use-abcd 1.4.2 → 1.4.3
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/chunks/{client-DReyDQ23.js → client-BfugfaiH.js} +54 -54
- package/dist/chunks/client-BfugfaiH.js.map +1 -0
- package/dist/index.js +105 -104
- package/dist/index.js.map +1 -1
- package/dist/runtime/client.d.ts +7 -7
- package/dist/runtime/client.js +1 -1
- package/dist/sync-queue.d.ts +9 -4
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
- package/dist/chunks/client-DReyDQ23.js.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useSyncExternalStore as j, useCallback as T, useRef as Nn, useMemo as Dn } from "react";
|
|
2
2
|
import { c as Ga } from "./chunks/types-Dy4rYb2N.js";
|
|
3
|
-
import { c as Wa, b as Va, a as Ja, f as Ya, d as Xa, s as Za } from "./chunks/client-
|
|
3
|
+
import { c as Wa, b as Va, a as Ja, f as Ya, d as Xa, s as Za } from "./chunks/client-BfugfaiH.js";
|
|
4
4
|
const v = {
|
|
5
5
|
Remove: "remove",
|
|
6
6
|
Replace: "replace",
|
|
@@ -29,7 +29,7 @@ function nt(e) {
|
|
|
29
29
|
function rt(e) {
|
|
30
30
|
return Object.getPrototypeOf(e) === Map.prototype;
|
|
31
31
|
}
|
|
32
|
-
function
|
|
32
|
+
function P(e) {
|
|
33
33
|
var t;
|
|
34
34
|
return (t = e.copy) !== null && t !== void 0 ? t : e.original;
|
|
35
35
|
}
|
|
@@ -81,7 +81,7 @@ function be(e, t, n) {
|
|
|
81
81
|
}
|
|
82
82
|
function Ne(e, t) {
|
|
83
83
|
const n = d(e);
|
|
84
|
-
return (n ?
|
|
84
|
+
return (n ? P(n) : e)[t];
|
|
85
85
|
}
|
|
86
86
|
function H(e, t) {
|
|
87
87
|
return e === t ? e !== 0 || 1 / e === 1 / t : e !== e && t !== t;
|
|
@@ -157,7 +157,7 @@ function nn(e, t) {
|
|
|
157
157
|
} else
|
|
158
158
|
throw new Error("Please check mark() to ensure that it is a stable marker draftable function.");
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function x(e) {
|
|
161
161
|
e.copy || (e.copy = nn(e.original, e.options));
|
|
162
162
|
}
|
|
163
163
|
function le(e) {
|
|
@@ -266,7 +266,7 @@ function rn(e, t, n) {
|
|
|
266
266
|
var a;
|
|
267
267
|
if (K(o)) {
|
|
268
268
|
const c = d(o);
|
|
269
|
-
|
|
269
|
+
x(c);
|
|
270
270
|
const u = !((a = c.assignedMap) === null || a === void 0) && a.size || c.operated ? c.copy : c.original;
|
|
271
271
|
be(r ? i : e, s, u);
|
|
272
272
|
} else
|
|
@@ -409,30 +409,30 @@ function _e(e, t, n, r) {
|
|
|
409
409
|
return Kn(e, t, n, r, i);
|
|
410
410
|
}
|
|
411
411
|
}
|
|
412
|
-
const
|
|
412
|
+
const xe = (e, t, n = !1) => {
|
|
413
413
|
if (typeof e == "object" && e !== null && (!$(e, t) || n))
|
|
414
414
|
throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.");
|
|
415
415
|
}, Ke = {
|
|
416
416
|
get size() {
|
|
417
|
-
return
|
|
417
|
+
return P(d(this)).size;
|
|
418
418
|
},
|
|
419
419
|
has(e) {
|
|
420
|
-
return
|
|
420
|
+
return P(d(this)).has(e);
|
|
421
421
|
},
|
|
422
422
|
set(e, t) {
|
|
423
|
-
const n = d(this), r =
|
|
424
|
-
return (!r.has(e) || !H(r.get(e), t)) && (
|
|
423
|
+
const n = d(this), r = P(n);
|
|
424
|
+
return (!r.has(e) || !H(r.get(e), t)) && (x(n), z(n), n.assignedMap.set(e, !0), n.copy.set(e, t), ot(n, e, t, _e)), this;
|
|
425
425
|
},
|
|
426
426
|
delete(e) {
|
|
427
427
|
if (!this.has(e))
|
|
428
428
|
return !1;
|
|
429
429
|
const t = d(this);
|
|
430
|
-
return
|
|
430
|
+
return x(t), z(t), t.original.has(e) ? t.assignedMap.set(e, !1) : t.assignedMap.delete(e), t.copy.delete(e), !0;
|
|
431
431
|
},
|
|
432
432
|
clear() {
|
|
433
433
|
const e = d(this);
|
|
434
434
|
if (this.size) {
|
|
435
|
-
|
|
435
|
+
x(e), z(e), e.assignedMap = /* @__PURE__ */ new Map();
|
|
436
436
|
for (const [t] of e.original)
|
|
437
437
|
e.assignedMap.set(t, !1);
|
|
438
438
|
e.copy.clear();
|
|
@@ -440,14 +440,14 @@ const Ae = (e, t, n = !1) => {
|
|
|
440
440
|
},
|
|
441
441
|
forEach(e, t) {
|
|
442
442
|
const n = d(this);
|
|
443
|
-
|
|
443
|
+
P(n).forEach((r, i) => {
|
|
444
444
|
e.call(t, this.get(i), i, this);
|
|
445
445
|
});
|
|
446
446
|
},
|
|
447
447
|
get(e) {
|
|
448
448
|
var t, n;
|
|
449
|
-
const r = d(this), i =
|
|
450
|
-
if (r.options.strict &&
|
|
449
|
+
const r = d(this), i = P(r).get(e), s = ((n = (t = r.options).mark) === null || n === void 0 ? void 0 : n.call(t, i, E)) === E.mutable;
|
|
450
|
+
if (r.options.strict && xe(i, r.options, s), s || r.finalized || !$(i, r.options) || i !== r.original.get(e))
|
|
451
451
|
return i;
|
|
452
452
|
const o = tt.createDraft({
|
|
453
453
|
original: i,
|
|
@@ -456,10 +456,10 @@ const Ae = (e, t, n = !1) => {
|
|
|
456
456
|
finalities: r.finalities,
|
|
457
457
|
options: r.options
|
|
458
458
|
});
|
|
459
|
-
return
|
|
459
|
+
return x(r), r.copy.set(e, o), o;
|
|
460
460
|
},
|
|
461
461
|
keys() {
|
|
462
|
-
return
|
|
462
|
+
return P(d(this)).keys();
|
|
463
463
|
},
|
|
464
464
|
values() {
|
|
465
465
|
const e = this.keys();
|
|
@@ -501,7 +501,7 @@ const Ae = (e, t, n = !1) => {
|
|
|
501
501
|
const o = s.value;
|
|
502
502
|
let a = e.setMap.get(o);
|
|
503
503
|
const c = d(a), u = ((i = (r = e.options).mark) === null || i === void 0 ? void 0 : i.call(r, a, E)) === E.mutable;
|
|
504
|
-
if (e.options.strict &&
|
|
504
|
+
if (e.options.strict && xe(o, e.options, u), !u && !c && $(o, e.options) && !e.finalized && e.original.has(o)) {
|
|
505
505
|
const l = tt.createDraft({
|
|
506
506
|
original: o,
|
|
507
507
|
parentDraft: e,
|
|
@@ -515,7 +515,7 @@ const Ae = (e, t, n = !1) => {
|
|
|
515
515
|
done: !1,
|
|
516
516
|
value: n ? a : [a, a]
|
|
517
517
|
};
|
|
518
|
-
},
|
|
518
|
+
}, Ae = {
|
|
519
519
|
get size() {
|
|
520
520
|
return d(this).setMap.size;
|
|
521
521
|
},
|
|
@@ -523,19 +523,19 @@ const Ae = (e, t, n = !1) => {
|
|
|
523
523
|
const t = d(this);
|
|
524
524
|
if (t.setMap.has(e))
|
|
525
525
|
return !0;
|
|
526
|
-
|
|
526
|
+
x(t);
|
|
527
527
|
const n = d(e);
|
|
528
528
|
return !!(n && t.setMap.has(n.original));
|
|
529
529
|
},
|
|
530
530
|
add(e) {
|
|
531
531
|
const t = d(this);
|
|
532
|
-
return this.has(e) || (
|
|
532
|
+
return this.has(e) || (x(t), z(t), t.assignedMap.set(e, !0), t.setMap.set(e, e), ot(t, e, e, _e)), this;
|
|
533
533
|
},
|
|
534
534
|
delete(e) {
|
|
535
535
|
if (!this.has(e))
|
|
536
536
|
return !1;
|
|
537
537
|
const t = d(this);
|
|
538
|
-
|
|
538
|
+
x(t), z(t);
|
|
539
539
|
const n = d(e);
|
|
540
540
|
return n && t.setMap.has(n.original) ? (t.assignedMap.set(n.original, !1), t.setMap.delete(n.original)) : (!n && t.setMap.has(e) ? t.assignedMap.set(e, !1) : t.assignedMap.delete(e), t.setMap.delete(e));
|
|
541
541
|
},
|
|
@@ -543,14 +543,14 @@ const Ae = (e, t, n = !1) => {
|
|
|
543
543
|
if (!this.size)
|
|
544
544
|
return;
|
|
545
545
|
const e = d(this);
|
|
546
|
-
|
|
546
|
+
x(e), z(e);
|
|
547
547
|
for (const t of e.original)
|
|
548
548
|
e.assignedMap.set(t, !1);
|
|
549
549
|
e.setMap.clear();
|
|
550
550
|
},
|
|
551
551
|
values() {
|
|
552
552
|
const e = d(this);
|
|
553
|
-
|
|
553
|
+
x(e);
|
|
554
554
|
const t = e.setMap.keys();
|
|
555
555
|
return {
|
|
556
556
|
[Symbol.iterator]: () => this.values(),
|
|
@@ -559,7 +559,7 @@ const Ae = (e, t, n = !1) => {
|
|
|
559
559
|
},
|
|
560
560
|
entries() {
|
|
561
561
|
const e = d(this);
|
|
562
|
-
|
|
562
|
+
x(e);
|
|
563
563
|
const t = e.setMap.keys();
|
|
564
564
|
return {
|
|
565
565
|
[Symbol.iterator]: () => this.entries(),
|
|
@@ -581,7 +581,7 @@ const Ae = (e, t, n = !1) => {
|
|
|
581
581
|
e.call(t, r.value, r.value, this), r = n.next();
|
|
582
582
|
}
|
|
583
583
|
};
|
|
584
|
-
Set.prototype.difference && Object.assign(
|
|
584
|
+
Set.prototype.difference && Object.assign(Ae, {
|
|
585
585
|
intersection(e) {
|
|
586
586
|
return Set.prototype.intersection.call(new Set(this.values()), e);
|
|
587
587
|
},
|
|
@@ -604,7 +604,7 @@ Set.prototype.difference && Object.assign(Pe, {
|
|
|
604
604
|
return Set.prototype.isDisjointFrom.call(new Set(this.values()), e);
|
|
605
605
|
}
|
|
606
606
|
});
|
|
607
|
-
const Vn = Reflect.ownKeys(
|
|
607
|
+
const Vn = Reflect.ownKeys(Ae), sn = {
|
|
608
608
|
get(e, t, n) {
|
|
609
609
|
var r, i;
|
|
610
610
|
const s = (r = e.copy) === null || r === void 0 ? void 0 : r[t];
|
|
@@ -616,13 +616,13 @@ const Vn = Reflect.ownKeys(Pe), sn = {
|
|
|
616
616
|
if (e.options.mark) {
|
|
617
617
|
const u = t === "size" && (e.original instanceof Map || e.original instanceof Set) ? Reflect.get(e.original, t) : Reflect.get(e.original, t, n);
|
|
618
618
|
if (o = e.options.mark(u, E), o === E.mutable)
|
|
619
|
-
return e.options.strict &&
|
|
619
|
+
return e.options.strict && xe(u, e.options, !0), u;
|
|
620
620
|
}
|
|
621
|
-
const a =
|
|
621
|
+
const a = P(e);
|
|
622
622
|
if (a instanceof Map && Wn.includes(t))
|
|
623
623
|
return t === "size" ? Object.getOwnPropertyDescriptor(Ke, "size").get.call(e.proxy) : Ke[t].bind(e.proxy);
|
|
624
624
|
if (a instanceof Set && Vn.includes(t))
|
|
625
|
-
return t === "size" ? Object.getOwnPropertyDescriptor(
|
|
625
|
+
return t === "size" ? Object.getOwnPropertyDescriptor(Ae, "size").get.call(e.proxy) : Ae[t].bind(e.proxy);
|
|
626
626
|
if (!he(a, t)) {
|
|
627
627
|
const u = yt(a, t);
|
|
628
628
|
return u ? "value" in u ? u.value : (
|
|
@@ -631,10 +631,10 @@ const Vn = Reflect.ownKeys(Pe), sn = {
|
|
|
631
631
|
) : void 0;
|
|
632
632
|
}
|
|
633
633
|
const c = a[t];
|
|
634
|
-
if (e.options.strict &&
|
|
634
|
+
if (e.options.strict && xe(c, e.options), e.finalized || !$(c, e.options))
|
|
635
635
|
return c;
|
|
636
636
|
if (c === Ne(e.original, t)) {
|
|
637
|
-
if (
|
|
637
|
+
if (x(e), e.copy[t] = at({
|
|
638
638
|
original: e.original[t],
|
|
639
639
|
parentDraft: e,
|
|
640
640
|
key: e.type === 1 ? Number(t) : t,
|
|
@@ -642,7 +642,7 @@ const Vn = Reflect.ownKeys(Pe), sn = {
|
|
|
642
642
|
options: e.options
|
|
643
643
|
}), typeof o == "function") {
|
|
644
644
|
const u = d(e.copy[t]);
|
|
645
|
-
return
|
|
645
|
+
return x(u), z(u), u.copy;
|
|
646
646
|
}
|
|
647
647
|
return e.copy[t];
|
|
648
648
|
}
|
|
@@ -655,20 +655,20 @@ const Vn = Reflect.ownKeys(Pe), sn = {
|
|
|
655
655
|
let i;
|
|
656
656
|
if (e.type === 1 && t !== "length" && !(Number.isInteger(i = Number(t)) && i >= 0 && (t === 0 || i === 0 || String(i) === String(t))))
|
|
657
657
|
throw new Error("Only supports setting array indices and the 'length' property.");
|
|
658
|
-
const s = yt(
|
|
658
|
+
const s = yt(P(e), t);
|
|
659
659
|
if (s?.set)
|
|
660
660
|
return s.set.call(e.proxy, n), !0;
|
|
661
|
-
const o = Ne(
|
|
662
|
-
return a && H(a.original, n) ? (e.copy[t] = n, e.assignedMap = (r = e.assignedMap) !== null && r !== void 0 ? r : /* @__PURE__ */ new Map(), e.assignedMap.set(t, !1), !0) : (H(n, o) && (n !== void 0 || he(e.original, t)) || (
|
|
661
|
+
const o = Ne(P(e), t), a = d(o);
|
|
662
|
+
return a && H(a.original, n) ? (e.copy[t] = n, e.assignedMap = (r = e.assignedMap) !== null && r !== void 0 ? r : /* @__PURE__ */ new Map(), e.assignedMap.set(t, !1), !0) : (H(n, o) && (n !== void 0 || he(e.original, t)) || (x(e), z(e), he(e.original, t) && H(n, e.original[t]) ? e.assignedMap.delete(t) : e.assignedMap.set(t, !0), e.copy[t] = n, ot(e, t, n, _e)), !0);
|
|
663
663
|
},
|
|
664
664
|
has(e, t) {
|
|
665
|
-
return t in
|
|
665
|
+
return t in P(e);
|
|
666
666
|
},
|
|
667
667
|
ownKeys(e) {
|
|
668
|
-
return Reflect.ownKeys(
|
|
668
|
+
return Reflect.ownKeys(P(e));
|
|
669
669
|
},
|
|
670
670
|
getOwnPropertyDescriptor(e, t) {
|
|
671
|
-
const n =
|
|
671
|
+
const n = P(e), r = Reflect.getOwnPropertyDescriptor(n, t);
|
|
672
672
|
return r && {
|
|
673
673
|
writable: !0,
|
|
674
674
|
configurable: e.type !== 1 || t !== "length",
|
|
@@ -687,7 +687,7 @@ const Vn = Reflect.ownKeys(Pe), sn = {
|
|
|
687
687
|
},
|
|
688
688
|
deleteProperty(e, t) {
|
|
689
689
|
var n;
|
|
690
|
-
return e.type === 1 ? sn.set.call(this, e, t, void 0, e.proxy) : (Ne(e.original, t) !== void 0 || t in e.original ? (
|
|
690
|
+
return e.type === 1 ? sn.set.call(this, e, t, void 0, e.proxy) : (Ne(e.original, t) !== void 0 || t in e.original ? (x(e), z(e), e.assignedMap.set(t, !1)) : (e.assignedMap = (n = e.assignedMap) !== null && n !== void 0 ? n : /* @__PURE__ */ new Map(), e.assignedMap.delete(t)), e.copy && delete e.copy[t], !0);
|
|
691
691
|
}
|
|
692
692
|
};
|
|
693
693
|
function at(e) {
|
|
@@ -713,11 +713,11 @@ function at(e) {
|
|
|
713
713
|
let w = l.type === 3 ? l.setMap : l.copy;
|
|
714
714
|
const C = q(w, r), S = d(C);
|
|
715
715
|
if (S) {
|
|
716
|
-
let
|
|
717
|
-
S.operated && (
|
|
716
|
+
let A = S.original;
|
|
717
|
+
S.operated && (A = it(C)), Ue(S), Ge(S, _e, f, h), l.options.enableAutoFreeze && (l.options.updatedValues = (p = l.options.updatedValues) !== null && p !== void 0 ? p : /* @__PURE__ */ new WeakMap(), l.options.updatedValues.set(A, S.original)), be(w, r, A);
|
|
718
718
|
}
|
|
719
|
-
(g = b.callbacks) === null || g === void 0 || g.forEach((
|
|
720
|
-
|
|
719
|
+
(g = b.callbacks) === null || g === void 0 || g.forEach((A) => {
|
|
720
|
+
A(f, h);
|
|
721
721
|
});
|
|
722
722
|
});
|
|
723
723
|
} else {
|
|
@@ -851,9 +851,9 @@ const Xn = (e) => function t(n, r, i) {
|
|
|
851
851
|
throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
|
|
852
852
|
return [C, S];
|
|
853
853
|
}
|
|
854
|
-
let
|
|
854
|
+
let A;
|
|
855
855
|
try {
|
|
856
|
-
|
|
856
|
+
A = u(C);
|
|
857
857
|
} catch (_) {
|
|
858
858
|
throw Be(d(C)), _;
|
|
859
859
|
}
|
|
@@ -884,9 +884,9 @@ const Xn = (e) => function t(n, r, i) {
|
|
|
884
884
|
}
|
|
885
885
|
return S([_]);
|
|
886
886
|
};
|
|
887
|
-
return
|
|
887
|
+
return A instanceof Promise ? A.then(V, (_) => {
|
|
888
888
|
throw Be(d(C)), _;
|
|
889
|
-
}) : V(
|
|
889
|
+
}) : V(A);
|
|
890
890
|
}, I = Xn();
|
|
891
891
|
Object.prototype.constructor.toString();
|
|
892
892
|
var an = typeof global == "object" && global && global.Object === Object && global, Zn = typeof self == "object" && self && self.Object === Object && self, Q = an || Zn || Function("return this")(), N = Q.Symbol, cn = Object.prototype, kn = cn.hasOwnProperty, er = cn.toString, ue = N ? N.toStringTag : void 0;
|
|
@@ -1006,13 +1006,13 @@ function ne(e) {
|
|
|
1006
1006
|
}
|
|
1007
1007
|
return "";
|
|
1008
1008
|
}
|
|
1009
|
-
var
|
|
1010
|
-
"^" + Tr.call(Rr).replace(
|
|
1009
|
+
var xr = /[\\^$.*+?()[\]{}|]/g, Ar = /^\[object .+?Constructor\]$/, Pr = Function.prototype, Er = Object.prototype, Tr = Pr.toString, Rr = Er.hasOwnProperty, Ir = RegExp(
|
|
1010
|
+
"^" + Tr.call(Rr).replace(xr, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"
|
|
1011
1011
|
);
|
|
1012
1012
|
function jr(e) {
|
|
1013
1013
|
if (!ae(e) || Or(e))
|
|
1014
1014
|
return !1;
|
|
1015
|
-
var t = fn(e) ? Ir :
|
|
1015
|
+
var t = fn(e) ? Ir : Ar;
|
|
1016
1016
|
return t.test(ne(e));
|
|
1017
1017
|
}
|
|
1018
1018
|
function $r(e, t) {
|
|
@@ -1054,14 +1054,14 @@ function Lr(e) {
|
|
|
1054
1054
|
return e;
|
|
1055
1055
|
};
|
|
1056
1056
|
}
|
|
1057
|
-
var
|
|
1057
|
+
var xt = (function() {
|
|
1058
1058
|
try {
|
|
1059
1059
|
var e = re(Object, "defineProperty");
|
|
1060
1060
|
return e({}, "", {}), e;
|
|
1061
1061
|
} catch {
|
|
1062
1062
|
}
|
|
1063
|
-
})(), qr =
|
|
1064
|
-
return
|
|
1063
|
+
})(), qr = xt ? function(e, t) {
|
|
1064
|
+
return xt(e, "toString", {
|
|
1065
1065
|
configurable: !0,
|
|
1066
1066
|
enumerable: !1,
|
|
1067
1067
|
value: Lr(t),
|
|
@@ -1087,10 +1087,10 @@ function ct(e, t) {
|
|
|
1087
1087
|
function ut(e, t) {
|
|
1088
1088
|
return e === t || e !== e && t !== t;
|
|
1089
1089
|
}
|
|
1090
|
-
var
|
|
1090
|
+
var At = Math.max;
|
|
1091
1091
|
function Wr(e, t, n) {
|
|
1092
|
-
return t =
|
|
1093
|
-
for (var r = arguments, i = -1, s =
|
|
1092
|
+
return t = At(t === void 0 ? e.length - 1 : t, 0), function() {
|
|
1093
|
+
for (var r = arguments, i = -1, s = At(r.length - t, 0), o = Array(s); ++i < s; )
|
|
1094
1094
|
o[i] = r[t + i];
|
|
1095
1095
|
i = -1;
|
|
1096
1096
|
for (var a = Array(t + 1); ++i < t; )
|
|
@@ -1108,7 +1108,7 @@ function lt(e) {
|
|
|
1108
1108
|
function ie(e) {
|
|
1109
1109
|
return e != null && lt(e.length) && !fn(e);
|
|
1110
1110
|
}
|
|
1111
|
-
function
|
|
1111
|
+
function Pt(e, t, n) {
|
|
1112
1112
|
if (!ae(n))
|
|
1113
1113
|
return !1;
|
|
1114
1114
|
var r = typeof t;
|
|
@@ -1136,10 +1136,10 @@ var dn = Object.prototype, kr = dn.hasOwnProperty, ei = dn.propertyIsEnumerable,
|
|
|
1136
1136
|
function ti() {
|
|
1137
1137
|
return !1;
|
|
1138
1138
|
}
|
|
1139
|
-
var pn = typeof exports == "object" && exports && !exports.nodeType && exports, Tt = pn && typeof module == "object" && module && !module.nodeType && module, ni = Tt && Tt.exports === pn, Rt = ni ? Q.Buffer : void 0, ri = Rt ? Rt.isBuffer : void 0,
|
|
1140
|
-
y[mi] = y[Si] = y[vi] = y[wi] = y[Oi] = y[Ci] = y[Mi] = y[
|
|
1139
|
+
var pn = typeof exports == "object" && exports && !exports.nodeType && exports, Tt = pn && typeof module == "object" && module && !module.nodeType && module, ni = Tt && Tt.exports === pn, Rt = ni ? Q.Buffer : void 0, ri = Rt ? Rt.isBuffer : void 0, Pe = ri || ti, ii = "[object Arguments]", si = "[object Array]", oi = "[object Boolean]", ai = "[object Date]", ci = "[object Error]", ui = "[object Function]", li = "[object Map]", fi = "[object Number]", hi = "[object Object]", di = "[object RegExp]", pi = "[object Set]", _i = "[object String]", yi = "[object WeakMap]", gi = "[object ArrayBuffer]", bi = "[object DataView]", mi = "[object Float32Array]", Si = "[object Float64Array]", vi = "[object Int8Array]", wi = "[object Int16Array]", Oi = "[object Int32Array]", Ci = "[object Uint8Array]", Mi = "[object Uint8ClampedArray]", xi = "[object Uint16Array]", Ai = "[object Uint32Array]", y = {};
|
|
1140
|
+
y[mi] = y[Si] = y[vi] = y[wi] = y[Oi] = y[Ci] = y[Mi] = y[xi] = y[Ai] = !0;
|
|
1141
1141
|
y[ii] = y[si] = y[gi] = y[oi] = y[bi] = y[ai] = y[ci] = y[ui] = y[li] = y[fi] = y[hi] = y[di] = y[pi] = y[_i] = y[yi] = !1;
|
|
1142
|
-
function
|
|
1142
|
+
function Pi(e) {
|
|
1143
1143
|
return X(e) && lt(e.length) && !!y[te(e)];
|
|
1144
1144
|
}
|
|
1145
1145
|
function _n(e) {
|
|
@@ -1153,9 +1153,9 @@ var yn = typeof exports == "object" && exports && !exports.nodeType && exports,
|
|
|
1153
1153
|
return e || He && He.binding && He.binding("util");
|
|
1154
1154
|
} catch {
|
|
1155
1155
|
}
|
|
1156
|
-
})(), jt = It && It.isTypedArray, ft = jt ? _n(jt) :
|
|
1156
|
+
})(), jt = It && It.isTypedArray, ft = jt ? _n(jt) : Pi, Ti = Object.prototype, Ri = Ti.hasOwnProperty;
|
|
1157
1157
|
function Ii(e, t) {
|
|
1158
|
-
var n = M(e), r = !n && Te(e), i = !n && !r &&
|
|
1158
|
+
var n = M(e), r = !n && Te(e), i = !n && !r && Pe(e), s = !n && !r && !i && ft(e), o = n || r || i || s, a = o ? Xr(e.length, String) : [], c = a.length;
|
|
1159
1159
|
for (var u in e)
|
|
1160
1160
|
Ri.call(e, u) && !(o && // Safari 9 has enumerable `arguments.length` in strict mode.
|
|
1161
1161
|
(u == "length" || // Node.js 0.10 has enumerable non-index properties on buffers.
|
|
@@ -1389,14 +1389,14 @@ function Cs(e) {
|
|
|
1389
1389
|
function Ms() {
|
|
1390
1390
|
this.__data__ = new B(), this.size = 0;
|
|
1391
1391
|
}
|
|
1392
|
-
function
|
|
1392
|
+
function xs(e) {
|
|
1393
1393
|
var t = this.__data__, n = t.delete(e);
|
|
1394
1394
|
return this.size = t.size, n;
|
|
1395
1395
|
}
|
|
1396
|
-
function
|
|
1396
|
+
function As(e) {
|
|
1397
1397
|
return this.__data__.get(e);
|
|
1398
1398
|
}
|
|
1399
|
-
function
|
|
1399
|
+
function Ps(e) {
|
|
1400
1400
|
return this.__data__.has(e);
|
|
1401
1401
|
}
|
|
1402
1402
|
var Es = 200;
|
|
@@ -1415,9 +1415,9 @@ function L(e) {
|
|
|
1415
1415
|
this.size = t.size;
|
|
1416
1416
|
}
|
|
1417
1417
|
L.prototype.clear = Ms;
|
|
1418
|
-
L.prototype.delete =
|
|
1419
|
-
L.prototype.get =
|
|
1420
|
-
L.prototype.has =
|
|
1418
|
+
L.prototype.delete = xs;
|
|
1419
|
+
L.prototype.get = As;
|
|
1420
|
+
L.prototype.has = Ps;
|
|
1421
1421
|
L.prototype.set = Ts;
|
|
1422
1422
|
function wn(e, t) {
|
|
1423
1423
|
for (var n = -1, r = e == null ? 0 : e.length, i = 0, s = []; ++n < r; ) {
|
|
@@ -1583,8 +1583,8 @@ function _o(e, t, n, r, i, s) {
|
|
|
1583
1583
|
h = a[f];
|
|
1584
1584
|
var C = e[h], S = t[h];
|
|
1585
1585
|
if (r)
|
|
1586
|
-
var
|
|
1587
|
-
if (!(
|
|
1586
|
+
var A = o ? r(S, C, h, t, e, s) : r(C, S, h, e, t, s);
|
|
1587
|
+
if (!(A === void 0 ? C === S || i(C, S, n, r, s) : A)) {
|
|
1588
1588
|
b = !1;
|
|
1589
1589
|
break;
|
|
1590
1590
|
}
|
|
@@ -1601,8 +1601,8 @@ function bo(e, t, n, r, i, s) {
|
|
|
1601
1601
|
var o = M(e), a = M(t), c = o ? Gt : F(e), u = a ? Gt : F(t);
|
|
1602
1602
|
c = c == Ut ? Se : c, u = u == Ut ? Se : u;
|
|
1603
1603
|
var l = c == Se, f = u == Se, h = c == u;
|
|
1604
|
-
if (h &&
|
|
1605
|
-
if (!
|
|
1604
|
+
if (h && Pe(e)) {
|
|
1605
|
+
if (!Pe(t))
|
|
1606
1606
|
return !1;
|
|
1607
1607
|
o = !0, l = !1;
|
|
1608
1608
|
}
|
|
@@ -1678,17 +1678,17 @@ function Mo(e, t, n) {
|
|
|
1678
1678
|
}
|
|
1679
1679
|
return s || ++r != i ? s : (i = e == null ? 0 : e.length, !!i && lt(i) && ct(o, i) && (M(e) || Te(e)));
|
|
1680
1680
|
}
|
|
1681
|
-
function
|
|
1681
|
+
function xo(e, t) {
|
|
1682
1682
|
return e != null && Mo(e, t, Co);
|
|
1683
1683
|
}
|
|
1684
|
-
var
|
|
1684
|
+
var Ao = 1, Po = 2;
|
|
1685
1685
|
function Eo(e, t) {
|
|
1686
1686
|
return dt(e) && Cn(t) ? Mn($e(e), t) : function(n) {
|
|
1687
1687
|
var r = m(n, e);
|
|
1688
|
-
return r === void 0 && r === t ?
|
|
1688
|
+
return r === void 0 && r === t ? xo(n, e) : Fe(t, r, Ao | Po);
|
|
1689
1689
|
};
|
|
1690
1690
|
}
|
|
1691
|
-
function
|
|
1691
|
+
function xn(e) {
|
|
1692
1692
|
return function(t) {
|
|
1693
1693
|
return t?.[e];
|
|
1694
1694
|
};
|
|
@@ -1699,7 +1699,7 @@ function To(e) {
|
|
|
1699
1699
|
};
|
|
1700
1700
|
}
|
|
1701
1701
|
function Ro(e) {
|
|
1702
|
-
return dt(e) ?
|
|
1702
|
+
return dt(e) ? xn($e(e)) : To(e);
|
|
1703
1703
|
}
|
|
1704
1704
|
function W(e) {
|
|
1705
1705
|
return typeof e == "function" ? e : e == null ? me : typeof e == "object" ? M(e) ? Eo(e[0], e[1]) : Oo(e) : Ro(e);
|
|
@@ -1792,14 +1792,14 @@ var Ze = qo(Bo);
|
|
|
1792
1792
|
function Uo(e) {
|
|
1793
1793
|
return e && e.length ? e[0] : void 0;
|
|
1794
1794
|
}
|
|
1795
|
-
function
|
|
1795
|
+
function An(e, t) {
|
|
1796
1796
|
var n = -1, r = ie(e) ? Array(e.length) : [];
|
|
1797
1797
|
return ze(e, function(i, s, o) {
|
|
1798
1798
|
r[++n] = t(i, s, o);
|
|
1799
1799
|
}), r;
|
|
1800
1800
|
}
|
|
1801
1801
|
function Y(e, t) {
|
|
1802
|
-
var n = M(e) ? de :
|
|
1802
|
+
var n = M(e) ? de : An;
|
|
1803
1803
|
return n(e, W(t));
|
|
1804
1804
|
}
|
|
1805
1805
|
function Go(e, t) {
|
|
@@ -1824,10 +1824,10 @@ function Yo(e) {
|
|
|
1824
1824
|
return t ? vn(e, 0, -1) : [];
|
|
1825
1825
|
}
|
|
1826
1826
|
var Xo = "[object Map]", Zo = "[object Set]", ko = Object.prototype, ea = ko.hasOwnProperty;
|
|
1827
|
-
function
|
|
1827
|
+
function Pn(e) {
|
|
1828
1828
|
if (e == null)
|
|
1829
1829
|
return !0;
|
|
1830
|
-
if (ie(e) && (M(e) || typeof e == "string" || typeof e.splice == "function" ||
|
|
1830
|
+
if (ie(e) && (M(e) || typeof e == "string" || typeof e.splice == "function" || Pe(e) || ft(e) || Te(e)))
|
|
1831
1831
|
return !e.length;
|
|
1832
1832
|
var t = F(e);
|
|
1833
1833
|
if (t == Xo || t == Zo)
|
|
@@ -1899,7 +1899,7 @@ function ca(e, t, n) {
|
|
|
1899
1899
|
}) : t = [me];
|
|
1900
1900
|
var r = -1;
|
|
1901
1901
|
t = de(t, _n(W));
|
|
1902
|
-
var i =
|
|
1902
|
+
var i = An(e, function(s, o, a) {
|
|
1903
1903
|
var c = de(t, function(u) {
|
|
1904
1904
|
return u(s);
|
|
1905
1905
|
});
|
|
@@ -1909,7 +1909,7 @@ function ca(e, t, n) {
|
|
|
1909
1909
|
return aa(s, o, n);
|
|
1910
1910
|
});
|
|
1911
1911
|
}
|
|
1912
|
-
var ua =
|
|
1912
|
+
var ua = xn("length"), Tn = "\\ud800-\\udfff", la = "\\u0300-\\u036f", fa = "\\ufe20-\\ufe2f", ha = "\\u20d0-\\u20ff", da = la + fa + ha, pa = "\\ufe0e\\ufe0f", _a = "[" + Tn + "]", ke = "[" + da + "]", et = "\\ud83c[\\udffb-\\udfff]", ya = "(?:" + ke + "|" + et + ")", Rn = "[^" + Tn + "]", In = "(?:\\ud83c[\\udde6-\\uddff]){2}", jn = "[\\ud800-\\udbff][\\udc00-\\udfff]", ga = "\\u200d", $n = ya + "?", Fn = "[" + pa + "]?", ba = "(?:" + ga + "(?:" + [Rn, In, jn].join("|") + ")" + Fn + $n + ")*", ma = Fn + $n + ba, Sa = "(?:" + [Rn + ke + "?", ke, In, jn, _a].join("|") + ")", Vt = RegExp(et + "(?=" + et + ")|" + Sa + ma, "g");
|
|
1913
1913
|
function va(e) {
|
|
1914
1914
|
for (var t = Vt.lastIndex = 0; Vt.test(e); )
|
|
1915
1915
|
++t;
|
|
@@ -1931,22 +1931,22 @@ var Me = Vr(function(e, t) {
|
|
|
1931
1931
|
if (e == null)
|
|
1932
1932
|
return [];
|
|
1933
1933
|
var n = t.length;
|
|
1934
|
-
return n > 1 &&
|
|
1934
|
+
return n > 1 && Pt(e, t[0], t[1]) ? t = [] : n > 2 && Pt(t[0], t[1], t[2]) && (t = [t[0]]), ca(e, Sn(t), []);
|
|
1935
1935
|
});
|
|
1936
1936
|
function Ma(e, t, n) {
|
|
1937
1937
|
return e && e.length ? (t = t === void 0 ? 1 : ln(t), vn(e, 0, t < 0 ? 0 : t)) : [];
|
|
1938
1938
|
}
|
|
1939
|
-
var
|
|
1939
|
+
var xa = 0;
|
|
1940
1940
|
function Jt(e) {
|
|
1941
|
-
var t = ++
|
|
1941
|
+
var t = ++xa;
|
|
1942
1942
|
return gn(e) + t;
|
|
1943
1943
|
}
|
|
1944
|
-
const
|
|
1945
|
-
if (
|
|
1944
|
+
const Aa = (e, t) => {
|
|
1945
|
+
if (Pn(e)) return [t];
|
|
1946
1946
|
const n = fe(e);
|
|
1947
1947
|
return O(n.type, "create") && O(t.type, "delete") ? null : O(n.type, "create") && O(t.type, "update") ? [{ ...n, data: t.data }] : O(n.type, "update") && O(t.type, "update") ? [...Yo(e), t] : O(n.type, "update") && O(t.type, "delete") ? [...e, t] : [t];
|
|
1948
1948
|
};
|
|
1949
|
-
class
|
|
1949
|
+
class Pa {
|
|
1950
1950
|
_config;
|
|
1951
1951
|
_state;
|
|
1952
1952
|
_subscribers = /* @__PURE__ */ new Set();
|
|
@@ -1963,7 +1963,7 @@ class xa {
|
|
|
1963
1963
|
}
|
|
1964
1964
|
enqueue(t) {
|
|
1965
1965
|
this._updateState((n) => {
|
|
1966
|
-
const r = [...n.queue.get(t.id) ?? []], i =
|
|
1966
|
+
const r = [...n.queue.get(t.id) ?? []], i = Aa(r, t);
|
|
1967
1967
|
i ? n.queue.set(t.id, i) : n.queue.delete(t.id), n.errors.delete(t.id);
|
|
1968
1968
|
}), this._scheduleFlush();
|
|
1969
1969
|
}
|
|
@@ -2035,16 +2035,16 @@ class xa {
|
|
|
2035
2035
|
const { isPaused: t, isSyncing: n, queue: r } = this._state;
|
|
2036
2036
|
if (t || n || O(oe(r), 0)) return;
|
|
2037
2037
|
const i = m(this._config, "batchSize", 1 / 0), s = [...r.entries()], o = Ma(s, i), a = s.slice(oe(o));
|
|
2038
|
-
this._updateState((
|
|
2039
|
-
|
|
2038
|
+
this._updateState((l) => {
|
|
2039
|
+
l.inFlight = new Map(o), l.queue = new Map(a), l.isSyncing = !0;
|
|
2040
2040
|
});
|
|
2041
|
-
const c = Go([...this._state.inFlight.values()]);
|
|
2041
|
+
const c = Go([...this._state.inFlight.values()]), u = this._config.getContext?.();
|
|
2042
2042
|
this._abortController = new AbortController();
|
|
2043
2043
|
try {
|
|
2044
|
-
const
|
|
2045
|
-
this._processResults(Ko(Y(
|
|
2046
|
-
} catch (
|
|
2047
|
-
this._handleError(
|
|
2044
|
+
const l = await this._config.onSync(c, u, this._abortController.signal);
|
|
2045
|
+
this._processResults(Ko(Y(l, (f) => [f.id, f])));
|
|
2046
|
+
} catch (l) {
|
|
2047
|
+
this._handleError(l);
|
|
2048
2048
|
}
|
|
2049
2049
|
this._abortController = null, oe(this._state.queue) > 0 && !this._state.isPaused && this._scheduleFlush();
|
|
2050
2050
|
}
|
|
@@ -2082,7 +2082,7 @@ class xa {
|
|
|
2082
2082
|
});
|
|
2083
2083
|
}
|
|
2084
2084
|
i.inFlight = /* @__PURE__ */ new Map(), i.isSyncing = !1;
|
|
2085
|
-
}), !
|
|
2085
|
+
}), !Pn(r) && this._config.onIdRemap && this._config.onIdRemap(r);
|
|
2086
2086
|
}
|
|
2087
2087
|
/**
|
|
2088
2088
|
* Handle network or unexpected errors during sync.
|
|
@@ -2476,9 +2476,10 @@ class R {
|
|
|
2476
2476
|
constructor(t) {
|
|
2477
2477
|
this.id = t.id, this.config = t;
|
|
2478
2478
|
const n = async (s) => s.map((o) => ({ id: o.id, status: "success" }));
|
|
2479
|
-
this._syncQueue = new
|
|
2479
|
+
this._syncQueue = new Pa({
|
|
2480
2480
|
debounce: t.syncDebounce ?? 300,
|
|
2481
2481
|
maxRetries: t.syncRetries ?? 3,
|
|
2482
|
+
getContext: () => this._state.context,
|
|
2482
2483
|
onSync: t.onSync ?? n,
|
|
2483
2484
|
onIdRemap: (s) => this._handleIdRemap(s)
|
|
2484
2485
|
}), this._fetchHandler = new Ta({
|
|
@@ -2835,10 +2836,10 @@ const $a = {
|
|
|
2835
2836
|
children: []
|
|
2836
2837
|
};
|
|
2837
2838
|
function Fa(e) {
|
|
2838
|
-
const t = Nn(
|
|
2839
|
+
const t = Nn($a), n = j(
|
|
2839
2840
|
(h) => e.collection.subscribe(h),
|
|
2840
2841
|
() => {
|
|
2841
|
-
const h = e.getChildren(), p = t.current, g =
|
|
2842
|
+
const h = e.getChildren(), p = t.current, g = ja(p.children, h) ? h : p.children, b = {
|
|
2842
2843
|
data: e.data,
|
|
2843
2844
|
status: e.getStatus(),
|
|
2844
2845
|
exists: e.exists(),
|
|
@@ -2847,7 +2848,7 @@ function Fa(e) {
|
|
|
2847
2848
|
};
|
|
2848
2849
|
return O(p, b) || (t.current = b), t.current;
|
|
2849
2850
|
},
|
|
2850
|
-
() => t.current
|
|
2851
|
+
() => t.current
|
|
2851
2852
|
), r = T(() => e.getParent(), [e]), i = T((h, p) => e.append(h, p), [e]), s = T((h, p) => e.prepend(h, p), [e]), o = T(
|
|
2852
2853
|
(h, p) => e.move(h, p),
|
|
2853
2854
|
[e]
|
|
@@ -2937,7 +2938,7 @@ export {
|
|
|
2937
2938
|
Ta as FetchHandler,
|
|
2938
2939
|
Yt as Item,
|
|
2939
2940
|
kt as Node,
|
|
2940
|
-
|
|
2941
|
+
Pa as SyncQueue,
|
|
2941
2942
|
Ga as categorizeResults,
|
|
2942
2943
|
Wa as createSyncClient,
|
|
2943
2944
|
Va as createSyncClientFromEndpoint,
|