@statezero/core 0.2.50 → 0.2.52

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.
Files changed (171) hide show
  1. package/dist/adaptors/vue/components/StateZeroDebugPanel.js +489 -471
  2. package/dist/adaptors/vue/reactivity.d.ts +1 -0
  3. package/dist/adaptors/vue/reactivity.js +17 -5
  4. package/dist/cli/commands/syncActions.js +33 -1
  5. package/dist/cli/commands/syncModels.js +44 -3
  6. package/dist/filtering/localFiltering.js +4 -4
  7. package/dist/flavours/django/errors.d.ts +12 -0
  8. package/dist/flavours/django/errors.js +20 -0
  9. package/dist/flavours/django/f.js +16 -15
  10. package/dist/index.d.ts +2 -1
  11. package/dist/index.js +2 -2
  12. package/dist/models/backend1/django_app/author.d.ts +284 -0
  13. package/dist/models/backend1/django_app/author.js +69 -0
  14. package/dist/models/backend1/django_app/author.schema.json +281 -0
  15. package/dist/models/backend1/django_app/book.d.ts +262 -0
  16. package/dist/models/backend1/django_app/book.js +71 -0
  17. package/dist/models/backend1/django_app/book.schema.json +254 -0
  18. package/dist/models/backend1/django_app/composeditem.d.ts +140 -0
  19. package/dist/models/backend1/django_app/composeditem.js +69 -0
  20. package/dist/models/backend1/django_app/composeditem.schema.json +122 -0
  21. package/dist/models/backend1/django_app/comprehensivemodel.schema.json +3 -3
  22. package/dist/models/backend1/django_app/dailyrate.schema.json +7 -7
  23. package/dist/models/backend1/django_app/deepmodellevel1.schema.json +1 -1
  24. package/dist/models/backend1/django_app/dummymodel.schema.json +3 -3
  25. package/dist/models/backend1/django_app/errortestcompoundunique.d.ts +124 -0
  26. package/dist/models/backend1/django_app/errortestcompoundunique.js +69 -0
  27. package/dist/models/backend1/django_app/errortestcompoundunique.schema.json +106 -0
  28. package/dist/models/backend1/django_app/errortestonetoonemodel.d.ts +118 -0
  29. package/dist/models/backend1/django_app/errortestonetoonemodel.js +71 -0
  30. package/dist/models/backend1/django_app/errortestonetoonemodel.schema.json +90 -0
  31. package/dist/models/backend1/django_app/errortestparent.d.ts +92 -0
  32. package/dist/models/backend1/django_app/errortestparent.js +69 -0
  33. package/dist/models/backend1/django_app/errortestparent.schema.json +70 -0
  34. package/dist/models/backend1/django_app/errortestprotectedchild.d.ts +118 -0
  35. package/dist/models/backend1/django_app/errortestprotectedchild.js +71 -0
  36. package/dist/models/backend1/django_app/errortestprotectedchild.schema.json +94 -0
  37. package/dist/models/backend1/django_app/errortestuniquemodel.d.ts +108 -0
  38. package/dist/models/backend1/django_app/errortestuniquemodel.js +69 -0
  39. package/dist/models/backend1/django_app/errortestuniquemodel.schema.json +88 -0
  40. package/dist/models/backend1/django_app/excludeditem.d.ts +124 -0
  41. package/dist/models/backend1/django_app/excludeditem.js +69 -0
  42. package/dist/models/backend1/django_app/excludeditem.schema.json +105 -0
  43. package/dist/models/backend1/django_app/hfchild.d.ts +118 -0
  44. package/dist/models/backend1/django_app/hfchild.js +71 -0
  45. package/dist/models/backend1/django_app/hfchild.schema.json +94 -0
  46. package/dist/models/backend1/django_app/hfparent.d.ts +124 -0
  47. package/dist/models/backend1/django_app/hfparent.js +69 -0
  48. package/dist/models/backend1/django_app/hfparent.schema.json +105 -0
  49. package/dist/models/backend1/django_app/index.js +19 -0
  50. package/dist/models/backend1/django_app/m2mdepthtestlevel1.schema.json +3 -3
  51. package/dist/models/backend1/django_app/m2mdepthtestlevel2.schema.json +3 -3
  52. package/dist/models/backend1/django_app/m2mdepthtestlevel3.schema.json +5 -5
  53. package/dist/models/backend1/django_app/modelwithrestrictedfields.schema.json +2 -2
  54. package/dist/models/backend1/django_app/nodeleteitem.d.ts +124 -0
  55. package/dist/models/backend1/django_app/nodeleteitem.js +69 -0
  56. package/dist/models/backend1/django_app/nodeleteitem.schema.json +105 -0
  57. package/dist/models/backend1/django_app/objectlevelitem.d.ts +124 -0
  58. package/dist/models/backend1/django_app/objectlevelitem.js +69 -0
  59. package/dist/models/backend1/django_app/objectlevelitem.schema.json +105 -0
  60. package/dist/models/backend1/django_app/order.schema.json +7 -7
  61. package/dist/models/backend1/django_app/orderitem.schema.json +5 -5
  62. package/dist/models/backend1/django_app/product.schema.json +11 -11
  63. package/dist/models/backend1/django_app/productcategory.schema.json +2 -2
  64. package/dist/models/backend1/django_app/rateplan.schema.json +2 -2
  65. package/dist/models/backend1/django_app/readonlyitem.d.ts +124 -0
  66. package/dist/models/backend1/django_app/readonlyitem.js +69 -0
  67. package/dist/models/backend1/django_app/readonlyitem.schema.json +105 -0
  68. package/dist/models/backend1/django_app/restrictedcreateitem.d.ts +124 -0
  69. package/dist/models/backend1/django_app/restrictedcreateitem.js +69 -0
  70. package/dist/models/backend1/django_app/restrictedcreateitem.schema.json +105 -0
  71. package/dist/models/backend1/django_app/restrictededititem.d.ts +124 -0
  72. package/dist/models/backend1/django_app/restrictededititem.js +69 -0
  73. package/dist/models/backend1/django_app/restrictededititem.schema.json +105 -0
  74. package/dist/models/backend1/django_app/restrictedfieldrelatedmodel.schema.json +1 -1
  75. package/dist/models/backend1/django_app/rowfiltereditem.d.ts +124 -0
  76. package/dist/models/backend1/django_app/rowfiltereditem.js +69 -0
  77. package/dist/models/backend1/django_app/rowfiltereditem.schema.json +105 -0
  78. package/dist/models/backend1/django_app/tag.d.ts +554 -0
  79. package/dist/models/backend1/django_app/tag.js +71 -0
  80. package/dist/models/backend1/django_app/tag.schema.json +541 -0
  81. package/dist/models/backend1/django_app/updateonlyitem.d.ts +108 -0
  82. package/dist/models/backend1/django_app/updateonlyitem.js +69 -0
  83. package/dist/models/backend1/django_app/updateonlyitem.schema.json +88 -0
  84. package/dist/models/default/django_app/author.d.ts +284 -0
  85. package/dist/models/default/django_app/author.js +69 -0
  86. package/dist/models/default/django_app/author.schema.json +281 -0
  87. package/dist/models/default/django_app/book.d.ts +262 -0
  88. package/dist/models/default/django_app/book.js +71 -0
  89. package/dist/models/default/django_app/book.schema.json +254 -0
  90. package/dist/models/default/django_app/composeditem.d.ts +140 -0
  91. package/dist/models/default/django_app/composeditem.js +69 -0
  92. package/dist/models/default/django_app/composeditem.schema.json +122 -0
  93. package/dist/models/default/django_app/comprehensivemodel.schema.json +3 -3
  94. package/dist/models/default/django_app/dailyrate.schema.json +7 -7
  95. package/dist/models/default/django_app/deepmodellevel1.d.ts +1 -13
  96. package/dist/models/default/django_app/deepmodellevel1.schema.json +2 -14
  97. package/dist/models/default/django_app/deepmodellevel2.d.ts +1 -13
  98. package/dist/models/default/django_app/deepmodellevel2.schema.json +1 -13
  99. package/dist/models/default/django_app/deepmodellevel3.d.ts +1 -13
  100. package/dist/models/default/django_app/deepmodellevel3.schema.json +1 -13
  101. package/dist/models/default/django_app/dummymodel.d.ts +1 -13
  102. package/dist/models/default/django_app/dummymodel.schema.json +4 -16
  103. package/dist/models/default/django_app/dummyrelatedmodel.d.ts +1 -13
  104. package/dist/models/default/django_app/dummyrelatedmodel.schema.json +1 -13
  105. package/dist/models/default/django_app/errortestcompoundunique.d.ts +124 -0
  106. package/dist/models/default/django_app/errortestcompoundunique.js +69 -0
  107. package/dist/models/default/django_app/errortestcompoundunique.schema.json +106 -0
  108. package/dist/models/default/django_app/errortestonetoonemodel.d.ts +118 -0
  109. package/dist/models/default/django_app/errortestonetoonemodel.js +71 -0
  110. package/dist/models/default/django_app/errortestonetoonemodel.schema.json +90 -0
  111. package/dist/models/default/django_app/errortestparent.d.ts +92 -0
  112. package/dist/models/default/django_app/errortestparent.js +69 -0
  113. package/dist/models/default/django_app/errortestparent.schema.json +70 -0
  114. package/dist/models/default/django_app/errortestprotectedchild.d.ts +118 -0
  115. package/dist/models/default/django_app/errortestprotectedchild.js +71 -0
  116. package/dist/models/default/django_app/errortestprotectedchild.schema.json +94 -0
  117. package/dist/models/default/django_app/errortestuniquemodel.d.ts +108 -0
  118. package/dist/models/default/django_app/errortestuniquemodel.js +69 -0
  119. package/dist/models/default/django_app/errortestuniquemodel.schema.json +88 -0
  120. package/dist/models/default/django_app/excludeditem.d.ts +124 -0
  121. package/dist/models/default/django_app/excludeditem.js +69 -0
  122. package/dist/models/default/django_app/excludeditem.schema.json +105 -0
  123. package/dist/models/default/django_app/filetest.d.ts +1 -13
  124. package/dist/models/default/django_app/filetest.schema.json +1 -13
  125. package/dist/models/default/django_app/hfchild.d.ts +118 -0
  126. package/dist/models/default/django_app/hfchild.js +71 -0
  127. package/dist/models/default/django_app/hfchild.schema.json +94 -0
  128. package/dist/models/default/django_app/hfparent.d.ts +124 -0
  129. package/dist/models/default/django_app/hfparent.js +69 -0
  130. package/dist/models/default/django_app/hfparent.schema.json +105 -0
  131. package/dist/models/default/django_app/index.js +19 -0
  132. package/dist/models/default/django_app/m2mdepthtestlevel1.schema.json +3 -3
  133. package/dist/models/default/django_app/m2mdepthtestlevel2.schema.json +3 -3
  134. package/dist/models/default/django_app/m2mdepthtestlevel3.schema.json +5 -5
  135. package/dist/models/default/django_app/modelwithrestrictedfields.schema.json +2 -2
  136. package/dist/models/default/django_app/nodeleteitem.d.ts +124 -0
  137. package/dist/models/default/django_app/nodeleteitem.js +69 -0
  138. package/dist/models/default/django_app/nodeleteitem.schema.json +105 -0
  139. package/dist/models/default/django_app/objectlevelitem.d.ts +124 -0
  140. package/dist/models/default/django_app/objectlevelitem.js +69 -0
  141. package/dist/models/default/django_app/objectlevelitem.schema.json +105 -0
  142. package/dist/models/default/django_app/order.schema.json +7 -7
  143. package/dist/models/default/django_app/orderitem.schema.json +5 -5
  144. package/dist/models/default/django_app/product.schema.json +11 -11
  145. package/dist/models/default/django_app/productcategory.schema.json +2 -2
  146. package/dist/models/default/django_app/rateplan.schema.json +2 -2
  147. package/dist/models/default/django_app/readonlyitem.d.ts +124 -0
  148. package/dist/models/default/django_app/readonlyitem.js +69 -0
  149. package/dist/models/default/django_app/readonlyitem.schema.json +105 -0
  150. package/dist/models/default/django_app/restrictedcreateitem.d.ts +124 -0
  151. package/dist/models/default/django_app/restrictedcreateitem.js +69 -0
  152. package/dist/models/default/django_app/restrictedcreateitem.schema.json +105 -0
  153. package/dist/models/default/django_app/restrictededititem.d.ts +124 -0
  154. package/dist/models/default/django_app/restrictededititem.js +69 -0
  155. package/dist/models/default/django_app/restrictededititem.schema.json +105 -0
  156. package/dist/models/default/django_app/restrictedfieldrelatedmodel.schema.json +1 -1
  157. package/dist/models/default/django_app/rowfiltereditem.d.ts +124 -0
  158. package/dist/models/default/django_app/rowfiltereditem.js +69 -0
  159. package/dist/models/default/django_app/rowfiltereditem.schema.json +105 -0
  160. package/dist/models/default/django_app/tag.d.ts +554 -0
  161. package/dist/models/default/django_app/tag.js +71 -0
  162. package/dist/models/default/django_app/tag.schema.json +541 -0
  163. package/dist/models/default/django_app/updateonlyitem.d.ts +108 -0
  164. package/dist/models/default/django_app/updateonlyitem.js +69 -0
  165. package/dist/models/default/django_app/updateonlyitem.schema.json +88 -0
  166. package/dist/schemaIntegrity.d.ts +14 -0
  167. package/dist/schemaIntegrity.js +29 -0
  168. package/dist/setup.js +6 -0
  169. package/dist/syncEngine/stores/operationEventHandlers.js +10 -8
  170. package/dist/syncEngine/stores/querysetStore.js +9 -0
  171. package/package.json +1 -1
@@ -1,22 +1,22 @@
1
- import { ref as J, computed as R, onMounted as us, onBeforeUnmount as hs, watch as it, createElementBlock as $, openBlock as A, createElementVNode as h, createVNode as Mt, toDisplayString as S, createCommentVNode as V, Fragment as W, renderList as ce, normalizeClass as $t, normalizeStyle as at, withDirectives as Ue, createTextVNode as Qe, vModelCheckbox as At, vModelSelect as Ot, Transition as Pt, withCtx as Ft } from "vue";
1
+ import { ref as J, computed as R, onMounted as hs, onBeforeUnmount as fs, watch as it, createElementBlock as $, openBlock as A, createElementVNode as h, createVNode as Tt, toDisplayString as S, createCommentVNode as V, Fragment as W, renderList as ce, normalizeClass as Mt, normalizeStyle as at, withDirectives as Qe, createTextVNode as Ve, vModelCheckbox as $t, vModelSelect as At, Transition as Ot, withCtx as Pt } from "vue";
2
2
  import { v7 as G } from "uuid";
3
- import { isNil as E, isEmpty as Ce, trim as dt, isEqual as qe } from "lodash-es";
3
+ import { isNil as E, isEmpty as ve, trim as dt, isEqual as qe } from "lodash-es";
4
4
  import Ae from "mitt";
5
- import Dt from "handlebars";
6
- import It from "superjson";
7
- import fs from "p-queue";
8
- import ps from "axios";
5
+ import It from "handlebars";
6
+ import Ft from "superjson";
7
+ import ps from "p-queue";
8
+ import ms from "axios";
9
9
  import { z as P } from "zod";
10
- import ms from "pusher-js";
11
- import vt from "sift";
12
- import { DateTime as ge } from "luxon";
13
- import { parse as ys, format as gs } from "date-fns";
14
- import { Graph as Kt } from "graphlib";
10
+ import ys from "pusher-js";
11
+ import Zt, { createEqualsOperation as ee } from "sift";
12
+ import { DateTime as _e } from "luxon";
13
+ import { parse as gs, format as _s } from "date-fns";
14
+ import { Graph as Dt } from "graphlib";
15
15
  import Le from "object-hash";
16
- import * as Zt from "mathjs";
17
- import _s from "rfdc";
16
+ import * as Yt from "mathjs";
17
+ import ws from "rfdc";
18
18
  const se = /* @__PURE__ */ new Map(), ut = /* @__PURE__ */ new Set();
19
- function ws(n) {
19
+ function Cs(n) {
20
20
  return ut.add(n), () => ut.delete(n);
21
21
  }
22
22
  function Je(n) {
@@ -25,7 +25,7 @@ function Je(n) {
25
25
  function zt(n) {
26
26
  return `{{TempPK_${n}}}`;
27
27
  }
28
- function Rt(n, e) {
28
+ function Kt(n, e) {
29
29
  const t = `{{TempPK_${n}}}`, s = `"TempPK_${n}"`, r = typeof e == "string" ? `"${e}"` : String(e);
30
30
  se.set(s, r);
31
31
  for (const o of ut)
@@ -35,7 +35,7 @@ function Rt(n, e) {
35
35
  console.warn("[tempPk] onResolve callback error:", i);
36
36
  }
37
37
  }
38
- function Cs(n) {
38
+ function vs(n) {
39
39
  if (!Je(String(n))) return n;
40
40
  const e = String(n).match(/\{\{\s*TempPK_([^}\s]+)\s*\}\}/);
41
41
  if (!e) return n;
@@ -47,15 +47,15 @@ function We(n) {
47
47
  const e = Object.fromEntries(se);
48
48
  try {
49
49
  if (typeof n == "string")
50
- return Dt.compile(n, { noEscape: !0 })(e);
51
- const t = It.stringify(n), r = Dt.compile(t, { noEscape: !0 })(e);
52
- return It.parse(r);
50
+ return It.compile(n, { noEscape: !0 })(e);
51
+ const t = Ft.stringify(n), r = It.compile(t, { noEscape: !0 })(e);
52
+ return Ft.parse(r);
53
53
  } catch {
54
54
  return n;
55
55
  }
56
56
  }
57
- const vs = Ae(), Es = Ae(), Nt = Ae();
58
- class bs {
57
+ const Es = Ae(), bs = Ae(), Rt = Ae();
58
+ class ks {
59
59
  constructor(e, t = {}) {
60
60
  this.dbName = e, this.storeName = t.storeName || "keyval-store", this.batchDelay = t.batchDelay || 50, this.version = t.version || 5, this.resetOnErrors = t.resetOnErrors || [
61
61
  "VersionError",
@@ -236,9 +236,9 @@ class bs {
236
236
  }
237
237
  }
238
238
  }
239
- class Et {
239
+ class vt {
240
240
  constructor(e, t = {}, s = null) {
241
- this.store = new bs(e, t), this.localMap = /* @__PURE__ */ new Map(), this.hydrate().then((r) => {
241
+ this.store = new ks(e, t), this.localMap = /* @__PURE__ */ new Map(), this.hydrate().then((r) => {
242
242
  typeof s == "function" && s(r);
243
243
  }).catch((r) => {
244
244
  console.error(`Cache hydration failed for "${e}":`, r);
@@ -285,7 +285,7 @@ class Et {
285
285
  });
286
286
  }
287
287
  }
288
- const ye = (n, e) => {
288
+ const ge = (n, e) => {
289
289
  if (!e || !e.pks || e.pks.length === 0) return;
290
290
  const t = e.pks.map((r) => n._lastRenderedData.get(r) ?? null), s = n.render(e.pks, !0, !1);
291
291
  if (!qe(s, t)) {
@@ -294,7 +294,7 @@ const ye = (n, e) => {
294
294
  o && o[r] != null && n._lastRenderedData.set(o[r], o);
295
295
  for (const o of e.pks)
296
296
  s.some((i) => i && i[r] === o) || n._lastRenderedData.set(o, null);
297
- vs.emit(
297
+ Es.emit(
298
298
  `${n.modelClass.configKey}::${n.modelClass.modelName}::render`,
299
299
  e
300
300
  ), n.renderCallbacks.forEach((o) => {
@@ -340,14 +340,14 @@ class Y {
340
340
  return r.size > 0 ? new Y(t, Array.from(r)) : null;
341
341
  }
342
342
  }
343
- class ks {
343
+ class Ss {
344
344
  modelClass;
345
345
  fetchFn;
346
346
  groundTruthArray;
347
347
  operationsMap;
348
348
  isSyncing;
349
349
  constructor(e, t, s = null, r = null, o = {}) {
350
- this.modelClass = e, this.fetchFn = t, this.isSyncing = !1, this.pruneThreshold = o.pruneThreshold || 10, this.groundTruthArray = s || [], this.operationsMap = /* @__PURE__ */ new Map(), r && r.length > 0 && this._loadOperations(r), this.modelCache = new Et("model-cache", {}, this.onHydrated.bind(this)), this._lastRenderedData = /* @__PURE__ */ new Map(), this.renderCallbacks = /* @__PURE__ */ new Set(), this._unsubscribeTempPk = ws((i, l) => {
350
+ this.modelClass = e, this.fetchFn = t, this.isSyncing = !1, this.pruneThreshold = o.pruneThreshold || 10, this.groundTruthArray = s || [], this.operationsMap = /* @__PURE__ */ new Map(), r && r.length > 0 && this._loadOperations(r), this.modelCache = new vt("model-cache", {}, this.onHydrated.bind(this)), this._lastRenderedData = /* @__PURE__ */ new Map(), this.renderCallbacks = /* @__PURE__ */ new Set(), this._unsubscribeTempPk = Cs((i, l) => {
351
351
  if (this._lastRenderedData.has(i)) {
352
352
  const a = this._lastRenderedData.get(i);
353
353
  a && typeof a == "object" && (a[this.pkField] = l), this._lastRenderedData.set(l, a), this._lastRenderedData.delete(i);
@@ -363,7 +363,7 @@ class ks {
363
363
  */
364
364
  _loadOperations(e) {
365
365
  e.forEach((t) => {
366
- const s = Oe.get(t.operationId);
366
+ const s = Pe.get(t.operationId);
367
367
  s ? this.operationsMap.set(s.operationId, s) : this.operationsMap.set(t.operationId, new q(t, !0));
368
368
  });
369
369
  }
@@ -374,7 +374,7 @@ class ks {
374
374
  onHydrated() {
375
375
  if (this.groundTruthArray.length === 0 && this.operationsMap.size === 0) {
376
376
  let e = this.modelCache.get(this.cacheKey);
377
- !E(e) && !Ce(e) && this.setGroundTruth(e);
377
+ !E(e) && !ve(e) && this.setGroundTruth(e);
378
378
  }
379
379
  }
380
380
  setCache(e) {
@@ -382,7 +382,7 @@ class ks {
382
382
  let s = [];
383
383
  e.forEach((r) => {
384
384
  let o = r[t];
385
- if (!(typeof o == "string" && Je(o) && (o = We(r[t]), E(o) || Ce(dt(o)))))
385
+ if (!(typeof o == "string" && Je(o) && (o = We(r[t]), E(o) || ve(dt(o)))))
386
386
  if (r && typeof r.serialize == "function") {
387
387
  const i = r.serialize(!0);
388
388
  i[t] = o, s.push(i);
@@ -398,7 +398,7 @@ class ks {
398
398
  let r = [];
399
399
  if (e.forEach((c) => {
400
400
  let f = c[s];
401
- typeof f == "string" && Je(f) && (f = We(c[s]), E(f) || Ce(dt(f))) || (c[s] = f, r.push(c));
401
+ typeof f == "string" && Je(f) && (f = We(c[s]), E(f) || ve(dt(f))) || (c[s] = f, r.push(c));
402
402
  }), t === null) {
403
403
  this.setCache(r);
404
404
  return;
@@ -422,16 +422,16 @@ class ks {
422
422
  }
423
423
  // Commit optimistic updates
424
424
  addOperation(e) {
425
- this.operationsMap.set(e.operationId, e), this.operationsMap.size > this.pruneThreshold && this.prune(), ye(this, Y.fromOperation(e));
425
+ this.operationsMap.set(e.operationId, e), this.operationsMap.size > this.pruneThreshold && this.prune(), ge(this, Y.fromOperation(e));
426
426
  }
427
427
  updateOperation(e) {
428
- return this.operationsMap.has(e.operationId) ? (this.operationsMap.set(e.operationId, e), ye(this, Y.fromOperation(e)), !0) : !1;
428
+ return this.operationsMap.has(e.operationId) ? (this.operationsMap.set(e.operationId, e), ge(this, Y.fromOperation(e)), !0) : !1;
429
429
  }
430
430
  confirm(e) {
431
- this.operationsMap.has(e.operationId) && (this.operationsMap.set(e.operationId, e), ye(this, Y.fromOperation(e)));
431
+ this.operationsMap.has(e.operationId) && (this.operationsMap.set(e.operationId, e), ge(this, Y.fromOperation(e)));
432
432
  }
433
433
  reject(e) {
434
- this.operationsMap.has(e.operationId) && (this.operationsMap.set(e.operationId, e), ye(this, Y.fromOperation(e)));
434
+ this.operationsMap.has(e.operationId) && (this.operationsMap.set(e.operationId, e), ge(this, Y.fromOperation(e)));
435
435
  }
436
436
  setOperations(e = []) {
437
437
  const t = this.operations;
@@ -439,14 +439,14 @@ class ks {
439
439
  this.operationsMap.set(r.operationId, r);
440
440
  });
441
441
  const s = [...t, ...this.operations];
442
- ye(this, Y.fromOperations(s));
442
+ ge(this, Y.fromOperations(s));
443
443
  }
444
444
  // Ground truth data methods
445
445
  setGroundTruth(e) {
446
446
  let t = this.groundTruthArray;
447
447
  this.groundTruthArray = Array.isArray(e) ? e : [];
448
448
  const s = [...t, ...this.groundTruthArray];
449
- ye(this, Y.fromInstances(s, this.modelClass));
449
+ ge(this, Y.fromInstances(s, this.modelClass));
450
450
  }
451
451
  getGroundTruth() {
452
452
  return this.groundTruthArray;
@@ -491,7 +491,7 @@ class ks {
491
491
  l
492
492
  );
493
493
  }
494
- ye(
494
+ ge(
495
495
  this,
496
496
  Y.fromInstances(
497
497
  [...i, ...Array.from(s.values())],
@@ -600,7 +600,7 @@ class ks {
600
600
  // Render methods
601
601
  render(e = null, t = !0, s = !0) {
602
602
  if (s && e !== null) {
603
- const o = (Array.isArray(e) ? e : [e]).map((a) => Cs(a)), i = [];
603
+ const o = (Array.isArray(e) ? e : [e]).map((a) => vs(a)), i = [];
604
604
  for (const a of o)
605
605
  this._lastRenderedData.has(a) || i.push(a);
606
606
  if (i.length === 0)
@@ -688,7 +688,7 @@ class Ge {
688
688
  const t = async ({ pks: s, modelClass: r }) => await r.objects.filter({
689
689
  [`${r.primaryKeyField}__in`]: s
690
690
  }).fetch().serialize();
691
- this._stores.set(e, new ks(e, t, null, null)), this.syncManager.followModel(this, e);
691
+ this._stores.set(e, new Ss(e, t, null, null)), this.syncManager.followModel(this, e);
692
692
  }
693
693
  return this._stores.get(e);
694
694
  }
@@ -751,7 +751,7 @@ class q {
751
751
  throw new Error(`All operation instances must be objects with the '${o}' field`);
752
752
  this.#e = r;
753
753
  const i = r.map((a) => a[o]);
754
- Q.getStore(s).render(i, !0, !1), this.#t = r.map((a) => s.fromPk(a[o]).serialize()), this.timestamp = e.timestamp || Date.now(), !t && (Oe.register(this), ie.emit(C.CREATED, this));
754
+ Q.getStore(s).render(i, !0, !1), this.#t = r.map((a) => s.fromPk(a[o]).serialize()), this.timestamp = e.timestamp || Date.now(), !t && (Pe.register(this), ie.emit(C.CREATED, this));
755
755
  }
756
756
  /**
757
757
  * Getter for instances that replaces any temporary PKs with real PKs
@@ -818,7 +818,7 @@ class q {
818
818
  return e.instances && !Array.isArray(e.instances) && (e.instances = [e.instances]), Object.assign(this, e), this.timestamp = Date.now(), ie.emit(C.MUTATED, this), this;
819
819
  }
820
820
  }
821
- class Ss {
821
+ class Ts {
822
822
  constructor() {
823
823
  this._operations = /* @__PURE__ */ new Map(), this._querysetStates = /* @__PURE__ */ new Map();
824
824
  }
@@ -903,11 +903,11 @@ class Ss {
903
903
  return t.length > 0 ? t[t.length - 1] : void 0;
904
904
  }
905
905
  }
906
- const Oe = new Ss(), Ts = Ae();
907
- function Ms(n) {
908
- Ts.emit("error", n);
906
+ const Pe = new Ts(), Ms = Ae();
907
+ function $s(n) {
908
+ Ms.emit("error", n);
909
909
  }
910
- class ve extends Error {
910
+ class fe extends Error {
911
911
  /**
912
912
  * Creates a new StateZeroError.
913
913
  *
@@ -917,7 +917,7 @@ class ve extends Error {
917
917
  * @param {number} status - The HTTP status code.
918
918
  */
919
919
  constructor(e, t, s, r) {
920
- super(e), this.name = "StateZeroError", this.code = t, this.detail = s, this.status = r, Object.setPrototypeOf(this, new.target.prototype), Ms(this);
920
+ super(e), this.name = "StateZeroError", this.code = t, this.detail = s, this.status = r, Object.setPrototypeOf(this, new.target.prototype), $s(this);
921
921
  }
922
922
  /**
923
923
  * Returns a full error message including the detail.
@@ -939,7 +939,7 @@ class ve extends Error {
939
939
  return this.message;
940
940
  }
941
941
  }
942
- class Ve extends ve {
942
+ class Oe extends fe {
943
943
  /**
944
944
  * Creates a new ValidationError.
945
945
  *
@@ -950,7 +950,7 @@ class Ve extends ve {
950
950
  super("Validation error", "validation_error", e, t), this.name = "ValidationError";
951
951
  }
952
952
  }
953
- class xt extends ve {
953
+ class Nt extends fe {
954
954
  /**
955
955
  * Creates a new DoesNotExist error.
956
956
  *
@@ -961,7 +961,7 @@ class xt extends ve {
961
961
  super("DoesNotExist", "does_not_exist", e, t), this.name = "DoesNotExist";
962
962
  }
963
963
  }
964
- class lt extends ve {
964
+ class lt extends fe {
965
965
  /**
966
966
  * Creates a new PermissionDenied error.
967
967
  *
@@ -972,7 +972,7 @@ class lt extends ve {
972
972
  super("Permission denied", "permission_denied", e, t), this.name = "PermissionDenied";
973
973
  }
974
974
  }
975
- class $s extends ve {
975
+ class As extends fe {
976
976
  /**
977
977
  * Creates a new MultipleObjectsReturned error.
978
978
  *
@@ -983,7 +983,18 @@ class $s extends ve {
983
983
  super("Multiple objects returned", "multiple_objects_returned", e, t), this.name = "MultipleObjectsReturned";
984
984
  }
985
985
  }
986
- class As extends ve {
986
+ class xt extends fe {
987
+ /**
988
+ * Creates a new ConflictError.
989
+ *
990
+ * @param {IErrorDetail|Object|string} [detail="A database conflict occurred."] - The error details.
991
+ * @param {number} [status=409] - The HTTP status code.
992
+ */
993
+ constructor(e = "A database conflict occurred.", t = 409) {
994
+ super("Conflict", "conflict", e, t), this.name = "ConflictError";
995
+ }
996
+ }
997
+ class Os extends fe {
987
998
  /**
988
999
  * Creates a new ASTValidationError.
989
1000
  *
@@ -994,7 +1005,7 @@ class As extends ve {
994
1005
  super("Query syntax error", "ast_validation_error", e, t), this.name = "ASTValidationError";
995
1006
  }
996
1007
  }
997
- class x extends ve {
1008
+ class x extends fe {
998
1009
  /**
999
1010
  * Creates a new ConfigError.
1000
1011
  *
@@ -1005,31 +1016,33 @@ class x extends ve {
1005
1016
  super("Configuration error", "config_error", e, t), this.name = "ConfigError";
1006
1017
  }
1007
1018
  }
1008
- function Os(n) {
1019
+ function Ps(n) {
1009
1020
  const { status: e, type: t, detail: s } = n;
1010
1021
  if (t === void 0 && s === "Invalid token.")
1011
1022
  return new lt(s, 403);
1012
1023
  switch (t) {
1013
1024
  // Direct mappings
1014
1025
  case "ValidationError":
1015
- return new Ve(s, e);
1026
+ return new Oe(s, e);
1016
1027
  case "NotFound":
1017
- return new xt(s, e);
1028
+ return new Nt(s, e);
1018
1029
  case "MultipleObjectsReturned":
1019
- return new $s(s, e);
1030
+ return new As(s, e);
1020
1031
  case "PermissionDenied":
1021
1032
  return new lt(s, e);
1033
+ case "ConflictError":
1034
+ return new xt(s, e);
1022
1035
  case "ASTValidationError":
1023
- return new As(s, e);
1036
+ return new Os(s, e);
1024
1037
  case "ConfigError":
1025
1038
  return new x(s, e);
1026
1039
  // Django error types that map to our error classes
1027
1040
  case "FieldError":
1028
- return new Ve(s, e);
1041
+ return new Oe(s, e);
1029
1042
  case "ValueError":
1030
- return new Ve(s, e);
1043
+ return new Oe(s, e);
1031
1044
  default:
1032
- return e === 400 ? new Ve(s, e) : e === 403 ? new lt(s, e) : e === 404 ? new xt(s, e) : new ve("Unknown error", "unknown", s, e);
1045
+ return e === 400 ? new Oe(s, e) : e === 403 ? new lt(s, e) : e === 404 ? new Nt(s, e) : e === 409 ? new xt(s, e) : new fe("Unknown error", "unknown", s, e);
1033
1046
  }
1034
1047
  }
1035
1048
  const jt = {
@@ -1040,7 +1053,7 @@ const jt = {
1040
1053
  BULK_UPDATE: "bulk_update",
1041
1054
  BULK_DELETE: "bulk_delete"
1042
1055
  };
1043
- class Ps {
1056
+ class Is {
1044
1057
  /**
1045
1058
  * @param {PusherReceiverOptions} options
1046
1059
  * @param {string} configKey - The backend configuration key
@@ -1050,7 +1063,7 @@ class Ps {
1050
1063
  this.configKey = t, this.connectionTimeoutId = null, s.appKey && /^\d+$/.test(s.appKey) && s.appKey.length < 15 && console.warn(
1051
1064
  `%c[Pusher Warning] The provided appKey ("${s.appKey}") looks like a numeric app_id. Pusher requires the alphanumeric key, not the ID. Please verify your configuration for backend: "${this.configKey}".`,
1052
1065
  "color: orange; font-weight: bold; font-size: 14px;"
1053
- ), this.pusherClient = new ms(s.appKey, {
1066
+ ), this.pusherClient = new ys(s.appKey, {
1054
1067
  cluster: s.cluster,
1055
1068
  forceTLS: s.forceTLS ?? !0,
1056
1069
  authEndpoint: s.authEndpoint,
@@ -1201,7 +1214,7 @@ function Ds() {
1201
1214
  let Qt = {
1202
1215
  backendConfigs: {}
1203
1216
  };
1204
- const Is = P.object({
1217
+ const zs = P.object({
1205
1218
  clientOptions: P.object({
1206
1219
  appKey: P.string({ required_error: "Pusher appKey is required" }),
1207
1220
  cluster: P.string({ required_error: "Pusher cluster is required" }),
@@ -1215,7 +1228,7 @@ const Is = P.object({
1215
1228
  }), Ks = P.object({
1216
1229
  type: P.enum(["websocket", "pusher", "none"]),
1217
1230
  websocketUrl: P.string().url().optional(),
1218
- pusher: Is.optional(),
1231
+ pusher: zs.optional(),
1219
1232
  hotpaths: P.array(P.string()).default(["default"])
1220
1233
  }).superRefine((n, e) => {
1221
1234
  n.type === "websocket" && (n.websocketUrl || e.addIssue({
@@ -1246,7 +1259,7 @@ const Is = P.object({
1246
1259
  "eventInterceptor must be a function if provided"
1247
1260
  ),
1248
1261
  events: P.lazy(() => Ks.optional())
1249
- }), zs = P.object({
1262
+ }), Rs = P.object({
1250
1263
  backendConfigs: P.record(P.string(), Be).refine(
1251
1264
  (n) => {
1252
1265
  for (const [e, t] of Object.entries(n))
@@ -1269,9 +1282,9 @@ const Is = P.object({
1269
1282
  periodicSyncIntervalSeconds: P.number().min(5).nullable().optional().default(null)
1270
1283
  });
1271
1284
  let ht = null;
1272
- function Rs(n) {
1285
+ function Ns(n) {
1273
1286
  Qt = n;
1274
- const e = zs.safeParse(Qt);
1287
+ const e = Rs.safeParse(Qt);
1275
1288
  if (!e.success) {
1276
1289
  const t = e.error.errors.map((s) => s.message);
1277
1290
  throw new x(`Error setting configuration: ${t.join(", ")}`);
@@ -1283,7 +1296,7 @@ function he() {
1283
1296
  throw new x("Configuration not set. Please call setConfig() with a valid configuration.");
1284
1297
  return ht;
1285
1298
  }
1286
- function Ns(n, e) {
1299
+ function xs(n, e) {
1287
1300
  try {
1288
1301
  const t = he();
1289
1302
  if (!t.backendConfigs[n])
@@ -1298,7 +1311,7 @@ function Ns(n, e) {
1298
1311
  throw t instanceof x ? t : new x(t.message || "Invalid backend configuration");
1299
1312
  }
1300
1313
  }
1301
- function Yt(n = "default") {
1314
+ function Xt(n = "default") {
1302
1315
  try {
1303
1316
  const e = he();
1304
1317
  if (!e.backendConfigs[n])
@@ -1320,7 +1333,7 @@ function Yt(n = "default") {
1320
1333
  ...t.events.pusher.clientOptions,
1321
1334
  getAuthHeaders: i
1322
1335
  };
1323
- s = new Ps({ clientOptions: l }, n);
1336
+ s = new Is({ clientOptions: l }, n);
1324
1337
  break;
1325
1338
  case "none":
1326
1339
  return null;
@@ -1332,12 +1345,12 @@ function Yt(n = "default") {
1332
1345
  throw e instanceof x ? e : new x(`Failed to initialize event receiver: ${e.message}`);
1333
1346
  }
1334
1347
  }
1335
- function xs() {
1348
+ function js() {
1336
1349
  try {
1337
1350
  const n = he(), e = {};
1338
1351
  return Object.keys(n.backendConfigs).forEach((t) => {
1339
1352
  try {
1340
- e[t] = Yt(t);
1353
+ e[t] = Xt(t);
1341
1354
  } catch (s) {
1342
1355
  console.warn(`Failed to initialize event receiver for backend "${t}": ${s.message}`);
1343
1356
  }
@@ -1347,12 +1360,12 @@ function xs() {
1347
1360
  }
1348
1361
  }
1349
1362
  let ft = null;
1350
- function js(n) {
1363
+ function Us(n) {
1351
1364
  if (typeof n != "function")
1352
1365
  throw new x("Provided model getter must be a function.");
1353
1366
  ft = n;
1354
1367
  }
1355
- function Us(n, e = "default") {
1368
+ function Qs(n, e = "default") {
1356
1369
  if (n && n.startsWith("http"))
1357
1370
  return n;
1358
1371
  const s = he().backendConfigs[e];
@@ -1360,20 +1373,20 @@ function Us(n, e = "default") {
1360
1373
  throw new x(`Backend "${e}" not found in configuration.`);
1361
1374
  return s.fileRootURL ? s.fileRootURL.replace(/\/$/, "") + n : n;
1362
1375
  }
1363
- function Xt(n, e) {
1376
+ function es(n, e) {
1364
1377
  if (!ft)
1365
1378
  throw new x("Model registry not registered. Please call registerModelGetter() with the function from model-registry.js during app initialization.");
1366
1379
  return ft(n, e);
1367
1380
  }
1368
1381
  const Fe = {
1369
- setConfig: Rs,
1382
+ setConfig: Ns,
1370
1383
  getConfig: he,
1371
- setBackendConfig: Ns,
1372
- initializeEventReceiver: Yt,
1373
- registerModelGetter: js,
1374
- getModelClass: Xt,
1375
- buildFileUrl: Us
1376
- }, es = "__STATEZERO_DEBUG__", X = globalThis[es] || {
1384
+ setBackendConfig: xs,
1385
+ initializeEventReceiver: Xt,
1386
+ registerModelGetter: Us,
1387
+ getModelClass: es,
1388
+ buildFileUrl: Qs
1389
+ }, ts = "__STATEZERO_DEBUG__", X = globalThis[ts] || {
1377
1390
  emitter: Ae(),
1378
1391
  buffer: [],
1379
1392
  enabled: !0,
@@ -1381,7 +1394,7 @@ const Fe = {
1381
1394
  maxEntries: 500,
1382
1395
  nextId: 1
1383
1396
  };
1384
- globalThis[es] = X;
1397
+ globalThis[ts] = X;
1385
1398
  const Me = X.emitter, ue = X.buffer;
1386
1399
  function Te(n) {
1387
1400
  if (!X.enabled) return;
@@ -1395,23 +1408,23 @@ function Te(n) {
1395
1408
  function B(n) {
1396
1409
  Te(n);
1397
1410
  }
1398
- function Qs(n) {
1411
+ function Vs(n) {
1399
1412
  return Me.on("record", n), () => Me.off("record", n);
1400
1413
  }
1401
- function Vs(n) {
1414
+ function Ls(n) {
1402
1415
  return Me.on("clear", n), () => Me.off("clear", n);
1403
1416
  }
1404
1417
  function Vt() {
1405
1418
  return ue.slice();
1406
1419
  }
1407
- function Ls() {
1420
+ function Gs() {
1408
1421
  ue.length = 0, Me.emit("clear");
1409
1422
  }
1410
1423
  function Lt(n) {
1411
1424
  const e = Number(n);
1412
1425
  !Number.isFinite(e) || e <= 0 || (X.maxEntries = Math.floor(e), ue.length > X.maxEntries && ue.splice(0, ue.length - X.maxEntries));
1413
1426
  }
1414
- function Gs() {
1427
+ function Bs() {
1415
1428
  X.started || (X.started = !0, ie.on(C.CREATED, (n) => {
1416
1429
  Te({
1417
1430
  type: "operation",
@@ -1465,10 +1478,10 @@ function Gs() {
1465
1478
  }));
1466
1479
  }
1467
1480
  const ct = /* @__PURE__ */ new Map();
1468
- function Bs(n = "default") {
1469
- return ct.has(n) || ct.set(n, new fs({ concurrency: 1 })), ct.get(n);
1481
+ function Hs(n = "default") {
1482
+ return ct.has(n) || ct.set(n, new ps({ concurrency: 1 })), ct.get(n);
1470
1483
  }
1471
- function Hs(n, e = 3e4) {
1484
+ function qs(n, e = 3e4) {
1472
1485
  return Promise.race([
1473
1486
  n,
1474
1487
  new Promise(
@@ -1476,7 +1489,7 @@ function Hs(n, e = 3e4) {
1476
1489
  )
1477
1490
  ]);
1478
1491
  }
1479
- function _e(n, e, t, s = null) {
1492
+ function we(n, e, t, s = null) {
1480
1493
  if (!e) return;
1481
1494
  const r = t.configKey;
1482
1495
  let o = null;
@@ -1535,7 +1548,7 @@ async function L(n, e, t = {}, s, r = null, o = null, i = {}) {
1535
1548
  "delete_instance",
1536
1549
  "get_or_create",
1537
1550
  "update_or_create"
1538
- ].includes(e), U = `${p.API_URL.replace(/\/+$/, "")}/${c.modelName}/`, N = p.getAuthHeaders ? p.getAuthHeaders() : {}, F = n.semanticKey;
1551
+ ].includes(e), U = `${p.API_URL.replace(/\/+$/, "")}/${c.modelName}/`, N = p.getAuthHeaders ? p.getAuthHeaders() : {}, I = n.semanticKey;
1539
1552
  s && (N["X-Operation-ID"] = s), o && (N["X-Canonical-ID"] = o);
1540
1553
  const re = async () => {
1541
1554
  try {
@@ -1543,7 +1556,7 @@ async function L(n, e, t = {}, s, r = null, o = null, i = {}) {
1543
1556
  type: "request",
1544
1557
  modelName: c.modelName,
1545
1558
  configKey: c.configKey,
1546
- semanticKey: F,
1559
+ semanticKey: I,
1547
1560
  operationType: e,
1548
1561
  operationId: s,
1549
1562
  canonicalId: o,
@@ -1551,61 +1564,61 @@ async function L(n, e, t = {}, s, r = null, o = null, i = {}) {
1551
1564
  payload: w,
1552
1565
  namespace: l
1553
1566
  });
1554
- let I = await ps.post(U, We(w), { headers: N });
1555
- typeof r == "function" && I?.data && await r(I.data);
1556
- const D = I?.data?.data, z = I?.data?.included, pe = Array.isArray(D) ? D.length : D != null ? 1 : 0, Ye = z ? Object.keys(z).length : 0, me = 100, Ke = Array.isArray(D) && D.length > me ? D.slice(0, me) : D, Xe = Array.isArray(D) && D.length > me;
1557
- let ze = z, Ee = !1;
1558
- if (z && typeof z == "object") {
1559
- const Re = {};
1567
+ let D = await ms.post(U, We(w), { headers: N });
1568
+ typeof r == "function" && D?.data && await r(D.data);
1569
+ const F = D?.data?.data, K = D?.data?.included, me = Array.isArray(F) ? F.length : F != null ? 1 : 0, Ye = K ? Object.keys(K).length : 0, ye = 100, Ke = Array.isArray(F) && F.length > ye ? F.slice(0, ye) : F, Xe = Array.isArray(F) && F.length > ye;
1570
+ let Re = K, Ee = !1;
1571
+ if (K && typeof K == "object") {
1572
+ const Ne = {};
1560
1573
  let ne = 0;
1561
- for (const [Ne, xe] of Object.entries(z))
1562
- if (Re[Ne] = xe, ne += 1, ne >= me) {
1574
+ for (const [xe, je] of Object.entries(K))
1575
+ if (Ne[xe] = je, ne += 1, ne >= ye) {
1563
1576
  Ee = !0;
1564
1577
  break;
1565
1578
  }
1566
- ze = Ee ? Re : z;
1579
+ Re = Ee ? Ne : K;
1567
1580
  }
1568
1581
  return B({
1569
1582
  type: "response",
1570
1583
  modelName: c.modelName,
1571
1584
  configKey: c.configKey,
1572
- semanticKey: F,
1585
+ semanticKey: I,
1573
1586
  operationType: e,
1574
1587
  operationId: s,
1575
1588
  canonicalId: o,
1576
1589
  url: U,
1577
- status: I.status,
1578
- dataCount: pe,
1590
+ status: D.status,
1591
+ dataCount: me,
1579
1592
  includedCount: Ye,
1580
1593
  data: Ke,
1581
- included: ze,
1594
+ included: Re,
1582
1595
  dataTruncated: Xe,
1583
1596
  includedTruncated: Ee
1584
- }), I.data;
1585
- } catch (I) {
1597
+ }), D.data;
1598
+ } catch (D) {
1586
1599
  if (B({
1587
1600
  type: "error",
1588
1601
  modelName: c.modelName,
1589
1602
  configKey: c.configKey,
1590
- semanticKey: F,
1603
+ semanticKey: I,
1591
1604
  operationType: e,
1592
1605
  operationId: s,
1593
1606
  canonicalId: o,
1594
1607
  url: U,
1595
- status: I?.response?.status,
1596
- message: I?.message
1597
- }), I?.code === "ECONNREFUSED") {
1598
- const D = "Connection refused. If you're running tests, start the test server with `python manage.py statezero_testserver`.";
1599
- throw new Error(`${D} (${U})`);
1608
+ status: D?.response?.status,
1609
+ message: D?.message
1610
+ }), D?.code === "ECONNREFUSED") {
1611
+ const F = "Connection refused. If you're running tests, start the test server with `python manage.py statezero_testserver`.";
1612
+ throw new Error(`${F} (${U})`);
1600
1613
  }
1601
- if (I.response && I.response.data) {
1602
- const D = Os(I.response.data);
1603
- throw Error.captureStackTrace && Error.captureStackTrace(D, L), D;
1614
+ if (D.response && D.response.data) {
1615
+ const F = Ps(D.response.data);
1616
+ throw Error.captureStackTrace && Error.captureStackTrace(F, L), F;
1604
1617
  }
1605
- throw new Error(`API call failed: ${I.message}`);
1618
+ throw new Error(`API call failed: ${D.message}`);
1606
1619
  }
1607
- }, fe = Bs(l), ae = b ? fe.add(re) : re();
1608
- return a ? Hs(ae, a) : ae;
1620
+ }, pe = Hs(l), ae = b ? pe.add(re) : re();
1621
+ return a ? qs(ae, a) : ae;
1609
1622
  }
1610
1623
  class Gt {
1611
1624
  // Supported Django strftime formats and their date-fns equivalents
@@ -1657,11 +1670,11 @@ class Gt {
1657
1670
  );
1658
1671
  try {
1659
1672
  if (!l || l === "iso-8601") {
1660
- const c = ge.fromISO(e, { zone: r });
1673
+ const c = _e.fromISO(e, { zone: r });
1661
1674
  return c.isValid ? c.toJSDate() : (console.error(`Failed to parse ISO date "${e}":`, c.invalidReason), null);
1662
1675
  }
1663
1676
  const a = this.SUPPORTED_FORMATS[l];
1664
- return ys(e, a, /* @__PURE__ */ new Date());
1677
+ return gs(e, a, /* @__PURE__ */ new Date());
1665
1678
  } catch (a) {
1666
1679
  return console.error(`Failed to parse date "${e}" with format "${l}"`, a), null;
1667
1680
  }
@@ -1693,13 +1706,13 @@ class Gt {
1693
1706
  if (!i || i === "iso-8601")
1694
1707
  return r === "date" ? e.toISOString().slice(0, 10) : e.toISOString();
1695
1708
  const l = this.SUPPORTED_FORMATS[i];
1696
- return gs(e, l);
1709
+ return _s(e, l);
1697
1710
  } catch (l) {
1698
1711
  return console.error(`Failed to format date with format "${i}"`, l), e.toISOString();
1699
1712
  }
1700
1713
  }
1701
1714
  }
1702
- function qs(n) {
1715
+ function Js(n) {
1703
1716
  if (!n || !n.configKey)
1704
1717
  return "UTC";
1705
1718
  const e = Fe.getConfig();
@@ -1757,7 +1770,7 @@ const Bt = {
1757
1770
  if (E(n) || typeof n != "string") return n;
1758
1771
  const { model: t, field: s } = e;
1759
1772
  if (t?.schema) {
1760
- const r = qs(t);
1773
+ const r = Js(t);
1761
1774
  return Gt.parseDate(n, s, t.schema, r);
1762
1775
  }
1763
1776
  try {
@@ -1781,7 +1794,7 @@ const Bt = {
1781
1794
  const { model: t, field: s } = e;
1782
1795
  return t.relationshipFields.has(s) && n ? t.relationshipFields.get(s).ModelClass().fromPk(n) : n;
1783
1796
  }
1784
- }, Js = {
1797
+ }, Ws = {
1785
1798
  toInternal: (n, e = {}) => {
1786
1799
  if (E(n)) return n;
1787
1800
  if (!Array.isArray(n)) throw new Error(`expected array, got ${typeof n}`);
@@ -1826,10 +1839,10 @@ const Bt = {
1826
1839
  "one-to-one": ke
1827
1840
  },
1828
1841
  array: {
1829
- "many-to-many": Js
1842
+ "many-to-many": Ws
1830
1843
  }
1831
1844
  };
1832
- class ts {
1845
+ class ss {
1833
1846
  constructor(e) {
1834
1847
  this.modelClass = e;
1835
1848
  }
@@ -1884,16 +1897,15 @@ class ts {
1884
1897
  return t;
1885
1898
  }
1886
1899
  }
1887
- const { createEqualsOperation: ee } = vt;
1888
- function Ws(n) {
1900
+ function Zs(n) {
1889
1901
  if (!n || !n.configKey)
1890
1902
  return "UTC";
1891
1903
  const e = Fe.getConfig();
1892
1904
  return (e.backendConfigs[n.configKey] || e.backendConfigs.default).BACKEND_TZ || "UTC";
1893
1905
  }
1894
- function Zs(n, e, t) {
1906
+ function Ys(n, e, t) {
1895
1907
  if (!t?.schema || !n) return e;
1896
- const s = new ts(t);
1908
+ const s = new ss(t);
1897
1909
  return Array.isArray(e) ? e.map((r) => s.toLiveField(n, r)) : s.toLiveField(n, e);
1898
1910
  }
1899
1911
  function De(n, e, t, s = {}) {
@@ -1912,8 +1924,6 @@ function De(n, e, t, s = {}) {
1912
1924
  "lt",
1913
1925
  "lte",
1914
1926
  "isnull",
1915
- "regex",
1916
- "iregex",
1917
1927
  "year",
1918
1928
  "month",
1919
1929
  "day",
@@ -1937,63 +1947,63 @@ function De(n, e, t, s = {}) {
1937
1947
  k === "pk" && p && (k = p.primaryKeyField);
1938
1948
  const U = b === c.length - 1;
1939
1949
  if (p && p.relationshipFields && p.relationshipFields instanceof Map && p.relationshipFields.has(k)) {
1940
- const N = p.relationshipFields.get(k), F = N.ModelClass(), re = N.relationshipType;
1950
+ const N = p.relationshipFields.get(k), I = N.ModelClass(), re = N.relationshipType;
1941
1951
  if (!U && re === "many-to-many") {
1942
1952
  let ae = c.slice(b + 1).join("__");
1943
1953
  a.length > 0 ? ae += "__" + a.join("__") : f && (ae += "__" + f);
1944
- const I = De(ae, e, F, s), D = m.length > 0 ? m.join(".") + "." + k : k, z = I.requiredPath || I.field, pe = `${D}.${z}`;
1954
+ const D = De(ae, e, I, s), F = m.length > 0 ? m.join(".") + "." + k : k, K = D.requiredPath || D.field, me = `${F}.${K}`;
1945
1955
  return {
1946
- field: D,
1947
- operator: { $elemMatch: { [I.field]: I.operator } },
1956
+ field: F,
1957
+ operator: { $elemMatch: { [D.field]: D.operator } },
1948
1958
  isM2M: !0,
1949
- requiredPath: pe
1959
+ requiredPath: me
1950
1960
  // Full path for data picking
1951
1961
  };
1952
1962
  }
1953
1963
  if (m.push(k), !U)
1954
- p = F;
1964
+ p = I;
1955
1965
  else {
1956
1966
  if (y = !0, re === "many-to-many")
1957
1967
  _ = !0, w = k;
1958
1968
  else {
1959
- const fe = F.primaryKeyField || "id";
1960
- m.push(fe), w = fe;
1969
+ const pe = I.primaryKeyField || "id";
1970
+ m.push(pe), w = pe;
1961
1971
  }
1962
- p = F;
1972
+ p = I;
1963
1973
  }
1964
1974
  } else if (p && p.fields && p.fields.includes(k)) {
1965
1975
  if (m.push(k), w = k, U)
1966
1976
  break;
1967
1977
  const N = p.schema?.properties?.[k];
1968
1978
  if (N && N.format === "json") {
1969
- const F = c.slice(b + 1);
1970
- m.push(...F);
1979
+ const I = c.slice(b + 1);
1980
+ m.push(...I);
1971
1981
  break;
1972
1982
  }
1973
1983
  throw new Error(`Field '${k}' in '${n}' is not a relationship field and cannot be traversed.`);
1974
1984
  } else
1975
1985
  throw new Error(`Field '${k}' in '${n}' not found in model ${p.modelName}.`);
1976
1986
  }
1977
- const v = m.join("."), T = i.includes(f) || a.length === 2 && i.includes(a[0]) ? e : Zs(w, e, p);
1987
+ const v = m.join("."), T = i.includes(f) || a.length === 2 && i.includes(a[0]) ? e : Ys(w, e, p);
1978
1988
  if (a.length === 2) {
1979
1989
  const [b, k] = a;
1980
- return Ys(v, b, k, T, y);
1990
+ return Xs(v, b, k, T, y);
1981
1991
  }
1982
1992
  if (f)
1983
- return Xs(v, f, T, y, p, w, _);
1993
+ return er(v, f, T, y, p, w, _);
1984
1994
  if (y) {
1985
1995
  let b = T;
1986
1996
  return T && typeof T == "object" && "pk" in T && (b = T.pk), _ ? { field: v, operator: { $elemMatch: { pk: { $eq: b } } }, isM2M: !0 } : { field: v, operator: { $eq: b } };
1987
1997
  }
1988
1998
  return { field: v, operator: { $eq: T } };
1989
1999
  }
1990
- function Ys(n, e, t, s, r) {
2000
+ function Xs(n, e, t, s, r) {
1991
2001
  return r ? (console.warn(`Date part comparison on relationship fields may not work as expected: ${n}`), { field: n, operator: { $eq: s } }) : {
1992
2002
  field: n,
1993
2003
  operator: { [`$${e}_${t}`]: s }
1994
2004
  };
1995
2005
  }
1996
- function Xs(n, e, t, s, r, o, i = !1) {
2006
+ function er(n, e, t, s, r, o, i = !1) {
1997
2007
  function l(a) {
1998
2008
  return a.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
1999
2009
  }
@@ -2048,12 +2058,12 @@ function Xs(n, e, t, s, r, o, i = !1) {
2048
2058
  operator: { $regex: new RegExp(`${l(t)}$`, "i") }
2049
2059
  } : e === "in" ? { field: n, operator: { $in: t } } : e === "gt" ? { field: n, operator: { $nin: [null, void 0], $gt: t } } : e === "gte" ? { field: n, operator: { $nin: [null, void 0], $gte: t } } : e === "lt" ? { field: n, operator: { $nin: [null, void 0], $lt: t } } : e === "lte" ? { field: n, operator: { $nin: [null, void 0], $lte: t } } : { field: n, operator: { $eq: t } };
2050
2060
  }
2051
- function er(n = "UTC", e = null) {
2052
- const t = e ? new ts(e) : null, s = (a, c = null) => a ? a instanceof Date ? a : t && c && typeof a == "string" ? t.toLiveField(c, a) : (console.warn("Date conversion without serializer context:", a), null) : null, r = (a, c, f = null) => {
2061
+ function tr(n = "UTC", e = null) {
2062
+ const t = e ? new ss(e) : null, s = (a, c = null) => a ? a instanceof Date ? a : t && c && typeof a == "string" ? t.toLiveField(c, a) : (console.warn("Date conversion without serializer context:", a), null) : null, r = (a, c, f = null) => {
2053
2063
  const p = s(a, f);
2054
2064
  if (!p || !(p instanceof Date) || isNaN(p.getTime()))
2055
2065
  return null;
2056
- const m = ge.fromJSDate(p).setZone(n);
2066
+ const m = _e.fromJSDate(p).setZone(n);
2057
2067
  return c(m);
2058
2068
  }, o = {
2059
2069
  // Year - same in both
@@ -2149,7 +2159,7 @@ function er(n = "UTC", e = null) {
2149
2159
  return !1;
2150
2160
  const _ = s(a, m);
2151
2161
  if (!_ || isNaN(_.getTime())) return !1;
2152
- const w = ge.fromJSDate(y).setZone(n), v = ge.fromJSDate(_).setZone(n);
2162
+ const w = _e.fromJSDate(y).setZone(n), v = _e.fromJSDate(_).setZone(n);
2153
2163
  return w.year === v.year && w.month === v.month && w.day === v.day;
2154
2164
  },
2155
2165
  c,
@@ -2163,7 +2173,7 @@ function er(n = "UTC", e = null) {
2163
2173
  const y = s(p, m);
2164
2174
  if (!y || !(y instanceof Date) || isNaN(y.getTime()))
2165
2175
  return !1;
2166
- const _ = ge.fromJSDate(y).setZone(n);
2176
+ const _ = _e.fromJSDate(y).setZone(n);
2167
2177
  let w, v, O;
2168
2178
  if (typeof a == "string") {
2169
2179
  const T = a.split(":");
@@ -2171,7 +2181,7 @@ function er(n = "UTC", e = null) {
2171
2181
  } else {
2172
2182
  const T = s(a, m);
2173
2183
  if (!T) return !1;
2174
- const b = ge.fromJSDate(T).setZone(n);
2184
+ const b = _e.fromJSDate(T).setZone(n);
2175
2185
  w = b.hour, v = b.minute, O = b.second;
2176
2186
  }
2177
2187
  return _.hour === w && _.minute === v && _.second === O;
@@ -2201,7 +2211,7 @@ function er(n = "UTC", e = null) {
2201
2211
  const v = s(_, w);
2202
2212
  if (!v || !(v instanceof Date) || isNaN(v.getTime()))
2203
2213
  return !1;
2204
- const O = ge.fromJSDate(v).setZone(n), T = c(O), b = a === "date" ? p : typeof p == "string" ? Number(p) : p;
2214
+ const O = _e.fromJSDate(v).setZone(n), T = c(O), b = a === "date" ? p : typeof p == "string" ? Number(p) : p;
2205
2215
  switch (f) {
2206
2216
  case "gt":
2207
2217
  return T > b;
@@ -2223,10 +2233,10 @@ function er(n = "UTC", e = null) {
2223
2233
  });
2224
2234
  }), o;
2225
2235
  }
2226
- function tr(n, e) {
2227
- const t = Ws(e);
2228
- return vt(n, {
2229
- operations: er(t, e)
2236
+ function sr(n, e) {
2237
+ const t = Zs(e);
2238
+ return Zt(n, {
2239
+ operations: tr(t, e)
2230
2240
  });
2231
2241
  }
2232
2242
  function pt(n, e) {
@@ -2236,7 +2246,7 @@ function pt(n, e) {
2236
2246
  const l = De(o, i, e), { field: a, operator: c, isDatePart: f, isM2M: p } = l;
2237
2247
  f ? (s.has(a) || s.set(a, []), s.get(a).push({ [a]: c })) : p && c.$elemMatch ? (r.has(a) || r.set(a, []), r.get(a).push(c.$elemMatch)) : t[a] ? t[a] = { ...t[a], ...c } : t[a] = c;
2238
2248
  } catch (l) {
2239
- throw new Error(`Failed to process field '${o}': ${l.message}`);
2249
+ throw new Oe(`Failed to process field '${o}': ${l.message}`);
2240
2250
  }
2241
2251
  for (const [o, i] of r.entries())
2242
2252
  i.length === 1 ? t[o] = { $elemMatch: i[0] } : t[o] = { $elemMatch: { $and: i } };
@@ -2257,7 +2267,7 @@ function pt(n, e) {
2257
2267
  }
2258
2268
  return t;
2259
2269
  }
2260
- function sr(n, e) {
2270
+ function rr(n, e) {
2261
2271
  return !n || !n.length ? null : {
2262
2272
  $or: n.map((t) => "operator" in t && "conditions" in t ? { [t.operator === "AND" ? "$and" : "$or"]: t.conditions.map((r) => pt(r, e)) } : pt(t, e))
2263
2273
  };
@@ -2268,7 +2278,7 @@ function He(n, e) {
2268
2278
  const { conditions: t, Q: s } = n;
2269
2279
  let r = {};
2270
2280
  if (t && Object.keys(t).length > 0 && (r = pt(t, e)), s && s.length > 0) {
2271
- const o = sr(s, e);
2281
+ const o = rr(s, e);
2272
2282
  if (o)
2273
2283
  return Object.keys(r).length > 0 ? { $and: [r, o] } : o;
2274
2284
  }
@@ -2288,7 +2298,7 @@ function He(n, e) {
2288
2298
  }
2289
2299
  return null;
2290
2300
  }
2291
- function rr(n, e, t) {
2301
+ function nr(n, e, t) {
2292
2302
  if (!e || !e.searchQuery) return n;
2293
2303
  const s = e.searchFields || (n[0] ? Object.keys(n[0]).filter((i) => typeof n[0][i] == "string") : []);
2294
2304
  if (!s.length) return n;
@@ -2311,7 +2321,7 @@ function rr(n, e, t) {
2311
2321
  };
2312
2322
  }
2313
2323
  });
2314
- return n.filter(vt({ $or: o }));
2324
+ return n.filter(Zt({ $or: o }));
2315
2325
  }
2316
2326
  function qt(n, e) {
2317
2327
  const t = e.split(".");
@@ -2323,7 +2333,7 @@ function qt(n, e) {
2323
2333
  }
2324
2334
  return s;
2325
2335
  }
2326
- function nr(n, e) {
2336
+ function or(n, e) {
2327
2337
  return n.map((t) => {
2328
2338
  const s = t.startsWith("-"), r = s ? t.substring(1) : t;
2329
2339
  try {
@@ -2340,9 +2350,9 @@ function nr(n, e) {
2340
2350
  }
2341
2351
  });
2342
2352
  }
2343
- function or(n, e, t) {
2353
+ function ir(n, e, t) {
2344
2354
  if (!e || !e.length) return [...n];
2345
- const s = nr(e, t);
2355
+ const s = or(e, t);
2346
2356
  return [...n].sort((r, o) => {
2347
2357
  for (const { field: i, desc: l } of s) {
2348
2358
  const a = qt(r, i), c = qt(o, i);
@@ -2367,9 +2377,9 @@ function mt(n, e, t) {
2367
2377
  let r = [...n];
2368
2378
  if (e.filter) {
2369
2379
  const o = He(e.filter, t);
2370
- o && Object.keys(o).length && (r = r.filter(tr(o, t)));
2380
+ o && Object.keys(o).length && (r = r.filter(sr(o, t)));
2371
2381
  }
2372
- return e.search && e.search.searchQuery && (r = rr(r, e.search, t)), Array.isArray(e.orderBy) && e.orderBy.length && (r = or(r, e.orderBy, t)), r.map((o) => o[s]);
2382
+ return e.search && e.search.searchQuery && (r = nr(r, e.search, t)), Array.isArray(e.orderBy) && e.orderBy.length && (r = ir(r, e.orderBy, t)), r.map((o) => o[s]);
2373
2383
  }
2374
2384
  function yt(n, e) {
2375
2385
  const t = /* @__PURE__ */ new Set(), s = e.primaryKeyField;
@@ -2433,7 +2443,7 @@ function wt(n, e, t, s = !1) {
2433
2443
  }
2434
2444
  return l;
2435
2445
  }
2436
- class ir {
2446
+ class ar {
2437
2447
  modelClass;
2438
2448
  fetchFn;
2439
2449
  queryset;
@@ -2444,10 +2454,10 @@ class ir {
2444
2454
  constructor(e, t, s, r = null, o = null, i = {}) {
2445
2455
  if (this.modelClass = e, this.fetchFn = t, this.queryset = s, this.isSyncing = !1, this.lastSync = null, this.isTemp = i.isTemp || !1, this.pruneThreshold = i.pruneThreshold || 10, this.groundTruthPks = r || [], this.operationsMap = /* @__PURE__ */ new Map(), this.includedPks = /* @__PURE__ */ new Map(), Array.isArray(o))
2446
2456
  for (const l of o) {
2447
- const c = Oe.get(l.operationId) || new q(l, !0);
2457
+ const c = Pe.get(l.operationId) || new q(l, !0);
2448
2458
  this.operationsMap.set(c.operationId, c);
2449
2459
  }
2450
- if (this.qsCache = new Et("queryset-cache", {}, this.onHydrated.bind(this)), this._lastRenderedPks = null, this.renderCallbacks = /* @__PURE__ */ new Set(), !this.isTemp) {
2460
+ if (this.qsCache = new vt("queryset-cache", {}, this.onHydrated.bind(this)), this._lastRenderedPks = null, this.renderCallbacks = /* @__PURE__ */ new Set(), !this.isTemp) {
2451
2461
  const l = Q.getStore(this.modelClass);
2452
2462
  this._modelStoreUnregister = l.registerRenderCallback(() => {
2453
2463
  this._emitRenderEvent();
@@ -2461,13 +2471,13 @@ class ir {
2461
2471
  onHydrated(e) {
2462
2472
  if (this.groundTruthPks.length === 0 && this.operationsMap.size === 0) {
2463
2473
  const t = this.qsCache.get(this.cacheKey);
2464
- !E(t) && !Ce(t) && this.setGroundTruth(t);
2474
+ !E(t) && !ve(t) && this.setGroundTruth(t);
2465
2475
  }
2466
2476
  }
2467
2477
  setCache(e) {
2468
2478
  let t = [];
2469
2479
  e.forEach((s) => {
2470
- typeof s == "string" && Je(s) && (s = We(s), E(s) || Ce(dt(s))) || t.push(s);
2480
+ typeof s == "string" && Je(s) && (s = We(s), E(s) || ve(dt(s))) || t.push(s);
2471
2481
  }), this.qsCache.set(this.cacheKey, t);
2472
2482
  }
2473
2483
  clearCache() {
@@ -2491,7 +2501,7 @@ class ir {
2491
2501
  } catch (s) {
2492
2502
  console.warn("Error in render callback:", s);
2493
2503
  }
2494
- }), qe(e, this._lastRenderedPks) || (this._lastRenderedPks = e, Es.emit(
2504
+ }), qe(e, this._lastRenderedPks) || (this._lastRenderedPks = e, bs.emit(
2495
2505
  `${this.modelClass.configKey}::${this.modelClass.modelName}::queryset::render`,
2496
2506
  { ast: this.queryset.build(), ModelClass: this.modelClass }
2497
2507
  ));
@@ -2510,7 +2520,13 @@ class ir {
2510
2520
  this.operationsMap.has(e.operationId) && (this.operationsMap.set(e.operationId, e), this._emitRenderEvent());
2511
2521
  }
2512
2522
  async setGroundTruth(e) {
2513
- this.groundTruthPks = Array.isArray(e) ? e : [], this.lastSync = Date.now(), this._emitRenderEvent();
2523
+ if (this.groundTruthPks = Array.isArray(e) ? e : [], this.groundTruthPks.length > 500) {
2524
+ const t = this.queryset?._serializerOptions?.limit;
2525
+ console.warn(
2526
+ `[statezero] ⚠️ ${this.modelClass.modelName} (${this.queryset.semanticKey}) received ${this.groundTruthPks.length} items${t ? ` (limit: ${t})` : " with NO limit"}. Live querysets re-render on every change — at this size, this WILL cause UI freezes on mobile. Add .fetch({ limit }) or use narrower filters.`
2527
+ );
2528
+ }
2529
+ this.lastSync = Date.now(), this._emitRenderEvent();
2514
2530
  }
2515
2531
  async setOperations(e) {
2516
2532
  if (this.operationsMap.clear(), Array.isArray(e))
@@ -2620,8 +2636,10 @@ class ir {
2620
2636
  t.add(o);
2621
2637
  break;
2622
2638
  case M.CHECKPOINT:
2639
+ break;
2623
2640
  case M.UPDATE:
2624
2641
  case M.UPDATE_INSTANCE:
2642
+ t.add(o);
2625
2643
  break;
2626
2644
  case M.DELETE:
2627
2645
  case M.DELETE_INSTANCE:
@@ -2659,7 +2677,7 @@ class ir {
2659
2677
  modelClass: this.modelClass,
2660
2678
  canonical_id: e
2661
2679
  }), { data: r, included: o } = s;
2662
- E(r) || (this.includedPks.clear(), _e(Q, o, this.modelClass, this.queryset), this.setGroundTruth(r)), this.setOperations(this.getInflightOperations()), this.lastSync = Date.now(), B({
2680
+ E(r) || (this.includedPks.clear(), we(Q, o, this.modelClass, this.queryset), this.setGroundTruth(r)), this.setOperations(this.getInflightOperations()), this.lastSync = Date.now(), B({
2663
2681
  type: "sync",
2664
2682
  phase: "success",
2665
2683
  semanticKey: this.queryset.semanticKey,
@@ -2684,9 +2702,9 @@ class ir {
2684
2702
  }
2685
2703
  }
2686
2704
  }
2687
- class ar {
2705
+ class lr {
2688
2706
  constructor() {
2689
- this.graph = new Kt({ directed: !0 }), this.processedQuerysets = /* @__PURE__ */ new Set();
2707
+ this.graph = new Dt({ directed: !0 }), this.processedQuerysets = /* @__PURE__ */ new Set();
2690
2708
  }
2691
2709
  /**
2692
2710
  * Add a queryset and its parent relationship to the graph
@@ -2772,10 +2790,10 @@ class ar {
2772
2790
  return !e && !t ? !0 : !e || !t || e.length !== t.length ? !1 : e.every((s, r) => s === t[r]);
2773
2791
  }
2774
2792
  clear() {
2775
- this.graph = new Kt({ directed: !0 }), this.processedQuerysets = /* @__PURE__ */ new Set();
2793
+ this.graph = new Dt({ directed: !0 }), this.processedQuerysets = /* @__PURE__ */ new Set();
2776
2794
  }
2777
2795
  }
2778
- class lr {
2796
+ class cr {
2779
2797
  #e;
2780
2798
  #t;
2781
2799
  #s;
@@ -2815,11 +2833,11 @@ class lr {
2815
2833
  return j.getStore(this.#e).render().map((r) => (this.#t.primaryKeyField, this.#t.fromPk(r, this.#e)));
2816
2834
  }
2817
2835
  }
2818
- class we {
2836
+ class Ce {
2819
2837
  constructor() {
2820
2838
  this._stores = /* @__PURE__ */ new Map(), this._tempStores = /* @__PURE__ */ new WeakMap(), this.followingQuerysets = /* @__PURE__ */ new Map(), this.syncManager = () => {
2821
2839
  console.warn("SyncManager not set for QuerysetStoreRegistry");
2822
- }, this.querysetStoreGraph = new ar(), this._groupSyncCache = /* @__PURE__ */ new Map();
2840
+ }, this.querysetStoreGraph = new lr(), this._groupSyncCache = /* @__PURE__ */ new Map();
2823
2841
  }
2824
2842
  clear() {
2825
2843
  this._stores.forEach((e) => {
@@ -2867,7 +2885,7 @@ class we {
2867
2885
  { namespace: "sync", timeout: 3e4 }
2868
2886
  // Sync ops on separate queue
2869
2887
  )).data;
2870
- }, o = new ir(
2888
+ }, o = new ar(
2871
2889
  e.ModelClass,
2872
2890
  r,
2873
2891
  e,
@@ -2891,7 +2909,7 @@ class we {
2891
2909
  this.addFollowingQueryset(s, e);
2892
2910
  let r;
2893
2911
  this._tempStores.has(e) ? (r = this._tempStores.get(e), r.isTemp = !1, r.registerWithModelStore(), this._stores.set(s, r), this.syncManager.followModel(this, e.ModelClass)) : this._stores.has(s) ? r = this._stores.get(s) : (r = this.getStore(e), r.isTemp = !1, r.registerWithModelStore(), this._stores.set(s, r), this.syncManager.followModel(this, e.ModelClass));
2894
- const o = new lr(e);
2912
+ const o = new cr(e);
2895
2913
  return t && r.sync(), o;
2896
2914
  }
2897
2915
  /**
@@ -3009,8 +3027,8 @@ class we {
3009
3027
  }
3010
3028
  }
3011
3029
  }
3012
- const j = new we();
3013
- class Ie {
3030
+ const j = new Ce();
3031
+ class ze {
3014
3032
  /**
3015
3033
  * Calculate metric based on ground truth and operations
3016
3034
  */
@@ -3055,7 +3073,7 @@ class Ie {
3055
3073
  return isNaN(r) ? 0 : r;
3056
3074
  }
3057
3075
  }
3058
- class cr extends Ie {
3076
+ class dr extends ze {
3059
3077
  reduceOperation(e, t, s) {
3060
3078
  if (t.status === C.REJECTED)
3061
3079
  return e;
@@ -3063,7 +3081,7 @@ class cr extends Ie {
3063
3081
  return r === M.CREATE ? e + 1 : [M.DELETE, M.DELETE_INSTANCE].includes(r) ? Math.max(0, e - 1) : e;
3064
3082
  }
3065
3083
  }
3066
- class dr extends Ie {
3084
+ class ur extends ze {
3067
3085
  reduceOperation(e, t, s) {
3068
3086
  if (t.status === C.REJECTED)
3069
3087
  return e;
@@ -3088,7 +3106,7 @@ class dr extends Ie {
3088
3106
  }
3089
3107
  }
3090
3108
  }
3091
- class ur extends Ie {
3109
+ class hr extends ze {
3092
3110
  getInitialValue() {
3093
3111
  return 1 / 0;
3094
3112
  }
@@ -3111,7 +3129,7 @@ class ur extends Ie {
3111
3129
  return e;
3112
3130
  }
3113
3131
  }
3114
- class hr extends Ie {
3132
+ class fr extends ze {
3115
3133
  getInitialValue() {
3116
3134
  return -1 / 0;
3117
3135
  }
@@ -3134,15 +3152,15 @@ class hr extends Ie {
3134
3152
  return e;
3135
3153
  }
3136
3154
  }
3137
- class fr {
3155
+ class pr {
3138
3156
  // Collection of custom strategy overrides
3139
3157
  static #e = /* @__PURE__ */ new Map();
3140
3158
  // Default strategy map
3141
3159
  static #t = /* @__PURE__ */ new Map([
3142
- ["count", () => new cr()],
3143
- ["sum", () => new dr()],
3144
- ["min", () => new ur()],
3145
- ["max", () => new hr()]
3160
+ ["count", () => new dr()],
3161
+ ["sum", () => new ur()],
3162
+ ["min", () => new hr()],
3163
+ ["max", () => new fr()]
3146
3164
  ]);
3147
3165
  /**
3148
3166
  * Clear all custom strategy overrides
@@ -3169,7 +3187,7 @@ class fr {
3169
3187
  static overrideStrategy(e, t, s) {
3170
3188
  if (!e || !s)
3171
3189
  throw new Error("overrideStrategy requires metricType and strategy");
3172
- if (!(s instanceof Ie))
3190
+ if (!(s instanceof ze))
3173
3191
  throw new Error("strategy must be an instance of MetricCalculationStrategy");
3174
3192
  let r;
3175
3193
  t ? r = this.#s(e, t) : r = `${e}::*::*`, this.#e.set(r, s);
@@ -3188,9 +3206,9 @@ class fr {
3188
3206
  return this.#e.has(o) ? this.#e.get(o) : (this.#t.get(s) || this.#t.get("count"))();
3189
3207
  }
3190
3208
  }
3191
- class pr {
3209
+ class mr {
3192
3210
  constructor(e, t, s, r = null, o = null, i) {
3193
- this.metricType = e, this.modelClass = t, this.queryset = s, this.field = r, this.ast = o, this.fetchFn = i, this.groundTruthValue = null, this.isSyncing = !1, this.strategy = fr.getStrategy(e, t), this.operations = [], this.confirmedOps = /* @__PURE__ */ new Set(), this.metricCache = new Et(
3211
+ this.metricType = e, this.modelClass = t, this.queryset = s, this.field = r, this.ast = o, this.fetchFn = i, this.groundTruthValue = null, this.isSyncing = !1, this.strategy = pr.getStrategy(e, t), this.operations = [], this.confirmedOps = /* @__PURE__ */ new Set(), this.metricCache = new vt(
3194
3212
  "metric-store-cache",
3195
3213
  {},
3196
3214
  this.onHydrated.bind(this)
@@ -3250,7 +3268,7 @@ class pr {
3250
3268
  onHydrated() {
3251
3269
  if (this.groundTruthValue === null) {
3252
3270
  const e = this.metricCache.get(this.cacheKey);
3253
- !E(e) && !Ce(e) && this.setGroundTruth(e?.value);
3271
+ !E(e) && !ve(e) && this.setGroundTruth(e?.value);
3254
3272
  }
3255
3273
  }
3256
3274
  setCache() {
@@ -3264,7 +3282,7 @@ class pr {
3264
3282
  }
3265
3283
  setGroundTruth(e) {
3266
3284
  const t = !qe(this.groundTruthValue, e);
3267
- this.groundTruthValue = e, this.setCache(), t && Nt.emit("metric::render", {
3285
+ this.groundTruthValue = e, this.setCache(), t && Rt.emit("metric::render", {
3268
3286
  metricType: this.metricType,
3269
3287
  ModelClass: this.modelClass,
3270
3288
  field: this.field,
@@ -3285,7 +3303,7 @@ class pr {
3285
3303
  this.field,
3286
3304
  this.modelClass
3287
3305
  );
3288
- return qe(this._lastCalculatedValue, e) || (this._lastCalculatedValue = e, Nt.emit("metric::render", {
3306
+ return qe(this._lastCalculatedValue, e) || (this._lastCalculatedValue = e, Rt.emit("metric::render", {
3289
3307
  metricType: this.metricType,
3290
3308
  ModelClass: this.modelClass,
3291
3309
  field: this.field,
@@ -3330,13 +3348,13 @@ function te(n, e) {
3330
3348
  function Z(n) {
3331
3349
  return delete n.isOptimistic, delete n.then, delete n.catch, n;
3332
3350
  }
3333
- _s();
3334
- Zt.create();
3335
- function mr(n, e) {
3351
+ ws();
3352
+ Yt.create();
3353
+ function yr(n, e) {
3336
3354
  if (!n || !n.__f_expr)
3337
3355
  return n;
3338
3356
  try {
3339
- return Zt.evaluate(n.original_expr, e);
3357
+ return Yt.evaluate(n.original_expr, e);
3340
3358
  } catch (t) {
3341
3359
  return console.warn(`Error evaluating F expression: ${t.message}`), null;
3342
3360
  }
@@ -3395,7 +3413,7 @@ class de {
3395
3413
  y[i] = p;
3396
3414
  for (const [_, w] of Object.entries(t))
3397
3415
  if (w && typeof w == "object" && w.__f_expr) {
3398
- const v = mr(w, m);
3416
+ const v = yr(w, m);
3399
3417
  v !== null ? y[_] = v : y[_] = m[_];
3400
3418
  } else
3401
3419
  y[_] = w;
@@ -3521,7 +3539,7 @@ class Jt extends Array {
3521
3539
  super(2), this[0] = e, this[1] = t, this.instance = e, this.created = t;
3522
3540
  }
3523
3541
  }
3524
- class yr {
3542
+ class gr {
3525
3543
  /**
3526
3544
  * Executes a get operation (get, first, last) with the QuerySet.
3527
3545
  *
@@ -3536,7 +3554,7 @@ class yr {
3536
3554
  const { data: p, included: m, model_name: y } = f.data;
3537
3555
  if (E(p) || Array.isArray(p) && p.length === 0)
3538
3556
  return null;
3539
- _e(Q, m, r, e);
3557
+ we(Q, m, r, e);
3540
3558
  const _ = Array.isArray(p) ? p[0] : p;
3541
3559
  return a.pk = _, Z(a), a;
3542
3560
  }
@@ -3561,7 +3579,7 @@ class yr {
3561
3579
  static executeList(e, t = "list", s = {}) {
3562
3580
  const r = j.getEntity(e), o = L(e, t, s).then((i) => {
3563
3581
  const { data: l, included: a } = i.data;
3564
- _e(Q, a, e.ModelClass, e);
3582
+ we(Q, a, e.ModelClass, e);
3565
3583
  const c = Array.isArray(l) ? l : [];
3566
3584
  return j.setEntity(e, c), Z(r), r;
3567
3585
  });
@@ -3590,7 +3608,7 @@ class yr {
3590
3608
  l.operationId
3591
3609
  ).then((m) => {
3592
3610
  const { data: y, included: _, model_name: w } = m.data, v = m.metadata.created;
3593
- _e(Q, _, r, e);
3611
+ we(Q, _, r, e);
3594
3612
  const O = Array.isArray(y) ? y[0] : y;
3595
3613
  a && (c.pk = O);
3596
3614
  const b = (_[w] || {})[O];
@@ -3617,7 +3635,7 @@ class yr {
3617
3635
  throw new Error(
3618
3636
  `Field parameter is required for ${t} operation`
3619
3637
  );
3620
- const i = Pe.getEntity(t, e, o), l = {};
3638
+ const i = Ie.getEntity(t, e, o), l = {};
3621
3639
  t !== "exists" && (l.field = o);
3622
3640
  const a = L(
3623
3641
  e,
@@ -3625,7 +3643,7 @@ class yr {
3625
3643
  l
3626
3644
  ).then((c) => {
3627
3645
  const f = c.data, p = j.getEntity(e);
3628
- return Pe.setEntity(t, e, o, f, p), Z(i), f;
3646
+ return Ie.setEntity(t, e, o, f, p), Z(i), f;
3629
3647
  });
3630
3648
  return te(i, a);
3631
3649
  }
@@ -3727,11 +3745,11 @@ class yr {
3727
3745
  o,
3728
3746
  async (p) => {
3729
3747
  const { data: m } = p.data, y = Array.isArray(m) ? m[0] : m;
3730
- Rt(o, y);
3748
+ Kt(o, y);
3731
3749
  }
3732
3750
  ).then((p) => {
3733
3751
  const { data: m, included: y, model_name: _ } = p.data;
3734
- _e(Q, y, r, e);
3752
+ we(Q, y, r, e);
3735
3753
  const w = Array.isArray(m) ? m[0] : m;
3736
3754
  c.pk = w;
3737
3755
  const O = (y[_] || {})[w];
@@ -3777,12 +3795,12 @@ class yr {
3777
3795
  const { data: m } = p.data;
3778
3796
  (Array.isArray(m) ? m : []).forEach((_, w) => {
3779
3797
  const v = `${o}_${w}`;
3780
- Rt(v, _);
3798
+ Kt(v, _);
3781
3799
  });
3782
3800
  }
3783
3801
  ).then((p) => {
3784
3802
  const { data: m, included: y, model_name: _ } = p.data;
3785
- _e(Q, y, r, e);
3803
+ we(Q, y, r, e);
3786
3804
  const w = Array.isArray(m) ? m : [];
3787
3805
  w.forEach((T, b) => {
3788
3806
  c[b] && (c[b].pk = T);
@@ -3818,7 +3836,7 @@ class yr {
3818
3836
  a.operationId
3819
3837
  ).then((m) => {
3820
3838
  const { data: y, included: _, model_name: w } = m.data;
3821
- _e(Q, _, r, e);
3839
+ we(Q, _, r, e);
3822
3840
  const v = Array.isArray(y) ? y[0] : y;
3823
3841
  f.pk = v;
3824
3842
  const T = (_[w] || {})[v];
@@ -3919,7 +3937,7 @@ class yr {
3919
3937
  return L(e, t, s);
3920
3938
  }
3921
3939
  }
3922
- class gr {
3940
+ class _r {
3923
3941
  constructor(e, t, s = null) {
3924
3942
  this.queryset = e, this.metricType = t, this.field = s;
3925
3943
  }
@@ -3931,7 +3949,7 @@ class gr {
3931
3949
  * Delegates to the underlying store's sync method
3932
3950
  */
3933
3951
  refreshFromDb() {
3934
- return Pe.getStore(
3952
+ return Ie.getStore(
3935
3953
  this.metricType,
3936
3954
  this.queryset,
3937
3955
  this.field
@@ -3941,7 +3959,7 @@ class gr {
3941
3959
  * Getter that always returns the current value from the store
3942
3960
  */
3943
3961
  get value() {
3944
- const e = Pe.getStore(
3962
+ const e = Ie.getStore(
3945
3963
  this.metricType,
3946
3964
  this.queryset,
3947
3965
  this.field
@@ -3990,8 +4008,8 @@ class Ct {
3990
4008
  if (!this._stores.has(i)) {
3991
4009
  const l = async ({ metricType: c, modelClass: f, field: p, ast: m }) => {
3992
4010
  const y = t.clone();
3993
- return await yr.executeAgg(y, c, { field: p });
3994
- }, a = new pr(
4011
+ return await gr.executeAgg(y, c, { field: p });
4012
+ }, a = new mr(
3995
4013
  e,
3996
4014
  r,
3997
4015
  t,
@@ -4014,7 +4032,7 @@ class Ct {
4014
4032
  if (E(e) || E(t) || E(t.ModelClass))
4015
4033
  return null;
4016
4034
  this.getStore(e, t, s);
4017
- const r = new gr(t, e, s);
4035
+ const r = new _r(t, e, s);
4018
4036
  return r;
4019
4037
  }
4020
4038
  /**
@@ -4024,7 +4042,7 @@ class Ct {
4024
4042
  if (E(e) || E(t) || E(t.ModelClass))
4025
4043
  return null;
4026
4044
  const o = this.getStore(e, t, s);
4027
- return o ? ((!E(o.groundTruthValue) || !Ce(o.operations)) && o.reset(), o.setGroundTruth(r), r) : null;
4045
+ return o ? ((!E(o.groundTruthValue) || !ve(o.operations)) && o.reset(), o.setGroundTruth(r), r) : null;
4028
4046
  }
4029
4047
  /**
4030
4048
  * Sync a specific metric with the server
@@ -4041,8 +4059,8 @@ class Ct {
4041
4059
  return this._stores.has(e) ? this._stores.get(e).queryset : null;
4042
4060
  }
4043
4061
  }
4044
- const Pe = new Ct();
4045
- class _r {
4062
+ const Ie = new Ct();
4063
+ class wr {
4046
4064
  constructor(e) {
4047
4065
  this.event = e.event, this.model = e.model, this.operation_id = e.operation_id, this.pk_field_name = e.pk_field_name, this.configKey = e.configKey, this.canonical_id = e.canonical_id || null, this.server_ts_ms = e.server_ts_ms || null, this.instances = e.instances?.map((t) => t && this.pk_field_name && t[this.pk_field_name] != null ? {
4048
4066
  ...t,
@@ -4050,7 +4068,7 @@ class _r {
4050
4068
  } : t) || e.instances, this._cachedInstances = null;
4051
4069
  }
4052
4070
  get modelClass() {
4053
- return Xt(this.model, this.configKey);
4071
+ return es(this.model, this.configKey);
4054
4072
  }
4055
4073
  async getFullInstances() {
4056
4074
  if (this.event === "delete")
@@ -4064,7 +4082,7 @@ class _r {
4064
4082
  }).fetch()), this._cachedInstances;
4065
4083
  }
4066
4084
  }
4067
- class wr {
4085
+ class Cr {
4068
4086
  constructor() {
4069
4087
  this.registries = /* @__PURE__ */ new Map(), this.followedModels = /* @__PURE__ */ new Map(), this.followAllQuerysets = !0, this.followedQuerysets = /* @__PURE__ */ new Map(), this.periodicSyncTimer = null, this.eventBatch = /* @__PURE__ */ new Map(), this.debounceTimer = null, this.maxWaitTimer = null, this.debounceMs = 100, this.maxWaitMs = 2e3, this.batchStartTime = null;
4070
4088
  }
@@ -4087,7 +4105,7 @@ class wr {
4087
4105
  * Initialize event handlers for all event receivers
4088
4106
  */
4089
4107
  initialize() {
4090
- xs(), Ds().forEach((t, s) => {
4108
+ js(), Ds().forEach((t, s) => {
4091
4109
  t && t.addModelEventHandler(this.handleEvent.bind(this));
4092
4110
  }), this.startPeriodicSync();
4093
4111
  }
@@ -4105,7 +4123,7 @@ class wr {
4105
4123
  }
4106
4124
  }
4107
4125
  async syncStaleQuerysets() {
4108
- const e = this.registries.get(we);
4126
+ const e = this.registries.get(Ce);
4109
4127
  if (!e) return;
4110
4128
  const t = `periodic-sync-${G()}`, s = new Set(
4111
4129
  [...this.followedQuerysets].map((o) => o.semanticKey).filter((o) => e._stores.has(o))
@@ -4121,7 +4139,7 @@ class wr {
4121
4139
  ), this.pruneUnreferencedModels();
4122
4140
  }
4123
4141
  pruneUnreferencedModels() {
4124
- const e = this.registries.get(Ge), t = this.registries.get(we);
4142
+ const e = this.registries.get(Ge), t = this.registries.get(Ce);
4125
4143
  if (!(!e || !t))
4126
4144
  for (const [s, r] of e._stores.entries())
4127
4145
  r.pruneUnreferencedInstances(t);
@@ -4166,9 +4184,9 @@ class wr {
4166
4184
  * Checks the `verify` flag on membership state to determine which querysets need syncing.
4167
4185
  */
4168
4186
  syncQuerysetsNeedingVerification(e) {
4169
- const t = Oe.getQuerysetStates(e);
4187
+ const t = Pe.getQuerysetStates(e);
4170
4188
  if (!t) return;
4171
- const s = this.registries.get(we);
4189
+ const s = this.registries.get(Ce);
4172
4190
  if (!s) return;
4173
4191
  const r = [];
4174
4192
  for (const [l, a] of t.entries())
@@ -4197,7 +4215,7 @@ class wr {
4197
4215
  operationId: e.operation_id,
4198
4216
  socketId: e.socket_id
4199
4217
  });
4200
- let t = new _r(e), s = Oe.has(t.operation_id);
4218
+ let t = new wr(e), s = Pe.has(t.operation_id);
4201
4219
  if (this.registries.has(Ct) && this.processMetrics(t), s) {
4202
4220
  this.syncQuerysetsNeedingVerification(t.operation_id);
4203
4221
  return;
@@ -4225,7 +4243,7 @@ class wr {
4225
4243
  s.has(o) || s.set(o, []), s.get(o).push(r);
4226
4244
  }), s.forEach((r, o) => {
4227
4245
  const i = r[0];
4228
- this.registries.has(we) && this.processQuerysetsBatch(i, r), this.registries.has(Ge) && this.processModels(i);
4246
+ this.registries.has(Ce) && this.processQuerysetsBatch(i, r), this.registries.has(Ge) && this.processModels(i);
4229
4247
  });
4230
4248
  }
4231
4249
  isQuerysetFollowed(e) {
@@ -4241,7 +4259,7 @@ class wr {
4241
4259
  return !1;
4242
4260
  }
4243
4261
  processQuerysetsBatch(e, t) {
4244
- const s = this.registries.get(we), r = [];
4262
+ const s = this.registries.get(Ce), r = [];
4245
4263
  for (const [c, f] of s._stores.entries())
4246
4264
  if (f.modelClass.modelName === e.model && f.modelClass.configKey === e.configKey) {
4247
4265
  if (this.followAllQuerysets) {
@@ -4284,7 +4302,7 @@ class wr {
4284
4302
  (e.instances || []).filter((c) => c && c[e.pk_field_name] != null).map((c) => c[e.pk_field_name])
4285
4303
  );
4286
4304
  if (r.size === 0) return;
4287
- const o = new Set(s.groundTruthPks), i = this.registries.get(we), l = /* @__PURE__ */ new Set();
4305
+ const o = new Set(s.groundTruthPks), i = this.registries.get(Ce), l = /* @__PURE__ */ new Set();
4288
4306
  if (i)
4289
4307
  for (const [c, f] of i._stores.entries())
4290
4308
  f.modelClass.modelName === e.model && f.modelClass.configKey === e.configKey && f.groundTruthPks.forEach((p) => l.add(p));
@@ -4294,97 +4312,97 @@ class wr {
4294
4312
  }), a.length > 0 && s.sync(a);
4295
4313
  }
4296
4314
  }
4297
- const $e = new wr();
4315
+ const $e = new Cr();
4298
4316
  $e.manageRegistry(j);
4299
4317
  $e.manageRegistry(Q);
4300
- $e.manageRegistry(Pe);
4301
- const Cr = /* @__PURE__ */ new Set();
4302
- function vr(n) {
4303
- typeof n == "function" && Cr.add(n);
4318
+ $e.manageRegistry(Ie);
4319
+ const vr = /* @__PURE__ */ new Set();
4320
+ function Er(n) {
4321
+ typeof n == "function" && vr.add(n);
4304
4322
  }
4305
4323
  $e.followAllQuerysets = !1;
4306
- const ss = /* @__PURE__ */ new Map();
4307
- vr(() => {
4308
- ss.clear(), $e.followAllQuerysets = !0, $e.followedQuerysets.clear();
4324
+ const rs = /* @__PURE__ */ new Map();
4325
+ Er(() => {
4326
+ rs.clear(), $e.followAllQuerysets = !0, $e.followedQuerysets.clear();
4309
4327
  });
4310
- const Er = (n, e) => {
4328
+ const br = (n, e) => {
4311
4329
  const t = n.__vccOpts || n;
4312
4330
  for (const [s, r] of e)
4313
4331
  t[s] = r;
4314
4332
  return t;
4315
- }, br = { class: "szd" }, kr = { class: "szd-header" }, Sr = { class: "szd-header__top" }, Tr = { class: "szd-header__left" }, Mr = {
4333
+ }, kr = { class: "szd" }, Sr = { class: "szd-header" }, Tr = { class: "szd-header__top" }, Mr = { class: "szd-header__left" }, $r = {
4316
4334
  key: 0,
4317
4335
  class: "szd-header__model"
4318
- }, $r = {
4336
+ }, Ar = {
4319
4337
  key: 1,
4320
4338
  class: "szd-header__model szd-header__model--empty"
4321
- }, Ar = { class: "szd-header__right" }, Or = {
4339
+ }, Or = { class: "szd-header__right" }, Pr = {
4322
4340
  key: 0,
4323
4341
  class: "szd-header__badge szd-header__badge--syncing"
4324
- }, Pr = {
4342
+ }, Ir = {
4325
4343
  key: 1,
4326
4344
  class: "szd-header__badge"
4327
- }, Fr = { class: "szd-header__badge" }, Dr = { class: "szd-tabs" }, Ir = ["onClick"], Kr = { class: "szd-content" }, zr = {
4345
+ }, Fr = { class: "szd-header__badge" }, Dr = { class: "szd-tabs" }, zr = ["onClick"], Kr = { class: "szd-content" }, Rr = {
4328
4346
  key: 0,
4329
4347
  class: "szd-panel"
4330
- }, Rr = { class: "szd-panel__section" }, Nr = { class: "szd-kv" }, xr = { class: "szd-kv__row" }, jr = { class: "szd-kv__value" }, Ur = { class: "szd-kv__row" }, Qr = { class: "szd-kv__value" }, Vr = { class: "szd-kv__row" }, Lr = { class: "szd-kv__value" }, Gr = { class: "szd-kv__row" }, Br = { class: "szd-kv__value" }, Hr = { class: "szd-panel__section" }, qr = { class: "szd-stats" }, Jr = { class: "szd-stat" }, Wr = { class: "szd-stat__value" }, Zr = { class: "szd-stat" }, Yr = { class: "szd-stat__value" }, Xr = { class: "szd-stat" }, en = { class: "szd-stat__value" }, tn = { class: "szd-stat" }, sn = { class: "szd-stat__value" }, rn = {
4348
+ }, Nr = { class: "szd-panel__section" }, xr = { class: "szd-kv" }, jr = { class: "szd-kv__row" }, Ur = { class: "szd-kv__value" }, Qr = { class: "szd-kv__row" }, Vr = { class: "szd-kv__value" }, Lr = { class: "szd-kv__row" }, Gr = { class: "szd-kv__value" }, Br = { class: "szd-kv__row" }, Hr = { class: "szd-kv__value" }, qr = { class: "szd-panel__section" }, Jr = { class: "szd-stats" }, Wr = { class: "szd-stat" }, Zr = { class: "szd-stat__value" }, Yr = { class: "szd-stat" }, Xr = { class: "szd-stat__value" }, en = { class: "szd-stat" }, tn = { class: "szd-stat__value" }, sn = { class: "szd-stat" }, rn = { class: "szd-stat__value" }, nn = {
4331
4349
  class: "szd-kv",
4332
4350
  style: { "margin-top": "12px" }
4333
- }, nn = { class: "szd-kv__row" }, on = { class: "szd-kv__value" }, an = {
4351
+ }, on = { class: "szd-kv__row" }, an = { class: "szd-kv__value" }, ln = {
4334
4352
  key: 0,
4335
4353
  class: "szd-panel__section"
4336
- }, ln = { class: "szd-event-preview__text" }, cn = { class: "szd-event-preview__time" }, dn = {
4354
+ }, cn = { class: "szd-event-preview__text" }, dn = { class: "szd-event-preview__time" }, un = {
4337
4355
  key: 1,
4338
4356
  class: "szd-panel"
4339
- }, un = { class: "szd-timeline-filters" }, hn = ["onUpdate:modelValue"], fn = { class: "szd-timeline" }, pn = ["onClick"], mn = { class: "szd-timeline__time" }, yn = { class: "szd-timeline__text" }, gn = {
4357
+ }, hn = { class: "szd-timeline-filters" }, fn = ["onUpdate:modelValue"], pn = { class: "szd-timeline" }, mn = ["onClick"], yn = { class: "szd-timeline__time" }, gn = { class: "szd-timeline__text" }, _n = {
4340
4358
  key: 0,
4341
4359
  class: "szd-empty"
4342
- }, _n = {
4360
+ }, wn = {
4343
4361
  key: 2,
4344
4362
  class: "szd-panel"
4345
- }, wn = { class: "szd-pipeline" }, Cn = ["onClick"], vn = { class: "szd-pipeline__label" }, En = { class: "szd-pipeline__count" }, bn = {
4363
+ }, Cn = { class: "szd-pipeline" }, vn = ["onClick"], En = { class: "szd-pipeline__label" }, bn = { class: "szd-pipeline__count" }, kn = {
4346
4364
  key: 0,
4347
4365
  class: "szd-pipeline__arrow"
4348
- }, kn = {
4366
+ }, Sn = {
4349
4367
  class: "szd-panel__section",
4350
4368
  style: { "margin-top": "20px" }
4351
- }, Sn = { class: "szd-preview-header" }, Tn = ["value"], Mn = {
4369
+ }, Tn = { class: "szd-preview-header" }, Mn = ["value"], $n = {
4352
4370
  key: 0,
4353
4371
  class: "szd-data-grid"
4354
- }, $n = { class: "szd-data-card__header" }, An = {
4372
+ }, An = { class: "szd-data-card__header" }, On = {
4355
4373
  key: 0,
4356
4374
  class: "szd-data-card__badge"
4357
- }, On = {
4375
+ }, Pn = {
4358
4376
  key: 1,
4359
4377
  class: "szd-data-card__badge szd-data-card__badge--absent"
4360
- }, Pn = { class: "szd-data-card__content" }, Fn = {
4378
+ }, In = { class: "szd-data-card__content" }, Fn = {
4361
4379
  key: 1,
4362
4380
  class: "szd-empty"
4363
4381
  }, Dn = {
4364
4382
  key: 3,
4365
4383
  class: "szd-panel"
4366
- }, In = {
4384
+ }, zn = {
4367
4385
  class: "szd-kv",
4368
4386
  style: { "margin-bottom": "16px" }
4369
- }, Kn = { class: "szd-kv__row" }, zn = { class: "szd-kv__value szd-kv__value--mono" }, Rn = { class: "szd-ast" }, Nn = {
4387
+ }, Kn = { class: "szd-kv__row" }, Rn = { class: "szd-kv__value szd-kv__value--mono" }, Nn = { class: "szd-ast" }, xn = {
4370
4388
  key: 0,
4371
4389
  class: "szd-detail"
4372
- }, xn = { class: "szd-detail__panel szd-detail__panel--sm" }, jn = { class: "szd-detail__header" }, Un = { class: "szd-detail__body" }, Qn = { class: "szd-settings-section" }, Vn = ["value"], Ln = {
4390
+ }, jn = { class: "szd-detail__panel szd-detail__panel--sm" }, Un = { class: "szd-detail__header" }, Qn = { class: "szd-detail__body" }, Vn = { class: "szd-settings-section" }, Ln = ["value"], Gn = {
4373
4391
  key: 0,
4374
4392
  class: "szd-settings-section"
4375
- }, Gn = { class: "szd-settings-row" }, Bn = { class: "szd-settings-code" }, Hn = { class: "szd-settings-section" }, qn = { class: "szd-settings-actions" }, Jn = ["disabled"], Wn = { class: "szd-settings-section" }, Zn = { class: "szd-toggle" }, Yn = {
4393
+ }, Bn = { class: "szd-settings-row" }, Hn = { class: "szd-settings-code" }, qn = { class: "szd-settings-section" }, Jn = { class: "szd-settings-actions" }, Wn = ["disabled"], Zn = { class: "szd-settings-section" }, Yn = { class: "szd-toggle" }, Xn = {
4376
4394
  key: 1,
4377
4395
  class: "szd-settings-section"
4378
- }, Xn = { class: "szd-kv" }, eo = { class: "szd-kv__row" }, to = { class: "szd-kv__value" }, so = { class: "szd-kv__row" }, ro = { class: "szd-kv__value" }, no = { class: "szd-kv__row" }, oo = { class: "szd-kv__value" }, io = { class: "szd-kv__row" }, ao = { class: "szd-kv__value" }, lo = { class: "szd-kv__row" }, co = { class: "szd-kv__value" }, uo = {
4396
+ }, eo = { class: "szd-kv" }, to = { class: "szd-kv__row" }, so = { class: "szd-kv__value" }, ro = { class: "szd-kv__row" }, no = { class: "szd-kv__value" }, oo = { class: "szd-kv__row" }, io = { class: "szd-kv__value" }, ao = { class: "szd-kv__row" }, lo = { class: "szd-kv__value" }, co = { class: "szd-kv__row" }, uo = { class: "szd-kv__value" }, ho = {
4379
4397
  key: 0,
4380
4398
  class: "szd-detail"
4381
- }, ho = { class: "szd-detail__panel" }, fo = { class: "szd-detail__header" }, po = { class: "szd-detail__title" }, mo = { class: "szd-detail__body" }, yo = { class: "szd-kv" }, go = { class: "szd-kv__key" }, _o = { class: "szd-kv__value" }, wo = { class: "szd-ast" }, Co = {
4399
+ }, fo = { class: "szd-detail__panel" }, po = { class: "szd-detail__header" }, mo = { class: "szd-detail__title" }, yo = { class: "szd-detail__body" }, go = { class: "szd-kv" }, _o = { class: "szd-kv__key" }, wo = { class: "szd-kv__value" }, Co = { class: "szd-ast" }, vo = {
4382
4400
  class: "szd-kv",
4383
4401
  style: { "margin-bottom": "16px" }
4384
- }, vo = { class: "szd-kv__row" }, Eo = { class: "szd-kv__value" }, bo = { class: "szd-kv__row" }, ko = { class: "szd-kv__value" }, So = {
4402
+ }, Eo = { class: "szd-kv__row" }, bo = { class: "szd-kv__value" }, ko = { class: "szd-kv__row" }, So = { class: "szd-kv__value" }, To = {
4385
4403
  key: 0,
4386
4404
  class: "szd-kv__note"
4387
- }, To = { class: "szd-ast" }, Wt = 100, Mo = {
4405
+ }, Mo = { class: "szd-ast" }, Wt = 100, $o = {
4388
4406
  __name: "StateZeroDebugPanel",
4389
4407
  props: {
4390
4408
  queryset: { type: [Object, String], default: null },
@@ -4419,7 +4437,7 @@ const Er = (n, e) => {
4419
4437
  ), v = R(() => {
4420
4438
  a.value;
4421
4439
  const u = [];
4422
- return ss.forEach((d) => {
4440
+ return rs.forEach((d) => {
4423
4441
  d?.semanticKey && u.push({
4424
4442
  semanticKey: d.semanticKey,
4425
4443
  modelName: d.ModelClass?.modelName,
@@ -4454,21 +4472,21 @@ const Er = (n, e) => {
4454
4472
  return null;
4455
4473
  }
4456
4474
  return k.value && j._stores.get(k.value) || null;
4457
- }), F = R(() => {
4475
+ }), I = R(() => {
4458
4476
  a.value;
4459
- const u = N.value, d = U.value, g = u?.modelClass?.modelName || d?.ModelClass?.modelName, K = u?.modelClass?.configKey || d?.ModelClass?.configKey, H = u?.groundTruthPks?.length ?? 0, oe = u?.operationsMap?.size ?? 0, le = u?.getInflightOperations?.() || [], be = u?.isSyncing ?? !1, je = u?.lastSync ? new Date(u.lastSync).toLocaleString() : "—", ot = u && Array.isArray(u._lastRenderedPks) ? u._lastRenderedPks.length : null, ls = u?.groundTruthPks?.length ?? 0, cs = u ? u.lastSync === null ? "model store" : "ground truth" : "—", ds = be ? "Sync in progress — results may change." : oe > 0 ? "Optimistic operations are applied to results." : u?.lastSync === null ? "No ground truth yet — rendering from model store." : "Using ground truth + local filters.";
4477
+ const u = N.value, d = U.value, g = u?.modelClass?.modelName || d?.ModelClass?.modelName, z = u?.modelClass?.configKey || d?.ModelClass?.configKey, H = u?.groundTruthPks?.length ?? 0, oe = u?.operationsMap?.size ?? 0, le = u?.getInflightOperations?.() || [], be = u?.isSyncing ?? !1, Ue = u?.lastSync ? new Date(u.lastSync).toLocaleString() : "—", ot = u && Array.isArray(u._lastRenderedPks) ? u._lastRenderedPks.length : null, cs = u?.groundTruthPks?.length ?? 0, ds = u ? u.lastSync === null ? "model store" : "ground truth" : "—", us = be ? "Sync in progress — results may change." : oe > 0 ? "Optimistic operations are applied to results." : u?.lastSync === null ? "No ground truth yet — rendering from model store." : "Using ground truth + local filters.";
4460
4478
  return {
4461
4479
  modelName: g,
4462
- configKey: K,
4480
+ configKey: z,
4463
4481
  groundTruthCount: H,
4464
4482
  opsCount: oe,
4465
4483
  inFlightCount: le.length,
4466
4484
  isSyncing: be,
4467
- lastSync: je,
4485
+ lastSync: Ue,
4468
4486
  optimisticCount: ot,
4469
- confirmedCount: ls,
4470
- source: cs,
4471
- reason: ds
4487
+ confirmedCount: cs,
4488
+ source: ds,
4489
+ reason: us
4472
4490
  };
4473
4491
  }), re = R(() => {
4474
4492
  a.value;
@@ -4478,27 +4496,27 @@ const Er = (n, e) => {
4478
4496
  return { error: u?.message || "Failed to build AST" };
4479
4497
  }
4480
4498
  });
4481
- function fe(u) {
4499
+ function pe(u) {
4482
4500
  if (!u?.filter?.conditions) return "—";
4483
4501
  const d = u.filter.conditions;
4484
- return typeof d != "object" ? String(d) : Object.entries(d).map(([K, H]) => H === null ? `${K}: null` : typeof H == "object" ? `${K}: ${JSON.stringify(H)}` : `${K}: ${H}`).join(", ");
4502
+ return typeof d != "object" ? String(d) : Object.entries(d).map(([z, H]) => H === null ? `${z}: null` : typeof H == "object" ? `${z}: ${JSON.stringify(H)}` : `${z}: ${H}`).join(", ");
4485
4503
  }
4486
4504
  function ae(u) {
4487
4505
  const d = u?.orderBy;
4488
4506
  return !d || Array.isArray(d) && d.length === 0 ? "—" : Array.isArray(d) ? d.join(", ") : String(d);
4489
4507
  }
4490
- const I = R(() => {
4508
+ const D = R(() => {
4491
4509
  const u = re.value;
4492
4510
  return {
4493
- filter: fe(u),
4511
+ filter: pe(u),
4494
4512
  orderBy: ae(u),
4495
4513
  limit: u?.serializerOptions?.limit ?? "—"
4496
4514
  };
4497
4515
  });
4498
- function D(u, d, g, K) {
4516
+ function F(u, d, g, z) {
4499
4517
  if (!u || !Array.isArray(g)) return [];
4500
4518
  const H = [];
4501
- for (const oe of g.slice(0, K))
4519
+ for (const oe of g.slice(0, z))
4502
4520
  try {
4503
4521
  const le = u.fromPk(oe, d);
4504
4522
  le && H.push(le.serialize());
@@ -4506,7 +4524,7 @@ const Er = (n, e) => {
4506
4524
  }
4507
4525
  return H;
4508
4526
  }
4509
- const z = R(() => {
4527
+ const K = R(() => {
4510
4528
  a.value;
4511
4529
  const u = N.value, d = U.value;
4512
4530
  if (!u || !d)
@@ -4523,7 +4541,7 @@ const Er = (n, e) => {
4523
4541
  finalSample: [],
4524
4542
  limit: null
4525
4543
  };
4526
- const g = Array.isArray(u.groundTruthPks) ? [...u.groundTruthPks] : [], K = u.renderFromData(!0), H = u.renderFromData(!1), oe = u._getValidatedAndFilteredPks(K), le = u.lastSync === null ? u.renderFromModelStore() : [], be = d.build()?.serializerOptions?.limit ?? null, je = be ? oe.slice(0, be) : oe, ot = le.length > 0 ? D(
4544
+ const g = Array.isArray(u.groundTruthPks) ? [...u.groundTruthPks] : [], z = u.renderFromData(!0), H = u.renderFromData(!1), oe = u._getValidatedAndFilteredPks(z), le = u.lastSync === null ? u.renderFromModelStore() : [], be = d.build()?.serializerOptions?.limit ?? null, Ue = be ? oe.slice(0, be) : oe, ot = le.length > 0 ? F(
4527
4545
  u.modelClass,
4528
4546
  d,
4529
4547
  le,
@@ -4532,66 +4550,66 @@ const Er = (n, e) => {
4532
4550
  return {
4533
4551
  modelStoreFiltered: le,
4534
4552
  groundTruth: g,
4535
- optimistic: K,
4553
+ optimistic: z,
4536
4554
  filtered: oe,
4537
- final: je,
4555
+ final: Ue,
4538
4556
  modelStoreSample: ot,
4539
- groundTruthSample: D(
4557
+ groundTruthSample: F(
4540
4558
  u.modelClass,
4541
4559
  d,
4542
4560
  g,
4543
4561
  e.sampleSize
4544
4562
  ),
4545
- optimisticSample: D(
4563
+ optimisticSample: F(
4546
4564
  u.modelClass,
4547
4565
  d,
4548
- K,
4566
+ z,
4549
4567
  e.sampleSize
4550
4568
  ),
4551
- filteredSample: D(
4569
+ filteredSample: F(
4552
4570
  u.modelClass,
4553
4571
  d,
4554
4572
  oe,
4555
4573
  e.sampleSize
4556
4574
  ),
4557
- finalSample: D(
4575
+ finalSample: F(
4558
4576
  u.modelClass,
4559
4577
  d,
4560
- je,
4578
+ Ue,
4561
4579
  e.sampleSize
4562
4580
  ),
4563
4581
  limit: be,
4564
4582
  confirmed: H
4565
4583
  };
4566
- }), pe = R(() => [
4567
- { id: "model-store", label: "Model Store", count: z.value.modelStoreFiltered.length, pks: z.value.modelStoreFiltered },
4568
- { id: "ground-truth", label: "Ground Truth", count: z.value.groundTruth.length, pks: z.value.groundTruth },
4569
- { id: "optimistic", label: "Optimistic", count: z.value.optimistic.length, pks: z.value.optimistic },
4570
- { id: "filtered", label: "Filtered", count: z.value.filtered.length, pks: z.value.filtered },
4571
- { id: "final", label: "Final", count: z.value.final.length, pks: z.value.final }
4572
- ]), Ye = R(() => z.value.final || []);
4573
- function me(u) {
4584
+ }), me = R(() => [
4585
+ { id: "model-store", label: "Model Store", count: K.value.modelStoreFiltered.length, pks: K.value.modelStoreFiltered },
4586
+ { id: "ground-truth", label: "Ground Truth", count: K.value.groundTruth.length, pks: K.value.groundTruth },
4587
+ { id: "optimistic", label: "Optimistic", count: K.value.optimistic.length, pks: K.value.optimistic },
4588
+ { id: "filtered", label: "Filtered", count: K.value.filtered.length, pks: K.value.filtered },
4589
+ { id: "final", label: "Final", count: K.value.final.length, pks: K.value.final }
4590
+ ]), Ye = R(() => K.value.final || []);
4591
+ function ye(u) {
4574
4592
  const d = N.value, g = U.value;
4575
4593
  if (!d || !g || u == null) return null;
4576
4594
  try {
4577
- const K = d.modelClass.fromPk(u, g);
4578
- return K ? K.serialize() : null;
4595
+ const z = d.modelClass.fromPk(u, g);
4596
+ return z ? z.serialize() : null;
4579
4597
  } catch {
4580
4598
  return null;
4581
4599
  }
4582
4600
  }
4583
- R(() => m.value == null ? null : me(m.value));
4601
+ R(() => m.value == null ? null : ye(m.value));
4584
4602
  const Ke = R(() => {
4585
4603
  if (!f.value || f.value.type !== "snapshot") return [];
4586
4604
  const u = f.value.data, d = N.value, g = U.value;
4587
- return !d || !g || !u.pks ? [] : D(d.modelClass, g, u.pks, Wt);
4588
- }), Xe = R(() => !f.value || f.value.type !== "snapshot" ? !1 : f.value.data.count > Wt), ze = R(() => {
4605
+ return !d || !g || !u.pks ? [] : F(d.modelClass, g, u.pks, Wt);
4606
+ }), Xe = R(() => !f.value || f.value.type !== "snapshot" ? !1 : f.value.data.count > Wt), Re = R(() => {
4589
4607
  if (!k.value) return l.value;
4590
4608
  const u = N.value;
4591
4609
  return l.value.filter((d) => d.semanticKey === k.value ? !0 : u ? d.modelName === u.modelClass?.modelName && d.configKey === u.modelClass?.configKey : !1);
4592
- }), Ee = R(() => ze.value.filter((u) => y.value[u.type])), Re = R(() => l.value.length), ne = R(
4610
+ }), Ee = R(() => Re.value.filter((u) => y.value[u.type])), Ne = R(() => l.value.length), ne = R(
4593
4611
  () => l.value.length ? l.value[l.value.length - 1] : null
4594
- ), Ne = [
4612
+ ), xe = [
4595
4613
  { id: "request", label: "Requests", color: "#3b82f6" },
4596
4614
  { id: "response", label: "Responses", color: "#22c55e" },
4597
4615
  { id: "render", label: "Renders", color: "#a855f7" },
@@ -4602,8 +4620,8 @@ const Er = (n, e) => {
4602
4620
  { id: "groupSync", label: "Group Sync", color: "#8b5cf6" },
4603
4621
  { id: "error", label: "Errors", color: "#ef4444" }
4604
4622
  ];
4605
- function xe(u) {
4606
- return Ne.find((d) => d.id === u)?.color || "#6b7280";
4623
+ function je(u) {
4624
+ return xe.find((d) => d.id === u)?.color || "#6b7280";
4607
4625
  }
4608
4626
  function et(u) {
4609
4627
  if (!u) return "";
@@ -4613,7 +4631,7 @@ const Er = (n, e) => {
4613
4631
  return "";
4614
4632
  }
4615
4633
  }
4616
- function bt(u) {
4634
+ function Et(u) {
4617
4635
  if (!u) return "";
4618
4636
  switch (u.type) {
4619
4637
  case "request":
@@ -4638,7 +4656,7 @@ const Er = (n, e) => {
4638
4656
  return u.type;
4639
4657
  }
4640
4658
  }
4641
- function rs(u) {
4659
+ function ns(u) {
4642
4660
  if (!u) return null;
4643
4661
  const d = {
4644
4662
  type: u.type,
@@ -4670,13 +4688,13 @@ const Er = (n, e) => {
4670
4688
  return d;
4671
4689
  }
4672
4690
  }
4673
- function ns() {
4674
- Ls(), l.value = [];
4675
- }
4676
4691
  function os() {
4692
+ Gs(), l.value = [];
4693
+ }
4694
+ function is() {
4677
4695
  !k.value || !navigator?.clipboard || navigator.clipboard.writeText(k.value);
4678
4696
  }
4679
- async function is() {
4697
+ async function as() {
4680
4698
  if (!(!N.value || c.value)) {
4681
4699
  c.value = !0;
4682
4700
  try {
@@ -4687,32 +4705,32 @@ const Er = (n, e) => {
4687
4705
  }
4688
4706
  }
4689
4707
  }
4690
- function kt(u) {
4708
+ function bt(u) {
4691
4709
  f.value = { type: "entry", data: u };
4692
4710
  }
4693
- function as(u) {
4711
+ function ls(u) {
4694
4712
  f.value = { type: "snapshot", data: u };
4695
4713
  }
4696
- function St() {
4714
+ function kt() {
4697
4715
  f.value = null;
4698
4716
  }
4699
- function Tt(u) {
4717
+ function St(u) {
4700
4718
  Object.keys(y.value).forEach((d) => {
4701
4719
  y.value[d] = u;
4702
4720
  });
4703
4721
  }
4704
4722
  let tt = null, st = null, rt = null, nt = null;
4705
- return us(() => {
4706
- Gs(), Lt(e.maxEntries), tt = Qs((u) => {
4723
+ return hs(() => {
4724
+ Bs(), Lt(e.maxEntries), tt = Vs((u) => {
4707
4725
  i.value && (l.value = [...l.value, u], l.value.length > e.maxEntries && (l.value = l.value.slice(-e.maxEntries)));
4708
- }), st = Vs(() => {
4726
+ }), st = Ls(() => {
4709
4727
  l.value = [];
4710
4728
  }), rt = setInterval(() => {
4711
4729
  a.value += 1;
4712
4730
  }, 2e3), nt = setInterval(() => {
4713
4731
  l.value = Vt();
4714
4732
  }, 1e3);
4715
- }), hs(() => {
4733
+ }), fs(() => {
4716
4734
  tt && tt(), st && st(), rt && clearInterval(rt), nt && clearInterval(nt);
4717
4735
  }), it(
4718
4736
  () => e.maxEntries,
@@ -4724,17 +4742,17 @@ const Er = (n, e) => {
4724
4742
  }
4725
4743
  ), it(k, () => {
4726
4744
  m.value = null;
4727
- }), (u, d) => (A(), $("section", br, [
4728
- h("header", kr, [
4729
- h("div", Sr, [
4730
- h("div", Tr, [
4745
+ }), (u, d) => (A(), $("section", kr, [
4746
+ h("header", Sr, [
4747
+ h("div", Tr, [
4748
+ h("div", Mr, [
4731
4749
  d[9] || (d[9] = h("div", { class: "szd-header__title" }, "StateZero", -1)),
4732
- k.value ? (A(), $("span", Mr, S(F.value.modelName || "?"), 1)) : (A(), $("span", $r, "No queryset"))
4750
+ k.value ? (A(), $("span", $r, S(I.value.modelName || "?"), 1)) : (A(), $("span", Ar, "No queryset"))
4733
4751
  ]),
4734
- h("div", Ar, [
4735
- F.value.isSyncing ? (A(), $("span", Or, "Syncing")) : V("", !0),
4736
- F.value.opsCount > 0 ? (A(), $("span", Pr, S(F.value.opsCount) + " ops", 1)) : V("", !0),
4737
- h("span", Fr, S(Re.value) + " events", 1),
4752
+ h("div", Or, [
4753
+ I.value.isSyncing ? (A(), $("span", Pr, "Syncing")) : V("", !0),
4754
+ I.value.opsCount > 0 ? (A(), $("span", Ir, S(I.value.opsCount) + " ops", 1)) : V("", !0),
4755
+ h("span", Fr, S(Ne.value) + " events", 1),
4738
4756
  h("button", {
4739
4757
  class: "szd-btn szd-btn--icon",
4740
4758
  onClick: d[0] || (d[0] = (g) => p.value = !0),
@@ -4761,137 +4779,137 @@ const Er = (n, e) => {
4761
4779
  h("nav", Dr, [
4762
4780
  (A(), $(W, null, ce(s, (g) => h("button", {
4763
4781
  key: g.id,
4764
- class: $t(["szd-tabs__tab", { "szd-tabs__tab--active": t.value === g.id }]),
4765
- onClick: (K) => t.value = g.id
4766
- }, S(g.label), 11, Ir)), 64))
4782
+ class: Mt(["szd-tabs__tab", { "szd-tabs__tab--active": t.value === g.id }]),
4783
+ onClick: (z) => t.value = g.id
4784
+ }, S(g.label), 11, zr)), 64))
4767
4785
  ])
4768
4786
  ]),
4769
4787
  h("main", Kr, [
4770
- t.value === "overview" ? (A(), $("div", zr, [
4771
- h("div", Rr, [
4788
+ t.value === "overview" ? (A(), $("div", Rr, [
4789
+ h("div", Nr, [
4772
4790
  d[15] || (d[15] = h("h3", { class: "szd-panel__heading" }, "Why This View?", -1)),
4773
- h("div", Nr, [
4774
- h("div", xr, [
4791
+ h("div", xr, [
4792
+ h("div", jr, [
4775
4793
  d[11] || (d[11] = h("span", { class: "szd-kv__key" }, "Filter:", -1)),
4776
- h("span", jr, S(I.value.filter), 1)
4794
+ h("span", Ur, S(D.value.filter), 1)
4777
4795
  ]),
4778
- h("div", Ur, [
4796
+ h("div", Qr, [
4779
4797
  d[12] || (d[12] = h("span", { class: "szd-kv__key" }, "Order:", -1)),
4780
- h("span", Qr, S(I.value.orderBy), 1)
4798
+ h("span", Vr, S(D.value.orderBy), 1)
4781
4799
  ]),
4782
- h("div", Vr, [
4800
+ h("div", Lr, [
4783
4801
  d[13] || (d[13] = h("span", { class: "szd-kv__key" }, "Limit:", -1)),
4784
- h("span", Lr, S(I.value.limit), 1)
4802
+ h("span", Gr, S(D.value.limit), 1)
4785
4803
  ]),
4786
- h("div", Gr, [
4804
+ h("div", Br, [
4787
4805
  d[14] || (d[14] = h("span", { class: "szd-kv__key" }, "Reason:", -1)),
4788
- h("span", Br, S(F.value.reason), 1)
4806
+ h("span", Hr, S(I.value.reason), 1)
4789
4807
  ])
4790
4808
  ])
4791
4809
  ]),
4792
- h("div", Hr, [
4810
+ h("div", qr, [
4793
4811
  d[21] || (d[21] = h("h3", { class: "szd-panel__heading" }, "Current State", -1)),
4794
- h("div", qr, [
4795
- h("div", Jr, [
4796
- h("div", Wr, S(F.value.optimisticCount ?? "—"), 1),
4812
+ h("div", Jr, [
4813
+ h("div", Wr, [
4814
+ h("div", Zr, S(I.value.optimisticCount ?? "—"), 1),
4797
4815
  d[16] || (d[16] = h("div", { class: "szd-stat__label" }, "Optimistic", -1))
4798
4816
  ]),
4799
- h("div", Zr, [
4800
- h("div", Yr, S(F.value.confirmedCount), 1),
4817
+ h("div", Yr, [
4818
+ h("div", Xr, S(I.value.confirmedCount), 1),
4801
4819
  d[17] || (d[17] = h("div", { class: "szd-stat__label" }, "Confirmed", -1))
4802
4820
  ]),
4803
- h("div", Xr, [
4804
- h("div", en, S(F.value.groundTruthCount), 1),
4821
+ h("div", en, [
4822
+ h("div", tn, S(I.value.groundTruthCount), 1),
4805
4823
  d[18] || (d[18] = h("div", { class: "szd-stat__label" }, "Ground Truth", -1))
4806
4824
  ]),
4807
- h("div", tn, [
4808
- h("div", sn, S(F.value.inFlightCount), 1),
4825
+ h("div", sn, [
4826
+ h("div", rn, S(I.value.inFlightCount), 1),
4809
4827
  d[19] || (d[19] = h("div", { class: "szd-stat__label" }, "In-Flight", -1))
4810
4828
  ])
4811
4829
  ]),
4812
- h("div", rn, [
4813
- h("div", nn, [
4830
+ h("div", nn, [
4831
+ h("div", on, [
4814
4832
  d[20] || (d[20] = h("span", { class: "szd-kv__key" }, "Last Sync:", -1)),
4815
- h("span", on, S(F.value.lastSync), 1)
4833
+ h("span", an, S(I.value.lastSync), 1)
4816
4834
  ])
4817
4835
  ])
4818
4836
  ]),
4819
- ne.value ? (A(), $("div", an, [
4837
+ ne.value ? (A(), $("div", ln, [
4820
4838
  d[22] || (d[22] = h("h3", { class: "szd-panel__heading" }, "Last Event", -1)),
4821
4839
  h("button", {
4822
4840
  class: "szd-event-preview",
4823
- onClick: d[1] || (d[1] = (g) => kt(ne.value))
4841
+ onClick: d[1] || (d[1] = (g) => bt(ne.value))
4824
4842
  }, [
4825
4843
  h("span", {
4826
4844
  class: "szd-event-preview__badge",
4827
- style: at({ background: xe(ne.value.type) })
4845
+ style: at({ background: je(ne.value.type) })
4828
4846
  }, S(ne.value.type), 5),
4829
- h("span", ln, S(bt(ne.value)), 1),
4830
- h("span", cn, S(et(ne.value.ts)), 1)
4847
+ h("span", cn, S(Et(ne.value)), 1),
4848
+ h("span", dn, S(et(ne.value.ts)), 1)
4831
4849
  ])
4832
4850
  ])) : V("", !0)
4833
4851
  ])) : V("", !0),
4834
- t.value === "timeline" ? (A(), $("div", dn, [
4835
- h("div", un, [
4852
+ t.value === "timeline" ? (A(), $("div", un, [
4853
+ h("div", hn, [
4836
4854
  h("button", {
4837
4855
  class: "szd-btn szd-btn--sm",
4838
- onClick: d[2] || (d[2] = (g) => Tt(!0))
4856
+ onClick: d[2] || (d[2] = (g) => St(!0))
4839
4857
  }, "All"),
4840
4858
  h("button", {
4841
4859
  class: "szd-btn szd-btn--sm",
4842
- onClick: d[3] || (d[3] = (g) => Tt(!1))
4860
+ onClick: d[3] || (d[3] = (g) => St(!1))
4843
4861
  }, "None"),
4844
- (A(), $(W, null, ce(Ne, (g) => h("label", {
4862
+ (A(), $(W, null, ce(xe, (g) => h("label", {
4845
4863
  key: g.id,
4846
- class: $t(["szd-filter-chip", { "szd-filter-chip--active": y.value[g.id] }]),
4864
+ class: Mt(["szd-filter-chip", { "szd-filter-chip--active": y.value[g.id] }]),
4847
4865
  style: at(y.value[g.id] ? { background: g.color, borderColor: g.color } : {})
4848
4866
  }, [
4849
- Ue(h("input", {
4867
+ Qe(h("input", {
4850
4868
  type: "checkbox",
4851
- "onUpdate:modelValue": (K) => y.value[g.id] = K,
4869
+ "onUpdate:modelValue": (z) => y.value[g.id] = z,
4852
4870
  class: "szd-filter-chip__input"
4853
- }, null, 8, hn), [
4854
- [At, y.value[g.id]]
4871
+ }, null, 8, fn), [
4872
+ [$t, y.value[g.id]]
4855
4873
  ]),
4856
- Qe(" " + S(g.label), 1)
4874
+ Ve(" " + S(g.label), 1)
4857
4875
  ], 6)), 64))
4858
4876
  ]),
4859
- h("div", fn, [
4877
+ h("div", pn, [
4860
4878
  (A(!0), $(W, null, ce(Ee.value, (g) => (A(), $("div", {
4861
4879
  key: g.id,
4862
4880
  class: "szd-timeline__item",
4863
- onClick: (K) => kt(g)
4881
+ onClick: (z) => bt(g)
4864
4882
  }, [
4865
- h("span", mn, S(et(g.ts)), 1),
4883
+ h("span", yn, S(et(g.ts)), 1),
4866
4884
  h("span", {
4867
4885
  class: "szd-timeline__badge",
4868
- style: at({ background: xe(g.type) })
4886
+ style: at({ background: je(g.type) })
4869
4887
  }, S(g.type), 5),
4870
- h("span", yn, S(bt(g)), 1)
4871
- ], 8, pn))), 128)),
4872
- Ee.value.length ? V("", !0) : (A(), $("div", gn, " No events match current filters "))
4888
+ h("span", gn, S(Et(g)), 1)
4889
+ ], 8, mn))), 128)),
4890
+ Ee.value.length ? V("", !0) : (A(), $("div", _n, " No events match current filters "))
4873
4891
  ])
4874
4892
  ])) : V("", !0),
4875
- t.value === "data" ? (A(), $("div", _n, [
4893
+ t.value === "data" ? (A(), $("div", wn, [
4876
4894
  d[25] || (d[25] = h("h3", { class: "szd-panel__heading" }, "Data Pipeline", -1)),
4877
- h("div", wn, [
4878
- (A(!0), $(W, null, ce(pe.value, (g, K) => (A(), $(W, {
4895
+ h("div", Cn, [
4896
+ (A(!0), $(W, null, ce(me.value, (g, z) => (A(), $(W, {
4879
4897
  key: g.id
4880
4898
  }, [
4881
4899
  h("div", {
4882
4900
  class: "szd-pipeline__stage",
4883
- onClick: (H) => as(g)
4901
+ onClick: (H) => ls(g)
4884
4902
  }, [
4885
- h("div", vn, S(g.label), 1),
4886
- h("div", En, S(g.count), 1)
4887
- ], 8, Cn),
4888
- K < pe.value.length - 1 ? (A(), $("div", bn, "→")) : V("", !0)
4903
+ h("div", En, S(g.label), 1),
4904
+ h("div", bn, S(g.count), 1)
4905
+ ], 8, vn),
4906
+ z < me.value.length - 1 ? (A(), $("div", kn, "→")) : V("", !0)
4889
4907
  ], 64))), 128))
4890
4908
  ]),
4891
- h("div", kn, [
4892
- h("div", Sn, [
4909
+ h("div", Sn, [
4910
+ h("div", Tn, [
4893
4911
  d[24] || (d[24] = h("h3", { class: "szd-panel__heading" }, "Instance Preview", -1)),
4894
- Ue(h("select", {
4912
+ Qe(h("select", {
4895
4913
  "onUpdate:modelValue": d[4] || (d[4] = (g) => m.value = g),
4896
4914
  class: "szd-select"
4897
4915
  }, [
@@ -4899,55 +4917,55 @@ const Er = (n, e) => {
4899
4917
  (A(!0), $(W, null, ce(Ye.value, (g) => (A(), $("option", {
4900
4918
  key: g,
4901
4919
  value: g
4902
- }, S(g), 9, Tn))), 128))
4920
+ }, S(g), 9, Mn))), 128))
4903
4921
  ], 512), [
4904
- [Ot, m.value]
4922
+ [At, m.value]
4905
4923
  ])
4906
4924
  ]),
4907
- m.value != null ? (A(), $("div", Mn, [
4908
- (A(!0), $(W, null, ce(pe.value, (g) => (A(), $("div", {
4925
+ m.value != null ? (A(), $("div", $n, [
4926
+ (A(!0), $(W, null, ce(me.value, (g) => (A(), $("div", {
4909
4927
  key: g.id,
4910
4928
  class: "szd-data-card"
4911
4929
  }, [
4912
- h("div", $n, [
4913
- Qe(S(g.label) + " ", 1),
4914
- g.pks.includes(m.value) ? (A(), $("span", An, "Present")) : (A(), $("span", On, "Absent"))
4930
+ h("div", An, [
4931
+ Ve(S(g.label) + " ", 1),
4932
+ g.pks.includes(m.value) ? (A(), $("span", On, "Present")) : (A(), $("span", Pn, "Absent"))
4915
4933
  ]),
4916
- h("pre", Pn, S(g.pks.includes(m.value) ? JSON.stringify(me(m.value), null, 2) : "—"), 1)
4934
+ h("pre", In, S(g.pks.includes(m.value) ? JSON.stringify(ye(m.value), null, 2) : "—"), 1)
4917
4935
  ]))), 128))
4918
4936
  ])) : (A(), $("div", Fn, "Select an instance to preview"))
4919
4937
  ])
4920
4938
  ])) : V("", !0),
4921
4939
  t.value === "ast" ? (A(), $("div", Dn, [
4922
4940
  d[27] || (d[27] = h("h3", { class: "szd-panel__heading" }, "Query AST", -1)),
4923
- h("div", In, [
4941
+ h("div", zn, [
4924
4942
  h("div", Kn, [
4925
4943
  d[26] || (d[26] = h("span", { class: "szd-kv__key" }, "Semantic Key:", -1)),
4926
- h("code", zn, S(k.value || "—"), 1)
4944
+ h("code", Rn, S(k.value || "—"), 1)
4927
4945
  ])
4928
4946
  ]),
4929
- h("pre", Rn, S(re.value ? JSON.stringify(re.value, null, 2) : "Select a queryset to view AST"), 1)
4947
+ h("pre", Nn, S(re.value ? JSON.stringify(re.value, null, 2) : "Select a queryset to view AST"), 1)
4930
4948
  ])) : V("", !0)
4931
4949
  ]),
4932
- Mt(Pt, { name: "szd-slide" }, {
4933
- default: Ft(() => [
4934
- p.value ? (A(), $("div", Nn, [
4950
+ Tt(Ot, { name: "szd-slide" }, {
4951
+ default: Pt(() => [
4952
+ p.value ? (A(), $("div", xn, [
4935
4953
  h("div", {
4936
4954
  class: "szd-detail__backdrop",
4937
4955
  onClick: d[5] || (d[5] = (g) => p.value = !1)
4938
4956
  }),
4939
- h("div", xn, [
4940
- h("div", jn, [
4957
+ h("div", jn, [
4958
+ h("div", Un, [
4941
4959
  d[28] || (d[28] = h("h3", { class: "szd-detail__title" }, "Debug Settings", -1)),
4942
4960
  h("button", {
4943
4961
  class: "szd-btn",
4944
4962
  onClick: d[6] || (d[6] = (g) => p.value = !1)
4945
4963
  }, "Close")
4946
4964
  ]),
4947
- h("div", Un, [
4948
- h("div", Qn, [
4965
+ h("div", Qn, [
4966
+ h("div", Vn, [
4949
4967
  d[30] || (d[30] = h("label", { class: "szd-settings-label" }, "Queryset", -1)),
4950
- Ue(h("select", {
4968
+ Qe(h("select", {
4951
4969
  "onUpdate:modelValue": d[7] || (d[7] = (g) => r.value = g),
4952
4970
  class: "szd-select szd-select--full"
4953
4971
  }, [
@@ -4955,69 +4973,69 @@ const Er = (n, e) => {
4955
4973
  (A(!0), $(W, null, ce(b.value, (g) => (A(), $("option", {
4956
4974
  key: g.semanticKey,
4957
4975
  value: g.semanticKey
4958
- }, S(g.modelName || "?") + " · " + S(g.semanticKey), 9, Vn))), 128))
4976
+ }, S(g.modelName || "?") + " · " + S(g.semanticKey), 9, Ln))), 128))
4959
4977
  ], 512), [
4960
- [Ot, r.value]
4978
+ [At, r.value]
4961
4979
  ])
4962
4980
  ]),
4963
- k.value ? (A(), $("div", Ln, [
4981
+ k.value ? (A(), $("div", Gn, [
4964
4982
  d[31] || (d[31] = h("label", { class: "szd-settings-label" }, "Semantic Key", -1)),
4965
- h("div", Gn, [
4966
- h("code", Bn, S(k.value), 1),
4983
+ h("div", Bn, [
4984
+ h("code", Hn, S(k.value), 1),
4967
4985
  h("button", {
4968
4986
  class: "szd-btn szd-btn--sm",
4969
- onClick: os
4987
+ onClick: is
4970
4988
  }, "Copy")
4971
4989
  ])
4972
4990
  ])) : V("", !0),
4973
- h("div", Hn, [
4991
+ h("div", qn, [
4974
4992
  d[32] || (d[32] = h("label", { class: "szd-settings-label" }, "Actions", -1)),
4975
- h("div", qn, [
4993
+ h("div", Jn, [
4976
4994
  h("button", {
4977
4995
  class: "szd-btn",
4978
- onClick: is,
4996
+ onClick: as,
4979
4997
  disabled: !N.value || c.value
4980
- }, S(c.value ? "Syncing..." : "Sync Now"), 9, Jn),
4998
+ }, S(c.value ? "Syncing..." : "Sync Now"), 9, Wn),
4981
4999
  h("button", {
4982
5000
  class: "szd-btn",
4983
- onClick: ns
5001
+ onClick: os
4984
5002
  }, "Clear Events")
4985
5003
  ])
4986
5004
  ]),
4987
- h("div", Wn, [
5005
+ h("div", Zn, [
4988
5006
  d[34] || (d[34] = h("label", { class: "szd-settings-label" }, "Options", -1)),
4989
- h("label", Zn, [
4990
- Ue(h("input", {
5007
+ h("label", Yn, [
5008
+ Qe(h("input", {
4991
5009
  type: "checkbox",
4992
5010
  "onUpdate:modelValue": d[8] || (d[8] = (g) => i.value = g)
4993
5011
  }, null, 512), [
4994
- [At, i.value]
5012
+ [$t, i.value]
4995
5013
  ]),
4996
- d[33] || (d[33] = Qe(" Live updates ", -1))
5014
+ d[33] || (d[33] = Ve(" Live updates ", -1))
4997
5015
  ])
4998
5016
  ]),
4999
- k.value ? (A(), $("div", Yn, [
5017
+ k.value ? (A(), $("div", Xn, [
5000
5018
  d[40] || (d[40] = h("label", { class: "szd-settings-label" }, "Current State", -1)),
5001
- h("div", Xn, [
5002
- h("div", eo, [
5019
+ h("div", eo, [
5020
+ h("div", to, [
5003
5021
  d[35] || (d[35] = h("span", { class: "szd-kv__key" }, "Model:", -1)),
5004
- h("span", to, S(F.value.modelName || "—"), 1)
5022
+ h("span", so, S(I.value.modelName || "—"), 1)
5005
5023
  ]),
5006
- h("div", so, [
5024
+ h("div", ro, [
5007
5025
  d[36] || (d[36] = h("span", { class: "szd-kv__key" }, "Source:", -1)),
5008
- h("span", ro, S(F.value.source), 1)
5026
+ h("span", no, S(I.value.source), 1)
5009
5027
  ]),
5010
- h("div", no, [
5028
+ h("div", oo, [
5011
5029
  d[37] || (d[37] = h("span", { class: "szd-kv__key" }, "Syncing:", -1)),
5012
- h("span", oo, S(F.value.isSyncing ? "Yes" : "No"), 1)
5030
+ h("span", io, S(I.value.isSyncing ? "Yes" : "No"), 1)
5013
5031
  ]),
5014
- h("div", io, [
5032
+ h("div", ao, [
5015
5033
  d[38] || (d[38] = h("span", { class: "szd-kv__key" }, "Operations:", -1)),
5016
- h("span", ao, S(F.value.opsCount), 1)
5034
+ h("span", lo, S(I.value.opsCount), 1)
5017
5035
  ]),
5018
- h("div", lo, [
5036
+ h("div", co, [
5019
5037
  d[39] || (d[39] = h("span", { class: "szd-kv__key" }, "Last Sync:", -1)),
5020
- h("span", co, S(F.value.lastSync), 1)
5038
+ h("span", uo, S(I.value.lastSync), 1)
5021
5039
  ])
5022
5040
  ])
5023
5041
  ])) : V("", !0)
@@ -5027,50 +5045,50 @@ const Er = (n, e) => {
5027
5045
  ]),
5028
5046
  _: 1
5029
5047
  }),
5030
- Mt(Pt, { name: "szd-slide" }, {
5031
- default: Ft(() => [
5032
- f.value ? (A(), $("div", uo, [
5048
+ Tt(Ot, { name: "szd-slide" }, {
5049
+ default: Pt(() => [
5050
+ f.value ? (A(), $("div", ho, [
5033
5051
  h("div", {
5034
5052
  class: "szd-detail__backdrop",
5035
- onClick: St
5053
+ onClick: kt
5036
5054
  }),
5037
- h("div", ho, [
5038
- h("div", fo, [
5039
- h("h3", po, S(f.value.type === "entry" ? "Event Detail" : "Snapshot: " + f.value.data.label), 1),
5055
+ h("div", fo, [
5056
+ h("div", po, [
5057
+ h("h3", mo, S(f.value.type === "entry" ? "Event Detail" : "Snapshot: " + f.value.data.label), 1),
5040
5058
  h("button", {
5041
5059
  class: "szd-btn",
5042
- onClick: St
5060
+ onClick: kt
5043
5061
  }, "Close")
5044
5062
  ]),
5045
- h("div", mo, [
5063
+ h("div", yo, [
5046
5064
  f.value.type === "entry" ? (A(), $(W, { key: 0 }, [
5047
- h("div", yo, [
5048
- (A(!0), $(W, null, ce(rs(f.value.data), (g, K) => (A(), $("div", {
5049
- key: K,
5065
+ h("div", go, [
5066
+ (A(!0), $(W, null, ce(ns(f.value.data), (g, z) => (A(), $("div", {
5067
+ key: z,
5050
5068
  class: "szd-kv__row"
5051
5069
  }, [
5052
- h("span", go, S(K) + ":", 1),
5053
- h("span", _o, S(g ?? "—"), 1)
5070
+ h("span", _o, S(z) + ":", 1),
5071
+ h("span", wo, S(g ?? "—"), 1)
5054
5072
  ]))), 128))
5055
5073
  ]),
5056
5074
  d[41] || (d[41] = h("h4", { style: { margin: "16px 0 8px" } }, "Raw JSON", -1)),
5057
- h("pre", wo, S(JSON.stringify(f.value.data, null, 2)), 1)
5075
+ h("pre", Co, S(JSON.stringify(f.value.data, null, 2)), 1)
5058
5076
  ], 64)) : (A(), $(W, { key: 1 }, [
5059
- h("div", Co, [
5060
- h("div", vo, [
5077
+ h("div", vo, [
5078
+ h("div", Eo, [
5061
5079
  d[42] || (d[42] = h("span", { class: "szd-kv__key" }, "Total Count:", -1)),
5062
- h("span", Eo, S(f.value.data.count), 1)
5080
+ h("span", bo, S(f.value.data.count), 1)
5063
5081
  ]),
5064
- h("div", bo, [
5082
+ h("div", ko, [
5065
5083
  d[43] || (d[43] = h("span", { class: "szd-kv__key" }, "Showing:", -1)),
5066
- h("span", ko, [
5067
- Qe(S(Ke.value.length) + " items ", 1),
5068
- Xe.value ? (A(), $("span", So, "(limited to first 100)")) : V("", !0)
5084
+ h("span", So, [
5085
+ Ve(S(Ke.value.length) + " items ", 1),
5086
+ Xe.value ? (A(), $("span", To, "(limited to first 100)")) : V("", !0)
5069
5087
  ])
5070
5088
  ])
5071
5089
  ]),
5072
5090
  d[44] || (d[44] = h("h4", { style: { margin: "0 0 8px" } }, "Data", -1)),
5073
- h("pre", To, S(JSON.stringify(Ke.value, null, 2)), 1)
5091
+ h("pre", Mo, S(JSON.stringify(Ke.value, null, 2)), 1)
5074
5092
  ], 64))
5075
5093
  ])
5076
5094
  ])
@@ -5080,7 +5098,7 @@ const Er = (n, e) => {
5080
5098
  })
5081
5099
  ]));
5082
5100
  }
5083
- }, Lo = /* @__PURE__ */ Er(Mo, [["__scopeId", "data-v-6d80920c"]]);
5101
+ }, Go = /* @__PURE__ */ br($o, [["__scopeId", "data-v-6d80920c"]]);
5084
5102
  export {
5085
- Lo as default
5103
+ Go as default
5086
5104
  };