@yakocloud/state-vocab 1.0.5 → 2.0.2

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.
@@ -1,804 +1,475 @@
1
- import De, { useMemo as re, createContext as br, useState as hr, useContext as mr, useEffect as Er, useRef as Rr } from "react";
2
- const Ae = Symbol("state-def"), K = Symbol("state-path");
3
- function _r(v, i, u) {
4
- if (!i)
5
- return v;
6
- const f = i.split(".");
7
- let c = v;
8
- for (const b of f)
9
- if (c !== null && typeof c == "object" && b in c)
10
- c = c[b];
1
+ import ie, { useMemo as $, createContext as fe, useState as de, useContext as me, useEffect as W, useRef as be } from "react";
2
+ const H = Symbol("state-def"), O = Symbol("state-path");
3
+ function ve(r, n, a) {
4
+ if (!n)
5
+ return r;
6
+ const s = n.split(".");
7
+ let t = r;
8
+ for (const c of s)
9
+ if (t !== null && typeof t == "object" && c in t)
10
+ t = t[c];
11
11
  else
12
- return u;
13
- return c === void 0 ? u : c;
12
+ return a;
13
+ return t === void 0 ? a : t;
14
14
  }
15
- function Sr(v, i, u) {
16
- const f = i.replace(/\[(\d+)\]/g, ".$1").split(".");
17
- let c = v;
18
- for (let b = 0; b < f.length - 1; b++) {
19
- const m = f[b], y = f[b + 1];
20
- (c[m] === void 0 || c[m] === null) && (c[m] = /^\d+$/.test(y) ? [] : {}), c = c[m];
15
+ function Ee(r, n, a) {
16
+ const s = n.replace(/\[(\d+)\]/g, ".$1").split(".");
17
+ let t = r;
18
+ for (let c = 0; c < s.length - 1; c++) {
19
+ const f = s[c], u = s[c + 1];
20
+ (t[f] === void 0 || t[f] === null) && (t[f] = /^\d+$/.test(u) ? [] : {}), t = t[f];
21
21
  }
22
- return c[f[f.length - 1]] = u, v;
22
+ return t[s[s.length - 1]] = a, r;
23
23
  }
24
- function Tr(v, i = 0) {
25
- let u;
26
- return function(...f) {
27
- u !== void 0 && clearTimeout(u), u = setTimeout(() => {
28
- u = void 0, v.apply(this, f);
29
- }, i);
24
+ function pe(r, n = 0) {
25
+ let a;
26
+ return function(...s) {
27
+ a !== void 0 && clearTimeout(a), a = setTimeout(() => {
28
+ a = void 0, r.apply(this, s);
29
+ }, n);
30
30
  };
31
31
  }
32
- function Or(v, i, u = []) {
33
- return re(
34
- () => Tr(v, i),
32
+ function _e(r, n, a = []) {
33
+ return $(
34
+ () => pe(r, n),
35
35
  // eslint-disable-next-line react-hooks/exhaustive-deps
36
- u
36
+ a
37
37
  );
38
38
  }
39
- function Pr(v) {
40
- const i = JSON.stringify(v, null, 2).split(`
41
- `), u = [], f = [];
42
- for (const c of i) {
43
- const b = c.match(/^(\s*)"([^"]+)"(\s*:\s*)(.+)$/);
44
- if (b) {
45
- const [, m, y, l, p] = b;
46
- u.push(`${m}%c"${y}"%c${l}%c${p}`), f.push(
39
+ function Se(r) {
40
+ const n = JSON.stringify(r, null, 2).split(`
41
+ `), a = [], s = [];
42
+ for (const t of n) {
43
+ const c = t.match(/^(\s*)"([^"]+)"(\s*:\s*)(.+)$/);
44
+ if (c) {
45
+ const [, f, u, p, v] = c;
46
+ a.push(`${f}%c"${u}"%c${p}%c${v}`), s.push(
47
47
  "color: #9cdcfe; font-weight: bold",
48
48
  "color: #cccccc",
49
49
  "color: #ce9178"
50
50
  );
51
51
  } else
52
- u.push(`%c${c}`), f.push("color: #cccccc");
52
+ a.push(`%c${t}`), s.push("color: #cccccc");
53
53
  }
54
- console.log(u.join(`
55
- `), ...f, v);
54
+ console.log(a.join(`
55
+ `), ...s, r);
56
56
  }
57
- var q = { exports: {} }, Y = {};
58
- var Ce;
59
- function Cr() {
60
- if (Ce) return Y;
61
- Ce = 1;
62
- var v = De, i = Symbol.for("react.element"), u = Symbol.for("react.fragment"), f = Object.prototype.hasOwnProperty, c = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, b = { key: !0, ref: !0, __self: !0, __source: !0 };
63
- function m(y, l, p) {
64
- var g, _ = {}, w = null, k = null;
65
- p !== void 0 && (w = "" + p), l.key !== void 0 && (w = "" + l.key), l.ref !== void 0 && (k = l.ref);
66
- for (g in l) f.call(l, g) && !b.hasOwnProperty(g) && (_[g] = l[g]);
67
- if (y && y.defaultProps) for (g in l = y.defaultProps, l) _[g] === void 0 && (_[g] = l[g]);
68
- return { $$typeof: i, type: y, key: w, ref: k, props: _, _owner: c.current };
57
+ var x = { exports: {} }, h = {};
58
+ var J;
59
+ function Re() {
60
+ if (J) return h;
61
+ J = 1;
62
+ var r = Symbol.for("react.transitional.element"), n = Symbol.for("react.fragment");
63
+ function a(s, t, c) {
64
+ var f = null;
65
+ if (c !== void 0 && (f = "" + c), t.key !== void 0 && (f = "" + t.key), "key" in t) {
66
+ c = {};
67
+ for (var u in t)
68
+ u !== "key" && (c[u] = t[u]);
69
+ } else c = t;
70
+ return t = c.ref, {
71
+ $$typeof: r,
72
+ type: s,
73
+ key: f,
74
+ ref: t !== void 0 ? t : null,
75
+ props: c
76
+ };
69
77
  }
70
- return Y.Fragment = u, Y.jsx = m, Y.jsxs = m, Y;
78
+ return h.Fragment = n, h.jsx = a, h.jsxs = a, h;
71
79
  }
72
- var M = {};
73
- var we;
74
- function wr() {
75
- return we || (we = 1, process.env.NODE_ENV !== "production" && (function() {
76
- var v = De, i = Symbol.for("react.element"), u = Symbol.for("react.portal"), f = Symbol.for("react.fragment"), c = Symbol.for("react.strict_mode"), b = Symbol.for("react.profiler"), m = Symbol.for("react.provider"), y = Symbol.for("react.context"), l = Symbol.for("react.forward_ref"), p = Symbol.for("react.suspense"), g = Symbol.for("react.suspense_list"), _ = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), k = Symbol.for("react.offscreen"), j = Symbol.iterator, P = "@@iterator";
77
- function R(e) {
78
- if (e === null || typeof e != "object")
79
- return null;
80
- var r = j && e[j] || e[P];
81
- return typeof r == "function" ? r : null;
82
- }
83
- var S = v.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
84
- function T(e) {
85
- {
86
- for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
87
- t[n - 1] = arguments[n];
88
- $e("error", e, t);
89
- }
90
- }
91
- function $e(e, r, t) {
92
- {
93
- var n = S.ReactDebugCurrentFrame, s = n.getStackAddendum();
94
- s !== "" && (r += "%s", t = t.concat([s]));
95
- var d = t.map(function(o) {
96
- return String(o);
97
- });
98
- d.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, d);
99
- }
100
- }
101
- var Ve = !1, We = !1, Ye = !1, Me = !1, Le = !1, te;
102
- te = Symbol.for("react.module.reference");
103
- function Ne(e) {
104
- return !!(typeof e == "string" || typeof e == "function" || e === f || e === b || Le || e === c || e === p || e === g || Me || e === k || Ve || We || Ye || typeof e == "object" && e !== null && (e.$$typeof === w || e.$$typeof === _ || e.$$typeof === m || e.$$typeof === y || e.$$typeof === l || // This needs to include all possible module reference object
105
- // types supported by any Flight configuration anywhere since
106
- // we don't know which Flight build this will end up being used
107
- // with.
108
- e.$$typeof === te || e.getModuleId !== void 0));
109
- }
110
- function Ue(e, r, t) {
111
- var n = e.displayName;
112
- if (n)
113
- return n;
114
- var s = r.displayName || r.name || "";
115
- return s !== "" ? t + "(" + s + ")" : t;
116
- }
117
- function ne(e) {
118
- return e.displayName || "Context";
119
- }
120
- function D(e) {
121
- if (e == null)
122
- return null;
123
- if (typeof e.tag == "number" && T("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
124
- return e.displayName || e.name || null;
125
- if (typeof e == "string")
126
- return e;
80
+ var k = {};
81
+ var U;
82
+ function Te() {
83
+ return U || (U = 1, process.env.NODE_ENV !== "production" && (function() {
84
+ function r(e) {
85
+ if (e == null) return null;
86
+ if (typeof e == "function")
87
+ return e.$$typeof === ce ? null : e.displayName || e.name || null;
88
+ if (typeof e == "string") return e;
127
89
  switch (e) {
128
- case f:
90
+ case S:
129
91
  return "Fragment";
130
- case u:
131
- return "Portal";
132
- case b:
92
+ case K:
133
93
  return "Profiler";
134
- case c:
94
+ case g:
135
95
  return "StrictMode";
136
- case p:
96
+ case ne:
137
97
  return "Suspense";
138
- case g:
98
+ case oe:
139
99
  return "SuspenseList";
100
+ case se:
101
+ return "Activity";
140
102
  }
141
103
  if (typeof e == "object")
142
- switch (e.$$typeof) {
143
- case y:
144
- var r = e;
145
- return ne(r) + ".Consumer";
146
- case m:
147
- var t = e;
148
- return ne(t._context) + ".Provider";
149
- case l:
150
- return Ue(e, e.render, "ForwardRef");
151
- case _:
152
- var n = e.displayName || null;
153
- return n !== null ? n : D(e.type) || "Memo";
154
- case w: {
155
- var s = e, d = s._payload, o = s._init;
104
+ switch (typeof e.tag == "number" && console.error(
105
+ "Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
106
+ ), e.$$typeof) {
107
+ case d:
108
+ return "Portal";
109
+ case te:
110
+ return e.displayName || "Context";
111
+ case ee:
112
+ return (e._context.displayName || "Context") + ".Consumer";
113
+ case re:
114
+ var o = e.render;
115
+ return e = e.displayName, e || (e = o.displayName || o.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
116
+ case ae:
117
+ return o = e.displayName || null, o !== null ? o : r(e.type) || "Memo";
118
+ case A:
119
+ o = e._payload, e = e._init;
156
120
  try {
157
- return D(o(d));
121
+ return r(e(o));
158
122
  } catch {
159
- return null;
160
123
  }
161
- }
162
124
  }
163
125
  return null;
164
126
  }
165
- var A = Object.assign, V = 0, ae, oe, ie, ue, se, ce, fe;
166
- function le() {
167
- }
168
- le.__reactDisabledLog = !0;
169
- function Je() {
170
- {
171
- if (V === 0) {
172
- ae = console.log, oe = console.info, ie = console.warn, ue = console.error, se = console.group, ce = console.groupCollapsed, fe = console.groupEnd;
173
- var e = {
174
- configurable: !0,
175
- enumerable: !0,
176
- value: le,
177
- writable: !0
178
- };
179
- Object.defineProperties(console, {
180
- info: e,
181
- log: e,
182
- warn: e,
183
- error: e,
184
- group: e,
185
- groupCollapsed: e,
186
- groupEnd: e
187
- });
188
- }
189
- V++;
190
- }
191
- }
192
- function qe() {
193
- {
194
- if (V--, V === 0) {
195
- var e = {
196
- configurable: !0,
197
- enumerable: !0,
198
- writable: !0
199
- };
200
- Object.defineProperties(console, {
201
- log: A({}, e, {
202
- value: ae
203
- }),
204
- info: A({}, e, {
205
- value: oe
206
- }),
207
- warn: A({}, e, {
208
- value: ie
209
- }),
210
- error: A({}, e, {
211
- value: ue
212
- }),
213
- group: A({}, e, {
214
- value: se
215
- }),
216
- groupCollapsed: A({}, e, {
217
- value: ce
218
- }),
219
- groupEnd: A({}, e, {
220
- value: fe
221
- })
222
- });
223
- }
224
- V < 0 && T("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
225
- }
226
- }
227
- var B = S.ReactCurrentDispatcher, z;
228
- function L(e, r, t) {
229
- {
230
- if (z === void 0)
231
- try {
232
- throw Error();
233
- } catch (s) {
234
- var n = s.stack.trim().match(/\n( *(at )?)/);
235
- z = n && n[1] || "";
236
- }
237
- return `
238
- ` + z + e;
239
- }
240
- }
241
- var G = !1, N;
242
- {
243
- var Ke = typeof WeakMap == "function" ? WeakMap : Map;
244
- N = new Ke();
127
+ function n(e) {
128
+ return "" + e;
245
129
  }
246
- function de(e, r) {
247
- if (!e || G)
248
- return "";
249
- {
250
- var t = N.get(e);
251
- if (t !== void 0)
252
- return t;
253
- }
254
- var n;
255
- G = !0;
256
- var s = Error.prepareStackTrace;
257
- Error.prepareStackTrace = void 0;
258
- var d;
259
- d = B.current, B.current = null, Je();
130
+ function a(e) {
260
131
  try {
261
- if (r) {
262
- var o = function() {
263
- throw Error();
264
- };
265
- if (Object.defineProperty(o.prototype, "props", {
266
- set: function() {
267
- throw Error();
268
- }
269
- }), typeof Reflect == "object" && Reflect.construct) {
270
- try {
271
- Reflect.construct(o, []);
272
- } catch (C) {
273
- n = C;
274
- }
275
- Reflect.construct(e, [], o);
276
- } else {
277
- try {
278
- o.call();
279
- } catch (C) {
280
- n = C;
281
- }
282
- e.call(o.prototype);
283
- }
284
- } else {
285
- try {
286
- throw Error();
287
- } catch (C) {
288
- n = C;
289
- }
290
- e();
291
- }
292
- } catch (C) {
293
- if (C && n && typeof C.stack == "string") {
294
- for (var a = C.stack.split(`
295
- `), O = n.stack.split(`
296
- `), h = a.length - 1, E = O.length - 1; h >= 1 && E >= 0 && a[h] !== O[E]; )
297
- E--;
298
- for (; h >= 1 && E >= 0; h--, E--)
299
- if (a[h] !== O[E]) {
300
- if (h !== 1 || E !== 1)
301
- do
302
- if (h--, E--, E < 0 || a[h] !== O[E]) {
303
- var x = `
304
- ` + a[h].replace(" at new ", " at ");
305
- return e.displayName && x.includes("<anonymous>") && (x = x.replace("<anonymous>", e.displayName)), typeof e == "function" && N.set(e, x), x;
306
- }
307
- while (h >= 1 && E >= 0);
308
- break;
309
- }
310
- }
311
- } finally {
312
- G = !1, B.current = d, qe(), Error.prepareStackTrace = s;
313
- }
314
- var $ = e ? e.displayName || e.name : "", F = $ ? L($) : "";
315
- return typeof e == "function" && N.set(e, F), F;
316
- }
317
- function Be(e, r, t) {
318
- return de(e, !1);
319
- }
320
- function ze(e) {
321
- var r = e.prototype;
322
- return !!(r && r.isReactComponent);
323
- }
324
- function U(e, r, t) {
325
- if (e == null)
326
- return "";
327
- if (typeof e == "function")
328
- return de(e, ze(e));
329
- if (typeof e == "string")
330
- return L(e);
331
- switch (e) {
332
- case p:
333
- return L("Suspense");
334
- case g:
335
- return L("SuspenseList");
336
- }
337
- if (typeof e == "object")
338
- switch (e.$$typeof) {
339
- case l:
340
- return Be(e.render);
341
- case _:
342
- return U(e.type, r, t);
343
- case w: {
344
- var n = e, s = n._payload, d = n._init;
345
- try {
346
- return U(d(s), r, t);
347
- } catch {
348
- }
349
- }
350
- }
351
- return "";
352
- }
353
- var W = Object.prototype.hasOwnProperty, ve = {}, pe = S.ReactDebugCurrentFrame;
354
- function J(e) {
355
- if (e) {
356
- var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
357
- pe.setExtraStackFrame(t);
358
- } else
359
- pe.setExtraStackFrame(null);
360
- }
361
- function Ge(e, r, t, n, s) {
362
- {
363
- var d = Function.call.bind(W);
364
- for (var o in e)
365
- if (d(e, o)) {
366
- var a = void 0;
367
- try {
368
- if (typeof e[o] != "function") {
369
- var O = Error((n || "React class") + ": " + t + " type `" + o + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[o] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
370
- throw O.name = "Invariant Violation", O;
371
- }
372
- a = e[o](r, o, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
373
- } catch (h) {
374
- a = h;
375
- }
376
- a && !(a instanceof Error) && (J(s), T("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, o, typeof a), J(null)), a instanceof Error && !(a.message in ve) && (ve[a.message] = !0, J(s), T("Failed %s type: %s", t, a.message), J(null));
377
- }
132
+ n(e);
133
+ var o = !1;
134
+ } catch {
135
+ o = !0;
378
136
  }
379
- }
380
- var Xe = Array.isArray;
381
- function X(e) {
382
- return Xe(e);
383
- }
384
- function He(e) {
385
- {
386
- var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
387
- return t;
137
+ if (o) {
138
+ o = console;
139
+ var i = o.error, m = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
140
+ return i.call(
141
+ o,
142
+ "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
143
+ m
144
+ ), n(e);
388
145
  }
389
146
  }
390
- function Ze(e) {
147
+ function s(e) {
148
+ if (e === S) return "<>";
149
+ if (typeof e == "object" && e !== null && e.$$typeof === A)
150
+ return "<...>";
391
151
  try {
392
- return ye(e), !1;
152
+ var o = r(e);
153
+ return o ? "<" + o + ">" : "<...>";
393
154
  } catch {
394
- return !0;
155
+ return "<...>";
395
156
  }
396
157
  }
397
- function ye(e) {
398
- return "" + e;
399
- }
400
- function ge(e) {
401
- if (Ze(e))
402
- return T("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", He(e)), ye(e);
158
+ function t() {
159
+ var e = j.A;
160
+ return e === null ? null : e.getOwner();
403
161
  }
404
- var be = S.ReactCurrentOwner, Qe = {
405
- key: !0,
406
- ref: !0,
407
- __self: !0,
408
- __source: !0
409
- }, he, me;
410
- function er(e) {
411
- if (W.call(e, "ref")) {
412
- var r = Object.getOwnPropertyDescriptor(e, "ref").get;
413
- if (r && r.isReactWarning)
414
- return !1;
415
- }
416
- return e.ref !== void 0;
162
+ function c() {
163
+ return Error("react-stack-top-frame");
417
164
  }
418
- function rr(e) {
419
- if (W.call(e, "key")) {
420
- var r = Object.getOwnPropertyDescriptor(e, "key").get;
421
- if (r && r.isReactWarning)
422
- return !1;
165
+ function f(e) {
166
+ if (Y.call(e, "key")) {
167
+ var o = Object.getOwnPropertyDescriptor(e, "key").get;
168
+ if (o && o.isReactWarning) return !1;
423
169
  }
424
170
  return e.key !== void 0;
425
171
  }
426
- function tr(e, r) {
427
- typeof e.ref == "string" && be.current;
428
- }
429
- function nr(e, r) {
430
- {
431
- var t = function() {
432
- he || (he = !0, T("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
433
- };
434
- t.isReactWarning = !0, Object.defineProperty(e, "key", {
435
- get: t,
436
- configurable: !0
437
- });
438
- }
439
- }
440
- function ar(e, r) {
441
- {
442
- var t = function() {
443
- me || (me = !0, T("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
444
- };
445
- t.isReactWarning = !0, Object.defineProperty(e, "ref", {
446
- get: t,
447
- configurable: !0
448
- });
172
+ function u(e, o) {
173
+ function i() {
174
+ D || (D = !0, console.error(
175
+ "%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
176
+ o
177
+ ));
449
178
  }
450
- }
451
- var or = function(e, r, t, n, s, d, o) {
452
- var a = {
453
- // This tag allows us to uniquely identify this as a React Element
454
- $$typeof: i,
455
- // Built-in properties that belong on the element
179
+ i.isReactWarning = !0, Object.defineProperty(e, "key", {
180
+ get: i,
181
+ configurable: !0
182
+ });
183
+ }
184
+ function p() {
185
+ var e = r(this.type);
186
+ return M[e] || (M[e] = !0, console.error(
187
+ "Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
188
+ )), e = this.props.ref, e !== void 0 ? e : null;
189
+ }
190
+ function v(e, o, i, m, w, C) {
191
+ var b = i.ref;
192
+ return e = {
193
+ $$typeof: _,
456
194
  type: e,
457
- key: r,
458
- ref: t,
459
- props: o,
460
- // Record the component responsible for creating this element.
461
- _owner: d
462
- };
463
- return a._store = {}, Object.defineProperty(a._store, "validated", {
195
+ key: o,
196
+ props: i,
197
+ _owner: m
198
+ }, (b !== void 0 ? b : null) !== null ? Object.defineProperty(e, "ref", {
199
+ enumerable: !1,
200
+ get: p
201
+ }) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
464
202
  configurable: !1,
465
203
  enumerable: !1,
466
204
  writable: !0,
467
- value: !1
468
- }), Object.defineProperty(a, "_self", {
205
+ value: 0
206
+ }), Object.defineProperty(e, "_debugInfo", {
469
207
  configurable: !1,
470
208
  enumerable: !1,
471
- writable: !1,
472
- value: n
473
- }), Object.defineProperty(a, "_source", {
209
+ writable: !0,
210
+ value: null
211
+ }), Object.defineProperty(e, "_debugStack", {
474
212
  configurable: !1,
475
213
  enumerable: !1,
476
- writable: !1,
477
- value: s
478
- }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
479
- };
480
- function ir(e, r, t, n, s) {
481
- {
482
- var d, o = {}, a = null, O = null;
483
- t !== void 0 && (ge(t), a = "" + t), rr(r) && (ge(r.key), a = "" + r.key), er(r) && (O = r.ref, tr(r, s));
484
- for (d in r)
485
- W.call(r, d) && !Qe.hasOwnProperty(d) && (o[d] = r[d]);
486
- if (e && e.defaultProps) {
487
- var h = e.defaultProps;
488
- for (d in h)
489
- o[d] === void 0 && (o[d] = h[d]);
490
- }
491
- if (a || O) {
492
- var E = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
493
- a && nr(o, E), O && ar(o, E);
494
- }
495
- return or(e, a, O, s, n, be.current, o);
496
- }
497
- }
498
- var H = S.ReactCurrentOwner, Ee = S.ReactDebugCurrentFrame;
499
- function I(e) {
500
- if (e) {
501
- var r = e._owner, t = U(e.type, e._source, r ? r.type : null);
502
- Ee.setExtraStackFrame(t);
503
- } else
504
- Ee.setExtraStackFrame(null);
505
- }
506
- var Z;
507
- Z = !1;
508
- function Q(e) {
509
- return typeof e == "object" && e !== null && e.$$typeof === i;
510
- }
511
- function Re() {
512
- {
513
- if (H.current) {
514
- var e = D(H.current.type);
515
- if (e)
516
- return `
517
-
518
- Check the render method of \`` + e + "`.";
519
- }
520
- return "";
521
- }
522
- }
523
- function ur(e) {
524
- return "";
525
- }
526
- var _e = {};
527
- function sr(e) {
528
- {
529
- var r = Re();
530
- if (!r) {
531
- var t = typeof e == "string" ? e : e.displayName || e.name;
532
- t && (r = `
533
-
534
- Check the top-level render call using <` + t + ">.");
535
- }
536
- return r;
537
- }
538
- }
539
- function Se(e, r) {
540
- {
541
- if (!e._store || e._store.validated || e.key != null)
542
- return;
543
- e._store.validated = !0;
544
- var t = sr(r);
545
- if (_e[t])
546
- return;
547
- _e[t] = !0;
548
- var n = "";
549
- e && e._owner && e._owner !== H.current && (n = " It was passed a child from " + D(e._owner.type) + "."), I(e), T('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), I(null);
550
- }
551
- }
552
- function Te(e, r) {
553
- {
554
- if (typeof e != "object")
555
- return;
556
- if (X(e))
557
- for (var t = 0; t < e.length; t++) {
558
- var n = e[t];
559
- Q(n) && Se(n, r);
560
- }
561
- else if (Q(e))
562
- e._store && (e._store.validated = !0);
563
- else if (e) {
564
- var s = R(e);
565
- if (typeof s == "function" && s !== e.entries)
566
- for (var d = s.call(e), o; !(o = d.next()).done; )
567
- Q(o.value) && Se(o.value, r);
568
- }
569
- }
570
- }
571
- function cr(e) {
572
- {
573
- var r = e.type;
574
- if (r == null || typeof r == "string")
575
- return;
576
- var t;
577
- if (typeof r == "function")
578
- t = r.propTypes;
579
- else if (typeof r == "object" && (r.$$typeof === l || // Note: Memo only checks outer props here.
580
- // Inner props are checked in the reconciler.
581
- r.$$typeof === _))
582
- t = r.propTypes;
583
- else
584
- return;
585
- if (t) {
586
- var n = D(r);
587
- Ge(t, e.props, "prop", n, e);
588
- } else if (r.PropTypes !== void 0 && !Z) {
589
- Z = !0;
590
- var s = D(r);
591
- T("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", s || "Unknown");
592
- }
593
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && T("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
594
- }
595
- }
596
- function fr(e) {
597
- {
598
- for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
599
- var n = r[t];
600
- if (n !== "children" && n !== "key") {
601
- I(e), T("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), I(null);
602
- break;
603
- }
604
- }
605
- e.ref !== null && (I(e), T("Invalid attribute `ref` supplied to `React.Fragment`."), I(null));
606
- }
607
- }
608
- var Oe = {};
609
- function Pe(e, r, t, n, s, d) {
610
- {
611
- var o = Ne(e);
612
- if (!o) {
613
- var a = "";
614
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
615
- var O = ur();
616
- O ? a += O : a += Re();
617
- var h;
618
- e === null ? h = "null" : X(e) ? h = "array" : e !== void 0 && e.$$typeof === i ? (h = "<" + (D(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : h = typeof e, T("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", h, a);
619
- }
620
- var E = ir(e, r, t, s, d);
621
- if (E == null)
622
- return E;
623
- if (o) {
624
- var x = r.children;
625
- if (x !== void 0)
626
- if (n)
627
- if (X(x)) {
628
- for (var $ = 0; $ < x.length; $++)
629
- Te(x[$], e);
630
- Object.freeze && Object.freeze(x);
631
- } else
632
- T("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
633
- else
634
- Te(x, e);
635
- }
636
- if (W.call(r, "key")) {
637
- var F = D(e), C = Object.keys(r).filter(function(gr) {
638
- return gr !== "key";
639
- }), ee = C.length > 0 ? "{key: someKey, " + C.join(": ..., ") + ": ...}" : "{key: someKey}";
640
- if (!Oe[F + ee]) {
641
- var yr = C.length > 0 ? "{" + C.join(": ..., ") + ": ...}" : "{}";
642
- T(`A props object containing a "key" prop is being spread into JSX:
214
+ writable: !0,
215
+ value: w
216
+ }), Object.defineProperty(e, "_debugTask", {
217
+ configurable: !1,
218
+ enumerable: !1,
219
+ writable: !0,
220
+ value: C
221
+ }), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
222
+ }
223
+ function l(e, o, i, m, w, C) {
224
+ var b = o.children;
225
+ if (b !== void 0)
226
+ if (m)
227
+ if (ue(b)) {
228
+ for (m = 0; m < b.length; m++)
229
+ R(b[m]);
230
+ Object.freeze && Object.freeze(b);
231
+ } else
232
+ console.error(
233
+ "React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
234
+ );
235
+ else R(b);
236
+ if (Y.call(o, "key")) {
237
+ b = r(e);
238
+ var y = Object.keys(o).filter(function(le) {
239
+ return le !== "key";
240
+ });
241
+ m = 0 < y.length ? "{key: someKey, " + y.join(": ..., ") + ": ...}" : "{key: someKey}", z[b + m] || (y = 0 < y.length ? "{" + y.join(": ..., ") + ": ...}" : "{}", console.error(
242
+ `A props object containing a "key" prop is being spread into JSX:
643
243
  let props = %s;
644
244
  <%s {...props} />
645
245
  React keys must be passed directly to JSX without using spread:
646
246
  let props = %s;
647
- <%s key={someKey} {...props} />`, ee, F, yr, F), Oe[F + ee] = !0;
648
- }
649
- }
650
- return e === f ? fr(E) : cr(E), E;
247
+ <%s key={someKey} {...props} />`,
248
+ m,
249
+ b,
250
+ y,
251
+ b
252
+ ), z[b + m] = !0);
651
253
  }
254
+ if (b = null, i !== void 0 && (a(i), b = "" + i), f(o) && (a(o.key), b = "" + o.key), "key" in o) {
255
+ i = {};
256
+ for (var V in o)
257
+ V !== "key" && (i[V] = o[V]);
258
+ } else i = o;
259
+ return b && u(
260
+ i,
261
+ typeof e == "function" ? e.displayName || e.name || "Unknown" : e
262
+ ), v(
263
+ e,
264
+ b,
265
+ i,
266
+ t(),
267
+ w,
268
+ C
269
+ );
652
270
  }
653
- function lr(e, r, t) {
654
- return Pe(e, r, t, !0);
271
+ function R(e) {
272
+ T(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === A && (e._payload.status === "fulfilled" ? T(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
655
273
  }
656
- function dr(e, r, t) {
657
- return Pe(e, r, t, !1);
274
+ function T(e) {
275
+ return typeof e == "object" && e !== null && e.$$typeof === _;
658
276
  }
659
- var vr = dr, pr = lr;
660
- M.Fragment = f, M.jsx = vr, M.jsxs = pr;
661
- })()), M;
277
+ var E = ie, _ = Symbol.for("react.transitional.element"), d = Symbol.for("react.portal"), S = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), K = Symbol.for("react.profiler"), ee = Symbol.for("react.consumer"), te = Symbol.for("react.context"), re = Symbol.for("react.forward_ref"), ne = Symbol.for("react.suspense"), oe = Symbol.for("react.suspense_list"), ae = Symbol.for("react.memo"), A = Symbol.for("react.lazy"), se = Symbol.for("react.activity"), ce = Symbol.for("react.client.reference"), j = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Y = Object.prototype.hasOwnProperty, ue = Array.isArray, N = console.createTask ? console.createTask : function() {
278
+ return null;
279
+ };
280
+ E = {
281
+ react_stack_bottom_frame: function(e) {
282
+ return e();
283
+ }
284
+ };
285
+ var D, M = {}, F = E.react_stack_bottom_frame.bind(
286
+ E,
287
+ c
288
+ )(), L = N(s(c)), z = {};
289
+ k.Fragment = S, k.jsx = function(e, o, i) {
290
+ var m = 1e4 > j.recentlyCreatedOwnerStacks++;
291
+ return l(
292
+ e,
293
+ o,
294
+ i,
295
+ !1,
296
+ m ? Error("react-stack-top-frame") : F,
297
+ m ? N(s(e)) : L
298
+ );
299
+ }, k.jsxs = function(e, o, i) {
300
+ var m = 1e4 > j.recentlyCreatedOwnerStacks++;
301
+ return l(
302
+ e,
303
+ o,
304
+ i,
305
+ !0,
306
+ m ? Error("react-stack-top-frame") : F,
307
+ m ? N(s(e)) : L
308
+ );
309
+ };
310
+ })()), k;
662
311
  }
663
- var xe;
664
- function xr() {
665
- return xe || (xe = 1, process.env.NODE_ENV === "production" ? q.exports = Cr() : q.exports = wr()), q.exports;
312
+ var q;
313
+ function ye() {
314
+ return q || (q = 1, process.env.NODE_ENV === "production" ? x.exports = Re() : x.exports = Te()), x.exports;
666
315
  }
667
- var jr = xr();
668
- const Fe = br({
316
+ var ge = ye();
317
+ const Z = fe({
669
318
  stateVocab: {},
670
319
  setStateVocab: () => {
671
320
  }
672
321
  });
673
- function kr() {
674
- return mr(Fe);
322
+ function he() {
323
+ return me(Z);
675
324
  }
676
- const Ar = (v) => {
677
- const { children: i, verbose: u } = v, [f, c] = hr({});
678
- return u && Pr(f), /* @__PURE__ */ jr.jsx(Fe.Provider, { value: { stateVocab: f, setStateVocab: c }, children: i });
325
+ const we = (r) => {
326
+ const { children: n, verbose: a } = r, [s, t] = de({});
327
+ return a && Se(s), /* @__PURE__ */ ge.jsx(Z.Provider, { value: { stateVocab: s, setStateVocab: t }, children: n });
328
+ }, P = (r, n) => (a) => {
329
+ const s = { ...a };
330
+ return Ee(s, r, n), s;
331
+ }, I = (r, n) => typeof r == "function" ? r() : r ?? n, G = (r) => {
332
+ const { serialized: n, defaultValue: a, superDefaultValue: s, deserialize: t } = r;
333
+ if (n === null) {
334
+ const c = I(a, s);
335
+ return typeof c > "u" ? void 0 : c;
336
+ }
337
+ return t(n);
679
338
  };
680
- function Fr(v = {}) {
339
+ function xe(r = {}) {
681
340
  const {
682
- storage: i,
683
- serialize: u = JSON.stringify,
684
- deserialize: f = JSON.parse,
685
- defaultValue: c
686
- } = v;
341
+ storage: n,
342
+ serialize: a = JSON.stringify,
343
+ deserialize: s = JSON.parse
344
+ } = r, t = r.defaultValue, c = r.bidirectional;
687
345
  return {
688
- [Ae]: !0,
346
+ [H]: !0,
689
347
  // marks this object as a leaf in the router tree
690
- [K]: "",
348
+ [O]: "",
691
349
  // placeholder; injected at runtime by injectPaths()
692
- useState(b, m) {
693
- m ??= {};
694
- const y = Or(
695
- m.onSet ?? (() => {
350
+ useState(f, u) {
351
+ u ??= {};
352
+ const p = _e(
353
+ u.onSet ?? (() => {
696
354
  }),
697
- m.delayedSet,
355
+ u.delayedSet,
698
356
  []
699
- ), l = kr(), p = this[K], g = () => typeof b == "function" ? b() : b ?? c, _ = re(
357
+ ), v = he(), l = this[O], R = $(
700
358
  () => {
701
- if (!i)
359
+ if (!n)
702
360
  return;
703
- const P = i.getItem(p);
704
- let R;
705
- if (P === null) {
706
- const S = g();
707
- if (typeof S > "u")
708
- return;
709
- R = S;
710
- } else
711
- R = f(P);
712
- return R;
361
+ const _ = n.getItem(l);
362
+ return G({
363
+ serialized: _,
364
+ defaultValue: f,
365
+ superDefaultValue: t,
366
+ deserialize: s
367
+ });
713
368
  },
714
369
  // eslint-disable-next-line react-hooks/exhaustive-deps
715
- [p]
716
- ), w = re(
717
- () => _r(
718
- l.stateVocab,
719
- p,
720
- _ ?? g()
370
+ [l]
371
+ ), T = $(
372
+ () => ve(
373
+ v.stateVocab,
374
+ l,
375
+ R ?? I(f, t)
721
376
  ),
722
377
  // eslint-disable-next-line react-hooks/exhaustive-deps
723
378
  [
724
- l.stateVocab,
725
- _,
726
- p
379
+ v.stateVocab,
380
+ R,
381
+ l
727
382
  ]
728
- ), k = (P) => (R) => {
729
- const S = { ...R };
730
- return Sr(S, p, P), S;
731
- };
732
- Er(
383
+ );
384
+ W(
733
385
  () => {
734
- !i || typeof _ > "u" || l.setStateVocab(k(_));
386
+ !n || typeof R > "u" || v.setStateVocab(P(l, R));
735
387
  },
736
388
  // eslint-disable-next-line react-hooks/exhaustive-deps
737
- [_]
738
- );
739
- const j = Rr(w);
389
+ [R]
390
+ ), W(() => {
391
+ if (!u.bidirectional && !c)
392
+ return;
393
+ const _ = (d) => {
394
+ if (d.key !== l)
395
+ return;
396
+ const S = d.newValue, g = G({
397
+ serialized: S,
398
+ defaultValue: f,
399
+ superDefaultValue: t,
400
+ deserialize: s
401
+ });
402
+ v.setStateVocab(P(l, g)), p(g, E.current), E.current = g;
403
+ };
404
+ return window.addEventListener("storage", _), () => window.removeEventListener("storage", _);
405
+ }, [
406
+ l,
407
+ u.bidirectional,
408
+ c
409
+ ]);
410
+ const E = be(T);
740
411
  return [
741
- w,
742
- function(R) {
743
- const S = typeof R == "function" ? R(j.current) : R;
744
- l.setStateVocab(k(S)), y(S, j.current), i && i.setItem(p, u(S)), j.current = S;
412
+ T,
413
+ function(d) {
414
+ const S = typeof d == "function" ? d(E.current) : d;
415
+ v.setStateVocab(P(l, S)), p(S, E.current), n && n.setItem(l, a(S)), E.current = S;
745
416
  },
746
417
  function() {
747
- const R = g();
748
- if (typeof R > "u") {
749
- i?.removeItem(p);
418
+ const d = I(f, t);
419
+ if (typeof d > "u") {
420
+ n?.removeItem(l);
750
421
  return;
751
422
  }
752
- l.setStateVocab(k(R)), y(R, j.current), j.current = R, i && i.setItem(p, u(R));
423
+ v.setStateVocab(P(l, d)), p(d, E.current), E.current = d, n && n.setItem(l, a(d));
753
424
  }
754
425
  ];
755
426
  },
756
427
  /** Returns the fully qualified job name (dot-separated path). */
757
428
  toString() {
758
- return this[K];
429
+ return this[O];
759
430
  }
760
431
  };
761
432
  }
762
- const je = /* @__PURE__ */ new WeakMap(), ke = /* @__PURE__ */ new WeakMap();
763
- function Ie(v, i = "") {
764
- let u = je.get(v);
765
- u || (u = /* @__PURE__ */ new Map(), je.set(v, u));
766
- const f = u.get(i);
767
- if (f)
768
- return f;
769
- const c = new Proxy(v, {
770
- get(b, m) {
771
- const y = b[m], l = i ? `${i}.${String(m)}` : String(m);
772
- if (y && typeof y == "object" && Ae in y) {
773
- const p = y;
774
- let g = ke.get(p);
775
- g || (g = /* @__PURE__ */ new Map(), ke.set(p, g));
776
- const _ = g.get(l);
777
- if (_)
778
- return _;
779
- const w = Reflect.ownKeys(p).filter(
780
- (P) => typeof p[P] == "function"
781
- ), k = Object.fromEntries(
782
- w.map((P) => [
783
- P,
784
- (...R) => p[P].call(
785
- { ...p, [K]: l },
786
- ...R
433
+ const X = /* @__PURE__ */ new WeakMap(), B = /* @__PURE__ */ new WeakMap();
434
+ function Q(r, n = "") {
435
+ let a = X.get(r);
436
+ a || (a = /* @__PURE__ */ new Map(), X.set(r, a));
437
+ const s = a.get(n);
438
+ if (s)
439
+ return s;
440
+ const t = new Proxy(r, {
441
+ get(c, f) {
442
+ const u = c[f], p = n ? `${n}.${String(f)}` : String(f);
443
+ if (u && typeof u == "object" && H in u) {
444
+ const v = u;
445
+ let l = B.get(v);
446
+ l || (l = /* @__PURE__ */ new Map(), B.set(v, l));
447
+ const R = l.get(p);
448
+ if (R)
449
+ return R;
450
+ const T = Reflect.ownKeys(v).filter(
451
+ (d) => typeof v[d] == "function"
452
+ ), E = Object.fromEntries(
453
+ T.map((d) => [
454
+ d,
455
+ (...S) => v[d].call(
456
+ { ...v, [O]: p },
457
+ ...S
787
458
  )
788
459
  ])
789
- ), j = { ...p, ...k };
790
- return g.set(l, j), j;
460
+ ), _ = { ...v, ...E };
461
+ return l.set(p, _), _;
791
462
  }
792
- return y && typeof y == "object" ? Ie(y, l) : y;
463
+ return u && typeof u == "object" ? Q(u, p) : u;
793
464
  }
794
465
  });
795
- return u.set(i, c), c;
466
+ return a.set(n, t), t;
796
467
  }
797
- function Ir(v) {
798
- return Ie(v);
468
+ function Pe(r) {
469
+ return Q(r);
799
470
  }
800
471
  export {
801
- Ar as StorageProvider,
802
- Fr as defineState,
803
- Ir as setupStorage
472
+ we as StorageProvider,
473
+ xe as defineState,
474
+ Pe as setupStorage
804
475
  };