@stonecrop/desktop 0.2.13 → 0.2.18

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.
@@ -0,0 +1,4908 @@
1
+ import { defineComponent as Z, ref as T, onMounted as zt, openBlock as x, createElementBlock as A, normalizeClass as uo, createElementVNode as D, Fragment as Oe, renderList as Pe, toDisplayString as le, createCommentVNode as ge, withDirectives as ze, vShow as qt, pushScopeId as fo, popScopeId as po, computed as L, createBlock as Se, resolveDynamicComponent as Kt, mergeProps as Jt, effectScope as ho, markRaw as ke, inject as ne, onBeforeMount as _r, shallowRef as br, toRaw as gt, hasInjectionContext as Er, getCurrentInstance as Yt, unref as E, shallowReactive as kr, watch as J, reactive as Ee, isRef as qe, isReactive as Qt, toRef as it, nextTick as Ke, getCurrentScope as Xt, onScopeDispose as Zt, h as mo, provide as ct, toRefs as kn, watchEffect as Sr, readonly as Ir, customRef as Or, normalizeStyle as ce, renderSlot as me, createVNode as pt, withCtx as ht, useCssVars as vo, createTextVNode as go, onBeforeUnmount as Pr, resolveComponent as xr, withKeys as tt, vModelText as $r } from "vue";
2
+ const en = (e) => (fo("data-v-b7fdfbec"), e = e(), po(), e), Nr = { class: "action-menu-icon" }, Cr = /* @__PURE__ */ en(() => /* @__PURE__ */ D("svg", {
3
+ class: "leftBar",
4
+ version: "1.1",
5
+ id: "Layer_1",
6
+ xmlns: "http://www.w3.org/2000/svg",
7
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
8
+ x: "0px",
9
+ y: "0px",
10
+ viewBox: "0 0 100 100",
11
+ "xml:space": "preserve",
12
+ width: "50",
13
+ height: "50"
14
+ }, [
15
+ /* @__PURE__ */ D("polygon", { points: "54.2,33.4 29.2,58.8 25,54.6 50,29.2 " })
16
+ ], -1)), Rr = /* @__PURE__ */ en(() => /* @__PURE__ */ D("svg", {
17
+ class: "rightBar",
18
+ version: "1.1",
19
+ id: "Layer_1",
20
+ xmlns: "http://www.w3.org/2000/svg",
21
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
22
+ x: "0px",
23
+ y: "0px",
24
+ viewBox: "0 0 100 100",
25
+ "xml:space": "preserve",
26
+ width: "50",
27
+ height: "50"
28
+ }, [
29
+ /* @__PURE__ */ D("polygon", { points: "70.8,58.8 45.8,33.4 50,29.2 75,54.6 " })
30
+ ], -1)), Ar = [
31
+ Cr,
32
+ Rr
33
+ ], Tr = /* @__PURE__ */ en(() => /* @__PURE__ */ D("div", { style: { "margin-right": "30px" } }, null, -1)), Dr = ["onclick"], Mr = { key: 1 }, Vr = ["onClick"], Lr = { class: "dropdown-container" }, jr = { class: "dropdown" }, Br = ["onclick"], Ur = ["href"], Hr = { class: "dropdown-item" }, Wr = /* @__PURE__ */ Z({
34
+ __name: "ActionSet",
35
+ props: {
36
+ elements: {}
37
+ },
38
+ setup(e) {
39
+ const t = e, n = T([]), o = T(!1), r = T(null), s = T(!1), i = T(!1);
40
+ zt(() => {
41
+ n.value = t.elements, a();
42
+ });
43
+ const a = () => {
44
+ for (let d of n.value)
45
+ d.elementType === "dropdown" && (d.show = !1);
46
+ }, c = () => {
47
+ s.value = !0, r.value = setTimeout(() => {
48
+ s.value && (o.value = !0);
49
+ }, 500);
50
+ }, u = () => {
51
+ s.value = !1, i.value = !1, clearTimeout(r.value), o.value = !1;
52
+ }, l = (d) => {
53
+ const f = !n.value[d].show;
54
+ a(), n.value[d].show = f;
55
+ };
56
+ return (d, f) => (x(), A("div", {
57
+ class: uo([{ "open-set": o.value, "hovered-and-closed": i.value }, "action-set collapse"]),
58
+ onMouseover: c,
59
+ onMouseleave: u
60
+ }, [
61
+ D("div", Nr, [
62
+ D("div", {
63
+ id: "chevron",
64
+ onClick: f[0] || (f[0] = (p) => i.value = !i.value)
65
+ }, Ar)
66
+ ]),
67
+ Tr,
68
+ (x(!0), A(Oe, null, Pe(n.value, (p, m) => (x(), A("div", {
69
+ class: "action-element",
70
+ key: m
71
+ }, [
72
+ p.elementType == "button" ? (x(), A("button", {
73
+ key: 0,
74
+ onclick: p.action,
75
+ class: "button-default"
76
+ }, le(p.label), 9, Dr)) : ge("", !0),
77
+ p.elementType == "dropdown" ? (x(), A("div", Mr, [
78
+ D("button", {
79
+ class: "button-default",
80
+ onClick: (v) => l(m)
81
+ }, le(p.label), 9, Vr),
82
+ ze(D("div", Lr, [
83
+ D("div", jr, [
84
+ (x(!0), A(Oe, null, Pe(p.actions, (v) => (x(), A("div", {
85
+ key: v.label
86
+ }, [
87
+ v.action != null ? (x(), A("button", {
88
+ key: 0,
89
+ onclick: v.action,
90
+ class: "dropdown-item"
91
+ }, le(v.label), 9, Br)) : v.link != null ? (x(), A("a", {
92
+ key: 1,
93
+ href: v.link
94
+ }, [
95
+ D("button", Hr, le(v.label), 1)
96
+ ], 8, Ur)) : ge("", !0)
97
+ ]))), 128))
98
+ ])
99
+ ], 512), [
100
+ [qt, p.show]
101
+ ])
102
+ ])) : ge("", !0)
103
+ ]))), 128))
104
+ ], 34));
105
+ }
106
+ }), tn = (e, t) => {
107
+ const n = e.__vccOpts || e;
108
+ for (const [o, r] of t)
109
+ n[o] = r;
110
+ return n;
111
+ }, Fr = /* @__PURE__ */ tn(Wr, [["__scopeId", "data-v-b7fdfbec"]]), Gr = {};
112
+ function zr(e, t) {
113
+ return x(), A("dialog");
114
+ }
115
+ const qr = /* @__PURE__ */ tn(Gr, [["render", zr]]), Kr = (e, t) => {
116
+ const n = e.__vccOpts || e;
117
+ for (const [o, r] of t)
118
+ n[o] = r;
119
+ return n;
120
+ };
121
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
122
+ const Jr = /* @__PURE__ */ Z({
123
+ __name: "AForm",
124
+ props: {
125
+ modelValue: {},
126
+ data: {},
127
+ readonly: { type: Boolean }
128
+ },
129
+ emits: ["update:modelValue"],
130
+ setup(e, { emit: t }) {
131
+ const n = e, o = t, r = T(n.data || {}), s = (a) => {
132
+ let c = {};
133
+ for (const [u, l] of Object.entries(a))
134
+ ["component", "fieldtype"].includes(u) || (c[u] = l), u === "rows" && l && l.length === 0 && (c.rows = r.value[a.fieldname]);
135
+ return c;
136
+ }, i = L({
137
+ get: () => n.modelValue.map((a, c) => L({
138
+ get() {
139
+ return a.value;
140
+ },
141
+ set: (u) => {
142
+ n.modelValue[c].value = u, o("update:modelValue", n.modelValue);
143
+ }
144
+ })),
145
+ set: () => {
146
+ }
147
+ });
148
+ return (a, c) => (x(), A("form", null, [
149
+ (x(!0), A(Oe, null, Pe(a.modelValue, (u, l) => (x(), Se(Kt(u.component), Jt({
150
+ key: l,
151
+ schema: u,
152
+ modelValue: i.value[l].value,
153
+ "onUpdate:modelValue": (d) => i.value[l].value = d,
154
+ data: r.value[u.fieldname],
155
+ readonly: a.readonly
156
+ }, s(u)), null, 16, ["schema", "modelValue", "onUpdate:modelValue", "data", "readonly"]))), 128))
157
+ ]));
158
+ }
159
+ }), Yr = /* @__PURE__ */ Kr(Jr, [["__scopeId", "data-v-74d66cf2"]]);
160
+ function At(e) {
161
+ this.message = e || "";
162
+ }
163
+ At.prototype = Object.create(Error.prototype, {
164
+ constructor: { value: At },
165
+ name: { value: "NotImplemented" },
166
+ stack: {
167
+ get: function() {
168
+ return new Error().stack;
169
+ }
170
+ }
171
+ });
172
+ class Be {
173
+ /**
174
+ * @constructor
175
+ * @param {Registry} registry - The immutable registry
176
+ * @param {ReturnType<typeof useDataStore>} store - The mutable Pinia store
177
+ * @param {Schema} [schema] - (optional) The Stonecrop schema
178
+ * @param {ImmutableDoctype['workflow']} [workflow] - (optional) The Stonecrop workflow
179
+ * @param {ImmutableDoctype['actions']} [actions] - (optional) The Stonecrop actions
180
+ * @returns {Stonecrop} The Stonecrop instance
181
+ * @description The Stonecrop constructor initializes a new Stonecrop instance with the given registry, store, schema, workflow, and actions. If a Stonecrop instance has already been created, it returns the existing instance instead of creating a new one.
182
+ * @example
183
+ * const registry = new Registry()
184
+ * const store = useDataStore()
185
+ * const stonecrop = new Stonecrop(registry, store, schema, workflow, actions)
186
+ */
187
+ constructor(t, n, o, r, s) {
188
+ if (this.name = "Stonecrop", Be._root)
189
+ return Be._root;
190
+ Be._root = this, this.registry = t, this.store = n, this.schema = o, this.workflow = r, this.actions = s;
191
+ }
192
+ /**
193
+ * @method setup
194
+ * @param {DoctypeMeta} doctype - The doctype to setup
195
+ * @returns {void}
196
+ * @description Sets up the Stonecrop instance with the given doctype
197
+ * @example
198
+ * const doctype = await registry.getMeta('Task')
199
+ * stonecrop.setup(doctype)
200
+ */
201
+ setup(t) {
202
+ this.getMeta(t), this.getWorkflow(t), this.getActions(t);
203
+ }
204
+ /**
205
+ * @method getMeta
206
+ * @param {DoctypeMeta} doctype - The doctype to get meta for
207
+ * @returns {DoctypeMeta}
208
+ * @see {@link DoctypeMeta}
209
+ * @throws NotImplementedError
210
+ * @description Gets the meta for the given doctype
211
+ * @example
212
+ * const doctype = await registry.getMeta('Task')
213
+ * const meta = stonecrop.getMeta(doctype)
214
+ */
215
+ getMeta(t) {
216
+ return this.registry.getMeta ? this.registry.getMeta(t.doctype) : new At(t.doctype);
217
+ }
218
+ /**
219
+ * @method getWorkflow
220
+ * @param {DoctypeMeta} doctype - The doctype to get workflow for
221
+ * @returns {void}
222
+ * @description Gets the workflow for the given doctype
223
+ * @example
224
+ * const doctype = await registry.getMeta('Task')
225
+ * stonecrop.getWorkflow(doctype)
226
+ */
227
+ getWorkflow(t) {
228
+ const n = this.registry.registry[t.slug];
229
+ this.workflow = n.workflow;
230
+ }
231
+ /**
232
+ * @method getActions
233
+ * @param {DoctypeMeta} doctype - The doctype to get actions for
234
+ * @returns {void}
235
+ * @description Gets the actions for the given doctype
236
+ * @example
237
+ * const doctype = await registry.getMeta('Task')
238
+ * stonecrop.getActions(doctype)
239
+ */
240
+ getActions(t) {
241
+ const n = this.registry.registry[t.slug];
242
+ this.actions = n.actions;
243
+ }
244
+ /**
245
+ * @method getRecords
246
+ * @param {DoctypeMeta} doctype - The doctype to get records for
247
+ * @param {RequestInit} [filters] - The filters to apply to the records
248
+ * @returns {Promise<void>}
249
+ * @description Gets the records for the given doctype
250
+ * @example
251
+ * const doctype = await registry.getMeta('Task')
252
+ * await stonecrop.getRecords(doctype)
253
+ * @example
254
+ * const doctype = await registry.getMeta('Task')
255
+ * const filters = JSON.stringify({ status: 'Open' })
256
+ * await stonecrop.getRecords(doctype, { body: filters })
257
+ */
258
+ async getRecords(t, n) {
259
+ this.store.$patch({ records: [] });
260
+ const r = await (await fetch(`/${t.slug}`, n)).json();
261
+ this.store.$patch({ records: r });
262
+ }
263
+ /**
264
+ * @method getRecord
265
+ * @param {DoctypeMeta} doctype - The doctype to get record for
266
+ * @param {string} id - The id of the record to get
267
+ * @returns {Promise<void>}
268
+ * @description Gets the record for the given doctype and id
269
+ * @example
270
+ * const doctype = await registry.getMeta('Task')
271
+ * await stonecrop.getRecord(doctype, 'TASK-00001')
272
+ */
273
+ async getRecord(t, n) {
274
+ this.store.$patch({ record: {} });
275
+ const r = await (await fetch(`/${t.slug}/${n}`)).json();
276
+ this.store.$patch({ record: r });
277
+ }
278
+ /**
279
+ * @method runAction
280
+ * @param {DoctypeMeta} doctype - The doctype to run action for
281
+ * @param {string} action - The action to run
282
+ * @param {string[]} [id] - The id(s) of the record(s) to run action on
283
+ * @returns {void}
284
+ * @description Runs the action for the given doctype and id
285
+ * @example
286
+ * const doctype = await registry.getMeta('Task')
287
+ * stonecrop.runAction(doctype, 'CREATE')
288
+ * @example
289
+ * const doctype = await registry.getMeta('Task')
290
+ * stonecrop.runAction(doctype, 'UPDATE', ['TASK-00001'])
291
+ * @example
292
+ * const doctype = await registry.getMeta('Task')
293
+ * stonecrop.runAction(doctype, 'DELETE', ['TASK-00001'])
294
+ * @example
295
+ * const doctype = await registry.getMeta('Task')
296
+ * stonecrop.runAction(doctype, 'TRANSITION', ['TASK-00001', 'TASK-00002'])
297
+ */
298
+ runAction(t, n, o) {
299
+ const s = this.registry.registry[t.slug].actions.get(n), { initialState: i } = this.workflow;
300
+ this.workflow.transition(i, { type: n }), s.length > 0 && s.forEach((a) => {
301
+ new Function(a)(o);
302
+ });
303
+ }
304
+ }
305
+ var yo = !1;
306
+ function nt(e, t, n) {
307
+ return Array.isArray(e) ? (e.length = Math.max(e.length, t), e.splice(t, 1, n), n) : (e[t] = n, n);
308
+ }
309
+ function It(e, t) {
310
+ if (Array.isArray(e)) {
311
+ e.splice(t, 1);
312
+ return;
313
+ }
314
+ delete e[t];
315
+ }
316
+ function Qr() {
317
+ return wo().__VUE_DEVTOOLS_GLOBAL_HOOK__;
318
+ }
319
+ function wo() {
320
+ return typeof navigator < "u" && typeof window < "u" ? window : typeof global < "u" ? global : {};
321
+ }
322
+ const Xr = typeof Proxy == "function", Zr = "devtools-plugin:setup", es = "plugin:settings:set";
323
+ let Ne, Tt;
324
+ function ts() {
325
+ var e;
326
+ return Ne !== void 0 || (typeof window < "u" && window.performance ? (Ne = !0, Tt = window.performance) : typeof global < "u" && (!((e = global.perf_hooks) === null || e === void 0) && e.performance) ? (Ne = !0, Tt = global.perf_hooks.performance) : Ne = !1), Ne;
327
+ }
328
+ function ns() {
329
+ return ts() ? Tt.now() : Date.now();
330
+ }
331
+ class os {
332
+ constructor(t, n) {
333
+ this.target = null, this.targetQueue = [], this.onQueue = [], this.plugin = t, this.hook = n;
334
+ const o = {};
335
+ if (t.settings)
336
+ for (const i in t.settings) {
337
+ const a = t.settings[i];
338
+ o[i] = a.defaultValue;
339
+ }
340
+ const r = `__vue-devtools-plugin-settings__${t.id}`;
341
+ let s = Object.assign({}, o);
342
+ try {
343
+ const i = localStorage.getItem(r), a = JSON.parse(i);
344
+ Object.assign(s, a);
345
+ } catch {
346
+ }
347
+ this.fallbacks = {
348
+ getSettings() {
349
+ return s;
350
+ },
351
+ setSettings(i) {
352
+ try {
353
+ localStorage.setItem(r, JSON.stringify(i));
354
+ } catch {
355
+ }
356
+ s = i;
357
+ },
358
+ now() {
359
+ return ns();
360
+ }
361
+ }, n && n.on(es, (i, a) => {
362
+ i === this.plugin.id && this.fallbacks.setSettings(a);
363
+ }), this.proxiedOn = new Proxy({}, {
364
+ get: (i, a) => this.target ? this.target.on[a] : (...c) => {
365
+ this.onQueue.push({
366
+ method: a,
367
+ args: c
368
+ });
369
+ }
370
+ }), this.proxiedTarget = new Proxy({}, {
371
+ get: (i, a) => this.target ? this.target[a] : a === "on" ? this.proxiedOn : Object.keys(this.fallbacks).includes(a) ? (...c) => (this.targetQueue.push({
372
+ method: a,
373
+ args: c,
374
+ resolve: () => {
375
+ }
376
+ }), this.fallbacks[a](...c)) : (...c) => new Promise((u) => {
377
+ this.targetQueue.push({
378
+ method: a,
379
+ args: c,
380
+ resolve: u
381
+ });
382
+ })
383
+ });
384
+ }
385
+ async setRealTarget(t) {
386
+ this.target = t;
387
+ for (const n of this.onQueue)
388
+ this.target.on[n.method](...n.args);
389
+ for (const n of this.targetQueue)
390
+ n.resolve(await this.target[n.method](...n.args));
391
+ }
392
+ }
393
+ function nn(e, t) {
394
+ const n = e, o = wo(), r = Qr(), s = Xr && n.enableEarlyProxy;
395
+ if (r && (o.__VUE_DEVTOOLS_PLUGIN_API_AVAILABLE__ || !s))
396
+ r.emit(Zr, e, t);
397
+ else {
398
+ const i = s ? new os(n, r) : null;
399
+ (o.__VUE_DEVTOOLS_PLUGINS__ = o.__VUE_DEVTOOLS_PLUGINS__ || []).push({
400
+ pluginDescriptor: n,
401
+ setupFn: t,
402
+ proxy: i
403
+ }), i && t(i.proxiedTarget);
404
+ }
405
+ }
406
+ /*!
407
+ * pinia v2.1.7
408
+ * (c) 2023 Eduardo San Martin Morote
409
+ * @license MIT
410
+ */
411
+ let Le;
412
+ const Je = (e) => Le = e, _o = process.env.NODE_ENV !== "production" ? Symbol("pinia") : (
413
+ /* istanbul ignore next */
414
+ Symbol()
415
+ );
416
+ function xe(e) {
417
+ return e && typeof e == "object" && Object.prototype.toString.call(e) === "[object Object]" && typeof e.toJSON != "function";
418
+ }
419
+ var re;
420
+ (function(e) {
421
+ e.direct = "direct", e.patchObject = "patch object", e.patchFunction = "patch function";
422
+ })(re || (re = {}));
423
+ const yt = typeof window < "u", Ue = (process.env.NODE_ENV !== "production" || !1) && process.env.NODE_ENV !== "test" && yt, Sn = typeof window == "object" && window.window === window ? window : typeof self == "object" && self.self === self ? self : typeof global == "object" && global.global === global ? global : typeof globalThis == "object" ? globalThis : { HTMLElement: null };
424
+ function rs(e, { autoBom: t = !1 } = {}) {
425
+ return t && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type) ? new Blob(["\uFEFF", e], { type: e.type }) : e;
426
+ }
427
+ function on(e, t, n) {
428
+ const o = new XMLHttpRequest();
429
+ o.open("GET", e), o.responseType = "blob", o.onload = function() {
430
+ ko(o.response, t, n);
431
+ }, o.onerror = function() {
432
+ console.error("could not download file");
433
+ }, o.send();
434
+ }
435
+ function bo(e) {
436
+ const t = new XMLHttpRequest();
437
+ t.open("HEAD", e, !1);
438
+ try {
439
+ t.send();
440
+ } catch {
441
+ }
442
+ return t.status >= 200 && t.status <= 299;
443
+ }
444
+ function lt(e) {
445
+ try {
446
+ e.dispatchEvent(new MouseEvent("click"));
447
+ } catch {
448
+ const n = document.createEvent("MouseEvents");
449
+ n.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), e.dispatchEvent(n);
450
+ }
451
+ }
452
+ const ut = typeof navigator == "object" ? navigator : { userAgent: "" }, Eo = /Macintosh/.test(ut.userAgent) && /AppleWebKit/.test(ut.userAgent) && !/Safari/.test(ut.userAgent), ko = yt ? (
453
+ // Use download attribute first if possible (#193 Lumia mobile) unless this is a macOS WebView or mini program
454
+ typeof HTMLAnchorElement < "u" && "download" in HTMLAnchorElement.prototype && !Eo ? ss : (
455
+ // Use msSaveOrOpenBlob as a second approach
456
+ "msSaveOrOpenBlob" in ut ? as : (
457
+ // Fallback to using FileReader and a popup
458
+ is
459
+ )
460
+ )
461
+ ) : () => {
462
+ };
463
+ function ss(e, t = "download", n) {
464
+ const o = document.createElement("a");
465
+ o.download = t, o.rel = "noopener", typeof e == "string" ? (o.href = e, o.origin !== location.origin ? bo(o.href) ? on(e, t, n) : (o.target = "_blank", lt(o)) : lt(o)) : (o.href = URL.createObjectURL(e), setTimeout(function() {
466
+ URL.revokeObjectURL(o.href);
467
+ }, 4e4), setTimeout(function() {
468
+ lt(o);
469
+ }, 0));
470
+ }
471
+ function as(e, t = "download", n) {
472
+ if (typeof e == "string")
473
+ if (bo(e))
474
+ on(e, t, n);
475
+ else {
476
+ const o = document.createElement("a");
477
+ o.href = e, o.target = "_blank", setTimeout(function() {
478
+ lt(o);
479
+ });
480
+ }
481
+ else
482
+ navigator.msSaveOrOpenBlob(rs(e, n), t);
483
+ }
484
+ function is(e, t, n, o) {
485
+ if (o = o || open("", "_blank"), o && (o.document.title = o.document.body.innerText = "downloading..."), typeof e == "string")
486
+ return on(e, t, n);
487
+ const r = e.type === "application/octet-stream", s = /constructor/i.test(String(Sn.HTMLElement)) || "safari" in Sn, i = /CriOS\/[\d]+/.test(navigator.userAgent);
488
+ if ((i || r && s || Eo) && typeof FileReader < "u") {
489
+ const a = new FileReader();
490
+ a.onloadend = function() {
491
+ let c = a.result;
492
+ if (typeof c != "string")
493
+ throw o = null, new Error("Wrong reader.result type");
494
+ c = i ? c : c.replace(/^data:[^;]*;/, "data:attachment/file;"), o ? o.location.href = c : location.assign(c), o = null;
495
+ }, a.readAsDataURL(e);
496
+ } else {
497
+ const a = URL.createObjectURL(e);
498
+ o ? o.location.assign(a) : location.href = a, o = null, setTimeout(function() {
499
+ URL.revokeObjectURL(a);
500
+ }, 4e4);
501
+ }
502
+ }
503
+ function H(e, t) {
504
+ const n = "🍍 " + e;
505
+ typeof __VUE_DEVTOOLS_TOAST__ == "function" ? __VUE_DEVTOOLS_TOAST__(n, t) : t === "error" ? console.error(n) : t === "warn" ? console.warn(n) : console.log(n);
506
+ }
507
+ function rn(e) {
508
+ return "_a" in e && "install" in e;
509
+ }
510
+ function So() {
511
+ if (!("clipboard" in navigator))
512
+ return H("Your browser doesn't support the Clipboard API", "error"), !0;
513
+ }
514
+ function Io(e) {
515
+ return e instanceof Error && e.message.toLowerCase().includes("document is not focused") ? (H('You need to activate the "Emulate a focused page" setting in the "Rendering" panel of devtools.', "warn"), !0) : !1;
516
+ }
517
+ async function cs(e) {
518
+ if (!So())
519
+ try {
520
+ await navigator.clipboard.writeText(JSON.stringify(e.state.value)), H("Global state copied to clipboard.");
521
+ } catch (t) {
522
+ if (Io(t))
523
+ return;
524
+ H("Failed to serialize the state. Check the console for more details.", "error"), console.error(t);
525
+ }
526
+ }
527
+ async function ls(e) {
528
+ if (!So())
529
+ try {
530
+ Oo(e, JSON.parse(await navigator.clipboard.readText())), H("Global state pasted from clipboard.");
531
+ } catch (t) {
532
+ if (Io(t))
533
+ return;
534
+ H("Failed to deserialize the state from clipboard. Check the console for more details.", "error"), console.error(t);
535
+ }
536
+ }
537
+ async function us(e) {
538
+ try {
539
+ ko(new Blob([JSON.stringify(e.state.value)], {
540
+ type: "text/plain;charset=utf-8"
541
+ }), "pinia-state.json");
542
+ } catch (t) {
543
+ H("Failed to export the state as JSON. Check the console for more details.", "error"), console.error(t);
544
+ }
545
+ }
546
+ let se;
547
+ function ds() {
548
+ se || (se = document.createElement("input"), se.type = "file", se.accept = ".json");
549
+ function e() {
550
+ return new Promise((t, n) => {
551
+ se.onchange = async () => {
552
+ const o = se.files;
553
+ if (!o)
554
+ return t(null);
555
+ const r = o.item(0);
556
+ return t(r ? { text: await r.text(), file: r } : null);
557
+ }, se.oncancel = () => t(null), se.onerror = n, se.click();
558
+ });
559
+ }
560
+ return e;
561
+ }
562
+ async function fs(e) {
563
+ try {
564
+ const n = await ds()();
565
+ if (!n)
566
+ return;
567
+ const { text: o, file: r } = n;
568
+ Oo(e, JSON.parse(o)), H(`Global state imported from "${r.name}".`);
569
+ } catch (t) {
570
+ H("Failed to import the state from JSON. Check the console for more details.", "error"), console.error(t);
571
+ }
572
+ }
573
+ function Oo(e, t) {
574
+ for (const n in t) {
575
+ const o = e.state.value[n];
576
+ o ? Object.assign(o, t[n]) : e.state.value[n] = t[n];
577
+ }
578
+ }
579
+ function te(e) {
580
+ return {
581
+ _custom: {
582
+ display: e
583
+ }
584
+ };
585
+ }
586
+ const Po = "🍍 Pinia (root)", Dt = "_root";
587
+ function ps(e) {
588
+ return rn(e) ? {
589
+ id: Dt,
590
+ label: Po
591
+ } : {
592
+ id: e.$id,
593
+ label: e.$id
594
+ };
595
+ }
596
+ function hs(e) {
597
+ if (rn(e)) {
598
+ const n = Array.from(e._s.keys()), o = e._s;
599
+ return {
600
+ state: n.map((s) => ({
601
+ editable: !0,
602
+ key: s,
603
+ value: e.state.value[s]
604
+ })),
605
+ getters: n.filter((s) => o.get(s)._getters).map((s) => {
606
+ const i = o.get(s);
607
+ return {
608
+ editable: !1,
609
+ key: s,
610
+ value: i._getters.reduce((a, c) => (a[c] = i[c], a), {})
611
+ };
612
+ })
613
+ };
614
+ }
615
+ const t = {
616
+ state: Object.keys(e.$state).map((n) => ({
617
+ editable: !0,
618
+ key: n,
619
+ value: e.$state[n]
620
+ }))
621
+ };
622
+ return e._getters && e._getters.length && (t.getters = e._getters.map((n) => ({
623
+ editable: !1,
624
+ key: n,
625
+ value: e[n]
626
+ }))), e._customProperties.size && (t.customProperties = Array.from(e._customProperties).map((n) => ({
627
+ editable: !0,
628
+ key: n,
629
+ value: e[n]
630
+ }))), t;
631
+ }
632
+ function ms(e) {
633
+ return e ? Array.isArray(e) ? e.reduce((t, n) => (t.keys.push(n.key), t.operations.push(n.type), t.oldValue[n.key] = n.oldValue, t.newValue[n.key] = n.newValue, t), {
634
+ oldValue: {},
635
+ keys: [],
636
+ operations: [],
637
+ newValue: {}
638
+ }) : {
639
+ operation: te(e.type),
640
+ key: te(e.key),
641
+ oldValue: e.oldValue,
642
+ newValue: e.newValue
643
+ } : {};
644
+ }
645
+ function vs(e) {
646
+ switch (e) {
647
+ case re.direct:
648
+ return "mutation";
649
+ case re.patchFunction:
650
+ return "$patch";
651
+ case re.patchObject:
652
+ return "$patch";
653
+ default:
654
+ return "unknown";
655
+ }
656
+ }
657
+ let Re = !0;
658
+ const dt = [], be = "pinia:mutations", z = "pinia", { assign: gs } = Object, mt = (e) => "🍍 " + e;
659
+ function ys(e, t) {
660
+ nn({
661
+ id: "dev.esm.pinia",
662
+ label: "Pinia 🍍",
663
+ logo: "https://pinia.vuejs.org/logo.svg",
664
+ packageName: "pinia",
665
+ homepage: "https://pinia.vuejs.org",
666
+ componentStateTypes: dt,
667
+ app: e
668
+ }, (n) => {
669
+ typeof n.now != "function" && H("You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."), n.addTimelineLayer({
670
+ id: be,
671
+ label: "Pinia 🍍",
672
+ color: 15064968
673
+ }), n.addInspector({
674
+ id: z,
675
+ label: "Pinia 🍍",
676
+ icon: "storage",
677
+ treeFilterPlaceholder: "Search stores",
678
+ actions: [
679
+ {
680
+ icon: "content_copy",
681
+ action: () => {
682
+ cs(t);
683
+ },
684
+ tooltip: "Serialize and copy the state"
685
+ },
686
+ {
687
+ icon: "content_paste",
688
+ action: async () => {
689
+ await ls(t), n.sendInspectorTree(z), n.sendInspectorState(z);
690
+ },
691
+ tooltip: "Replace the state with the content of your clipboard"
692
+ },
693
+ {
694
+ icon: "save",
695
+ action: () => {
696
+ us(t);
697
+ },
698
+ tooltip: "Save the state as a JSON file"
699
+ },
700
+ {
701
+ icon: "folder_open",
702
+ action: async () => {
703
+ await fs(t), n.sendInspectorTree(z), n.sendInspectorState(z);
704
+ },
705
+ tooltip: "Import the state from a JSON file"
706
+ }
707
+ ],
708
+ nodeActions: [
709
+ {
710
+ icon: "restore",
711
+ tooltip: 'Reset the state (with "$reset")',
712
+ action: (o) => {
713
+ const r = t._s.get(o);
714
+ r ? typeof r.$reset != "function" ? H(`Cannot reset "${o}" store because it doesn't have a "$reset" method implemented.`, "warn") : (r.$reset(), H(`Store "${o}" reset.`)) : H(`Cannot reset "${o}" store because it wasn't found.`, "warn");
715
+ }
716
+ }
717
+ ]
718
+ }), n.on.inspectComponent((o, r) => {
719
+ const s = o.componentInstance && o.componentInstance.proxy;
720
+ if (s && s._pStores) {
721
+ const i = o.componentInstance.proxy._pStores;
722
+ Object.values(i).forEach((a) => {
723
+ o.instanceData.state.push({
724
+ type: mt(a.$id),
725
+ key: "state",
726
+ editable: !0,
727
+ value: a._isOptionsAPI ? {
728
+ _custom: {
729
+ value: gt(a.$state),
730
+ actions: [
731
+ {
732
+ icon: "restore",
733
+ tooltip: "Reset the state of this store",
734
+ action: () => a.$reset()
735
+ }
736
+ ]
737
+ }
738
+ } : (
739
+ // NOTE: workaround to unwrap transferred refs
740
+ Object.keys(a.$state).reduce((c, u) => (c[u] = a.$state[u], c), {})
741
+ )
742
+ }), a._getters && a._getters.length && o.instanceData.state.push({
743
+ type: mt(a.$id),
744
+ key: "getters",
745
+ editable: !1,
746
+ value: a._getters.reduce((c, u) => {
747
+ try {
748
+ c[u] = a[u];
749
+ } catch (l) {
750
+ c[u] = l;
751
+ }
752
+ return c;
753
+ }, {})
754
+ });
755
+ });
756
+ }
757
+ }), n.on.getInspectorTree((o) => {
758
+ if (o.app === e && o.inspectorId === z) {
759
+ let r = [t];
760
+ r = r.concat(Array.from(t._s.values())), o.rootNodes = (o.filter ? r.filter((s) => "$id" in s ? s.$id.toLowerCase().includes(o.filter.toLowerCase()) : Po.toLowerCase().includes(o.filter.toLowerCase())) : r).map(ps);
761
+ }
762
+ }), n.on.getInspectorState((o) => {
763
+ if (o.app === e && o.inspectorId === z) {
764
+ const r = o.nodeId === Dt ? t : t._s.get(o.nodeId);
765
+ if (!r)
766
+ return;
767
+ r && (o.state = hs(r));
768
+ }
769
+ }), n.on.editInspectorState((o, r) => {
770
+ if (o.app === e && o.inspectorId === z) {
771
+ const s = o.nodeId === Dt ? t : t._s.get(o.nodeId);
772
+ if (!s)
773
+ return H(`store "${o.nodeId}" not found`, "error");
774
+ const { path: i } = o;
775
+ rn(s) ? i.unshift("state") : (i.length !== 1 || !s._customProperties.has(i[0]) || i[0] in s.$state) && i.unshift("$state"), Re = !1, o.set(s, i, o.state.value), Re = !0;
776
+ }
777
+ }), n.on.editComponentState((o) => {
778
+ if (o.type.startsWith("🍍")) {
779
+ const r = o.type.replace(/^🍍\s*/, ""), s = t._s.get(r);
780
+ if (!s)
781
+ return H(`store "${r}" not found`, "error");
782
+ const { path: i } = o;
783
+ if (i[0] !== "state")
784
+ return H(`Invalid path for store "${r}":
785
+ ${i}
786
+ Only state can be modified.`);
787
+ i[0] = "$state", Re = !1, o.set(s, i, o.state.value), Re = !0;
788
+ }
789
+ });
790
+ });
791
+ }
792
+ function ws(e, t) {
793
+ dt.includes(mt(t.$id)) || dt.push(mt(t.$id)), nn({
794
+ id: "dev.esm.pinia",
795
+ label: "Pinia 🍍",
796
+ logo: "https://pinia.vuejs.org/logo.svg",
797
+ packageName: "pinia",
798
+ homepage: "https://pinia.vuejs.org",
799
+ componentStateTypes: dt,
800
+ app: e,
801
+ settings: {
802
+ logStoreChanges: {
803
+ label: "Notify about new/deleted stores",
804
+ type: "boolean",
805
+ defaultValue: !0
806
+ }
807
+ // useEmojis: {
808
+ // label: 'Use emojis in messages ⚡️',
809
+ // type: 'boolean',
810
+ // defaultValue: true,
811
+ // },
812
+ }
813
+ }, (n) => {
814
+ const o = typeof n.now == "function" ? n.now.bind(n) : Date.now;
815
+ t.$onAction(({ after: i, onError: a, name: c, args: u }) => {
816
+ const l = xo++;
817
+ n.addTimelineEvent({
818
+ layerId: be,
819
+ event: {
820
+ time: o(),
821
+ title: "🛫 " + c,
822
+ subtitle: "start",
823
+ data: {
824
+ store: te(t.$id),
825
+ action: te(c),
826
+ args: u
827
+ },
828
+ groupId: l
829
+ }
830
+ }), i((d) => {
831
+ ve = void 0, n.addTimelineEvent({
832
+ layerId: be,
833
+ event: {
834
+ time: o(),
835
+ title: "🛬 " + c,
836
+ subtitle: "end",
837
+ data: {
838
+ store: te(t.$id),
839
+ action: te(c),
840
+ args: u,
841
+ result: d
842
+ },
843
+ groupId: l
844
+ }
845
+ });
846
+ }), a((d) => {
847
+ ve = void 0, n.addTimelineEvent({
848
+ layerId: be,
849
+ event: {
850
+ time: o(),
851
+ logType: "error",
852
+ title: "💥 " + c,
853
+ subtitle: "end",
854
+ data: {
855
+ store: te(t.$id),
856
+ action: te(c),
857
+ args: u,
858
+ error: d
859
+ },
860
+ groupId: l
861
+ }
862
+ });
863
+ });
864
+ }, !0), t._customProperties.forEach((i) => {
865
+ J(() => E(t[i]), (a, c) => {
866
+ n.notifyComponentUpdate(), n.sendInspectorState(z), Re && n.addTimelineEvent({
867
+ layerId: be,
868
+ event: {
869
+ time: o(),
870
+ title: "Change",
871
+ subtitle: i,
872
+ data: {
873
+ newValue: a,
874
+ oldValue: c
875
+ },
876
+ groupId: ve
877
+ }
878
+ });
879
+ }, { deep: !0 });
880
+ }), t.$subscribe(({ events: i, type: a }, c) => {
881
+ if (n.notifyComponentUpdate(), n.sendInspectorState(z), !Re)
882
+ return;
883
+ const u = {
884
+ time: o(),
885
+ title: vs(a),
886
+ data: gs({ store: te(t.$id) }, ms(i)),
887
+ groupId: ve
888
+ };
889
+ a === re.patchFunction ? u.subtitle = "⤵️" : a === re.patchObject ? u.subtitle = "🧩" : i && !Array.isArray(i) && (u.subtitle = i.type), i && (u.data["rawEvent(s)"] = {
890
+ _custom: {
891
+ display: "DebuggerEvent",
892
+ type: "object",
893
+ tooltip: "raw DebuggerEvent[]",
894
+ value: i
895
+ }
896
+ }), n.addTimelineEvent({
897
+ layerId: be,
898
+ event: u
899
+ });
900
+ }, { detached: !0, flush: "sync" });
901
+ const r = t._hotUpdate;
902
+ t._hotUpdate = ke((i) => {
903
+ r(i), n.addTimelineEvent({
904
+ layerId: be,
905
+ event: {
906
+ time: o(),
907
+ title: "🔥 " + t.$id,
908
+ subtitle: "HMR update",
909
+ data: {
910
+ store: te(t.$id),
911
+ info: te("HMR update")
912
+ }
913
+ }
914
+ }), n.notifyComponentUpdate(), n.sendInspectorTree(z), n.sendInspectorState(z);
915
+ });
916
+ const { $dispose: s } = t;
917
+ t.$dispose = () => {
918
+ s(), n.notifyComponentUpdate(), n.sendInspectorTree(z), n.sendInspectorState(z), n.getSettings().logStoreChanges && H(`Disposed "${t.$id}" store 🗑`);
919
+ }, n.notifyComponentUpdate(), n.sendInspectorTree(z), n.sendInspectorState(z), n.getSettings().logStoreChanges && H(`"${t.$id}" store installed 🆕`);
920
+ });
921
+ }
922
+ let xo = 0, ve;
923
+ function In(e, t, n) {
924
+ const o = t.reduce((r, s) => (r[s] = gt(e)[s], r), {});
925
+ for (const r in o)
926
+ e[r] = function() {
927
+ const s = xo, i = n ? new Proxy(e, {
928
+ get(...c) {
929
+ return ve = s, Reflect.get(...c);
930
+ },
931
+ set(...c) {
932
+ return ve = s, Reflect.set(...c);
933
+ }
934
+ }) : e;
935
+ ve = s;
936
+ const a = o[r].apply(i, arguments);
937
+ return ve = void 0, a;
938
+ };
939
+ }
940
+ function _s({ app: e, store: t, options: n }) {
941
+ if (t.$id.startsWith("__hot:"))
942
+ return;
943
+ t._isOptionsAPI = !!n.state, In(t, Object.keys(n.actions), t._isOptionsAPI);
944
+ const o = t._hotUpdate;
945
+ gt(t)._hotUpdate = function(r) {
946
+ o.apply(this, arguments), In(t, Object.keys(r._hmrPayload.actions), !!t._isOptionsAPI);
947
+ }, ws(
948
+ e,
949
+ // FIXME: is there a way to allow the assignment from Store<Id, S, G, A> to StoreGeneric?
950
+ t
951
+ );
952
+ }
953
+ function bs() {
954
+ const e = ho(!0), t = e.run(() => T({}));
955
+ let n = [], o = [];
956
+ const r = ke({
957
+ install(s) {
958
+ Je(r), r._a = s, s.provide(_o, r), s.config.globalProperties.$pinia = r, Ue && ys(s, r), o.forEach((i) => n.push(i)), o = [];
959
+ },
960
+ use(s) {
961
+ return !this._a && !yo ? o.push(s) : n.push(s), this;
962
+ },
963
+ _p: n,
964
+ // it's actually undefined here
965
+ // @ts-expect-error
966
+ _a: null,
967
+ _e: e,
968
+ _s: /* @__PURE__ */ new Map(),
969
+ state: t
970
+ });
971
+ return Ue && typeof Proxy < "u" && r.use(_s), r;
972
+ }
973
+ function $o(e, t) {
974
+ for (const n in t) {
975
+ const o = t[n];
976
+ if (!(n in e))
977
+ continue;
978
+ const r = e[n];
979
+ xe(r) && xe(o) && !qe(o) && !Qt(o) ? e[n] = $o(r, o) : e[n] = o;
980
+ }
981
+ return e;
982
+ }
983
+ const No = () => {
984
+ };
985
+ function On(e, t, n, o = No) {
986
+ e.push(t);
987
+ const r = () => {
988
+ const s = e.indexOf(t);
989
+ s > -1 && (e.splice(s, 1), o());
990
+ };
991
+ return !n && Xt() && Zt(r), r;
992
+ }
993
+ function Ce(e, ...t) {
994
+ e.slice().forEach((n) => {
995
+ n(...t);
996
+ });
997
+ }
998
+ const Es = (e) => e();
999
+ function Mt(e, t) {
1000
+ e instanceof Map && t instanceof Map && t.forEach((n, o) => e.set(o, n)), e instanceof Set && t instanceof Set && t.forEach(e.add, e);
1001
+ for (const n in t) {
1002
+ if (!t.hasOwnProperty(n))
1003
+ continue;
1004
+ const o = t[n], r = e[n];
1005
+ xe(r) && xe(o) && e.hasOwnProperty(n) && !qe(o) && !Qt(o) ? e[n] = Mt(r, o) : e[n] = o;
1006
+ }
1007
+ return e;
1008
+ }
1009
+ const ks = process.env.NODE_ENV !== "production" ? Symbol("pinia:skipHydration") : (
1010
+ /* istanbul ignore next */
1011
+ Symbol()
1012
+ );
1013
+ function Ss(e) {
1014
+ return !xe(e) || !e.hasOwnProperty(ks);
1015
+ }
1016
+ const { assign: X } = Object;
1017
+ function Pn(e) {
1018
+ return !!(qe(e) && e.effect);
1019
+ }
1020
+ function xn(e, t, n, o) {
1021
+ const { state: r, actions: s, getters: i } = t, a = n.state.value[e];
1022
+ let c;
1023
+ function u() {
1024
+ !a && (process.env.NODE_ENV === "production" || !o) && (n.state.value[e] = r ? r() : {});
1025
+ const l = process.env.NODE_ENV !== "production" && o ? (
1026
+ // use ref() to unwrap refs inside state TODO: check if this is still necessary
1027
+ kn(T(r ? r() : {}).value)
1028
+ ) : kn(n.state.value[e]);
1029
+ return X(l, s, Object.keys(i || {}).reduce((d, f) => (process.env.NODE_ENV !== "production" && f in l && console.warn(`[🍍]: A getter cannot have the same name as another state property. Rename one of them. Found with "${f}" in store "${e}".`), d[f] = ke(L(() => {
1030
+ Je(n);
1031
+ const p = n._s.get(e);
1032
+ return i[f].call(p, p);
1033
+ })), d), {}));
1034
+ }
1035
+ return c = Vt(e, u, t, n, o, !0), c;
1036
+ }
1037
+ function Vt(e, t, n = {}, o, r, s) {
1038
+ let i;
1039
+ const a = X({ actions: {} }, n);
1040
+ if (process.env.NODE_ENV !== "production" && !o._e.active)
1041
+ throw new Error("Pinia destroyed");
1042
+ const c = {
1043
+ deep: !0
1044
+ // flush: 'post',
1045
+ };
1046
+ process.env.NODE_ENV !== "production" && !yo && (c.onTrigger = (k) => {
1047
+ u ? p = k : u == !1 && !I._hotUpdating && (Array.isArray(p) ? p.push(k) : console.error("🍍 debuggerEvents should be an array. This is most likely an internal Pinia bug."));
1048
+ });
1049
+ let u, l, d = [], f = [], p;
1050
+ const m = o.state.value[e];
1051
+ !s && !m && (process.env.NODE_ENV === "production" || !r) && (o.state.value[e] = {});
1052
+ const v = T({});
1053
+ let g;
1054
+ function S(k) {
1055
+ let _;
1056
+ u = l = !1, process.env.NODE_ENV !== "production" && (p = []), typeof k == "function" ? (k(o.state.value[e]), _ = {
1057
+ type: re.patchFunction,
1058
+ storeId: e,
1059
+ events: p
1060
+ }) : (Mt(o.state.value[e], k), _ = {
1061
+ type: re.patchObject,
1062
+ payload: k,
1063
+ storeId: e,
1064
+ events: p
1065
+ });
1066
+ const M = g = Symbol();
1067
+ Ke().then(() => {
1068
+ g === M && (u = !0);
1069
+ }), l = !0, Ce(d, _, o.state.value[e]);
1070
+ }
1071
+ const O = s ? function() {
1072
+ const { state: _ } = n, M = _ ? _() : {};
1073
+ this.$patch((U) => {
1074
+ X(U, M);
1075
+ });
1076
+ } : (
1077
+ /* istanbul ignore next */
1078
+ process.env.NODE_ENV !== "production" ? () => {
1079
+ throw new Error(`🍍: Store "${e}" is built using the setup syntax and does not implement $reset().`);
1080
+ } : No
1081
+ );
1082
+ function V() {
1083
+ i.stop(), d = [], f = [], o._s.delete(e);
1084
+ }
1085
+ function W(k, _) {
1086
+ return function() {
1087
+ Je(o);
1088
+ const M = Array.from(arguments), U = [], we = [];
1089
+ function De(G) {
1090
+ U.push(G);
1091
+ }
1092
+ function Ze(G) {
1093
+ we.push(G);
1094
+ }
1095
+ Ce(f, {
1096
+ args: M,
1097
+ name: k,
1098
+ store: I,
1099
+ after: De,
1100
+ onError: Ze
1101
+ });
1102
+ let oe;
1103
+ try {
1104
+ oe = _.apply(this && this.$id === e ? this : I, M);
1105
+ } catch (G) {
1106
+ throw Ce(we, G), G;
1107
+ }
1108
+ return oe instanceof Promise ? oe.then((G) => (Ce(U, G), G)).catch((G) => (Ce(we, G), Promise.reject(G))) : (Ce(U, oe), oe);
1109
+ };
1110
+ }
1111
+ const Y = /* @__PURE__ */ ke({
1112
+ actions: {},
1113
+ getters: {},
1114
+ state: [],
1115
+ hotState: v
1116
+ }), Q = {
1117
+ _p: o,
1118
+ // _s: scope,
1119
+ $id: e,
1120
+ $onAction: On.bind(null, f),
1121
+ $patch: S,
1122
+ $reset: O,
1123
+ $subscribe(k, _ = {}) {
1124
+ const M = On(d, k, _.detached, () => U()), U = i.run(() => J(() => o.state.value[e], (we) => {
1125
+ (_.flush === "sync" ? l : u) && k({
1126
+ storeId: e,
1127
+ type: re.direct,
1128
+ events: p
1129
+ }, we);
1130
+ }, X({}, c, _)));
1131
+ return M;
1132
+ },
1133
+ $dispose: V
1134
+ }, I = Ee(process.env.NODE_ENV !== "production" || Ue ? X(
1135
+ {
1136
+ _hmrPayload: Y,
1137
+ _customProperties: ke(/* @__PURE__ */ new Set())
1138
+ // devtools custom properties
1139
+ },
1140
+ Q
1141
+ // must be added later
1142
+ // setupStore
1143
+ ) : Q);
1144
+ o._s.set(e, I);
1145
+ const ee = (o._a && o._a.runWithContext || Es)(() => o._e.run(() => (i = ho()).run(t)));
1146
+ for (const k in ee) {
1147
+ const _ = ee[k];
1148
+ if (qe(_) && !Pn(_) || Qt(_))
1149
+ process.env.NODE_ENV !== "production" && r ? nt(v.value, k, it(ee, k)) : s || (m && Ss(_) && (qe(_) ? _.value = m[k] : Mt(_, m[k])), o.state.value[e][k] = _), process.env.NODE_ENV !== "production" && Y.state.push(k);
1150
+ else if (typeof _ == "function") {
1151
+ const M = process.env.NODE_ENV !== "production" && r ? _ : W(k, _);
1152
+ ee[k] = M, process.env.NODE_ENV !== "production" && (Y.actions[k] = _), a.actions[k] = _;
1153
+ } else
1154
+ process.env.NODE_ENV !== "production" && Pn(_) && (Y.getters[k] = s ? (
1155
+ // @ts-expect-error
1156
+ n.getters[k]
1157
+ ) : _, yt && (ee._getters || // @ts-expect-error: same
1158
+ (ee._getters = ke([]))).push(k));
1159
+ }
1160
+ if (X(I, ee), X(gt(I), ee), Object.defineProperty(I, "$state", {
1161
+ get: () => process.env.NODE_ENV !== "production" && r ? v.value : o.state.value[e],
1162
+ set: (k) => {
1163
+ if (process.env.NODE_ENV !== "production" && r)
1164
+ throw new Error("cannot set hotState");
1165
+ S((_) => {
1166
+ X(_, k);
1167
+ });
1168
+ }
1169
+ }), process.env.NODE_ENV !== "production" && (I._hotUpdate = ke((k) => {
1170
+ I._hotUpdating = !0, k._hmrPayload.state.forEach((_) => {
1171
+ if (_ in I.$state) {
1172
+ const M = k.$state[_], U = I.$state[_];
1173
+ typeof M == "object" && xe(M) && xe(U) ? $o(M, U) : k.$state[_] = U;
1174
+ }
1175
+ nt(I, _, it(k.$state, _));
1176
+ }), Object.keys(I.$state).forEach((_) => {
1177
+ _ in k.$state || It(I, _);
1178
+ }), u = !1, l = !1, o.state.value[e] = it(k._hmrPayload, "hotState"), l = !0, Ke().then(() => {
1179
+ u = !0;
1180
+ });
1181
+ for (const _ in k._hmrPayload.actions) {
1182
+ const M = k[_];
1183
+ nt(I, _, W(_, M));
1184
+ }
1185
+ for (const _ in k._hmrPayload.getters) {
1186
+ const M = k._hmrPayload.getters[_], U = s ? (
1187
+ // special handling of options api
1188
+ L(() => (Je(o), M.call(I, I)))
1189
+ ) : M;
1190
+ nt(I, _, U);
1191
+ }
1192
+ Object.keys(I._hmrPayload.getters).forEach((_) => {
1193
+ _ in k._hmrPayload.getters || It(I, _);
1194
+ }), Object.keys(I._hmrPayload.actions).forEach((_) => {
1195
+ _ in k._hmrPayload.actions || It(I, _);
1196
+ }), I._hmrPayload = k._hmrPayload, I._getters = k._getters, I._hotUpdating = !1;
1197
+ })), Ue) {
1198
+ const k = {
1199
+ writable: !0,
1200
+ configurable: !0,
1201
+ // avoid warning on devtools trying to display this property
1202
+ enumerable: !1
1203
+ };
1204
+ ["_p", "_hmrPayload", "_getters", "_customProperties"].forEach((_) => {
1205
+ Object.defineProperty(I, _, X({ value: I[_] }, k));
1206
+ });
1207
+ }
1208
+ return o._p.forEach((k) => {
1209
+ if (Ue) {
1210
+ const _ = i.run(() => k({
1211
+ store: I,
1212
+ app: o._a,
1213
+ pinia: o,
1214
+ options: a
1215
+ }));
1216
+ Object.keys(_ || {}).forEach((M) => I._customProperties.add(M)), X(I, _);
1217
+ } else
1218
+ X(I, i.run(() => k({
1219
+ store: I,
1220
+ app: o._a,
1221
+ pinia: o,
1222
+ options: a
1223
+ })));
1224
+ }), process.env.NODE_ENV !== "production" && I.$state && typeof I.$state == "object" && typeof I.$state.constructor == "function" && !I.$state.constructor.toString().includes("[native code]") && console.warn(`[🍍]: The "state" must be a plain object. It cannot be
1225
+ state: () => new MyClass()
1226
+ Found in store "${I.$id}".`), m && s && n.hydrate && n.hydrate(I.$state, m), u = !0, l = !0, I;
1227
+ }
1228
+ function Is(e, t, n) {
1229
+ let o, r;
1230
+ const s = typeof t == "function";
1231
+ if (typeof e == "string")
1232
+ o = e, r = s ? n : t;
1233
+ else if (r = e, o = e.id, process.env.NODE_ENV !== "production" && typeof o != "string")
1234
+ throw new Error('[🍍]: "defineStore()" must be passed a store id as its first argument.');
1235
+ function i(a, c) {
1236
+ const u = Er();
1237
+ if (a = // in test mode, ignore the argument provided as we can always retrieve a
1238
+ // pinia instance with getActivePinia()
1239
+ (process.env.NODE_ENV === "test" && Le && Le._testing ? null : a) || (u ? ne(_o, null) : null), a && Je(a), process.env.NODE_ENV !== "production" && !Le)
1240
+ throw new Error(`[🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"?
1241
+ See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help.
1242
+ This will fail in production.`);
1243
+ a = Le, a._s.has(o) || (s ? Vt(o, t, r, a) : xn(o, r, a), process.env.NODE_ENV !== "production" && (i._pinia = a));
1244
+ const l = a._s.get(o);
1245
+ if (process.env.NODE_ENV !== "production" && c) {
1246
+ const d = "__hot:" + o, f = s ? Vt(d, t, r, a, !0) : xn(d, X({}, r), a, !0);
1247
+ c._hotUpdate(f), delete a.state.value[d], a._s.delete(d);
1248
+ }
1249
+ if (process.env.NODE_ENV !== "production" && yt) {
1250
+ const d = Yt();
1251
+ if (d && d.proxy && // avoid adding stores that are just built for hot module replacement
1252
+ !c) {
1253
+ const f = d.proxy, p = "_pStores" in f ? f._pStores : f._pStores = {};
1254
+ p[o] = l;
1255
+ }
1256
+ }
1257
+ return l;
1258
+ }
1259
+ return i.$id = o, i;
1260
+ }
1261
+ const Os = Is("data", () => {
1262
+ const e = T([]), t = T({});
1263
+ return { records: e, record: t };
1264
+ });
1265
+ function Co(e) {
1266
+ e || (e = ne("$registry"));
1267
+ const t = Os(), n = T(new Be(e, t)), o = T(!1);
1268
+ return _r(async () => {
1269
+ var r, s;
1270
+ const i = e.router.currentRoute.value, a = (r = i.params.records) == null ? void 0 : r.toString().toLowerCase(), c = (s = i.params.record) == null ? void 0 : s.toString().toLowerCase();
1271
+ if (!a && !c)
1272
+ return;
1273
+ const u = await e.getMeta(a);
1274
+ e.addDoctype(u), n.value.setup(u), a && (c ? await n.value.getRecord(u, c) : await n.value.getRecords(u)), n.value.runAction(u, "LOAD", c ? [c] : void 0), o.value = !0;
1275
+ }), { stonecrop: n, isReady: o };
1276
+ }
1277
+ /*!
1278
+ * vue-router v4.2.5
1279
+ * (c) 2023 Eduardo San Martin Morote
1280
+ * @license MIT
1281
+ */
1282
+ const ie = typeof window < "u";
1283
+ function Ps(e) {
1284
+ return e.__esModule || e[Symbol.toStringTag] === "Module";
1285
+ }
1286
+ const R = Object.assign;
1287
+ function Ot(e, t) {
1288
+ const n = {};
1289
+ for (const o in t) {
1290
+ const r = t[o];
1291
+ n[o] = K(r) ? r.map(e) : e(r);
1292
+ }
1293
+ return n;
1294
+ }
1295
+ const He = () => {
1296
+ }, K = Array.isArray;
1297
+ function N(e) {
1298
+ const t = Array.from(arguments).slice(1);
1299
+ console.warn.apply(console, ["[Vue Router warn]: " + e].concat(t));
1300
+ }
1301
+ const xs = /\/$/, $s = (e) => e.replace(xs, "");
1302
+ function Pt(e, t, n = "/") {
1303
+ let o, r = {}, s = "", i = "";
1304
+ const a = t.indexOf("#");
1305
+ let c = t.indexOf("?");
1306
+ return a < c && a >= 0 && (c = -1), c > -1 && (o = t.slice(0, c), s = t.slice(c + 1, a > -1 ? a : t.length), r = e(s)), a > -1 && (o = o || t.slice(0, a), i = t.slice(a, t.length)), o = Rs(o ?? t, n), {
1307
+ fullPath: o + (s && "?") + s + i,
1308
+ path: o,
1309
+ query: r,
1310
+ hash: i
1311
+ };
1312
+ }
1313
+ function Ns(e, t) {
1314
+ const n = t.query ? e(t.query) : "";
1315
+ return t.path + (n && "?") + n + (t.hash || "");
1316
+ }
1317
+ function $n(e, t) {
1318
+ return !t || !e.toLowerCase().startsWith(t.toLowerCase()) ? e : e.slice(t.length) || "/";
1319
+ }
1320
+ function Nn(e, t, n) {
1321
+ const o = t.matched.length - 1, r = n.matched.length - 1;
1322
+ return o > -1 && o === r && ye(t.matched[o], n.matched[r]) && Ro(t.params, n.params) && e(t.query) === e(n.query) && t.hash === n.hash;
1323
+ }
1324
+ function ye(e, t) {
1325
+ return (e.aliasOf || e) === (t.aliasOf || t);
1326
+ }
1327
+ function Ro(e, t) {
1328
+ if (Object.keys(e).length !== Object.keys(t).length)
1329
+ return !1;
1330
+ for (const n in e)
1331
+ if (!Cs(e[n], t[n]))
1332
+ return !1;
1333
+ return !0;
1334
+ }
1335
+ function Cs(e, t) {
1336
+ return K(e) ? Cn(e, t) : K(t) ? Cn(t, e) : e === t;
1337
+ }
1338
+ function Cn(e, t) {
1339
+ return K(t) ? e.length === t.length && e.every((n, o) => n === t[o]) : e.length === 1 && e[0] === t;
1340
+ }
1341
+ function Rs(e, t) {
1342
+ if (e.startsWith("/"))
1343
+ return e;
1344
+ if (process.env.NODE_ENV !== "production" && !t.startsWith("/"))
1345
+ return N(`Cannot resolve a relative location without an absolute path. Trying to resolve "${e}" from "${t}". It should look like "/${t}".`), e;
1346
+ if (!e)
1347
+ return t;
1348
+ const n = t.split("/"), o = e.split("/"), r = o[o.length - 1];
1349
+ (r === ".." || r === ".") && o.push("");
1350
+ let s = n.length - 1, i, a;
1351
+ for (i = 0; i < o.length; i++)
1352
+ if (a = o[i], a !== ".")
1353
+ if (a === "..")
1354
+ s > 1 && s--;
1355
+ else
1356
+ break;
1357
+ return n.slice(0, s).join("/") + "/" + o.slice(i - (i === o.length ? 1 : 0)).join("/");
1358
+ }
1359
+ var Ye;
1360
+ (function(e) {
1361
+ e.pop = "pop", e.push = "push";
1362
+ })(Ye || (Ye = {}));
1363
+ var We;
1364
+ (function(e) {
1365
+ e.back = "back", e.forward = "forward", e.unknown = "";
1366
+ })(We || (We = {}));
1367
+ function As(e) {
1368
+ if (!e)
1369
+ if (ie) {
1370
+ const t = document.querySelector("base");
1371
+ e = t && t.getAttribute("href") || "/", e = e.replace(/^\w+:\/\/[^\/]+/, "");
1372
+ } else
1373
+ e = "/";
1374
+ return e[0] !== "/" && e[0] !== "#" && (e = "/" + e), $s(e);
1375
+ }
1376
+ const Ts = /^[^#]+#/;
1377
+ function Ds(e, t) {
1378
+ return e.replace(Ts, "#") + t;
1379
+ }
1380
+ function Ms(e, t) {
1381
+ const n = document.documentElement.getBoundingClientRect(), o = e.getBoundingClientRect();
1382
+ return {
1383
+ behavior: t.behavior,
1384
+ left: o.left - n.left - (t.left || 0),
1385
+ top: o.top - n.top - (t.top || 0)
1386
+ };
1387
+ }
1388
+ const wt = () => ({
1389
+ left: window.pageXOffset,
1390
+ top: window.pageYOffset
1391
+ });
1392
+ function Vs(e) {
1393
+ let t;
1394
+ if ("el" in e) {
1395
+ const n = e.el, o = typeof n == "string" && n.startsWith("#");
1396
+ if (process.env.NODE_ENV !== "production" && typeof e.el == "string" && (!o || !document.getElementById(e.el.slice(1))))
1397
+ try {
1398
+ const s = document.querySelector(e.el);
1399
+ if (o && s) {
1400
+ N(`The selector "${e.el}" should be passed as "el: document.querySelector('${e.el}')" because it starts with "#".`);
1401
+ return;
1402
+ }
1403
+ } catch {
1404
+ N(`The selector "${e.el}" is invalid. If you are using an id selector, make sure to escape it. You can find more information about escaping characters in selectors at https://mathiasbynens.be/notes/css-escapes or use CSS.escape (https://developer.mozilla.org/en-US/docs/Web/API/CSS/escape).`);
1405
+ return;
1406
+ }
1407
+ const r = typeof n == "string" ? o ? document.getElementById(n.slice(1)) : document.querySelector(n) : n;
1408
+ if (!r) {
1409
+ process.env.NODE_ENV !== "production" && N(`Couldn't find element using selector "${e.el}" returned by scrollBehavior.`);
1410
+ return;
1411
+ }
1412
+ t = Ms(r, e);
1413
+ } else
1414
+ t = e;
1415
+ "scrollBehavior" in document.documentElement.style ? window.scrollTo(t) : window.scrollTo(t.left != null ? t.left : window.pageXOffset, t.top != null ? t.top : window.pageYOffset);
1416
+ }
1417
+ function Rn(e, t) {
1418
+ return (history.state ? history.state.position - t : -1) + e;
1419
+ }
1420
+ const Lt = /* @__PURE__ */ new Map();
1421
+ function Ls(e, t) {
1422
+ Lt.set(e, t);
1423
+ }
1424
+ function js(e) {
1425
+ const t = Lt.get(e);
1426
+ return Lt.delete(e), t;
1427
+ }
1428
+ let Bs = () => location.protocol + "//" + location.host;
1429
+ function Ao(e, t) {
1430
+ const { pathname: n, search: o, hash: r } = t, s = e.indexOf("#");
1431
+ if (s > -1) {
1432
+ let a = r.includes(e.slice(s)) ? e.slice(s).length : 1, c = r.slice(a);
1433
+ return c[0] !== "/" && (c = "/" + c), $n(c, "");
1434
+ }
1435
+ return $n(n, e) + o + r;
1436
+ }
1437
+ function Us(e, t, n, o) {
1438
+ let r = [], s = [], i = null;
1439
+ const a = ({ state: f }) => {
1440
+ const p = Ao(e, location), m = n.value, v = t.value;
1441
+ let g = 0;
1442
+ if (f) {
1443
+ if (n.value = p, t.value = f, i && i === m) {
1444
+ i = null;
1445
+ return;
1446
+ }
1447
+ g = v ? f.position - v.position : 0;
1448
+ } else
1449
+ o(p);
1450
+ r.forEach((S) => {
1451
+ S(n.value, m, {
1452
+ delta: g,
1453
+ type: Ye.pop,
1454
+ direction: g ? g > 0 ? We.forward : We.back : We.unknown
1455
+ });
1456
+ });
1457
+ };
1458
+ function c() {
1459
+ i = n.value;
1460
+ }
1461
+ function u(f) {
1462
+ r.push(f);
1463
+ const p = () => {
1464
+ const m = r.indexOf(f);
1465
+ m > -1 && r.splice(m, 1);
1466
+ };
1467
+ return s.push(p), p;
1468
+ }
1469
+ function l() {
1470
+ const { history: f } = window;
1471
+ f.state && f.replaceState(R({}, f.state, { scroll: wt() }), "");
1472
+ }
1473
+ function d() {
1474
+ for (const f of s)
1475
+ f();
1476
+ s = [], window.removeEventListener("popstate", a), window.removeEventListener("beforeunload", l);
1477
+ }
1478
+ return window.addEventListener("popstate", a), window.addEventListener("beforeunload", l, {
1479
+ passive: !0
1480
+ }), {
1481
+ pauseListeners: c,
1482
+ listen: u,
1483
+ destroy: d
1484
+ };
1485
+ }
1486
+ function An(e, t, n, o = !1, r = !1) {
1487
+ return {
1488
+ back: e,
1489
+ current: t,
1490
+ forward: n,
1491
+ replaced: o,
1492
+ position: window.history.length,
1493
+ scroll: r ? wt() : null
1494
+ };
1495
+ }
1496
+ function Hs(e) {
1497
+ const { history: t, location: n } = window, o = {
1498
+ value: Ao(e, n)
1499
+ }, r = { value: t.state };
1500
+ r.value || s(o.value, {
1501
+ back: null,
1502
+ current: o.value,
1503
+ forward: null,
1504
+ // the length is off by one, we need to decrease it
1505
+ position: t.length - 1,
1506
+ replaced: !0,
1507
+ // don't add a scroll as the user may have an anchor, and we want
1508
+ // scrollBehavior to be triggered without a saved position
1509
+ scroll: null
1510
+ }, !0);
1511
+ function s(c, u, l) {
1512
+ const d = e.indexOf("#"), f = d > -1 ? (n.host && document.querySelector("base") ? e : e.slice(d)) + c : Bs() + e + c;
1513
+ try {
1514
+ t[l ? "replaceState" : "pushState"](u, "", f), r.value = u;
1515
+ } catch (p) {
1516
+ process.env.NODE_ENV !== "production" ? N("Error with push/replace State", p) : console.error(p), n[l ? "replace" : "assign"](f);
1517
+ }
1518
+ }
1519
+ function i(c, u) {
1520
+ const l = R({}, t.state, An(
1521
+ r.value.back,
1522
+ // keep back and forward entries but override current position
1523
+ c,
1524
+ r.value.forward,
1525
+ !0
1526
+ ), u, { position: r.value.position });
1527
+ s(c, l, !0), o.value = c;
1528
+ }
1529
+ function a(c, u) {
1530
+ const l = R(
1531
+ {},
1532
+ // use current history state to gracefully handle a wrong call to
1533
+ // history.replaceState
1534
+ // https://github.com/vuejs/router/issues/366
1535
+ r.value,
1536
+ t.state,
1537
+ {
1538
+ forward: c,
1539
+ scroll: wt()
1540
+ }
1541
+ );
1542
+ process.env.NODE_ENV !== "production" && !t.state && N(`history.state seems to have been manually replaced without preserving the necessary values. Make sure to preserve existing history state if you are manually calling history.replaceState:
1543
+
1544
+ history.replaceState(history.state, '', url)
1545
+
1546
+ You can find more information at https://next.router.vuejs.org/guide/migration/#usage-of-history-state.`), s(l.current, l, !0);
1547
+ const d = R({}, An(o.value, c, null), { position: l.position + 1 }, u);
1548
+ s(c, d, !1), o.value = c;
1549
+ }
1550
+ return {
1551
+ location: o,
1552
+ state: r,
1553
+ push: a,
1554
+ replace: i
1555
+ };
1556
+ }
1557
+ function Ws(e) {
1558
+ e = As(e);
1559
+ const t = Hs(e), n = Us(e, t.state, t.location, t.replace);
1560
+ function o(s, i = !0) {
1561
+ i || n.pauseListeners(), history.go(s);
1562
+ }
1563
+ const r = R({
1564
+ // it's overridden right after
1565
+ location: "",
1566
+ base: e,
1567
+ go: o,
1568
+ createHref: Ds.bind(null, e)
1569
+ }, t, n);
1570
+ return Object.defineProperty(r, "location", {
1571
+ enumerable: !0,
1572
+ get: () => t.location.value
1573
+ }), Object.defineProperty(r, "state", {
1574
+ enumerable: !0,
1575
+ get: () => t.state.value
1576
+ }), r;
1577
+ }
1578
+ function Fs(e) {
1579
+ return typeof e == "string" || e && typeof e == "object";
1580
+ }
1581
+ function To(e) {
1582
+ return typeof e == "string" || typeof e == "symbol";
1583
+ }
1584
+ const pe = {
1585
+ path: "/",
1586
+ name: void 0,
1587
+ params: {},
1588
+ query: {},
1589
+ hash: "",
1590
+ fullPath: "/",
1591
+ matched: [],
1592
+ meta: {},
1593
+ redirectedFrom: void 0
1594
+ }, jt = Symbol(process.env.NODE_ENV !== "production" ? "navigation failure" : "");
1595
+ var Tn;
1596
+ (function(e) {
1597
+ e[e.aborted = 4] = "aborted", e[e.cancelled = 8] = "cancelled", e[e.duplicated = 16] = "duplicated";
1598
+ })(Tn || (Tn = {}));
1599
+ const Gs = {
1600
+ 1({ location: e, currentLocation: t }) {
1601
+ return `No match for
1602
+ ${JSON.stringify(e)}${t ? `
1603
+ while being at
1604
+ ` + JSON.stringify(t) : ""}`;
1605
+ },
1606
+ 2({ from: e, to: t }) {
1607
+ return `Redirected from "${e.fullPath}" to "${qs(t)}" via a navigation guard.`;
1608
+ },
1609
+ 4({ from: e, to: t }) {
1610
+ return `Navigation aborted from "${e.fullPath}" to "${t.fullPath}" via a navigation guard.`;
1611
+ },
1612
+ 8({ from: e, to: t }) {
1613
+ return `Navigation cancelled from "${e.fullPath}" to "${t.fullPath}" with a new navigation.`;
1614
+ },
1615
+ 16({ from: e, to: t }) {
1616
+ return `Avoided redundant navigation to current location: "${e.fullPath}".`;
1617
+ }
1618
+ };
1619
+ function Te(e, t) {
1620
+ return process.env.NODE_ENV !== "production" ? R(new Error(Gs[e](t)), {
1621
+ type: e,
1622
+ [jt]: !0
1623
+ }, t) : R(new Error(), {
1624
+ type: e,
1625
+ [jt]: !0
1626
+ }, t);
1627
+ }
1628
+ function ae(e, t) {
1629
+ return e instanceof Error && jt in e && (t == null || !!(e.type & t));
1630
+ }
1631
+ const zs = ["params", "query", "hash"];
1632
+ function qs(e) {
1633
+ if (typeof e == "string")
1634
+ return e;
1635
+ if ("path" in e)
1636
+ return e.path;
1637
+ const t = {};
1638
+ for (const n of zs)
1639
+ n in e && (t[n] = e[n]);
1640
+ return JSON.stringify(t, null, 2);
1641
+ }
1642
+ const Dn = "[^/]+?", Ks = {
1643
+ sensitive: !1,
1644
+ strict: !1,
1645
+ start: !0,
1646
+ end: !0
1647
+ }, Js = /[.+*?^${}()[\]/\\]/g;
1648
+ function Ys(e, t) {
1649
+ const n = R({}, Ks, t), o = [];
1650
+ let r = n.start ? "^" : "";
1651
+ const s = [];
1652
+ for (const u of e) {
1653
+ const l = u.length ? [] : [
1654
+ 90
1655
+ /* PathScore.Root */
1656
+ ];
1657
+ n.strict && !u.length && (r += "/");
1658
+ for (let d = 0; d < u.length; d++) {
1659
+ const f = u[d];
1660
+ let p = 40 + (n.sensitive ? 0.25 : 0);
1661
+ if (f.type === 0)
1662
+ d || (r += "/"), r += f.value.replace(Js, "\\$&"), p += 40;
1663
+ else if (f.type === 1) {
1664
+ const { value: m, repeatable: v, optional: g, regexp: S } = f;
1665
+ s.push({
1666
+ name: m,
1667
+ repeatable: v,
1668
+ optional: g
1669
+ });
1670
+ const O = S || Dn;
1671
+ if (O !== Dn) {
1672
+ p += 10;
1673
+ try {
1674
+ new RegExp(`(${O})`);
1675
+ } catch (W) {
1676
+ throw new Error(`Invalid custom RegExp for param "${m}" (${O}): ` + W.message);
1677
+ }
1678
+ }
1679
+ let V = v ? `((?:${O})(?:/(?:${O}))*)` : `(${O})`;
1680
+ d || (V = // avoid an optional / if there are more segments e.g. /:p?-static
1681
+ // or /:p?-:p2
1682
+ g && u.length < 2 ? `(?:/${V})` : "/" + V), g && (V += "?"), r += V, p += 20, g && (p += -8), v && (p += -20), O === ".*" && (p += -50);
1683
+ }
1684
+ l.push(p);
1685
+ }
1686
+ o.push(l);
1687
+ }
1688
+ if (n.strict && n.end) {
1689
+ const u = o.length - 1;
1690
+ o[u][o[u].length - 1] += 0.7000000000000001;
1691
+ }
1692
+ n.strict || (r += "/?"), n.end ? r += "$" : n.strict && (r += "(?:/|$)");
1693
+ const i = new RegExp(r, n.sensitive ? "" : "i");
1694
+ function a(u) {
1695
+ const l = u.match(i), d = {};
1696
+ if (!l)
1697
+ return null;
1698
+ for (let f = 1; f < l.length; f++) {
1699
+ const p = l[f] || "", m = s[f - 1];
1700
+ d[m.name] = p && m.repeatable ? p.split("/") : p;
1701
+ }
1702
+ return d;
1703
+ }
1704
+ function c(u) {
1705
+ let l = "", d = !1;
1706
+ for (const f of e) {
1707
+ (!d || !l.endsWith("/")) && (l += "/"), d = !1;
1708
+ for (const p of f)
1709
+ if (p.type === 0)
1710
+ l += p.value;
1711
+ else if (p.type === 1) {
1712
+ const { value: m, repeatable: v, optional: g } = p, S = m in u ? u[m] : "";
1713
+ if (K(S) && !v)
1714
+ throw new Error(`Provided param "${m}" is an array but it is not repeatable (* or + modifiers)`);
1715
+ const O = K(S) ? S.join("/") : S;
1716
+ if (!O)
1717
+ if (g)
1718
+ f.length < 2 && (l.endsWith("/") ? l = l.slice(0, -1) : d = !0);
1719
+ else
1720
+ throw new Error(`Missing required param "${m}"`);
1721
+ l += O;
1722
+ }
1723
+ }
1724
+ return l || "/";
1725
+ }
1726
+ return {
1727
+ re: i,
1728
+ score: o,
1729
+ keys: s,
1730
+ parse: a,
1731
+ stringify: c
1732
+ };
1733
+ }
1734
+ function Qs(e, t) {
1735
+ let n = 0;
1736
+ for (; n < e.length && n < t.length; ) {
1737
+ const o = t[n] - e[n];
1738
+ if (o)
1739
+ return o;
1740
+ n++;
1741
+ }
1742
+ return e.length < t.length ? e.length === 1 && e[0] === 80 ? -1 : 1 : e.length > t.length ? t.length === 1 && t[0] === 80 ? 1 : -1 : 0;
1743
+ }
1744
+ function Xs(e, t) {
1745
+ let n = 0;
1746
+ const o = e.score, r = t.score;
1747
+ for (; n < o.length && n < r.length; ) {
1748
+ const s = Qs(o[n], r[n]);
1749
+ if (s)
1750
+ return s;
1751
+ n++;
1752
+ }
1753
+ if (Math.abs(r.length - o.length) === 1) {
1754
+ if (Mn(o))
1755
+ return 1;
1756
+ if (Mn(r))
1757
+ return -1;
1758
+ }
1759
+ return r.length - o.length;
1760
+ }
1761
+ function Mn(e) {
1762
+ const t = e[e.length - 1];
1763
+ return e.length > 0 && t[t.length - 1] < 0;
1764
+ }
1765
+ const Zs = {
1766
+ type: 0,
1767
+ value: ""
1768
+ }, ea = /[a-zA-Z0-9_]/;
1769
+ function ta(e) {
1770
+ if (!e)
1771
+ return [[]];
1772
+ if (e === "/")
1773
+ return [[Zs]];
1774
+ if (!e.startsWith("/"))
1775
+ throw new Error(process.env.NODE_ENV !== "production" ? `Route paths should start with a "/": "${e}" should be "/${e}".` : `Invalid path "${e}"`);
1776
+ function t(p) {
1777
+ throw new Error(`ERR (${n})/"${u}": ${p}`);
1778
+ }
1779
+ let n = 0, o = n;
1780
+ const r = [];
1781
+ let s;
1782
+ function i() {
1783
+ s && r.push(s), s = [];
1784
+ }
1785
+ let a = 0, c, u = "", l = "";
1786
+ function d() {
1787
+ u && (n === 0 ? s.push({
1788
+ type: 0,
1789
+ value: u
1790
+ }) : n === 1 || n === 2 || n === 3 ? (s.length > 1 && (c === "*" || c === "+") && t(`A repeatable param (${u}) must be alone in its segment. eg: '/:ids+.`), s.push({
1791
+ type: 1,
1792
+ value: u,
1793
+ regexp: l,
1794
+ repeatable: c === "*" || c === "+",
1795
+ optional: c === "*" || c === "?"
1796
+ })) : t("Invalid state to consume buffer"), u = "");
1797
+ }
1798
+ function f() {
1799
+ u += c;
1800
+ }
1801
+ for (; a < e.length; ) {
1802
+ if (c = e[a++], c === "\\" && n !== 2) {
1803
+ o = n, n = 4;
1804
+ continue;
1805
+ }
1806
+ switch (n) {
1807
+ case 0:
1808
+ c === "/" ? (u && d(), i()) : c === ":" ? (d(), n = 1) : f();
1809
+ break;
1810
+ case 4:
1811
+ f(), n = o;
1812
+ break;
1813
+ case 1:
1814
+ c === "(" ? n = 2 : ea.test(c) ? f() : (d(), n = 0, c !== "*" && c !== "?" && c !== "+" && a--);
1815
+ break;
1816
+ case 2:
1817
+ c === ")" ? l[l.length - 1] == "\\" ? l = l.slice(0, -1) + c : n = 3 : l += c;
1818
+ break;
1819
+ case 3:
1820
+ d(), n = 0, c !== "*" && c !== "?" && c !== "+" && a--, l = "";
1821
+ break;
1822
+ default:
1823
+ t("Unknown state");
1824
+ break;
1825
+ }
1826
+ }
1827
+ return n === 2 && t(`Unfinished custom RegExp for param "${u}"`), d(), i(), r;
1828
+ }
1829
+ function na(e, t, n) {
1830
+ const o = Ys(ta(e.path), n);
1831
+ if (process.env.NODE_ENV !== "production") {
1832
+ const s = /* @__PURE__ */ new Set();
1833
+ for (const i of o.keys)
1834
+ s.has(i.name) && N(`Found duplicated params with name "${i.name}" for path "${e.path}". Only the last one will be available on "$route.params".`), s.add(i.name);
1835
+ }
1836
+ const r = R(o, {
1837
+ record: e,
1838
+ parent: t,
1839
+ // these needs to be populated by the parent
1840
+ children: [],
1841
+ alias: []
1842
+ });
1843
+ return t && !r.record.aliasOf == !t.record.aliasOf && t.children.push(r), r;
1844
+ }
1845
+ function oa(e, t) {
1846
+ const n = [], o = /* @__PURE__ */ new Map();
1847
+ t = jn({ strict: !1, end: !0, sensitive: !1 }, t);
1848
+ function r(l) {
1849
+ return o.get(l);
1850
+ }
1851
+ function s(l, d, f) {
1852
+ const p = !f, m = ra(l);
1853
+ process.env.NODE_ENV !== "production" && ca(m, d), m.aliasOf = f && f.record;
1854
+ const v = jn(t, l), g = [
1855
+ m
1856
+ ];
1857
+ if ("alias" in l) {
1858
+ const V = typeof l.alias == "string" ? [l.alias] : l.alias;
1859
+ for (const W of V)
1860
+ g.push(R({}, m, {
1861
+ // this allows us to hold a copy of the `components` option
1862
+ // so that async components cache is hold on the original record
1863
+ components: f ? f.record.components : m.components,
1864
+ path: W,
1865
+ // we might be the child of an alias
1866
+ aliasOf: f ? f.record : m
1867
+ // the aliases are always of the same kind as the original since they
1868
+ // are defined on the same record
1869
+ }));
1870
+ }
1871
+ let S, O;
1872
+ for (const V of g) {
1873
+ const { path: W } = V;
1874
+ if (d && W[0] !== "/") {
1875
+ const Y = d.record.path, Q = Y[Y.length - 1] === "/" ? "" : "/";
1876
+ V.path = d.record.path + (W && Q + W);
1877
+ }
1878
+ if (process.env.NODE_ENV !== "production" && V.path === "*")
1879
+ throw new Error(`Catch all routes ("*") must now be defined using a param with a custom regexp.
1880
+ See more at https://next.router.vuejs.org/guide/migration/#removed-star-or-catch-all-routes.`);
1881
+ if (S = na(V, d, v), process.env.NODE_ENV !== "production" && d && W[0] === "/" && la(S, d), f ? (f.alias.push(S), process.env.NODE_ENV !== "production" && ia(f, S)) : (O = O || S, O !== S && O.alias.push(S), p && l.name && !Ln(S) && i(l.name)), m.children) {
1882
+ const Y = m.children;
1883
+ for (let Q = 0; Q < Y.length; Q++)
1884
+ s(Y[Q], S, f && f.children[Q]);
1885
+ }
1886
+ f = f || S, (S.record.components && Object.keys(S.record.components).length || S.record.name || S.record.redirect) && c(S);
1887
+ }
1888
+ return O ? () => {
1889
+ i(O);
1890
+ } : He;
1891
+ }
1892
+ function i(l) {
1893
+ if (To(l)) {
1894
+ const d = o.get(l);
1895
+ d && (o.delete(l), n.splice(n.indexOf(d), 1), d.children.forEach(i), d.alias.forEach(i));
1896
+ } else {
1897
+ const d = n.indexOf(l);
1898
+ d > -1 && (n.splice(d, 1), l.record.name && o.delete(l.record.name), l.children.forEach(i), l.alias.forEach(i));
1899
+ }
1900
+ }
1901
+ function a() {
1902
+ return n;
1903
+ }
1904
+ function c(l) {
1905
+ let d = 0;
1906
+ for (; d < n.length && Xs(l, n[d]) >= 0 && // Adding children with empty path should still appear before the parent
1907
+ // https://github.com/vuejs/router/issues/1124
1908
+ (l.record.path !== n[d].record.path || !Do(l, n[d])); )
1909
+ d++;
1910
+ n.splice(d, 0, l), l.record.name && !Ln(l) && o.set(l.record.name, l);
1911
+ }
1912
+ function u(l, d) {
1913
+ let f, p = {}, m, v;
1914
+ if ("name" in l && l.name) {
1915
+ if (f = o.get(l.name), !f)
1916
+ throw Te(1, {
1917
+ location: l
1918
+ });
1919
+ if (process.env.NODE_ENV !== "production") {
1920
+ const O = Object.keys(l.params || {}).filter((V) => !f.keys.find((W) => W.name === V));
1921
+ O.length && N(`Discarded invalid param(s) "${O.join('", "')}" when navigating. See https://github.com/vuejs/router/blob/main/packages/router/CHANGELOG.md#414-2022-08-22 for more details.`);
1922
+ }
1923
+ v = f.record.name, p = R(
1924
+ // paramsFromLocation is a new object
1925
+ Vn(
1926
+ d.params,
1927
+ // only keep params that exist in the resolved location
1928
+ // TODO: only keep optional params coming from a parent record
1929
+ f.keys.filter((O) => !O.optional).map((O) => O.name)
1930
+ ),
1931
+ // discard any existing params in the current location that do not exist here
1932
+ // #1497 this ensures better active/exact matching
1933
+ l.params && Vn(l.params, f.keys.map((O) => O.name))
1934
+ ), m = f.stringify(p);
1935
+ } else if ("path" in l)
1936
+ m = l.path, process.env.NODE_ENV !== "production" && !m.startsWith("/") && N(`The Matcher cannot resolve relative paths but received "${m}". Unless you directly called \`matcher.resolve("${m}")\`, this is probably a bug in vue-router. Please open an issue at https://github.com/vuejs/router/issues/new/choose.`), f = n.find((O) => O.re.test(m)), f && (p = f.parse(m), v = f.record.name);
1937
+ else {
1938
+ if (f = d.name ? o.get(d.name) : n.find((O) => O.re.test(d.path)), !f)
1939
+ throw Te(1, {
1940
+ location: l,
1941
+ currentLocation: d
1942
+ });
1943
+ v = f.record.name, p = R({}, d.params, l.params), m = f.stringify(p);
1944
+ }
1945
+ const g = [];
1946
+ let S = f;
1947
+ for (; S; )
1948
+ g.unshift(S.record), S = S.parent;
1949
+ return {
1950
+ name: v,
1951
+ path: m,
1952
+ params: p,
1953
+ matched: g,
1954
+ meta: aa(g)
1955
+ };
1956
+ }
1957
+ return e.forEach((l) => s(l)), { addRoute: s, resolve: u, removeRoute: i, getRoutes: a, getRecordMatcher: r };
1958
+ }
1959
+ function Vn(e, t) {
1960
+ const n = {};
1961
+ for (const o of t)
1962
+ o in e && (n[o] = e[o]);
1963
+ return n;
1964
+ }
1965
+ function ra(e) {
1966
+ return {
1967
+ path: e.path,
1968
+ redirect: e.redirect,
1969
+ name: e.name,
1970
+ meta: e.meta || {},
1971
+ aliasOf: void 0,
1972
+ beforeEnter: e.beforeEnter,
1973
+ props: sa(e),
1974
+ children: e.children || [],
1975
+ instances: {},
1976
+ leaveGuards: /* @__PURE__ */ new Set(),
1977
+ updateGuards: /* @__PURE__ */ new Set(),
1978
+ enterCallbacks: {},
1979
+ components: "components" in e ? e.components || null : e.component && { default: e.component }
1980
+ };
1981
+ }
1982
+ function sa(e) {
1983
+ const t = {}, n = e.props || !1;
1984
+ if ("component" in e)
1985
+ t.default = n;
1986
+ else
1987
+ for (const o in e.components)
1988
+ t[o] = typeof n == "object" ? n[o] : n;
1989
+ return t;
1990
+ }
1991
+ function Ln(e) {
1992
+ for (; e; ) {
1993
+ if (e.record.aliasOf)
1994
+ return !0;
1995
+ e = e.parent;
1996
+ }
1997
+ return !1;
1998
+ }
1999
+ function aa(e) {
2000
+ return e.reduce((t, n) => R(t, n.meta), {});
2001
+ }
2002
+ function jn(e, t) {
2003
+ const n = {};
2004
+ for (const o in e)
2005
+ n[o] = o in t ? t[o] : e[o];
2006
+ return n;
2007
+ }
2008
+ function Bt(e, t) {
2009
+ return e.name === t.name && e.optional === t.optional && e.repeatable === t.repeatable;
2010
+ }
2011
+ function ia(e, t) {
2012
+ for (const n of e.keys)
2013
+ if (!n.optional && !t.keys.find(Bt.bind(null, n)))
2014
+ return N(`Alias "${t.record.path}" and the original record: "${e.record.path}" must have the exact same param named "${n.name}"`);
2015
+ for (const n of t.keys)
2016
+ if (!n.optional && !e.keys.find(Bt.bind(null, n)))
2017
+ return N(`Alias "${t.record.path}" and the original record: "${e.record.path}" must have the exact same param named "${n.name}"`);
2018
+ }
2019
+ function ca(e, t) {
2020
+ t && t.record.name && !e.name && !e.path && N(`The route named "${String(t.record.name)}" has a child without a name and an empty path. Using that name won't render the empty path child so you probably want to move the name to the child instead. If this is intentional, add a name to the child route to remove the warning.`);
2021
+ }
2022
+ function la(e, t) {
2023
+ for (const n of t.keys)
2024
+ if (!e.keys.find(Bt.bind(null, n)))
2025
+ return N(`Absolute path "${e.record.path}" must have the exact same param named "${n.name}" as its parent "${t.record.path}".`);
2026
+ }
2027
+ function Do(e, t) {
2028
+ return t.children.some((n) => n === e || Do(e, n));
2029
+ }
2030
+ const Mo = /#/g, ua = /&/g, da = /\//g, fa = /=/g, pa = /\?/g, Vo = /\+/g, ha = /%5B/g, ma = /%5D/g, Lo = /%5E/g, va = /%60/g, jo = /%7B/g, ga = /%7C/g, Bo = /%7D/g, ya = /%20/g;
2031
+ function sn(e) {
2032
+ return encodeURI("" + e).replace(ga, "|").replace(ha, "[").replace(ma, "]");
2033
+ }
2034
+ function wa(e) {
2035
+ return sn(e).replace(jo, "{").replace(Bo, "}").replace(Lo, "^");
2036
+ }
2037
+ function Ut(e) {
2038
+ return sn(e).replace(Vo, "%2B").replace(ya, "+").replace(Mo, "%23").replace(ua, "%26").replace(va, "`").replace(jo, "{").replace(Bo, "}").replace(Lo, "^");
2039
+ }
2040
+ function _a(e) {
2041
+ return Ut(e).replace(fa, "%3D");
2042
+ }
2043
+ function ba(e) {
2044
+ return sn(e).replace(Mo, "%23").replace(pa, "%3F");
2045
+ }
2046
+ function Ea(e) {
2047
+ return e == null ? "" : ba(e).replace(da, "%2F");
2048
+ }
2049
+ function Qe(e) {
2050
+ try {
2051
+ return decodeURIComponent("" + e);
2052
+ } catch {
2053
+ process.env.NODE_ENV !== "production" && N(`Error decoding "${e}". Using original value`);
2054
+ }
2055
+ return "" + e;
2056
+ }
2057
+ function ka(e) {
2058
+ const t = {};
2059
+ if (e === "" || e === "?")
2060
+ return t;
2061
+ const o = (e[0] === "?" ? e.slice(1) : e).split("&");
2062
+ for (let r = 0; r < o.length; ++r) {
2063
+ const s = o[r].replace(Vo, " "), i = s.indexOf("="), a = Qe(i < 0 ? s : s.slice(0, i)), c = i < 0 ? null : Qe(s.slice(i + 1));
2064
+ if (a in t) {
2065
+ let u = t[a];
2066
+ K(u) || (u = t[a] = [u]), u.push(c);
2067
+ } else
2068
+ t[a] = c;
2069
+ }
2070
+ return t;
2071
+ }
2072
+ function Bn(e) {
2073
+ let t = "";
2074
+ for (let n in e) {
2075
+ const o = e[n];
2076
+ if (n = _a(n), o == null) {
2077
+ o !== void 0 && (t += (t.length ? "&" : "") + n);
2078
+ continue;
2079
+ }
2080
+ (K(o) ? o.map((s) => s && Ut(s)) : [o && Ut(o)]).forEach((s) => {
2081
+ s !== void 0 && (t += (t.length ? "&" : "") + n, s != null && (t += "=" + s));
2082
+ });
2083
+ }
2084
+ return t;
2085
+ }
2086
+ function Sa(e) {
2087
+ const t = {};
2088
+ for (const n in e) {
2089
+ const o = e[n];
2090
+ o !== void 0 && (t[n] = K(o) ? o.map((r) => r == null ? null : "" + r) : o == null ? o : "" + o);
2091
+ }
2092
+ return t;
2093
+ }
2094
+ const Ia = Symbol(process.env.NODE_ENV !== "production" ? "router view location matched" : ""), Un = Symbol(process.env.NODE_ENV !== "production" ? "router view depth" : ""), an = Symbol(process.env.NODE_ENV !== "production" ? "router" : ""), Uo = Symbol(process.env.NODE_ENV !== "production" ? "route location" : ""), Ht = Symbol(process.env.NODE_ENV !== "production" ? "router view location" : "");
2095
+ function Me() {
2096
+ let e = [];
2097
+ function t(o) {
2098
+ return e.push(o), () => {
2099
+ const r = e.indexOf(o);
2100
+ r > -1 && e.splice(r, 1);
2101
+ };
2102
+ }
2103
+ function n() {
2104
+ e = [];
2105
+ }
2106
+ return {
2107
+ add: t,
2108
+ list: () => e.slice(),
2109
+ reset: n
2110
+ };
2111
+ }
2112
+ function he(e, t, n, o, r) {
2113
+ const s = o && // name is defined if record is because of the function overload
2114
+ (o.enterCallbacks[r] = o.enterCallbacks[r] || []);
2115
+ return () => new Promise((i, a) => {
2116
+ const c = (d) => {
2117
+ d === !1 ? a(Te(4, {
2118
+ from: n,
2119
+ to: t
2120
+ })) : d instanceof Error ? a(d) : Fs(d) ? a(Te(2, {
2121
+ from: t,
2122
+ to: d
2123
+ })) : (s && // since enterCallbackArray is truthy, both record and name also are
2124
+ o.enterCallbacks[r] === s && typeof d == "function" && s.push(d), i());
2125
+ }, u = e.call(o && o.instances[r], t, n, process.env.NODE_ENV !== "production" ? Oa(c, t, n) : c);
2126
+ let l = Promise.resolve(u);
2127
+ if (e.length < 3 && (l = l.then(c)), process.env.NODE_ENV !== "production" && e.length > 2) {
2128
+ const d = `The "next" callback was never called inside of ${e.name ? '"' + e.name + '"' : ""}:
2129
+ ${e.toString()}
2130
+ . If you are returning a value instead of calling "next", make sure to remove the "next" parameter from your function.`;
2131
+ if (typeof u == "object" && "then" in u)
2132
+ l = l.then((f) => c._called ? f : (N(d), Promise.reject(new Error("Invalid navigation guard"))));
2133
+ else if (u !== void 0 && !c._called) {
2134
+ N(d), a(new Error("Invalid navigation guard"));
2135
+ return;
2136
+ }
2137
+ }
2138
+ l.catch((d) => a(d));
2139
+ });
2140
+ }
2141
+ function Oa(e, t, n) {
2142
+ let o = 0;
2143
+ return function() {
2144
+ o++ === 1 && N(`The "next" callback was called more than once in one navigation guard when going from "${n.fullPath}" to "${t.fullPath}". It should be called exactly one time in each navigation guard. This will fail in production.`), e._called = !0, o === 1 && e.apply(null, arguments);
2145
+ };
2146
+ }
2147
+ function xt(e, t, n, o) {
2148
+ const r = [];
2149
+ for (const s of e) {
2150
+ process.env.NODE_ENV !== "production" && !s.components && !s.children.length && N(`Record with path "${s.path}" is either missing a "component(s)" or "children" property.`);
2151
+ for (const i in s.components) {
2152
+ let a = s.components[i];
2153
+ if (process.env.NODE_ENV !== "production") {
2154
+ if (!a || typeof a != "object" && typeof a != "function")
2155
+ throw N(`Component "${i}" in record with path "${s.path}" is not a valid component. Received "${String(a)}".`), new Error("Invalid route component");
2156
+ if ("then" in a) {
2157
+ N(`Component "${i}" in record with path "${s.path}" is a Promise instead of a function that returns a Promise. Did you write "import('./MyPage.vue')" instead of "() => import('./MyPage.vue')" ? This will break in production if not fixed.`);
2158
+ const c = a;
2159
+ a = () => c;
2160
+ } else
2161
+ a.__asyncLoader && // warn only once per component
2162
+ !a.__warnedDefineAsync && (a.__warnedDefineAsync = !0, N(`Component "${i}" in record with path "${s.path}" is defined using "defineAsyncComponent()". Write "() => import('./MyPage.vue')" instead of "defineAsyncComponent(() => import('./MyPage.vue'))".`));
2163
+ }
2164
+ if (!(t !== "beforeRouteEnter" && !s.instances[i]))
2165
+ if (Pa(a)) {
2166
+ const u = (a.__vccOpts || a)[t];
2167
+ u && r.push(he(u, n, o, s, i));
2168
+ } else {
2169
+ let c = a();
2170
+ process.env.NODE_ENV !== "production" && !("catch" in c) && (N(`Component "${i}" in record with path "${s.path}" is a function that does not return a Promise. If you were passing a functional component, make sure to add a "displayName" to the component. This will break in production if not fixed.`), c = Promise.resolve(c)), r.push(() => c.then((u) => {
2171
+ if (!u)
2172
+ return Promise.reject(new Error(`Couldn't resolve component "${i}" at "${s.path}"`));
2173
+ const l = Ps(u) ? u.default : u;
2174
+ s.components[i] = l;
2175
+ const f = (l.__vccOpts || l)[t];
2176
+ return f && he(f, n, o, s, i)();
2177
+ }));
2178
+ }
2179
+ }
2180
+ }
2181
+ return r;
2182
+ }
2183
+ function Pa(e) {
2184
+ return typeof e == "object" || "displayName" in e || "props" in e || "__vccOpts" in e;
2185
+ }
2186
+ function Hn(e) {
2187
+ const t = ne(an), n = ne(Uo), o = L(() => t.resolve(E(e.to))), r = L(() => {
2188
+ const { matched: c } = o.value, { length: u } = c, l = c[u - 1], d = n.matched;
2189
+ if (!l || !d.length)
2190
+ return -1;
2191
+ const f = d.findIndex(ye.bind(null, l));
2192
+ if (f > -1)
2193
+ return f;
2194
+ const p = Wn(c[u - 2]);
2195
+ return (
2196
+ // we are dealing with nested routes
2197
+ u > 1 && // if the parent and matched route have the same path, this link is
2198
+ // referring to the empty child. Or we currently are on a different
2199
+ // child of the same parent
2200
+ Wn(l) === p && // avoid comparing the child with its parent
2201
+ d[d.length - 1].path !== p ? d.findIndex(ye.bind(null, c[u - 2])) : f
2202
+ );
2203
+ }), s = L(() => r.value > -1 && Ca(n.params, o.value.params)), i = L(() => r.value > -1 && r.value === n.matched.length - 1 && Ro(n.params, o.value.params));
2204
+ function a(c = {}) {
2205
+ return Na(c) ? t[E(e.replace) ? "replace" : "push"](
2206
+ E(e.to)
2207
+ // avoid uncaught errors are they are logged anyway
2208
+ ).catch(He) : Promise.resolve();
2209
+ }
2210
+ if (process.env.NODE_ENV !== "production" && ie) {
2211
+ const c = Yt();
2212
+ if (c) {
2213
+ const u = {
2214
+ route: o.value,
2215
+ isActive: s.value,
2216
+ isExactActive: i.value
2217
+ };
2218
+ c.__vrl_devtools = c.__vrl_devtools || [], c.__vrl_devtools.push(u), Sr(() => {
2219
+ u.route = o.value, u.isActive = s.value, u.isExactActive = i.value;
2220
+ }, { flush: "post" });
2221
+ }
2222
+ }
2223
+ return {
2224
+ route: o,
2225
+ href: L(() => o.value.href),
2226
+ isActive: s,
2227
+ isExactActive: i,
2228
+ navigate: a
2229
+ };
2230
+ }
2231
+ const xa = /* @__PURE__ */ Z({
2232
+ name: "RouterLink",
2233
+ compatConfig: { MODE: 3 },
2234
+ props: {
2235
+ to: {
2236
+ type: [String, Object],
2237
+ required: !0
2238
+ },
2239
+ replace: Boolean,
2240
+ activeClass: String,
2241
+ // inactiveClass: String,
2242
+ exactActiveClass: String,
2243
+ custom: Boolean,
2244
+ ariaCurrentValue: {
2245
+ type: String,
2246
+ default: "page"
2247
+ }
2248
+ },
2249
+ useLink: Hn,
2250
+ setup(e, { slots: t }) {
2251
+ const n = Ee(Hn(e)), { options: o } = ne(an), r = L(() => ({
2252
+ [Fn(e.activeClass, o.linkActiveClass, "router-link-active")]: n.isActive,
2253
+ // [getLinkClass(
2254
+ // props.inactiveClass,
2255
+ // options.linkInactiveClass,
2256
+ // 'router-link-inactive'
2257
+ // )]: !link.isExactActive,
2258
+ [Fn(e.exactActiveClass, o.linkExactActiveClass, "router-link-exact-active")]: n.isExactActive
2259
+ }));
2260
+ return () => {
2261
+ const s = t.default && t.default(n);
2262
+ return e.custom ? s : mo("a", {
2263
+ "aria-current": n.isExactActive ? e.ariaCurrentValue : null,
2264
+ href: n.href,
2265
+ // this would override user added attrs but Vue will still add
2266
+ // the listener, so we end up triggering both
2267
+ onClick: n.navigate,
2268
+ class: r.value
2269
+ }, s);
2270
+ };
2271
+ }
2272
+ }), $a = xa;
2273
+ function Na(e) {
2274
+ if (!(e.metaKey || e.altKey || e.ctrlKey || e.shiftKey) && !e.defaultPrevented && !(e.button !== void 0 && e.button !== 0)) {
2275
+ if (e.currentTarget && e.currentTarget.getAttribute) {
2276
+ const t = e.currentTarget.getAttribute("target");
2277
+ if (/\b_blank\b/i.test(t))
2278
+ return;
2279
+ }
2280
+ return e.preventDefault && e.preventDefault(), !0;
2281
+ }
2282
+ }
2283
+ function Ca(e, t) {
2284
+ for (const n in t) {
2285
+ const o = t[n], r = e[n];
2286
+ if (typeof o == "string") {
2287
+ if (o !== r)
2288
+ return !1;
2289
+ } else if (!K(r) || r.length !== o.length || o.some((s, i) => s !== r[i]))
2290
+ return !1;
2291
+ }
2292
+ return !0;
2293
+ }
2294
+ function Wn(e) {
2295
+ return e ? e.aliasOf ? e.aliasOf.path : e.path : "";
2296
+ }
2297
+ const Fn = (e, t, n) => e ?? t ?? n, Ra = /* @__PURE__ */ Z({
2298
+ name: "RouterView",
2299
+ // #674 we manually inherit them
2300
+ inheritAttrs: !1,
2301
+ props: {
2302
+ name: {
2303
+ type: String,
2304
+ default: "default"
2305
+ },
2306
+ route: Object
2307
+ },
2308
+ // Better compat for @vue/compat users
2309
+ // https://github.com/vuejs/router/issues/1315
2310
+ compatConfig: { MODE: 3 },
2311
+ setup(e, { attrs: t, slots: n }) {
2312
+ process.env.NODE_ENV !== "production" && Ta();
2313
+ const o = ne(Ht), r = L(() => e.route || o.value), s = ne(Un, 0), i = L(() => {
2314
+ let u = E(s);
2315
+ const { matched: l } = r.value;
2316
+ let d;
2317
+ for (; (d = l[u]) && !d.components; )
2318
+ u++;
2319
+ return u;
2320
+ }), a = L(() => r.value.matched[i.value]);
2321
+ ct(Un, L(() => i.value + 1)), ct(Ia, a), ct(Ht, r);
2322
+ const c = T();
2323
+ return J(() => [c.value, a.value, e.name], ([u, l, d], [f, p, m]) => {
2324
+ l && (l.instances[d] = u, p && p !== l && u && u === f && (l.leaveGuards.size || (l.leaveGuards = p.leaveGuards), l.updateGuards.size || (l.updateGuards = p.updateGuards))), u && l && // if there is no instance but to and from are the same this might be
2325
+ // the first visit
2326
+ (!p || !ye(l, p) || !f) && (l.enterCallbacks[d] || []).forEach((v) => v(u));
2327
+ }, { flush: "post" }), () => {
2328
+ const u = r.value, l = e.name, d = a.value, f = d && d.components[l];
2329
+ if (!f)
2330
+ return Gn(n.default, { Component: f, route: u });
2331
+ const p = d.props[l], m = p ? p === !0 ? u.params : typeof p == "function" ? p(u) : p : null, g = mo(f, R({}, m, t, {
2332
+ onVnodeUnmounted: (S) => {
2333
+ S.component.isUnmounted && (d.instances[l] = null);
2334
+ },
2335
+ ref: c
2336
+ }));
2337
+ if (process.env.NODE_ENV !== "production" && ie && g.ref) {
2338
+ const S = {
2339
+ depth: i.value,
2340
+ name: d.name,
2341
+ path: d.path,
2342
+ meta: d.meta
2343
+ };
2344
+ (K(g.ref) ? g.ref.map((V) => V.i) : [g.ref.i]).forEach((V) => {
2345
+ V.__vrv_devtools = S;
2346
+ });
2347
+ }
2348
+ return (
2349
+ // pass the vnode to the slot as a prop.
2350
+ // h and <component :is="..."> both accept vnodes
2351
+ Gn(n.default, { Component: g, route: u }) || g
2352
+ );
2353
+ };
2354
+ }
2355
+ });
2356
+ function Gn(e, t) {
2357
+ if (!e)
2358
+ return null;
2359
+ const n = e(t);
2360
+ return n.length === 1 ? n[0] : n;
2361
+ }
2362
+ const Aa = Ra;
2363
+ function Ta() {
2364
+ const e = Yt(), t = e.parent && e.parent.type.name, n = e.parent && e.parent.subTree && e.parent.subTree.type;
2365
+ if (t && (t === "KeepAlive" || t.includes("Transition")) && typeof n == "object" && n.name === "RouterView") {
2366
+ const o = t === "KeepAlive" ? "keep-alive" : "transition";
2367
+ N(`<router-view> can no longer be used directly inside <transition> or <keep-alive>.
2368
+ Use slot props instead:
2369
+
2370
+ <router-view v-slot="{ Component }">
2371
+ <${o}>
2372
+ <component :is="Component" />
2373
+ </${o}>
2374
+ </router-view>`);
2375
+ }
2376
+ }
2377
+ function Ve(e, t) {
2378
+ const n = R({}, e, {
2379
+ // remove variables that can contain vue instances
2380
+ matched: e.matched.map((o) => Wa(o, ["instances", "children", "aliasOf"]))
2381
+ });
2382
+ return {
2383
+ _custom: {
2384
+ type: null,
2385
+ readOnly: !0,
2386
+ display: e.fullPath,
2387
+ tooltip: t,
2388
+ value: n
2389
+ }
2390
+ };
2391
+ }
2392
+ function ot(e) {
2393
+ return {
2394
+ _custom: {
2395
+ display: e
2396
+ }
2397
+ };
2398
+ }
2399
+ let Da = 0;
2400
+ function Ma(e, t, n) {
2401
+ if (t.__hasDevtools)
2402
+ return;
2403
+ t.__hasDevtools = !0;
2404
+ const o = Da++;
2405
+ nn({
2406
+ id: "org.vuejs.router" + (o ? "." + o : ""),
2407
+ label: "Vue Router",
2408
+ packageName: "vue-router",
2409
+ homepage: "https://router.vuejs.org",
2410
+ logo: "https://router.vuejs.org/logo.png",
2411
+ componentStateTypes: ["Routing"],
2412
+ app: e
2413
+ }, (r) => {
2414
+ typeof r.now != "function" && console.warn("[Vue Router]: You seem to be using an outdated version of Vue Devtools. Are you still using the Beta release instead of the stable one? You can find the links at https://devtools.vuejs.org/guide/installation.html."), r.on.inspectComponent((l, d) => {
2415
+ l.instanceData && l.instanceData.state.push({
2416
+ type: "Routing",
2417
+ key: "$route",
2418
+ editable: !1,
2419
+ value: Ve(t.currentRoute.value, "Current Route")
2420
+ });
2421
+ }), r.on.visitComponentTree(({ treeNode: l, componentInstance: d }) => {
2422
+ if (d.__vrv_devtools) {
2423
+ const f = d.__vrv_devtools;
2424
+ l.tags.push({
2425
+ label: (f.name ? `${f.name.toString()}: ` : "") + f.path,
2426
+ textColor: 0,
2427
+ tooltip: "This component is rendered by &lt;router-view&gt;",
2428
+ backgroundColor: Ho
2429
+ });
2430
+ }
2431
+ K(d.__vrl_devtools) && (d.__devtoolsApi = r, d.__vrl_devtools.forEach((f) => {
2432
+ let p = Go, m = "";
2433
+ f.isExactActive ? (p = Fo, m = "This is exactly active") : f.isActive && (p = Wo, m = "This link is active"), l.tags.push({
2434
+ label: f.route.path,
2435
+ textColor: 0,
2436
+ tooltip: m,
2437
+ backgroundColor: p
2438
+ });
2439
+ }));
2440
+ }), J(t.currentRoute, () => {
2441
+ c(), r.notifyComponentUpdate(), r.sendInspectorTree(a), r.sendInspectorState(a);
2442
+ });
2443
+ const s = "router:navigations:" + o;
2444
+ r.addTimelineLayer({
2445
+ id: s,
2446
+ label: `Router${o ? " " + o : ""} Navigations`,
2447
+ color: 4237508
2448
+ }), t.onError((l, d) => {
2449
+ r.addTimelineEvent({
2450
+ layerId: s,
2451
+ event: {
2452
+ title: "Error during Navigation",
2453
+ subtitle: d.fullPath,
2454
+ logType: "error",
2455
+ time: r.now(),
2456
+ data: { error: l },
2457
+ groupId: d.meta.__navigationId
2458
+ }
2459
+ });
2460
+ });
2461
+ let i = 0;
2462
+ t.beforeEach((l, d) => {
2463
+ const f = {
2464
+ guard: ot("beforeEach"),
2465
+ from: Ve(d, "Current Location during this navigation"),
2466
+ to: Ve(l, "Target location")
2467
+ };
2468
+ Object.defineProperty(l.meta, "__navigationId", {
2469
+ value: i++
2470
+ }), r.addTimelineEvent({
2471
+ layerId: s,
2472
+ event: {
2473
+ time: r.now(),
2474
+ title: "Start of navigation",
2475
+ subtitle: l.fullPath,
2476
+ data: f,
2477
+ groupId: l.meta.__navigationId
2478
+ }
2479
+ });
2480
+ }), t.afterEach((l, d, f) => {
2481
+ const p = {
2482
+ guard: ot("afterEach")
2483
+ };
2484
+ f ? (p.failure = {
2485
+ _custom: {
2486
+ type: Error,
2487
+ readOnly: !0,
2488
+ display: f ? f.message : "",
2489
+ tooltip: "Navigation Failure",
2490
+ value: f
2491
+ }
2492
+ }, p.status = ot("❌")) : p.status = ot("✅"), p.from = Ve(d, "Current Location during this navigation"), p.to = Ve(l, "Target location"), r.addTimelineEvent({
2493
+ layerId: s,
2494
+ event: {
2495
+ title: "End of navigation",
2496
+ subtitle: l.fullPath,
2497
+ time: r.now(),
2498
+ data: p,
2499
+ logType: f ? "warning" : "default",
2500
+ groupId: l.meta.__navigationId
2501
+ }
2502
+ });
2503
+ });
2504
+ const a = "router-inspector:" + o;
2505
+ r.addInspector({
2506
+ id: a,
2507
+ label: "Routes" + (o ? " " + o : ""),
2508
+ icon: "book",
2509
+ treeFilterPlaceholder: "Search routes"
2510
+ });
2511
+ function c() {
2512
+ if (!u)
2513
+ return;
2514
+ const l = u;
2515
+ let d = n.getRoutes().filter((f) => !f.parent || // these routes have a parent with no component which will not appear in the view
2516
+ // therefore we still need to include them
2517
+ !f.parent.record.components);
2518
+ d.forEach(Ko), l.filter && (d = d.filter((f) => (
2519
+ // save matches state based on the payload
2520
+ Wt(f, l.filter.toLowerCase())
2521
+ ))), d.forEach((f) => qo(f, t.currentRoute.value)), l.rootNodes = d.map(zo);
2522
+ }
2523
+ let u;
2524
+ r.on.getInspectorTree((l) => {
2525
+ u = l, l.app === e && l.inspectorId === a && c();
2526
+ }), r.on.getInspectorState((l) => {
2527
+ if (l.app === e && l.inspectorId === a) {
2528
+ const f = n.getRoutes().find((p) => p.record.__vd_id === l.nodeId);
2529
+ f && (l.state = {
2530
+ options: La(f)
2531
+ });
2532
+ }
2533
+ }), r.sendInspectorTree(a), r.sendInspectorState(a);
2534
+ });
2535
+ }
2536
+ function Va(e) {
2537
+ return e.optional ? e.repeatable ? "*" : "?" : e.repeatable ? "+" : "";
2538
+ }
2539
+ function La(e) {
2540
+ const { record: t } = e, n = [
2541
+ { editable: !1, key: "path", value: t.path }
2542
+ ];
2543
+ return t.name != null && n.push({
2544
+ editable: !1,
2545
+ key: "name",
2546
+ value: t.name
2547
+ }), n.push({ editable: !1, key: "regexp", value: e.re }), e.keys.length && n.push({
2548
+ editable: !1,
2549
+ key: "keys",
2550
+ value: {
2551
+ _custom: {
2552
+ type: null,
2553
+ readOnly: !0,
2554
+ display: e.keys.map((o) => `${o.name}${Va(o)}`).join(" "),
2555
+ tooltip: "Param keys",
2556
+ value: e.keys
2557
+ }
2558
+ }
2559
+ }), t.redirect != null && n.push({
2560
+ editable: !1,
2561
+ key: "redirect",
2562
+ value: t.redirect
2563
+ }), e.alias.length && n.push({
2564
+ editable: !1,
2565
+ key: "aliases",
2566
+ value: e.alias.map((o) => o.record.path)
2567
+ }), Object.keys(e.record.meta).length && n.push({
2568
+ editable: !1,
2569
+ key: "meta",
2570
+ value: e.record.meta
2571
+ }), n.push({
2572
+ key: "score",
2573
+ editable: !1,
2574
+ value: {
2575
+ _custom: {
2576
+ type: null,
2577
+ readOnly: !0,
2578
+ display: e.score.map((o) => o.join(", ")).join(" | "),
2579
+ tooltip: "Score used to sort routes",
2580
+ value: e.score
2581
+ }
2582
+ }
2583
+ }), n;
2584
+ }
2585
+ const Ho = 15485081, Wo = 2450411, Fo = 8702998, ja = 2282478, Go = 16486972, Ba = 6710886;
2586
+ function zo(e) {
2587
+ const t = [], { record: n } = e;
2588
+ n.name != null && t.push({
2589
+ label: String(n.name),
2590
+ textColor: 0,
2591
+ backgroundColor: ja
2592
+ }), n.aliasOf && t.push({
2593
+ label: "alias",
2594
+ textColor: 0,
2595
+ backgroundColor: Go
2596
+ }), e.__vd_match && t.push({
2597
+ label: "matches",
2598
+ textColor: 0,
2599
+ backgroundColor: Ho
2600
+ }), e.__vd_exactActive && t.push({
2601
+ label: "exact",
2602
+ textColor: 0,
2603
+ backgroundColor: Fo
2604
+ }), e.__vd_active && t.push({
2605
+ label: "active",
2606
+ textColor: 0,
2607
+ backgroundColor: Wo
2608
+ }), n.redirect && t.push({
2609
+ label: typeof n.redirect == "string" ? `redirect: ${n.redirect}` : "redirects",
2610
+ textColor: 16777215,
2611
+ backgroundColor: Ba
2612
+ });
2613
+ let o = n.__vd_id;
2614
+ return o == null && (o = String(Ua++), n.__vd_id = o), {
2615
+ id: o,
2616
+ label: n.path,
2617
+ tags: t,
2618
+ children: e.children.map(zo)
2619
+ };
2620
+ }
2621
+ let Ua = 0;
2622
+ const Ha = /^\/(.*)\/([a-z]*)$/;
2623
+ function qo(e, t) {
2624
+ const n = t.matched.length && ye(t.matched[t.matched.length - 1], e.record);
2625
+ e.__vd_exactActive = e.__vd_active = n, n || (e.__vd_active = t.matched.some((o) => ye(o, e.record))), e.children.forEach((o) => qo(o, t));
2626
+ }
2627
+ function Ko(e) {
2628
+ e.__vd_match = !1, e.children.forEach(Ko);
2629
+ }
2630
+ function Wt(e, t) {
2631
+ const n = String(e.re).match(Ha);
2632
+ if (e.__vd_match = !1, !n || n.length < 3)
2633
+ return !1;
2634
+ if (new RegExp(n[1].replace(/\$$/, ""), n[2]).test(t))
2635
+ return e.children.forEach((i) => Wt(i, t)), e.record.path !== "/" || t === "/" ? (e.__vd_match = e.re.test(t), !0) : !1;
2636
+ const r = e.record.path.toLowerCase(), s = Qe(r);
2637
+ return !t.startsWith("/") && (s.includes(t) || r.includes(t)) || s.startsWith(t) || r.startsWith(t) || e.record.name && String(e.record.name).includes(t) ? !0 : e.children.some((i) => Wt(i, t));
2638
+ }
2639
+ function Wa(e, t) {
2640
+ const n = {};
2641
+ for (const o in e)
2642
+ t.includes(o) || (n[o] = e[o]);
2643
+ return n;
2644
+ }
2645
+ function Fa(e) {
2646
+ const t = oa(e.routes, e), n = e.parseQuery || ka, o = e.stringifyQuery || Bn, r = e.history;
2647
+ if (process.env.NODE_ENV !== "production" && !r)
2648
+ throw new Error('Provide the "history" option when calling "createRouter()": https://next.router.vuejs.org/api/#history.');
2649
+ const s = Me(), i = Me(), a = Me(), c = br(pe);
2650
+ let u = pe;
2651
+ ie && e.scrollBehavior && "scrollRestoration" in history && (history.scrollRestoration = "manual");
2652
+ const l = Ot.bind(null, (h) => "" + h), d = Ot.bind(null, Ea), f = (
2653
+ // @ts-expect-error: intentionally avoid the type check
2654
+ Ot.bind(null, Qe)
2655
+ );
2656
+ function p(h, w) {
2657
+ let y, b;
2658
+ return To(h) ? (y = t.getRecordMatcher(h), b = w) : b = h, t.addRoute(b, y);
2659
+ }
2660
+ function m(h) {
2661
+ const w = t.getRecordMatcher(h);
2662
+ w ? t.removeRoute(w) : process.env.NODE_ENV !== "production" && N(`Cannot remove non-existent route "${String(h)}"`);
2663
+ }
2664
+ function v() {
2665
+ return t.getRoutes().map((h) => h.record);
2666
+ }
2667
+ function g(h) {
2668
+ return !!t.getRecordMatcher(h);
2669
+ }
2670
+ function S(h, w) {
2671
+ if (w = R({}, w || c.value), typeof h == "string") {
2672
+ const P = Pt(n, h, w.path), j = t.resolve({ path: P.path }, w), _e = r.createHref(P.fullPath);
2673
+ return process.env.NODE_ENV !== "production" && (_e.startsWith("//") ? N(`Location "${h}" resolved to "${_e}". A resolved location cannot start with multiple slashes.`) : j.matched.length || N(`No match found for location with path "${h}"`)), R(P, j, {
2674
+ params: f(j.params),
2675
+ hash: Qe(P.hash),
2676
+ redirectedFrom: void 0,
2677
+ href: _e
2678
+ });
2679
+ }
2680
+ let y;
2681
+ if ("path" in h)
2682
+ process.env.NODE_ENV !== "production" && "params" in h && !("name" in h) && // @ts-expect-error: the type is never
2683
+ Object.keys(h.params).length && N(`Path "${h.path}" was passed with params but they will be ignored. Use a named route alongside params instead.`), y = R({}, h, {
2684
+ path: Pt(n, h.path, w.path).path
2685
+ });
2686
+ else {
2687
+ const P = R({}, h.params);
2688
+ for (const j in P)
2689
+ P[j] == null && delete P[j];
2690
+ y = R({}, h, {
2691
+ params: d(P)
2692
+ }), w.params = d(w.params);
2693
+ }
2694
+ const b = t.resolve(y, w), C = h.hash || "";
2695
+ process.env.NODE_ENV !== "production" && C && !C.startsWith("#") && N(`A \`hash\` should always start with the character "#". Replace "${C}" with "#${C}".`), b.params = l(f(b.params));
2696
+ const B = Ns(o, R({}, h, {
2697
+ hash: wa(C),
2698
+ path: b.path
2699
+ })), $ = r.createHref(B);
2700
+ return process.env.NODE_ENV !== "production" && ($.startsWith("//") ? N(`Location "${h}" resolved to "${$}". A resolved location cannot start with multiple slashes.`) : b.matched.length || N(`No match found for location with path "${"path" in h ? h.path : h}"`)), R({
2701
+ fullPath: B,
2702
+ // keep the hash encoded so fullPath is effectively path + encodedQuery +
2703
+ // hash
2704
+ hash: C,
2705
+ query: (
2706
+ // if the user is using a custom query lib like qs, we might have
2707
+ // nested objects, so we keep the query as is, meaning it can contain
2708
+ // numbers at `$route.query`, but at the point, the user will have to
2709
+ // use their own type anyway.
2710
+ // https://github.com/vuejs/router/issues/328#issuecomment-649481567
2711
+ o === Bn ? Sa(h.query) : h.query || {}
2712
+ )
2713
+ }, b, {
2714
+ redirectedFrom: void 0,
2715
+ href: $
2716
+ });
2717
+ }
2718
+ function O(h) {
2719
+ return typeof h == "string" ? Pt(n, h, c.value.path) : R({}, h);
2720
+ }
2721
+ function V(h, w) {
2722
+ if (u !== h)
2723
+ return Te(8, {
2724
+ from: w,
2725
+ to: h
2726
+ });
2727
+ }
2728
+ function W(h) {
2729
+ return I(h);
2730
+ }
2731
+ function Y(h) {
2732
+ return W(R(O(h), { replace: !0 }));
2733
+ }
2734
+ function Q(h) {
2735
+ const w = h.matched[h.matched.length - 1];
2736
+ if (w && w.redirect) {
2737
+ const { redirect: y } = w;
2738
+ let b = typeof y == "function" ? y(h) : y;
2739
+ if (typeof b == "string" && (b = b.includes("?") || b.includes("#") ? b = O(b) : (
2740
+ // force empty params
2741
+ { path: b }
2742
+ ), b.params = {}), process.env.NODE_ENV !== "production" && !("path" in b) && !("name" in b))
2743
+ throw N(`Invalid redirect found:
2744
+ ${JSON.stringify(b, null, 2)}
2745
+ when navigating to "${h.fullPath}". A redirect must contain a name or path. This will break in production.`), new Error("Invalid redirect");
2746
+ return R({
2747
+ query: h.query,
2748
+ hash: h.hash,
2749
+ // avoid transferring params if the redirect has a path
2750
+ params: "path" in b ? {} : h.params
2751
+ }, b);
2752
+ }
2753
+ }
2754
+ function I(h, w) {
2755
+ const y = u = S(h), b = c.value, C = h.state, B = h.force, $ = h.replace === !0, P = Q(y);
2756
+ if (P)
2757
+ return I(
2758
+ R(O(P), {
2759
+ state: typeof P == "object" ? R({}, C, P.state) : C,
2760
+ force: B,
2761
+ replace: $
2762
+ }),
2763
+ // keep original redirectedFrom if it exists
2764
+ w || y
2765
+ );
2766
+ const j = y;
2767
+ j.redirectedFrom = w;
2768
+ let _e;
2769
+ return !B && Nn(o, b, y) && (_e = Te(16, { to: j, from: b }), En(
2770
+ b,
2771
+ b,
2772
+ // this is a push, the only way for it to be triggered from a
2773
+ // history.listen is with a redirect, which makes it become a push
2774
+ !0,
2775
+ // This cannot be the first navigation because the initial location
2776
+ // cannot be manually navigated to
2777
+ !1
2778
+ )), (_e ? Promise.resolve(_e) : k(j, b)).catch((q) => ae(q) ? (
2779
+ // navigation redirects still mark the router as ready
2780
+ ae(
2781
+ q,
2782
+ 2
2783
+ /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
2784
+ ) ? q : Et(q)
2785
+ ) : (
2786
+ // reject any unknown error
2787
+ G(q, j, b)
2788
+ )).then((q) => {
2789
+ if (q) {
2790
+ if (ae(
2791
+ q,
2792
+ 2
2793
+ /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
2794
+ ))
2795
+ return process.env.NODE_ENV !== "production" && // we are redirecting to the same location we were already at
2796
+ Nn(o, S(q.to), j) && // and we have done it a couple of times
2797
+ w && // @ts-expect-error: added only in dev
2798
+ (w._count = w._count ? (
2799
+ // @ts-expect-error
2800
+ w._count + 1
2801
+ ) : 1) > 30 ? (N(`Detected a possibly infinite redirection in a navigation guard when going from "${b.fullPath}" to "${j.fullPath}". Aborting to avoid a Stack Overflow.
2802
+ Are you always returning a new location within a navigation guard? That would lead to this error. Only return when redirecting or aborting, that should fix this. This might break in production if not fixed.`), Promise.reject(new Error("Infinite redirect in navigation guard"))) : I(
2803
+ // keep options
2804
+ R({
2805
+ // preserve an existing replacement but allow the redirect to override it
2806
+ replace: $
2807
+ }, O(q.to), {
2808
+ state: typeof q.to == "object" ? R({}, C, q.to.state) : C,
2809
+ force: B
2810
+ }),
2811
+ // preserve the original redirectedFrom if any
2812
+ w || j
2813
+ );
2814
+ } else
2815
+ q = M(j, b, !0, $, C);
2816
+ return _(j, b, q), q;
2817
+ });
2818
+ }
2819
+ function bn(h, w) {
2820
+ const y = V(h, w);
2821
+ return y ? Promise.reject(y) : Promise.resolve();
2822
+ }
2823
+ function ee(h) {
2824
+ const w = et.values().next().value;
2825
+ return w && typeof w.runWithContext == "function" ? w.runWithContext(h) : h();
2826
+ }
2827
+ function k(h, w) {
2828
+ let y;
2829
+ const [b, C, B] = Ga(h, w);
2830
+ y = xt(b.reverse(), "beforeRouteLeave", h, w);
2831
+ for (const P of b)
2832
+ P.leaveGuards.forEach((j) => {
2833
+ y.push(he(j, h, w));
2834
+ });
2835
+ const $ = bn.bind(null, h, w);
2836
+ return y.push($), $e(y).then(() => {
2837
+ y = [];
2838
+ for (const P of s.list())
2839
+ y.push(he(P, h, w));
2840
+ return y.push($), $e(y);
2841
+ }).then(() => {
2842
+ y = xt(C, "beforeRouteUpdate", h, w);
2843
+ for (const P of C)
2844
+ P.updateGuards.forEach((j) => {
2845
+ y.push(he(j, h, w));
2846
+ });
2847
+ return y.push($), $e(y);
2848
+ }).then(() => {
2849
+ y = [];
2850
+ for (const P of B)
2851
+ if (P.beforeEnter)
2852
+ if (K(P.beforeEnter))
2853
+ for (const j of P.beforeEnter)
2854
+ y.push(he(j, h, w));
2855
+ else
2856
+ y.push(he(P.beforeEnter, h, w));
2857
+ return y.push($), $e(y);
2858
+ }).then(() => (h.matched.forEach((P) => P.enterCallbacks = {}), y = xt(B, "beforeRouteEnter", h, w), y.push($), $e(y))).then(() => {
2859
+ y = [];
2860
+ for (const P of i.list())
2861
+ y.push(he(P, h, w));
2862
+ return y.push($), $e(y);
2863
+ }).catch((P) => ae(
2864
+ P,
2865
+ 8
2866
+ /* ErrorTypes.NAVIGATION_CANCELLED */
2867
+ ) ? P : Promise.reject(P));
2868
+ }
2869
+ function _(h, w, y) {
2870
+ a.list().forEach((b) => ee(() => b(h, w, y)));
2871
+ }
2872
+ function M(h, w, y, b, C) {
2873
+ const B = V(h, w);
2874
+ if (B)
2875
+ return B;
2876
+ const $ = w === pe, P = ie ? history.state : {};
2877
+ y && (b || $ ? r.replace(h.fullPath, R({
2878
+ scroll: $ && P && P.scroll
2879
+ }, C)) : r.push(h.fullPath, C)), c.value = h, En(h, w, y, $), Et();
2880
+ }
2881
+ let U;
2882
+ function we() {
2883
+ U || (U = r.listen((h, w, y) => {
2884
+ const b = S(h), C = Q(b);
2885
+ if (C) {
2886
+ I(R(C, { replace: !0 }), b).catch(He);
2887
+ return;
2888
+ }
2889
+ u = b;
2890
+ const B = c.value;
2891
+ ie && Ls(Rn(B.fullPath, y.delta), wt()), k(b, B).catch(($) => ae(
2892
+ $,
2893
+ 12
2894
+ /* ErrorTypes.NAVIGATION_CANCELLED */
2895
+ ) ? $ : ae(
2896
+ $,
2897
+ 2
2898
+ /* ErrorTypes.NAVIGATION_GUARD_REDIRECT */
2899
+ ) ? (I(
2900
+ $.to,
2901
+ b
2902
+ // avoid an uncaught rejection, let push call triggerError
2903
+ ).then((P) => {
2904
+ ae(
2905
+ P,
2906
+ 20
2907
+ /* ErrorTypes.NAVIGATION_DUPLICATED */
2908
+ ) && !y.delta && y.type === Ye.pop && r.go(-1, !1);
2909
+ }).catch(He), Promise.reject()) : (y.delta && r.go(-y.delta, !1), G($, b, B))).then(($) => {
2910
+ $ = $ || M(
2911
+ // after navigation, all matched components are resolved
2912
+ b,
2913
+ B,
2914
+ !1
2915
+ ), $ && (y.delta && // a new navigation has been triggered, so we do not want to revert, that will change the current history
2916
+ // entry while a different route is displayed
2917
+ !ae(
2918
+ $,
2919
+ 8
2920
+ /* ErrorTypes.NAVIGATION_CANCELLED */
2921
+ ) ? r.go(-y.delta, !1) : y.type === Ye.pop && ae(
2922
+ $,
2923
+ 20
2924
+ /* ErrorTypes.NAVIGATION_DUPLICATED */
2925
+ ) && r.go(-1, !1)), _(b, B, $);
2926
+ }).catch(He);
2927
+ }));
2928
+ }
2929
+ let De = Me(), Ze = Me(), oe;
2930
+ function G(h, w, y) {
2931
+ Et(h);
2932
+ const b = Ze.list();
2933
+ return b.length ? b.forEach((C) => C(h, w, y)) : (process.env.NODE_ENV !== "production" && N("uncaught error during route navigation:"), console.error(h)), Promise.reject(h);
2934
+ }
2935
+ function yr() {
2936
+ return oe && c.value !== pe ? Promise.resolve() : new Promise((h, w) => {
2937
+ De.add([h, w]);
2938
+ });
2939
+ }
2940
+ function Et(h) {
2941
+ return oe || (oe = !h, we(), De.list().forEach(([w, y]) => h ? y(h) : w()), De.reset()), h;
2942
+ }
2943
+ function En(h, w, y, b) {
2944
+ const { scrollBehavior: C } = e;
2945
+ if (!ie || !C)
2946
+ return Promise.resolve();
2947
+ const B = !y && js(Rn(h.fullPath, 0)) || (b || !y) && history.state && history.state.scroll || null;
2948
+ return Ke().then(() => C(h, w, B)).then(($) => $ && Vs($)).catch(($) => G($, h, w));
2949
+ }
2950
+ const kt = (h) => r.go(h);
2951
+ let St;
2952
+ const et = /* @__PURE__ */ new Set(), wr = {
2953
+ currentRoute: c,
2954
+ listening: !0,
2955
+ addRoute: p,
2956
+ removeRoute: m,
2957
+ hasRoute: g,
2958
+ getRoutes: v,
2959
+ resolve: S,
2960
+ options: e,
2961
+ push: W,
2962
+ replace: Y,
2963
+ go: kt,
2964
+ back: () => kt(-1),
2965
+ forward: () => kt(1),
2966
+ beforeEach: s.add,
2967
+ beforeResolve: i.add,
2968
+ afterEach: a.add,
2969
+ onError: Ze.add,
2970
+ isReady: yr,
2971
+ install(h) {
2972
+ const w = this;
2973
+ h.component("RouterLink", $a), h.component("RouterView", Aa), h.config.globalProperties.$router = w, Object.defineProperty(h.config.globalProperties, "$route", {
2974
+ enumerable: !0,
2975
+ get: () => E(c)
2976
+ }), ie && // used for the initial navigation client side to avoid pushing
2977
+ // multiple times when the router is used in multiple apps
2978
+ !St && c.value === pe && (St = !0, W(r.location).catch((C) => {
2979
+ process.env.NODE_ENV !== "production" && N("Unexpected error when starting the router:", C);
2980
+ }));
2981
+ const y = {};
2982
+ for (const C in pe)
2983
+ Object.defineProperty(y, C, {
2984
+ get: () => c.value[C],
2985
+ enumerable: !0
2986
+ });
2987
+ h.provide(an, w), h.provide(Uo, kr(y)), h.provide(Ht, c);
2988
+ const b = h.unmount;
2989
+ et.add(h), h.unmount = function() {
2990
+ et.delete(h), et.size < 1 && (u = pe, U && U(), U = null, c.value = pe, St = !1, oe = !1), b();
2991
+ }, process.env.NODE_ENV !== "production" && ie && Ma(h, w, t);
2992
+ }
2993
+ };
2994
+ function $e(h) {
2995
+ return h.reduce((w, y) => w.then(() => ee(y)), Promise.resolve());
2996
+ }
2997
+ return wr;
2998
+ }
2999
+ function Ga(e, t) {
3000
+ const n = [], o = [], r = [], s = Math.max(t.matched.length, e.matched.length);
3001
+ for (let i = 0; i < s; i++) {
3002
+ const a = t.matched[i];
3003
+ a && (e.matched.find((u) => ye(u, a)) ? o.push(a) : n.push(a));
3004
+ const c = e.matched[i];
3005
+ c && (t.matched.find((u) => ye(u, c)) || r.push(c));
3006
+ }
3007
+ return [n, o, r];
3008
+ }
3009
+ Fa({
3010
+ history: Ws(),
3011
+ routes: []
3012
+ });
3013
+ function za(e) {
3014
+ return e && typeof e.then == "function";
3015
+ }
3016
+ Promise.resolve(!1);
3017
+ Promise.resolve(!0);
3018
+ var Ie = Promise.resolve();
3019
+ function Jo(e, t) {
3020
+ return e || (e = 0), new Promise(function(n) {
3021
+ return setTimeout(function() {
3022
+ return n(t);
3023
+ }, e);
3024
+ });
3025
+ }
3026
+ function qa(e, t) {
3027
+ return Math.floor(Math.random() * (t - e + 1) + e);
3028
+ }
3029
+ function cn() {
3030
+ return Math.random().toString(36).substring(2);
3031
+ }
3032
+ var zn = 0, $t = 0;
3033
+ function _t() {
3034
+ var e = (/* @__PURE__ */ new Date()).getTime();
3035
+ return e === zn ? ($t++, e * 1e3 + $t) : (zn = e, $t = 0, e * 1e3);
3036
+ }
3037
+ var Ka = _t, Ja = "native";
3038
+ function Ya(e) {
3039
+ var t = {
3040
+ messagesCallback: null,
3041
+ bc: new BroadcastChannel(e),
3042
+ subFns: []
3043
+ // subscriberFunctions
3044
+ };
3045
+ return t.bc.onmessage = function(n) {
3046
+ t.messagesCallback && t.messagesCallback(n.data);
3047
+ }, t;
3048
+ }
3049
+ function Qa(e) {
3050
+ e.bc.close(), e.subFns = [];
3051
+ }
3052
+ function Xa(e, t) {
3053
+ try {
3054
+ return e.bc.postMessage(t, !1), Ie;
3055
+ } catch (n) {
3056
+ return Promise.reject(n);
3057
+ }
3058
+ }
3059
+ function Za(e, t) {
3060
+ e.messagesCallback = t;
3061
+ }
3062
+ function ei() {
3063
+ if (typeof window > "u")
3064
+ return !1;
3065
+ if (typeof BroadcastChannel == "function") {
3066
+ if (BroadcastChannel._pubkey)
3067
+ throw new Error("BroadcastChannel: Do not overwrite window.BroadcastChannel with this module, this is not a polyfill");
3068
+ return !0;
3069
+ } else
3070
+ return !1;
3071
+ }
3072
+ function ti() {
3073
+ return 150;
3074
+ }
3075
+ var ni = {
3076
+ create: Ya,
3077
+ close: Qa,
3078
+ onMessage: Za,
3079
+ postMessage: Xa,
3080
+ canBeUsed: ei,
3081
+ type: Ja,
3082
+ averageResponseTime: ti,
3083
+ microSeconds: Ka
3084
+ }, Yo = (
3085
+ /** @class */
3086
+ function() {
3087
+ function e(t) {
3088
+ this.ttl = t, this.map = /* @__PURE__ */ new Map(), this._to = !1;
3089
+ }
3090
+ return e.prototype.has = function(t) {
3091
+ return this.map.has(t);
3092
+ }, e.prototype.add = function(t) {
3093
+ var n = this;
3094
+ this.map.set(t, Qo()), this._to || (this._to = !0, setTimeout(function() {
3095
+ n._to = !1, oi(n);
3096
+ }, 0));
3097
+ }, e.prototype.clear = function() {
3098
+ this.map.clear();
3099
+ }, e;
3100
+ }()
3101
+ );
3102
+ function oi(e) {
3103
+ for (var t = Qo() - e.ttl, n = e.map[Symbol.iterator](); ; ) {
3104
+ var o = n.next().value;
3105
+ if (!o)
3106
+ return;
3107
+ var r = o[0], s = o[1];
3108
+ if (s < t)
3109
+ e.map.delete(r);
3110
+ else
3111
+ return;
3112
+ }
3113
+ }
3114
+ function Qo() {
3115
+ return (/* @__PURE__ */ new Date()).getTime();
3116
+ }
3117
+ function ln() {
3118
+ var e = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}, t = JSON.parse(JSON.stringify(e));
3119
+ return typeof t.webWorkerSupport > "u" && (t.webWorkerSupport = !0), t.idb || (t.idb = {}), t.idb.ttl || (t.idb.ttl = 1e3 * 45), t.idb.fallbackInterval || (t.idb.fallbackInterval = 150), e.idb && typeof e.idb.onclose == "function" && (t.idb.onclose = e.idb.onclose), t.localstorage || (t.localstorage = {}), t.localstorage.removeTimeout || (t.localstorage.removeTimeout = 1e3 * 60), e.methods && (t.methods = e.methods), t.node || (t.node = {}), t.node.ttl || (t.node.ttl = 1e3 * 60 * 2), t.node.maxParallelWrites || (t.node.maxParallelWrites = 2048), typeof t.node.useFastPath > "u" && (t.node.useFastPath = !0), t;
3120
+ }
3121
+ var ri = _t, si = "pubkey.broadcast-channel-0-", ue = "messages", bt = {
3122
+ durability: "relaxed"
3123
+ }, ai = "idb";
3124
+ function Xo() {
3125
+ if (typeof indexedDB < "u")
3126
+ return indexedDB;
3127
+ if (typeof window < "u") {
3128
+ if (typeof window.mozIndexedDB < "u")
3129
+ return window.mozIndexedDB;
3130
+ if (typeof window.webkitIndexedDB < "u")
3131
+ return window.webkitIndexedDB;
3132
+ if (typeof window.msIndexedDB < "u")
3133
+ return window.msIndexedDB;
3134
+ }
3135
+ return !1;
3136
+ }
3137
+ function un(e) {
3138
+ e.commit && e.commit();
3139
+ }
3140
+ function ii(e) {
3141
+ var t = Xo(), n = si + e, o = t.open(n);
3142
+ return o.onupgradeneeded = function(r) {
3143
+ var s = r.target.result;
3144
+ s.createObjectStore(ue, {
3145
+ keyPath: "id",
3146
+ autoIncrement: !0
3147
+ });
3148
+ }, new Promise(function(r, s) {
3149
+ o.onerror = function(i) {
3150
+ return s(i);
3151
+ }, o.onsuccess = function() {
3152
+ r(o.result);
3153
+ };
3154
+ });
3155
+ }
3156
+ function ci(e, t, n) {
3157
+ var o = (/* @__PURE__ */ new Date()).getTime(), r = {
3158
+ uuid: t,
3159
+ time: o,
3160
+ data: n
3161
+ }, s = e.transaction([ue], "readwrite", bt);
3162
+ return new Promise(function(i, a) {
3163
+ s.oncomplete = function() {
3164
+ return i();
3165
+ }, s.onerror = function(u) {
3166
+ return a(u);
3167
+ };
3168
+ var c = s.objectStore(ue);
3169
+ c.add(r), un(s);
3170
+ });
3171
+ }
3172
+ function li(e, t) {
3173
+ var n = e.transaction(ue, "readonly", bt), o = n.objectStore(ue), r = [], s = IDBKeyRange.bound(t + 1, 1 / 0);
3174
+ if (o.getAll) {
3175
+ var i = o.getAll(s);
3176
+ return new Promise(function(c, u) {
3177
+ i.onerror = function(l) {
3178
+ return u(l);
3179
+ }, i.onsuccess = function(l) {
3180
+ c(l.target.result);
3181
+ };
3182
+ });
3183
+ }
3184
+ function a() {
3185
+ try {
3186
+ return s = IDBKeyRange.bound(t + 1, 1 / 0), o.openCursor(s);
3187
+ } catch {
3188
+ return o.openCursor();
3189
+ }
3190
+ }
3191
+ return new Promise(function(c, u) {
3192
+ var l = a();
3193
+ l.onerror = function(d) {
3194
+ return u(d);
3195
+ }, l.onsuccess = function(d) {
3196
+ var f = d.target.result;
3197
+ f ? f.value.id < t + 1 ? f.continue(t + 1) : (r.push(f.value), f.continue()) : (un(n), c(r));
3198
+ };
3199
+ });
3200
+ }
3201
+ function ui(e, t) {
3202
+ if (e.closed)
3203
+ return Promise.resolve([]);
3204
+ var n = e.db.transaction(ue, "readwrite", bt), o = n.objectStore(ue);
3205
+ return Promise.all(t.map(function(r) {
3206
+ var s = o.delete(r);
3207
+ return new Promise(function(i) {
3208
+ s.onsuccess = function() {
3209
+ return i();
3210
+ };
3211
+ });
3212
+ }));
3213
+ }
3214
+ function di(e, t) {
3215
+ var n = (/* @__PURE__ */ new Date()).getTime() - t, o = e.transaction(ue, "readonly", bt), r = o.objectStore(ue), s = [];
3216
+ return new Promise(function(i) {
3217
+ r.openCursor().onsuccess = function(a) {
3218
+ var c = a.target.result;
3219
+ if (c) {
3220
+ var u = c.value;
3221
+ u.time < n ? (s.push(u), c.continue()) : (un(o), i(s));
3222
+ } else
3223
+ i(s);
3224
+ };
3225
+ });
3226
+ }
3227
+ function fi(e) {
3228
+ return di(e.db, e.options.idb.ttl).then(function(t) {
3229
+ return ui(e, t.map(function(n) {
3230
+ return n.id;
3231
+ }));
3232
+ });
3233
+ }
3234
+ function pi(e, t) {
3235
+ return t = ln(t), ii(e).then(function(n) {
3236
+ var o = {
3237
+ closed: !1,
3238
+ lastCursorId: 0,
3239
+ channelName: e,
3240
+ options: t,
3241
+ uuid: cn(),
3242
+ /**
3243
+ * emittedMessagesIds
3244
+ * contains all messages that have been emitted before
3245
+ * @type {ObliviousSet}
3246
+ */
3247
+ eMIs: new Yo(t.idb.ttl * 2),
3248
+ // ensures we do not read messages in parallel
3249
+ writeBlockPromise: Ie,
3250
+ messagesCallback: null,
3251
+ readQueuePromises: [],
3252
+ db: n
3253
+ };
3254
+ return n.onclose = function() {
3255
+ o.closed = !0, t.idb.onclose && t.idb.onclose();
3256
+ }, Zo(o), o;
3257
+ });
3258
+ }
3259
+ function Zo(e) {
3260
+ e.closed || er(e).then(function() {
3261
+ return Jo(e.options.idb.fallbackInterval);
3262
+ }).then(function() {
3263
+ return Zo(e);
3264
+ });
3265
+ }
3266
+ function hi(e, t) {
3267
+ return !(e.uuid === t.uuid || t.eMIs.has(e.id) || e.data.time < t.messagesCallbackTime);
3268
+ }
3269
+ function er(e) {
3270
+ return e.closed || !e.messagesCallback ? Ie : li(e.db, e.lastCursorId).then(function(t) {
3271
+ var n = t.filter(function(o) {
3272
+ return !!o;
3273
+ }).map(function(o) {
3274
+ return o.id > e.lastCursorId && (e.lastCursorId = o.id), o;
3275
+ }).filter(function(o) {
3276
+ return hi(o, e);
3277
+ }).sort(function(o, r) {
3278
+ return o.time - r.time;
3279
+ });
3280
+ return n.forEach(function(o) {
3281
+ e.messagesCallback && (e.eMIs.add(o.id), e.messagesCallback(o.data));
3282
+ }), Ie;
3283
+ });
3284
+ }
3285
+ function mi(e) {
3286
+ e.closed = !0, e.db.close();
3287
+ }
3288
+ function vi(e, t) {
3289
+ return e.writeBlockPromise = e.writeBlockPromise.then(function() {
3290
+ return ci(e.db, e.uuid, t);
3291
+ }).then(function() {
3292
+ qa(0, 10) === 0 && fi(e);
3293
+ }), e.writeBlockPromise;
3294
+ }
3295
+ function gi(e, t, n) {
3296
+ e.messagesCallbackTime = n, e.messagesCallback = t, er(e);
3297
+ }
3298
+ function yi() {
3299
+ return !!Xo();
3300
+ }
3301
+ function wi(e) {
3302
+ return e.idb.fallbackInterval * 2;
3303
+ }
3304
+ var _i = {
3305
+ create: pi,
3306
+ close: mi,
3307
+ onMessage: gi,
3308
+ postMessage: vi,
3309
+ canBeUsed: yi,
3310
+ type: ai,
3311
+ averageResponseTime: wi,
3312
+ microSeconds: ri
3313
+ }, bi = _t, Ei = "pubkey.broadcastChannel-", ki = "localstorage";
3314
+ function tr() {
3315
+ var e;
3316
+ if (typeof window > "u")
3317
+ return null;
3318
+ try {
3319
+ e = window.localStorage, e = window["ie8-eventlistener/storage"] || window.localStorage;
3320
+ } catch {
3321
+ }
3322
+ return e;
3323
+ }
3324
+ function nr(e) {
3325
+ return Ei + e;
3326
+ }
3327
+ function Si(e, t) {
3328
+ return new Promise(function(n) {
3329
+ Jo().then(function() {
3330
+ var o = nr(e.channelName), r = {
3331
+ token: cn(),
3332
+ time: (/* @__PURE__ */ new Date()).getTime(),
3333
+ data: t,
3334
+ uuid: e.uuid
3335
+ }, s = JSON.stringify(r);
3336
+ tr().setItem(o, s);
3337
+ var i = document.createEvent("Event");
3338
+ i.initEvent("storage", !0, !0), i.key = o, i.newValue = s, window.dispatchEvent(i), n();
3339
+ });
3340
+ });
3341
+ }
3342
+ function Ii(e, t) {
3343
+ var n = nr(e), o = function(s) {
3344
+ s.key === n && t(JSON.parse(s.newValue));
3345
+ };
3346
+ return window.addEventListener("storage", o), o;
3347
+ }
3348
+ function Oi(e) {
3349
+ window.removeEventListener("storage", e);
3350
+ }
3351
+ function Pi(e, t) {
3352
+ if (t = ln(t), !or())
3353
+ throw new Error("BroadcastChannel: localstorage cannot be used");
3354
+ var n = cn(), o = new Yo(t.localstorage.removeTimeout), r = {
3355
+ channelName: e,
3356
+ uuid: n,
3357
+ eMIs: o
3358
+ // emittedMessagesIds
3359
+ };
3360
+ return r.listener = Ii(e, function(s) {
3361
+ r.messagesCallback && s.uuid !== n && (!s.token || o.has(s.token) || s.data.time && s.data.time < r.messagesCallbackTime || (o.add(s.token), r.messagesCallback(s.data)));
3362
+ }), r;
3363
+ }
3364
+ function xi(e) {
3365
+ Oi(e.listener);
3366
+ }
3367
+ function $i(e, t, n) {
3368
+ e.messagesCallbackTime = n, e.messagesCallback = t;
3369
+ }
3370
+ function or() {
3371
+ var e = tr();
3372
+ if (!e)
3373
+ return !1;
3374
+ try {
3375
+ var t = "__broadcastchannel_check";
3376
+ e.setItem(t, "works"), e.removeItem(t);
3377
+ } catch {
3378
+ return !1;
3379
+ }
3380
+ return !0;
3381
+ }
3382
+ function Ni() {
3383
+ var e = 120, t = navigator.userAgent.toLowerCase();
3384
+ return t.includes("safari") && !t.includes("chrome") ? e * 2 : e;
3385
+ }
3386
+ var Ci = {
3387
+ create: Pi,
3388
+ close: xi,
3389
+ onMessage: $i,
3390
+ postMessage: Si,
3391
+ canBeUsed: or,
3392
+ type: ki,
3393
+ averageResponseTime: Ni,
3394
+ microSeconds: bi
3395
+ }, Ri = _t, Ai = "simulate", dn = /* @__PURE__ */ new Set();
3396
+ function Ti(e) {
3397
+ var t = {
3398
+ name: e,
3399
+ messagesCallback: null
3400
+ };
3401
+ return dn.add(t), t;
3402
+ }
3403
+ function Di(e) {
3404
+ dn.delete(e);
3405
+ }
3406
+ function Mi(e, t) {
3407
+ return new Promise(function(n) {
3408
+ return setTimeout(function() {
3409
+ var o = Array.from(dn);
3410
+ o.filter(function(r) {
3411
+ return r.name === e.name;
3412
+ }).filter(function(r) {
3413
+ return r !== e;
3414
+ }).filter(function(r) {
3415
+ return !!r.messagesCallback;
3416
+ }).forEach(function(r) {
3417
+ return r.messagesCallback(t);
3418
+ }), n();
3419
+ }, 5);
3420
+ });
3421
+ }
3422
+ function Vi(e, t) {
3423
+ e.messagesCallback = t;
3424
+ }
3425
+ function Li() {
3426
+ return !0;
3427
+ }
3428
+ function ji() {
3429
+ return 5;
3430
+ }
3431
+ var Bi = {
3432
+ create: Ti,
3433
+ close: Di,
3434
+ onMessage: Vi,
3435
+ postMessage: Mi,
3436
+ canBeUsed: Li,
3437
+ type: Ai,
3438
+ averageResponseTime: ji,
3439
+ microSeconds: Ri
3440
+ }, qn = [
3441
+ ni,
3442
+ // fastest
3443
+ _i,
3444
+ Ci
3445
+ ];
3446
+ function Ui(e) {
3447
+ var t = [].concat(e.methods, qn).filter(Boolean);
3448
+ if (e.type) {
3449
+ if (e.type === "simulate")
3450
+ return Bi;
3451
+ var n = t.find(function(r) {
3452
+ return r.type === e.type;
3453
+ });
3454
+ if (n)
3455
+ return n;
3456
+ throw new Error("method-type " + e.type + " not found");
3457
+ }
3458
+ e.webWorkerSupport || (t = t.filter(function(r) {
3459
+ return r.type !== "idb";
3460
+ }));
3461
+ var o = t.find(function(r) {
3462
+ return r.canBeUsed();
3463
+ });
3464
+ if (o)
3465
+ return o;
3466
+ throw new Error("No usable method found in " + JSON.stringify(qn.map(function(r) {
3467
+ return r.type;
3468
+ })));
3469
+ }
3470
+ var rr = /* @__PURE__ */ new Set(), Hi = 0, fn = function(t, n) {
3471
+ this.id = Hi++, rr.add(this), this.name = t, this.options = ln(n), this.method = Ui(this.options), this._iL = !1, this._onML = null, this._addEL = {
3472
+ message: [],
3473
+ internal: []
3474
+ }, this._uMP = /* @__PURE__ */ new Set(), this._befC = [], this._prepP = null, Wi(this);
3475
+ };
3476
+ fn._pubkey = !0;
3477
+ fn.prototype = {
3478
+ postMessage: function(t) {
3479
+ if (this.closed)
3480
+ throw new Error("BroadcastChannel.postMessage(): Cannot post message after channel has closed " + /**
3481
+ * In the past when this error appeared, it was really hard to debug.
3482
+ * So now we log the msg together with the error so it at least
3483
+ * gives some clue about where in your application this happens.
3484
+ */
3485
+ JSON.stringify(t));
3486
+ return Kn(this, "message", t);
3487
+ },
3488
+ postInternal: function(t) {
3489
+ return Kn(this, "internal", t);
3490
+ },
3491
+ set onmessage(e) {
3492
+ var t = this.method.microSeconds(), n = {
3493
+ time: t,
3494
+ fn: e
3495
+ };
3496
+ Yn(this, "message", this._onML), e && typeof e == "function" ? (this._onML = n, Jn(this, "message", n)) : this._onML = null;
3497
+ },
3498
+ addEventListener: function(t, n) {
3499
+ var o = this.method.microSeconds(), r = {
3500
+ time: o,
3501
+ fn: n
3502
+ };
3503
+ Jn(this, t, r);
3504
+ },
3505
+ removeEventListener: function(t, n) {
3506
+ var o = this._addEL[t].find(function(r) {
3507
+ return r.fn === n;
3508
+ });
3509
+ Yn(this, t, o);
3510
+ },
3511
+ close: function() {
3512
+ var t = this;
3513
+ if (!this.closed) {
3514
+ rr.delete(this), this.closed = !0;
3515
+ var n = this._prepP ? this._prepP : Ie;
3516
+ return this._onML = null, this._addEL.message = [], n.then(function() {
3517
+ return Promise.all(Array.from(t._uMP));
3518
+ }).then(function() {
3519
+ return Promise.all(t._befC.map(function(o) {
3520
+ return o();
3521
+ }));
3522
+ }).then(function() {
3523
+ return t.method.close(t._state);
3524
+ });
3525
+ }
3526
+ },
3527
+ get type() {
3528
+ return this.method.type;
3529
+ },
3530
+ get isClosed() {
3531
+ return this.closed;
3532
+ }
3533
+ };
3534
+ function Kn(e, t, n) {
3535
+ var o = e.method.microSeconds(), r = {
3536
+ time: o,
3537
+ type: t,
3538
+ data: n
3539
+ }, s = e._prepP ? e._prepP : Ie;
3540
+ return s.then(function() {
3541
+ var i = e.method.postMessage(e._state, r);
3542
+ return e._uMP.add(i), i.catch().then(function() {
3543
+ return e._uMP.delete(i);
3544
+ }), i;
3545
+ });
3546
+ }
3547
+ function Wi(e) {
3548
+ var t = e.method.create(e.name, e.options);
3549
+ za(t) ? (e._prepP = t, t.then(function(n) {
3550
+ e._state = n;
3551
+ })) : e._state = t;
3552
+ }
3553
+ function sr(e) {
3554
+ return e._addEL.message.length > 0 || e._addEL.internal.length > 0;
3555
+ }
3556
+ function Jn(e, t, n) {
3557
+ e._addEL[t].push(n), Fi(e);
3558
+ }
3559
+ function Yn(e, t, n) {
3560
+ e._addEL[t] = e._addEL[t].filter(function(o) {
3561
+ return o !== n;
3562
+ }), Gi(e);
3563
+ }
3564
+ function Fi(e) {
3565
+ if (!e._iL && sr(e)) {
3566
+ var t = function(r) {
3567
+ e._addEL[r.type].forEach(function(s) {
3568
+ var i = 1e5, a = s.time - i;
3569
+ r.time >= a && s.fn(r.data);
3570
+ });
3571
+ }, n = e.method.microSeconds();
3572
+ e._prepP ? e._prepP.then(function() {
3573
+ e._iL = !0, e.method.onMessage(e._state, t, n);
3574
+ }) : (e._iL = !0, e.method.onMessage(e._state, t, n));
3575
+ }
3576
+ }
3577
+ function Gi(e) {
3578
+ if (e._iL && !sr(e)) {
3579
+ e._iL = !1;
3580
+ var t = e.method.microSeconds();
3581
+ e.method.onMessage(e._state, null, t);
3582
+ }
3583
+ }
3584
+ class Nt extends Error {
3585
+ /**
3586
+ * @param {string} message
3587
+ * @param {string[]} keys
3588
+ */
3589
+ constructor(t, n) {
3590
+ super(t), this.name = "DevalueError", this.path = n.join("");
3591
+ }
3592
+ }
3593
+ function Qn(e) {
3594
+ return Object(e) !== e;
3595
+ }
3596
+ const zi = /* @__PURE__ */ Object.getOwnPropertyNames(
3597
+ Object.prototype
3598
+ ).sort().join("\0");
3599
+ function qi(e) {
3600
+ const t = Object.getPrototypeOf(e);
3601
+ return t === Object.prototype || t === null || Object.getOwnPropertyNames(t).sort().join("\0") === zi;
3602
+ }
3603
+ function Ki(e) {
3604
+ return Object.prototype.toString.call(e).slice(8, -1);
3605
+ }
3606
+ function Ji(e) {
3607
+ switch (e) {
3608
+ case '"':
3609
+ return '\\"';
3610
+ case "<":
3611
+ return "\\u003C";
3612
+ case "\\":
3613
+ return "\\\\";
3614
+ case `
3615
+ `:
3616
+ return "\\n";
3617
+ case "\r":
3618
+ return "\\r";
3619
+ case " ":
3620
+ return "\\t";
3621
+ case "\b":
3622
+ return "\\b";
3623
+ case "\f":
3624
+ return "\\f";
3625
+ case "\u2028":
3626
+ return "\\u2028";
3627
+ case "\u2029":
3628
+ return "\\u2029";
3629
+ default:
3630
+ return e < " " ? `\\u${e.charCodeAt(0).toString(16).padStart(4, "0")}` : "";
3631
+ }
3632
+ }
3633
+ function Ae(e) {
3634
+ let t = "", n = 0;
3635
+ const o = e.length;
3636
+ for (let r = 0; r < o; r += 1) {
3637
+ const s = e[r], i = Ji(s);
3638
+ i && (t += e.slice(n, r) + i, n = r + 1);
3639
+ }
3640
+ return `"${n === 0 ? e : t + e.slice(n)}"`;
3641
+ }
3642
+ const pn = -1, ar = -2, ir = -3, cr = -4, lr = -5, hn = -6;
3643
+ function Xn(e, t) {
3644
+ return Yi(JSON.parse(e), t);
3645
+ }
3646
+ function Yi(e, t) {
3647
+ if (typeof e == "number")
3648
+ return r(e, !0);
3649
+ if (!Array.isArray(e) || e.length === 0)
3650
+ throw new Error("Invalid input");
3651
+ const n = (
3652
+ /** @type {any[]} */
3653
+ e
3654
+ ), o = Array(n.length);
3655
+ function r(s, i = !1) {
3656
+ if (s === pn)
3657
+ return;
3658
+ if (s === ir)
3659
+ return NaN;
3660
+ if (s === cr)
3661
+ return 1 / 0;
3662
+ if (s === lr)
3663
+ return -1 / 0;
3664
+ if (s === hn)
3665
+ return -0;
3666
+ if (i)
3667
+ throw new Error("Invalid input");
3668
+ if (s in o)
3669
+ return o[s];
3670
+ const a = n[s];
3671
+ if (!a || typeof a != "object")
3672
+ o[s] = a;
3673
+ else if (Array.isArray(a))
3674
+ if (typeof a[0] == "string") {
3675
+ const c = a[0], u = t == null ? void 0 : t[c];
3676
+ if (u)
3677
+ return o[s] = u(r(a[1]));
3678
+ switch (c) {
3679
+ case "Date":
3680
+ o[s] = new Date(a[1]);
3681
+ break;
3682
+ case "Set":
3683
+ const l = /* @__PURE__ */ new Set();
3684
+ o[s] = l;
3685
+ for (let p = 1; p < a.length; p += 1)
3686
+ l.add(r(a[p]));
3687
+ break;
3688
+ case "Map":
3689
+ const d = /* @__PURE__ */ new Map();
3690
+ o[s] = d;
3691
+ for (let p = 1; p < a.length; p += 2)
3692
+ d.set(r(a[p]), r(a[p + 1]));
3693
+ break;
3694
+ case "RegExp":
3695
+ o[s] = new RegExp(a[1], a[2]);
3696
+ break;
3697
+ case "Object":
3698
+ o[s] = Object(a[1]);
3699
+ break;
3700
+ case "BigInt":
3701
+ o[s] = BigInt(a[1]);
3702
+ break;
3703
+ case "null":
3704
+ const f = /* @__PURE__ */ Object.create(null);
3705
+ o[s] = f;
3706
+ for (let p = 1; p < a.length; p += 2)
3707
+ f[a[p]] = r(a[p + 1]);
3708
+ break;
3709
+ default:
3710
+ throw new Error(`Unknown type ${c}`);
3711
+ }
3712
+ } else {
3713
+ const c = new Array(a.length);
3714
+ o[s] = c;
3715
+ for (let u = 0; u < a.length; u += 1) {
3716
+ const l = a[u];
3717
+ l !== ar && (c[u] = r(l));
3718
+ }
3719
+ }
3720
+ else {
3721
+ const c = {};
3722
+ o[s] = c;
3723
+ for (const u in a) {
3724
+ const l = a[u];
3725
+ c[u] = r(l);
3726
+ }
3727
+ }
3728
+ return o[s];
3729
+ }
3730
+ return r(0);
3731
+ }
3732
+ function Zn(e, t) {
3733
+ const n = [], o = /* @__PURE__ */ new Map(), r = [];
3734
+ for (const u in t)
3735
+ r.push({ key: u, fn: t[u] });
3736
+ const s = [];
3737
+ let i = 0;
3738
+ function a(u) {
3739
+ if (typeof u == "function")
3740
+ throw new Nt("Cannot stringify a function", s);
3741
+ if (o.has(u))
3742
+ return o.get(u);
3743
+ if (u === void 0)
3744
+ return pn;
3745
+ if (Number.isNaN(u))
3746
+ return ir;
3747
+ if (u === 1 / 0)
3748
+ return cr;
3749
+ if (u === -1 / 0)
3750
+ return lr;
3751
+ if (u === 0 && 1 / u < 0)
3752
+ return hn;
3753
+ const l = i++;
3754
+ o.set(u, l);
3755
+ for (const { key: f, fn: p } of r) {
3756
+ const m = p(u);
3757
+ if (m)
3758
+ return n[l] = `["${f}",${a(m)}]`, l;
3759
+ }
3760
+ let d = "";
3761
+ if (Qn(u))
3762
+ d = Ct(u);
3763
+ else
3764
+ switch (Ki(u)) {
3765
+ case "Number":
3766
+ case "String":
3767
+ case "Boolean":
3768
+ d = `["Object",${Ct(u)}]`;
3769
+ break;
3770
+ case "BigInt":
3771
+ d = `["BigInt",${u}]`;
3772
+ break;
3773
+ case "Date":
3774
+ d = `["Date","${u.toISOString()}"]`;
3775
+ break;
3776
+ case "RegExp":
3777
+ const { source: p, flags: m } = u;
3778
+ d = m ? `["RegExp",${Ae(p)},"${m}"]` : `["RegExp",${Ae(p)}]`;
3779
+ break;
3780
+ case "Array":
3781
+ d = "[";
3782
+ for (let v = 0; v < u.length; v += 1)
3783
+ v > 0 && (d += ","), v in u ? (s.push(`[${v}]`), d += a(u[v]), s.pop()) : d += ar;
3784
+ d += "]";
3785
+ break;
3786
+ case "Set":
3787
+ d = '["Set"';
3788
+ for (const v of u)
3789
+ d += `,${a(v)}`;
3790
+ d += "]";
3791
+ break;
3792
+ case "Map":
3793
+ d = '["Map"';
3794
+ for (const [v, g] of u)
3795
+ s.push(
3796
+ `.get(${Qn(v) ? Ct(v) : "..."})`
3797
+ ), d += `,${a(v)},${a(g)}`;
3798
+ d += "]";
3799
+ break;
3800
+ default:
3801
+ if (!qi(u))
3802
+ throw new Nt(
3803
+ "Cannot stringify arbitrary non-POJOs",
3804
+ s
3805
+ );
3806
+ if (Object.getOwnPropertySymbols(u).length > 0)
3807
+ throw new Nt(
3808
+ "Cannot stringify POJOs with symbolic keys",
3809
+ s
3810
+ );
3811
+ if (Object.getPrototypeOf(u) === null) {
3812
+ d = '["null"';
3813
+ for (const v in u)
3814
+ s.push(`.${v}`), d += `,${Ae(v)},${a(u[v])}`, s.pop();
3815
+ d += "]";
3816
+ } else {
3817
+ d = "{";
3818
+ let v = !1;
3819
+ for (const g in u)
3820
+ v && (d += ","), v = !0, s.push(`.${g}`), d += `${Ae(g)}:${a(u[g])}`, s.pop();
3821
+ d += "}";
3822
+ }
3823
+ }
3824
+ return n[l] = d, l;
3825
+ }
3826
+ const c = a(e);
3827
+ return c < 0 ? `${c}` : `[${n.join(",")}]`;
3828
+ }
3829
+ function Ct(e) {
3830
+ const t = typeof e;
3831
+ return t === "string" ? Ae(e) : e instanceof String ? Ae(e.toString()) : e === void 0 ? pn.toString() : e === 0 && 1 / e < 0 ? hn.toString() : t === "bigint" ? `["BigInt","${e}"]` : String(e);
3832
+ }
3833
+ function Qi(e, t, { initialize: n, type: o }) {
3834
+ let r = `${t.$id}-${e.toString()}`, s = new fn(r, { type: o }), i = !1, a = 0;
3835
+ J(() => t[e], (l) => {
3836
+ i || (a = Date.now(), s.postMessage({ timestamp: a, state: Xn(Zn(l)) })), i = !1;
3837
+ }, { deep: !0 }), s.onmessage = (l) => {
3838
+ if (l === void 0) {
3839
+ s.postMessage({ timestamp: a, state: Xn(Zn(t[e])) });
3840
+ return;
3841
+ }
3842
+ l.timestamp <= a || (i = !0, a = l.timestamp, t[e] = l.state);
3843
+ };
3844
+ let c = () => s.postMessage(void 0), u = () => s.close();
3845
+ return n && c(), { sync: c, unshare: u };
3846
+ }
3847
+ var Xi = (e, t) => Object.keys(t).includes(e), Zi = ({ initialize: e = !0, enable: t = !0, type: n }) => ({ store: o, options: r }) => {
3848
+ var s, i;
3849
+ let a = ((s = r == null ? void 0 : r.share) == null ? void 0 : s.enable) ?? t, c = ((i = r == null ? void 0 : r.share) == null ? void 0 : i.omit) ?? [];
3850
+ !a || Object.keys(o.$state).forEach((u) => {
3851
+ var l;
3852
+ c.includes(u) || !Xi(u, o.$state) || Qi(u, o, { initialize: ((l = r == null ? void 0 : r.share) == null ? void 0 : l.initialize) ?? e, type: n });
3853
+ });
3854
+ };
3855
+ const ec = bs();
3856
+ ec.use(
3857
+ Zi({
3858
+ enable: !0,
3859
+ initialize: !0
3860
+ })
3861
+ );
3862
+ const tc = /* @__PURE__ */ Z({
3863
+ __name: "Doctype",
3864
+ setup(e) {
3865
+ const { stonecrop: t, isReady: n } = Co(), o = T([]);
3866
+ return J(n, () => {
3867
+ if (n.value) {
3868
+ let r = t.value.schema.schema.toArray();
3869
+ r.forEach((s, i) => {
3870
+ const c = t.value.store.record[s.fieldname];
3871
+ r[i].value = c;
3872
+ }), o.value = r;
3873
+ }
3874
+ }), (r, s) => E(n) ? (x(), Se(E(Yr), {
3875
+ key: 0,
3876
+ class: "aform-main",
3877
+ modelValue: o.value,
3878
+ "onUpdate:modelValue": s[0] || (s[0] = (i) => o.value = i)
3879
+ }, null, 8, ["modelValue"])) : ge("", !0);
3880
+ }
3881
+ });
3882
+ function nc(e) {
3883
+ return Xt() ? (Zt(e), !0) : !1;
3884
+ }
3885
+ function ur(e) {
3886
+ return typeof e == "function" ? e() : E(e);
3887
+ }
3888
+ const oc = typeof window < "u" && typeof document < "u";
3889
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
3890
+ const rc = Object.prototype.toString, sc = (e) => rc.call(e) === "[object Object]", ac = () => {
3891
+ };
3892
+ function vt(e) {
3893
+ var t;
3894
+ const n = ur(e);
3895
+ return (t = n == null ? void 0 : n.$el) != null ? t : n;
3896
+ }
3897
+ const mn = oc ? window : void 0;
3898
+ function Ft(...e) {
3899
+ let t, n, o, r;
3900
+ if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, r] = e, t = mn) : [t, n, o, r] = e, !t)
3901
+ return ac;
3902
+ Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
3903
+ const s = [], i = () => {
3904
+ s.forEach((l) => l()), s.length = 0;
3905
+ }, a = (l, d, f, p) => (l.addEventListener(d, f, p), () => l.removeEventListener(d, f, p)), c = J(
3906
+ () => [vt(t), ur(r)],
3907
+ ([l, d]) => {
3908
+ if (i(), !l)
3909
+ return;
3910
+ const f = sc(d) ? { ...d } : d;
3911
+ s.push(
3912
+ ...n.flatMap((p) => o.map((m) => a(l, p, m, f)))
3913
+ );
3914
+ },
3915
+ { immediate: !0, flush: "post" }
3916
+ ), u = () => {
3917
+ c(), i();
3918
+ };
3919
+ return nc(u), u;
3920
+ }
3921
+ function ic(e = {}) {
3922
+ var t;
3923
+ const {
3924
+ window: n = mn,
3925
+ deep: o = !0
3926
+ } = e, r = (t = e.document) != null ? t : n == null ? void 0 : n.document, s = () => {
3927
+ var c;
3928
+ let u = r == null ? void 0 : r.activeElement;
3929
+ if (o)
3930
+ for (; u != null && u.shadowRoot; )
3931
+ u = (c = u == null ? void 0 : u.shadowRoot) == null ? void 0 : c.activeElement;
3932
+ return u;
3933
+ }, i = T(), a = () => {
3934
+ i.value = s();
3935
+ };
3936
+ return n && (Ft(n, "blur", (c) => {
3937
+ c.relatedTarget === null && a();
3938
+ }, !0), Ft(n, "focus", a, !0)), a(), i;
3939
+ }
3940
+ function cc(e, t = {}) {
3941
+ const n = ic(t), o = L(() => vt(e));
3942
+ return { focused: L(() => o.value && n.value ? o.value.contains(n.value) : !1) };
3943
+ }
3944
+ function lc(e, { window: t = mn, scrollTarget: n } = {}) {
3945
+ const o = T(!1), r = () => {
3946
+ if (!t)
3947
+ return;
3948
+ const s = t.document, i = vt(e);
3949
+ if (!i)
3950
+ o.value = !1;
3951
+ else {
3952
+ const a = i.getBoundingClientRect();
3953
+ o.value = a.top <= (t.innerHeight || s.documentElement.clientHeight) && a.left <= (t.innerWidth || s.documentElement.clientWidth) && a.bottom >= 0 && a.right >= 0;
3954
+ }
3955
+ };
3956
+ return J(
3957
+ () => vt(e),
3958
+ () => r(),
3959
+ { immediate: !0, flush: "post" }
3960
+ ), t && Ft(n || t, "scroll", r, {
3961
+ capture: !1,
3962
+ passive: !0
3963
+ }), o;
3964
+ }
3965
+ const de = (e) => {
3966
+ let t = lc(e).value;
3967
+ return t = t && e.offsetHeight > 0, t;
3968
+ }, fe = (e) => e.tabIndex >= 0, eo = (e) => {
3969
+ const t = e.target;
3970
+ return vn(t);
3971
+ }, vn = (e) => {
3972
+ var t;
3973
+ let n;
3974
+ if (e instanceof HTMLTableCellElement) {
3975
+ const o = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
3976
+ if (o) {
3977
+ const r = Array.from(o.children)[e.cellIndex];
3978
+ r && (n = r);
3979
+ }
3980
+ } else if (e instanceof HTMLTableRowElement) {
3981
+ const o = e.previousElementSibling;
3982
+ o && (n = o);
3983
+ }
3984
+ return n && (!fe(n) || !de(n)) ? vn(n) : n;
3985
+ }, uc = (e) => {
3986
+ var t;
3987
+ const n = e.target;
3988
+ let o;
3989
+ if (n instanceof HTMLTableCellElement) {
3990
+ const r = (t = n.parentElement) == null ? void 0 : t.parentElement;
3991
+ if (r) {
3992
+ const s = r.firstElementChild.children[n.cellIndex];
3993
+ s && (o = s);
3994
+ }
3995
+ } else if (n instanceof HTMLTableRowElement) {
3996
+ const r = n.parentElement;
3997
+ if (r) {
3998
+ const s = r.firstElementChild;
3999
+ s && (o = s);
4000
+ }
4001
+ }
4002
+ return o && (!fe(o) || !de(o)) ? gn(o) : o;
4003
+ }, to = (e) => {
4004
+ const t = e.target;
4005
+ return gn(t);
4006
+ }, gn = (e) => {
4007
+ var t;
4008
+ let n;
4009
+ if (e instanceof HTMLTableCellElement) {
4010
+ const o = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
4011
+ if (o) {
4012
+ const r = Array.from(o.children)[e.cellIndex];
4013
+ r && (n = r);
4014
+ }
4015
+ } else if (e instanceof HTMLTableRowElement) {
4016
+ const o = e.nextElementSibling;
4017
+ o && (n = o);
4018
+ }
4019
+ return n && (!fe(n) || !de(n)) ? gn(n) : n;
4020
+ }, dc = (e) => {
4021
+ var t;
4022
+ const n = e.target;
4023
+ let o;
4024
+ if (n instanceof HTMLTableCellElement) {
4025
+ const r = (t = n.parentElement) == null ? void 0 : t.parentElement;
4026
+ if (r) {
4027
+ const s = r.lastElementChild.children[n.cellIndex];
4028
+ s && (o = s);
4029
+ }
4030
+ } else if (n instanceof HTMLTableRowElement) {
4031
+ const r = n.parentElement;
4032
+ if (r) {
4033
+ const s = r.lastElementChild;
4034
+ s && (o = s);
4035
+ }
4036
+ }
4037
+ return o && (!fe(o) || !de(o)) ? vn(o) : o;
4038
+ }, no = (e) => {
4039
+ const t = e.target;
4040
+ return yn(t);
4041
+ }, yn = (e) => {
4042
+ var t;
4043
+ let n;
4044
+ if (e.previousElementSibling)
4045
+ n = e.previousElementSibling;
4046
+ else {
4047
+ const o = (t = e.parentElement) == null ? void 0 : t.previousElementSibling;
4048
+ n = o == null ? void 0 : o.lastElementChild;
4049
+ }
4050
+ return n && (!fe(n) || !de(n)) ? yn(n) : n;
4051
+ }, oo = (e) => {
4052
+ const t = e.target;
4053
+ return wn(t);
4054
+ }, wn = (e) => {
4055
+ var t;
4056
+ let n;
4057
+ if (e.nextElementSibling)
4058
+ n = e.nextElementSibling;
4059
+ else {
4060
+ const o = (t = e.parentElement) == null ? void 0 : t.nextElementSibling;
4061
+ n = o == null ? void 0 : o.firstElementChild;
4062
+ }
4063
+ return n && (!fe(n) || !de(n)) ? wn(n) : n;
4064
+ }, ro = (e) => {
4065
+ const t = e.target.parentElement.firstElementChild;
4066
+ return t && (!fe(t) || !de(t)) ? wn(t) : t;
4067
+ }, so = (e) => {
4068
+ const t = e.target.parentElement.lastElementChild;
4069
+ return t && (!fe(t) || !de(t)) ? yn(t) : t;
4070
+ }, rt = ["alt", "control", "shift", "meta"], fc = {
4071
+ ArrowUp: "up",
4072
+ ArrowDown: "down",
4073
+ ArrowLeft: "left",
4074
+ ArrowRight: "right"
4075
+ }, _n = {
4076
+ "keydown.up": (e) => {
4077
+ const t = eo(e);
4078
+ t && (e.preventDefault(), e.stopPropagation(), t.focus());
4079
+ },
4080
+ "keydown.down": (e) => {
4081
+ const t = to(e);
4082
+ t && (e.preventDefault(), e.stopPropagation(), t.focus());
4083
+ },
4084
+ "keydown.left": (e) => {
4085
+ const t = no(e);
4086
+ e.preventDefault(), e.stopPropagation(), t && t.focus();
4087
+ },
4088
+ "keydown.right": (e) => {
4089
+ const t = oo(e);
4090
+ e.preventDefault(), e.stopPropagation(), t && t.focus();
4091
+ },
4092
+ "keydown.control.up": (e) => {
4093
+ const t = uc(e);
4094
+ t && (e.preventDefault(), e.stopPropagation(), t.focus());
4095
+ },
4096
+ "keydown.control.down": (e) => {
4097
+ const t = dc(e);
4098
+ t && (e.preventDefault(), e.stopPropagation(), t.focus());
4099
+ },
4100
+ "keydown.control.left": (e) => {
4101
+ const t = ro(e);
4102
+ t && (e.preventDefault(), e.stopPropagation(), t.focus());
4103
+ },
4104
+ "keydown.control.right": (e) => {
4105
+ const t = so(e);
4106
+ t && (e.preventDefault(), e.stopPropagation(), t.focus());
4107
+ },
4108
+ "keydown.end": (e) => {
4109
+ const t = so(e);
4110
+ t && (e.preventDefault(), e.stopPropagation(), t.focus());
4111
+ },
4112
+ "keydown.enter": (e) => {
4113
+ if (e.target instanceof HTMLTableCellElement) {
4114
+ e.preventDefault(), e.stopPropagation();
4115
+ const t = to(e);
4116
+ t && t.focus();
4117
+ }
4118
+ },
4119
+ "keydown.shift.enter": (e) => {
4120
+ if (e.target instanceof HTMLTableCellElement) {
4121
+ e.preventDefault(), e.stopPropagation();
4122
+ const t = eo(e);
4123
+ t && t.focus();
4124
+ }
4125
+ },
4126
+ "keydown.home": (e) => {
4127
+ const t = ro(e);
4128
+ t && (e.preventDefault(), e.stopPropagation(), t.focus());
4129
+ },
4130
+ "keydown.tab": (e) => {
4131
+ const t = oo(e);
4132
+ t && (e.preventDefault(), e.stopPropagation(), t.focus());
4133
+ },
4134
+ "keydown.shift.tab": (e) => {
4135
+ const t = no(e);
4136
+ t && (e.preventDefault(), e.stopPropagation(), t.focus());
4137
+ }
4138
+ };
4139
+ function dr(e) {
4140
+ const t = (i) => {
4141
+ let a = null;
4142
+ return i.parent && (typeof i.parent == "string" ? a = document.querySelector(i.parent) : i.parent instanceof HTMLElement ? a = i.parent : a = i.parent.value), a;
4143
+ }, n = (i) => {
4144
+ const a = t(i);
4145
+ let c = [];
4146
+ if (typeof i.selectors == "string")
4147
+ c = a ? Array.from(a.querySelectorAll(i.selectors)) : Array.from(document.querySelectorAll(i.selectors));
4148
+ else if (Array.isArray(i.selectors))
4149
+ for (const u of i.selectors)
4150
+ u instanceof HTMLElement ? c.push(u) : c.push(u.$el);
4151
+ else if (i.selectors instanceof HTMLElement)
4152
+ c.push(i.selectors);
4153
+ else if (Array.isArray(i.selectors.value))
4154
+ for (const u of i.selectors.value)
4155
+ u instanceof HTMLElement ? c.push(u) : c.push(u.$el);
4156
+ else
4157
+ c.push(i.selectors.value);
4158
+ return c;
4159
+ }, o = (i) => {
4160
+ const a = t(i);
4161
+ let c = [];
4162
+ return i.selectors ? c = n(i) : a && (c = Array.from(a.children).filter((u) => fe(u) && de(u))), c;
4163
+ }, r = (i) => (a) => {
4164
+ const c = fc[a.key] || a.key.toLowerCase();
4165
+ if (rt.includes(c))
4166
+ return;
4167
+ const u = i.handlers || _n;
4168
+ for (const l of Object.keys(u)) {
4169
+ const [d, ...f] = l.split(".");
4170
+ if (d === "keydown" && f.includes(c)) {
4171
+ const p = u[l], m = f.filter((g) => rt.includes(g)), v = rt.some((g) => {
4172
+ const S = g.charAt(0).toUpperCase() + g.slice(1);
4173
+ return a.getModifierState(S);
4174
+ });
4175
+ if (m.length > 0) {
4176
+ if (v) {
4177
+ for (const g of rt)
4178
+ if (f.includes(g)) {
4179
+ const S = g.charAt(0).toUpperCase() + g.slice(1);
4180
+ a.getModifierState(S) && p(a);
4181
+ }
4182
+ }
4183
+ } else
4184
+ v || p(a);
4185
+ }
4186
+ }
4187
+ }, s = [];
4188
+ zt(() => {
4189
+ for (const i of e) {
4190
+ const a = t(i), c = o(i), u = r(i), l = a ? [a] : c;
4191
+ for (const d of l) {
4192
+ const { focused: f } = cc(T(d)), p = J(f, (m) => {
4193
+ m ? d.addEventListener("keydown", u) : d.removeEventListener("keydown", u);
4194
+ });
4195
+ s.push(p);
4196
+ }
4197
+ }
4198
+ }), Pr(() => {
4199
+ for (const i of s)
4200
+ i();
4201
+ });
4202
+ }
4203
+ const pc = ["data-colindex", "data-rowindex", "data-editable", "contenteditable", "tabindex"], hc = { key: 1 }, mc = /* @__PURE__ */ Z({
4204
+ __name: "ACell",
4205
+ props: {
4206
+ colIndex: {},
4207
+ rowIndex: {},
4208
+ tableid: {},
4209
+ addNavigation: { type: [Boolean, Object], default: !0 },
4210
+ tabIndex: { default: 0 }
4211
+ },
4212
+ setup(e) {
4213
+ var t;
4214
+ const n = e, o = ne(n.tableid), r = T(null), s = T(""), i = T(!1), a = L(() => {
4215
+ const v = o.cellData(n.colIndex, n.rowIndex);
4216
+ if (o.columns[n.colIndex].format) {
4217
+ const g = o.columns[n.colIndex].format;
4218
+ return typeof g == "function" ? g(v) : typeof g == "string" ? Function(`"use strict";return (${g})`)()(v) : v;
4219
+ } else
4220
+ return v;
4221
+ }), c = (v) => {
4222
+ if (o.columns[n.colIndex].mask, o.columns[n.colIndex].modalComponent) {
4223
+ const g = r.value.getBoundingClientRect();
4224
+ o.modal.visible = !0, o.modal.colIndex = n.colIndex, o.modal.rowIndex = n.rowIndex, o.modal.parent = r.value, o.modal.top = g.top + g.height, o.modal.left = g.left, o.modal.width = l.value, o.modal.component = o.columns[n.colIndex].modalComponent, o.modal.componentProps = o.columns[n.colIndex].modalComponentProps;
4225
+ }
4226
+ };
4227
+ if (n.addNavigation) {
4228
+ let v = {
4229
+ ..._n,
4230
+ "keydown.f2": c,
4231
+ "keydown.alt.up": c,
4232
+ "keydown.alt.down": c,
4233
+ "keydown.alt.left": c,
4234
+ "keydown.alt.right": c
4235
+ };
4236
+ typeof n.addNavigation == "object" && (v = {
4237
+ ...v,
4238
+ ...n.addNavigation
4239
+ }), dr([
4240
+ {
4241
+ selectors: r,
4242
+ handlers: v
4243
+ }
4244
+ ]);
4245
+ }
4246
+ const u = L(() => o.columns[n.colIndex].align || "center"), l = L(() => o.columns[n.colIndex].width || "40ch"), d = () => {
4247
+ r.value && (s.value = r.value.textContent);
4248
+ }, f = () => {
4249
+ r.value && r.value.textContent !== s.value && (s.value = r.value.textContent, r.value.dispatchEvent(new Event("change")), i.value = !0, o.columns[n.colIndex].format || o.setCellData(n.rowIndex, n.colIndex, s.value));
4250
+ }, p = (v, g) => g && v === 0 && g > 0 ? `${g}ch` : "inherit", m = {
4251
+ textAlign: u.value,
4252
+ width: l.value,
4253
+ backgroundColor: i.value ? "var(--cell-modified-color)" : "inherit",
4254
+ fontWeight: i.value ? "bold" : "inherit",
4255
+ paddingLeft: p(n.colIndex, (t = o.display[n.rowIndex]) == null ? void 0 : t.indent)
4256
+ };
4257
+ return (v, g) => (x(), A("td", {
4258
+ ref_key: "cell",
4259
+ ref: r,
4260
+ "data-colindex": v.colIndex,
4261
+ "data-rowindex": v.rowIndex,
4262
+ "data-editable": E(o).columns[v.colIndex].edit,
4263
+ contenteditable: E(o).columns[v.colIndex].edit,
4264
+ tabindex: v.tabIndex,
4265
+ spellcheck: !1,
4266
+ style: m,
4267
+ onFocus: d,
4268
+ onPaste: f,
4269
+ onBlur: f,
4270
+ onInput: f,
4271
+ onClick: c,
4272
+ onMousedown: c
4273
+ }, [
4274
+ E(o).columns[v.colIndex].cellComponent ? (x(), Se(Kt(E(o).columns[v.colIndex].cellComponent), Jt({
4275
+ key: 0,
4276
+ value: a.value
4277
+ }, E(o).columns[v.colIndex].cellComponentProps), null, 16, ["value"])) : (x(), A("span", hc, le(a.value), 1))
4278
+ ], 40, pc));
4279
+ }
4280
+ }), Xe = (e, t) => {
4281
+ const n = e.__vccOpts || e;
4282
+ for (const [o, r] of t)
4283
+ n[o] = r;
4284
+ return n;
4285
+ }, vc = /* @__PURE__ */ Xe(mc, [["__scopeId", "data-v-f3597719"]]), gc = ["tabindex"], yc = {
4286
+ key: 0,
4287
+ tabIndex: -1,
4288
+ class: "list-index"
4289
+ }, wc = /* @__PURE__ */ Z({
4290
+ __name: "ARow",
4291
+ props: {
4292
+ row: {},
4293
+ rowIndex: {},
4294
+ tableid: {},
4295
+ tabIndex: { default: -1 },
4296
+ addNavigation: { type: [Boolean, Object], default: !1 }
4297
+ },
4298
+ setup(e) {
4299
+ vo((c) => ({
4300
+ "30f057ab": E(r)
4301
+ }));
4302
+ const t = e, n = ne(t.tableid), o = T(null), r = n.numberedRowWidth.value, s = () => n.config.view !== "tree" ? "" : n.display[t.rowIndex].isRoot || n.display[t.rowIndex].isParent ? n.display[t.rowIndex].childrenOpen ? "-" : "+" : "", i = L(() => n.config.view !== "tree" || n.display[t.rowIndex].isRoot || n.display[t.rowIndex].open), a = (c) => {
4303
+ n.toggleRowExpand(c);
4304
+ };
4305
+ if (t.addNavigation) {
4306
+ let c = _n;
4307
+ typeof t.addNavigation == "object" && (c = {
4308
+ ...c,
4309
+ ...t.addNavigation
4310
+ }), dr([
4311
+ {
4312
+ selectors: o,
4313
+ handlers: c
4314
+ }
4315
+ ]);
4316
+ }
4317
+ return (c, u) => ze((x(), A("tr", {
4318
+ ref_key: "rowEl",
4319
+ ref: o,
4320
+ tabindex: c.tabIndex,
4321
+ class: "table-row"
4322
+ }, [
4323
+ me(c.$slots, "index", {}, () => [
4324
+ E(n).config.view === "list" ? (x(), A("td", yc, le(c.rowIndex + 1), 1)) : E(n).config.view === "tree" ? (x(), A("td", {
4325
+ key: 1,
4326
+ tabIndex: -1,
4327
+ class: "tree-index",
4328
+ onClick: u[0] || (u[0] = (l) => a(c.rowIndex))
4329
+ }, le(s()), 1)) : ge("", !0)
4330
+ ], !0),
4331
+ me(c.$slots, "default", {}, void 0, !0)
4332
+ ], 8, gc)), [
4333
+ [qt, i.value]
4334
+ ]);
4335
+ }
4336
+ }), _c = /* @__PURE__ */ Xe(wc, [["__scopeId", "data-v-762810eb"]]);
4337
+ let st;
4338
+ const bc = new Uint8Array(16);
4339
+ function Ec() {
4340
+ if (!st && (st = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto), !st))
4341
+ throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
4342
+ return st(bc);
4343
+ }
4344
+ const F = [];
4345
+ for (let e = 0; e < 256; ++e)
4346
+ F.push((e + 256).toString(16).slice(1));
4347
+ function kc(e, t = 0) {
4348
+ return F[e[t + 0]] + F[e[t + 1]] + F[e[t + 2]] + F[e[t + 3]] + "-" + F[e[t + 4]] + F[e[t + 5]] + "-" + F[e[t + 6]] + F[e[t + 7]] + "-" + F[e[t + 8]] + F[e[t + 9]] + "-" + F[e[t + 10]] + F[e[t + 11]] + F[e[t + 12]] + F[e[t + 13]] + F[e[t + 14]] + F[e[t + 15]];
4349
+ }
4350
+ const Sc = typeof crypto < "u" && crypto.randomUUID && crypto.randomUUID.bind(crypto), ao = {
4351
+ randomUUID: Sc
4352
+ };
4353
+ function fr(e, t, n) {
4354
+ if (ao.randomUUID && !t && !e)
4355
+ return ao.randomUUID();
4356
+ e = e || {};
4357
+ const o = e.random || (e.rng || Ec)();
4358
+ if (o[6] = o[6] & 15 | 64, o[8] = o[8] & 63 | 128, t) {
4359
+ n = n || 0;
4360
+ for (let r = 0; r < 16; ++r)
4361
+ t[n + r] = o[r];
4362
+ return t;
4363
+ }
4364
+ return kc(o);
4365
+ }
4366
+ function pr(e) {
4367
+ return Xt() ? (Zt(e), !0) : !1;
4368
+ }
4369
+ function Fe(e) {
4370
+ return typeof e == "function" ? e() : E(e);
4371
+ }
4372
+ const hr = typeof window < "u" && typeof document < "u";
4373
+ typeof WorkerGlobalScope < "u" && globalThis instanceof WorkerGlobalScope;
4374
+ const Ic = Object.prototype.toString, Oc = (e) => Ic.call(e) === "[object Object]", Ge = () => {
4375
+ }, Gt = /* @__PURE__ */ Pc();
4376
+ function Pc() {
4377
+ var e, t;
4378
+ return hr && ((e = window == null ? void 0 : window.navigator) == null ? void 0 : e.userAgent) && (/iP(ad|hone|od)/.test(window.navigator.userAgent) || ((t = window == null ? void 0 : window.navigator) == null ? void 0 : t.maxTouchPoints) > 2 && /iPad|Macintosh/.test(window == null ? void 0 : window.navigator.userAgent));
4379
+ }
4380
+ const io = {
4381
+ mounted: "mounted",
4382
+ updated: "updated",
4383
+ unmounted: "unmounted"
4384
+ };
4385
+ function xc(...e) {
4386
+ if (e.length !== 1)
4387
+ return it(...e);
4388
+ const t = e[0];
4389
+ return typeof t == "function" ? Ir(Or(() => ({ get: t, set: Ge }))) : T(t);
4390
+ }
4391
+ function je(e) {
4392
+ var t;
4393
+ const n = Fe(e);
4394
+ return (t = n == null ? void 0 : n.$el) != null ? t : n;
4395
+ }
4396
+ const mr = hr ? window : void 0;
4397
+ function ft(...e) {
4398
+ let t, n, o, r;
4399
+ if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([n, o, r] = e, t = mr) : [t, n, o, r] = e, !t)
4400
+ return Ge;
4401
+ Array.isArray(n) || (n = [n]), Array.isArray(o) || (o = [o]);
4402
+ const s = [], i = () => {
4403
+ s.forEach((l) => l()), s.length = 0;
4404
+ }, a = (l, d, f, p) => (l.addEventListener(d, f, p), () => l.removeEventListener(d, f, p)), c = J(
4405
+ () => [je(t), Fe(r)],
4406
+ ([l, d]) => {
4407
+ if (i(), !l)
4408
+ return;
4409
+ const f = Oc(d) ? { ...d } : d;
4410
+ s.push(
4411
+ ...n.flatMap((p) => o.map((m) => a(l, p, m, f)))
4412
+ );
4413
+ },
4414
+ { immediate: !0, flush: "post" }
4415
+ ), u = () => {
4416
+ c(), i();
4417
+ };
4418
+ return pr(u), u;
4419
+ }
4420
+ let co = !1;
4421
+ function lo(e, t, n = {}) {
4422
+ const { window: o = mr, ignore: r = [], capture: s = !0, detectIframe: i = !1 } = n;
4423
+ if (!o)
4424
+ return Ge;
4425
+ Gt && !co && (co = !0, Array.from(o.document.body.children).forEach((l) => l.addEventListener("click", Ge)), o.document.documentElement.addEventListener("click", Ge));
4426
+ let a = !0;
4427
+ const c = (l) => r.some((d) => {
4428
+ if (typeof d == "string")
4429
+ return Array.from(o.document.querySelectorAll(d)).some((f) => f === l.target || l.composedPath().includes(f));
4430
+ {
4431
+ const f = je(d);
4432
+ return f && (l.target === f || l.composedPath().includes(f));
4433
+ }
4434
+ }), u = [
4435
+ ft(o, "click", (l) => {
4436
+ const d = je(e);
4437
+ if (!(!d || d === l.target || l.composedPath().includes(d))) {
4438
+ if (l.detail === 0 && (a = !c(l)), !a) {
4439
+ a = !0;
4440
+ return;
4441
+ }
4442
+ t(l);
4443
+ }
4444
+ }, { passive: !0, capture: s }),
4445
+ ft(o, "pointerdown", (l) => {
4446
+ const d = je(e);
4447
+ a = !c(l) && !!(d && !l.composedPath().includes(d));
4448
+ }, { passive: !0 }),
4449
+ i && ft(o, "blur", (l) => {
4450
+ setTimeout(() => {
4451
+ var d;
4452
+ const f = je(e);
4453
+ ((d = o.document.activeElement) == null ? void 0 : d.tagName) === "IFRAME" && !(f != null && f.contains(o.document.activeElement)) && t(l);
4454
+ }, 0);
4455
+ })
4456
+ ].filter(Boolean);
4457
+ return () => u.forEach((l) => l());
4458
+ }
4459
+ const $c = {
4460
+ [io.mounted](e, t) {
4461
+ const n = !t.modifiers.bubble;
4462
+ if (typeof t.value == "function")
4463
+ e.__onClickOutside_stop = lo(e, t.value, { capture: n });
4464
+ else {
4465
+ const [o, r] = t.value;
4466
+ e.__onClickOutside_stop = lo(e, o, Object.assign({ capture: n }, r));
4467
+ }
4468
+ },
4469
+ [io.unmounted](e) {
4470
+ e.__onClickOutside_stop();
4471
+ }
4472
+ };
4473
+ function Rt(e) {
4474
+ return typeof Window < "u" && e instanceof Window ? e.document.documentElement : typeof Document < "u" && e instanceof Document ? e.documentElement : e;
4475
+ }
4476
+ function vr(e) {
4477
+ const t = window.getComputedStyle(e);
4478
+ if (t.overflowX === "scroll" || t.overflowY === "scroll" || t.overflowX === "auto" && e.clientWidth < e.scrollWidth || t.overflowY === "auto" && e.clientHeight < e.scrollHeight)
4479
+ return !0;
4480
+ {
4481
+ const n = e.parentNode;
4482
+ return !n || n.tagName === "BODY" ? !1 : vr(n);
4483
+ }
4484
+ }
4485
+ function Nc(e) {
4486
+ const t = e || window.event, n = t.target;
4487
+ return vr(n) ? !1 : t.touches.length > 1 ? !0 : (t.preventDefault && t.preventDefault(), !1);
4488
+ }
4489
+ const at = /* @__PURE__ */ new WeakMap();
4490
+ function Cc(e, t = !1) {
4491
+ const n = T(t);
4492
+ let o = null;
4493
+ J(xc(e), (i) => {
4494
+ const a = Rt(Fe(i));
4495
+ if (a) {
4496
+ const c = a;
4497
+ at.get(c) || at.set(c, c.style.overflow), n.value && (c.style.overflow = "hidden");
4498
+ }
4499
+ }, {
4500
+ immediate: !0
4501
+ });
4502
+ const r = () => {
4503
+ const i = Rt(Fe(e));
4504
+ !i || n.value || (Gt && (o = ft(
4505
+ i,
4506
+ "touchmove",
4507
+ (a) => {
4508
+ Nc(a);
4509
+ },
4510
+ { passive: !1 }
4511
+ )), i.style.overflow = "hidden", n.value = !0);
4512
+ }, s = () => {
4513
+ var i;
4514
+ const a = Rt(Fe(e));
4515
+ !a || !n.value || (Gt && (o == null || o()), a.style.overflow = (i = at.get(a)) != null ? i : "", at.delete(a), n.value = !1);
4516
+ };
4517
+ return pr(s), L({
4518
+ get() {
4519
+ return n.value;
4520
+ },
4521
+ set(i) {
4522
+ i ? r() : s();
4523
+ }
4524
+ });
4525
+ }
4526
+ function Rc() {
4527
+ let e = !1;
4528
+ const t = T(!1);
4529
+ return (n, o) => {
4530
+ if (t.value = o.value, e)
4531
+ return;
4532
+ e = !0;
4533
+ const r = Cc(n, o.value);
4534
+ J(t, (s) => r.value = s);
4535
+ };
4536
+ }
4537
+ Rc();
4538
+ class Ac {
4539
+ constructor(t, n, o, r, s, i) {
4540
+ this.id = t || fr(), this.rows = o, this.columns = Ee(n), this.config = Ee(r), this.table = s || Ee(this.createTableObject()), this.display = this.createDisplayObject(i), this.modal = Ee({ visible: !1 });
4541
+ }
4542
+ createTableObject() {
4543
+ const t = {};
4544
+ for (const [n, o] of this.columns.entries())
4545
+ for (const [r, s] of this.rows.entries())
4546
+ t[`${n}:${r}`] = s[o.name];
4547
+ return t;
4548
+ }
4549
+ createDisplayObject(t) {
4550
+ const n = [Object.assign({}, { modified: !1 })];
4551
+ if (t && "0:0" in t)
4552
+ return t;
4553
+ const o = /* @__PURE__ */ new Set();
4554
+ for (let r = this.rows.length - 1; r >= 0; r--) {
4555
+ const s = this.rows[r];
4556
+ s.parent && o.add(s.parent), n[r] = {
4557
+ childrenOpen: !1,
4558
+ expanded: !1,
4559
+ indent: s.indent || null,
4560
+ isParent: o.has(r),
4561
+ isRoot: s.parent === null || s.parent === void 0,
4562
+ modified: !1,
4563
+ open: s.parent === null || s.parent === void 0,
4564
+ parent: s.parent
4565
+ };
4566
+ }
4567
+ return Ee(n);
4568
+ }
4569
+ get zeroColumn() {
4570
+ return ["list", "tree", "list-expansion"].includes(this.config.view);
4571
+ }
4572
+ get numberedRowWidth() {
4573
+ return L(() => String(Math.ceil(this.rows.length / 100) + 1) + "ch");
4574
+ }
4575
+ cellData(t, n) {
4576
+ return this.table[`${t}:${n}`];
4577
+ }
4578
+ setCellData(t, n, o) {
4579
+ this.table[`${n}:${t}`] !== o && (this.display[t].modified = !0), this.table[`${n}:${t}`] = o;
4580
+ const r = this.columns[n];
4581
+ return this.rows[t][r.name] = o, this.table[`${n}:${t}`];
4582
+ }
4583
+ toggleRowExpand(t) {
4584
+ if (this.config.view === "tree") {
4585
+ this.display[t].childrenOpen = !this.display[t].childrenOpen;
4586
+ for (let n = this.rows.length - 1; n >= 0; n--)
4587
+ this.display[n].parent === t && (this.display[n].open = !this.display[n].open, this.display[n].childrenOpen && this.toggleRowExpand(n));
4588
+ } else
4589
+ this.config.view === "list-expansion" && (this.display[t].expanded = !this.display[t].expanded);
4590
+ }
4591
+ }
4592
+ const Tc = {
4593
+ key: 0,
4594
+ id: "resizable"
4595
+ }, Dc = {
4596
+ class: "atable-header-row",
4597
+ tabindex: "-1"
4598
+ }, Mc = {
4599
+ key: 0,
4600
+ id: "header-index"
4601
+ }, Vc = /* @__PURE__ */ Z({
4602
+ __name: "ATableHeader",
4603
+ props: {
4604
+ columns: {},
4605
+ config: {},
4606
+ tableid: {}
4607
+ },
4608
+ setup(e) {
4609
+ vo((r) => ({
4610
+ "0c61081d": E(n)
4611
+ }));
4612
+ const t = ne(e.tableid), n = t.numberedRowWidth.value, o = (r) => ({
4613
+ minWidth: r.width || "40ch",
4614
+ textAlign: r.align || "center",
4615
+ width: t.config.fullWidth ? "auto" : null
4616
+ });
4617
+ return (r, s) => r.columns.length ? (x(), A("thead", Tc, [
4618
+ D("tr", Dc, [
4619
+ E(t).zeroColumn ? (x(), A("th", Mc)) : ge("", !0),
4620
+ (x(!0), A(Oe, null, Pe(r.columns, (i, a) => (x(), A("th", {
4621
+ key: a,
4622
+ tabindex: "-1",
4623
+ style: ce(o(i))
4624
+ }, [
4625
+ me(r.$slots, "default", {}, () => [
4626
+ go(le(i.label || String.fromCharCode(a + 97).toUpperCase()), 1)
4627
+ ], !0)
4628
+ ], 4))), 128))
4629
+ ])
4630
+ ])) : ge("", !0);
4631
+ }
4632
+ }), Lc = /* @__PURE__ */ Xe(Vc, [["__scopeId", "data-v-b0bfa37f"]]), jc = /* @__PURE__ */ Z({
4633
+ __name: "ATableModal",
4634
+ props: {
4635
+ colIndex: {},
4636
+ rowIndex: {},
4637
+ tableid: {}
4638
+ },
4639
+ setup(e) {
4640
+ ne(e.tableid);
4641
+ const t = (n) => {
4642
+ n.stopPropagation();
4643
+ };
4644
+ return (n, o) => (x(), A("div", {
4645
+ ref: "amodal",
4646
+ class: "amodal",
4647
+ tabindex: "-1",
4648
+ onClick: t,
4649
+ onInput: t
4650
+ }, [
4651
+ me(n.$slots, "default", {}, void 0, !0)
4652
+ ], 544));
4653
+ }
4654
+ }), Bc = /* @__PURE__ */ Xe(jc, [["__scopeId", "data-v-10a48b2a"]]), Uc = /* @__PURE__ */ Z({
4655
+ __name: "ATable",
4656
+ props: {
4657
+ id: {},
4658
+ modelValue: {},
4659
+ columns: {},
4660
+ rows: { default: () => [] },
4661
+ config: { default: () => new Object() },
4662
+ tableid: {}
4663
+ },
4664
+ emits: ["update:modelValue"],
4665
+ setup(e, { emit: t }) {
4666
+ const n = e, o = t;
4667
+ let r = n.modelValue ? n.modelValue : n.rows, s = new Ac(n.id, n.columns, r, n.config);
4668
+ ct(s.id, s), J(
4669
+ () => s.rows,
4670
+ (a) => {
4671
+ o("update:modelValue", a);
4672
+ },
4673
+ { deep: !0 }
4674
+ );
4675
+ const i = (a) => {
4676
+ var c;
4677
+ a.target instanceof Node && (c = s.modal.parent) != null && c.contains(a.target) || s.modal.visible && (s.modal.visible = !1);
4678
+ };
4679
+ return window.addEventListener("keydown", async (a) => {
4680
+ if (a.key === "Escape" && s.modal.visible) {
4681
+ s.modal.visible = !1;
4682
+ const c = s.modal.parent;
4683
+ c && (await Ke(), c.focus());
4684
+ }
4685
+ }), (a, c) => ze((x(), A("table", {
4686
+ class: "atable",
4687
+ style: ce({ width: E(s).config.fullWidth ? "100%" : "auto" })
4688
+ }, [
4689
+ me(a.$slots, "header", { data: E(s) }, () => [
4690
+ pt(Lc, {
4691
+ columns: E(s).columns,
4692
+ config: E(s).config,
4693
+ tableid: E(s).id
4694
+ }, null, 8, ["columns", "config", "tableid"])
4695
+ ], !0),
4696
+ D("tbody", null, [
4697
+ me(a.$slots, "body", { data: E(s) }, () => [
4698
+ (x(!0), A(Oe, null, Pe(E(s).rows, (u, l) => (x(), Se(_c, {
4699
+ key: u.id || E(fr)(),
4700
+ row: u,
4701
+ rowIndex: l,
4702
+ tableid: E(s).id
4703
+ }, {
4704
+ default: ht(() => [
4705
+ (x(!0), A(Oe, null, Pe(E(s).columns, (d, f) => (x(), Se(vc, {
4706
+ key: `${f}:${l}`,
4707
+ tableid: E(s).id,
4708
+ col: d,
4709
+ spellcheck: "false",
4710
+ rowIndex: l,
4711
+ colIndex: f + (E(s).zeroColumn ? 0 : -1),
4712
+ component: d.cellComponent,
4713
+ style: ce({
4714
+ textAlign: (d == null ? void 0 : d.align) || "center",
4715
+ minWidth: (d == null ? void 0 : d.width) || "40ch",
4716
+ width: E(s).config.fullWidth ? "auto" : null
4717
+ })
4718
+ }, null, 8, ["tableid", "col", "rowIndex", "colIndex", "component", "style"]))), 128))
4719
+ ]),
4720
+ _: 2
4721
+ }, 1032, ["row", "rowIndex", "tableid"]))), 128))
4722
+ ], !0)
4723
+ ]),
4724
+ me(a.$slots, "footer", { data: E(s) }, void 0, !0),
4725
+ me(a.$slots, "modal", { data: E(s) }, () => [
4726
+ ze(pt(Bc, {
4727
+ colIndex: E(s).modal.colIndex,
4728
+ rowIndex: E(s).modal.rowIndex,
4729
+ tableid: E(s).id,
4730
+ style: ce({
4731
+ left: E(s).modal.left + "px",
4732
+ top: E(s).modal.top + "px",
4733
+ maxWidth: E(s).modal.width + "px"
4734
+ })
4735
+ }, {
4736
+ default: ht(() => [
4737
+ (x(), Se(Kt(E(s).modal.component), Jt({
4738
+ key: `${E(s).modal.rowIndex}:${E(s).modal.colIndex}`,
4739
+ colIndex: E(s).modal.colIndex,
4740
+ rowIndex: E(s).modal.rowIndex,
4741
+ tableid: E(s).id
4742
+ }, E(s).modal.componentProps), null, 16, ["colIndex", "rowIndex", "tableid"]))
4743
+ ]),
4744
+ _: 1
4745
+ }, 8, ["colIndex", "rowIndex", "tableid", "style"]), [
4746
+ [qt, E(s).modal.visible]
4747
+ ])
4748
+ ], !0)
4749
+ ], 4)), [
4750
+ [E($c), i]
4751
+ ]);
4752
+ }
4753
+ }), Hc = /* @__PURE__ */ Xe(Uc, [["__scopeId", "data-v-f0f87ebf"]]), Wc = /* @__PURE__ */ Z({
4754
+ __name: "Records",
4755
+ setup(e) {
4756
+ const { stonecrop: t, isReady: n } = Co(), o = { view: "list" };
4757
+ return (r, s) => E(n) ? (x(), Se(E(Hc), {
4758
+ key: 0,
4759
+ columns: E(t).schema.schema.toArray(),
4760
+ rows: E(t).store.records,
4761
+ config: o
4762
+ }, null, 8, ["columns", "rows"])) : ge("", !0);
4763
+ }
4764
+ }), gr = (e) => (fo("data-v-18bfde6e"), e = e(), po(), e), Fc = { class: "tabs" }, Gc = { tabindex: "0" }, zc = {
4765
+ version: "1.1",
4766
+ id: "Capa_1",
4767
+ xmlns: "http://www.w3.org/2000/svg",
4768
+ "xmlns:xlink": "http://www.w3.org/1999/xlink",
4769
+ x: "0px",
4770
+ y: "0px",
4771
+ viewBox: "0 0 424.098 424.098",
4772
+ style: { "enable-background": "new 0 0 424.098 424.098" },
4773
+ "xml:space": "preserve"
4774
+ }, qc = /* @__PURE__ */ gr(() => /* @__PURE__ */ D("g", null, [
4775
+ /* @__PURE__ */ D("path", {
4776
+ style: { fill: "#010002" },
4777
+ d: `M351.191,401.923H72.901c-4.487,0-8.129-3.633-8.129-8.129V242.262l-56.664-0.114
4778
+ c-3.284-0.008-6.243-1.992-7.495-5.023c-1.252-3.04-0.553-6.527,1.764-8.852L206.104,24.546c1.853-1.845,4.503-2.666,7.047-2.276
4779
+ c2.414,0.39,4.511,1.845,5.731,3.942l47.43,47.43V58.499c0-4.487,3.633-8.129,8.129-8.129h47.755c4.495,0,8.129,3.642,8.129,8.129
4780
+ v79.156l91.39,91.398c2.325,2.325,3.024,5.828,1.764,8.868c-1.26,3.032-4.227,5.007-7.511,5.007c-0.008,0-0.008,0-0.016,0
4781
+ l-56.64-0.114v150.98C359.32,398.29,355.686,401.923,351.191,401.923z M81.03,385.666h262.033V234.67
4782
+ c0-2.162,0.854-4.235,2.39-5.755c1.528-1.52,3.585-2.374,5.739-2.374c0.008,0,0.008,0,0.016,0l45.105,0.089l-79.855-79.863
4783
+ c-1.528-1.528-2.382-3.593-2.382-5.747V66.628h-31.498v26.645c0,3.284-1.975,6.251-5.015,7.511
4784
+ c-3.032,1.268-6.527,0.569-8.86-1.764l-57.038-57.038l-183.95,183.95l45.203,0.089c4.487,0.008,8.112,3.642,8.112,8.129
4785
+ C81.03,234.149,81.03,385.666,81.03,385.666z`
4786
+ })
4787
+ ], -1)), Kc = [
4788
+ qc
4789
+ ], Jc = { tabindex: "0" }, Yc = { style: { width: "11pt" } }, Qc = /* @__PURE__ */ gr(() => /* @__PURE__ */ D("g", { transform: "matrix(-0.08088215,0,0,0.08088215,9.8016177,3.1263021e-6)" }, [
4790
+ /* @__PURE__ */ D("path", {
4791
+ d: "M 93.148438,80.832031 C 109.5,57.742188 104.03125,25.769531 80.941406,9.421875 57.851562,-6.925781 25.878906,-1.460938 9.53125,21.632812 -6.816406,44.722656 -1.351562,76.691406 21.742188,93.039062 38.222656,104.70703 60.011719,105.60547 77.394531,95.339844 l 37.769529,37.542966 c 4.07813,4.29297 10.86328,4.46485 15.15625,0.38672 4.29297,-4.07422 4.46485,-10.85937 0.39063,-15.15234 -0.12891,-0.13672 -0.25391,-0.26172 -0.39063,-0.39063 z m -41.839844,3.5 C 33.0625,84.335938 18.269531,69.554688 18.257812,51.308594 18.253906,33.0625 33.035156,18.269531 51.285156,18.261719 c 18.222656,-0.0078 33.007813,14.75 33.042969,32.972656 0.03125,18.25 -14.742187,33.066406 -32.996094,33.097656 -0.0078,0 -0.01172,0 -0.02344,0 z m 0,0",
4792
+ style: { fill: "#000000", "fill-opacity": "1", "fill-rule": "nonzero", stroke: "none" },
4793
+ id: "path2"
4794
+ })
4795
+ ], -1)), Xc = [
4796
+ Qc
4797
+ ], Zc = /* @__PURE__ */ Z({
4798
+ __name: "SheetNav",
4799
+ props: {
4800
+ breadcrumbs: {}
4801
+ },
4802
+ setup(e) {
4803
+ const t = e, n = T([]), o = T(!0), r = T(!1), s = T(""), i = T(null), a = L(() => o.value ? "unrotated" : "rotated");
4804
+ zt(() => {
4805
+ n.value = t.breadcrumbs || [];
4806
+ });
4807
+ const c = () => {
4808
+ o.value = !o.value;
4809
+ }, u = async () => {
4810
+ r.value = !r.value, await Ke(() => {
4811
+ i.value.focus();
4812
+ });
4813
+ }, l = (p) => {
4814
+ p.preventDefault(), p.stopPropagation();
4815
+ }, d = async (p) => {
4816
+ p.preventDefault(), p.stopPropagation(), await u();
4817
+ }, f = () => {
4818
+ };
4819
+ return (p, m) => {
4820
+ const v = xr("router-link");
4821
+ return x(), A("footer", null, [
4822
+ D("ul", Fc, [
4823
+ D("li", {
4824
+ class: "hidebreadcrumbs",
4825
+ onClick: c,
4826
+ onKeydown: tt(c, ["enter"])
4827
+ }, [
4828
+ D("a", Gc, [
4829
+ D("div", {
4830
+ class: uo(a.value)
4831
+ }, "×", 2)
4832
+ ])
4833
+ ], 32),
4834
+ D("li", {
4835
+ class: "hometab",
4836
+ onClick: f,
4837
+ onKeydown: tt(f, ["enter"]),
4838
+ style: ce({ display: o.value ? "block" : "none" })
4839
+ }, [
4840
+ pt(v, {
4841
+ to: "/home",
4842
+ tabindex: "0"
4843
+ }, {
4844
+ default: ht(() => [
4845
+ (x(), A("svg", zc, Kc))
4846
+ ]),
4847
+ _: 1
4848
+ })
4849
+ ], 36),
4850
+ D("li", {
4851
+ class: "searchtab",
4852
+ onClick: u,
4853
+ onKeydown: tt(u, ["enter"]),
4854
+ style: ce({ display: o.value ? "block" : "none" })
4855
+ }, [
4856
+ D("a", Jc, [
4857
+ D("span", {
4858
+ style: ce({ display: r.value ? "none" : "block" })
4859
+ }, [
4860
+ (x(), A("svg", Yc, Xc))
4861
+ ], 4),
4862
+ ze(D("input", {
4863
+ "onUpdate:modelValue": m[0] || (m[0] = (g) => s.value = g),
4864
+ ref_key: "searchinput",
4865
+ ref: i,
4866
+ style: ce({ display: r.value ? "block" : "none" }),
4867
+ onClick: m[1] || (m[1] = (g) => l(g)),
4868
+ onInput: m[2] || (m[2] = (g) => l(g)),
4869
+ onBlur: m[3] || (m[3] = (g) => d(g)),
4870
+ onKeydown: m[4] || (m[4] = tt((g) => d(g), ["enter"])),
4871
+ type: "text"
4872
+ }, null, 36), [
4873
+ [$r, s.value]
4874
+ ])
4875
+ ])
4876
+ ], 36),
4877
+ (x(!0), A(Oe, null, Pe(n.value, (g, S) => (x(), A("li", {
4878
+ key: S,
4879
+ style: ce({ display: o.value ? "block" : "none" })
4880
+ }, [
4881
+ pt(v, {
4882
+ tabindex: "0",
4883
+ to: g.to
4884
+ }, {
4885
+ default: ht(() => [
4886
+ go(le(g.title), 1)
4887
+ ]),
4888
+ _: 2
4889
+ }, 1032, ["to"])
4890
+ ], 4))), 128))
4891
+ ])
4892
+ ]);
4893
+ };
4894
+ }
4895
+ }), el = /* @__PURE__ */ tn(Zc, [["__scopeId", "data-v-18bfde6e"]]), nl = {
4896
+ install: (e) => {
4897
+ e.component("ActionSet", Fr), e.component("CommandPalette", qr), e.component("Doctype", tc), e.component("Records", Wc), e.component("SheetNav", el);
4898
+ }
4899
+ };
4900
+ export {
4901
+ Fr as ActionSet,
4902
+ qr as CommandPalette,
4903
+ tc as Doctype,
4904
+ Wc as Records,
4905
+ el as SheetNav,
4906
+ nl as StonecropDesktop
4907
+ };
4908
+ //# sourceMappingURL=desktop.js.map