@instantdb/react-common 0.22.47-experimental.sync-table.19184737115.1 → 0.22.47-experimental.sync-table.19185308245.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 +189 -184
- package/dist/standalone/index.umd.cjs +8 -8
- package/package.json +3 -3
package/dist/standalone/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Tr, { useRef as
|
|
1
|
+
import Tr, { useRef as st, useCallback as ae, useSyncExternalStore as It, useEffect as be, useMemo as Pt, useState as wr } from "react";
|
|
2
2
|
var Mt = { exports: {} }, Me = {};
|
|
3
3
|
/**
|
|
4
4
|
* @license React
|
|
@@ -65,14 +65,14 @@ function Ui() {
|
|
|
65
65
|
}
|
|
66
66
|
var O = !1, P = !1, U = !1, q = !1, ke = !1, ze;
|
|
67
67
|
ze = Symbol.for("react.module.reference");
|
|
68
|
-
function
|
|
68
|
+
function ht(l) {
|
|
69
69
|
return !!(typeof l == "string" || typeof l == "function" || l === i || l === o || ke || l === s || l === a || l === f || q || l === y || O || P || U || typeof l == "object" && l !== null && (l.$$typeof === p || l.$$typeof === h || l.$$typeof === u || l.$$typeof === c || l.$$typeof === d || // This needs to include all possible module reference object
|
|
70
70
|
// types supported by any Flight configuration anywhere since
|
|
71
71
|
// we don't know which Flight build this will end up being used
|
|
72
72
|
// with.
|
|
73
73
|
l.$$typeof === ze || l.getModuleId !== void 0));
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function pt(l, b, w) {
|
|
76
76
|
var v = l.displayName;
|
|
77
77
|
if (v)
|
|
78
78
|
return v;
|
|
@@ -112,7 +112,7 @@ function Ui() {
|
|
|
112
112
|
var w = l;
|
|
113
113
|
return Ke(w._context) + ".Provider";
|
|
114
114
|
case d:
|
|
115
|
-
return
|
|
115
|
+
return pt(l, l.render, "ForwardRef");
|
|
116
116
|
case h:
|
|
117
117
|
var v = l.displayName || null;
|
|
118
118
|
return v !== null ? v : ne(l.type) || "Memo";
|
|
@@ -189,27 +189,27 @@ function Ui() {
|
|
|
189
189
|
Ie < 0 && m("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
var
|
|
192
|
+
var yt = S.ReactCurrentDispatcher, bt;
|
|
193
193
|
function Be(l, b, w) {
|
|
194
194
|
{
|
|
195
|
-
if (
|
|
195
|
+
if (bt === void 0)
|
|
196
196
|
try {
|
|
197
197
|
throw Error();
|
|
198
198
|
} catch (j) {
|
|
199
199
|
var v = j.stack.trim().match(/\n( *(at )?)/);
|
|
200
|
-
|
|
200
|
+
bt = v && v[1] || "";
|
|
201
201
|
}
|
|
202
202
|
return `
|
|
203
|
-
` +
|
|
203
|
+
` + bt + l;
|
|
204
204
|
}
|
|
205
205
|
}
|
|
206
|
-
var
|
|
206
|
+
var _t = !1, Qe;
|
|
207
207
|
{
|
|
208
208
|
var fi = typeof WeakMap == "function" ? WeakMap : Map;
|
|
209
209
|
Qe = new fi();
|
|
210
210
|
}
|
|
211
211
|
function Sn(l, b) {
|
|
212
|
-
if (!l ||
|
|
212
|
+
if (!l || _t)
|
|
213
213
|
return "";
|
|
214
214
|
{
|
|
215
215
|
var w = Qe.get(l);
|
|
@@ -217,11 +217,11 @@ function Ui() {
|
|
|
217
217
|
return w;
|
|
218
218
|
}
|
|
219
219
|
var v;
|
|
220
|
-
|
|
220
|
+
_t = !0;
|
|
221
221
|
var j = Error.prepareStackTrace;
|
|
222
222
|
Error.prepareStackTrace = void 0;
|
|
223
223
|
var k;
|
|
224
|
-
k =
|
|
224
|
+
k = yt.current, yt.current = null, ci();
|
|
225
225
|
try {
|
|
226
226
|
if (b) {
|
|
227
227
|
var C = function() {
|
|
@@ -274,9 +274,9 @@ function Ui() {
|
|
|
274
274
|
}
|
|
275
275
|
}
|
|
276
276
|
} finally {
|
|
277
|
-
|
|
277
|
+
_t = !1, yt.current = k, di(), Error.prepareStackTrace = j;
|
|
278
278
|
}
|
|
279
|
-
var
|
|
279
|
+
var we = l ? l.displayName || l.name : "", fe = we ? Be(we) : "";
|
|
280
280
|
return typeof l == "function" && Qe.set(l, fe), fe;
|
|
281
281
|
}
|
|
282
282
|
function li(l, b, w) {
|
|
@@ -343,7 +343,7 @@ function Ui() {
|
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
var yi = Array.isArray;
|
|
346
|
-
function
|
|
346
|
+
function gt(l) {
|
|
347
347
|
return yi(l);
|
|
348
348
|
}
|
|
349
349
|
function bi(l) {
|
|
@@ -460,23 +460,23 @@ function Ui() {
|
|
|
460
460
|
return Oi(l, E, W, j, v, An.current, C);
|
|
461
461
|
}
|
|
462
462
|
}
|
|
463
|
-
var
|
|
464
|
-
function
|
|
463
|
+
var Tt = S.ReactCurrentOwner, kn = S.ReactDebugCurrentFrame;
|
|
464
|
+
function Te(l) {
|
|
465
465
|
if (l) {
|
|
466
466
|
var b = l._owner, w = Ge(l.type, l._source, b ? b.type : null);
|
|
467
467
|
kn.setExtraStackFrame(w);
|
|
468
468
|
} else
|
|
469
469
|
kn.setExtraStackFrame(null);
|
|
470
470
|
}
|
|
471
|
-
var
|
|
472
|
-
|
|
473
|
-
function
|
|
471
|
+
var wt;
|
|
472
|
+
wt = !1;
|
|
473
|
+
function St(l) {
|
|
474
474
|
return typeof l == "object" && l !== null && l.$$typeof === n;
|
|
475
475
|
}
|
|
476
476
|
function In() {
|
|
477
477
|
{
|
|
478
|
-
if (
|
|
479
|
-
var l = ne(
|
|
478
|
+
if (Tt.current) {
|
|
479
|
+
var l = ne(Tt.current.type);
|
|
480
480
|
if (l)
|
|
481
481
|
return `
|
|
482
482
|
|
|
@@ -511,25 +511,25 @@ Check the top-level render call using <` + w + ">.");
|
|
|
511
511
|
return;
|
|
512
512
|
Pn[w] = !0;
|
|
513
513
|
var v = "";
|
|
514
|
-
l && l._owner && l._owner !==
|
|
514
|
+
l && l._owner && l._owner !== Tt.current && (v = " It was passed a child from " + ne(l._owner.type) + "."), Te(l), m('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', w, v), Te(null);
|
|
515
515
|
}
|
|
516
516
|
}
|
|
517
517
|
function Rn(l, b) {
|
|
518
518
|
{
|
|
519
519
|
if (typeof l != "object")
|
|
520
520
|
return;
|
|
521
|
-
if (
|
|
521
|
+
if (gt(l))
|
|
522
522
|
for (var w = 0; w < l.length; w++) {
|
|
523
523
|
var v = l[w];
|
|
524
|
-
|
|
524
|
+
St(v) && Mn(v, b);
|
|
525
525
|
}
|
|
526
|
-
else if (
|
|
526
|
+
else if (St(l))
|
|
527
527
|
l._store && (l._store.validated = !0);
|
|
528
528
|
else if (l) {
|
|
529
529
|
var j = g(l);
|
|
530
530
|
if (typeof j == "function" && j !== l.entries)
|
|
531
531
|
for (var k = j.call(l), C; !(C = k.next()).done; )
|
|
532
|
-
|
|
532
|
+
St(C.value) && Mn(C.value, b);
|
|
533
533
|
}
|
|
534
534
|
}
|
|
535
535
|
}
|
|
@@ -550,8 +550,8 @@ Check the top-level render call using <` + w + ">.");
|
|
|
550
550
|
if (w) {
|
|
551
551
|
var v = ne(b);
|
|
552
552
|
pi(w, l.props, "prop", v, l);
|
|
553
|
-
} else if (b.PropTypes !== void 0 && !
|
|
554
|
-
|
|
553
|
+
} else if (b.PropTypes !== void 0 && !wt) {
|
|
554
|
+
wt = !0;
|
|
555
555
|
var j = ne(b);
|
|
556
556
|
m("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", j || "Unknown");
|
|
557
557
|
}
|
|
@@ -563,24 +563,24 @@ Check the top-level render call using <` + w + ">.");
|
|
|
563
563
|
for (var b = Object.keys(l.props), w = 0; w < b.length; w++) {
|
|
564
564
|
var v = b[w];
|
|
565
565
|
if (v !== "children" && v !== "key") {
|
|
566
|
-
|
|
566
|
+
Te(l), m("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", v), Te(null);
|
|
567
567
|
break;
|
|
568
568
|
}
|
|
569
569
|
}
|
|
570
|
-
l.ref !== null && (
|
|
570
|
+
l.ref !== null && (Te(l), m("Invalid attribute `ref` supplied to `React.Fragment`."), Te(null));
|
|
571
571
|
}
|
|
572
572
|
}
|
|
573
573
|
var $n = {};
|
|
574
574
|
function Dn(l, b, w, v, j, k) {
|
|
575
575
|
{
|
|
576
|
-
var C =
|
|
576
|
+
var C = ht(l);
|
|
577
577
|
if (!C) {
|
|
578
578
|
var E = "";
|
|
579
579
|
(l === void 0 || typeof l == "object" && l !== null && Object.keys(l).length === 0) && (E += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
580
580
|
var W = Ai();
|
|
581
581
|
W ? E += W : E += In();
|
|
582
582
|
var R;
|
|
583
|
-
l === null ? R = "null" :
|
|
583
|
+
l === null ? R = "null" : gt(l) ? R = "array" : l !== void 0 && l.$$typeof === n ? (R = "<" + (ne(l.type) || "Unknown") + " />", E = " Did you accidentally export a JSX literal instead of a component?") : R = typeof l, m("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", R, E);
|
|
584
584
|
}
|
|
585
585
|
var D = Ei(l, b, w, j, k);
|
|
586
586
|
if (D == null)
|
|
@@ -589,9 +589,9 @@ Check the top-level render call using <` + w + ">.");
|
|
|
589
589
|
var J = b.children;
|
|
590
590
|
if (J !== void 0)
|
|
591
591
|
if (v)
|
|
592
|
-
if (
|
|
593
|
-
for (var
|
|
594
|
-
Rn(J[
|
|
592
|
+
if (gt(J)) {
|
|
593
|
+
for (var we = 0; we < J.length; we++)
|
|
594
|
+
Rn(J[we], l);
|
|
595
595
|
Object.freeze && Object.freeze(J);
|
|
596
596
|
} else
|
|
597
597
|
m("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,15 +601,15 @@ Check the top-level render call using <` + w + ">.");
|
|
|
601
601
|
if (Pe.call(b, "key")) {
|
|
602
602
|
var fe = ne(l), K = Object.keys(b).filter(function(Di) {
|
|
603
603
|
return Di !== "key";
|
|
604
|
-
}),
|
|
605
|
-
if (!$n[fe +
|
|
604
|
+
}), mt = K.length > 0 ? "{key: someKey, " + K.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
605
|
+
if (!$n[fe + mt]) {
|
|
606
606
|
var $i = K.length > 0 ? "{" + K.join(": ..., ") + ": ...}" : "{}";
|
|
607
607
|
m(`A props object containing a "key" prop is being spread into JSX:
|
|
608
608
|
let props = %s;
|
|
609
609
|
<%s {...props} />
|
|
610
610
|
React keys must be passed directly to JSX without using spread:
|
|
611
611
|
let props = %s;
|
|
612
|
-
<%s key={someKey} {...props} />`,
|
|
612
|
+
<%s key={someKey} {...props} />`, mt, fe, $i, fe), $n[fe + mt] = !0;
|
|
613
613
|
}
|
|
614
614
|
}
|
|
615
615
|
return l === i ? ki(D) : ji(D), D;
|
|
@@ -670,7 +670,7 @@ const $ = {
|
|
|
670
670
|
Remove: "remove",
|
|
671
671
|
Replace: "replace",
|
|
672
672
|
Add: "add"
|
|
673
|
-
}, Sr = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), Fi = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"),
|
|
673
|
+
}, Sr = Symbol.for("__MUTATIVE_PROXY_DRAFT__"), Fi = Symbol("__MUTATIVE_RAW_RETURN_SYMBOL__"), tt = Symbol.iterator, Y = {
|
|
674
674
|
mutable: "mutable",
|
|
675
675
|
immutable: "immutable"
|
|
676
676
|
}, Zt = {};
|
|
@@ -698,7 +698,7 @@ function H(t) {
|
|
|
698
698
|
var e;
|
|
699
699
|
return (e = t.copy) !== null && e !== void 0 ? e : t.original;
|
|
700
700
|
}
|
|
701
|
-
function
|
|
701
|
+
function _e(t) {
|
|
702
702
|
return !!A(t);
|
|
703
703
|
}
|
|
704
704
|
function A(t) {
|
|
@@ -735,16 +735,16 @@ function mr(t, e = []) {
|
|
|
735
735
|
}
|
|
736
736
|
return e;
|
|
737
737
|
}
|
|
738
|
-
function
|
|
738
|
+
function ge(t) {
|
|
739
739
|
return Array.isArray(t) ? 1 : t instanceof Map ? 2 : t instanceof Set ? 3 : 0;
|
|
740
740
|
}
|
|
741
741
|
function ue(t, e) {
|
|
742
|
-
return
|
|
742
|
+
return ge(t) === 2 ? t.get(e) : t[e];
|
|
743
743
|
}
|
|
744
744
|
function Ve(t, e, n) {
|
|
745
|
-
|
|
745
|
+
ge(t) === 2 ? t.set(e, n) : t[e] = n;
|
|
746
746
|
}
|
|
747
|
-
function
|
|
747
|
+
function vt(t, e) {
|
|
748
748
|
const n = A(t);
|
|
749
749
|
return (n ? H(n) : t)[e];
|
|
750
750
|
}
|
|
@@ -756,7 +756,7 @@ function Rt(t) {
|
|
|
756
756
|
for (; t.finalities.revoke.length > 0; )
|
|
757
757
|
t.finalities.revoke.pop()();
|
|
758
758
|
}
|
|
759
|
-
function
|
|
759
|
+
function pe(t, e) {
|
|
760
760
|
return e ? t : [""].concat(t).map((n) => {
|
|
761
761
|
const r = `${n}`;
|
|
762
762
|
return r.indexOf("/") === -1 && r.indexOf("~") === -1 ? r : r.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
@@ -765,7 +765,7 @@ function he(t, e) {
|
|
|
765
765
|
function Ni(t, e) {
|
|
766
766
|
for (let n = 0; n < e.length - 1; n += 1) {
|
|
767
767
|
const r = e[n];
|
|
768
|
-
if (t = ue(
|
|
768
|
+
if (t = ue(ge(t) === 3 ? Array.from(t) : t, r), typeof t != "object")
|
|
769
769
|
throw new Error(`Cannot resolve patch at '${e.join("/")}'.`);
|
|
770
770
|
}
|
|
771
771
|
return t;
|
|
@@ -854,8 +854,8 @@ function De(t) {
|
|
|
854
854
|
e[n] = De(t[n]);
|
|
855
855
|
return e;
|
|
856
856
|
}
|
|
857
|
-
function
|
|
858
|
-
return
|
|
857
|
+
function nt(t) {
|
|
858
|
+
return _e(t) ? De(t) : t;
|
|
859
859
|
}
|
|
860
860
|
function re(t) {
|
|
861
861
|
var e;
|
|
@@ -864,7 +864,7 @@ function re(t) {
|
|
|
864
864
|
function Fn() {
|
|
865
865
|
throw new Error("Cannot modify frozen object");
|
|
866
866
|
}
|
|
867
|
-
function
|
|
867
|
+
function Se(t, e, n, r, i) {
|
|
868
868
|
{
|
|
869
869
|
n = n ?? /* @__PURE__ */ new WeakMap(), r = r ?? [], i = i ?? [];
|
|
870
870
|
const o = n.has(t) ? n.get(t) : t;
|
|
@@ -881,37 +881,37 @@ function we(t, e, n, r, i) {
|
|
|
881
881
|
} else
|
|
882
882
|
r.push(o);
|
|
883
883
|
}
|
|
884
|
-
if (Object.isFrozen(t) ||
|
|
884
|
+
if (Object.isFrozen(t) || _e(t)) {
|
|
885
885
|
r.pop(), i.pop();
|
|
886
886
|
return;
|
|
887
887
|
}
|
|
888
|
-
switch (
|
|
888
|
+
switch (ge(t)) {
|
|
889
889
|
case 2:
|
|
890
890
|
for (const [u, c] of t)
|
|
891
|
-
|
|
891
|
+
Se(u, u, n, r, i), Se(c, u, n, r, i);
|
|
892
892
|
t.set = t.clear = t.delete = Fn;
|
|
893
893
|
break;
|
|
894
894
|
case 3:
|
|
895
895
|
for (const u of t)
|
|
896
|
-
|
|
896
|
+
Se(u, u, n, r, i);
|
|
897
897
|
t.add = t.clear = t.delete = Fn;
|
|
898
898
|
break;
|
|
899
899
|
case 1:
|
|
900
900
|
Object.freeze(t);
|
|
901
901
|
let o = 0;
|
|
902
902
|
for (const u of t)
|
|
903
|
-
|
|
903
|
+
Se(u, o, n, r, i), o += 1;
|
|
904
904
|
break;
|
|
905
905
|
default:
|
|
906
906
|
Object.freeze(t), Object.keys(t).forEach((u) => {
|
|
907
907
|
const c = t[u];
|
|
908
|
-
|
|
908
|
+
Se(c, u, n, r, i);
|
|
909
909
|
});
|
|
910
910
|
}
|
|
911
911
|
r.pop(), i.pop();
|
|
912
912
|
}
|
|
913
913
|
function nn(t, e) {
|
|
914
|
-
const n =
|
|
914
|
+
const n = ge(t);
|
|
915
915
|
if (n === 0)
|
|
916
916
|
Reflect.ownKeys(t).forEach((r) => {
|
|
917
917
|
e(r, t[r], t);
|
|
@@ -924,12 +924,12 @@ function nn(t, e) {
|
|
|
924
924
|
t.forEach((r, i) => e(i, r, t));
|
|
925
925
|
}
|
|
926
926
|
function Or(t, e, n) {
|
|
927
|
-
if (
|
|
927
|
+
if (_e(t) || !ee(t, n) || e.has(t) || Object.isFrozen(t))
|
|
928
928
|
return;
|
|
929
929
|
const r = t instanceof Set, i = r ? /* @__PURE__ */ new Map() : void 0;
|
|
930
930
|
if (e.add(t), nn(t, (s, o) => {
|
|
931
931
|
var u;
|
|
932
|
-
if (
|
|
932
|
+
if (_e(o)) {
|
|
933
933
|
const c = A(o);
|
|
934
934
|
z(c);
|
|
935
935
|
const d = !((u = c.assignedMap) === null || u === void 0) && u.size || c.operated ? c.copy : c.original;
|
|
@@ -980,32 +980,32 @@ function zi(t, e, n, r, i) {
|
|
|
980
980
|
c.length < s.length && ([s, c] = [c, s], [n, r] = [r, n]);
|
|
981
981
|
for (let d = 0; d < s.length; d += 1)
|
|
982
982
|
if (o.get(d.toString()) && c[d] !== s[d]) {
|
|
983
|
-
const a = e.concat([d]), f =
|
|
983
|
+
const a = e.concat([d]), f = pe(a, i);
|
|
984
984
|
n.push({
|
|
985
985
|
op: $.Replace,
|
|
986
986
|
path: f,
|
|
987
987
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
988
|
-
value:
|
|
988
|
+
value: nt(c[d])
|
|
989
989
|
}), r.push({
|
|
990
990
|
op: $.Replace,
|
|
991
991
|
path: f,
|
|
992
992
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
993
|
-
value:
|
|
993
|
+
value: nt(s[d])
|
|
994
994
|
});
|
|
995
995
|
}
|
|
996
996
|
for (let d = s.length; d < c.length; d += 1) {
|
|
997
|
-
const a = e.concat([d]), f =
|
|
997
|
+
const a = e.concat([d]), f = pe(a, i);
|
|
998
998
|
n.push({
|
|
999
999
|
op: $.Add,
|
|
1000
1000
|
path: f,
|
|
1001
1001
|
// If it is a draft, it needs to be deep cloned, and it may also be non-draft.
|
|
1002
|
-
value:
|
|
1002
|
+
value: nt(c[d])
|
|
1003
1003
|
});
|
|
1004
1004
|
}
|
|
1005
1005
|
if (s.length < c.length) {
|
|
1006
1006
|
const { arrayLengthAssignment: d = !0 } = u.enablePatches;
|
|
1007
1007
|
if (d) {
|
|
1008
|
-
const a = e.concat(["length"]), f =
|
|
1008
|
+
const a = e.concat(["length"]), f = pe(a, i);
|
|
1009
1009
|
r.push({
|
|
1010
1010
|
op: $.Replace,
|
|
1011
1011
|
path: f,
|
|
@@ -1013,7 +1013,7 @@ function zi(t, e, n, r, i) {
|
|
|
1013
1013
|
});
|
|
1014
1014
|
} else
|
|
1015
1015
|
for (let a = c.length; s.length < a; a -= 1) {
|
|
1016
|
-
const f = e.concat([a - 1]), h =
|
|
1016
|
+
const f = e.concat([a - 1]), h = pe(f, i);
|
|
1017
1017
|
r.push({
|
|
1018
1018
|
op: $.Remove,
|
|
1019
1019
|
path: h
|
|
@@ -1023,10 +1023,10 @@ function zi(t, e, n, r, i) {
|
|
|
1023
1023
|
}
|
|
1024
1024
|
function Ki({ original: t, copy: e, assignedMap: n }, r, i, s, o) {
|
|
1025
1025
|
n.forEach((u, c) => {
|
|
1026
|
-
const d = ue(t, c), a =
|
|
1026
|
+
const d = ue(t, c), a = nt(ue(e, c)), f = u ? Le(t, c) ? $.Replace : $.Add : $.Remove;
|
|
1027
1027
|
if (oe(d, a) && f === $.Replace)
|
|
1028
1028
|
return;
|
|
1029
|
-
const h = r.concat(c), p =
|
|
1029
|
+
const h = r.concat(c), p = pe(h, o);
|
|
1030
1030
|
i.push(f === $.Remove ? { op: f, path: p } : { op: f, path: p, value: a }), s.push(f === $.Add ? { op: $.Remove, path: p } : f === $.Remove ? { op: $.Add, path: p, value: d } : { op: $.Replace, path: p, value: d });
|
|
1031
1031
|
});
|
|
1032
1032
|
}
|
|
@@ -1034,7 +1034,7 @@ function Bi({ original: t, copy: e }, n, r, i, s) {
|
|
|
1034
1034
|
let o = 0;
|
|
1035
1035
|
t.forEach((u) => {
|
|
1036
1036
|
if (!e.has(u)) {
|
|
1037
|
-
const c = n.concat([o]), d =
|
|
1037
|
+
const c = n.concat([o]), d = pe(c, s);
|
|
1038
1038
|
r.push({
|
|
1039
1039
|
op: $.Remove,
|
|
1040
1040
|
path: d,
|
|
@@ -1048,7 +1048,7 @@ function Bi({ original: t, copy: e }, n, r, i, s) {
|
|
|
1048
1048
|
o += 1;
|
|
1049
1049
|
}), o = 0, e.forEach((u) => {
|
|
1050
1050
|
if (!t.has(u)) {
|
|
1051
|
-
const c = n.concat([o]), d =
|
|
1051
|
+
const c = n.concat([o]), d = pe(c, s);
|
|
1052
1052
|
r.push({
|
|
1053
1053
|
op: $.Add,
|
|
1054
1054
|
path: d,
|
|
@@ -1074,7 +1074,7 @@ function Ne(t, e, n, r) {
|
|
|
1074
1074
|
return Bi(t, e, n, r, i);
|
|
1075
1075
|
}
|
|
1076
1076
|
}
|
|
1077
|
-
const
|
|
1077
|
+
const ot = (t, e, n = !1) => {
|
|
1078
1078
|
if (typeof t == "object" && t !== null && (!ee(t, e) || n))
|
|
1079
1079
|
throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.");
|
|
1080
1080
|
}, xt = {
|
|
@@ -1112,7 +1112,7 @@ const st = (t, e, n = !1) => {
|
|
|
1112
1112
|
get(t) {
|
|
1113
1113
|
var e, n;
|
|
1114
1114
|
const r = A(this), i = H(r).get(t), s = ((n = (e = r.options).mark) === null || n === void 0 ? void 0 : n.call(e, i, Y)) === Y.mutable;
|
|
1115
|
-
if (r.options.strict &&
|
|
1115
|
+
if (r.options.strict && ot(i, r.options, s), s || r.finalized || !ee(i, r.options) || i !== r.original.get(t))
|
|
1116
1116
|
return i;
|
|
1117
1117
|
const o = Zt.createDraft({
|
|
1118
1118
|
original: i,
|
|
@@ -1129,7 +1129,7 @@ const st = (t, e, n = !1) => {
|
|
|
1129
1129
|
values() {
|
|
1130
1130
|
const t = this.keys();
|
|
1131
1131
|
return {
|
|
1132
|
-
[
|
|
1132
|
+
[tt]: () => this.values(),
|
|
1133
1133
|
next: () => {
|
|
1134
1134
|
const e = t.next();
|
|
1135
1135
|
return e.done ? e : {
|
|
@@ -1142,7 +1142,7 @@ const st = (t, e, n = !1) => {
|
|
|
1142
1142
|
entries() {
|
|
1143
1143
|
const t = this.keys();
|
|
1144
1144
|
return {
|
|
1145
|
-
[
|
|
1145
|
+
[tt]: () => this.entries(),
|
|
1146
1146
|
next: () => {
|
|
1147
1147
|
const e = t.next();
|
|
1148
1148
|
if (e.done)
|
|
@@ -1155,7 +1155,7 @@ const st = (t, e, n = !1) => {
|
|
|
1155
1155
|
}
|
|
1156
1156
|
};
|
|
1157
1157
|
},
|
|
1158
|
-
[
|
|
1158
|
+
[tt]() {
|
|
1159
1159
|
return this.entries();
|
|
1160
1160
|
}
|
|
1161
1161
|
}, Qi = Reflect.ownKeys(xt), Nn = (t, e, { isValuesIterator: n }) => () => {
|
|
@@ -1166,7 +1166,7 @@ const st = (t, e, n = !1) => {
|
|
|
1166
1166
|
const o = s.value;
|
|
1167
1167
|
let u = t.setMap.get(o);
|
|
1168
1168
|
const c = A(u), d = ((i = (r = t.options).mark) === null || i === void 0 ? void 0 : i.call(r, u, Y)) === Y.mutable;
|
|
1169
|
-
if (t.options.strict &&
|
|
1169
|
+
if (t.options.strict && ot(o, t.options, d), !d && !c && ee(o, t.options) && !t.finalized && t.original.has(o)) {
|
|
1170
1170
|
const a = Zt.createDraft({
|
|
1171
1171
|
original: o,
|
|
1172
1172
|
parentDraft: t,
|
|
@@ -1180,7 +1180,7 @@ const st = (t, e, n = !1) => {
|
|
|
1180
1180
|
done: !1,
|
|
1181
1181
|
value: n ? u : [u, u]
|
|
1182
1182
|
};
|
|
1183
|
-
},
|
|
1183
|
+
}, ut = {
|
|
1184
1184
|
get size() {
|
|
1185
1185
|
return A(this).setMap.size;
|
|
1186
1186
|
},
|
|
@@ -1236,7 +1236,7 @@ const st = (t, e, n = !1) => {
|
|
|
1236
1236
|
keys() {
|
|
1237
1237
|
return this.values();
|
|
1238
1238
|
},
|
|
1239
|
-
[
|
|
1239
|
+
[tt]() {
|
|
1240
1240
|
return this.values();
|
|
1241
1241
|
},
|
|
1242
1242
|
forEach(t, e) {
|
|
@@ -1246,7 +1246,7 @@ const st = (t, e, n = !1) => {
|
|
|
1246
1246
|
t.call(e, r.value, r.value, this), r = n.next();
|
|
1247
1247
|
}
|
|
1248
1248
|
};
|
|
1249
|
-
Set.prototype.difference && Object.assign(
|
|
1249
|
+
Set.prototype.difference && Object.assign(ut, {
|
|
1250
1250
|
intersection(t) {
|
|
1251
1251
|
return Set.prototype.intersection.call(new Set(this.values()), t);
|
|
1252
1252
|
},
|
|
@@ -1269,7 +1269,7 @@ Set.prototype.difference && Object.assign(ot, {
|
|
|
1269
1269
|
return Set.prototype.isDisjointFrom.call(new Set(this.values()), t);
|
|
1270
1270
|
}
|
|
1271
1271
|
});
|
|
1272
|
-
const Gi = Reflect.ownKeys(
|
|
1272
|
+
const Gi = Reflect.ownKeys(ut), Er = /* @__PURE__ */ new WeakSet(), Ar = {
|
|
1273
1273
|
get(t, e, n) {
|
|
1274
1274
|
var r, i;
|
|
1275
1275
|
const s = (r = t.copy) === null || r === void 0 ? void 0 : r[e];
|
|
@@ -1281,7 +1281,7 @@ const Gi = Reflect.ownKeys(ot), Er = /* @__PURE__ */ new WeakSet(), Ar = {
|
|
|
1281
1281
|
if (t.options.mark) {
|
|
1282
1282
|
const d = e === "size" && (t.original instanceof Map || t.original instanceof Set) ? Reflect.get(t.original, e) : Reflect.get(t.original, e, n);
|
|
1283
1283
|
if (o = t.options.mark(d, Y), o === Y.mutable)
|
|
1284
|
-
return t.options.strict &&
|
|
1284
|
+
return t.options.strict && ot(d, t.options, !0), d;
|
|
1285
1285
|
}
|
|
1286
1286
|
const u = H(t);
|
|
1287
1287
|
if (u instanceof Map && Qi.includes(e)) {
|
|
@@ -1293,8 +1293,8 @@ const Gi = Reflect.ownKeys(ot), Er = /* @__PURE__ */ new WeakSet(), Ar = {
|
|
|
1293
1293
|
}
|
|
1294
1294
|
if (u instanceof Set && Gi.includes(e)) {
|
|
1295
1295
|
if (e === "size")
|
|
1296
|
-
return Object.getOwnPropertyDescriptor(
|
|
1297
|
-
const d =
|
|
1296
|
+
return Object.getOwnPropertyDescriptor(ut, "size").get.call(t.proxy);
|
|
1297
|
+
const d = ut[e];
|
|
1298
1298
|
if (d)
|
|
1299
1299
|
return d.bind(t.proxy);
|
|
1300
1300
|
}
|
|
@@ -1306,9 +1306,9 @@ const Gi = Reflect.ownKeys(ot), Er = /* @__PURE__ */ new WeakSet(), Ar = {
|
|
|
1306
1306
|
) : void 0;
|
|
1307
1307
|
}
|
|
1308
1308
|
const c = u[e];
|
|
1309
|
-
if (t.options.strict &&
|
|
1309
|
+
if (t.options.strict && ot(c, t.options), t.finalized || !ee(c, t.options))
|
|
1310
1310
|
return c;
|
|
1311
|
-
if (c ===
|
|
1311
|
+
if (c === vt(t.original, e)) {
|
|
1312
1312
|
if (z(t), t.copy[e] = sn({
|
|
1313
1313
|
original: t.original[e],
|
|
1314
1314
|
parentDraft: t,
|
|
@@ -1333,7 +1333,7 @@ const Gi = Reflect.ownKeys(ot), Er = /* @__PURE__ */ new WeakSet(), Ar = {
|
|
|
1333
1333
|
const s = Ln(H(t), e);
|
|
1334
1334
|
if (s != null && s.set)
|
|
1335
1335
|
return s.set.call(t.proxy, n), !0;
|
|
1336
|
-
const o =
|
|
1336
|
+
const o = vt(H(t), e), u = A(o);
|
|
1337
1337
|
return u && oe(u.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) : (oe(n, o) && (n !== void 0 || Le(t.original, e)) || (z(t), re(t), Le(t.original, e) && oe(n, t.original[e]) ? t.assignedMap.delete(e) : t.assignedMap.set(e, !0), t.copy[e] = n, rn(t, e, n, Ne)), !0);
|
|
1338
1338
|
},
|
|
1339
1339
|
has(t, e) {
|
|
@@ -1362,11 +1362,11 @@ const Gi = Reflect.ownKeys(ot), Er = /* @__PURE__ */ new WeakSet(), Ar = {
|
|
|
1362
1362
|
},
|
|
1363
1363
|
deleteProperty(t, e) {
|
|
1364
1364
|
var n;
|
|
1365
|
-
return t.type === 1 ? Ar.set.call(this, t, e, void 0, t.proxy) : (
|
|
1365
|
+
return t.type === 1 ? Ar.set.call(this, t, e, void 0, t.proxy) : (vt(t.original, e) !== void 0 || e in t.original ? (z(t), re(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);
|
|
1366
1366
|
}
|
|
1367
1367
|
};
|
|
1368
1368
|
function sn(t) {
|
|
1369
|
-
const { original: e, parentDraft: n, key: r, finalities: i, options: s } = t, o =
|
|
1369
|
+
const { original: e, parentDraft: n, key: r, finalities: i, options: s } = t, o = ge(e), u = {
|
|
1370
1370
|
type: o,
|
|
1371
1371
|
finalized: !1,
|
|
1372
1372
|
parent: n,
|
|
@@ -1411,7 +1411,7 @@ function Hi(t, e, n, r, i) {
|
|
|
1411
1411
|
for (; o.finalities.draft.length > 0; )
|
|
1412
1412
|
o.finalities.draft.pop()(n, r);
|
|
1413
1413
|
const d = c ? e[0] : o ? o.operated ? o.copy : o.original : t;
|
|
1414
|
-
return o && Rt(o), i &&
|
|
1414
|
+
return o && Rt(o), i && Se(d, d, o == null ? void 0 : o.options.updatedValues), [
|
|
1415
1415
|
d,
|
|
1416
1416
|
n && c ? [{ op: $.Replace, path: [], value: e[0] }] : n,
|
|
1417
1417
|
r && c ? [{ op: $.Replace, path: [], value: u }] : r
|
|
@@ -1460,7 +1460,7 @@ function Cr(t) {
|
|
|
1460
1460
|
const n = A(t);
|
|
1461
1461
|
if (!ee(t, n == null ? void 0 : n.options))
|
|
1462
1462
|
return t;
|
|
1463
|
-
const r =
|
|
1463
|
+
const r = ge(t);
|
|
1464
1464
|
if (n && !n.operated)
|
|
1465
1465
|
return n.original;
|
|
1466
1466
|
let i;
|
|
@@ -1488,7 +1488,7 @@ function Cr(t) {
|
|
|
1488
1488
|
return i;
|
|
1489
1489
|
}
|
|
1490
1490
|
function Vn(t) {
|
|
1491
|
-
if (!
|
|
1491
|
+
if (!_e(t))
|
|
1492
1492
|
throw new Error(`current() is only used for Draft, parameter: ${t}`);
|
|
1493
1493
|
return Cr(t);
|
|
1494
1494
|
}
|
|
@@ -1503,7 +1503,7 @@ const Ji = (t) => function e(n, r, i) {
|
|
|
1503
1503
|
if (typeof r != "function" && (a = r), a !== void 0 && Object.prototype.toString.call(a) !== "[object Object]")
|
|
1504
1504
|
throw new Error(`Invalid options: ${a}, 'options' should be an object.`);
|
|
1505
1505
|
a = Object.assign(Object.assign({}, t), a);
|
|
1506
|
-
const f =
|
|
1506
|
+
const f = _e(c) ? Vn(c) : c, h = Array.isArray(a.mark) ? (O, P) => {
|
|
1507
1507
|
for (const U of a.mark) {
|
|
1508
1508
|
if (typeof U != "function")
|
|
1509
1509
|
throw new Error(`Invalid mark: ${U}, 'mark' should be a function.`);
|
|
@@ -1533,7 +1533,7 @@ const Ji = (t) => function e(n, r, i) {
|
|
|
1533
1533
|
}
|
|
1534
1534
|
const M = (O) => {
|
|
1535
1535
|
const P = A(g);
|
|
1536
|
-
if (!
|
|
1536
|
+
if (!_e(O)) {
|
|
1537
1537
|
if (O !== void 0 && !oe(O, g) && (P != null && P.operated))
|
|
1538
1538
|
throw new Error("Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.");
|
|
1539
1539
|
const q = O == null ? void 0 : O[Fi];
|
|
@@ -1570,8 +1570,8 @@ function jr(t, e) {
|
|
|
1570
1570
|
function qn(t, e) {
|
|
1571
1571
|
return Object.keys(t).length === Object.keys(e).length && Object.keys(t).every((n) => e.hasOwnProperty(n) && t[n] === e[n]);
|
|
1572
1572
|
}
|
|
1573
|
-
function
|
|
1574
|
-
return typeof t != "object" || typeof e != "object" || t === null || e === null ? t === e : jr(t, e) ? Object.keys(t).every((n) =>
|
|
1573
|
+
function rt(t, e) {
|
|
1574
|
+
return typeof t != "object" || typeof e != "object" || t === null || e === null ? t === e : jr(t, e) ? Object.keys(t).every((n) => rt(t[n], e[n])) : !1;
|
|
1575
1575
|
}
|
|
1576
1576
|
function on(t) {
|
|
1577
1577
|
if (!xe(t))
|
|
@@ -1935,7 +1935,7 @@ function ys(t) {
|
|
|
1935
1935
|
return null;
|
|
1936
1936
|
}
|
|
1937
1937
|
}
|
|
1938
|
-
function
|
|
1938
|
+
function dt(t) {
|
|
1939
1939
|
if (t !== void 0) {
|
|
1940
1940
|
if (t === null)
|
|
1941
1941
|
return null;
|
|
@@ -1996,7 +1996,7 @@ function Pr(t, e, n) {
|
|
|
1996
1996
|
console.warn("no such attr", u, t);
|
|
1997
1997
|
continue;
|
|
1998
1998
|
}
|
|
1999
|
-
f["checked-data-type"] === "date" && n && (d =
|
|
1999
|
+
f["checked-data-type"] === "date" && n && (d = dt(d), o[2] = d), un(f) && B(s, [d, c, u], o), B(r, [u, c, d], o), B(i, [c, u, d], o);
|
|
2000
2000
|
}
|
|
2001
2001
|
return { eav: r, aev: i, vae: s };
|
|
2002
2002
|
}
|
|
@@ -2022,7 +2022,7 @@ function Rr(t) {
|
|
|
2022
2022
|
};
|
|
2023
2023
|
}
|
|
2024
2024
|
function $r(t) {
|
|
2025
|
-
return
|
|
2025
|
+
return it(t.attrs, t.triples, t.cardinalityInference, t.linkIndex, t.useDateObjects);
|
|
2026
2026
|
}
|
|
2027
2027
|
function _s(t, e) {
|
|
2028
2028
|
return Ce(t.eav, [e]) !== void 0;
|
|
@@ -2030,7 +2030,7 @@ function _s(t, e) {
|
|
|
2030
2030
|
function cn(t) {
|
|
2031
2031
|
t.attrIndexes = Mr(t.attrs);
|
|
2032
2032
|
}
|
|
2033
|
-
function
|
|
2033
|
+
function it(t, e, n, r, i) {
|
|
2034
2034
|
const s = Pr(t, e, i);
|
|
2035
2035
|
return s.useDateObjects = i, s.attrs = t, s.attrIndexes = Mr(t), s.cardinalityInference = n, s.linkIndex = r, s.__type = "store", s;
|
|
2036
2036
|
}
|
|
@@ -2084,7 +2084,7 @@ function Ur(t, e) {
|
|
|
2084
2084
|
const u = Ae(t.attrs, s);
|
|
2085
2085
|
if (!u)
|
|
2086
2086
|
return;
|
|
2087
|
-
u["checked-data-type"] === "date" && t.useDateObjects && (o =
|
|
2087
|
+
u["checked-data-type"] === "date" && t.useDateObjects && (o = dt(o));
|
|
2088
2088
|
const c = Ce(t.eav, [i, s, o]), d = (n = c == null ? void 0 : c[3]) !== null && n !== void 0 ? n : xr(t, u, r), a = [i, s, o, d];
|
|
2089
2089
|
bs(u) ? (B(t.eav, [i, s], /* @__PURE__ */ new Map([[o, a]])), B(t.aev, [s, i], /* @__PURE__ */ new Map([[o, a]]))) : (B(t.eav, [i, s, o], a), B(t.aev, [s, i, o], a)), un(u) && B(t.vae, [o, s, i], a);
|
|
2090
2090
|
}
|
|
@@ -2417,15 +2417,15 @@ for (let t = 0; t < 256; ++t)
|
|
|
2417
2417
|
function Vs(t, e = 0) {
|
|
2418
2418
|
return (F[t[e + 0]] + F[t[e + 1]] + F[t[e + 2]] + F[t[e + 3]] + "-" + F[t[e + 4]] + F[t[e + 5]] + "-" + F[t[e + 6]] + F[t[e + 7]] + "-" + F[t[e + 8]] + F[t[e + 9]] + "-" + F[t[e + 10]] + F[t[e + 11]] + F[t[e + 12]] + F[t[e + 13]] + F[t[e + 14]] + F[t[e + 15]]).toLowerCase();
|
|
2419
2419
|
}
|
|
2420
|
-
let
|
|
2420
|
+
let Ot;
|
|
2421
2421
|
const qs = new Uint8Array(16);
|
|
2422
2422
|
function Ws() {
|
|
2423
|
-
if (!
|
|
2423
|
+
if (!Ot) {
|
|
2424
2424
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
2425
2425
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
2426
|
-
|
|
2426
|
+
Ot = crypto.getRandomValues.bind(crypto);
|
|
2427
2427
|
}
|
|
2428
|
-
return
|
|
2428
|
+
return Ot(qs);
|
|
2429
2429
|
}
|
|
2430
2430
|
const zs = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Bn = { randomUUID: zs };
|
|
2431
2431
|
function Ks(t, e, n) {
|
|
@@ -2474,9 +2474,9 @@ function Hs() {
|
|
|
2474
2474
|
const Ys = Hs();
|
|
2475
2475
|
let Js = 0;
|
|
2476
2476
|
function Fe(t) {
|
|
2477
|
-
return
|
|
2477
|
+
return ft(`_${t}`, Js++);
|
|
2478
2478
|
}
|
|
2479
|
-
function
|
|
2479
|
+
function ft(t, e) {
|
|
2480
2480
|
return `?${t}-${e}`;
|
|
2481
2481
|
}
|
|
2482
2482
|
class Oe extends Error {
|
|
@@ -2688,7 +2688,7 @@ function zr(t, e, n, r, i) {
|
|
|
2688
2688
|
});
|
|
2689
2689
|
}
|
|
2690
2690
|
function co(t, e, n, r) {
|
|
2691
|
-
const i =
|
|
2691
|
+
const i = ft;
|
|
2692
2692
|
return r ? zr(i, t, e, n, r).concat(Gn(i, t, e, n)) : Gn(i, t, e, n);
|
|
2693
2693
|
}
|
|
2694
2694
|
function fo(t, e, n) {
|
|
@@ -2728,7 +2728,7 @@ function po(t, e, n) {
|
|
|
2728
2728
|
function Ue(t, e, n, r, i) {
|
|
2729
2729
|
return e === r || e == null && r == null ? Qs(t, n) : r == null ? 1 : e == null ? -1 : po(e, r, i);
|
|
2730
2730
|
}
|
|
2731
|
-
function
|
|
2731
|
+
function at([t, e], [n, r], i) {
|
|
2732
2732
|
return Ue(t, e, n, r, i);
|
|
2733
2733
|
}
|
|
2734
2734
|
function Wt(t) {
|
|
@@ -2738,9 +2738,9 @@ function yo(t, e, n, r) {
|
|
|
2738
2738
|
var i;
|
|
2739
2739
|
const [s, o, u, c] = t, d = n === "desc" ? 1 : -1;
|
|
2740
2740
|
if (((i = e["forward-identity"]) === null || i === void 0 ? void 0 : i[2]) === "id")
|
|
2741
|
-
return
|
|
2741
|
+
return at(r, [s, c], null) === d;
|
|
2742
2742
|
const [a, f] = r, h = e["checked-data-type"], p = h === "date" ? Wt(f) : f, y = h === "date" ? Wt(u) : u;
|
|
2743
|
-
return
|
|
2743
|
+
return at([a, p], [s, y], h) === d;
|
|
2744
2744
|
}
|
|
2745
2745
|
function bo(t, e) {
|
|
2746
2746
|
const n = e[1];
|
|
@@ -2785,9 +2785,9 @@ function wo(t, { etype: e, pageInfo: n, dq: r, form: i }) {
|
|
|
2785
2785
|
});
|
|
2786
2786
|
}
|
|
2787
2787
|
a.sort(d === "asc" ? function(T, g) {
|
|
2788
|
-
return
|
|
2788
|
+
return at(T, g, h == null ? void 0 : h["checked-data-type"]);
|
|
2789
2789
|
} : function(T, g) {
|
|
2790
|
-
return
|
|
2790
|
+
return at(g, T, h == null ? void 0 : h["checked-data-type"]);
|
|
2791
2791
|
});
|
|
2792
2792
|
let p = {};
|
|
2793
2793
|
const y = To(t, e, r);
|
|
@@ -2814,7 +2814,7 @@ function mo(t, { etype: e, level: n, form: r, join: i, pageInfo: s }) {
|
|
|
2814
2814
|
var o, u, c, d, a;
|
|
2815
2815
|
if (!Kr(r) && (!s || !s["start-cursor"]))
|
|
2816
2816
|
return [];
|
|
2817
|
-
const f = io(co(t, e, n, (o = r.$) === null || o === void 0 ? void 0 : o.where), i), h = fo(
|
|
2817
|
+
const f = io(co(t, e, n, (o = r.$) === null || o === void 0 ? void 0 : o.where), i), h = fo(ft, e, n), p = (u = r.$) === null || u === void 0 ? void 0 : u.fields, y = wo(t, {
|
|
2818
2818
|
etype: e,
|
|
2819
2819
|
pageInfo: s,
|
|
2820
2820
|
form: r,
|
|
@@ -2838,7 +2838,7 @@ function vo(t, e) {
|
|
|
2838
2838
|
}
|
|
2839
2839
|
function Br(t, e) {
|
|
2840
2840
|
const n = vo(t, e);
|
|
2841
|
-
return ho(
|
|
2841
|
+
return ho(ft, t, e, n);
|
|
2842
2842
|
}
|
|
2843
2843
|
function Oo(t) {
|
|
2844
2844
|
const e = {};
|
|
@@ -2896,7 +2896,7 @@ function zt(t, e, n) {
|
|
|
2896
2896
|
}
|
|
2897
2897
|
});
|
|
2898
2898
|
}
|
|
2899
|
-
function
|
|
2899
|
+
function ct(t) {
|
|
2900
2900
|
return t.startsWith("lookup__");
|
|
2901
2901
|
}
|
|
2902
2902
|
function Gr(t) {
|
|
@@ -2911,7 +2911,7 @@ function Co(t) {
|
|
|
2911
2911
|
if (n === "__etype")
|
|
2912
2912
|
return t;
|
|
2913
2913
|
const r = n;
|
|
2914
|
-
return
|
|
2914
|
+
return ct(r) ? zt(t, Gr(r), []) : zt(t, r, []);
|
|
2915
2915
|
}
|
|
2916
2916
|
});
|
|
2917
2917
|
}
|
|
@@ -2951,7 +2951,7 @@ function V(t, e, n) {
|
|
|
2951
2951
|
return s === e && o === n;
|
|
2952
2952
|
});
|
|
2953
2953
|
}
|
|
2954
|
-
function
|
|
2954
|
+
function ye(t, e, n) {
|
|
2955
2955
|
return Object.values(t).find((r) => {
|
|
2956
2956
|
const i = r["reverse-identity"];
|
|
2957
2957
|
if (!i)
|
|
@@ -2982,13 +2982,13 @@ function Bt(t) {
|
|
|
2982
2982
|
function Po(t, e, n) {
|
|
2983
2983
|
if (!Kt(t, e, n))
|
|
2984
2984
|
return V(t, e, n);
|
|
2985
|
-
const r = Bt(n), i = V(t, e, r) ||
|
|
2985
|
+
const r = Bt(n), i = V(t, e, r) || ye(t, e, r);
|
|
2986
2986
|
if (i && i["value-type"] !== "ref")
|
|
2987
2987
|
throw new Error(`${n} does not reference a valid link attribute.`);
|
|
2988
2988
|
return i;
|
|
2989
2989
|
}
|
|
2990
2990
|
function Qt(t) {
|
|
2991
|
-
return typeof t == "string" && !
|
|
2991
|
+
return typeof t == "string" && !ct(t) ? null : typeof t == "string" && ct(t) ? Gr(t) : Io(t);
|
|
2992
2992
|
}
|
|
2993
2993
|
function G(t, e, n) {
|
|
2994
2994
|
const r = Qt(n);
|
|
@@ -3010,7 +3010,7 @@ function Hr(t, e, n, r) {
|
|
|
3010
3010
|
}
|
|
3011
3011
|
function Mo({ attrs: t }, [e, n, r]) {
|
|
3012
3012
|
const i = Object.entries(r).flatMap(([s, o]) => {
|
|
3013
|
-
const u = Array.isArray(o) ? o : [o], c = V(t, e, s), d =
|
|
3013
|
+
const u = Array.isArray(o) ? o : [o], c = V(t, e, s), d = ye(t, e, s);
|
|
3014
3014
|
return u.map((a) => c ? [
|
|
3015
3015
|
"add-triple",
|
|
3016
3016
|
G(t, e, n),
|
|
@@ -3027,7 +3027,7 @@ function Mo({ attrs: t }, [e, n, r]) {
|
|
|
3027
3027
|
}
|
|
3028
3028
|
function Ro({ attrs: t }, [e, n, r]) {
|
|
3029
3029
|
const i = Object.entries(r).flatMap(([s, o]) => {
|
|
3030
|
-
const u = Array.isArray(o) ? o : [o], c = V(t, e, s), d =
|
|
3030
|
+
const u = Array.isArray(o) ? o : [o], c = V(t, e, s), d = ye(t, e, s);
|
|
3031
3031
|
return u.map((a) => c ? [
|
|
3032
3032
|
"retract-triple",
|
|
3033
3033
|
G(t, e, n),
|
|
@@ -3071,14 +3071,14 @@ function Do(t, e) {
|
|
|
3071
3071
|
const { stores: n, attrs: r } = t, [i, s, o, u] = e, c = on(o), d = G(r, i, s);
|
|
3072
3072
|
return [["id", d]].concat(Object.entries(c)).map(([f, h]) => {
|
|
3073
3073
|
const p = V(r, i, f);
|
|
3074
|
-
return p["checked-data-type"] === "date" && t.useDateObjects && (h =
|
|
3074
|
+
return p["checked-data-type"] === "date" && t.useDateObjects && (h = dt(h)), ["add-triple", d, p.id, h, { mode: "create" }];
|
|
3075
3075
|
});
|
|
3076
3076
|
}
|
|
3077
3077
|
function xo(t, e) {
|
|
3078
3078
|
const { stores: n, attrs: r } = t, [i, s, o, u] = e, c = on(o), d = G(r, i, s), a = Yr(t, [i, d, o, u]);
|
|
3079
3079
|
return [["id", d]].concat(Object.entries(c)).map(([h, p]) => {
|
|
3080
3080
|
const y = V(r, i, h);
|
|
3081
|
-
return y["checked-data-type"] === "date" && t.useDateObjects && (p =
|
|
3081
|
+
return y["checked-data-type"] === "date" && t.useDateObjects && (p = dt(p)), [
|
|
3082
3082
|
"add-triple",
|
|
3083
3083
|
d,
|
|
3084
3084
|
y.id,
|
|
@@ -3228,7 +3228,7 @@ function Zo({ attrs: t, schema: e }, n) {
|
|
|
3228
3228
|
f != null && f.isUnsynced && !s.has(f.id) && (u.push(["add-attr", f]), s.add(f.id));
|
|
3229
3229
|
}
|
|
3230
3230
|
function a(f, h) {
|
|
3231
|
-
const p = V(o, f, h), y =
|
|
3231
|
+
const p = V(o, f, h), y = ye(o, f, h);
|
|
3232
3232
|
d(p), d(y), !p && !y && c(Zn(e, f, h, Yo));
|
|
3233
3233
|
}
|
|
3234
3234
|
for (const f of n)
|
|
@@ -3236,7 +3236,7 @@ function Zo({ attrs: t, schema: e }, n) {
|
|
|
3236
3236
|
const _ = p[0];
|
|
3237
3237
|
if (y) {
|
|
3238
3238
|
a(h, y);
|
|
3239
|
-
const T = V(o, h, y), g =
|
|
3239
|
+
const T = V(o, h, y), g = ye(o, h, y);
|
|
3240
3240
|
d(T), d(g);
|
|
3241
3241
|
const S = ((r = T == null ? void 0 : T["reverse-identity"]) === null || r === void 0 ? void 0 : r[1]) || ((i = g == null ? void 0 : g["forward-identity"]) === null || i === void 0 ? void 0 : i[1]) || y;
|
|
3242
3242
|
if (Kt(o, S, _))
|
|
@@ -3260,7 +3260,7 @@ function Zo({ attrs: t, schema: e }, n) {
|
|
|
3260
3260
|
for (const g of Object.keys(_)) {
|
|
3261
3261
|
const S = V(o, p, g);
|
|
3262
3262
|
if (d(S), Go.has(h) && (S || c(Ze(e, p, g, g === "id" ? { "unique?": !0 } : null))), Qo.has(h)) {
|
|
3263
|
-
const m =
|
|
3263
|
+
const m = ye(o, p, g);
|
|
3264
3264
|
!S && !m && c(Zn(e, p, g)), d(m);
|
|
3265
3265
|
}
|
|
3266
3266
|
}
|
|
@@ -3424,13 +3424,13 @@ var tu = function(t, e, n, r) {
|
|
|
3424
3424
|
d((r = r.apply(t, e || [])).next());
|
|
3425
3425
|
});
|
|
3426
3426
|
};
|
|
3427
|
-
class
|
|
3427
|
+
class lt extends Ee {
|
|
3428
3428
|
constructor(e) {
|
|
3429
3429
|
var n;
|
|
3430
3430
|
const r = ((n = e.body) === null || n === void 0 ? void 0 : n.message) || `API Error (${e.status})`;
|
|
3431
3431
|
super(r, e.body.hint);
|
|
3432
3432
|
const i = new.target.prototype;
|
|
3433
|
-
Object.setPrototypeOf && Object.setPrototypeOf(this, i), Error.captureStackTrace && Error.captureStackTrace(this,
|
|
3433
|
+
Object.setPrototypeOf && Object.setPrototypeOf(this, i), Error.captureStackTrace && Error.captureStackTrace(this, lt), this.name = "InstantAPIError", this.status = e.status, this.body = e.body;
|
|
3434
3434
|
}
|
|
3435
3435
|
get [Symbol.toStringTag]() {
|
|
3436
3436
|
return "InstantAPIError";
|
|
@@ -3439,7 +3439,7 @@ class ft extends Ee {
|
|
|
3439
3439
|
function te(t, e) {
|
|
3440
3440
|
return tu(this, void 0, void 0, function* () {
|
|
3441
3441
|
const n = yield fetch(t, e), r = yield n.json();
|
|
3442
|
-
return n.status === 200 ? Promise.resolve(r) : Promise.reject(new
|
|
3442
|
+
return n.status === 200 ? Promise.resolve(r) : Promise.reject(new lt({ status: n.status, body: r }));
|
|
3443
3443
|
});
|
|
3444
3444
|
}
|
|
3445
3445
|
var je = function(t, e, n, r) {
|
|
@@ -3835,7 +3835,7 @@ function ir(t) {
|
|
|
3835
3835
|
}, e;
|
|
3836
3836
|
}, {});
|
|
3837
3837
|
}
|
|
3838
|
-
const ni = "v0.22.47-experimental.sync-table.
|
|
3838
|
+
const ni = "v0.22.47-experimental.sync-table.19185308245.1";
|
|
3839
3839
|
function bu(t, e) {
|
|
3840
3840
|
return {
|
|
3841
3841
|
info: t ? (...n) => console.info(...n, e()) : () => {
|
|
@@ -4072,7 +4072,7 @@ const sr = [
|
|
|
4072
4072
|
si(n[r], r, e, r, 0);
|
|
4073
4073
|
}
|
|
4074
4074
|
}
|
|
4075
|
-
}, ur = (t) => typeof t != "string" ? !1 :
|
|
4075
|
+
}, ur = (t) => typeof t != "string" ? !1 : ct(t) ? !0 : ve(t);
|
|
4076
4076
|
class Z extends Error {
|
|
4077
4077
|
constructor(e) {
|
|
4078
4078
|
super(e), this.name = "TransactionValidationError";
|
|
@@ -4092,7 +4092,7 @@ const oi = (t) => t.length > 0 ? t.join(", ") : "none", Su = (t, e) => new Z(`En
|
|
|
4092
4092
|
if (!n)
|
|
4093
4093
|
throw Su(t, Object.keys(e.entities));
|
|
4094
4094
|
return n;
|
|
4095
|
-
},
|
|
4095
|
+
}, Et = (t, e, n) => {
|
|
4096
4096
|
const r = ui(t, n);
|
|
4097
4097
|
if (typeof e != "object" || e === null)
|
|
4098
4098
|
throw new Z(`Arguments for data operation on entity '${t}' must be an object, but received: ${typeof e}`);
|
|
@@ -4122,9 +4122,9 @@ const oi = (t) => t.length > 0 ? t.join(", ") : "none", Su = (t, e) => new Z(`En
|
|
|
4122
4122
|
}
|
|
4123
4123
|
}
|
|
4124
4124
|
}, vu = {
|
|
4125
|
-
create:
|
|
4126
|
-
update:
|
|
4127
|
-
merge:
|
|
4125
|
+
create: Et,
|
|
4126
|
+
update: Et,
|
|
4127
|
+
merge: Et,
|
|
4128
4128
|
link: cr,
|
|
4129
4129
|
unlink: cr,
|
|
4130
4130
|
delete: () => {
|
|
@@ -4345,7 +4345,7 @@ function ku(t, e) {
|
|
|
4345
4345
|
n[r] = i;
|
|
4346
4346
|
return n;
|
|
4347
4347
|
}
|
|
4348
|
-
function
|
|
4348
|
+
function At(t, e) {
|
|
4349
4349
|
return Qr({ store: e, pageInfo: null, aggregate: null }, t.query).data[t.table][0];
|
|
4350
4350
|
}
|
|
4351
4351
|
function hr(t, e, n) {
|
|
@@ -4388,7 +4388,7 @@ function Iu(t, e) {
|
|
|
4388
4388
|
}
|
|
4389
4389
|
return o;
|
|
4390
4390
|
}
|
|
4391
|
-
function
|
|
4391
|
+
function Xe(t, e) {
|
|
4392
4392
|
return { [t.table]: e.map((n) => n.entity) };
|
|
4393
4393
|
}
|
|
4394
4394
|
function Pu(t, e) {
|
|
@@ -4408,10 +4408,10 @@ function Pu(t, e) {
|
|
|
4408
4408
|
return Ue(o.entity.id, o.entity[r], s.entity.id, s.entity[r], n);
|
|
4409
4409
|
});
|
|
4410
4410
|
}
|
|
4411
|
-
var
|
|
4411
|
+
var le;
|
|
4412
4412
|
(function(t) {
|
|
4413
4413
|
t.InitialSyncBatch = "InitialSyncBatch", t.InitialSyncComplete = "InitialSyncComplete", t.LoadFromStorage = "LoadFromStorage", t.SyncTransaction = "SyncTransaction", t.Error = "Error";
|
|
4414
|
-
})(
|
|
4414
|
+
})(le || (le = {}));
|
|
4415
4415
|
class Mu {
|
|
4416
4416
|
constructor(e, n, r, i, s) {
|
|
4417
4417
|
this.callbacks = {}, this.idToHash = {}, this.trySend = e, this.config = r, this.log = i, this.createStore = s, this.subs = new Ht(n, "subs", {}, ku, ju, (o) => Cu(o, this.config.useDateObjects));
|
|
@@ -4462,8 +4462,8 @@ class Mu {
|
|
|
4462
4462
|
const u = this.subs.currentValue[n];
|
|
4463
4463
|
if (u && u.state && u.state.txId) {
|
|
4464
4464
|
this.sendResync(u, u.state), u.entities && r && (Object.keys(e)[0], r({
|
|
4465
|
-
type:
|
|
4466
|
-
data:
|
|
4465
|
+
type: le.LoadFromStorage,
|
|
4466
|
+
data: Xe(u, u.entities)
|
|
4467
4467
|
}));
|
|
4468
4468
|
return;
|
|
4469
4469
|
}
|
|
@@ -4515,7 +4515,7 @@ class Mu {
|
|
|
4515
4515
|
const f = (d = a.entities) !== null && d !== void 0 ? d : [];
|
|
4516
4516
|
a.entities = f;
|
|
4517
4517
|
for (const h of r) {
|
|
4518
|
-
const p = this.createStore(h), y =
|
|
4518
|
+
const p = this.createStore(h), y = At(a, p);
|
|
4519
4519
|
f.push({
|
|
4520
4520
|
store: p,
|
|
4521
4521
|
entity: y,
|
|
@@ -4524,11 +4524,11 @@ class Mu {
|
|
|
4524
4524
|
}
|
|
4525
4525
|
return c;
|
|
4526
4526
|
})[i];
|
|
4527
|
-
u.entities &&
|
|
4528
|
-
type:
|
|
4529
|
-
data:
|
|
4527
|
+
u.entities && this.notifyCbs(i, {
|
|
4528
|
+
type: le.InitialSyncBatch,
|
|
4529
|
+
data: Xe(u, u.entities),
|
|
4530
4530
|
batch: s
|
|
4531
|
-
})
|
|
4531
|
+
});
|
|
4532
4532
|
}
|
|
4533
4533
|
onSyncInitFinish(e) {
|
|
4534
4534
|
const n = e["subscription-id"], r = this.idToHash[n];
|
|
@@ -4536,12 +4536,17 @@ class Mu {
|
|
|
4536
4536
|
this.log.error("Missing hash for subscription", e);
|
|
4537
4537
|
return;
|
|
4538
4538
|
}
|
|
4539
|
-
this.subs.set((
|
|
4540
|
-
const
|
|
4541
|
-
if (!
|
|
4542
|
-
return this.log.error("Missing sub for hash", r, e),
|
|
4543
|
-
const
|
|
4544
|
-
return
|
|
4539
|
+
this.subs.set((s) => {
|
|
4540
|
+
const o = s[r];
|
|
4541
|
+
if (!o)
|
|
4542
|
+
return this.log.error("Missing sub for hash", r, e), s;
|
|
4543
|
+
const u = o.state;
|
|
4544
|
+
return u ? (u.txId = e["tx-id"], s) : (this.log.error("Sub never set init, missing result", o, e), s);
|
|
4545
|
+
});
|
|
4546
|
+
const i = this.subs.currentValue[r];
|
|
4547
|
+
i && this.notifyCbs(r, {
|
|
4548
|
+
type: le.InitialSyncComplete,
|
|
4549
|
+
data: Xe(i, i.entities || [])
|
|
4545
4550
|
});
|
|
4546
4551
|
}
|
|
4547
4552
|
onSyncUpdateTriples(e) {
|
|
@@ -4574,7 +4579,7 @@ class Mu {
|
|
|
4574
4579
|
for (const [g, S] of Object.entries(f))
|
|
4575
4580
|
if (_s(S.store, _)) {
|
|
4576
4581
|
pr(S.store, T);
|
|
4577
|
-
const m =
|
|
4582
|
+
const m = At(o, S.store), M = Iu(S.store, T)[_];
|
|
4578
4583
|
for (const [O, { oldValue: P, newValue: U }] of Object.entries(M || {}))
|
|
4579
4584
|
P === U && delete M[O];
|
|
4580
4585
|
m ? (h.push({
|
|
@@ -4588,7 +4593,7 @@ class Mu {
|
|
|
4588
4593
|
for (const [_, T] of Object.entries(a)) {
|
|
4589
4594
|
const g = this.createStore([]);
|
|
4590
4595
|
pr(g, T);
|
|
4591
|
-
const S =
|
|
4596
|
+
const S = At(o, g);
|
|
4592
4597
|
if (!S) {
|
|
4593
4598
|
this.log.error("No entity found after applying change", {
|
|
4594
4599
|
sub: o,
|
|
@@ -4607,8 +4612,8 @@ class Mu {
|
|
|
4607
4612
|
for (const _ of d.sort().reverse())
|
|
4608
4613
|
y.push(f[_].entity), f.splice(_, 1);
|
|
4609
4614
|
Pu(o, f), this.notifyCbs(r, {
|
|
4610
|
-
type:
|
|
4611
|
-
data:
|
|
4615
|
+
type: le.SyncTransaction,
|
|
4616
|
+
data: Xe(o, o.entities),
|
|
4612
4617
|
added: p,
|
|
4613
4618
|
removed: y,
|
|
4614
4619
|
updated: h
|
|
@@ -4634,7 +4639,7 @@ class Mu {
|
|
|
4634
4639
|
hint: e.hint
|
|
4635
4640
|
}, i = Object.keys(e["original-event"].q)[0];
|
|
4636
4641
|
this.notifyCbs(n, {
|
|
4637
|
-
type:
|
|
4642
|
+
type: le.Error,
|
|
4638
4643
|
data: { [i]: [] },
|
|
4639
4644
|
error: r
|
|
4640
4645
|
});
|
|
@@ -4763,7 +4768,7 @@ class qu {
|
|
|
4763
4768
|
}, this.notifyOne = (d) => {
|
|
4764
4769
|
var a, f;
|
|
4765
4770
|
const h = (a = this.queryCbs[d]) !== null && a !== void 0 ? a : [], p = (f = this._dataForQueryCache[d]) === null || f === void 0 ? void 0 : f.data, y = this.dataForQuery(d);
|
|
4766
|
-
y && (
|
|
4771
|
+
y && (rt(y, p) || h.forEach((_) => _.cb(y)));
|
|
4767
4772
|
}, this.notifyOneQueryOnce = (d) => {
|
|
4768
4773
|
var a;
|
|
4769
4774
|
const f = (a = this.queryOnceDfds[d]) !== null && a !== void 0 ? a : [], h = this.dataForQuery(d);
|
|
@@ -4875,7 +4880,7 @@ class qu {
|
|
|
4875
4880
|
}
|
|
4876
4881
|
}))), this._initStorage(n), this._syncTable = new Mu(this._trySendAuthed.bind(this), this._persister, {
|
|
4877
4882
|
useDateObjects: this.config.useDateObjects
|
|
4878
|
-
}, this._log, (d) =>
|
|
4883
|
+
}, this._log, (d) => it(this.attrs, d, this.config.enableCardinalityInference, this._linkIndex, this.config.useDateObjects)), this._oauthCallbackResponse = this._oauthLoginInit(), this.getCurrentUser(), r.getIsOnline().then((d) => {
|
|
4879
4884
|
this._isOnline = d, this._startSocket(), r.listen((a) => {
|
|
4880
4885
|
a !== this._isOnline && (this._log.info("[network] online =", a), this._isOnline = a, this._isOnline ? this._startSocket() : (this._log.info("Changing status from", this.status, "to", ie.CLOSED), this._setStatus(ie.CLOSED)));
|
|
4881
4886
|
});
|
|
@@ -4926,7 +4931,7 @@ class qu {
|
|
|
4926
4931
|
i.resolve({ status: e, eventId: n });
|
|
4927
4932
|
else if (r.type) {
|
|
4928
4933
|
const { status: o } = r, u = Ru(r, ["status"]);
|
|
4929
|
-
i.reject(new
|
|
4934
|
+
i.reject(new lt({
|
|
4930
4935
|
// @ts-expect-error body.type is not constant typed
|
|
4931
4936
|
body: u,
|
|
4932
4937
|
status: o
|
|
@@ -4963,7 +4968,7 @@ class qu {
|
|
|
4963
4968
|
break;
|
|
4964
4969
|
}
|
|
4965
4970
|
case "add-query-ok": {
|
|
4966
|
-
const { q: h, result: p } = n, y = N(h), _ = (o = (s = p == null ? void 0 : p[0]) === null || s === void 0 ? void 0 : s.data) === null || o === void 0 ? void 0 : o["page-info"], T = (c = (u = p == null ? void 0 : p[0]) === null || u === void 0 ? void 0 : u.data) === null || c === void 0 ? void 0 : c.aggregate, g = rr(p), S =
|
|
4971
|
+
const { q: h, result: p } = n, y = N(h), _ = (o = (s = p == null ? void 0 : p[0]) === null || s === void 0 ? void 0 : s.data) === null || o === void 0 ? void 0 : o["page-info"], T = (c = (u = p == null ? void 0 : p[0]) === null || u === void 0 ? void 0 : u.data) === null || c === void 0 ? void 0 : c.aggregate, g = rr(p), S = it(this.attrs, g, d, this._linkIndex, this.config.useDateObjects);
|
|
4967
4972
|
this.querySubs.set((m) => (m[y].result = {
|
|
4968
4973
|
store: S,
|
|
4969
4974
|
pageInfo: _,
|
|
@@ -4995,8 +5000,8 @@ class qu {
|
|
|
4995
5000
|
_ !== this.pendingMutations.currentValue && this.pendingMutations.set(() => _);
|
|
4996
5001
|
const T = br(_.entries()), g = h.map((S) => {
|
|
4997
5002
|
var m, M, O, P;
|
|
4998
|
-
const U = S["instaql-query"], q = S["instaql-result"], ke = N(U), ze = rr(q),
|
|
4999
|
-
return { hash: ke, store:
|
|
5003
|
+
const U = S["instaql-query"], q = S["instaql-result"], ke = N(U), ze = rr(q), ht = it(this.attrs, ze, d, this._linkIndex, this.config.useDateObjects), pt = this._applyOptimisticUpdates(ht, T, y), Ke = (M = (m = q == null ? void 0 : q[0]) === null || m === void 0 ? void 0 : m.data) === null || M === void 0 ? void 0 : M["page-info"], ne = (P = (O = q == null ? void 0 : q[0]) === null || O === void 0 ? void 0 : O.data) === null || P === void 0 ? void 0 : P.aggregate;
|
|
5004
|
+
return { hash: ke, store: pt, pageInfo: Ke, aggregate: ne };
|
|
5000
5005
|
});
|
|
5001
5006
|
g.forEach(({ hash: S, store: m, pageInfo: M, aggregate: O }) => {
|
|
5002
5007
|
this.querySubs.set((P) => (P[S].result = { store: m, pageInfo: M, aggregate: O, processedTxId: y }, P));
|
|
@@ -5183,7 +5188,7 @@ class qu {
|
|
|
5183
5188
|
return V(e, h, p);
|
|
5184
5189
|
}, s = (a) => {
|
|
5185
5190
|
const [f, h, p] = a["forward-identity"];
|
|
5186
|
-
return
|
|
5191
|
+
return ye(e, h, p);
|
|
5187
5192
|
}, o = { attrIdMap: {}, refSwapAttrIds: /* @__PURE__ */ new Set() };
|
|
5188
5193
|
let u = !1;
|
|
5189
5194
|
const c = (a, f) => {
|
|
@@ -5473,7 +5478,7 @@ class qu {
|
|
|
5473
5478
|
n.isLoading || e(this._currentUserCached);
|
|
5474
5479
|
let r = !1;
|
|
5475
5480
|
return this.getCurrentUser().then((i) => {
|
|
5476
|
-
r ||
|
|
5481
|
+
r || rt(i, n) || e(i);
|
|
5477
5482
|
}), () => {
|
|
5478
5483
|
r = !0, this.authCbs = this.authCbs.filter((i) => i !== e);
|
|
5479
5484
|
};
|
|
@@ -5546,7 +5551,7 @@ class qu {
|
|
|
5546
5551
|
return x(this, void 0, void 0, function* () {
|
|
5547
5552
|
var n;
|
|
5548
5553
|
const { user: r } = yield this.getCurrentUser();
|
|
5549
|
-
if (!
|
|
5554
|
+
if (!rt(r, e)) {
|
|
5550
5555
|
yield this.setCurrentUser(e), this.updateUser(e);
|
|
5551
5556
|
try {
|
|
5552
5557
|
(n = this._broadcastChannel) === null || n === void 0 || n.postMessage({ type: "auth" });
|
|
@@ -5875,9 +5880,9 @@ class qu {
|
|
|
5875
5880
|
});
|
|
5876
5881
|
}
|
|
5877
5882
|
}
|
|
5878
|
-
let
|
|
5883
|
+
let et;
|
|
5879
5884
|
function Wu(t, e) {
|
|
5880
|
-
|
|
5885
|
+
et == null || et.dispose();
|
|
5881
5886
|
const n = Hu(e), r = Bu(e, u), i = Ku(zu(t));
|
|
5882
5887
|
function s(a) {
|
|
5883
5888
|
var f;
|
|
@@ -5894,7 +5899,7 @@ function Wu(t, e) {
|
|
|
5894
5899
|
n.element.remove(), r.element.remove(), removeEventListener("keydown", o), removeEventListener("message", s);
|
|
5895
5900
|
}
|
|
5896
5901
|
function d() {
|
|
5897
|
-
document.body.appendChild(n.element), document.body.appendChild(r.element), addEventListener("keydown", o), addEventListener("message", s),
|
|
5902
|
+
document.body.appendChild(n.element), document.body.appendChild(r.element), addEventListener("keydown", o), addEventListener("message", s), et = {
|
|
5898
5903
|
dispose: c
|
|
5899
5904
|
};
|
|
5900
5905
|
}
|
|
@@ -6205,7 +6210,7 @@ function gr(t) {
|
|
|
6205
6210
|
}
|
|
6206
6211
|
function ua(t, e, n) {
|
|
6207
6212
|
e && n && "ruleParams" in n && (e = { $$ruleParams: n.ruleParams, ...e });
|
|
6208
|
-
const r = e ? ta(e) : null, i = N(r), s =
|
|
6213
|
+
const r = e ? ta(e) : null, i = N(r), s = st(
|
|
6209
6214
|
gr(t._reactor.getPreviousResult(r))
|
|
6210
6215
|
), o = ae(
|
|
6211
6216
|
(c) => (s.current = gr(
|
|
@@ -6230,8 +6235,8 @@ function ua(t, e, n) {
|
|
|
6230
6235
|
), query: r };
|
|
6231
6236
|
}
|
|
6232
6237
|
function aa() {
|
|
6233
|
-
const t =
|
|
6234
|
-
|
|
6238
|
+
const t = st(null);
|
|
6239
|
+
be(() => {
|
|
6235
6240
|
n();
|
|
6236
6241
|
}, []);
|
|
6237
6242
|
function e(r, i) {
|
|
@@ -6244,7 +6249,7 @@ function aa() {
|
|
|
6244
6249
|
}
|
|
6245
6250
|
const ca = 1e3;
|
|
6246
6251
|
function da(t, e, n) {
|
|
6247
|
-
|
|
6252
|
+
be(() => t.core._reactor.subscribeTopic(
|
|
6248
6253
|
t.id,
|
|
6249
6254
|
e,
|
|
6250
6255
|
(i, s) => {
|
|
@@ -6253,7 +6258,7 @@ function da(t, e, n) {
|
|
|
6253
6258
|
), [t.id, e]);
|
|
6254
6259
|
}
|
|
6255
6260
|
function fa(t, e) {
|
|
6256
|
-
return
|
|
6261
|
+
return be(() => t.core._reactor.joinRoom(t.id), [t.id]), ae(
|
|
6257
6262
|
(r) => {
|
|
6258
6263
|
t.core._reactor.publishTopic({
|
|
6259
6264
|
roomType: t.type,
|
|
@@ -6271,7 +6276,7 @@ function la(t, e = {}) {
|
|
|
6271
6276
|
peers: {},
|
|
6272
6277
|
isLoading: !0
|
|
6273
6278
|
});
|
|
6274
|
-
|
|
6279
|
+
be(() => t.core._reactor.subscribePresence(
|
|
6275
6280
|
t.type,
|
|
6276
6281
|
t.id,
|
|
6277
6282
|
e,
|
|
@@ -6291,10 +6296,10 @@ function la(t, e = {}) {
|
|
|
6291
6296
|
}), [n, i]);
|
|
6292
6297
|
}
|
|
6293
6298
|
function ha(t, e, n) {
|
|
6294
|
-
|
|
6299
|
+
be(() => t.core._reactor.joinRoom(t.id, e), [t.id]), be(() => t.core._reactor.publishPresence(t.type, t.id, e), [t.type, t.id, n ?? JSON.stringify(e)]);
|
|
6295
6300
|
}
|
|
6296
6301
|
function pa(t, e, n = {}) {
|
|
6297
|
-
const r = aa(), i =
|
|
6302
|
+
const r = aa(), i = he.usePresence(t, {
|
|
6298
6303
|
keys: [e]
|
|
6299
6304
|
}), s = Pt(() => {
|
|
6300
6305
|
const a = t._core._reactor.getPresence(
|
|
@@ -6330,7 +6335,7 @@ function pa(t, e, n = {}) {
|
|
|
6330
6335
|
inputProps: d
|
|
6331
6336
|
};
|
|
6332
6337
|
}
|
|
6333
|
-
const
|
|
6338
|
+
const he = {
|
|
6334
6339
|
useTopicEffect: da,
|
|
6335
6340
|
usePublishTopic: fa,
|
|
6336
6341
|
usePresence: la,
|
|
@@ -6340,8 +6345,8 @@ const le = {
|
|
|
6340
6345
|
class ya {
|
|
6341
6346
|
constructor(e, n, r) {
|
|
6342
6347
|
this.useTopicEffect = (i, s) => {
|
|
6343
|
-
|
|
6344
|
-
}, this.usePublishTopic = (i) =>
|
|
6348
|
+
he.useTopicEffect(this, i, s);
|
|
6349
|
+
}, this.usePublishTopic = (i) => he.usePublishTopic(this, i), this.usePresence = (i = {}) => he.usePresence(this, i), this.useSyncPresence = (i, s) => he.useSyncPresence(this, i, s), this.useTypingIndicator = (i, s = {}) => he.useTypingIndicator(this, i, s), this.core = e, this._core = this.core, this.type = n, this.id = r;
|
|
6345
6350
|
}
|
|
6346
6351
|
}
|
|
6347
6352
|
const ba = {
|
|
@@ -6353,18 +6358,18 @@ class ga {
|
|
|
6353
6358
|
constructor(e, n) {
|
|
6354
6359
|
this.tx = fn(), this.getLocalId = (r) => this.core.getLocalId(r), this.useLocalId = (r) => {
|
|
6355
6360
|
const [i, s] = wr(null);
|
|
6356
|
-
return
|
|
6361
|
+
return be(() => {
|
|
6357
6362
|
(async () => {
|
|
6358
6363
|
const u = await this.getLocalId(r);
|
|
6359
6364
|
s(u);
|
|
6360
6365
|
})();
|
|
6361
6366
|
}, [r]), i;
|
|
6362
|
-
}, this.rooms =
|
|
6367
|
+
}, this.rooms = he, this.transact = (r) => this.core.transact(r), this.useQuery = (r, i) => ua(
|
|
6363
6368
|
this.core,
|
|
6364
6369
|
r,
|
|
6365
6370
|
i
|
|
6366
6371
|
).state, this.useAuth = () => {
|
|
6367
|
-
const r =
|
|
6372
|
+
const r = st(
|
|
6368
6373
|
this.core._reactor._currentUserCached
|
|
6369
6374
|
), i = ae((o) => this.core.subscribeAuth((c) => {
|
|
6370
6375
|
r.current = { isLoading: !1, ...c }, o();
|
|
@@ -6382,7 +6387,7 @@ class ga {
|
|
|
6382
6387
|
);
|
|
6383
6388
|
return r;
|
|
6384
6389
|
}, this.useConnectionStatus = () => {
|
|
6385
|
-
const r =
|
|
6390
|
+
const r = st(
|
|
6386
6391
|
this.core._reactor.status
|
|
6387
6392
|
), i = ae((o) => this.core.subscribeConnectionStatus((c) => {
|
|
6388
6393
|
c !== r.current && (r.current = c, o());
|