@instantdb/react-common 0.22.104 → 0.22.105-experimental.fix1111111.21050884263.1
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/standalone/index.js +279 -275
- package/dist/standalone/index.umd.cjs +10 -10
- package/package.json +3 -3
package/dist/standalone/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
var Ms = Object.defineProperty;
|
|
2
2
|
var js = (t, e, n) => e in t ? Ms(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
3
|
var p = (t, e, n) => js(t, typeof e != "symbol" ? e + "" : e, n);
|
|
4
|
-
import yr, { useRef as Ke, useCallback as le, useSyncExternalStore as
|
|
5
|
-
var
|
|
4
|
+
import yr, { useRef as Ke, useCallback as le, useSyncExternalStore as It, useEffect as be, useMemo as Mt, useState as br } from "react";
|
|
5
|
+
var jt = { exports: {} }, Me = {};
|
|
6
6
|
/**
|
|
7
7
|
* @license React
|
|
8
8
|
* react-jsx-runtime.production.min.js
|
|
@@ -12,10 +12,10 @@ var Mt = { exports: {} }, Me = {};
|
|
|
12
12
|
* This source code is licensed under the MIT license found in the
|
|
13
13
|
* LICENSE file in the root directory of this source tree.
|
|
14
14
|
*/
|
|
15
|
-
var
|
|
15
|
+
var Rn;
|
|
16
16
|
function Rs() {
|
|
17
|
-
if (
|
|
18
|
-
|
|
17
|
+
if (Rn) return Me;
|
|
18
|
+
Rn = 1;
|
|
19
19
|
var t = yr, e = Symbol.for("react.element"), n = Symbol.for("react.fragment"), r = Object.prototype.hasOwnProperty, s = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
20
20
|
function o(a, c, u) {
|
|
21
21
|
var l, d = {}, h = null, y = null;
|
|
@@ -26,10 +26,10 @@ function Rs() {
|
|
|
26
26
|
}
|
|
27
27
|
return Me.Fragment = n, Me.jsx = o, Me.jsxs = o, Me;
|
|
28
28
|
}
|
|
29
|
-
var je = {},
|
|
29
|
+
var je = {}, $n;
|
|
30
30
|
function $s() {
|
|
31
|
-
if (
|
|
32
|
-
|
|
31
|
+
if ($n) return je;
|
|
32
|
+
$n = 1;
|
|
33
33
|
var t = {};
|
|
34
34
|
/**
|
|
35
35
|
* @license React
|
|
@@ -130,18 +130,18 @@ function $s() {
|
|
|
130
130
|
}
|
|
131
131
|
return null;
|
|
132
132
|
}
|
|
133
|
-
var re = Object.assign, ue = 0,
|
|
134
|
-
function
|
|
133
|
+
var re = Object.assign, ue = 0, ln, fn, dn, hn, pn, yn, bn;
|
|
134
|
+
function _n() {
|
|
135
135
|
}
|
|
136
|
-
|
|
136
|
+
_n.__reactDisabledLog = !0;
|
|
137
137
|
function ss() {
|
|
138
138
|
{
|
|
139
139
|
if (ue === 0) {
|
|
140
|
-
|
|
140
|
+
ln = console.log, fn = console.info, dn = console.warn, hn = console.error, pn = console.group, yn = console.groupCollapsed, bn = console.groupEnd;
|
|
141
141
|
var f = {
|
|
142
142
|
configurable: !0,
|
|
143
143
|
enumerable: !0,
|
|
144
|
-
value:
|
|
144
|
+
value: _n,
|
|
145
145
|
writable: !0
|
|
146
146
|
};
|
|
147
147
|
Object.defineProperties(console, {
|
|
@@ -167,25 +167,25 @@ function $s() {
|
|
|
167
167
|
};
|
|
168
168
|
Object.defineProperties(console, {
|
|
169
169
|
log: re({}, f, {
|
|
170
|
-
value:
|
|
170
|
+
value: ln
|
|
171
171
|
}),
|
|
172
172
|
info: re({}, f, {
|
|
173
|
-
value:
|
|
173
|
+
value: fn
|
|
174
174
|
}),
|
|
175
175
|
warn: re({}, f, {
|
|
176
|
-
value:
|
|
176
|
+
value: dn
|
|
177
177
|
}),
|
|
178
178
|
error: re({}, f, {
|
|
179
|
-
value:
|
|
179
|
+
value: hn
|
|
180
180
|
}),
|
|
181
181
|
group: re({}, f, {
|
|
182
|
-
value:
|
|
182
|
+
value: pn
|
|
183
183
|
}),
|
|
184
184
|
groupCollapsed: re({}, f, {
|
|
185
|
-
value:
|
|
185
|
+
value: yn
|
|
186
186
|
}),
|
|
187
187
|
groupEnd: re({}, f, {
|
|
188
|
-
value:
|
|
188
|
+
value: bn
|
|
189
189
|
})
|
|
190
190
|
});
|
|
191
191
|
}
|
|
@@ -211,7 +211,7 @@ function $s() {
|
|
|
211
211
|
var os = typeof WeakMap == "function" ? WeakMap : Map;
|
|
212
212
|
Be = new os();
|
|
213
213
|
}
|
|
214
|
-
function
|
|
214
|
+
function gn(f, _) {
|
|
215
215
|
if (!f || bt)
|
|
216
216
|
return "";
|
|
217
217
|
{
|
|
@@ -283,7 +283,7 @@ function $s() {
|
|
|
283
283
|
return typeof f == "function" && Be.set(f, fe), fe;
|
|
284
284
|
}
|
|
285
285
|
function as(f, _, S) {
|
|
286
|
-
return
|
|
286
|
+
return gn(f, !1);
|
|
287
287
|
}
|
|
288
288
|
function cs(f) {
|
|
289
289
|
var _ = f.prototype;
|
|
@@ -293,7 +293,7 @@ function $s() {
|
|
|
293
293
|
if (f == null)
|
|
294
294
|
return "";
|
|
295
295
|
if (typeof f == "function")
|
|
296
|
-
return
|
|
296
|
+
return gn(f, cs(f));
|
|
297
297
|
if (typeof f == "string")
|
|
298
298
|
return Qe(f);
|
|
299
299
|
switch (f) {
|
|
@@ -318,13 +318,13 @@ function $s() {
|
|
|
318
318
|
}
|
|
319
319
|
return "";
|
|
320
320
|
}
|
|
321
|
-
var Ie = Object.prototype.hasOwnProperty,
|
|
321
|
+
var Ie = Object.prototype.hasOwnProperty, Tn = {}, wn = T.ReactDebugCurrentFrame;
|
|
322
322
|
function He(f) {
|
|
323
323
|
if (f) {
|
|
324
324
|
var _ = f._owner, S = Ge(f.type, f._source, _ ? _.type : null);
|
|
325
|
-
|
|
325
|
+
wn.setExtraStackFrame(S);
|
|
326
326
|
} else
|
|
327
|
-
|
|
327
|
+
wn.setExtraStackFrame(null);
|
|
328
328
|
}
|
|
329
329
|
function us(f, _, S, O, I) {
|
|
330
330
|
{
|
|
@@ -341,7 +341,7 @@ function $s() {
|
|
|
341
341
|
} catch ($) {
|
|
342
342
|
k = $;
|
|
343
343
|
}
|
|
344
|
-
k && !(k instanceof Error) && (He(I), v("%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).", O || "React class", S, C, typeof k), He(null)), k instanceof Error && !(k.message in
|
|
344
|
+
k && !(k instanceof Error) && (He(I), v("%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).", O || "React class", S, C, typeof k), He(null)), k instanceof Error && !(k.message in Tn) && (Tn[k.message] = !0, He(I), v("Failed %s type: %s", S, k.message), He(null));
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
}
|
|
@@ -357,24 +357,24 @@ function $s() {
|
|
|
357
357
|
}
|
|
358
358
|
function ds(f) {
|
|
359
359
|
try {
|
|
360
|
-
return
|
|
360
|
+
return mn(f), !1;
|
|
361
361
|
} catch {
|
|
362
362
|
return !0;
|
|
363
363
|
}
|
|
364
364
|
}
|
|
365
|
-
function
|
|
365
|
+
function mn(f) {
|
|
366
366
|
return "" + f;
|
|
367
367
|
}
|
|
368
|
-
function
|
|
368
|
+
function Sn(f) {
|
|
369
369
|
if (ds(f))
|
|
370
|
-
return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", fs(f)),
|
|
370
|
+
return v("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", fs(f)), mn(f);
|
|
371
371
|
}
|
|
372
|
-
var
|
|
372
|
+
var vn = T.ReactCurrentOwner, hs = {
|
|
373
373
|
key: !0,
|
|
374
374
|
ref: !0,
|
|
375
375
|
__self: !0,
|
|
376
376
|
__source: !0
|
|
377
|
-
},
|
|
377
|
+
}, An, On;
|
|
378
378
|
function ps(f) {
|
|
379
379
|
if (Ie.call(f, "ref")) {
|
|
380
380
|
var _ = Object.getOwnPropertyDescriptor(f, "ref").get;
|
|
@@ -392,12 +392,12 @@ function $s() {
|
|
|
392
392
|
return f.key !== void 0;
|
|
393
393
|
}
|
|
394
394
|
function bs(f, _) {
|
|
395
|
-
typeof f.ref == "string" &&
|
|
395
|
+
typeof f.ref == "string" && vn.current;
|
|
396
396
|
}
|
|
397
397
|
function _s(f, _) {
|
|
398
398
|
{
|
|
399
399
|
var S = function() {
|
|
400
|
-
|
|
400
|
+
An || (An = !0, v("%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)", _));
|
|
401
401
|
};
|
|
402
402
|
S.isReactWarning = !0, Object.defineProperty(f, "key", {
|
|
403
403
|
get: S,
|
|
@@ -408,7 +408,7 @@ function $s() {
|
|
|
408
408
|
function gs(f, _) {
|
|
409
409
|
{
|
|
410
410
|
var S = function() {
|
|
411
|
-
|
|
411
|
+
On || (On = !0, v("%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)", _));
|
|
412
412
|
};
|
|
413
413
|
S.isReactWarning = !0, Object.defineProperty(f, "ref", {
|
|
414
414
|
get: S,
|
|
@@ -448,7 +448,7 @@ function $s() {
|
|
|
448
448
|
function ws(f, _, S, O, I) {
|
|
449
449
|
{
|
|
450
450
|
var M, C = {}, k = null, z = null;
|
|
451
|
-
S !== void 0 && (
|
|
451
|
+
S !== void 0 && (Sn(S), k = "" + S), ys(_) && (Sn(_.key), k = "" + _.key), ps(_) && (z = _.ref, bs(_, I));
|
|
452
452
|
for (M in _)
|
|
453
453
|
Ie.call(_, M) && !hs.hasOwnProperty(M) && (C[M] = _[M]);
|
|
454
454
|
if (f && f.defaultProps) {
|
|
@@ -460,23 +460,23 @@ function $s() {
|
|
|
460
460
|
var x = typeof f == "function" ? f.displayName || f.name || "Unknown" : f;
|
|
461
461
|
k && _s(C, x), z && gs(C, x);
|
|
462
462
|
}
|
|
463
|
-
return Ts(f, k, z, I, O,
|
|
463
|
+
return Ts(f, k, z, I, O, vn.current, C);
|
|
464
464
|
}
|
|
465
465
|
}
|
|
466
|
-
var gt = T.ReactCurrentOwner,
|
|
466
|
+
var gt = T.ReactCurrentOwner, En = T.ReactDebugCurrentFrame;
|
|
467
467
|
function we(f) {
|
|
468
468
|
if (f) {
|
|
469
469
|
var _ = f._owner, S = Ge(f.type, f._source, _ ? _.type : null);
|
|
470
|
-
|
|
470
|
+
En.setExtraStackFrame(S);
|
|
471
471
|
} else
|
|
472
|
-
|
|
472
|
+
En.setExtraStackFrame(null);
|
|
473
473
|
}
|
|
474
474
|
var Tt;
|
|
475
475
|
Tt = !1;
|
|
476
476
|
function wt(f) {
|
|
477
477
|
return typeof f == "object" && f !== null && f.$$typeof === n;
|
|
478
478
|
}
|
|
479
|
-
function
|
|
479
|
+
function kn() {
|
|
480
480
|
{
|
|
481
481
|
if (gt.current) {
|
|
482
482
|
var f = X(gt.current.type);
|
|
@@ -491,10 +491,10 @@ Check the render method of \`` + f + "`.";
|
|
|
491
491
|
function ms(f) {
|
|
492
492
|
return "";
|
|
493
493
|
}
|
|
494
|
-
var
|
|
494
|
+
var Pn = {};
|
|
495
495
|
function Ss(f) {
|
|
496
496
|
{
|
|
497
|
-
var _ =
|
|
497
|
+
var _ = kn();
|
|
498
498
|
if (!_) {
|
|
499
499
|
var S = typeof f == "string" ? f : f.displayName || f.name;
|
|
500
500
|
S && (_ = `
|
|
@@ -504,27 +504,27 @@ Check the top-level render call using <` + S + ">.");
|
|
|
504
504
|
return _;
|
|
505
505
|
}
|
|
506
506
|
}
|
|
507
|
-
function
|
|
507
|
+
function Cn(f, _) {
|
|
508
508
|
{
|
|
509
509
|
if (!f._store || f._store.validated || f.key != null)
|
|
510
510
|
return;
|
|
511
511
|
f._store.validated = !0;
|
|
512
512
|
var S = Ss(_);
|
|
513
|
-
if (
|
|
513
|
+
if (Pn[S])
|
|
514
514
|
return;
|
|
515
|
-
|
|
515
|
+
Pn[S] = !0;
|
|
516
516
|
var O = "";
|
|
517
517
|
f && f._owner && f._owner !== gt.current && (O = " It was passed a child from " + X(f._owner.type) + "."), we(f), v('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', S, O), we(null);
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
|
-
function
|
|
520
|
+
function In(f, _) {
|
|
521
521
|
{
|
|
522
522
|
if (typeof f != "object")
|
|
523
523
|
return;
|
|
524
524
|
if (_t(f))
|
|
525
525
|
for (var S = 0; S < f.length; S++) {
|
|
526
526
|
var O = f[S];
|
|
527
|
-
wt(O) &&
|
|
527
|
+
wt(O) && Cn(O, _);
|
|
528
528
|
}
|
|
529
529
|
else if (wt(f))
|
|
530
530
|
f._store && (f._store.validated = !0);
|
|
@@ -532,7 +532,7 @@ Check the top-level render call using <` + S + ">.");
|
|
|
532
532
|
var I = m(f);
|
|
533
533
|
if (typeof I == "function" && I !== f.entries)
|
|
534
534
|
for (var M = I.call(f), C; !(C = M.next()).done; )
|
|
535
|
-
wt(C.value) &&
|
|
535
|
+
wt(C.value) && Cn(C.value, _);
|
|
536
536
|
}
|
|
537
537
|
}
|
|
538
538
|
}
|
|
@@ -573,15 +573,15 @@ Check the top-level render call using <` + S + ">.");
|
|
|
573
573
|
f.ref !== null && (we(f), v("Invalid attribute `ref` supplied to `React.Fragment`."), we(null));
|
|
574
574
|
}
|
|
575
575
|
}
|
|
576
|
-
var
|
|
577
|
-
function
|
|
576
|
+
var Mn = {};
|
|
577
|
+
function jn(f, _, S, O, I, M) {
|
|
578
578
|
{
|
|
579
579
|
var C = dt(f);
|
|
580
580
|
if (!C) {
|
|
581
581
|
var k = "";
|
|
582
582
|
(f === void 0 || typeof f == "object" && f !== null && Object.keys(f).length === 0) && (k += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
583
583
|
var z = ms();
|
|
584
|
-
z ? k += z : k +=
|
|
584
|
+
z ? k += z : k += kn();
|
|
585
585
|
var $;
|
|
586
586
|
f === null ? $ = "null" : _t(f) ? $ = "array" : f !== void 0 && f.$$typeof === n ? ($ = "<" + (X(f.type) || "Unknown") + " />", k = " Did you accidentally export a JSX literal instead of a component?") : $ = typeof f, v("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", $, k);
|
|
587
587
|
}
|
|
@@ -594,43 +594,43 @@ Check the top-level render call using <` + S + ">.");
|
|
|
594
594
|
if (O)
|
|
595
595
|
if (_t(Y)) {
|
|
596
596
|
for (var me = 0; me < Y.length; me++)
|
|
597
|
-
|
|
597
|
+
In(Y[me], f);
|
|
598
598
|
Object.freeze && Object.freeze(Y);
|
|
599
599
|
} else
|
|
600
600
|
v("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
601
601
|
else
|
|
602
|
-
|
|
602
|
+
In(Y, f);
|
|
603
603
|
}
|
|
604
604
|
if (Ie.call(_, "key")) {
|
|
605
605
|
var fe = X(f), W = Object.keys(_).filter(function(Is) {
|
|
606
606
|
return Is !== "key";
|
|
607
607
|
}), mt = W.length > 0 ? "{key: someKey, " + W.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
608
|
-
if (!
|
|
608
|
+
if (!Mn[fe + mt]) {
|
|
609
609
|
var Cs = W.length > 0 ? "{" + W.join(": ..., ") + ": ...}" : "{}";
|
|
610
610
|
v(`A props object containing a "key" prop is being spread into JSX:
|
|
611
611
|
let props = %s;
|
|
612
612
|
<%s {...props} />
|
|
613
613
|
React keys must be passed directly to JSX without using spread:
|
|
614
614
|
let props = %s;
|
|
615
|
-
<%s key={someKey} {...props} />`, mt, fe, Cs, fe),
|
|
615
|
+
<%s key={someKey} {...props} />`, mt, fe, Cs, fe), Mn[fe + mt] = !0;
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
618
|
return f === s ? As(x) : vs(x), x;
|
|
619
619
|
}
|
|
620
620
|
}
|
|
621
621
|
function Os(f, _, S) {
|
|
622
|
-
return
|
|
622
|
+
return jn(f, _, S, !0);
|
|
623
623
|
}
|
|
624
624
|
function Es(f, _, S) {
|
|
625
|
-
return
|
|
625
|
+
return jn(f, _, S, !1);
|
|
626
626
|
}
|
|
627
627
|
var ks = Es, Ps = Os;
|
|
628
628
|
je.Fragment = s, je.jsx = ks, je.jsxs = Ps;
|
|
629
629
|
}(), je;
|
|
630
630
|
}
|
|
631
631
|
var Ds = {};
|
|
632
|
-
Ds.NODE_ENV === "production" ?
|
|
633
|
-
var Je =
|
|
632
|
+
Ds.NODE_ENV === "production" ? jt.exports = Rs() : jt.exports = $s();
|
|
633
|
+
var Je = jt.exports;
|
|
634
634
|
function F(t) {
|
|
635
635
|
if (typeof t == "number")
|
|
636
636
|
return (Math.abs(t * 2654435761) >>> 0).toString(16);
|
|
@@ -676,11 +676,11 @@ const D = {
|
|
|
676
676
|
}, _r = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), xs = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), tt = Symbol.iterator, J = {
|
|
677
677
|
mutable: "mutable",
|
|
678
678
|
immutable: "immutable"
|
|
679
|
-
},
|
|
679
|
+
}, Jt = {};
|
|
680
680
|
function Le(t, e) {
|
|
681
681
|
return t instanceof Map ? t.has(e) : Object.prototype.hasOwnProperty.call(t, e);
|
|
682
682
|
}
|
|
683
|
-
function
|
|
683
|
+
function Dn(t, e) {
|
|
684
684
|
if (e in t) {
|
|
685
685
|
let n = Reflect.getPrototypeOf(t);
|
|
686
686
|
for (; n; ) {
|
|
@@ -691,10 +691,10 @@ function $n(t, e) {
|
|
|
691
691
|
}
|
|
692
692
|
}
|
|
693
693
|
}
|
|
694
|
-
function
|
|
694
|
+
function Yt(t) {
|
|
695
695
|
return Object.getPrototypeOf(t) === Set.prototype;
|
|
696
696
|
}
|
|
697
|
-
function
|
|
697
|
+
function Zt(t) {
|
|
698
698
|
return Object.getPrototypeOf(t) === Map.prototype;
|
|
699
699
|
}
|
|
700
700
|
function H(t) {
|
|
@@ -707,7 +707,7 @@ function _e(t) {
|
|
|
707
707
|
function P(t) {
|
|
708
708
|
return typeof t != "object" ? null : t == null ? void 0 : t[_r];
|
|
709
709
|
}
|
|
710
|
-
function
|
|
710
|
+
function Xt(t) {
|
|
711
711
|
var e;
|
|
712
712
|
const n = P(t);
|
|
713
713
|
return n ? (e = n.copy) !== null && e !== void 0 ? e : n.original : t;
|
|
@@ -754,7 +754,7 @@ function St(t, e) {
|
|
|
754
754
|
function ae(t, e) {
|
|
755
755
|
return t === e ? t !== 0 || 1 / t === 1 / e : t !== t && e !== e;
|
|
756
756
|
}
|
|
757
|
-
function
|
|
757
|
+
function Rt(t) {
|
|
758
758
|
if (t)
|
|
759
759
|
for (; t.finalities.revoke.length > 0; )
|
|
760
760
|
t.finalities.revoke.pop()();
|
|
@@ -795,13 +795,13 @@ function Tr(t, e) {
|
|
|
795
795
|
if (Array.isArray(t))
|
|
796
796
|
return Array.prototype.concat.call(t);
|
|
797
797
|
if (t instanceof Set) {
|
|
798
|
-
if (!
|
|
798
|
+
if (!Yt(t)) {
|
|
799
799
|
const r = Object.getPrototypeOf(t).constructor;
|
|
800
800
|
return new r(t.values());
|
|
801
801
|
}
|
|
802
802
|
return Set.prototype.difference ? Set.prototype.difference.call(t, /* @__PURE__ */ new Set()) : new Set(t.values());
|
|
803
803
|
} else if (t instanceof Map) {
|
|
804
|
-
if (!
|
|
804
|
+
if (!Zt(t)) {
|
|
805
805
|
const r = Object.getPrototypeOf(t).constructor;
|
|
806
806
|
return new r(t);
|
|
807
807
|
}
|
|
@@ -830,7 +830,7 @@ function V(t) {
|
|
|
830
830
|
}
|
|
831
831
|
function $e(t) {
|
|
832
832
|
if (!te(t))
|
|
833
|
-
return
|
|
833
|
+
return Xt(t);
|
|
834
834
|
if (Array.isArray(t))
|
|
835
835
|
return t.map($e);
|
|
836
836
|
if (t instanceof Map) {
|
|
@@ -838,7 +838,7 @@ function $e(t) {
|
|
|
838
838
|
r,
|
|
839
839
|
$e(s)
|
|
840
840
|
]);
|
|
841
|
-
if (!
|
|
841
|
+
if (!Zt(t)) {
|
|
842
842
|
const r = Object.getPrototypeOf(t).constructor;
|
|
843
843
|
return new r(n);
|
|
844
844
|
}
|
|
@@ -846,7 +846,7 @@ function $e(t) {
|
|
|
846
846
|
}
|
|
847
847
|
if (t instanceof Set) {
|
|
848
848
|
const n = Array.from(t).map($e);
|
|
849
|
-
if (!
|
|
849
|
+
if (!Yt(t)) {
|
|
850
850
|
const r = Object.getPrototypeOf(t).constructor;
|
|
851
851
|
return new r(n);
|
|
852
852
|
}
|
|
@@ -864,7 +864,7 @@ function se(t) {
|
|
|
864
864
|
var e;
|
|
865
865
|
t.assignedMap = (e = t.assignedMap) !== null && e !== void 0 ? e : /* @__PURE__ */ new Map(), t.operated || (t.operated = !0, t.parent && se(t.parent));
|
|
866
866
|
}
|
|
867
|
-
function
|
|
867
|
+
function xn() {
|
|
868
868
|
throw new Error("Cannot modify frozen object");
|
|
869
869
|
}
|
|
870
870
|
function Se(t, e, n, r, s) {
|
|
@@ -892,12 +892,12 @@ function Se(t, e, n, r, s) {
|
|
|
892
892
|
case 2:
|
|
893
893
|
for (const [a, c] of t)
|
|
894
894
|
Se(a, a, n, r, s), Se(c, a, n, r, s);
|
|
895
|
-
t.set = t.clear = t.delete =
|
|
895
|
+
t.set = t.clear = t.delete = xn;
|
|
896
896
|
break;
|
|
897
897
|
case 3:
|
|
898
898
|
for (const a of t)
|
|
899
899
|
Se(a, a, n, r, s);
|
|
900
|
-
t.add = t.clear = t.delete =
|
|
900
|
+
t.add = t.clear = t.delete = xn;
|
|
901
901
|
break;
|
|
902
902
|
case 1:
|
|
903
903
|
Object.freeze(t);
|
|
@@ -913,7 +913,7 @@ function Se(t, e, n, r, s) {
|
|
|
913
913
|
}
|
|
914
914
|
r.pop(), s.pop();
|
|
915
915
|
}
|
|
916
|
-
function
|
|
916
|
+
function en(t, e) {
|
|
917
917
|
const n = ge(t);
|
|
918
918
|
if (n === 0)
|
|
919
919
|
Reflect.ownKeys(t).forEach((r) => {
|
|
@@ -930,7 +930,7 @@ function wr(t, e, n) {
|
|
|
930
930
|
if (_e(t) || !te(t, n) || e.has(t) || Object.isFrozen(t))
|
|
931
931
|
return;
|
|
932
932
|
const r = t instanceof Set, s = r ? /* @__PURE__ */ new Map() : void 0;
|
|
933
|
-
if (e.add(t),
|
|
933
|
+
if (e.add(t), en(t, (i, o) => {
|
|
934
934
|
var a;
|
|
935
935
|
if (_e(o)) {
|
|
936
936
|
const c = P(o);
|
|
@@ -950,12 +950,12 @@ function Ns(t, e) {
|
|
|
950
950
|
const n = t.type === 3 ? t.setMap : t.copy;
|
|
951
951
|
t.finalities.revoke.length > 1 && t.assignedMap.get(e) && n && wr(ce(n, e), t.finalities.handledSet, t.options);
|
|
952
952
|
}
|
|
953
|
-
function
|
|
953
|
+
function $t(t) {
|
|
954
954
|
t.type === 3 && t.copy && (t.copy.clear(), t.setMap.forEach((e) => {
|
|
955
|
-
t.copy.add(
|
|
955
|
+
t.copy.add(Xt(e));
|
|
956
956
|
}));
|
|
957
957
|
}
|
|
958
|
-
function
|
|
958
|
+
function Dt(t, e, n, r) {
|
|
959
959
|
if (t.operated && t.assignedMap && t.assignedMap.size > 0 && !t.finalized) {
|
|
960
960
|
if (n && r) {
|
|
961
961
|
const i = gr(t);
|
|
@@ -964,14 +964,14 @@ function $t(t, e, n, r) {
|
|
|
964
964
|
t.finalized = !0;
|
|
965
965
|
}
|
|
966
966
|
}
|
|
967
|
-
function
|
|
967
|
+
function tn(t, e, n, r) {
|
|
968
968
|
const s = P(n);
|
|
969
969
|
s && (s.callbacks || (s.callbacks = []), s.callbacks.push((i, o) => {
|
|
970
970
|
var a;
|
|
971
971
|
const c = t.type === 3 ? t.setMap : t.copy;
|
|
972
972
|
if (ae(ce(c, e), n)) {
|
|
973
973
|
let u = s.original;
|
|
974
|
-
s.copy && (u = s.copy),
|
|
974
|
+
s.copy && (u = s.copy), $t(t), Dt(t, r, i, o), t.options.enableAutoFreeze && (t.options.updatedValues = (a = t.options.updatedValues) !== null && a !== void 0 ? a : /* @__PURE__ */ new WeakMap(), t.options.updatedValues.set(u, s.original)), ze(c, e, u);
|
|
975
975
|
}
|
|
976
976
|
}), t.options.enableAutoFreeze && s.finalities !== t.finalities && (t.options.enableAutoFreeze = !1)), te(n, t.options) && t.finalities.draft.push(() => {
|
|
977
977
|
const i = t.type === 3 ? t.setMap : t.copy;
|
|
@@ -1080,7 +1080,7 @@ function qe(t, e, n, r) {
|
|
|
1080
1080
|
const st = (t, e, n = !1) => {
|
|
1081
1081
|
if (typeof t == "object" && t !== null && (!te(t, e) || n))
|
|
1082
1082
|
throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.");
|
|
1083
|
-
},
|
|
1083
|
+
}, xt = {
|
|
1084
1084
|
get size() {
|
|
1085
1085
|
return H(P(this)).size;
|
|
1086
1086
|
},
|
|
@@ -1089,7 +1089,7 @@ const st = (t, e, n = !1) => {
|
|
|
1089
1089
|
},
|
|
1090
1090
|
set(t, e) {
|
|
1091
1091
|
const n = P(this), r = H(n);
|
|
1092
|
-
return (!r.has(t) || !ae(r.get(t), e)) && (V(n), se(n), n.assignedMap.set(t, !0), n.copy.set(t, e),
|
|
1092
|
+
return (!r.has(t) || !ae(r.get(t), e)) && (V(n), se(n), n.assignedMap.set(t, !0), n.copy.set(t, e), tn(n, t, e, qe)), this;
|
|
1093
1093
|
},
|
|
1094
1094
|
delete(t) {
|
|
1095
1095
|
if (!this.has(t))
|
|
@@ -1117,7 +1117,7 @@ const st = (t, e, n = !1) => {
|
|
|
1117
1117
|
const r = P(this), s = H(r).get(t), i = ((n = (e = r.options).mark) === null || n === void 0 ? void 0 : n.call(e, s, J)) === J.mutable;
|
|
1118
1118
|
if (r.options.strict && st(s, r.options, i), i || r.finalized || !te(s, r.options) || s !== r.original.get(t))
|
|
1119
1119
|
return s;
|
|
1120
|
-
const o =
|
|
1120
|
+
const o = Jt.createDraft({
|
|
1121
1121
|
original: s,
|
|
1122
1122
|
parentDraft: r,
|
|
1123
1123
|
key: t,
|
|
@@ -1161,7 +1161,7 @@ const st = (t, e, n = !1) => {
|
|
|
1161
1161
|
[tt]() {
|
|
1162
1162
|
return this.entries();
|
|
1163
1163
|
}
|
|
1164
|
-
}, Vs = Reflect.ownKeys(
|
|
1164
|
+
}, Vs = Reflect.ownKeys(xt), Un = (t, e, { isValuesIterator: n }) => () => {
|
|
1165
1165
|
var r, s;
|
|
1166
1166
|
const i = e.next();
|
|
1167
1167
|
if (i.done)
|
|
@@ -1170,7 +1170,7 @@ const st = (t, e, n = !1) => {
|
|
|
1170
1170
|
let a = t.setMap.get(o);
|
|
1171
1171
|
const c = P(a), u = ((s = (r = t.options).mark) === null || s === void 0 ? void 0 : s.call(r, a, J)) === J.mutable;
|
|
1172
1172
|
if (t.options.strict && st(o, t.options, u), !u && !c && te(o, t.options) && !t.finalized && t.original.has(o)) {
|
|
1173
|
-
const l =
|
|
1173
|
+
const l = Jt.createDraft({
|
|
1174
1174
|
original: o,
|
|
1175
1175
|
parentDraft: t,
|
|
1176
1176
|
key: o,
|
|
@@ -1197,7 +1197,7 @@ const st = (t, e, n = !1) => {
|
|
|
1197
1197
|
},
|
|
1198
1198
|
add(t) {
|
|
1199
1199
|
const e = P(this);
|
|
1200
|
-
return this.has(t) || (V(e), se(e), e.assignedMap.set(t, !0), e.setMap.set(t, t),
|
|
1200
|
+
return this.has(t) || (V(e), se(e), e.assignedMap.set(t, !0), e.setMap.set(t, t), tn(e, t, t, qe)), this;
|
|
1201
1201
|
},
|
|
1202
1202
|
delete(t) {
|
|
1203
1203
|
if (!this.has(t))
|
|
@@ -1222,7 +1222,7 @@ const st = (t, e, n = !1) => {
|
|
|
1222
1222
|
const e = t.setMap.keys();
|
|
1223
1223
|
return {
|
|
1224
1224
|
[Symbol.iterator]: () => this.values(),
|
|
1225
|
-
next:
|
|
1225
|
+
next: Un(t, e, { isValuesIterator: !0 })
|
|
1226
1226
|
};
|
|
1227
1227
|
},
|
|
1228
1228
|
entries() {
|
|
@@ -1231,7 +1231,7 @@ const st = (t, e, n = !1) => {
|
|
|
1231
1231
|
const e = t.setMap.keys();
|
|
1232
1232
|
return {
|
|
1233
1233
|
[Symbol.iterator]: () => this.entries(),
|
|
1234
|
-
next:
|
|
1234
|
+
next: Un(t, e, {
|
|
1235
1235
|
isValuesIterator: !1
|
|
1236
1236
|
})
|
|
1237
1237
|
};
|
|
@@ -1289,8 +1289,8 @@ const Ws = Reflect.ownKeys(it), mr = /* @__PURE__ */ new WeakSet(), Sr = {
|
|
|
1289
1289
|
const a = H(t);
|
|
1290
1290
|
if (a instanceof Map && Vs.includes(e)) {
|
|
1291
1291
|
if (e === "size")
|
|
1292
|
-
return Object.getOwnPropertyDescriptor(
|
|
1293
|
-
const u =
|
|
1292
|
+
return Object.getOwnPropertyDescriptor(xt, "size").get.call(t.proxy);
|
|
1293
|
+
const u = xt[e];
|
|
1294
1294
|
if (u)
|
|
1295
1295
|
return u.bind(t.proxy);
|
|
1296
1296
|
}
|
|
@@ -1302,7 +1302,7 @@ const Ws = Reflect.ownKeys(it), mr = /* @__PURE__ */ new WeakSet(), Sr = {
|
|
|
1302
1302
|
return u.bind(t.proxy);
|
|
1303
1303
|
}
|
|
1304
1304
|
if (!Le(a, e)) {
|
|
1305
|
-
const u =
|
|
1305
|
+
const u = Dn(a, e);
|
|
1306
1306
|
return u ? "value" in u ? u.value : (
|
|
1307
1307
|
// !case: support for getter
|
|
1308
1308
|
(s = u.get) === null || s === void 0 ? void 0 : s.call(t.proxy)
|
|
@@ -1312,7 +1312,7 @@ const Ws = Reflect.ownKeys(it), mr = /* @__PURE__ */ new WeakSet(), Sr = {
|
|
|
1312
1312
|
if (t.options.strict && st(c, t.options), t.finalized || !te(c, t.options))
|
|
1313
1313
|
return c;
|
|
1314
1314
|
if (c === St(t.original, e)) {
|
|
1315
|
-
if (V(t), t.copy[e] =
|
|
1315
|
+
if (V(t), t.copy[e] = nn({
|
|
1316
1316
|
original: t.original[e],
|
|
1317
1317
|
parentDraft: t,
|
|
1318
1318
|
key: t.type === 1 ? Number(e) : e,
|
|
@@ -1333,11 +1333,11 @@ const Ws = Reflect.ownKeys(it), mr = /* @__PURE__ */ new WeakSet(), Sr = {
|
|
|
1333
1333
|
let s;
|
|
1334
1334
|
if (t.type === 1 && e !== "length" && !(Number.isInteger(s = Number(e)) && s >= 0 && (e === 0 || s === 0 || String(s) === String(e))))
|
|
1335
1335
|
throw new Error("Only supports setting array indices and the 'length' property.");
|
|
1336
|
-
const i =
|
|
1336
|
+
const i = Dn(H(t), e);
|
|
1337
1337
|
if (i != null && i.set)
|
|
1338
1338
|
return i.set.call(t.proxy, n), !0;
|
|
1339
1339
|
const o = St(H(t), e), a = P(o);
|
|
1340
|
-
return a && ae(a.original, n) ? (t.copy[e] = n, t.assignedMap = (r = t.assignedMap) !== null && r !== void 0 ? r : /* @__PURE__ */ new Map(), t.assignedMap.set(e, !1), !0) : (ae(n, o) && (n !== void 0 || Le(t.original, e)) || (V(t), se(t), Le(t.original, e) && ae(n, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = n,
|
|
1340
|
+
return a && ae(a.original, n) ? (t.copy[e] = n, t.assignedMap = (r = t.assignedMap) !== null && r !== void 0 ? r : /* @__PURE__ */ new Map(), t.assignedMap.set(e, !1), !0) : (ae(n, o) && (n !== void 0 || Le(t.original, e)) || (V(t), se(t), Le(t.original, e) && ae(n, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = n, tn(t, e, n, qe)), !0);
|
|
1341
1341
|
},
|
|
1342
1342
|
has(t, e) {
|
|
1343
1343
|
return e in H(t);
|
|
@@ -1368,7 +1368,7 @@ const Ws = Reflect.ownKeys(it), mr = /* @__PURE__ */ new WeakSet(), Sr = {
|
|
|
1368
1368
|
return t.type === 1 ? Sr.set.call(this, t, e, void 0, t.proxy) : (St(t.original, e) !== void 0 || e in t.original ? (V(t), se(t), t.assignedMap.set(e, !1)) : (t.assignedMap = (n = t.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), t.assignedMap.delete(e)), t.copy && delete t.copy[e], !0);
|
|
1369
1369
|
}
|
|
1370
1370
|
};
|
|
1371
|
-
function
|
|
1371
|
+
function nn(t) {
|
|
1372
1372
|
const { original: e, parentDraft: n, key: r, finalities: s, options: i } = t, o = ge(e), a = {
|
|
1373
1373
|
type: o,
|
|
1374
1374
|
finalized: !1,
|
|
@@ -1392,7 +1392,7 @@ function tn(t) {
|
|
|
1392
1392
|
const m = ce(w, r), T = P(m);
|
|
1393
1393
|
if (T) {
|
|
1394
1394
|
let v = T.original;
|
|
1395
|
-
T.operated && (v =
|
|
1395
|
+
T.operated && (v = Xt(m)), $t(T), Dt(T, qe, d, h), l.options.enableAutoFreeze && (l.options.updatedValues = (y = l.options.updatedValues) !== null && y !== void 0 ? y : /* @__PURE__ */ new WeakMap(), l.options.updatedValues.set(v, T.original)), ze(w, r, v);
|
|
1396
1396
|
}
|
|
1397
1397
|
(b = g.callbacks) === null || b === void 0 || b.forEach((v) => {
|
|
1398
1398
|
v(d, h);
|
|
@@ -1401,12 +1401,12 @@ function tn(t) {
|
|
|
1401
1401
|
} else {
|
|
1402
1402
|
const l = P(c);
|
|
1403
1403
|
l.finalities.draft.push((d, h) => {
|
|
1404
|
-
|
|
1404
|
+
$t(l), Dt(l, qe, d, h);
|
|
1405
1405
|
});
|
|
1406
1406
|
}
|
|
1407
1407
|
return c;
|
|
1408
1408
|
}
|
|
1409
|
-
|
|
1409
|
+
Jt.createDraft = nn;
|
|
1410
1410
|
function Qs(t, e, n, r, s) {
|
|
1411
1411
|
var i;
|
|
1412
1412
|
const o = P(t), a = (i = o == null ? void 0 : o.original) !== null && i !== void 0 ? i : t, c = !!e.length;
|
|
@@ -1414,7 +1414,7 @@ function Qs(t, e, n, r, s) {
|
|
|
1414
1414
|
for (; o.finalities.draft.length > 0; )
|
|
1415
1415
|
o.finalities.draft.pop()(n, r);
|
|
1416
1416
|
const u = c ? e[0] : o ? o.operated ? o.copy : o.original : t;
|
|
1417
|
-
return o &&
|
|
1417
|
+
return o && Rt(o), s && Se(u, u, o == null ? void 0 : o.options.updatedValues), [
|
|
1418
1418
|
u,
|
|
1419
1419
|
n && c ? [{ op: D.Replace, path: [], value: e[0] }] : n,
|
|
1420
1420
|
r && c ? [{ op: D.Replace, path: [], value: a }] : r
|
|
@@ -1429,7 +1429,7 @@ function Bs(t, e) {
|
|
|
1429
1429
|
};
|
|
1430
1430
|
let s, i;
|
|
1431
1431
|
e.enablePatches && (s = [], i = []);
|
|
1432
|
-
const a = ((n = e.mark) === null || n === void 0 ? void 0 : n.call(e, t, J)) === J.mutable || !te(t, e) ? t :
|
|
1432
|
+
const a = ((n = e.mark) === null || n === void 0 ? void 0 : n.call(e, t, J)) === J.mutable || !te(t, e) ? t : nn({
|
|
1433
1433
|
original: t,
|
|
1434
1434
|
parentDraft: null,
|
|
1435
1435
|
finalities: r,
|
|
@@ -1443,9 +1443,9 @@ function Bs(t, e) {
|
|
|
1443
1443
|
}
|
|
1444
1444
|
];
|
|
1445
1445
|
}
|
|
1446
|
-
function
|
|
1446
|
+
function Ut(t) {
|
|
1447
1447
|
const { rootDraft: e, value: n, useRawReturn: r = !1, isRoot: s = !0 } = t;
|
|
1448
|
-
|
|
1448
|
+
en(n, (i, o, a) => {
|
|
1449
1449
|
const c = P(o);
|
|
1450
1450
|
if (c && e && c.finalities === e.finalities) {
|
|
1451
1451
|
t.isContainDraft = !0;
|
|
@@ -1455,7 +1455,7 @@ function xt(t) {
|
|
|
1455
1455
|
a.clear(), l.forEach((d) => a.add(i === d ? u : d));
|
|
1456
1456
|
} else
|
|
1457
1457
|
ze(a, i, u);
|
|
1458
|
-
} else typeof o == "object" && o !== null && (t.value = o, t.isRoot = !1,
|
|
1458
|
+
} else typeof o == "object" && o !== null && (t.value = o, t.isRoot = !1, Ut(t));
|
|
1459
1459
|
}), s && (t.isContainDraft || console.warn("The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance."), r && console.warn("The return value contains drafts, please don't use 'rawReturn()' to wrap the return value."));
|
|
1460
1460
|
}
|
|
1461
1461
|
function vr(t) {
|
|
@@ -1468,7 +1468,7 @@ function vr(t) {
|
|
|
1468
1468
|
return n.original;
|
|
1469
1469
|
let s;
|
|
1470
1470
|
function i() {
|
|
1471
|
-
s = r === 2 ?
|
|
1471
|
+
s = r === 2 ? Zt(t) ? new Map(t) : new (Object.getPrototypeOf(t)).constructor(t) : r === 3 ? Array.from(n.setMap.values()) : Tr(t, n == null ? void 0 : n.options);
|
|
1472
1472
|
}
|
|
1473
1473
|
if (n) {
|
|
1474
1474
|
n.finalized = !0;
|
|
@@ -1479,18 +1479,18 @@ function vr(t) {
|
|
|
1479
1479
|
}
|
|
1480
1480
|
} else
|
|
1481
1481
|
s = t;
|
|
1482
|
-
if (
|
|
1482
|
+
if (en(s, (o, a) => {
|
|
1483
1483
|
if (n && ae(ce(n.original, o), a))
|
|
1484
1484
|
return;
|
|
1485
1485
|
const c = vr(a);
|
|
1486
1486
|
c !== a && (s === t && i(), ze(s, o, c));
|
|
1487
1487
|
}), r === 3) {
|
|
1488
1488
|
const o = (e = n == null ? void 0 : n.original) !== null && e !== void 0 ? e : s;
|
|
1489
|
-
return
|
|
1489
|
+
return Yt(o) ? new Set(s) : new (Object.getPrototypeOf(o)).constructor(s);
|
|
1490
1490
|
}
|
|
1491
1491
|
return s;
|
|
1492
1492
|
}
|
|
1493
|
-
function
|
|
1493
|
+
function Ln(t) {
|
|
1494
1494
|
if (!_e(t))
|
|
1495
1495
|
throw new Error(`current() is only used for Draft, parameter: ${t}`);
|
|
1496
1496
|
return vr(t);
|
|
@@ -1506,7 +1506,7 @@ const Gs = (t) => function e(n, r, s) {
|
|
|
1506
1506
|
if (typeof r != "function" && (l = r), l !== void 0 && Object.prototype.toString.call(l) !== "[object Object]")
|
|
1507
1507
|
throw new Error(`Invalid options: ${l}, 'options' should be an object.`);
|
|
1508
1508
|
l = Object.assign(Object.assign({}, t), l);
|
|
1509
|
-
const d = _e(c) ?
|
|
1509
|
+
const d = _e(c) ? Ln(c) : c, h = Array.isArray(l.mark) ? (A, j) => {
|
|
1510
1510
|
for (const L of l.mark) {
|
|
1511
1511
|
if (typeof L != "function")
|
|
1512
1512
|
throw new Error(`Invalid mark: ${L}, 'mark' should be a function.`);
|
|
@@ -1532,7 +1532,7 @@ const Gs = (t) => function e(n, r, s) {
|
|
|
1532
1532
|
try {
|
|
1533
1533
|
v = u(m);
|
|
1534
1534
|
} catch (A) {
|
|
1535
|
-
throw
|
|
1535
|
+
throw Rt(P(m)), A;
|
|
1536
1536
|
}
|
|
1537
1537
|
const E = (A) => {
|
|
1538
1538
|
const j = P(m);
|
|
@@ -1542,14 +1542,14 @@ const Gs = (t) => function e(n, r, s) {
|
|
|
1542
1542
|
const q = A == null ? void 0 : A[xs];
|
|
1543
1543
|
if (q) {
|
|
1544
1544
|
const Pe = q[0];
|
|
1545
|
-
return w.strict && typeof A == "object" && A !== null &&
|
|
1545
|
+
return w.strict && typeof A == "object" && A !== null && Ut({
|
|
1546
1546
|
rootDraft: j,
|
|
1547
1547
|
value: A,
|
|
1548
1548
|
useRawReturn: !0
|
|
1549
1549
|
}), T([Pe]);
|
|
1550
1550
|
}
|
|
1551
1551
|
if (A !== void 0)
|
|
1552
|
-
return typeof A == "object" && A !== null &&
|
|
1552
|
+
return typeof A == "object" && A !== null && Ut({ rootDraft: j, value: A }), T([A]);
|
|
1553
1553
|
}
|
|
1554
1554
|
if (A === m || A === void 0)
|
|
1555
1555
|
return T([]);
|
|
@@ -1557,12 +1557,12 @@ const Gs = (t) => function e(n, r, s) {
|
|
|
1557
1557
|
if (w === L.options) {
|
|
1558
1558
|
if (L.operated)
|
|
1559
1559
|
throw new Error("Cannot return a modified child draft.");
|
|
1560
|
-
return T([
|
|
1560
|
+
return T([Ln(A)]);
|
|
1561
1561
|
}
|
|
1562
1562
|
return T([A]);
|
|
1563
1563
|
};
|
|
1564
1564
|
return v instanceof Promise ? v.then(E, (A) => {
|
|
1565
|
-
throw
|
|
1565
|
+
throw Rt(P(m)), A;
|
|
1566
1566
|
}) : E(v);
|
|
1567
1567
|
}, ot = Gs();
|
|
1568
1568
|
Object.prototype.constructor.toString();
|
|
@@ -1570,13 +1570,13 @@ function Ar(t, e) {
|
|
|
1570
1570
|
const n = Object.keys(t), r = Object.keys(e);
|
|
1571
1571
|
return n.length === r.length && Object.keys(t).every((s) => e.hasOwnProperty(s));
|
|
1572
1572
|
}
|
|
1573
|
-
function
|
|
1573
|
+
function Fn(t, e) {
|
|
1574
1574
|
return Object.keys(t).length === Object.keys(e).length && Object.keys(t).every((n) => e.hasOwnProperty(n) && t[n] === e[n]);
|
|
1575
1575
|
}
|
|
1576
1576
|
function rt(t, e) {
|
|
1577
1577
|
return typeof t != "object" || typeof e != "object" || t === null || e === null ? t === e : Ar(t, e) ? Object.keys(t).every((n) => rt(t[n], e[n])) : !1;
|
|
1578
1578
|
}
|
|
1579
|
-
function
|
|
1579
|
+
function rn(t) {
|
|
1580
1580
|
if (!De(t))
|
|
1581
1581
|
return t;
|
|
1582
1582
|
const e = {};
|
|
@@ -1614,7 +1614,7 @@ function Hs(t, e, n) {
|
|
|
1614
1614
|
const s = e[e.length - 1];
|
|
1615
1615
|
Array.isArray(r) && typeof s == "number" ? r.splice(s, 0, n) : r[s] = n;
|
|
1616
1616
|
}
|
|
1617
|
-
function
|
|
1617
|
+
function Nn(t, e, n) {
|
|
1618
1618
|
if (!t || e.length === 0)
|
|
1619
1619
|
return;
|
|
1620
1620
|
let r = t || {};
|
|
@@ -1639,7 +1639,7 @@ function Er(t, e) {
|
|
|
1639
1639
|
function Js(t) {
|
|
1640
1640
|
return t && Object.keys(t).length === 0;
|
|
1641
1641
|
}
|
|
1642
|
-
const
|
|
1642
|
+
const Kn = /ZULU|YEKT|YEKST|YAPT|YAKT|YAKST|XJT|WGT|WGST|WFT|WETDST|WET|WDT|WAT|WAST|WAKT|WADT|VUT|VOLT|VLAT|VLAST|VET|UZT|UZST|UYT|UYST|UTC|UT|ULAT|ULAST|UCT|TVT|TRUT|TOT|TMT|TKT|TJT|TFT|TAHT|SGT|SCT|SAST|SADT|RET|PYT|PYST|PWT|PST|PONT|PMST|PMDT|PKT|PKST|PHT|PGT|PETT|PETST|PET|PDT|OMST|OMSST|NZT|NZST|NZDT|NUT|NST|NPT|NOVT|NOVST|NFT|NDT|MYT|MVT|MUT|MUST|MST|MSK|MSD|MPT|MMT|MHT|MEZ|METDST|MET|MESZ|MEST|MDT|MAWT|MART|MAGT|MAGST|LKT|LINT|LIGT|LHST|LHDT|KST|KRAT|KRAST|KOST|KGT|KGST|KDT|JST|JAYT|IST|IRT|IRKT|IRKST|IOT|IDT|ICT|HST|HKT|GYT|GMT|GILT|GFT|GET|GEST|GAMT|GALT|FNT|FNST|FKT|FKST|FJT|FJST|FET|EST|EGT|EGST|EETDST|EET|EEST|EDT|EAT|EAST|EASST|DDUT|DAVT|CXT|CST|COT|CLT|CLST|CKT|CHUT|CHAST|CHADT|CETDST|CET|CEST|CDT|CCT|CAST|CADT|BTT|BST|BRT|BRST|BRA|BOT|BORT|BNT|BDT|BDST|AZT|AZST|AZOT|AZOST|AWST|AWSST|AST|ART|ARST|ANAT|ANAST|AMT|AMST|ALMT|ALMST|AKST|AKDT|AFT|AEST|AESST|AEDT|ADT|ACWST|ACT|ACST|ACSST|ACDT$/, Ys = {
|
|
1643
1643
|
ZULU: 0,
|
|
1644
1644
|
YEKT: 18e3,
|
|
1645
1645
|
YEKST: 21600,
|
|
@@ -1903,10 +1903,10 @@ function ui(t) {
|
|
|
1903
1903
|
}
|
|
1904
1904
|
}
|
|
1905
1905
|
function li(t) {
|
|
1906
|
-
const e = t.match(
|
|
1906
|
+
const e = t.match(Kn);
|
|
1907
1907
|
if (!e)
|
|
1908
1908
|
return null;
|
|
1909
|
-
const [n] = e, r = Ys[n], s = new Date(t.replace(
|
|
1909
|
+
const [n] = e, r = Ys[n], s = new Date(t.replace(Kn, "Z"));
|
|
1910
1910
|
return new Date(s.getTime() - r * 1e3);
|
|
1911
1911
|
}
|
|
1912
1912
|
const fi = [
|
|
@@ -1931,7 +1931,7 @@ function di(t, e) {
|
|
|
1931
1931
|
return null;
|
|
1932
1932
|
}
|
|
1933
1933
|
}
|
|
1934
|
-
function
|
|
1934
|
+
function Lt(t) {
|
|
1935
1935
|
for (const e of fi) {
|
|
1936
1936
|
const n = di(e, t);
|
|
1937
1937
|
if (n)
|
|
@@ -1942,7 +1942,7 @@ function Ut(t) {
|
|
|
1942
1942
|
function hi(t) {
|
|
1943
1943
|
try {
|
|
1944
1944
|
const e = JSON.parse(t);
|
|
1945
|
-
return typeof e == "string" ?
|
|
1945
|
+
return typeof e == "string" ? Lt(e) : null;
|
|
1946
1946
|
} catch {
|
|
1947
1947
|
return null;
|
|
1948
1948
|
}
|
|
@@ -1954,7 +1954,7 @@ function ut(t) {
|
|
|
1954
1954
|
if (t instanceof Date)
|
|
1955
1955
|
return t;
|
|
1956
1956
|
if (typeof t == "string") {
|
|
1957
|
-
const e =
|
|
1957
|
+
const e = Lt(t) || hi(t) || Lt(t.trim());
|
|
1958
1958
|
if (!e)
|
|
1959
1959
|
throw new Error(`Unable to parse \`${t}\` as a date.`);
|
|
1960
1960
|
return e;
|
|
@@ -1994,7 +1994,7 @@ class ye {
|
|
|
1994
1994
|
return this._blobAttrs;
|
|
1995
1995
|
this._blobAttrs = /* @__PURE__ */ new Map();
|
|
1996
1996
|
for (const e of Object.values(this.attrs))
|
|
1997
|
-
if (
|
|
1997
|
+
if (on(e)) {
|
|
1998
1998
|
const [n, r, s] = e["forward-identity"];
|
|
1999
1999
|
Q(this.blobAttrs, [r, s], e);
|
|
2000
2000
|
}
|
|
@@ -2041,10 +2041,10 @@ class ye {
|
|
|
2041
2041
|
function pi(t) {
|
|
2042
2042
|
return t.cardinality === "one";
|
|
2043
2043
|
}
|
|
2044
|
-
function
|
|
2044
|
+
function sn(t) {
|
|
2045
2045
|
return t["value-type"] === "ref";
|
|
2046
2046
|
}
|
|
2047
|
-
function
|
|
2047
|
+
function on(t) {
|
|
2048
2048
|
return t["value-type"] === "blob";
|
|
2049
2049
|
}
|
|
2050
2050
|
function ke(t, e) {
|
|
@@ -2079,7 +2079,7 @@ function kr(t, e, n) {
|
|
|
2079
2079
|
console.warn("no such attr", c, a);
|
|
2080
2080
|
continue;
|
|
2081
2081
|
}
|
|
2082
|
-
l["checked-data-type"] === "date" && n && (u = ut(u), o[2] = u),
|
|
2082
|
+
l["checked-data-type"] === "date" && n && (u = ut(u), o[2] = u), sn(l) && Q(i, [u, c, a], o), Q(r, [a, c, u], o), Q(s, [c, a, u], o);
|
|
2083
2083
|
}
|
|
2084
2084
|
return { eav: r, aev: s, vae: i };
|
|
2085
2085
|
}
|
|
@@ -2139,7 +2139,7 @@ function Mr(t, e, n) {
|
|
|
2139
2139
|
if (!r)
|
|
2140
2140
|
return;
|
|
2141
2141
|
const [s, i, o] = r, a = e.getAttr(i);
|
|
2142
|
-
a && (ee(t.eav, [s, i, o]), ee(t.aev, [i, s, o]),
|
|
2142
|
+
a && (ee(t.eav, [s, i, o]), ee(t.aev, [i, s, o]), sn(a) && ee(t.vae, [o, i, s]));
|
|
2143
2143
|
}
|
|
2144
2144
|
let bi = 0;
|
|
2145
2145
|
function jr(t, e, n) {
|
|
@@ -2158,7 +2158,7 @@ function Rr(t, e, n) {
|
|
|
2158
2158
|
return;
|
|
2159
2159
|
a["checked-data-type"] === "date" && t.useDateObjects && (o = ut(o));
|
|
2160
2160
|
const c = ke(t.eav, [s, i, o]), u = (c == null ? void 0 : c[3]) ?? jr(t, a, r), l = [s, i, o, u];
|
|
2161
|
-
pi(a) ? (Q(t.eav, [s, i], /* @__PURE__ */ new Map([[o, l]])), Q(t.aev, [i, s], /* @__PURE__ */ new Map([[o, l]]))) : (Q(t.eav, [s, i, o], l), Q(t.aev, [i, s, o], l)),
|
|
2161
|
+
pi(a) ? (Q(t.eav, [s, i], /* @__PURE__ */ new Map([[o, l]])), Q(t.aev, [i, s], /* @__PURE__ */ new Map([[o, l]]))) : (Q(t.eav, [s, i, o], l), Q(t.aev, [i, s, o], l)), sn(a) && Q(t.vae, [o, i, s], l);
|
|
2162
2162
|
}
|
|
2163
2163
|
function _i(t, e, n) {
|
|
2164
2164
|
var y;
|
|
@@ -2168,7 +2168,7 @@ function _i(t, e, n) {
|
|
|
2168
2168
|
const [s, i, o] = r, a = e.getAttr(i);
|
|
2169
2169
|
if (!a)
|
|
2170
2170
|
return;
|
|
2171
|
-
if (!
|
|
2171
|
+
if (!on(a))
|
|
2172
2172
|
throw new Error("merge operation is not supported for links");
|
|
2173
2173
|
const c = ke(t.eav, [s, i]);
|
|
2174
2174
|
if (!c)
|
|
@@ -2184,7 +2184,7 @@ function _i(t, e, n) {
|
|
|
2184
2184
|
];
|
|
2185
2185
|
Q(t.eav, [s, i], /* @__PURE__ */ new Map([[d, h]])), Q(t.aev, [i, s], /* @__PURE__ */ new Map([[d, h]]));
|
|
2186
2186
|
}
|
|
2187
|
-
function
|
|
2187
|
+
function Ft(t, e, n) {
|
|
2188
2188
|
var u, l;
|
|
2189
2189
|
const [r, s] = n, i = Ve(t, [r]);
|
|
2190
2190
|
if (!i)
|
|
@@ -2195,7 +2195,7 @@ function Lt(t, e, n) {
|
|
|
2195
2195
|
const h = e.getAttr(d);
|
|
2196
2196
|
h && h["on-delete-reverse"] === "cascade" && B(a.get(d), 1).forEach(([y, b, g]) => {
|
|
2197
2197
|
var w;
|
|
2198
|
-
return
|
|
2198
|
+
return Ft(t, e, [g, (w = h["reverse-identity"]) == null ? void 0 : w[1]]);
|
|
2199
2199
|
}), // Fall back to deleting everything if we've rehydrated tx-steps from
|
|
2200
2200
|
// the store that didn't set `etype` in deleteEntity
|
|
2201
2201
|
(!s || // If we don't know about the attr, let's just get rid of it
|
|
@@ -2208,7 +2208,7 @@ function Lt(t, e, n) {
|
|
|
2208
2208
|
c && c.forEach((d) => {
|
|
2209
2209
|
var w, m, T;
|
|
2210
2210
|
const [h, y, b] = d, g = e.getAttr(y);
|
|
2211
|
-
(!s || !g || ((w = g["reverse-identity"]) == null ? void 0 : w[1]) === s) && (ee(t.eav, [h, y, b]), ee(t.aev, [y, h, b]), ee(t.vae, [b, y, h])), g && g["on-delete"] === "cascade" && ((m = g["reverse-identity"]) == null ? void 0 : m[1]) === s &&
|
|
2211
|
+
(!s || !g || ((w = g["reverse-identity"]) == null ? void 0 : w[1]) === s) && (ee(t.eav, [h, y, b]), ee(t.aev, [y, h, b]), ee(t.vae, [b, y, h])), g && g["on-delete"] === "cascade" && ((m = g["reverse-identity"]) == null ? void 0 : m[1]) === s && Ft(t, e, [h, (T = g["forward-identity"]) == null ? void 0 : T[1]]);
|
|
2212
2212
|
}), ((l = t.vae.get(o)) == null ? void 0 : l.size) === 0 && ee(t.vae, [o]);
|
|
2213
2213
|
}
|
|
2214
2214
|
function $r(t, e, n) {
|
|
@@ -2245,7 +2245,7 @@ function mi(t, e, n) {
|
|
|
2245
2245
|
Mr(t, e, s);
|
|
2246
2246
|
break;
|
|
2247
2247
|
case "delete-entity":
|
|
2248
|
-
|
|
2248
|
+
Ft(t, e, s);
|
|
2249
2249
|
break;
|
|
2250
2250
|
case "add-attr":
|
|
2251
2251
|
gi(e, s);
|
|
@@ -2437,15 +2437,15 @@ function Ci(t, e, n) {
|
|
|
2437
2437
|
}
|
|
2438
2438
|
return { ...n, [t]: e };
|
|
2439
2439
|
}
|
|
2440
|
-
function
|
|
2440
|
+
function qn(t, e, n) {
|
|
2441
2441
|
return t === e ? n : null;
|
|
2442
2442
|
}
|
|
2443
2443
|
function Ii(t) {
|
|
2444
2444
|
switch (typeof t) {
|
|
2445
2445
|
case "string":
|
|
2446
|
-
return t.startsWith("?") ? Ci :
|
|
2446
|
+
return t.startsWith("?") ? Ci : qn;
|
|
2447
2447
|
default:
|
|
2448
|
-
return
|
|
2448
|
+
return qn;
|
|
2449
2449
|
}
|
|
2450
2450
|
}
|
|
2451
2451
|
const Mi = [
|
|
@@ -2475,19 +2475,19 @@ function $i(t, e, n) {
|
|
|
2475
2475
|
return Ui(t, e, n).map((r) => Ri(e, r, n)).filter((r) => r);
|
|
2476
2476
|
}
|
|
2477
2477
|
function Di(t, e, n) {
|
|
2478
|
-
return e.or ? e.or.patterns.flatMap((r) =>
|
|
2478
|
+
return e.or ? e.or.patterns.flatMap((r) => Nt(t, r, n)) : e.and ? e.and.patterns.reduce((r, s) => Nt(t, s, r), n) : n.flatMap((r) => $i(t, e, r));
|
|
2479
2479
|
}
|
|
2480
|
-
function
|
|
2480
|
+
function Nt(t, e, n = [{}]) {
|
|
2481
2481
|
return e.reduce((r, s) => Di(t, s, r), n);
|
|
2482
2482
|
}
|
|
2483
|
-
function
|
|
2484
|
-
return Array.isArray(e) ? e.map((n) =>
|
|
2483
|
+
function an(t, e) {
|
|
2484
|
+
return Array.isArray(e) ? e.map((n) => an(t, n)) : Pi(e) ? t[e] : e;
|
|
2485
2485
|
}
|
|
2486
2486
|
function xi(t, { find: e, where: n }) {
|
|
2487
|
-
return
|
|
2487
|
+
return Nt(t, n).map((s) => an(s, e));
|
|
2488
2488
|
}
|
|
2489
2489
|
function Ui(t, e, n) {
|
|
2490
|
-
return vi(t,
|
|
2490
|
+
return vi(t, an(n, e));
|
|
2491
2491
|
}
|
|
2492
2492
|
const Li = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i;
|
|
2493
2493
|
function Ae(t) {
|
|
@@ -2509,18 +2509,18 @@ function Ki() {
|
|
|
2509
2509
|
}
|
|
2510
2510
|
return vt(Ni);
|
|
2511
2511
|
}
|
|
2512
|
-
const qi = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto),
|
|
2512
|
+
const qi = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), zn = { randomUUID: qi };
|
|
2513
2513
|
function zi(t, e, n) {
|
|
2514
2514
|
var s;
|
|
2515
|
-
if (
|
|
2516
|
-
return
|
|
2515
|
+
if (zn.randomUUID && !t)
|
|
2516
|
+
return zn.randomUUID();
|
|
2517
2517
|
t = t || {};
|
|
2518
2518
|
const r = t.random ?? ((s = t.rng) == null ? void 0 : s.call(t)) ?? Ki();
|
|
2519
2519
|
if (r.length < 16)
|
|
2520
2520
|
throw new Error("Random bytes length must be >= 16");
|
|
2521
2521
|
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, Fi(r);
|
|
2522
2522
|
}
|
|
2523
|
-
function
|
|
2523
|
+
function Vn(t) {
|
|
2524
2524
|
const e = t.replace(/-/g, ""), n = [];
|
|
2525
2525
|
for (let r = 0; r < e.length; r += 2)
|
|
2526
2526
|
n.push(parseInt(e.substring(r, r + 2), 16));
|
|
@@ -2536,7 +2536,7 @@ function Vi(t, e) {
|
|
|
2536
2536
|
return 0;
|
|
2537
2537
|
}
|
|
2538
2538
|
function Wi(t, e) {
|
|
2539
|
-
return Vi(
|
|
2539
|
+
return Vi(Vn(t), Vn(e));
|
|
2540
2540
|
}
|
|
2541
2541
|
function N() {
|
|
2542
2542
|
return zi();
|
|
@@ -2572,7 +2572,7 @@ function Ji(t, e) {
|
|
|
2572
2572
|
throw new Oe(`Could not find id attr for ${e}`);
|
|
2573
2573
|
return n;
|
|
2574
2574
|
}
|
|
2575
|
-
function
|
|
2575
|
+
function Wn(t, e, n, r) {
|
|
2576
2576
|
return [Yi(t, e, n, r)];
|
|
2577
2577
|
}
|
|
2578
2578
|
function Yi(t, e, n, r) {
|
|
@@ -2605,7 +2605,7 @@ function Lr(t, e, n, r, s) {
|
|
|
2605
2605
|
];
|
|
2606
2606
|
return [i ? d : u, h, y, a, !!i];
|
|
2607
2607
|
}
|
|
2608
|
-
function
|
|
2608
|
+
function Qn(t, e) {
|
|
2609
2609
|
if (typeof e != "string")
|
|
2610
2610
|
return function(o) {
|
|
2611
2611
|
return !1;
|
|
@@ -2656,7 +2656,7 @@ function Xi(t, e) {
|
|
|
2656
2656
|
}
|
|
2657
2657
|
};
|
|
2658
2658
|
if (e.hasOwnProperty("$like")) {
|
|
2659
|
-
const r =
|
|
2659
|
+
const r = Qn(!0, e.$like);
|
|
2660
2660
|
return {
|
|
2661
2661
|
$comparator: !0,
|
|
2662
2662
|
$op: function(i) {
|
|
@@ -2665,7 +2665,7 @@ function Xi(t, e) {
|
|
|
2665
2665
|
};
|
|
2666
2666
|
}
|
|
2667
2667
|
if (e.hasOwnProperty("$ilike")) {
|
|
2668
|
-
const r =
|
|
2668
|
+
const r = Qn(!1, e.$ilike);
|
|
2669
2669
|
return {
|
|
2670
2670
|
$comparator: !0,
|
|
2671
2671
|
$op: function(i) {
|
|
@@ -2704,7 +2704,7 @@ function to(t, e, n, r, s) {
|
|
|
2704
2704
|
}, [n, r, []]);
|
|
2705
2705
|
return [i, o, a];
|
|
2706
2706
|
}
|
|
2707
|
-
function
|
|
2707
|
+
function Kt(t, e, n, r, s, i) {
|
|
2708
2708
|
const o = s.slice(0, s.length - 1), a = s[s.length - 1], [c, u, l] = to(t, e, n, r, o), d = eo(t, e, c, u, a, i);
|
|
2709
2709
|
return l.concat([d]);
|
|
2710
2710
|
}
|
|
@@ -2723,7 +2723,7 @@ function io(t, e, n) {
|
|
|
2723
2723
|
return e == i ? i : `${i}-${n}`;
|
|
2724
2724
|
};
|
|
2725
2725
|
}
|
|
2726
|
-
function
|
|
2726
|
+
function Bn(t, e, n, r, s, i) {
|
|
2727
2727
|
const o = t(r, s), a = i.map((c, u) => {
|
|
2728
2728
|
const l = io(t, o, u);
|
|
2729
2729
|
return Fr(l, n, r, s, c);
|
|
@@ -2736,22 +2736,22 @@ function oo(t) {
|
|
|
2736
2736
|
e.push(t.slice(0, n));
|
|
2737
2737
|
return e;
|
|
2738
2738
|
}
|
|
2739
|
-
function
|
|
2740
|
-
return oo(s).map((i) =>
|
|
2739
|
+
function Gn(t, e, n, r, s) {
|
|
2740
|
+
return oo(s).map((i) => Kt(t, e, n, r, i, {
|
|
2741
2741
|
$isNull: !0
|
|
2742
2742
|
}));
|
|
2743
2743
|
}
|
|
2744
2744
|
function Fr(t, e, n, r, s) {
|
|
2745
2745
|
return Object.entries(s).flatMap(([i, o]) => {
|
|
2746
2746
|
if (ro([i, o]))
|
|
2747
|
-
return
|
|
2747
|
+
return Bn(t, "or", e, n, r, o);
|
|
2748
2748
|
if (so([i, o]))
|
|
2749
|
-
return
|
|
2749
|
+
return Bn(t, "and", e, n, r, o);
|
|
2750
2750
|
if (i === "$entityIdStartsWith")
|
|
2751
2751
|
return [];
|
|
2752
2752
|
const a = i.split(".");
|
|
2753
2753
|
if (o != null && o.hasOwnProperty("$ne") && (o = { ...o, $not: o.$ne }, delete o.$ne), o != null && o.hasOwnProperty("$not")) {
|
|
2754
|
-
const c =
|
|
2754
|
+
const c = Kt(t, e, n, r, a, o), u = Gn(t, e, n, r, a);
|
|
2755
2755
|
return [
|
|
2756
2756
|
{
|
|
2757
2757
|
or: {
|
|
@@ -2764,16 +2764,16 @@ function Fr(t, e, n, r, s) {
|
|
|
2764
2764
|
return o != null && o.hasOwnProperty("$isNull") && o.$isNull === !0 && a.length > 1 ? [
|
|
2765
2765
|
{
|
|
2766
2766
|
or: {
|
|
2767
|
-
patterns:
|
|
2767
|
+
patterns: Gn(t, e, n, r, a),
|
|
2768
2768
|
joinSym: t(n, r)
|
|
2769
2769
|
}
|
|
2770
2770
|
}
|
|
2771
|
-
] :
|
|
2771
|
+
] : Kt(t, e, n, r, a, o);
|
|
2772
2772
|
});
|
|
2773
2773
|
}
|
|
2774
2774
|
function ao(t, e, n, r) {
|
|
2775
2775
|
const s = lt;
|
|
2776
|
-
return r ? Fr(s, t, e, n, r).concat(
|
|
2776
|
+
return r ? Fr(s, t, e, n, r).concat(Wn(s, t, e, n)) : Wn(s, t, e, n);
|
|
2777
2777
|
}
|
|
2778
2778
|
function co(t, e, n) {
|
|
2779
2779
|
return [t(e, n), t("time", n)];
|
|
@@ -2815,7 +2815,7 @@ function Ue(t, e, n, r, s) {
|
|
|
2815
2815
|
function at([t, e], [n, r], s) {
|
|
2816
2816
|
return Ue(t, e, n, r, s);
|
|
2817
2817
|
}
|
|
2818
|
-
function
|
|
2818
|
+
function qt(t) {
|
|
2819
2819
|
return t == null ? t : new Date(t).getTime();
|
|
2820
2820
|
}
|
|
2821
2821
|
function ho(t, e, n, r) {
|
|
@@ -2823,7 +2823,7 @@ function ho(t, e, n, r) {
|
|
|
2823
2823
|
const [s, i, o, a] = t, c = n === "desc" ? 1 : -1;
|
|
2824
2824
|
if (((b = e["forward-identity"]) == null ? void 0 : b[2]) === "id")
|
|
2825
2825
|
return at(r, [s, a], null) === c;
|
|
2826
|
-
const [u, l] = r, d = e["checked-data-type"], h = d === "date" ?
|
|
2826
|
+
const [u, l] = r, d = e["checked-data-type"], h = d === "date" ? qt(l) : l, y = d === "date" ? qt(o) : o;
|
|
2827
2827
|
return at([u, h], [s, y], d) === c;
|
|
2828
2828
|
}
|
|
2829
2829
|
function po(t, e) {
|
|
@@ -2847,7 +2847,7 @@ function _o(t, e, n) {
|
|
|
2847
2847
|
const r = /* @__PURE__ */ new Map();
|
|
2848
2848
|
for (const o of n.fields) {
|
|
2849
2849
|
const a = U(t, e, o), c = (s = a == null ? void 0 : a["forward-identity"]) == null ? void 0 : s[2];
|
|
2850
|
-
c &&
|
|
2850
|
+
c && on(a) && r.set(c, a);
|
|
2851
2851
|
}
|
|
2852
2852
|
if (!r.has("id")) {
|
|
2853
2853
|
const o = U(t, e, "id"), a = (i = o == null ? void 0 : o["forward-identity"]) == null ? void 0 : i[2];
|
|
@@ -2865,7 +2865,7 @@ function go(t, e, { etype: n, pageInfo: r, dq: s, form: i }) {
|
|
|
2865
2865
|
u = u.map(([T]) => {
|
|
2866
2866
|
var E, A, j, L, q;
|
|
2867
2867
|
let v = (q = (L = (j = (A = (E = t.eav.get(T)) == null ? void 0 : E.get(m)) == null ? void 0 : A.values()) == null ? void 0 : j.next()) == null ? void 0 : L.value) == null ? void 0 : q[2];
|
|
2868
|
-
return w && (v =
|
|
2868
|
+
return w && (v = qt(v)), [T, v];
|
|
2869
2869
|
});
|
|
2870
2870
|
}
|
|
2871
2871
|
u.sort(c === "asc" ? function(m, T) {
|
|
@@ -2961,7 +2961,7 @@ function vo() {
|
|
|
2961
2961
|
return new Set(Object.keys(e));
|
|
2962
2962
|
}
|
|
2963
2963
|
const Ao = vo();
|
|
2964
|
-
function
|
|
2964
|
+
function zt(t, e, n) {
|
|
2965
2965
|
const r = {
|
|
2966
2966
|
__etype: t,
|
|
2967
2967
|
__ops: n
|
|
@@ -2973,7 +2973,7 @@ function qt(t, e, n) {
|
|
|
2973
2973
|
if (i === "__etype")
|
|
2974
2974
|
return t;
|
|
2975
2975
|
if (Ao.has(i))
|
|
2976
|
-
return (o, a) =>
|
|
2976
|
+
return (o, a) => zt(t, e, [
|
|
2977
2977
|
...n,
|
|
2978
2978
|
a ? [i, t, e, o, a] : [i, t, e, o]
|
|
2979
2979
|
]);
|
|
@@ -2995,18 +2995,18 @@ function Oo(t) {
|
|
|
2995
2995
|
if (n === "__etype")
|
|
2996
2996
|
return t;
|
|
2997
2997
|
const r = n;
|
|
2998
|
-
return ct(r) ?
|
|
2998
|
+
return ct(r) ? zt(t, zr(r), []) : zt(t, r, []);
|
|
2999
2999
|
}
|
|
3000
3000
|
});
|
|
3001
3001
|
}
|
|
3002
|
-
function
|
|
3002
|
+
function cn() {
|
|
3003
3003
|
return new Proxy({}, {
|
|
3004
3004
|
get(t, e) {
|
|
3005
3005
|
return Oo(e);
|
|
3006
3006
|
}
|
|
3007
3007
|
});
|
|
3008
3008
|
}
|
|
3009
|
-
|
|
3009
|
+
cn();
|
|
3010
3010
|
function Eo(t) {
|
|
3011
3011
|
return t.__ops;
|
|
3012
3012
|
}
|
|
@@ -3042,7 +3042,7 @@ function Co(t, e, n) {
|
|
|
3042
3042
|
// before assuming it's a ref lookup.
|
|
3043
3043
|
!U(t, e, n);
|
|
3044
3044
|
}
|
|
3045
|
-
function
|
|
3045
|
+
function Vt(t) {
|
|
3046
3046
|
const [e, n, ...r] = t.split(".");
|
|
3047
3047
|
if (r.length > 0 || n !== "id")
|
|
3048
3048
|
throw new Error(`${t} is not a valid lookup attribute.`);
|
|
@@ -3051,16 +3051,16 @@ function zt(t) {
|
|
|
3051
3051
|
function Io(t, e, n) {
|
|
3052
3052
|
if (!Co(t, e, n))
|
|
3053
3053
|
return U(t, e, n);
|
|
3054
|
-
const r =
|
|
3054
|
+
const r = Vt(n), s = U(t, e, r) || Te(t, e, r);
|
|
3055
3055
|
if (s && s["value-type"] !== "ref")
|
|
3056
3056
|
throw new Error(`${n} does not reference a valid link attribute.`);
|
|
3057
3057
|
return s;
|
|
3058
3058
|
}
|
|
3059
|
-
function
|
|
3059
|
+
function Wt(t) {
|
|
3060
3060
|
return typeof t == "string" && !ct(t) ? null : typeof t == "string" && ct(t) ? zr(t) : Po(t);
|
|
3061
3061
|
}
|
|
3062
3062
|
function G(t, e, n) {
|
|
3063
|
-
const r =
|
|
3063
|
+
const r = Wt(n);
|
|
3064
3064
|
if (r === null)
|
|
3065
3065
|
return n;
|
|
3066
3066
|
const [s, i] = r, o = Io(t, e, s);
|
|
@@ -3147,14 +3147,14 @@ function Wr({ stores: t, attrsStore: e }, [n, r, s, i]) {
|
|
|
3147
3147
|
return (i == null ? void 0 : i.upsert) === !1 ? { mode: "update" } : (i == null ? void 0 : i.upsert) === !0 ? null : Ro(t, e, n, r) ? { mode: "update" } : null;
|
|
3148
3148
|
}
|
|
3149
3149
|
function $o(t, e) {
|
|
3150
|
-
const { attrsStore: n } = t, [r, s, i, o] = e, a =
|
|
3150
|
+
const { attrsStore: n } = t, [r, s, i, o] = e, a = rn(i), c = G(n, r, s);
|
|
3151
3151
|
return [["id", c]].concat(Object.entries(a)).map(([l, d]) => {
|
|
3152
3152
|
const h = U(n, r, l);
|
|
3153
3153
|
return h["checked-data-type"] === "date" && t.useDateObjects && (d = ut(d)), ["add-triple", c, h.id, d, { mode: "create" }];
|
|
3154
3154
|
});
|
|
3155
3155
|
}
|
|
3156
3156
|
function Do(t, e) {
|
|
3157
|
-
const { attrsStore: n } = t, [r, s, i, o] = e, a =
|
|
3157
|
+
const { attrsStore: n } = t, [r, s, i, o] = e, a = rn(i), c = G(n, r, s), u = Wr(t, [r, c, i, o]);
|
|
3158
3158
|
return [["id", c]].concat(Object.entries(a)).map(([d, h]) => {
|
|
3159
3159
|
const y = U(n, r, d);
|
|
3160
3160
|
return y["checked-data-type"] === "date" && t.useDateObjects && (h = ut(h)), [
|
|
@@ -3170,7 +3170,7 @@ function xo({ attrsStore: t }, [e, n]) {
|
|
|
3170
3170
|
return [["delete-entity", G(t, e, n), e]];
|
|
3171
3171
|
}
|
|
3172
3172
|
function Uo(t, e) {
|
|
3173
|
-
const { attrsStore: n } = t, [r, s, i, o] = e, a =
|
|
3173
|
+
const { attrsStore: n } = t, [r, s, i, o] = e, a = rn(i), c = G(n, r, s), u = Wr(t, [r, c, i, o]), l = Object.entries(a).map(([h, y]) => {
|
|
3174
3174
|
const b = U(n, r, h);
|
|
3175
3175
|
return [
|
|
3176
3176
|
"deep-merge-triple",
|
|
@@ -3275,7 +3275,7 @@ function Vo(t, e, n) {
|
|
|
3275
3275
|
"on-delete-reverse": i.onDelete
|
|
3276
3276
|
};
|
|
3277
3277
|
}
|
|
3278
|
-
function
|
|
3278
|
+
function Hn(t, e, n, r) {
|
|
3279
3279
|
const s = t ? Vo(t, e, n) : null, i = N(), o = [N(), e, n], a = [N(), n, e];
|
|
3280
3280
|
return {
|
|
3281
3281
|
id: i,
|
|
@@ -3301,20 +3301,20 @@ const Wo = /* @__PURE__ */ new Set(["create", "update", "merge", "link", "unlink
|
|
|
3301
3301
|
"merge",
|
|
3302
3302
|
"delete",
|
|
3303
3303
|
"ruleParams"
|
|
3304
|
-
]),
|
|
3305
|
-
...
|
|
3304
|
+
]), Qt = { "unique?": !0, "index?": !0 }, Ho = {
|
|
3305
|
+
...Qt,
|
|
3306
3306
|
cardinality: "one"
|
|
3307
3307
|
};
|
|
3308
3308
|
function Jo(t) {
|
|
3309
3309
|
const e = [], [n, r, s, i] = t;
|
|
3310
3310
|
if (!Go.has(n))
|
|
3311
3311
|
return e;
|
|
3312
|
-
const o =
|
|
3312
|
+
const o = Wt(s);
|
|
3313
3313
|
if (o && e.push({ etype: r, lookupPair: o }), n === "link")
|
|
3314
3314
|
for (const [a, c] of Object.entries(i)) {
|
|
3315
3315
|
const u = Array.isArray(c) ? c : [c];
|
|
3316
3316
|
for (const l of u) {
|
|
3317
|
-
const d =
|
|
3317
|
+
const d = Wt(l);
|
|
3318
3318
|
d && e.push({
|
|
3319
3319
|
etype: r,
|
|
3320
3320
|
lookupPair: d,
|
|
@@ -3349,7 +3349,7 @@ function Yo({ attrsStore: t, schema: e }, n) {
|
|
|
3349
3349
|
}
|
|
3350
3350
|
function d(b, g) {
|
|
3351
3351
|
const w = o(b, g), m = a(b, g);
|
|
3352
|
-
u(w), u(m), !w && !m && c(
|
|
3352
|
+
u(w), u(m), !w && !m && c(Hn(e, b, g, Ho));
|
|
3353
3353
|
}
|
|
3354
3354
|
for (const b of n)
|
|
3355
3355
|
for (const { etype: g, lookupPair: w, linkLabel: m } of Jo(b)) {
|
|
@@ -3360,16 +3360,16 @@ function Yo({ attrsStore: t, schema: e }, n) {
|
|
|
3360
3360
|
u(v), u(E);
|
|
3361
3361
|
const A = ((h = v == null ? void 0 : v["reverse-identity"]) == null ? void 0 : h[1]) || ((y = E == null ? void 0 : E["forward-identity"]) == null ? void 0 : y[1]) || m;
|
|
3362
3362
|
if (l(A, T))
|
|
3363
|
-
d(A,
|
|
3363
|
+
d(A, Vt(T));
|
|
3364
3364
|
else {
|
|
3365
3365
|
const j = o(A, T);
|
|
3366
|
-
j || c(Ze(e, A, T,
|
|
3366
|
+
j || c(Ze(e, A, T, Qt)), u(j);
|
|
3367
3367
|
}
|
|
3368
3368
|
} else if (l(g, T))
|
|
3369
|
-
d(g,
|
|
3369
|
+
d(g, Vt(T));
|
|
3370
3370
|
else {
|
|
3371
3371
|
const v = o(g, T);
|
|
3372
|
-
v || c(Ze(e, g, T,
|
|
3372
|
+
v || c(Ze(e, g, T, Qt)), u(v);
|
|
3373
3373
|
}
|
|
3374
3374
|
}
|
|
3375
3375
|
for (const b of n) {
|
|
@@ -3381,7 +3381,7 @@ function Yo({ attrsStore: t, schema: e }, n) {
|
|
|
3381
3381
|
const A = o(w, E);
|
|
3382
3382
|
if (u(A), Bo.has(g) && (A || c(Ze(e, w, E, E === "id" ? { "unique?": !0 } : null))), Qo.has(g)) {
|
|
3383
3383
|
const j = a(w, E);
|
|
3384
|
-
!A && !j && c(
|
|
3384
|
+
!A && !j && c(Hn(e, w, E)), u(j);
|
|
3385
3385
|
}
|
|
3386
3386
|
}
|
|
3387
3387
|
}
|
|
@@ -3398,7 +3398,7 @@ function Zo(t, e) {
|
|
|
3398
3398
|
const r = (Array.isArray(e) ? e : [e]).flatMap((c) => Eo(c)), [s, i] = Yo(t, r), o = { ...t, attrsStore: s }, a = r.flatMap((c) => No(o, c));
|
|
3399
3399
|
return [...i, ...a];
|
|
3400
3400
|
}
|
|
3401
|
-
function
|
|
3401
|
+
function Jn(t, e) {
|
|
3402
3402
|
typeof requestIdleCallback > "u" ? t() : requestIdleCallback(t, { timeout: e });
|
|
3403
3403
|
}
|
|
3404
3404
|
const Ne = "__meta";
|
|
@@ -3406,7 +3406,7 @@ class Xo {
|
|
|
3406
3406
|
constructor(e, n) {
|
|
3407
3407
|
}
|
|
3408
3408
|
}
|
|
3409
|
-
class
|
|
3409
|
+
class Bt {
|
|
3410
3410
|
constructor(e) {
|
|
3411
3411
|
p(this, "currentValue");
|
|
3412
3412
|
p(this, "_subs", []);
|
|
@@ -3599,7 +3599,7 @@ class Qt {
|
|
|
3599
3599
|
gc() {
|
|
3600
3600
|
this._nextGc || (this._nextGc = setTimeout(
|
|
3601
3601
|
() => {
|
|
3602
|
-
|
|
3602
|
+
Jn(() => {
|
|
3603
3603
|
this._nextGc = null, this._gc();
|
|
3604
3604
|
}, 30 * 1e3);
|
|
3605
3605
|
},
|
|
@@ -3614,7 +3614,7 @@ class Qt {
|
|
|
3614
3614
|
return;
|
|
3615
3615
|
}
|
|
3616
3616
|
this._nextSave = setTimeout(() => {
|
|
3617
|
-
|
|
3617
|
+
Jn(() => {
|
|
3618
3618
|
this._nextSave = null, this._writeToStorage(e).then(n).catch(r);
|
|
3619
3619
|
}, this._idleCallbackMaxWaitMs);
|
|
3620
3620
|
}, this._saveThrottleMs);
|
|
@@ -3700,7 +3700,7 @@ async function sa(t, e, n) {
|
|
|
3700
3700
|
};
|
|
3701
3701
|
});
|
|
3702
3702
|
}
|
|
3703
|
-
async function
|
|
3703
|
+
async function Yn(t, e, n) {
|
|
3704
3704
|
const r = n.put(e, t);
|
|
3705
3705
|
return new Promise((s, i) => {
|
|
3706
3706
|
r.onsuccess = () => s(), r.onerror = (o) => i(o);
|
|
@@ -3735,7 +3735,7 @@ async function ia(t, e) {
|
|
|
3735
3735
|
break;
|
|
3736
3736
|
}
|
|
3737
3737
|
default: {
|
|
3738
|
-
const h =
|
|
3738
|
+
const h = Yn(l, d, i);
|
|
3739
3739
|
a.push(h);
|
|
3740
3740
|
const y = {
|
|
3741
3741
|
createdAt: Date.now(),
|
|
@@ -3746,12 +3746,12 @@ async function ia(t, e) {
|
|
|
3746
3746
|
break;
|
|
3747
3747
|
}
|
|
3748
3748
|
}
|
|
3749
|
-
const u =
|
|
3749
|
+
const u = Yn(Ne, c, i);
|
|
3750
3750
|
a.push(u), await Promise.all(a), await new Promise((l, d) => {
|
|
3751
3751
|
s.oncomplete = (h) => l(h), s.onerror = (h) => d(h), s.onabort = (h) => d(h);
|
|
3752
3752
|
});
|
|
3753
3753
|
}
|
|
3754
|
-
const
|
|
3754
|
+
const Zn = /* @__PURE__ */ new Map();
|
|
3755
3755
|
class Qr extends Xo {
|
|
3756
3756
|
constructor(n, r) {
|
|
3757
3757
|
super(n, r);
|
|
@@ -3774,9 +3774,9 @@ class Qr extends Xo {
|
|
|
3774
3774
|
const u = ia(this._appId, c).catch((l) => {
|
|
3775
3775
|
na("Error upgrading store from version 5 to 6.")(l);
|
|
3776
3776
|
});
|
|
3777
|
-
|
|
3777
|
+
Zn.set(this.dbName, u), u.then(() => n(c)).catch(() => n(c));
|
|
3778
3778
|
} else {
|
|
3779
|
-
const u =
|
|
3779
|
+
const u = Zn.get(this.dbName);
|
|
3780
3780
|
u ? u.then(() => n(c)).catch(() => n(c)) : n(c);
|
|
3781
3781
|
}
|
|
3782
3782
|
}, i.onupgradeneeded = (o) => {
|
|
@@ -3934,7 +3934,7 @@ async function ua({ apiURI: t, appId: e }) {
|
|
|
3934
3934
|
})
|
|
3935
3935
|
});
|
|
3936
3936
|
}
|
|
3937
|
-
async function
|
|
3937
|
+
async function Xn({ apiURI: t, appId: e, code: n, codeVerifier: r, refreshToken: s }) {
|
|
3938
3938
|
return await ne(`${t}/runtime/oauth/token`, {
|
|
3939
3939
|
method: "POST",
|
|
3940
3940
|
headers: { "content-type": "application/json" },
|
|
@@ -4027,9 +4027,9 @@ async function ba({ apiURI: t, appId: e, path: n, refreshToken: r }) {
|
|
|
4027
4027
|
});
|
|
4028
4028
|
return s;
|
|
4029
4029
|
}
|
|
4030
|
-
let
|
|
4031
|
-
typeof window < "u" && typeof window.localStorage < "u" && (
|
|
4032
|
-
function
|
|
4030
|
+
let un = !1, Gr = !1, Hr = !1;
|
|
4031
|
+
typeof window < "u" && typeof window.localStorage < "u" && (un = !!window.localStorage.getItem("devBackend"), Gr = !!window.localStorage.getItem("__instantLogging"), Hr = !!window.localStorage.getItem("__devtoolLocalDash"));
|
|
4032
|
+
function er(t, e) {
|
|
4033
4033
|
if (!e)
|
|
4034
4034
|
return t;
|
|
4035
4035
|
const n = {};
|
|
@@ -4042,27 +4042,27 @@ function _a(t, e, n) {
|
|
|
4042
4042
|
peers: {}
|
|
4043
4043
|
};
|
|
4044
4044
|
if (e && "user" in e ? e.user : !0) {
|
|
4045
|
-
const i =
|
|
4045
|
+
const i = er(t.user ?? {}, e == null ? void 0 : e.keys);
|
|
4046
4046
|
r.user = { ...i, peerId: n };
|
|
4047
4047
|
}
|
|
4048
4048
|
for (const i of Object.keys(t.peers ?? {})) {
|
|
4049
4049
|
const o = (e == null ? void 0 : e.peers) === void 0, a = Array.isArray(e == null ? void 0 : e.peers) && (e == null ? void 0 : e.peers.includes(i));
|
|
4050
4050
|
if (o || a) {
|
|
4051
|
-
const c =
|
|
4051
|
+
const c = er(t.peers[i], e == null ? void 0 : e.keys);
|
|
4052
4052
|
r.peers[i] = { ...c, peerId: i };
|
|
4053
4053
|
}
|
|
4054
4054
|
}
|
|
4055
4055
|
return r;
|
|
4056
4056
|
}
|
|
4057
4057
|
function ga(t, e) {
|
|
4058
|
-
if (t.isLoading !== e.isLoading || t.error !== e.error || (t.user || e.user) && (!t.user || !e.user || !
|
|
4058
|
+
if (t.isLoading !== e.isLoading || t.error !== e.error || (t.user || e.user) && (!t.user || !e.user || !Fn(t.user, e.user)) || !Ar(t.peers, e.peers))
|
|
4059
4059
|
return !0;
|
|
4060
4060
|
for (const r of Object.keys(t.peers))
|
|
4061
|
-
if (!
|
|
4061
|
+
if (!Fn(t.peers[r], e.peers[r]))
|
|
4062
4062
|
return !0;
|
|
4063
4063
|
return !1;
|
|
4064
4064
|
}
|
|
4065
|
-
class
|
|
4065
|
+
class tr {
|
|
4066
4066
|
constructor() {
|
|
4067
4067
|
p(this, "promise");
|
|
4068
4068
|
p(this, "_resolve");
|
|
@@ -4087,11 +4087,11 @@ function Jr(t, e = []) {
|
|
|
4087
4087
|
Jr(n["child-nodes"], e);
|
|
4088
4088
|
});
|
|
4089
4089
|
}
|
|
4090
|
-
function
|
|
4090
|
+
function nr(t) {
|
|
4091
4091
|
const e = [];
|
|
4092
4092
|
return Jr(t, e), e;
|
|
4093
4093
|
}
|
|
4094
|
-
function
|
|
4094
|
+
function rr(t) {
|
|
4095
4095
|
return Object.values(t.links).reduce((e, n) => {
|
|
4096
4096
|
var r, s;
|
|
4097
4097
|
return e[r = n.forward.on] ?? (e[r] = {}), e[n.forward.on][n.forward.label] = {
|
|
@@ -4105,7 +4105,7 @@ function nr(t) {
|
|
|
4105
4105
|
}, e;
|
|
4106
4106
|
}, {});
|
|
4107
4107
|
}
|
|
4108
|
-
const Yr = "v0.22.
|
|
4108
|
+
const Yr = "v0.22.105-experimental.fix1111111.21050884263.1";
|
|
4109
4109
|
function Ta(t, e) {
|
|
4110
4110
|
return {
|
|
4111
4111
|
info: t ? (...n) => console.info(...n, e()) : () => {
|
|
@@ -4155,7 +4155,7 @@ class R extends Error {
|
|
|
4155
4155
|
super(r), this.name = "QueryValidationError";
|
|
4156
4156
|
}
|
|
4157
4157
|
}
|
|
4158
|
-
const
|
|
4158
|
+
const sr = [
|
|
4159
4159
|
"where",
|
|
4160
4160
|
"order",
|
|
4161
4161
|
"limit",
|
|
@@ -4295,8 +4295,8 @@ const rr = [
|
|
|
4295
4295
|
}
|
|
4296
4296
|
}, va = (t, e, n, r, s = 0) => {
|
|
4297
4297
|
for (const o of Object.keys(t))
|
|
4298
|
-
if (!
|
|
4299
|
-
throw new R(`Invalid query parameter '${o}' in $ object. Valid parameters are: ${
|
|
4298
|
+
if (!sr.includes(o))
|
|
4299
|
+
throw new R(`Invalid query parameter '${o}' in $ object. Valid parameters are: ${sr.join(", ")}. Found: ${o}`, r);
|
|
4300
4300
|
const i = [
|
|
4301
4301
|
// 'limit', // only supported client side
|
|
4302
4302
|
"offset",
|
|
@@ -4334,7 +4334,7 @@ const rr = [
|
|
|
4334
4334
|
throw new R(`Query parameter '$' must be an object in entity '${e}', but received: ${typeof a}`, `${r}.$`);
|
|
4335
4335
|
va(a, e, n, `${r}.$`, s);
|
|
4336
4336
|
}
|
|
4337
|
-
},
|
|
4337
|
+
}, ir = (t, e) => {
|
|
4338
4338
|
if (typeof t != "object" || t === null)
|
|
4339
4339
|
throw new R(`Query must be an object, but received: ${typeof t}${t === null ? " (null)" : ""}`);
|
|
4340
4340
|
if (Array.isArray(t))
|
|
@@ -4353,7 +4353,7 @@ const rr = [
|
|
|
4353
4353
|
es(n[r], r, e, r, 0);
|
|
4354
4354
|
}
|
|
4355
4355
|
}
|
|
4356
|
-
},
|
|
4356
|
+
}, or = (t) => typeof t != "string" ? !1 : ct(t) ? !0 : Ae(t);
|
|
4357
4357
|
class Z extends Error {
|
|
4358
4358
|
constructor(e) {
|
|
4359
4359
|
super(e), this.name = "TransactionValidationError";
|
|
@@ -4384,7 +4384,7 @@ const ts = (t) => t.length > 0 ? t.join(", ") : "none", Aa = (t, e) => new Z(`En
|
|
|
4384
4384
|
if (o && !Oa(i, o))
|
|
4385
4385
|
throw new Z(`Invalid value for attribute '${s}' in entity '${t}'. Expected ${o.valueType}, but received: ${typeof i}`);
|
|
4386
4386
|
}
|
|
4387
|
-
},
|
|
4387
|
+
}, ar = (t, e, n) => {
|
|
4388
4388
|
const r = ns(t, n);
|
|
4389
4389
|
if (typeof e != "object" || e === null)
|
|
4390
4390
|
throw new Z(`Arguments for link operation on entity '${t}' must be an object, but received: ${typeof e}`);
|
|
@@ -4396,9 +4396,9 @@ const ts = (t) => t.length > 0 ? t.join(", ") : "none", Aa = (t, e) => new Z(`En
|
|
|
4396
4396
|
if (i != null) {
|
|
4397
4397
|
if (Array.isArray(i)) {
|
|
4398
4398
|
for (const a of i)
|
|
4399
|
-
if (!
|
|
4399
|
+
if (!or(a))
|
|
4400
4400
|
throw new Z(`Invalid entity ID in link '${s}' for entity '${t}'. Expected a UUID or a lookup, but received: ${a}`);
|
|
4401
|
-
} else if (!
|
|
4401
|
+
} else if (!or(i))
|
|
4402
4402
|
throw new Z(`Invalid UUID in link '${s}' for entity '${t}'. Expected a UUID, but received: ${i}`);
|
|
4403
4403
|
}
|
|
4404
4404
|
}
|
|
@@ -4406,8 +4406,8 @@ const ts = (t) => t.length > 0 ? t.join(", ") : "none", Aa = (t, e) => new Z(`En
|
|
|
4406
4406
|
create: Ot,
|
|
4407
4407
|
update: Ot,
|
|
4408
4408
|
merge: Ot,
|
|
4409
|
-
link:
|
|
4410
|
-
unlink:
|
|
4409
|
+
link: ar,
|
|
4410
|
+
unlink: ar,
|
|
4411
4411
|
delete: () => {
|
|
4412
4412
|
}
|
|
4413
4413
|
}, ka = (t, e) => {
|
|
@@ -4435,7 +4435,7 @@ const ts = (t) => t.length > 0 ? t.join(", ") : "none", Aa = (t, e) => new Z(`En
|
|
|
4435
4435
|
}
|
|
4436
4436
|
};
|
|
4437
4437
|
let rs = 0;
|
|
4438
|
-
class
|
|
4438
|
+
class cr {
|
|
4439
4439
|
constructor(e) {
|
|
4440
4440
|
p(this, "type", "ws");
|
|
4441
4441
|
p(this, "conn");
|
|
@@ -4601,7 +4601,7 @@ function ja(t, e, n) {
|
|
|
4601
4601
|
function Et(t, e, n) {
|
|
4602
4602
|
return qr({ store: e, attrsStore: n, pageInfo: null, aggregate: null }, t.query).data[t.table][0];
|
|
4603
4603
|
}
|
|
4604
|
-
function
|
|
4604
|
+
function ur(t, e, n, r) {
|
|
4605
4605
|
var o;
|
|
4606
4606
|
const s = (o = U(n, t.table, "id")) == null ? void 0 : o.id;
|
|
4607
4607
|
if (!s)
|
|
@@ -4609,7 +4609,7 @@ function cr(t, e, n, r) {
|
|
|
4609
4609
|
const i = ke(e.eav, [r, s, r]);
|
|
4610
4610
|
return i ? i[3] : -1;
|
|
4611
4611
|
}
|
|
4612
|
-
function
|
|
4612
|
+
function lr(t, e, n) {
|
|
4613
4613
|
for (const { action: r, triple: s } of n)
|
|
4614
4614
|
switch (r) {
|
|
4615
4615
|
case "added":
|
|
@@ -4687,7 +4687,7 @@ class xa {
|
|
|
4687
4687
|
p(this, "log");
|
|
4688
4688
|
p(this, "createStore");
|
|
4689
4689
|
p(this, "getAttrs");
|
|
4690
|
-
this.trySend = e, this.config = r, this.log = s, this.createStore = i, this.getAttrs = o, this.subs = new
|
|
4690
|
+
this.trySend = e, this.config = r, this.log = s, this.createStore = i, this.getAttrs = o, this.subs = new Bt({
|
|
4691
4691
|
persister: n,
|
|
4692
4692
|
merge: ja,
|
|
4693
4693
|
serialize: Ma,
|
|
@@ -4816,7 +4816,7 @@ class xa {
|
|
|
4816
4816
|
c.push({
|
|
4817
4817
|
store: l,
|
|
4818
4818
|
entity: d,
|
|
4819
|
-
serverCreatedAt:
|
|
4819
|
+
serverCreatedAt: ur(o, l, a.attrsStore, d.id)
|
|
4820
4820
|
}), i.push(d);
|
|
4821
4821
|
}
|
|
4822
4822
|
this.subs.updateInPlace((u) => {
|
|
@@ -4887,7 +4887,7 @@ class xa {
|
|
|
4887
4887
|
for (let T = 0; T < d.length; T++) {
|
|
4888
4888
|
const v = d[T];
|
|
4889
4889
|
if (yi(v.store, w)) {
|
|
4890
|
-
|
|
4890
|
+
lr(v.store, l.attrsStore, m);
|
|
4891
4891
|
const E = Et(s, v.store, l.attrsStore), A = Ra(v.store, l.attrsStore, m)[w];
|
|
4892
4892
|
E ? (h.push({
|
|
4893
4893
|
oldEntity: v.entity,
|
|
@@ -4900,7 +4900,7 @@ class xa {
|
|
|
4900
4900
|
const y = [];
|
|
4901
4901
|
for (const [w, m] of Object.entries(u)) {
|
|
4902
4902
|
const T = this.createStore([]);
|
|
4903
|
-
|
|
4903
|
+
lr(T, l.attrsStore, m);
|
|
4904
4904
|
const v = Et(s, T, l.attrsStore);
|
|
4905
4905
|
if (!v) {
|
|
4906
4906
|
this.log.error("No entity found after applying change", {
|
|
@@ -4913,7 +4913,7 @@ class xa {
|
|
|
4913
4913
|
d.push({
|
|
4914
4914
|
store: T,
|
|
4915
4915
|
entity: v,
|
|
4916
|
-
serverCreatedAt:
|
|
4916
|
+
serverCreatedAt: ur(s, T, l.attrsStore, v.id)
|
|
4917
4917
|
}), y.push(v);
|
|
4918
4918
|
}
|
|
4919
4919
|
const b = [];
|
|
@@ -4973,10 +4973,10 @@ const ie = {
|
|
|
4973
4973
|
}, kt = "_instant_oauth_redirect", Re = "currentUser";
|
|
4974
4974
|
function qa({ transportType: t, appId: e, apiURI: n, wsURI: r, EventSourceImpl: s }) {
|
|
4975
4975
|
if (!s)
|
|
4976
|
-
return new
|
|
4976
|
+
return new cr(`${r}?app_id=${e}`);
|
|
4977
4977
|
switch (t) {
|
|
4978
4978
|
case "ws":
|
|
4979
|
-
return new
|
|
4979
|
+
return new cr(`${r}?app_id=${e}`);
|
|
4980
4980
|
case "sse":
|
|
4981
4981
|
return new Ca(s, `${n}/runtime/sse?app_id=${e}`);
|
|
4982
4982
|
default:
|
|
@@ -4986,7 +4986,7 @@ function qa({ transportType: t, appId: e, apiURI: n, wsURI: r, EventSourceImpl:
|
|
|
4986
4986
|
function za() {
|
|
4987
4987
|
return typeof window < "u" || typeof chrome < "u";
|
|
4988
4988
|
}
|
|
4989
|
-
const
|
|
4989
|
+
const fr = {
|
|
4990
4990
|
"set-presence": !0,
|
|
4991
4991
|
"set-presence-ok": !0,
|
|
4992
4992
|
"refresh-presence": !0,
|
|
@@ -5042,7 +5042,7 @@ function Ga(t, e, n) {
|
|
|
5042
5042
|
const r = e == null ? void 0 : e.result, s = n == null ? void 0 : n.result;
|
|
5043
5043
|
return r && !s && n && (n.result = r), n || e;
|
|
5044
5044
|
}
|
|
5045
|
-
function
|
|
5045
|
+
function Pt(t) {
|
|
5046
5046
|
return [...t].sort((e, n) => {
|
|
5047
5047
|
const [r, s] = e, [i, o] = n, a = s.order || 0, c = o.order || 0;
|
|
5048
5048
|
return a == c ? r < i ? -1 : r > i ? 1 : 0 : a - c;
|
|
@@ -5175,7 +5175,7 @@ class Ha {
|
|
|
5175
5175
|
this._updatePendingMutations((c) => {
|
|
5176
5176
|
c.set(r, o);
|
|
5177
5177
|
});
|
|
5178
|
-
const a = new
|
|
5178
|
+
const a = new tr();
|
|
5179
5179
|
return this.mutationDeferredStore.set(r, a), this._sendMutation(r, o), this.notifyAll(), a.promise;
|
|
5180
5180
|
});
|
|
5181
5181
|
p(this, "_transportOnOpen", (e) => {
|
|
@@ -5246,7 +5246,7 @@ class Ha {
|
|
|
5246
5246
|
}
|
|
5247
5247
|
this._log.info("[socket][close]", n.id, "schedule reconnect, ms =", this._reconnectTimeoutMs), this._scheduleReconnect();
|
|
5248
5248
|
});
|
|
5249
|
-
if (this._EventSource = i, this.config = { ...Ka, ...e }, this.queryCacheLimit = this.config.queryCacheLimit ?? 10, this._pendingTxCleanupTimeout = this.config.pendingTxCleanupTimeout ?? La, this._pendingMutationCleanupThreshold = this.config.pendingMutationCleanupThreshold ?? Fa, this._log = Ta(e.verbose ||
|
|
5249
|
+
if (this._EventSource = i, this.config = { ...Ka, ...e }, this.queryCacheLimit = this.config.queryCacheLimit ?? 10, this._pendingTxCleanupTimeout = this.config.pendingTxCleanupTimeout ?? La, this._pendingMutationCleanupThreshold = this.config.pendingMutationCleanupThreshold ?? Fa, this._log = Ta(e.verbose || un || Gr, () => this._reactorStats()), this.versions = { ...s || {}, "@instantdb/core": Yr }, this.config.schema && (this._linkIndex = rr(this.config.schema)), !!za()) {
|
|
5250
5250
|
if (!e.appId)
|
|
5251
5251
|
throw new Error("Instant must be initialized with an appId.");
|
|
5252
5252
|
if (!Ae(e.appId))
|
|
@@ -5285,7 +5285,7 @@ class Ha {
|
|
|
5285
5285
|
...this.config,
|
|
5286
5286
|
schema: e,
|
|
5287
5287
|
cardinalityInference: !!e
|
|
5288
|
-
}, this._linkIndex = e ?
|
|
5288
|
+
}, this._linkIndex = e ? rr(this.config.schema) : null;
|
|
5289
5289
|
}
|
|
5290
5290
|
_reactorStats() {
|
|
5291
5291
|
return {
|
|
@@ -5298,7 +5298,7 @@ class Ha {
|
|
|
5298
5298
|
this.kv.waitForKeyToLoad("pendingMutations").then(() => this.notifyOne(e));
|
|
5299
5299
|
}
|
|
5300
5300
|
_initStorage(e) {
|
|
5301
|
-
this.querySubs = new
|
|
5301
|
+
this.querySubs = new Bt({
|
|
5302
5302
|
persister: new e(this.config.appId, "querySubs"),
|
|
5303
5303
|
merge: Ga,
|
|
5304
5304
|
serialize: Wa,
|
|
@@ -5318,7 +5318,7 @@ class Ha {
|
|
|
5318
5318
|
maxSize: 1e6
|
|
5319
5319
|
// 1 million triples
|
|
5320
5320
|
}
|
|
5321
|
-
}), this.querySubs.onKeyLoaded = (n) => this._onQuerySubLoaded(n), this.kv = new
|
|
5321
|
+
}), this.querySubs.onKeyLoaded = (n) => this._onQuerySubLoaded(n), this.kv = new Bt({
|
|
5322
5322
|
persister: new e(this.config.appId, "kv"),
|
|
5323
5323
|
merge: this._onMergeKv,
|
|
5324
5324
|
serialize: Ba,
|
|
@@ -5401,7 +5401,7 @@ class Ha {
|
|
|
5401
5401
|
_handleReceive(e, n) {
|
|
5402
5402
|
var s, i, o, a, c, u;
|
|
5403
5403
|
const r = !!this.config.schema && ("cardinalityInference" in this.config ? !!this.config.cardinalityInference : !0);
|
|
5404
|
-
switch (
|
|
5404
|
+
switch (fr[n.op] || this._log.info("[receive]", e, n.op, n), n.op) {
|
|
5405
5405
|
case "init-ok": {
|
|
5406
5406
|
this._setStatus(ie.AUTHENTICATED), this._reconnectTimeoutMs = 0, this._setAttrs(n.attrs), this._flushPendingMessages(), this._sessionId = n["session-id"];
|
|
5407
5407
|
for (const h of Object.keys(this._rooms)) {
|
|
@@ -5418,7 +5418,7 @@ class Ha {
|
|
|
5418
5418
|
const { q: h, result: y } = n, b = F(h);
|
|
5419
5419
|
if (!this._hasQueryListeners() && !this.querySubs.currentValue[b])
|
|
5420
5420
|
break;
|
|
5421
|
-
const g = (a = (o = y == null ? void 0 : y[0]) == null ? void 0 : o.data) == null ? void 0 : a["page-info"], w = (u = (c = y == null ? void 0 : y[0]) == null ? void 0 : c.data) == null ? void 0 : u.aggregate, m =
|
|
5421
|
+
const g = (a = (o = y == null ? void 0 : y[0]) == null ? void 0 : o.data) == null ? void 0 : a["page-info"], w = (u = (c = y == null ? void 0 : y[0]) == null ? void 0 : c.data) == null ? void 0 : u.aggregate, m = nr(y), T = this.ensureAttrs(), v = xe(T, m, r, this.config.useDateObjects);
|
|
5422
5422
|
this.querySubs.updateInPlace((E) => {
|
|
5423
5423
|
if (!E[b]) {
|
|
5424
5424
|
this._log.info("Missing value in querySubs", { hash: b, q: h });
|
|
@@ -5457,9 +5457,9 @@ class Ha {
|
|
|
5457
5457
|
g !== this._pendingMutations() && this.kv.updateInPlace((T) => {
|
|
5458
5458
|
T.pendingMutations = g;
|
|
5459
5459
|
});
|
|
5460
|
-
const w =
|
|
5460
|
+
const w = Pt(g.entries()), m = h.map((T) => {
|
|
5461
5461
|
var Ce, X, re, ue;
|
|
5462
|
-
const v = T["instaql-query"], E = T["instaql-result"], A = F(v), j =
|
|
5462
|
+
const v = T["instaql-query"], E = T["instaql-result"], A = F(v), j = nr(E), L = this.ensureAttrs(), q = xe(L, j, r, this.config.useDateObjects), { store: Pe, attrsStore: We } = this._applyOptimisticUpdates(q, L, w, b), dt = (X = (Ce = E == null ? void 0 : E[0]) == null ? void 0 : Ce.data) == null ? void 0 : X["page-info"], ht = (ue = (re = E == null ? void 0 : E[0]) == null ? void 0 : re.data) == null ? void 0 : ue.aggregate;
|
|
5463
5463
|
return {
|
|
5464
5464
|
q: v,
|
|
5465
5465
|
hash: A,
|
|
@@ -5645,15 +5645,15 @@ class Ha {
|
|
|
5645
5645
|
* Returns an unsubscribe function
|
|
5646
5646
|
*/
|
|
5647
5647
|
subscribeQuery(e, n, r) {
|
|
5648
|
-
this.config.disableValidation ||
|
|
5648
|
+
this.config.disableValidation || ir(e, this.config.schema), r && "ruleParams" in r && (e = { $$ruleParams: r.ruleParams, ...e });
|
|
5649
5649
|
const s = F(e), i = this.getPreviousResult(e);
|
|
5650
5650
|
return i && n(i), this.queryCbs[s] = this.queryCbs[s] ?? [], this.queryCbs[s].push({ q: e, cb: n }), this._startQuerySub(e, s), () => {
|
|
5651
5651
|
this._unsubQuery(e, s, n);
|
|
5652
5652
|
};
|
|
5653
5653
|
}
|
|
5654
5654
|
queryOnce(e, n) {
|
|
5655
|
-
this.config.disableValidation ||
|
|
5656
|
-
const r = new
|
|
5655
|
+
this.config.disableValidation || ir(e, this.config.schema), n && "ruleParams" in n && (e = { $$ruleParams: n.ruleParams, ...e });
|
|
5656
|
+
const r = new tr();
|
|
5657
5657
|
if (!this._isOnline)
|
|
5658
5658
|
return r.reject(new Error("We can't run `queryOnce`, because the device is offline.")), r.promise;
|
|
5659
5659
|
if (!this.querySubs)
|
|
@@ -5739,7 +5739,7 @@ class Ha {
|
|
|
5739
5739
|
return a ? u : n;
|
|
5740
5740
|
}
|
|
5741
5741
|
_rewriteMutationsSorted(e, n) {
|
|
5742
|
-
return
|
|
5742
|
+
return Pt(this._rewriteMutations(e, n).entries());
|
|
5743
5743
|
}
|
|
5744
5744
|
// ---------------------------
|
|
5745
5745
|
// Transact
|
|
@@ -5840,12 +5840,16 @@ class Ha {
|
|
|
5840
5840
|
// Websocket
|
|
5841
5841
|
/** Send messages we accumulated while we were connecting */
|
|
5842
5842
|
_flushPendingMessages() {
|
|
5843
|
-
Object.keys(this.queryCbs).map((
|
|
5844
|
-
this._trySendAuthed(
|
|
5845
|
-
}), Object.values(this.queryOnceDfds).flat().forEach(({ eventId:
|
|
5846
|
-
this._trySendAuthed(
|
|
5847
|
-
})
|
|
5848
|
-
|
|
5843
|
+
Object.keys(this.queryCbs).map((i) => this.querySubs.currentValue[i]).filter((i) => i).forEach(({ eventId: i, q: o }) => {
|
|
5844
|
+
this._trySendAuthed(i, { op: "add-query", q: o });
|
|
5845
|
+
}), Object.values(this.queryOnceDfds).flat().forEach(({ eventId: i, q: o }) => {
|
|
5846
|
+
this._trySendAuthed(i, { op: "add-query", q: o });
|
|
5847
|
+
});
|
|
5848
|
+
const r = this._rewriteMutations(this.ensureAttrs(), this._pendingMutations());
|
|
5849
|
+
r !== this._pendingMutations() && this.kv.updateInPlace((i) => {
|
|
5850
|
+
i.pendingMutations = r;
|
|
5851
|
+
}), Pt(r.entries()).forEach(([i, o]) => {
|
|
5852
|
+
o["tx-id"] || this._sendMutation(i, o);
|
|
5849
5853
|
}), this._syncTable.flushPending();
|
|
5850
5854
|
}
|
|
5851
5855
|
/**
|
|
@@ -5879,7 +5883,7 @@ class Ha {
|
|
|
5879
5883
|
}
|
|
5880
5884
|
_trySend(e, n, r) {
|
|
5881
5885
|
if (this._transport.isOpen()) {
|
|
5882
|
-
switch (
|
|
5886
|
+
switch (fr[n.op] || this._log.info("[send]", this._transport.id, n.op, n), n.op) {
|
|
5883
5887
|
case "transact": {
|
|
5884
5888
|
this._inFlightMutationEventIds.add(e);
|
|
5885
5889
|
break;
|
|
@@ -5970,7 +5974,7 @@ class Ha {
|
|
|
5970
5974
|
return null;
|
|
5971
5975
|
this._replaceUrlAfterOAuth();
|
|
5972
5976
|
try {
|
|
5973
|
-
const c = await this._getCurrentUser(), u = (c == null ? void 0 : c.type) === "guest", { user: l } = await
|
|
5977
|
+
const c = await this._getCurrentUser(), u = (c == null ? void 0 : c.type) === "guest", { user: l } = await Xn({
|
|
5974
5978
|
apiURI: this.config.apiURI,
|
|
5975
5979
|
appId: this.config.appId,
|
|
5976
5980
|
code: r,
|
|
@@ -6180,7 +6184,7 @@ class Ha {
|
|
|
6180
6184
|
*/
|
|
6181
6185
|
async exchangeCodeForToken({ code: e, codeVerifier: n }) {
|
|
6182
6186
|
var o;
|
|
6183
|
-
const r = await this.getCurrentUser(), s = ((o = r == null ? void 0 : r.user) == null ? void 0 : o.type) === "guest", i = await
|
|
6187
|
+
const r = await this.getCurrentUser(), s = ((o = r == null ? void 0 : r.user) == null ? void 0 : o.type) === "guest", i = await Xn({
|
|
6184
6188
|
apiURI: this.config.apiURI,
|
|
6185
6189
|
appId: this.config.appId,
|
|
6186
6190
|
code: e,
|
|
@@ -6312,7 +6316,7 @@ class Ha {
|
|
|
6312
6316
|
Hs(u, l, h);
|
|
6313
6317
|
break;
|
|
6314
6318
|
case "r":
|
|
6315
|
-
|
|
6319
|
+
Nn(u, l, h);
|
|
6316
6320
|
break;
|
|
6317
6321
|
case "-":
|
|
6318
6322
|
Er(u, l);
|
|
@@ -6327,7 +6331,7 @@ class Ha {
|
|
|
6327
6331
|
delete r[this._sessionId];
|
|
6328
6332
|
const s = Object.fromEntries(Object.entries(r).map(([i, o]) => [i, o.data]));
|
|
6329
6333
|
this._presence = ot(this._presence, (i) => {
|
|
6330
|
-
|
|
6334
|
+
Nn(i, [e, "result", "peers"], s);
|
|
6331
6335
|
});
|
|
6332
6336
|
}
|
|
6333
6337
|
// --------
|
|
@@ -6438,7 +6442,7 @@ function Ja(t, e) {
|
|
|
6438
6442
|
return u();
|
|
6439
6443
|
}
|
|
6440
6444
|
function Ya(t) {
|
|
6441
|
-
return `${
|
|
6445
|
+
return `${un || Hr ? "http://localhost:3000" : "https://instantdb.com"}/_devtool?appId=${t}`;
|
|
6442
6446
|
}
|
|
6443
6447
|
function Za(t) {
|
|
6444
6448
|
const e = document.createElement("iframe");
|
|
@@ -6525,11 +6529,11 @@ function sc() {
|
|
|
6525
6529
|
function ic() {
|
|
6526
6530
|
return globalThis.__instantDbStore = globalThis.__instantDbStore ?? {}, globalThis.__instantDbStore;
|
|
6527
6531
|
}
|
|
6528
|
-
function
|
|
6532
|
+
function Gt(t) {
|
|
6529
6533
|
const e = t.__adminToken;
|
|
6530
6534
|
return t.appId + "_" + (t.websocketURI || "default_ws_uri") + "_" + (t.apiURI || "default_api_uri") + "_" + (e || "client_only") + "_" + t.useDateObjects;
|
|
6531
6535
|
}
|
|
6532
|
-
const
|
|
6536
|
+
const Ht = ic(), dr = sc();
|
|
6533
6537
|
class oc {
|
|
6534
6538
|
constructor(e) {
|
|
6535
6539
|
p(this, "db");
|
|
@@ -6704,7 +6708,7 @@ class uc {
|
|
|
6704
6708
|
p(this, "_reactor");
|
|
6705
6709
|
p(this, "auth");
|
|
6706
6710
|
p(this, "storage");
|
|
6707
|
-
p(this, "tx",
|
|
6711
|
+
p(this, "tx", cn());
|
|
6708
6712
|
this._reactor = e, this.auth = new oc(this._reactor), this.storage = new ac(this._reactor);
|
|
6709
6713
|
}
|
|
6710
6714
|
/**
|
|
@@ -6846,7 +6850,7 @@ class uc {
|
|
|
6846
6850
|
};
|
|
6847
6851
|
}
|
|
6848
6852
|
shutdown() {
|
|
6849
|
-
delete Gt
|
|
6853
|
+
delete Ht[Gt(this._reactor.config)], this._reactor.shutdown();
|
|
6850
6854
|
}
|
|
6851
6855
|
/**
|
|
6852
6856
|
* Use this for one-off queries.
|
|
@@ -6897,7 +6901,7 @@ function fc(t, e, n, r, s) {
|
|
|
6897
6901
|
...t,
|
|
6898
6902
|
appId: (u = t.appId) == null ? void 0 : u.trim(),
|
|
6899
6903
|
useDateObjects: t.useDateObjects ?? !1
|
|
6900
|
-
}, o = Gt
|
|
6904
|
+
}, o = Ht[Gt(i)];
|
|
6901
6905
|
if (o)
|
|
6902
6906
|
return lc(o, i.schema) && o._reactor.updateSchema(i.schema), o;
|
|
6903
6907
|
const a = new Ha({
|
|
@@ -6905,7 +6909,7 @@ function fc(t, e, n, r, s) {
|
|
|
6905
6909
|
...i,
|
|
6906
6910
|
cardinalityInference: !!i.schema
|
|
6907
6911
|
}, e || Qr, n || Br, { ...r || {}, "@instantdb/core": Yr }, s), c = new uc(a);
|
|
6908
|
-
return Gt
|
|
6912
|
+
return Ht[Gt(i)] = c, dc(i.appId, i.devtool), c;
|
|
6909
6913
|
}
|
|
6910
6914
|
function dc(t, e) {
|
|
6911
6915
|
if (typeof window > "u" || typeof window.location > "u" || typeof document > "u" || typeof e == "boolean" && !e)
|
|
@@ -6955,7 +6959,7 @@ function pc(t, e, n) {
|
|
|
6955
6959
|
// Build a new subscribe function if the query changes
|
|
6956
6960
|
[s]
|
|
6957
6961
|
);
|
|
6958
|
-
return { state:
|
|
6962
|
+
return { state: It(
|
|
6959
6963
|
o,
|
|
6960
6964
|
() => i.current,
|
|
6961
6965
|
() => hc
|
|
@@ -7018,7 +7022,7 @@ function Tc(t, e = {}) {
|
|
|
7018
7022
|
},
|
|
7019
7023
|
[t.type, t.id]
|
|
7020
7024
|
);
|
|
7021
|
-
return
|
|
7025
|
+
return Mt(() => ({
|
|
7022
7026
|
...n,
|
|
7023
7027
|
publishPresence: s
|
|
7024
7028
|
}), [n, s]);
|
|
@@ -7029,7 +7033,7 @@ function wc(t, e, n) {
|
|
|
7029
7033
|
function mc(t, e, n = {}) {
|
|
7030
7034
|
const r = yc(), s = he.usePresence(t, {
|
|
7031
7035
|
keys: [e]
|
|
7032
|
-
}), i =
|
|
7036
|
+
}), i = Mt(() => {
|
|
7033
7037
|
const l = t._core._reactor.getPresence(
|
|
7034
7038
|
t.type,
|
|
7035
7039
|
t.id
|
|
@@ -7056,7 +7060,7 @@ function mc(t, e, n = {}) {
|
|
|
7056
7060
|
[n.stopOnEnter, o]
|
|
7057
7061
|
), c = le(() => {
|
|
7058
7062
|
o(!1);
|
|
7059
|
-
}, [o]), u =
|
|
7063
|
+
}, [o]), u = Mt(() => ({ onKeyDown: a, onBlur: c }), [a, c]);
|
|
7060
7064
|
return {
|
|
7061
7065
|
active: i,
|
|
7062
7066
|
setActive: o,
|
|
@@ -7162,9 +7166,9 @@ const vc = {
|
|
|
7162
7166
|
user: void 0,
|
|
7163
7167
|
error: void 0
|
|
7164
7168
|
};
|
|
7165
|
-
class
|
|
7169
|
+
class Ct {
|
|
7166
7170
|
constructor(e, n) {
|
|
7167
|
-
p(this, "tx",
|
|
7171
|
+
p(this, "tx", cn());
|
|
7168
7172
|
p(this, "auth");
|
|
7169
7173
|
p(this, "storage");
|
|
7170
7174
|
p(this, "core");
|
|
@@ -7340,7 +7344,7 @@ class Pt {
|
|
|
7340
7344
|
), n = le((s) => this.core.subscribeConnectionStatus((o) => {
|
|
7341
7345
|
o !== e.current && (e.current = o, s());
|
|
7342
7346
|
}), []);
|
|
7343
|
-
return
|
|
7347
|
+
return It(
|
|
7344
7348
|
n,
|
|
7345
7349
|
() => e.current,
|
|
7346
7350
|
// For SSR, always return 'connecting' as the initial state
|
|
@@ -7421,7 +7425,7 @@ class Pt {
|
|
|
7421
7425
|
), n = le((s) => this.core.subscribeAuth((o) => {
|
|
7422
7426
|
e.current = { isLoading: !1, ...o }, s();
|
|
7423
7427
|
}), []);
|
|
7424
|
-
return
|
|
7428
|
+
return It(
|
|
7425
7429
|
n,
|
|
7426
7430
|
() => e.current,
|
|
7427
7431
|
() => vc
|
|
@@ -7441,7 +7445,7 @@ class Pt {
|
|
|
7441
7445
|
return this.core.getAuth();
|
|
7442
7446
|
}
|
|
7443
7447
|
}
|
|
7444
|
-
p(
|
|
7448
|
+
p(Ct, "Storage"), p(Ct, "NetworkListener"), p(Ct, "EventSourceImpl");
|
|
7445
7449
|
export {
|
|
7446
|
-
|
|
7450
|
+
Ct as InstantReactAbstractDatabase
|
|
7447
7451
|
};
|