@instantdb/react 0.22.162-branch-svelte-feedback.23169179938.1 → 0.22.162
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 +144 -144
- package/dist/standalone/index.umd.cjs +1 -1
- package/package.json +4 -4
package/dist/standalone/index.js
CHANGED
|
@@ -317,7 +317,7 @@ function cs(n, e, t) {
|
|
|
317
317
|
});
|
|
318
318
|
}
|
|
319
319
|
}
|
|
320
|
-
function
|
|
320
|
+
function Ai(n, e) {
|
|
321
321
|
const t = n.type === 3 ? n.setMap : n.copy;
|
|
322
322
|
n.finalities.revoke.length > 1 && n.assignedMap.get(e) && t && cs(Ie(t, e), n.finalities.handledSet, n.options);
|
|
323
323
|
}
|
|
@@ -346,10 +346,10 @@ function Vn(n, e, t, r) {
|
|
|
346
346
|
}
|
|
347
347
|
}), n.options.enableAutoFreeze && s.finalities !== n.finalities && (n.options.enableAutoFreeze = !1)), Se(t, n.options) && n.finalities.draft.push(() => {
|
|
348
348
|
const i = n.type === 3 ? n.setMap : n.copy;
|
|
349
|
-
Ce(Ie(i, e), t) &&
|
|
349
|
+
Ce(Ie(i, e), t) && Ai(n, e);
|
|
350
350
|
});
|
|
351
351
|
}
|
|
352
|
-
function
|
|
352
|
+
function ki(n, e, t, r, s) {
|
|
353
353
|
let { original: i, assignedMap: o, options: a } = n, c = n.copy;
|
|
354
354
|
c.length < i.length && ([i, c] = [c, i], [t, r] = [r, t]);
|
|
355
355
|
for (let u = 0; u < i.length; u += 1)
|
|
@@ -443,7 +443,7 @@ function _t(n, e, t, r) {
|
|
|
443
443
|
case 2:
|
|
444
444
|
return Ci(n, e, t, r, s);
|
|
445
445
|
case 1:
|
|
446
|
-
return
|
|
446
|
+
return ki(n, e, t, r, s);
|
|
447
447
|
case 3:
|
|
448
448
|
return Ii(n, e, t, r, s);
|
|
449
449
|
}
|
|
@@ -1647,7 +1647,7 @@ function fe(n, e, t = []) {
|
|
|
1647
1647
|
fe(r, e - 1, t);
|
|
1648
1648
|
return t;
|
|
1649
1649
|
}
|
|
1650
|
-
function
|
|
1650
|
+
function At(n, e, t) {
|
|
1651
1651
|
var i;
|
|
1652
1652
|
const r = [];
|
|
1653
1653
|
if (t != null && t.hasOwnProperty("$not")) {
|
|
@@ -1697,7 +1697,7 @@ function uo(n, [e, t, r]) {
|
|
|
1697
1697
|
}
|
|
1698
1698
|
case "eav": {
|
|
1699
1699
|
const a = (o = n.eav.get(e)) == null ? void 0 : o.get(t);
|
|
1700
|
-
return a ?
|
|
1700
|
+
return a ? At(n, a, r) : [];
|
|
1701
1701
|
}
|
|
1702
1702
|
case "ev": {
|
|
1703
1703
|
const a = n.eav.get(e);
|
|
@@ -1705,7 +1705,7 @@ function uo(n, [e, t, r]) {
|
|
|
1705
1705
|
return [];
|
|
1706
1706
|
const c = [];
|
|
1707
1707
|
for (const u of a.values())
|
|
1708
|
-
c.push(...
|
|
1708
|
+
c.push(...At(n, u, r));
|
|
1709
1709
|
return c;
|
|
1710
1710
|
}
|
|
1711
1711
|
case "a": {
|
|
@@ -1718,14 +1718,14 @@ function uo(n, [e, t, r]) {
|
|
|
1718
1718
|
return [];
|
|
1719
1719
|
const c = [];
|
|
1720
1720
|
for (const u of a.values())
|
|
1721
|
-
c.push(...
|
|
1721
|
+
c.push(...At(n, u, r));
|
|
1722
1722
|
return c;
|
|
1723
1723
|
}
|
|
1724
1724
|
case "v": {
|
|
1725
1725
|
const a = [];
|
|
1726
1726
|
for (const c of n.eav.values())
|
|
1727
1727
|
for (const u of c.values())
|
|
1728
|
-
a.push(...
|
|
1728
|
+
a.push(...At(n, u, r));
|
|
1729
1729
|
return a;
|
|
1730
1730
|
}
|
|
1731
1731
|
default:
|
|
@@ -1867,18 +1867,18 @@ function et(n) {
|
|
|
1867
1867
|
const Z = [];
|
|
1868
1868
|
for (let n = 0; n < 256; ++n)
|
|
1869
1869
|
Z.push((n + 256).toString(16).slice(1));
|
|
1870
|
-
function
|
|
1870
|
+
function Ao(n, e = 0) {
|
|
1871
1871
|
return (Z[n[e + 0]] + Z[n[e + 1]] + Z[n[e + 2]] + Z[n[e + 3]] + "-" + Z[n[e + 4]] + Z[n[e + 5]] + "-" + Z[n[e + 6]] + Z[n[e + 7]] + "-" + Z[n[e + 8]] + Z[n[e + 9]] + "-" + Z[n[e + 10]] + Z[n[e + 11]] + Z[n[e + 12]] + Z[n[e + 13]] + Z[n[e + 14]] + Z[n[e + 15]]).toLowerCase();
|
|
1872
1872
|
}
|
|
1873
1873
|
let sn;
|
|
1874
|
-
const
|
|
1874
|
+
const ko = new Uint8Array(16);
|
|
1875
1875
|
function Co() {
|
|
1876
1876
|
if (!sn) {
|
|
1877
1877
|
if (typeof crypto > "u" || !crypto.getRandomValues)
|
|
1878
1878
|
throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
|
|
1879
1879
|
sn = crypto.getRandomValues.bind(crypto);
|
|
1880
1880
|
}
|
|
1881
|
-
return sn(
|
|
1881
|
+
return sn(ko);
|
|
1882
1882
|
}
|
|
1883
1883
|
const Io = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Er = { randomUUID: Io };
|
|
1884
1884
|
function Po(n, e, t) {
|
|
@@ -1889,7 +1889,7 @@ function Po(n, e, t) {
|
|
|
1889
1889
|
const r = n.random ?? ((s = n.rng) == null ? void 0 : s.call(n)) ?? Co();
|
|
1890
1890
|
if (r.length < 16)
|
|
1891
1891
|
throw new Error("Random bytes length must be >= 16");
|
|
1892
|
-
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128,
|
|
1892
|
+
return r[6] = r[6] & 15 | 64, r[8] = r[8] & 63 | 128, Ao(r);
|
|
1893
1893
|
}
|
|
1894
1894
|
function Or(n) {
|
|
1895
1895
|
const e = n.replace(/-/g, ""), t = [];
|
|
@@ -1925,9 +1925,9 @@ function xo() {
|
|
|
1925
1925
|
return n;
|
|
1926
1926
|
}
|
|
1927
1927
|
const $o = xo();
|
|
1928
|
-
let
|
|
1928
|
+
let As = !0;
|
|
1929
1929
|
const Fu = (n) => {
|
|
1930
|
-
|
|
1930
|
+
As = n;
|
|
1931
1931
|
};
|
|
1932
1932
|
let Do = 0;
|
|
1933
1933
|
function pt(n) {
|
|
@@ -1947,7 +1947,7 @@ function Uo(n, e) {
|
|
|
1947
1947
|
throw new tt(`Could not find id attr for ${e}`);
|
|
1948
1948
|
return t;
|
|
1949
1949
|
}
|
|
1950
|
-
function
|
|
1950
|
+
function Ar(n, e, t, r) {
|
|
1951
1951
|
return [Lo(n, e, t, r)];
|
|
1952
1952
|
}
|
|
1953
1953
|
function Lo(n, e, t, r) {
|
|
@@ -1961,7 +1961,7 @@ function Lo(n, e, t, r) {
|
|
|
1961
1961
|
function Fo(n, e, t) {
|
|
1962
1962
|
return n.map((r) => r === e ? t : r);
|
|
1963
1963
|
}
|
|
1964
|
-
function
|
|
1964
|
+
function ks(n, e, t, r, s) {
|
|
1965
1965
|
const i = V(e, t, s), o = Ke(e, t, s), a = i || o;
|
|
1966
1966
|
if (!a)
|
|
1967
1967
|
throw new tt(`Could not find attr for ${[t, s]}`);
|
|
@@ -1980,7 +1980,7 @@ function As(n, e, t, r, s) {
|
|
|
1980
1980
|
];
|
|
1981
1981
|
return [i ? f : u, p, y, a, !!i];
|
|
1982
1982
|
}
|
|
1983
|
-
function
|
|
1983
|
+
function kr(n, e) {
|
|
1984
1984
|
if (typeof e != "string")
|
|
1985
1985
|
return function(o) {
|
|
1986
1986
|
return !1;
|
|
@@ -2031,7 +2031,7 @@ function No(n, e) {
|
|
|
2031
2031
|
}
|
|
2032
2032
|
};
|
|
2033
2033
|
if (e.hasOwnProperty("$like")) {
|
|
2034
|
-
const r =
|
|
2034
|
+
const r = kr(!0, e.$like);
|
|
2035
2035
|
return {
|
|
2036
2036
|
$comparator: !0,
|
|
2037
2037
|
$op: function(i) {
|
|
@@ -2040,7 +2040,7 @@ function No(n, e) {
|
|
|
2040
2040
|
};
|
|
2041
2041
|
}
|
|
2042
2042
|
if (e.hasOwnProperty("$ilike")) {
|
|
2043
|
-
const r =
|
|
2043
|
+
const r = kr(!1, e.$ilike);
|
|
2044
2044
|
return {
|
|
2045
2045
|
$comparator: !0,
|
|
2046
2046
|
$op: function(i) {
|
|
@@ -2074,7 +2074,7 @@ function Wo(n, e, t, r, s, i) {
|
|
|
2074
2074
|
}
|
|
2075
2075
|
function Ko(n, e, t, r, s) {
|
|
2076
2076
|
const [i, o, a] = s.reduce((c, u) => {
|
|
2077
|
-
const [l, f, p] = c, [y, b, _] =
|
|
2077
|
+
const [l, f, p] = c, [y, b, _] = ks(n, e, l, f, u);
|
|
2078
2078
|
return [y, b, [...p, _]];
|
|
2079
2079
|
}, [t, r, []]);
|
|
2080
2080
|
return [i, o, a];
|
|
@@ -2148,13 +2148,13 @@ function Cs(n, e, t, r, s) {
|
|
|
2148
2148
|
}
|
|
2149
2149
|
function Qo(n, e, t, r) {
|
|
2150
2150
|
const s = Vt;
|
|
2151
|
-
return r ? Cs(s, n, e, t, r).concat(
|
|
2151
|
+
return r ? Cs(s, n, e, t, r).concat(Ar(s, n, e, t)) : Ar(s, n, e, t);
|
|
2152
2152
|
}
|
|
2153
2153
|
function Ho(n, e, t) {
|
|
2154
2154
|
return [n(e, t), n("time", t)];
|
|
2155
2155
|
}
|
|
2156
2156
|
function Jo(n, e, t, r, s, i) {
|
|
2157
|
-
const [o, a, c, u, l] =
|
|
2157
|
+
const [o, a, c, u, l] = ks(n, e, t, r, s), f = Fo(c, n(t, r), i);
|
|
2158
2158
|
return [o, a, f, u, l];
|
|
2159
2159
|
}
|
|
2160
2160
|
function Yo(n, e, t, { etype: r, level: s, form: i }, o) {
|
|
@@ -2280,7 +2280,7 @@ function oa(n, e, { etype: t, level: r, form: s, join: i, pageInfo: o }) {
|
|
|
2280
2280
|
dq: { where: a, find: c, fields: u }
|
|
2281
2281
|
}), f = ((b = s.$) == null ? void 0 : b.limit) || ((_ = s.$) == null ? void 0 : _.first) || ((m = s.$) == null ? void 0 : m.last);
|
|
2282
2282
|
if (f != null) {
|
|
2283
|
-
r > 0 &&
|
|
2283
|
+
r > 0 && As && console.warn("WARNING: Limits in child queries are only run client-side. Data returned from the server will not have a limit.");
|
|
2284
2284
|
const S = Object.entries(l);
|
|
2285
2285
|
return S.length <= f ? l : Object.fromEntries(S.slice(0, f));
|
|
2286
2286
|
}
|
|
@@ -2436,11 +2436,11 @@ function ga(n, e, t) {
|
|
|
2436
2436
|
throw new Error(`${t} does not reference a valid link attribute.`);
|
|
2437
2437
|
return s;
|
|
2438
2438
|
}
|
|
2439
|
-
function
|
|
2439
|
+
function An(n) {
|
|
2440
2440
|
return typeof n == "string" && !Kt(n) ? null : typeof n == "string" && Kt(n) ? En(n) : ya(n);
|
|
2441
2441
|
}
|
|
2442
2442
|
function de(n, e, t) {
|
|
2443
|
-
const r =
|
|
2443
|
+
const r = An(t);
|
|
2444
2444
|
if (r === null)
|
|
2445
2445
|
return t;
|
|
2446
2446
|
const [s, i] = r, o = ga(n, e, s);
|
|
@@ -2571,15 +2571,15 @@ function Ea(n, e) {
|
|
|
2571
2571
|
function Oa({ attrsStore: n }, [e, t, r]) {
|
|
2572
2572
|
return [["rule-params", de(n, e, t), e, r]];
|
|
2573
2573
|
}
|
|
2574
|
-
function
|
|
2574
|
+
function Aa(n) {
|
|
2575
2575
|
const [e, t, r, s, i] = n;
|
|
2576
2576
|
if (!s)
|
|
2577
2577
|
return n;
|
|
2578
2578
|
const o = { ...s };
|
|
2579
2579
|
return delete o.id, [e, t, r, o, ...i ? [i] : []];
|
|
2580
2580
|
}
|
|
2581
|
-
function
|
|
2582
|
-
const [t, ...r] =
|
|
2581
|
+
function ka(n, e) {
|
|
2582
|
+
const [t, ...r] = Aa(e);
|
|
2583
2583
|
switch (t) {
|
|
2584
2584
|
case "merge":
|
|
2585
2585
|
return Ea(n, r);
|
|
@@ -2624,7 +2624,7 @@ function Ia(n, e, t) {
|
|
|
2624
2624
|
"checked-data-type": o
|
|
2625
2625
|
};
|
|
2626
2626
|
}
|
|
2627
|
-
function
|
|
2627
|
+
function kt(n, e, t, r) {
|
|
2628
2628
|
const s = n ? Ia(n, e, t) : null, i = N(), a = [N(), e, t];
|
|
2629
2629
|
return {
|
|
2630
2630
|
id: i,
|
|
@@ -2681,20 +2681,20 @@ const Ra = /* @__PURE__ */ new Set(["create", "update", "merge", "link", "unlink
|
|
|
2681
2681
|
"merge",
|
|
2682
2682
|
"delete",
|
|
2683
2683
|
"ruleParams"
|
|
2684
|
-
]),
|
|
2685
|
-
...
|
|
2684
|
+
]), kn = { "unique?": !0, "index?": !0 }, Da = {
|
|
2685
|
+
...kn,
|
|
2686
2686
|
cardinality: "one"
|
|
2687
2687
|
};
|
|
2688
2688
|
function Ua(n) {
|
|
2689
2689
|
const e = [], [t, r, s, i] = n;
|
|
2690
2690
|
if (!$a.has(t))
|
|
2691
2691
|
return e;
|
|
2692
|
-
const o =
|
|
2692
|
+
const o = An(s);
|
|
2693
2693
|
if (o && e.push({ etype: r, lookupPair: o }), t === "link")
|
|
2694
2694
|
for (const [a, c] of Object.entries(i)) {
|
|
2695
2695
|
const u = Array.isArray(c) ? c : [c];
|
|
2696
2696
|
for (const l of u) {
|
|
2697
|
-
const f =
|
|
2697
|
+
const f = An(l);
|
|
2698
2698
|
f && e.push({
|
|
2699
2699
|
etype: r,
|
|
2700
2700
|
lookupPair: f,
|
|
@@ -2743,23 +2743,23 @@ function La({ attrsStore: n, schema: e }, t) {
|
|
|
2743
2743
|
f(v, On(g));
|
|
2744
2744
|
else {
|
|
2745
2745
|
const C = o(v, g);
|
|
2746
|
-
C || c(
|
|
2746
|
+
C || c(kt(e, v, g, kn)), u(C);
|
|
2747
2747
|
}
|
|
2748
2748
|
} else if (l(_, g))
|
|
2749
2749
|
f(_, On(g));
|
|
2750
2750
|
else {
|
|
2751
2751
|
const w = o(_, g);
|
|
2752
|
-
w || c(
|
|
2752
|
+
w || c(kt(e, _, g, kn)), u(w);
|
|
2753
2753
|
}
|
|
2754
2754
|
}
|
|
2755
2755
|
for (const b of t) {
|
|
2756
2756
|
const [_, m, S, g] = b;
|
|
2757
2757
|
if (Ra.has(_)) {
|
|
2758
2758
|
const w = o(m, "id");
|
|
2759
|
-
u(w), w || c(
|
|
2759
|
+
u(w), w || c(kt(e, m, "id", { "unique?": !0 }));
|
|
2760
2760
|
for (const O of Object.keys(g)) {
|
|
2761
2761
|
const v = o(m, O);
|
|
2762
|
-
if (u(v), xa.has(_) && (v || c(
|
|
2762
|
+
if (u(v), xa.has(_) && (v || c(kt(e, m, O, O === "id" ? { "unique?": !0 } : null))), ja.has(_)) {
|
|
2763
2763
|
const C = a(m, O);
|
|
2764
2764
|
!v && !C && c(Pr(e, m, O)), u(C);
|
|
2765
2765
|
}
|
|
@@ -2775,7 +2775,7 @@ function La({ attrsStore: n, schema: e }, t) {
|
|
|
2775
2775
|
return [n, i];
|
|
2776
2776
|
}
|
|
2777
2777
|
function Fa(n, e) {
|
|
2778
|
-
const r = (Array.isArray(e) ? e : [e]).flatMap((c) => ha(c)), [s, i] = La(n, r), o = { ...n, attrsStore: s }, a = r.flatMap((c) =>
|
|
2778
|
+
const r = (Array.isArray(e) ? e : [e]).flatMap((c) => ha(c)), [s, i] = La(n, r), o = { ...n, attrsStore: s }, a = r.flatMap((c) => ka(o, c));
|
|
2779
2779
|
return [...i, ...a];
|
|
2780
2780
|
}
|
|
2781
2781
|
function Mr(n, e) {
|
|
@@ -3486,7 +3486,7 @@ function Lr(n) {
|
|
|
3486
3486
|
}, e;
|
|
3487
3487
|
}, {});
|
|
3488
3488
|
}
|
|
3489
|
-
const Xn = "v0.22.162
|
|
3489
|
+
const Xn = "v0.22.162";
|
|
3490
3490
|
function oc(n, e) {
|
|
3491
3491
|
return {
|
|
3492
3492
|
info: n ? (...t) => console.info(...t, e()) : () => {
|
|
@@ -4393,67 +4393,67 @@ function Ec({ WStream: n, opts: e, startStream: t, appendStream: r, registerStre
|
|
|
4393
4393
|
const g = [], w = new TextEncoder();
|
|
4394
4394
|
function O() {
|
|
4395
4395
|
f = !0;
|
|
4396
|
-
for (const
|
|
4397
|
-
|
|
4396
|
+
for (const A of p)
|
|
4397
|
+
A(a ?? void 0);
|
|
4398
4398
|
}
|
|
4399
|
-
function v(
|
|
4400
|
-
return p.push(
|
|
4401
|
-
const I = p.indexOf(
|
|
4399
|
+
function v(A) {
|
|
4400
|
+
return p.push(A), f && A(a ?? void 0), () => {
|
|
4401
|
+
const I = p.indexOf(A);
|
|
4402
4402
|
I !== -1 && p.splice(I, 1);
|
|
4403
4403
|
};
|
|
4404
4404
|
}
|
|
4405
|
-
function C(
|
|
4406
|
-
return b.push(
|
|
4407
|
-
const I = b.indexOf(
|
|
4405
|
+
function C(A) {
|
|
4406
|
+
return b.push(A), () => {
|
|
4407
|
+
const I = b.indexOf(A);
|
|
4408
4408
|
I !== -1 && b.splice(I, 1);
|
|
4409
4409
|
};
|
|
4410
4410
|
}
|
|
4411
|
-
e.waitUntil && e.waitUntil(new Promise((
|
|
4412
|
-
b.push(
|
|
4411
|
+
e.waitUntil && e.waitUntil(new Promise((A) => {
|
|
4412
|
+
b.push(A);
|
|
4413
4413
|
}));
|
|
4414
4414
|
function j() {
|
|
4415
|
-
for (const
|
|
4415
|
+
for (const A of b)
|
|
4416
4416
|
try {
|
|
4417
|
-
|
|
4417
|
+
A();
|
|
4418
4418
|
} catch {
|
|
4419
4419
|
}
|
|
4420
4420
|
}
|
|
4421
|
-
function U(
|
|
4422
|
-
return y.push(
|
|
4423
|
-
const I = y.indexOf(
|
|
4421
|
+
function U(A) {
|
|
4422
|
+
return y.push(A), o && A(o), () => {
|
|
4423
|
+
const I = y.indexOf(A);
|
|
4424
4424
|
I !== -1 && y.splice(I, 1);
|
|
4425
4425
|
};
|
|
4426
4426
|
}
|
|
4427
|
-
function B(
|
|
4428
|
-
o =
|
|
4427
|
+
function B(A) {
|
|
4428
|
+
o = A;
|
|
4429
4429
|
for (const I of y)
|
|
4430
4430
|
I(o);
|
|
4431
4431
|
}
|
|
4432
4432
|
function ye() {
|
|
4433
4433
|
_ = !0;
|
|
4434
4434
|
}
|
|
4435
|
-
function Re(
|
|
4435
|
+
function Re(A) {
|
|
4436
4436
|
let I = m, H = 0, Y = 0;
|
|
4437
4437
|
for (const { byteLen: ae } of g) {
|
|
4438
4438
|
const _e = I + ae;
|
|
4439
|
-
if (_e >
|
|
4439
|
+
if (_e > A)
|
|
4440
4440
|
break;
|
|
4441
4441
|
I = _e, H++, Y += ae;
|
|
4442
4442
|
}
|
|
4443
4443
|
H > 0 && (m += Y, S -= Y, g.splice(0, H));
|
|
4444
4444
|
}
|
|
4445
|
-
function te(
|
|
4446
|
-
a = I, O(),
|
|
4445
|
+
function te(A, I) {
|
|
4446
|
+
a = I, O(), A.error(I), j();
|
|
4447
4447
|
}
|
|
4448
4448
|
async function oe() {
|
|
4449
|
-
const
|
|
4449
|
+
const A = await t({
|
|
4450
4450
|
clientId: i,
|
|
4451
4451
|
reconnectToken: u,
|
|
4452
4452
|
ruleParams: e.ruleParams
|
|
4453
4453
|
});
|
|
4454
|
-
switch (
|
|
4454
|
+
switch (A.type) {
|
|
4455
4455
|
case "ok": {
|
|
4456
|
-
const { streamId: I, offset: H } =
|
|
4456
|
+
const { streamId: I, offset: H } = A;
|
|
4457
4457
|
o = I, Re(H), g.length && r({
|
|
4458
4458
|
streamId: I,
|
|
4459
4459
|
chunks: g.map((Y) => Y.chunk),
|
|
@@ -4466,7 +4466,7 @@ function Ec({ WStream: n, opts: e, startStream: t, appendStream: r, registerStre
|
|
|
4466
4466
|
break;
|
|
4467
4467
|
}
|
|
4468
4468
|
case "error": {
|
|
4469
|
-
c && te(c,
|
|
4469
|
+
c && te(c, A.error);
|
|
4470
4470
|
break;
|
|
4471
4471
|
}
|
|
4472
4472
|
}
|
|
@@ -4474,14 +4474,14 @@ function Ec({ WStream: n, opts: e, startStream: t, appendStream: r, registerStre
|
|
|
4474
4474
|
function W() {
|
|
4475
4475
|
ye(), oe();
|
|
4476
4476
|
}
|
|
4477
|
-
function Q({ offset:
|
|
4478
|
-
Re(
|
|
4477
|
+
function Q({ offset: A, done: I }) {
|
|
4478
|
+
Re(A), I && (l = !0, j());
|
|
4479
4479
|
}
|
|
4480
|
-
function ee(
|
|
4481
|
-
return l ? (te(
|
|
4480
|
+
function ee(A) {
|
|
4481
|
+
return l ? (te(A, new se("Stream has been closed.")), null) : o || (te(A, new se("Stream has not been initialized.")), null);
|
|
4482
4482
|
}
|
|
4483
|
-
async function
|
|
4484
|
-
c =
|
|
4483
|
+
async function Ae(A) {
|
|
4484
|
+
c = A;
|
|
4485
4485
|
let I = !0, H = 0;
|
|
4486
4486
|
for (; I; ) {
|
|
4487
4487
|
let Y = Date.now() + Math.min(15e3, 500 * (H - 1));
|
|
@@ -4496,7 +4496,7 @@ function Ec({ WStream: n, opts: e, startStream: t, appendStream: r, registerStre
|
|
|
4496
4496
|
const { streamId: _e, offset: rt } = ae;
|
|
4497
4497
|
if (rt !== 0) {
|
|
4498
4498
|
const me = new se("Write stream is corrupted");
|
|
4499
|
-
te(
|
|
4499
|
+
te(A, me);
|
|
4500
4500
|
return;
|
|
4501
4501
|
}
|
|
4502
4502
|
B(_e), s(_e, {
|
|
@@ -4514,7 +4514,7 @@ function Ec({ WStream: n, opts: e, startStream: t, appendStream: r, registerStre
|
|
|
4514
4514
|
break;
|
|
4515
4515
|
}
|
|
4516
4516
|
case "error": {
|
|
4517
|
-
te(
|
|
4517
|
+
te(A, ae.error);
|
|
4518
4518
|
return;
|
|
4519
4519
|
}
|
|
4520
4520
|
}
|
|
@@ -4542,20 +4542,20 @@ function Ec({ WStream: n, opts: e, startStream: t, appendStream: r, registerStre
|
|
|
4542
4542
|
stream: new Tt({
|
|
4543
4543
|
// TODO(dww): accept a storage so that write streams can survive across
|
|
4544
4544
|
// browser restarts
|
|
4545
|
-
async start(
|
|
4545
|
+
async start(A) {
|
|
4546
4546
|
try {
|
|
4547
|
-
await
|
|
4547
|
+
await Ae(A);
|
|
4548
4548
|
} catch (I) {
|
|
4549
|
-
te(
|
|
4549
|
+
te(A, I);
|
|
4550
4550
|
}
|
|
4551
4551
|
},
|
|
4552
|
-
write(
|
|
4552
|
+
write(A, I) {
|
|
4553
4553
|
const H = ee(I);
|
|
4554
4554
|
if (H) {
|
|
4555
|
-
const Y = w.encode(
|
|
4556
|
-
g.push({ chunk:
|
|
4555
|
+
const Y = w.encode(A).length;
|
|
4556
|
+
g.push({ chunk: A, byteLen: Y });
|
|
4557
4557
|
const ae = m + S;
|
|
4558
|
-
S += Y, _ || r({ streamId: H, chunks: [
|
|
4558
|
+
S += Y, _ || r({ streamId: H, chunks: [A], offset: ae });
|
|
4559
4559
|
}
|
|
4560
4560
|
},
|
|
4561
4561
|
close() {
|
|
@@ -4566,13 +4566,13 @@ function Ec({ WStream: n, opts: e, startStream: t, appendStream: r, registerStre
|
|
|
4566
4566
|
isDone: !0
|
|
4567
4567
|
}) : j(), O();
|
|
4568
4568
|
},
|
|
4569
|
-
abort(
|
|
4569
|
+
abort(A) {
|
|
4570
4570
|
o ? r({
|
|
4571
4571
|
streamId: o,
|
|
4572
4572
|
chunks: [],
|
|
4573
4573
|
offset: m + S,
|
|
4574
4574
|
isDone: !0,
|
|
4575
|
-
abortReason:
|
|
4575
|
+
abortReason: A
|
|
4576
4576
|
}) : j(), O();
|
|
4577
4577
|
}
|
|
4578
4578
|
}),
|
|
@@ -4616,7 +4616,7 @@ class Oc {
|
|
|
4616
4616
|
}
|
|
4617
4617
|
}
|
|
4618
4618
|
}
|
|
4619
|
-
function
|
|
4619
|
+
function Ac({ RStream: n, opts: e, startStream: t, cancelStream: r }) {
|
|
4620
4620
|
let s = e.byteOffset || 0, i = !1;
|
|
4621
4621
|
const o = new TextDecoder("utf-8"), a = new TextEncoder();
|
|
4622
4622
|
let c, u = !1;
|
|
@@ -4682,8 +4682,8 @@ function kc({ RStream: n, opts: e, startStream: t, cancelStream: r }) {
|
|
|
4682
4682
|
if (C > 0 && (ee = Q.subarray(C), C -= Q.length - ee.length), !ee.length)
|
|
4683
4683
|
continue;
|
|
4684
4684
|
s += ee.length;
|
|
4685
|
-
const
|
|
4686
|
-
w.enqueue(
|
|
4685
|
+
const Ae = o.decode(ee);
|
|
4686
|
+
w.enqueue(Ae);
|
|
4687
4687
|
}
|
|
4688
4688
|
} finally {
|
|
4689
4689
|
oe.releaseLock();
|
|
@@ -4742,7 +4742,7 @@ function kc({ RStream: n, opts: e, startStream: t, cancelStream: r }) {
|
|
|
4742
4742
|
}
|
|
4743
4743
|
};
|
|
4744
4744
|
}
|
|
4745
|
-
class
|
|
4745
|
+
class kc {
|
|
4746
4746
|
constructor({ WStream: e, RStream: t, trySend: r, log: s }) {
|
|
4747
4747
|
h(this, "trySend");
|
|
4748
4748
|
h(this, "WStream");
|
|
@@ -4767,7 +4767,7 @@ class Ac {
|
|
|
4767
4767
|
}), t;
|
|
4768
4768
|
}
|
|
4769
4769
|
createReadStream(e) {
|
|
4770
|
-
const { stream: t, addCloseCb: r } =
|
|
4770
|
+
const { stream: t, addCloseCb: r } = Ac({
|
|
4771
4771
|
RStream: this.RStream,
|
|
4772
4772
|
opts: e,
|
|
4773
4773
|
startStream: this.startReadStream.bind(this),
|
|
@@ -5214,7 +5214,7 @@ class Nc {
|
|
|
5214
5214
|
}
|
|
5215
5215
|
})), this._initStorage(t), this._syncTable = new vc(this._trySendAuthed.bind(this), new t(this.config.appId, "syncSubs"), {
|
|
5216
5216
|
useDateObjects: this.config.useDateObjects
|
|
5217
|
-
}, this._log, (o) => ut(this.ensureAttrs(), o, this.config.enableCardinalityInference, this.config.useDateObjects), () => this.ensureAttrs()), this._instantStream = new
|
|
5217
|
+
}, this._log, (o) => ut(this.ensureAttrs(), o, this.config.enableCardinalityInference, this.config.useDateObjects), () => this.ensureAttrs()), this._instantStream = new kc({
|
|
5218
5218
|
WStream: this.config.WritableStream || WritableStream,
|
|
5219
5219
|
RStream: this.config.ReadableStream || ReadableStream,
|
|
5220
5220
|
trySend: this._trySendAuthed.bind(this),
|
|
@@ -5437,8 +5437,8 @@ class Nc {
|
|
|
5437
5437
|
w.pendingMutations = m;
|
|
5438
5438
|
});
|
|
5439
5439
|
const S = ln(m.entries()), g = y.map((w) => {
|
|
5440
|
-
var W, Q, ee,
|
|
5441
|
-
const O = w["instaql-query"], v = w["instaql-result"], C = J(O), j = Ur(v), U = this.ensureAttrs(), B = ut(U, j, r, this.config.useDateObjects), { store: ye, attrsStore: Re } = this._applyOptimisticUpdates(B, U, S, _), te = (Q = (W = v == null ? void 0 : v[0]) == null ? void 0 : W.data) == null ? void 0 : Q["page-info"], oe = (
|
|
5440
|
+
var W, Q, ee, Ae;
|
|
5441
|
+
const O = w["instaql-query"], v = w["instaql-result"], C = J(O), j = Ur(v), U = this.ensureAttrs(), B = ut(U, j, r, this.config.useDateObjects), { store: ye, attrsStore: Re } = this._applyOptimisticUpdates(B, U, S, _), te = (Q = (W = v == null ? void 0 : v[0]) == null ? void 0 : W.data) == null ? void 0 : Q["page-info"], oe = (Ae = (ee = v == null ? void 0 : v[0]) == null ? void 0 : ee.data) == null ? void 0 : Ae.aggregate;
|
|
5442
5442
|
return {
|
|
5443
5443
|
q: O,
|
|
5444
5444
|
hash: C,
|
|
@@ -7142,14 +7142,14 @@ function bu() {
|
|
|
7142
7142
|
var g = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
7143
7143
|
function w(d) {
|
|
7144
7144
|
{
|
|
7145
|
-
for (var T = arguments.length, E = new Array(T > 1 ? T - 1 : 0),
|
|
7146
|
-
E[
|
|
7145
|
+
for (var T = arguments.length, E = new Array(T > 1 ? T - 1 : 0), k = 1; k < T; k++)
|
|
7146
|
+
E[k - 1] = arguments[k];
|
|
7147
7147
|
O("error", d, E);
|
|
7148
7148
|
}
|
|
7149
7149
|
}
|
|
7150
7150
|
function O(d, T, E) {
|
|
7151
7151
|
{
|
|
7152
|
-
var
|
|
7152
|
+
var k = g.ReactDebugCurrentFrame, $ = k.getStackAddendum();
|
|
7153
7153
|
$ !== "" && (T += "%s", E = E.concat([$]));
|
|
7154
7154
|
var D = E.map(function(x) {
|
|
7155
7155
|
return String(x);
|
|
@@ -7167,9 +7167,9 @@ function bu() {
|
|
|
7167
7167
|
d.$$typeof === ye || d.getModuleId !== void 0));
|
|
7168
7168
|
}
|
|
7169
7169
|
function te(d, T, E) {
|
|
7170
|
-
var
|
|
7171
|
-
if (
|
|
7172
|
-
return
|
|
7170
|
+
var k = d.displayName;
|
|
7171
|
+
if (k)
|
|
7172
|
+
return k;
|
|
7173
7173
|
var $ = T.displayName || T.name || "";
|
|
7174
7174
|
return $ !== "" ? E + "(" + $ + ")" : E;
|
|
7175
7175
|
}
|
|
@@ -7208,8 +7208,8 @@ function bu() {
|
|
|
7208
7208
|
case u:
|
|
7209
7209
|
return te(d, d.render, "ForwardRef");
|
|
7210
7210
|
case p:
|
|
7211
|
-
var
|
|
7212
|
-
return
|
|
7211
|
+
var k = d.displayName || null;
|
|
7212
|
+
return k !== null ? k : W(d.type) || "Memo";
|
|
7213
7213
|
case y: {
|
|
7214
7214
|
var $ = d, D = $._payload, x = $._init;
|
|
7215
7215
|
try {
|
|
@@ -7221,14 +7221,14 @@ function bu() {
|
|
|
7221
7221
|
}
|
|
7222
7222
|
return null;
|
|
7223
7223
|
}
|
|
7224
|
-
var Q = Object.assign, ee = 0,
|
|
7224
|
+
var Q = Object.assign, ee = 0, Ae, Tt, Ht, A, I, H, Y;
|
|
7225
7225
|
function ae() {
|
|
7226
7226
|
}
|
|
7227
7227
|
ae.__reactDisabledLog = !0;
|
|
7228
7228
|
function _e() {
|
|
7229
7229
|
{
|
|
7230
7230
|
if (ee === 0) {
|
|
7231
|
-
|
|
7231
|
+
Ae = console.log, Tt = console.info, Ht = console.warn, A = console.error, I = console.group, H = console.groupCollapsed, Y = console.groupEnd;
|
|
7232
7232
|
var d = {
|
|
7233
7233
|
configurable: !0,
|
|
7234
7234
|
enumerable: !0,
|
|
@@ -7258,7 +7258,7 @@ function bu() {
|
|
|
7258
7258
|
};
|
|
7259
7259
|
Object.defineProperties(console, {
|
|
7260
7260
|
log: Q({}, d, {
|
|
7261
|
-
value:
|
|
7261
|
+
value: Ae
|
|
7262
7262
|
}),
|
|
7263
7263
|
info: Q({}, d, {
|
|
7264
7264
|
value: Tt
|
|
@@ -7267,7 +7267,7 @@ function bu() {
|
|
|
7267
7267
|
value: Ht
|
|
7268
7268
|
}),
|
|
7269
7269
|
error: Q({}, d, {
|
|
7270
|
-
value:
|
|
7270
|
+
value: A
|
|
7271
7271
|
}),
|
|
7272
7272
|
group: Q({}, d, {
|
|
7273
7273
|
value: I
|
|
@@ -7290,8 +7290,8 @@ function bu() {
|
|
|
7290
7290
|
try {
|
|
7291
7291
|
throw Error();
|
|
7292
7292
|
} catch ($) {
|
|
7293
|
-
var
|
|
7294
|
-
Jt =
|
|
7293
|
+
var k = $.stack.trim().match(/\n( *(at )?)/);
|
|
7294
|
+
Jt = k && k[1] || "";
|
|
7295
7295
|
}
|
|
7296
7296
|
return `
|
|
7297
7297
|
` + Jt + d;
|
|
@@ -7310,7 +7310,7 @@ function bu() {
|
|
|
7310
7310
|
if (E !== void 0)
|
|
7311
7311
|
return E;
|
|
7312
7312
|
}
|
|
7313
|
-
var
|
|
7313
|
+
var k;
|
|
7314
7314
|
Yt = !0;
|
|
7315
7315
|
var $ = Error.prepareStackTrace;
|
|
7316
7316
|
Error.prepareStackTrace = void 0;
|
|
@@ -7329,14 +7329,14 @@ function bu() {
|
|
|
7329
7329
|
try {
|
|
7330
7330
|
Reflect.construct(x, []);
|
|
7331
7331
|
} catch (ce) {
|
|
7332
|
-
|
|
7332
|
+
k = ce;
|
|
7333
7333
|
}
|
|
7334
7334
|
Reflect.construct(d, [], x);
|
|
7335
7335
|
} else {
|
|
7336
7336
|
try {
|
|
7337
7337
|
x.call();
|
|
7338
7338
|
} catch (ce) {
|
|
7339
|
-
|
|
7339
|
+
k = ce;
|
|
7340
7340
|
}
|
|
7341
7341
|
d.call(x.prototype);
|
|
7342
7342
|
}
|
|
@@ -7344,14 +7344,14 @@ function bu() {
|
|
|
7344
7344
|
try {
|
|
7345
7345
|
throw Error();
|
|
7346
7346
|
} catch (ce) {
|
|
7347
|
-
|
|
7347
|
+
k = ce;
|
|
7348
7348
|
}
|
|
7349
7349
|
d();
|
|
7350
7350
|
}
|
|
7351
7351
|
} catch (ce) {
|
|
7352
|
-
if (ce &&
|
|
7352
|
+
if (ce && k && typeof ce.stack == "string") {
|
|
7353
7353
|
for (var M = ce.stack.split(`
|
|
7354
|
-
`), ne =
|
|
7354
|
+
`), ne = k.stack.split(`
|
|
7355
7355
|
`), K = M.length - 1, z = ne.length - 1; K >= 1 && z >= 0 && M[K] !== ne[z]; )
|
|
7356
7356
|
z--;
|
|
7357
7357
|
for (; K >= 1 && z >= 0; K--, z--)
|
|
@@ -7400,7 +7400,7 @@ function bu() {
|
|
|
7400
7400
|
case p:
|
|
7401
7401
|
return Et(d.type, T, E);
|
|
7402
7402
|
case y: {
|
|
7403
|
-
var
|
|
7403
|
+
var k = d, $ = k._payload, D = k._init;
|
|
7404
7404
|
try {
|
|
7405
7405
|
return Et(D($), T, E);
|
|
7406
7406
|
} catch {
|
|
@@ -7417,7 +7417,7 @@ function bu() {
|
|
|
7417
7417
|
} else
|
|
7418
7418
|
rr.setExtraStackFrame(null);
|
|
7419
7419
|
}
|
|
7420
|
-
function Ys(d, T, E,
|
|
7420
|
+
function Ys(d, T, E, k, $) {
|
|
7421
7421
|
{
|
|
7422
7422
|
var D = Function.call.bind(st);
|
|
7423
7423
|
for (var x in d)
|
|
@@ -7425,14 +7425,14 @@ function bu() {
|
|
|
7425
7425
|
var M = void 0;
|
|
7426
7426
|
try {
|
|
7427
7427
|
if (typeof d[x] != "function") {
|
|
7428
|
-
var ne = Error((
|
|
7428
|
+
var ne = Error((k || "React class") + ": " + E + " type `" + x + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof d[x] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
7429
7429
|
throw ne.name = "Invariant Violation", ne;
|
|
7430
7430
|
}
|
|
7431
|
-
M = d[x](T, x,
|
|
7431
|
+
M = d[x](T, x, k, E, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
7432
7432
|
} catch (K) {
|
|
7433
7433
|
M = K;
|
|
7434
7434
|
}
|
|
7435
|
-
M && !(M instanceof Error) && (Ot($), w("%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).",
|
|
7435
|
+
M && !(M instanceof Error) && (Ot($), w("%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).", k || "React class", E, x, typeof M), Ot(null)), M instanceof Error && !(M.message in nr) && (nr[M.message] = !0, Ot($), w("Failed %s type: %s", E, M.message), Ot(null));
|
|
7436
7436
|
}
|
|
7437
7437
|
}
|
|
7438
7438
|
}
|
|
@@ -7507,7 +7507,7 @@ function bu() {
|
|
|
7507
7507
|
});
|
|
7508
7508
|
}
|
|
7509
7509
|
}
|
|
7510
|
-
var ai = function(d, T, E,
|
|
7510
|
+
var ai = function(d, T, E, k, $, D, x) {
|
|
7511
7511
|
var M = {
|
|
7512
7512
|
// This tag allows us to uniquely identify this as a React Element
|
|
7513
7513
|
$$typeof: t,
|
|
@@ -7528,7 +7528,7 @@ function bu() {
|
|
|
7528
7528
|
configurable: !1,
|
|
7529
7529
|
enumerable: !1,
|
|
7530
7530
|
writable: !1,
|
|
7531
|
-
value:
|
|
7531
|
+
value: k
|
|
7532
7532
|
}), Object.defineProperty(M, "_source", {
|
|
7533
7533
|
configurable: !1,
|
|
7534
7534
|
enumerable: !1,
|
|
@@ -7536,7 +7536,7 @@ function bu() {
|
|
|
7536
7536
|
value: $
|
|
7537
7537
|
}), Object.freeze && (Object.freeze(M.props), Object.freeze(M)), M;
|
|
7538
7538
|
};
|
|
7539
|
-
function ci(d, T, E,
|
|
7539
|
+
function ci(d, T, E, k, $) {
|
|
7540
7540
|
{
|
|
7541
7541
|
var D, x = {}, M = null, ne = null;
|
|
7542
7542
|
E !== void 0 && (ir(E), M = "" + E), ri(T) && (ir(T.key), M = "" + T.key), ni(T) && (ne = T.ref, si(T, $));
|
|
@@ -7551,7 +7551,7 @@ function bu() {
|
|
|
7551
7551
|
var z = typeof d == "function" ? d.displayName || d.name || "Unknown" : d;
|
|
7552
7552
|
M && ii(x, z), ne && oi(x, z);
|
|
7553
7553
|
}
|
|
7554
|
-
return ai(d, M, ne, $,
|
|
7554
|
+
return ai(d, M, ne, $, k, or.current, x);
|
|
7555
7555
|
}
|
|
7556
7556
|
}
|
|
7557
7557
|
var Xt = g.ReactCurrentOwner, ur = g.ReactDebugCurrentFrame;
|
|
@@ -7604,8 +7604,8 @@ Check the top-level render call using <` + E + ">.");
|
|
|
7604
7604
|
if (fr[E])
|
|
7605
7605
|
return;
|
|
7606
7606
|
fr[E] = !0;
|
|
7607
|
-
var
|
|
7608
|
-
d && d._owner && d._owner !== Xt.current && (
|
|
7607
|
+
var k = "";
|
|
7608
|
+
d && d._owner && d._owner !== Xt.current && (k = " It was passed a child from " + W(d._owner.type) + "."), qe(d), w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', E, k), qe(null);
|
|
7609
7609
|
}
|
|
7610
7610
|
}
|
|
7611
7611
|
function hr(d, T) {
|
|
@@ -7614,8 +7614,8 @@ Check the top-level render call using <` + E + ">.");
|
|
|
7614
7614
|
return;
|
|
7615
7615
|
if (Zt(d))
|
|
7616
7616
|
for (var E = 0; E < d.length; E++) {
|
|
7617
|
-
var
|
|
7618
|
-
tn(
|
|
7617
|
+
var k = d[E];
|
|
7618
|
+
tn(k) && dr(k, T);
|
|
7619
7619
|
}
|
|
7620
7620
|
else if (tn(d))
|
|
7621
7621
|
d._store && (d._store.validated = !0);
|
|
@@ -7642,8 +7642,8 @@ Check the top-level render call using <` + E + ">.");
|
|
|
7642
7642
|
else
|
|
7643
7643
|
return;
|
|
7644
7644
|
if (E) {
|
|
7645
|
-
var
|
|
7646
|
-
Ys(E, d.props, "prop",
|
|
7645
|
+
var k = W(T);
|
|
7646
|
+
Ys(E, d.props, "prop", k, d);
|
|
7647
7647
|
} else if (T.PropTypes !== void 0 && !en) {
|
|
7648
7648
|
en = !0;
|
|
7649
7649
|
var $ = W(T);
|
|
@@ -7655,9 +7655,9 @@ Check the top-level render call using <` + E + ">.");
|
|
|
7655
7655
|
function di(d) {
|
|
7656
7656
|
{
|
|
7657
7657
|
for (var T = Object.keys(d.props), E = 0; E < T.length; E++) {
|
|
7658
|
-
var
|
|
7659
|
-
if (
|
|
7660
|
-
qe(d), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",
|
|
7658
|
+
var k = T[E];
|
|
7659
|
+
if (k !== "children" && k !== "key") {
|
|
7660
|
+
qe(d), w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", k), qe(null);
|
|
7661
7661
|
break;
|
|
7662
7662
|
}
|
|
7663
7663
|
}
|
|
@@ -7665,7 +7665,7 @@ Check the top-level render call using <` + E + ">.");
|
|
|
7665
7665
|
}
|
|
7666
7666
|
}
|
|
7667
7667
|
var pr = {};
|
|
7668
|
-
function yr(d, T, E,
|
|
7668
|
+
function yr(d, T, E, k, $, D) {
|
|
7669
7669
|
{
|
|
7670
7670
|
var x = Re(d);
|
|
7671
7671
|
if (!x) {
|
|
@@ -7682,7 +7682,7 @@ Check the top-level render call using <` + E + ">.");
|
|
|
7682
7682
|
if (x) {
|
|
7683
7683
|
var be = T.children;
|
|
7684
7684
|
if (be !== void 0)
|
|
7685
|
-
if (
|
|
7685
|
+
if (k)
|
|
7686
7686
|
if (Zt(be)) {
|
|
7687
7687
|
for (var ze = 0; ze < be.length; ze++)
|
|
7688
7688
|
hr(be[ze], d);
|
|
@@ -7808,7 +7808,7 @@ function Eu(n, e = {}) {
|
|
|
7808
7808
|
function Ou(n, e, t) {
|
|
7809
7809
|
Fe(() => n.core._reactor.joinRoom(n.type, n.id, e), [n.id]), Fe(() => n.core._reactor.publishPresence(n.type, n.id, e), [n.type, n.id, t ?? JSON.stringify(e)]);
|
|
7810
7810
|
}
|
|
7811
|
-
function
|
|
7811
|
+
function Au(n, e, t = {}) {
|
|
7812
7812
|
const r = wu(), s = $e.usePresence(n, {
|
|
7813
7813
|
keys: [e]
|
|
7814
7814
|
}), i = hn(() => {
|
|
@@ -7839,9 +7839,9 @@ const $e = {
|
|
|
7839
7839
|
usePublishTopic: vu,
|
|
7840
7840
|
usePresence: Eu,
|
|
7841
7841
|
useSyncPresence: Ou,
|
|
7842
|
-
useTypingIndicator:
|
|
7842
|
+
useTypingIndicator: Au
|
|
7843
7843
|
};
|
|
7844
|
-
class
|
|
7844
|
+
class ku {
|
|
7845
7845
|
constructor(e, t, r) {
|
|
7846
7846
|
h(this, "core");
|
|
7847
7847
|
/** @deprecated use `core` instead */
|
|
@@ -8181,7 +8181,7 @@ class $t {
|
|
|
8181
8181
|
* const { peers } = db.rooms.usePresence(room);
|
|
8182
8182
|
*/
|
|
8183
8183
|
room(e = "_defaultRoomType", t = "_defaultRoomId") {
|
|
8184
|
-
return new
|
|
8184
|
+
return new ku(this.core, e, t);
|
|
8185
8185
|
}
|
|
8186
8186
|
_useAuth() {
|
|
8187
8187
|
const e = Xe(this.core._reactor._currentUserCached), t = Me((s) => this.core.subscribeAuth((o) => {
|
|
@@ -8366,7 +8366,7 @@ function es(n) {
|
|
|
8366
8366
|
}
|
|
8367
8367
|
var Bs = (n) => {
|
|
8368
8368
|
throw TypeError(n);
|
|
8369
|
-
}, er = (n, e, t) => e.has(n) || Bs("Cannot " + t), P = (n, e, t) => (er(n, e, "read from private field"), t ? t.call(n) : e.get(n)), G = (n, e, t) => e.has(n) ? Bs("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), F = (n, e, t, r) => (er(n, e, "write to private field"), e.set(n, t), t),
|
|
8369
|
+
}, er = (n, e, t) => e.has(n) || Bs("Cannot " + t), P = (n, e, t) => (er(n, e, "read from private field"), t ? t.call(n) : e.get(n)), G = (n, e, t) => e.has(n) ? Bs("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(n) : e.set(n, t), F = (n, e, t, r) => (er(n, e, "write to private field"), e.set(n, t), t), ke = (n, e, t) => (er(n, e, "access private method"), t), ue, De, Ge, Dt, qt, bt, Je, gt, Pe, Qe, Ze, He, ft, we, jn, xn, $n, ts, Dn, Un, dt, Ln, Fn;
|
|
8370
8370
|
class Ut extends EventTarget {
|
|
8371
8371
|
constructor(e, t) {
|
|
8372
8372
|
var r, s;
|
|
@@ -8375,15 +8375,15 @@ class Ut extends EventTarget {
|
|
|
8375
8375
|
P(this, Qe).reset();
|
|
8376
8376
|
const { body: a, redirected: c, status: u, headers: l } = i;
|
|
8377
8377
|
if (u === 204) {
|
|
8378
|
-
|
|
8378
|
+
ke(this, we, dt).call(this, "Server sent HTTP 204, not reconnecting", 204), this.close();
|
|
8379
8379
|
return;
|
|
8380
8380
|
}
|
|
8381
8381
|
if (c ? F(this, Ge, new URL(i.url)) : F(this, Ge, void 0), u !== 200) {
|
|
8382
|
-
|
|
8382
|
+
ke(this, we, dt).call(this, `Non-200 status code (${u})`, u);
|
|
8383
8383
|
return;
|
|
8384
8384
|
}
|
|
8385
8385
|
if (!(l.get("content-type") || "").startsWith("text/event-stream")) {
|
|
8386
|
-
|
|
8386
|
+
ke(this, we, dt).call(this, 'Invalid content type, expected "text/event-stream"', u);
|
|
8387
8387
|
return;
|
|
8388
8388
|
}
|
|
8389
8389
|
if (P(this, ue) === this.CLOSED)
|
|
@@ -8391,17 +8391,17 @@ class Ut extends EventTarget {
|
|
|
8391
8391
|
F(this, ue, this.OPEN);
|
|
8392
8392
|
const f = new Event("open");
|
|
8393
8393
|
if ((o = P(this, ft)) == null || o.call(this, f), this.dispatchEvent(f), typeof a != "object" || !a || !("getReader" in a)) {
|
|
8394
|
-
|
|
8394
|
+
ke(this, we, dt).call(this, "Invalid response body, expected a web ReadableStream", u), this.close();
|
|
8395
8395
|
return;
|
|
8396
8396
|
}
|
|
8397
8397
|
const p = new TextDecoder(), y = a.getReader();
|
|
8398
8398
|
let b = !0;
|
|
8399
8399
|
do {
|
|
8400
8400
|
const { done: _, value: m } = await y.read();
|
|
8401
|
-
m && P(this, Qe).feed(p.decode(m, { stream: !_ })), _ && (b = !1, P(this, Qe).reset(),
|
|
8401
|
+
m && P(this, Qe).feed(p.decode(m, { stream: !_ })), _ && (b = !1, P(this, Qe).reset(), ke(this, we, Ln).call(this));
|
|
8402
8402
|
} while (b);
|
|
8403
8403
|
}), G(this, $n, (i) => {
|
|
8404
|
-
F(this, Pe, void 0), !(i.name === "AbortError" || i.type === "aborted") &&
|
|
8404
|
+
F(this, Pe, void 0), !(i.name === "AbortError" || i.type === "aborted") && ke(this, we, Ln).call(this, Rn(i));
|
|
8405
8405
|
}), G(this, Dn, (i) => {
|
|
8406
8406
|
typeof i.id == "string" && F(this, gt, i.id);
|
|
8407
8407
|
const o = new MessageEvent(i.event || "message", {
|
|
@@ -8413,7 +8413,7 @@ class Ut extends EventTarget {
|
|
|
8413
8413
|
}), G(this, Un, (i) => {
|
|
8414
8414
|
F(this, bt, i);
|
|
8415
8415
|
}), G(this, Fn, () => {
|
|
8416
|
-
F(this, Je, void 0), P(this, ue) === this.CONNECTING &&
|
|
8416
|
+
F(this, Je, void 0), P(this, ue) === this.CONNECTING && ke(this, we, jn).call(this);
|
|
8417
8417
|
});
|
|
8418
8418
|
try {
|
|
8419
8419
|
if (e instanceof URL)
|
|
@@ -8428,7 +8428,7 @@ class Ut extends EventTarget {
|
|
|
8428
8428
|
F(this, Qe, Iu({
|
|
8429
8429
|
onEvent: P(this, Dn),
|
|
8430
8430
|
onRetry: P(this, Un)
|
|
8431
|
-
})), F(this, ue, this.CONNECTING), F(this, bt, 3e3), F(this, qt, (r = t == null ? void 0 : t.fetch) != null ? r : globalThis.fetch), F(this, Dt, (s = t == null ? void 0 : t.withCredentials) != null ? s : !1),
|
|
8431
|
+
})), F(this, ue, this.CONNECTING), F(this, bt, 3e3), F(this, qt, (r = t == null ? void 0 : t.fetch) != null ? r : globalThis.fetch), F(this, Dt, (s = t == null ? void 0 : t.withCredentials) != null ? s : !1), ke(this, we, jn).call(this);
|
|
8432
8432
|
}
|
|
8433
8433
|
/**
|
|
8434
8434
|
* Returns the state of this EventSource object's connection. It can have the values described below.
|
|
@@ -8507,7 +8507,7 @@ ue = /* @__PURE__ */ new WeakMap(), De = /* @__PURE__ */ new WeakMap(), Ge = /*
|
|
|
8507
8507
|
* @internal
|
|
8508
8508
|
*/
|
|
8509
8509
|
jn = function() {
|
|
8510
|
-
F(this, ue, this.CONNECTING), F(this, Pe, new AbortController()), P(this, qt)(P(this, De),
|
|
8510
|
+
F(this, ue, this.CONNECTING), F(this, Pe, new AbortController()), P(this, qt)(P(this, De), ke(this, we, ts).call(this)).then(P(this, xn)).catch(P(this, $n));
|
|
8511
8511
|
}, xn = /* @__PURE__ */ new WeakMap(), $n = /* @__PURE__ */ new WeakMap(), /**
|
|
8512
8512
|
* Get request options for the `fetch()` request
|
|
8513
8513
|
*
|