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