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