@stonecrop/desktop 0.9.2 → 0.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/desktop.js CHANGED
@@ -1,40 +1,40 @@
1
- import { defineComponent as Ee, ref as A, onMounted as Te, openBlock as j, createElementBlock as F, normalizeClass as De, createElementVNode as T, Fragment as pe, renderList as be, toDisplayString as Y, createCommentVNode as de, withDirectives as Ce, vShow as Je, useTemplateRef as ht, computed as x, watch as H, nextTick as se, createBlock as Xe, Teleport as xt, createVNode as ae, Transition as Tt, withCtx as we, withModifiers as gt, vModelText as mt, renderSlot as Me, createTextVNode as Re, toRaw as yt, isRef as fe, isReactive as Pe, toRef as re, hasInjectionContext as Ke, inject as Se, getCurrentInstance as bt, reactive as wt, markRaw as ge, effectScope as Pt, getCurrentScope as Ye, onScopeDispose as et, toRefs as nt, provide as Ge, shallowRef as _e, toValue as Q, readonly as Ve, customRef as tt, unref as Oe, useModel as Vt, watchEffect as at, resolveComponent as St, resolveDynamicComponent as Mt, mergeProps as jt, mergeModels as rt, withKeys as he, normalizeStyle as je } from "vue";
2
- const Ft = { class: "action-menu-icon" }, Lt = ["disabled", "onClick"], Bt = { key: 1 }, Ht = ["onClick"], Wt = { class: "dropdown-container" }, Ut = { class: "dropdown" }, zt = ["onClick"], Jt = ["href"], Kt = { class: "dropdown-item" }, Gt = /* @__PURE__ */ Ee({
1
+ import { defineComponent as we, ref as C, onMounted as Ae, openBlock as P, createElementBlock as V, normalizeClass as Oe, createElementVNode as A, Fragment as de, renderList as me, toDisplayString as X, createCommentVNode as ue, withDirectives as Ne, vShow as Ue, useTemplateRef as ft, computed as I, watch as L, nextTick as ae, createBlock as Ze, Teleport as Rt, createVNode as ne, Transition as It, withCtx as ye, withModifiers as pt, vModelText as ht, renderSlot as Pe, createTextVNode as $e, toRaw as vt, isRef as fe, isReactive as xe, toRef as re, hasInjectionContext as ze, inject as be, getCurrentInstance as gt, reactive as mt, markRaw as he, effectScope as At, getCurrentScope as Qe, onScopeDispose as Xe, toRefs as tt, provide as Ge, shallowRef as Se, toValue as Q, readonly as Te, customRef as Ye, unref as De, useModel as xt, watchEffect as Tt, resolveComponent as yt, resolveDynamicComponent as Pt, mergeProps as Vt, mergeModels as ot, withKeys as pe, normalizeStyle as Ve } from "vue";
2
+ const jt = { class: "action-menu-icon" }, Mt = ["disabled", "onClick"], Ft = { key: 1 }, Lt = ["onClick"], Bt = { class: "dropdown-container" }, Wt = { class: "dropdown" }, Ht = ["onClick"], Ut = ["href"], zt = { class: "dropdown-item" }, Gt = /* @__PURE__ */ we({
3
3
  __name: "ActionSet",
4
4
  props: {
5
5
  elements: { default: () => [] }
6
6
  },
7
7
  emits: ["actionClick"],
8
8
  setup(t, { emit: e }) {
9
- const o = e, n = A({}), a = A(!1), s = A(-1), r = A(!1), u = A(!1);
10
- Te(() => {
11
- i();
9
+ const o = e, n = C({}), r = C(!1), i = C(-1), a = C(!1), u = C(!1);
10
+ Ae(() => {
11
+ c();
12
12
  });
13
- const i = () => {
13
+ const c = () => {
14
14
  n.value = {};
15
- }, c = () => {
16
- r.value = !0, s.value = setTimeout(() => {
17
- r.value && (a.value = !0);
15
+ }, f = () => {
16
+ a.value = !0, i.value = setTimeout(() => {
17
+ a.value && (r.value = !0);
18
18
  }, 500);
19
19
  }, p = () => {
20
- r.value = !1, u.value = !1, clearTimeout(s.value), a.value = !1;
21
- }, y = (O) => {
22
- const _ = !n.value[O];
23
- i(), _ && (n.value[O] = !0);
24
- }, h = (O, _) => {
25
- o("actionClick", _, O);
20
+ a.value = !1, u.value = !1, clearTimeout(i.value), r.value = !1;
21
+ }, b = (_) => {
22
+ const m = !n.value[_];
23
+ c(), m && (n.value[_] = !0);
24
+ }, h = (_, m) => {
25
+ o("actionClick", m, _);
26
26
  };
27
- return (O, _) => (j(), F("div", {
28
- class: De([{ "open-set": a.value, "hovered-and-closed": u.value }, "action-set collapse"]),
29
- onMouseover: c,
27
+ return (_, m) => (P(), V("div", {
28
+ class: Oe([{ "open-set": r.value, "hovered-and-closed": u.value }, "action-set collapse"]),
29
+ onMouseover: f,
30
30
  onMouseleave: p
31
31
  }, [
32
- T("div", Ft, [
33
- T("div", {
32
+ A("div", jt, [
33
+ A("div", {
34
34
  id: "chevron",
35
- onClick: _[0] || (_[0] = (D) => u.value = !u.value)
36
- }, [..._[1] || (_[1] = [
37
- T("svg", {
35
+ onClick: m[0] || (m[0] = (O) => u.value = !u.value)
36
+ }, [...m[1] || (m[1] = [
37
+ A("svg", {
38
38
  id: "Layer_1",
39
39
  class: "leftBar",
40
40
  version: "1.1",
@@ -47,9 +47,9 @@ const Ft = { class: "action-menu-icon" }, Lt = ["disabled", "onClick"], Bt = { k
47
47
  width: "50",
48
48
  height: "50"
49
49
  }, [
50
- T("polygon", { points: "54.2,33.4 29.2,58.8 25,54.6 50,29.2 " })
50
+ A("polygon", { points: "54.2,33.4 29.2,58.8 25,54.6 50,29.2 " })
51
51
  ], -1),
52
- T("svg", {
52
+ A("svg", {
53
53
  id: "Layer_1",
54
54
  class: "rightBar",
55
55
  version: "1.1",
@@ -62,62 +62,62 @@ const Ft = { class: "action-menu-icon" }, Lt = ["disabled", "onClick"], Bt = { k
62
62
  width: "50",
63
63
  height: "50"
64
64
  }, [
65
- T("polygon", { points: "70.8,58.8 45.8,33.4 50,29.2 75,54.6 " })
65
+ A("polygon", { points: "70.8,58.8 45.8,33.4 50,29.2 75,54.6 " })
66
66
  ], -1)
67
67
  ])])
68
68
  ]),
69
- _[2] || (_[2] = T("div", { style: { "margin-right": "30px" } }, null, -1)),
70
- (j(!0), F(pe, null, be(t.elements, (D, V) => (j(), F("div", {
71
- key: D.label,
69
+ m[2] || (m[2] = A("div", { style: { "margin-right": "30px" } }, null, -1)),
70
+ (P(!0), V(de, null, me(t.elements, (O, R) => (P(), V("div", {
71
+ key: O.label,
72
72
  class: "action-element"
73
73
  }, [
74
- D.type == "button" ? (j(), F("button", {
74
+ O.type == "button" ? (P(), V("button", {
75
75
  key: 0,
76
- disabled: D.disabled,
76
+ disabled: O.disabled,
77
77
  class: "button-default",
78
- onClick: (M) => h(D.action, D.label)
79
- }, Y(D.label), 9, Lt)) : de("", !0),
80
- D.type == "dropdown" ? (j(), F("div", Bt, [
81
- T("button", {
78
+ onClick: (x) => h(O.action, O.label)
79
+ }, X(O.label), 9, Mt)) : ue("", !0),
80
+ O.type == "dropdown" ? (P(), V("div", Ft, [
81
+ A("button", {
82
82
  class: "button-default",
83
- onClick: (M) => y(V)
84
- }, Y(D.label), 9, Ht),
85
- Ce(T("div", Wt, [
86
- T("div", Ut, [
87
- (j(!0), F(pe, null, be(D.actions, (M, P) => (j(), F("div", {
88
- key: M.label
83
+ onClick: (x) => b(R)
84
+ }, X(O.label), 9, Lt),
85
+ Ne(A("div", Bt, [
86
+ A("div", Wt, [
87
+ (P(!0), V(de, null, me(O.actions, (x, H) => (P(), V("div", {
88
+ key: x.label
89
89
  }, [
90
- M.action != null ? (j(), F("button", {
90
+ x.action != null ? (P(), V("button", {
91
91
  key: 0,
92
92
  class: "dropdown-item",
93
- onClick: (U) => h(M.action, M.label)
94
- }, Y(M.label), 9, zt)) : M.link != null ? (j(), F("a", {
93
+ onClick: (U) => h(x.action, x.label)
94
+ }, X(x.label), 9, Ht)) : x.link != null ? (P(), V("a", {
95
95
  key: 1,
96
- href: M.link
96
+ href: x.link
97
97
  }, [
98
- T("button", Kt, Y(M.label), 1)
99
- ], 8, Jt)) : de("", !0)
98
+ A("button", zt, X(x.label), 1)
99
+ ], 8, Ut)) : ue("", !0)
100
100
  ]))), 128))
101
101
  ])
102
102
  ], 512), [
103
- [Je, n.value[V]]
103
+ [Ue, n.value[R]]
104
104
  ])
105
- ])) : de("", !0)
105
+ ])) : ue("", !0)
106
106
  ]))), 128))
107
107
  ], 34));
108
108
  }
109
- }), Et = (t, e) => {
109
+ }), bt = (t, e) => {
110
110
  const o = t.__vccOpts || t;
111
- for (const [n, a] of e)
112
- o[n] = a;
111
+ for (const [n, r] of e)
112
+ o[n] = r;
113
113
  return o;
114
- }, _t = /* @__PURE__ */ Et(Gt, [["__scopeId", "data-v-eb01c863"]]), qt = { class: "command-palette-header" }, Zt = ["placeholder"], Qt = {
114
+ }, wt = /* @__PURE__ */ bt(Gt, [["__scopeId", "data-v-eb01c863"]]), Jt = { class: "command-palette-header" }, Kt = ["placeholder"], qt = {
115
115
  key: 0,
116
116
  class: "command-palette-results"
117
- }, Xt = ["onClick", "onMouseover"], Yt = { class: "result-title" }, eo = { class: "result-content" }, to = {
117
+ }, Zt = ["onClick", "onMouseover"], Qt = { class: "result-title" }, Xt = { class: "result-content" }, Yt = {
118
118
  key: 1,
119
119
  class: "command-palette-no-results"
120
- }, $t = /* @__PURE__ */ Ee({
120
+ }, St = /* @__PURE__ */ we({
121
121
  __name: "CommandPalette",
122
122
  props: {
123
123
  search: { type: Function },
@@ -127,515 +127,515 @@ const Ft = { class: "action-menu-icon" }, Lt = ["disabled", "onClick"], Bt = { k
127
127
  },
128
128
  emits: ["select", "close"],
129
129
  setup(t, { emit: e }) {
130
- const o = e, n = A(""), a = A(0), s = ht("input"), r = x(() => n.value ? t.search(n.value).slice(0, t.maxResults) : []);
131
- H(
130
+ const o = e, n = C(""), r = C(0), i = ft("input"), a = I(() => n.value ? t.search(n.value).slice(0, t.maxResults) : []);
131
+ L(
132
132
  () => t.isOpen,
133
133
  async (p) => {
134
- p && (n.value = "", a.value = 0, await se(), s.value?.focus());
134
+ p && (n.value = "", r.value = 0, await ae(), i.value?.focus());
135
135
  }
136
- ), H(r, () => {
137
- a.value = 0;
136
+ ), L(a, () => {
137
+ r.value = 0;
138
138
  });
139
139
  const u = () => {
140
140
  o("close");
141
- }, i = (p) => {
141
+ }, c = (p) => {
142
142
  switch (p.key) {
143
143
  case "Escape":
144
144
  u();
145
145
  break;
146
146
  case "ArrowDown":
147
- p.preventDefault(), r.value.length && (a.value = (a.value + 1) % r.value.length);
147
+ p.preventDefault(), a.value.length && (r.value = (r.value + 1) % a.value.length);
148
148
  break;
149
149
  case "ArrowUp":
150
- p.preventDefault(), r.value.length && (a.value = (a.value - 1 + r.value.length) % r.value.length);
150
+ p.preventDefault(), a.value.length && (r.value = (r.value - 1 + a.value.length) % a.value.length);
151
151
  break;
152
152
  case "Enter":
153
- r.value.length && a.value >= 0 && c(r.value[a.value]);
153
+ a.value.length && r.value >= 0 && f(a.value[r.value]);
154
154
  break;
155
155
  }
156
- }, c = (p) => {
156
+ }, f = (p) => {
157
157
  o("select", p), u();
158
158
  };
159
- return (p, y) => (j(), Xe(xt, { to: "body" }, [
160
- ae(Tt, { name: "fade" }, {
161
- default: we(() => [
162
- t.isOpen ? (j(), F("div", {
159
+ return (p, b) => (P(), Ze(Rt, { to: "body" }, [
160
+ ne(It, { name: "fade" }, {
161
+ default: ye(() => [
162
+ t.isOpen ? (P(), V("div", {
163
163
  key: 0,
164
164
  class: "command-palette-overlay",
165
165
  onClick: u
166
166
  }, [
167
- T("div", {
167
+ A("div", {
168
168
  class: "command-palette",
169
- onClick: y[1] || (y[1] = gt(() => {
169
+ onClick: b[1] || (b[1] = pt(() => {
170
170
  }, ["stop"]))
171
171
  }, [
172
- T("div", qt, [
173
- Ce(T("input", {
172
+ A("div", Jt, [
173
+ Ne(A("input", {
174
174
  ref: "input",
175
- "onUpdate:modelValue": y[0] || (y[0] = (h) => n.value = h),
175
+ "onUpdate:modelValue": b[0] || (b[0] = (h) => n.value = h),
176
176
  type: "text",
177
177
  class: "command-palette-input",
178
178
  placeholder: t.placeholder,
179
179
  autofocus: "",
180
- onKeydown: i
181
- }, null, 40, Zt), [
182
- [mt, n.value]
180
+ onKeydown: c
181
+ }, null, 40, Kt), [
182
+ [ht, n.value]
183
183
  ])
184
184
  ]),
185
- r.value.length ? (j(), F("div", Qt, [
186
- (j(!0), F(pe, null, be(r.value, (h, O) => (j(), F("div", {
187
- key: O,
188
- class: De(["command-palette-result", { selected: O === a.value }]),
189
- onClick: (_) => c(h),
190
- onMouseover: (_) => a.value = O
185
+ a.value.length ? (P(), V("div", qt, [
186
+ (P(!0), V(de, null, me(a.value, (h, _) => (P(), V("div", {
187
+ key: _,
188
+ class: Oe(["command-palette-result", { selected: _ === r.value }]),
189
+ onClick: (m) => f(h),
190
+ onMouseover: (m) => r.value = _
191
191
  }, [
192
- T("div", Yt, [
193
- Me(p.$slots, "title", { result: h })
192
+ A("div", Qt, [
193
+ Pe(p.$slots, "title", { result: h })
194
194
  ]),
195
- T("div", eo, [
196
- Me(p.$slots, "content", { result: h })
195
+ A("div", Xt, [
196
+ Pe(p.$slots, "content", { result: h })
197
197
  ])
198
- ], 42, Xt))), 128))
199
- ])) : n.value && !r.value.length ? (j(), F("div", to, [
200
- Me(p.$slots, "empty", {}, () => [
201
- Re(' No results found for "' + Y(n.value) + '" ', 1)
198
+ ], 42, Zt))), 128))
199
+ ])) : n.value && !a.value.length ? (P(), V("div", Yt, [
200
+ Pe(p.$slots, "empty", {}, () => [
201
+ $e(' No results found for "' + X(n.value) + '" ', 1)
202
202
  ])
203
- ])) : de("", !0)
203
+ ])) : ue("", !0)
204
204
  ])
205
- ])) : de("", !0)
205
+ ])) : ue("", !0)
206
206
  ]),
207
207
  _: 3
208
208
  })
209
209
  ]));
210
210
  }
211
211
  });
212
- const ce = typeof window < "u";
213
- let ne;
214
- const Ae = (t) => ne = t;
212
+ const le = typeof window < "u";
213
+ let oe;
214
+ const Ce = (t) => oe = t;
215
215
  process.env.NODE_ENV;
216
- const qe = process.env.NODE_ENV !== "production" ? /* @__PURE__ */ Symbol("pinia") : (
216
+ const Je = process.env.NODE_ENV !== "production" ? /* @__PURE__ */ Symbol("pinia") : (
217
217
  /* istanbul ignore next */
218
218
  /* @__PURE__ */ Symbol()
219
219
  );
220
- function ie(t) {
220
+ function se(t) {
221
221
  return t && typeof t == "object" && Object.prototype.toString.call(t) === "[object Object]" && typeof t.toJSON != "function";
222
222
  }
223
- var me;
223
+ var ve;
224
224
  (function(t) {
225
225
  t.direct = "direct", t.patchObject = "patch object", t.patchFunction = "patch function";
226
- })(me || (me = {}));
227
- function kt(t, e) {
226
+ })(ve || (ve = {}));
227
+ function Et(t, e) {
228
228
  for (const o in e) {
229
229
  const n = e[o];
230
230
  if (!(o in t))
231
231
  continue;
232
- const a = t[o];
233
- ie(a) && ie(n) && !fe(n) && !Pe(n) ? t[o] = kt(a, n) : t[o] = n;
232
+ const r = t[o];
233
+ se(r) && se(n) && !fe(n) && !xe(n) ? t[o] = Et(r, n) : t[o] = n;
234
234
  }
235
235
  return t;
236
236
  }
237
- const Nt = () => {
237
+ const _t = () => {
238
238
  };
239
- function st(t, e, o, n = Nt) {
239
+ function nt(t, e, o, n = _t) {
240
240
  t.add(e);
241
- const a = () => {
241
+ const r = () => {
242
242
  t.delete(e) && n();
243
243
  };
244
- return !o && Ye() && et(a), a;
244
+ return !o && Qe() && Xe(r), r;
245
245
  }
246
- function le(t, ...e) {
246
+ function ie(t, ...e) {
247
247
  t.forEach((o) => {
248
248
  o(...e);
249
249
  });
250
250
  }
251
- const oo = (t) => t(), it = /* @__PURE__ */ Symbol(), Fe = /* @__PURE__ */ Symbol();
252
- function Ze(t, e) {
251
+ const eo = (t) => t(), rt = /* @__PURE__ */ Symbol(), je = /* @__PURE__ */ Symbol();
252
+ function Ke(t, e) {
253
253
  t instanceof Map && e instanceof Map ? e.forEach((o, n) => t.set(n, o)) : t instanceof Set && e instanceof Set && e.forEach(t.add, t);
254
254
  for (const o in e) {
255
255
  if (!e.hasOwnProperty(o))
256
256
  continue;
257
- const n = e[o], a = t[o];
258
- ie(a) && ie(n) && t.hasOwnProperty(o) && !fe(n) && !Pe(n) ? t[o] = Ze(a, n) : t[o] = n;
257
+ const n = e[o], r = t[o];
258
+ se(r) && se(n) && t.hasOwnProperty(o) && !fe(n) && !xe(n) ? t[o] = Ke(r, n) : t[o] = n;
259
259
  }
260
260
  return t;
261
261
  }
262
- const no = process.env.NODE_ENV !== "production" ? /* @__PURE__ */ Symbol("pinia:skipHydration") : (
262
+ const to = process.env.NODE_ENV !== "production" ? /* @__PURE__ */ Symbol("pinia:skipHydration") : (
263
263
  /* istanbul ignore next */
264
264
  /* @__PURE__ */ Symbol()
265
265
  );
266
- function ao(t) {
267
- return !ie(t) || !Object.prototype.hasOwnProperty.call(t, no);
266
+ function oo(t) {
267
+ return !se(t) || !Object.prototype.hasOwnProperty.call(t, to);
268
268
  }
269
269
  const { assign: Z } = Object;
270
- function lt(t) {
270
+ function at(t) {
271
271
  return !!(fe(t) && t.effect);
272
272
  }
273
- function ct(t, e, o, n) {
274
- const { state: a, actions: s, getters: r } = e, u = o.state.value[t];
275
- let i;
276
- function c() {
277
- !u && (process.env.NODE_ENV === "production" || !n) && (o.state.value[t] = a ? a() : {});
273
+ function st(t, e, o, n) {
274
+ const { state: r, actions: i, getters: a } = e, u = o.state.value[t];
275
+ let c;
276
+ function f() {
277
+ !u && (process.env.NODE_ENV === "production" || !n) && (o.state.value[t] = r ? r() : {});
278
278
  const p = process.env.NODE_ENV !== "production" && n ? (
279
279
  // use ref() to unwrap refs inside state TODO: check if this is still necessary
280
- nt(A(a ? a() : {}).value)
281
- ) : nt(o.state.value[t]);
282
- return Z(p, s, Object.keys(r || {}).reduce((y, h) => (process.env.NODE_ENV !== "production" && h in p && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${h}" in store "${t}".`), y[h] = ge(x(() => {
283
- Ae(o);
284
- const O = o._s.get(t);
285
- return r[h].call(O, O);
286
- })), y), {}));
287
- }
288
- return i = Qe(t, c, e, o, n, !0), i;
280
+ tt(C(r ? r() : {}).value)
281
+ ) : tt(o.state.value[t]);
282
+ return Z(p, i, Object.keys(a || {}).reduce((b, h) => (process.env.NODE_ENV !== "production" && h in p && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${h}" in store "${t}".`), b[h] = he(I(() => {
283
+ Ce(o);
284
+ const _ = o._s.get(t);
285
+ return a[h].call(_, _);
286
+ })), b), {}));
287
+ }
288
+ return c = qe(t, f, e, o, n, !0), c;
289
289
  }
290
- function Qe(t, e, o = {}, n, a, s) {
291
- let r;
290
+ function qe(t, e, o = {}, n, r, i) {
291
+ let a;
292
292
  const u = Z({ actions: {} }, o);
293
293
  if (process.env.NODE_ENV !== "production" && !n._e.active)
294
294
  throw new Error("Pinia destroyed");
295
- const i = { deep: !0 };
296
- process.env.NODE_ENV !== "production" && (i.onTrigger = (g) => {
297
- c ? O = g : c == !1 && !$._hotUpdating && (Array.isArray(O) ? O.push(g) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."));
295
+ const c = { deep: !0 };
296
+ process.env.NODE_ENV !== "production" && (c.onTrigger = (v) => {
297
+ f ? _ = v : f == !1 && !E._hotUpdating && (Array.isArray(_) ? _.push(v) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."));
298
298
  });
299
- let c, p, y = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set(), O;
300
- const _ = n.state.value[t];
301
- !s && !_ && (process.env.NODE_ENV === "production" || !a) && (n.state.value[t] = {});
302
- const D = A({});
303
- let V;
304
- function M(g) {
305
- let m;
306
- c = p = !1, process.env.NODE_ENV !== "production" && (O = []), typeof g == "function" ? (g(n.state.value[t]), m = {
307
- type: me.patchFunction,
299
+ let f, p, b = /* @__PURE__ */ new Set(), h = /* @__PURE__ */ new Set(), _;
300
+ const m = n.state.value[t];
301
+ !i && !m && (process.env.NODE_ENV === "production" || !r) && (n.state.value[t] = {});
302
+ const O = C({});
303
+ let R;
304
+ function x(v) {
305
+ let g;
306
+ f = p = !1, process.env.NODE_ENV !== "production" && (_ = []), typeof v == "function" ? (v(n.state.value[t]), g = {
307
+ type: ve.patchFunction,
308
308
  storeId: t,
309
- events: O
310
- }) : (Ze(n.state.value[t], g), m = {
311
- type: me.patchObject,
312
- payload: g,
309
+ events: _
310
+ }) : (Ke(n.state.value[t], v), g = {
311
+ type: ve.patchObject,
312
+ payload: v,
313
313
  storeId: t,
314
- events: O
314
+ events: _
315
315
  });
316
- const C = V = /* @__PURE__ */ Symbol();
317
- se().then(() => {
318
- V === C && (c = !0);
319
- }), p = !0, le(y, m, n.state.value[t]);
320
- }
321
- const P = s ? function() {
322
- const { state: m } = o, C = m ? m() : {};
323
- this.$patch((B) => {
324
- Z(B, C);
316
+ const $ = R = /* @__PURE__ */ Symbol();
317
+ ae().then(() => {
318
+ R === $ && (f = !0);
319
+ }), p = !0, ie(b, g, n.state.value[t]);
320
+ }
321
+ const H = i ? function() {
322
+ const { state: g } = o, $ = g ? g() : {};
323
+ this.$patch((M) => {
324
+ Z(M, $);
325
325
  });
326
326
  } : (
327
327
  /* istanbul ignore next */
328
328
  process.env.NODE_ENV !== "production" ? () => {
329
329
  throw new Error(`🍍: Store "${t}" is built using the setup syntax and does not implement $reset().`);
330
- } : Nt
330
+ } : _t
331
331
  );
332
332
  function U() {
333
- r.stop(), y.clear(), h.clear(), n._s.delete(t);
334
- }
335
- const q = (g, m = "") => {
336
- if (it in g)
337
- return g[Fe] = m, g;
338
- const C = function() {
339
- Ae(n);
340
- const B = Array.from(arguments), k = /* @__PURE__ */ new Set(), I = /* @__PURE__ */ new Set();
341
- function L(S) {
333
+ a.stop(), b.clear(), h.clear(), n._s.delete(t);
334
+ }
335
+ const K = (v, g = "") => {
336
+ if (rt in v)
337
+ return v[je] = g, v;
338
+ const $ = function() {
339
+ Ce(n);
340
+ const M = Array.from(arguments), k = /* @__PURE__ */ new Set(), T = /* @__PURE__ */ new Set();
341
+ function F(S) {
342
342
  k.add(S);
343
343
  }
344
- function E(S) {
345
- I.add(S);
344
+ function w(S) {
345
+ T.add(S);
346
346
  }
347
- le(h, {
348
- args: B,
349
- name: C[Fe],
350
- store: $,
351
- after: L,
352
- onError: E
347
+ ie(h, {
348
+ args: M,
349
+ name: $[je],
350
+ store: E,
351
+ after: F,
352
+ onError: w
353
353
  });
354
- let N;
354
+ let D;
355
355
  try {
356
- N = g.apply(this && this.$id === t ? this : $, B);
356
+ D = v.apply(this && this.$id === t ? this : E, M);
357
357
  } catch (S) {
358
- throw le(I, S), S;
358
+ throw ie(T, S), S;
359
359
  }
360
- return N instanceof Promise ? N.then((S) => (le(k, S), S)).catch((S) => (le(I, S), Promise.reject(S))) : (le(k, N), N);
360
+ return D instanceof Promise ? D.then((S) => (ie(k, S), S)).catch((S) => (ie(T, S), Promise.reject(S))) : (ie(k, D), D);
361
361
  };
362
- return C[it] = !0, C[Fe] = m, C;
363
- }, K = /* @__PURE__ */ ge({
362
+ return $[rt] = !0, $[je] = g, $;
363
+ }, G = /* @__PURE__ */ he({
364
364
  actions: {},
365
365
  getters: {},
366
366
  state: [],
367
- hotState: D
367
+ hotState: O
368
368
  }), z = {
369
369
  _p: n,
370
370
  // _s: scope,
371
371
  $id: t,
372
- $onAction: st.bind(null, h),
373
- $patch: M,
374
- $reset: P,
375
- $subscribe(g, m = {}) {
376
- const C = st(y, g, m.detached, () => B()), B = r.run(() => H(() => n.state.value[t], (k) => {
377
- (m.flush === "sync" ? p : c) && g({
372
+ $onAction: nt.bind(null, h),
373
+ $patch: x,
374
+ $reset: H,
375
+ $subscribe(v, g = {}) {
376
+ const $ = nt(b, v, g.detached, () => M()), M = a.run(() => L(() => n.state.value[t], (k) => {
377
+ (g.flush === "sync" ? p : f) && v({
378
378
  storeId: t,
379
- type: me.direct,
380
- events: O
379
+ type: ve.direct,
380
+ events: _
381
381
  }, k);
382
- }, Z({}, i, m)));
383
- return C;
382
+ }, Z({}, c, g)));
383
+ return $;
384
384
  },
385
385
  $dispose: U
386
- }, $ = wt(process.env.NODE_ENV !== "production" || process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && ce ? Z(
386
+ }, E = mt(process.env.NODE_ENV !== "production" || process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && le ? Z(
387
387
  {
388
- _hmrPayload: K,
389
- _customProperties: ge(/* @__PURE__ */ new Set())
388
+ _hmrPayload: G,
389
+ _customProperties: he(/* @__PURE__ */ new Set())
390
390
  // devtools custom properties
391
391
  },
392
392
  z
393
393
  // must be added later
394
394
  // setupStore
395
395
  ) : z);
396
- n._s.set(t, $);
397
- const W = (n._a && n._a.runWithContext || oo)(() => n._e.run(() => (r = Pt()).run(() => e({ action: q }))));
398
- for (const g in W) {
399
- const m = W[g];
400
- if (fe(m) && !lt(m) || Pe(m))
401
- process.env.NODE_ENV !== "production" && a ? D.value[g] = re(W, g) : s || (_ && ao(m) && (fe(m) ? m.value = _[g] : Ze(m, _[g])), n.state.value[t][g] = m), process.env.NODE_ENV !== "production" && K.state.push(g);
402
- else if (typeof m == "function") {
403
- const C = process.env.NODE_ENV !== "production" && a ? m : q(m, g);
404
- W[g] = C, process.env.NODE_ENV !== "production" && (K.actions[g] = m), u.actions[g] = m;
405
- } else process.env.NODE_ENV !== "production" && lt(m) && (K.getters[g] = s ? (
396
+ n._s.set(t, E);
397
+ const B = (n._a && n._a.runWithContext || eo)(() => n._e.run(() => (a = At()).run(() => e({ action: K }))));
398
+ for (const v in B) {
399
+ const g = B[v];
400
+ if (fe(g) && !at(g) || xe(g))
401
+ process.env.NODE_ENV !== "production" && r ? O.value[v] = re(B, v) : i || (m && oo(g) && (fe(g) ? g.value = m[v] : Ke(g, m[v])), n.state.value[t][v] = g), process.env.NODE_ENV !== "production" && G.state.push(v);
402
+ else if (typeof g == "function") {
403
+ const $ = process.env.NODE_ENV !== "production" && r ? g : K(g, v);
404
+ B[v] = $, process.env.NODE_ENV !== "production" && (G.actions[v] = g), u.actions[v] = g;
405
+ } else process.env.NODE_ENV !== "production" && at(g) && (G.getters[v] = i ? (
406
406
  // @ts-expect-error
407
- o.getters[g]
408
- ) : m, ce && (W._getters || // @ts-expect-error: same
409
- (W._getters = ge([]))).push(g));
410
- }
411
- if (Z($, W), Z(yt($), W), Object.defineProperty($, "$state", {
412
- get: () => process.env.NODE_ENV !== "production" && a ? D.value : n.state.value[t],
413
- set: (g) => {
414
- if (process.env.NODE_ENV !== "production" && a)
407
+ o.getters[v]
408
+ ) : g, le && (B._getters || // @ts-expect-error: same
409
+ (B._getters = he([]))).push(v));
410
+ }
411
+ if (Z(E, B), Z(vt(E), B), Object.defineProperty(E, "$state", {
412
+ get: () => process.env.NODE_ENV !== "production" && r ? O.value : n.state.value[t],
413
+ set: (v) => {
414
+ if (process.env.NODE_ENV !== "production" && r)
415
415
  throw new Error("cannot set hotState");
416
- M((m) => {
417
- Z(m, g);
416
+ x((g) => {
417
+ Z(g, v);
418
418
  });
419
419
  }
420
- }), process.env.NODE_ENV !== "production" && ($._hotUpdate = ge((g) => {
421
- $._hotUpdating = !0, g._hmrPayload.state.forEach((m) => {
422
- if (m in $.$state) {
423
- const C = g.$state[m], B = $.$state[m];
424
- typeof C == "object" && ie(C) && ie(B) ? kt(C, B) : g.$state[m] = B;
420
+ }), process.env.NODE_ENV !== "production" && (E._hotUpdate = he((v) => {
421
+ E._hotUpdating = !0, v._hmrPayload.state.forEach((g) => {
422
+ if (g in E.$state) {
423
+ const $ = v.$state[g], M = E.$state[g];
424
+ typeof $ == "object" && se($) && se(M) ? Et($, M) : v.$state[g] = M;
425
425
  }
426
- $[m] = re(g.$state, m);
427
- }), Object.keys($.$state).forEach((m) => {
428
- m in g.$state || delete $[m];
429
- }), c = !1, p = !1, n.state.value[t] = re(g._hmrPayload, "hotState"), p = !0, se().then(() => {
430
- c = !0;
426
+ E[g] = re(v.$state, g);
427
+ }), Object.keys(E.$state).forEach((g) => {
428
+ g in v.$state || delete E[g];
429
+ }), f = !1, p = !1, n.state.value[t] = re(v._hmrPayload, "hotState"), p = !0, ae().then(() => {
430
+ f = !0;
431
431
  });
432
- for (const m in g._hmrPayload.actions) {
433
- const C = g[m];
434
- $[m] = //
435
- q(C, m);
432
+ for (const g in v._hmrPayload.actions) {
433
+ const $ = v[g];
434
+ E[g] = //
435
+ K($, g);
436
436
  }
437
- for (const m in g._hmrPayload.getters) {
438
- const C = g._hmrPayload.getters[m], B = s ? (
437
+ for (const g in v._hmrPayload.getters) {
438
+ const $ = v._hmrPayload.getters[g], M = i ? (
439
439
  // special handling of options api
440
- x(() => (Ae(n), C.call($, $)))
441
- ) : C;
442
- $[m] = //
443
- B;
440
+ I(() => (Ce(n), $.call(E, E)))
441
+ ) : $;
442
+ E[g] = //
443
+ M;
444
444
  }
445
- Object.keys($._hmrPayload.getters).forEach((m) => {
446
- m in g._hmrPayload.getters || delete $[m];
447
- }), Object.keys($._hmrPayload.actions).forEach((m) => {
448
- m in g._hmrPayload.actions || delete $[m];
449
- }), $._hmrPayload = g._hmrPayload, $._getters = g._getters, $._hotUpdating = !1;
450
- })), process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && ce) {
451
- const g = {
445
+ Object.keys(E._hmrPayload.getters).forEach((g) => {
446
+ g in v._hmrPayload.getters || delete E[g];
447
+ }), Object.keys(E._hmrPayload.actions).forEach((g) => {
448
+ g in v._hmrPayload.actions || delete E[g];
449
+ }), E._hmrPayload = v._hmrPayload, E._getters = v._getters, E._hotUpdating = !1;
450
+ })), process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && le) {
451
+ const v = {
452
452
  writable: !0,
453
453
  configurable: !0,
454
454
  // avoid warning on devtools trying to display this property
455
455
  enumerable: !1
456
456
  };
457
- ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((m) => {
458
- Object.defineProperty($, m, Z({ value: $[m] }, g));
457
+ ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((g) => {
458
+ Object.defineProperty(E, g, Z({ value: E[g] }, v));
459
459
  });
460
460
  }
461
- return n._p.forEach((g) => {
462
- if (process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && ce) {
463
- const m = r.run(() => g({
464
- store: $,
461
+ return n._p.forEach((v) => {
462
+ if (process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test" && le) {
463
+ const g = a.run(() => v({
464
+ store: E,
465
465
  app: n._a,
466
466
  pinia: n,
467
467
  options: u
468
468
  }));
469
- Object.keys(m || {}).forEach((C) => $._customProperties.add(C)), Z($, m);
469
+ Object.keys(g || {}).forEach(($) => E._customProperties.add($)), Z(E, g);
470
470
  } else
471
- Z($, r.run(() => g({
472
- store: $,
471
+ Z(E, a.run(() => v({
472
+ store: E,
473
473
  app: n._a,
474
474
  pinia: n,
475
475
  options: u
476
476
  })));
477
- }), process.env.NODE_ENV !== "production" && $.$state && typeof $.$state == "object" && typeof $.$state.constructor == "function" && !$.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be
477
+ }), process.env.NODE_ENV !== "production" && E.$state && typeof E.$state == "object" && typeof E.$state.constructor == "function" && !E.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be
478
478
  state: () => new MyClass()
479
- Found in store "${$.$id}".`), _ && s && o.hydrate && o.hydrate($.$state, _), c = !0, p = !0, $;
479
+ Found in store "${E.$id}".`), m && i && o.hydrate && o.hydrate(E.$state, m), f = !0, p = !0, E;
480
480
  }
481
481
  // @__NO_SIDE_EFFECTS__
482
- function ro(t, e, o) {
482
+ function no(t, e, o) {
483
483
  let n;
484
- const a = typeof e == "function";
485
- n = a ? o : e;
486
- function s(r, u) {
487
- const i = Ke();
488
- if (r = // in test mode, ignore the argument provided as we can always retrieve a
484
+ const r = typeof e == "function";
485
+ n = r ? o : e;
486
+ function i(a, u) {
487
+ const c = ze();
488
+ if (a = // in test mode, ignore the argument provided as we can always retrieve a
489
489
  // pinia instance with getActivePinia()
490
- (process.env.NODE_ENV === "test" && ne && ne._testing ? null : r) || (i ? Se(qe, null) : null), r && Ae(r), process.env.NODE_ENV !== "production" && !ne)
490
+ (process.env.NODE_ENV === "test" && oe && oe._testing ? null : a) || (c ? be(Je, null) : null), a && Ce(a), process.env.NODE_ENV !== "production" && !oe)
491
491
  throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
492
492
  See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
493
493
  This will fail in production.`);
494
- r = ne, r._s.has(t) || (a ? Qe(t, e, n, r) : ct(t, n, r), process.env.NODE_ENV !== "production" && (s._pinia = r));
495
- const c = r._s.get(t);
494
+ a = oe, a._s.has(t) || (r ? qe(t, e, n, a) : st(t, n, a), process.env.NODE_ENV !== "production" && (i._pinia = a));
495
+ const f = a._s.get(t);
496
496
  if (process.env.NODE_ENV !== "production" && u) {
497
- const p = "__hot:" + t, y = a ? Qe(p, e, n, r, !0) : ct(p, Z({}, n), r, !0);
498
- u._hotUpdate(y), delete r.state.value[p], r._s.delete(p);
497
+ const p = "__hot:" + t, b = r ? qe(p, e, n, a, !0) : st(p, Z({}, n), a, !0);
498
+ u._hotUpdate(b), delete a.state.value[p], a._s.delete(p);
499
499
  }
500
- if (process.env.NODE_ENV !== "production" && ce) {
501
- const p = bt();
500
+ if (process.env.NODE_ENV !== "production" && le) {
501
+ const p = gt();
502
502
  if (p && p.proxy && // avoid adding stores that are just built for hot module replacement
503
503
  !u) {
504
- const y = p.proxy, h = "_pStores" in y ? y._pStores : y._pStores = {};
505
- h[t] = c;
504
+ const b = p.proxy, h = "_pStores" in b ? b._pStores : b._pStores = {};
505
+ h[t] = f;
506
506
  }
507
507
  }
508
- return c;
508
+ return f;
509
509
  }
510
- return s.$id = t, s;
510
+ return i.$id = t, i;
511
511
  }
512
- function so(t) {
513
- const e = yt(t), o = {};
512
+ function ro(t) {
513
+ const e = vt(t), o = {};
514
514
  for (const n in e) {
515
- const a = e[n];
516
- a.effect ? o[n] = // ...
517
- x({
515
+ const r = e[n];
516
+ r.effect ? o[n] = // ...
517
+ I({
518
518
  get: () => t[n],
519
- set(s) {
520
- t[n] = s;
519
+ set(i) {
520
+ t[n] = i;
521
521
  }
522
- }) : (fe(a) || Pe(a)) && (o[n] = // ---
522
+ }) : (fe(r) || xe(r)) && (o[n] = // ---
523
523
  re(t, n));
524
524
  }
525
525
  return o;
526
526
  }
527
- const io = typeof window < "u" && typeof document < "u";
527
+ const ao = typeof window < "u" && typeof document < "u";
528
528
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
529
- const lo = Object.prototype.toString, co = (t) => lo.call(t) === "[object Object]", uo = () => {
529
+ const so = Object.prototype.toString, io = (t) => so.call(t) === "[object Object]", lo = () => {
530
530
  };
531
- function po(...t) {
531
+ function co(...t) {
532
532
  if (t.length !== 1) return re(...t);
533
533
  const e = t[0];
534
- return typeof e == "function" ? Ve(tt(() => ({
534
+ return typeof e == "function" ? Te(Ye(() => ({
535
535
  get: e,
536
- set: uo
537
- }))) : A(e);
536
+ set: lo
537
+ }))) : C(e);
538
538
  }
539
- function fo(t, e) {
539
+ function uo(t, e) {
540
540
  function o(...n) {
541
- return new Promise((a, s) => {
541
+ return new Promise((r, i) => {
542
542
  Promise.resolve(t(() => e.apply(this, n), {
543
543
  fn: e,
544
544
  thisArg: this,
545
545
  args: n
546
- })).then(a).catch(s);
546
+ })).then(r).catch(i);
547
547
  });
548
548
  }
549
549
  return o;
550
550
  }
551
- const Ot = (t) => t();
552
- function vo(t = Ot, e = {}) {
553
- const { initialState: o = "active" } = e, n = po(o === "active");
554
- function a() {
551
+ const kt = (t) => t();
552
+ function fo(t = kt, e = {}) {
553
+ const { initialState: o = "active" } = e, n = co(o === "active");
554
+ function r() {
555
555
  n.value = !1;
556
556
  }
557
- function s() {
557
+ function i() {
558
558
  n.value = !0;
559
559
  }
560
- const r = (...u) => {
560
+ const a = (...u) => {
561
561
  n.value && t(...u);
562
562
  };
563
563
  return {
564
- isActive: Ve(n),
565
- pause: a,
566
- resume: s,
567
- eventFilter: r
564
+ isActive: Te(n),
565
+ pause: r,
566
+ resume: i,
567
+ eventFilter: a
568
568
  };
569
569
  }
570
- function Le(t) {
570
+ function Me(t) {
571
571
  return Array.isArray(t) ? t : [t];
572
572
  }
573
- function ho(t) {
574
- return bt();
573
+ function po(t) {
574
+ return gt();
575
575
  }
576
- function go(t, e, o = {}) {
577
- const { eventFilter: n = Ot, ...a } = o;
578
- return H(t, fo(n, e), a);
576
+ function ho(t, e, o = {}) {
577
+ const { eventFilter: n = kt, ...r } = o;
578
+ return L(t, uo(n, e), r);
579
579
  }
580
- function mo(t, e, o = {}) {
581
- const { eventFilter: n, initialState: a = "active", ...s } = o, { eventFilter: r, pause: u, resume: i, isActive: c } = vo(n, { initialState: a });
580
+ function vo(t, e, o = {}) {
581
+ const { eventFilter: n, initialState: r = "active", ...i } = o, { eventFilter: a, pause: u, resume: c, isActive: f } = fo(n, { initialState: r });
582
582
  return {
583
- stop: go(t, e, {
584
- ...s,
585
- eventFilter: r
583
+ stop: ho(t, e, {
584
+ ...i,
585
+ eventFilter: a
586
586
  }),
587
587
  pause: u,
588
- resume: i,
589
- isActive: c
588
+ resume: c,
589
+ isActive: f
590
590
  };
591
591
  }
592
- function yo(t, e = !0, o) {
593
- ho() ? Te(t, o) : e ? t() : se(t);
592
+ function go(t, e = !0, o) {
593
+ po() ? Ae(t, o) : e ? t() : ae(t);
594
594
  }
595
- function bo(t, e, o) {
596
- return H(t, e, {
595
+ function mo(t, e, o) {
596
+ return L(t, e, {
597
597
  ...o,
598
598
  immediate: !0
599
599
  });
600
600
  }
601
- const Ie = io ? window : void 0;
602
- function wo(t) {
601
+ const Re = ao ? window : void 0;
602
+ function yo(t) {
603
603
  var e;
604
604
  const o = Q(t);
605
605
  return (e = o?.$el) !== null && e !== void 0 ? e : o;
606
606
  }
607
- function ut(...t) {
608
- const e = (n, a, s, r) => (n.addEventListener(a, s, r), () => n.removeEventListener(a, s, r)), o = x(() => {
609
- const n = Le(Q(t[0])).filter((a) => a != null);
610
- return n.every((a) => typeof a != "string") ? n : void 0;
607
+ function it(...t) {
608
+ const e = (n, r, i, a) => (n.addEventListener(r, i, a), () => n.removeEventListener(r, i, a)), o = I(() => {
609
+ const n = Me(Q(t[0])).filter((r) => r != null);
610
+ return n.every((r) => typeof r != "string") ? n : void 0;
611
611
  });
612
- return bo(() => {
613
- var n, a;
612
+ return mo(() => {
613
+ var n, r;
614
614
  return [
615
- (n = (a = o.value) === null || a === void 0 ? void 0 : a.map((s) => wo(s))) !== null && n !== void 0 ? n : [Ie].filter((s) => s != null),
616
- Le(Q(o.value ? t[1] : t[0])),
617
- Le(Oe(o.value ? t[2] : t[1])),
615
+ (n = (r = o.value) === null || r === void 0 ? void 0 : r.map((i) => yo(i))) !== null && n !== void 0 ? n : [Re].filter((i) => i != null),
616
+ Me(Q(o.value ? t[1] : t[0])),
617
+ Me(De(o.value ? t[2] : t[1])),
618
618
  Q(o.value ? t[3] : t[2])
619
619
  ];
620
- }, ([n, a, s, r], u, i) => {
621
- if (!n?.length || !a?.length || !s?.length) return;
622
- const c = co(r) ? { ...r } : r, p = n.flatMap((y) => a.flatMap((h) => s.map((O) => e(y, h, O, c))));
623
- i(() => {
624
- p.forEach((y) => y());
620
+ }, ([n, r, i, a], u, c) => {
621
+ if (!n?.length || !r?.length || !i?.length) return;
622
+ const f = io(a) ? { ...a } : a, p = n.flatMap((b) => r.flatMap((h) => i.map((_) => e(b, h, _, f))));
623
+ c(() => {
624
+ p.forEach((b) => b());
625
625
  });
626
626
  }, { flush: "post" });
627
627
  }
628
- const $e = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, ke = "__vueuse_ssr_handlers__", So = /* @__PURE__ */ Eo();
629
- function Eo() {
630
- return ke in $e || ($e[ke] = $e[ke] || {}), $e[ke];
628
+ const Ee = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, _e = "__vueuse_ssr_handlers__", bo = /* @__PURE__ */ wo();
629
+ function wo() {
630
+ return _e in Ee || (Ee[_e] = Ee[_e] || {}), Ee[_e];
631
631
  }
632
- function _o(t, e) {
633
- return So[t] || e;
632
+ function So(t, e) {
633
+ return bo[t] || e;
634
634
  }
635
- function $o(t) {
635
+ function Eo(t) {
636
636
  return t == null ? "any" : t instanceof Set ? "set" : t instanceof Map ? "map" : t instanceof Date ? "date" : typeof t == "boolean" ? "boolean" : typeof t == "string" ? "string" : typeof t == "object" ? "object" : Number.isNaN(t) ? "any" : "number";
637
637
  }
638
- const ko = {
638
+ const _o = {
639
639
  boolean: {
640
640
  read: (t) => t === "true",
641
641
  write: (t) => String(t)
@@ -668,101 +668,101 @@ const ko = {
668
668
  read: (t) => new Date(t),
669
669
  write: (t) => t.toISOString()
670
670
  }
671
- }, dt = "vueuse-storage";
672
- function No(t, e, o, n = {}) {
673
- var a;
674
- const { flush: s = "pre", deep: r = !0, listenToStorageChanges: u = !0, writeDefaults: i = !0, mergeDefaults: c = !1, shallow: p, window: y = Ie, eventFilter: h, onError: O = (k) => {
671
+ }, lt = "vueuse-storage";
672
+ function ko(t, e, o, n = {}) {
673
+ var r;
674
+ const { flush: i = "pre", deep: a = !0, listenToStorageChanges: u = !0, writeDefaults: c = !0, mergeDefaults: f = !1, shallow: p, window: b = Re, eventFilter: h, onError: _ = (k) => {
675
675
  console.error(k);
676
- }, initOnMounted: _ } = n, D = (p ? _e : A)(e), V = x(() => Q(t));
676
+ }, initOnMounted: m } = n, O = (p ? Se : C)(e), R = I(() => Q(t));
677
677
  if (!o) try {
678
- o = _o("getDefaultStorage", () => Ie?.localStorage)();
678
+ o = So("getDefaultStorage", () => Re?.localStorage)();
679
679
  } catch (k) {
680
- O(k);
680
+ _(k);
681
681
  }
682
- if (!o) return D;
683
- const M = Q(e), P = $o(M), U = (a = n.serializer) !== null && a !== void 0 ? a : ko[P], { pause: q, resume: K } = mo(D, (k) => g(k), {
684
- flush: s,
685
- deep: r,
682
+ if (!o) return O;
683
+ const x = Q(e), H = Eo(x), U = (r = n.serializer) !== null && r !== void 0 ? r : _o[H], { pause: K, resume: G } = vo(O, (k) => v(k), {
684
+ flush: i,
685
+ deep: a,
686
686
  eventFilter: h
687
687
  });
688
- H(V, () => C(), { flush: s });
688
+ L(R, () => $(), { flush: i });
689
689
  let z = !1;
690
- const $ = (k) => {
691
- _ && !z || C(k);
692
- }, te = (k) => {
693
- _ && !z || B(k);
690
+ const E = (k) => {
691
+ m && !z || $(k);
692
+ }, Y = (k) => {
693
+ m && !z || M(k);
694
694
  };
695
- y && u && (o instanceof Storage ? ut(y, "storage", $, { passive: !0 }) : ut(y, dt, te)), _ ? yo(() => {
696
- z = !0, C();
697
- }) : C();
698
- function W(k, I) {
699
- if (y) {
700
- const L = {
701
- key: V.value,
695
+ b && u && (o instanceof Storage ? it(b, "storage", E, { passive: !0 }) : it(b, lt, Y)), m ? go(() => {
696
+ z = !0, $();
697
+ }) : $();
698
+ function B(k, T) {
699
+ if (b) {
700
+ const F = {
701
+ key: R.value,
702
702
  oldValue: k,
703
- newValue: I,
703
+ newValue: T,
704
704
  storageArea: o
705
705
  };
706
- y.dispatchEvent(o instanceof Storage ? new StorageEvent("storage", L) : new CustomEvent(dt, { detail: L }));
706
+ b.dispatchEvent(o instanceof Storage ? new StorageEvent("storage", F) : new CustomEvent(lt, { detail: F }));
707
707
  }
708
708
  }
709
- function g(k) {
709
+ function v(k) {
710
710
  try {
711
- const I = o.getItem(V.value);
711
+ const T = o.getItem(R.value);
712
712
  if (k == null)
713
- W(I, null), o.removeItem(V.value);
713
+ B(T, null), o.removeItem(R.value);
714
714
  else {
715
- const L = U.write(k);
716
- I !== L && (o.setItem(V.value, L), W(I, L));
715
+ const F = U.write(k);
716
+ T !== F && (o.setItem(R.value, F), B(T, F));
717
717
  }
718
- } catch (I) {
719
- O(I);
718
+ } catch (T) {
719
+ _(T);
720
720
  }
721
721
  }
722
- function m(k) {
723
- const I = k ? k.newValue : o.getItem(V.value);
724
- if (I == null)
725
- return i && M != null && o.setItem(V.value, U.write(M)), M;
726
- if (!k && c) {
727
- const L = U.read(I);
728
- return typeof c == "function" ? c(L, M) : P === "object" && !Array.isArray(L) ? {
729
- ...M,
730
- ...L
731
- } : L;
732
- } else return typeof I != "string" ? I : U.read(I);
733
- }
734
- function C(k) {
722
+ function g(k) {
723
+ const T = k ? k.newValue : o.getItem(R.value);
724
+ if (T == null)
725
+ return c && x != null && o.setItem(R.value, U.write(x)), x;
726
+ if (!k && f) {
727
+ const F = U.read(T);
728
+ return typeof f == "function" ? f(F, x) : H === "object" && !Array.isArray(F) ? {
729
+ ...x,
730
+ ...F
731
+ } : F;
732
+ } else return typeof T != "string" ? T : U.read(T);
733
+ }
734
+ function $(k) {
735
735
  if (!(k && k.storageArea !== o)) {
736
736
  if (k && k.key == null) {
737
- D.value = M;
737
+ O.value = x;
738
738
  return;
739
739
  }
740
- if (!(k && k.key !== V.value)) {
741
- q();
740
+ if (!(k && k.key !== R.value)) {
741
+ K();
742
742
  try {
743
- const I = U.write(D.value);
744
- (k === void 0 || k?.newValue !== I) && (D.value = m(k));
745
- } catch (I) {
746
- O(I);
743
+ const T = U.write(O.value);
744
+ (k === void 0 || k?.newValue !== T) && (O.value = g(k));
745
+ } catch (T) {
746
+ _(T);
747
747
  } finally {
748
- k ? se(K) : K();
748
+ k ? ae(G) : G();
749
749
  }
750
750
  }
751
751
  }
752
752
  }
753
- function B(k) {
754
- C(k.detail);
753
+ function M(k) {
754
+ $(k.detail);
755
755
  }
756
- return D;
756
+ return O;
757
757
  }
758
- function Oo(t, e, o = {}) {
759
- const { window: n = Ie } = o;
760
- return No(t, e, n?.localStorage, o);
758
+ function Do(t, e, o = {}) {
759
+ const { window: n = Re } = o;
760
+ return ko(t, e, n?.localStorage, o);
761
761
  }
762
- function Be() {
762
+ function Fe() {
763
763
  return typeof crypto < "u" && crypto.randomUUID ? crypto.randomUUID() : `${Date.now()}-${Math.random().toString(36).substring(2, 9)}`;
764
764
  }
765
- function Ne(t) {
765
+ function ke(t) {
766
766
  const e = {
767
767
  type: t.type,
768
768
  clientId: t.clientId,
@@ -776,7 +776,7 @@ function Ne(t) {
776
776
  timestamp: o.timestamp.toISOString()
777
777
  }))), e;
778
778
  }
779
- function Do(t) {
779
+ function Oo(t) {
780
780
  const e = {
781
781
  type: t.type,
782
782
  clientId: t.clientId,
@@ -790,249 +790,249 @@ function Do(t) {
790
790
  timestamp: new Date(o.timestamp)
791
791
  }))), e;
792
792
  }
793
- const Dt = /* @__PURE__ */ ro("hst-operation-log", () => {
794
- const t = A({
793
+ const Dt = /* @__PURE__ */ no("hst-operation-log", () => {
794
+ const t = C({
795
795
  maxOperations: 100,
796
796
  enableCrossTabSync: !0,
797
797
  autoSyncInterval: 3e4,
798
798
  enablePersistence: !1,
799
799
  persistenceKeyPrefix: "stonecrop-ops"
800
- }), e = A([]), o = A(-1), n = A(Be()), a = A(!1), s = A([]), r = A(null), u = x(() => o.value < 0 ? !1 : e.value[o.value]?.reversible ?? !1), i = x(() => o.value < e.value.length - 1), c = x(() => {
801
- let f = 0;
802
- for (let v = o.value; v >= 0 && e.value[v]?.reversible; v--)
803
- f++;
804
- return f;
805
- }), p = x(() => e.value.length - 1 - o.value), y = x(() => ({
800
+ }), e = C([]), o = C(-1), n = C(Fe()), r = C(!1), i = C([]), a = C(null), u = I(() => o.value < 0 ? !1 : e.value[o.value]?.reversible ?? !1), c = I(() => o.value < e.value.length - 1), f = I(() => {
801
+ let d = 0;
802
+ for (let s = o.value; s >= 0 && e.value[s]?.reversible; s--)
803
+ d++;
804
+ return d;
805
+ }), p = I(() => e.value.length - 1 - o.value), b = I(() => ({
806
806
  canUndo: u.value,
807
- canRedo: i.value,
808
- undoCount: c.value,
807
+ canRedo: c.value,
808
+ undoCount: f.value,
809
809
  redoCount: p.value,
810
810
  currentIndex: o.value
811
811
  }));
812
- function h(f) {
813
- t.value = { ...t.value, ...f }, t.value.enablePersistence && (E(), S()), t.value.enableCrossTabSync && m();
812
+ function h(d) {
813
+ t.value = { ...t.value, ...d }, t.value.enablePersistence && (w(), S()), t.value.enableCrossTabSync && g();
814
814
  }
815
- function O(f, v = "user") {
816
- const b = {
817
- ...f,
818
- id: Be(),
815
+ function _(d, s = "user") {
816
+ const l = {
817
+ ...d,
818
+ id: Fe(),
819
819
  timestamp: /* @__PURE__ */ new Date(),
820
- source: v,
820
+ source: s,
821
821
  userId: t.value.userId
822
822
  };
823
- if (t.value.operationFilter && !t.value.operationFilter(b))
824
- return b.id;
825
- if (a.value)
826
- return s.value.push(b), b.id;
827
- if (o.value < e.value.length - 1 && (e.value = e.value.slice(0, o.value + 1)), e.value.push(b), o.value++, t.value.maxOperations && e.value.length > t.value.maxOperations) {
828
- const l = e.value.length - t.value.maxOperations;
829
- e.value = e.value.slice(l), o.value -= l;
823
+ if (t.value.operationFilter && !t.value.operationFilter(l))
824
+ return l.id;
825
+ if (r.value)
826
+ return i.value.push(l), l.id;
827
+ if (o.value < e.value.length - 1 && (e.value = e.value.slice(0, o.value + 1)), e.value.push(l), o.value++, t.value.maxOperations && e.value.length > t.value.maxOperations) {
828
+ const y = e.value.length - t.value.maxOperations;
829
+ e.value = e.value.slice(y), o.value -= y;
830
830
  }
831
- return t.value.enableCrossTabSync && C(b), b.id;
831
+ return t.value.enableCrossTabSync && $(l), l.id;
832
832
  }
833
- function _() {
834
- a.value = !0, s.value = [], r.value = Be();
833
+ function m() {
834
+ r.value = !0, i.value = [], a.value = Fe();
835
835
  }
836
- function D(f) {
837
- if (!a.value || s.value.length === 0)
838
- return a.value = !1, s.value = [], r.value = null, null;
839
- const v = r.value, b = s.value.every((w) => w.reversible), l = {
840
- id: v,
836
+ function O(d) {
837
+ if (!r.value || i.value.length === 0)
838
+ return r.value = !1, i.value = [], a.value = null, null;
839
+ const s = a.value, l = i.value.every((j) => j.reversible), y = {
840
+ id: s,
841
841
  type: "batch",
842
842
  path: "",
843
843
  // Batch doesn't have a single path
844
844
  fieldname: "",
845
845
  beforeValue: null,
846
846
  afterValue: null,
847
- doctype: s.value[0]?.doctype || "",
847
+ doctype: i.value[0]?.doctype || "",
848
848
  timestamp: /* @__PURE__ */ new Date(),
849
849
  source: "user",
850
- reversible: b,
851
- irreversibleReason: b ? void 0 : "Contains irreversible operations",
852
- childOperationIds: s.value.map((w) => w.id),
853
- metadata: { description: f }
850
+ reversible: l,
851
+ irreversibleReason: l ? void 0 : "Contains irreversible operations",
852
+ childOperationIds: i.value.map((j) => j.id),
853
+ metadata: { description: d }
854
854
  };
855
- s.value.forEach((w) => {
856
- w.parentOperationId = v;
857
- }), e.value.push(...s.value, l), o.value = e.value.length - 1, t.value.enableCrossTabSync && B(s.value, l);
858
- const d = v;
859
- return a.value = !1, s.value = [], r.value = null, d;
855
+ i.value.forEach((j) => {
856
+ j.parentOperationId = s;
857
+ }), e.value.push(...i.value, y), o.value = e.value.length - 1, t.value.enableCrossTabSync && M(i.value, y);
858
+ const N = s;
859
+ return r.value = !1, i.value = [], a.value = null, N;
860
860
  }
861
- function V() {
862
- a.value = !1, s.value = [], r.value = null;
861
+ function R() {
862
+ r.value = !1, i.value = [], a.value = null;
863
863
  }
864
- function M(f) {
864
+ function x(d) {
865
865
  if (!u.value) return !1;
866
- const v = e.value[o.value];
867
- if (!v.reversible)
868
- return typeof console < "u" && v.irreversibleReason && console.warn("Cannot undo irreversible operation:", v.irreversibleReason), !1;
866
+ const s = e.value[o.value];
867
+ if (!s.reversible)
868
+ return typeof console < "u" && s.irreversibleReason && console.warn("Cannot undo irreversible operation:", s.irreversibleReason), !1;
869
869
  try {
870
- if (v.type === "batch" && v.childOperationIds)
871
- for (let b = v.childOperationIds.length - 1; b >= 0; b--) {
872
- const l = v.childOperationIds[b], d = e.value.find((w) => w.id === l);
873
- d && U(d, f);
870
+ if (s.type === "batch" && s.childOperationIds)
871
+ for (let l = s.childOperationIds.length - 1; l >= 0; l--) {
872
+ const y = s.childOperationIds[l], N = e.value.find((j) => j.id === y);
873
+ N && U(N, d);
874
874
  }
875
875
  else
876
- U(v, f);
877
- return o.value--, t.value.enableCrossTabSync && k(v), !0;
878
- } catch (b) {
879
- return typeof console < "u" && console.error("Undo failed:", b), !1;
876
+ U(s, d);
877
+ return o.value--, t.value.enableCrossTabSync && k(s), !0;
878
+ } catch (l) {
879
+ return typeof console < "u" && console.error("Undo failed:", l), !1;
880
880
  }
881
881
  }
882
- function P(f) {
883
- if (!i.value) return !1;
884
- const v = e.value[o.value + 1];
882
+ function H(d) {
883
+ if (!c.value) return !1;
884
+ const s = e.value[o.value + 1];
885
885
  try {
886
- if (v.type === "batch" && v.childOperationIds)
887
- for (const b of v.childOperationIds) {
888
- const l = e.value.find((d) => d.id === b);
889
- l && q(l, f);
886
+ if (s.type === "batch" && s.childOperationIds)
887
+ for (const l of s.childOperationIds) {
888
+ const y = e.value.find((N) => N.id === l);
889
+ y && K(y, d);
890
890
  }
891
891
  else
892
- q(v, f);
893
- return o.value++, t.value.enableCrossTabSync && I(v), !0;
894
- } catch (b) {
895
- return typeof console < "u" && console.error("Redo failed:", b), !1;
892
+ K(s, d);
893
+ return o.value++, t.value.enableCrossTabSync && T(s), !0;
894
+ } catch (l) {
895
+ return typeof console < "u" && console.error("Redo failed:", l), !1;
896
896
  }
897
897
  }
898
- function U(f, v) {
899
- (f.type === "set" || f.type === "delete") && v && typeof v.set == "function" && v.set(f.path, f.beforeValue, "undo");
898
+ function U(d, s) {
899
+ (d.type === "set" || d.type === "delete") && s && typeof s.set == "function" && s.set(d.path, d.beforeValue, "undo");
900
900
  }
901
- function q(f, v) {
902
- (f.type === "set" || f.type === "delete") && v && typeof v.set == "function" && v.set(f.path, f.afterValue, "redo");
901
+ function K(d, s) {
902
+ (d.type === "set" || d.type === "delete") && s && typeof s.set == "function" && s.set(d.path, d.afterValue, "redo");
903
903
  }
904
- function K() {
905
- const f = e.value.filter((b) => b.reversible).length, v = e.value.map((b) => b.timestamp);
904
+ function G() {
905
+ const d = e.value.filter((l) => l.reversible).length, s = e.value.map((l) => l.timestamp);
906
906
  return {
907
907
  operations: [...e.value],
908
908
  currentIndex: o.value,
909
909
  totalOperations: e.value.length,
910
- reversibleOperations: f,
911
- irreversibleOperations: e.value.length - f,
912
- oldestOperation: v.length > 0 ? new Date(Math.min(...v.map((b) => b.getTime()))) : void 0,
913
- newestOperation: v.length > 0 ? new Date(Math.max(...v.map((b) => b.getTime()))) : void 0
910
+ reversibleOperations: d,
911
+ irreversibleOperations: e.value.length - d,
912
+ oldestOperation: s.length > 0 ? new Date(Math.min(...s.map((l) => l.getTime()))) : void 0,
913
+ newestOperation: s.length > 0 ? new Date(Math.max(...s.map((l) => l.getTime()))) : void 0
914
914
  };
915
915
  }
916
916
  function z() {
917
917
  e.value = [], o.value = -1;
918
918
  }
919
- function $(f, v) {
920
- return e.value.filter((b) => b.doctype === f && (v === void 0 || b.recordId === v));
919
+ function E(d, s) {
920
+ return e.value.filter((l) => l.doctype === d && (s === void 0 || l.recordId === s));
921
921
  }
922
- function te(f, v) {
923
- const b = e.value.find((l) => l.id === f);
924
- b && (b.reversible = !1, b.irreversibleReason = v);
922
+ function Y(d, s) {
923
+ const l = e.value.find((y) => y.id === d);
924
+ l && (l.reversible = !1, l.irreversibleReason = s);
925
925
  }
926
- function W(f, v, b, l = "success", d) {
927
- const w = {
926
+ function B(d, s, l, y = "success", N) {
927
+ const j = {
928
928
  type: "action",
929
- path: b && b.length > 0 ? `${f}.${b[0]}` : f,
929
+ path: l && l.length > 0 ? `${d}.${l[0]}` : d,
930
930
  fieldname: "",
931
931
  beforeValue: null,
932
932
  afterValue: null,
933
- doctype: f,
934
- recordId: b && b.length > 0 ? b[0] : void 0,
933
+ doctype: d,
934
+ recordId: l && l.length > 0 ? l[0] : void 0,
935
935
  reversible: !1,
936
936
  // Actions are typically not reversible
937
- actionName: v,
938
- actionRecordIds: b,
939
- actionResult: l,
940
- actionError: d
937
+ actionName: s,
938
+ actionRecordIds: l,
939
+ actionResult: y,
940
+ actionError: N
941
941
  };
942
- return O(w);
943
- }
944
- let g = null;
945
- function m() {
946
- typeof window > "u" || !window.BroadcastChannel || (g = new BroadcastChannel("stonecrop-operation-log"), g.addEventListener("message", (f) => {
947
- const v = f.data;
948
- if (!v || typeof v != "object") return;
949
- const b = Do(v);
950
- b.clientId !== n.value && (b.type === "operation" && b.operation ? (e.value.push({ ...b.operation, source: "sync" }), o.value = e.value.length - 1) : b.type === "operation" && b.operations && (e.value.push(...b.operations.map((l) => ({ ...l, source: "sync" }))), o.value = e.value.length - 1));
942
+ return _(j);
943
+ }
944
+ let v = null;
945
+ function g() {
946
+ typeof window > "u" || !window.BroadcastChannel || (v = new BroadcastChannel("stonecrop-operation-log"), v.addEventListener("message", (d) => {
947
+ const s = d.data;
948
+ if (!s || typeof s != "object") return;
949
+ const l = Oo(s);
950
+ l.clientId !== n.value && (l.type === "operation" && l.operation ? (e.value.push({ ...l.operation, source: "sync" }), o.value = e.value.length - 1) : l.type === "operation" && l.operations && (e.value.push(...l.operations.map((y) => ({ ...y, source: "sync" }))), o.value = e.value.length - 1));
951
951
  }));
952
952
  }
953
- function C(f) {
954
- if (!g) return;
955
- const v = {
953
+ function $(d) {
954
+ if (!v) return;
955
+ const s = {
956
956
  type: "operation",
957
- operation: f,
957
+ operation: d,
958
958
  clientId: n.value,
959
959
  timestamp: /* @__PURE__ */ new Date()
960
960
  };
961
- g.postMessage(Ne(v));
961
+ v.postMessage(ke(s));
962
962
  }
963
- function B(f, v) {
964
- if (!g) return;
965
- const b = {
963
+ function M(d, s) {
964
+ if (!v) return;
965
+ const l = {
966
966
  type: "operation",
967
- operations: [...f, v],
967
+ operations: [...d, s],
968
968
  clientId: n.value,
969
969
  timestamp: /* @__PURE__ */ new Date()
970
970
  };
971
- g.postMessage(Ne(b));
971
+ v.postMessage(ke(l));
972
972
  }
973
- function k(f) {
974
- if (!g) return;
975
- const v = {
973
+ function k(d) {
974
+ if (!v) return;
975
+ const s = {
976
976
  type: "undo",
977
- operation: f,
977
+ operation: d,
978
978
  clientId: n.value,
979
979
  timestamp: /* @__PURE__ */ new Date()
980
980
  };
981
- g.postMessage(Ne(v));
981
+ v.postMessage(ke(s));
982
982
  }
983
- function I(f) {
984
- if (!g) return;
985
- const v = {
983
+ function T(d) {
984
+ if (!v) return;
985
+ const s = {
986
986
  type: "redo",
987
- operation: f,
987
+ operation: d,
988
988
  clientId: n.value,
989
989
  timestamp: /* @__PURE__ */ new Date()
990
990
  };
991
- g.postMessage(Ne(v));
991
+ v.postMessage(ke(s));
992
992
  }
993
- const L = Oo("stonecrop-ops-operations", null, {
993
+ const F = Do("stonecrop-ops-operations", null, {
994
994
  serializer: {
995
- read: (f) => {
995
+ read: (d) => {
996
996
  try {
997
- return JSON.parse(f);
997
+ return JSON.parse(d);
998
998
  } catch {
999
999
  return null;
1000
1000
  }
1001
1001
  },
1002
- write: (f) => f ? JSON.stringify(f) : ""
1002
+ write: (d) => d ? JSON.stringify(d) : ""
1003
1003
  }
1004
1004
  });
1005
- function E() {
1005
+ function w() {
1006
1006
  if (!(typeof window > "u"))
1007
1007
  try {
1008
- const f = L.value;
1009
- f && Array.isArray(f.operations) && (e.value = f.operations.map((v) => ({
1010
- ...v,
1011
- timestamp: new Date(v.timestamp)
1012
- })), o.value = f.currentIndex ?? -1);
1013
- } catch (f) {
1014
- typeof console < "u" && console.error("Failed to load operations from persistence:", f);
1008
+ const d = F.value;
1009
+ d && Array.isArray(d.operations) && (e.value = d.operations.map((s) => ({
1010
+ ...s,
1011
+ timestamp: new Date(s.timestamp)
1012
+ })), o.value = d.currentIndex ?? -1);
1013
+ } catch (d) {
1014
+ typeof console < "u" && console.error("Failed to load operations from persistence:", d);
1015
1015
  }
1016
1016
  }
1017
- function N() {
1017
+ function D() {
1018
1018
  if (!(typeof window > "u"))
1019
1019
  try {
1020
- L.value = {
1021
- operations: e.value.map((f) => ({
1022
- ...f,
1023
- timestamp: f.timestamp.toISOString()
1020
+ F.value = {
1021
+ operations: e.value.map((d) => ({
1022
+ ...d,
1023
+ timestamp: d.timestamp.toISOString()
1024
1024
  })),
1025
1025
  currentIndex: o.value
1026
1026
  };
1027
- } catch (f) {
1028
- typeof console < "u" && console.error("Failed to save operations to persistence:", f);
1027
+ } catch (d) {
1028
+ typeof console < "u" && console.error("Failed to save operations to persistence:", d);
1029
1029
  }
1030
1030
  }
1031
1031
  function S() {
1032
- H(
1032
+ L(
1033
1033
  [e, o],
1034
1034
  () => {
1035
- t.value.enablePersistence && N();
1035
+ t.value.enablePersistence && D();
1036
1036
  },
1037
1037
  { deep: !0 }
1038
1038
  );
@@ -1043,28 +1043,28 @@ const Dt = /* @__PURE__ */ ro("hst-operation-log", () => {
1043
1043
  currentIndex: o,
1044
1044
  config: t,
1045
1045
  clientId: n,
1046
- undoRedoState: y,
1046
+ undoRedoState: b,
1047
1047
  // Computed
1048
1048
  canUndo: u,
1049
- canRedo: i,
1050
- undoCount: c,
1049
+ canRedo: c,
1050
+ undoCount: f,
1051
1051
  redoCount: p,
1052
1052
  // Methods
1053
1053
  configure: h,
1054
- addOperation: O,
1055
- startBatch: _,
1056
- commitBatch: D,
1057
- cancelBatch: V,
1058
- undo: M,
1059
- redo: P,
1054
+ addOperation: _,
1055
+ startBatch: m,
1056
+ commitBatch: O,
1057
+ cancelBatch: R,
1058
+ undo: x,
1059
+ redo: H,
1060
1060
  clear: z,
1061
- getOperationsFor: $,
1062
- getSnapshot: K,
1063
- markIrreversible: te,
1064
- logAction: W
1061
+ getOperationsFor: E,
1062
+ getSnapshot: G,
1063
+ markIrreversible: Y,
1064
+ logAction: B
1065
1065
  };
1066
1066
  });
1067
- class ye {
1067
+ class ge {
1068
1068
  /**
1069
1069
  * The root FieldTriggerEngine instance
1070
1070
  */
@@ -1085,9 +1085,9 @@ class ye {
1085
1085
  * @param options - Configuration options for the field trigger engine
1086
1086
  */
1087
1087
  constructor(e = {}) {
1088
- if (ye._root)
1089
- return ye._root;
1090
- ye._root = this, this.options = {
1088
+ if (ge._root)
1089
+ return ge._root;
1090
+ ge._root = this, this.options = {
1091
1091
  defaultTimeout: e.defaultTimeout ?? 5e3,
1092
1092
  debug: e.debug ?? !1,
1093
1093
  enableRollback: e.enableRollback ?? !0,
@@ -1133,25 +1133,25 @@ class ye {
1133
1133
  */
1134
1134
  registerDoctypeActions(e, o) {
1135
1135
  if (!o) return;
1136
- const n = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Map();
1136
+ const n = /* @__PURE__ */ new Map(), r = /* @__PURE__ */ new Map();
1137
1137
  if (typeof o.entrySeq == "function")
1138
- o.entrySeq().forEach(([s, r]) => {
1139
- this.categorizeAction(s, r, n, a);
1138
+ o.entrySeq().forEach(([i, a]) => {
1139
+ this.categorizeAction(i, a, n, r);
1140
1140
  });
1141
1141
  else if (o instanceof Map)
1142
- for (const [s, r] of o)
1143
- this.categorizeAction(s, r, n, a);
1144
- else o && typeof o == "object" && Object.entries(o).forEach(([s, r]) => {
1145
- this.categorizeAction(s, r, n, a);
1142
+ for (const [i, a] of o)
1143
+ this.categorizeAction(i, a, n, r);
1144
+ else o && typeof o == "object" && Object.entries(o).forEach(([i, a]) => {
1145
+ this.categorizeAction(i, a, n, r);
1146
1146
  });
1147
- this.doctypeActions.set(e, n), this.doctypeTransitions.set(e, a);
1147
+ this.doctypeActions.set(e, n), this.doctypeTransitions.set(e, r);
1148
1148
  }
1149
1149
  /**
1150
1150
  * Categorize an action as either a field trigger or XState transition
1151
1151
  * Uses uppercase convention: UPPERCASE = transition, lowercase/mixed = field trigger
1152
1152
  */
1153
- categorizeAction(e, o, n, a) {
1154
- this.isTransitionKey(e) ? a.set(e, o) : n.set(e, o);
1153
+ categorizeAction(e, o, n, r) {
1154
+ this.isTransitionKey(e) ? r.set(e, o) : n.set(e, o);
1155
1155
  }
1156
1156
  /**
1157
1157
  * Determine if a key represents an XState transition
@@ -1166,8 +1166,8 @@ class ye {
1166
1166
  * @param options - Execution options (timeout and enableRollback)
1167
1167
  */
1168
1168
  async executeFieldTriggers(e, o = {}) {
1169
- const { doctype: n, fieldname: a } = e, s = this.findFieldTriggers(n, a);
1170
- if (s.length === 0)
1169
+ const { doctype: n, fieldname: r } = e, i = this.findFieldTriggers(n, r);
1170
+ if (i.length === 0)
1171
1171
  return {
1172
1172
  path: e.path,
1173
1173
  actionResults: [],
@@ -1176,48 +1176,48 @@ class ye {
1176
1176
  stoppedOnError: !1,
1177
1177
  rolledBack: !1
1178
1178
  };
1179
- const r = performance.now(), u = [];
1180
- let i = !1, c = !1, p;
1181
- const y = this.getFieldRollback(n, a), h = o.enableRollback ?? y ?? this.options.enableRollback;
1179
+ const a = performance.now(), u = [];
1180
+ let c = !1, f = !1, p;
1181
+ const b = this.getFieldRollback(n, r), h = o.enableRollback ?? b ?? this.options.enableRollback;
1182
1182
  h && e.store && (p = this.captureSnapshot(e));
1183
- for (const D of s)
1183
+ for (const O of i)
1184
1184
  try {
1185
- const V = await this.executeAction(D, e, o.timeout);
1186
- if (u.push(V), !V.success) {
1187
- i = !0;
1185
+ const R = await this.executeAction(O, e, o.timeout);
1186
+ if (u.push(R), !R.success) {
1187
+ c = !0;
1188
1188
  break;
1189
1189
  }
1190
- } catch (V) {
1191
- const M = {
1190
+ } catch (R) {
1191
+ const x = {
1192
1192
  success: !1,
1193
- error: V instanceof Error ? V : new Error(String(V)),
1193
+ error: R instanceof Error ? R : new Error(String(R)),
1194
1194
  executionTime: 0,
1195
- action: D
1195
+ action: O
1196
1196
  };
1197
- u.push(M), i = !0;
1197
+ u.push(x), c = !0;
1198
1198
  break;
1199
1199
  }
1200
- if (h && i && p && e.store)
1200
+ if (h && c && p && e.store)
1201
1201
  try {
1202
- this.restoreSnapshot(e, p), c = !0;
1203
- } catch (D) {
1204
- console.error("[FieldTriggers] Rollback failed:", D);
1202
+ this.restoreSnapshot(e, p), f = !0;
1203
+ } catch (O) {
1204
+ console.error("[FieldTriggers] Rollback failed:", O);
1205
1205
  }
1206
- const O = performance.now() - r, _ = u.filter((D) => !D.success);
1207
- if (_.length > 0 && this.options.errorHandler)
1208
- for (const D of _)
1206
+ const _ = performance.now() - a, m = u.filter((O) => !O.success);
1207
+ if (m.length > 0 && this.options.errorHandler)
1208
+ for (const O of m)
1209
1209
  try {
1210
- this.options.errorHandler(D.error, e, D.action);
1211
- } catch (V) {
1212
- console.error("[FieldTriggers] Error in global error handler:", V);
1210
+ this.options.errorHandler(O.error, e, O.action);
1211
+ } catch (R) {
1212
+ console.error("[FieldTriggers] Error in global error handler:", R);
1213
1213
  }
1214
1214
  return {
1215
1215
  path: e.path,
1216
1216
  actionResults: u,
1217
- totalExecutionTime: O,
1218
- allSucceeded: u.every((D) => D.success),
1219
- stoppedOnError: i,
1220
- rolledBack: c,
1217
+ totalExecutionTime: _,
1218
+ allSucceeded: u.every((O) => O.success),
1219
+ stoppedOnError: c,
1220
+ rolledBack: f,
1221
1221
  snapshot: this.options.debug && h ? p : void 0
1222
1222
  // Only include snapshot in debug mode if rollback is enabled
1223
1223
  };
@@ -1229,35 +1229,35 @@ class ye {
1229
1229
  * @param options - Execution options (timeout)
1230
1230
  */
1231
1231
  async executeTransitionActions(e, o = {}) {
1232
- const { doctype: n, transition: a } = e, s = this.findTransitionActions(n, a);
1233
- if (s.length === 0)
1232
+ const { doctype: n, transition: r } = e, i = this.findTransitionActions(n, r);
1233
+ if (i.length === 0)
1234
1234
  return [];
1235
- const r = [];
1236
- for (const i of s)
1235
+ const a = [];
1236
+ for (const c of i)
1237
1237
  try {
1238
- const c = await this.executeTransitionAction(i, e, o.timeout);
1239
- if (r.push(c), !c.success)
1238
+ const f = await this.executeTransitionAction(c, e, o.timeout);
1239
+ if (a.push(f), !f.success)
1240
1240
  break;
1241
- } catch (c) {
1241
+ } catch (f) {
1242
1242
  const p = {
1243
1243
  success: !1,
1244
- error: c instanceof Error ? c : new Error(String(c)),
1244
+ error: f instanceof Error ? f : new Error(String(f)),
1245
1245
  executionTime: 0,
1246
- action: i,
1247
- transition: a
1246
+ action: c,
1247
+ transition: r
1248
1248
  };
1249
- r.push(p);
1249
+ a.push(p);
1250
1250
  break;
1251
1251
  }
1252
- const u = r.filter((i) => !i.success);
1252
+ const u = a.filter((c) => !c.success);
1253
1253
  if (u.length > 0 && this.options.errorHandler)
1254
- for (const i of u)
1254
+ for (const c of u)
1255
1255
  try {
1256
- this.options.errorHandler(i.error, e, i.action);
1257
- } catch (c) {
1258
- console.error("[FieldTriggers] Error in global error handler:", c);
1256
+ this.options.errorHandler(c.error, e, c.action);
1257
+ } catch (f) {
1258
+ console.error("[FieldTriggers] Error in global error handler:", f);
1259
1259
  }
1260
- return r;
1260
+ return a;
1261
1261
  }
1262
1262
  /**
1263
1263
  * Find transition actions for a specific doctype and transition
@@ -1270,26 +1270,26 @@ class ye {
1270
1270
  * Execute a single transition action by name
1271
1271
  */
1272
1272
  async executeTransitionAction(e, o, n) {
1273
- const a = performance.now(), s = n ?? this.options.defaultTimeout;
1273
+ const r = performance.now(), i = n ?? this.options.defaultTimeout;
1274
1274
  try {
1275
- let r = this.globalTransitionActions.get(e);
1276
- if (!r) {
1275
+ let a = this.globalTransitionActions.get(e);
1276
+ if (!a) {
1277
1277
  const u = this.globalActions.get(e);
1278
- u && (r = u);
1278
+ u && (a = u);
1279
1279
  }
1280
- if (!r)
1280
+ if (!a)
1281
1281
  throw new Error(`Transition action "${e}" not found in registry`);
1282
- return await this.executeWithTimeout(r, o, s), {
1282
+ return await this.executeWithTimeout(a, o, i), {
1283
1283
  success: !0,
1284
- executionTime: performance.now() - a,
1284
+ executionTime: performance.now() - r,
1285
1285
  action: e,
1286
1286
  transition: o.transition
1287
1287
  };
1288
- } catch (r) {
1289
- const u = performance.now() - a;
1288
+ } catch (a) {
1289
+ const u = performance.now() - r;
1290
1290
  return {
1291
1291
  success: !1,
1292
- error: r instanceof Error ? r : new Error(String(r)),
1292
+ error: a instanceof Error ? a : new Error(String(a)),
1293
1293
  executionTime: u,
1294
1294
  action: e,
1295
1295
  transition: o.transition
@@ -1303,10 +1303,10 @@ class ye {
1303
1303
  findFieldTriggers(e, o) {
1304
1304
  const n = this.doctypeActions.get(e);
1305
1305
  if (!n) return [];
1306
- const a = [];
1307
- for (const [s, r] of n)
1308
- this.isFieldTriggerKey(s, o) && a.push(...r);
1309
- return a;
1306
+ const r = [];
1307
+ for (const [i, a] of n)
1308
+ this.isFieldTriggerKey(i, o) && r.push(...a);
1309
+ return r;
1310
1310
  }
1311
1311
  /**
1312
1312
  * Determine if an action key represents a field trigger
@@ -1323,12 +1323,12 @@ class ye {
1323
1323
  * Supports wildcards (*) for dynamic segments
1324
1324
  */
1325
1325
  matchFieldPattern(e, o) {
1326
- const n = e.split("."), a = o.split(".");
1327
- if (n.length !== a.length)
1326
+ const n = e.split("."), r = o.split(".");
1327
+ if (n.length !== r.length)
1328
1328
  return !1;
1329
- for (let s = 0; s < n.length; s++) {
1330
- const r = n[s], u = a[s];
1331
- if (r !== "*" && r !== u)
1329
+ for (let i = 0; i < n.length; i++) {
1330
+ const a = n[i], u = r[i];
1331
+ if (a !== "*" && a !== u)
1332
1332
  return !1;
1333
1333
  }
1334
1334
  return !0;
@@ -1337,21 +1337,21 @@ class ye {
1337
1337
  * Execute a single action by name
1338
1338
  */
1339
1339
  async executeAction(e, o, n) {
1340
- const a = performance.now(), s = n ?? this.options.defaultTimeout;
1340
+ const r = performance.now(), i = n ?? this.options.defaultTimeout;
1341
1341
  try {
1342
- const r = this.globalActions.get(e);
1343
- if (!r)
1342
+ const a = this.globalActions.get(e);
1343
+ if (!a)
1344
1344
  throw new Error(`Action "${e}" not found in registry`);
1345
- return await this.executeWithTimeout(r, o, s), {
1345
+ return await this.executeWithTimeout(a, o, i), {
1346
1346
  success: !0,
1347
- executionTime: performance.now() - a,
1347
+ executionTime: performance.now() - r,
1348
1348
  action: e
1349
1349
  };
1350
- } catch (r) {
1351
- const u = performance.now() - a;
1350
+ } catch (a) {
1351
+ const u = performance.now() - r;
1352
1352
  return {
1353
1353
  success: !1,
1354
- error: r instanceof Error ? r : new Error(String(r)),
1354
+ error: a instanceof Error ? a : new Error(String(a)),
1355
1355
  executionTime: u,
1356
1356
  action: e
1357
1357
  };
@@ -1361,14 +1361,14 @@ class ye {
1361
1361
  * Execute a function with timeout
1362
1362
  */
1363
1363
  async executeWithTimeout(e, o, n) {
1364
- return new Promise((a, s) => {
1365
- const r = setTimeout(() => {
1366
- s(new Error(`Action timeout after ${n}ms`));
1364
+ return new Promise((r, i) => {
1365
+ const a = setTimeout(() => {
1366
+ i(new Error(`Action timeout after ${n}ms`));
1367
1367
  }, n);
1368
1368
  Promise.resolve(e(o)).then((u) => {
1369
- clearTimeout(r), a(u);
1369
+ clearTimeout(a), r(u);
1370
1370
  }).catch((u) => {
1371
- clearTimeout(r), s(u);
1371
+ clearTimeout(a), i(u);
1372
1372
  });
1373
1373
  });
1374
1374
  }
@@ -1400,24 +1400,24 @@ class ye {
1400
1400
  }
1401
1401
  }
1402
1402
  }
1403
- function pt(t) {
1404
- return new ye(t);
1403
+ function ct(t) {
1404
+ return new ge(t);
1405
1405
  }
1406
- function ft() {
1406
+ function ut() {
1407
1407
  try {
1408
1408
  return Dt();
1409
1409
  } catch {
1410
1410
  return null;
1411
1411
  }
1412
1412
  }
1413
- class ue {
1413
+ class ce {
1414
1414
  static instance;
1415
1415
  /**
1416
1416
  * Gets the singleton instance of HST
1417
1417
  * @returns The HST singleton instance
1418
1418
  */
1419
1419
  static getInstance() {
1420
- return ue.instance || (ue.instance = new ue()), ue.instance;
1420
+ return ce.instance || (ce.instance = new ce()), ce.instance;
1421
1421
  }
1422
1422
  /**
1423
1423
  * Gets the global registry instance
@@ -1451,23 +1451,23 @@ class ue {
1451
1451
  return o.registry[e];
1452
1452
  }
1453
1453
  }
1454
- class xe {
1454
+ class Ie {
1455
1455
  target;
1456
1456
  parentPath;
1457
1457
  rootNode;
1458
1458
  doctype;
1459
1459
  parentDoctype;
1460
1460
  hst;
1461
- constructor(e, o, n = "", a = null, s) {
1462
- return this.target = e, this.parentPath = n, this.rootNode = a || this, this.doctype = o, this.parentDoctype = s, this.hst = ue.getInstance(), new Proxy(this, {
1463
- get(r, u) {
1464
- if (u in r) return r[u];
1465
- const i = String(u);
1466
- return r.getNode(i);
1467
- },
1468
- set(r, u, i) {
1461
+ constructor(e, o, n = "", r = null, i) {
1462
+ return this.target = e, this.parentPath = n, this.rootNode = r || this, this.doctype = o, this.parentDoctype = i, this.hst = ce.getInstance(), new Proxy(this, {
1463
+ get(a, u) {
1464
+ if (u in a) return a[u];
1469
1465
  const c = String(u);
1470
- return r.set(c, i), !0;
1466
+ return a.getNode(c);
1467
+ },
1468
+ set(a, u, c) {
1469
+ const f = String(u);
1470
+ return a.set(f, c), !0;
1471
1471
  }
1472
1472
  });
1473
1473
  }
@@ -1476,25 +1476,25 @@ class xe {
1476
1476
  }
1477
1477
  // Method to get a tree-wrapped node for navigation
1478
1478
  getNode(e) {
1479
- const o = this.resolvePath(e), n = this.resolveValue(e), a = o.split(".");
1480
- let s = this.doctype;
1481
- return this.doctype === "StonecropStore" && a.length >= 1 && (s = a[0]), typeof n == "object" && n !== null && !this.isPrimitive(n) ? new xe(n, s, o, this.rootNode, this.parentDoctype) : new xe(n, s, o, this.rootNode, this.parentDoctype);
1479
+ const o = this.resolvePath(e), n = this.resolveValue(e), r = o.split(".");
1480
+ let i = this.doctype;
1481
+ return this.doctype === "StonecropStore" && r.length >= 1 && (i = r[0]), typeof n == "object" && n !== null && !this.isPrimitive(n) ? new Ie(n, i, o, this.rootNode, this.parentDoctype) : new Ie(n, i, o, this.rootNode, this.parentDoctype);
1482
1482
  }
1483
1483
  set(e, o, n = "user") {
1484
- const a = this.resolvePath(e), s = this.has(e) ? this.get(e) : void 0;
1484
+ const r = this.resolvePath(e), i = this.has(e) ? this.get(e) : void 0;
1485
1485
  if (n !== "undo" && n !== "redo") {
1486
- const r = ft();
1487
- if (r && typeof r.addOperation == "function") {
1488
- const u = a.split("."), i = this.doctype === "StonecropStore" && u.length >= 1 ? u[0] : this.doctype, c = u.length >= 2 ? u[1] : void 0, p = u.slice(2).join(".") || u[u.length - 1], y = o === void 0 && s !== void 0 ? "delete" : "set";
1489
- r.addOperation(
1486
+ const a = ut();
1487
+ if (a && typeof a.addOperation == "function") {
1488
+ const u = r.split("."), c = this.doctype === "StonecropStore" && u.length >= 1 ? u[0] : this.doctype, f = u.length >= 2 ? u[1] : void 0, p = u.slice(2).join(".") || u[u.length - 1], b = o === void 0 && i !== void 0 ? "delete" : "set";
1489
+ a.addOperation(
1490
1490
  {
1491
- type: y,
1492
- path: a,
1491
+ type: b,
1492
+ path: r,
1493
1493
  fieldname: p,
1494
- beforeValue: s,
1494
+ beforeValue: i,
1495
1495
  afterValue: o,
1496
- doctype: i,
1497
- recordId: c,
1496
+ doctype: c,
1497
+ recordId: f,
1498
1498
  reversible: !0
1499
1499
  // Default to reversible, can be changed by field triggers
1500
1500
  },
@@ -1502,7 +1502,7 @@ class xe {
1502
1502
  );
1503
1503
  }
1504
1504
  }
1505
- this.updateValue(e, o), this.triggerFieldActions(a, s, o);
1505
+ this.updateValue(e, o), this.triggerFieldActions(r, i, o);
1506
1506
  }
1507
1507
  has(e) {
1508
1508
  try {
@@ -1510,13 +1510,13 @@ class xe {
1510
1510
  return !0;
1511
1511
  const o = this.parsePath(e);
1512
1512
  let n = this.target;
1513
- for (let a = 0; a < o.length; a++) {
1514
- const s = o[a];
1513
+ for (let r = 0; r < o.length; r++) {
1514
+ const i = o[r];
1515
1515
  if (n == null)
1516
1516
  return !1;
1517
- if (a === o.length - 1)
1518
- return this.isImmutable(n) ? n.has(s) : this.isPiniaStore(n) && n.$state && s in n.$state || s in n;
1519
- n = this.getProperty(n, s);
1517
+ if (r === o.length - 1)
1518
+ return this.isImmutable(n) ? n.has(i) : this.isPiniaStore(n) && n.$state && i in n.$state || i in n;
1519
+ n = this.getProperty(n, i);
1520
1520
  }
1521
1521
  return !1;
1522
1522
  } catch {
@@ -1545,9 +1545,9 @@ class xe {
1545
1545
  * Trigger an XState transition with optional context data
1546
1546
  */
1547
1547
  async triggerTransition(e, o) {
1548
- const n = pt(), a = this.parentPath.split(".");
1549
- let s = this.doctype, r;
1550
- this.doctype === "StonecropStore" && a.length >= 1 && (s = a[0]), a.length >= 2 && (r = a[1]);
1548
+ const n = ct(), r = this.parentPath.split(".");
1549
+ let i = this.doctype, a;
1550
+ this.doctype === "StonecropStore" && r.length >= 1 && (i = r[0]), r.length >= 2 && (a = r[1]);
1551
1551
  const u = {
1552
1552
  path: this.parentPath,
1553
1553
  fieldname: "",
@@ -1555,24 +1555,24 @@ class xe {
1555
1555
  beforeValue: void 0,
1556
1556
  afterValue: void 0,
1557
1557
  operation: "set",
1558
- doctype: s,
1559
- recordId: r,
1558
+ doctype: i,
1559
+ recordId: a,
1560
1560
  timestamp: /* @__PURE__ */ new Date(),
1561
1561
  store: this.rootNode || void 0,
1562
1562
  transition: e,
1563
1563
  currentState: o?.currentState,
1564
1564
  targetState: o?.targetState,
1565
1565
  fsmContext: o?.fsmContext
1566
- }, i = ft();
1567
- return i && typeof i.addOperation == "function" && i.addOperation(
1566
+ }, c = ut();
1567
+ return c && typeof c.addOperation == "function" && c.addOperation(
1568
1568
  {
1569
1569
  type: "transition",
1570
1570
  path: this.parentPath,
1571
1571
  fieldname: e,
1572
1572
  beforeValue: o?.currentState,
1573
1573
  afterValue: o?.targetState,
1574
- doctype: s,
1575
- recordId: r,
1574
+ doctype: i,
1575
+ recordId: a,
1576
1576
  reversible: !1,
1577
1577
  // FSM transitions are generally not reversible
1578
1578
  metadata: {
@@ -1594,22 +1594,22 @@ class xe {
1594
1594
  return this.target;
1595
1595
  const o = this.parsePath(e);
1596
1596
  let n = this.target;
1597
- for (const a of o) {
1597
+ for (const r of o) {
1598
1598
  if (n == null)
1599
1599
  return;
1600
- n = this.getProperty(n, a);
1600
+ n = this.getProperty(n, r);
1601
1601
  }
1602
1602
  return n;
1603
1603
  }
1604
1604
  updateValue(e, o) {
1605
1605
  if (e === "")
1606
1606
  throw new Error("Cannot set value on empty path");
1607
- const n = this.parsePath(e), a = n.pop();
1608
- let s = this.target;
1609
- for (const r of n)
1610
- if (s = this.getProperty(s, r), s == null)
1607
+ const n = this.parsePath(e), r = n.pop();
1608
+ let i = this.target;
1609
+ for (const a of n)
1610
+ if (i = this.getProperty(i, a), i == null)
1611
1611
  throw new Error(`Cannot set property on null/undefined path: ${e}`);
1612
- this.setProperty(s, a, o);
1612
+ this.setProperty(i, r, o);
1613
1613
  }
1614
1614
  getProperty(e, o) {
1615
1615
  return this.isImmutable(e) ? e.get(o) : this.isVueReactive(e) ? e[o] : this.isPiniaStore(e) ? e.$state?.[o] ?? e[o] : e[o];
@@ -1625,31 +1625,31 @@ class xe {
1625
1625
  }
1626
1626
  async triggerFieldActions(e, o, n) {
1627
1627
  try {
1628
- if (!e || typeof e != "string")
1628
+ if (!e || typeof e != "string" || Object.is(o, n))
1629
1629
  return;
1630
- const a = e.split(".");
1631
- if (a.length < 3)
1630
+ const r = e.split(".");
1631
+ if (r.length < 3)
1632
1632
  return;
1633
- const s = pt(), r = a.slice(2).join(".") || a[a.length - 1];
1633
+ const i = ct(), a = r.slice(2).join(".") || r[r.length - 1];
1634
1634
  let u = this.doctype;
1635
- this.doctype === "StonecropStore" && a.length >= 1 && (u = a[0]);
1636
- let i;
1637
- a.length >= 2 && (i = a[1]);
1638
- const c = {
1635
+ this.doctype === "StonecropStore" && r.length >= 1 && (u = r[0]);
1636
+ let c;
1637
+ r.length >= 2 && (c = r[1]);
1638
+ const f = {
1639
1639
  path: e,
1640
- fieldname: r,
1640
+ fieldname: a,
1641
1641
  beforeValue: o,
1642
1642
  afterValue: n,
1643
1643
  operation: "set",
1644
1644
  doctype: u,
1645
- recordId: i,
1645
+ recordId: c,
1646
1646
  timestamp: /* @__PURE__ */ new Date(),
1647
1647
  store: this.rootNode || void 0
1648
1648
  // Pass the root store for snapshot/rollback capabilities
1649
1649
  };
1650
- await s.executeFieldTriggers(c);
1651
- } catch (a) {
1652
- a instanceof Error && console.warn("Field trigger error:", a.message);
1650
+ await i.executeFieldTriggers(f);
1651
+ } catch (r) {
1652
+ r instanceof Error && console.warn("Field trigger error:", r.message);
1653
1653
  }
1654
1654
  }
1655
1655
  isVueReactive(e) {
@@ -1661,19 +1661,19 @@ class xe {
1661
1661
  isImmutable(e) {
1662
1662
  if (!e || typeof e != "object")
1663
1663
  return !1;
1664
- const o = "get" in e && typeof e.get == "function", n = "set" in e && typeof e.set == "function", a = "has" in e && typeof e.has == "function", s = "__ownerID" in e || "_map" in e || "_list" in e || "_origin" in e || "_capacity" in e || "_defaultValues" in e || "_tail" in e || "_root" in e || "size" in e && o && n;
1665
- let r;
1664
+ const o = "get" in e && typeof e.get == "function", n = "set" in e && typeof e.set == "function", r = "has" in e && typeof e.has == "function", i = "__ownerID" in e || "_map" in e || "_list" in e || "_origin" in e || "_capacity" in e || "_defaultValues" in e || "_tail" in e || "_root" in e || "size" in e && o && n;
1665
+ let a;
1666
1666
  try {
1667
- const i = e;
1668
- if ("constructor" in i && i.constructor && typeof i.constructor == "object" && "name" in i.constructor) {
1669
- const c = i.constructor.name;
1670
- r = typeof c == "string" ? c : void 0;
1667
+ const c = e;
1668
+ if ("constructor" in c && c.constructor && typeof c.constructor == "object" && "name" in c.constructor) {
1669
+ const f = c.constructor.name;
1670
+ a = typeof f == "string" ? f : void 0;
1671
1671
  }
1672
1672
  } catch {
1673
- r = void 0;
1673
+ a = void 0;
1674
1674
  }
1675
- const u = r && (r.includes("Map") || r.includes("List") || r.includes("Set") || r.includes("Stack") || r.includes("Seq")) && (o || n);
1676
- return !!(o && n && a && s || o && n && u);
1675
+ const u = a && (a.includes("Map") || a.includes("List") || a.includes("Set") || a.includes("Stack") || a.includes("Seq")) && (o || n);
1676
+ return !!(o && n && r && i || o && n && u);
1677
1677
  }
1678
1678
  isPrimitive(e) {
1679
1679
  return e == null || typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "function" || typeof e == "symbol" || typeof e == "bigint";
@@ -1687,10 +1687,10 @@ class xe {
1687
1687
  return e ? e.replace(/\[(\d+)\]/g, ".$1").split(".").filter((o) => o.length > 0) : [];
1688
1688
  }
1689
1689
  }
1690
- function Co(t, e, o) {
1691
- return new xe(t, e, "", null, o);
1690
+ function No(t, e, o) {
1691
+ return new Ie(t, e, "", null, o);
1692
1692
  }
1693
- class Ro {
1693
+ class $o {
1694
1694
  hstStore;
1695
1695
  _operationLogStore;
1696
1696
  _operationLogConfig;
@@ -1718,7 +1718,7 @@ class Ro {
1718
1718
  const e = {};
1719
1719
  Object.keys(this.registry.registry).forEach((o) => {
1720
1720
  e[o] = {};
1721
- }), this.hstStore = Co(wt(e), "StonecropStore");
1721
+ }), this.hstStore = No(mt(e), "StonecropStore");
1722
1722
  }
1723
1723
  /**
1724
1724
  * Setup automatic sync with Registry when doctypes are added
@@ -1745,8 +1745,8 @@ class Ro {
1745
1745
  * @param recordData - The record data
1746
1746
  */
1747
1747
  addRecord(e, o, n) {
1748
- const a = typeof e == "string" ? e : e.slug;
1749
- this.ensureDoctypeExists(a), this.hstStore.set(`${a}.${o}`, n);
1748
+ const r = typeof e == "string" ? e : e.slug;
1749
+ this.ensureDoctypeExists(r), this.hstStore.set(`${r}.${o}`, n);
1750
1750
  }
1751
1751
  /**
1752
1752
  * Get a specific record
@@ -1777,7 +1777,7 @@ class Ro {
1777
1777
  const o = typeof e == "string" ? e : e.slug;
1778
1778
  this.ensureDoctypeExists(o);
1779
1779
  const n = this.hstStore.get(o);
1780
- return !n || typeof n != "object" ? [] : Object.keys(n).filter((a) => n[a] !== void 0);
1780
+ return !n || typeof n != "object" ? [] : Object.keys(n).filter((r) => n[r] !== void 0);
1781
1781
  }
1782
1782
  /**
1783
1783
  * Clear all records for a doctype
@@ -1804,19 +1804,19 @@ class Ro {
1804
1804
  * @param args - Action arguments (typically record IDs)
1805
1805
  */
1806
1806
  runAction(e, o, n) {
1807
- const a = this.registry.registry[e.slug]?.actions?.get(o), s = Array.isArray(n) ? n.filter((c) => typeof c == "string") : void 0, r = this.getOperationLogStore();
1808
- let u = "success", i;
1807
+ const r = this.registry.registry[e.slug]?.actions?.get(o), i = Array.isArray(n) ? n.filter((f) => typeof f == "string") : void 0, a = this.getOperationLogStore();
1808
+ let u = "success", c;
1809
1809
  try {
1810
- a && a.length > 0 && a.forEach((c) => {
1810
+ r && r.length > 0 && r.forEach((f) => {
1811
1811
  try {
1812
- new Function("args", c)(n);
1812
+ new Function("args", f)(n);
1813
1813
  } catch (p) {
1814
- throw u = "failure", i = p instanceof Error ? p.message : "Unknown error", p;
1814
+ throw u = "failure", c = p instanceof Error ? p.message : "Unknown error", p;
1815
1815
  }
1816
1816
  });
1817
1817
  } catch {
1818
1818
  } finally {
1819
- r.logAction(e.doctype, o, s, u, i);
1819
+ a.logAction(e.doctype, o, i, u, c);
1820
1820
  }
1821
1821
  }
1822
1822
  /**
@@ -1862,14 +1862,14 @@ class Ro {
1862
1862
  return this.hstStore;
1863
1863
  }
1864
1864
  }
1865
- function Ao(t) {
1865
+ function Co(t) {
1866
1866
  t || (t = {});
1867
- const e = t.registry || Se("$registry"), o = Se("$stonecrop"), n = A(), a = A(), s = A({}), r = A(), u = A(), i = A([]);
1867
+ const e = t.registry || be("$registry"), o = be("$stonecrop"), n = C(), r = C(), i = C({}), a = C(), u = C(), c = C([]);
1868
1868
  if (t.doctype && e) {
1869
- const E = t.doctype.schema ? Array.isArray(t.doctype.schema) ? t.doctype.schema : Array.from(t.doctype.schema) : [];
1870
- i.value = e.resolveSchema(E);
1869
+ const w = t.doctype.schema ? Array.isArray(t.doctype.schema) ? t.doctype.schema : Array.from(t.doctype.schema) : [];
1870
+ c.value = e.resolveSchema(w);
1871
1871
  }
1872
- const c = A([]), p = A(-1), y = x(() => n.value?.getOperationLogStore().canUndo ?? !1), h = x(() => n.value?.getOperationLogStore().canRedo ?? !1), O = x(() => n.value?.getOperationLogStore().undoCount ?? 0), _ = x(() => n.value?.getOperationLogStore().redoCount ?? 0), D = x(
1872
+ const f = C([]), p = C(-1), b = I(() => n.value?.getOperationLogStore().canUndo ?? !1), h = I(() => n.value?.getOperationLogStore().canRedo ?? !1), _ = I(() => n.value?.getOperationLogStore().undoCount ?? 0), m = I(() => n.value?.getOperationLogStore().redoCount ?? 0), O = I(
1873
1873
  () => n.value?.getOperationLogStore().undoRedoState ?? {
1874
1874
  canUndo: !1,
1875
1875
  canRedo: !1,
@@ -1877,35 +1877,35 @@ function Ao(t) {
1877
1877
  redoCount: 0,
1878
1878
  currentIndex: -1
1879
1879
  }
1880
- ), V = (E) => n.value?.getOperationLogStore().undo(E) ?? !1, M = (E) => n.value?.getOperationLogStore().redo(E) ?? !1, P = () => {
1880
+ ), R = (w) => n.value?.getOperationLogStore().undo(w) ?? !1, x = (w) => n.value?.getOperationLogStore().redo(w) ?? !1, H = () => {
1881
1881
  n.value?.getOperationLogStore().startBatch();
1882
- }, U = (E) => n.value?.getOperationLogStore().commitBatch(E) ?? null, q = () => {
1882
+ }, U = (w) => n.value?.getOperationLogStore().commitBatch(w) ?? null, K = () => {
1883
1883
  n.value?.getOperationLogStore().cancelBatch();
1884
- }, K = () => {
1884
+ }, G = () => {
1885
1885
  n.value?.getOperationLogStore().clear();
1886
- }, z = (E, N) => n.value?.getOperationLogStore().getOperationsFor(E, N) ?? [], $ = () => n.value?.getOperationLogStore().getSnapshot() ?? {
1886
+ }, z = (w, D) => n.value?.getOperationLogStore().getOperationsFor(w, D) ?? [], E = () => n.value?.getOperationLogStore().getSnapshot() ?? {
1887
1887
  operations: [],
1888
1888
  currentIndex: -1,
1889
1889
  totalOperations: 0,
1890
1890
  reversibleOperations: 0,
1891
1891
  irreversibleOperations: 0
1892
- }, te = (E, N) => {
1893
- n.value?.getOperationLogStore().markIrreversible(E, N);
1894
- }, W = (E, N, S, f = "success", v) => n.value?.getOperationLogStore().logAction(E, N, S, f, v) ?? "", g = (E) => {
1895
- n.value?.getOperationLogStore().configure(E);
1892
+ }, Y = (w, D) => {
1893
+ n.value?.getOperationLogStore().markIrreversible(w, D);
1894
+ }, B = (w, D, S, d = "success", s) => n.value?.getOperationLogStore().logAction(w, D, S, d, s) ?? "", v = (w) => {
1895
+ n.value?.getOperationLogStore().configure(w);
1896
1896
  };
1897
- Te(async () => {
1897
+ Ae(async () => {
1898
1898
  if (e) {
1899
- n.value = o || new Ro(e);
1899
+ n.value = o || new $o(e);
1900
1900
  try {
1901
- const E = n.value.getOperationLogStore(), N = so(E);
1902
- c.value = N.operations.value, p.value = N.currentIndex.value, H(
1903
- () => N.operations.value,
1901
+ const w = n.value.getOperationLogStore(), D = ro(w);
1902
+ f.value = D.operations.value, p.value = D.currentIndex.value, L(
1903
+ () => D.operations.value,
1904
1904
  (S) => {
1905
- c.value = S;
1905
+ f.value = S;
1906
1906
  }
1907
- ), H(
1908
- () => N.currentIndex.value,
1907
+ ), L(
1908
+ () => D.currentIndex.value,
1909
1909
  (S) => {
1910
1910
  p.value = S;
1911
1911
  }
@@ -1913,166 +1913,166 @@ function Ao(t) {
1913
1913
  } catch {
1914
1914
  }
1915
1915
  if (!t.doctype && e.router) {
1916
- const E = e.router.currentRoute.value;
1917
- if (!E.path) return;
1918
- const N = E.path.split("/").filter((f) => f.length > 0), S = N[1]?.toLowerCase();
1919
- if (N.length > 0) {
1920
- const f = {
1921
- path: E.path,
1922
- segments: N
1923
- }, v = await e.getMeta?.(f);
1924
- if (v) {
1925
- if (e.addDoctype(v), n.value.setup(v), r.value = v, u.value = S, a.value = n.value.getStore(), e) {
1926
- const b = v.schema ? Array.isArray(v.schema) ? v.schema : Array.from(v.schema) : [];
1927
- i.value = e.resolveSchema(b);
1916
+ const w = e.router.currentRoute.value;
1917
+ if (!w.path) return;
1918
+ const D = w.path.split("/").filter((d) => d.length > 0), S = D[1]?.toLowerCase();
1919
+ if (D.length > 0) {
1920
+ const d = {
1921
+ path: w.path,
1922
+ segments: D
1923
+ }, s = await e.getMeta?.(d);
1924
+ if (s) {
1925
+ if (e.addDoctype(s), n.value.setup(s), a.value = s, u.value = S, r.value = n.value.getStore(), e) {
1926
+ const l = s.schema ? Array.isArray(s.schema) ? s.schema : Array.from(s.schema) : [];
1927
+ c.value = e.resolveSchema(l);
1928
1928
  }
1929
1929
  if (S && S !== "new") {
1930
- const b = n.value.getRecordById(v, S);
1931
- if (b)
1932
- s.value = b.get("") || {};
1930
+ const l = n.value.getRecordById(s, S);
1931
+ if (l)
1932
+ i.value = l.get("") || {};
1933
1933
  else
1934
1934
  try {
1935
- await n.value.getRecord(v, S);
1936
- const l = n.value.getRecordById(v, S);
1937
- l && (s.value = l.get("") || {});
1935
+ await n.value.getRecord(s, S);
1936
+ const y = n.value.getRecordById(s, S);
1937
+ y && (i.value = y.get("") || {});
1938
1938
  } catch {
1939
- s.value = oe(v);
1939
+ i.value = ee(s);
1940
1940
  }
1941
1941
  } else
1942
- s.value = oe(v);
1943
- a.value && vt(v, S || "new", s, a.value), n.value.runAction(v, "load", S ? [S] : void 0);
1942
+ i.value = ee(s);
1943
+ r.value && dt(s, S || "new", i, r.value), n.value.runAction(s, "load", S ? [S] : void 0);
1944
1944
  }
1945
1945
  }
1946
1946
  }
1947
1947
  if (t.doctype) {
1948
- a.value = n.value.getStore();
1949
- const E = t.doctype, N = t.recordId;
1950
- if (N && N !== "new") {
1951
- const S = n.value.getRecordById(E, N);
1948
+ r.value = n.value.getStore();
1949
+ const w = t.doctype, D = t.recordId;
1950
+ if (D && D !== "new") {
1951
+ const S = n.value.getRecordById(w, D);
1952
1952
  if (S)
1953
- s.value = S.get("") || {};
1953
+ i.value = S.get("") || {};
1954
1954
  else
1955
1955
  try {
1956
- await n.value.getRecord(E, N);
1957
- const f = n.value.getRecordById(E, N);
1958
- f && (s.value = f.get("") || {});
1956
+ await n.value.getRecord(w, D);
1957
+ const d = n.value.getRecordById(w, D);
1958
+ d && (i.value = d.get("") || {});
1959
1959
  } catch {
1960
- s.value = oe(E);
1960
+ i.value = ee(w);
1961
1961
  }
1962
1962
  } else
1963
- s.value = oe(E);
1964
- a.value && vt(E, N || "new", s, a.value);
1963
+ i.value = ee(w);
1964
+ r.value && dt(w, D || "new", i, r.value);
1965
1965
  }
1966
1966
  }
1967
1967
  });
1968
- const m = (E, N) => {
1969
- const S = t.doctype || r.value;
1968
+ const g = (w, D) => {
1969
+ const S = t.doctype || a.value;
1970
1970
  if (!S) return "";
1971
- const f = N || t.recordId || u.value || "new";
1972
- return `${S.slug}.${f}.${E}`;
1973
- }, C = (E) => {
1974
- const N = t.doctype || r.value;
1975
- if (!(!a.value || !n.value || !N))
1971
+ const d = D || t.recordId || u.value || "new";
1972
+ return `${S.slug}.${d}.${w}`;
1973
+ }, $ = (w) => {
1974
+ const D = t.doctype || a.value;
1975
+ if (!(!r.value || !n.value || !D))
1976
1976
  try {
1977
- const S = E.path.split(".");
1977
+ const S = w.path.split(".");
1978
1978
  if (S.length >= 2) {
1979
- const b = S[0], l = S[1];
1980
- if (a.value.has(`${b}.${l}`) || n.value.addRecord(N, l, { ...s.value }), S.length > 3) {
1981
- const d = `${b}.${l}`, w = S.slice(2);
1982
- let R = d;
1983
- for (let J = 0; J < w.length - 1; J++)
1984
- if (R += `.${w[J]}`, !a.value.has(R)) {
1985
- const ee = w[J + 1], G = !isNaN(Number(ee));
1986
- a.value.set(R, G ? [] : {});
1979
+ const l = S[0], y = S[1];
1980
+ if (r.value.has(`${l}.${y}`) || n.value.addRecord(D, y, { ...i.value }), S.length > 3) {
1981
+ const N = `${l}.${y}`, j = S.slice(2);
1982
+ let J = N;
1983
+ for (let W = 0; W < j.length - 1; W++)
1984
+ if (J += `.${j[W]}`, !r.value.has(J)) {
1985
+ const te = j[W + 1], q = !isNaN(Number(te));
1986
+ r.value.set(J, q ? [] : {});
1987
1987
  }
1988
1988
  }
1989
1989
  }
1990
- a.value.set(E.path, E.value);
1991
- const f = E.fieldname.split("."), v = { ...s.value };
1992
- f.length === 1 ? v[f[0]] = E.value : Io(v, f, E.value), s.value = v;
1990
+ r.value.set(w.path, w.value);
1991
+ const d = w.fieldname.split("."), s = { ...i.value };
1992
+ d.length === 1 ? s[d[0]] = w.value : Ro(s, d, w.value), i.value = s;
1993
1993
  } catch {
1994
1994
  }
1995
1995
  };
1996
- (t.doctype || e?.router) && (Ge("hstPathProvider", m), Ge("hstChangeHandler", C));
1997
- const B = (E, N, S) => {
1996
+ (t.doctype || e?.router) && (Ge("hstPathProvider", g), Ge("hstChangeHandler", $));
1997
+ const M = (w, D, S) => {
1998
1998
  if (!n.value)
1999
- return oe(N);
1999
+ return ee(D);
2000
2000
  if (S)
2001
2001
  try {
2002
- const f = a.value?.get(E);
2003
- return f && typeof f == "object" ? f : oe(N);
2002
+ const d = r.value?.get(w);
2003
+ return d && typeof d == "object" ? d : ee(D);
2004
2004
  } catch {
2005
- return oe(N);
2005
+ return ee(D);
2006
2006
  }
2007
- return oe(N);
2008
- }, k = async (E, N) => {
2009
- if (!a.value || !n.value)
2007
+ return ee(D);
2008
+ }, k = async (w, D) => {
2009
+ if (!r.value || !n.value)
2010
2010
  throw new Error("HST store not initialized");
2011
- const S = `${E.slug}.${N}`, f = { ...a.value.get(S) || {} }, v = E.schema ? Array.isArray(E.schema) ? E.schema : Array.from(E.schema) : [], b = (e ? e.resolveSchema(v) : v).filter(
2012
- (l) => "fieldtype" in l && l.fieldtype === "Doctype" && "schema" in l && Array.isArray(l.schema)
2011
+ const S = `${w.slug}.${D}`, d = { ...r.value.get(S) || {} }, s = w.schema ? Array.isArray(w.schema) ? w.schema : Array.from(w.schema) : [], l = (e ? e.resolveSchema(s) : s).filter(
2012
+ (y) => "fieldtype" in y && y.fieldtype === "Doctype" && "schema" in y && Array.isArray(y.schema)
2013
2013
  );
2014
- for (const l of b) {
2015
- const d = l, w = `${S}.${d.fieldname}`, R = Ct(d.schema, w, a.value);
2016
- f[d.fieldname] = R;
2014
+ for (const y of l) {
2015
+ const N = y, j = `${S}.${N.fieldname}`, J = Ot(N.schema, j, r.value);
2016
+ d[N.fieldname] = J;
2017
2017
  }
2018
- return f;
2019
- }, I = (E, N) => ({
2020
- provideHSTPath: (S) => `${E}.${S}`,
2018
+ return d;
2019
+ }, T = (w, D) => ({
2020
+ provideHSTPath: (S) => `${w}.${S}`,
2021
2021
  handleHSTChange: (S) => {
2022
- const f = S.path.startsWith(E) ? S.path : `${E}.${S.fieldname}`;
2023
- C({
2022
+ const d = S.path.startsWith(w) ? S.path : `${w}.${S.fieldname}`;
2023
+ $({
2024
2024
  ...S,
2025
- path: f
2025
+ path: d
2026
2026
  });
2027
2027
  }
2028
- }), L = {
2029
- operations: c,
2028
+ }), F = {
2029
+ operations: f,
2030
2030
  currentIndex: p,
2031
- undoRedoState: D,
2032
- canUndo: y,
2031
+ undoRedoState: O,
2032
+ canUndo: b,
2033
2033
  canRedo: h,
2034
- undoCount: O,
2035
- redoCount: _,
2036
- undo: V,
2037
- redo: M,
2038
- startBatch: P,
2034
+ undoCount: _,
2035
+ redoCount: m,
2036
+ undo: R,
2037
+ redo: x,
2038
+ startBatch: H,
2039
2039
  commitBatch: U,
2040
- cancelBatch: q,
2041
- clear: K,
2040
+ cancelBatch: K,
2041
+ clear: G,
2042
2042
  getOperationsFor: z,
2043
- getSnapshot: $,
2044
- markIrreversible: te,
2045
- logAction: W,
2046
- configure: g
2043
+ getSnapshot: E,
2044
+ markIrreversible: Y,
2045
+ logAction: B,
2046
+ configure: v
2047
2047
  };
2048
2048
  return t.doctype ? {
2049
2049
  stonecrop: n,
2050
- operationLog: L,
2051
- provideHSTPath: m,
2052
- handleHSTChange: C,
2053
- hstStore: a,
2054
- formData: s,
2055
- resolvedSchema: i,
2056
- loadNestedData: B,
2050
+ operationLog: F,
2051
+ provideHSTPath: g,
2052
+ handleHSTChange: $,
2053
+ hstStore: r,
2054
+ formData: i,
2055
+ resolvedSchema: c,
2056
+ loadNestedData: M,
2057
2057
  saveRecursive: k,
2058
- createNestedContext: I
2058
+ createNestedContext: T
2059
2059
  } : !t.doctype && e?.router ? {
2060
2060
  stonecrop: n,
2061
- operationLog: L,
2062
- provideHSTPath: m,
2063
- handleHSTChange: C,
2064
- hstStore: a,
2065
- formData: s,
2066
- resolvedSchema: i,
2067
- loadNestedData: B,
2061
+ operationLog: F,
2062
+ provideHSTPath: g,
2063
+ handleHSTChange: $,
2064
+ hstStore: r,
2065
+ formData: i,
2066
+ resolvedSchema: c,
2067
+ loadNestedData: M,
2068
2068
  saveRecursive: k,
2069
- createNestedContext: I
2069
+ createNestedContext: T
2070
2070
  } : {
2071
2071
  stonecrop: n,
2072
- operationLog: L
2072
+ operationLog: F
2073
2073
  };
2074
2074
  }
2075
- function oe(t) {
2075
+ function ee(t) {
2076
2076
  const e = {};
2077
2077
  return t.schema && t.schema.forEach((o) => {
2078
2078
  switch ("fieldtype" in o ? o.fieldtype : "Data") {
@@ -2098,15 +2098,15 @@ function oe(t) {
2098
2098
  }
2099
2099
  }), e;
2100
2100
  }
2101
- function vt(t, e, o, n) {
2102
- H(
2101
+ function dt(t, e, o, n) {
2102
+ L(
2103
2103
  o,
2104
- (a) => {
2105
- const s = `${t.slug}.${e}`;
2106
- Object.keys(a).forEach((r) => {
2107
- const u = `${s}.${r}`;
2104
+ (r) => {
2105
+ const i = `${t.slug}.${e}`;
2106
+ Object.keys(r).forEach((a) => {
2107
+ const u = `${i}.${a}`;
2108
2108
  try {
2109
- n.set(u, a[r]);
2109
+ n.set(u, r[a]);
2110
2110
  } catch {
2111
2111
  }
2112
2112
  });
@@ -2114,267 +2114,265 @@ function vt(t, e, o, n) {
2114
2114
  { deep: !0 }
2115
2115
  );
2116
2116
  }
2117
- function Io(t, e, o) {
2117
+ function Ro(t, e, o) {
2118
2118
  let n = t;
2119
- for (let s = 0; s < e.length - 1; s++) {
2120
- const r = e[s];
2121
- (!(r in n) || typeof n[r] != "object") && (n[r] = isNaN(Number(e[s + 1])) ? {} : []), n = n[r];
2119
+ for (let i = 0; i < e.length - 1; i++) {
2120
+ const a = e[i];
2121
+ (!(a in n) || typeof n[a] != "object") && (n[a] = isNaN(Number(e[i + 1])) ? {} : []), n = n[a];
2122
2122
  }
2123
- const a = e[e.length - 1];
2124
- n[a] = o;
2123
+ const r = e[e.length - 1];
2124
+ n[r] = o;
2125
2125
  }
2126
- function Ct(t, e, o) {
2127
- const n = { ...o.get(e) || {} }, a = t.filter(
2128
- (s) => "fieldtype" in s && s.fieldtype === "Doctype" && "schema" in s && Array.isArray(s.schema)
2126
+ function Ot(t, e, o) {
2127
+ const n = { ...o.get(e) || {} }, r = t.filter(
2128
+ (i) => "fieldtype" in i && i.fieldtype === "Doctype" && "schema" in i && Array.isArray(i.schema)
2129
2129
  );
2130
- for (const s of a) {
2131
- const r = s, u = `${e}.${r.fieldname}`, i = Ct(r.schema, u, o);
2132
- n[r.fieldname] = i;
2130
+ for (const i of r) {
2131
+ const a = i, u = `${e}.${a.fieldname}`, c = Ot(a.schema, u, o);
2132
+ n[a.fieldname] = c;
2133
2133
  }
2134
2134
  return n;
2135
2135
  }
2136
2136
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
2137
- function xo(t, e) {
2138
- return Ye() ? (et(t, e), !0) : !1;
2137
+ function Io(t, e) {
2138
+ return Qe() ? (Xe(t, e), !0) : !1;
2139
2139
  }
2140
2140
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
2141
- const To = () => {
2141
+ const Ao = () => {
2142
2142
  };
2143
- function Po(...t) {
2143
+ function xo(...t) {
2144
2144
  if (t.length !== 1) return re(...t);
2145
2145
  const e = t[0];
2146
- return typeof e == "function" ? Ve(tt(() => ({
2146
+ return typeof e == "function" ? Te(Ye(() => ({
2147
2147
  get: e,
2148
- set: To
2149
- }))) : A(e);
2148
+ set: Ao
2149
+ }))) : C(e);
2150
2150
  }
2151
- function He(t) {
2151
+ function Le(t) {
2152
2152
  return typeof Window < "u" && t instanceof Window ? t.document.documentElement : typeof Document < "u" && t instanceof Document ? t.documentElement : t;
2153
2153
  }
2154
- const We = /* @__PURE__ */ new WeakMap();
2155
- function Vo(t, e = !1) {
2156
- const o = _e(e);
2154
+ const Be = /* @__PURE__ */ new WeakMap();
2155
+ function To(t, e = !1) {
2156
+ const o = Se(e);
2157
2157
  let n = "";
2158
- H(Po(t), (r) => {
2159
- const u = He(Q(r));
2158
+ L(xo(t), (a) => {
2159
+ const u = Le(Q(a));
2160
2160
  if (u) {
2161
- const i = u;
2162
- if (We.get(i) || We.set(i, i.style.overflow), i.style.overflow !== "hidden" && (n = i.style.overflow), i.style.overflow === "hidden") return o.value = !0;
2163
- if (o.value) return i.style.overflow = "hidden";
2161
+ const c = u;
2162
+ if (Be.get(c) || Be.set(c, c.style.overflow), c.style.overflow !== "hidden" && (n = c.style.overflow), c.style.overflow === "hidden") return o.value = !0;
2163
+ if (o.value) return c.style.overflow = "hidden";
2164
2164
  }
2165
2165
  }, { immediate: !0 });
2166
- const a = () => {
2167
- const r = He(Q(t));
2168
- !r || o.value || (r.style.overflow = "hidden", o.value = !0);
2169
- }, s = () => {
2170
- const r = He(Q(t));
2171
- !r || !o.value || (r.style.overflow = n, We.delete(r), o.value = !1);
2166
+ const r = () => {
2167
+ const a = Le(Q(t));
2168
+ !a || o.value || (a.style.overflow = "hidden", o.value = !0);
2169
+ }, i = () => {
2170
+ const a = Le(Q(t));
2171
+ !a || !o.value || (a.style.overflow = n, Be.delete(a), o.value = !1);
2172
2172
  };
2173
- return xo(s), x({
2173
+ return Io(i), I({
2174
2174
  get() {
2175
2175
  return o.value;
2176
2176
  },
2177
- set(r) {
2178
- r ? a() : s();
2177
+ set(a) {
2178
+ a ? r() : i();
2179
2179
  }
2180
2180
  });
2181
2181
  }
2182
- function Mo() {
2182
+ function Po() {
2183
2183
  let t = !1;
2184
- const e = _e(!1);
2184
+ const e = Se(!1);
2185
2185
  return (o, n) => {
2186
2186
  if (e.value = n.value, t) return;
2187
2187
  t = !0;
2188
- const a = Vo(o, n.value);
2189
- H(e, (s) => a.value = s);
2188
+ const r = To(o, n.value);
2189
+ L(e, (i) => r.value = i);
2190
2190
  };
2191
2191
  }
2192
- Mo();
2193
- const jo = (t, e) => {
2192
+ Po();
2193
+ const Vo = (t, e) => {
2194
2194
  const o = t.__vccOpts || t;
2195
- for (const [n, a] of e)
2196
- o[n] = a;
2195
+ for (const [n, r] of e)
2196
+ o[n] = r;
2197
2197
  return o;
2198
2198
  };
2199
- function Fo(t, e) {
2200
- return Ye() ? (et(t, e), !0) : !1;
2199
+ function jo(t, e) {
2200
+ return Qe() ? (Xe(t, e), !0) : !1;
2201
2201
  }
2202
2202
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
2203
- const Lo = () => {
2203
+ const Mo = () => {
2204
2204
  };
2205
- function Bo(...t) {
2205
+ function Fo(...t) {
2206
2206
  if (t.length !== 1) return re(...t);
2207
2207
  const e = t[0];
2208
- return typeof e == "function" ? Ve(tt(() => ({
2208
+ return typeof e == "function" ? Te(Ye(() => ({
2209
2209
  get: e,
2210
- set: Lo
2211
- }))) : A(e);
2210
+ set: Mo
2211
+ }))) : C(e);
2212
2212
  }
2213
- function Ue(t) {
2213
+ function We(t) {
2214
2214
  return typeof Window < "u" && t instanceof Window ? t.document.documentElement : typeof Document < "u" && t instanceof Document ? t.documentElement : t;
2215
2215
  }
2216
- const ze = /* @__PURE__ */ new WeakMap();
2217
- function Ho(t, e = !1) {
2218
- const o = _e(e);
2216
+ const He = /* @__PURE__ */ new WeakMap();
2217
+ function Lo(t, e = !1) {
2218
+ const o = Se(e);
2219
2219
  let n = "";
2220
- H(Bo(t), (r) => {
2221
- const u = Ue(Q(r));
2220
+ L(Fo(t), (a) => {
2221
+ const u = We(Q(a));
2222
2222
  if (u) {
2223
- const i = u;
2224
- if (ze.get(i) || ze.set(i, i.style.overflow), i.style.overflow !== "hidden" && (n = i.style.overflow), i.style.overflow === "hidden") return o.value = !0;
2225
- if (o.value) return i.style.overflow = "hidden";
2223
+ const c = u;
2224
+ if (He.get(c) || He.set(c, c.style.overflow), c.style.overflow !== "hidden" && (n = c.style.overflow), c.style.overflow === "hidden") return o.value = !0;
2225
+ if (o.value) return c.style.overflow = "hidden";
2226
2226
  }
2227
2227
  }, { immediate: !0 });
2228
- const a = () => {
2229
- const r = Ue(Q(t));
2230
- !r || o.value || (r.style.overflow = "hidden", o.value = !0);
2231
- }, s = () => {
2232
- const r = Ue(Q(t));
2233
- !r || !o.value || (r.style.overflow = n, ze.delete(r), o.value = !1);
2228
+ const r = () => {
2229
+ const a = We(Q(t));
2230
+ !a || o.value || (a.style.overflow = "hidden", o.value = !0);
2231
+ }, i = () => {
2232
+ const a = We(Q(t));
2233
+ !a || !o.value || (a.style.overflow = n, He.delete(a), o.value = !1);
2234
2234
  };
2235
- return Fo(s), x({
2235
+ return jo(i), I({
2236
2236
  get() {
2237
2237
  return o.value;
2238
2238
  },
2239
- set(r) {
2240
- r ? a() : s();
2239
+ set(a) {
2240
+ a ? r() : i();
2241
2241
  }
2242
2242
  });
2243
2243
  }
2244
- function Wo() {
2244
+ function Bo() {
2245
2245
  let t = !1;
2246
- const e = _e(!1);
2246
+ const e = Se(!1);
2247
2247
  return (o, n) => {
2248
2248
  if (e.value = n.value, t) return;
2249
2249
  t = !0;
2250
- const a = Ho(o, n.value);
2251
- H(e, (s) => a.value = s);
2250
+ const r = Lo(o, n.value);
2251
+ L(e, (i) => r.value = i);
2252
2252
  };
2253
2253
  }
2254
- Wo();
2254
+ Bo();
2255
2255
  typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
2256
- const Uo = { class: "aform" }, zo = {
2256
+ const Wo = { class: "aform" }, Ho = {
2257
2257
  key: 0,
2258
2258
  class: "aform-nested-section"
2259
- }, Jo = {
2259
+ }, Uo = {
2260
2260
  key: 0,
2261
2261
  class: "aform-nested-label"
2262
- }, Ko = /* @__PURE__ */ Ee({
2262
+ }, zo = /* @__PURE__ */ we({
2263
2263
  __name: "AForm",
2264
- props: /* @__PURE__ */ rt({
2264
+ props: /* @__PURE__ */ ot({
2265
2265
  schema: {},
2266
- readOnly: { type: Boolean }
2266
+ mode: { default: "edit" }
2267
2267
  }, {
2268
2268
  data: { required: !0 },
2269
2269
  dataModifiers: {}
2270
2270
  }),
2271
- emits: /* @__PURE__ */ rt(["update:schema", "update:data"], ["update:data"]),
2271
+ emits: /* @__PURE__ */ ot(["update:schema", "update:data"], ["update:data"]),
2272
2272
  setup(t, { emit: e }) {
2273
- const o = e, n = Vt(t, "data"), a = A({});
2274
- H(
2273
+ const o = e, n = xt(t, "data"), r = C({});
2274
+ L(
2275
2275
  () => n.value,
2276
- (c) => {
2277
- !t.schema || !c || t.schema.forEach((p) => {
2278
- "schema" in p && Array.isArray(p.schema) && p.schema.length > 0 && (a.value[p.fieldname] = c[p.fieldname] ?? {});
2276
+ (b) => {
2277
+ !t.schema || !b || t.schema.forEach((h) => {
2278
+ "schema" in h && Array.isArray(h.schema) && h.schema.length > 0 && (r.value[h.fieldname] = b[h.fieldname] ?? {});
2279
2279
  });
2280
2280
  },
2281
2281
  { immediate: !0 }
2282
2282
  );
2283
- const s = (c, p) => {
2284
- a.value[c] = p, n.value && (n.value[c] = p, o("update:data", n.value));
2285
- };
2286
- at(() => {
2287
- n.value && t.schema && t.schema.forEach((c) => {
2288
- c.fieldname && n.value[c.fieldname] !== void 0 && (c.value = n.value[c.fieldname]);
2289
- });
2290
- });
2291
- const r = (c) => {
2292
- const p = {};
2293
- for (const [y, h] of Object.entries(c))
2294
- ["component", "fieldtype"].includes(y) || (p[y] = h), y === "rows" && (!h || Array.isArray(h) && h.length === 0) && (p.rows = n.value[c.fieldname] || []);
2295
- return p;
2296
- }, u = A([]);
2297
- at(() => {
2298
- t.schema && u.value.length !== t.schema.length && (u.value = t.schema.map((c, p) => x({
2283
+ const i = (b, h) => {
2284
+ r.value[b] = h, n.value && (n.value[b] = h, o("update:data", { ...n.value }));
2285
+ }, a = (b) => {
2286
+ const h = {};
2287
+ for (const [_, m] of Object.entries(b))
2288
+ ["component", "fieldtype", "mode"].includes(_) || (h[_] = m), _ === "rows" && (!m || Array.isArray(m) && m.length === 0) && (h.rows = n.value[b.fieldname] || []);
2289
+ return h;
2290
+ }, u = I(() => t.mode ?? "edit");
2291
+ function c(b) {
2292
+ return b.mode || u.value;
2293
+ }
2294
+ const f = C([]);
2295
+ Tt(() => {
2296
+ t.schema && f.value.length !== t.schema.length && (f.value = t.schema.map((b, h) => I({
2299
2297
  get() {
2300
- return c.value;
2298
+ return n.value?.[t.schema[h].fieldname];
2301
2299
  },
2302
- set: (y) => {
2303
- const h = t.schema[p].fieldname;
2304
- t.schema[p].value = y, h && n.value && (n.value[h] = y, o("update:data", n.value)), o("update:schema", t.schema);
2300
+ set: (_) => {
2301
+ const m = t.schema[h].fieldname;
2302
+ m && n.value && (n.value[m] = _, o("update:data", { ...n.value })), o("update:schema", t.schema);
2305
2303
  }
2306
2304
  })));
2307
2305
  });
2308
- const i = x(() => u.value);
2309
- return (c, p) => {
2310
- const y = St("AForm", !0);
2311
- return j(), F("form", Uo, [
2312
- (j(!0), F(pe, null, be(t.schema, (h, O) => (j(), F(pe, { key: O }, [
2313
- "schema" in h && Array.isArray(h.schema) && h.schema.length > 0 ? (j(), F("div", zo, [
2314
- h.label ? (j(), F("h4", Jo, Y(h.label), 1)) : de("", !0),
2315
- ae(y, {
2316
- data: a.value[h.fieldname],
2317
- "onUpdate:data": (_) => s(h.fieldname, _),
2318
- schema: h.schema,
2319
- "read-only": t.readOnly || h.readOnly
2320
- }, null, 8, ["data", "onUpdate:data", "schema", "read-only"])
2321
- ])) : (j(), Xe(Mt(h.component), jt({
2306
+ const p = I(() => f.value);
2307
+ return (b, h) => {
2308
+ const _ = yt("AForm", !0);
2309
+ return P(), V("form", Wo, [
2310
+ (P(!0), V(de, null, me(t.schema, (m, O) => (P(), V(de, { key: O }, [
2311
+ "schema" in m && Array.isArray(m.schema) && m.schema.length > 0 ? (P(), V("div", Ho, [
2312
+ m.label ? (P(), V("h4", Uo, X(m.label), 1)) : ue("", !0),
2313
+ ne(_, {
2314
+ data: r.value[m.fieldname],
2315
+ mode: c(m),
2316
+ schema: m.schema,
2317
+ "onUpdate:data": (R) => i(m.fieldname, R)
2318
+ }, null, 8, ["data", "mode", "schema", "onUpdate:data"])
2319
+ ])) : (P(), Ze(Pt(m.component), Vt({
2322
2320
  key: 1,
2323
- modelValue: i.value[O].value,
2324
- "onUpdate:modelValue": (_) => i.value[O].value = _,
2325
- schema: h,
2326
- data: n.value[h.fieldname],
2327
- "read-only": t.readOnly
2328
- }, { ref_for: !0 }, r(h)), null, 16, ["modelValue", "onUpdate:modelValue", "schema", "data", "read-only"]))
2321
+ modelValue: p.value[O].value,
2322
+ "onUpdate:modelValue": (R) => p.value[O].value = R,
2323
+ schema: m,
2324
+ data: n.value[m.fieldname],
2325
+ mode: c(m)
2326
+ }, { ref_for: !0 }, a(m)), null, 16, ["modelValue", "onUpdate:modelValue", "schema", "data", "mode"]))
2329
2327
  ], 64))), 128))
2330
2328
  ]);
2331
2329
  };
2332
2330
  }
2333
- }), Go = /* @__PURE__ */ jo(Ko, [["__scopeId", "data-v-a3cba83d"]]), qo = { class: "tabs" }, Zo = { tabindex: "0" }, Qo = { tabindex: "0" }, Xo = /* @__PURE__ */ Ee({
2331
+ }), Go = /* @__PURE__ */ Vo(zo, [["__scopeId", "data-v-5c01cea5"]]), Jo = { class: "tabs" }, Ko = { tabindex: "0" }, qo = { tabindex: "0" }, Zo = /* @__PURE__ */ we({
2334
2332
  __name: "SheetNav",
2335
2333
  props: {
2336
2334
  breadcrumbs: { default: () => [] }
2337
2335
  },
2338
2336
  setup(t) {
2339
- const e = A(!0), o = A(!1), n = A(""), a = ht("searchinput"), s = x(() => e.value ? "unrotated" : "rotated"), r = () => {
2337
+ const e = C(!0), o = C(!1), n = C(""), r = ft("searchinput"), i = I(() => e.value ? "unrotated" : "rotated"), a = () => {
2340
2338
  e.value = !e.value;
2341
2339
  }, u = async () => {
2342
- o.value = !o.value, await se(() => {
2343
- a.value?.focus();
2340
+ o.value = !o.value, await ae(() => {
2341
+ r.value?.focus();
2344
2342
  });
2345
- }, i = (y) => {
2346
- y.preventDefault(), y.stopPropagation();
2347
- }, c = async (y) => {
2348
- y.preventDefault(), y.stopPropagation(), await u();
2343
+ }, c = (b) => {
2344
+ b.preventDefault(), b.stopPropagation();
2345
+ }, f = async (b) => {
2346
+ b.preventDefault(), b.stopPropagation(), await u();
2349
2347
  }, p = () => {
2350
2348
  };
2351
- return (y, h) => {
2352
- const O = St("router-link");
2353
- return j(), F("footer", null, [
2354
- T("ul", qo, [
2355
- T("li", {
2349
+ return (b, h) => {
2350
+ const _ = yt("router-link");
2351
+ return P(), V("footer", null, [
2352
+ A("ul", Jo, [
2353
+ A("li", {
2356
2354
  class: "hidebreadcrumbs",
2357
- onClick: r,
2358
- onKeydown: he(r, ["enter"])
2355
+ onClick: a,
2356
+ onKeydown: pe(a, ["enter"])
2359
2357
  }, [
2360
- T("a", Zo, [
2361
- T("div", {
2362
- class: De(s.value)
2358
+ A("a", Ko, [
2359
+ A("div", {
2360
+ class: Oe(i.value)
2363
2361
  }, "×", 2)
2364
2362
  ])
2365
2363
  ], 32),
2366
- T("li", {
2364
+ A("li", {
2367
2365
  class: "hometab",
2368
- style: je({ display: e.value ? "block" : "none" }),
2366
+ style: Ve({ display: e.value ? "block" : "none" }),
2369
2367
  onClick: p,
2370
- onKeydown: he(p, ["enter"])
2368
+ onKeydown: pe(p, ["enter"])
2371
2369
  }, [
2372
- ae(O, {
2370
+ ne(_, {
2373
2371
  to: "/",
2374
2372
  tabindex: "0"
2375
2373
  }, {
2376
- default: we(() => [...h[5] || (h[5] = [
2377
- T("svg", {
2374
+ default: ye(() => [...h[5] || (h[5] = [
2375
+ A("svg", {
2378
2376
  class: "icon",
2379
2377
  "aria-label": "Home",
2380
2378
  viewBox: "0 0 24 24",
@@ -2382,19 +2380,19 @@ const Uo = { class: "aform" }, zo = {
2382
2380
  stroke: "currentColor",
2383
2381
  "stroke-width": "2"
2384
2382
  }, [
2385
- T("path", { d: "M3 12l9-9 9 9" }),
2386
- T("path", { d: "M9 21V12h6v9" })
2383
+ A("path", { d: "M3 12l9-9 9 9" }),
2384
+ A("path", { d: "M9 21V12h6v9" })
2387
2385
  ], -1)
2388
2386
  ])]),
2389
2387
  _: 1
2390
2388
  })
2391
2389
  ], 36),
2392
- T("li", {
2393
- class: De(["searchtab", { "search-active": o.value }]),
2394
- style: je({ display: e.value ? "block" : "none" })
2390
+ A("li", {
2391
+ class: Oe(["searchtab", { "search-active": o.value }]),
2392
+ style: Ve({ display: e.value ? "block" : "none" })
2395
2393
  }, [
2396
- T("a", Qo, [
2397
- Ce((j(), F("svg", {
2394
+ A("a", qo, [
2395
+ Ne((P(), V("svg", {
2398
2396
  class: "icon search-icon",
2399
2397
  role: "button",
2400
2398
  "aria-label": "Search",
@@ -2403,46 +2401,46 @@ const Uo = { class: "aform" }, zo = {
2403
2401
  stroke: "currentColor",
2404
2402
  "stroke-width": "2",
2405
2403
  onClick: u,
2406
- onKeydown: he(u, ["enter"])
2404
+ onKeydown: pe(u, ["enter"])
2407
2405
  }, [...h[6] || (h[6] = [
2408
- T("circle", {
2406
+ A("circle", {
2409
2407
  cx: "11",
2410
2408
  cy: "11",
2411
2409
  r: "7"
2412
2410
  }, null, -1),
2413
- T("path", { d: "M21 21l-4.35-4.35" }, null, -1)
2411
+ A("path", { d: "M21 21l-4.35-4.35" }, null, -1)
2414
2412
  ])], 544)), [
2415
- [Je, !o.value]
2413
+ [Ue, !o.value]
2416
2414
  ]),
2417
- Ce(T("input", {
2415
+ Ne(A("input", {
2418
2416
  ref: "searchinput",
2419
- "onUpdate:modelValue": h[0] || (h[0] = (_) => n.value = _),
2417
+ "onUpdate:modelValue": h[0] || (h[0] = (m) => n.value = m),
2420
2418
  type: "text",
2421
2419
  placeholder: "Search...",
2422
- onClick: h[1] || (h[1] = gt(() => {
2420
+ onClick: h[1] || (h[1] = pt(() => {
2423
2421
  }, ["stop"])),
2424
- onInput: h[2] || (h[2] = (_) => i(_)),
2425
- onBlur: h[3] || (h[3] = (_) => c(_)),
2422
+ onInput: h[2] || (h[2] = (m) => c(m)),
2423
+ onBlur: h[3] || (h[3] = (m) => f(m)),
2426
2424
  onKeydown: [
2427
- h[4] || (h[4] = he((_) => c(_), ["enter"])),
2428
- he(u, ["escape"])
2425
+ h[4] || (h[4] = pe((m) => f(m), ["enter"])),
2426
+ pe(u, ["escape"])
2429
2427
  ]
2430
2428
  }, null, 544), [
2431
- [Je, o.value],
2432
- [mt, n.value]
2429
+ [Ue, o.value],
2430
+ [ht, n.value]
2433
2431
  ])
2434
2432
  ])
2435
2433
  ], 6),
2436
- (j(!0), F(pe, null, be(t.breadcrumbs, (_) => (j(), F("li", {
2437
- key: _.title,
2438
- style: je({ display: e.value ? "block" : "none" })
2434
+ (P(!0), V(de, null, me(t.breadcrumbs, (m) => (P(), V("li", {
2435
+ key: m.title,
2436
+ style: Ve({ display: e.value ? "block" : "none" })
2439
2437
  }, [
2440
- ae(O, {
2438
+ ne(_, {
2441
2439
  tabindex: "0",
2442
- to: _.to
2440
+ to: m.to
2443
2441
  }, {
2444
- default: we(() => [
2445
- Re(Y(_.title), 1)
2442
+ default: ye(() => [
2443
+ $e(X(m.title), 1)
2446
2444
  ]),
2447
2445
  _: 2
2448
2446
  }, 1032, ["to"])
@@ -2451,107 +2449,107 @@ const Uo = { class: "aform" }, zo = {
2451
2449
  ]);
2452
2450
  };
2453
2451
  }
2454
- }), Rt = /* @__PURE__ */ Et(Xo, [["__scopeId", "data-v-eb5bcbb6"]]), Yo = {
2452
+ }), Nt = /* @__PURE__ */ bt(Zo, [["__scopeId", "data-v-eb5bcbb6"]]), Qo = {
2455
2453
  key: 1,
2456
2454
  class: "loading"
2457
- }, en = {
2455
+ }, Xo = {
2458
2456
  key: 2,
2459
2457
  class: "loading"
2460
- }, tn = /* @__PURE__ */ Ee({
2458
+ }, Yo = /* @__PURE__ */ we({
2461
2459
  __name: "Desktop",
2462
2460
  props: {
2463
2461
  availableDoctypes: { default: () => [] }
2464
2462
  },
2465
2463
  setup(t) {
2466
- const { stonecrop: e } = Ao(), o = A(!1), n = A(!1), a = A(!1), s = x({
2464
+ const { stonecrop: e } = Co(), o = C(!1), n = C(!1), r = C(!1), i = I({
2467
2465
  get() {
2468
- if (!e.value || !i.value || !p.value)
2466
+ if (!e.value || !c.value || !p.value)
2469
2467
  return {};
2470
2468
  try {
2471
- return e.value.getRecordById(i.value, p.value)?.get("") || {};
2469
+ return { ...e.value.getRecordById(c.value, p.value)?.get("") || {} };
2472
2470
  } catch {
2473
2471
  return {};
2474
2472
  }
2475
2473
  },
2476
- set(l) {
2477
- if (!(!e.value || !i.value || !p.value))
2474
+ set(s) {
2475
+ if (!(!e.value || !c.value || !p.value))
2478
2476
  try {
2479
- const d = e.value.getStore();
2480
- for (const [w, R] of Object.entries(l)) {
2481
- const J = `${i.value}.${p.value}.${w}`;
2482
- d.set(J, R);
2477
+ const l = e.value.getStore();
2478
+ for (const [y, N] of Object.entries(s)) {
2479
+ const j = `${c.value}.${p.value}.${y}`;
2480
+ (l.has(j) ? l.get(j) : void 0) !== N && l.set(j, N);
2483
2481
  }
2484
- } catch (d) {
2485
- console.warn("HST update failed:", d);
2482
+ } catch (l) {
2483
+ console.warn("HST update failed:", l);
2486
2484
  }
2487
2485
  }
2488
- }), r = x(() => Oe(e.value?.registry.router?.currentRoute)), u = x(() => e.value?.registry.router), i = x(() => {
2489
- if (!r.value) return "";
2490
- if (r.value.meta?.actualDoctype)
2491
- return r.value.meta.actualDoctype;
2492
- if (r.value.params.doctype)
2493
- return r.value.params.doctype;
2494
- const l = r.value.params.pathMatch;
2495
- return l && l.length > 0 ? l[0] : "";
2496
- }), c = x(() => {
2497
- if (!r.value) return "";
2498
- if (r.value.meta?.doctype)
2499
- return r.value.meta.doctype;
2500
- if (r.value.params.doctype)
2501
- return r.value.params.doctype;
2502
- const l = r.value.params.pathMatch;
2503
- return l && l.length > 0 ? l[0] : "";
2504
- }), p = x(() => {
2505
- if (!r.value) return "";
2506
- if (r.value.params.recordId)
2507
- return r.value.params.recordId;
2508
- const l = r.value.params.pathMatch;
2509
- return l && l.length > 1 ? l[1] : "";
2510
- }), y = x(() => p.value?.startsWith("new-")), h = x(() => {
2511
- if (!r.value || r.value.name === "home" || r.value.path === "/")
2486
+ }), a = I(() => De(e.value?.registry.router?.currentRoute)), u = I(() => e.value?.registry.router), c = I(() => {
2487
+ if (!a.value) return "";
2488
+ if (a.value.meta?.actualDoctype)
2489
+ return a.value.meta.actualDoctype;
2490
+ if (a.value.params.doctype)
2491
+ return a.value.params.doctype;
2492
+ const s = a.value.params.pathMatch;
2493
+ return s && s.length > 0 ? s[0] : "";
2494
+ }), f = I(() => {
2495
+ if (!a.value) return "";
2496
+ if (a.value.meta?.doctype)
2497
+ return a.value.meta.doctype;
2498
+ if (a.value.params.doctype)
2499
+ return a.value.params.doctype;
2500
+ const s = a.value.params.pathMatch;
2501
+ return s && s.length > 0 ? s[0] : "";
2502
+ }), p = I(() => {
2503
+ if (!a.value) return "";
2504
+ if (a.value.params.recordId)
2505
+ return a.value.params.recordId;
2506
+ const s = a.value.params.pathMatch;
2507
+ return s && s.length > 1 ? s[1] : "";
2508
+ }), b = I(() => p.value?.startsWith("new-")), h = I(() => {
2509
+ if (!a.value || a.value.name === "home" || a.value.path === "/")
2512
2510
  return "doctypes";
2513
- if (r.value.name && r.value.name !== "catch-all") {
2514
- const d = r.value.name;
2515
- if (d.includes("form") || r.value.params.recordId)
2511
+ if (a.value.name && a.value.name !== "catch-all") {
2512
+ const l = a.value.name;
2513
+ if (l.includes("form") || a.value.params.recordId)
2516
2514
  return "record";
2517
- if (d.includes("list") || r.value.params.doctype)
2515
+ if (l.includes("list") || a.value.params.doctype)
2518
2516
  return "records";
2519
2517
  }
2520
- const l = r.value.params.pathMatch;
2521
- return l && l.length > 0 ? l.length === 1 ? "records" : "record" : "doctypes";
2522
- }), O = () => {
2523
- if (!e.value || !i.value || !p.value)
2518
+ const s = a.value.params.pathMatch;
2519
+ return s && s.length > 0 ? s.length === 1 ? "records" : "record" : "doctypes";
2520
+ }), _ = () => {
2521
+ if (!e.value || !c.value || !p.value)
2524
2522
  return [];
2525
2523
  try {
2526
- const d = e.value.registry.registry[i.value];
2527
- if (!d?.workflow?.states)
2524
+ const l = e.value.registry.registry[c.value];
2525
+ if (!l?.workflow?.states)
2528
2526
  return [];
2529
- const w = y.value ? "creating" : "editing", R = d.workflow.states[w];
2530
- return R?.on ? Object.keys(R.on).map((G) => {
2531
- const ve = R.on?.[G], X = typeof ve == "string" ? ve : "unknown", At = async () => {
2532
- const ot = e.value?.getRecordById(i.value, p.value);
2533
- if (ot) {
2534
- const It = s.value || {};
2535
- await ot.triggerTransition(G, {
2536
- currentState: w,
2537
- targetState: X,
2538
- fsmContext: It
2527
+ const y = b.value ? "creating" : "editing", N = l.workflow.states[y];
2528
+ return N?.on ? Object.keys(N.on).map((W) => {
2529
+ const te = N.on?.[W], q = typeof te == "string" ? te : "unknown", $t = async () => {
2530
+ const et = e.value?.getRecordById(c.value, p.value);
2531
+ if (et) {
2532
+ const Ct = i.value || {};
2533
+ await et.triggerTransition(W, {
2534
+ currentState: y,
2535
+ targetState: q,
2536
+ fsmContext: Ct
2539
2537
  });
2540
2538
  }
2541
2539
  };
2542
2540
  return {
2543
- label: `${G} (→ ${X})`,
2544
- action: At
2541
+ label: `${W} (→ ${q})`,
2542
+ action: $t
2545
2543
  };
2546
2544
  }) : [];
2547
- } catch (l) {
2548
- return console.warn("Error getting available transitions:", l), [];
2545
+ } catch (s) {
2546
+ return console.warn("Error getting available transitions:", s), [];
2549
2547
  }
2550
- }, _ = x(() => {
2551
- const l = [];
2548
+ }, m = I(() => {
2549
+ const s = [];
2552
2550
  switch (h.value) {
2553
2551
  case "doctypes":
2554
- l.push({
2552
+ s.push({
2555
2553
  type: "button",
2556
2554
  label: "Refresh",
2557
2555
  action: () => {
@@ -2560,7 +2558,7 @@ const Uo = { class: "aform" }, zo = {
2560
2558
  });
2561
2559
  break;
2562
2560
  case "records":
2563
- l.push(
2561
+ s.push(
2564
2562
  {
2565
2563
  type: "button",
2566
2564
  label: "New Record",
@@ -2578,28 +2576,28 @@ const Uo = { class: "aform" }, zo = {
2578
2576
  );
2579
2577
  break;
2580
2578
  case "record": {
2581
- const d = O();
2582
- d.length > 0 && l.push({
2579
+ const l = _();
2580
+ l.length > 0 && s.push({
2583
2581
  type: "dropdown",
2584
2582
  label: "Actions",
2585
- actions: d
2583
+ actions: l
2586
2584
  });
2587
2585
  break;
2588
2586
  }
2589
2587
  }
2590
- return l;
2591
- }), D = x(() => {
2592
- const l = [];
2593
- return h.value === "records" && c.value ? l.push(
2588
+ return s;
2589
+ }), O = I(() => {
2590
+ const s = [];
2591
+ return h.value === "records" && f.value ? s.push(
2594
2592
  { title: "Home", to: "/" },
2595
- { title: P(c.value), to: `/${c.value}` }
2596
- ) : h.value === "record" && c.value && l.push(
2593
+ { title: H(f.value), to: `/${f.value}` }
2594
+ ) : h.value === "record" && f.value && s.push(
2597
2595
  { title: "Home", to: "/" },
2598
- { title: P(c.value), to: `/${c.value}` },
2599
- { title: y.value ? "New Record" : "Edit Record", to: r.value?.fullPath || "" }
2600
- ), l;
2601
- }), V = (l) => {
2602
- const d = [
2596
+ { title: H(f.value), to: `/${f.value}` },
2597
+ { title: b.value ? "New Record" : "Edit Record", to: a.value?.fullPath || "" }
2598
+ ), s;
2599
+ }), R = (s) => {
2600
+ const l = [
2603
2601
  {
2604
2602
  title: "Go Home",
2605
2603
  description: "Navigate to the home page",
@@ -2610,66 +2608,57 @@ const Uo = { class: "aform" }, zo = {
2610
2608
  {
2611
2609
  title: "Toggle Command Palette",
2612
2610
  description: "Open/close the command palette",
2613
- action: () => a.value = !a.value
2611
+ action: () => r.value = !r.value
2614
2612
  }
2615
2613
  ];
2616
- return c.value && (d.push({
2617
- title: `View ${P(c.value)} Records`,
2618
- description: `Navigate to ${c.value} list`,
2614
+ return f.value && (l.push({
2615
+ title: `View ${H(f.value)} Records`,
2616
+ description: `Navigate to ${f.value} list`,
2619
2617
  action: () => {
2620
- u.value?.push(`/${c.value}`);
2618
+ u.value?.push(`/${f.value}`);
2621
2619
  }
2622
- }), d.push({
2623
- title: `Create New ${P(c.value)}`,
2624
- description: `Create a new ${c.value} record`,
2620
+ }), l.push({
2621
+ title: `Create New ${H(f.value)}`,
2622
+ description: `Create a new ${f.value} record`,
2625
2623
  action: () => {
2626
2624
  z();
2627
2625
  }
2628
- })), t.availableDoctypes.forEach((w) => {
2629
- d.push({
2630
- title: `View ${P(w)}`,
2631
- description: `Navigate to ${w} list`,
2626
+ })), t.availableDoctypes.forEach((y) => {
2627
+ l.push({
2628
+ title: `View ${H(y)}`,
2629
+ description: `Navigate to ${y} list`,
2632
2630
  action: () => {
2633
- u.value?.push(`/${w}`);
2631
+ u.value?.push(`/${y}`);
2634
2632
  }
2635
2633
  });
2636
- }), l ? d.filter(
2637
- (w) => w.title.toLowerCase().includes(l.toLowerCase()) || w.description.toLowerCase().includes(l.toLowerCase())
2638
- ) : d;
2639
- }, M = (l) => {
2640
- l.action(), a.value = !1;
2641
- }, P = (l) => l.split("-").map((d) => d.charAt(0).toUpperCase() + d.slice(1)).join(" "), U = (l) => e.value ? e.value.getRecordIds(l).length : 0, q = async (l) => {
2642
- await u.value?.push(`/${l}`);
2643
- }, K = async (l) => {
2644
- await u.value?.push(`/${c.value}/${l}`);
2634
+ }), s ? l.filter(
2635
+ (y) => y.title.toLowerCase().includes(s.toLowerCase()) || y.description.toLowerCase().includes(s.toLowerCase())
2636
+ ) : l;
2637
+ }, x = (s) => {
2638
+ s.action(), r.value = !1;
2639
+ }, H = (s) => s.split("-").map((l) => l.charAt(0).toUpperCase() + l.slice(1)).join(" "), U = (s) => e.value ? e.value.getRecordIds(s).length : 0, K = async (s) => {
2640
+ await u.value?.push(`/${s}`);
2641
+ }, G = async (s) => {
2642
+ await u.value?.push(`/${f.value}/${s}`);
2645
2643
  }, z = async () => {
2646
- const l = `new-${Date.now()}`;
2647
- await u.value?.push(`/${c.value}/${l}`);
2648
- }, $ = (l) => {
2644
+ const s = `new-${Date.now()}`;
2645
+ await u.value?.push(`/${f.value}/${s}`);
2646
+ }, E = (s) => {
2649
2647
  if (e.value)
2650
2648
  try {
2651
- e.value.records(l);
2649
+ e.value.records(s);
2652
2650
  } catch {
2653
2651
  }
2654
- }, te = () => {
2652
+ }, Y = () => {
2655
2653
  if (!t.availableDoctypes.length) return [];
2656
- const l = t.availableDoctypes.map((d) => ({
2657
- id: d,
2658
- doctype: d,
2659
- display_name: P(d),
2660
- record_count: U(d),
2654
+ const s = t.availableDoctypes.map((l) => ({
2655
+ id: l,
2656
+ doctype: l,
2657
+ display_name: H(l),
2658
+ record_count: U(l),
2661
2659
  actions: "View Records"
2662
2660
  }));
2663
2661
  return [
2664
- {
2665
- fieldname: "header",
2666
- component: "div",
2667
- value: `
2668
- <div class="view-header">
2669
- <h1>Available Doctypes</h1>
2670
- </div>
2671
- `
2672
- },
2673
2662
  {
2674
2663
  fieldname: "doctypes_table",
2675
2664
  component: "ATable",
@@ -2711,279 +2700,110 @@ const Uo = { class: "aform" }, zo = {
2711
2700
  view: "list",
2712
2701
  fullWidth: !0
2713
2702
  },
2714
- rows: l
2703
+ rows: s
2715
2704
  }
2716
2705
  ];
2717
- }, W = () => {
2718
- if (!i.value) return [];
2706
+ }, B = () => {
2707
+ if (!c.value) return [];
2719
2708
  if (!e.value) return [];
2720
- const l = m(), d = C();
2721
- if (d.length === 0)
2722
- return [
2723
- {
2724
- fieldname: "header",
2725
- component: "div",
2726
- value: `
2727
- <div class="view-header">
2728
- <nav class="breadcrumbs">
2729
- <a href="/">Home</a>
2730
- <span class="separator">/</span>
2731
- <span class="current">${P(c.value || i.value)}</span>
2732
- </nav>
2733
- <h1>${P(c.value || i.value)} Records</h1>
2734
- </div>
2735
- `
2736
- },
2737
- {
2738
- fieldname: "loading",
2739
- component: "div",
2740
- value: `
2741
- <div class="loading-state">
2742
- <p>Loading ${P(c.value || i.value)} schema...</p>
2743
- </div>
2744
- `
2745
- }
2746
- ];
2747
- const w = l.map((R) => ({
2748
- ...R,
2709
+ const s = g(), l = $();
2710
+ if (l.length === 0)
2711
+ return [];
2712
+ const y = s.map((N) => ({
2713
+ ...N,
2749
2714
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
2750
- id: R.id || "",
2715
+ id: N.id || "",
2751
2716
  actions: "Edit | Delete"
2752
2717
  }));
2753
2718
  return [
2754
2719
  {
2755
- fieldname: "header",
2756
- component: "div",
2757
- value: `
2758
- <div class="view-header">
2759
- <nav class="breadcrumbs">
2760
- <a href="/">Home</a>
2761
- <span class="separator">/</span>
2762
- <span class="current">${P(c.value || i.value)}</span>
2763
- </nav>
2764
- <h1>${P(c.value || i.value)} Records</h1>
2765
- </div>
2766
- `
2767
- },
2768
- {
2769
- fieldname: "actions",
2770
- component: "div",
2771
- value: `
2772
- <div class="view-actions">
2773
- <button class="btn-primary" data-action="create">
2774
- New ${P(c.value || i.value)}
2775
- </button>
2776
- </div>
2777
- `
2778
- },
2779
- ...l.length === 0 ? [
2780
- {
2781
- fieldname: "empty_state",
2782
- component: "div",
2783
- value: `
2784
- <div class="empty-state">
2785
- <p>No ${c.value || i.value} records found.</p>
2786
- <button class="btn-primary" data-action="create">
2787
- Create First Record
2788
- </button>
2789
- </div>
2790
- `
2791
- }
2792
- ] : [
2793
- {
2794
- fieldname: "records_table",
2795
- component: "ATable",
2796
- columns: [
2797
- ...d.map((R) => ({
2798
- label: R.label,
2799
- name: R.fieldname,
2800
- fieldtype: R.fieldtype,
2801
- align: "left",
2802
- edit: !1,
2803
- width: "20ch"
2804
- })),
2805
- {
2806
- label: "Actions",
2807
- name: "actions",
2808
- fieldtype: "Data",
2809
- align: "center",
2810
- edit: !1,
2811
- width: "20ch"
2812
- }
2813
- ],
2814
- config: {
2815
- view: "list",
2816
- fullWidth: !0
2817
- },
2818
- rows: w
2819
- }
2820
- ]
2821
- ];
2822
- }, g = () => {
2823
- if (!i.value) return [];
2824
- if (!e.value) return [];
2825
- try {
2826
- const d = e.value?.registry?.registry[i.value];
2827
- if (!d?.schema)
2828
- return [
2829
- {
2830
- fieldname: "header",
2831
- component: "div",
2832
- value: `
2833
- <div class="view-header">
2834
- <nav class="breadcrumbs">
2835
- <a href="/">Home</a>
2836
- <span class="separator">/</span>
2837
- <a href="/${c.value || i.value}">${P(
2838
- c.value || i.value
2839
- )}</a>
2840
- <span class="separator">/</span>
2841
- <span class="current">${y.value ? "New Record" : p.value}</span>
2842
- </nav>
2843
- <h1>${y.value ? `New ${P(c.value || i.value)}` : `Edit ${P(c.value || i.value)}`}</h1>
2844
- </div>
2845
- `
2846
- },
2720
+ fieldname: "records_table",
2721
+ component: "ATable",
2722
+ columns: [
2723
+ ...l.map((N) => ({
2724
+ label: N.label,
2725
+ name: N.fieldname,
2726
+ fieldtype: N.fieldtype,
2727
+ align: "left",
2728
+ edit: !1,
2729
+ width: "20ch"
2730
+ })),
2847
2731
  {
2848
- fieldname: "loading",
2849
- component: "div",
2850
- value: `
2851
- <div class="loading-state">
2852
- <p>Loading ${P(c.value || i.value)} form...</p>
2853
- </div>
2854
- `
2732
+ label: "Actions",
2733
+ name: "actions",
2734
+ fieldtype: "Data",
2735
+ align: "center",
2736
+ edit: !1,
2737
+ width: "20ch"
2855
2738
  }
2856
- ];
2857
- const w = "toArray" in d.schema ? d.schema.toArray() : d.schema, R = B();
2858
- return [
2859
- {
2860
- fieldname: "header",
2861
- component: "div",
2862
- value: `
2863
- <div class="view-header">
2864
- <nav class="breadcrumbs">
2865
- <a href="/">Home</a>
2866
- <span class="separator">/</span>
2867
- <a href="/${c.value || i.value}">${P(
2868
- c.value || i.value
2869
- )}</a>
2870
- <span class="separator">/</span>
2871
- <span class="current">${y.value ? "New Record" : p.value}</span>
2872
- </nav>
2873
- <h1>
2874
- ${y.value ? `New ${P(c.value || i.value)}` : `Edit ${P(c.value || i.value)}`}
2875
- </h1>
2876
- </div>
2877
- `
2878
- },
2879
- {
2880
- fieldname: "actions",
2881
- component: "div",
2882
- value: `
2883
- <div class="view-actions">
2884
- <button class="btn-primary" data-action="save" ${n.value ? "disabled" : ""}>
2885
- ${n.value ? "Saving..." : "Save"}
2886
- </button>
2887
- <button class="btn-secondary" data-action="cancel">Cancel</button>
2888
- ${y.value ? "" : '<button class="btn-danger" data-action="delete">Delete</button>'}
2889
- </div>
2890
- `
2739
+ ],
2740
+ config: {
2741
+ view: "list",
2742
+ fullWidth: !0
2891
2743
  },
2892
- ...w.map((J) => ({
2893
- ...J,
2894
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
2895
- value: R[J.fieldname] || ""
2896
- }))
2897
- ];
2744
+ rows: y
2745
+ }
2746
+ ];
2747
+ }, v = () => {
2748
+ if (!c.value) return [];
2749
+ if (!e.value) return [];
2750
+ try {
2751
+ const l = e.value?.registry?.registry[c.value];
2752
+ return l?.schema ? "toArray" in l.schema ? l.schema.toArray() : l.schema : [];
2898
2753
  } catch {
2899
- return [
2900
- {
2901
- fieldname: "error",
2902
- component: "div",
2903
- value: `
2904
- <div class="error-state">
2905
- <p>Unable to load form schema for ${P(c.value || i.value)}</p>
2906
- </div>
2907
- `
2908
- }
2909
- ];
2754
+ return [];
2910
2755
  }
2911
- }, m = () => {
2912
- if (!e.value || !i.value)
2756
+ }, g = () => {
2757
+ if (!e.value || !c.value)
2913
2758
  return [];
2914
- const d = e.value.records(i.value)?.get("");
2915
- return d && typeof d == "object" && !Array.isArray(d) ? Object.values(d) : [];
2916
- }, C = () => {
2917
- if (!e.value || !i.value) return [];
2759
+ const l = e.value.records(c.value)?.get("");
2760
+ return l && typeof l == "object" && !Array.isArray(l) ? Object.values(l) : [];
2761
+ }, $ = () => {
2762
+ if (!e.value || !c.value) return [];
2918
2763
  try {
2919
- const d = e.value.registry.registry[i.value];
2920
- if (d?.schema)
2921
- return ("toArray" in d.schema ? d.schema.toArray() : d.schema).map((R) => ({
2922
- fieldname: R.fieldname,
2923
- label: "label" in R && R.label || R.fieldname,
2924
- fieldtype: "fieldtype" in R && R.fieldtype || "Data"
2764
+ const l = e.value.registry.registry[c.value];
2765
+ if (l?.schema)
2766
+ return ("toArray" in l.schema ? l.schema.toArray() : l.schema).map((N) => ({
2767
+ fieldname: N.fieldname,
2768
+ label: "label" in N && N.label || N.fieldname,
2769
+ fieldtype: "fieldtype" in N && N.fieldtype || "Data"
2925
2770
  }));
2926
2771
  } catch {
2927
2772
  }
2928
2773
  return [];
2929
- }, B = () => !e.value || !i.value || y.value ? {} : e.value.getRecordById(i.value, p.value)?.get("") || {}, k = x(() => {
2774
+ }, M = I(() => {
2930
2775
  switch (h.value) {
2931
2776
  case "doctypes":
2932
- return te();
2777
+ return Y();
2933
2778
  case "records":
2934
- return W();
2779
+ return B();
2935
2780
  case "record":
2936
- return g();
2781
+ return v();
2937
2782
  default:
2938
2783
  return [];
2939
2784
  }
2940
- }), I = A([]);
2941
- H(
2942
- k,
2943
- (l) => {
2944
- I.value = [...l];
2945
- },
2946
- { immediate: !0, deep: !0 }
2947
- ), H(
2948
- I,
2949
- (l) => {
2950
- if (!(!e.value || !i.value || !p.value || y.value))
2951
- try {
2952
- const d = e.value.getStore();
2953
- l.forEach((w) => {
2954
- if (w.fieldname && "value" in w && !["header", "actions", "loading", "error"].includes(w.fieldname)) {
2955
- const R = `${i.value}.${p.value}.${w.fieldname}`;
2956
- (d.has(R) ? d.get(R) : void 0) !== w.value && d.set(R, w.value);
2957
- }
2958
- });
2959
- } catch (d) {
2960
- console.warn("HST schema sync failed:", d);
2961
- }
2962
- },
2963
- { deep: !0 }
2964
- );
2965
- const L = async () => {
2785
+ }), k = async () => {
2966
2786
  if (e.value) {
2967
2787
  n.value = !0;
2968
2788
  try {
2969
- const l = s.value || {};
2970
- if (y.value) {
2971
- const d = `record-${Date.now()}`, w = { id: d, ...l };
2972
- e.value.addRecord(i.value, d, w);
2973
- const R = e.value.getRecordById(i.value, d);
2974
- R && await R.triggerTransition("SAVE", {
2789
+ const s = i.value || {};
2790
+ if (b.value) {
2791
+ const l = `record-${Date.now()}`, y = { id: l, ...s };
2792
+ e.value.addRecord(c.value, l, y);
2793
+ const N = e.value.getRecordById(c.value, l);
2794
+ N && await N.triggerTransition("SAVE", {
2975
2795
  currentState: "creating",
2976
2796
  targetState: "saved",
2977
- fsmContext: w
2978
- }), await u.value?.replace(`/${c.value}/${d}`);
2797
+ fsmContext: y
2798
+ }), await u.value?.replace(`/${f.value}/${l}`);
2979
2799
  } else {
2980
- const d = { id: p.value, ...l };
2981
- e.value.addRecord(i.value, p.value, d);
2982
- const w = e.value.getRecordById(i.value, p.value);
2983
- w && await w.triggerTransition("SAVE", {
2800
+ const l = { id: p.value, ...s };
2801
+ e.value.addRecord(c.value, p.value, l);
2802
+ const y = e.value.getRecordById(c.value, p.value);
2803
+ y && await y.triggerTransition("SAVE", {
2984
2804
  currentState: "editing",
2985
2805
  targetState: "saved",
2986
- fsmContext: d
2806
+ fsmContext: l
2987
2807
  });
2988
2808
  }
2989
2809
  } catch {
@@ -2991,165 +2811,165 @@ const Uo = { class: "aform" }, zo = {
2991
2811
  n.value = !1;
2992
2812
  }
2993
2813
  }
2994
- }, E = async () => {
2995
- if (y.value)
2996
- await u.value?.push(`/${c.value}`);
2814
+ }, T = async () => {
2815
+ if (b.value)
2816
+ await u.value?.push(`/${f.value}`);
2997
2817
  else {
2998
2818
  if (e.value) {
2999
- const l = e.value.getRecordById(i.value, p.value);
3000
- l && await l.triggerTransition("CANCEL", {
2819
+ const s = e.value.getRecordById(c.value, p.value);
2820
+ s && await s.triggerTransition("CANCEL", {
3001
2821
  currentState: "editing",
3002
2822
  targetState: "cancelled"
3003
2823
  });
3004
2824
  }
3005
- v();
2825
+ S();
3006
2826
  }
3007
- }, N = (l, d) => {
3008
- d && d();
3009
- }, S = async (l) => {
2827
+ }, F = (s, l) => {
2828
+ l && l();
2829
+ }, w = async (s) => {
3010
2830
  if (!e.value) return;
3011
- const d = l || p.value;
3012
- if (d && confirm("Are you sure you want to delete this record?")) {
3013
- const w = e.value.getRecordById(i.value, d);
3014
- w && await w.triggerTransition("DELETE", {
2831
+ const l = s || p.value;
2832
+ if (l && confirm("Are you sure you want to delete this record?")) {
2833
+ const y = e.value.getRecordById(c.value, l);
2834
+ y && await y.triggerTransition("DELETE", {
3015
2835
  currentState: "editing",
3016
2836
  targetState: "deleted"
3017
- }), e.value.removeRecord(i.value, d), h.value === "record" && await u.value?.push(`/${c.value}`);
2837
+ }), e.value.removeRecord(c.value, l), h.value === "record" && await u.value?.push(`/${f.value}`);
3018
2838
  }
3019
- }, f = async (l) => {
3020
- const d = l.target, w = d.getAttribute("data-action");
3021
- if (w)
3022
- switch (w) {
2839
+ }, D = async (s) => {
2840
+ const l = s.target, y = l.getAttribute("data-action");
2841
+ if (y)
2842
+ switch (y) {
3023
2843
  case "create":
3024
2844
  await z();
3025
2845
  break;
3026
2846
  case "save":
3027
- await L();
2847
+ await k();
3028
2848
  break;
3029
2849
  case "cancel":
3030
- await E();
2850
+ await T();
3031
2851
  break;
3032
2852
  case "delete":
3033
- await S();
2853
+ await w();
3034
2854
  break;
3035
2855
  }
3036
- const R = d.closest("td, th");
3037
- if (R) {
3038
- const J = R.textContent?.trim(), ee = R.closest("tr");
3039
- if (J === "View Records" && ee) {
3040
- const G = ee.querySelectorAll("td");
3041
- if (G.length > 0) {
3042
- const X = G[1].textContent?.trim();
3043
- X && await q(X);
2856
+ const N = l.closest("td, th");
2857
+ if (N) {
2858
+ const j = N.textContent?.trim(), J = N.closest("tr");
2859
+ if (j === "View Records" && J) {
2860
+ const W = J.querySelectorAll("td");
2861
+ if (W.length > 0) {
2862
+ const q = W[1].textContent?.trim();
2863
+ q && await K(q);
3044
2864
  }
3045
- } else if (J?.includes("Edit") && ee) {
3046
- const G = ee.querySelectorAll("td");
3047
- if (G.length > 0) {
3048
- const X = G[0].textContent?.trim();
3049
- X && await K(X);
2865
+ } else if (j?.includes("Edit") && J) {
2866
+ const W = J.querySelectorAll("td");
2867
+ if (W.length > 0) {
2868
+ const q = W[0].textContent?.trim();
2869
+ q && await G(q);
3050
2870
  }
3051
- } else if (J?.includes("Delete") && ee) {
3052
- const G = ee.querySelectorAll("td");
3053
- if (G.length > 0) {
3054
- const X = G[0].textContent?.trim();
3055
- X && await S(X);
2871
+ } else if (j?.includes("Delete") && J) {
2872
+ const W = J.querySelectorAll("td");
2873
+ if (W.length > 0) {
2874
+ const q = W[0].textContent?.trim();
2875
+ q && await w(q);
3056
2876
  }
3057
2877
  }
3058
2878
  }
3059
2879
  };
3060
- H(
3061
- [h, i, p],
2880
+ L(
2881
+ [h, c, p],
3062
2882
  () => {
3063
- h.value === "record" && v();
2883
+ h.value === "record" && S();
3064
2884
  },
3065
2885
  { immediate: !0 }
3066
- ), H(
2886
+ ), L(
3067
2887
  e,
3068
- (l) => {
2888
+ (s) => {
3069
2889
  },
3070
2890
  { immediate: !0 }
3071
- ), H(
3072
- [h, i, e],
3073
- ([l, d, w]) => {
3074
- l === "records" && d && w && $(d);
2891
+ ), L(
2892
+ [h, c, e],
2893
+ ([s, l, y]) => {
2894
+ s === "records" && l && y && E(l);
3075
2895
  },
3076
2896
  { immediate: !0 }
3077
2897
  );
3078
- const v = () => {
3079
- if (!(!e.value || !i.value)) {
2898
+ const S = () => {
2899
+ if (!(!e.value || !c.value)) {
3080
2900
  o.value = !0;
3081
2901
  try {
3082
- y.value || e.value.getRecordById(i.value, p.value);
3083
- } catch (l) {
3084
- console.warn("Error loading record data:", l);
2902
+ b.value || e.value.getRecordById(c.value, p.value);
2903
+ } catch (s) {
2904
+ console.warn("Error loading record data:", s);
3085
2905
  } finally {
3086
2906
  o.value = !1;
3087
2907
  }
3088
2908
  }
3089
2909
  };
3090
2910
  return Ge("desktopMethods", {
3091
- navigateToDoctype: q,
3092
- openRecord: K,
2911
+ navigateToDoctype: K,
2912
+ openRecord: G,
3093
2913
  createNewRecord: z,
3094
- handleSave: L,
3095
- handleCancel: E,
3096
- handleDelete: S
3097
- }), Te(() => {
3098
- se(() => {
3099
- h.value === "records" && i.value && e.value && $(i.value);
2914
+ handleSave: k,
2915
+ handleCancel: T,
2916
+ handleDelete: w
2917
+ }), Ae(() => {
2918
+ ae(() => {
2919
+ h.value === "records" && c.value && e.value && E(c.value);
3100
2920
  });
3101
- const l = (d) => {
3102
- (d.ctrlKey || d.metaKey) && d.key === "k" && (d.preventDefault(), a.value = !0), d.key === "Escape" && a.value && (a.value = !1);
2921
+ const s = (l) => {
2922
+ (l.ctrlKey || l.metaKey) && l.key === "k" && (l.preventDefault(), r.value = !0), l.key === "Escape" && r.value && (r.value = !1);
3103
2923
  };
3104
- return document.addEventListener("keydown", l), () => {
3105
- document.removeEventListener("keydown", l);
2924
+ return document.addEventListener("keydown", s), () => {
2925
+ document.removeEventListener("keydown", s);
3106
2926
  };
3107
- }), (l, d) => (j(), F("div", {
2927
+ }), (s, l) => (P(), V("div", {
3108
2928
  class: "desktop",
3109
- onClick: f
2929
+ onClick: D
3110
2930
  }, [
3111
- ae(_t, {
3112
- elements: _.value,
3113
- onActionClick: N
2931
+ ne(wt, {
2932
+ elements: m.value,
2933
+ onActionClick: F
3114
2934
  }, null, 8, ["elements"]),
3115
- I.value.length > 0 ? (j(), Xe(Oe(Go), {
2935
+ M.value.length > 0 ? (P(), Ze(De(Go), {
3116
2936
  key: 0,
3117
- modelValue: I.value,
3118
- "onUpdate:modelValue": d[0] || (d[0] = (w) => I.value = w),
3119
- data: s.value
3120
- }, null, 8, ["modelValue", "data"])) : Oe(e) ? (j(), F("div", en, [
3121
- T("p", null, "Loading " + Y(h.value) + " data...", 1)
3122
- ])) : (j(), F("div", Yo, [...d[2] || (d[2] = [
3123
- T("p", null, "Initializing Stonecrop...", -1)
2937
+ data: i.value,
2938
+ "onUpdate:data": l[0] || (l[0] = (y) => i.value = y),
2939
+ schema: M.value
2940
+ }, null, 8, ["data", "schema"])) : De(e) ? (P(), V("div", Xo, [
2941
+ A("p", null, "Loading " + X(h.value) + " data...", 1)
2942
+ ])) : (P(), V("div", Qo, [...l[2] || (l[2] = [
2943
+ A("p", null, "Initializing Stonecrop...", -1)
3124
2944
  ])])),
3125
- ae(Rt, { breadcrumbs: D.value }, null, 8, ["breadcrumbs"]),
3126
- ae($t, {
3127
- "is-open": a.value,
3128
- search: V,
2945
+ ne(Nt, { breadcrumbs: O.value }, null, 8, ["breadcrumbs"]),
2946
+ ne(St, {
2947
+ "is-open": r.value,
2948
+ search: R,
3129
2949
  placeholder: "Type a command or search...",
3130
- onSelect: M,
3131
- onClose: d[1] || (d[1] = (w) => a.value = !1)
2950
+ onSelect: x,
2951
+ onClose: l[1] || (l[1] = (y) => r.value = !1)
3132
2952
  }, {
3133
- title: we(({ result: w }) => [
3134
- Re(Y(w.title), 1)
2953
+ title: ye(({ result: y }) => [
2954
+ $e(X(y.title), 1)
3135
2955
  ]),
3136
- content: we(({ result: w }) => [
3137
- Re(Y(w.description), 1)
2956
+ content: ye(({ result: y }) => [
2957
+ $e(X(y.description), 1)
3138
2958
  ]),
3139
2959
  _: 1
3140
2960
  }, 8, ["is-open"])
3141
2961
  ]));
3142
2962
  }
3143
- }), an = {
2963
+ }), on = {
3144
2964
  install: (t) => {
3145
- t.component("ActionSet", _t), t.component("CommandPalette", $t), t.component("Desktop", tn), t.component("SheetNav", Rt);
2965
+ t.component("ActionSet", wt), t.component("CommandPalette", St), t.component("Desktop", Yo), t.component("SheetNav", Nt);
3146
2966
  }
3147
2967
  };
3148
2968
  export {
3149
- _t as ActionSet,
3150
- $t as CommandPalette,
3151
- tn as Desktop,
3152
- Rt as SheetNav,
3153
- an as StonecropDesktop
2969
+ wt as ActionSet,
2970
+ St as CommandPalette,
2971
+ Yo as Desktop,
2972
+ Nt as SheetNav,
2973
+ on as StonecropDesktop
3154
2974
  };
3155
2975
  //# sourceMappingURL=desktop.js.map