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