@aerogel/core 0.0.0-next.fcfbfdc3428c34c4d1c0e781b61d244f13232fc9 → 0.1.0-next.c4b24f52d8b652bd5c14c2d12e1b38b779ab7682

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/dist/aerogel-core.css +1 -0
  2. package/dist/aerogel-core.d.ts +661 -919
  3. package/dist/aerogel-core.js +1983 -1440
  4. package/dist/aerogel-core.js.map +1 -1
  5. package/package.json +7 -5
  6. package/src/components/AppLayout.vue +1 -3
  7. package/src/components/AppOverlays.vue +0 -27
  8. package/src/components/contracts/AlertModal.ts +15 -0
  9. package/src/components/contracts/ConfirmModal.ts +12 -5
  10. package/src/components/contracts/DropdownMenu.ts +8 -3
  11. package/src/components/contracts/ErrorReportModal.ts +8 -4
  12. package/src/components/contracts/Input.ts +7 -7
  13. package/src/components/contracts/LoadingModal.ts +6 -2
  14. package/src/components/contracts/Modal.ts +4 -4
  15. package/src/components/contracts/PromptModal.ts +5 -1
  16. package/src/components/contracts/Select.ts +9 -8
  17. package/src/components/contracts/Toast.ts +4 -2
  18. package/src/components/headless/HeadlessButton.vue +2 -2
  19. package/src/components/headless/HeadlessInputInput.vue +16 -5
  20. package/src/components/headless/HeadlessModal.vue +8 -43
  21. package/src/components/headless/HeadlessModalContent.vue +2 -2
  22. package/src/components/headless/HeadlessSelect.vue +10 -8
  23. package/src/components/headless/HeadlessSelectOptions.vue +8 -3
  24. package/src/components/headless/HeadlessSwitch.vue +96 -0
  25. package/src/components/headless/index.ts +1 -0
  26. package/src/components/ui/AdvancedOptions.vue +1 -1
  27. package/src/components/ui/AlertModal.vue +7 -3
  28. package/src/components/ui/Button.vue +27 -10
  29. package/src/components/ui/ConfirmModal.vue +11 -3
  30. package/src/components/ui/DropdownMenuOption.vue +12 -4
  31. package/src/components/ui/DropdownMenuOptions.vue +18 -1
  32. package/src/components/ui/ErrorLogs.vue +19 -0
  33. package/src/components/ui/ErrorLogsModal.vue +48 -0
  34. package/src/components/ui/ErrorReportModal.vue +18 -7
  35. package/src/components/ui/Input.vue +2 -2
  36. package/src/components/ui/LoadingModal.vue +3 -1
  37. package/src/components/ui/Markdown.vue +29 -1
  38. package/src/components/ui/Modal.vue +61 -21
  39. package/src/components/ui/ModalContext.vue +2 -1
  40. package/src/components/ui/PromptModal.vue +5 -2
  41. package/src/components/ui/Select.vue +5 -3
  42. package/src/components/ui/SelectLabel.vue +5 -1
  43. package/src/components/ui/SelectOptions.vue +6 -1
  44. package/src/components/ui/SelectTrigger.vue +1 -1
  45. package/src/components/ui/Setting.vue +31 -0
  46. package/src/components/ui/StartupCrash.vue +51 -6
  47. package/src/components/ui/Switch.vue +11 -0
  48. package/src/components/ui/TextArea.vue +56 -0
  49. package/src/components/ui/Toast.vue +19 -15
  50. package/src/components/ui/index.ts +5 -0
  51. package/src/directives/measure.ts +11 -5
  52. package/src/errors/Errors.state.ts +1 -0
  53. package/src/errors/Errors.ts +45 -21
  54. package/src/errors/index.ts +6 -2
  55. package/src/errors/settings/Debug.vue +14 -0
  56. package/src/errors/settings/index.ts +10 -0
  57. package/src/forms/FormController.test.ts +35 -9
  58. package/src/forms/FormController.ts +34 -24
  59. package/src/forms/index.ts +0 -1
  60. package/src/forms/utils.ts +58 -33
  61. package/src/forms/validation.ts +31 -0
  62. package/src/index.css +34 -12
  63. package/src/lang/index.ts +1 -1
  64. package/src/lang/settings/Language.vue +1 -1
  65. package/src/services/Events.test.ts +8 -8
  66. package/src/services/Events.ts +2 -8
  67. package/src/services/Service.ts +11 -6
  68. package/src/services/index.ts +2 -2
  69. package/src/testing/index.ts +4 -0
  70. package/src/ui/UI.state.ts +3 -13
  71. package/src/ui/UI.ts +103 -84
  72. package/src/ui/index.ts +16 -17
  73. package/src/utils/app.ts +7 -0
  74. package/src/utils/classes.ts +9 -17
  75. package/src/utils/composition/events.ts +2 -4
  76. package/src/utils/composition/forms.ts +7 -1
  77. package/src/utils/index.ts +1 -0
  78. package/src/utils/markdown.ts +35 -1
  79. package/src/utils/vue.ts +6 -1
  80. package/src/forms/composition.ts +0 -6
@@ -1,39 +1,42 @@
1
- var yt = Object.defineProperty;
2
- var _t = (t, s, e) => s in t ? yt(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e;
3
- var $ = (t, s, e) => _t(t, typeof s != "symbol" ? s + "" : s, e);
4
- import { markRaw as $e, Comment as wt, Text as $t, Static as Ct, inject as ie, reactive as pe, nextTick as qe, defineComponent as g, useAttrs as Fe, useSlots as Ee, computed as u, createBlock as f, openBlock as l, h as xt, unref as o, mergeProps as P, withCtx as m, renderSlot as _, createPropsRestProxy as Y, onUnmounted as fe, onMounted as St, watch as He, toRaw as kt, ref as D, watchEffect as ce, createVNode as h, normalizeProps as ee, guardReactiveProps as te, createTextVNode as V, toDisplayString as S, normalizeClass as k, createElementBlock as b, Fragment as q, renderList as U, readonly as Le, provide as se, resolveDynamicComponent as W, createCommentVNode as E, createElementVNode as y, toRef as Ie, useTemplateRef as re, withModifiers as Ue, withDirectives as Oe, vModelCheckbox as Mt, normalizeStyle as Et, createApp as Ht, vModelText as Lt } from "vue";
5
- import { JSError as he, tap as Z, MagicObject as Ne, PromisedValue as K, Storage as O, objectOnly as ae, arrayFrom as We, isEmpty as ye, objectDeepClone as Rt, fail as Q, facade as G, arrayRemove as Ce, getEnv as Tt, updateLocationQueryParameters as Pt, forever as It, toString as j, isDevelopment as X, isTesting as Re, after as Ve, uuid as le, required as Vt, isObject as xe, objectWithoutEmpty as Ke, stringMatchAll as At, isInstanceOf as Bt, objectWithout as Dt, noop as zt, debounce as jt, value as qt, stringExcerpt as Ft, arraySorted as Ut, ListenersManager as Ot, toError as Nt, round as Wt } from "@noeldemartin/utils";
6
- import N from "virtual:aerogel";
7
- import { createPinia as Kt, setActivePinia as Qt, defineStore as Jt } from "pinia";
8
- import Zt from "dompurify";
9
- import { marked as Gt, Renderer as Ae } from "marked";
10
- import { Primitive as Xt, SelectValue as Be, SelectTrigger as Yt, SelectIcon as es, SelectItem as ts, SelectItemText as ss, SelectPortal as rs, SelectContent as ns, SelectViewport as as, SelectRoot as os, Label as ls, useForwardExpose as Te, DialogRoot as is, DialogPortal as cs, DialogContent as us, DialogDescription as ds, DialogOverlay as ps, DialogTitle as ms, ToastClose as fs, ToastRoot as hs, ToastProvider as gs, ToastViewport as vs, DropdownMenuItem as bs, DropdownMenuContent as ys, DropdownMenuRoot as _s, DropdownMenuTrigger as ws, DropdownMenuPortal as $s } from "reka-ui";
11
- import Cs from "clsx";
12
- import { cva as xs } from "class-variance-authority";
13
- import { twMerge as Ss } from "tailwind-merge";
14
- class Se extends he {
1
+ var kt = Object.defineProperty;
2
+ var St = (t, s, e) => s in t ? kt(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e;
3
+ var _ = (t, s, e) => St(t, typeof s != "symbol" ? s + "" : s, e);
4
+ import { markRaw as E, Comment as Tt, Text as Mt, Static as Ht, inject as X, reactive as pe, nextTick as Oe, unref as o, watchEffect as Y, defineComponent as g, computed as c, createBlock as h, openBlock as u, mergeProps as H, withCtx as f, renderSlot as w, createPropsRestProxy as N, onUnmounted as ge, ref as U, readonly as ve, useAttrs as Ne, onMounted as Et, watch as Me, toRaw as Vt, createVNode as p, normalizeProps as ne, guardReactiveProps as ae, createTextVNode as I, toDisplayString as x, normalizeClass as k, createElementBlock as b, Fragment as D, renderList as F, provide as le, resolveDynamicComponent as W, useSlots as He, createCommentVNode as T, createElementVNode as y, h as Lt, toRef as Re, useTemplateRef as G, withModifiers as We, withDirectives as Ke, vModelCheckbox as It, normalizeStyle as qt, resolveComponent as zt, createApp as Rt, vModelText as Pt } from "vue";
5
+ import { JSError as be, stringToSlug as At, tap as ee, MagicObject as Qe, PromisedValue as K, Storage as O, objectOnly as oe, arrayFrom as Je, isEmpty as xe, objectDeepClone as Dt, fail as Q, facade as te, arrayRemove as Se, getEnv as jt, updateLocationQueryParameters as Bt, forever as Ft, toString as B, isDevelopment as J, isTesting as Ee, after as ue, uuid as re, required as Ut, isObject as ce, objectWithoutEmpty as Ze, stringMatchAll as Xe, objectWithout as Ot, noop as Nt, debounce as Wt, value as Kt, isInstanceOf as Pe, stringExcerpt as Qt, arraySorted as Jt, ListenersManager as Zt, toError as Xt, round as Yt } from "@noeldemartin/utils";
6
+ import j from "virtual:aerogel";
7
+ import { createPinia as Gt, setActivePinia as es, defineStore as ts } from "pinia";
8
+ import ss from "dompurify";
9
+ import { marked as rs, Renderer as Ae } from "marked";
10
+ import ns from "clsx";
11
+ import { cva as as } from "class-variance-authority";
12
+ import { twMerge as ls } from "tailwind-merge";
13
+ import { Primitive as os, SelectValue as De, SelectTrigger as is, SelectIcon as us, SelectItem as cs, SelectItemText as ds, SelectPortal as ps, SelectContent as ms, SelectViewport as fs, SelectRoot as hs, Label as gs, useForwardExpose as Ve, SwitchRoot as vs, SwitchThumb as bs, DialogRoot as ys, DialogPortal as ws, DialogContent as $s, DialogDescription as _s, DialogOverlay as xs, DialogTitle as Cs, ToastClose as ks, ToastRoot as Ss, ToastProvider as Ts, ToastViewport as Ms, DropdownMenuItem as Hs, DropdownMenuContent as Es, DropdownMenuRoot as Vs, DropdownMenuTrigger as Ls, DropdownMenuPortal as Is } from "reka-ui";
14
+ class Te extends be {
15
15
  constructor(s, e) {
16
16
  super(`Service '${s}' failed booting`, { cause: e });
17
17
  }
18
18
  }
19
- let Pe = null;
20
- function Qe() {
21
- return Pe ?? ks();
19
+ function qs() {
20
+ return j.namespace ?? At(j.name);
22
21
  }
23
- function ks() {
24
- return Z(Kt(), (t) => {
25
- Pe = t, Qt(t);
22
+ let Le = null;
23
+ function Ye() {
24
+ return Le ?? zs();
25
+ }
26
+ function zs() {
27
+ return ee(Gt(), (t) => {
28
+ Le = t, es(t);
26
29
  });
27
30
  }
28
- function Ms() {
29
- return Pe ?? Qe();
31
+ function Rs() {
32
+ return Le ?? Ye();
30
33
  }
31
- function Es(t, s) {
32
- return Qe(), Jt(t, s)();
34
+ function Ps(t, s) {
35
+ return Ye(), ts(t, s)();
33
36
  }
34
- function ge(t) {
37
+ function ye(t) {
35
38
  var s;
36
- return s = class extends ve {
39
+ return s = class extends we {
37
40
  usesStore() {
38
41
  return !0;
39
42
  }
@@ -67,19 +70,19 @@ To fix this problem, declare your initialState as a function instead.`
67
70
  var r;
68
71
  return ((r = t.restore) == null ? void 0 : r.call(t, e)) ?? e;
69
72
  }
70
- }, $(s, "persist", t.persist ?? []), s;
73
+ }, _(s, "persist", t.persist ?? []), s;
71
74
  }
72
- var we;
73
- let ve = (we = class extends Ne {
75
+ var ke;
76
+ let we = (ke = class extends Qe {
74
77
  constructor() {
75
78
  super();
76
- $(this, "_name");
77
- $(this, "_booted");
78
- $(this, "_computedStateKeys");
79
- $(this, "_watchers");
80
- $(this, "_store");
79
+ _(this, "_name");
80
+ _(this, "_booted");
81
+ _(this, "_computedStateKeys");
82
+ _(this, "_watchers");
83
+ _(this, "_store");
81
84
  const e = this.getComputedStateDefinition();
82
- this._name = this.getName() ?? new.target.name, this._booted = new K(), this._computedStateKeys = new Set(Object.keys(e)), this._watchers = this.getStateWatchers(), this._store = this.usesStore() && Es(this._name, {
85
+ this._name = this.getName() ?? new.target.name, this._booted = new K(), this._computedStateKeys = new Set(Object.keys(e)), this._watchers = this.getStateWatchers(), this._store = this.usesStore() && Ps(this._name, {
83
86
  state: () => this.getInitialState(),
84
87
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
85
88
  getters: e
@@ -92,7 +95,7 @@ let ve = (we = class extends Ne {
92
95
  return super.static(e);
93
96
  }
94
97
  launch() {
95
- const e = (r) => this._booted.reject(new Se(this._name, r));
98
+ const e = (r) => this._booted.reject(new Te(this._name, r));
96
99
  try {
97
100
  this.frameworkBoot().then(() => this.boot()).then(() => this._booted.resolve()).catch(e);
98
101
  } catch (r) {
@@ -101,7 +104,7 @@ let ve = (we = class extends Ne {
101
104
  return this._booted;
102
105
  }
103
106
  hasPersistedState() {
104
- return O.has(this._name);
107
+ return O.has(this.storageKey);
105
108
  }
106
109
  hasState(e) {
107
110
  return this._store ? e in this._store.$state || this._computedStateKeys.has(e) : !1;
@@ -113,14 +116,14 @@ let ve = (we = class extends Ne {
113
116
  setState(e, r) {
114
117
  if (!this._store)
115
118
  return;
116
- const n = typeof e == "string" ? { [e]: r } : e, a = ae(this._store.$state, Object.keys(n));
119
+ const n = typeof e == "string" ? { [e]: r } : e, a = oe(this._store.$state, Object.keys(n));
117
120
  Object.assign(this._store.$state, n), this.onStateUpdated(n, a);
118
121
  }
119
122
  updatePersistedState(e) {
120
123
  if (!this._store)
121
124
  return;
122
- const r = We(e), n = ae(this._store.$state, r);
123
- ye(n) || this.onPersistentStateUpdated(n);
125
+ const r = Je(e), n = oe(this._store.$state, r);
126
+ xe(n) || this.onPersistentStateUpdated(n);
124
127
  }
125
128
  __get(e) {
126
129
  return this.hasState(e) ? this.getState(e) : super.__get(e);
@@ -128,19 +131,22 @@ let ve = (we = class extends Ne {
128
131
  __set(e, r) {
129
132
  this.setState({ [e]: r });
130
133
  }
134
+ get storageKey() {
135
+ return `${qs()}:${this._name}`;
136
+ }
131
137
  onStateUpdated(e, r) {
132
- const n = ae(e, this.static("persist"));
133
- ye(n) || this.onPersistentStateUpdated(n);
138
+ const n = oe(e, this.static("persist"));
139
+ xe(n) || this.onPersistentStateUpdated(n);
134
140
  for (const a in e) {
135
141
  const i = this._watchers[a];
136
142
  !i || e[a] === r[a] || i.call(this, e[a], r[a]);
137
143
  }
138
144
  }
139
145
  onPersistentStateUpdated(e) {
140
- const r = O.get(this._name);
141
- r && O.set(this._name, {
146
+ const r = O.get(this.storageKey);
147
+ r && O.set(this.storageKey, {
142
148
  ...r,
143
- ...this.serializePersistedState(Rt(e))
149
+ ...this.serializePersistedState(Dt(e))
144
150
  });
145
151
  }
146
152
  usesStore() {
@@ -170,37 +176,40 @@ let ve = (we = class extends Ne {
170
176
  async boot() {
171
177
  }
172
178
  restorePersistedState() {
173
- if (!(!this.usesStore() || ye(this.static("persist")))) {
174
- if (O.has(this._name)) {
175
- const e = O.require(this._name);
179
+ if (!(!this.usesStore() || xe(this.static("persist")))) {
180
+ if (O.has(this.storageKey)) {
181
+ const e = O.require(this.storageKey);
176
182
  this.setState(this.deserializePersistedState(e));
177
183
  return;
178
184
  }
179
- O.set(this._name, ae(this.getState(), this.static("persist")));
185
+ O.set(this.storageKey, oe(this.getState(), this.static("persist")));
180
186
  }
181
187
  }
182
188
  requireStore() {
183
189
  return this._store ? this._store : Q(`Failed getting '${this._name}' store`);
184
190
  }
185
- }, $(we, "persist", []), we);
186
- const va = {
191
+ }, _(ke, "persist", []), ke);
192
+ const ll = {
187
193
  Low: -256,
188
194
  Default: 0,
189
195
  High: 256
190
196
  };
191
- class Hs extends ve {
197
+ class As extends we {
192
198
  constructor() {
193
199
  super(...arguments);
194
- $(this, "listeners", {});
200
+ _(this, "listeners", {});
195
201
  }
196
202
  async boot() {
197
- Object.entries(globalThis.__aerogelEvents__ ?? {}).forEach(([e, r]) => this.on(e, r));
203
+ Object.entries(globalThis.__aerogelEvents__ ?? {}).forEach(([e, r]) => (
204
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
205
+ this.on(e, r)
206
+ ));
198
207
  }
199
208
  async emit(e, r) {
200
209
  var a;
201
210
  const n = this.listeners[e] ?? { priorities: [], handlers: {} };
202
211
  for (const i of n.priorities)
203
- await Promise.all(((a = n.handlers[i]) == null ? void 0 : a.map((c) => c(r))) ?? []);
212
+ await Promise.all(((a = n.handlers[i]) == null ? void 0 : a.map((l) => l(r))) ?? []);
204
213
  }
205
214
  // prettier-ignore
206
215
  /* eslint-enable max-len */
@@ -212,11 +221,11 @@ class Hs extends ve {
212
221
  /* eslint-enable max-len */
213
222
  once(e, r, n) {
214
223
  let a = null;
215
- const i = typeof r == "function" ? {} : r, c = typeof r == "function" ? r : n;
216
- return Z(
224
+ const i = typeof r == "function" ? {} : r, l = typeof r == "function" ? r : n;
225
+ return ee(
217
226
  () => a && this.off(e, a),
218
- (p) => {
219
- a = (...d) => (p(), c(...d)), this.registerListener(e, i, c);
227
+ (d) => {
228
+ a = (...v) => (d(), l(...v)), this.registerListener(e, i, l);
220
229
  }
221
230
  );
222
231
  }
@@ -226,30 +235,30 @@ class Hs extends ve {
226
235
  if (!n)
227
236
  return;
228
237
  const a = [...n.priorities];
229
- for (const c of a)
230
- Ce(n.handlers[c] ?? [], r), ((i = n.handlers[c]) == null ? void 0 : i.length) === 0 && (delete n.handlers[c], Ce(n.priorities, c));
238
+ for (const l of a)
239
+ Se(n.handlers[l] ?? [], r), ((i = n.handlers[l]) == null ? void 0 : i.length) === 0 && (delete n.handlers[l], Se(n.priorities, l));
231
240
  n.priorities.length === 0 && delete this.listeners[e];
232
241
  }
233
242
  registerListener(e, r, n) {
234
- var p, d, w;
243
+ var d, v, $;
235
244
  const a = r.priority ?? 0;
236
245
  e in this.listeners || (this.listeners[e] = { priorities: [], handlers: {} });
237
- const i = ((p = this.listeners[e]) == null ? void 0 : p.priorities) ?? Q(`priorities missing for event '${e}'`), c = ((d = this.listeners[e]) == null ? void 0 : d.handlers) ?? Q(`handlers missing for event '${e}'`);
238
- i.includes(a) || (i.push(a), i.sort((v, C) => C - v), c[a] = []), (w = c[a]) == null || w.push(n);
246
+ const i = ((d = this.listeners[e]) == null ? void 0 : d.priorities) ?? Q(`priorities missing for event '${e}'`), l = ((v = this.listeners[e]) == null ? void 0 : v.handlers) ?? Q(`handlers missing for event '${e}'`);
247
+ i.includes(a) || (i.push(a), i.sort((m, C) => C - m), l[a] = []), ($ = l[a]) == null || $.push(n);
239
248
  }
240
249
  }
241
- const M = G(Hs);
242
- function ba(t) {
250
+ const R = te(As);
251
+ function ol(t) {
243
252
  return t;
244
253
  }
245
- const Ls = ge({
254
+ const Ds = ye({
246
255
  name: "app",
247
256
  initialState: {
248
257
  plugins: {},
249
258
  instance: null,
250
- environment: Tt() ?? "development",
251
- version: N.version,
252
- sourceUrl: N.sourceUrl,
259
+ environment: jt() ?? "development",
260
+ version: j.version,
261
+ sourceUrl: j.sourceUrl,
253
262
  settings: []
254
263
  },
255
264
  computed: {
@@ -257,19 +266,19 @@ const Ls = ge({
257
266
  staging: (t) => t.environment === "staging",
258
267
  testing: (t) => t.environment === "test" || t.environment === "testing",
259
268
  versionName(t) {
260
- return this.development ? "dev." + N.sourceHash.toString().substring(0, 7) : this.staging ? "staging." + N.sourceHash.toString().substring(0, 7) : `v${t.version}`;
269
+ return this.development ? "dev." + j.sourceHash.toString().substring(0, 7) : this.staging ? "staging." + j.sourceHash.toString().substring(0, 7) : `v${t.version}`;
261
270
  },
262
271
  versionUrl(t) {
263
- return t.sourceUrl + (this.development || this.staging ? `/tree/${N.sourceHash}` : `/releases/tag/${this.versionName}`);
272
+ return t.sourceUrl + (this.development || this.staging ? `/tree/${j.sourceHash}` : `/releases/tag/${this.versionName}`);
264
273
  }
265
274
  }
266
275
  });
267
- class Rs extends Ls {
276
+ class js extends Ds {
268
277
  constructor() {
269
278
  super(...arguments);
270
- $(this, "name", N.name);
271
- $(this, "ready", new K());
272
- $(this, "mounted", new K());
279
+ _(this, "name", j.name);
280
+ _(this, "ready", new K());
281
+ _(this, "mounted", new K());
273
282
  }
274
283
  isReady() {
275
284
  return this.ready.isResolved();
@@ -278,13 +287,13 @@ class Rs extends Ls {
278
287
  return this.mounted.isResolved();
279
288
  }
280
289
  addSetting(e) {
281
- this.settings.push($e(e));
290
+ this.settings.push(E(e));
282
291
  }
283
292
  async whenReady(e) {
284
293
  return await this.ready.then(e);
285
294
  }
286
295
  async reload(e) {
287
- e && Pt(e), location.reload(), await It();
296
+ e && Bt(e), location.reload(), await Ft();
288
297
  }
289
298
  plugin(e) {
290
299
  return this.plugins[e] ?? null;
@@ -294,15 +303,15 @@ class Rs extends Ls {
294
303
  return ((r = this.instance) == null ? void 0 : r.config.globalProperties[e]) ?? null;
295
304
  }
296
305
  async boot() {
297
- M.once("application-ready", () => this.ready.resolve()), M.once("application-mounted", () => this.mounted.resolve());
306
+ R.once("application-ready", () => this.ready.resolve()), R.once("application-mounted", () => this.mounted.resolve());
298
307
  }
299
308
  }
300
- const z = G(Rs);
301
- function ya(t) {
309
+ const A = te(js);
310
+ function il(t) {
302
311
  return t;
303
312
  }
304
- async function Ts(t, ...s) {
305
- z.setState(
313
+ async function Bs(t, ...s) {
314
+ A.setState(
306
315
  "plugins",
307
316
  t.reduce(
308
317
  (e, r) => (r.name && (e[r.name] = r), e),
@@ -310,55 +319,55 @@ async function Ts(t, ...s) {
310
319
  )
311
320
  ), await Promise.all(t.map((e) => e.install(...s)) ?? []);
312
321
  }
313
- function Ps(t) {
314
- return Object.entries(t.props ?? {}).reduce((s, [e, r]) => s + `${e}="${j(r)}"`, "");
322
+ function Fs(t) {
323
+ return Object.entries(t.props ?? {}).reduce((s, [e, r]) => s + `${e}="${B(r)}"`, "");
315
324
  }
316
- function _a(t) {
325
+ function ul(t) {
317
326
  return t;
318
327
  }
319
- function Is(t) {
320
- const s = ie(t);
328
+ function Us(t) {
329
+ const s = X(t);
321
330
  return s ? pe(s) : void 0;
322
331
  }
323
- function R(t, s) {
324
- return Is(t) ?? Q(s ?? `Could not resolve '${j(t)}' injection key`);
332
+ function V(t, s) {
333
+ return Us(t) ?? Q(s ?? `Could not resolve '${B(t)}' injection key`);
325
334
  }
326
- function Vs(t, s) {
327
- return ie(t) ?? Q(s ?? `Could not resolve '${j(t)}' injection key`);
335
+ function Os(t, s) {
336
+ return X(t) ?? Q(s ?? `Could not resolve '${B(t)}' injection key`);
328
337
  }
329
- function Je(t) {
330
- return typeof t == "string" ? t : t.type === wt ? "" : t.type === $t || t.type === Ct ? t.children : t.type === "br" ? `
338
+ function Ge(t) {
339
+ return typeof t == "string" ? t : t.type === Tt ? "" : t.type === Mt || t.type === Ht ? t.children : t.type === "br" ? `
331
340
 
332
- ` : `<${t.type} ${Ps(t)}>${Array.from(t.children).map(Je).join("")}</${t.type}>`;
341
+ ` : `<${t.type} ${Fs(t)}>${Array.from(t.children).map(Ge).join("")}</${t.type}>`;
333
342
  }
334
- const _e = /* @__PURE__ */ new WeakMap(), As = {
335
- mounted(t, { value: s }) {
336
- const e = typeof s == "function" ? s : null, r = () => {
337
- const n = t.getBoundingClientRect();
338
- t.style.setProperty("--width", `${n.width}px`), t.style.setProperty("--height", `${n.height}px`), e == null || e({ width: n.width, height: n.height });
343
+ const Ce = /* @__PURE__ */ new WeakMap(), Ns = {
344
+ mounted(t, { value: s, modifiers: e }) {
345
+ const r = typeof s == "function" ? s : null, n = () => {
346
+ const a = t.getBoundingClientRect();
347
+ e.css && (t.style.setProperty("--width", `${a.width}px`), t.style.setProperty("--height", `${a.height}px`)), r == null || r({ width: a.width, height: a.height });
339
348
  };
340
- _e.set(t, Z(new ResizeObserver(r)).observe(t)), r();
349
+ e.watch && Ce.set(t, ee(new ResizeObserver(n)).observe(t)), n();
341
350
  },
342
351
  unmounted(t) {
343
352
  var s;
344
- (s = _e.get(t)) == null || s.unobserve(t), _e.delete(t);
353
+ (s = Ce.get(t)) == null || s.unobserve(t), Ce.delete(t);
345
354
  }
346
- }, Bs = {
347
- measure: As
348
- }, Ds = {
355
+ }, Ws = {
356
+ measure: Ns
357
+ }, Ks = {
349
358
  install(t, s) {
350
359
  const e = {
351
- ...Bs,
360
+ ...Ws,
352
361
  ...s.directives
353
362
  };
354
363
  for (const [r, n] of Object.entries(e))
355
364
  t.directive(r, n);
356
365
  }
357
366
  };
358
- class zs extends ve {
367
+ class Qs extends we {
359
368
  constructor() {
360
369
  super(...arguments);
361
- $(this, "cache");
370
+ _(this, "cache");
362
371
  }
363
372
  async get(e) {
364
373
  return await (await this.open()).match(e) ?? null;
@@ -371,30 +380,30 @@ class zs extends ve {
371
380
  (await n.keys(e)).length !== 0 && await n.put(e, r);
372
381
  }
373
382
  async open() {
374
- return this.cache = this.cache ?? Z(new K(), (e) => {
383
+ return this.cache = this.cache ?? ee(new K(), (e) => {
375
384
  caches.open("app").then((r) => e.resolve(r));
376
385
  });
377
386
  }
378
387
  }
379
- const wa = G(zs);
380
- class js extends ve {
388
+ const cl = te(Qs);
389
+ class Js extends we {
381
390
  async purge() {
382
- await M.emit("purge-storage");
391
+ await R.emit("purge-storage");
383
392
  }
384
393
  }
385
- const qs = G(js);
386
- function $a(t, s) {
394
+ const et = te(Js);
395
+ function dl(t, s) {
387
396
  return {
388
397
  ...t,
389
- ...ae(s, Object.keys(t))
398
+ ...oe(s, Object.keys(t))
390
399
  };
391
400
  }
392
- const Fs = {
393
- $app: z,
394
- $events: M,
395
- $storage: qs
401
+ const Zs = {
402
+ $app: A,
403
+ $events: R,
404
+ $storage: et
396
405
  };
397
- async function be(t, s) {
406
+ async function $e(t, s) {
398
407
  await Promise.all(
399
408
  Object.entries(s).map(async ([e, r]) => {
400
409
  await r.launch().catch((n) => {
@@ -402,50 +411,45 @@ async function be(t, s) {
402
411
  return (i = (a = t.config).errorHandler) == null ? void 0 : i.call(a, n, null, `Failed launching ${e}.`);
403
412
  });
404
413
  })
405
- ), Object.assign(t.config.globalProperties, s), (X() || Re()) && Object.assign(globalThis, s);
414
+ ), Object.assign(t.config.globalProperties, s), (J() || Ee()) && Object.assign(globalThis, s);
406
415
  }
407
- const Us = {
416
+ const Xs = {
408
417
  async install(t, s) {
409
418
  var r;
410
419
  const e = {
411
- ...Fs,
420
+ ...Zs,
412
421
  ...s.services
413
422
  };
414
- t.use(Ms()), (r = s.settings) == null || r.forEach((n) => z.addSetting(n)), await be(t, e);
423
+ t.use(Rs()), (r = s.settings) == null || r.forEach((n) => A.addSetting(n)), await $e(t, e);
415
424
  }
416
- }, Ze = 768, me = {
425
+ }, tt = 768, me = {
417
426
  Mobile: "mobile",
418
427
  Desktop: "desktop"
419
428
  };
420
- function Ge() {
421
- return globalThis.innerWidth > Ze ? me.Desktop : me.Mobile;
429
+ function st() {
430
+ return globalThis.innerWidth > tt ? me.Desktop : me.Mobile;
422
431
  }
423
- const Os = ge({
432
+ const Ys = ye({
424
433
  name: "ui",
425
434
  initialState: {
426
435
  modals: [],
427
436
  toasts: [],
428
- layout: Ge()
437
+ layout: st()
429
438
  },
430
439
  computed: {
440
+ desktop: ({ layout: t }) => t === me.Desktop,
431
441
  mobile: ({ layout: t }) => t === me.Mobile,
432
- desktop: ({ layout: t }) => t === me.Desktop
433
- }
434
- }), L = {
435
- AlertModal: "alert-modal",
436
- ConfirmModal: "confirm-modal",
437
- ErrorReportModal: "error-report-modal",
438
- LoadingModal: "loading-modal",
439
- PromptModal: "prompt-modal",
440
- Toast: "toast",
441
- StartupCrash: "startup-crash",
442
- RouterLink: "router-link"
443
- };
444
- class Ns extends Os {
442
+ openModals: ({ modals: t }) => t.filter(({ closing: s }) => !s)
443
+ }
444
+ });
445
+ class Gs extends Ys {
445
446
  constructor() {
446
447
  super(...arguments);
447
- $(this, "modalCallbacks", {});
448
- $(this, "components", {});
448
+ _(this, "modalCallbacks", {});
449
+ _(this, "components", {});
450
+ }
451
+ registerComponent(e, r) {
452
+ this.components[e] = r;
449
453
  }
450
454
  resolveComponent(e) {
451
455
  return this.components[e] ?? null;
@@ -458,10 +462,7 @@ class Ns extends Os {
458
462
  title: e,
459
463
  message: r
460
464
  };
461
- this.openModal(
462
- this.requireComponent(L.AlertModal),
463
- n()
464
- );
465
+ this.modal(this.requireComponent("alert-modal"), n());
465
466
  }
466
467
  // prettier-ignore
467
468
  /* eslint-enable max-len */
@@ -475,20 +476,17 @@ class Ns extends Os {
475
476
  title: e,
476
477
  message: r,
477
478
  required: !!(n != null && n.required)
478
- }, p = await (await this.openModal(
479
- this.requireComponent(L.ConfirmModal),
480
- i
481
- )).beforeClose, d = typeof p == "object" ? p[0] : p ?? !1, w = typeof p == "object" ? p[1] : Object.entries(i.checkboxes ?? {}).reduce(
482
- (v, [C, { default: T }]) => ({
483
- [C]: T ?? !1,
484
- ...v
479
+ }, l = await this.modalForm(this.requireComponent("confirm-modal"), i), d = typeof l == "object" ? l[0] : l ?? !1, v = typeof l == "object" ? l[1] : Object.entries(i.checkboxes ?? {}).reduce(
480
+ ($, [m, { default: C }]) => ({
481
+ [m]: C ?? !1,
482
+ ...$
485
483
  }),
486
484
  {}
487
485
  );
488
- for (const [v, C] of Object.entries(i.checkboxes ?? {}))
489
- if (!(!C.required || w[v]))
490
- return d && X() && console.warn(`Confirmed confirm modal was suppressed because required '${v}' checkbox was missing`), [!1, w];
491
- return "checkboxes" in i ? [d, w] : d;
486
+ for (const [$, m] of Object.entries(i.checkboxes ?? {}))
487
+ if (!(!m.required || v[$]))
488
+ return d && J() && console.warn(`Confirmed confirm modal was suppressed because required '${$}' checkbox was missing`), [!1, v];
489
+ return "checkboxes" in i ? [d, v] : d;
492
490
  }
493
491
  async prompt(e, r, n) {
494
492
  const a = (n == null ? void 0 : n.trim) ?? !0, i = () => typeof r != "string" ? {
@@ -498,98 +496,105 @@ class Ns extends Os {
498
496
  title: e,
499
497
  message: r,
500
498
  ...n ?? {}
501
- }, p = await (await this.openModal(
502
- this.requireComponent(L.PromptModal),
503
- i()
504
- )).beforeClose;
505
- return (a && typeof p == "string" ? p == null ? void 0 : p.trim() : p) ?? null;
499
+ }, l = await this.modalForm(this.requireComponent("prompt-modal"), i());
500
+ return (a && typeof l == "string" ? l == null ? void 0 : l.trim() : l) ?? null;
506
501
  }
507
502
  async loading(e, r) {
508
- const n = (d) => typeof d == "function" ? Promise.resolve(d()) : d, a = () => typeof e == "string" ? {
509
- props: { message: e },
510
- operationPromise: n(r)
511
- } : typeof e == "function" || e instanceof Promise ? { operationPromise: n(e) } : {
512
- props: e,
513
- operationPromise: n(r)
514
- }, { operationPromise: i, props: c } = a(), p = await this.openModal(this.requireComponent(L.LoadingModal), c);
503
+ const n = (m) => typeof m == "function" ? Promise.resolve(m()) : m, a = () => {
504
+ if (typeof e == "string")
505
+ return {
506
+ props: { message: e },
507
+ operationPromise: n(r)
508
+ };
509
+ if (typeof e == "function" || e instanceof Promise)
510
+ return { operationPromise: n(e) };
511
+ const { delay: m, ...C } = e;
512
+ return {
513
+ props: C,
514
+ delay: o(m),
515
+ operationPromise: n(r)
516
+ };
517
+ };
518
+ let i = !1;
519
+ const { operationPromise: l, props: d, delay: v } = a();
520
+ if (v && await Promise.race([ue({ ms: v }).then(() => i = !0), l]), v && !i)
521
+ return l;
522
+ const $ = await this.modal(this.requireComponent("loading-modal"), d);
515
523
  try {
516
- const d = await i;
517
- return await Ve({ ms: 500 }), d;
524
+ const m = await l;
525
+ return await ue({ ms: 500 }), m;
518
526
  } finally {
519
- await this.closeModal(p.id);
527
+ await this.closeModal($.id);
520
528
  }
521
529
  }
522
530
  toast(e, r = {}) {
523
531
  const { component: n, ...a } = r, i = {
524
- id: le(),
532
+ id: re(),
525
533
  properties: { message: e, ...a },
526
- component: $e(n ?? this.requireComponent(L.Toast))
534
+ component: E(n ?? this.requireComponent("toast"))
527
535
  };
528
536
  this.setState("toasts", this.toasts.concat(i));
529
537
  }
530
- registerComponent(e, r) {
531
- this.components[e] = r;
532
- }
533
- async openModal(e, r) {
534
- const n = le(), a = {}, i = {
538
+ async modal(e, r) {
539
+ const n = re(), a = {}, i = {
535
540
  id: n,
541
+ closing: !1,
536
542
  properties: r ?? {},
537
- component: $e(e),
543
+ component: E(e),
538
544
  beforeClose: new Promise((d) => a.willClose = d),
539
- afterClose: new Promise((d) => a.closed = d)
540
- }, c = this.modals.at(-1), p = this.modals.concat(i);
541
- return this.modalCallbacks[i.id] = a, this.setState({ modals: p }), await qe(), await (c && M.emit("hide-modal", { id: c.id })), await Promise.all([
542
- c || M.emit("show-overlays-backdrop"),
543
- M.emit("show-modal", { id: i.id })
544
- ]), i;
545
+ afterClose: new Promise((d) => a.hasClosed = d)
546
+ }, l = this.modals.concat(i);
547
+ return this.modalCallbacks[i.id] = a, this.setState({ modals: l }), await Oe(), i;
548
+ }
549
+ async modalForm(e, r) {
550
+ return await (await this.modal(e, r)).beforeClose;
545
551
  }
546
552
  async closeModal(e, r) {
547
- if (!z.isMounted()) {
553
+ if (!A.isMounted()) {
548
554
  await this.removeModal(e, r);
549
555
  return;
550
556
  }
551
- await M.emit("close-modal", { id: e, result: r });
557
+ await R.emit("close-modal", { id: e, result: r });
552
558
  }
553
559
  async closeAllModals() {
554
560
  for (; this.modals.length > 0; )
555
- await this.closeModal(Vt(this.modals[this.modals.length - 1]).id);
561
+ await this.closeModal(Ut(this.modals[this.modals.length - 1]).id);
556
562
  }
557
563
  async boot() {
558
564
  this.watchModalEvents(), this.watchMountedEvent(), this.watchViewportBreakpoints();
559
565
  }
560
566
  async removeModal(e, r) {
561
- var a, i;
567
+ var n, a;
562
568
  this.setState(
563
569
  "modals",
564
- this.modals.filter((c) => c.id !== e)
565
- ), (i = (a = this.modalCallbacks[e]) == null ? void 0 : a.closed) == null || i.call(a, r), delete this.modalCallbacks[e];
566
- const n = this.modals.at(-1);
567
- await (n && M.emit("show-modal", { id: n.id }));
570
+ this.modals.filter((i) => i.id !== e)
571
+ ), (a = (n = this.modalCallbacks[e]) == null ? void 0 : n.hasClosed) == null || a.call(n, r), delete this.modalCallbacks[e];
568
572
  }
569
573
  watchModalEvents() {
570
- M.on("modal-will-close", ({ modal: e, result: r }) => {
571
- var n, a;
572
- (a = (n = this.modalCallbacks[e.id]) == null ? void 0 : n.willClose) == null || a.call(n, r), this.modals.length === 1 && M.emit("hide-overlays-backdrop");
573
- }), M.on("modal-closed", async ({ modal: { id: e }, result: r }) => {
574
+ R.on("modal-will-close", ({ modal: { id: e }, result: r }) => {
575
+ var a, i;
576
+ const n = this.modals.find((l) => e === l.id);
577
+ n && (n.closing = !0), (i = (a = this.modalCallbacks[e]) == null ? void 0 : a.willClose) == null || i.call(a, r);
578
+ }), R.on("modal-has-closed", async ({ modal: { id: e }, result: r }) => {
574
579
  await this.removeModal(e, r);
575
580
  });
576
581
  }
577
582
  watchMountedEvent() {
578
- M.once("application-mounted", async () => {
583
+ R.once("application-mounted", async () => {
579
584
  if (!globalThis.document || !globalThis.getComputedStyle)
580
585
  return;
581
586
  const e = globalThis.document.getElementById("splash");
582
- e && (globalThis.getComputedStyle(e).opacity !== "0" && (e.style.opacity = "0", await Ve({ ms: 600 })), e.remove());
587
+ e && (globalThis.getComputedStyle(e).opacity !== "0" && (e.style.opacity = "0", await ue({ ms: 600 })), e.remove());
583
588
  });
584
589
  }
585
590
  watchViewportBreakpoints() {
586
591
  if (!globalThis.matchMedia)
587
592
  return;
588
- globalThis.matchMedia(`(min-width: ${Ze}px)`).addEventListener("change", () => this.setState({ layout: Ge() }));
593
+ globalThis.matchMedia(`(min-width: ${tt}px)`).addEventListener("change", () => this.setState({ layout: st() }));
589
594
  }
590
595
  }
591
- const I = G(Ns);
592
- class Ws {
596
+ const z = te(Gs);
597
+ class er {
593
598
  constructor(s, e) {
594
599
  this.locale = s, this.fallbackLocale = e;
595
600
  }
@@ -609,13 +614,13 @@ class Ws {
609
614
  return ["en"];
610
615
  }
611
616
  translate(s) {
612
- return X() && console.warn("Lang provider is missing"), s;
617
+ return J() && console.warn("Lang provider is missing"), s;
613
618
  }
614
619
  translateWithDefault(s, e) {
615
- return X() && console.warn("Lang provider is missing"), e;
620
+ return J() && console.warn("Lang provider is missing"), e;
616
621
  }
617
622
  }
618
- const Ks = ge({
623
+ const tr = ye({
619
624
  name: "lang",
620
625
  persist: ["locale", "fallbackLocale"],
621
626
  initialState: {
@@ -624,11 +629,11 @@ const Ks = ge({
624
629
  fallbackLocale: "en"
625
630
  }
626
631
  });
627
- class Qs extends Ks {
632
+ class sr extends tr {
628
633
  constructor() {
629
634
  super();
630
- $(this, "provider");
631
- this.provider = new Ws(
635
+ _(this, "provider");
636
+ this.provider = new er(
632
637
  this.getState("locale") ?? this.getBrowserLocale(),
633
638
  this.getState("fallbackLocale")
634
639
  );
@@ -656,11 +661,12 @@ class Qs extends Ks {
656
661
  );
657
662
  }
658
663
  }
659
- const J = G(Qs), Xe = J.translate.bind(J), x = J.translateWithDefault.bind(J), Js = ge({
664
+ const Z = te(sr), rt = Z.translate.bind(Z), S = Z.translateWithDefault.bind(Z), rr = ye({
660
665
  name: "errors",
661
666
  initialState: {
662
667
  logs: [],
663
- startupErrors: []
668
+ startupErrors: [],
669
+ debug: !1
664
670
  },
665
671
  computed: {
666
672
  hasErrors: ({ logs: t }) => t.length > 0,
@@ -668,11 +674,12 @@ const J = G(Qs), Xe = J.translate.bind(J), x = J.translateWithDefault.bind(J), J
668
674
  hasStartupErrors: ({ startupErrors: t }) => t.length > 0
669
675
  }
670
676
  });
671
- class Zs extends Js {
677
+ class nr extends rr {
672
678
  constructor() {
673
679
  super(...arguments);
674
- $(this, "forceReporting", !1);
675
- $(this, "enabled", !0);
680
+ _(this, "forceReporting", !1);
681
+ _(this, "enabled", !0);
682
+ _(this, "eruda", null);
676
683
  }
677
684
  enable() {
678
685
  this.enabled = !0;
@@ -680,20 +687,18 @@ class Zs extends Js {
680
687
  disable() {
681
688
  this.enabled = !1;
682
689
  }
683
- async inspect(e) {
684
- const r = Array.isArray(e) ? e : [await this.createErrorReport(e)];
685
- if (r.length === 0) {
686
- I.alert(x("errors.inspectEmpty", "Nothing to inspect!"));
690
+ async inspect(e, r) {
691
+ if (Array.isArray(e) && e.length === 0) {
692
+ z.alert(S("errors.inspectEmpty", "Nothing to inspect!"));
687
693
  return;
688
694
  }
689
- I.openModal(I.requireComponent(L.ErrorReportModal), {
690
- reports: r
691
- });
695
+ const n = Array.isArray(e) ? e[0] : this.isErrorReport(e) ? e : await this.createErrorReport(e), a = Array.isArray(e) ? e : r ?? [n];
696
+ z.modal(z.requireComponent("error-report-modal"), { report: n, reports: a });
692
697
  }
693
698
  async report(e, r) {
694
- if (await M.emit("error", { error: e, message: r }), Re("unit") || (X() && this.logError(e), !this.enabled))
699
+ if (await R.emit("error", { error: e, message: r }), Ee("unit") || (J() && this.logError(e), !this.enabled))
695
700
  throw e;
696
- if (!z.isMounted()) {
701
+ if (!A.isMounted()) {
697
702
  const i = await this.createStartupErrorReport(e);
698
703
  i && this.setState({ startupErrors: this.startupErrors.concat(i) });
699
704
  return;
@@ -703,23 +708,23 @@ class Zs extends Js {
703
708
  seen: !1,
704
709
  date: /* @__PURE__ */ new Date()
705
710
  };
706
- I.toast(
707
- r ?? x("errors.notice", "Something went wrong, but it's not your fault. Try again!"),
711
+ z.toast(
712
+ r ?? S("errors.notice", "Something went wrong, but it's not your fault. Try again!"),
708
713
  {
709
714
  variant: "danger",
710
715
  actions: [
711
716
  {
712
- label: x("errors.viewDetails", "View details"),
717
+ label: S("errors.viewDetails", "View details"),
713
718
  dismiss: !0,
714
- click: () => I.openModal(
715
- I.requireComponent(L.ErrorReportModal),
716
- { reports: [n] }
717
- )
719
+ click: () => z.modal(z.requireComponent("error-report-modal"), { report: n, reports: [n] })
718
720
  }
719
721
  ]
720
722
  }
721
723
  ), this.setState({ logs: [a].concat(this.logs) });
722
724
  }
725
+ reportDevelopmentError(e, r) {
726
+ J() && (r && console.warn(r), this.logError(e));
727
+ }
723
728
  see(e) {
724
729
  this.setState({
725
730
  logs: this.logs.map((r) => r.report !== e ? r : {
@@ -728,33 +733,38 @@ class Zs extends Js {
728
733
  })
729
734
  });
730
735
  }
731
- seeAll() {
732
- this.setState({
733
- logs: this.logs.map((e) => ({
734
- ...e,
735
- seen: !0
736
- }))
736
+ async boot() {
737
+ Y(async () => {
738
+ var e;
739
+ if (!this.debug) {
740
+ (e = this.eruda) == null || e.destroy();
741
+ return;
742
+ }
743
+ this.eruda ?? (this.eruda = (await import("eruda")).default), this.eruda.init();
737
744
  });
738
745
  }
739
746
  logError(e) {
740
- console.error(e), xe(e) && e.cause && this.logError(e.cause);
747
+ console.error(e), ce(e) && e.cause && this.logError(e.cause);
748
+ }
749
+ isErrorReport(e) {
750
+ return ce(e) && "title" in e;
741
751
  }
742
752
  async createErrorReport(e) {
743
- return typeof e == "string" ? { title: e } : e instanceof Error || e instanceof he ? this.createErrorReportFromError(e) : xe(e) ? Ke({
744
- title: j(
745
- e.name ?? e.title ?? x("errors.unknown", "Unknown Error")
753
+ return typeof e == "string" ? { title: e } : e instanceof Error || e instanceof be ? this.createErrorReportFromError(e) : ce(e) ? Ze({
754
+ title: B(
755
+ e.name ?? e.title ?? S("errors.unknown", "Unknown Error")
746
756
  ),
747
- description: j(
748
- e.message ?? e.description ?? x("errors.unknownDescription", "Unknown error object")
757
+ description: B(
758
+ e.message ?? e.description ?? S("errors.unknownDescription", "Unknown error object")
749
759
  ),
750
760
  error: e
751
761
  }) : {
752
- title: x("errors.unknown", "Unknown Error"),
762
+ title: S("errors.unknown", "Unknown Error"),
753
763
  error: e
754
764
  };
755
765
  }
756
766
  async createStartupErrorReport(e) {
757
- return e instanceof Se ? e.cause instanceof Se ? null : this.createErrorReport(e.cause) : this.createErrorReport(e);
767
+ return e instanceof Te ? e.cause instanceof Te ? null : this.createErrorReport(e.cause) : this.createErrorReport(e);
758
768
  }
759
769
  createErrorReportFromError(e, r = {}) {
760
770
  return {
@@ -766,84 +776,44 @@ class Zs extends Js {
766
776
  };
767
777
  }
768
778
  }
769
- const Ye = G(Zs), et = [];
770
- function Ca(t) {
771
- et.push(t);
772
- }
773
- function Gs(t) {
774
- for (const s of et) {
775
- const e = s(t);
776
- if (e)
777
- return e;
778
- }
779
- return typeof t == "string" ? t : t instanceof Error || t instanceof he ? t.message : xe(t) ? j(t.message ?? t.description ?? "Unknown error object") : x("errors.unknown", "Unknown Error");
780
- }
781
- class De extends he {
782
- }
783
- const Xs = { $errors: Ye }, Ys = (t) => (Ye.report(t), !0);
784
- function er(t, s = () => !1) {
785
- const e = (r) => s(r) || Ys(r);
786
- t.config.errorHandler = e, globalThis.onerror = (r, n, a, i, c) => e(c ?? r), globalThis.onunhandledrejection = (r) => e(r.reason);
787
- }
788
- const tr = {
789
- async install(t, s) {
790
- er(t, s.handleError), await be(t, Xs);
791
- }
792
- };
793
- function sr() {
794
- return Z(new Ae(), (t) => {
779
+ const nt = te(nr);
780
+ let ie = null;
781
+ function ar() {
782
+ return ee(new Ae(), (t) => {
795
783
  t.link = function(s) {
796
- return Ae.prototype.link.apply(this, [s]).replace("<a", '<a target="_blank"');
784
+ const e = Ae.prototype.link.apply(this, [s]);
785
+ return s.href.startsWith("#") ? e : e.replace("<a", '<a target="_blank"');
797
786
  };
798
787
  });
799
788
  }
800
- function rr(t) {
801
- const s = At(t, /<a[^>]*href="#action:([^"]+)"[^>]*>([^<]+)<\/a>/g);
789
+ function lr(t) {
790
+ const s = Xe(t, /<a[^>]*href="#action:([^"]+)"[^>]*>([^<]+)<\/a>/g);
802
791
  for (const [e, r, n] of s)
803
792
  t = t.replace(e, `<button type="button" data-markdown-action="${r}">${n}</button>`);
804
793
  return t;
805
794
  }
806
- function nr(t) {
807
- let s = Gt(t, { renderer: sr(), async: !1 });
808
- return s = ar(s), s = rr(s), s;
795
+ function or(t) {
796
+ const s = Xe(t, /<a[^>]*href="#route:([^"]+)"[^>]*>([^<]+)<\/a>/g);
797
+ for (const [e, r, n] of s) {
798
+ const a = (ie == null ? void 0 : ie.resolve(r)) ?? r;
799
+ t = t.replace(e, `<a data-markdown-route="${r}" href="${a}">${n}</a>`);
800
+ }
801
+ return t;
809
802
  }
810
- function ar(t) {
811
- return Zt.sanitize(t, { ADD_ATTR: ["target"] });
803
+ function ir() {
804
+ return ie;
812
805
  }
813
- const A = /* @__PURE__ */ g({
814
- __name: "Markdown",
815
- props: {
816
- as: {},
817
- inline: { type: Boolean },
818
- langKey: {},
819
- langParams: {},
820
- langDefault: {},
821
- text: {},
822
- actions: {}
823
- },
824
- setup(t) {
825
- const s = Fe(), e = Ee(), r = u(() => e.default ? e.default().map(Je).join("") : t.text ?? (t.langKey && (t.langDefault ? x(t.langKey, t.langDefault, t.langParams ?? {}) : Xe(t.langKey, t.langParams ?? {})))), n = u(() => {
826
- if (!r.value)
827
- return null;
828
- let c = nr(r.value);
829
- return t.inline && (c = c.replace("<p>", "<span>").replace("</p>", "</span>")), c;
830
- }), a = () => xt(t.as ?? (t.inline ? "span" : "div"), {
831
- innerHTML: n.value,
832
- onClick: i,
833
- ...s,
834
- class: `${s.class ?? ""} ${t.inline ? "" : "prose"}`
835
- });
836
- async function i(c) {
837
- var d, w;
838
- const { target: p } = c;
839
- if (Bt(p, HTMLElement) && p.dataset.markdownAction) {
840
- (w = (d = t.actions) == null ? void 0 : d[p.dataset.markdownAction]) == null || w.call(d);
841
- return;
842
- }
843
- }
844
- return (c, p) => (l(), f(a));
845
- }
846
- }), or = /* @__PURE__ */ g({
806
+ function pl(t) {
807
+ ie = t;
808
+ }
809
+ function ur(t) {
810
+ let s = rs(t, { renderer: ar(), async: !1 });
811
+ return s = cr(s), s = lr(s), s = or(s), s;
812
+ }
813
+ function cr(t) {
814
+ return ss.sanitize(t, { ADD_ATTR: ["target"] });
815
+ }
816
+ const at = /* @__PURE__ */ g({
847
817
  __name: "HeadlessButton",
848
818
  props: {
849
819
  class: {},
@@ -859,9 +829,9 @@ const A = /* @__PURE__ */ g({
859
829
  as: {}
860
830
  },
861
831
  setup(t) {
862
- const s = u(() => t.as ? { as: t.as } : t.route ? {
863
- as: I.resolveComponent(L.RouterLink) ?? "a",
864
- to: Ke({
832
+ const s = c(() => t.as ? { as: t.as } : t.route ? {
833
+ as: z.resolveComponent("router-link") ?? "a",
834
+ to: Ze({
865
835
  name: t.route,
866
836
  params: t.routeParams,
867
837
  query: t.routeQuery
@@ -874,28 +844,26 @@ const A = /* @__PURE__ */ g({
874
844
  as: "button",
875
845
  type: t.submit ? "submit" : "button"
876
846
  });
877
- return (e, r) => (l(), f(o(Xt), P({
847
+ return (e, r) => (u(), h(o(os), H({
878
848
  class: t.class,
879
849
  "as-child": e.asChild,
880
850
  disabled: e.disabled
881
851
  }, s.value), {
882
- default: m(() => [
883
- _(e.$slots, "default")
852
+ default: f(() => [
853
+ w(e.$slots, "default")
884
854
  ]),
885
855
  _: 3
886
856
  }, 16, ["class", "as-child", "disabled"]));
887
857
  }
888
858
  });
889
- function tt(t, s) {
890
- return u(() => {
891
- const { baseClasses: e, ...r } = t, { baseClasses: n, ...a } = s, i = xs(n, a), c = Object.entries(r).reduce((p, [d, w]) => (p[d] = o(w), p), {});
892
- return H(i(c), o(e));
893
- });
859
+ function lt(t, s) {
860
+ const { baseClasses: e, ...r } = t, { baseClasses: n, ...a } = s, i = as(n, a);
861
+ return M(i(r), o(e));
894
862
  }
895
- function H(...t) {
896
- return Ss(Cs(t));
863
+ function M(...t) {
864
+ return ls(ns(t));
897
865
  }
898
- const B = /* @__PURE__ */ g({
866
+ const q = /* @__PURE__ */ g({
899
867
  __name: "Button",
900
868
  props: {
901
869
  class: {},
@@ -911,10 +879,10 @@ const B = /* @__PURE__ */ g({
911
879
  as: {}
912
880
  },
913
881
  setup(t) {
914
- const s = Y(t, ["class", "size", "variant", "disabled"]), e = tt(
882
+ const s = N(t, ["class", "size", "variant", "disabled"]), e = c(() => lt(
915
883
  { baseClasses: t.class, variant: t.variant, size: t.size, disabled: t.disabled },
916
884
  {
917
- baseClasses: "flex items-center justify-center gap-1 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2",
885
+ baseClasses: "focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2",
918
886
  variants: {
919
887
  variant: {
920
888
  default: "bg-primary-600 text-white focus-visible:outline-primary-600",
@@ -922,12 +890,12 @@ const B = /* @__PURE__ */ g({
922
890
  danger: "bg-red-600 text-white focus-visible:outline-red-600",
923
891
  ghost: "bg-transparent",
924
892
  outline: "bg-transparent text-primary-600 ring-primary-600",
925
- link: "text-primary-600"
893
+ link: "text-links"
926
894
  },
927
895
  size: {
928
- small: "text-xs",
929
- default: "text-sm",
930
- large: "text-base",
896
+ small: "text-xs min-h-6",
897
+ default: "text-sm min-h-8",
898
+ large: "text-base min-h-10",
931
899
  icon: "rounded-full p-2.5"
932
900
  },
933
901
  disabled: {
@@ -938,7 +906,7 @@ const B = /* @__PURE__ */ g({
938
906
  compoundVariants: [
939
907
  {
940
908
  variant: ["default", "secondary", "danger", "ghost", "outline"],
941
- class: "font-medium"
909
+ class: "flex items-center justify-center gap-1 font-medium"
942
910
  },
943
911
  {
944
912
  variant: ["default", "danger"],
@@ -976,12 +944,27 @@ const B = /* @__PURE__ */ g({
976
944
  {
977
945
  variant: "danger",
978
946
  disabled: !1,
979
- class: "hover:bg-red-50"
947
+ class: "hover:bg-red-500"
980
948
  },
981
949
  {
982
950
  variant: "link",
983
951
  disabled: !1,
984
952
  class: "hover:underline"
953
+ },
954
+ {
955
+ variant: "link",
956
+ size: "small",
957
+ class: "leading-6"
958
+ },
959
+ {
960
+ variant: "link",
961
+ size: "default",
962
+ class: "leading-8"
963
+ },
964
+ {
965
+ variant: "link",
966
+ size: "large",
967
+ class: "leading-10"
985
968
  }
986
969
  ],
987
970
  defaultVariants: {
@@ -990,91 +973,233 @@ const B = /* @__PURE__ */ g({
990
973
  disabled: !1
991
974
  }
992
975
  }
993
- );
994
- return (r, n) => (l(), f(or, P({
995
- class: o(e),
976
+ ));
977
+ return (r, n) => (u(), h(at, H({
978
+ class: e.value,
996
979
  disabled: r.disabled
997
980
  }, s), {
998
- default: m(() => [
999
- _(r.$slots, "default")
981
+ default: f(() => [
982
+ w(r.$slots, "default")
1000
983
  ]),
1001
984
  _: 3
1002
985
  }, 16, ["class", "disabled"]));
1003
986
  }
1004
987
  });
1005
- function lr(t) {
988
+ function dr(t) {
1006
989
  return typeof t == "object" && t !== null && "label" in t;
1007
990
  }
1008
- function oe(t, s) {
1009
- const e = M.on(t, s);
1010
- fe(() => e());
991
+ function ot(t, s) {
992
+ const e = R.on(t, s);
993
+ ge(() => e());
994
+ }
995
+ const pr = {
996
+ required: (t) => t ? void 0 : "required"
997
+ };
998
+ function mr(t, s) {
999
+ var e;
1000
+ if (t == null)
1001
+ return !0;
1002
+ switch (s.type) {
1003
+ case "string":
1004
+ return typeof t == "string";
1005
+ case "enum":
1006
+ return !!((e = s.values) != null && e.includes(t));
1007
+ case "number":
1008
+ return typeof t == "number";
1009
+ case "boolean":
1010
+ return typeof t == "boolean";
1011
+ case "date":
1012
+ return t instanceof Date;
1013
+ case "object":
1014
+ return typeof t == "object";
1015
+ }
1016
+ }
1017
+ const de = { ...pr };
1018
+ function ml(t, s) {
1019
+ de[t] = s;
1020
+ }
1021
+ function fr(t, s) {
1022
+ return mr(t, s) ? [] : ["invalid_value"];
1023
+ }
1024
+ function hr(t, s) {
1025
+ var r;
1026
+ const e = (r = de[s]) == null ? void 0 : r.call(de, t);
1027
+ return e ? Je(e) : [];
1028
+ }
1029
+ const fl = Symbol(), je = /* @__PURE__ */ new WeakMap();
1030
+ class gr extends Qe {
1031
+ constructor(e) {
1032
+ super();
1033
+ _(this, "errors");
1034
+ _(this, "_fields");
1035
+ _(this, "_data");
1036
+ _(this, "_submitted");
1037
+ _(this, "_errors");
1038
+ _(this, "_listeners", {});
1039
+ this._fields = e, this._submitted = U(!1), this._data = this.getInitialData(e), this._errors = this.getInitialErrors(e), je.set(
1040
+ this,
1041
+ c(() => !Object.values(this._errors).some((r) => r !== null))
1042
+ ), this.errors = ve(this._errors);
1043
+ }
1044
+ get valid() {
1045
+ var e;
1046
+ return !!((e = je.get(this)) != null && e.value);
1047
+ }
1048
+ get submitted() {
1049
+ return this._submitted.value;
1050
+ }
1051
+ setFieldValue(e, r) {
1052
+ const n = this._fields[e] ?? Q(`Trying to set undefined '${B(e)}' field`);
1053
+ this._data[e] = n.type === "string" && (n.trim ?? !0) ? B(r).trim() : r, this._submitted.value && this.validate();
1054
+ }
1055
+ getFieldValue(e) {
1056
+ return this._data[e];
1057
+ }
1058
+ getFieldRules(e) {
1059
+ var r, n;
1060
+ return ((n = (r = this._fields[e]) == null ? void 0 : r.rules) == null ? void 0 : n.split("|")) ?? [];
1061
+ }
1062
+ getFieldType(e) {
1063
+ var r;
1064
+ return ((r = this._fields[e]) == null ? void 0 : r.type) ?? null;
1065
+ }
1066
+ data() {
1067
+ return { ...this._data };
1068
+ }
1069
+ validate() {
1070
+ const e = Object.entries(this._fields).reduce(
1071
+ (r, [n, a]) => (r[n] = this.getFieldErrors(n, a), r),
1072
+ {}
1073
+ );
1074
+ return this.resetErrors(e), this.valid;
1075
+ }
1076
+ reset(e = {}) {
1077
+ this._submitted.value = !1, e.keepData || this.resetData(), e.keepErrors || this.resetErrors();
1078
+ }
1079
+ submit() {
1080
+ var r;
1081
+ this._submitted.value = !0;
1082
+ const e = this.validate();
1083
+ return e && ((r = this._listeners.submit) == null || r.forEach((n) => n())), e;
1084
+ }
1085
+ on(e, r) {
1086
+ var n, a;
1087
+ return (n = this._listeners)[e] ?? (n[e] = []), (a = this._listeners[e]) == null || a.push(r), () => this.off(e, r);
1088
+ }
1089
+ off(e, r) {
1090
+ Se(this._listeners[e] ?? [], r);
1091
+ }
1092
+ async focus(e) {
1093
+ var r;
1094
+ await Oe(), (r = this._listeners.focus) == null || r.forEach((n) => n(e));
1095
+ }
1096
+ __get(e) {
1097
+ return e in this._fields ? this.getFieldValue(e) : super.__get(e);
1098
+ }
1099
+ __set(e, r) {
1100
+ if (!(e in this._fields)) {
1101
+ super.__set(e, r);
1102
+ return;
1103
+ }
1104
+ this.setFieldValue(e, r);
1105
+ }
1106
+ getFieldErrors(e, r) {
1107
+ var l;
1108
+ const n = [], a = this._data[e], i = ((l = r.rules) == null ? void 0 : l.split("|")) ?? [];
1109
+ n.push(...fr(a, r));
1110
+ for (const d of i)
1111
+ d !== "required" && a == null || n.push(...hr(a, d));
1112
+ return n.length > 0 ? n : null;
1113
+ }
1114
+ getInitialData(e) {
1115
+ if (this.static().isConjuring())
1116
+ return {};
1117
+ const r = Object.entries(e).reduce((n, [a, i]) => (n[a] = i.default ?? null, n), {});
1118
+ return pe(r);
1119
+ }
1120
+ getInitialErrors(e) {
1121
+ if (this.static().isConjuring())
1122
+ return {};
1123
+ const r = Object.keys(e).reduce((n, a) => (n[a] = null, n), {});
1124
+ return pe(r);
1125
+ }
1126
+ resetData() {
1127
+ for (const [e, r] of Object.entries(this._fields))
1128
+ this._data[e] = r.default ?? null;
1129
+ }
1130
+ resetErrors(e) {
1131
+ Object.keys(this._errors).forEach((r) => delete this._errors[r]), e && Object.assign(this._errors, e);
1132
+ }
1133
+ }
1134
+ function it(t, s) {
1135
+ const e = X("form", null), r = e == null ? void 0 : e.on("focus", (n) => t.name === n && s());
1136
+ ge(() => r == null ? void 0 : r());
1011
1137
  }
1012
- function st(t, s) {
1013
- const e = ie("form", null), r = e == null ? void 0 : e.on("focus", (n) => t.name === n && s());
1014
- fe(() => r == null ? void 0 : r());
1138
+ function ut(t) {
1139
+ return new gr(t);
1015
1140
  }
1016
- function rt() {
1017
- const t = Fe(), s = u(() => t.class);
1018
- return [u(() => Dt(t, "class")), s];
1141
+ function Ie() {
1142
+ const t = Ne(), s = c(() => t.class);
1143
+ return [c(() => Ot(t, "class")), s];
1019
1144
  }
1020
- function xa(t) {
1021
- let s = zt;
1022
- St(() => s = t()), fe(() => s());
1145
+ function hl(t) {
1146
+ let s = Nt;
1147
+ Et(() => s = t()), ge(() => s());
1023
1148
  }
1024
- function Sa(t, s) {
1149
+ function gl(t, s) {
1025
1150
  const e = pe(O.get(t) ?? s);
1026
- return He(e, () => O.set(t, kt(e))), e;
1151
+ return Me(e, () => O.set(t, Vt(e))), e;
1027
1152
  }
1028
- function ka(t) {
1029
- const s = D(), e = u(t);
1030
- return He(e, async () => s.value = await e.value, { immediate: !0 }), s;
1153
+ function vl(t) {
1154
+ const s = U(), e = c(t);
1155
+ return Me(e, async () => s.value = await e.value, { immediate: !0 }), s;
1031
1156
  }
1032
- function Ma(t, s) {
1033
- const e = s ? t : {}, r = s ?? t, n = D(e.initial ?? null), a = jt((i) => n.value = i, e.delay ?? 300);
1034
- return ce(() => a(r())), n;
1157
+ function bl(t, s) {
1158
+ const e = s ? t : {}, r = s ?? t, n = U(e.initial ?? null), a = Wt((i) => n.value = i, e.delay ?? 300);
1159
+ return Y(() => a(r())), n;
1035
1160
  }
1036
- const nt = /* @__PURE__ */ g({
1161
+ const ct = /* @__PURE__ */ g({
1037
1162
  __name: "HeadlessSelectValue",
1038
1163
  setup(t) {
1039
- const s = R(
1164
+ const s = V(
1040
1165
  "select",
1041
1166
  "<HeadlessSelectValue> must be a child of a <HeadlessSelect>"
1042
1167
  );
1043
- return (e, r) => e.$slots.default ? (l(), f(o(Be), {
1168
+ return (e, r) => e.$slots.default ? (u(), h(o(De), {
1044
1169
  key: 0,
1045
1170
  placeholder: o(s).placeholder
1046
1171
  }, {
1047
- default: m(() => [
1048
- _(e.$slots, "default")
1172
+ default: f(() => [
1173
+ w(e.$slots, "default")
1049
1174
  ]),
1050
1175
  _: 3
1051
- }, 8, ["placeholder"])) : (l(), f(o(Be), {
1176
+ }, 8, ["placeholder"])) : (u(), h(o(De), {
1052
1177
  key: 1,
1053
1178
  placeholder: o(s).placeholder
1054
1179
  }, null, 8, ["placeholder"]));
1055
1180
  }
1056
- }), at = /* @__PURE__ */ g({
1181
+ }), dt = /* @__PURE__ */ g({
1057
1182
  __name: "HeadlessSelectTrigger",
1058
1183
  setup(t) {
1059
- const s = R(
1184
+ const s = V(
1060
1185
  "select",
1061
1186
  "<HeadlessSelectTrigger> must be a child of a <HeadlessSelect>"
1062
1187
  );
1063
- return (e, r) => (l(), f(o(Yt), {
1188
+ return (e, r) => (u(), h(o(is), {
1064
1189
  id: o(s).id
1065
1190
  }, {
1066
- default: m(() => [
1067
- _(e.$slots, "default", {}, () => [
1068
- h(nt, {
1191
+ default: f(() => [
1192
+ w(e.$slots, "default", {}, () => [
1193
+ p(ct, {
1069
1194
  placeholder: o(s).placeholder
1070
1195
  }, null, 8, ["placeholder"]),
1071
- h(o(es))
1196
+ p(o(us))
1072
1197
  ])
1073
1198
  ]),
1074
1199
  _: 3
1075
1200
  }, 8, ["id"]));
1076
1201
  }
1077
- }), ot = /* @__PURE__ */ g({
1202
+ }), pt = /* @__PURE__ */ g({
1078
1203
  __name: "HeadlessSelectOption",
1079
1204
  props: {
1080
1205
  value: {},
@@ -1084,20 +1209,20 @@ const nt = /* @__PURE__ */ g({
1084
1209
  as: {}
1085
1210
  },
1086
1211
  setup(t) {
1087
- const s = R(
1212
+ const s = V(
1088
1213
  "select",
1089
1214
  "<HeadlessSelectOption> must be a child of a <HeadlessSelect>"
1090
- ), e = u(() => {
1215
+ ), e = c(() => {
1091
1216
  var n;
1092
1217
  const r = (n = s.options) == null ? void 0 : n.find((a) => a.value === t.value);
1093
- return r ? r.label : j(t.value);
1218
+ return r ? r.label : B(t.value);
1094
1219
  });
1095
- return (r, n) => (l(), f(o(ts), ee(te(r.$props)), {
1096
- default: m(() => [
1097
- h(o(ss), null, {
1098
- default: m(() => [
1099
- _(r.$slots, "default", {}, () => [
1100
- V(S(e.value), 1)
1220
+ return (r, n) => (u(), h(o(cs), ne(ae(r.$props)), {
1221
+ default: f(() => [
1222
+ p(o(ds), null, {
1223
+ default: f(() => [
1224
+ w(r.$slots, "default", {}, () => [
1225
+ I(x(e.value), 1)
1101
1226
  ])
1102
1227
  ]),
1103
1228
  _: 3
@@ -1106,34 +1231,35 @@ const nt = /* @__PURE__ */ g({
1106
1231
  _: 3
1107
1232
  }, 16));
1108
1233
  }
1109
- }), lt = /* @__PURE__ */ g({
1234
+ }), mt = /* @__PURE__ */ g({
1110
1235
  __name: "HeadlessSelectOptions",
1111
1236
  props: {
1112
1237
  class: {},
1113
1238
  innerClass: {}
1114
1239
  },
1115
1240
  setup(t) {
1116
- const s = R(
1241
+ const s = V(
1117
1242
  "select",
1118
1243
  "<HeadlessSelectOptions> must be a child of a <HeadlessSelect>"
1119
- );
1120
- return (e, r) => (l(), f(o(rs), null, {
1121
- default: m(() => [
1122
- h(o(ns), {
1244
+ ), e = c(() => M("min-w-(--reka-select-trigger-width) max-h-(--reka-select-content-available-height)", t.class));
1245
+ return (r, n) => (u(), h(o(ps), null, {
1246
+ default: f(() => [
1247
+ p(o(ms), {
1123
1248
  position: "popper",
1124
- class: k(e.$props.class),
1249
+ class: k(e.value),
1125
1250
  align: o(s).align,
1126
- side: o(s).side
1251
+ side: o(s).side,
1252
+ "side-offset": 4
1127
1253
  }, {
1128
- default: m(() => [
1129
- h(o(as), {
1130
- class: k(e.innerClass)
1254
+ default: f(() => [
1255
+ p(o(fs), {
1256
+ class: k(r.innerClass)
1131
1257
  }, {
1132
- default: m(() => [
1133
- _(e.$slots, "default", {}, () => [
1134
- (l(!0), b(q, null, U(o(s).options ?? [], (n) => (l(), f(ot, {
1135
- key: n.key,
1136
- value: n.value
1258
+ default: f(() => [
1259
+ w(r.$slots, "default", {}, () => [
1260
+ (u(!0), b(D, null, F(o(s).options ?? [], (a) => (u(), h(pt, {
1261
+ key: a.key,
1262
+ value: a.value
1137
1263
  }, null, 8, ["value"]))), 128))
1138
1264
  ])
1139
1265
  ]),
@@ -1146,7 +1272,7 @@ const nt = /* @__PURE__ */ g({
1146
1272
  _: 3
1147
1273
  }));
1148
1274
  }
1149
- }), ir = /* @__PURE__ */ g({
1275
+ }), vr = /* @__PURE__ */ g({
1150
1276
  inheritAttrs: !1,
1151
1277
  __name: "HeadlessSelect",
1152
1278
  props: {
@@ -1154,6 +1280,7 @@ const nt = /* @__PURE__ */ g({
1154
1280
  options: {},
1155
1281
  placeholder: {},
1156
1282
  renderOption: { type: Function },
1283
+ compareOptions: { type: Function, default: (t, s) => t === s },
1157
1284
  labelClass: {},
1158
1285
  optionsClass: {},
1159
1286
  align: {},
@@ -1165,56 +1292,56 @@ const nt = /* @__PURE__ */ g({
1165
1292
  },
1166
1293
  emits: ["update:modelValue"],
1167
1294
  setup(t, { expose: s, emit: e }) {
1168
- const r = e, n = ie("form", null), a = u(() => n && t.name ? n.getFieldValue(t.name) : t.modelValue), i = u(() => a.value), c = u(() => !n || !t.name ? null : n.errors[t.name] ?? null), p = u(() => t.options ? t.options.map((v) => ({
1169
- key: le(),
1170
- label: t.renderOption ? t.renderOption(v) : lr(v) ? qt(v.label) : j(v),
1171
- value: v
1172
- })) : null), d = {
1295
+ const r = e, n = X("form", null), a = c(() => n && t.name ? n.getFieldValue(t.name) : t.modelValue), i = c(() => a.value), l = c(() => !n || !t.name ? null : n.errors[t.name] ?? null), d = c(() => t.options ? t.options.map((m) => ({
1296
+ key: re(),
1297
+ label: t.renderOption ? t.renderOption(m) : dr(m) ? Kt(m.label) : B(m),
1298
+ value: m
1299
+ })) : null), v = {
1173
1300
  labelClass: t.labelClass,
1174
1301
  optionsClass: t.optionsClass,
1175
1302
  align: t.align,
1176
1303
  side: t.side,
1177
1304
  value: a,
1178
- id: `select-${le()}`,
1179
- name: u(() => t.name),
1180
- label: u(() => t.label),
1181
- description: u(() => t.description),
1182
- placeholder: u(() => t.placeholder ?? x("ui.select", "Select an option")),
1183
- options: p,
1184
- selectedOption: u(() => {
1185
- var v;
1186
- return (v = p.value) == null ? void 0 : v.find((C) => C.value === t.modelValue);
1305
+ id: `select-${re()}`,
1306
+ name: c(() => t.name),
1307
+ label: c(() => t.label),
1308
+ description: c(() => t.description),
1309
+ placeholder: c(() => t.placeholder ?? S("ui.select", "Select an option")),
1310
+ options: d,
1311
+ selectedOption: c(() => {
1312
+ var m;
1313
+ return (m = d.value) == null ? void 0 : m.find((C) => C.value === t.modelValue);
1187
1314
  }),
1188
- errors: Le(c),
1189
- required: u(() => {
1315
+ errors: ve(l),
1316
+ required: c(() => {
1190
1317
  if (!(!t.name || !n))
1191
1318
  return n.getFieldRules(t.name).includes("required");
1192
1319
  }),
1193
- update(v) {
1320
+ update(m) {
1194
1321
  if (n && t.name) {
1195
- n.setFieldValue(t.name, v);
1322
+ n.setFieldValue(t.name, m);
1196
1323
  return;
1197
1324
  }
1198
- r("update:modelValue", v);
1325
+ r("update:modelValue", m);
1199
1326
  }
1200
1327
  };
1201
- function w(v) {
1202
- d.update(v);
1328
+ function $(m) {
1329
+ v.update(m);
1203
1330
  }
1204
- return se("select", d), s(d), (v, C) => (l(), f(o(os), {
1331
+ return le("select", v), s(v), (m, C) => (u(), h(o(hs), {
1205
1332
  "model-value": i.value,
1206
- by: (T, ue) => T === ue,
1207
- "onUpdate:modelValue": C[0] || (C[0] = (T) => w(T))
1333
+ by: m.compareOptions,
1334
+ "onUpdate:modelValue": C[0] || (C[0] = (L) => $(L))
1208
1335
  }, {
1209
- default: m(({ open: T }) => [
1210
- (l(), f(W(v.as), ee(te(v.$attrs)), {
1211
- default: m(() => [
1212
- _(v.$slots, "default", {
1213
- modelValue: v.modelValue,
1214
- open: T
1336
+ default: f(({ open: L }) => [
1337
+ (u(), h(W(m.as), ne(ae(m.$attrs)), {
1338
+ default: f(() => [
1339
+ w(m.$slots, "default", {
1340
+ modelValue: m.modelValue,
1341
+ open: L
1215
1342
  }, () => [
1216
- h(at),
1217
- h(lt)
1343
+ p(dt),
1344
+ p(mt)
1218
1345
  ])
1219
1346
  ]),
1220
1347
  _: 2
@@ -1223,47 +1350,50 @@ const nt = /* @__PURE__ */ g({
1223
1350
  _: 3
1224
1351
  }, 8, ["model-value", "by"]));
1225
1352
  }
1226
- }), ze = /* @__PURE__ */ g({
1353
+ }), Be = /* @__PURE__ */ g({
1227
1354
  __name: "HeadlessSelectLabel",
1228
1355
  props: {
1229
1356
  asChild: { type: Boolean },
1230
1357
  as: {}
1231
1358
  },
1232
1359
  setup(t) {
1233
- const s = R(
1360
+ const s = V(
1234
1361
  "select",
1235
1362
  "<HeadlessSelectLabel> must be a child of a <HeadlessSelect>"
1236
- ), e = Ee(), r = u(() => !!(s.label || e.default));
1237
- return (n, a) => r.value ? (l(), f(o(ls), P({
1363
+ ), e = He(), r = c(() => !!(s.label || e.default));
1364
+ return (n, a) => r.value ? (u(), h(o(gs), H({
1238
1365
  key: 0,
1239
1366
  for: o(s).id
1240
1367
  }, n.$props), {
1241
- default: m(() => [
1242
- _(n.$slots, "default", {}, () => [
1243
- V(S(o(s).label), 1)
1368
+ default: f(() => [
1369
+ w(n.$slots, "default", {}, () => [
1370
+ I(x(o(s).label), 1)
1244
1371
  ])
1245
1372
  ]),
1246
1373
  _: 3
1247
- }, 16, ["for"])) : E("", !0);
1374
+ }, 16, ["for"])) : T("", !0);
1248
1375
  }
1249
- }), it = /* @__PURE__ */ g({
1376
+ }), ft = /* @__PURE__ */ g({
1250
1377
  __name: "SelectLabel",
1378
+ props: {
1379
+ class: {}
1380
+ },
1251
1381
  setup(t) {
1252
- const s = R("select", "<SelectLabel> must be a child of a <Select>"), e = u(() => H("block text-sm leading-6 font-medium text-gray-900", s.labelClass));
1253
- return (r, n) => r.$slots.default ? (l(), f(ze, {
1382
+ const s = V("select", "<SelectLabel> must be a child of a <Select>"), e = c(() => M("block text-sm leading-6 font-medium text-gray-900", s.labelClass, t.class));
1383
+ return (r, n) => r.$slots.default ? (u(), h(Be, {
1254
1384
  key: 0,
1255
1385
  class: k(e.value)
1256
1386
  }, {
1257
- default: m(() => [
1258
- _(r.$slots, "default")
1387
+ default: f(() => [
1388
+ w(r.$slots, "default")
1259
1389
  ]),
1260
1390
  _: 3
1261
- }, 8, ["class"])) : (l(), f(ze, {
1391
+ }, 8, ["class"])) : (u(), h(Be, {
1262
1392
  key: 1,
1263
1393
  class: k(e.value)
1264
1394
  }, null, 8, ["class"]));
1265
1395
  }
1266
- }), cr = /* @__PURE__ */ g({
1396
+ }), Fe = /* @__PURE__ */ g({
1267
1397
  __name: "SelectOption",
1268
1398
  props: {
1269
1399
  value: {},
@@ -1271,100 +1401,114 @@ const nt = /* @__PURE__ */ g({
1271
1401
  innerClass: {}
1272
1402
  },
1273
1403
  setup(t) {
1274
- const s = u(() => H("group p-1 outline-none", t.class)), e = u(() => H(
1404
+ const s = c(() => M("group p-1 outline-none", t.class)), e = c(() => M(
1275
1405
  // eslint-disable-next-line vue/max-len
1276
1406
  "relative flex max-w-[calc(100vw-2rem)] cursor-pointer items-center truncate rounded-md gap-2 px-2 py-1 text-sm select-none *:truncate group-data-[highlighted]:bg-gray-100 group-data-[state=checked]:font-semibold group-data-[state=unchecked]:opacity-50",
1277
1407
  t.innerClass
1278
1408
  ));
1279
- return (r, n) => (l(), f(ot, {
1409
+ return (r, n) => (u(), h(pt, {
1280
1410
  class: k(s.value),
1281
1411
  value: r.value
1282
1412
  }, {
1283
- default: m(() => [
1413
+ default: f(() => [
1284
1414
  y("div", {
1285
1415
  class: k(e.value)
1286
1416
  }, [
1287
- _(r.$slots, "default")
1417
+ w(r.$slots, "default")
1288
1418
  ], 2)
1289
1419
  ]),
1290
1420
  _: 3
1291
1421
  }, 8, ["class", "value"]));
1292
1422
  }
1293
- }), ct = /* @__PURE__ */ g({
1423
+ }), ht = /* @__PURE__ */ g({
1294
1424
  __name: "SelectOptions",
1295
1425
  props: {
1296
1426
  class: {}
1297
1427
  },
1298
1428
  setup(t) {
1299
- const s = R("select", "<SelectOptions> must be a child of a <Select>"), e = u(() => H(
1429
+ const s = V("select", "<SelectOptions> must be a child of a <Select>"), e = c(() => M(
1300
1430
  "z-50 overflow-auto rounded-lg bg-white text-base shadow-lg ring-1 ring-black/5 focus:outline-hidden",
1301
1431
  s.optionsClass,
1302
1432
  t.class
1303
1433
  ));
1304
- return (r, n) => (l(), f(lt, {
1434
+ return (r, n) => (u(), h(mt, {
1305
1435
  class: k(e.value)
1306
1436
  }, {
1307
- default: m(() => [
1308
- _(r.$slots, "default", {}, () => {
1309
- var a;
1310
- return [
1311
- (l(!0), b(q, null, U(((a = o(s)) == null ? void 0 : a.options) ?? [], (i) => (l(), f(cr, {
1312
- key: i.key,
1313
- value: i.value
1437
+ default: f(() => {
1438
+ var a;
1439
+ return [
1440
+ (a = o(s).options) != null && a.length ? w(r.$slots, "default", { key: 0 }, () => {
1441
+ var i;
1442
+ return [
1443
+ (u(!0), b(D, null, F(((i = o(s)) == null ? void 0 : i.options) ?? [], (l) => (u(), h(Fe, {
1444
+ key: l.key,
1445
+ value: l.value
1446
+ }, {
1447
+ default: f(() => [
1448
+ I(x(l.label), 1)
1449
+ ]),
1450
+ _: 2
1451
+ }, 1032, ["value"]))), 128))
1452
+ ];
1453
+ }) : w(r.$slots, "default", { key: 1 }, () => [
1454
+ p(Fe, {
1455
+ disabled: "",
1456
+ value: null
1314
1457
  }, {
1315
- default: m(() => [
1316
- V(S(i.label), 1)
1458
+ default: f(() => [
1459
+ I(x(r.$td("ui.selectEmpty", "No options available")), 1)
1317
1460
  ]),
1318
- _: 2
1319
- }, 1032, ["value"]))), 128))
1320
- ];
1321
- })
1322
- ]),
1461
+ _: 1
1462
+ })
1463
+ ])
1464
+ ];
1465
+ }),
1323
1466
  _: 3
1324
1467
  }, 8, ["class"]));
1325
1468
  }
1326
- }), ur = {
1469
+ }), br = {
1327
1470
  viewBox: "0 0 20 20",
1328
1471
  width: "1.2em",
1329
1472
  height: "1.2em"
1330
1473
  };
1331
- function dr(t, s) {
1332
- return l(), b("svg", ur, s[0] || (s[0] = [
1474
+ function yr(t, s) {
1475
+ return u(), b("svg", br, s[0] || (s[0] = [
1333
1476
  y("path", {
1334
1477
  fill: "currentColor",
1335
1478
  d: "m9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828L5.757 6.586L4.343 8z"
1336
1479
  }, null, -1)
1337
1480
  ]));
1338
1481
  }
1339
- const pr = { name: "zondicons-cheveron-down", render: dr }, ut = /* @__PURE__ */ g({
1482
+ const wr = E({ name: "zondicons-cheveron-down", render: yr }), gt = /* @__PURE__ */ g({
1340
1483
  __name: "SelectTrigger",
1341
1484
  props: {
1342
1485
  class: {}
1343
1486
  },
1344
1487
  setup(t) {
1345
- const s = R("select", "<SelectTrigger> must be a child of a <Select>"), e = u(() => H(
1488
+ const s = V("select", "<SelectTrigger> must be a child of a <Select>"), e = c(() => M(
1346
1489
  // eslint-disable-next-line vue/max-len
1347
- "focus:outline-primary-600 grid w-full cursor-default grid-cols-1 rounded-md bg-white py-1.5 pr-2 pl-3 text-left text-gray-900 outline-1 -outline-offset-1 outline-gray-300 focus:outline-2 focus:-outline-offset-2 sm:text-sm/6",
1490
+ "focus:outline-primary-600 data-[state=open]:outline-primary-600 grid w-full cursor-default grid-cols-1 rounded-md bg-white py-1.5 pr-2 pl-3 text-left text-gray-900 outline-1 -outline-offset-1 outline-gray-300 focus:outline-2 focus:-outline-offset-2 sm:text-sm/6",
1348
1491
  { "mt-1": s.label },
1349
1492
  t.class
1350
1493
  ));
1351
- return (r, n) => (l(), f(at, {
1494
+ return (r, n) => (u(), h(dt, {
1352
1495
  class: k(e.value)
1353
1496
  }, {
1354
- default: m(() => [
1355
- h(nt, { class: "col-start-1 row-start-1 truncate pr-6" }),
1356
- h(o(pr), { class: "col-start-1 row-start-1 size-5 self-center justify-self-end text-gray-500 sm:size-4" })
1497
+ default: f(() => [
1498
+ p(ct, { class: "col-start-1 row-start-1 truncate pr-6" }),
1499
+ p(o(wr), { class: "col-start-1 row-start-1 size-5 self-center justify-self-end text-gray-500 sm:size-4" })
1357
1500
  ]),
1358
1501
  _: 1
1359
1502
  }, 8, ["class"]));
1360
1503
  }
1361
- }), mr = /* @__PURE__ */ g({
1504
+ }), $r = /* @__PURE__ */ g({
1362
1505
  __name: "Select",
1363
1506
  props: {
1364
1507
  as: {},
1365
1508
  options: {},
1366
1509
  placeholder: {},
1367
1510
  renderOption: { type: Function },
1511
+ compareOptions: { type: Function },
1368
1512
  labelClass: {},
1369
1513
  optionsClass: {},
1370
1514
  align: {},
@@ -1376,30 +1520,30 @@ const pr = { name: "zondicons-cheveron-down", render: dr }, ut = /* @__PURE__ */
1376
1520
  },
1377
1521
  emits: ["update:modelValue"],
1378
1522
  setup(t) {
1379
- const { forwardRef: s } = Te();
1380
- return (e, r) => (l(), f(ir, P({ ref: o(s) }, e.$props, {
1523
+ const { forwardRef: s } = Ve();
1524
+ return (e, r) => (u(), h(vr, H({ ref: o(s) }, e.$props, {
1381
1525
  "onUpdate:modelValue": r[0] || (r[0] = (n) => e.$emit("update:modelValue", n))
1382
1526
  }), {
1383
- default: m(() => [
1384
- h(it),
1385
- _(e.$slots, "default", {}, () => [
1386
- h(ut),
1387
- h(ct)
1527
+ default: f(() => [
1528
+ p(ft),
1529
+ w(e.$slots, "default", {}, () => [
1530
+ p(gt),
1531
+ p(ht)
1388
1532
  ])
1389
1533
  ]),
1390
1534
  _: 3
1391
1535
  }, 16));
1392
1536
  }
1393
- }), fr = { class: "grow" }, hr = /* @__PURE__ */ g({
1537
+ }), _r = { class: "grow" }, xr = /* @__PURE__ */ g({
1394
1538
  __name: "Language",
1395
1539
  setup(t) {
1396
- const s = J.getBrowserLocale(), e = u(() => [null, ...J.locales]);
1540
+ const s = Z.getBrowserLocale(), e = c(() => [null, ...Z.locales]);
1397
1541
  function r(n) {
1398
- return (n && N.locales[n]) ?? x("settings.localeDefault", "{locale} (default)", {
1399
- locale: N.locales[s] ?? s
1542
+ return (n && j.locales[n]) ?? S("settings.localeDefault", "{locale} (default)", {
1543
+ locale: j.locales[s] ?? s
1400
1544
  });
1401
1545
  }
1402
- return (n, a) => (l(), f(mr, {
1546
+ return (n, a) => (u(), h($r, {
1403
1547
  modelValue: n.$lang.locale,
1404
1548
  "onUpdate:modelValue": a[0] || (a[0] = (i) => n.$lang.locale = i),
1405
1549
  class: "flex flex-col items-start md:flex-row",
@@ -1407,159 +1551,341 @@ const pr = { name: "zondicons-cheveron-down", render: dr }, ut = /* @__PURE__ */
1407
1551
  options: e.value,
1408
1552
  "render-option": r
1409
1553
  }, {
1410
- default: m(() => [
1411
- y("div", fr, [
1412
- h(it, null, {
1413
- default: m(() => [
1414
- V(S(n.$td("settings.locale", "Language")), 1)
1554
+ default: f(() => [
1555
+ y("div", _r, [
1556
+ p(ft, { class: "text-base font-semibold" }, {
1557
+ default: f(() => [
1558
+ I(x(n.$td("settings.locale", "Language")), 1)
1415
1559
  ]),
1416
1560
  _: 1
1417
1561
  }),
1418
- h(A, {
1562
+ p(P, {
1419
1563
  "lang-key": "settings.localeDescription",
1420
1564
  "lang-default": "Choose the application's language.",
1421
1565
  class: "mt-1 text-sm text-gray-500"
1422
1566
  })
1423
1567
  ]),
1424
- h(B, {
1568
+ p(q, {
1425
1569
  variant: "ghost",
1426
- as: ut,
1570
+ as: gt,
1427
1571
  class: "grid w-auto outline-none"
1428
1572
  }),
1429
- h(ct)
1573
+ p(ht)
1430
1574
  ]),
1431
1575
  _: 1
1432
1576
  }, 8, ["modelValue", "options"]));
1433
1577
  }
1434
- }), gr = [
1578
+ }), Cr = [
1435
1579
  {
1436
1580
  priority: 100,
1437
- component: hr
1581
+ component: xr
1438
1582
  }
1439
- ], vr = { $lang: J }, br = {
1583
+ ], kr = { $lang: Z }, Sr = {
1440
1584
  async install(t) {
1441
1585
  var s;
1442
- (s = t.config.globalProperties).$t ?? (s.$t = Xe), t.config.globalProperties.$td = x, gr.forEach((e) => z.addSetting(e)), await be(t, vr);
1586
+ (s = t.config.globalProperties).$t ?? (s.$t = rt), t.config.globalProperties.$td = S, Cr.forEach((e) => A.addSetting(e)), await $e(t, kr);
1443
1587
  }
1444
- }, yr = {
1445
- async install() {
1446
- Re() && (globalThis.testingRuntime = {
1447
- on: (...t) => M.on(...t)
1588
+ }, Tr = /* @__PURE__ */ g({
1589
+ __name: "Markdown",
1590
+ props: {
1591
+ as: {},
1592
+ inline: { type: Boolean },
1593
+ langKey: {},
1594
+ langParams: {},
1595
+ langDefault: {},
1596
+ text: {},
1597
+ actions: {}
1598
+ },
1599
+ setup(t) {
1600
+ const s = Ne(), e = He(), r = c(() => e.default ? e.default().map(Ge).join("") : t.text ?? (t.langKey && (t.langDefault ? S(t.langKey, t.langDefault, t.langParams ?? {}) : rt(t.langKey, t.langParams ?? {})))), n = c(() => {
1601
+ if (!r.value)
1602
+ return null;
1603
+ let l = ur(r.value);
1604
+ return t.inline && (l = l.replace("<p>", "<span>").replace("</p>", "</span>")), l;
1605
+ }), a = () => Lt(t.as ?? (t.inline ? "span" : "div"), {
1606
+ innerHTML: n.value,
1607
+ onClick: i,
1608
+ ...s,
1609
+ class: `${s.class ?? ""} ${t.inline ? "" : "prose"}`
1448
1610
  });
1449
- }
1450
- }, _r = {
1451
- viewBox: "0 0 20 20",
1452
- width: "1.2em",
1453
- height: "1.2em"
1454
- };
1455
- function wr(t, s) {
1456
- return l(), b("svg", _r, s[0] || (s[0] = [
1457
- y("path", {
1458
- fill: "currentColor",
1459
- d: "M10 8.586L2.929 1.515L1.515 2.929L8.586 10l-7.071 7.071l1.414 1.414L10 11.414l7.071 7.071l1.414-1.414L11.414 10l7.071-7.071l-1.414-1.414z"
1460
- }, null, -1)
1461
- ]));
1462
- }
1463
- const $r = { name: "zondicons-close", render: wr }, Cr = /* @__PURE__ */ g({
1464
- __name: "HeadlessModal",
1611
+ async function i(l) {
1612
+ var v, $;
1613
+ const { target: d } = l;
1614
+ if (Pe(d, HTMLElement) && d.dataset.markdownAction) {
1615
+ ($ = (v = t.actions) == null ? void 0 : v[d.dataset.markdownAction]) == null || $.call(v);
1616
+ return;
1617
+ }
1618
+ if (Pe(d, HTMLAnchorElement) && d.dataset.markdownRoute) {
1619
+ const m = ir();
1620
+ m && (l.preventDefault(), m.visit(d.dataset.markdownRoute));
1621
+ return;
1622
+ }
1623
+ }
1624
+ return (l, d) => (u(), h(a));
1625
+ }
1626
+ }), Mr = (t, s) => {
1627
+ const e = t.__vccOpts || t;
1628
+ for (const [r, n] of s)
1629
+ e[r] = n;
1630
+ return e;
1631
+ }, P = /* @__PURE__ */ Mr(Tr, [["__scopeId", "data-v-8b211cfb"]]), Hr = { class: "flex-grow" }, Er = ["id"], Vr = /* @__PURE__ */ g({
1632
+ __name: "Setting",
1465
1633
  props: {
1466
- persistent: { type: Boolean },
1467
1634
  title: {},
1468
- titleHidden: { type: Boolean },
1635
+ titleId: {},
1469
1636
  description: {},
1470
- descriptionHidden: { type: Boolean }
1637
+ class: {},
1638
+ layout: { default: "horizontal" }
1471
1639
  },
1472
- setup(t, { expose: s }) {
1473
- const e = D(null), { modal: r } = R(
1474
- "modal",
1475
- "could not obtain modal reference from <HeadlessModal>, did you render this component manually? Show it using $ui.openModal() instead"
1476
- );
1477
- s({ close: w, $content: e });
1478
- const { forwardRef: n, currentElement: a } = Te(), i = D(!0), c = D(!1);
1479
- se("$modalContentRef", e), oe("close-modal", async ({ id: v, result: C }) => {
1480
- v === r.id && await w(C);
1481
- }), oe("hide-modal", async ({ id: v }) => {
1482
- v === r.id && await p();
1483
- }), oe("show-modal", async ({ id: v }) => {
1484
- v === r.id && await d();
1485
- });
1486
- async function p() {
1487
- a.value && (i.value = !0);
1488
- }
1489
- async function d() {
1490
- a.value && (i.value = !1);
1491
- }
1492
- async function w(v) {
1493
- c.value || (M.emit("modal-will-close", { modal: r, result: v }), await p(), c.value = !0, M.emit("modal-closed", { modal: r, result: v }));
1494
- }
1495
- return (v, C) => (l(), f(o(is), {
1496
- ref: o(n),
1497
- open: "",
1498
- "onUpdate:open": C[0] || (C[0] = (T) => v.persistent || w())
1499
- }, {
1500
- default: m(() => [
1501
- h(o(cs), null, {
1502
- default: m(() => [
1503
- _(v.$slots, "default", { close: w })
1504
- ]),
1505
- _: 3
1506
- })
1640
+ setup(t) {
1641
+ const s = c(() => M(t.class, "flex flex-col justify-center gap-1"));
1642
+ return (e, r) => (u(), b("div", {
1643
+ class: k(["mt-4 flex", { "flex-col": e.layout === "vertical" }])
1644
+ }, [
1645
+ y("div", Hr, [
1646
+ y("h3", {
1647
+ id: e.titleId,
1648
+ class: "text-base font-semibold"
1649
+ }, x(e.title), 9, Er),
1650
+ e.description ? (u(), h(P, {
1651
+ key: 0,
1652
+ text: e.description,
1653
+ class: "mt-1 text-sm text-gray-500"
1654
+ }, null, 8, ["text"])) : T("", !0)
1507
1655
  ]),
1508
- _: 3
1509
- }, 512));
1656
+ y("div", {
1657
+ class: k(s.value)
1658
+ }, [
1659
+ w(e.$slots, "default")
1660
+ ], 2)
1661
+ ], 2));
1510
1662
  }
1511
- }), dt = /* @__PURE__ */ g({
1512
- __name: "ModalContext",
1663
+ }), Lr = ["for"], Ir = /* @__PURE__ */ g({
1664
+ inheritAttrs: !1,
1665
+ __name: "HeadlessSwitch",
1513
1666
  props: {
1514
- modal: {},
1515
- childIndex: {}
1516
- },
1667
+ name: {},
1668
+ label: {},
1669
+ description: {},
1670
+ modelValue: {},
1671
+ class: {},
1672
+ labelClass: {},
1673
+ inputClass: {},
1674
+ thumbClass: {}
1675
+ },
1676
+ emits: ["update:modelValue"],
1677
+ setup(t, { expose: s, emit: e }) {
1678
+ const r = e, n = X("form", null), a = c(() => !n || !t.name ? null : n.errors[t.name] ?? null), i = {
1679
+ id: `switch-${re()}`,
1680
+ name: c(() => t.name),
1681
+ label: c(() => t.label),
1682
+ description: c(() => t.description),
1683
+ value: c(() => n && t.name ? n.getFieldValue(t.name) : t.modelValue),
1684
+ errors: ve(a),
1685
+ required: c(() => {
1686
+ if (!(!t.name || !n))
1687
+ return n.getFieldRules(t.name).includes("required");
1688
+ }),
1689
+ update(l) {
1690
+ if (n && t.name) {
1691
+ n.setFieldValue(t.name, l);
1692
+ return;
1693
+ }
1694
+ r("update:modelValue", l);
1695
+ }
1696
+ };
1697
+ return s(i), Y(() => {
1698
+ !t.description && !a.value || console.warn("Errors and description not implemented in <HeadlessSwitch>");
1699
+ }), (l, d) => (u(), b("div", {
1700
+ class: k(t.class)
1701
+ }, [
1702
+ l.label ? (u(), b("label", {
1703
+ key: 0,
1704
+ for: i.id,
1705
+ class: k(l.labelClass)
1706
+ }, x(l.label), 11, Lr)) : T("", !0),
1707
+ p(o(vs), H({
1708
+ id: i.id,
1709
+ name: l.name,
1710
+ "model-value": i.value.value
1711
+ }, l.$attrs, {
1712
+ class: l.inputClass,
1713
+ "onUpdate:modelValue": d[0] || (d[0] = (v) => l.$emit("update:modelValue", v))
1714
+ }), {
1715
+ default: f(() => [
1716
+ p(o(bs), {
1717
+ class: k(l.thumbClass)
1718
+ }, null, 8, ["class"])
1719
+ ]),
1720
+ _: 1
1721
+ }, 16, ["id", "name", "model-value", "class"])
1722
+ ], 2));
1723
+ }
1724
+ }), qr = /* @__PURE__ */ g({
1725
+ __name: "Switch",
1517
1726
  setup(t) {
1518
- const s = t, e = u(() => {
1727
+ return (s, e) => (u(), h(Ir, {
1728
+ class: "flex flex-row items-center gap-1",
1729
+ "input-class": "disabled:opacity-50 disabled:cursor-not-allowed data-[state=checked]:bg-primary-600 data-[state=unchecked]:bg-gray-200 relative inline-flex h-6 w-11 shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focusdisabled:opacity-50 disabled:cursor-not-allowed :ring-2 focus:ring-primary-600 focus:ring-offset-2 focus:outline-hidden",
1730
+ "thumb-class": "data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0 pointer-events-none inline-block size-5 transform rounded-full bg-white shadow-sm ring-0 transition duration-200 ease-in-out"
1731
+ }));
1732
+ }
1733
+ }), zr = /* @__PURE__ */ g({
1734
+ __name: "Debug",
1735
+ setup(t) {
1736
+ return (s, e) => (u(), h(Vr, {
1737
+ "title-id": "debug-setting",
1738
+ title: s.$td("settings.debug", "Debugging"),
1739
+ description: s.$td("settings.debugDescription", "Enable debugging with [Eruda](https://eruda.liriliri.io/).")
1740
+ }, {
1741
+ default: f(() => [
1742
+ p(qr, {
1743
+ modelValue: s.$errors.debug,
1744
+ "onUpdate:modelValue": e[0] || (e[0] = (r) => s.$errors.debug = r),
1745
+ "aria-labelledby": "debug-setting"
1746
+ }, null, 8, ["modelValue"])
1747
+ ]),
1748
+ _: 1
1749
+ }, 8, ["title", "description"]));
1750
+ }
1751
+ }), Rr = [
1752
+ {
1753
+ priority: 10,
1754
+ component: zr
1755
+ }
1756
+ ], vt = [];
1757
+ function yl(t) {
1758
+ vt.push(t);
1759
+ }
1760
+ function bt(t) {
1761
+ for (const s of vt) {
1762
+ const e = s(t);
1763
+ if (e)
1764
+ return e;
1765
+ }
1766
+ return typeof t == "string" ? t : t instanceof Error || t instanceof be ? t.message : ce(t) ? B(t.message ?? t.description ?? "Unknown error object") : S("errors.unknown", "Unknown Error");
1767
+ }
1768
+ class Ue extends be {
1769
+ }
1770
+ const Pr = { $errors: nt }, Ar = (t) => (nt.report(t), !0);
1771
+ function Dr(t, s = () => !1) {
1772
+ const e = (r) => s(r) || Ar(r);
1773
+ t.config.errorHandler = e, globalThis.onerror = (r, n, a, i, l) => e(l ?? r), globalThis.onunhandledrejection = (r) => e(r.reason);
1774
+ }
1775
+ const jr = {
1776
+ async install(t, s) {
1777
+ Dr(t, s.handleError), Rr.forEach((e) => A.addSetting(e)), await $e(t, Pr);
1778
+ }
1779
+ }, Br = {
1780
+ async install() {
1781
+ Ee() && (globalThis.testingRuntime = {
1782
+ on: (...t) => R.on(...t),
1783
+ service: (t) => A.service(t)
1784
+ });
1785
+ }
1786
+ }, Fr = {
1787
+ viewBox: "0 0 20 20",
1788
+ width: "1.2em",
1789
+ height: "1.2em"
1790
+ };
1791
+ function Ur(t, s) {
1792
+ return u(), b("svg", Fr, s[0] || (s[0] = [
1793
+ y("path", {
1794
+ fill: "currentColor",
1795
+ d: "M10 8.586L2.929 1.515L1.515 2.929L8.586 10l-7.071 7.071l1.414 1.414L10 11.414l7.071 7.071l1.414-1.414L11.414 10l7.071-7.071l-1.414-1.414z"
1796
+ }, null, -1)
1797
+ ]));
1798
+ }
1799
+ const Or = E({ name: "zondicons-close", render: Ur }), Nr = /* @__PURE__ */ g({
1800
+ __name: "HeadlessModal",
1801
+ props: {
1802
+ persistent: { type: Boolean },
1803
+ title: {},
1804
+ titleHidden: { type: Boolean },
1805
+ description: {},
1806
+ descriptionHidden: { type: Boolean }
1807
+ },
1808
+ setup(t, { expose: s }) {
1809
+ const e = U(null), { modal: r } = V(
1810
+ "modal",
1811
+ "could not obtain modal reference from <HeadlessModal>, did you render this component manually? Show it using $ui.modal() instead"
1812
+ );
1813
+ s({ close: i, $content: e });
1814
+ const { forwardRef: n } = Ve(), a = U(!1);
1815
+ le("$modalContentRef", e), ot("close-modal", async ({ id: l, result: d }) => {
1816
+ l === r.id && await i(d);
1817
+ });
1818
+ async function i(l) {
1819
+ a.value || (await R.emit("modal-will-close", { modal: r, result: l }), a.value = !0, await R.emit("modal-has-closed", { modal: r, result: l }));
1820
+ }
1821
+ return (l, d) => (u(), h(o(ys), {
1822
+ ref: o(n),
1823
+ open: "",
1824
+ "onUpdate:open": d[0] || (d[0] = (v) => l.persistent || i())
1825
+ }, {
1826
+ default: f(() => [
1827
+ p(o(ws), null, {
1828
+ default: f(() => [
1829
+ w(l.$slots, "default", { close: i })
1830
+ ]),
1831
+ _: 3
1832
+ })
1833
+ ]),
1834
+ _: 3
1835
+ }, 512));
1836
+ }
1837
+ }), yt = /* @__PURE__ */ g({
1838
+ __name: "ModalContext",
1839
+ props: {
1840
+ modal: {},
1841
+ childIndex: {}
1842
+ },
1843
+ setup(t) {
1844
+ const s = t, e = c(() => {
1519
1845
  const r = {};
1520
1846
  for (const n in s.modal.properties)
1521
1847
  r[n] = o(s.modal.properties[n]);
1522
1848
  return r;
1523
1849
  });
1524
- return se("modal", {
1525
- modal: Ie(s, "modal"),
1526
- childIndex: Ie(s, "childIndex")
1527
- }), (r, n) => (l(), f(W(r.modal.component), ee(te(e.value)), null, 16));
1850
+ return le("modal", {
1851
+ modal: Re(s, "modal"),
1852
+ childIndex: Re(s, "childIndex")
1853
+ }), (r, n) => (u(), h(W(r.modal.component), ne(ae(e.value)), null, 16));
1528
1854
  }
1529
- }), xr = /* @__PURE__ */ g({
1855
+ }), Wr = /* @__PURE__ */ g({
1530
1856
  __name: "HeadlessModalContent",
1531
1857
  setup(t) {
1532
- const { childIndex: s = 0 } = R(
1858
+ const { childIndex: s = 0 } = V(
1533
1859
  "modal",
1534
- "could not obtain modal reference from <HeadlessModalContent>, did you render this component manually? Show it using $ui.openModal() instead"
1535
- ), e = Vs("$modalContentRef"), r = re("$contentRef"), n = u(() => I.modals[s] ?? null);
1536
- return ce(() => e.value = r.value), (a, i) => (l(), f(o(us), { ref: "$contentRef" }, {
1537
- default: m(() => [
1538
- _(a.$slots, "default"),
1539
- n.value ? (l(), f(dt, {
1860
+ "could not obtain modal reference from <HeadlessModalContent>, did you render this component manually? Show it using $ui.modal() instead"
1861
+ ), e = Os("$modalContentRef"), r = G("$contentRef"), n = c(() => z.modals[s] ?? null);
1862
+ return Y(() => e.value = r.value), (a, i) => (u(), h(o($s), { ref: "$contentRef" }, {
1863
+ default: f(() => [
1864
+ w(a.$slots, "default"),
1865
+ n.value ? (u(), h(yt, {
1540
1866
  key: 0,
1541
1867
  "child-index": o(s) + 1,
1542
1868
  modal: n.value
1543
- }, null, 8, ["child-index", "modal"])) : E("", !0)
1869
+ }, null, 8, ["child-index", "modal"])) : T("", !0)
1544
1870
  ]),
1545
1871
  _: 3
1546
1872
  }, 512));
1547
1873
  }
1548
- }), Sr = /* @__PURE__ */ g({
1874
+ }), Kr = /* @__PURE__ */ g({
1549
1875
  __name: "HeadlessModalDescription",
1550
1876
  props: {
1551
1877
  asChild: { type: Boolean },
1552
1878
  as: {}
1553
1879
  },
1554
1880
  setup(t) {
1555
- return (s, e) => (l(), f(o(ds), ee(te(s.$props)), {
1556
- default: m(() => [
1557
- _(s.$slots, "default")
1881
+ return (s, e) => (u(), h(o(_s), ne(ae(s.$props)), {
1882
+ default: f(() => [
1883
+ w(s.$slots, "default")
1558
1884
  ]),
1559
1885
  _: 3
1560
1886
  }, 16));
1561
1887
  }
1562
- }), kr = /* @__PURE__ */ g({
1888
+ }), Qr = /* @__PURE__ */ g({
1563
1889
  __name: "HeadlessModalOverlay",
1564
1890
  props: {
1565
1891
  forceMount: { type: Boolean },
@@ -1567,31 +1893,31 @@ const $r = { name: "zondicons-close", render: wr }, Cr = /* @__PURE__ */ g({
1567
1893
  as: {}
1568
1894
  },
1569
1895
  setup(t) {
1570
- return (s, e) => (l(), f(o(ps), ee(te(s.$props)), {
1571
- default: m(() => [
1572
- _(s.$slots, "default")
1896
+ return (s, e) => (u(), h(o(xs), ne(ae(s.$props)), {
1897
+ default: f(() => [
1898
+ w(s.$slots, "default")
1573
1899
  ]),
1574
1900
  _: 3
1575
1901
  }, 16));
1576
1902
  }
1577
- }), Mr = /* @__PURE__ */ g({
1903
+ }), Jr = /* @__PURE__ */ g({
1578
1904
  __name: "HeadlessModalTitle",
1579
1905
  props: {
1580
1906
  asChild: { type: Boolean },
1581
1907
  as: {}
1582
1908
  },
1583
1909
  setup(t) {
1584
- return (s, e) => (l(), f(o(ms), ee(te(s.$props)), {
1585
- default: m(() => [
1586
- _(s.$slots, "default")
1910
+ return (s, e) => (u(), h(o(Cs), ne(ae(s.$props)), {
1911
+ default: f(() => [
1912
+ w(s.$slots, "default")
1587
1913
  ]),
1588
1914
  _: 3
1589
1915
  }, 16));
1590
1916
  }
1591
- }), Er = {
1917
+ }), Zr = {
1592
1918
  key: 0,
1593
- class: "absolute top-0 right-0 hidden pt-1.5 pr-1.5 sm:block"
1594
- }, Hr = { class: "sr-only" }, ne = /* @__PURE__ */ g({
1919
+ class: "absolute top-0 right-0 hidden pt-3.5 pr-2.5 sm:block"
1920
+ }, Xr = ["onClick"], Yr = { class: "sr-only" }, se = /* @__PURE__ */ g({
1595
1921
  __name: "Modal",
1596
1922
  props: {
1597
1923
  persistent: { type: Boolean },
@@ -1599,76 +1925,90 @@ const $r = { name: "zondicons-close", render: wr }, Cr = /* @__PURE__ */ g({
1599
1925
  titleHidden: { type: Boolean },
1600
1926
  description: {},
1601
1927
  descriptionHidden: { type: Boolean },
1602
- dismissable: { type: Boolean, default: !0 },
1603
1928
  wrapperClass: { default: "" },
1604
- class: { default: "" }
1929
+ class: { default: "" },
1930
+ closeHidden: { type: Boolean }
1605
1931
  },
1606
1932
  setup(t, { expose: s }) {
1607
- const e = Y(t, ["class", "dismissable", "wrapperClass", "title", "titleHidden", "description", "persistent"]);
1933
+ const e = N(t, ["class", "wrapperClass", "title", "titleHidden", "description", "persistent", "closeHidden"]);
1608
1934
  s({
1609
- close: async (d) => {
1610
- var w;
1611
- return (w = a.value) == null ? void 0 : w.close(d);
1935
+ close: async (m) => {
1936
+ var C;
1937
+ return (C = a.value) == null ? void 0 : C.close(m);
1612
1938
  },
1613
- $content: u(() => {
1614
- var d;
1615
- return (d = a.value) == null ? void 0 : d.$content;
1939
+ $content: c(() => {
1940
+ var m;
1941
+ return (m = a.value) == null ? void 0 : m.$content;
1616
1942
  })
1617
1943
  });
1618
- const { forwardRef: r, currentRef: n } = Te(), a = n, i = u(() => t.description ? {} : { "aria-describedby": void 0 }), c = u(() => H({ "mt-2": t.title && !t.titleHidden }, t.class)), p = u(() => H(
1619
- // eslint-disable-next-line vue/max-len
1620
- "fixed top-1/2 left-1/2 z-50 w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 overflow-hidden rounded-lg bg-white px-4 pt-5 pb-4 text-left shadow-xl sm:max-w-lg",
1944
+ const { forwardRef: r, currentRef: n } = Ve(), a = n, i = V("modal"), l = c(() => !i.modal.closing && i.childIndex === z.openModals.length), d = c(() => t.description ? {} : { "aria-describedby": void 0 }), v = c(() => M("max-h-[90vh] overflow-auto px-4 pb-4", { "pt-4": !t.title || t.titleHidden }, t.class)), $ = c(() => M(
1945
+ "isolate fixed top-1/2 left-1/2 z-50 w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2",
1946
+ "overflow-hidden rounded-lg bg-white text-left shadow-xl sm:max-w-lg",
1947
+ "animate-[fade-in_var(--tw-duration)_ease-in-out,grow_var(--tw-duration)_ease-in-out]",
1948
+ "transition-[scale,opacity] will-change-[scale,opacity] duration-300",
1949
+ {
1950
+ "scale-50 opacity-0": !l.value,
1951
+ "scale-100 opacity-100": l.value
1952
+ },
1621
1953
  t.wrapperClass
1622
1954
  ));
1623
- return (d, w) => (l(), f(Cr, P(e, {
1624
- ref: (v) => o(r)(v),
1625
- persistent: d.persistent
1955
+ return ot("modal-will-close", async ({ modal: { id: m } }) => {
1956
+ m === i.modal.id && await ue({ ms: 300 });
1957
+ }), (m, C) => (u(), h(Nr, H(e, {
1958
+ ref: (L) => o(r)(L),
1959
+ persistent: m.persistent
1626
1960
  }), {
1627
- default: m(({ close: v }) => [
1628
- h(kr, { class: "fixed inset-0 bg-black/30" }),
1629
- h(xr, P(i.value, { class: p.value }), {
1630
- default: m(() => [
1631
- !d.persistent && d.dismissable ? (l(), b("div", Er, [
1632
- h(B, {
1633
- variant: "ghost",
1634
- size: "icon",
1635
- onClick: (C) => v()
1636
- }, {
1637
- default: m(() => [
1638
- y("span", Hr, S(d.$td("ui.close", "Close")), 1),
1639
- h(o($r), { class: "size-3 text-gray-400" })
1640
- ]),
1641
- _: 2
1642
- }, 1032, ["onClick"])
1643
- ])) : E("", !0),
1644
- d.title ? (l(), f(Mr, {
1961
+ default: f(({ close: L }) => [
1962
+ p(Qr, {
1963
+ class: k(["fixed inset-0 animate-[fade-in_var(--tw-duration)_ease-in-out] transition-opacity duration-300 will-change-[opacity]", {
1964
+ "bg-black/30": o(i).childIndex === 1,
1965
+ "opacity-0": o(i).childIndex === 1 && o(i).modal.closing
1966
+ }])
1967
+ }, null, 8, ["class"]),
1968
+ p(Wr, H(d.value, { class: $.value }), {
1969
+ default: f(() => [
1970
+ !m.persistent && !m.closeHidden ? (u(), b("div", Zr, [
1971
+ y("button", {
1972
+ type: "button",
1973
+ class: "clickable z-10 rounded-full p-2.5 text-gray-400 hover:text-gray-500",
1974
+ onClick: (_e) => L()
1975
+ }, [
1976
+ y("span", Yr, x(m.$td("ui.close", "Close")), 1),
1977
+ p(o(Or), { class: "size-4" })
1978
+ ], 8, Xr)
1979
+ ])) : T("", !0),
1980
+ m.title ? (u(), h(Jr, {
1645
1981
  key: 1,
1646
- class: k(["text-base font-semibold text-gray-900", { "sr-only": d.titleHidden }])
1982
+ class: k(["px-4 pt-5 text-base font-semibold text-gray-900", {
1983
+ "sr-only": m.titleHidden,
1984
+ "pb-0": m.description && !m.descriptionHidden,
1985
+ "pb-2": !m.description || m.descriptionHidden
1986
+ }])
1647
1987
  }, {
1648
- default: m(() => [
1649
- h(A, {
1650
- text: d.title,
1988
+ default: f(() => [
1989
+ p(P, {
1990
+ text: m.title,
1651
1991
  inline: ""
1652
1992
  }, null, 8, ["text"])
1653
1993
  ]),
1654
1994
  _: 1
1655
- }, 8, ["class"])) : E("", !0),
1656
- d.description ? (l(), f(Sr, {
1995
+ }, 8, ["class"])) : T("", !0),
1996
+ m.description ? (u(), h(Kr, {
1657
1997
  key: 2,
1658
- class: k({ "sr-only": d.descriptionHidden })
1998
+ class: k(["px-4 pt-1 pb-2", { "sr-only": m.descriptionHidden }])
1659
1999
  }, {
1660
- default: m(() => [
1661
- h(A, {
1662
- text: d.description,
1663
- class: "mt-1 text-sm leading-6 text-gray-500"
2000
+ default: f(() => [
2001
+ p(P, {
2002
+ text: m.description,
2003
+ class: "text-sm leading-6 text-gray-500"
1664
2004
  }, null, 8, ["text"])
1665
2005
  ]),
1666
2006
  _: 1
1667
- }, 8, ["class"])) : E("", !0),
2007
+ }, 8, ["class"])) : T("", !0),
1668
2008
  y("div", {
1669
- class: k(c.value)
2009
+ class: k(v.value)
1670
2010
  }, [
1671
- _(d.$slots, "default", { close: v })
2011
+ w(m.$slots, "default", { close: L })
1672
2012
  ], 2)
1673
2013
  ]),
1674
2014
  _: 2
@@ -1677,21 +2017,30 @@ const $r = { name: "zondicons-close", render: wr }, Cr = /* @__PURE__ */ g({
1677
2017
  _: 3
1678
2018
  }, 16, ["persistent"]));
1679
2019
  }
1680
- }), Lr = /* @__PURE__ */ g({
2020
+ });
2021
+ function Gr(t) {
2022
+ const s = c(() => t.title ?? S("ui.alert", "Alert")), e = c(() => !t.title);
2023
+ return { renderedTitle: s, titleHidden: e };
2024
+ }
2025
+ const en = /* @__PURE__ */ g({
1681
2026
  __name: "AlertModal",
1682
2027
  props: {
1683
2028
  title: {},
1684
2029
  message: {}
1685
2030
  },
1686
- setup(t) {
1687
- return (s, e) => (l(), f(ne, { title: s.title }, {
1688
- default: m(() => [
1689
- h(A, { text: s.message }, null, 8, ["text"])
2031
+ setup(t, { expose: s }) {
2032
+ const e = t, { renderedTitle: r, titleHidden: n } = Gr(e);
2033
+ return s(), (a, i) => (u(), h(se, {
2034
+ title: o(r),
2035
+ "title-hidden": o(n)
2036
+ }, {
2037
+ default: f(() => [
2038
+ p(P, { text: a.message }, null, 8, ["text"])
1690
2039
  ]),
1691
2040
  _: 1
1692
- }, 8, ["title"]));
2041
+ }, 8, ["title", "title-hidden"]));
1693
2042
  }
1694
- }), pt = /* @__PURE__ */ g({
2043
+ }), wt = /* @__PURE__ */ g({
1695
2044
  __name: "Form",
1696
2045
  props: {
1697
2046
  form: {}
@@ -1700,214 +2049,39 @@ const $r = { name: "zondicons-close", render: wr }, Cr = /* @__PURE__ */ g({
1700
2049
  setup(t, { emit: s }) {
1701
2050
  let e;
1702
2051
  const r = s;
1703
- return ce((n) => {
2052
+ return Y((n) => {
1704
2053
  var a;
1705
2054
  e == null || e(), e = (a = t.form) == null ? void 0 : a.on("submit", () => r("submit")), n(() => e == null ? void 0 : e());
1706
- }), se("form", t.form), (n, a) => (l(), b("form", {
1707
- onSubmit: a[0] || (a[0] = Ue((i) => {
1708
- var c;
1709
- return (c = n.form) == null ? void 0 : c.submit();
2055
+ }), le("form", t.form), (n, a) => (u(), b("form", {
2056
+ onSubmit: a[0] || (a[0] = We((i) => {
2057
+ var l;
2058
+ return (l = n.form) == null ? void 0 : l.submit();
1710
2059
  }, ["prevent"]))
1711
2060
  }, [
1712
- _(n.$slots, "default")
2061
+ w(n.$slots, "default")
1713
2062
  ], 32));
1714
2063
  }
1715
- }), Rr = {
1716
- required: (t) => t ? void 0 : "required"
1717
- }, de = { ...Rr };
1718
- function Ea(t, s) {
1719
- de[t] = s;
1720
- }
1721
- function Tr(t, s) {
1722
- var r;
1723
- const e = (r = de[s]) == null ? void 0 : r.call(de, t);
1724
- return e ? We(e) : [];
1725
- }
1726
- const F = {
1727
- String: "string",
1728
- Number: "number",
1729
- Boolean: "boolean",
1730
- Object: "object",
1731
- Date: "date"
1732
- }, je = /* @__PURE__ */ new WeakMap();
1733
- class Pr extends Ne {
1734
- constructor(e) {
1735
- super();
1736
- $(this, "errors");
1737
- $(this, "_fields");
1738
- $(this, "_data");
1739
- $(this, "_submitted");
1740
- $(this, "_errors");
1741
- $(this, "_listeners", {});
1742
- this._fields = e, this._submitted = D(!1), this._data = this.getInitialData(e), this._errors = this.getInitialErrors(e), je.set(
1743
- this,
1744
- u(() => !Object.values(this._errors).some((r) => r !== null))
1745
- ), this.errors = Le(this._errors);
1746
- }
1747
- get valid() {
1748
- var e;
1749
- return !!((e = je.get(this)) != null && e.value);
1750
- }
1751
- get submitted() {
1752
- return this._submitted.value;
1753
- }
1754
- setFieldValue(e, r) {
1755
- const n = this._fields[e] ?? Q(`Trying to set undefined '${j(e)}' field`);
1756
- this._data[e] = n.type === F.String && (n.trim ?? !0) ? j(r).trim() : r, this._submitted.value && this.validate();
1757
- }
1758
- getFieldValue(e) {
1759
- return this._data[e];
1760
- }
1761
- getFieldRules(e) {
1762
- var r, n;
1763
- return ((n = (r = this._fields[e]) == null ? void 0 : r.rules) == null ? void 0 : n.split("|")) ?? [];
1764
- }
1765
- data() {
1766
- return { ...this._data };
1767
- }
1768
- validate() {
1769
- const e = Object.entries(this._fields).reduce(
1770
- (r, [n, a]) => (r[n] = this.getFieldErrors(n, a), r),
1771
- {}
1772
- );
1773
- return this.resetErrors(e), this.valid;
1774
- }
1775
- reset(e = {}) {
1776
- this._submitted.value = !1, e.keepData || this.resetData(), e.keepErrors || this.resetErrors();
1777
- }
1778
- submit() {
1779
- var r;
1780
- this._submitted.value = !0;
1781
- const e = this.validate();
1782
- return e && ((r = this._listeners.submit) == null || r.forEach((n) => n())), e;
1783
- }
1784
- on(e, r) {
1785
- var n, a;
1786
- return (n = this._listeners)[e] ?? (n[e] = []), (a = this._listeners[e]) == null || a.push(r), () => this.off(e, r);
1787
- }
1788
- off(e, r) {
1789
- Ce(this._listeners[e] ?? [], r);
1790
- }
1791
- async focus(e) {
1792
- var r;
1793
- await qe(), (r = this._listeners.focus) == null || r.forEach((n) => n(e));
1794
- }
1795
- __get(e) {
1796
- return e in this._fields ? this.getFieldValue(e) : super.__get(e);
1797
- }
1798
- __set(e, r) {
1799
- if (!(e in this._fields)) {
1800
- super.__set(e, r);
1801
- return;
1802
- }
1803
- this.setFieldValue(e, r);
1804
- }
1805
- getFieldErrors(e, r) {
1806
- var c;
1807
- const n = [], a = this._data[e], i = ((c = r.rules) == null ? void 0 : c.split("|")) ?? [];
1808
- for (const p of i)
1809
- p !== "required" && a == null || n.push(...Tr(a, p));
1810
- return n.length > 0 ? n : null;
1811
- }
1812
- getInitialData(e) {
1813
- if (this.static().isConjuring())
1814
- return {};
1815
- const r = Object.entries(e).reduce((n, [a, i]) => (n[a] = i.default ?? null, n), {});
1816
- return pe(r);
1817
- }
1818
- getInitialErrors(e) {
1819
- if (this.static().isConjuring())
1820
- return {};
1821
- const r = Object.keys(e).reduce((n, a) => (n[a] = null, n), {});
1822
- return pe(r);
1823
- }
1824
- resetData() {
1825
- for (const [e, r] of Object.entries(this._fields))
1826
- this._data[e] = r.default ?? null;
1827
- }
1828
- resetErrors(e) {
1829
- Object.keys(this._errors).forEach((r) => delete this._errors[r]), e && Object.assign(this._errors, e);
1830
- }
1831
- }
1832
- function mt(t) {
1833
- return new Pr(t);
1834
- }
1835
- function Ha(t, s = {}) {
1836
- return {
1837
- default: t,
1838
- type: F.Boolean,
1839
- rules: s.rules
1840
- };
1841
- }
1842
- function La(t, s = {}) {
1843
- return {
1844
- default: t,
1845
- type: F.Date,
1846
- rules: s.rules
1847
- };
1848
- }
1849
- function Ra(t) {
1850
- return {
1851
- default: t,
1852
- type: F.Boolean,
1853
- rules: "required"
1854
- };
1855
- }
1856
- function Ta(t) {
1857
- return {
1858
- default: t,
1859
- type: F.Date,
1860
- rules: "required"
1861
- };
1862
- }
1863
- function Pa(t) {
1864
- return {
1865
- default: t,
1866
- type: F.Number,
1867
- rules: "required"
1868
- };
1869
- }
1870
- function Ir(t) {
1871
- return {
1872
- default: t,
1873
- type: F.String,
1874
- rules: "required"
1875
- };
1876
- }
1877
- function Ia(t, s = {}) {
1878
- return {
1879
- default: t,
1880
- type: F.Number,
1881
- rules: s.rules
1882
- };
1883
- }
1884
- function Va(t, s = {}) {
1885
- return {
1886
- default: t,
1887
- type: F.String,
1888
- rules: s.rules
1889
- };
1890
- }
1891
- function Vr(t) {
1892
- const s = mt(
2064
+ });
2065
+ function tn(t) {
2066
+ const s = ut(
1893
2067
  Object.entries(t.checkboxes ?? {}).reduce(
1894
- (n, [a, i]) => ({
1895
- [a]: {
1896
- type: F.Boolean,
1897
- default: i.default,
1898
- required: i.required ? "required" : void 0
2068
+ (i, [l, d]) => ({
2069
+ [l]: {
2070
+ type: "boolean",
2071
+ default: d.default,
2072
+ required: d.required ? "required" : void 0
1899
2073
  },
1900
- ...n
2074
+ ...i
1901
2075
  }),
1902
2076
  {}
1903
2077
  )
1904
- ), e = u(() => t.acceptText ?? x("ui.accept", "Ok")), r = u(() => t.cancelText ?? x("ui.cancel", "Cancel"));
1905
- return { form: s, renderedAcceptText: e, renderedCancelText: r };
2078
+ ), e = c(() => t.title ?? S("ui.confirm", "Confirm")), r = c(() => !t.title), n = c(() => t.acceptText ?? S("ui.accept", "Ok")), a = c(() => t.cancelText ?? S("ui.cancel", "Cancel"));
2079
+ return { form: s, renderedTitle: e, titleHidden: r, renderedAcceptText: n, renderedCancelText: a };
1906
2080
  }
1907
- const Ar = {
2081
+ const sn = {
1908
2082
  key: 0,
1909
2083
  class: "mt-4 flex flex-col text-sm text-gray-600"
1910
- }, Br = { class: "flex items-center" }, Dr = ["onUpdate:modelValue", "required"], zr = { class: "ml-1.5" }, jr = { class: "mt-4 flex flex-row-reverse gap-2" }, qr = /* @__PURE__ */ g({
2084
+ }, rn = { class: "flex items-center" }, nn = ["onUpdate:modelValue", "required"], an = { class: "ml-1.5" }, ln = { class: "mt-4 flex flex-row-reverse gap-2" }, on = /* @__PURE__ */ g({
1911
2085
  __name: "ConfirmModal",
1912
2086
  props: {
1913
2087
  title: {},
@@ -1920,54 +2094,55 @@ const Ar = {
1920
2094
  actions: {},
1921
2095
  required: { type: Boolean }
1922
2096
  },
1923
- setup(t) {
1924
- const s = Y(t, ["cancelVariant"]), { form: e, renderedAcceptText: r, renderedCancelText: n } = Vr(s);
1925
- return (a, i) => (l(), f(ne, {
1926
- title: a.title,
2097
+ setup(t, { expose: s }) {
2098
+ const e = N(t, ["cancelVariant"]), { form: r, renderedTitle: n, titleHidden: a, renderedAcceptText: i, renderedCancelText: l } = tn(e);
2099
+ return s(), (d, v) => (u(), h(se, {
2100
+ title: o(n),
2101
+ "title-hidden": o(a),
1927
2102
  persistent: ""
1928
2103
  }, {
1929
- default: m(({ close: c }) => [
1930
- h(pt, {
1931
- form: o(e),
1932
- onSubmit: (p) => c([!0, o(e).data()])
2104
+ default: f(({ close: $ }) => [
2105
+ p(wt, {
2106
+ form: o(r),
2107
+ onSubmit: (m) => $([!0, o(r).data()])
1933
2108
  }, {
1934
- default: m(() => [
1935
- h(A, {
1936
- text: a.message,
1937
- actions: a.actions
2109
+ default: f(() => [
2110
+ p(P, {
2111
+ text: d.message,
2112
+ actions: d.actions
1938
2113
  }, null, 8, ["text", "actions"]),
1939
- a.checkboxes ? (l(), b("ul", Ar, [
1940
- (l(!0), b(q, null, U(a.checkboxes, (p, d) => (l(), b("li", { key: d }, [
1941
- y("label", Br, [
1942
- Oe(y("input", {
1943
- "onUpdate:modelValue": (w) => o(e)[d] = w,
2114
+ d.checkboxes ? (u(), b("ul", sn, [
2115
+ (u(!0), b(D, null, F(d.checkboxes, (m, C) => (u(), b("li", { key: C }, [
2116
+ y("label", rn, [
2117
+ Ke(y("input", {
2118
+ "onUpdate:modelValue": (L) => o(r)[C] = L,
1944
2119
  type: "checkbox",
1945
- required: p.required,
2120
+ required: m.required,
1946
2121
  class: "border-primary-600 text-primary-600 hover:bg-primary-50 hover:checked:bg-primary-500 focus:ring-primary-600 focus-visible:ring-primary-600 rounded border-2"
1947
- }, null, 8, Dr), [
1948
- [Mt, o(e)[d]]
2122
+ }, null, 8, nn), [
2123
+ [It, o(r)[C]]
1949
2124
  ]),
1950
- y("span", zr, S(p.label), 1)
2125
+ y("span", an, x(m.label), 1)
1951
2126
  ])
1952
2127
  ]))), 128))
1953
- ])) : E("", !0),
1954
- y("div", jr, [
1955
- h(B, {
1956
- variant: a.acceptVariant,
2128
+ ])) : T("", !0),
2129
+ y("div", ln, [
2130
+ p(q, {
2131
+ variant: d.acceptVariant,
1957
2132
  submit: ""
1958
2133
  }, {
1959
- default: m(() => [
1960
- V(S(o(r)), 1)
2134
+ default: f(() => [
2135
+ I(x(o(i)), 1)
1961
2136
  ]),
1962
2137
  _: 1
1963
2138
  }, 8, ["variant"]),
1964
- a.required ? E("", !0) : (l(), f(B, {
2139
+ d.required ? T("", !0) : (u(), h(q, {
1965
2140
  key: 0,
1966
- variant: a.cancelVariant,
1967
- onClick: (p) => c(!1)
2141
+ variant: d.cancelVariant,
2142
+ onClick: (m) => $(!1)
1968
2143
  }, {
1969
- default: m(() => [
1970
- V(S(o(n)), 1)
2144
+ default: f(() => [
2145
+ I(x(o(l)), 1)
1971
2146
  ]),
1972
2147
  _: 2
1973
2148
  }, 1032, ["variant", "onClick"]))
@@ -1977,94 +2152,94 @@ const Ar = {
1977
2152
  }, 1032, ["form", "onSubmit"])
1978
2153
  ]),
1979
2154
  _: 1
1980
- }, 8, ["title"]));
2155
+ }, 8, ["title", "title-hidden"]));
1981
2156
  }
1982
- }), Fr = {
2157
+ }), un = {
1983
2158
  viewBox: "0 0 20 20",
1984
2159
  width: "1.2em",
1985
2160
  height: "1.2em"
1986
2161
  };
1987
- function Ur(t, s) {
1988
- return l(), b("svg", Fr, s[0] || (s[0] = [
2162
+ function cn(t, s) {
2163
+ return u(), b("svg", un, s[0] || (s[0] = [
1989
2164
  y("path", {
1990
2165
  fill: "currentColor",
1991
2166
  d: "M7.05 9.293L6.343 10L12 15.657l1.414-1.414L9.172 10l4.242-4.243L12 4.343z"
1992
2167
  }, null, -1)
1993
2168
  ]));
1994
2169
  }
1995
- const Or = { name: "zondicons-cheveron-left", render: Ur }, Nr = {
2170
+ const dn = E({ name: "zondicons-cheveron-left", render: cn }), pn = {
1996
2171
  viewBox: "0 0 20 20",
1997
2172
  width: "1.2em",
1998
2173
  height: "1.2em"
1999
2174
  };
2000
- function Wr(t, s) {
2001
- return l(), b("svg", Nr, s[0] || (s[0] = [
2175
+ function mn(t, s) {
2176
+ return u(), b("svg", pn, s[0] || (s[0] = [
2002
2177
  y("path", {
2003
2178
  fill: "currentColor",
2004
2179
  d: "m12.95 10.707l.707-.707L8 4.343L6.586 5.757L10.828 10l-4.242 4.243L8 15.657z"
2005
2180
  }, null, -1)
2006
2181
  ]));
2007
2182
  }
2008
- const ft = { name: "zondicons-cheveron-right", render: Wr }, Kr = {
2183
+ const $t = E({ name: "zondicons-cheveron-right", render: mn }), fn = {
2009
2184
  viewBox: "0 0 20 20",
2010
2185
  width: "1.2em",
2011
2186
  height: "1.2em"
2012
2187
  };
2013
- function Qr(t, s) {
2014
- return l(), b("svg", Kr, s[0] || (s[0] = [
2188
+ function hn(t, s) {
2189
+ return u(), b("svg", fn, s[0] || (s[0] = [
2015
2190
  y("path", {
2016
2191
  fill: "currentColor",
2017
2192
  d: "M2.93 17.07A10 10 0 1 1 17.07 2.93A10 10 0 0 1 2.93 17.07M9 5v6h2V5zm0 8v2h2v-2z"
2018
2193
  }, null, -1)
2019
2194
  ]));
2020
2195
  }
2021
- const ht = { name: "zondicons-exclamation-solid", render: Qr }, Jr = {
2196
+ const qe = E({ name: "zondicons-exclamation-solid", render: hn }), gn = {
2022
2197
  viewBox: "0 0 24 24",
2023
2198
  width: "1.2em",
2024
2199
  height: "1.2em"
2025
2200
  };
2026
- function Zr(t, s) {
2027
- return l(), b("svg", Jr, s[0] || (s[0] = [
2201
+ function vn(t, s) {
2202
+ return u(), b("svg", gn, s[0] || (s[0] = [
2028
2203
  y("path", {
2029
2204
  fill: "currentColor",
2030
2205
  d: "M20 19V7H4v12zm0-16a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2zm-7 14v-2h5v2zm-3.42-4L5.57 9H8.4l3.3 3.3c.39.39.39 1.03 0 1.42L8.42 17H5.59z"
2031
2206
  }, null, -1)
2032
2207
  ]));
2033
2208
  }
2034
- const Gr = { name: "mdi-console", render: Zr }, Xr = {
2209
+ const bn = E({ name: "mdi-console", render: vn }), yn = {
2035
2210
  viewBox: "0 0 20 20",
2036
2211
  width: "1.2em",
2037
2212
  height: "1.2em"
2038
2213
  };
2039
- function Yr(t, s) {
2040
- return l(), b("svg", Xr, s[0] || (s[0] = [
2214
+ function wn(t, s) {
2215
+ return u(), b("svg", yn, s[0] || (s[0] = [
2041
2216
  y("path", {
2042
2217
  fill: "currentColor",
2043
2218
  d: "M6 6V2c0-1.1.9-2 2-2h10a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2h-4v4a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V8c0-1.1.9-2 2-2zm2 0h4a2 2 0 0 1 2 2v4h4V2H8zM2 8v10h10V8z"
2044
2219
  }, null, -1)
2045
2220
  ]));
2046
2221
  }
2047
- const en = { name: "zondicons-copy", render: Yr }, tn = {
2222
+ const $n = E({ name: "zondicons-copy", render: wn }), _n = {
2048
2223
  viewBox: "0 0 24 24",
2049
2224
  width: "1.2em",
2050
2225
  height: "1.2em"
2051
2226
  };
2052
- function sn(t, s) {
2053
- return l(), b("svg", tn, s[0] || (s[0] = [
2227
+ function xn(t, s) {
2228
+ return u(), b("svg", _n, s[0] || (s[0] = [
2054
2229
  y("path", {
2055
2230
  fill: "currentColor",
2056
2231
  d: "M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33s1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03 1.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2"
2057
2232
  }, null, -1)
2058
2233
  ]));
2059
2234
  }
2060
- const rn = { name: "mdi-github", render: sn }, nn = { class: "flex" }, an = { class: "sr-only" }, on = /* @__PURE__ */ g({
2235
+ const Cn = E({ name: "mdi-github", render: xn }), kn = { class: "flex" }, Sn = { class: "sr-only" }, Tn = /* @__PURE__ */ g({
2061
2236
  __name: "ErrorReportModalButtons",
2062
2237
  props: {
2063
2238
  report: {}
2064
2239
  },
2065
2240
  setup(t) {
2066
- const s = t, e = u(() => s.report.description ? `${s.report.title}: ${s.report.description}` : s.report.title), r = u(() => {
2067
- if (!z.sourceUrl)
2241
+ const s = t, e = c(() => s.report.description ? `${s.report.title}: ${s.report.description}` : s.report.title), r = c(() => {
2242
+ if (!A.sourceUrl)
2068
2243
  return !1;
2069
2244
  const a = encodeURIComponent(e.value), i = encodeURIComponent(
2070
2245
  [
@@ -2072,35 +2247,35 @@ const rn = { name: "mdi-github", render: sn }, nn = { class: "flex" }, an = { cl
2072
2247
  "",
2073
2248
  "Error details:",
2074
2249
  "```",
2075
- Ft(
2250
+ Qt(
2076
2251
  s.report.details ?? "Details missing from report",
2077
- 1800 - a.length - z.sourceUrl.length
2252
+ 1800 - a.length - A.sourceUrl.length
2078
2253
  ).trim(),
2079
2254
  "```"
2080
2255
  ].join(`
2081
2256
  `)
2082
2257
  );
2083
- return `${z.sourceUrl}/issues/new?title=${a}&body=${i}`;
2084
- }), n = u(() => Z(
2258
+ return `${A.sourceUrl}/issues/new?title=${a}&body=${i}`;
2259
+ }), n = c(() => ee(
2085
2260
  [
2086
2261
  {
2087
2262
  id: "clipboard",
2088
2263
  description: "Copy to clipboard",
2089
- iconComponent: en,
2264
+ iconComponent: $n,
2090
2265
  async click() {
2091
2266
  await navigator.clipboard.writeText(`${e.value}
2092
2267
 
2093
- ${s.report.details}`), I.toast(x("errors.copiedToClipboard", "Debug information copied to clipboard"));
2268
+ ${s.report.details}`), z.toast(S("errors.copiedToClipboard", "Debug information copied to clipboard"));
2094
2269
  }
2095
2270
  },
2096
2271
  {
2097
2272
  id: "console",
2098
2273
  description: "Log to console",
2099
- iconComponent: Gr,
2274
+ iconComponent: bn,
2100
2275
  click() {
2101
2276
  const a = s.report.error ?? s.report;
2102
- window.error = a, console.error(a), I.toast(
2103
- x(
2277
+ window.error = a, console.error(a), z.toast(
2278
+ S(
2104
2279
  "errors.addedToConsole",
2105
2280
  "You can now use the **error** variable in the console"
2106
2281
  )
@@ -2112,24 +2287,24 @@ ${s.report.details}`), I.toast(x("errors.copiedToClipboard", "Debug information
2112
2287
  r.value && a.push({
2113
2288
  id: "github",
2114
2289
  description: "Report in GitHub",
2115
- iconComponent: rn,
2290
+ iconComponent: Cn,
2116
2291
  url: r.value
2117
2292
  });
2118
2293
  }
2119
2294
  ));
2120
- return (a, i) => (l(), b("div", nn, [
2121
- (l(!0), b(q, null, U(n.value, (c) => _(a.$slots, "default", P({ ref_for: !0 }, c), () => [
2122
- h(B, {
2295
+ return (a, i) => (u(), b("div", kn, [
2296
+ (u(!0), b(D, null, F(n.value, (l) => w(a.$slots, "default", H({ ref_for: !0 }, l), () => [
2297
+ p(q, {
2123
2298
  size: "icon",
2124
2299
  variant: "ghost",
2125
2300
  class: "group whitespace-nowrap",
2126
- href: c.url,
2127
- title: a.$td(`errors.report_${c.id}`, c.description),
2128
- onClick: c.click
2301
+ href: l.url,
2302
+ title: a.$td(`errors.report_${l.id}`, l.description),
2303
+ onClick: l.click
2129
2304
  }, {
2130
- default: m(() => [
2131
- y("span", an, S(a.$td(`errors.report_${c.id}`, c.description)), 1),
2132
- (l(), f(W(c.iconComponent), {
2305
+ default: f(() => [
2306
+ y("span", Sn, x(a.$td(`errors.report_${l.id}`, l.description)), 1),
2307
+ (u(), h(W(l.iconComponent), {
2133
2308
  class: "size-4",
2134
2309
  "aria-hidden": "true"
2135
2310
  }))
@@ -2139,7 +2314,7 @@ ${s.report.details}`), I.toast(x("errors.copiedToClipboard", "Debug information
2139
2314
  ])), 256))
2140
2315
  ]));
2141
2316
  }
2142
- }), ln = /* @__PURE__ */ g({
2317
+ }), Mn = /* @__PURE__ */ g({
2143
2318
  __name: "ErrorReportModalTitle",
2144
2319
  props: {
2145
2320
  report: {},
@@ -2147,107 +2322,114 @@ ${s.report.details}`), I.toast(x("errors.copiedToClipboard", "Debug information
2147
2322
  totalReports: {}
2148
2323
  },
2149
2324
  setup(t) {
2150
- const s = u(() => !t.totalReports || t.totalReports <= 1 ? t.report.title : `${t.report.title} (${t.currentReport}/${t.totalReports})`);
2151
- return (e, r) => (l(), f(A, {
2325
+ const s = c(() => !t.totalReports || t.totalReports <= 1 ? t.report.title : `${t.report.title} (${t.currentReport}/${t.totalReports})`);
2326
+ return (e, r) => (u(), h(P, {
2152
2327
  text: s.value,
2153
2328
  inline: ""
2154
2329
  }, null, 8, ["text"]));
2155
2330
  }
2156
2331
  });
2157
- function cn(t) {
2158
- const s = D(0), e = u(() => t.reports[s.value]), r = u(
2332
+ function Hn(t) {
2333
+ const s = U(t.reports.includes(t.report) ? t.reports.indexOf(t.report) : 0), e = c(() => t.reports[s.value]), r = c(
2159
2334
  () => {
2160
2335
  var i;
2161
- return ((i = e.value.details) == null ? void 0 : i.trim()) || x("errors.detailsEmpty", "This error is missing a stacktrace.");
2336
+ return ((i = e.value.details) == null ? void 0 : i.trim()) || S("errors.detailsEmpty", "This error is missing a stacktrace.");
2162
2337
  }
2163
- ), n = x("errors.previousReport", "Show previous report"), a = x("errors.nextReport", "Show next report");
2338
+ ), n = S("errors.previousReport", "Show previous report"), a = S("errors.nextReport", "Show next report");
2164
2339
  return {
2165
2340
  activeReportIndex: s,
2166
2341
  details: r,
2167
2342
  nextReportText: a,
2168
2343
  previousReportText: n,
2169
- report: e
2344
+ activeReport: e
2170
2345
  };
2171
2346
  }
2172
- const un = { class: "px-4 pt-5 pb-4" }, dn = { class: "flex justify-between gap-4" }, pn = { class: "flex items-center gap-2" }, mn = {
2347
+ const En = { class: "px-4 pt-5 pb-4" }, Vn = { class: "flex justify-between gap-4" }, Ln = { class: "flex items-center gap-2" }, In = {
2173
2348
  key: 0,
2174
2349
  class: "flex gap-0.5"
2175
- }, fn = { class: "-mt-2 max-h-[80vh] overflow-auto bg-red-800/10" }, hn = ["textContent"], gn = /* @__PURE__ */ g({
2350
+ }, qn = { class: "-mt-2 max-h-[75vh] overflow-auto bg-red-800/10" }, zn = ["textContent"], Rn = /* @__PURE__ */ g({
2176
2351
  __name: "ErrorReportModal",
2177
2352
  props: {
2353
+ report: {},
2178
2354
  reports: {}
2179
2355
  },
2180
- setup(t) {
2181
- const s = t, { activeReportIndex: e, details: r, nextReportText: n, previousReportText: a, report: i } = cn(s);
2182
- return (c, p) => (l(), f(ne, { "wrapper-class": "p-0 sm:w-auto sm:min-w-lg sm:max-w-[80vw]" }, {
2183
- default: m(() => [
2184
- y("div", un, [
2185
- y("h2", dn, [
2186
- y("div", pn, [
2187
- h(o(ht), { class: "size-5 text-red-600" }),
2188
- h(ln, {
2356
+ setup(t, { expose: s }) {
2357
+ const e = t, { activeReportIndex: r, details: n, nextReportText: a, previousReportText: i, activeReport: l } = Hn(e);
2358
+ return s(), (d, v) => (u(), h(se, {
2359
+ title: d.$td("errors.report", "Error report"),
2360
+ "title-hidden": "",
2361
+ "close-hidden": "",
2362
+ class: "p-0",
2363
+ "wrapper-class": "sm:w-auto sm:min-w-lg sm:max-w-[80vw]"
2364
+ }, {
2365
+ default: f(() => [
2366
+ y("div", En, [
2367
+ y("h2", Vn, [
2368
+ y("div", Ln, [
2369
+ p(o(qe), { class: "size-5 text-red-600" }),
2370
+ p(Mn, {
2189
2371
  class: "text-lg leading-6 font-semibold text-gray-900",
2190
- report: o(i),
2191
- "current-report": o(e) + 1,
2192
- "total-reports": c.reports.length
2372
+ report: o(l),
2373
+ "current-report": o(r) + 1,
2374
+ "total-reports": d.reports.length
2193
2375
  }, null, 8, ["report", "current-report", "total-reports"]),
2194
- c.reports.length > 1 ? (l(), b("span", mn, [
2195
- h(B, {
2376
+ d.reports.length > 1 ? (u(), b("span", In, [
2377
+ p(q, {
2196
2378
  size: "icon",
2197
2379
  variant: "ghost",
2198
- disabled: o(e) === 0,
2199
- "aria-label": o(a),
2200
- title: o(a),
2201
- onClick: p[0] || (p[0] = (d) => e.value--)
2380
+ disabled: o(r) === 0,
2381
+ "aria-label": o(i),
2382
+ title: o(i),
2383
+ onClick: v[0] || (v[0] = ($) => r.value--)
2202
2384
  }, {
2203
- default: m(() => [
2204
- h(o(Or), { class: "size-4" })
2385
+ default: f(() => [
2386
+ p(o(dn), { class: "size-4" })
2205
2387
  ]),
2206
2388
  _: 1
2207
2389
  }, 8, ["disabled", "aria-label", "title"]),
2208
- h(B, {
2390
+ p(q, {
2209
2391
  size: "icon",
2210
2392
  variant: "ghost",
2211
- disabled: o(e) === c.reports.length - 1,
2212
- "aria-label": o(n),
2213
- title: o(n),
2214
- onClick: p[1] || (p[1] = (d) => e.value++)
2393
+ disabled: o(r) === d.reports.length - 1,
2394
+ "aria-label": o(a),
2395
+ title: o(a),
2396
+ onClick: v[1] || (v[1] = ($) => r.value++)
2215
2397
  }, {
2216
- default: m(() => [
2217
- h(o(ft), { class: "size-4" })
2398
+ default: f(() => [
2399
+ p(o($t), { class: "size-4" })
2218
2400
  ]),
2219
2401
  _: 1
2220
2402
  }, 8, ["disabled", "aria-label", "title"])
2221
- ])) : E("", !0)
2403
+ ])) : T("", !0)
2222
2404
  ]),
2223
- h(on, {
2224
- report: o(i),
2405
+ p(Tn, {
2406
+ report: o(l),
2225
2407
  class: "gap-0.5"
2226
2408
  }, null, 8, ["report"])
2227
2409
  ]),
2228
- o(i).description ? (l(), f(A, {
2410
+ o(l).description ? (u(), h(P, {
2229
2411
  key: 0,
2230
- text: o(i).description,
2412
+ text: o(l).description,
2231
2413
  class: "text-gray-600"
2232
- }, null, 8, ["text"])) : E("", !0)
2414
+ }, null, 8, ["text"])) : T("", !0)
2233
2415
  ]),
2234
- y("div", fn, [
2416
+ y("div", qn, [
2235
2417
  y("pre", {
2236
2418
  class: "p-4 text-xs text-red-800",
2237
- textContent: S(o(r))
2238
- }, null, 8, hn)
2419
+ textContent: x(o(n))
2420
+ }, null, 8, zn)
2239
2421
  ])
2240
2422
  ]),
2241
2423
  _: 1
2242
- }));
2424
+ }, 8, ["title"]));
2243
2425
  }
2244
- }), vn = {
2426
+ }), Pn = {
2245
2427
  viewBox: "0 0 24 24",
2246
2428
  width: "1.2em",
2247
2429
  height: "1.2em"
2248
2430
  };
2249
- function bn(t, s) {
2250
- return l(), b("svg", vn, s[0] || (s[0] = [
2431
+ function An(t, s) {
2432
+ return u(), b("svg", Pn, s[0] || (s[0] = [
2251
2433
  y("path", {
2252
2434
  fill: "currentColor",
2253
2435
  d: "M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z",
@@ -2267,7 +2449,7 @@ function bn(t, s) {
2267
2449
  ], -1)
2268
2450
  ]));
2269
2451
  }
2270
- const yn = { name: "svg-spinners-90-ring-with-bg", render: bn }, _n = { class: "mt-1 h-2 w-full overflow-hidden rounded-full bg-gray-200" }, wn = { class: "sr-only" }, $n = /* @__PURE__ */ g({
2452
+ const Dn = E({ name: "svg-spinners-90-ring-with-bg", render: An }), jn = { class: "mt-1 h-2 w-full overflow-hidden rounded-full bg-gray-200" }, Bn = { class: "sr-only" }, Fn = /* @__PURE__ */ g({
2271
2453
  __name: "ProgressBar",
2272
2454
  props: {
2273
2455
  filledClass: {},
@@ -2276,31 +2458,31 @@ const yn = { name: "svg-spinners-90-ring-with-bg", render: bn }, _n = { class: "
2276
2458
  },
2277
2459
  setup(t) {
2278
2460
  let s;
2279
- const e = D(0), r = u(() => H("size-full transition-transform duration-500 rounded-r-full ease-linear bg-primary-600", t.filledClass)), n = u(() => typeof t.progress == "number" ? t.progress : e.value);
2280
- return He(
2461
+ const e = U(0), r = c(() => M("size-full transition-transform duration-500 rounded-r-full ease-linear bg-primary-600", t.filledClass)), n = c(() => typeof t.progress == "number" ? t.progress : e.value);
2462
+ return Me(
2281
2463
  () => t.job,
2282
2464
  () => {
2283
2465
  s && s(), e.value = t.job ? t.job.progress : 0, s = t.job && t.job.listeners.add({ onUpdated: (a) => e.value = a });
2284
2466
  },
2285
2467
  { immediate: !0 }
2286
- ), fe(() => s && s()), (a, i) => (l(), b("div", _n, [
2468
+ ), ge(() => s && s()), (a, i) => (u(), b("div", jn, [
2287
2469
  y("div", {
2288
2470
  class: k(r.value),
2289
- style: Et(`transform:translateX(-${(1 - n.value) * 100}%)`)
2471
+ style: qt(`transform:translateX(-${(1 - n.value) * 100}%)`)
2290
2472
  }, null, 6),
2291
- y("span", wn, S(a.$td("ui.progress", "{progress}% complete", {
2473
+ y("span", Bn, x(a.$td("ui.progress", "{progress}% complete", {
2292
2474
  progress: n.value * 100
2293
2475
  })), 1)
2294
2476
  ]));
2295
2477
  }
2296
2478
  });
2297
- function Cn(t) {
2298
- const s = u(() => t.title ?? x("ui.loading", "Loading")), e = u(
2299
- () => t.message ?? x("ui.loadingInProgress", "Loading in progress...")
2300
- ), r = u(() => typeof t.progress == "number" || !!t.job), n = u(() => !t.title);
2479
+ function Un(t) {
2480
+ const s = c(() => t.title ?? S("ui.loading", "Loading")), e = c(
2481
+ () => t.message ?? S("ui.loadingInProgress", "Loading in progress...")
2482
+ ), r = c(() => typeof t.progress == "number" || !!t.job), n = c(() => !t.title);
2301
2483
  return { renderedTitle: s, renderedMessage: e, titleHidden: n, showProgress: r };
2302
2484
  }
2303
- const xn = /* @__PURE__ */ g({
2485
+ const On = /* @__PURE__ */ g({
2304
2486
  __name: "LoadingModal",
2305
2487
  props: {
2306
2488
  title: {},
@@ -2308,31 +2490,31 @@ const xn = /* @__PURE__ */ g({
2308
2490
  progress: {},
2309
2491
  job: {}
2310
2492
  },
2311
- setup(t) {
2312
- const s = t, { renderedTitle: e, renderedMessage: r, titleHidden: n, showProgress: a } = Cn(s);
2313
- return (i, c) => (l(), f(ne, {
2493
+ setup(t, { expose: s }) {
2494
+ const e = t, { renderedTitle: r, renderedMessage: n, titleHidden: a, showProgress: i } = Un(e);
2495
+ return s(), (l, d) => (u(), h(se, {
2314
2496
  persistent: "",
2315
- class: k(["flex", { "flex-col-reverse": o(a), "items-center justify-center gap-2": !o(a) }]),
2497
+ class: k(["flex", { "flex-col-reverse": o(i), "items-center justify-center gap-2": !o(i) }]),
2316
2498
  "wrapper-class": "w-auto",
2317
- title: o(e),
2318
- "title-hidden": o(n)
2499
+ title: o(r),
2500
+ "title-hidden": o(a)
2319
2501
  }, {
2320
- default: m(() => [
2321
- o(a) ? (l(), f($n, {
2502
+ default: f(() => [
2503
+ o(i) ? (u(), h(Fn, {
2322
2504
  key: 0,
2323
- progress: i.progress,
2324
- job: i.job,
2505
+ progress: l.progress,
2506
+ job: l.job,
2325
2507
  class: "min-w-[min(400px,80vw)]"
2326
- }, null, 8, ["progress", "job"])) : (l(), f(o(yn), {
2508
+ }, null, 8, ["progress", "job"])) : (u(), h(o(Dn), {
2327
2509
  key: 1,
2328
2510
  class: "text-primary-600 mr-1 size-6"
2329
2511
  })),
2330
- h(A, { text: o(r) }, null, 8, ["text"])
2512
+ p(P, { text: o(n) }, null, 8, ["text"])
2331
2513
  ]),
2332
2514
  _: 1
2333
2515
  }, 8, ["title", "title-hidden", "class"]));
2334
2516
  }
2335
- }), gt = /* @__PURE__ */ g({
2517
+ }), ze = /* @__PURE__ */ g({
2336
2518
  __name: "HeadlessInput",
2337
2519
  props: {
2338
2520
  name: {},
@@ -2343,59 +2525,64 @@ const xn = /* @__PURE__ */ g({
2343
2525
  },
2344
2526
  emits: ["update:modelValue"],
2345
2527
  setup(t, { expose: s, emit: e }) {
2346
- const r = e, n = ie("form", null), a = u(() => !n || !t.name ? null : n.errors[t.name] ?? null), i = {
2347
- id: `input-${le()}`,
2348
- name: u(() => t.name),
2349
- label: u(() => t.label),
2350
- description: u(() => t.description),
2351
- value: u(() => n && t.name ? n.getFieldValue(t.name) : t.modelValue),
2352
- errors: Le(a),
2353
- required: u(() => {
2528
+ const r = e, n = X("form", null), a = c(() => !n || !t.name ? null : n.errors[t.name] ?? null), i = {
2529
+ id: `input-${re()}`,
2530
+ name: c(() => t.name),
2531
+ label: c(() => t.label),
2532
+ description: c(() => t.description),
2533
+ value: c(() => n && t.name ? n.getFieldValue(t.name) : t.modelValue),
2534
+ errors: ve(a),
2535
+ required: c(() => {
2354
2536
  if (!(!t.name || !n))
2355
2537
  return n.getFieldRules(t.name).includes("required");
2356
2538
  }),
2357
- update(c) {
2539
+ update(l) {
2358
2540
  if (n && t.name) {
2359
- n.setFieldValue(t.name, c);
2541
+ n.setFieldValue(t.name, l);
2360
2542
  return;
2361
2543
  }
2362
- r("update:modelValue", c);
2544
+ r("update:modelValue", l);
2363
2545
  }
2364
2546
  };
2365
- return se("input", i), s(i), (c, p) => (l(), f(W(c.as), null, {
2366
- default: m(() => [
2367
- _(c.$slots, "default")
2547
+ return le("input", i), s(i), (l, d) => (u(), h(W(l.as), null, {
2548
+ default: f(() => [
2549
+ w(l.$slots, "default")
2368
2550
  ]),
2369
2551
  _: 3
2370
2552
  }));
2371
2553
  }
2372
- }), Sn = ["for"], ke = /* @__PURE__ */ g({
2554
+ }), Nn = ["for"], fe = /* @__PURE__ */ g({
2373
2555
  __name: "HeadlessInputLabel",
2374
2556
  setup(t) {
2375
- const s = R("input", "<HeadlessInputLabel> must be a child of a <HeadlessInput>"), e = Ee(), r = u(() => !!(s.label || e.default));
2376
- return (n, a) => r.value ? (l(), b("label", {
2557
+ const s = V("input", "<HeadlessInputLabel> must be a child of a <HeadlessInput>"), e = He(), r = c(() => !!(s.label || e.default));
2558
+ return (n, a) => r.value ? (u(), b("label", {
2377
2559
  key: 0,
2378
2560
  for: o(s).id
2379
2561
  }, [
2380
- _(n.$slots, "default", {}, () => [
2381
- V(S(o(s).label), 1)
2562
+ w(n.$slots, "default", {}, () => [
2563
+ I(x(o(s).label), 1)
2382
2564
  ])
2383
- ], 8, Sn)) : E("", !0);
2565
+ ], 8, Nn)) : T("", !0);
2384
2566
  }
2385
- }), kn = ["id", "name", "type", "checked", "required", "aria-invalid", "aria-describedby"], vt = /* @__PURE__ */ g({
2567
+ }), Wn = ["id", "name", "checked", "type", "required", "aria-invalid", "aria-describedby"], _t = /* @__PURE__ */ g({
2386
2568
  __name: "HeadlessInputInput",
2387
2569
  props: {
2388
- type: { default: "text" }
2570
+ type: {}
2389
2571
  },
2390
2572
  setup(t) {
2391
- const s = re("$inputRef"), e = R("input", "<HeadlessInputInput> must be a child of a <HeadlessInput>"), r = u(() => e.name ?? void 0), n = u(() => e.value), a = u(() => {
2573
+ const s = G("$inputRef"), e = V("input", "<HeadlessInputInput> must be a child of a <HeadlessInput>"), r = X("form", null), n = c(() => e.name ?? void 0), a = c(() => e.value), i = c(() => {
2574
+ if (t.type)
2575
+ return t.type;
2576
+ const $ = (n.value && (r == null ? void 0 : r.getFieldType(n.value))) ?? "";
2577
+ return ["text", "email", "number", "tel", "url"].includes($) ? $ : "text";
2578
+ }), l = c(() => {
2392
2579
  if (t.type === "checkbox")
2393
- return !!n.value;
2580
+ return !!a.value;
2394
2581
  });
2395
- function i() {
2396
- s.value && e.update(c());
2582
+ function d() {
2583
+ s.value && e.update(v());
2397
2584
  }
2398
- function c() {
2585
+ function v() {
2399
2586
  if (!s.value)
2400
2587
  return null;
2401
2588
  switch (t.type) {
@@ -2407,59 +2594,59 @@ const xn = /* @__PURE__ */ g({
2407
2594
  return s.value.value;
2408
2595
  }
2409
2596
  }
2410
- return st(e, () => {
2411
- var p;
2412
- return (p = s.value) == null ? void 0 : p.focus();
2413
- }), ce(() => {
2597
+ return it(e, () => {
2598
+ var $;
2599
+ return ($ = s.value) == null ? void 0 : $.focus();
2600
+ }), Y(() => {
2414
2601
  if (s.value) {
2415
- if (t.type === "date") {
2416
- s.value.valueAsDate = n.value;
2602
+ if (t.type === "date" && a.value instanceof Date) {
2603
+ s.value.valueAsDate = a.value;
2417
2604
  return;
2418
2605
  }
2419
- s.value.value = n.value ?? null;
2606
+ s.value.value = a.value ?? null;
2420
2607
  }
2421
- }), (p, d) => (l(), b("input", {
2608
+ }), ($, m) => (u(), b("input", {
2422
2609
  id: o(e).id,
2423
2610
  ref: "$inputRef",
2424
- name: r.value,
2425
- type: p.type,
2426
- checked: a.value,
2611
+ name: n.value,
2612
+ checked: l.value,
2613
+ type: i.value,
2427
2614
  required: o(e).required ?? void 0,
2428
2615
  "aria-invalid": o(e).errors ? "true" : "false",
2429
2616
  "aria-describedby": o(e).errors ? `${o(e).id}-error` : o(e).description ? `${o(e).id}-description` : void 0,
2430
- onInput: i
2431
- }, null, 40, kn));
2617
+ onInput: d
2618
+ }, null, 40, Wn));
2432
2619
  }
2433
- }), Mn = /* @__PURE__ */ g({
2620
+ }), xt = /* @__PURE__ */ g({
2434
2621
  inheritAttrs: !1,
2435
2622
  __name: "HeadlessInputDescription",
2436
2623
  setup(t) {
2437
- const s = R(
2624
+ const s = V(
2438
2625
  "input",
2439
2626
  "<HeadlessInputDescription> must be a child of a <HeadlessInput>"
2440
- ), e = u(() => typeof s.description == "string" ? s.description : ""), r = u(() => !!s.description);
2441
- return (n, a) => _(n.$slots, "default", {
2627
+ ), e = c(() => typeof s.description == "string" ? s.description : ""), r = c(() => !!s.description);
2628
+ return (n, a) => w(n.$slots, "default", {
2442
2629
  id: `${o(s).id}-description`
2443
2630
  }, () => [
2444
- r.value ? (l(), f(A, P({ key: 0 }, n.$attrs, {
2631
+ r.value ? (u(), h(P, H({ key: 0 }, n.$attrs, {
2445
2632
  id: `${o(s).id}-description`,
2446
2633
  text: e.value
2447
- }), null, 16, ["id", "text"])) : E("", !0)
2634
+ }), null, 16, ["id", "text"])) : T("", !0)
2448
2635
  ]);
2449
2636
  }
2450
- }), En = ["id"], Me = /* @__PURE__ */ g({
2637
+ }), Kn = ["id"], he = /* @__PURE__ */ g({
2451
2638
  __name: "HeadlessInputError",
2452
2639
  setup(t) {
2453
- const s = R("input", "<HeadlessInputError> must be a child of a <HeadlessInput>"), e = u(() => s.errors ? x(`errors.${s.errors[0]}`, `Error: ${s.errors[0]}`) : null);
2454
- return (r, n) => e.value ? (l(), b("p", {
2640
+ const s = V("input", "<HeadlessInputError> must be a child of a <HeadlessInput>"), e = c(() => s.errors ? S(`errors.${s.errors[0]}`, `Error: ${s.errors[0]}`) : null);
2641
+ return (r, n) => e.value ? (u(), b("p", {
2455
2642
  key: 0,
2456
2643
  id: `${o(s).id}-error`
2457
- }, S(e.value), 9, En)) : E("", !0);
2644
+ }, x(e.value), 9, Kn)) : T("", !0);
2458
2645
  }
2459
- }), Hn = {
2646
+ }), Qn = {
2460
2647
  key: 0,
2461
2648
  class: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3"
2462
- }, Ln = /* @__PURE__ */ g({
2649
+ }, Jn = /* @__PURE__ */ g({
2463
2650
  inheritAttrs: !1,
2464
2651
  __name: "Input",
2465
2652
  props: {
@@ -2472,53 +2659,139 @@ const xn = /* @__PURE__ */ g({
2472
2659
  },
2473
2660
  emits: ["update:modelValue"],
2474
2661
  setup(t) {
2475
- const s = Y(t, ["label", "inputClass", "wrapperClass"]), e = re("$inputRef"), [r, n] = rt(), a = u(() => H("relative rounded-md shadow-2xs", { "mt-1": t.label }, t.wrapperClass)), i = u(() => {
2476
- var c, p, d;
2477
- return H(
2662
+ const s = N(t, ["label", "inputClass", "wrapperClass"]), e = G("$inputRef"), [r, n] = Ie(), a = c(() => M("relative rounded-md shadow-2xs", { "mt-1": t.label }, t.wrapperClass)), i = c(() => {
2663
+ var l, d, v;
2664
+ return M(
2478
2665
  // eslint-disable-next-line vue/max-len
2479
2666
  "block w-full rounded-md border-0 py-1.5 ring-1 ring-inset focus:ring-2 focus:ring-inset sm:text-sm sm:leading-6",
2480
2667
  {
2481
- "focus:ring-primary-600": !((c = e.value) != null && c.errors),
2482
- "text-gray-900 shadow-2xs ring-gray-300 placeholder:text-gray-400": !((p = e.value) != null && p.errors),
2483
- "pr-10 text-red-900 ring-red-300 placeholder:text-red-300 focus:ring-red-500": (d = e.value) == null ? void 0 : d.errors
2668
+ "focus:ring-primary-600": !((l = e.value) != null && l.errors),
2669
+ "text-gray-900 shadow-2xs ring-gray-900/10 placeholder:text-gray-400": !((d = e.value) != null && d.errors),
2670
+ "pr-10 text-red-900 ring-red-900/10 placeholder:text-red-300 focus:ring-red-500": (v = e.value) == null ? void 0 : v.errors
2484
2671
  },
2485
2672
  t.inputClass
2486
2673
  );
2487
2674
  });
2488
- return (c, p) => (l(), f(gt, P({
2675
+ return (l, d) => (u(), h(ze, H({
2489
2676
  ref: "$inputRef",
2490
- label: c.label,
2677
+ label: l.label,
2491
2678
  class: o(n)
2492
2679
  }, s, {
2493
- "onUpdate:modelValue": p[0] || (p[0] = (d) => c.$emit("update:modelValue", d))
2680
+ "onUpdate:modelValue": d[0] || (d[0] = (v) => l.$emit("update:modelValue", v))
2494
2681
  }), {
2495
- default: m(() => {
2496
- var d;
2682
+ default: f(() => {
2683
+ var v;
2497
2684
  return [
2498
- h(ke, { class: "block text-sm leading-6 font-medium text-gray-900" }),
2685
+ p(fe, { class: "block text-sm leading-6 font-medium text-gray-900" }),
2499
2686
  y("div", {
2500
2687
  class: k(a.value)
2501
2688
  }, [
2502
- h(vt, P(o(r), { class: i.value }), null, 16, ["class"]),
2503
- (d = o(e)) != null && d.errors ? (l(), b("div", Hn, [
2504
- h(o(ht), { class: "size-5 text-red-500" })
2505
- ])) : E("", !0)
2689
+ p(_t, H(o(r), { class: i.value }), null, 16, ["class"]),
2690
+ (v = e.value) != null && v.errors ? (u(), b("div", Qn, [
2691
+ p(o(qe), { class: "size-5 text-red-500" })
2692
+ ])) : T("", !0)
2506
2693
  ], 2),
2507
- h(Mn, { class: "mt-2 text-sm text-gray-600" }),
2508
- h(Me, { class: "mt-2 text-sm text-red-600" })
2694
+ p(xt, { class: "mt-2 text-sm text-gray-600" }),
2695
+ p(he, { class: "mt-2 text-sm text-red-600" })
2509
2696
  ];
2510
2697
  }),
2511
2698
  _: 1
2512
2699
  }, 16, ["label", "class"]));
2513
2700
  }
2514
2701
  });
2515
- function Rn(t) {
2516
- const s = mt({
2517
- draft: Ir(t.defaultValue ?? "")
2518
- }), e = u(() => t.title ?? t.message), r = u(() => t.title ? t.message : null), n = u(() => t.acceptText ?? x("ui.accept", "Ok")), a = u(() => t.cancelText ?? x("ui.cancel", "Cancel"));
2702
+ function wl(t, s = {}) {
2703
+ return {
2704
+ default: t,
2705
+ type: "boolean",
2706
+ rules: s.rules
2707
+ };
2708
+ }
2709
+ function $l(t, s = {}) {
2710
+ return {
2711
+ default: t,
2712
+ type: "date",
2713
+ rules: s.rules
2714
+ };
2715
+ }
2716
+ function _l(t, s, e = {}) {
2717
+ return {
2718
+ default: s,
2719
+ type: "enum",
2720
+ rules: e.rules,
2721
+ values: t
2722
+ };
2723
+ }
2724
+ function xl(t) {
2725
+ return {
2726
+ default: t,
2727
+ type: "boolean",
2728
+ rules: "required"
2729
+ };
2730
+ }
2731
+ function Cl(t) {
2732
+ return {
2733
+ default: t,
2734
+ type: "date",
2735
+ rules: "required"
2736
+ };
2737
+ }
2738
+ function kl(t, s) {
2739
+ return {
2740
+ default: s,
2741
+ type: "enum",
2742
+ rules: "required",
2743
+ values: t
2744
+ };
2745
+ }
2746
+ function Sl(t) {
2747
+ return {
2748
+ default: t,
2749
+ type: "number",
2750
+ rules: "required"
2751
+ };
2752
+ }
2753
+ function Tl(t) {
2754
+ return {
2755
+ default: t,
2756
+ type: "object",
2757
+ rules: "required"
2758
+ };
2759
+ }
2760
+ function Zn(t) {
2761
+ return {
2762
+ default: t,
2763
+ type: "string",
2764
+ rules: "required"
2765
+ };
2766
+ }
2767
+ function Ml(t, s = {}) {
2768
+ return {
2769
+ default: t,
2770
+ type: "number",
2771
+ rules: s.rules
2772
+ };
2773
+ }
2774
+ function Hl(t, s = {}) {
2775
+ return {
2776
+ default: t,
2777
+ type: "object",
2778
+ rules: s.rules
2779
+ };
2780
+ }
2781
+ function El(t, s = {}) {
2782
+ return {
2783
+ default: t,
2784
+ type: "string",
2785
+ rules: s.rules
2786
+ };
2787
+ }
2788
+ function Xn(t) {
2789
+ const s = ut({
2790
+ draft: Zn(t.defaultValue ?? "")
2791
+ }), e = c(() => t.title ?? t.message), r = c(() => t.title ? t.message : null), n = c(() => t.acceptText ?? S("ui.accept", "Ok")), a = c(() => t.cancelText ?? S("ui.cancel", "Cancel"));
2519
2792
  return { form: s, renderedTitle: e, renderedMessage: r, renderedAcceptText: n, renderedCancelText: a };
2520
2793
  }
2521
- const Tn = { class: "mt-4 flex flex-row-reverse gap-2" }, Pn = /* @__PURE__ */ g({
2794
+ const Yn = { class: "mt-4 flex flex-row-reverse gap-2" }, Gn = /* @__PURE__ */ g({
2522
2795
  __name: "PromptModal",
2523
2796
  props: {
2524
2797
  title: {},
@@ -2531,44 +2804,44 @@ const Tn = { class: "mt-4 flex flex-row-reverse gap-2" }, Pn = /* @__PURE__ */ g
2531
2804
  cancelText: {},
2532
2805
  cancelVariant: { default: "secondary" }
2533
2806
  },
2534
- setup(t) {
2535
- const s = Y(t, ["cancelVariant"]), { form: e, renderedTitle: r, renderedMessage: n, renderedAcceptText: a, renderedCancelText: i } = Rn(s);
2536
- return (c, p) => (l(), f(ne, {
2537
- title: o(r),
2807
+ setup(t, { expose: s }) {
2808
+ const e = N(t, ["cancelVariant"]), { form: r, renderedTitle: n, renderedMessage: a, renderedAcceptText: i, renderedCancelText: l } = Xn(e);
2809
+ return s(), (d, v) => (u(), h(se, {
2810
+ title: o(n),
2538
2811
  persistent: ""
2539
2812
  }, {
2540
- default: m(({ close: d }) => [
2541
- h(pt, {
2542
- form: o(e),
2543
- onSubmit: (w) => d(o(e).draft)
2813
+ default: f(({ close: $ }) => [
2814
+ p(wt, {
2815
+ form: o(r),
2816
+ onSubmit: (m) => $(o(r).draft)
2544
2817
  }, {
2545
- default: m(() => [
2546
- o(n) ? (l(), f(A, {
2818
+ default: f(() => [
2819
+ o(a) ? (u(), h(P, {
2547
2820
  key: 0,
2548
- text: o(n)
2549
- }, null, 8, ["text"])) : E("", !0),
2550
- h(Ln, {
2821
+ text: o(a)
2822
+ }, null, 8, ["text"])) : T("", !0),
2823
+ p(Jn, {
2551
2824
  name: "draft",
2552
2825
  class: "mt-2",
2553
- placeholder: c.placeholder,
2554
- label: c.label
2826
+ placeholder: d.placeholder,
2827
+ label: d.label
2555
2828
  }, null, 8, ["placeholder", "label"]),
2556
- y("div", Tn, [
2557
- h(B, {
2558
- variant: c.acceptVariant,
2829
+ y("div", Yn, [
2830
+ p(q, {
2831
+ variant: d.acceptVariant,
2559
2832
  submit: ""
2560
2833
  }, {
2561
- default: m(() => [
2562
- V(S(o(a)), 1)
2834
+ default: f(() => [
2835
+ I(x(o(i)), 1)
2563
2836
  ]),
2564
2837
  _: 1
2565
2838
  }, 8, ["variant"]),
2566
- h(B, {
2567
- variant: c.cancelVariant,
2568
- onClick: (w) => d(!1)
2839
+ p(q, {
2840
+ variant: d.cancelVariant,
2841
+ onClick: (m) => $()
2569
2842
  }, {
2570
- default: m(() => [
2571
- V(S(o(i)), 1)
2843
+ default: f(() => [
2844
+ I(x(o(l)), 1)
2572
2845
  ]),
2573
2846
  _: 2
2574
2847
  }, 1032, ["variant", "onClick"])
@@ -2580,61 +2853,152 @@ const Tn = { class: "mt-4 flex flex-row-reverse gap-2" }, Pn = /* @__PURE__ */ g
2580
2853
  _: 1
2581
2854
  }, 8, ["title"]));
2582
2855
  }
2583
- }), In = { class: "grid grow place-items-center" }, Vn = { class: "flex flex-col items-center space-y-6 p-8" }, An = { class: "mt-2 text-center text-4xl font-medium text-red-600" }, Bn = { class: "mt-4 flex flex-col space-y-4" }, Dn = /* @__PURE__ */ g({
2856
+ }), ea = {
2857
+ viewBox: "0 0 24 24",
2858
+ width: "1.2em",
2859
+ height: "1.2em"
2860
+ };
2861
+ function ta(t, s) {
2862
+ return u(), b("svg", ea, s[0] || (s[0] = [
2863
+ y("path", {
2864
+ fill: "currentColor",
2865
+ d: "M12 21q-1.625 0-3.012-.8T6.8 18H4v-2h2.1q-.075-.5-.088-1T6 14H4v-2h2q0-.5.012-1t.088-1H4V8h2.8q.35-.575.788-1.075T8.6 6.05L7 4.4L8.4 3l2.15 2.15q.7-.225 1.425-.225t1.425.225L15.6 3L17 4.4l-1.65 1.65q.575.375 1.038.862T17.2 8H20v2h-2.1q.075.5.088 1T18 12h2v2h-2q0 .5-.013 1t-.087 1H20v2h-2.8q-.8 1.4-2.187 2.2T12 21m-2-5h4v-2h-4zm0-4h4v-2h-4z"
2866
+ }, null, -1)
2867
+ ]));
2868
+ }
2869
+ const sa = E({ name: "material-symbols-bug-report", render: ta }), ra = {
2870
+ viewBox: "0 0 24 24",
2871
+ width: "1.2em",
2872
+ height: "1.2em"
2873
+ };
2874
+ function na(t, s) {
2875
+ return u(), b("svg", ra, s[0] || (s[0] = [
2876
+ y("path", {
2877
+ fill: "currentColor",
2878
+ d: "M7 21q-.825 0-1.412-.587T5 19V6q-.425 0-.712-.288T4 5t.288-.712T5 4h4q0-.425.288-.712T10 3h4q.425 0 .713.288T15 4h4q.425 0 .713.288T20 5t-.288.713T19 6v13q0 .825-.587 1.413T17 21zm5-7.1l1.9 1.9q.275.275.7.275t.7-.275t.275-.7t-.275-.7l-1.9-1.9l1.9-1.9q.275-.275.275-.7t-.275-.7t-.7-.275t-.7.275L12 11.1l-1.9-1.9q-.275-.275-.7-.275t-.7.275t-.275.7t.275.7l1.9 1.9l-1.9 1.9q-.275.275-.275.7t.275.7t.7.275t.7-.275z"
2879
+ }, null, -1)
2880
+ ]));
2881
+ }
2882
+ const aa = E({ name: "material-symbols-delete-forever-rounded", render: na }), la = {
2883
+ viewBox: "0 0 24 24",
2884
+ width: "1.2em",
2885
+ height: "1.2em"
2886
+ };
2887
+ function oa(t, s) {
2888
+ return u(), b("svg", la, s[0] || (s[0] = [
2889
+ y("path", {
2890
+ fill: "currentColor",
2891
+ d: "M11.25 13.5q.95 0 1.6-.65t.65-1.6t-.65-1.6t-1.6-.65t-1.6.65t-.65 1.6t.65 1.6t1.6.65m4.825 4l-2.625-2.625q-.5.325-1.062.475t-1.138.15q-1.775 0-3.012-1.237T7 11.25t1.238-3.012T11.25 7t3.013 1.238T15.5 11.25q0 .575-.162 1.138t-.488 1.062l2.65 2.65zM5 21q-.825 0-1.412-.587T3 19v-4h2v4h4v2zm10 0v-2h4v-4h2v4q0 .825-.587 1.413T19 21zM3 9V5q0-.825.588-1.412T5 3h4v2H5v4zm16 0V5h-4V3h4q.825 0 1.413.588T21 5v4z"
2892
+ }, null, -1)
2893
+ ]));
2894
+ }
2895
+ const ia = E({ name: "material-symbols-frame-inspect", render: oa }), ua = {
2896
+ viewBox: "0 0 24 24",
2897
+ width: "1.2em",
2898
+ height: "1.2em"
2899
+ };
2900
+ function ca(t, s) {
2901
+ return u(), b("svg", ua, s[0] || (s[0] = [
2902
+ y("path", {
2903
+ fill: "currentColor",
2904
+ d: "M12 20q-3.35 0-5.675-2.325T4 12t2.325-5.675T12 4q1.725 0 3.3.712T18 6.75V5q0-.425.288-.712T19 4t.713.288T20 5v5q0 .425-.288.713T19 11h-5q-.425 0-.712-.288T13 10t.288-.712T14 9h3.2q-.8-1.4-2.187-2.2T12 6Q9.5 6 7.75 7.75T6 12t1.75 4.25T12 18q1.7 0 3.113-.862t2.187-2.313q.2-.35.563-.487t.737-.013q.4.125.575.525t-.025.75q-1.025 2-2.925 3.2T12 20"
2905
+ }, null, -1)
2906
+ ]));
2907
+ }
2908
+ const da = E({ name: "material-symbols-refresh-rounded", render: ca }), pa = { class: "grid grow place-items-center" }, ma = { class: "flex flex-col items-center p-8" }, fa = { class: "mt-0 mb-0 text-center text-4xl font-medium text-red-600" }, ha = { class: "mt-4 grid grid-cols-1 gap-2 sm:grid-cols-2 [&_button]:justify-start sm:[&_button]:size-32 sm:[&_button]:flex-col sm:[&_button]:justify-center [&_svg]:size-6 sm:[&_svg]:size-8" }, ga = /* @__PURE__ */ g({
2584
2909
  __name: "StartupCrash",
2585
2910
  setup(t) {
2586
- return (s, e) => (l(), b("div", In, [
2587
- y("div", Vn, [
2588
- y("h1", An, S(s.$td("startupCrash.title", "Something went wrong!")), 1),
2589
- h(A, {
2590
- text: s.$td(
2591
- "startupCrash.message",
2592
- `Something failed trying to start the application.
2911
+ async function s() {
2912
+ await z.confirm(
2913
+ S("startupCrash.purgeConfirmTitle", "Delete everything?"),
2914
+ S(
2915
+ "startupCrash.purgeConfirmMessage",
2916
+ `If the problem persists, one drastic solution may be to wipe the storage in this device to start from scratch. However, keep in mind that **all the data that you haven't synchronized will be deleted forever**.
2593
2917
 
2594
- Here's some things you can do:`
2595
- ),
2596
- class: "mt-4 text-center"
2597
- }, null, 8, ["text"]),
2598
- y("div", Bn, [
2599
- h(B, {
2600
- variant: "danger",
2601
- onClick: e[0] || (e[0] = (r) => s.$app.reload())
2602
- }, {
2603
- default: m(() => [
2604
- V(S(s.$td("startupCrash.reload", "Try again")), 1)
2605
- ]),
2606
- _: 1
2607
- }),
2608
- h(B, {
2609
- variant: "danger",
2610
- onClick: e[1] || (e[1] = (r) => s.$errors.inspect(s.$errors.startupErrors))
2611
- }, {
2612
- default: m(() => [
2613
- V(S(s.$td("startupCrash.inspect", "View error details")), 1)
2614
- ]),
2615
- _: 1
2616
- })
2918
+ Do you still want to proceed?`
2919
+ ),
2920
+ {
2921
+ acceptVariant: "danger",
2922
+ acceptText: S("startupCrash.purgeConfirmAccept", "Purge device")
2923
+ }
2924
+ ) && (await et.purge(), await A.reload());
2925
+ }
2926
+ return (e, r) => {
2927
+ const n = zt("i-majesticons-exclamation");
2928
+ return u(), b("div", pa, [
2929
+ y("div", ma, [
2930
+ p(n, { class: "size-20 text-red-600" }),
2931
+ y("h1", fa, x(e.$td("startupCrash.title", "Oops, something went wrong!")), 1),
2932
+ p(P, {
2933
+ text: e.$td(
2934
+ "startupCrash.message",
2935
+ "There was a problem starting the application, but here's some things you can do:"
2936
+ ),
2937
+ class: "mt-4 text-center"
2938
+ }, null, 8, ["text"]),
2939
+ y("div", ha, [
2940
+ p(q, {
2941
+ variant: "danger",
2942
+ onClick: r[0] || (r[0] = (a) => e.$app.reload())
2943
+ }, {
2944
+ default: f(() => [
2945
+ p(o(da)),
2946
+ I(" " + x(e.$td("startupCrash.reload", "Try again")), 1)
2947
+ ]),
2948
+ _: 1
2949
+ }),
2950
+ p(q, {
2951
+ variant: "danger",
2952
+ onClick: r[1] || (r[1] = (a) => e.$errors.inspect(e.$errors.startupErrors))
2953
+ }, {
2954
+ default: f(() => [
2955
+ p(o(sa)),
2956
+ I(" " + x(e.$td("startupCrash.inspect", "View error details")), 1)
2957
+ ]),
2958
+ _: 1
2959
+ }),
2960
+ p(q, {
2961
+ variant: "danger",
2962
+ onClick: r[2] || (r[2] = (a) => s())
2963
+ }, {
2964
+ default: f(() => [
2965
+ p(o(aa)),
2966
+ I(" " + x(e.$td("startupCrash.purge", "Purge device")), 1)
2967
+ ]),
2968
+ _: 1
2969
+ }),
2970
+ p(q, {
2971
+ variant: "danger",
2972
+ onClick: r[3] || (r[3] = (a) => e.$errors.debug = !e.$errors.debug)
2973
+ }, {
2974
+ default: f(() => [
2975
+ p(o(ia)),
2976
+ I(" " + x(e.$td("startupCrash.debug", "Toggle debugging")), 1)
2977
+ ]),
2978
+ _: 1
2979
+ })
2980
+ ])
2617
2981
  ])
2618
- ])
2619
- ]));
2982
+ ]);
2983
+ };
2620
2984
  }
2621
- }), bt = /* @__PURE__ */ g({
2985
+ }), Ct = /* @__PURE__ */ g({
2622
2986
  __name: "HeadlessToastAction",
2623
2987
  props: {
2624
2988
  action: {}
2625
2989
  },
2626
2990
  setup(t) {
2627
- return (s, e) => (l(), f(W(s.action.dismiss ? o(fs) : "button"), {
2991
+ return (s, e) => (u(), h(W(s.action.dismiss ? o(ks) : "button"), {
2628
2992
  type: "button",
2629
2993
  onClick: s.action.click
2630
2994
  }, {
2631
- default: m(() => [
2632
- V(S(s.action.label), 1)
2995
+ default: f(() => [
2996
+ I(x(s.action.label), 1)
2633
2997
  ]),
2634
2998
  _: 1
2635
2999
  }, 8, ["onClick"]));
2636
3000
  }
2637
- }), zn = { key: 0 }, jn = /* @__PURE__ */ g({
3001
+ }), va = { key: 0 }, ba = /* @__PURE__ */ g({
2638
3002
  __name: "HeadlessToast",
2639
3003
  props: {
2640
3004
  message: {},
@@ -2642,11 +3006,11 @@ Here's some things you can do:`
2642
3006
  variant: {}
2643
3007
  },
2644
3008
  setup(t) {
2645
- return (s, e) => (l(), f(o(hs), null, {
2646
- default: m(() => [
2647
- _(s.$slots, "default", {}, () => [
2648
- s.message ? (l(), b("span", zn, S(s.message), 1)) : E("", !0),
2649
- (l(!0), b(q, null, U(s.actions, (r, n) => (l(), f(bt, {
3009
+ return (s, e) => (u(), h(o(Ss), null, {
3010
+ default: f(() => [
3011
+ w(s.$slots, "default", {}, () => [
3012
+ s.message ? (u(), b("span", va, x(s.message), 1)) : T("", !0),
3013
+ (u(!0), b(D, null, F(s.actions, (r, n) => (u(), h(Ct, {
2650
3014
  key: n,
2651
3015
  action: r
2652
3016
  }, null, 8, ["action"]))), 128))
@@ -2655,7 +3019,7 @@ Here's some things you can do:`
2655
3019
  _: 3
2656
3020
  }));
2657
3021
  }
2658
- }), qn = /* @__PURE__ */ g({
3022
+ }), ya = /* @__PURE__ */ g({
2659
3023
  __name: "Toast",
2660
3024
  props: {
2661
3025
  message: {},
@@ -2663,8 +3027,8 @@ Here's some things you can do:`
2663
3027
  variant: { default: "secondary" },
2664
3028
  class: {}
2665
3029
  },
2666
- setup(t) {
2667
- const s = tt(
3030
+ setup(t, { expose: s }) {
3031
+ const e = c(() => lt(
2668
3032
  { baseClasses: t.class, variant: t.variant },
2669
3033
  {
2670
3034
  baseClasses: "flex items-center gap-2 rounded-md p-2 ring-1 shadow-lg border-gray-200",
@@ -2678,116 +3042,111 @@ Here's some things you can do:`
2678
3042
  variant: "secondary"
2679
3043
  }
2680
3044
  }
2681
- );
2682
- return (e, r) => (l(), f(jn, {
2683
- class: k(o(s))
3045
+ ));
3046
+ return s(), (r, n) => (u(), h(ba, {
3047
+ class: k(e.value)
2684
3048
  }, {
2685
- default: m(() => [
2686
- e.message ? (l(), f(A, {
3049
+ default: f(() => [
3050
+ r.message ? (u(), h(P, {
2687
3051
  key: 0,
2688
- text: e.message,
3052
+ text: r.message,
2689
3053
  inline: ""
2690
- }, null, 8, ["text"])) : E("", !0),
2691
- (l(!0), b(q, null, U(e.actions, (n, a) => (l(), f(B, {
2692
- key: a,
2693
- action: n,
2694
- variant: e.variant,
2695
- as: bt
3054
+ }, null, 8, ["text"])) : T("", !0),
3055
+ (u(!0), b(D, null, F(r.actions, (a, i) => (u(), h(q, {
3056
+ key: i,
3057
+ action: a,
3058
+ variant: r.variant,
3059
+ as: Ct
2696
3060
  }, null, 8, ["action", "variant"]))), 128))
2697
3061
  ]),
2698
3062
  _: 1
2699
3063
  }, 8, ["class"]));
2700
3064
  }
2701
- }), Fn = { $ui: I }, Un = {
3065
+ }), wa = { $ui: z }, $a = {
2702
3066
  async install(t, s) {
2703
3067
  const e = {
2704
- [L.AlertModal]: Lr,
2705
- [L.ConfirmModal]: qr,
2706
- [L.ErrorReportModal]: gn,
2707
- [L.LoadingModal]: xn,
2708
- [L.PromptModal]: Pn,
2709
- [L.Toast]: qn,
2710
- [L.StartupCrash]: Dn
2711
- };
2712
- Object.entries({
2713
- ...e,
3068
+ "alert-modal": en,
3069
+ "confirm-modal": on,
3070
+ "error-report-modal": Rn,
3071
+ "loading-modal": On,
3072
+ "prompt-modal": Gn,
3073
+ "startup-crash": ga,
3074
+ toast: ya,
2714
3075
  ...s.components
2715
- }).forEach(([r, n]) => I.registerComponent(r, n)), await be(t, Fn);
3076
+ };
3077
+ for (const [r, n] of Object.entries(e))
3078
+ z.registerComponent(r, n);
3079
+ await $e(t, wa);
2716
3080
  }
2717
3081
  };
2718
- async function On(t, s = {}) {
3082
+ async function _a(t, s = {}) {
2719
3083
  var r;
2720
- const e = [yr, Ds, tr, br, Us, Un, ...s.plugins ?? []];
2721
- z.instance = t, await Ts(e, t, s), await ((r = s.install) == null ? void 0 : r.call(s, t)), await M.emit("application-ready");
3084
+ const e = [Br, Ks, jr, Sr, Xs, $a, ...s.plugins ?? []];
3085
+ A.instance = t, await Bs(e, t, s), await ((r = s.install) == null ? void 0 : r.call(s, t)), await R.emit("application-ready");
2722
3086
  }
2723
- async function Aa(t, s = {}) {
3087
+ async function Vl(t, s = {}) {
2724
3088
  var r;
2725
- const e = Ht(t);
2726
- X() && (window.$aerogel = e), await On(e, s), e.mount("#app"), (r = e._container) == null || r.classList.remove("loading"), await M.emit("application-mounted");
3089
+ const e = Rt(t);
3090
+ J() && (window.$aerogel = e), await _a(e, s), e.mount("#app"), (r = e._container) == null || r.classList.remove("loading"), await R.emit("application-mounted");
2727
3091
  }
2728
- const Nn = { key: 0 }, Wn = /* @__PURE__ */ g({
3092
+ const xa = { key: 0 }, Ca = /* @__PURE__ */ g({
2729
3093
  __name: "AppModals",
2730
3094
  setup(t) {
2731
- const s = u(() => I.modals[0] ?? null);
2732
- return (e, r) => s.value ? (l(), b("aside", Nn, [
2733
- h(dt, {
3095
+ const s = c(() => z.modals[0] ?? null);
3096
+ return (e, r) => s.value ? (u(), b("aside", xa, [
3097
+ p(yt, {
2734
3098
  "child-index": 1,
2735
3099
  modal: s.value
2736
3100
  }, null, 8, ["modal"])
2737
- ])) : E("", !0);
3101
+ ])) : T("", !0);
2738
3102
  }
2739
- }), Kn = /* @__PURE__ */ g({
3103
+ }), ka = /* @__PURE__ */ g({
2740
3104
  __name: "AppToasts",
2741
3105
  setup(t) {
2742
- return (s, e) => (l(), f(o(gs), null, {
2743
- default: m(() => [
2744
- (l(!0), b(q, null, U(s.$ui.toasts, (r) => (l(), f(W(r.component), P({
3106
+ return (s, e) => (u(), h(o(Ts), null, {
3107
+ default: f(() => [
3108
+ (u(!0), b(D, null, F(s.$ui.toasts, (r) => (u(), h(W(r.component), H({
2745
3109
  id: r.id,
2746
3110
  key: r.id,
2747
3111
  ref_for: !0
2748
3112
  }, r.properties), null, 16, ["id"]))), 128)),
2749
- h(o(vs), { class: "fixed right-0 bottom-0 z-50 flex flex-col items-end space-y-4 px-4 py-6 sm:p-6" })
3113
+ p(o(Ms), { class: "fixed right-0 bottom-0 z-50 flex flex-col items-end space-y-4 px-4 py-6 sm:p-6" })
2750
3114
  ]),
2751
3115
  _: 1
2752
3116
  }));
2753
3117
  }
2754
- }), Qn = /* @__PURE__ */ g({
3118
+ }), Sa = /* @__PURE__ */ g({
2755
3119
  __name: "AppOverlays",
2756
3120
  setup(t) {
2757
- const s = D(null), e = D(!0);
2758
- return oe("show-overlays-backdrop", async () => {
2759
- !s.value || !e.value || (e.value = !1, s.value.classList.remove("opacity-0"));
2760
- }), oe("hide-overlays-backdrop", async () => {
2761
- !s.value || e.value || (e.value = !0, s.value.classList.add("opacity-0"));
2762
- }), (r, n) => (l(), b(q, null, [
2763
- h(Wn),
2764
- h(Kn)
3121
+ return (s, e) => (u(), b(D, null, [
3122
+ p(Ca),
3123
+ p(ka)
2765
3124
  ], 64));
2766
3125
  }
2767
- }), Jn = { class: "flex min-h-full flex-col text-base leading-tight font-normal text-gray-900 antialiased" }, Ba = /* @__PURE__ */ g({
3126
+ }), Ta = { class: "flex min-h-full flex-col text-base leading-tight font-normal text-gray-900 antialiased" }, Ll = /* @__PURE__ */ g({
2768
3127
  __name: "AppLayout",
2769
3128
  setup(t) {
2770
- return (s, e) => (l(), b("div", Jn, [
2771
- s.$errors.hasStartupErrors ? _(s.$slots, "startup-crash", { key: 0 }, () => [
2772
- (l(), f(W(s.$ui.requireComponent(o(L).StartupCrash))))
2773
- ]) : _(s.$slots, "default", { key: 1 }),
2774
- h(Qn)
3129
+ return (s, e) => (u(), b("div", Ta, [
3130
+ s.$errors.hasStartupErrors ? w(s.$slots, "startup-crash", { key: 0 }, () => [
3131
+ (u(), h(W(s.$ui.requireComponent("startup-crash"))))
3132
+ ]) : w(s.$slots, "default", { key: 1 }),
3133
+ p(Sa)
2775
3134
  ]));
2776
3135
  }
2777
- }), Zn = ["id", "name", "value", "required", "aria-invalid", "aria-describedby"], Da = /* @__PURE__ */ g({
3136
+ }), Ma = ["id", "name", "value", "required", "aria-invalid", "aria-describedby"], Ha = /* @__PURE__ */ g({
2778
3137
  __name: "HeadlessInputTextArea",
2779
3138
  setup(t) {
2780
- const s = re("$textAreaRef"), e = R(
3139
+ const s = G("$textAreaRef"), e = V(
2781
3140
  "input",
2782
3141
  "<HeadlessInputTextArea> must be a child of a <HeadlessInput>"
2783
- ), r = u(() => e.name ?? void 0), n = u(() => e.value);
3142
+ ), r = c(() => e.name ?? void 0), n = c(() => e.value);
2784
3143
  function a() {
2785
3144
  s.value && e.update(s.value.value);
2786
3145
  }
2787
- return st(e, () => {
3146
+ return it(e, () => {
2788
3147
  var i;
2789
3148
  return (i = s.value) == null ? void 0 : i.focus();
2790
- }), (i, c) => (l(), b("textarea", {
3149
+ }), (i, l) => (u(), b("textarea", {
2791
3150
  id: o(e).id,
2792
3151
  ref: "$textAreaRef",
2793
3152
  name: r.value,
@@ -2796,22 +3155,22 @@ const Nn = { key: 0 }, Wn = /* @__PURE__ */ g({
2796
3155
  "aria-invalid": o(e).errors ? "true" : "false",
2797
3156
  "aria-describedby": o(e).errors ? `${o(e).id}-error` : o(e).description ? `${o(e).id}-description` : void 0,
2798
3157
  onInput: a
2799
- }, null, 40, Zn));
3158
+ }, null, 40, Ma));
2800
3159
  }
2801
- }), Gn = { class: "group" }, Xn = { class: "-ml-2 flex w-[max-content] cursor-pointer items-center rounded-lg py-2 pr-3 pl-1 hover:bg-gray-100 focus-visible:outline focus-visible:outline-gray-700" }, Yn = { class: "pt-2 pl-4" }, za = /* @__PURE__ */ g({
3160
+ }), Ea = { class: "group" }, Va = { class: "-ml-2 flex w-[max-content] items-center rounded-lg py-2 pr-3 pl-1 hover:bg-gray-100 focus-visible:outline focus-visible:outline-gray-700" }, La = { class: "pt-2 pl-4" }, Il = /* @__PURE__ */ g({
2802
3161
  __name: "AdvancedOptions",
2803
3162
  setup(t) {
2804
- return (s, e) => (l(), b("details", Gn, [
2805
- y("summary", Xn, [
2806
- h(o(ft), { class: "size-6 transition-transform group-open:rotate-90" }),
2807
- y("span", null, S(s.$td("ui.advancedOptions", "Advanced options")), 1)
3163
+ return (s, e) => (u(), b("details", Ea, [
3164
+ y("summary", Va, [
3165
+ p(o($t), { class: "size-6 transition-transform group-open:rotate-90" }),
3166
+ y("span", null, x(s.$td("ui.advancedOptions", "Advanced options")), 1)
2808
3167
  ]),
2809
- y("div", Yn, [
2810
- _(s.$slots, "default")
3168
+ y("div", La, [
3169
+ w(s.$slots, "default")
2811
3170
  ])
2812
3171
  ]));
2813
3172
  }
2814
- }), ea = { class: "flex h-6 items-center" }, ja = /* @__PURE__ */ g({
3173
+ }), Ia = { class: "flex h-6 items-center" }, ql = /* @__PURE__ */ g({
2815
3174
  inheritAttrs: !1,
2816
3175
  __name: "Checkbox",
2817
3176
  props: {
@@ -2824,95 +3183,119 @@ const Nn = { key: 0 }, Wn = /* @__PURE__ */ g({
2824
3183
  },
2825
3184
  emits: ["update:modelValue"],
2826
3185
  setup(t) {
2827
- const s = Y(t, ["inputClass", "labelClass"]), e = re("$inputRef"), [r, n] = rt(), a = u(() => H("relative flex items-start", n.value)), i = u(() => {
2828
- var p, d;
2829
- return H(
3186
+ const s = N(t, ["inputClass", "labelClass"]), e = G("$inputRef"), [r, n] = Ie(), a = c(() => M("relative flex items-start", n.value)), i = c(() => {
3187
+ var d, v;
3188
+ return M(
2830
3189
  "size-4 rounded text-primary-600 not-checked:hover:bg-gray-200 checked:hover:text-primary-500 checked:border-0",
2831
3190
  {
2832
- "border-gray-300 focus:ring-primary-600": !((p = e.value) != null && p.errors),
2833
- "border-red-400 border-2 focus:ring-red-600": (d = e.value) == null ? void 0 : d.errors
3191
+ "border-gray-300 focus:ring-primary-600": !((d = e.value) != null && d.errors),
3192
+ "border-red-400 border-2 focus:ring-red-600": (v = e.value) == null ? void 0 : v.errors
2834
3193
  },
2835
3194
  t.inputClass
2836
3195
  );
2837
- }), c = u(() => H("ml-2 text-sm leading-6", t.labelClass));
2838
- return (p, d) => (l(), f(gt, P({
3196
+ }), l = c(() => M("ml-2 text-sm leading-6", t.labelClass));
3197
+ return (d, v) => (u(), h(ze, H({
2839
3198
  ref: "$inputRef",
2840
3199
  class: a.value
2841
3200
  }, s, {
2842
- "onUpdate:modelValue": d[0] || (d[0] = (w) => p.$emit("update:modelValue", w))
3201
+ "onUpdate:modelValue": v[0] || (v[0] = ($) => d.$emit("update:modelValue", $))
2843
3202
  }), {
2844
- default: m(() => [
2845
- y("div", ea, [
2846
- h(vt, P(o(r), {
3203
+ default: f(() => [
3204
+ y("div", Ia, [
3205
+ p(_t, H(o(r), {
2847
3206
  type: "checkbox",
2848
3207
  class: i.value
2849
3208
  }), null, 16, ["class"])
2850
3209
  ]),
2851
- p.$slots.default ? (l(), b("div", {
3210
+ d.$slots.default ? (u(), b("div", {
2852
3211
  key: 0,
2853
- class: k(c.value)
3212
+ class: k(l.value)
2854
3213
  }, [
2855
- h(ke, { class: "text-gray-900" }, {
2856
- default: m(() => [
2857
- _(p.$slots, "default")
3214
+ p(fe, { class: "text-gray-900" }, {
3215
+ default: f(() => [
3216
+ w(d.$slots, "default")
2858
3217
  ]),
2859
3218
  _: 3
2860
3219
  }),
2861
- h(Me, { class: "text-red-600" })
2862
- ], 2)) : p.label ? (l(), b("div", {
3220
+ p(he, { class: "text-red-600" })
3221
+ ], 2)) : d.label ? (u(), b("div", {
2863
3222
  key: 1,
2864
- class: k(c.value)
3223
+ class: k(l.value)
2865
3224
  }, [
2866
- h(ke, { class: "text-gray-900" }),
2867
- h(Me, { class: "text-red-600" })
2868
- ], 2)) : E("", !0)
3225
+ p(fe, { class: "text-gray-900" }),
3226
+ p(he, { class: "text-red-600" })
3227
+ ], 2)) : T("", !0)
2869
3228
  ]),
2870
3229
  _: 3
2871
3230
  }, 16, ["class"]));
2872
3231
  }
2873
- }), ta = /* @__PURE__ */ g({
3232
+ }), qa = /* @__PURE__ */ g({
2874
3233
  __name: "DropdownMenuOption",
3234
+ props: {
3235
+ class: {},
3236
+ asChild: { type: Boolean },
3237
+ as: {}
3238
+ },
2875
3239
  emits: ["select"],
2876
3240
  setup(t) {
2877
- return (s, e) => (l(), f(o(bs), {
2878
- class: "flex w-full items-center gap-2 rounded-lg px-2 py-2 text-sm text-gray-900 data-[highlighted]:bg-gray-100",
2879
- onSelect: e[0] || (e[0] = (r) => s.$emit("select"))
2880
- }, {
2881
- default: m(() => [
2882
- _(s.$slots, "default")
3241
+ const s = N(t, ["class"]), e = c(() => M(
3242
+ "flex w-full items-center gap-2 rounded-lg px-2 py-2 text-sm text-gray-900 data-[highlighted]:bg-gray-100",
3243
+ t.class
3244
+ ));
3245
+ return (r, n) => (u(), h(o(Hs), H({ class: e.value }, s, {
3246
+ onSelect: n[0] || (n[0] = (a) => r.$emit("select"))
3247
+ }), {
3248
+ default: f(() => [
3249
+ w(r.$slots, "default")
2883
3250
  ]),
2884
3251
  _: 3
2885
- }));
3252
+ }, 16, ["class"]));
2886
3253
  }
2887
- }), sa = /* @__PURE__ */ g({
3254
+ }), za = /* @__PURE__ */ g({
2888
3255
  __name: "DropdownMenuOptions",
2889
3256
  setup(t) {
2890
- const s = R(
3257
+ const s = V(
2891
3258
  "dropdown-menu",
2892
3259
  "<DropdownMenuOptions> must be a child of a <DropdownMenu>"
2893
3260
  );
2894
- return (e, r) => (l(), f(o(ys), {
3261
+ return (e, r) => (u(), h(o(Es), {
2895
3262
  class: "gap-y-0.5 rounded-lg bg-white p-1.5 shadow-lg ring-1 ring-black/5",
2896
3263
  align: o(s).align,
2897
3264
  side: o(s).side
2898
3265
  }, {
2899
- default: m(() => [
2900
- _(e.$slots, "default", {}, () => [
2901
- (l(!0), b(q, null, U(o(s).options, (n, a) => (l(), f(ta, {
2902
- key: a,
2903
- onSelect: n.click
2904
- }, {
2905
- default: m(() => [
2906
- V(S(n.label), 1)
3266
+ default: f(() => [
3267
+ w(e.$slots, "default", {}, () => [
3268
+ (u(!0), b(D, null, F(o(s).options, (n, a) => (u(), h(qa, H(
3269
+ {
3270
+ key: a,
3271
+ as: n.route || n.href ? at : void 0,
3272
+ class: n.class,
3273
+ ref_for: !0
3274
+ },
3275
+ n.route || n.href ? {
3276
+ href: n.href,
3277
+ route: n.route,
3278
+ routeParams: n.routeParams,
3279
+ routeQuery: n.routeQuery
3280
+ } : {},
3281
+ {
3282
+ onSelect: (i) => {
3283
+ var l;
3284
+ return (l = n.click) == null ? void 0 : l.call(n);
3285
+ }
3286
+ }
3287
+ ), {
3288
+ default: f(() => [
3289
+ I(x(n.label), 1)
2907
3290
  ]),
2908
3291
  _: 2
2909
- }, 1032, ["onSelect"]))), 128))
3292
+ }, 1040, ["as", "class", "onSelect"]))), 128))
2910
3293
  ])
2911
3294
  ]),
2912
3295
  _: 3
2913
3296
  }, 8, ["align", "side"]));
2914
3297
  }
2915
- }), qa = /* @__PURE__ */ g({
3298
+ }), zl = /* @__PURE__ */ g({
2916
3299
  __name: "DropdownMenu",
2917
3300
  props: {
2918
3301
  align: {},
@@ -2923,23 +3306,23 @@ const Nn = { key: 0 }, Wn = /* @__PURE__ */ g({
2923
3306
  const e = {
2924
3307
  align: t.align,
2925
3308
  side: t.side,
2926
- options: u(() => {
3309
+ options: c(() => {
2927
3310
  var r;
2928
3311
  return (r = t.options) == null ? void 0 : r.filter(Boolean);
2929
3312
  })
2930
3313
  };
2931
- return se("dropdown-menu", e), s(e), (r, n) => (l(), f(o(_s), null, {
2932
- default: m(() => [
2933
- h(o(ws), null, {
2934
- default: m(() => [
2935
- _(r.$slots, "default")
3314
+ return le("dropdown-menu", e), s(e), (r, n) => (u(), h(o(Vs), null, {
3315
+ default: f(() => [
3316
+ p(o(Ls), null, {
3317
+ default: f(() => [
3318
+ w(r.$slots, "default")
2936
3319
  ]),
2937
3320
  _: 3
2938
3321
  }),
2939
- h(o($s), null, {
2940
- default: m(() => [
2941
- _(r.$slots, "options", {}, () => [
2942
- h(sa)
3322
+ p(o(Is), null, {
3323
+ default: f(() => [
3324
+ w(r.$slots, "options", {}, () => [
3325
+ p(za)
2943
3326
  ])
2944
3327
  ]),
2945
3328
  _: 3
@@ -2948,7 +3331,7 @@ const Nn = { key: 0 }, Wn = /* @__PURE__ */ g({
2948
3331
  _: 3
2949
3332
  }));
2950
3333
  }
2951
- }), ra = ["aria-hidden"], na = ["tabindex", "aria-label", "type"], Fa = /* @__PURE__ */ g({
3334
+ }), Ra = ["aria-hidden"], Pa = ["tabindex", "aria-label", "type"], Rl = /* @__PURE__ */ g({
2952
3335
  __name: "EditableContent",
2953
3336
  props: {
2954
3337
  type: { default: "text" },
@@ -2961,69 +3344,160 @@ const Nn = { key: 0 }, Wn = /* @__PURE__ */ g({
2961
3344
  },
2962
3345
  emits: ["update", "save"],
2963
3346
  setup(t, { emit: s }) {
2964
- const e = s, r = re("$inputRef"), n = D(null), a = D(t.text), i = u(() => H("inline whitespace-pre", t.contentClass)), c = u(() => H("invisible whitespace-pre", t.contentClass)), p = u(() => H("absolute inset-0 h-full w-full resize-none border-0 bg-transparent p-0 focus:ring-0", t.contentClass));
2965
- function d() {
3347
+ const e = s, r = G("$inputRef"), n = U(null), a = U(t.text), i = c(() => M("inline whitespace-pre", t.contentClass)), l = c(() => M("invisible whitespace-pre", t.contentClass)), d = c(() => M("absolute inset-0 h-full w-full resize-none border-0 bg-transparent p-0 focus:ring-0", t.contentClass));
3348
+ function v() {
2966
3349
  n.value = t.text;
2967
3350
  }
2968
- function w() {
3351
+ function $() {
2969
3352
  n.value && (t.type !== "number" && a.value.trim().length === 0 && (a.value = n.value, e("update", a.value)), n.value = null, e("save"));
2970
3353
  }
2971
- return ce(() => a.value = t.text), (v, C) => (l(), b("div", {
2972
- class: k(["relative", { "pointer-events-none!": v.disabled && !n.value }])
3354
+ return Y(() => a.value = t.text), (m, C) => (u(), b("div", {
3355
+ class: k(["relative", { "pointer-events-none!": m.disabled && !n.value }])
2973
3356
  }, [
2974
- n.value ? (l(), b("span", {
3357
+ n.value ? (u(), b("span", {
2975
3358
  key: 1,
2976
- class: k(c.value)
2977
- }, S(a.value), 3)) : (l(), b("div", {
3359
+ class: k(l.value)
3360
+ }, x(a.value), 3)) : (u(), b("div", {
2978
3361
  key: 0,
2979
3362
  class: k(i.value)
2980
3363
  }, [
2981
- _(v.$slots, "default")
3364
+ w(m.$slots, "default")
2982
3365
  ], 2)),
2983
- v.type === "number" ? (l(), b("span", {
3366
+ m.type === "number" ? (u(), b("span", {
2984
3367
  key: 2,
2985
3368
  class: k(["inline-block transition-[width]", n.value ? "w-5" : "w-0"])
2986
- }, null, 2)) : E("", !0),
3369
+ }, null, 2)) : T("", !0),
2987
3370
  y("form", {
2988
3371
  class: "w-full",
2989
- "aria-hidden": v.formAriaHidden,
2990
- onSubmit: C[4] || (C[4] = Ue((T) => {
2991
- var ue;
2992
- return (ue = o(r)) == null ? void 0 : ue.blur();
3372
+ "aria-hidden": m.formAriaHidden,
3373
+ onSubmit: C[4] || (C[4] = We((L) => {
3374
+ var _e;
3375
+ return (_e = r.value) == null ? void 0 : _e.blur();
2993
3376
  }, ["prevent"]))
2994
3377
  }, [
2995
- Oe(y("input", {
3378
+ Ke(y("input", {
2996
3379
  ref: "$inputRef",
2997
- "onUpdate:modelValue": C[0] || (C[0] = (T) => a.value = T),
2998
- tabindex: v.tabindex ?? void 0,
2999
- "aria-label": v.ariaLabel ?? void 0,
3000
- type: v.type,
3380
+ "onUpdate:modelValue": C[0] || (C[0] = (L) => a.value = L),
3381
+ tabindex: m.tabindex ?? void 0,
3382
+ "aria-label": m.ariaLabel ?? void 0,
3383
+ type: m.type,
3001
3384
  class: k([
3002
- p.value,
3003
- { "opacity-0": !n.value, "appearance-textfield": !n.value && v.type === "number" }
3385
+ d.value,
3386
+ { "opacity-0": !n.value, "appearance-textfield": !n.value && m.type === "number" }
3004
3387
  ]),
3005
- onKeyup: C[1] || (C[1] = (T) => v.$emit("update", a.value)),
3006
- onFocus: C[2] || (C[2] = (T) => d()),
3007
- onBlur: C[3] || (C[3] = (T) => w())
3008
- }, null, 42, na), [
3009
- [Lt, a.value]
3388
+ onKeyup: C[1] || (C[1] = (L) => m.$emit("update", a.value)),
3389
+ onFocus: C[2] || (C[2] = (L) => v()),
3390
+ onBlur: C[3] || (C[3] = (L) => $())
3391
+ }, null, 42, Pa), [
3392
+ [Pt, a.value]
3010
3393
  ])
3011
- ], 40, ra)
3394
+ ], 40, Ra)
3012
3395
  ], 2));
3013
3396
  }
3014
- }), Ua = /* @__PURE__ */ g({
3397
+ }), Aa = {
3398
+ viewBox: "0 0 512 512",
3399
+ width: "1.2em",
3400
+ height: "1.2em"
3401
+ };
3402
+ function Da(t, s) {
3403
+ return u(), b("svg", Aa, s[0] || (s[0] = [
3404
+ y("path", {
3405
+ fill: "currentColor",
3406
+ d: "M449.07 399.08L278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0 0 80 446.25h340.89a32 32 0 0 0 28.18-47.17m-198.6-1.83a20 20 0 1 1 20-20a20 20 0 0 1-20 20m21.72-201.15l-5.74 122a16 16 0 0 1-32 0l-5.74-121.95a21.73 21.73 0 0 1 21.5-22.69h.21a21.74 21.74 0 0 1 21.73 22.7Z"
3407
+ }, null, -1)
3408
+ ]));
3409
+ }
3410
+ const ja = E({ name: "ion-warning", render: Da }), Ba = {
3411
+ viewBox: "0 0 20 20",
3412
+ width: "1.2em",
3413
+ height: "1.2em"
3414
+ };
3415
+ function Fa(t, s) {
3416
+ return u(), b("svg", Ba, s[0] || (s[0] = [
3417
+ y("path", {
3418
+ fill: "currentColor",
3419
+ d: "M.2 10a11 11 0 0 1 19.6 0A11 11 0 0 1 .2 10m9.8 4a4 4 0 1 0 0-8a4 4 0 0 0 0 8m0-2a2 2 0 1 1 0-4a2 2 0 0 1 0 4"
3420
+ }, null, -1)
3421
+ ]));
3422
+ }
3423
+ const Ua = E({ name: "zondicons-view-show", render: Fa }), Oa = { class: "font-medium" }, Na = ["datetime"], Wa = /* @__PURE__ */ g({
3424
+ __name: "ErrorLogsModal",
3425
+ setup(t) {
3426
+ return (s, e) => (u(), h(se, {
3427
+ title: s.$td("errors.report", "Errors ({count})", { count: s.$errors.logs.length })
3428
+ }, {
3429
+ default: f(() => [
3430
+ y("ol", null, [
3431
+ (u(!0), b(D, null, F(s.$errors.logs, (r, n) => (u(), b("li", {
3432
+ key: n,
3433
+ class: "mb-2 flex max-w-prose min-w-56 justify-between py-2 last:mb-0"
3434
+ }, [
3435
+ y("div", null, [
3436
+ y("h3", Oa, x(r.report.title), 1),
3437
+ y("time", {
3438
+ datetime: r.date.toISOString(),
3439
+ class: "text-xs text-gray-700"
3440
+ }, x(r.date.toLocaleTimeString()), 9, Na),
3441
+ p(P, {
3442
+ class: "text-sm text-gray-500",
3443
+ text: r.report.description ?? o(bt)(r.report)
3444
+ }, null, 8, ["text"])
3445
+ ]),
3446
+ p(q, {
3447
+ size: "icon",
3448
+ variant: "ghost",
3449
+ "aria-label": s.$td("errors.viewDetails", "View details"),
3450
+ title: s.$td("errors.viewDetails", "View details"),
3451
+ class: "self-center",
3452
+ onClick: (a) => s.$errors.inspect(
3453
+ r.report,
3454
+ s.$errors.logs.map(({ report: i }) => i)
3455
+ )
3456
+ }, {
3457
+ default: f(() => [
3458
+ p(o(Ua), {
3459
+ class: "size-4",
3460
+ "aria-hidden": "true"
3461
+ })
3462
+ ]),
3463
+ _: 2
3464
+ }, 1032, ["aria-label", "title", "onClick"])
3465
+ ]))), 128))
3466
+ ])
3467
+ ]),
3468
+ _: 1
3469
+ }, 8, ["title"]));
3470
+ }
3471
+ }), Pl = /* @__PURE__ */ g({
3472
+ __name: "ErrorLogs",
3473
+ setup(t) {
3474
+ return (s, e) => s.$errors.logs.length > 0 ? (u(), h(q, {
3475
+ key: 0,
3476
+ size: "icon",
3477
+ variant: "ghost",
3478
+ title: s.$td("errors.viewLogs", "View error logs"),
3479
+ "aria-label": s.$td("errors.viewLogs", "View error logs"),
3480
+ onClick: e[0] || (e[0] = (r) => s.$ui.modal(Wa))
3481
+ }, {
3482
+ default: f(() => [
3483
+ p(o(ja), { class: "size-6 text-red-500" })
3484
+ ]),
3485
+ _: 1
3486
+ }, 8, ["title", "aria-label"])) : T("", !0);
3487
+ }
3488
+ }), Al = /* @__PURE__ */ g({
3015
3489
  __name: "ErrorMessage",
3016
3490
  props: {
3017
3491
  error: {}
3018
3492
  },
3019
3493
  setup(t) {
3020
- const s = u(() => Gs(t.error));
3021
- return (e, r) => (l(), f(A, {
3494
+ const s = c(() => bt(t.error));
3495
+ return (e, r) => (u(), h(P, {
3022
3496
  text: s.value,
3023
3497
  inline: ""
3024
3498
  }, null, 8, ["text"]));
3025
3499
  }
3026
- }), Oa = /* @__PURE__ */ g({
3500
+ }), Dl = /* @__PURE__ */ g({
3027
3501
  __name: "Link",
3028
3502
  props: {
3029
3503
  class: {},
@@ -3038,45 +3512,100 @@ const Nn = { key: 0 }, Wn = /* @__PURE__ */ g({
3038
3512
  as: {}
3039
3513
  },
3040
3514
  setup(t) {
3041
- return (s, e) => (l(), f(B, P({ variant: "link" }, s.$props), {
3042
- default: m(() => [
3043
- _(s.$slots, "default")
3515
+ return (s, e) => (u(), h(q, H({ variant: "link" }, s.$props), {
3516
+ default: f(() => [
3517
+ w(s.$slots, "default")
3044
3518
  ]),
3045
3519
  _: 3
3046
3520
  }, 16));
3047
3521
  }
3048
- }), Na = /* @__PURE__ */ g({
3522
+ }), jl = /* @__PURE__ */ g({
3049
3523
  __name: "SettingsModal",
3050
3524
  setup(t) {
3051
- const s = u(() => Ut(z.settings, "priority", "desc"));
3052
- return (e, r) => (l(), f(ne, {
3525
+ const s = c(() => Jt(A.settings, "priority", "desc"));
3526
+ return (e, r) => (u(), h(se, {
3053
3527
  title: e.$td("settings.title", "Settings")
3054
3528
  }, {
3055
- default: m(() => [
3056
- (l(!0), b(q, null, U(s.value, (n, a) => (l(), f(W(n.component), { key: a }))), 128))
3529
+ default: f(() => [
3530
+ (u(!0), b(D, null, F(s.value, (n, a) => (u(), h(W(n.component), { key: a }))), 128))
3057
3531
  ]),
3058
3532
  _: 1
3059
3533
  }, 8, ["title"]));
3060
3534
  }
3535
+ }), Ka = {
3536
+ key: 0,
3537
+ class: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3"
3538
+ }, Bl = /* @__PURE__ */ g({
3539
+ inheritAttrs: !1,
3540
+ __name: "TextArea",
3541
+ props: {
3542
+ name: {},
3543
+ label: {},
3544
+ description: {},
3545
+ modelValue: {},
3546
+ inputClass: {},
3547
+ wrapperClass: {}
3548
+ },
3549
+ emits: ["update:modelValue"],
3550
+ setup(t) {
3551
+ const s = N(t, ["label", "inputClass", "wrapperClass"]), e = G("$inputRef"), [r, n] = Ie(), a = c(() => M("relative rounded-md shadow-2xs", { "mt-1": t.label }, t.wrapperClass)), i = c(() => {
3552
+ var l, d, v;
3553
+ return M(
3554
+ // eslint-disable-next-line vue/max-len
3555
+ "block w-full rounded-md border-0 py-1.5 ring-1 ring-inset focus:ring-2 focus:ring-inset sm:text-sm sm:leading-6",
3556
+ {
3557
+ "focus:ring-primary-600": !((l = e.value) != null && l.errors),
3558
+ "text-gray-900 shadow-2xs ring-gray-900/10 placeholder:text-gray-400": !((d = e.value) != null && d.errors),
3559
+ "pr-10 text-red-900 ring-red-900/10 placeholder:text-red-300 focus:ring-red-500": (v = e.value) == null ? void 0 : v.errors
3560
+ },
3561
+ t.inputClass
3562
+ );
3563
+ });
3564
+ return (l, d) => (u(), h(ze, H({
3565
+ ref: "$inputRef",
3566
+ label: l.label,
3567
+ class: o(n)
3568
+ }, s, {
3569
+ "onUpdate:modelValue": d[0] || (d[0] = (v) => l.$emit("update:modelValue", v))
3570
+ }), {
3571
+ default: f(() => {
3572
+ var v;
3573
+ return [
3574
+ p(fe, { class: "block text-sm leading-6 font-medium text-gray-900" }),
3575
+ y("div", {
3576
+ class: k(a.value)
3577
+ }, [
3578
+ p(Ha, H(o(r), { class: i.value }), null, 16, ["class"]),
3579
+ (v = e.value) != null && v.errors ? (u(), b("div", Ka, [
3580
+ p(o(qe), { class: "size-5 text-red-500" })
3581
+ ])) : T("", !0)
3582
+ ], 2),
3583
+ p(xt, { class: "mt-2 text-sm text-gray-600" }),
3584
+ p(he, { class: "mt-2 text-sm text-red-600" })
3585
+ ];
3586
+ }),
3587
+ _: 1
3588
+ }, 16, ["label", "class"]));
3589
+ }
3061
3590
  });
3062
- class Wa {
3591
+ class Fl {
3063
3592
  constructor() {
3064
- $(this, "status");
3065
- $(this, "_listeners");
3066
- $(this, "_progress");
3067
- $(this, "_cancelled");
3068
- $(this, "_started");
3069
- $(this, "_completed");
3070
- this.status = this.getInitialStatus(), this._listeners = new Ot(), this._started = new K(), this._completed = new K();
3593
+ _(this, "status");
3594
+ _(this, "_listeners");
3595
+ _(this, "_progress");
3596
+ _(this, "_cancelled");
3597
+ _(this, "_started");
3598
+ _(this, "_completed");
3599
+ this.status = this.getInitialStatus(), this._listeners = new Zt(), this._started = new K(), this._completed = new K();
3071
3600
  }
3072
3601
  async start() {
3073
3602
  this.beforeStart(), this._started.resolve();
3074
3603
  try {
3075
3604
  await this.updateProgress(), await this.run(), await this.updateProgress(), this._completed.resolve();
3076
3605
  } catch (s) {
3077
- if (s instanceof De)
3606
+ if (s instanceof Ue)
3078
3607
  return;
3079
- throw Z(Nt(s), (e) => {
3608
+ throw ee(Xt(s), (e) => {
3080
3609
  this._completed.reject(e);
3081
3610
  });
3082
3611
  }
@@ -3117,10 +3646,10 @@ class Wa {
3117
3646
  }
3118
3647
  assertNotCancelled() {
3119
3648
  if (this._cancelled)
3120
- throw this._cancelled.resolve(), new De();
3649
+ throw this._cancelled.resolve(), new Ue();
3121
3650
  }
3122
3651
  calculateCurrentProgress(s) {
3123
- return s ?? (s = this.status), s.completed ? 1 : s.children ? Wt(
3652
+ return s ?? (s = this.status), s.completed ? 1 : s.children ? Yt(
3124
3653
  s.children.reduce((e, r) => e + this.calculateCurrentProgress(r), 0) / s.children.length,
3125
3654
  2
3126
3655
  ) : 0;
@@ -3134,133 +3663,147 @@ class Wa {
3134
3663
  return { ...s };
3135
3664
  }
3136
3665
  }
3137
- async function Ka(t) {
3666
+ async function Ul(t) {
3138
3667
  await t.start();
3139
3668
  }
3140
3669
  export {
3141
- za as AdvancedOptions,
3142
- Lr as AlertModal,
3143
- z as App,
3144
- Ba as AppLayout,
3145
- Wn as AppModals,
3146
- Qn as AppOverlays,
3147
- Rs as AppService,
3148
- Kn as AppToasts,
3149
- B as Button,
3150
- wa as Cache,
3151
- zs as CacheService,
3152
- ja as Checkbox,
3153
- qr as ConfirmModal,
3154
- qa as DropdownMenu,
3155
- ta as DropdownMenuOption,
3156
- sa as DropdownMenuOptions,
3157
- Fa as EditableContent,
3158
- Ua as ErrorMessage,
3159
- gn as ErrorReportModal,
3160
- on as ErrorReportModalButtons,
3161
- ln as ErrorReportModalTitle,
3162
- Ye as Errors,
3163
- va as EventListenerPriorities,
3164
- M as Events,
3165
- Hs as EventsService,
3166
- pt as Form,
3167
- Pr as FormController,
3168
- F as FormFieldTypes,
3169
- or as HeadlessButton,
3170
- gt as HeadlessInput,
3171
- Mn as HeadlessInputDescription,
3172
- Me as HeadlessInputError,
3173
- vt as HeadlessInputInput,
3174
- ke as HeadlessInputLabel,
3175
- Da as HeadlessInputTextArea,
3176
- Cr as HeadlessModal,
3177
- xr as HeadlessModalContent,
3178
- Sr as HeadlessModalDescription,
3179
- kr as HeadlessModalOverlay,
3180
- Mr as HeadlessModalTitle,
3181
- ir as HeadlessSelect,
3182
- ze as HeadlessSelectLabel,
3183
- ot as HeadlessSelectOption,
3184
- lt as HeadlessSelectOptions,
3185
- at as HeadlessSelectTrigger,
3186
- nt as HeadlessSelectValue,
3187
- jn as HeadlessToast,
3188
- Ln as Input,
3189
- Wa as Job,
3190
- De as JobCancelledError,
3191
- J as Lang,
3670
+ Il as AdvancedOptions,
3671
+ en as AlertModal,
3672
+ A as App,
3673
+ Ll as AppLayout,
3674
+ Ca as AppModals,
3675
+ Sa as AppOverlays,
3676
+ js as AppService,
3677
+ ka as AppToasts,
3678
+ q as Button,
3679
+ cl as Cache,
3680
+ Qs as CacheService,
3681
+ ql as Checkbox,
3682
+ on as ConfirmModal,
3683
+ zl as DropdownMenu,
3684
+ qa as DropdownMenuOption,
3685
+ za as DropdownMenuOptions,
3686
+ Rl as EditableContent,
3687
+ Pl as ErrorLogs,
3688
+ Wa as ErrorLogsModal,
3689
+ Al as ErrorMessage,
3690
+ Rn as ErrorReportModal,
3691
+ Tn as ErrorReportModalButtons,
3692
+ Mn as ErrorReportModalTitle,
3693
+ nt as Errors,
3694
+ ll as EventListenerPriorities,
3695
+ R as Events,
3696
+ As as EventsService,
3697
+ wt as Form,
3698
+ gr as FormController,
3699
+ at as HeadlessButton,
3700
+ ze as HeadlessInput,
3701
+ xt as HeadlessInputDescription,
3702
+ he as HeadlessInputError,
3703
+ _t as HeadlessInputInput,
3704
+ fe as HeadlessInputLabel,
3705
+ Ha as HeadlessInputTextArea,
3706
+ Nr as HeadlessModal,
3707
+ Wr as HeadlessModalContent,
3708
+ Kr as HeadlessModalDescription,
3709
+ Qr as HeadlessModalOverlay,
3710
+ Jr as HeadlessModalTitle,
3711
+ vr as HeadlessSelect,
3712
+ Be as HeadlessSelectLabel,
3713
+ pt as HeadlessSelectOption,
3714
+ mt as HeadlessSelectOptions,
3715
+ dt as HeadlessSelectTrigger,
3716
+ ct as HeadlessSelectValue,
3717
+ Ir as HeadlessSwitch,
3718
+ ba as HeadlessToast,
3719
+ Jn as Input,
3720
+ Fl as Job,
3721
+ Ue as JobCancelledError,
3722
+ Z as Lang,
3192
3723
  me as Layouts,
3193
- Oa as Link,
3194
- xn as LoadingModal,
3195
- Ze as MOBILE_BREAKPOINT,
3196
- A as Markdown,
3197
- ne as Modal,
3198
- dt as ModalContext,
3199
- $n as ProgressBar,
3200
- Pn as PromptModal,
3201
- mr as Select,
3202
- it as SelectLabel,
3203
- cr as SelectOption,
3204
- ct as SelectOptions,
3205
- ut as SelectTrigger,
3206
- ve as Service,
3207
- Se as ServiceBootError,
3208
- Na as SettingsModal,
3209
- Dn as StartupCrash,
3210
- qs as Storage,
3211
- qn as Toast,
3212
- I as UI,
3213
- L as UIComponents,
3214
- Ns as UIService,
3215
- Ha as booleanInput,
3216
- be as bootServices,
3217
- Aa as bootstrap,
3218
- On as bootstrapApplication,
3219
- H as classes,
3220
- ka as computedAsync,
3221
- Ma as computedDebounce,
3222
- tt as computedVariantClasses,
3223
- La as dateInput,
3224
- _a as defineDirective,
3225
- Ea as defineFormValidationRule,
3226
- ya as definePlugin,
3227
- ge as defineServiceState,
3228
- Es as defineServiceStore,
3229
- ba as defineSettings,
3230
- Ka as dispatch,
3231
- Ge as getCurrentLayout,
3232
- Gs as getErrorMessage,
3233
- Ms as getPiniaStore,
3234
- lr as hasSelectOptionLabel,
3235
- Vs as injectOrFail,
3236
- Is as injectReactive,
3237
- R as injectReactiveOrFail,
3238
- Ts as installPlugins,
3239
- Ia as numberInput,
3240
- xa as onCleanMounted,
3241
- st as onFormFocus,
3242
- Sa as persistent,
3243
- Ca as registerErrorHandler,
3244
- nr as renderMarkdown,
3245
- Je as renderVNode,
3246
- $a as replaceExisting,
3247
- Ra as requiredBooleanInput,
3248
- Ta as requiredDateInput,
3249
- Pa as requiredNumberInput,
3250
- Ir as requiredStringInput,
3251
- ks as resetPiniaStore,
3252
- ar as safeHtml,
3253
- Va as stringInput,
3254
- Xe as translate,
3255
- x as translateWithDefault,
3256
- Vr as useConfirmModal,
3257
- cn as useErrorReportModal,
3258
- oe as useEvent,
3259
- mt as useForm,
3260
- rt as useInputAttrs,
3261
- Cn as useLoadingModal,
3262
- Rn as usePromptModal,
3263
- Tr as validate,
3264
- de as validators
3724
+ Dl as Link,
3725
+ On as LoadingModal,
3726
+ tt as MOBILE_BREAKPOINT,
3727
+ P as Markdown,
3728
+ se as Modal,
3729
+ yt as ModalContext,
3730
+ Fn as ProgressBar,
3731
+ Gn as PromptModal,
3732
+ $r as Select,
3733
+ ft as SelectLabel,
3734
+ Fe as SelectOption,
3735
+ ht as SelectOptions,
3736
+ gt as SelectTrigger,
3737
+ we as Service,
3738
+ Te as ServiceBootError,
3739
+ Vr as Setting,
3740
+ jl as SettingsModal,
3741
+ ga as StartupCrash,
3742
+ et as Storage,
3743
+ qr as Switch,
3744
+ Bl as TextArea,
3745
+ ya as Toast,
3746
+ z as UI,
3747
+ Gs as UIService,
3748
+ fl as __valueType,
3749
+ qs as appNamespace,
3750
+ wl as booleanInput,
3751
+ $e as bootServices,
3752
+ Vl as bootstrap,
3753
+ _a as bootstrapApplication,
3754
+ M as classes,
3755
+ vl as computedAsync,
3756
+ bl as computedDebounce,
3757
+ $l as dateInput,
3758
+ ul as defineDirective,
3759
+ ml as defineFormValidationRule,
3760
+ il as definePlugin,
3761
+ ye as defineServiceState,
3762
+ Ps as defineServiceStore,
3763
+ ol as defineSettings,
3764
+ Ul as dispatch,
3765
+ _l as enumInput,
3766
+ st as getCurrentLayout,
3767
+ bt as getErrorMessage,
3768
+ ir as getMarkdownRouter,
3769
+ Rs as getPiniaStore,
3770
+ dr as hasSelectOptionLabel,
3771
+ Os as injectOrFail,
3772
+ Us as injectReactive,
3773
+ V as injectReactiveOrFail,
3774
+ Bs as installPlugins,
3775
+ Ml as numberInput,
3776
+ Hl as objectInput,
3777
+ hl as onCleanMounted,
3778
+ it as onFormFocus,
3779
+ gl as persistent,
3780
+ yl as registerErrorHandler,
3781
+ ur as renderMarkdown,
3782
+ Ge as renderVNode,
3783
+ dl as replaceExisting,
3784
+ xl as requiredBooleanInput,
3785
+ Cl as requiredDateInput,
3786
+ kl as requiredEnumInput,
3787
+ Sl as requiredNumberInput,
3788
+ Tl as requiredObjectInput,
3789
+ Zn as requiredStringInput,
3790
+ zs as resetPiniaStore,
3791
+ cr as safeHtml,
3792
+ pl as setMarkdownRouter,
3793
+ El as stringInput,
3794
+ rt as translate,
3795
+ S as translateWithDefault,
3796
+ Gr as useAlertModal,
3797
+ tn as useConfirmModal,
3798
+ Hn as useErrorReportModal,
3799
+ ot as useEvent,
3800
+ ut as useForm,
3801
+ Ie as useInputAttrs,
3802
+ Un as useLoadingModal,
3803
+ Xn as usePromptModal,
3804
+ hr as validate,
3805
+ fr as validateType,
3806
+ de as validators,
3807
+ lt as variantClasses
3265
3808
  };
3266
3809
  //# sourceMappingURL=aerogel-core.js.map