cogsbox-state 0.5.304 → 0.5.305
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CogsState.jsx +413 -405
- package/dist/CogsState.jsx.map +1 -1
- package/package.json +1 -1
- package/src/CogsState.tsx +31 -16
package/dist/CogsState.jsx
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as yt } from "react/jsx-runtime";
|
|
3
|
-
import { useState as
|
|
4
|
-
import { transformStateFunc as
|
|
5
|
-
import { pushFunc as vt, updateFn as
|
|
6
|
-
import
|
|
3
|
+
import { useState as nt, useRef as q, useEffect as at, useLayoutEffect as dt, useMemo as It, createElement as st, useSyncExternalStore as Mt, startTransition as jt, useCallback as Et } from "react";
|
|
4
|
+
import { transformStateFunc as Ot, isDeepEqual as z, isFunction as Z, getNestedValue as B, getDifferences as pt, debounce as Rt } from "./utility.js";
|
|
5
|
+
import { pushFunc as vt, updateFn as ot, cutFunc as lt, ValidationWrapper as Ft, FormControlComponent as Ut } from "./Functions.jsx";
|
|
6
|
+
import Dt from "superjson";
|
|
7
7
|
import { v4 as wt } from "uuid";
|
|
8
8
|
import "zod";
|
|
9
9
|
import { getGlobalStore as o, formRefStore as Tt } from "./store.js";
|
|
10
10
|
import { useCogsConfig as Ct } from "./CogsStateClient.jsx";
|
|
11
|
-
import { applyPatch as
|
|
12
|
-
import
|
|
11
|
+
import { applyPatch as Wt } from "fast-json-patch";
|
|
12
|
+
import Gt from "react-use-measure";
|
|
13
13
|
function $t(t, c) {
|
|
14
14
|
const m = o.getState().getInitialOptions, f = o.getState().setInitialStateOptions, y = m(t) || {};
|
|
15
15
|
f(t, {
|
|
@@ -22,40 +22,40 @@ function kt({
|
|
|
22
22
|
options: c,
|
|
23
23
|
initialOptionsPart: m
|
|
24
24
|
}) {
|
|
25
|
-
const f =
|
|
26
|
-
let
|
|
25
|
+
const f = et(t) || {}, y = m[t] || {}, k = o.getState().setInitialStateOptions, p = { ...y, ...f };
|
|
26
|
+
let I = !1;
|
|
27
27
|
if (c)
|
|
28
28
|
for (const a in c)
|
|
29
|
-
|
|
30
|
-
!
|
|
31
|
-
|
|
29
|
+
p.hasOwnProperty(a) ? (a == "localStorage" && c[a] && p[a].key !== c[a]?.key && (I = !0, p[a] = c[a]), a == "initialState" && c[a] && p[a] !== c[a] && // Different references
|
|
30
|
+
!z(p[a], c[a]) && (I = !0, p[a] = c[a])) : (I = !0, p[a] = c[a]);
|
|
31
|
+
I && k(t, p);
|
|
32
32
|
}
|
|
33
|
-
function
|
|
33
|
+
function de(t, { formElements: c, validation: m }) {
|
|
34
34
|
return { initialState: t, formElements: c, validation: m };
|
|
35
35
|
}
|
|
36
|
-
const
|
|
36
|
+
const ue = (t, c) => {
|
|
37
37
|
let m = t;
|
|
38
|
-
const [f, y] =
|
|
39
|
-
(Object.keys(y).length > 0 || c && Object.keys(c).length > 0) && Object.keys(y).forEach((
|
|
40
|
-
y[
|
|
38
|
+
const [f, y] = Ot(m);
|
|
39
|
+
(Object.keys(y).length > 0 || c && Object.keys(c).length > 0) && Object.keys(y).forEach((I) => {
|
|
40
|
+
y[I] = y[I] || {}, y[I].formElements = {
|
|
41
41
|
...c?.formElements,
|
|
42
42
|
// Global defaults first
|
|
43
43
|
...c?.validation,
|
|
44
|
-
...y[
|
|
44
|
+
...y[I].formElements || {}
|
|
45
45
|
// State-specific overrides
|
|
46
|
-
},
|
|
46
|
+
}, et(I) || o.getState().setInitialStateOptions(I, y[I]);
|
|
47
47
|
}), o.getState().setInitialStates(f), o.getState().setCreatedState(f);
|
|
48
|
-
const
|
|
49
|
-
const [v] =
|
|
48
|
+
const k = (I, a) => {
|
|
49
|
+
const [v] = nt(a?.componentId ?? wt());
|
|
50
50
|
kt({
|
|
51
|
-
stateKey:
|
|
51
|
+
stateKey: I,
|
|
52
52
|
options: a,
|
|
53
53
|
initialOptionsPart: y
|
|
54
54
|
});
|
|
55
|
-
const n = o.getState().cogsStateStore[
|
|
55
|
+
const n = o.getState().cogsStateStore[I] || f[I], S = a?.modifyState ? a.modifyState(n) : n, [G, F] = Yt(
|
|
56
56
|
S,
|
|
57
57
|
{
|
|
58
|
-
stateKey:
|
|
58
|
+
stateKey: I,
|
|
59
59
|
syncUpdate: a?.syncUpdate,
|
|
60
60
|
componentId: v,
|
|
61
61
|
localStorage: a?.localStorage,
|
|
@@ -68,23 +68,23 @@ const de = (t, c) => {
|
|
|
68
68
|
serverState: a?.serverState
|
|
69
69
|
}
|
|
70
70
|
);
|
|
71
|
-
return
|
|
71
|
+
return F;
|
|
72
72
|
};
|
|
73
|
-
function
|
|
74
|
-
kt({ stateKey:
|
|
73
|
+
function p(I, a) {
|
|
74
|
+
kt({ stateKey: I, options: a, initialOptionsPart: y }), a.localStorage && Bt(I, a), St(I);
|
|
75
75
|
}
|
|
76
|
-
return { useCogsState:
|
|
76
|
+
return { useCogsState: k, setCogsOptions: p };
|
|
77
77
|
}, {
|
|
78
78
|
setUpdaterState: ut,
|
|
79
|
-
setState:
|
|
80
|
-
getInitialOptions:
|
|
79
|
+
setState: tt,
|
|
80
|
+
getInitialOptions: et,
|
|
81
81
|
getKeyState: Vt,
|
|
82
|
-
getValidationErrors:
|
|
83
|
-
setStateLog:
|
|
84
|
-
updateInitialStateGlobal:
|
|
85
|
-
addValidationError:
|
|
86
|
-
removeValidationError:
|
|
87
|
-
setServerSyncActions:
|
|
82
|
+
getValidationErrors: Lt,
|
|
83
|
+
setStateLog: Ht,
|
|
84
|
+
updateInitialStateGlobal: At,
|
|
85
|
+
addValidationError: zt,
|
|
86
|
+
removeValidationError: Y,
|
|
87
|
+
setServerSyncActions: qt
|
|
88
88
|
} = o.getState(), Nt = (t, c, m, f, y) => {
|
|
89
89
|
m?.log && console.log(
|
|
90
90
|
"saving to localstorage",
|
|
@@ -92,21 +92,21 @@ const de = (t, c) => {
|
|
|
92
92
|
m.localStorage?.key,
|
|
93
93
|
f
|
|
94
94
|
);
|
|
95
|
-
const
|
|
96
|
-
if (
|
|
97
|
-
const
|
|
98
|
-
let
|
|
95
|
+
const k = Z(m?.localStorage?.key) ? m.localStorage?.key(t) : m?.localStorage?.key;
|
|
96
|
+
if (k && f) {
|
|
97
|
+
const p = `${f}-${c}-${k}`;
|
|
98
|
+
let I;
|
|
99
99
|
try {
|
|
100
|
-
|
|
100
|
+
I = ft(p)?.lastSyncedWithServer;
|
|
101
101
|
} catch {
|
|
102
102
|
}
|
|
103
103
|
const a = {
|
|
104
104
|
state: t,
|
|
105
105
|
lastUpdated: Date.now(),
|
|
106
|
-
lastSyncedWithServer: y ??
|
|
107
|
-
}, v =
|
|
106
|
+
lastSyncedWithServer: y ?? I
|
|
107
|
+
}, v = Dt.serialize(a);
|
|
108
108
|
window.localStorage.setItem(
|
|
109
|
-
|
|
109
|
+
p,
|
|
110
110
|
JSON.stringify(v.json)
|
|
111
111
|
);
|
|
112
112
|
}
|
|
@@ -119,27 +119,27 @@ const de = (t, c) => {
|
|
|
119
119
|
return console.error("Error loading from localStorage:", c), null;
|
|
120
120
|
}
|
|
121
121
|
}, Bt = (t, c) => {
|
|
122
|
-
const m = o.getState().cogsStateStore[t], { sessionId: f } = Ct(), y =
|
|
122
|
+
const m = o.getState().cogsStateStore[t], { sessionId: f } = Ct(), y = Z(c?.localStorage?.key) ? c.localStorage.key(m) : c?.localStorage?.key;
|
|
123
123
|
if (y && f) {
|
|
124
|
-
const
|
|
124
|
+
const k = ft(
|
|
125
125
|
`${f}-${t}-${y}`
|
|
126
126
|
);
|
|
127
|
-
if (
|
|
128
|
-
return
|
|
127
|
+
if (k && k.lastUpdated > (k.lastSyncedWithServer || 0))
|
|
128
|
+
return tt(t, k.state), St(t), !0;
|
|
129
129
|
}
|
|
130
130
|
return !1;
|
|
131
|
-
}, xt = (t, c, m, f, y,
|
|
132
|
-
const
|
|
131
|
+
}, xt = (t, c, m, f, y, k) => {
|
|
132
|
+
const p = {
|
|
133
133
|
initialState: c,
|
|
134
134
|
updaterState: gt(
|
|
135
135
|
t,
|
|
136
136
|
f,
|
|
137
137
|
y,
|
|
138
|
-
|
|
138
|
+
k
|
|
139
139
|
),
|
|
140
140
|
state: m
|
|
141
141
|
};
|
|
142
|
-
|
|
142
|
+
At(t, p.initialState), ut(t, p.updaterState), tt(t, p.state);
|
|
143
143
|
}, St = (t) => {
|
|
144
144
|
const c = o.getState().stateComponents.get(t);
|
|
145
145
|
if (!c) return;
|
|
@@ -149,7 +149,7 @@ const de = (t, c) => {
|
|
|
149
149
|
}), queueMicrotask(() => {
|
|
150
150
|
m.forEach((f) => f());
|
|
151
151
|
});
|
|
152
|
-
},
|
|
152
|
+
}, ge = (t, c) => {
|
|
153
153
|
const m = o.getState().stateComponents.get(t);
|
|
154
154
|
if (m) {
|
|
155
155
|
const f = `${t}////${c}`, y = m.components.get(f);
|
|
@@ -157,22 +157,22 @@ const de = (t, c) => {
|
|
|
157
157
|
return;
|
|
158
158
|
y && y.forceUpdate();
|
|
159
159
|
}
|
|
160
|
-
},
|
|
160
|
+
}, Jt = (t, c, m, f) => {
|
|
161
161
|
switch (t) {
|
|
162
162
|
case "update":
|
|
163
163
|
return {
|
|
164
|
-
oldValue:
|
|
165
|
-
newValue:
|
|
164
|
+
oldValue: B(c, f),
|
|
165
|
+
newValue: B(m, f)
|
|
166
166
|
};
|
|
167
167
|
case "insert":
|
|
168
168
|
return {
|
|
169
169
|
oldValue: null,
|
|
170
170
|
// or undefined
|
|
171
|
-
newValue:
|
|
171
|
+
newValue: B(m, f)
|
|
172
172
|
};
|
|
173
173
|
case "cut":
|
|
174
174
|
return {
|
|
175
|
-
oldValue:
|
|
175
|
+
oldValue: B(c, f),
|
|
176
176
|
newValue: null
|
|
177
177
|
// or undefined
|
|
178
178
|
};
|
|
@@ -180,27 +180,27 @@ const de = (t, c) => {
|
|
|
180
180
|
return { oldValue: null, newValue: null };
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
|
-
function
|
|
183
|
+
function Yt(t, {
|
|
184
184
|
stateKey: c,
|
|
185
185
|
serverSync: m,
|
|
186
186
|
localStorage: f,
|
|
187
187
|
formElements: y,
|
|
188
|
-
reactiveDeps:
|
|
189
|
-
reactiveType:
|
|
190
|
-
componentId:
|
|
188
|
+
reactiveDeps: k,
|
|
189
|
+
reactiveType: p,
|
|
190
|
+
componentId: I,
|
|
191
191
|
initialState: a,
|
|
192
192
|
syncUpdate: v,
|
|
193
193
|
dependencies: n,
|
|
194
194
|
serverState: S
|
|
195
195
|
} = {}) {
|
|
196
|
-
const [G,
|
|
196
|
+
const [G, F] = nt({}), { sessionId: U } = Ct();
|
|
197
197
|
let L = !c;
|
|
198
|
-
const [h] =
|
|
198
|
+
const [h] = nt(c ?? wt()), l = o.getState().stateLog[h], it = q(/* @__PURE__ */ new Set()), X = q(I ?? wt()), j = q(
|
|
199
199
|
null
|
|
200
200
|
);
|
|
201
|
-
j.current =
|
|
201
|
+
j.current = et(h) ?? null, at(() => {
|
|
202
202
|
if (v && v.stateKey === h && v.path?.[0]) {
|
|
203
|
-
|
|
203
|
+
tt(h, (r) => ({
|
|
204
204
|
...r,
|
|
205
205
|
[v.path[0]]: v.newValue
|
|
206
206
|
}));
|
|
@@ -210,27 +210,27 @@ function Jt(t, {
|
|
|
210
210
|
userId: v.userId
|
|
211
211
|
});
|
|
212
212
|
}
|
|
213
|
-
}, [v]),
|
|
213
|
+
}, [v]), at(() => {
|
|
214
214
|
if (a) {
|
|
215
215
|
$t(h, {
|
|
216
216
|
initialState: a
|
|
217
217
|
});
|
|
218
218
|
const e = j.current, s = e?.serverState?.id !== void 0 && e?.serverState?.status === "success" && e?.serverState?.data, i = o.getState().initialStateGlobal[h];
|
|
219
|
-
if (!(i && !
|
|
219
|
+
if (!(i && !z(i, a) || !i) && !s)
|
|
220
220
|
return;
|
|
221
|
-
let
|
|
222
|
-
const A =
|
|
223
|
-
A &&
|
|
224
|
-
let
|
|
225
|
-
const
|
|
226
|
-
s &&
|
|
221
|
+
let u = null;
|
|
222
|
+
const A = Z(e?.localStorage?.key) ? e?.localStorage?.key(a) : e?.localStorage?.key;
|
|
223
|
+
A && U && (u = ft(`${U}-${h}-${A}`));
|
|
224
|
+
let w = a, T = !1;
|
|
225
|
+
const P = s ? Date.now() : 0, x = u?.lastUpdated || 0, M = u?.lastSyncedWithServer || 0;
|
|
226
|
+
s && P > x ? (w = e.serverState.data, T = !0) : u && x > M && (w = u.state, e?.localStorage?.onChange && e?.localStorage?.onChange(w)), o.getState().initializeShadowState(h, a), xt(
|
|
227
227
|
h,
|
|
228
228
|
a,
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
), T && A &&
|
|
229
|
+
w,
|
|
230
|
+
rt,
|
|
231
|
+
X.current,
|
|
232
|
+
U
|
|
233
|
+
), T && A && U && Nt(w, h, e, U, Date.now()), St(h), (Array.isArray(p) ? p : [p || "component"]).includes("none") || F({});
|
|
234
234
|
}
|
|
235
235
|
}, [
|
|
236
236
|
a,
|
|
@@ -245,170 +245,170 @@ function Jt(t, {
|
|
|
245
245
|
localStorage: f,
|
|
246
246
|
middleware: j.current?.middleware
|
|
247
247
|
});
|
|
248
|
-
const e = `${h}////${
|
|
248
|
+
const e = `${h}////${X.current}`, r = o.getState().stateComponents.get(h) || {
|
|
249
249
|
components: /* @__PURE__ */ new Map()
|
|
250
250
|
};
|
|
251
251
|
return r.components.set(e, {
|
|
252
|
-
forceUpdate: () =>
|
|
252
|
+
forceUpdate: () => F({}),
|
|
253
253
|
paths: /* @__PURE__ */ new Set(),
|
|
254
254
|
deps: [],
|
|
255
|
-
depsFunction:
|
|
256
|
-
reactiveType:
|
|
257
|
-
}), o.getState().stateComponents.set(h, r),
|
|
255
|
+
depsFunction: k || void 0,
|
|
256
|
+
reactiveType: p ?? ["component", "deps"]
|
|
257
|
+
}), o.getState().stateComponents.set(h, r), F({}), () => {
|
|
258
258
|
r && (r.components.delete(e), r.components.size === 0 && o.getState().stateComponents.delete(h));
|
|
259
259
|
};
|
|
260
260
|
}, []);
|
|
261
|
-
const
|
|
261
|
+
const rt = (e, r, s, i) => {
|
|
262
262
|
if (Array.isArray(r)) {
|
|
263
|
-
const
|
|
264
|
-
|
|
263
|
+
const u = `${h}-${r.join(".")}`;
|
|
264
|
+
it.current.add(u);
|
|
265
265
|
}
|
|
266
|
-
const
|
|
267
|
-
|
|
268
|
-
const A =
|
|
269
|
-
if (
|
|
270
|
-
let
|
|
266
|
+
const g = o.getState();
|
|
267
|
+
tt(h, (u) => {
|
|
268
|
+
const A = Z(e) ? e(u) : e, w = `${h}-${r.join(".")}`;
|
|
269
|
+
if (w) {
|
|
270
|
+
let b = !1, N = g.signalDomElements.get(w);
|
|
271
271
|
if ((!N || N.size === 0) && (s.updateType === "insert" || s.updateType === "cut")) {
|
|
272
|
-
const O = r.slice(0, -1),
|
|
273
|
-
if (Array.isArray(
|
|
274
|
-
|
|
275
|
-
const
|
|
276
|
-
N =
|
|
272
|
+
const O = r.slice(0, -1), W = B(A, O);
|
|
273
|
+
if (Array.isArray(W)) {
|
|
274
|
+
b = !0;
|
|
275
|
+
const $ = `${h}-${O.join(".")}`;
|
|
276
|
+
N = g.signalDomElements.get($);
|
|
277
277
|
}
|
|
278
278
|
}
|
|
279
279
|
if (N) {
|
|
280
|
-
const O =
|
|
281
|
-
N.forEach(({ parentId:
|
|
282
|
-
const
|
|
283
|
-
`[data-parent-id="${
|
|
280
|
+
const O = b ? B(A, r.slice(0, -1)) : B(A, r);
|
|
281
|
+
N.forEach(({ parentId: W, position: $, effect: E }) => {
|
|
282
|
+
const C = document.querySelector(
|
|
283
|
+
`[data-parent-id="${W}"]`
|
|
284
284
|
);
|
|
285
|
-
if (
|
|
286
|
-
const
|
|
287
|
-
if (
|
|
288
|
-
const
|
|
289
|
-
|
|
285
|
+
if (C) {
|
|
286
|
+
const R = Array.from(C.childNodes);
|
|
287
|
+
if (R[$]) {
|
|
288
|
+
const _ = E ? new Function("state", `return (${E})(state)`)(O) : O;
|
|
289
|
+
R[$].textContent = String(_);
|
|
290
290
|
}
|
|
291
291
|
}
|
|
292
292
|
});
|
|
293
293
|
}
|
|
294
294
|
}
|
|
295
|
-
console.log("shadowState",
|
|
295
|
+
console.log("shadowState", g.shadowStateStore), s.updateType === "update" && (i || j.current?.validation?.key) && r && Y(
|
|
296
296
|
(i || j.current?.validation?.key) + "." + r.join(".")
|
|
297
297
|
);
|
|
298
298
|
const T = r.slice(0, r.length - 1);
|
|
299
|
-
s.updateType === "cut" && j.current?.validation?.key &&
|
|
299
|
+
s.updateType === "cut" && j.current?.validation?.key && Y(
|
|
300
300
|
j.current?.validation?.key + "." + T.join(".")
|
|
301
|
-
), s.updateType === "insert" && j.current?.validation?.key &&
|
|
301
|
+
), s.updateType === "insert" && j.current?.validation?.key && Lt(
|
|
302
302
|
j.current?.validation?.key + "." + T.join(".")
|
|
303
303
|
).filter(([N, O]) => {
|
|
304
|
-
let
|
|
305
|
-
if (N == T.join(".") &&
|
|
306
|
-
let
|
|
307
|
-
|
|
304
|
+
let W = N?.split(".").length;
|
|
305
|
+
if (N == T.join(".") && W == T.length - 1) {
|
|
306
|
+
let $ = N + "." + T;
|
|
307
|
+
Y(N), zt($, O);
|
|
308
308
|
}
|
|
309
309
|
});
|
|
310
|
-
const
|
|
311
|
-
if (console.log("stateEntry >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>",
|
|
312
|
-
const
|
|
310
|
+
const P = g.stateComponents.get(h);
|
|
311
|
+
if (console.log("stateEntry >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>", P), P) {
|
|
312
|
+
const b = pt(u, A), N = new Set(b), O = s.updateType === "update" ? r.join(".") : r.slice(0, -1).join(".") || "";
|
|
313
313
|
for (const [
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
] of
|
|
317
|
-
let
|
|
318
|
-
const
|
|
319
|
-
if (console.log("component",
|
|
320
|
-
if (
|
|
321
|
-
|
|
314
|
+
W,
|
|
315
|
+
$
|
|
316
|
+
] of P.components.entries()) {
|
|
317
|
+
let E = !1;
|
|
318
|
+
const C = Array.isArray($.reactiveType) ? $.reactiveType : [$.reactiveType || "component"];
|
|
319
|
+
if (console.log("component", $), !C.includes("none")) {
|
|
320
|
+
if (C.includes("all")) {
|
|
321
|
+
$.forceUpdate();
|
|
322
322
|
continue;
|
|
323
323
|
}
|
|
324
|
-
if (
|
|
325
|
-
for (const
|
|
326
|
-
let
|
|
324
|
+
if (C.includes("component") && (($.paths.has(O) || $.paths.has("")) && (E = !0), !E))
|
|
325
|
+
for (const R of N) {
|
|
326
|
+
let _ = R;
|
|
327
327
|
for (; ; ) {
|
|
328
|
-
if (
|
|
329
|
-
|
|
328
|
+
if ($.paths.has(_)) {
|
|
329
|
+
E = !0;
|
|
330
330
|
break;
|
|
331
331
|
}
|
|
332
|
-
const
|
|
333
|
-
if (
|
|
334
|
-
const
|
|
332
|
+
const D = _.lastIndexOf(".");
|
|
333
|
+
if (D !== -1) {
|
|
334
|
+
const H = _.substring(
|
|
335
335
|
0,
|
|
336
|
-
|
|
336
|
+
D
|
|
337
337
|
);
|
|
338
338
|
if (!isNaN(
|
|
339
|
-
Number(
|
|
340
|
-
) &&
|
|
341
|
-
|
|
339
|
+
Number(_.substring(D + 1))
|
|
340
|
+
) && $.paths.has(H)) {
|
|
341
|
+
E = !0;
|
|
342
342
|
break;
|
|
343
343
|
}
|
|
344
|
-
|
|
344
|
+
_ = H;
|
|
345
345
|
} else
|
|
346
|
-
|
|
347
|
-
if (
|
|
346
|
+
_ = "";
|
|
347
|
+
if (_ === "")
|
|
348
348
|
break;
|
|
349
349
|
}
|
|
350
|
-
if (
|
|
350
|
+
if (E) break;
|
|
351
351
|
}
|
|
352
|
-
if (!
|
|
353
|
-
const
|
|
354
|
-
let
|
|
355
|
-
typeof
|
|
352
|
+
if (!E && C.includes("deps") && $.depsFunction) {
|
|
353
|
+
const R = $.depsFunction(A);
|
|
354
|
+
let _ = !1;
|
|
355
|
+
typeof R == "boolean" ? R && (_ = !0) : z($.deps, R) || ($.deps = R, _ = !0), _ && (E = !0);
|
|
356
356
|
}
|
|
357
|
-
|
|
357
|
+
E && $.forceUpdate();
|
|
358
358
|
}
|
|
359
359
|
}
|
|
360
360
|
}
|
|
361
|
-
const
|
|
362
|
-
r = r.map((
|
|
363
|
-
const O = r.slice(0, -1),
|
|
364
|
-
return N === r.length - 1 && ["insert", "cut"].includes(s.updateType) ? (
|
|
361
|
+
const x = Date.now();
|
|
362
|
+
r = r.map((b, N) => {
|
|
363
|
+
const O = r.slice(0, -1), W = B(A, O);
|
|
364
|
+
return N === r.length - 1 && ["insert", "cut"].includes(s.updateType) ? (W.length - 1).toString() : b;
|
|
365
365
|
});
|
|
366
|
-
const { oldValue:
|
|
366
|
+
const { oldValue: M, newValue: V } = Jt(
|
|
367
367
|
s.updateType,
|
|
368
|
-
|
|
368
|
+
u,
|
|
369
369
|
A,
|
|
370
370
|
r
|
|
371
|
-
),
|
|
372
|
-
timeStamp:
|
|
371
|
+
), J = {
|
|
372
|
+
timeStamp: x,
|
|
373
373
|
stateKey: h,
|
|
374
374
|
path: r,
|
|
375
375
|
updateType: s.updateType,
|
|
376
376
|
status: "new",
|
|
377
|
-
oldValue:
|
|
378
|
-
newValue:
|
|
377
|
+
oldValue: M,
|
|
378
|
+
newValue: V
|
|
379
379
|
};
|
|
380
380
|
switch (s.updateType) {
|
|
381
381
|
case "update":
|
|
382
|
-
|
|
382
|
+
g.updateShadowAtPath(h, r, A);
|
|
383
383
|
break;
|
|
384
384
|
case "insert":
|
|
385
|
-
const
|
|
386
|
-
|
|
385
|
+
const b = r.slice(0, -1);
|
|
386
|
+
g.insertShadowArrayElement(h, b, V);
|
|
387
387
|
break;
|
|
388
388
|
case "cut":
|
|
389
389
|
const N = r.slice(0, -1), O = parseInt(r[r.length - 1]);
|
|
390
|
-
|
|
390
|
+
g.removeShadowArrayElement(h, N, O);
|
|
391
391
|
break;
|
|
392
392
|
}
|
|
393
|
-
if (
|
|
394
|
-
const O = [...
|
|
395
|
-
const
|
|
396
|
-
return
|
|
393
|
+
if (Ht(h, (b) => {
|
|
394
|
+
const O = [...b ?? [], J].reduce((W, $) => {
|
|
395
|
+
const E = `${$.stateKey}:${JSON.stringify($.path)}`, C = W.get(E);
|
|
396
|
+
return C ? (C.timeStamp = Math.max(C.timeStamp, $.timeStamp), C.newValue = $.newValue, C.oldValue = C.oldValue ?? $.oldValue, C.updateType = $.updateType) : W.set(E, { ...$ }), W;
|
|
397
397
|
}, /* @__PURE__ */ new Map());
|
|
398
398
|
return Array.from(O.values());
|
|
399
399
|
}), Nt(
|
|
400
400
|
A,
|
|
401
401
|
h,
|
|
402
402
|
j.current,
|
|
403
|
-
|
|
403
|
+
U
|
|
404
404
|
), j.current?.middleware && j.current.middleware({
|
|
405
405
|
updateLog: l,
|
|
406
|
-
update:
|
|
406
|
+
update: J
|
|
407
407
|
}), j.current?.serverSync) {
|
|
408
|
-
const
|
|
409
|
-
|
|
408
|
+
const b = g.serverState[h], N = j.current?.serverSync;
|
|
409
|
+
qt(h, {
|
|
410
410
|
syncKey: typeof N.syncKey == "string" ? N.syncKey : N.syncKey({ state: A }),
|
|
411
|
-
rollBackState:
|
|
411
|
+
rollBackState: b,
|
|
412
412
|
actionTimeStamp: Date.now() + (N.debounce ?? 3e3),
|
|
413
413
|
status: "waiting"
|
|
414
414
|
});
|
|
@@ -420,53 +420,53 @@ function Jt(t, {
|
|
|
420
420
|
h,
|
|
421
421
|
gt(
|
|
422
422
|
h,
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
423
|
+
rt,
|
|
424
|
+
X.current,
|
|
425
|
+
U
|
|
426
426
|
)
|
|
427
|
-
), o.getState().cogsStateStore[h] ||
|
|
427
|
+
), o.getState().cogsStateStore[h] || tt(h, t), o.getState().initialStateGlobal[h] || At(h, t));
|
|
428
428
|
const d = It(() => gt(
|
|
429
429
|
h,
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
), [h,
|
|
430
|
+
rt,
|
|
431
|
+
X.current,
|
|
432
|
+
U
|
|
433
|
+
), [h, U]);
|
|
434
434
|
return [Vt(h), d];
|
|
435
435
|
}
|
|
436
436
|
function gt(t, c, m, f) {
|
|
437
437
|
const y = /* @__PURE__ */ new Map();
|
|
438
|
-
let
|
|
439
|
-
const
|
|
438
|
+
let k = 0;
|
|
439
|
+
const p = (v) => {
|
|
440
440
|
const n = v.join(".");
|
|
441
441
|
for (const [S] of y)
|
|
442
442
|
(S === n || S.startsWith(n + ".")) && y.delete(S);
|
|
443
|
-
|
|
444
|
-
},
|
|
443
|
+
k++;
|
|
444
|
+
}, I = {
|
|
445
445
|
removeValidation: (v) => {
|
|
446
|
-
v?.validationKey &&
|
|
446
|
+
v?.validationKey && Y(v.validationKey);
|
|
447
447
|
},
|
|
448
448
|
revertToInitialState: (v) => {
|
|
449
449
|
const n = o.getState().getInitialOptions(t)?.validation;
|
|
450
|
-
n?.key &&
|
|
450
|
+
n?.key && Y(n?.key), v?.validationKey && Y(v.validationKey);
|
|
451
451
|
const S = o.getState().initialStateGlobal[t];
|
|
452
|
-
o.getState().clearSelectedIndexesForState(t), y.clear(),
|
|
453
|
-
const G = a(S, []),
|
|
454
|
-
L && localStorage.removeItem(L), ut(t, G),
|
|
452
|
+
o.getState().clearSelectedIndexesForState(t), y.clear(), k++;
|
|
453
|
+
const G = a(S, []), F = et(t), U = Z(F?.localStorage?.key) ? F?.localStorage?.key(S) : F?.localStorage?.key, L = `${f}-${t}-${U}`;
|
|
454
|
+
L && localStorage.removeItem(L), ut(t, G), tt(t, S);
|
|
455
455
|
const h = o.getState().stateComponents.get(t);
|
|
456
456
|
return h && h.components.forEach((l) => {
|
|
457
457
|
l.forceUpdate();
|
|
458
458
|
}), S;
|
|
459
459
|
},
|
|
460
460
|
updateInitialState: (v) => {
|
|
461
|
-
y.clear(),
|
|
461
|
+
y.clear(), k++;
|
|
462
462
|
const n = gt(
|
|
463
463
|
t,
|
|
464
464
|
c,
|
|
465
465
|
m,
|
|
466
466
|
f
|
|
467
|
-
), S = o.getState().initialStateGlobal[t], G =
|
|
468
|
-
return localStorage.getItem(
|
|
469
|
-
|
|
467
|
+
), S = o.getState().initialStateGlobal[t], G = et(t), F = Z(G?.localStorage?.key) ? G?.localStorage?.key(S) : G?.localStorage?.key, U = `${f}-${t}-${F}`;
|
|
468
|
+
return localStorage.getItem(U) && localStorage.removeItem(U), jt(() => {
|
|
469
|
+
At(t, v), o.getState().initializeShadowState(t, v), ut(t, n), tt(t, v);
|
|
470
470
|
const L = o.getState().stateComponents.get(t);
|
|
471
471
|
L && L.components.forEach((h) => {
|
|
472
472
|
h.forceUpdate();
|
|
@@ -480,27 +480,27 @@ function gt(t, c, m, f) {
|
|
|
480
480
|
_isLoading: o.getState().isLoadingGlobal[t],
|
|
481
481
|
_isServerSynced: () => {
|
|
482
482
|
const v = o.getState().serverState[t];
|
|
483
|
-
return !!(v &&
|
|
483
|
+
return !!(v && z(v, Vt(t)));
|
|
484
484
|
}
|
|
485
485
|
};
|
|
486
486
|
function a(v, n = [], S) {
|
|
487
487
|
const G = n.map(String).join(".");
|
|
488
488
|
y.get(G);
|
|
489
|
-
const
|
|
489
|
+
const F = function() {
|
|
490
490
|
return o().getNestedState(t, n);
|
|
491
491
|
};
|
|
492
|
-
Object.keys(
|
|
493
|
-
|
|
492
|
+
Object.keys(I).forEach((h) => {
|
|
493
|
+
F[h] = I[h];
|
|
494
494
|
});
|
|
495
|
-
const
|
|
496
|
-
apply(h, l,
|
|
495
|
+
const U = {
|
|
496
|
+
apply(h, l, it) {
|
|
497
497
|
return console.log(
|
|
498
498
|
`PROXY APPLY TRAP HIT: stateKey=${t}, path=${n.join(".")}`
|
|
499
499
|
), console.trace("Apply trap stack trace"), o().getNestedState(t, n);
|
|
500
500
|
},
|
|
501
501
|
get(h, l) {
|
|
502
502
|
S?.validIndices && !Array.isArray(v) && (S = { ...S, validIndices: void 0 });
|
|
503
|
-
const
|
|
503
|
+
const it = /* @__PURE__ */ new Set([
|
|
504
504
|
"insert",
|
|
505
505
|
"cut",
|
|
506
506
|
"cutByValue",
|
|
@@ -523,15 +523,15 @@ function gt(t, c, m, f) {
|
|
|
523
523
|
"_stateKey",
|
|
524
524
|
"getComponents"
|
|
525
525
|
]);
|
|
526
|
-
if (l !== "then" && !l.startsWith("$") && l !== "stateMapNoRender" && !
|
|
526
|
+
if (l !== "then" && !l.startsWith("$") && l !== "stateMapNoRender" && !it.has(l)) {
|
|
527
527
|
const d = `${t}////${m}`, e = o.getState().stateComponents.get(t);
|
|
528
528
|
if (e) {
|
|
529
529
|
const r = e.components.get(d);
|
|
530
530
|
if (r && !r.paths.has("")) {
|
|
531
531
|
const s = n.join(".");
|
|
532
532
|
let i = !0;
|
|
533
|
-
for (const
|
|
534
|
-
if (s.startsWith(
|
|
533
|
+
for (const g of r.paths)
|
|
534
|
+
if (s.startsWith(g) && (s === g || s[g.length] === ".")) {
|
|
535
535
|
i = !1;
|
|
536
536
|
break;
|
|
537
537
|
}
|
|
@@ -553,13 +553,13 @@ function gt(t, c, m, f) {
|
|
|
553
553
|
try {
|
|
554
554
|
const i = await e.action(r);
|
|
555
555
|
if (i && !i.success && i.errors && s) {
|
|
556
|
-
o.getState().removeValidationError(s), i.errors.forEach((
|
|
557
|
-
const A = [s, ...
|
|
558
|
-
o.getState().addValidationError(A,
|
|
556
|
+
o.getState().removeValidationError(s), i.errors.forEach((u) => {
|
|
557
|
+
const A = [s, ...u.path].join(".");
|
|
558
|
+
o.getState().addValidationError(A, u.message);
|
|
559
559
|
});
|
|
560
|
-
const
|
|
561
|
-
|
|
562
|
-
|
|
560
|
+
const g = o.getState().stateComponents.get(t);
|
|
561
|
+
g && g.components.forEach((u) => {
|
|
562
|
+
u.forceUpdate();
|
|
563
563
|
});
|
|
564
564
|
}
|
|
565
565
|
return i?.success && e.onSuccess ? e.onSuccess(i.data) : !i?.success && e.onError && e.onError(i.error), i;
|
|
@@ -568,20 +568,20 @@ function gt(t, c, m, f) {
|
|
|
568
568
|
}
|
|
569
569
|
};
|
|
570
570
|
if (l === "_status") {
|
|
571
|
-
const d = o.getState().getNestedState(t, n), e = o.getState().initialStateGlobal[t], r =
|
|
572
|
-
return
|
|
571
|
+
const d = o.getState().getNestedState(t, n), e = o.getState().initialStateGlobal[t], r = B(e, n);
|
|
572
|
+
return z(d, r) ? "fresh" : "stale";
|
|
573
573
|
}
|
|
574
574
|
if (l === "getStatus")
|
|
575
575
|
return function() {
|
|
576
576
|
const d = o().getNestedState(
|
|
577
577
|
t,
|
|
578
578
|
n
|
|
579
|
-
), e = o.getState().initialStateGlobal[t], r =
|
|
580
|
-
return
|
|
579
|
+
), e = o.getState().initialStateGlobal[t], r = B(e, n);
|
|
580
|
+
return z(d, r) ? "fresh" : "stale";
|
|
581
581
|
};
|
|
582
582
|
if (l === "removeStorage")
|
|
583
583
|
return () => {
|
|
584
|
-
const d = o.getState().initialStateGlobal[t], e =
|
|
584
|
+
const d = o.getState().initialStateGlobal[t], e = et(t), r = Z(e?.localStorage?.key) ? e?.localStorage?.key(d) : e?.localStorage?.key, s = `${f}-${t}-${r}`;
|
|
585
585
|
s && localStorage.removeItem(s);
|
|
586
586
|
};
|
|
587
587
|
if (l === "showValidationErrors")
|
|
@@ -621,152 +621,160 @@ function gt(t, c, m, f) {
|
|
|
621
621
|
itemHeight: r = 50,
|
|
622
622
|
overscan: s = 5,
|
|
623
623
|
stickToBottom: i = !1
|
|
624
|
-
} = e,
|
|
624
|
+
} = e, g = q(null), [u, A] = nt({
|
|
625
625
|
startIndex: 0,
|
|
626
626
|
endIndex: 10
|
|
627
|
-
}),
|
|
627
|
+
}), w = q(i), T = q(0), P = q(!0), x = q(!1), M = o().getNestedState(
|
|
628
628
|
t,
|
|
629
629
|
n
|
|
630
|
-
),
|
|
631
|
-
const
|
|
630
|
+
), V = M.length, { totalHeight: J, positions: b } = It(() => {
|
|
631
|
+
const E = o.getState().getShadowMetadata(t, n) || [];
|
|
632
632
|
let C = 0;
|
|
633
|
-
const
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
633
|
+
const R = [];
|
|
634
|
+
let _ = !1;
|
|
635
|
+
for (let D = 0; D < V; D++) {
|
|
636
|
+
R[D] = C;
|
|
637
|
+
const H = E[D]?.virtualizer?.itemHeight;
|
|
638
|
+
H && (_ = !0), C += H || r;
|
|
638
639
|
}
|
|
639
|
-
return { totalHeight: C, positions:
|
|
640
|
-
}, [
|
|
641
|
-
const
|
|
642
|
-
{ length: C -
|
|
643
|
-
(
|
|
644
|
-
), _ =
|
|
640
|
+
return x.current = _, { totalHeight: C, positions: R };
|
|
641
|
+
}, [V, t, n.join("."), r]), N = It(() => {
|
|
642
|
+
const E = Math.max(0, u.startIndex), C = Math.min(V, u.endIndex), R = Array.from(
|
|
643
|
+
{ length: C - E },
|
|
644
|
+
(D, H) => E + H
|
|
645
|
+
), _ = R.map((D) => M[D]);
|
|
645
646
|
return a(_, n, {
|
|
646
647
|
...S,
|
|
647
|
-
validIndices:
|
|
648
|
+
validIndices: R
|
|
648
649
|
});
|
|
649
|
-
}, [
|
|
650
|
+
}, [u.startIndex, u.endIndex, M, V]);
|
|
650
651
|
dt(() => {
|
|
651
|
-
const
|
|
652
|
-
if (!
|
|
653
|
-
const C =
|
|
654
|
-
T.current =
|
|
652
|
+
const E = g.current;
|
|
653
|
+
if (!E) return;
|
|
654
|
+
const C = w.current, R = V > T.current;
|
|
655
|
+
T.current = V;
|
|
655
656
|
const _ = () => {
|
|
656
|
-
const { scrollTop:
|
|
657
|
-
|
|
658
|
-
let mt = 0,
|
|
659
|
-
for (; mt <=
|
|
660
|
-
const
|
|
661
|
-
|
|
657
|
+
const { scrollTop: D, clientHeight: H, scrollHeight: Pt } = E;
|
|
658
|
+
w.current = Pt - D - H < 10;
|
|
659
|
+
let mt = 0, ct = V - 1;
|
|
660
|
+
for (; mt <= ct; ) {
|
|
661
|
+
const K = Math.floor((mt + ct) / 2);
|
|
662
|
+
b[K] < D ? mt = K + 1 : ct = K - 1;
|
|
662
663
|
}
|
|
663
|
-
const ht = Math.max(0,
|
|
664
|
-
let
|
|
665
|
-
const
|
|
666
|
-
for (;
|
|
667
|
-
|
|
668
|
-
|
|
664
|
+
const ht = Math.max(0, ct - s);
|
|
665
|
+
let Q = ht;
|
|
666
|
+
const _t = D + H;
|
|
667
|
+
for (; Q < V && b[Q] < _t; )
|
|
668
|
+
Q++;
|
|
669
|
+
Q = Math.min(V, Q + s), A((K) => K.startIndex !== ht || K.endIndex !== Q ? { startIndex: ht, endIndex: Q } : K);
|
|
669
670
|
};
|
|
670
|
-
return
|
|
671
|
+
return E.addEventListener("scroll", _, {
|
|
671
672
|
passive: !0
|
|
672
|
-
}), i
|
|
673
|
-
|
|
674
|
-
top:
|
|
675
|
-
behavior: "auto"
|
|
676
|
-
});
|
|
677
|
-
}, 0), x.current = !1) : C && V && requestAnimationFrame(() => {
|
|
678
|
-
I.scrollTo({
|
|
679
|
-
top: I.scrollHeight,
|
|
673
|
+
}), i && !P.current && C && R && requestAnimationFrame(() => {
|
|
674
|
+
E.scrollTo({
|
|
675
|
+
top: E.scrollHeight,
|
|
680
676
|
behavior: "smooth"
|
|
681
677
|
});
|
|
682
|
-
})
|
|
683
|
-
}, [
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
678
|
+
}), _(), () => E.removeEventListener("scroll", _);
|
|
679
|
+
}, [V, b, s, i]), at(() => {
|
|
680
|
+
if (i && P.current && V > 0 && x.current) {
|
|
681
|
+
const E = g.current;
|
|
682
|
+
E && requestAnimationFrame(() => {
|
|
683
|
+
requestAnimationFrame(() => {
|
|
684
|
+
E.scrollTo({
|
|
685
|
+
top: E.scrollHeight,
|
|
686
|
+
behavior: "auto"
|
|
687
|
+
}), P.current = !1;
|
|
688
|
+
});
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
}, [i, V, b]);
|
|
692
|
+
const O = Et(
|
|
693
|
+
(E = "smooth") => {
|
|
694
|
+
g.current && g.current.scrollTo({
|
|
695
|
+
top: g.current.scrollHeight,
|
|
696
|
+
behavior: E
|
|
689
697
|
});
|
|
690
698
|
},
|
|
691
699
|
[]
|
|
692
|
-
),
|
|
693
|
-
(
|
|
694
|
-
|
|
695
|
-
top:
|
|
700
|
+
), W = Et(
|
|
701
|
+
(E, C = "smooth") => {
|
|
702
|
+
g.current && b[E] !== void 0 && g.current.scrollTo({
|
|
703
|
+
top: b[E],
|
|
696
704
|
behavior: C
|
|
697
705
|
});
|
|
698
706
|
},
|
|
699
|
-
[
|
|
700
|
-
),
|
|
707
|
+
[b]
|
|
708
|
+
), $ = {
|
|
701
709
|
outer: {
|
|
702
|
-
ref:
|
|
710
|
+
ref: g,
|
|
703
711
|
style: { overflowY: "auto", height: "100%" }
|
|
704
712
|
},
|
|
705
713
|
inner: {
|
|
706
714
|
style: {
|
|
707
|
-
height: `${
|
|
715
|
+
height: `${J}px`,
|
|
708
716
|
position: "relative"
|
|
709
717
|
}
|
|
710
718
|
},
|
|
711
719
|
list: {
|
|
712
720
|
style: {
|
|
713
|
-
transform: `translateY(${
|
|
721
|
+
transform: `translateY(${b[u.startIndex] || 0}px)`
|
|
714
722
|
}
|
|
715
723
|
}
|
|
716
724
|
};
|
|
717
725
|
return {
|
|
718
|
-
virtualState:
|
|
719
|
-
virtualizerProps:
|
|
720
|
-
scrollToBottom:
|
|
721
|
-
scrollToIndex:
|
|
726
|
+
virtualState: N,
|
|
727
|
+
virtualizerProps: $,
|
|
728
|
+
scrollToBottom: O,
|
|
729
|
+
scrollToIndex: W
|
|
722
730
|
};
|
|
723
731
|
};
|
|
724
732
|
if (l === "stateSort")
|
|
725
733
|
return (e) => {
|
|
726
734
|
const s = [...d()].sort(
|
|
727
|
-
(
|
|
728
|
-
), i = s.map(({ item:
|
|
735
|
+
(u, A) => e(u.item, A.item)
|
|
736
|
+
), i = s.map(({ item: u }) => u), g = {
|
|
729
737
|
...S,
|
|
730
738
|
validIndices: s.map(
|
|
731
|
-
({ originalIndex:
|
|
739
|
+
({ originalIndex: u }) => u
|
|
732
740
|
)
|
|
733
741
|
};
|
|
734
|
-
return a(i, n,
|
|
742
|
+
return a(i, n, g);
|
|
735
743
|
};
|
|
736
744
|
if (l === "stateFilter")
|
|
737
745
|
return (e) => {
|
|
738
746
|
const s = d().filter(
|
|
739
|
-
({ item:
|
|
740
|
-
), i = s.map(({ item:
|
|
747
|
+
({ item: u }, A) => e(u, A)
|
|
748
|
+
), i = s.map(({ item: u }) => u), g = {
|
|
741
749
|
...S,
|
|
742
750
|
validIndices: s.map(
|
|
743
|
-
({ originalIndex:
|
|
751
|
+
({ originalIndex: u }) => u
|
|
744
752
|
)
|
|
745
753
|
};
|
|
746
|
-
return a(i, n,
|
|
754
|
+
return a(i, n, g);
|
|
747
755
|
};
|
|
748
756
|
if (l === "stateMap")
|
|
749
757
|
return (e) => {
|
|
750
758
|
const r = o.getState().getNestedState(t, n);
|
|
751
|
-
return Array.isArray(r) ? (S?.validIndices || Array.from({ length: r.length }, (i,
|
|
752
|
-
const
|
|
753
|
-
return e(
|
|
759
|
+
return Array.isArray(r) ? (S?.validIndices || Array.from({ length: r.length }, (i, g) => g)).map((i, g) => {
|
|
760
|
+
const u = r[i], A = [...n, i.toString()], w = a(u, A, S);
|
|
761
|
+
return e(u, w, {
|
|
754
762
|
register: () => {
|
|
755
|
-
const [,
|
|
763
|
+
const [, P] = nt({}), x = `${m}-${n.join(".")}-${i}`;
|
|
756
764
|
dt(() => {
|
|
757
|
-
const
|
|
765
|
+
const M = `${t}////${x}`, V = o.getState().stateComponents.get(t) || {
|
|
758
766
|
components: /* @__PURE__ */ new Map()
|
|
759
767
|
};
|
|
760
|
-
return
|
|
761
|
-
forceUpdate: () =>
|
|
768
|
+
return V.components.set(M, {
|
|
769
|
+
forceUpdate: () => P({}),
|
|
762
770
|
paths: /* @__PURE__ */ new Set([A.join(".")])
|
|
763
|
-
}), o.getState().stateComponents.set(t,
|
|
764
|
-
const
|
|
765
|
-
|
|
771
|
+
}), o.getState().stateComponents.set(t, V), () => {
|
|
772
|
+
const J = o.getState().stateComponents.get(t);
|
|
773
|
+
J && J.components.delete(M);
|
|
766
774
|
};
|
|
767
|
-
}, [t,
|
|
775
|
+
}, [t, x]);
|
|
768
776
|
},
|
|
769
|
-
index:
|
|
777
|
+
index: g,
|
|
770
778
|
originalIndex: i
|
|
771
779
|
});
|
|
772
780
|
}) : (console.warn(
|
|
@@ -776,9 +784,9 @@ function gt(t, c, m, f) {
|
|
|
776
784
|
};
|
|
777
785
|
if (l === "stateMapNoRender")
|
|
778
786
|
return (e) => v.map((s, i) => {
|
|
779
|
-
let
|
|
780
|
-
S?.validIndices && S.validIndices[i] !== void 0 ?
|
|
781
|
-
const
|
|
787
|
+
let g;
|
|
788
|
+
S?.validIndices && S.validIndices[i] !== void 0 ? g = S.validIndices[i] : g = i;
|
|
789
|
+
const u = [...n, g.toString()], A = a(s, u, S);
|
|
782
790
|
return e(
|
|
783
791
|
s,
|
|
784
792
|
A,
|
|
@@ -788,7 +796,7 @@ function gt(t, c, m, f) {
|
|
|
788
796
|
);
|
|
789
797
|
});
|
|
790
798
|
if (l === "$stateMap")
|
|
791
|
-
return (e) =>
|
|
799
|
+
return (e) => st(Zt, {
|
|
792
800
|
proxy: {
|
|
793
801
|
_stateKey: t,
|
|
794
802
|
_path: n,
|
|
@@ -800,17 +808,17 @@ function gt(t, c, m, f) {
|
|
|
800
808
|
if (l === "stateList")
|
|
801
809
|
return (e) => {
|
|
802
810
|
const r = o.getState().getNestedState(t, n);
|
|
803
|
-
return Array.isArray(r) ? (S?.validIndices || Array.from({ length: r.length }, (i,
|
|
804
|
-
const
|
|
805
|
-
return
|
|
811
|
+
return Array.isArray(r) ? (S?.validIndices || Array.from({ length: r.length }, (i, g) => g)).map((i, g) => {
|
|
812
|
+
const u = r[i], A = [...n, i.toString()], w = a(u, A, S), T = `${m}-${n.join(".")}-${i}`;
|
|
813
|
+
return st(Qt, {
|
|
806
814
|
key: i,
|
|
807
815
|
stateKey: t,
|
|
808
816
|
itemComponentId: T,
|
|
809
817
|
itemPath: A,
|
|
810
818
|
children: e(
|
|
811
|
-
g,
|
|
812
|
-
E,
|
|
813
819
|
u,
|
|
820
|
+
w,
|
|
821
|
+
g,
|
|
814
822
|
r,
|
|
815
823
|
a(r, n, S)
|
|
816
824
|
)
|
|
@@ -822,7 +830,7 @@ function gt(t, c, m, f) {
|
|
|
822
830
|
if (l === "stateFlattenOn")
|
|
823
831
|
return (e) => {
|
|
824
832
|
const r = v;
|
|
825
|
-
y.clear(),
|
|
833
|
+
y.clear(), k++;
|
|
826
834
|
const s = r.flatMap(
|
|
827
835
|
(i) => i[e] ?? []
|
|
828
836
|
);
|
|
@@ -845,36 +853,36 @@ function gt(t, c, m, f) {
|
|
|
845
853
|
return a(s, i);
|
|
846
854
|
};
|
|
847
855
|
if (l === "insert")
|
|
848
|
-
return (e) => (
|
|
856
|
+
return (e) => (p(n), vt(c, e, n, t), a(
|
|
849
857
|
o.getState().getNestedState(t, n),
|
|
850
858
|
n
|
|
851
859
|
));
|
|
852
860
|
if (l === "uniqueInsert")
|
|
853
861
|
return (e, r, s) => {
|
|
854
|
-
const i = o.getState().getNestedState(t, n),
|
|
855
|
-
let
|
|
856
|
-
if (!i.some((
|
|
862
|
+
const i = o.getState().getNestedState(t, n), g = Z(e) ? e(i) : e;
|
|
863
|
+
let u = null;
|
|
864
|
+
if (!i.some((w) => {
|
|
857
865
|
if (r) {
|
|
858
|
-
const
|
|
859
|
-
(
|
|
866
|
+
const P = r.every(
|
|
867
|
+
(x) => z(w[x], g[x])
|
|
860
868
|
);
|
|
861
|
-
return
|
|
869
|
+
return P && (u = w), P;
|
|
862
870
|
}
|
|
863
|
-
const T =
|
|
864
|
-
return T && (
|
|
871
|
+
const T = z(w, g);
|
|
872
|
+
return T && (u = w), T;
|
|
865
873
|
}))
|
|
866
|
-
|
|
867
|
-
else if (s &&
|
|
868
|
-
const
|
|
869
|
-
(
|
|
874
|
+
p(n), vt(c, g, n, t);
|
|
875
|
+
else if (s && u) {
|
|
876
|
+
const w = s(u), T = i.map(
|
|
877
|
+
(P) => z(P, u) ? w : P
|
|
870
878
|
);
|
|
871
|
-
|
|
879
|
+
p(n), ot(c, T, n);
|
|
872
880
|
}
|
|
873
881
|
};
|
|
874
882
|
if (l === "cut")
|
|
875
883
|
return (e, r) => {
|
|
876
884
|
if (!r?.waitForSync)
|
|
877
|
-
return
|
|
885
|
+
return p(n), lt(c, n, t, e), a(
|
|
878
886
|
o.getState().getNestedState(t, n),
|
|
879
887
|
n
|
|
880
888
|
);
|
|
@@ -882,17 +890,17 @@ function gt(t, c, m, f) {
|
|
|
882
890
|
if (l === "cutByValue")
|
|
883
891
|
return (e) => {
|
|
884
892
|
for (let r = 0; r < v.length; r++)
|
|
885
|
-
v[r] === e &&
|
|
893
|
+
v[r] === e && lt(c, n, t, r);
|
|
886
894
|
};
|
|
887
895
|
if (l === "toggleByValue")
|
|
888
896
|
return (e) => {
|
|
889
897
|
const r = v.findIndex((s) => s === e);
|
|
890
|
-
r > -1 ?
|
|
898
|
+
r > -1 ? lt(c, n, t, r) : vt(c, e, n, t);
|
|
891
899
|
};
|
|
892
900
|
if (l === "stateFind")
|
|
893
901
|
return (e) => {
|
|
894
902
|
const s = d().find(
|
|
895
|
-
({ item:
|
|
903
|
+
({ item: g }, u) => e(g, u)
|
|
896
904
|
);
|
|
897
905
|
if (!s) return;
|
|
898
906
|
const i = [...n, s.originalIndex.toString()];
|
|
@@ -901,22 +909,22 @@ function gt(t, c, m, f) {
|
|
|
901
909
|
if (l === "findWith")
|
|
902
910
|
return (e, r) => {
|
|
903
911
|
const i = d().find(
|
|
904
|
-
({ item:
|
|
912
|
+
({ item: u }) => u[e] === r
|
|
905
913
|
);
|
|
906
914
|
if (!i) return;
|
|
907
|
-
const
|
|
908
|
-
return a(i.item,
|
|
915
|
+
const g = [...n, i.originalIndex.toString()];
|
|
916
|
+
return a(i.item, g, S);
|
|
909
917
|
};
|
|
910
918
|
}
|
|
911
|
-
const
|
|
912
|
-
if (!isNaN(Number(
|
|
919
|
+
const X = n[n.length - 1];
|
|
920
|
+
if (!isNaN(Number(X))) {
|
|
913
921
|
const d = n.slice(0, -1), e = o.getState().getNestedState(t, d);
|
|
914
922
|
if (Array.isArray(e) && l === "cut")
|
|
915
|
-
return () =>
|
|
923
|
+
return () => lt(
|
|
916
924
|
c,
|
|
917
925
|
d,
|
|
918
926
|
t,
|
|
919
|
-
Number(
|
|
927
|
+
Number(X)
|
|
920
928
|
);
|
|
921
929
|
}
|
|
922
930
|
if (l === "get")
|
|
@@ -953,7 +961,7 @@ function gt(t, c, m, f) {
|
|
|
953
961
|
const e = n.slice(0, -1), r = Number(n[n.length - 1]), s = e.join(".");
|
|
954
962
|
d ? o.getState().setSelectedIndex(t, s, r) : o.getState().setSelectedIndex(t, s, void 0);
|
|
955
963
|
const i = o.getState().getNestedState(t, [...e]);
|
|
956
|
-
|
|
964
|
+
ot(c, i, e), p(e);
|
|
957
965
|
};
|
|
958
966
|
if (l === "toggleSelected")
|
|
959
967
|
return () => {
|
|
@@ -964,12 +972,12 @@ function gt(t, c, m, f) {
|
|
|
964
972
|
s === e ? void 0 : e
|
|
965
973
|
);
|
|
966
974
|
const i = o.getState().getNestedState(t, [...d]);
|
|
967
|
-
|
|
975
|
+
ot(c, i, d), p(d);
|
|
968
976
|
};
|
|
969
977
|
if (n.length == 0) {
|
|
970
978
|
if (l === "applyJsonPatch")
|
|
971
979
|
return (d) => {
|
|
972
|
-
const e = o.getState().cogsStateStore[t], s =
|
|
980
|
+
const e = o.getState().cogsStateStore[t], s = Wt(e, d).newDocument;
|
|
973
981
|
xt(
|
|
974
982
|
t,
|
|
975
983
|
o.getState().initialStateGlobal[t],
|
|
@@ -980,57 +988,57 @@ function gt(t, c, m, f) {
|
|
|
980
988
|
);
|
|
981
989
|
const i = o.getState().stateComponents.get(t);
|
|
982
990
|
if (i) {
|
|
983
|
-
const
|
|
991
|
+
const g = pt(e, s), u = new Set(g);
|
|
984
992
|
for (const [
|
|
985
993
|
A,
|
|
986
|
-
|
|
994
|
+
w
|
|
987
995
|
] of i.components.entries()) {
|
|
988
996
|
let T = !1;
|
|
989
|
-
const
|
|
990
|
-
if (!
|
|
991
|
-
if (
|
|
992
|
-
|
|
997
|
+
const P = Array.isArray(w.reactiveType) ? w.reactiveType : [w.reactiveType || "component"];
|
|
998
|
+
if (!P.includes("none")) {
|
|
999
|
+
if (P.includes("all")) {
|
|
1000
|
+
w.forceUpdate();
|
|
993
1001
|
continue;
|
|
994
1002
|
}
|
|
995
|
-
if (
|
|
996
|
-
for (const
|
|
997
|
-
if (
|
|
1003
|
+
if (P.includes("component") && (w.paths.has("") && (T = !0), !T))
|
|
1004
|
+
for (const x of u) {
|
|
1005
|
+
if (w.paths.has(x)) {
|
|
998
1006
|
T = !0;
|
|
999
1007
|
break;
|
|
1000
1008
|
}
|
|
1001
|
-
let
|
|
1002
|
-
for (;
|
|
1003
|
-
const
|
|
1004
|
-
if (
|
|
1009
|
+
let M = x.lastIndexOf(".");
|
|
1010
|
+
for (; M !== -1; ) {
|
|
1011
|
+
const V = x.substring(0, M);
|
|
1012
|
+
if (w.paths.has(V)) {
|
|
1005
1013
|
T = !0;
|
|
1006
1014
|
break;
|
|
1007
1015
|
}
|
|
1008
|
-
const
|
|
1009
|
-
|
|
1016
|
+
const J = x.substring(
|
|
1017
|
+
M + 1
|
|
1010
1018
|
);
|
|
1011
|
-
if (!isNaN(Number(
|
|
1012
|
-
const
|
|
1013
|
-
if (
|
|
1014
|
-
const N =
|
|
1019
|
+
if (!isNaN(Number(J))) {
|
|
1020
|
+
const b = V.lastIndexOf(".");
|
|
1021
|
+
if (b !== -1) {
|
|
1022
|
+
const N = V.substring(
|
|
1015
1023
|
0,
|
|
1016
|
-
|
|
1024
|
+
b
|
|
1017
1025
|
);
|
|
1018
|
-
if (
|
|
1026
|
+
if (w.paths.has(N)) {
|
|
1019
1027
|
T = !0;
|
|
1020
1028
|
break;
|
|
1021
1029
|
}
|
|
1022
1030
|
}
|
|
1023
1031
|
}
|
|
1024
|
-
|
|
1032
|
+
M = V.lastIndexOf(".");
|
|
1025
1033
|
}
|
|
1026
1034
|
if (T) break;
|
|
1027
1035
|
}
|
|
1028
|
-
if (!T &&
|
|
1029
|
-
const
|
|
1030
|
-
let
|
|
1031
|
-
typeof
|
|
1036
|
+
if (!T && P.includes("deps") && w.depsFunction) {
|
|
1037
|
+
const x = w.depsFunction(s);
|
|
1038
|
+
let M = !1;
|
|
1039
|
+
typeof x == "boolean" ? x && (M = !0) : z(w.deps, x) || (w.deps = x, M = !0), M && (T = !0);
|
|
1032
1040
|
}
|
|
1033
|
-
T &&
|
|
1041
|
+
T && w.forceUpdate();
|
|
1034
1042
|
}
|
|
1035
1043
|
}
|
|
1036
1044
|
}
|
|
@@ -1042,17 +1050,17 @@ function gt(t, c, m, f) {
|
|
|
1042
1050
|
throw new Error("Zod schema not found");
|
|
1043
1051
|
if (!d?.key)
|
|
1044
1052
|
throw new Error("Validation key not found");
|
|
1045
|
-
|
|
1053
|
+
Y(d.key);
|
|
1046
1054
|
const r = o.getState().cogsStateStore[t];
|
|
1047
1055
|
try {
|
|
1048
1056
|
const s = o.getState().getValidationErrors(d.key);
|
|
1049
|
-
s && s.length > 0 && s.forEach(([
|
|
1050
|
-
|
|
1057
|
+
s && s.length > 0 && s.forEach(([g]) => {
|
|
1058
|
+
g && g.startsWith(d.key) && Y(g);
|
|
1051
1059
|
});
|
|
1052
1060
|
const i = d.zodSchema.safeParse(r);
|
|
1053
|
-
return i.success ? !0 : (i.error.errors.forEach((
|
|
1054
|
-
const A =
|
|
1055
|
-
e(T,
|
|
1061
|
+
return i.success ? !0 : (i.error.errors.forEach((u) => {
|
|
1062
|
+
const A = u.path, w = u.message, T = [d.key, ...A].join(".");
|
|
1063
|
+
e(T, w);
|
|
1056
1064
|
}), St(t), !1);
|
|
1057
1065
|
} catch (s) {
|
|
1058
1066
|
return console.error("Zod schema validation failed", s), !1;
|
|
@@ -1070,9 +1078,9 @@ function gt(t, c, m, f) {
|
|
|
1070
1078
|
if (l === "_isLoading")
|
|
1071
1079
|
return o.getState().isLoadingGlobal[t];
|
|
1072
1080
|
if (l === "revertToInitialState")
|
|
1073
|
-
return
|
|
1074
|
-
if (l === "updateInitialState") return
|
|
1075
|
-
if (l === "removeValidation") return
|
|
1081
|
+
return I.revertToInitialState;
|
|
1082
|
+
if (l === "updateInitialState") return I.updateInitialState;
|
|
1083
|
+
if (l === "removeValidation") return I.removeValidation;
|
|
1076
1084
|
}
|
|
1077
1085
|
if (l === "getFormRef")
|
|
1078
1086
|
return () => Tt.getState().getFormRef(t + "." + n.join("."));
|
|
@@ -1081,7 +1089,7 @@ function gt(t, c, m, f) {
|
|
|
1081
1089
|
children: d,
|
|
1082
1090
|
hideMessage: e
|
|
1083
1091
|
}) => /* @__PURE__ */ yt(
|
|
1084
|
-
|
|
1092
|
+
Ft,
|
|
1085
1093
|
{
|
|
1086
1094
|
formOpts: e ? { validation: { message: "" } } : void 0,
|
|
1087
1095
|
path: n,
|
|
@@ -1093,25 +1101,25 @@ function gt(t, c, m, f) {
|
|
|
1093
1101
|
);
|
|
1094
1102
|
if (l === "_stateKey") return t;
|
|
1095
1103
|
if (l === "_path") return n;
|
|
1096
|
-
if (l === "_isServerSynced") return
|
|
1104
|
+
if (l === "_isServerSynced") return I._isServerSynced;
|
|
1097
1105
|
if (l === "update")
|
|
1098
1106
|
return (d, e) => {
|
|
1099
1107
|
if (e?.debounce)
|
|
1100
|
-
|
|
1101
|
-
|
|
1108
|
+
Rt(() => {
|
|
1109
|
+
ot(c, d, n, "");
|
|
1102
1110
|
const r = o.getState().getNestedState(t, n);
|
|
1103
1111
|
e?.afterUpdate && e.afterUpdate(r);
|
|
1104
1112
|
}, e.debounce);
|
|
1105
1113
|
else {
|
|
1106
|
-
|
|
1114
|
+
ot(c, d, n, "");
|
|
1107
1115
|
const r = o.getState().getNestedState(t, n);
|
|
1108
1116
|
e?.afterUpdate && e.afterUpdate(r);
|
|
1109
1117
|
}
|
|
1110
|
-
|
|
1118
|
+
p(n);
|
|
1111
1119
|
};
|
|
1112
1120
|
if (l === "formElement")
|
|
1113
1121
|
return (d, e) => /* @__PURE__ */ yt(
|
|
1114
|
-
|
|
1122
|
+
Ut,
|
|
1115
1123
|
{
|
|
1116
1124
|
setState: c,
|
|
1117
1125
|
stateKey: t,
|
|
@@ -1120,13 +1128,13 @@ function gt(t, c, m, f) {
|
|
|
1120
1128
|
formOpts: e
|
|
1121
1129
|
}
|
|
1122
1130
|
);
|
|
1123
|
-
const j = [...n, l],
|
|
1124
|
-
return a(
|
|
1131
|
+
const j = [...n, l], rt = o.getState().getNestedState(t, j);
|
|
1132
|
+
return a(rt, j, S);
|
|
1125
1133
|
}
|
|
1126
|
-
}, L = new Proxy(
|
|
1134
|
+
}, L = new Proxy(F, U);
|
|
1127
1135
|
return y.set(G, {
|
|
1128
1136
|
proxy: L,
|
|
1129
|
-
stateVersion:
|
|
1137
|
+
stateVersion: k
|
|
1130
1138
|
}), L;
|
|
1131
1139
|
}
|
|
1132
1140
|
return a(
|
|
@@ -1134,9 +1142,9 @@ function gt(t, c, m, f) {
|
|
|
1134
1142
|
);
|
|
1135
1143
|
}
|
|
1136
1144
|
function bt(t) {
|
|
1137
|
-
return
|
|
1145
|
+
return st(Xt, { proxy: t });
|
|
1138
1146
|
}
|
|
1139
|
-
function
|
|
1147
|
+
function Zt({
|
|
1140
1148
|
proxy: t,
|
|
1141
1149
|
rebuildStateShape: c
|
|
1142
1150
|
}) {
|
|
@@ -1145,23 +1153,23 @@ function Yt({
|
|
|
1145
1153
|
m,
|
|
1146
1154
|
t._path
|
|
1147
1155
|
).stateMapNoRender(
|
|
1148
|
-
(y,
|
|
1156
|
+
(y, k, p, I, a) => t._mapFn(y, k, p, I, a)
|
|
1149
1157
|
) : null;
|
|
1150
1158
|
}
|
|
1151
|
-
function
|
|
1159
|
+
function Xt({
|
|
1152
1160
|
proxy: t
|
|
1153
1161
|
}) {
|
|
1154
|
-
const c =
|
|
1155
|
-
return
|
|
1162
|
+
const c = q(null), m = `${t._stateKey}-${t._path.join(".")}`;
|
|
1163
|
+
return at(() => {
|
|
1156
1164
|
const f = c.current;
|
|
1157
1165
|
if (!f || !f.parentElement) return;
|
|
1158
|
-
const y = f.parentElement,
|
|
1159
|
-
let
|
|
1160
|
-
|
|
1166
|
+
const y = f.parentElement, p = Array.from(y.childNodes).indexOf(f);
|
|
1167
|
+
let I = y.getAttribute("data-parent-id");
|
|
1168
|
+
I || (I = `parent-${crypto.randomUUID()}`, y.setAttribute("data-parent-id", I));
|
|
1161
1169
|
const v = {
|
|
1162
1170
|
instanceId: `instance-${crypto.randomUUID()}`,
|
|
1163
|
-
parentId:
|
|
1164
|
-
position:
|
|
1171
|
+
parentId: I,
|
|
1172
|
+
position: p,
|
|
1165
1173
|
effect: t._effect
|
|
1166
1174
|
};
|
|
1167
1175
|
o.getState().addSignalElement(m, v);
|
|
@@ -1173,22 +1181,22 @@ function Zt({
|
|
|
1173
1181
|
"state",
|
|
1174
1182
|
`return (${t._effect})(state)`
|
|
1175
1183
|
)(n);
|
|
1176
|
-
} catch (
|
|
1177
|
-
console.error("Error evaluating effect function during mount:",
|
|
1184
|
+
} catch (F) {
|
|
1185
|
+
console.error("Error evaluating effect function during mount:", F), S = n;
|
|
1178
1186
|
}
|
|
1179
1187
|
else
|
|
1180
1188
|
S = n;
|
|
1181
1189
|
S !== null && typeof S == "object" && (S = JSON.stringify(S));
|
|
1182
1190
|
const G = document.createTextNode(String(S));
|
|
1183
1191
|
f.replaceWith(G);
|
|
1184
|
-
}, [t._stateKey, t._path.join("."), t._effect]),
|
|
1192
|
+
}, [t._stateKey, t._path.join("."), t._effect]), st("span", {
|
|
1185
1193
|
ref: c,
|
|
1186
1194
|
style: { display: "none" },
|
|
1187
1195
|
"data-signal-id": m
|
|
1188
1196
|
});
|
|
1189
1197
|
}
|
|
1190
|
-
function
|
|
1191
|
-
const c =
|
|
1198
|
+
function fe(t) {
|
|
1199
|
+
const c = Mt(
|
|
1192
1200
|
(m) => {
|
|
1193
1201
|
const f = o.getState().stateComponents.get(t._stateKey) || {
|
|
1194
1202
|
components: /* @__PURE__ */ new Map()
|
|
@@ -1200,22 +1208,22 @@ function ge(t) {
|
|
|
1200
1208
|
},
|
|
1201
1209
|
() => o.getState().getNestedState(t._stateKey, t._path)
|
|
1202
1210
|
);
|
|
1203
|
-
return
|
|
1211
|
+
return st("text", {}, String(c));
|
|
1204
1212
|
}
|
|
1205
|
-
function
|
|
1213
|
+
function Qt({
|
|
1206
1214
|
stateKey: t,
|
|
1207
1215
|
itemComponentId: c,
|
|
1208
1216
|
itemPath: m,
|
|
1209
1217
|
children: f
|
|
1210
1218
|
}) {
|
|
1211
|
-
const [, y] =
|
|
1212
|
-
return
|
|
1213
|
-
|
|
1219
|
+
const [, y] = nt({}), [k, p] = Gt(), I = q(null);
|
|
1220
|
+
return at(() => {
|
|
1221
|
+
p.height > 0 && p.height !== I.current && (I.current = p.height, o.getState().setShadowMetadata(t, m, {
|
|
1214
1222
|
virtualizer: {
|
|
1215
|
-
itemHeight:
|
|
1223
|
+
itemHeight: p.height
|
|
1216
1224
|
}
|
|
1217
1225
|
}));
|
|
1218
|
-
}, [
|
|
1226
|
+
}, [p.height, t, m]), dt(() => {
|
|
1219
1227
|
const a = `${t}////${c}`, v = o.getState().stateComponents.get(t) || {
|
|
1220
1228
|
components: /* @__PURE__ */ new Map()
|
|
1221
1229
|
};
|
|
@@ -1226,14 +1234,14 @@ function Xt({
|
|
|
1226
1234
|
const n = o.getState().stateComponents.get(t);
|
|
1227
1235
|
n && n.components.delete(a);
|
|
1228
1236
|
};
|
|
1229
|
-
}, [t, c, m.join(".")]), /* @__PURE__ */ yt("div", { ref:
|
|
1237
|
+
}, [t, c, m.join(".")]), /* @__PURE__ */ yt("div", { ref: k, children: f });
|
|
1230
1238
|
}
|
|
1231
1239
|
export {
|
|
1232
1240
|
bt as $cogsSignal,
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1241
|
+
fe as $cogsSignalStore,
|
|
1242
|
+
de as addStateOptions,
|
|
1243
|
+
ue as createCogsState,
|
|
1244
|
+
ge as notifyComponent,
|
|
1245
|
+
Yt as useCogsStateFn
|
|
1238
1246
|
};
|
|
1239
1247
|
//# sourceMappingURL=CogsState.jsx.map
|