@instantdb/react-common 0.22.45 → 0.22.46-experimental.drewh-ssr.19112166667.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.
@@ -1,5 +1,5 @@
1
- import lr, { useRef as ut, useCallback as pe, useSyncExternalStore as kt, useEffect as we, useMemo as It, useState as hr } from "react";
2
- var Mt = { exports: {} }, $e = {};
1
+ import lr, { useRef as at, useCallback as pe, useSyncExternalStore as It, useEffect as we, useMemo as Mt, useState as hr } from "react";
2
+ var Rt = { exports: {} }, $e = {};
3
3
  /**
4
4
  * @license React
5
5
  * react-jsx-runtime.production.min.js
@@ -127,14 +127,14 @@ function Ei() {
127
127
  }
128
128
  return null;
129
129
  }
130
- var U = Object.assign, ye = 0, Ke, Be, Qe, Ge, Ye, hn, pn;
130
+ var U = Object.assign, ye = 0, Ke, Qe, Be, Ge, Ye, hn, pn;
131
131
  function yn() {
132
132
  }
133
133
  yn.__reactDisabledLog = !0;
134
134
  function Jr() {
135
135
  {
136
136
  if (ye === 0) {
137
- Ke = console.log, Be = console.info, Qe = console.warn, Ge = console.error, Ye = console.group, hn = console.groupCollapsed, pn = console.groupEnd;
137
+ Ke = console.log, Qe = console.info, Be = console.warn, Ge = console.error, Ye = console.group, hn = console.groupCollapsed, pn = console.groupEnd;
138
138
  var l = {
139
139
  configurable: !0,
140
140
  enumerable: !0,
@@ -167,10 +167,10 @@ function Ei() {
167
167
  value: Ke
168
168
  }),
169
169
  info: U({}, l, {
170
- value: Be
170
+ value: Qe
171
171
  }),
172
172
  warn: U({}, l, {
173
- value: Qe
173
+ value: Be
174
174
  }),
175
175
  error: U({}, l, {
176
176
  value: Ge
@@ -189,27 +189,27 @@ function Ei() {
189
189
  ye < 0 && S("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
190
190
  }
191
191
  }
192
- var bt = m.ReactCurrentDispatcher, _t;
192
+ var _t = m.ReactCurrentDispatcher, gt;
193
193
  function He(l, y, _) {
194
194
  {
195
- if (_t === void 0)
195
+ if (gt === void 0)
196
196
  try {
197
197
  throw Error();
198
198
  } catch (P) {
199
199
  var v = P.stack.trim().match(/\n( *(at )?)/);
200
- _t = v && v[1] || "";
200
+ gt = v && v[1] || "";
201
201
  }
202
202
  return `
203
- ` + _t + l;
203
+ ` + gt + l;
204
204
  }
205
205
  }
206
- var gt = !1, Je;
206
+ var Tt = !1, Je;
207
207
  {
208
208
  var Xr = typeof WeakMap == "function" ? WeakMap : Map;
209
209
  Je = new Xr();
210
210
  }
211
211
  function bn(l, y) {
212
- if (!l || gt)
212
+ if (!l || Tt)
213
213
  return "";
214
214
  {
215
215
  var _ = Je.get(l);
@@ -217,11 +217,11 @@ function Ei() {
217
217
  return _;
218
218
  }
219
219
  var v;
220
- gt = !0;
220
+ Tt = !0;
221
221
  var P = Error.prepareStackTrace;
222
222
  Error.prepareStackTrace = void 0;
223
223
  var k;
224
- k = bt.current, bt.current = null, Jr();
224
+ k = _t.current, _t.current = null, Jr();
225
225
  try {
226
226
  if (y) {
227
227
  var j = function() {
@@ -234,47 +234,47 @@ function Ei() {
234
234
  }), typeof Reflect == "object" && Reflect.construct) {
235
235
  try {
236
236
  Reflect.construct(j, []);
237
- } catch (Q) {
238
- v = Q;
237
+ } catch (G) {
238
+ v = G;
239
239
  }
240
240
  Reflect.construct(l, [], j);
241
241
  } else {
242
242
  try {
243
243
  j.call();
244
- } catch (Q) {
245
- v = Q;
244
+ } catch (G) {
245
+ v = G;
246
246
  }
247
247
  l.call(j.prototype);
248
248
  }
249
249
  } else {
250
250
  try {
251
251
  throw Error();
252
- } catch (Q) {
253
- v = Q;
252
+ } catch (G) {
253
+ v = G;
254
254
  }
255
255
  l();
256
256
  }
257
- } catch (Q) {
258
- if (Q && v && typeof Q.stack == "string") {
259
- for (var A = Q.stack.split(`
257
+ } catch (G) {
258
+ if (G && v && typeof G.stack == "string") {
259
+ for (var A = G.stack.split(`
260
260
  `), K = v.stack.split(`
261
- `), M = A.length - 1, $ = K.length - 1; M >= 1 && $ >= 0 && A[M] !== K[$]; )
262
- $--;
263
- for (; M >= 1 && $ >= 0; M--, $--)
264
- if (A[M] !== K[$]) {
265
- if (M !== 1 || $ !== 1)
261
+ `), R = A.length - 1, D = K.length - 1; R >= 1 && D >= 0 && A[R] !== K[D]; )
262
+ D--;
263
+ for (; R >= 1 && D >= 0; R--, D--)
264
+ if (A[R] !== K[D]) {
265
+ if (R !== 1 || D !== 1)
266
266
  do
267
- if (M--, $--, $ < 0 || A[M] !== K[$]) {
267
+ if (R--, D--, D < 0 || A[R] !== K[D]) {
268
268
  var ee = `
269
- ` + A[M].replace(" at new ", " at ");
269
+ ` + A[R].replace(" at new ", " at ");
270
270
  return l.displayName && ee.includes("<anonymous>") && (ee = ee.replace("<anonymous>", l.displayName)), typeof l == "function" && Je.set(l, ee), ee;
271
271
  }
272
- while (M >= 1 && $ >= 0);
272
+ while (R >= 1 && D >= 0);
273
273
  break;
274
274
  }
275
275
  }
276
276
  } finally {
277
- gt = !1, bt.current = k, Zr(), Error.prepareStackTrace = P;
277
+ Tt = !1, _t.current = k, Zr(), Error.prepareStackTrace = P;
278
278
  }
279
279
  var Oe = l ? l.displayName || l.name : "", be = Oe ? He(Oe) : "";
280
280
  return typeof l == "function" && Je.set(l, be), be;
@@ -335,15 +335,15 @@ function Ei() {
335
335
  throw K.name = "Invariant Violation", K;
336
336
  }
337
337
  A = l[j](y, j, v, _, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
338
- } catch (M) {
339
- A = M;
338
+ } catch (R) {
339
+ A = R;
340
340
  }
341
341
  A && !(A instanceof Error) && (Xe(P), S("%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).", v || "React class", _, j, typeof A), Xe(null)), A instanceof Error && !(A.message in _n) && (_n[A.message] = !0, Xe(P), S("Failed %s type: %s", _, A.message), Xe(null));
342
342
  }
343
343
  }
344
344
  }
345
345
  var ri = Array.isArray;
346
- function Tt(l) {
346
+ function wt(l) {
347
347
  return ri(l);
348
348
  }
349
349
  function ii(l) {
@@ -449,18 +449,18 @@ function Ei() {
449
449
  for (k in y)
450
450
  Re.call(y, k) && !oi.hasOwnProperty(k) && (j[k] = y[k]);
451
451
  if (l && l.defaultProps) {
452
- var M = l.defaultProps;
453
- for (k in M)
454
- j[k] === void 0 && (j[k] = M[k]);
452
+ var R = l.defaultProps;
453
+ for (k in R)
454
+ j[k] === void 0 && (j[k] = R[k]);
455
455
  }
456
456
  if (A || K) {
457
- var $ = typeof l == "function" ? l.displayName || l.name || "Unknown" : l;
458
- A && di(j, $), K && fi(j, $);
457
+ var D = typeof l == "function" ? l.displayName || l.name || "Unknown" : l;
458
+ A && di(j, D), K && fi(j, D);
459
459
  }
460
460
  return li(l, A, K, P, v, mn.current, j);
461
461
  }
462
462
  }
463
- var wt = m.ReactCurrentOwner, On = m.ReactDebugCurrentFrame;
463
+ var mt = m.ReactCurrentOwner, On = m.ReactDebugCurrentFrame;
464
464
  function ve(l) {
465
465
  if (l) {
466
466
  var y = l._owner, _ = Ze(l.type, l._source, y ? y.type : null);
@@ -468,15 +468,15 @@ function Ei() {
468
468
  } else
469
469
  On.setExtraStackFrame(null);
470
470
  }
471
- var mt;
472
- mt = !1;
473
- function St(l) {
471
+ var St;
472
+ St = !1;
473
+ function vt(l) {
474
474
  return typeof l == "object" && l !== null && l.$$typeof === n;
475
475
  }
476
476
  function En() {
477
477
  {
478
- if (wt.current) {
479
- var l = F(wt.current.type);
478
+ if (mt.current) {
479
+ var l = F(mt.current.type);
480
480
  if (l)
481
481
  return `
482
482
 
@@ -511,25 +511,25 @@ Check the top-level render call using <` + _ + ">.");
511
511
  return;
512
512
  An[_] = !0;
513
513
  var v = "";
514
- l && l._owner && l._owner !== wt.current && (v = " It was passed a child from " + F(l._owner.type) + "."), ve(l), S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', _, v), ve(null);
514
+ l && l._owner && l._owner !== mt.current && (v = " It was passed a child from " + F(l._owner.type) + "."), ve(l), S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', _, v), ve(null);
515
515
  }
516
516
  }
517
517
  function jn(l, y) {
518
518
  {
519
519
  if (typeof l != "object")
520
520
  return;
521
- if (Tt(l))
521
+ if (wt(l))
522
522
  for (var _ = 0; _ < l.length; _++) {
523
523
  var v = l[_];
524
- St(v) && Cn(v, y);
524
+ vt(v) && Cn(v, y);
525
525
  }
526
- else if (St(l))
526
+ else if (vt(l))
527
527
  l._store && (l._store.validated = !0);
528
528
  else if (l) {
529
529
  var P = T(l);
530
530
  if (typeof P == "function" && P !== l.entries)
531
531
  for (var k = P.call(l), j; !(j = k.next()).done; )
532
- St(j.value) && Cn(j.value, y);
532
+ vt(j.value) && Cn(j.value, y);
533
533
  }
534
534
  }
535
535
  }
@@ -550,8 +550,8 @@ Check the top-level render call using <` + _ + ">.");
550
550
  if (_) {
551
551
  var v = F(y);
552
552
  ni(_, l.props, "prop", v, l);
553
- } else if (y.PropTypes !== void 0 && !mt) {
554
- mt = !0;
553
+ } else if (y.PropTypes !== void 0 && !St) {
554
+ St = !0;
555
555
  var P = F(y);
556
556
  S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", P || "Unknown");
557
557
  }
@@ -579,17 +579,17 @@ Check the top-level render call using <` + _ + ">.");
579
579
  (l === void 0 || typeof l == "object" && l !== null && Object.keys(l).length === 0) && (A += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
580
580
  var K = pi();
581
581
  K ? A += K : A += En();
582
- var M;
583
- l === null ? M = "null" : Tt(l) ? M = "array" : l !== void 0 && l.$$typeof === n ? (M = "<" + (F(l.type) || "Unknown") + " />", A = " Did you accidentally export a JSX literal instead of a component?") : M = typeof l, S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", M, A);
582
+ var R;
583
+ l === null ? R = "null" : wt(l) ? R = "array" : l !== void 0 && l.$$typeof === n ? (R = "<" + (F(l.type) || "Unknown") + " />", A = " Did you accidentally export a JSX literal instead of a component?") : R = typeof l, S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", R, A);
584
584
  }
585
- var $ = hi(l, y, _, P, k);
586
- if ($ == null)
587
- return $;
585
+ var D = hi(l, y, _, P, k);
586
+ if (D == null)
587
+ return D;
588
588
  if (j) {
589
589
  var ee = y.children;
590
590
  if (ee !== void 0)
591
591
  if (v)
592
- if (Tt(ee)) {
592
+ if (wt(ee)) {
593
593
  for (var Oe = 0; Oe < ee.length; Oe++)
594
594
  jn(ee[Oe], l);
595
595
  Object.freeze && Object.freeze(ee);
@@ -599,20 +599,20 @@ Check the top-level render call using <` + _ + ">.");
599
599
  jn(ee, l);
600
600
  }
601
601
  if (Re.call(y, "key")) {
602
- var be = F(l), Q = Object.keys(y).filter(function(vi) {
602
+ var be = F(l), G = Object.keys(y).filter(function(vi) {
603
603
  return vi !== "key";
604
- }), vt = Q.length > 0 ? "{key: someKey, " + Q.join(": ..., ") + ": ...}" : "{key: someKey}";
605
- if (!Pn[be + vt]) {
606
- var Si = Q.length > 0 ? "{" + Q.join(": ..., ") + ": ...}" : "{}";
604
+ }), Ot = G.length > 0 ? "{key: someKey, " + G.join(": ..., ") + ": ...}" : "{key: someKey}";
605
+ if (!Pn[be + Ot]) {
606
+ var Si = G.length > 0 ? "{" + G.join(": ..., ") + ": ...}" : "{}";
607
607
  S(`A props object containing a "key" prop is being spread into JSX:
608
608
  let props = %s;
609
609
  <%s {...props} />
610
610
  React keys must be passed directly to JSX without using spread:
611
611
  let props = %s;
612
- <%s key={someKey} {...props} />`, vt, be, Si, be), Pn[be + vt] = !0;
612
+ <%s key={someKey} {...props} />`, Ot, be, Si, be), Pn[be + Ot] = !0;
613
613
  }
614
614
  }
615
- return l === i ? _i($) : bi($), $;
615
+ return l === i ? _i(D) : bi(D), D;
616
616
  }
617
617
  }
618
618
  function gi(l, y, _) {
@@ -626,9 +626,9 @@ React keys must be passed directly to JSX without using spread:
626
626
  }(), De;
627
627
  }
628
628
  var Ai = {};
629
- Ai.NODE_ENV === "production" ? Mt.exports = Oi() : Mt.exports = Ei();
630
- var et = Mt.exports;
631
- function G(e) {
629
+ Ai.NODE_ENV === "production" ? Rt.exports = Oi() : Rt.exports = Ei();
630
+ var et = Rt.exports;
631
+ function Q(e) {
632
632
  if (typeof e == "number")
633
633
  return (Math.abs(e * 2654435761) >>> 0).toString(16);
634
634
  if (typeof e == "boolean")
@@ -647,7 +647,7 @@ function G(e) {
647
647
  let t = 2166136261;
648
648
  for (let n = 0; n < e.length; n++) {
649
649
  t ^= (n + 1) * 2654435761;
650
- const r = G(e[n]);
650
+ const r = Q(e[n]);
651
651
  for (let i = 0; i < r.length; i++)
652
652
  t ^= r.charCodeAt(i), t *= 16777619, t = t >>> 0;
653
653
  }
@@ -657,16 +657,16 @@ function G(e) {
657
657
  let t = 2166136261;
658
658
  const n = Object.keys(e).sort();
659
659
  for (let r = 0; r < n.length; r++) {
660
- const i = n[r], s = G(i);
660
+ const i = n[r], s = Q(i);
661
661
  t ^= parseInt(s, 16), t *= 16777619, t = t >>> 0;
662
- const o = G(e[i]);
662
+ const o = Q(e[i]);
663
663
  t ^= parseInt(o, 16), t *= 16777619, t = t >>> 0;
664
664
  }
665
665
  return t.toString(16);
666
666
  }
667
- return G(String(e));
667
+ return Q(String(e));
668
668
  }
669
- const R = {
669
+ const $ = {
670
670
  Remove: "remove",
671
671
  Replace: "replace",
672
672
  Add: "add"
@@ -744,14 +744,14 @@ function le(e, t) {
744
744
  function qe(e, t, n) {
745
745
  Se(e) === 2 ? e.set(t, n) : e[t] = n;
746
746
  }
747
- function Ot(e, t) {
747
+ function Et(e, t) {
748
748
  const n = C(e);
749
749
  return (n ? Z(n) : e)[t];
750
750
  }
751
751
  function fe(e, t) {
752
752
  return e === t ? e !== 0 || 1 / e === 1 / t : e !== e && t !== t;
753
753
  }
754
- function Rt(e) {
754
+ function $t(e) {
755
755
  if (e)
756
756
  for (; e.finalities.revoke.length > 0; )
757
757
  e.finalities.revoke.pop()();
@@ -947,12 +947,12 @@ function Ii(e, t) {
947
947
  const n = e.type === 3 ? e.setMap : e.copy;
948
948
  e.finalities.revoke.length > 1 && e.assignedMap.get(t) && n && _r(le(n, t), e.finalities.handledSet, e.options);
949
949
  }
950
- function $t(e) {
950
+ function Dt(e) {
951
951
  e.type === 3 && e.copy && (e.copy.clear(), e.setMap.forEach((t) => {
952
952
  e.copy.add(tn(t));
953
953
  }));
954
954
  }
955
- function Dt(e, t, n, r) {
955
+ function xt(e, t, n, r) {
956
956
  if (e.operated && e.assignedMap && e.assignedMap.size > 0 && !e.finalized) {
957
957
  if (n && r) {
958
958
  const s = yr(e);
@@ -968,7 +968,7 @@ function rn(e, t, n, r) {
968
968
  const a = e.type === 3 ? e.setMap : e.copy;
969
969
  if (fe(le(a, t), n)) {
970
970
  let d = i.original;
971
- i.copy && (d = i.copy), $t(e), Dt(e, r, s, o), e.options.enableAutoFreeze && (e.options.updatedValues = (u = e.options.updatedValues) !== null && u !== void 0 ? u : /* @__PURE__ */ new WeakMap(), e.options.updatedValues.set(d, i.original)), qe(a, t, d);
971
+ i.copy && (d = i.copy), Dt(e), xt(e, r, s, o), e.options.enableAutoFreeze && (e.options.updatedValues = (u = e.options.updatedValues) !== null && u !== void 0 ? u : /* @__PURE__ */ new WeakMap(), e.options.updatedValues.set(d, i.original)), qe(a, t, d);
972
972
  }
973
973
  }), e.options.enableAutoFreeze && i.finalities !== e.finalities && (e.options.enableAutoFreeze = !1)), ie(n, e.options) && e.finalities.draft.push(() => {
974
974
  const s = e.type === 3 ? e.setMap : e.copy;
@@ -982,12 +982,12 @@ function Mi(e, t, n, r, i) {
982
982
  if (o.get(d.toString()) && a[d] !== s[d]) {
983
983
  const c = t.concat([d]), f = ge(c, i);
984
984
  n.push({
985
- op: R.Replace,
985
+ op: $.Replace,
986
986
  path: f,
987
987
  // If it is a draft, it needs to be deep cloned, and it may also be non-draft.
988
988
  value: st(a[d])
989
989
  }), r.push({
990
- op: R.Replace,
990
+ op: $.Replace,
991
991
  path: f,
992
992
  // If it is a draft, it needs to be deep cloned, and it may also be non-draft.
993
993
  value: st(s[d])
@@ -996,7 +996,7 @@ function Mi(e, t, n, r, i) {
996
996
  for (let d = s.length; d < a.length; d += 1) {
997
997
  const c = t.concat([d]), f = ge(c, i);
998
998
  n.push({
999
- op: R.Add,
999
+ op: $.Add,
1000
1000
  path: f,
1001
1001
  // If it is a draft, it needs to be deep cloned, and it may also be non-draft.
1002
1002
  value: st(a[d])
@@ -1007,7 +1007,7 @@ function Mi(e, t, n, r, i) {
1007
1007
  if (d) {
1008
1008
  const c = t.concat(["length"]), f = ge(c, i);
1009
1009
  r.push({
1010
- op: R.Replace,
1010
+ op: $.Replace,
1011
1011
  path: f,
1012
1012
  value: s.length
1013
1013
  });
@@ -1015,7 +1015,7 @@ function Mi(e, t, n, r, i) {
1015
1015
  for (let c = a.length; s.length < c; c -= 1) {
1016
1016
  const f = t.concat([c - 1]), h = ge(f, i);
1017
1017
  r.push({
1018
- op: R.Remove,
1018
+ op: $.Remove,
1019
1019
  path: h
1020
1020
  });
1021
1021
  }
@@ -1023,11 +1023,11 @@ function Mi(e, t, n, r, i) {
1023
1023
  }
1024
1024
  function Ri({ original: e, copy: t, assignedMap: n }, r, i, s, o) {
1025
1025
  n.forEach((u, a) => {
1026
- const d = le(e, a), c = st(le(t, a)), f = u ? Fe(e, a) ? R.Replace : R.Add : R.Remove;
1027
- if (fe(d, c) && f === R.Replace)
1026
+ const d = le(e, a), c = st(le(t, a)), f = u ? Fe(e, a) ? $.Replace : $.Add : $.Remove;
1027
+ if (fe(d, c) && f === $.Replace)
1028
1028
  return;
1029
1029
  const h = r.concat(a), p = ge(h, o);
1030
- i.push(f === R.Remove ? { op: f, path: p } : { op: f, path: p, value: c }), s.push(f === R.Add ? { op: R.Remove, path: p } : f === R.Remove ? { op: R.Add, path: p, value: d } : { op: R.Replace, path: p, value: d });
1030
+ i.push(f === $.Remove ? { op: f, path: p } : { op: f, path: p, value: c }), s.push(f === $.Add ? { op: $.Remove, path: p } : f === $.Remove ? { op: $.Add, path: p, value: d } : { op: $.Replace, path: p, value: d });
1031
1031
  });
1032
1032
  }
1033
1033
  function $i({ original: e, copy: t }, n, r, i, s) {
@@ -1036,11 +1036,11 @@ function $i({ original: e, copy: t }, n, r, i, s) {
1036
1036
  if (!t.has(u)) {
1037
1037
  const a = n.concat([o]), d = ge(a, s);
1038
1038
  r.push({
1039
- op: R.Remove,
1039
+ op: $.Remove,
1040
1040
  path: d,
1041
1041
  value: u
1042
1042
  }), i.unshift({
1043
- op: R.Add,
1043
+ op: $.Add,
1044
1044
  path: d,
1045
1045
  value: u
1046
1046
  });
@@ -1050,11 +1050,11 @@ function $i({ original: e, copy: t }, n, r, i, s) {
1050
1050
  if (!e.has(u)) {
1051
1051
  const a = n.concat([o]), d = ge(a, s);
1052
1052
  r.push({
1053
- op: R.Add,
1053
+ op: $.Add,
1054
1054
  path: d,
1055
1055
  value: u
1056
1056
  }), i.unshift({
1057
- op: R.Remove,
1057
+ op: $.Remove,
1058
1058
  path: d,
1059
1059
  value: u
1060
1060
  });
@@ -1074,10 +1074,10 @@ function Ve(e, t, n, r) {
1074
1074
  return $i(e, t, n, r, i);
1075
1075
  }
1076
1076
  }
1077
- const at = (e, t, n = !1) => {
1077
+ const ct = (e, t, n = !1) => {
1078
1078
  if (typeof e == "object" && e !== null && (!ie(e, t) || n))
1079
1079
  throw new Error("Strict mode: Mutable data cannot be accessed directly, please use 'unsafe(callback)' wrap.");
1080
- }, xt = {
1080
+ }, Ut = {
1081
1081
  get size() {
1082
1082
  return Z(C(this)).size;
1083
1083
  },
@@ -1112,7 +1112,7 @@ const at = (e, t, n = !1) => {
1112
1112
  get(e) {
1113
1113
  var t, n;
1114
1114
  const r = C(this), i = Z(r).get(e), s = ((n = (t = r.options).mark) === null || n === void 0 ? void 0 : n.call(t, i, X)) === X.mutable;
1115
- if (r.options.strict && at(i, r.options, s), s || r.finalized || !ie(i, r.options) || i !== r.original.get(e))
1115
+ if (r.options.strict && ct(i, r.options, s), s || r.finalized || !ie(i, r.options) || i !== r.original.get(e))
1116
1116
  return i;
1117
1117
  const o = Zt.createDraft({
1118
1118
  original: i,
@@ -1158,7 +1158,7 @@ const at = (e, t, n = !1) => {
1158
1158
  [it]() {
1159
1159
  return this.entries();
1160
1160
  }
1161
- }, Di = Reflect.ownKeys(xt), Dn = (e, t, { isValuesIterator: n }) => () => {
1161
+ }, Di = Reflect.ownKeys(Ut), Dn = (e, t, { isValuesIterator: n }) => () => {
1162
1162
  var r, i;
1163
1163
  const s = t.next();
1164
1164
  if (s.done)
@@ -1166,7 +1166,7 @@ const at = (e, t, n = !1) => {
1166
1166
  const o = s.value;
1167
1167
  let u = e.setMap.get(o);
1168
1168
  const a = C(u), d = ((i = (r = e.options).mark) === null || i === void 0 ? void 0 : i.call(r, u, X)) === X.mutable;
1169
- if (e.options.strict && at(o, e.options, d), !d && !a && ie(o, e.options) && !e.finalized && e.original.has(o)) {
1169
+ if (e.options.strict && ct(o, e.options, d), !d && !a && ie(o, e.options) && !e.finalized && e.original.has(o)) {
1170
1170
  const c = Zt.createDraft({
1171
1171
  original: o,
1172
1172
  parentDraft: e,
@@ -1180,7 +1180,7 @@ const at = (e, t, n = !1) => {
1180
1180
  done: !1,
1181
1181
  value: n ? u : [u, u]
1182
1182
  };
1183
- }, ct = {
1183
+ }, dt = {
1184
1184
  get size() {
1185
1185
  return C(this).setMap.size;
1186
1186
  },
@@ -1246,7 +1246,7 @@ const at = (e, t, n = !1) => {
1246
1246
  e.call(t, r.value, r.value, this), r = n.next();
1247
1247
  }
1248
1248
  };
1249
- Set.prototype.difference && Object.assign(ct, {
1249
+ Set.prototype.difference && Object.assign(dt, {
1250
1250
  intersection(e) {
1251
1251
  return Set.prototype.intersection.call(new Set(this.values()), e);
1252
1252
  },
@@ -1269,7 +1269,7 @@ Set.prototype.difference && Object.assign(ct, {
1269
1269
  return Set.prototype.isDisjointFrom.call(new Set(this.values()), e);
1270
1270
  }
1271
1271
  });
1272
- const xi = Reflect.ownKeys(ct), gr = /* @__PURE__ */ new WeakSet(), Tr = {
1272
+ const xi = Reflect.ownKeys(dt), gr = /* @__PURE__ */ new WeakSet(), Tr = {
1273
1273
  get(e, t, n) {
1274
1274
  var r, i;
1275
1275
  const s = (r = e.copy) === null || r === void 0 ? void 0 : r[t];
@@ -1281,20 +1281,20 @@ const xi = Reflect.ownKeys(ct), gr = /* @__PURE__ */ new WeakSet(), Tr = {
1281
1281
  if (e.options.mark) {
1282
1282
  const d = t === "size" && (e.original instanceof Map || e.original instanceof Set) ? Reflect.get(e.original, t) : Reflect.get(e.original, t, n);
1283
1283
  if (o = e.options.mark(d, X), o === X.mutable)
1284
- return e.options.strict && at(d, e.options, !0), d;
1284
+ return e.options.strict && ct(d, e.options, !0), d;
1285
1285
  }
1286
1286
  const u = Z(e);
1287
1287
  if (u instanceof Map && Di.includes(t)) {
1288
1288
  if (t === "size")
1289
- return Object.getOwnPropertyDescriptor(xt, "size").get.call(e.proxy);
1290
- const d = xt[t];
1289
+ return Object.getOwnPropertyDescriptor(Ut, "size").get.call(e.proxy);
1290
+ const d = Ut[t];
1291
1291
  if (d)
1292
1292
  return d.bind(e.proxy);
1293
1293
  }
1294
1294
  if (u instanceof Set && xi.includes(t)) {
1295
1295
  if (t === "size")
1296
- return Object.getOwnPropertyDescriptor(ct, "size").get.call(e.proxy);
1297
- const d = ct[t];
1296
+ return Object.getOwnPropertyDescriptor(dt, "size").get.call(e.proxy);
1297
+ const d = dt[t];
1298
1298
  if (d)
1299
1299
  return d.bind(e.proxy);
1300
1300
  }
@@ -1306,9 +1306,9 @@ const xi = Reflect.ownKeys(ct), gr = /* @__PURE__ */ new WeakSet(), Tr = {
1306
1306
  ) : void 0;
1307
1307
  }
1308
1308
  const a = u[t];
1309
- if (e.options.strict && at(a, e.options), e.finalized || !ie(a, e.options))
1309
+ if (e.options.strict && ct(a, e.options), e.finalized || !ie(a, e.options))
1310
1310
  return a;
1311
- if (a === Ot(e.original, t)) {
1311
+ if (a === Et(e.original, t)) {
1312
1312
  if (B(e), e.copy[t] = sn({
1313
1313
  original: e.original[t],
1314
1314
  parentDraft: e,
@@ -1333,7 +1333,7 @@ const xi = Reflect.ownKeys(ct), gr = /* @__PURE__ */ new WeakSet(), Tr = {
1333
1333
  const s = Rn(Z(e), t);
1334
1334
  if (s != null && s.set)
1335
1335
  return s.set.call(e.proxy, n), !0;
1336
- const o = Ot(Z(e), t), u = C(o);
1336
+ const o = Et(Z(e), t), u = C(o);
1337
1337
  return u && fe(u.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) : (fe(n, o) && (n !== void 0 || Fe(e.original, t)) || (B(e), ae(e), Fe(e.original, t) && fe(n, e.original[t]) ? e.assignedMap.delete(t) : e.assignedMap.set(t, !0), e.copy[t] = n, rn(e, t, n, Ve)), !0);
1338
1338
  },
1339
1339
  has(e, t) {
@@ -1362,7 +1362,7 @@ const xi = Reflect.ownKeys(ct), gr = /* @__PURE__ */ new WeakSet(), Tr = {
1362
1362
  },
1363
1363
  deleteProperty(e, t) {
1364
1364
  var n;
1365
- return e.type === 1 ? Tr.set.call(this, e, t, void 0, e.proxy) : (Ot(e.original, t) !== void 0 || t in e.original ? (B(e), ae(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);
1365
+ return e.type === 1 ? Tr.set.call(this, e, t, void 0, e.proxy) : (Et(e.original, t) !== void 0 || t in e.original ? (B(e), ae(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);
1366
1366
  }
1367
1367
  };
1368
1368
  function sn(e) {
@@ -1389,7 +1389,7 @@ function sn(e) {
1389
1389
  const T = le(w, r), m = C(T);
1390
1390
  if (m) {
1391
1391
  let S = m.original;
1392
- m.operated && (S = tn(T)), $t(m), Dt(m, Ve, f, h), c.options.enableAutoFreeze && (c.options.updatedValues = (p = c.options.updatedValues) !== null && p !== void 0 ? p : /* @__PURE__ */ new WeakMap(), c.options.updatedValues.set(S, m.original)), qe(w, r, S);
1392
+ m.operated && (S = tn(T)), Dt(m), xt(m, Ve, f, h), c.options.enableAutoFreeze && (c.options.updatedValues = (p = c.options.updatedValues) !== null && p !== void 0 ? p : /* @__PURE__ */ new WeakMap(), c.options.updatedValues.set(S, m.original)), qe(w, r, S);
1393
1393
  }
1394
1394
  (b = g.callbacks) === null || b === void 0 || b.forEach((S) => {
1395
1395
  S(f, h);
@@ -1398,7 +1398,7 @@ function sn(e) {
1398
1398
  } else {
1399
1399
  const c = C(a);
1400
1400
  c.finalities.draft.push((f, h) => {
1401
- $t(c), Dt(c, Ve, f, h);
1401
+ Dt(c), xt(c, Ve, f, h);
1402
1402
  });
1403
1403
  }
1404
1404
  return a;
@@ -1411,10 +1411,10 @@ function Ui(e, t, n, r, i) {
1411
1411
  for (; o.finalities.draft.length > 0; )
1412
1412
  o.finalities.draft.pop()(n, r);
1413
1413
  const d = a ? t[0] : o ? o.operated ? o.copy : o.original : e;
1414
- return o && Rt(o), i && Ee(d, d, o == null ? void 0 : o.options.updatedValues), [
1414
+ return o && $t(o), i && Ee(d, d, o == null ? void 0 : o.options.updatedValues), [
1415
1415
  d,
1416
- n && a ? [{ op: R.Replace, path: [], value: t[0] }] : n,
1417
- r && a ? [{ op: R.Replace, path: [], value: u }] : r
1416
+ n && a ? [{ op: $.Replace, path: [], value: t[0] }] : n,
1417
+ r && a ? [{ op: $.Replace, path: [], value: u }] : r
1418
1418
  ];
1419
1419
  }
1420
1420
  function Li(e, t) {
@@ -1440,7 +1440,7 @@ function Li(e, t) {
1440
1440
  }
1441
1441
  ];
1442
1442
  }
1443
- function Ut(e) {
1443
+ function Lt(e) {
1444
1444
  const { rootDraft: t, value: n, useRawReturn: r = !1, isRoot: i = !0 } = e;
1445
1445
  nn(n, (s, o, u) => {
1446
1446
  const a = C(o);
@@ -1452,7 +1452,7 @@ function Ut(e) {
1452
1452
  u.clear(), c.forEach((f) => u.add(s === f ? d : f));
1453
1453
  } else
1454
1454
  qe(u, s, d);
1455
- } else typeof o == "object" && o !== null && (e.value = o, e.isRoot = !1, Ut(e));
1455
+ } else typeof o == "object" && o !== null && (e.value = o, e.isRoot = !1, Lt(e));
1456
1456
  }), i && (e.isContainDraft || console.warn("The return value does not contain any draft, please use 'rawReturn()' to wrap the return value to improve performance."), r && console.warn("The return value contains drafts, please don't use 'rawReturn()' to wrap the return value."));
1457
1457
  }
1458
1458
  function wr(e) {
@@ -1529,7 +1529,7 @@ const Fi = (e) => function t(n, r, i) {
1529
1529
  try {
1530
1530
  S = d(T);
1531
1531
  } catch (E) {
1532
- throw Rt(C(T)), E;
1532
+ throw $t(C(T)), E;
1533
1533
  }
1534
1534
  const W = (E) => {
1535
1535
  const x = C(T);
@@ -1539,14 +1539,14 @@ const Fi = (e) => function t(n, r, i) {
1539
1539
  const oe = E == null ? void 0 : E[Ci];
1540
1540
  if (oe) {
1541
1541
  const O = oe[0];
1542
- return w.strict && typeof E == "object" && E !== null && Ut({
1542
+ return w.strict && typeof E == "object" && E !== null && Lt({
1543
1543
  rootDraft: x,
1544
1544
  value: E,
1545
1545
  useRawReturn: !0
1546
1546
  }), m([O]);
1547
1547
  }
1548
1548
  if (E !== void 0)
1549
- return typeof E == "object" && E !== null && Ut({ rootDraft: x, value: E }), m([E]);
1549
+ return typeof E == "object" && E !== null && Lt({ rootDraft: x, value: E }), m([E]);
1550
1550
  }
1551
1551
  if (E === T || E === void 0)
1552
1552
  return m([]);
@@ -1559,9 +1559,9 @@ const Fi = (e) => function t(n, r, i) {
1559
1559
  return m([E]);
1560
1560
  };
1561
1561
  return S instanceof Promise ? S.then(W, (E) => {
1562
- throw Rt(C(T)), E;
1562
+ throw $t(C(T)), E;
1563
1563
  }) : W(S);
1564
- }, Lt = Fi();
1564
+ }, Ft = Fi();
1565
1565
  Object.prototype.constructor.toString();
1566
1566
  function mr(e, t) {
1567
1567
  const n = Object.keys(e), r = Object.keys(t);
@@ -1839,14 +1839,14 @@ function zi(e) {
1839
1839
  return /* @__PURE__ */ new Date(e + "Z");
1840
1840
  }
1841
1841
  const Ki = /^(\d+)[\./-](\d+)[\./-](\d+)$/;
1842
- function Bi(e) {
1842
+ function Qi(e) {
1843
1843
  const t = e.match(Ki);
1844
1844
  if (!t)
1845
1845
  return null;
1846
1846
  const [n, r, i, s] = t;
1847
1847
  return r <= 0 || i <= 0 || s <= 0 ? null : r > 999 ? new Date(Date.UTC(r, i - 1, s, 0, 0, 0, 0)) : new Date(Date.UTC(s, r - 1, i, 0, 0, 0, 0));
1848
1848
  }
1849
- function Qi(e) {
1849
+ function Bi(e) {
1850
1850
  const [t, n] = e.split(" ");
1851
1851
  return /* @__PURE__ */ new Date(t + "T" + n + "Z");
1852
1852
  }
@@ -1899,14 +1899,14 @@ function es(e) {
1899
1899
  return new Date(i.getTime() - r * 1e3);
1900
1900
  }
1901
1901
  const ts = [
1902
- Bi,
1902
+ Qi,
1903
1903
  Gi,
1904
1904
  Hi,
1905
1905
  Zi,
1906
1906
  Yi,
1907
1907
  zi,
1908
1908
  Ji,
1909
- Qi,
1909
+ Bi,
1910
1910
  Wi,
1911
1911
  Xi,
1912
1912
  es
@@ -1919,7 +1919,7 @@ function ns(e, t) {
1919
1919
  return null;
1920
1920
  }
1921
1921
  }
1922
- function Ft(e) {
1922
+ function Nt(e) {
1923
1923
  for (const t of ts) {
1924
1924
  const n = ns(t, e);
1925
1925
  if (n)
@@ -1930,19 +1930,19 @@ function Ft(e) {
1930
1930
  function rs(e) {
1931
1931
  try {
1932
1932
  const t = JSON.parse(e);
1933
- return typeof t == "string" ? Ft(t) : null;
1933
+ return typeof t == "string" ? Nt(t) : null;
1934
1934
  } catch {
1935
1935
  return null;
1936
1936
  }
1937
1937
  }
1938
- function lt(e) {
1938
+ function ht(e) {
1939
1939
  if (e !== void 0) {
1940
1940
  if (e === null)
1941
1941
  return null;
1942
1942
  if (e instanceof Date)
1943
1943
  return e;
1944
1944
  if (typeof e == "string") {
1945
- const t = Ft(e) || rs(e) || Ft(e.trim());
1945
+ const t = Nt(e) || rs(e) || Nt(e.trim());
1946
1946
  if (!t)
1947
1947
  throw new Error(`Unable to parse \`${e}\` as a date.`);
1948
1948
  return t;
@@ -1963,7 +1963,7 @@ function an(e) {
1963
1963
  function Ie(e, t) {
1964
1964
  return e[t];
1965
1965
  }
1966
- function ht(e, t) {
1966
+ function pt(e, t) {
1967
1967
  return t.reduce((n, r) => n && n.get(r), e);
1968
1968
  }
1969
1969
  function re(e, t) {
@@ -1996,7 +1996,7 @@ function Or(e, t, n) {
1996
1996
  console.warn("no such attr", u, e);
1997
1997
  continue;
1998
1998
  }
1999
- f["checked-data-type"] === "date" && n && (d = lt(d), o[2] = d), un(f) && Y(s, [d, a, u], o), Y(r, [u, a, d], o), Y(i, [a, u, d], o);
1999
+ f["checked-data-type"] === "date" && n && (d = ht(d), o[2] = d), un(f) && Y(s, [d, a, u], o), Y(r, [u, a, d], o), Y(i, [a, u, d], o);
2000
2000
  }
2001
2001
  return { eav: r, aev: i, vae: s };
2002
2002
  }
@@ -2022,12 +2022,12 @@ function ss(e) {
2022
2022
  };
2023
2023
  }
2024
2024
  function os(e) {
2025
- return Nt(e.attrs, e.triples, e.cardinalityInference, e.linkIndex, e.useDateObjects);
2025
+ return ut(e.attrs, e.triples, e.cardinalityInference, e.linkIndex, e.useDateObjects);
2026
2026
  }
2027
2027
  function cn(e) {
2028
2028
  e.attrIndexes = Er(e.attrs);
2029
2029
  }
2030
- function Nt(e, t, n, r, i) {
2030
+ function ut(e, t, n, r, i) {
2031
2031
  const s = Or(e, t, i);
2032
2032
  return s.useDateObjects = i, s.attrs = e, s.attrIndexes = Er(e), s.cardinalityInference = n, s.linkIndex = r, s.__type = "store", s;
2033
2033
  }
@@ -2069,7 +2069,7 @@ let as = 0;
2069
2069
  function Ar(e, t, n) {
2070
2070
  const [r, i, s] = n;
2071
2071
  let o;
2072
- const u = ht(e.ea, [r, i, s]);
2072
+ const u = pt(e.ea, [r, i, s]);
2073
2073
  return u && (o = u[3]), o || Date.now() * 10 + as++;
2074
2074
  }
2075
2075
  function cs(e, t) {
@@ -2081,8 +2081,8 @@ function cs(e, t) {
2081
2081
  const u = Ie(e.attrs, s);
2082
2082
  if (!u)
2083
2083
  return;
2084
- u["checked-data-type"] === "date" && e.useDateObjects && (o = lt(o));
2085
- const a = ht(e.eav, [i, s, o]), d = (n = a == null ? void 0 : a[3]) !== null && n !== void 0 ? n : Ar(e, u, r), c = [i, s, o, d];
2084
+ u["checked-data-type"] === "date" && e.useDateObjects && (o = ht(o));
2085
+ const a = pt(e.eav, [i, s, o]), d = (n = a == null ? void 0 : a[3]) !== null && n !== void 0 ? n : Ar(e, u, r), c = [i, s, o, d];
2086
2086
  is(u) ? (Y(e.eav, [i, s], /* @__PURE__ */ new Map([[o, c]])), Y(e.aev, [s, i], /* @__PURE__ */ new Map([[o, c]]))) : (Y(e.eav, [i, s, o], c), Y(e.aev, [s, i, o], c)), un(u) && Y(e.vae, [o, s, i], c);
2087
2087
  }
2088
2088
  function ds(e, t) {
@@ -2095,7 +2095,7 @@ function ds(e, t) {
2095
2095
  return;
2096
2096
  if (!an(u))
2097
2097
  throw new Error("merge operation is not supported for links");
2098
- const a = ht(e.eav, [i, s]);
2098
+ const a = pt(e.eav, [i, s]);
2099
2099
  if (!a)
2100
2100
  return;
2101
2101
  const d = (n = a.values().next()) === null || n === void 0 ? void 0 : n.value;
@@ -2319,7 +2319,7 @@ function Ts(e, t) {
2319
2319
  return;
2320
2320
  const [r, i, s] = n;
2321
2321
  if (Ie(e.attrs, i))
2322
- return ht(e.eav, [r, i]);
2322
+ return pt(e.eav, [r, i]);
2323
2323
  }
2324
2324
  function ws(e, t) {
2325
2325
  const n = t.filter(([r, i, s, o, u]) => {
@@ -2336,7 +2336,7 @@ function ws(e, t) {
2336
2336
  }
2337
2337
  return !(a === "create" && d || a === "update" && !d);
2338
2338
  });
2339
- return Lt(e, (r) => {
2339
+ return Ft(e, (r) => {
2340
2340
  n.forEach((i) => {
2341
2341
  ps(r, i);
2342
2342
  });
@@ -2414,15 +2414,15 @@ for (let e = 0; e < 256; ++e)
2414
2414
  function Ms(e, t = 0) {
2415
2415
  return (N[e[t + 0]] + N[e[t + 1]] + N[e[t + 2]] + N[e[t + 3]] + "-" + N[e[t + 4]] + N[e[t + 5]] + "-" + N[e[t + 6]] + N[e[t + 7]] + "-" + N[e[t + 8]] + N[e[t + 9]] + "-" + N[e[t + 10]] + N[e[t + 11]] + N[e[t + 12]] + N[e[t + 13]] + N[e[t + 14]] + N[e[t + 15]]).toLowerCase();
2416
2416
  }
2417
- let Et;
2417
+ let At;
2418
2418
  const Rs = new Uint8Array(16);
2419
2419
  function $s() {
2420
- if (!Et) {
2420
+ if (!At) {
2421
2421
  if (typeof crypto > "u" || !crypto.getRandomValues)
2422
2422
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
2423
- Et = crypto.getRandomValues.bind(crypto);
2423
+ At = crypto.getRandomValues.bind(crypto);
2424
2424
  }
2425
- return Et(Rs);
2425
+ return At(Rs);
2426
2426
  }
2427
2427
  const Ds = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), Vn = { randomUUID: Ds };
2428
2428
  function xs(e, t, n) {
@@ -2471,9 +2471,9 @@ function Ns() {
2471
2471
  const Vs = Ns();
2472
2472
  let qs = 0;
2473
2473
  function Ne(e) {
2474
- return pt(`_${e}`, qs++);
2474
+ return yt(`_${e}`, qs++);
2475
2475
  }
2476
- function pt(e, t) {
2476
+ function yt(e, t) {
2477
2477
  return `?${e}-${t}`;
2478
2478
  }
2479
2479
  class Pe extends Error {
@@ -2530,7 +2530,7 @@ function zn(e, t) {
2530
2530
  return typeof o != "string" ? !1 : i.test(o);
2531
2531
  };
2532
2532
  }
2533
- function Bs(e, t) {
2533
+ function Qs(e, t) {
2534
2534
  if (typeof t != "object" || t.hasOwnProperty("$in") || t.hasOwnProperty("in"))
2535
2535
  return t;
2536
2536
  const n = e["checked-data-type"] === "date";
@@ -2590,7 +2590,7 @@ function Bs(e, t) {
2590
2590
  }
2591
2591
  return t;
2592
2592
  }
2593
- function Qs(e, t, n, r, i, s) {
2593
+ function Bs(e, t, n, r, i, s) {
2594
2594
  const o = Ce(t, n, i), u = Pr(t, n, i), a = o || u;
2595
2595
  if (!a)
2596
2596
  throw new Pe(`No attr for etype = ${n} label = ${i}`);
@@ -2608,7 +2608,7 @@ function Qs(e, t, n, r, i, s) {
2608
2608
  return o ? [
2609
2609
  e(n, r),
2610
2610
  a.id,
2611
- Bs(a, s),
2611
+ Qs(a, s),
2612
2612
  Ne("time")
2613
2613
  ] : [s, a.id, e(n, r), Ne("time")];
2614
2614
  }
@@ -2620,7 +2620,7 @@ function Gs(e, t, n, r, i) {
2620
2620
  return [s, o, u];
2621
2621
  }
2622
2622
  function Wt(e, t, n, r, i, s) {
2623
- const o = i.slice(0, i.length - 1), u = i[i.length - 1], [a, d, c] = Gs(e, t, n, r, o), f = Qs(e, t, a, d, u, s);
2623
+ const o = i.slice(0, i.length - 1), u = i[i.length - 1], [a, d, c] = Gs(e, t, n, r, o), f = Bs(e, t, a, d, u, s);
2624
2624
  return c.concat([f]);
2625
2625
  }
2626
2626
  function Ys(e, t) {
@@ -2651,7 +2651,7 @@ function Xs(e) {
2651
2651
  t.push(e.slice(0, n));
2652
2652
  return t;
2653
2653
  }
2654
- function Bn(e, t, n, r, i) {
2654
+ function Qn(e, t, n, r, i) {
2655
2655
  return Xs(i).map((s) => Wt(e, t, n, r, s, { $isNull: !0 }));
2656
2656
  }
2657
2657
  function Rr(e, t, n, r, i) {
@@ -2664,7 +2664,7 @@ function Rr(e, t, n, r, i) {
2664
2664
  return [];
2665
2665
  const u = s.split(".");
2666
2666
  if (o != null && o.hasOwnProperty("$ne") && (o = Object.assign(Object.assign({}, o), { $not: o.$ne }), delete o.$ne), o != null && o.hasOwnProperty("$not")) {
2667
- const a = Wt(e, t, n, r, u, o), d = Bn(e, t, n, r, u);
2667
+ const a = Wt(e, t, n, r, u, o), d = Qn(e, t, n, r, u);
2668
2668
  return [
2669
2669
  {
2670
2670
  or: {
@@ -2677,7 +2677,7 @@ function Rr(e, t, n, r, i) {
2677
2677
  return o != null && o.hasOwnProperty("$isNull") && o.$isNull === !0 && u.length > 1 ? [
2678
2678
  {
2679
2679
  or: {
2680
- patterns: Bn(e, t, n, r, u),
2680
+ patterns: Qn(e, t, n, r, u),
2681
2681
  joinSym: e(n, r)
2682
2682
  }
2683
2683
  }
@@ -2685,7 +2685,7 @@ function Rr(e, t, n, r, i) {
2685
2685
  });
2686
2686
  }
2687
2687
  function eo(e, t, n, r) {
2688
- const i = pt;
2688
+ const i = yt;
2689
2689
  return r ? Rr(i, e, t, n, r).concat(Wn(i, e, t, n)) : Wn(i, e, t, n);
2690
2690
  }
2691
2691
  function to(e, t, n) {
@@ -2722,7 +2722,7 @@ function ro(e, t, { etype: n, level: r, form: i }, s) {
2722
2722
  function io(e, t, n) {
2723
2723
  return n === "string" ? Vs(e, t) : e > t ? 1 : -1;
2724
2724
  }
2725
- function dt([e, t], [n, r], i) {
2725
+ function ft([e, t], [n, r], i) {
2726
2726
  return t === r || t == null && r == null ? Ls(e, n) : r == null ? 1 : t == null ? -1 : io(t, r, i);
2727
2727
  }
2728
2728
  function zt(e) {
@@ -2732,9 +2732,9 @@ function so(e, t, n, r) {
2732
2732
  var i;
2733
2733
  const [s, o, u, a] = e, d = n === "desc" ? 1 : -1;
2734
2734
  if (((i = t["forward-identity"]) === null || i === void 0 ? void 0 : i[2]) === "id")
2735
- return dt(r, [s, a], null) === d;
2735
+ return ft(r, [s, a], null) === d;
2736
2736
  const [c, f] = r, h = t["checked-data-type"], p = h === "date" ? zt(f) : f, b = h === "date" ? zt(u) : u;
2737
- return dt([c, p], [s, b], h) === d;
2737
+ return ft([c, p], [s, b], h) === d;
2738
2738
  }
2739
2739
  function oo(e, t) {
2740
2740
  const n = t[1];
@@ -2779,9 +2779,9 @@ function fo(e, { etype: t, pageInfo: n, dq: r, form: i }) {
2779
2779
  });
2780
2780
  }
2781
2781
  c.sort(d === "asc" ? function(w, T) {
2782
- return dt(w, T, h == null ? void 0 : h["checked-data-type"]);
2782
+ return ft(w, T, h == null ? void 0 : h["checked-data-type"]);
2783
2783
  } : function(w, T) {
2784
- return dt(T, w, h == null ? void 0 : h["checked-data-type"]);
2784
+ return ft(T, w, h == null ? void 0 : h["checked-data-type"]);
2785
2785
  });
2786
2786
  let p = {};
2787
2787
  const b = co(e, t, r);
@@ -2808,7 +2808,7 @@ function ho(e, { etype: t, level: n, form: r, join: i, pageInfo: s }) {
2808
2808
  var o, u, a, d, c;
2809
2809
  if (!$r(r) && (!s || !s["start-cursor"]))
2810
2810
  return [];
2811
- const f = Ys(eo(e, t, n, (o = r.$) === null || o === void 0 ? void 0 : o.where), i), h = to(pt, t, n), p = (u = r.$) === null || u === void 0 ? void 0 : u.fields, b = fo(e, {
2811
+ const f = Ys(eo(e, t, n, (o = r.$) === null || o === void 0 ? void 0 : o.where), i), h = to(yt, t, n), p = (u = r.$) === null || u === void 0 ? void 0 : u.fields, b = fo(e, {
2812
2812
  etype: t,
2813
2813
  pageInfo: s,
2814
2814
  form: r,
@@ -2831,7 +2831,7 @@ function po(e, t) {
2831
2831
  }
2832
2832
  function Dr(e, t) {
2833
2833
  const n = po(e, t);
2834
- return ro(pt, e, t, n);
2834
+ return ro(yt, e, t, n);
2835
2835
  }
2836
2836
  function yo(e) {
2837
2837
  const t = {};
@@ -2889,7 +2889,7 @@ function Kt(e, t, n) {
2889
2889
  }
2890
2890
  });
2891
2891
  }
2892
- function ft(e) {
2892
+ function lt(e) {
2893
2893
  return e.startsWith("lookup__");
2894
2894
  }
2895
2895
  function xr(e) {
@@ -2904,7 +2904,7 @@ function To(e) {
2904
2904
  if (n === "__etype")
2905
2905
  return e;
2906
2906
  const r = n;
2907
- return ft(r) ? Kt(e, xr(r), []) : Kt(e, r, []);
2907
+ return lt(r) ? Kt(e, xr(r), []) : Kt(e, r, []);
2908
2908
  }
2909
2909
  });
2910
2910
  }
@@ -2961,27 +2961,27 @@ function So(e) {
2961
2961
  throw new Error("lookup must be an object with a single unique attr and value.");
2962
2962
  return t[0];
2963
2963
  }
2964
- function Bt(e, t, n) {
2964
+ function Qt(e, t, n) {
2965
2965
  return n.indexOf(".") !== -1 && // attr names can have `.` in them, so use the attr we find with a `.`
2966
2966
  // before assuming it's a ref lookup.
2967
2967
  !V(e, t, n);
2968
2968
  }
2969
- function Qt(e) {
2969
+ function Bt(e) {
2970
2970
  const [t, n, ...r] = e.split(".");
2971
2971
  if (r.length > 0 || n !== "id")
2972
2972
  throw new Error(`${e} is not a valid lookup attribute.`);
2973
2973
  return t;
2974
2974
  }
2975
2975
  function vo(e, t, n) {
2976
- if (!Bt(e, t, n))
2976
+ if (!Qt(e, t, n))
2977
2977
  return V(e, t, n);
2978
- const r = Qt(n), i = V(e, t, r) || Te(e, t, r);
2978
+ const r = Bt(n), i = V(e, t, r) || Te(e, t, r);
2979
2979
  if (i && i["value-type"] !== "ref")
2980
2980
  throw new Error(`${n} does not reference a valid link attribute.`);
2981
2981
  return i;
2982
2982
  }
2983
2983
  function Gt(e) {
2984
- return typeof e == "string" && !ft(e) ? null : typeof e == "string" && ft(e) ? xr(e) : So(e);
2984
+ return typeof e == "string" && !lt(e) ? null : typeof e == "string" && lt(e) ? xr(e) : So(e);
2985
2985
  }
2986
2986
  function J(e, t, n) {
2987
2987
  const r = Gt(n);
@@ -3064,14 +3064,14 @@ function Co(e, t) {
3064
3064
  const { stores: n, attrs: r } = e, [i, s, o, u] = t, a = on(o), d = J(r, i, s);
3065
3065
  return [["id", d]].concat(Object.entries(a)).map(([f, h]) => {
3066
3066
  const p = V(r, i, f);
3067
- return p["checked-data-type"] === "date" && e.useDateObjects && (h = lt(h)), ["add-triple", d, p.id, h, { mode: "create" }];
3067
+ return p["checked-data-type"] === "date" && e.useDateObjects && (h = ht(h)), ["add-triple", d, p.id, h, { mode: "create" }];
3068
3068
  });
3069
3069
  }
3070
3070
  function jo(e, t) {
3071
3071
  const { stores: n, attrs: r } = e, [i, s, o, u] = t, a = on(o), d = J(r, i, s), c = Lr(e, [i, d, o, u]);
3072
3072
  return [["id", d]].concat(Object.entries(a)).map(([h, p]) => {
3073
3073
  const b = V(r, i, h);
3074
- return b["checked-data-type"] === "date" && e.useDateObjects && (p = lt(p)), [
3074
+ return b["checked-data-type"] === "date" && e.useDateObjects && (p = ht(p)), [
3075
3075
  "add-triple",
3076
3076
  d,
3077
3077
  b.id,
@@ -3179,7 +3179,7 @@ function Uo(e, t, n) {
3179
3179
  "on-delete-reverse": s.onDelete
3180
3180
  };
3181
3181
  }
3182
- function Qn(e, t, n, r) {
3182
+ function Bn(e, t, n, r) {
3183
3183
  const i = e ? Uo(e, t, n) : null, s = q(), o = [q(), t, n], u = [q(), n, t];
3184
3184
  return Object.assign(Object.assign({ id: s, "forward-identity": o, "reverse-identity": u, "value-type": "ref", cardinality: "many", "unique?": !1, "index?": !1, isUnsynced: !0 }, i || {}), r || {});
3185
3185
  }
@@ -3222,7 +3222,7 @@ function zo({ attrs: e, schema: t }, n) {
3222
3222
  }
3223
3223
  function c(f, h) {
3224
3224
  const p = V(o, f, h), b = Te(o, f, h);
3225
- d(p), d(b), !p && !b && a(Qn(t, f, h, qo));
3225
+ d(p), d(b), !p && !b && a(Bn(t, f, h, qo));
3226
3226
  }
3227
3227
  for (const f of n)
3228
3228
  for (const { etype: h, lookupPair: p, linkLabel: b } of Wo(f)) {
@@ -3232,14 +3232,14 @@ function zo({ attrs: e, schema: t }, n) {
3232
3232
  const w = V(o, h, b), T = Te(o, h, b);
3233
3233
  d(w), d(T);
3234
3234
  const m = ((r = w == null ? void 0 : w["reverse-identity"]) === null || r === void 0 ? void 0 : r[1]) || ((i = T == null ? void 0 : T["forward-identity"]) === null || i === void 0 ? void 0 : i[1]) || b;
3235
- if (Bt(o, m, g))
3236
- c(m, Qt(g));
3235
+ if (Qt(o, m, g))
3236
+ c(m, Bt(g));
3237
3237
  else {
3238
3238
  const S = V(o, m, g);
3239
3239
  S || a(nt(t, m, g, Yt)), d(S);
3240
3240
  }
3241
- } else if (Bt(o, h, g))
3242
- c(h, Qt(g));
3241
+ } else if (Qt(o, h, g))
3242
+ c(h, Bt(g));
3243
3243
  else {
3244
3244
  const w = V(o, h, g);
3245
3245
  w || a(nt(t, h, g, Yt)), d(w);
@@ -3254,7 +3254,7 @@ function zo({ attrs: e, schema: t }, n) {
3254
3254
  const m = V(o, p, T);
3255
3255
  if (d(m), No.has(h) && (m || a(nt(t, p, T, T === "id" ? { "unique?": !0 } : null))), Fo.has(h)) {
3256
3256
  const S = Te(o, p, T);
3257
- !m && !S && a(Qn(t, p, T)), d(S);
3257
+ !m && !S && a(Bn(t, p, T)), d(S);
3258
3258
  }
3259
3259
  }
3260
3260
  }
@@ -3336,7 +3336,7 @@ class Fr {
3336
3336
  });
3337
3337
  }
3338
3338
  }
3339
- var Bo = function(e, t, n, r) {
3339
+ var Qo = function(e, t, n, r) {
3340
3340
  function i(s) {
3341
3341
  return s instanceof n ? s : new n(function(o) {
3342
3342
  o(s);
@@ -3365,7 +3365,7 @@ var Bo = function(e, t, n, r) {
3365
3365
  };
3366
3366
  class Nr {
3367
3367
  static getIsOnline() {
3368
- return Bo(this, void 0, void 0, function* () {
3368
+ return Qo(this, void 0, void 0, function* () {
3369
3369
  return navigator.onLine;
3370
3370
  });
3371
3371
  }
@@ -3390,7 +3390,7 @@ class ke extends Error {
3390
3390
  return "InstantError";
3391
3391
  }
3392
3392
  }
3393
- var Qo = function(e, t, n, r) {
3393
+ var Bo = function(e, t, n, r) {
3394
3394
  function i(s) {
3395
3395
  return s instanceof n ? s : new n(function(o) {
3396
3396
  o(s);
@@ -3417,22 +3417,22 @@ var Qo = function(e, t, n, r) {
3417
3417
  d((r = r.apply(e, t || [])).next());
3418
3418
  });
3419
3419
  };
3420
- class yt extends ke {
3420
+ class bt extends ke {
3421
3421
  constructor(t) {
3422
3422
  var n;
3423
3423
  const r = ((n = t.body) === null || n === void 0 ? void 0 : n.message) || `API Error (${t.status})`;
3424
3424
  super(r, t.body.hint);
3425
3425
  const i = new.target.prototype;
3426
- Object.setPrototypeOf && Object.setPrototypeOf(this, i), Error.captureStackTrace && Error.captureStackTrace(this, yt), this.name = "InstantAPIError", this.status = t.status, this.body = t.body;
3426
+ Object.setPrototypeOf && Object.setPrototypeOf(this, i), Error.captureStackTrace && Error.captureStackTrace(this, bt), this.name = "InstantAPIError", this.status = t.status, this.body = t.body;
3427
3427
  }
3428
3428
  get [Symbol.toStringTag]() {
3429
3429
  return "InstantAPIError";
3430
3430
  }
3431
3431
  }
3432
3432
  function se(e, t) {
3433
- return Qo(this, void 0, void 0, function* () {
3433
+ return Bo(this, void 0, void 0, function* () {
3434
3434
  const n = yield fetch(e, t), r = yield n.json();
3435
- return n.status === 200 ? Promise.resolve(r) : Promise.reject(new yt({ status: n.status, body: r }));
3435
+ return n.status === 200 ? Promise.resolve(r) : Promise.reject(new bt({ status: n.status, body: r }));
3436
3436
  });
3437
3437
  }
3438
3438
  var Me = function(e, t, n, r) {
@@ -3825,7 +3825,7 @@ function er(e) {
3825
3825
  }, t;
3826
3826
  }, {});
3827
3827
  }
3828
- const zr = "v0.22.45";
3828
+ const zr = "v0.22.46-experimental.drewh-ssr.19112166667.1";
3829
3829
  function au(e, t) {
3830
3830
  return {
3831
3831
  info: e ? (...n) => console.info(...n, t()) : () => {
@@ -3969,12 +3969,12 @@ const tr = [
3969
3969
  throw new I(`Attribute '${u}' does not exist on entity '${o}' in dot notation path '${e}'. Available attributes: ${c.length > 0 ? c.join(", ") + ", id" : "id"}`, i);
3970
3970
  }
3971
3971
  Ae(t, e, d, n, i);
3972
- }, Br = (e, t, n, r) => {
3972
+ }, Qr = (e, t, n, r) => {
3973
3973
  for (const [i, s] of Object.entries(e)) {
3974
3974
  if (i === "or" || i === "and") {
3975
3975
  if (Array.isArray(s))
3976
3976
  for (const d of s)
3977
- typeof d == "object" && d !== null && Br(d, t, n, `${r}.${i}[${d}]`);
3977
+ typeof d == "object" && d !== null && Qr(d, t, n, `${r}.${i}[${d}]`);
3978
3978
  continue;
3979
3979
  }
3980
3980
  if (i === "id") {
@@ -4020,9 +4020,9 @@ const tr = [
4020
4020
  if (e.where && n) {
4021
4021
  if (typeof e.where != "object" || e.where === null)
4022
4022
  throw new I(`'where' clause must be an object in entity '${t}', but received: ${typeof e.where}`, r ? `${r}.where` : void 0);
4023
- Br(e.where, t, n, r ? `${r}.where` : "where");
4023
+ Qr(e.where, t, n, r ? `${r}.where` : "where");
4024
4024
  }
4025
- }, Qr = (e, t, n, r, i = 0) => {
4025
+ }, Br = (e, t, n, r, i = 0) => {
4026
4026
  var s;
4027
4027
  if (!e || typeof e != "object")
4028
4028
  throw new I(`Query part for entity '${t}' must be an object, but received: ${typeof e}`, r);
@@ -4035,7 +4035,7 @@ const tr = [
4035
4035
  const u = e[o];
4036
4036
  if (typeof u == "object" && u !== null) {
4037
4037
  const a = (s = n == null ? void 0 : n.entities[t].links[o]) === null || s === void 0 ? void 0 : s.entityName;
4038
- a && Qr(u, a, n, `${r}.${o}`, i + 1);
4038
+ a && Br(u, a, n, `${r}.${o}`, i + 1);
4039
4039
  }
4040
4040
  } else {
4041
4041
  const u = e[o];
@@ -4059,10 +4059,10 @@ const tr = [
4059
4059
  const i = Object.keys(t.entities);
4060
4060
  throw new I(`Entity '${r}' does not exist in schema. Available entities: ${i.length > 0 ? i.join(", ") : "none"}`, r);
4061
4061
  }
4062
- Qr(n[r], r, t, r, 0);
4062
+ Br(n[r], r, t, r, 0);
4063
4063
  }
4064
4064
  }
4065
- }, rr = (e) => typeof e != "string" ? !1 : ft(e) ? !0 : je(e);
4065
+ }, rr = (e) => typeof e != "string" ? !1 : lt(e) ? !0 : je(e);
4066
4066
  class te extends Error {
4067
4067
  constructor(t) {
4068
4068
  super(t), this.name = "TransactionValidationError";
@@ -4082,7 +4082,7 @@ const Gr = (e) => e.length > 0 ? e.join(", ") : "none", hu = (e, t) => new te(`E
4082
4082
  if (!n)
4083
4083
  throw hu(e, Object.keys(t.entities));
4084
4084
  return n;
4085
- }, At = (e, t, n) => {
4085
+ }, Ct = (e, t, n) => {
4086
4086
  const r = Yr(e, n);
4087
4087
  if (typeof t != "object" || t === null)
4088
4088
  throw new te(`Arguments for data operation on entity '${e}' must be an object, but received: ${typeof t}`);
@@ -4112,9 +4112,9 @@ const Gr = (e) => e.length > 0 ? e.join(", ") : "none", hu = (e, t) => new te(`E
4112
4112
  }
4113
4113
  }
4114
4114
  }, yu = {
4115
- create: At,
4116
- update: At,
4117
- merge: At,
4115
+ create: Ct,
4116
+ update: Ct,
4117
+ merge: Ct,
4118
4118
  link: sr,
4119
4119
  unlink: sr,
4120
4120
  delete: () => {
@@ -4277,7 +4277,7 @@ class gu {
4277
4277
  this.handleClose();
4278
4278
  }
4279
4279
  }
4280
- var D = function(e, t, n, r) {
4280
+ var M = function(e, t, n, r) {
4281
4281
  function i(s) {
4282
4282
  return s instanceof n ? s : new n(function(o) {
4283
4283
  o(s);
@@ -4320,7 +4320,7 @@ const ce = {
4320
4320
  }, wu = 3e4, mu = 3e4, Su = 200, vu = {
4321
4321
  apiURI: "https://api.instantdb.com",
4322
4322
  websocketURI: "wss://api.instantdb.com/runtime/session"
4323
- }, Ct = "_instant_oauth_redirect", jt = "currentUser";
4323
+ }, jt = "_instant_oauth_redirect", Pt = "currentUser";
4324
4324
  function Ou({ transportType: e, appId: t, apiURI: n, wsURI: r, EventSourceImpl: i }) {
4325
4325
  if (!i)
4326
4326
  return new ur(`${r}?app_id=${t}`);
@@ -4391,7 +4391,7 @@ class ju {
4391
4391
  !c.has(p) && !b["tx-id"] && this._sendMutation(p, b);
4392
4392
  });
4393
4393
  }, this.getPreviousResult = (d) => {
4394
- const c = G(d);
4394
+ const c = Q(d);
4395
4395
  return this.dataForQuery(c);
4396
4396
  }, this.notifyOne = (d) => {
4397
4397
  var c, f;
@@ -4496,7 +4496,7 @@ class ju {
4496
4496
  throw new Error("Instant must be initialized with an appId.");
4497
4497
  if (!je(t.appId))
4498
4498
  throw new Error(`Instant must be initialized with a valid appId. \`${t.appId}\` is not a valid uuid.`);
4499
- typeof BroadcastChannel == "function" && (this._broadcastChannel = new BroadcastChannel("@instantdb"), this._broadcastChannel.addEventListener("message", (d) => D(this, void 0, void 0, function* () {
4499
+ typeof BroadcastChannel == "function" && (this._broadcastChannel = new BroadcastChannel("@instantdb"), this._broadcastChannel.addEventListener("message", (d) => M(this, void 0, void 0, function* () {
4500
4500
  var c;
4501
4501
  try {
4502
4502
  if (((c = d.data) === null || c === void 0 ? void 0 : c.type) === "auth") {
@@ -4506,7 +4506,12 @@ class ju {
4506
4506
  } catch (f) {
4507
4507
  this._log.error("[error] handle broadcast channel", f);
4508
4508
  }
4509
- }))), this._initStorage(n), this._oauthCallbackResponse = this._oauthLoginInit(), this.getCurrentUser(), r.getIsOnline().then((d) => {
4509
+ }))), this._initStorage(n), this._oauthCallbackResponse = this._oauthLoginInit(), this.getCurrentUser().then((d) => {
4510
+ this.syncUserToEndpoint(d.user);
4511
+ }), setInterval(() => M(this, void 0, void 0, function* () {
4512
+ const d = yield this.getCurrentUser();
4513
+ this.syncUserToEndpoint(d.user);
4514
+ }), 1e3 * 60 * 60 * 23), r.getIsOnline().then((d) => {
4510
4515
  this._isOnline = d, this._startSocket(), r.listen((c) => {
4511
4516
  c !== this._isOnline && (this._log.info("[network] online =", c), this._isOnline = c, this._isOnline ? this._startSocket() : (this._log.info("Changing status from", this.status, "to", ce.CLOSED), this._setStatus(ce.CLOSED)));
4512
4517
  });
@@ -4556,7 +4561,7 @@ class ju {
4556
4561
  i.resolve({ status: t, eventId: n });
4557
4562
  else if (r.type) {
4558
4563
  const { status: o } = r, u = Tu(r, ["status"]);
4559
- i.reject(new yt({
4564
+ i.reject(new bt({
4560
4565
  // @ts-expect-error body.type is not constant typed
4561
4566
  body: u,
4562
4567
  status: o
@@ -4576,6 +4581,27 @@ class ju {
4576
4581
  this._tryBroadcast(t, a, u, d);
4577
4582
  }
4578
4583
  }
4584
+ /**
4585
+ * Does the same thing as handle-query-add-ok
4586
+ * but called as a result of receiving query info from ssr
4587
+ * @param {any} q
4588
+ * @param {{ triples: any; pageInfo: any; }} result
4589
+ * @param {boolean} enableCardinalityInference
4590
+ */
4591
+ _addQueryData(t, n, r) {
4592
+ if (!this.attrs)
4593
+ throw new Error("Attrs in reactor have not been set");
4594
+ const i = Q(t), s = ut(this.attrs, n.triples, r, this._linkIndex, this.config.useDateObjects);
4595
+ this.querySubs.set((o) => (o[i] = {
4596
+ result: {
4597
+ store: s,
4598
+ pageInfo: n.pageInfo,
4599
+ processedTxId: void 0,
4600
+ isExternal: !0
4601
+ },
4602
+ q: t
4603
+ }, o)), this._cleanupPendingMutationsQueries(), this.notifyOne(i), this.notifyOneQueryOnce(i), this._cleanupPendingMutationsTimeout();
4604
+ }
4579
4605
  _handleReceive(t, n) {
4580
4606
  var r, i, s, o, u, a;
4581
4607
  const d = !!this.config.schema && ("cardinalityInference" in this.config ? !!this.config.cardinalityInference : !0);
@@ -4588,10 +4614,10 @@ class ju {
4588
4614
  }
4589
4615
  break;
4590
4616
  case "add-query-exists":
4591
- this.notifyOneQueryOnce(G(n.q));
4617
+ this.notifyOneQueryOnce(Q(n.q));
4592
4618
  break;
4593
4619
  case "add-query-ok":
4594
- const { q: c, result: f } = n, h = G(c), p = (o = (s = f == null ? void 0 : f[0]) === null || s === void 0 ? void 0 : s.data) === null || o === void 0 ? void 0 : o["page-info"], b = (a = (u = f == null ? void 0 : f[0]) === null || u === void 0 ? void 0 : u.data) === null || a === void 0 ? void 0 : a.aggregate, g = Xn(f), w = Nt(this.attrs, g, d, this._linkIndex, this.config.useDateObjects);
4620
+ const { q: c, result: f } = n, h = Q(c), p = (o = (s = f == null ? void 0 : f[0]) === null || s === void 0 ? void 0 : s.data) === null || o === void 0 ? void 0 : o["page-info"], b = (a = (u = f == null ? void 0 : f[0]) === null || u === void 0 ? void 0 : u.data) === null || a === void 0 ? void 0 : a.aggregate, g = Xn(f), w = ut(this.attrs, g, d, this._linkIndex, this.config.useDateObjects);
4595
4621
  this.querySubs.set((O) => (O[h].result = {
4596
4622
  store: w,
4597
4623
  pageInfo: p,
@@ -4606,8 +4632,8 @@ class ju {
4606
4632
  W !== this.pendingMutations.currentValue && this.pendingMutations.set(() => W);
4607
4633
  const E = cr(W.entries()), x = T.map((O) => {
4608
4634
  var z, he, ue, ne;
4609
- const F = O["instaql-query"], U = O["instaql-result"], ye = G(F), Ke = Xn(U), Be = Nt(this.attrs, Ke, d, this._linkIndex, this.config.useDateObjects), Qe = this._applyOptimisticUpdates(Be, E, S), Ge = (he = (z = U == null ? void 0 : U[0]) === null || z === void 0 ? void 0 : z.data) === null || he === void 0 ? void 0 : he["page-info"], Ye = (ne = (ue = U == null ? void 0 : U[0]) === null || ue === void 0 ? void 0 : ue.data) === null || ne === void 0 ? void 0 : ne.aggregate;
4610
- return { hash: ye, store: Qe, pageInfo: Ge, aggregate: Ye };
4635
+ const F = O["instaql-query"], U = O["instaql-result"], ye = Q(F), Ke = Xn(U), Qe = ut(this.attrs, Ke, d, this._linkIndex, this.config.useDateObjects), Be = this._applyOptimisticUpdates(Qe, E, S), Ge = (he = (z = U == null ? void 0 : U[0]) === null || z === void 0 ? void 0 : z.data) === null || he === void 0 ? void 0 : he["page-info"], Ye = (ne = (ue = U == null ? void 0 : U[0]) === null || ue === void 0 ? void 0 : ue.data) === null || ne === void 0 ? void 0 : ne.aggregate;
4636
+ return { hash: ye, store: Be, pageInfo: Ge, aggregate: Ye };
4611
4637
  });
4612
4638
  x.forEach(({ hash: O, store: z, pageInfo: he, aggregate: ue }) => {
4613
4639
  this.querySubs.set((ne) => (ne[O].result = { store: z, pageInfo: he, aggregate: ue, processedTxId: S }, ne));
@@ -4693,8 +4719,8 @@ class ju {
4693
4719
  return;
4694
4720
  }
4695
4721
  if (!((n = t["original-event"]) === null || n === void 0) && n.hasOwnProperty("q") && ((r = t["original-event"]) === null || r === void 0 ? void 0 : r.op) === "add-query") {
4696
- const h = (i = t["original-event"]) === null || i === void 0 ? void 0 : i.q, p = G(h);
4697
- this.notifyQueryError(G(h), d), this.notifyQueryOnceError(h, p, u, d);
4722
+ const h = (i = t["original-event"]) === null || i === void 0 ? void 0 : i.q, p = Q(h);
4723
+ this.notifyQueryError(Q(h), d), this.notifyQueryOnceError(h, p, u, d);
4698
4724
  return;
4699
4725
  }
4700
4726
  if (((s = t["original-event"]) === null || s === void 0 ? void 0 : s.op) === "init") {
@@ -4734,7 +4760,7 @@ class ju {
4734
4760
  subscribeQuery(t, n, r) {
4735
4761
  var i;
4736
4762
  this.config.disableValidation || nr(t, this.config.schema), r && "ruleParams" in r && (t = Object.assign({ $$ruleParams: r.ruleParams }, t));
4737
- const s = G(t), o = this.getPreviousResult(t);
4763
+ const s = Q(t), o = this.getPreviousResult(t);
4738
4764
  return o && n(o), this.queryCbs[s] = (i = this.queryCbs[s]) !== null && i !== void 0 ? i : [], this.queryCbs[s].push({ q: t, cb: n }), this._startQuerySub(t, s), () => {
4739
4765
  this._unsubQuery(t, s, n);
4740
4766
  };
@@ -4747,7 +4773,7 @@ class ju {
4747
4773
  return i.reject(new Error("We can't run `queryOnce`, because the device is offline.")), i.promise;
4748
4774
  if (!this.querySubs)
4749
4775
  return i.reject(new Error("We can't run `queryOnce` on the backend. Use adminAPI.query instead: https://www.instantdb.com/docs/backend#query")), i.promise;
4750
- const s = G(t), o = this._startQuerySub(t, s);
4776
+ const s = Q(t), o = this._startQuerySub(t, s);
4751
4777
  return this.queryOnceDfds[s] = (r = this.queryOnceDfds[s]) !== null && r !== void 0 ? r : [], this.queryOnceDfds[s].push({ q: t, dfd: i, eventId: o }), setTimeout(() => i.reject(new Error("Query timed out")), wu), i.promise;
4752
4778
  }
4753
4779
  _completeQueryOnce(t, n, r) {
@@ -4837,22 +4863,25 @@ class ju {
4837
4863
  return Object.fromEntries(s.map((u) => [u.id, u]));
4838
4864
  }
4839
4865
  /** Runs instaql on a query and a store */
4840
- dataForQuery(t) {
4841
- const n = this._errorMessage;
4842
- if (n)
4843
- return { error: n };
4866
+ dataForQuery(t, n = !0) {
4867
+ const r = this._errorMessage;
4868
+ if (r)
4869
+ return { error: r };
4844
4870
  if (!this.querySubs || !this.pendingMutations)
4845
4871
  return;
4846
- const r = this.querySubs.version(), i = this.querySubs.currentValue, s = this.pendingMutations.version(), o = this.pendingMutations.currentValue, { q: u, result: a } = i[t] || {};
4847
- if (!a)
4872
+ const i = this.querySubs.version(), s = this.querySubs.currentValue, o = this.pendingMutations.version(), u = this.pendingMutations.currentValue, { q: a, result: d } = s[t] || {};
4873
+ if (!d)
4848
4874
  return;
4849
- const d = this._dataForQueryCache[t];
4850
- if (d && r === d.querySubVersion && s === d.pendingMutationsVersion)
4851
- return d.data;
4852
- const { store: c, pageInfo: f, aggregate: h, processedTxId: p } = a, b = this._rewriteMutationsSorted(c.attrs, o), g = this._applyOptimisticUpdates(c, b, p), w = bo({ store: g, pageInfo: f, aggregate: h }, u);
4875
+ const c = this._dataForQueryCache[t];
4876
+ if (c && i === c.querySubVersion && o === c.pendingMutationsVersion)
4877
+ return c.data;
4878
+ let f = d.store;
4879
+ const { pageInfo: h, aggregate: p, processedTxId: b } = d, g = this._rewriteMutationsSorted(f.attrs, u);
4880
+ n && (f = this._applyOptimisticUpdates(f, g, b));
4881
+ const w = bo({ store: f, pageInfo: h, aggregate: p }, a);
4853
4882
  return this._dataForQueryCache[t] = {
4854
- querySubVersion: r,
4855
- pendingMutationsVersion: s,
4883
+ querySubVersion: i,
4884
+ pendingMutationsVersion: o,
4856
4885
  data: w
4857
4886
  }, w;
4858
4887
  }
@@ -4988,7 +5017,7 @@ class ju {
4988
5017
  * id once, even if multiple callers call this function concurrently.
4989
5018
  */
4990
5019
  getLocalId(t) {
4991
- return D(this, void 0, void 0, function* () {
5020
+ return M(this, void 0, void 0, function* () {
4992
5021
  const n = `localToken_${t}`, r = yield this._persister.getItem(n);
4993
5022
  if (r)
4994
5023
  return r;
@@ -5004,9 +5033,9 @@ class ju {
5004
5033
  if (typeof URL > "u")
5005
5034
  return;
5006
5035
  const t = new URL(window.location.href);
5007
- if (t.searchParams.get(Ct)) {
5036
+ if (t.searchParams.get(jt)) {
5008
5037
  const n = t.toString();
5009
- t.searchParams.delete(Ct), t.searchParams.delete("code"), t.searchParams.delete("error");
5038
+ t.searchParams.delete(jt), t.searchParams.delete("code"), t.searchParams.delete("error");
5010
5039
  const r = t.pathname + (t.searchParams.size ? "?" + t.searchParams : "") + t.hash;
5011
5040
  if (history.replaceState(history.state, "", r), // @ts-ignore (waiting for ts support)
5012
5041
  typeof navigation == "object" && // @ts-ignore (waiting for ts support)
@@ -5026,12 +5055,12 @@ class ju {
5026
5055
  * @returns Promise<null | {error: {message: string}}>
5027
5056
  */
5028
5057
  _oauthLoginInit() {
5029
- return D(this, void 0, void 0, function* () {
5058
+ return M(this, void 0, void 0, function* () {
5030
5059
  var t, n, r, i;
5031
5060
  if (typeof window > "u" || typeof window.location > "u" || typeof URLSearchParams > "u")
5032
5061
  return null;
5033
5062
  const s = new URLSearchParams(window.location.search);
5034
- if (!s.get(Ct))
5063
+ if (!s.get(jt))
5035
5064
  return null;
5036
5065
  const o = s.get("error");
5037
5066
  if (o)
@@ -5054,7 +5083,7 @@ class ju {
5054
5083
  });
5055
5084
  }
5056
5085
  _waitForOAuthCallbackResponse() {
5057
- return D(this, void 0, void 0, function* () {
5086
+ return M(this, void 0, void 0, function* () {
5058
5087
  return yield this._oauthCallbackResponse;
5059
5088
  });
5060
5089
  }
@@ -5075,7 +5104,7 @@ class ju {
5075
5104
  };
5076
5105
  }
5077
5106
  getAuth() {
5078
- return D(this, void 0, void 0, function* () {
5107
+ return M(this, void 0, void 0, function* () {
5079
5108
  const { user: t, error: n } = yield this.getCurrentUser();
5080
5109
  if (n)
5081
5110
  throw new ke("Could not get current user: " + n.message);
@@ -5108,21 +5137,21 @@ class ju {
5108
5137
  this.connectionStatusCbs.forEach((n) => n(t));
5109
5138
  }
5110
5139
  setCurrentUser(t) {
5111
- return D(this, void 0, void 0, function* () {
5112
- yield this._persister.setItem(jt, t);
5140
+ return M(this, void 0, void 0, function* () {
5141
+ yield this._persister.setItem(Pt, t);
5113
5142
  });
5114
5143
  }
5115
5144
  getCurrentUserCached() {
5116
5145
  return this._currentUserCached;
5117
5146
  }
5118
5147
  _getCurrentUser() {
5119
- return D(this, void 0, void 0, function* () {
5120
- const t = yield this._persister.getItem(jt);
5148
+ return M(this, void 0, void 0, function* () {
5149
+ const t = yield this._persister.getItem(Pt);
5121
5150
  return typeof t == "string" ? JSON.parse(t) : t;
5122
5151
  });
5123
5152
  }
5124
5153
  getCurrentUser() {
5125
- return D(this, void 0, void 0, function* () {
5154
+ return M(this, void 0, void 0, function* () {
5126
5155
  const t = yield this._waitForOAuthCallbackResponse();
5127
5156
  if (t != null && t.error) {
5128
5157
  const i = { error: t.error, user: void 0 };
@@ -5133,13 +5162,13 @@ class ju {
5133
5162
  });
5134
5163
  }
5135
5164
  _hasCurrentUser() {
5136
- return D(this, void 0, void 0, function* () {
5137
- const t = yield this._persister.getItem(jt);
5165
+ return M(this, void 0, void 0, function* () {
5166
+ const t = yield this._persister.getItem(Pt);
5138
5167
  return JSON.parse(t) != null;
5139
5168
  });
5140
5169
  }
5141
5170
  changeCurrentUser(t) {
5142
- return D(this, void 0, void 0, function* () {
5171
+ return M(this, void 0, void 0, function* () {
5143
5172
  var n;
5144
5173
  const { user: r } = yield this.getCurrentUser();
5145
5174
  if (!ot(r, t)) {
@@ -5152,7 +5181,26 @@ class ju {
5152
5181
  }
5153
5182
  });
5154
5183
  }
5184
+ syncUserToEndpoint(t) {
5185
+ return M(this, void 0, void 0, function* () {
5186
+ if (this.config.endpointURI)
5187
+ try {
5188
+ fetch(this.config.endpointURI + "/sync-auth", {
5189
+ method: "POST",
5190
+ body: JSON.stringify({
5191
+ user: t
5192
+ }),
5193
+ headers: {
5194
+ "Content-Type": "application/json"
5195
+ }
5196
+ });
5197
+ } catch (n) {
5198
+ console.error("Error syncing user with external endpoint", n);
5199
+ }
5200
+ });
5201
+ }
5155
5202
  updateUser(t) {
5203
+ this.syncUserToEndpoint(t);
5156
5204
  const n = { error: void 0, user: t };
5157
5205
  this._currentUserCached = Object.assign({ isLoading: !1 }, n), this._dataForQueryCache = {}, this.querySubs.set((r) => (Object.keys(r).forEach((i) => {
5158
5206
  delete r[i].result;
@@ -5166,7 +5214,7 @@ class ju {
5166
5214
  });
5167
5215
  }
5168
5216
  signInWithMagicCode(t) {
5169
- return D(this, arguments, void 0, function* ({ email: n, code: r }) {
5217
+ return M(this, arguments, void 0, function* ({ email: n, code: r }) {
5170
5218
  var i;
5171
5219
  const s = yield this.getCurrentUser(), o = ((i = s == null ? void 0 : s.user) === null || i === void 0 ? void 0 : i.type) === "guest", u = yield Yo({
5172
5220
  apiURI: this.config.apiURI,
@@ -5179,7 +5227,7 @@ class ju {
5179
5227
  });
5180
5228
  }
5181
5229
  signInWithCustomToken(t) {
5182
- return D(this, void 0, void 0, function* () {
5230
+ return M(this, void 0, void 0, function* () {
5183
5231
  const n = yield Ho({
5184
5232
  apiURI: this.config.apiURI,
5185
5233
  appId: this.config.appId,
@@ -5189,7 +5237,7 @@ class ju {
5189
5237
  });
5190
5238
  }
5191
5239
  signInAsGuest() {
5192
- return D(this, void 0, void 0, function* () {
5240
+ return M(this, void 0, void 0, function* () {
5193
5241
  const t = yield Jo({
5194
5242
  apiURI: this.config.apiURI,
5195
5243
  appId: this.config.appId
@@ -5216,7 +5264,7 @@ class ju {
5216
5264
  });
5217
5265
  }
5218
5266
  signOut(t) {
5219
- return D(this, void 0, void 0, function* () {
5267
+ return M(this, void 0, void 0, function* () {
5220
5268
  const n = yield this.getCurrentUser();
5221
5269
  this.potentiallyInvalidateToken(n, t), yield this.changeCurrentUser(null);
5222
5270
  });
@@ -5239,7 +5287,7 @@ class ju {
5239
5287
  * @param {string} [params.codeVerifier] - The code verifier used to generate the code challenge.
5240
5288
  */
5241
5289
  exchangeCodeForToken(t) {
5242
- return D(this, arguments, void 0, function* ({ code: n, codeVerifier: r }) {
5290
+ return M(this, arguments, void 0, function* ({ code: n, codeVerifier: r }) {
5243
5291
  var i;
5244
5292
  const s = yield this.getCurrentUser(), o = ((i = s == null ? void 0 : s.user) === null || i === void 0 ? void 0 : i.type) === "guest", u = yield Yn({
5245
5293
  apiURI: this.config.apiURI,
@@ -5262,7 +5310,7 @@ class ju {
5262
5310
  * @param {string | null | undefined} [params.nonce] - The nonce used when requesting the id_token from the external service
5263
5311
  */
5264
5312
  signInWithIdToken(t) {
5265
- return D(this, arguments, void 0, function* ({ idToken: n, clientName: r, nonce: i }) {
5313
+ return M(this, arguments, void 0, function* ({ idToken: n, clientName: r, nonce: i }) {
5266
5314
  var s;
5267
5315
  const o = yield this.getCurrentUser(), u = (s = o == null ? void 0 : o.user) === null || s === void 0 ? void 0 : s.refresh_token, a = yield Zo({
5268
5316
  apiURI: this.config.apiURI,
@@ -5362,7 +5410,7 @@ class ju {
5362
5410
  const o = ((i = (r = this._presence[t]) === null || r === void 0 ? void 0 : r.result) === null || i === void 0 ? void 0 : i.peers) || {};
5363
5411
  let u = Object.fromEntries(Object.entries(o).map(([d, c]) => [d, { data: c }]));
5364
5412
  (s = this._presence[t]) === null || s === void 0 || s.result;
5365
- const a = Lt(u, (d) => {
5413
+ const a = Ft(u, (d) => {
5366
5414
  for (let [c, f, h] of n)
5367
5415
  switch (f) {
5368
5416
  case "+":
@@ -5383,7 +5431,7 @@ class ju {
5383
5431
  const r = Object.assign({}, n);
5384
5432
  delete r[this._sessionId];
5385
5433
  const i = Object.fromEntries(Object.entries(r).map(([s, o]) => [s, o.data]));
5386
- this._presence = Lt(this._presence, (s) => {
5434
+ this._presence = Ft(this._presence, (s) => {
5387
5435
  Ln(s, [t, "result", "peers"], i);
5388
5436
  });
5389
5437
  }
@@ -5426,14 +5474,14 @@ class ju {
5426
5474
  // --------
5427
5475
  // Storage
5428
5476
  uploadFile(t, n, r) {
5429
- return D(this, void 0, void 0, function* () {
5477
+ return M(this, void 0, void 0, function* () {
5430
5478
  var i;
5431
5479
  const s = yield this.getCurrentUser(), o = (i = s == null ? void 0 : s.user) === null || i === void 0 ? void 0 : i.refresh_token;
5432
5480
  return eu(Object.assign(Object.assign({}, r), { apiURI: this.config.apiURI, appId: this.config.appId, path: t, file: n, refreshToken: o }));
5433
5481
  });
5434
5482
  }
5435
5483
  deleteFile(t) {
5436
- return D(this, void 0, void 0, function* () {
5484
+ return M(this, void 0, void 0, function* () {
5437
5485
  var n;
5438
5486
  const r = yield this.getCurrentUser(), i = (n = r == null ? void 0 : r.user) === null || n === void 0 ? void 0 : n.refresh_token;
5439
5487
  return yield tu({
@@ -5447,7 +5495,7 @@ class ju {
5447
5495
  // Deprecated Storage API (Jan 2025)
5448
5496
  // ---------------------------------
5449
5497
  upload(t, n) {
5450
- return D(this, void 0, void 0, function* () {
5498
+ return M(this, void 0, void 0, function* () {
5451
5499
  var r;
5452
5500
  const i = yield this.getCurrentUser(), s = (r = i == null ? void 0 : i.user) === null || r === void 0 ? void 0 : r.refresh_token, o = t || n.name, u = yield nu({
5453
5501
  apiURI: this.config.apiURI,
@@ -5459,7 +5507,7 @@ class ju {
5459
5507
  });
5460
5508
  }
5461
5509
  getDownloadUrl(t) {
5462
- return D(this, void 0, void 0, function* () {
5510
+ return M(this, void 0, void 0, function* () {
5463
5511
  var n;
5464
5512
  const r = yield this.getCurrentUser(), i = (n = r == null ? void 0 : r.user) === null || n === void 0 ? void 0 : n.refresh_token;
5465
5513
  return yield iu({
@@ -5581,7 +5629,7 @@ function Ht(e) {
5581
5629
  const t = e.__adminToken;
5582
5630
  return e.appId + "_" + (e.websocketURI || "default_ws_uri") + "_" + (e.apiURI || "default_api_uri") + "_" + (t || "client_only") + "_" + e.useDateObjects;
5583
5631
  }
5584
- const Jt = Lu(), Pt = Uu();
5632
+ const Jt = Lu(), kt = Uu();
5585
5633
  class Fu {
5586
5634
  constructor(t) {
5587
5635
  this.db = t, this.sendMagicCode = (n) => this.db.sendMagicCode(n), this.signInWithMagicCode = (n) => this.db.signInWithMagicCode(n), this.signInWithToken = (n) => this.db.signInWithCustomToken(n), this.signInAsGuest = () => this.db.signInAsGuest(), this.createAuthorizationURL = (n) => this.db.createAuthorizationURL(n), this.signInWithIdToken = (n) => this.db.signInWithIdToken(n), this.exchangeOAuthCode = (n) => this.db.exchangeCodeForToken(n), this.issuerURI = () => this.db.issuerURI(), this.signOut = (n = { invalidateToken: !0 }) => this.db.signOut(n);
@@ -5760,10 +5808,10 @@ class qu {
5760
5808
  function dr(e) {
5761
5809
  if (!e)
5762
5810
  return "0";
5763
- if (Pt.get(e))
5764
- return Pt.get(e);
5765
- const t = G(e);
5766
- return Pt.set(e, t), t;
5811
+ if (kt.get(e))
5812
+ return kt.get(e);
5813
+ const t = Q(e);
5814
+ return kt.set(e, t), t;
5767
5815
  }
5768
5816
  function Wu(e, t) {
5769
5817
  return dr(e._reactor.config.schema) !== dr(t);
@@ -5781,7 +5829,7 @@ function Ku(e, t) {
5781
5829
  const n = Object.assign({ position: "bottom-right", allowedHosts: ["localhost"] }, typeof t == "object" ? t : {});
5782
5830
  n.allowedHosts.includes(window.location.hostname) && Pu(e, n);
5783
5831
  }
5784
- const Bu = {
5832
+ const Qu = {
5785
5833
  isLoading: !0,
5786
5834
  data: void 0,
5787
5835
  pageInfo: void 0,
@@ -5796,14 +5844,14 @@ function fr(e) {
5796
5844
  ...e || {}
5797
5845
  };
5798
5846
  }
5799
- function Qu(e, t, n) {
5847
+ function Bu(e, t, n) {
5800
5848
  t && n && "ruleParams" in n && (t = { $$ruleParams: n.ruleParams, ...t });
5801
- const r = t ? Vu(t) : null, i = G(r), s = ut(
5849
+ const r = t ? Vu(t) : null, i = Q(r), s = at(
5802
5850
  fr(e._reactor.getPreviousResult(r))
5803
5851
  ), o = pe(
5804
5852
  (a) => (s.current = fr(
5805
5853
  e._reactor.getPreviousResult(r)
5806
- ), r ? e.subscribeQuery(r, (c) => {
5854
+ ), s.current.data && a(), r ? e.subscribeQuery(r, (c) => {
5807
5855
  s.current = {
5808
5856
  isLoading: !c,
5809
5857
  data: void 0,
@@ -5816,14 +5864,14 @@ function Qu(e, t, n) {
5816
5864
  // Build a new subscribe function if the query changes
5817
5865
  [i]
5818
5866
  );
5819
- return { state: kt(
5867
+ return { state: It(
5820
5868
  o,
5821
5869
  () => s.current,
5822
- () => Bu
5870
+ () => Qu
5823
5871
  ), query: r };
5824
5872
  }
5825
5873
  function Gu() {
5826
- const e = ut(null);
5874
+ const e = at(null);
5827
5875
  we(() => {
5828
5876
  n();
5829
5877
  }, []);
@@ -5878,7 +5926,7 @@ function Zu(e, t = {}) {
5878
5926
  },
5879
5927
  [e.type, e.id]
5880
5928
  );
5881
- return It(() => ({
5929
+ return Mt(() => ({
5882
5930
  ...n,
5883
5931
  publishPresence: i
5884
5932
  }), [n, i]);
@@ -5889,7 +5937,7 @@ function Xu(e, t, n) {
5889
5937
  function ea(e, t, n = {}) {
5890
5938
  const r = Gu(), i = _e.usePresence(e, {
5891
5939
  keys: [t]
5892
- }), s = It(() => {
5940
+ }), s = Mt(() => {
5893
5941
  const c = e._core._reactor.getPresence(
5894
5942
  e.type,
5895
5943
  e.id
@@ -5916,7 +5964,7 @@ function ea(e, t, n = {}) {
5916
5964
  [n.stopOnEnter, o]
5917
5965
  ), a = pe(() => {
5918
5966
  o(!1);
5919
- }, [o]), d = It(() => ({ onKeyDown: u, onBlur: a }), [u, a]);
5967
+ }, [o]), d = Mt(() => ({ onKeyDown: u, onBlur: a }), [u, a]);
5920
5968
  return {
5921
5969
  active: s,
5922
5970
  setActive: o,
@@ -5952,17 +6000,17 @@ class ia {
5952
6000
  s(u);
5953
6001
  })();
5954
6002
  }, [r]), i;
5955
- }, this.rooms = _e, this.transact = (r) => this.core.transact(r), this.useQuery = (r, i) => Qu(
6003
+ }, this.rooms = _e, this.transact = (r) => this.core.transact(r), this.useQuery = (r, i) => Bu(
5956
6004
  this.core,
5957
6005
  r,
5958
6006
  i
5959
6007
  ).state, this.useAuth = () => {
5960
- const r = ut(
6008
+ const r = at(
5961
6009
  this.core._reactor._currentUserCached
5962
6010
  ), i = pe((o) => this.core.subscribeAuth((a) => {
5963
6011
  r.current = { isLoading: !1, ...a }, o();
5964
6012
  }), []);
5965
- return kt(
6013
+ return It(
5966
6014
  i,
5967
6015
  () => r.current,
5968
6016
  () => na
@@ -5975,12 +6023,12 @@ class ia {
5975
6023
  );
5976
6024
  return r;
5977
6025
  }, this.useConnectionStatus = () => {
5978
- const r = ut(
6026
+ const r = at(
5979
6027
  this.core._reactor.status
5980
6028
  ), i = pe((o) => this.core.subscribeConnectionStatus((a) => {
5981
6029
  a !== r.current && (r.current = a, o());
5982
6030
  }), []);
5983
- return kt(
6031
+ return It(
5984
6032
  i,
5985
6033
  () => r.current,
5986
6034
  // For SSR, always return 'connecting' as the initial state