@instantdb/react 1.0.63-branch-codex-indexeddb-explicit-commit.31419272329.1 → 1.0.63-branch-codex-indexeddb-explicit-commit.31419410889.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.
@@ -792,11 +792,11 @@ function er(n) {
792
792
  l.finalities.draft.push((f, d) => {
793
793
  var b, y;
794
794
  const g = L(c);
795
- let m = l.type === 3 ? l.setMap : l.copy;
796
- const S = xe(m, r), _ = L(S);
797
- if (_) {
798
- let w = _.original;
799
- _.operated && (w = Yn(S)), vn(_), En(_, Ot, f, d), l.options.enableAutoFreeze && (l.options.updatedValues = (b = l.options.updatedValues) !== null && b !== void 0 ? b : /* @__PURE__ */ new WeakMap(), l.options.updatedValues.set(w, _.original)), At(m, r, w);
795
+ let _ = l.type === 3 ? l.setMap : l.copy;
796
+ const S = xe(_, r), m = L(S);
797
+ if (m) {
798
+ let w = m.original;
799
+ m.operated && (w = Yn(S)), vn(m), En(m, Ot, f, d), l.options.enableAutoFreeze && (l.options.updatedValues = (b = l.options.updatedValues) !== null && b !== void 0 ? b : /* @__PURE__ */ new WeakMap(), l.options.updatedValues.set(w, m.original)), At(_, r, w);
800
800
  }
801
801
  (y = g.callbacks) === null || y === void 0 || y.forEach((w) => {
802
802
  w(f, d);
@@ -918,19 +918,19 @@ const Ji = (n) => function e(t, r, s) {
918
918
  if (R)
919
919
  return R;
920
920
  }
921
- } : l.mark, b = (i = l.enablePatches) !== null && i !== void 0 ? i : !1, y = (o = l.strict) !== null && o !== void 0 ? o : !1, m = {
921
+ } : l.mark, b = (i = l.enablePatches) !== null && i !== void 0 ? i : !1, y = (o = l.strict) !== null && o !== void 0 ? o : !1, _ = {
922
922
  enableAutoFreeze: (a = l.enableAutoFreeze) !== null && a !== void 0 ? a : !1,
923
923
  mark: d,
924
924
  strict: y,
925
925
  enablePatches: b
926
926
  };
927
- if (!Ae(f, m) && typeof f == "object" && f !== null)
927
+ if (!Ae(f, _) && typeof f == "object" && f !== null)
928
928
  throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
929
- const [S, _] = Hi(f, m);
929
+ const [S, m] = Hi(f, _);
930
930
  if (typeof r != "function") {
931
- if (!Ae(f, m))
931
+ if (!Ae(f, _))
932
932
  throw new Error("Invalid base state: create() only supports plain objects, arrays, Set, Map or using mark() to mark the state as immutable.");
933
- return [S, _];
933
+ return [S, m];
934
934
  }
935
935
  let w;
936
936
  try {
@@ -946,24 +946,24 @@ const Ji = (n) => function e(t, r, s) {
946
946
  const R = O == null ? void 0 : O[Li];
947
947
  if (R) {
948
948
  const H = R[0];
949
- return m.strict && typeof O == "object" && O !== null && An({
949
+ return _.strict && typeof O == "object" && O !== null && An({
950
950
  rootDraft: M,
951
951
  value: O,
952
952
  useRawReturn: !0
953
- }), _([H]);
953
+ }), m([H]);
954
954
  }
955
955
  if (O !== void 0)
956
- return typeof O == "object" && O !== null && An({ rootDraft: M, value: O }), _([O]);
956
+ return typeof O == "object" && O !== null && An({ rootDraft: M, value: O }), m([O]);
957
957
  }
958
958
  if (O === S || O === void 0)
959
- return _([]);
959
+ return m([]);
960
960
  const I = L(O);
961
- if (m === I.options) {
961
+ if (_ === I.options) {
962
962
  if (I.operated)
963
963
  throw new Error("Cannot return a modified child draft.");
964
- return _([kr(O)]);
964
+ return m([kr(O)]);
965
965
  }
966
- return _([O]);
966
+ return m([O]);
967
967
  };
968
968
  return w instanceof Promise ? w.then(A, (O) => {
969
969
  throw Tn(L(S)), O;
@@ -1601,8 +1601,8 @@ function Cn(n, e, t) {
1601
1601
  for (const f of a.keys()) {
1602
1602
  const d = e.getAttr(f);
1603
1603
  d && d["on-delete-reverse"] === "cascade" && ge(a.get(f), 1).forEach(([b, y, g]) => {
1604
- var m;
1605
- return Cn(n, e, [g, (m = d["reverse-identity"]) == null ? void 0 : m[1]]);
1604
+ var _;
1605
+ return Cn(n, e, [g, (_ = d["reverse-identity"]) == null ? void 0 : _[1]]);
1606
1606
  }), // Fall back to deleting everything if we've rehydrated tx-steps from
1607
1607
  // the store that didn't set `etype` in deleteEntity
1608
1608
  (!s || // If we don't know about the attr, let's just get rid of it
@@ -1613,9 +1613,9 @@ function Cn(n, e, t) {
1613
1613
  }
1614
1614
  const c = n.vae.get(o) && ge(n.vae.get(o), 2);
1615
1615
  c && c.forEach((f) => {
1616
- var m, S, _;
1616
+ var _, S, m;
1617
1617
  const [d, b, y] = f, g = e.getAttr(b);
1618
- (!s || !g || ((m = g["reverse-identity"]) == null ? void 0 : m[1]) === s) && (Oe(n.eav, [d, b, y]), Oe(n.aev, [b, d, y]), Oe(n.vae, [y, b, d])), g && g["on-delete"] === "cascade" && ((S = g["reverse-identity"]) == null ? void 0 : S[1]) === s && Cn(n, e, [d, (_ = g["forward-identity"]) == null ? void 0 : _[1]]);
1618
+ (!s || !g || ((_ = g["reverse-identity"]) == null ? void 0 : _[1]) === s) && (Oe(n.eav, [d, b, y]), Oe(n.aev, [b, d, y]), Oe(n.vae, [y, b, d])), g && g["on-delete"] === "cascade" && ((S = g["reverse-identity"]) == null ? void 0 : S[1]) === s && Cn(n, e, [d, (m = g["forward-identity"]) == null ? void 0 : m[1]]);
1619
1619
  }), ((l = n.vae.get(o)) == null ? void 0 : l.size) === 0 && Oe(n.vae, [o]);
1620
1620
  }
1621
1621
  function xs(n, e, t) {
@@ -2197,20 +2197,20 @@ function ha(n, e, t, { etype: r, level: s, form: i }, o) {
2197
2197
  const a = Object.keys(i).filter((c) => c !== "$");
2198
2198
  return a.length ? Object.entries(o).map(function([u, l]) {
2199
2199
  return a.map(function(b) {
2200
- var g, m, S;
2201
- const y = !!(e.cardinalityInference && ((S = (m = (g = t.linkIndex) == null ? void 0 : g[r]) == null ? void 0 : m[b]) != null && S.isSingular));
2200
+ var g, _, S;
2201
+ const y = !!(e.cardinalityInference && ((S = (_ = (g = t.linkIndex) == null ? void 0 : g[r]) == null ? void 0 : _[b]) != null && S.isSingular));
2202
2202
  try {
2203
- const [_, w, A] = da(n, t, r, s, b, u), O = qs(e, t, {
2204
- etype: _,
2203
+ const [m, w, A] = da(n, t, r, s, b, u), O = qs(e, t, {
2204
+ etype: m,
2205
2205
  level: w,
2206
2206
  form: i[b],
2207
2207
  join: A
2208
2208
  }), M = y ? O[0] : O;
2209
2209
  return { [b]: M };
2210
- } catch (_) {
2211
- if (_ instanceof ot)
2210
+ } catch (m) {
2211
+ if (m instanceof ot)
2212
2212
  return { [b]: y ? void 0 : [] };
2213
- throw _;
2213
+ throw m;
2214
2214
  }
2215
2215
  }).reduce(function(b, y) {
2216
2216
  return { ...b, ...y };
@@ -2275,31 +2275,31 @@ function wa(n, e, t) {
2275
2275
  return r;
2276
2276
  }
2277
2277
  function Sa(n, e, { etype: t, pageInfo: r, dq: s, form: i }) {
2278
- var g, m;
2278
+ var g, _;
2279
2279
  const o = (g = i == null ? void 0 : i.$) == null ? void 0 : g.order, a = Ws(i), c = Ta(i);
2280
2280
  let u = Fo(n, s);
2281
2281
  const l = r == null ? void 0 : r["start-cursor"], f = r == null ? void 0 : r["end-cursor"], d = ma(e, t, l, o);
2282
- if (d && ((m = d == null ? void 0 : d["forward-identity"]) == null ? void 0 : m[2]) !== "id") {
2283
- const S = d["checked-data-type"] === "date", _ = d.id;
2282
+ if (d && ((_ = d == null ? void 0 : d["forward-identity"]) == null ? void 0 : _[2]) !== "id") {
2283
+ const S = d["checked-data-type"] === "date", m = d.id;
2284
2284
  u = u.map(([w]) => {
2285
2285
  var O, M, I, R, H;
2286
- let A = (H = (R = (I = (M = (O = n.eav.get(w)) == null ? void 0 : O.get(_)) == null ? void 0 : M.values()) == null ? void 0 : I.next()) == null ? void 0 : R.value) == null ? void 0 : H[2];
2286
+ let A = (H = (R = (I = (M = (O = n.eav.get(w)) == null ? void 0 : O.get(m)) == null ? void 0 : M.values()) == null ? void 0 : I.next()) == null ? void 0 : R.value) == null ? void 0 : H[2];
2287
2287
  return S && (A = Rn(A)), [w, A];
2288
2288
  });
2289
2289
  }
2290
- u.sort(c === "asc" ? function(_, w) {
2291
- return Ht(_, w, d == null ? void 0 : d["checked-data-type"]);
2292
- } : function(_, w) {
2293
- return Ht(w, _, d == null ? void 0 : d["checked-data-type"]);
2290
+ u.sort(c === "asc" ? function(m, w) {
2291
+ return Ht(m, w, d == null ? void 0 : d["checked-data-type"]);
2292
+ } : function(m, w) {
2293
+ return Ht(w, m, d == null ? void 0 : d["checked-data-type"]);
2294
2294
  });
2295
2295
  let b = {};
2296
2296
  const y = wa(e, t, s);
2297
2297
  for (const S of u) {
2298
- const [_] = S;
2299
- if (b[_] || !a && l && d && ya(l, d, c, S) || !a && f && d && ba(f, d, c, S))
2298
+ const [m] = S;
2299
+ if (b[m] || !a && l && d && ya(l, d, c, S) || !a && f && d && ba(f, d, c, S))
2300
2300
  continue;
2301
- const w = ko(n, y, _);
2302
- w && (b[_] = w);
2301
+ const w = ko(n, y, m);
2302
+ w && (b[m] = w);
2303
2303
  }
2304
2304
  return b;
2305
2305
  }
@@ -2314,7 +2314,7 @@ function Ws(n) {
2314
2314
  return !e && !t && !r;
2315
2315
  }
2316
2316
  function va(n, e, { etype: t, level: r, form: s, join: i, pageInfo: o }) {
2317
- var d, b, y, g, m;
2317
+ var d, b, y, g, _;
2318
2318
  if (!Ws(s) && (!o || !o["start-cursor"]))
2319
2319
  return [];
2320
2320
  const a = ia(la(e, t, r, (d = s.$) == null ? void 0 : d.where), i), c = fa(Xt, t, r), u = (b = s.$) == null ? void 0 : b.fields, l = Sa(n, e, {
@@ -2322,7 +2322,7 @@ function va(n, e, { etype: t, level: r, form: s, join: i, pageInfo: o }) {
2322
2322
  pageInfo: o,
2323
2323
  form: s,
2324
2324
  dq: { where: a, find: c, fields: u }
2325
- }), f = ((y = s.$) == null ? void 0 : y.limit) || ((g = s.$) == null ? void 0 : g.first) || ((m = s.$) == null ? void 0 : m.last);
2325
+ }), f = ((y = s.$) == null ? void 0 : y.limit) || ((g = s.$) == null ? void 0 : g.first) || ((_ = s.$) == null ? void 0 : _.last);
2326
2326
  if (f != null) {
2327
2327
  r > 0 && Ls && console.warn("WARNING: Limits in child queries are only run client-side. Data returned from the server will not have a limit.");
2328
2328
  const S = Object.entries(l);
@@ -2752,12 +2752,12 @@ function tc({ attrsStore: n, schema: e }, t) {
2752
2752
  var d, b;
2753
2753
  const r = /* @__PURE__ */ new Set(), s = [], i = [];
2754
2754
  function o(y, g) {
2755
- return se(n, y, g) || s.find((m) => m["forward-identity"][1] === y && m["forward-identity"][2] === g);
2755
+ return se(n, y, g) || s.find((_) => _["forward-identity"][1] === y && _["forward-identity"][2] === g);
2756
2756
  }
2757
2757
  function a(y, g) {
2758
- return Ve(n, y, g) || s.find((m) => {
2759
- var S, _;
2760
- return ((S = m["reverse-identity"]) == null ? void 0 : S[1]) === y && ((_ = m["reverse-identity"]) == null ? void 0 : _[2]) === g;
2758
+ return Ve(n, y, g) || s.find((_) => {
2759
+ var S, m;
2760
+ return ((S = _["reverse-identity"]) == null ? void 0 : S[1]) === y && ((m = _["reverse-identity"]) == null ? void 0 : m[2]) === g;
2761
2761
  });
2762
2762
  }
2763
2763
  function c(y) {
@@ -2772,40 +2772,40 @@ function tc({ attrsStore: n, schema: e }, t) {
2772
2772
  !o(y, g);
2773
2773
  }
2774
2774
  function f(y, g) {
2775
- const m = o(y, g), S = a(y, g);
2776
- u(m), u(S), !m && !S && c(Lr(e, y, g, Xa));
2775
+ const _ = o(y, g), S = a(y, g);
2776
+ u(_), u(S), !_ && !S && c(Lr(e, y, g, Xa));
2777
2777
  }
2778
2778
  for (const y of t)
2779
- for (const { etype: g, lookupPair: m, linkLabel: S } of ec(y)) {
2780
- const _ = m[0];
2779
+ for (const { etype: g, lookupPair: _, linkLabel: S } of ec(y)) {
2780
+ const m = _[0];
2781
2781
  if (S) {
2782
2782
  f(g, S);
2783
2783
  const w = o(g, S), A = a(g, S);
2784
2784
  u(w), u(A);
2785
2785
  const O = ((d = w == null ? void 0 : w["reverse-identity"]) == null ? void 0 : d[1]) || ((b = A == null ? void 0 : A["forward-identity"]) == null ? void 0 : b[1]) || S;
2786
- if (l(O, _))
2787
- f(O, jn(_));
2786
+ if (l(O, m))
2787
+ f(O, jn(m));
2788
2788
  else {
2789
- const M = o(O, _);
2790
- M || c(jt(e, O, _, $n)), u(M);
2789
+ const M = o(O, m);
2790
+ M || c(jt(e, O, m, $n)), u(M);
2791
2791
  }
2792
- } else if (l(g, _))
2793
- f(g, jn(_));
2792
+ } else if (l(g, m))
2793
+ f(g, jn(m));
2794
2794
  else {
2795
- const w = o(g, _);
2796
- w || c(jt(e, g, _, $n)), u(w);
2795
+ const w = o(g, m);
2796
+ w || c(jt(e, g, m, $n)), u(w);
2797
2797
  }
2798
2798
  }
2799
2799
  for (const y of t) {
2800
- const [g, m, S, _] = y;
2800
+ const [g, _, S, m] = y;
2801
2801
  if (Ha.has(g)) {
2802
- const w = o(m, "id");
2803
- u(w), w || c(jt(e, m, "id", { "unique?": !0 }));
2804
- for (const A of Object.keys(_)) {
2805
- const O = o(m, A);
2806
- if (u(O), Ya.has(g) && (O || c(jt(e, m, A, A === "id" ? { "unique?": !0 } : null))), Ja.has(g)) {
2807
- const M = a(m, A);
2808
- !O && !M && c(Lr(e, m, A)), u(M);
2802
+ const w = o(_, "id");
2803
+ u(w), w || c(jt(e, _, "id", { "unique?": !0 }));
2804
+ for (const A of Object.keys(m)) {
2805
+ const O = o(_, A);
2806
+ if (u(O), Ya.has(g) && (O || c(jt(e, _, A, A === "id" ? { "unique?": !0 } : null))), Ja.has(g)) {
2807
+ const M = a(_, A);
2808
+ !O && !M && c(Lr(e, _, A)), u(M);
2809
2809
  }
2810
2810
  }
2811
2811
  }
@@ -3119,8 +3119,8 @@ async function cc(n, e, t) {
3119
3119
  };
3120
3120
  a[b] = S;
3121
3121
  }
3122
- const m = t.put(g, b);
3123
- s.add(m);
3122
+ const _ = t.put(g, b);
3123
+ s.add(_);
3124
3124
  }
3125
3125
  const c = { objects: a }, u = t.put(c, tt);
3126
3126
  s.add(u);
@@ -3139,50 +3139,49 @@ async function Nr(n, e, t) {
3139
3139
  });
3140
3140
  }
3141
3141
  async function uc(n, e) {
3142
- var f;
3143
3142
  const t = await ac(`instant_${n}_5`);
3144
3143
  if (!t)
3145
3144
  return;
3146
- const r = await new Promise((d, b) => {
3147
- const m = t.transaction(["kv"], "readonly").objectStore("kv").openCursor();
3148
- m.onerror = (_) => {
3149
- b(_);
3145
+ const r = await new Promise((l, f) => {
3146
+ const y = t.transaction(["kv"], "readonly").objectStore("kv").openCursor();
3147
+ y.onerror = (_) => {
3148
+ f(_);
3150
3149
  };
3151
- const S = [];
3152
- m.onsuccess = () => {
3153
- const _ = m.result;
3150
+ const g = [];
3151
+ y.onsuccess = () => {
3152
+ const _ = y.result;
3154
3153
  if (_) {
3155
- const w = _.key, A = _.value;
3156
- S.push([w, A]), _.continue();
3154
+ const S = _.key, m = _.value;
3155
+ g.push([S, m]), _.continue();
3157
3156
  } else
3158
- d(S);
3159
- }, m.onerror = (_) => {
3160
- b(_);
3157
+ l(g);
3158
+ }, y.onerror = (_) => {
3159
+ f(_);
3161
3160
  };
3162
- }), s = e.transaction(["kv", "querySubs"], "readwrite"), i = s.objectStore("kv"), o = s.objectStore("querySubs"), a = new Promise((d, b) => {
3163
- s.oncomplete = (y) => d(y), s.onerror = (y) => b(y), s.onabort = (y) => b(y);
3164
- }), c = [], u = { objects: {} };
3165
- for (const [d, b] of r)
3166
- switch (d) {
3161
+ }), s = e.transaction(["kv", "querySubs"], "readwrite"), i = s.objectStore("kv"), o = s.objectStore("querySubs"), a = [], c = { objects: {} };
3162
+ for (const [l, f] of r)
3163
+ switch (l) {
3167
3164
  case "querySubs": {
3168
- const y = cc(d, b, o);
3169
- c.push(y);
3165
+ const d = cc(l, f, o);
3166
+ a.push(d);
3170
3167
  break;
3171
3168
  }
3172
3169
  default: {
3173
- const y = Nr(d, b, i);
3174
- c.push(y);
3175
- const g = {
3170
+ const d = Nr(l, f, i);
3171
+ a.push(d);
3172
+ const b = {
3176
3173
  createdAt: Date.now(),
3177
3174
  updatedAt: Date.now(),
3178
3175
  size: 0
3179
3176
  };
3180
- u.objects[d] = g;
3177
+ c.objects[l] = b;
3181
3178
  break;
3182
3179
  }
3183
3180
  }
3184
- const l = Nr(tt, u, i);
3185
- c.push(l), (f = s.commit) == null || f.call(s), await Promise.all([Promise.all(c), a]);
3181
+ const u = Nr(tt, c, i);
3182
+ a.push(u), await Promise.all(a), await new Promise((l, f) => {
3183
+ s.oncomplete = (d) => l(d), s.onerror = (d) => f(d), s.onabort = (d) => f(d);
3184
+ });
3186
3185
  }
3187
3186
  const Kr = /* @__PURE__ */ new Map();
3188
3187
  class Bs extends rc {
@@ -3547,7 +3546,7 @@ function Qr(n) {
3547
3546
  }, e;
3548
3547
  }, {});
3549
3548
  }
3550
- const ar = "v1.0.63-branch-codex-indexeddb-explicit-commit.31419272329.1";
3549
+ const ar = "v1.0.63-branch-codex-indexeddb-explicit-commit.31419410889.1";
3551
3550
  function vc(n, e, t = console) {
3552
3551
  return {
3553
3552
  info: n ? (...r) => t.info(...r, e()) : () => {
@@ -4360,9 +4359,9 @@ class Nc {
4360
4359
  continue;
4361
4360
  i.txId = a["tx-id"];
4362
4361
  const c = [], u = {};
4363
- for (const m of a.changes) {
4364
- const S = u[m.triple[0]] ?? [];
4365
- u[m.triple[0]] = S, S.push(m);
4362
+ for (const _ of a.changes) {
4363
+ const S = u[_.triple[0]] ?? [];
4364
+ u[_.triple[0]] = S, S.push(_);
4366
4365
  }
4367
4366
  const l = s.values ?? {
4368
4367
  entities: [],
@@ -4370,42 +4369,42 @@ class Nc {
4370
4369
  }, f = l.entities;
4371
4370
  s.values = l;
4372
4371
  const d = [];
4373
- e: for (const [m, S] of Object.entries(u))
4374
- for (let _ = 0; _ < f.length; _++) {
4375
- const w = f[_];
4376
- if (_o(w.store, m)) {
4372
+ e: for (const [_, S] of Object.entries(u))
4373
+ for (let m = 0; m < f.length; m++) {
4374
+ const w = f[m];
4375
+ if (_o(w.store, _)) {
4377
4376
  Xr(w.store, l.attrsStore, S);
4378
- const A = yn(s, w.store, l.attrsStore), O = Uc(w.store, l.attrsStore, S)[m];
4377
+ const A = yn(s, w.store, l.attrsStore), O = Uc(w.store, l.attrsStore, S)[_];
4379
4378
  A ? (d.push({
4380
4379
  oldEntity: w.entity,
4381
4380
  newEntity: A,
4382
4381
  changedFields: O || {}
4383
- }), w.entity = A) : c.push(_), delete u[m];
4382
+ }), w.entity = A) : c.push(m), delete u[_];
4384
4383
  continue e;
4385
4384
  }
4386
4385
  }
4387
4386
  const b = [];
4388
- for (const [m, S] of Object.entries(u)) {
4389
- const _ = this.createStore([]);
4390
- Xr(_, l.attrsStore, S);
4391
- const w = yn(s, _, l.attrsStore);
4387
+ for (const [_, S] of Object.entries(u)) {
4388
+ const m = this.createStore([]);
4389
+ Xr(m, l.attrsStore, S);
4390
+ const w = yn(s, m, l.attrsStore);
4392
4391
  if (!w) {
4393
4392
  this.log.error("No entity found after applying change", {
4394
4393
  sub: s,
4395
4394
  changes: S,
4396
- store: _
4395
+ store: m
4397
4396
  });
4398
4397
  continue;
4399
4398
  }
4400
4399
  f.push({
4401
- store: _,
4400
+ store: m,
4402
4401
  entity: w,
4403
- serverCreatedAt: Zr(s, _, l.attrsStore, w.id)
4402
+ serverCreatedAt: Zr(s, m, l.attrsStore, w.id)
4404
4403
  }), b.push(w);
4405
4404
  }
4406
4405
  const y = [];
4407
- for (const m of c.sort().reverse())
4408
- y.push(f[m].entity), f.splice(m, 1);
4406
+ for (const _ of c.sort().reverse())
4407
+ y.push(f[_].entity), f.splice(_, 1);
4409
4408
  const g = Lc(s, this.getAttrs);
4410
4409
  Fc(s, g, f), this.notifyCbs(r, {
4411
4410
  type: Ue.SyncTransaction,
@@ -4454,8 +4453,8 @@ function Kc({ WStream: n, opts: e, startStream: t, appendStream: r, registerStre
4454
4453
  const u = Z();
4455
4454
  let l = !1, f = !1;
4456
4455
  const d = [], b = [], y = [];
4457
- let g = !1, m = 0, S = 0;
4458
- const _ = [], w = new TextEncoder();
4456
+ let g = !1, _ = 0, S = 0;
4457
+ const m = [], w = new TextEncoder();
4459
4458
  function A() {
4460
4459
  f = !0;
4461
4460
  for (const E of d)
@@ -4498,14 +4497,14 @@ function Kc({ WStream: n, opts: e, startStream: t, appendStream: r, registerStre
4498
4497
  g = !0;
4499
4498
  }
4500
4499
  function G(E) {
4501
- let C = m, W = 0, J = 0;
4502
- for (const { byteLen: X } of _) {
4500
+ let C = _, W = 0, J = 0;
4501
+ for (const { byteLen: X } of m) {
4503
4502
  const le = C + X;
4504
4503
  if (le > E)
4505
4504
  break;
4506
4505
  C = le, W++, J += X;
4507
4506
  }
4508
- W > 0 && (m += J, S -= J, _.splice(0, W));
4507
+ W > 0 && (_ += J, S -= J, m.splice(0, W));
4509
4508
  }
4510
4509
  function V(E, C) {
4511
4510
  a = C, A(), E.error(C), I();
@@ -4519,10 +4518,10 @@ function Kc({ WStream: n, opts: e, startStream: t, appendStream: r, registerStre
4519
4518
  switch (E.type) {
4520
4519
  case "ok": {
4521
4520
  const { streamId: C, offset: W } = E;
4522
- o = C, G(W), _.length && r({
4521
+ o = C, G(W), m.length && r({
4523
4522
  streamId: C,
4524
- chunks: _.map((J) => J.chunk),
4525
- offset: m
4523
+ chunks: m.map((J) => J.chunk),
4524
+ offset: _
4526
4525
  }), g = !1;
4527
4526
  break;
4528
4527
  }
@@ -4618,8 +4617,8 @@ function Kc({ WStream: n, opts: e, startStream: t, appendStream: r, registerStre
4618
4617
  const W = x(C);
4619
4618
  if (W) {
4620
4619
  const J = w.encode(E).length;
4621
- _.push({ chunk: E, byteLen: J });
4622
- const X = m + S;
4620
+ m.push({ chunk: E, byteLen: J });
4621
+ const X = _ + S;
4623
4622
  S += J, g || r({ streamId: W, chunks: [E], offset: X });
4624
4623
  }
4625
4624
  },
@@ -4627,7 +4626,7 @@ function Kc({ WStream: n, opts: e, startStream: t, appendStream: r, registerStre
4627
4626
  o ? r({
4628
4627
  streamId: o,
4629
4628
  chunks: [],
4630
- offset: m + S,
4629
+ offset: _ + S,
4631
4630
  isDone: !0
4632
4631
  }) : I(), A();
4633
4632
  },
@@ -4635,7 +4634,7 @@ function Kc({ WStream: n, opts: e, startStream: t, appendStream: r, registerStre
4635
4634
  o ? r({
4636
4635
  streamId: o,
4637
4636
  chunks: [],
4638
- offset: m + S,
4637
+ offset: _ + S,
4639
4638
  isDone: !0,
4640
4639
  abortReason: E
4641
4640
  }) : I(), A();
@@ -4698,7 +4697,7 @@ function qc({ RStream: n, opts: e, startStream: t, cancelStream: r }) {
4698
4697
  R !== -1 && l.splice(R, 1);
4699
4698
  };
4700
4699
  }
4701
- function m(I) {
4700
+ function _(I) {
4702
4701
  return f.push(I), d && I(d), () => {
4703
4702
  const R = f.indexOf(I);
4704
4703
  R !== -1 && f.splice(R, 1);
@@ -4707,7 +4706,7 @@ function qc({ RStream: n, opts: e, startStream: t, cancelStream: r }) {
4707
4706
  function S(I, R) {
4708
4707
  b = R, I.error(R), y(R);
4709
4708
  }
4710
- let _ = 0;
4709
+ let m = 0;
4711
4710
  async function w(I, R) {
4712
4711
  c = Z();
4713
4712
  const H = { ...I || {}, eventId: c };
@@ -4736,7 +4735,7 @@ function qc({ RStream: n, opts: e, startStream: t, cancelStream: r }) {
4736
4735
  for (let q = 0; q < F.files.length; q++) {
4737
4736
  const k = F.files[q + 1], j = await ne;
4738
4737
  if (k && (ne = fetch(k.url, { signal: V.signal })), !j.ok) {
4739
- if (_++, _ > 10) {
4738
+ if (m++, m > 10) {
4740
4739
  S(R, new oe("Unable to process stream."));
4741
4740
  return;
4742
4741
  }
@@ -4778,7 +4777,7 @@ function qc({ RStream: n, opts: e, startStream: t, cancelStream: r }) {
4778
4777
  }
4779
4778
  }
4780
4779
  }
4781
- if (_ = 0, F.content) {
4780
+ if (m = 0, F.content) {
4782
4781
  let V = F.content, ne = a.encode(F.content);
4783
4782
  if (G > 0) {
4784
4783
  const q = ne.subarray(G);
@@ -4820,7 +4819,7 @@ function qc({ RStream: n, opts: e, startStream: t, cancelStream: r }) {
4820
4819
  }, ne = (q) => {
4821
4820
  H(q || new oe("Stream is closed.")), G();
4822
4821
  };
4823
- F.push(m(V)), F.push(g(ne));
4822
+ F.push(_(V)), F.push(g(ne));
4824
4823
  });
4825
4824
  }
4826
4825
  }
@@ -5473,8 +5472,8 @@ class su {
5473
5472
  case "init-ok": {
5474
5473
  this._setStatus(Ce.AUTHENTICATED), this._reconnectTimeoutMs = 0, this._setAppStatus(((s = t["app-status"]) == null ? void 0 : s.status) ?? "active"), this._setAttrs(t.attrs), this._flushPendingMessages(), this._sessionId = t["session-id"];
5475
5474
  for (const y of Object.keys(this._rooms)) {
5476
- const g = (o = (i = this._presence[y]) == null ? void 0 : i.result) == null ? void 0 : o.user, m = (a = this._rooms[y]) == null ? void 0 : a.roomType;
5477
- this._tryJoinRoom(m, y, g);
5475
+ const g = (o = (i = this._presence[y]) == null ? void 0 : i.result) == null ? void 0 : o.user, _ = (a = this._rooms[y]) == null ? void 0 : a.roomType;
5476
+ this._tryJoinRoom(_, y, g);
5478
5477
  }
5479
5478
  break;
5480
5479
  }
@@ -5483,23 +5482,23 @@ class su {
5483
5482
  break;
5484
5483
  }
5485
5484
  case "add-query-ok": {
5486
- const { q: y, result: g } = t, m = ue(y);
5487
- if (!this._hasQueryListeners() && !this.querySubs.currentValue[m])
5485
+ const { q: y, result: g } = t, _ = ue(y);
5486
+ if (!this._hasQueryListeners() && !this.querySubs.currentValue[_])
5488
5487
  break;
5489
- const S = (u = (c = g == null ? void 0 : g[0]) == null ? void 0 : c.data) == null ? void 0 : u["page-info"], _ = (f = (l = g == null ? void 0 : g[0]) == null ? void 0 : l.data) == null ? void 0 : f.aggregate, w = Vr(g), A = this.ensureAttrs(), O = yt(A, w, r, this.config.useDateObjects);
5488
+ const S = (u = (c = g == null ? void 0 : g[0]) == null ? void 0 : c.data) == null ? void 0 : u["page-info"], m = (f = (l = g == null ? void 0 : g[0]) == null ? void 0 : l.data) == null ? void 0 : f.aggregate, w = Vr(g), A = this.ensureAttrs(), O = yt(A, w, r, this.config.useDateObjects);
5490
5489
  this.querySubs.updateInPlace((M) => {
5491
- if (!M[m]) {
5492
- this._log.info("Missing value in querySubs", { hash: m, q: y });
5490
+ if (!M[_]) {
5491
+ this._log.info("Missing value in querySubs", { hash: _, q: y });
5493
5492
  return;
5494
5493
  }
5495
- M[m].result = {
5494
+ M[_].result = {
5496
5495
  store: O,
5497
5496
  attrsStore: A,
5498
5497
  pageInfo: S,
5499
- aggregate: _,
5498
+ aggregate: m,
5500
5499
  processedTxId: t["processed-tx-id"]
5501
5500
  };
5502
- }), this._cleanupPendingMutationsQueries(), this.notifyOne(m), this.notifyOneQueryOnce(m), this._cleanupPendingMutationsTimeout();
5501
+ }), this._cleanupPendingMutationsQueries(), this.notifyOne(_), this.notifyOneQueryOnce(_), this._cleanupPendingMutationsTimeout();
5503
5502
  break;
5504
5503
  }
5505
5504
  case "start-sync-ok": {
@@ -5535,15 +5534,15 @@ class su {
5535
5534
  break;
5536
5535
  }
5537
5536
  case "refresh-ok": {
5538
- const { computations: y, attrs: g } = t, m = t["processed-tx-id"];
5537
+ const { computations: y, attrs: g } = t, _ = t["processed-tx-id"];
5539
5538
  g && this._setAttrs(g), this._cleanupPendingMutationsTimeout();
5540
- const S = this._rewriteMutations(this.ensureAttrs(), this._pendingMutations(), m);
5539
+ const S = this._rewriteMutations(this.ensureAttrs(), this._pendingMutations(), _);
5541
5540
  S !== this._pendingMutations() && this.kv.updateInPlace((A) => {
5542
5541
  A.pendingMutations = S;
5543
5542
  });
5544
- const _ = _n(S.entries()), w = y.map((A) => {
5543
+ const m = _n(S.entries()), w = y.map((A) => {
5545
5544
  var k, x, j, D;
5546
- const O = A["instaql-query"], M = A["instaql-result"], I = ue(O), R = Vr(M), H = this.ensureAttrs(), F = yt(H, R, r, this.config.useDateObjects), { store: G, attrsStore: V } = this._applyOptimisticUpdates(F, H, _, m), ne = (x = (k = M == null ? void 0 : M[0]) == null ? void 0 : k.data) == null ? void 0 : x["page-info"], q = (D = (j = M == null ? void 0 : M[0]) == null ? void 0 : j.data) == null ? void 0 : D.aggregate;
5545
+ const O = A["instaql-query"], M = A["instaql-result"], I = ue(O), R = Vr(M), H = this.ensureAttrs(), F = yt(H, R, r, this.config.useDateObjects), { store: G, attrsStore: V } = this._applyOptimisticUpdates(F, H, m, _), ne = (x = (k = M == null ? void 0 : M[0]) == null ? void 0 : k.data) == null ? void 0 : x["page-info"], q = (D = (j = M == null ? void 0 : M[0]) == null ? void 0 : j.data) == null ? void 0 : D.aggregate;
5547
5546
  return {
5548
5547
  q: O,
5549
5548
  hash: I,
@@ -5564,7 +5563,7 @@ class su {
5564
5563
  attrsStore: I,
5565
5564
  pageInfo: R,
5566
5565
  aggregate: H,
5567
- processedTxId: m
5566
+ processedTxId: _
5568
5567
  };
5569
5568
  });
5570
5569
  }), this._cleanupPendingMutationsQueries(), w.forEach(({ hash: A }) => {
@@ -5585,15 +5584,15 @@ class su {
5585
5584
  confirmed: Date.now()
5586
5585
  });
5587
5586
  });
5588
- const _ = [];
5587
+ const m = [];
5589
5588
  for (const w of S["tx-steps"])
5590
5589
  if (w[0] === "add-attr") {
5591
5590
  const A = w[1];
5592
- _.push(A);
5591
+ m.push(A);
5593
5592
  }
5594
- if (_.length) {
5593
+ if (m.length) {
5595
5594
  const w = Object.values(this.ensureAttrs().attrs);
5596
- this._setAttrs([...w, ..._]);
5595
+ this._setAttrs([...w, ...m]);
5597
5596
  }
5598
5597
  this._finishTransaction("synced", y), this._cleanupPendingMutationsTimeout();
5599
5598
  break;
@@ -5634,7 +5633,7 @@ class su {
5634
5633
  message: "This app is currently disabled.",
5635
5634
  hint: { status: "disabled" }
5636
5635
  };
5637
- Object.keys(this.queryCbs).forEach((m) => this.notifyQueryError(m, g));
5636
+ Object.keys(this.queryCbs).forEach((_) => this.notifyQueryError(_, g));
5638
5637
  }
5639
5638
  y === "disabled" && t.status !== "disabled" && this._startSocket();
5640
5639
  break;
@@ -5692,16 +5691,16 @@ class su {
5692
5691
  message: e.message || "Uh-oh, something went wrong. Ping Joe & Stopa."
5693
5692
  };
5694
5693
  if (e.hint && (s.hint = e.hint), e["trace-id"] || (a = e["original-event"]) != null && a["trace-id"]) {
5695
- const m = [e["trace-id"], (c = e["original-event"]) == null ? void 0 : c["trace-id"]].filter(Boolean).join(",");
5696
- s.traceId = m;
5694
+ const _ = [e["trace-id"], (c = e["original-event"]) == null ? void 0 : c["trace-id"]].filter(Boolean).join(",");
5695
+ s.traceId = _;
5697
5696
  }
5698
5697
  if (r) {
5699
5698
  this._handleMutationError("error", t, s);
5700
5699
  return;
5701
5700
  }
5702
5701
  if ((u = e["original-event"]) != null && u.hasOwnProperty("q") && ((l = e["original-event"]) == null ? void 0 : l.op) === "add-query") {
5703
- const g = (f = e["original-event"]) == null ? void 0 : f.q, m = ue(g);
5704
- this.notifyQueryError(ue(g), s), this.notifyQueryOnceError(g, m, t, s);
5702
+ const g = (f = e["original-event"]) == null ? void 0 : f.q, _ = ue(g);
5703
+ this.notifyQueryError(ue(g), s), this.notifyQueryOnceError(g, _, t, s);
5705
5704
  return;
5706
5705
  }
5707
5706
  if (((d = e["original-event"]) == null ? void 0 : d.op) === "init") {
@@ -5847,9 +5846,9 @@ class su {
5847
5846
  for (const b of l) {
5848
5847
  const [y] = b;
5849
5848
  if (y === "add-attr") {
5850
- const [m, S] = b, _ = s(S);
5851
- if (_ && S.id !== _.id) {
5852
- o.attrIdMap[S.id] = _.id, a = !0;
5849
+ const [_, S] = b, m = s(S);
5850
+ if (m && S.id !== m.id) {
5851
+ o.attrIdMap[S.id] = m.id, a = !0;
5853
5852
  continue;
5854
5853
  }
5855
5854
  if (S["value-type"] === "ref") {
@@ -5917,10 +5916,10 @@ class su {
5917
5916
  if (l && s === l.querySubVersion && o === l.pendingMutationsVersion)
5918
5917
  return l;
5919
5918
  let f = u.store, d = u.attrsStore;
5920
- const { pageInfo: b, aggregate: y, processedTxId: g } = u, m = this._rewriteMutationsSorted(d, a);
5919
+ const { pageInfo: b, aggregate: y, processedTxId: g } = u, _ = this._rewriteMutationsSorted(d, a);
5921
5920
  if (t) {
5922
- const _ = this._applyOptimisticUpdates(f, d, m, g);
5923
- f = _.store, d = _.attrsStore;
5921
+ const m = this._applyOptimisticUpdates(f, d, _, g);
5922
+ f = m.store, d = m.attrsStore;
5924
5923
  }
5925
5924
  return { data: zs({ store: f, attrsStore: d, pageInfo: b, aggregate: y }, c), querySubVersion: s, pendingMutationsVersion: o };
5926
5925
  }
@@ -6902,7 +6901,7 @@ const Tu = (n) => JSON.stringify(n), gt = (n, e = !1) => JSON.stringify([n, e]),
6902
6901
  var G, V, ne, q;
6903
6902
  const { entityName: s, entityQuery: i } = oi(e), o = ((G = i.$) == null ? void 0 : G.limit) || 10, a = s, c = ii((V = i.$) == null ? void 0 : V.order), u = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map();
6904
6903
  let d = !1, b = !0, y = null, g = null;
6905
- const m = (k) => {
6904
+ const _ = (k) => {
6906
6905
  t({ error: k, data: void 0, canLoadNextPage: !1 });
6907
6906
  }, S = () => {
6908
6907
  if (!b)
@@ -6914,7 +6913,7 @@ const Tu = (n) => JSON.stringify(n), gt = (n, e = !1) => JSON.stringify([n, e]),
6914
6913
  chunks: k,
6915
6914
  canLoadNextPage: Eu(u)
6916
6915
  });
6917
- }, _ = (k, x) => {
6916
+ }, m = (k, x) => {
6918
6917
  u.set(gt(k, x.afterInclusive), x), S();
6919
6918
  }, w = (k, x) => {
6920
6919
  l.set(gt(k), x), R(), S();
@@ -6936,7 +6935,7 @@ const Tu = (n) => JSON.stringify(n), gt = (n, e = !1) => JSON.stringify([n, e]),
6936
6935
  }
6937
6936
  }, (W) => {
6938
6937
  if (W.error)
6939
- return m(W.error);
6938
+ return _(W.error);
6940
6939
  const J = W.data[a], X = W.pageInfo[a];
6941
6940
  lt(J && X, "Expected query subscription to contain rows and pageInfo"), w(j, {
6942
6941
  data: J,
@@ -6961,7 +6960,7 @@ const Tu = (n) => JSON.stringify(n), gt = (n, e = !1) => JSON.stringify([n, e]),
6961
6960
  }
6962
6961
  }, (K) => {
6963
6962
  if (K.error)
6964
- return m(K.error);
6963
+ return _(K.error);
6965
6964
  const E = K.data[a], C = K.pageInfo[a];
6966
6965
  lt(E && C, "Expected rows and pageInfo"), w(k, {
6967
6966
  data: E,
@@ -6987,9 +6986,9 @@ const Tu = (n) => JSON.stringify(n), gt = (n, e = !1) => JSON.stringify([n, e]),
6987
6986
  }
6988
6987
  }, (E) => {
6989
6988
  if (E.error)
6990
- return m(E.error);
6989
+ return _(E.error);
6991
6990
  const C = E.data[a], W = E.pageInfo[a];
6992
- lt(C && W, "Page info and rows"), _(k, {
6991
+ lt(C && W, "Page info and rows"), m(k, {
6993
6992
  data: C,
6994
6993
  status: "bootstrapping",
6995
6994
  hasMore: W.hasNextPage,
@@ -7020,9 +7019,9 @@ const Tu = (n) => JSON.stringify(n), gt = (n, e = !1) => JSON.stringify([n, e]),
7020
7019
  }
7021
7020
  }, (J) => {
7022
7021
  if (J.error)
7023
- return m(J.error);
7022
+ return _(J.error);
7024
7023
  const X = J.data[a], le = J.pageInfo[a];
7025
- lt(X && le, "Expected rows and pageInfo"), _(k, {
7024
+ lt(X && le, "Expected rows and pageInfo"), m(k, {
7026
7025
  data: X,
7027
7026
  status: "frozen",
7028
7027
  hasMore: le.hasNextPage,
@@ -7065,10 +7064,10 @@ const Tu = (n) => JSON.stringify(n), gt = (n, e = !1) => JSON.stringify([n, e]),
7065
7064
  if (d)
7066
7065
  return;
7067
7066
  if (k.error)
7068
- return m(k.error);
7067
+ return _(k.error);
7069
7068
  const x = k.pageInfo[a], j = (K = k == null ? void 0 : k.data) == null ? void 0 : K[a];
7070
7069
  if (lt(j && x, "Expected rows and pageInfo"), j.length < o) {
7071
- _(mn, {
7070
+ m(mn, {
7072
7071
  data: j,
7073
7072
  status: "pre-bootstrap"
7074
7073
  });
@@ -7076,7 +7075,7 @@ const Tu = (n) => JSON.stringify(n), gt = (n, e = !1) => JSON.stringify([n, e]),
7076
7075
  }
7077
7076
  const D = x.startCursor;
7078
7077
  if (!D) {
7079
- _(mn, {
7078
+ m(mn, {
7080
7079
  data: j,
7081
7080
  status: "pre-bootstrap"
7082
7081
  });
@@ -7644,14 +7643,14 @@ function Lu() {
7644
7643
  * LICENSE file in the root directory of this source tree.
7645
7644
  */
7646
7645
  return n.NODE_ENV !== "production" && function() {
7647
- var e = ys, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), c = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), y = Symbol.for("react.offscreen"), g = Symbol.iterator, m = "@@iterator";
7646
+ var e = ys, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), s = Symbol.for("react.fragment"), i = Symbol.for("react.strict_mode"), o = Symbol.for("react.profiler"), a = Symbol.for("react.provider"), c = Symbol.for("react.context"), u = Symbol.for("react.forward_ref"), l = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), d = Symbol.for("react.memo"), b = Symbol.for("react.lazy"), y = Symbol.for("react.offscreen"), g = Symbol.iterator, _ = "@@iterator";
7648
7647
  function S(h) {
7649
7648
  if (h === null || typeof h != "object")
7650
7649
  return null;
7651
- var T = g && h[g] || h[m];
7650
+ var T = g && h[g] || h[_];
7652
7651
  return typeof T == "function" ? T : null;
7653
7652
  }
7654
- var _ = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
7653
+ var m = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
7655
7654
  function w(h) {
7656
7655
  {
7657
7656
  for (var T = arguments.length, v = new Array(T > 1 ? T - 1 : 0), P = 1; P < T; P++)
@@ -7661,7 +7660,7 @@ function Lu() {
7661
7660
  }
7662
7661
  function A(h, T, v) {
7663
7662
  {
7664
- var P = _.ReactDebugCurrentFrame, z = P.getStackAddendum();
7663
+ var P = m.ReactDebugCurrentFrame, z = P.getStackAddendum();
7665
7664
  z !== "" && (T += "%s", v = v.concat([z]));
7666
7665
  var Q = v.map(function(N) {
7667
7666
  return String(N);
@@ -7795,7 +7794,7 @@ function Lu() {
7795
7794
  x < 0 && w("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
7796
7795
  }
7797
7796
  }
7798
- var ve = _.ReactCurrentDispatcher, rn;
7797
+ var ve = m.ReactCurrentDispatcher, rn;
7799
7798
  function Ct(h, T, v) {
7800
7799
  {
7801
7800
  if (rn === void 0)
@@ -7921,7 +7920,7 @@ function Lu() {
7921
7920
  }
7922
7921
  return "";
7923
7922
  }
7924
- var ut = Object.prototype.hasOwnProperty, lr = {}, fr = _.ReactDebugCurrentFrame;
7923
+ var ut = Object.prototype.hasOwnProperty, lr = {}, fr = m.ReactDebugCurrentFrame;
7925
7924
  function Rt(h) {
7926
7925
  if (h) {
7927
7926
  var T = h._owner, v = Pt(h.type, h._source, T ? T.type : null);
@@ -7972,7 +7971,7 @@ function Lu() {
7972
7971
  if (bi(h))
7973
7972
  return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", yi(h)), dr(h);
7974
7973
  }
7975
- var pr = _.ReactCurrentOwner, gi = {
7974
+ var pr = m.ReactCurrentOwner, gi = {
7976
7975
  key: !0,
7977
7976
  ref: !0,
7978
7977
  __self: !0,
@@ -8066,7 +8065,7 @@ function Lu() {
8066
8065
  return vi(h, U, fe, z, P, pr.current, N);
8067
8066
  }
8068
8067
  }
8069
- var an = _.ReactCurrentOwner, gr = _.ReactDebugCurrentFrame;
8068
+ var an = m.ReactCurrentOwner, gr = m.ReactDebugCurrentFrame;
8070
8069
  function Qe(h) {
8071
8070
  if (h) {
8072
8071
  var T = h._owner, v = Pt(h.type, h._source, T ? T.type : null);
@@ -8817,10 +8816,10 @@ function el(n) {
8817
8816
  const { onEvent: e = wn, onError: t = wn, onRetry: r = wn, onComment: s } = n;
8818
8817
  let i = "", o = !0, a, c = "", u = "";
8819
8818
  function l(g) {
8820
- const m = o ? g.replace(/^\xEF\xBB\xBF/, "") : g, [S, _] = tl(`${i}${m}`);
8819
+ const _ = o ? g.replace(/^\xEF\xBB\xBF/, "") : g, [S, m] = tl(`${i}${_}`);
8821
8820
  for (const w of S)
8822
8821
  f(w);
8823
- i = _, o = !1;
8822
+ i = m, o = !1;
8824
8823
  }
8825
8824
  function f(g) {
8826
8825
  if (g === "") {
@@ -8831,31 +8830,31 @@ function el(n) {
8831
8830
  s && s(g.slice(g.startsWith(": ") ? 2 : 1));
8832
8831
  return;
8833
8832
  }
8834
- const m = g.indexOf(":");
8835
- if (m !== -1) {
8836
- const S = g.slice(0, m), _ = g[m + 1] === " " ? 2 : 1, w = g.slice(m + _);
8833
+ const _ = g.indexOf(":");
8834
+ if (_ !== -1) {
8835
+ const S = g.slice(0, _), m = g[_ + 1] === " " ? 2 : 1, w = g.slice(_ + m);
8837
8836
  d(S, w, g);
8838
8837
  return;
8839
8838
  }
8840
8839
  d(g, "", g);
8841
8840
  }
8842
- function d(g, m, S) {
8841
+ function d(g, _, S) {
8843
8842
  switch (g) {
8844
8843
  case "event":
8845
- u = m;
8844
+ u = _;
8846
8845
  break;
8847
8846
  case "data":
8848
- c = `${c}${m}
8847
+ c = `${c}${_}
8849
8848
  `;
8850
8849
  break;
8851
8850
  case "id":
8852
- a = m.includes("\0") ? void 0 : m;
8851
+ a = _.includes("\0") ? void 0 : _;
8853
8852
  break;
8854
8853
  case "retry":
8855
- /^\d+$/.test(m) ? r(parseInt(m, 10)) : t(
8856
- new ls(`Invalid \`retry\` value: "${m}"`, {
8854
+ /^\d+$/.test(_) ? r(parseInt(_, 10)) : t(
8855
+ new ls(`Invalid \`retry\` value: "${_}"`, {
8857
8856
  type: "invalid-retry",
8858
- value: m,
8857
+ value: _,
8859
8858
  line: S
8860
8859
  })
8861
8860
  );
@@ -8864,7 +8863,7 @@ function el(n) {
8864
8863
  t(
8865
8864
  new ls(
8866
8865
  `Unknown field "${g.length > 20 ? `${g.slice(0, 20)}…` : g}"`,
8867
- { type: "unknown-field", field: g, value: m, line: S }
8866
+ { type: "unknown-field", field: g, value: _, line: S }
8868
8867
  )
8869
8868
  );
8870
8869
  break;
@@ -8995,8 +8994,8 @@ class Vt extends EventTarget {
8995
8994
  const d = new TextDecoder(), b = a.getReader();
8996
8995
  let y = !0;
8997
8996
  do {
8998
- const { done: g, value: m } = await b.read();
8999
- m && $(this, Ze).feed(d.decode(m, { stream: !g })), g && (y = !1, $(this, Ze).reset(), Re(this, Ee, Qn).call(this));
8997
+ const { done: g, value: _ } = await b.read();
8998
+ _ && $(this, Ze).feed(d.decode(_, { stream: !g })), g && (y = !1, $(this, Ze).reset(), Re(this, Ee, Qn).call(this));
9000
8999
  } while (y);
9001
9000
  }), ie(this, qn, (i) => {
9002
9001
  Y(this, $e, void 0), !(i.name === "AbortError" || i.type === "aborted") && Re(this, Ee, Qn).call(this, Nn(i));
@@ -9198,8 +9197,8 @@ function yl({
9198
9197
  const l = e || `cursors-space-default--${String(t.type)}-${t.id}`, f = t.usePresence({
9199
9198
  keys: [l]
9200
9199
  }), d = t._core._reactor.getPresence(t.type, t.id);
9201
- function b(_, w) {
9202
- const A = w.clientX, O = w.clientY, M = (A - _.left) / _.width * 100, I = (O - _.top) / _.height * 100;
9200
+ function b(m, w) {
9201
+ const A = w.clientX, O = w.clientY, M = (A - m.left) / m.width * 100, I = (O - m.top) / m.height * 100;
9203
9202
  f.publishPresence({
9204
9203
  [l]: {
9205
9204
  x: A,
@@ -9210,27 +9209,27 @@ function yl({
9210
9209
  }
9211
9210
  });
9212
9211
  }
9213
- function y(_) {
9214
- c || _.stopPropagation();
9215
- const w = _.currentTarget.getBoundingClientRect();
9216
- b(w, _);
9212
+ function y(m) {
9213
+ c || m.stopPropagation();
9214
+ const w = m.currentTarget.getBoundingClientRect();
9215
+ b(w, m);
9217
9216
  }
9218
- function g(_) {
9217
+ function g(m) {
9219
9218
  f.publishPresence({
9220
9219
  [l]: void 0
9221
9220
  });
9222
9221
  }
9223
- function m(_) {
9224
- if (_.touches.length !== 1)
9222
+ function _(m) {
9223
+ if (m.touches.length !== 1)
9225
9224
  return;
9226
- const w = _.touches[0];
9225
+ const w = m.touches[0];
9227
9226
  if (w.target instanceof Element) {
9228
- c || _.stopPropagation();
9227
+ c || m.stopPropagation();
9229
9228
  const A = w.target.getBoundingClientRect();
9230
9229
  b(A, w);
9231
9230
  }
9232
9231
  }
9233
- function S(_) {
9232
+ function S(m) {
9234
9233
  f.publishPresence({
9235
9234
  [l]: void 0
9236
9235
  });
@@ -9240,7 +9239,7 @@ function yl({
9240
9239
  {
9241
9240
  onMouseMove: y,
9242
9241
  onMouseOut: g,
9243
- onTouchMove: m,
9242
+ onTouchMove: _,
9244
9243
  onTouchEnd: S,
9245
9244
  className: r,
9246
9245
  style: {
@@ -9258,7 +9257,7 @@ function yl({
9258
9257
  ...ol,
9259
9258
  zIndex: u !== void 0 ? u : al
9260
9259
  },
9261
- children: Object.entries(f.peers).map(([_, w]) => {
9260
+ children: Object.entries(f.peers).map(([m, w]) => {
9262
9261
  const A = w[l];
9263
9262
  return A ? /* @__PURE__ */ ce.jsx(
9264
9263
  "div",
@@ -9271,10 +9270,10 @@ function yl({
9271
9270
  },
9272
9271
  children: a ? a({
9273
9272
  color: A.color,
9274
- presence: d == null ? void 0 : d.peers[_]
9273
+ presence: d == null ? void 0 : d.peers[m]
9275
9274
  }) : /* @__PURE__ */ ce.jsx(il, { ...A })
9276
9275
  },
9277
- _
9276
+ m
9278
9277
  ) : null;
9279
9278
  })
9280
9279
  },