@aeria-ui/ui 0.0.63 → 0.0.65

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (23) hide show
  1. package/dist/_id_-149df831.js +37 -0
  2. package/dist/{activation-7645786e.js → activation-d3f6dc73.js} +1 -1
  3. package/dist/components/aeria-insert-panel/aeria-insert-panel.vue.d.ts +31 -0
  4. package/dist/components/form/aeria-form/aeria-form.vue.d.ts +0 -4
  5. package/dist/components/form/aeria-options/aeria-options.vue.d.ts +8 -4
  6. package/dist/components/form/aeria-search/_internals/components/aeria-search-item/aeria-search-item.vue.d.ts +1 -0
  7. package/dist/components/form/types.d.ts +1 -0
  8. package/dist/{profile-7847d400.js → index-1bbeba72.js} +30 -30
  9. package/dist/{crud-view-3df511a9.js → index-38b13e16.js} +7 -7
  10. package/dist/index-6876218a.js +3428 -0
  11. package/dist/{password-change-55124275.js → index-87c76c28.js} +14 -14
  12. package/dist/{signin-81d4ab57.js → signin-78854e9e.js} +1 -1
  13. package/dist/{signup-ab6052da.js → signup-42edefc2.js} +1 -1
  14. package/dist/style.css +1 -1
  15. package/dist/ui.js +13 -13
  16. package/dist/views/dashboard/crud/[collection]/[id].vue.d.ts +16 -0
  17. package/package.json +2 -2
  18. package/dist/components/aeria-crud/_internals/components/aeria-insert-panel/aeria-insert-panel.vue.d.ts +0 -9
  19. package/dist/index-13fe0da8.js +0 -3321
  20. /package/dist/components/{aeria-crud/_internals/components/aeria-filter-panel → aeria-filter-panel}/aeria-filter-panel.vue.d.ts +0 -0
  21. /package/dist/views/dashboard/{crud-view/crud-view.vue.d.ts → crud/[collection]/index.vue.d.ts} +0 -0
  22. /package/dist/views/dashboard/user/password-change/{password-change.vue.d.ts → index.vue.d.ts} +0 -0
  23. /package/dist/views/dashboard/user/profile/{profile.vue.d.ts → index.vue.d.ts} +0 -0
@@ -0,0 +1,3428 @@
1
+ import { defineComponent as U, ref as J, resolveDirective as ne, openBlock as o, createElementBlock as i, normalizeClass as K, Fragment as P, renderList as D, withDirectives as N, toDisplayString as k, createCommentVNode as y, createTextVNode as W, unref as e, renderSlot as I, inject as ve, computed as Q, createElementVNode as V, mergeProps as H, createBlock as g, resolveDynamicComponent as he, withCtx as f, useCssVars as Ct, Teleport as Xe, onMounted as vt, watch as ue, createVNode as z, vModelDynamic as Ot, onBeforeMount as yt, normalizeStyle as $e, withModifiers as qe, pushScopeId as Ee, popScopeId as De, provide as ye, createSlots as ce, normalizeProps as pe, guardReactiveProps as Ve, vModelCheckbox as It, onUnmounted as At, isRef as ct, resolveComponent as Bt, Suspense as wt, useSlots as St, h as jt } from "vue";
2
+ import { t as M, useI18n as Tt } from "@aeria-ui/i18n";
3
+ import { useScrollObserver as Ye, useBreakpoints as ze, useMask as Lt, PAGINATION_PER_PAGE_DEFAULTS as Rt, API_URL as ht, request as zt, useDebounce as $t, isDocumentComplete as Mt, getObjectKey as Ft, convertToSearchQuery as qt, useAction as Ut, convertFromSearchQuery as Et, usePasswordPolicy as Dt } from "@aeria-ui/core";
4
+ import { arraysIntersect as bt, getReferenceProperty as _e, convertConditionToQuery as Ht, deepClone as Re, freshItem as Qt, isRequired as Gt, evaluateCondition as Ke } from "@aeriajs/common";
5
+ import { useStore as ie, getStoreId as Me, useParentStore as ge, STORE_ID as He, getGlobalStateManager as gt } from "@aeria-ui/state-management";
6
+ import { useRouter as Ie } from "vue-router";
7
+ const Wt = ["onClick"], Kt = { key: 0 }, Xt = {
8
+ key: 0,
9
+ class: "accordion__content"
10
+ }, Yt = /* @__PURE__ */ U({
11
+ __name: "aeria-accordion",
12
+ props: {
13
+ enumerate: { type: Boolean },
14
+ noPadding: { type: Boolean },
15
+ headers: {}
16
+ },
17
+ setup(d) {
18
+ const r = J(null), a = (t) => typeof t == "string" ? t : t.title;
19
+ return (t, l) => {
20
+ const s = ne("clickable");
21
+ return o(), i("div", {
22
+ class: K({
23
+ accordion: !0,
24
+ "accordion--padded": !t.noPadding
25
+ })
26
+ }, [
27
+ (o(!0), i(P, null, D(Object.keys(t.$slots).filter((u) => u !== "default"), (u, v) => (o(), i("div", {
28
+ key: u,
29
+ class: "accordion__slot"
30
+ }, [
31
+ N((o(), i("div", {
32
+ class: "accordion__header",
33
+ onClick: (c) => r.value === u ? r.value = null : r.value = u
34
+ }, [
35
+ t.enumerate ? (o(), i("span", Kt, k(v + 1) + ". ", 1)) : y("", !0),
36
+ W(" " + k(t.headers[u] ? a(t.headers[u]) : e(M)(u)), 1)
37
+ ], 8, Wt)), [
38
+ [s]
39
+ ]),
40
+ r.value === u ? (o(), i("div", Xt, [
41
+ I(t.$slots, u, {}, void 0, !0)
42
+ ])) : y("", !0)
43
+ ]))), 128))
44
+ ], 2);
45
+ };
46
+ }
47
+ });
48
+ const X = (d, r) => {
49
+ const a = d.__vccOpts || d;
50
+ for (const [t, l] of r)
51
+ a[t] = l;
52
+ return a;
53
+ }, Rl = /* @__PURE__ */ X(Yt, [["__scopeId", "data-v-3ea933d4"]]), Jt = /* @__PURE__ */ U({
54
+ __name: "aeria-badge",
55
+ props: {
56
+ large: { type: Boolean },
57
+ alt: { type: Boolean }
58
+ },
59
+ setup(d) {
60
+ return (r, a) => (o(), i("div", {
61
+ class: K(`
62
+ badge
63
+ ${r.large && "badge--large"}
64
+ ${r.alt && "badge--alt"}
65
+ `)
66
+ }, [
67
+ I(r.$slots, "default", {}, void 0, !0)
68
+ ], 2));
69
+ }
70
+ });
71
+ const be = /* @__PURE__ */ X(Jt, [["__scopeId", "data-v-47f92648"]]), Zt = /* @__PURE__ */ U({
72
+ __name: "aeria-bare-button",
73
+ props: {
74
+ disabled: { type: Boolean }
75
+ },
76
+ emits: ["click"],
77
+ setup(d, { emit: r }) {
78
+ const a = d, t = r, l = (s) => {
79
+ a.disabled || t("click", s);
80
+ };
81
+ return (s, u) => (o(), i("button", {
82
+ class: K(`
83
+ barebutton
84
+ barebutton--${s.disabled ? "disabled" : "enabled"}
85
+ `),
86
+ onClick: l
87
+ }, [
88
+ I(s.$slots, "default", {}, void 0, !0)
89
+ ], 2));
90
+ }
91
+ });
92
+ const fe = /* @__PURE__ */ X(Zt, [["__scopeId", "data-v-35bc81ae"]]), Pt = ["href"], Nt = {
93
+ key: 0,
94
+ "data-component": "icon-label"
95
+ }, xt = /* @__PURE__ */ U({
96
+ __name: "aeria-icon",
97
+ props: {
98
+ icon: {},
99
+ size: {},
100
+ medium: { type: Boolean },
101
+ reactive: { type: [Boolean, null] },
102
+ iconRight: { type: Boolean },
103
+ fill: {}
104
+ },
105
+ setup(d) {
106
+ const r = d, a = typeof r.reactive == "boolean" ? r.reactive : ve("iconReactive", !1), t = Q(() => {
107
+ var l;
108
+ return (l = r.icon) != null && l.includes(":") ? r.icon : `regular:${r.icon}`;
109
+ });
110
+ return (l, s) => (o(), i("a", {
111
+ class: K(`
112
+ icon
113
+ ${e(a) && "icon--reactive"}
114
+ ${l.$slots.default ? "icon--centered" : "icon--standalone"}
115
+ `)
116
+ }, [
117
+ V("div", {
118
+ class: K(`
119
+ icon__icon
120
+ ${l.size && `icon__icon--${l.size}`}
121
+ ${l.iconRight && "icon__icon--right"}
122
+ `)
123
+ }, [
124
+ (o(), i("svg", H({
125
+ width: "24",
126
+ height: "24",
127
+ viewBox: "0 0 256 256",
128
+ "data-component": "icon"
129
+ }, {
130
+ ...l.fill ? { fill: l.fill } : {}
131
+ }), [
132
+ V("use", {
133
+ href: `/assets/icons.svg#${t.value}`
134
+ }, null, 8, Pt)
135
+ ], 16))
136
+ ], 2),
137
+ l.$slots.default ? (o(), i("div", Nt, [
138
+ I(l.$slots, "default", {}, void 0, !0)
139
+ ])) : y("", !0)
140
+ ], 2));
141
+ }
142
+ });
143
+ const x = /* @__PURE__ */ X(xt, [["__scopeId", "data-v-4b763bd3"]]), en = { class: "panel__header-left" }, tn = { key: 1 }, nn = {
144
+ key: 2,
145
+ style: { "margin-left": "auto" }
146
+ }, on = /* @__PURE__ */ U({
147
+ __name: "aeria-panel",
148
+ props: {
149
+ closeHint: { type: Boolean, default: !1 },
150
+ modelValue: { default: !0 },
151
+ title: {},
152
+ float: { type: Boolean },
153
+ fixedRight: { type: Boolean },
154
+ floating: { type: Boolean },
155
+ loading: { type: Boolean },
156
+ bordered: { type: Boolean },
157
+ overlay: { type: Boolean },
158
+ invisibleOverlay: { type: Boolean },
159
+ collapsed: { type: Boolean },
160
+ collapsible: { type: Boolean, default: !1 },
161
+ fill: { type: Boolean },
162
+ fillFooter: { type: Boolean },
163
+ transparent: { type: Boolean },
164
+ transparentMobile: { type: Boolean },
165
+ outerHeader: { type: Boolean },
166
+ overlayLayer: {}
167
+ },
168
+ emits: ["update:modelValue", "update:collapsed", "update:closeHint", "overlayClick", "close"],
169
+ setup(d, { emit: r }) {
170
+ const a = d, t = r, l = Q(() => a.floating || a.float), s = J(a.collapsed), u = J(null), { reachedEnd: v } = Ye(u), c = () => {
171
+ t("update:modelValue", !1), t("close");
172
+ }, h = () => {
173
+ t("overlayClick");
174
+ }, p = (n) => {
175
+ t("update:collapsed", n), s.value = n;
176
+ };
177
+ return (n, _) => {
178
+ const $ = ne("clickable"), b = ne("loading"), S = ne("overlay");
179
+ return n.modelValue ? N((o(), i("div", {
180
+ key: 0,
181
+ class: K(`
182
+ panel
183
+ ${n.fixedRight && "panel--fixed"}
184
+ `)
185
+ }, [
186
+ (o(), g(he(
187
+ l.value ? "dialog" : "div"
188
+ ), {
189
+ "data-component": "panel",
190
+ class: K(`
191
+ aeria-surface
192
+ panel__content
193
+ ${l.value && "panel__content--floating"}
194
+ ${n.bordered && "panel__content--bordered"}
195
+ ${n.fixedRight && "panel__content--fixed-right"}
196
+ ${n.transparent && "panel__content--transparent"}
197
+ ${n.transparentMobile && "panel__content--transparent-mobile"}
198
+ ${n.outerHeader && "panel__content--outer-header"}
199
+ `),
200
+ onClick: _[2] || (_[2] = (T) => T.stopPropagation())
201
+ }, {
202
+ default: f(() => [
203
+ n.$slots.header || n.title ? (o(), i("div", {
204
+ key: 0,
205
+ class: K(`
206
+ panel__header
207
+ ${s.value && "panel__header--collapsed"}
208
+ ${n.outerHeader && "panel__header--outer"}
209
+ `)
210
+ }, [
211
+ V("div", en, [
212
+ n.$slots.header ? I(n.$slots, "header", { key: 0 }, void 0, !0) : n.title ? (o(), i("div", tn, k(n.title), 1)) : y("", !0),
213
+ n.$slots.extra ? (o(), i("div", nn, [
214
+ I(n.$slots, "extra", {}, void 0, !0)
215
+ ])) : y("", !0)
216
+ ]),
217
+ n.collapsible && s.value ? N((o(), g(x, {
218
+ key: 0,
219
+ reactive: "",
220
+ icon: "plus",
221
+ onClick: _[0] || (_[0] = (T) => p(!s.value))
222
+ }, null, 512)), [
223
+ [$]
224
+ ]) : n.collapsible && !s.value ? N((o(), g(x, {
225
+ key: 1,
226
+ reactive: "",
227
+ icon: "minus",
228
+ onClick: _[1] || (_[1] = (T) => p(!s.value))
229
+ }, null, 512)), [
230
+ [$]
231
+ ]) : n.closeHint ? N((o(), g(x, {
232
+ key: 2,
233
+ reactive: "",
234
+ icon: "x",
235
+ onClick: c
236
+ }, null, 512)), [
237
+ [$]
238
+ ]) : y("", !0)
239
+ ], 2)) : y("", !0),
240
+ s.value ? y("", !0) : N((o(), i("div", {
241
+ key: 1,
242
+ ref_key: "body",
243
+ ref: u,
244
+ class: K(`
245
+ panel__body
246
+ ${n.fill || "panel__body--padded"}
247
+ `)
248
+ }, [
249
+ I(n.$slots, "default", {}, void 0, !0)
250
+ ], 2)), [
251
+ [b, n.loading]
252
+ ]),
253
+ n.$slots.footer ? (o(), i("div", {
254
+ key: 2,
255
+ class: K(`
256
+ panel__footer
257
+ ${n.fillFooter || "panel__footer--padded"}
258
+ ${e(v) || "panel__footer--shadowed"}
259
+ `)
260
+ }, [
261
+ I(n.$slots, "footer", {}, void 0, !0)
262
+ ], 2)) : y("", !0)
263
+ ]),
264
+ _: 3
265
+ }, 8, ["class"]))
266
+ ], 2)), [
267
+ [S, {
268
+ condition: n.overlay || n.fixedRight || l.value,
269
+ invisible: n.invisibleOverlay,
270
+ click: h,
271
+ layer: n.overlayLayer || (l.value ? 60 : n.fixedRight ? 50 : 0)
272
+ }]
273
+ ]) : y("", !0);
274
+ };
275
+ }
276
+ });
277
+ const Ae = /* @__PURE__ */ X(on, [["__scopeId", "data-v-73b47cf0"]]), an = { class: "button__content" }, ln = {
278
+ key: 1,
279
+ class: "button__content"
280
+ }, sn = /* @__PURE__ */ U({
281
+ __name: "aeria-button",
282
+ props: {
283
+ size: {},
284
+ variant: {},
285
+ small: { type: Boolean },
286
+ large: { type: Boolean },
287
+ icon: {},
288
+ disabled: { type: Boolean },
289
+ loading: { type: Boolean }
290
+ },
291
+ setup(d) {
292
+ const r = d, a = ve("buttonVariant", r.variant) || "primary", t = (() => {
293
+ switch (!0) {
294
+ case r.small:
295
+ return "small";
296
+ case r.large:
297
+ return "large";
298
+ }
299
+ return ve("buttonSize", r.size) || "medium";
300
+ })();
301
+ return (l, s) => (o(), g(fe, {
302
+ class: K(`
303
+ button
304
+ button--${e(a)}
305
+ button--${e(t)}
306
+ ${l.loading && "button--loading"}
307
+ `),
308
+ disabled: l.disabled
309
+ }, {
310
+ default: f(() => [
311
+ l.icon ? (o(), g(x, {
312
+ key: 0,
313
+ icon: l.icon
314
+ }, {
315
+ default: f(() => [
316
+ V("div", an, [
317
+ I(l.$slots, "default", {}, void 0, !0)
318
+ ])
319
+ ]),
320
+ _: 3
321
+ }, 8, ["icon"])) : (o(), i("div", ln, [
322
+ I(l.$slots, "default", {}, void 0, !0)
323
+ ]))
324
+ ]),
325
+ _: 3
326
+ }, 8, ["class", "disabled"]));
327
+ }
328
+ });
329
+ const re = /* @__PURE__ */ X(sn, [["__scopeId", "data-v-c328251b"]]), rn = { class: "card__picture" }, un = { class: "card__footer" }, cn = { class: "card__footer-upper" }, dn = { class: "card__badge" }, pn = /* @__PURE__ */ U({
330
+ __name: "aeria-card",
331
+ props: {
332
+ inactive: { type: Boolean },
333
+ horizontal: { type: Boolean }
334
+ },
335
+ setup(d) {
336
+ return (r, a) => (o(), i("div", {
337
+ class: K(`
338
+ card
339
+ ${r.inactive && "card--inactive"}
340
+ ${r.horizontal && "card--horizontal"}
341
+ `)
342
+ }, [
343
+ V("div", rn, [
344
+ I(r.$slots, "default", {}, void 0, !0)
345
+ ]),
346
+ V("div", un, [
347
+ V("div", cn, [
348
+ V("div", null, [
349
+ I(r.$slots, "footer", {}, void 0, !0)
350
+ ]),
351
+ r.$slots.actions ? I(r.$slots, "actions", { key: 0 }, void 0, !0) : y("", !0)
352
+ ]),
353
+ V("div", dn, [
354
+ I(r.$slots, "badge", {}, void 0, !0)
355
+ ])
356
+ ])
357
+ ], 2));
358
+ }
359
+ });
360
+ const _n = /* @__PURE__ */ X(pn, [["__scopeId", "data-v-c1a322df"]]), mn = { class: "content__body" }, fn = {
361
+ key: 0,
362
+ class: "content__section"
363
+ }, vn = { class: "content__item" }, yn = /* @__PURE__ */ U({
364
+ __name: "aeria-context-menu",
365
+ props: {
366
+ actions: {},
367
+ subject: {},
368
+ overlayLayer: {}
369
+ },
370
+ emits: ["actionClick"],
371
+ setup(d, { emit: r }) {
372
+ Ct((c) => ({
373
+ "21ea8da7": v.value.x,
374
+ "21ea8da8": v.value.y
375
+ }));
376
+ const a = r, t = J(null), l = J(!1), s = (c) => c == null ? void 0 : c.filter((h) => {
377
+ if (h.roles) {
378
+ const p = ie("user");
379
+ return bt(h.roles, p.currentUser.roles);
380
+ }
381
+ return !0;
382
+ }), u = (c, h) => {
383
+ c.click(h), a("actionClick", {
384
+ action: c,
385
+ subject: h
386
+ }), l.value = !1;
387
+ }, v = Q(() => {
388
+ if (!t.value)
389
+ return {
390
+ x: 0,
391
+ y: 0
392
+ };
393
+ const c = t.value.getBoundingClientRect().top, h = t.value.getBoundingClientRect().left, p = t.value.offsetHeight;
394
+ return {
395
+ _: l.value,
396
+ x: Math.floor(h) + "px",
397
+ y: Math.floor(c + p) + "px"
398
+ };
399
+ });
400
+ return (c, h) => {
401
+ const p = ne("overlay");
402
+ return o(), i(P, null, [
403
+ Object.keys(c.$slots).some((n) => n !== "default") || c.actions !== void 0 && c.actions.length > 0 ? (o(), i("div", {
404
+ key: 0,
405
+ ref_key: "contextmenu",
406
+ ref: t,
407
+ class: "contextmenu"
408
+ }, [
409
+ V("a", {
410
+ class: "contextmenu__trigger",
411
+ onClick: h[0] || (h[0] = (n) => l.value = !0)
412
+ }, [
413
+ I(c.$slots, "default", {}, void 0, !0)
414
+ ])
415
+ ], 512)) : y("", !0),
416
+ l.value ? (o(), g(Xe, {
417
+ key: 1,
418
+ to: "main"
419
+ }, [
420
+ N((o(), g(Ae, {
421
+ modelValue: l.value,
422
+ "onUpdate:modelValue": h[4] || (h[4] = (n) => l.value = n),
423
+ fill: "",
424
+ bordered: "",
425
+ class: "content",
426
+ style: { "--panel-min-width": "0" }
427
+ }, {
428
+ default: f(() => [
429
+ V("div", mn, [
430
+ c.$slots.header ? (o(), i("div", fn, [
431
+ I(c.$slots, "header", {}, void 0, !0)
432
+ ])) : y("", !0),
433
+ Object.keys(c.$slots).filter((n) => !["default", "extra", "header"].includes(n)).length > 0 ? (o(), i("div", {
434
+ key: 1,
435
+ class: "content__section",
436
+ onClick: h[1] || (h[1] = (n) => l.value = !1)
437
+ }, [
438
+ (o(!0), i(P, null, D(Object.keys(c.$slots).filter((n) => !["default", "extra", "header"].includes(n)), (n, _) => (o(), g(fe, {
439
+ key: `slot-${_}`,
440
+ class: "content__item content__item--reactive"
441
+ }, {
442
+ default: f(() => [
443
+ I(c.$slots, n, {}, void 0, !0)
444
+ ]),
445
+ _: 2
446
+ }, 1024))), 128))
447
+ ])) : y("", !0),
448
+ c.actions !== void 0 && c.actions.length > 0 ? (o(), i("div", {
449
+ key: 2,
450
+ class: "content__section",
451
+ onClick: h[2] || (h[2] = (n) => l.value = !1)
452
+ }, [
453
+ (o(!0), i(P, null, D(s(c.actions), (n, _) => (o(), g(fe, {
454
+ key: `action-${_}`,
455
+ class: "content__item content__item--reactive",
456
+ onClick: ($) => u(n, c.subject)
457
+ }, {
458
+ default: f(() => [
459
+ n.icon ? (o(), g(x, {
460
+ key: 0,
461
+ icon: n.icon
462
+ }, {
463
+ default: f(() => [
464
+ W(k(n.translate ? e(M)(n.label, { capitalize: !0 }) : n.label), 1)
465
+ ]),
466
+ _: 2
467
+ }, 1032, ["icon"])) : y("", !0)
468
+ ]),
469
+ _: 2
470
+ }, 1032, ["onClick"]))), 128))
471
+ ])) : y("", !0),
472
+ c.$slots.extra ? (o(), i("div", {
473
+ key: 3,
474
+ class: "content__section",
475
+ onClick: h[3] || (h[3] = (n) => l.value = !1)
476
+ }, [
477
+ V("div", vn, [
478
+ c.$slots.extra ? I(c.$slots, "extra", { key: 0 }, void 0, !0) : y("", !0)
479
+ ])
480
+ ])) : y("", !0)
481
+ ])
482
+ ]),
483
+ _: 3
484
+ }, 8, ["modelValue"])), [
485
+ [
486
+ p,
487
+ {
488
+ layer: c.overlayLayer,
489
+ click: () => {
490
+ l.value = !1;
491
+ }
492
+ },
493
+ void 0,
494
+ { invisibleOnLarge: !0 }
495
+ ]
496
+ ])
497
+ ])) : y("", !0)
498
+ ], 64);
499
+ };
500
+ }
501
+ });
502
+ const Ce = /* @__PURE__ */ X(yn, [["__scopeId", "data-v-35e35d32"]]), hn = { class: "info__content" }, $n = /* @__PURE__ */ U({
503
+ __name: "aeria-info",
504
+ props: {
505
+ where: {}
506
+ },
507
+ setup(d) {
508
+ const r = d, a = ze(), t = J(!1), l = r.where || "top";
509
+ return (s, u) => e(a).md ? (o(), i("div", {
510
+ key: 0,
511
+ class: "info",
512
+ onMouseleave: u[1] || (u[1] = (v) => t.value = !1)
513
+ }, [
514
+ t.value ? (o(), i("div", {
515
+ key: 0,
516
+ class: K(`
517
+ info__bubble
518
+ info__bubble--${e(l)}
519
+ `)
520
+ }, [
521
+ V("div", hn, [
522
+ I(s.$slots, "text", {}, void 0, !0)
523
+ ])
524
+ ], 2)) : y("", !0),
525
+ V("div", {
526
+ onMouseover: u[0] || (u[0] = (v) => t.value = !0)
527
+ }, [
528
+ I(s.$slots, "default", {}, void 0, !0)
529
+ ], 32)
530
+ ], 32)) : I(s.$slots, "default", { key: 1 }, void 0, !0);
531
+ }
532
+ });
533
+ const bn = /* @__PURE__ */ X($n, [["__scopeId", "data-v-76defa0b"]]), gn = { class: "input" }, kn = {
534
+ key: 0,
535
+ class: "input__label"
536
+ }, Vn = {
537
+ key: 1,
538
+ class: "input__hint"
539
+ }, Cn = ["placeholder", "readonly", "value"], On = ["value"], In = {
540
+ key: 1,
541
+ class: "input__clipboard"
542
+ }, An = /* @__PURE__ */ U({
543
+ __name: "aeria-input",
544
+ props: {
545
+ modelValue: {},
546
+ property: {},
547
+ propertyName: {},
548
+ parentPropertyName: {},
549
+ parentCollection: {},
550
+ readOnly: { type: Boolean },
551
+ variant: {}
552
+ },
553
+ emits: ["update:modelValue", "input", "change"],
554
+ setup(d, { emit: r }) {
555
+ var B;
556
+ const a = d, t = a.property || {}, l = "icon" in t || "inputType" in t && t.inputType === "search", s = ve("searchOnly", !1), u = ve("innerInputLabel", !1), v = !s && (a.readOnly || t.readOnly), c = (F) => navigator.clipboard.writeText(F), h = r, p = ve("inputVariant", a.variant) || "normal", n = {
557
+ name: a.propertyName,
558
+ readonly: v,
559
+ type: (() => {
560
+ if ("type" in t)
561
+ switch (t.type) {
562
+ case "number":
563
+ case "integer":
564
+ return "number";
565
+ }
566
+ if (t.inputType)
567
+ return t.inputType;
568
+ switch (typeof a.modelValue) {
569
+ case "string":
570
+ return "text";
571
+ case "number":
572
+ return "number";
573
+ default:
574
+ return "text";
575
+ }
576
+ })(),
577
+ placeholder: u ? t.description || a.propertyName : t.placeholder
578
+ };
579
+ "type" in t && ((t.type === "number" || t.type === "integer") && (t.minimum && (n.min = t.minimum), t.exclusiveMinimum && (n.min = t.exclusiveMinimum + 1), t.maximum && (n.max = t.maximum), t.exclusiveMaximum && (n.max = t.exclusiveMaximum - 1)), t.type === "string" && ((t.format === "date" || t.format === "date-time") && (n.type = !s && t.format === "date-time" ? "datetime-local" : "date"), n.minlength = t.minLength, n.maxlength = t.maxLength)), n.type === "text" && s && (n.type = "search"), vt(() => {
580
+ a.modelValue !== null && T(a.modelValue);
581
+ });
582
+ const _ = () => {
583
+ try {
584
+ return a.modelValue ? new Date(a.modelValue).toISOString().split("T").shift() : "";
585
+ } catch {
586
+ return "";
587
+ }
588
+ }, $ = J([
589
+ "date",
590
+ "date-time"
591
+ ].includes(n.type) ? _() : a.modelValue === null || a.modelValue === void 0 ? "" : a.modelValue), b = ((B = a.property) == null ? void 0 : B.type) === "string" && a.property.mask ? Lt(a.property.mask) : null, S = (F) => {
592
+ var Y;
593
+ return typeof $.value == "string" && ((Y = a.property) == null ? void 0 : Y.type) === "string" && b !== null ? ($.value = b.enmask($.value, void 0, {
594
+ defaultValue: !0
595
+ }), a.property.maskedValue === !0 ? $.value : b.unmask($.value)) : F;
596
+ }, T = (F) => {
597
+ const Y = (() => {
598
+ if (!F || typeof F != "string")
599
+ return F;
600
+ if (n.type === "number" || n.type === "integer")
601
+ return Number(F);
602
+ if (!("type" in t && t.type === "string"))
603
+ return S(F);
604
+ switch (t.format) {
605
+ case "date":
606
+ case "date-time":
607
+ return new Date(F);
608
+ default:
609
+ return S(F);
610
+ }
611
+ })();
612
+ h("input", Y), h("update:modelValue", Y);
613
+ }, Z = (F) => {
614
+ const Y = F.target.value;
615
+ $.value = Y, T(Y);
616
+ };
617
+ return ue(() => a.modelValue, (F, Y) => {
618
+ F instanceof Date || (Y && !F ? $.value = void 0 : $.value = b ? b.enmask(String(F), void 0, {
619
+ defaultValue: !0
620
+ }) : String(F));
621
+ }), (F, Y) => {
622
+ const w = ne("focus"), te = ne("clickable");
623
+ return o(), i("label", gn, [
624
+ e(u) ? y("", !0) : (o(), i("div", kn, [
625
+ F.$slots.default ? I(F.$slots, "default", { key: 0 }, void 0, !0) : I(F.$slots, "description", { key: 1 }, void 0, !0)
626
+ ])),
627
+ F.$slots.hint ? (o(), i("div", Vn, [
628
+ I(F.$slots, "hint", {}, void 0, !0)
629
+ ])) : y("", !0),
630
+ "element" in e(t) && e(t).element === "textarea" ? (o(), i("div", {
631
+ key: 2,
632
+ class: K(`
633
+ input__container
634
+ input__container--${e(p)}
635
+ `)
636
+ }, [
637
+ N(V("textarea", {
638
+ placeholder: n.placeholder,
639
+ readonly: n.readonly,
640
+ value: F.modelValue,
641
+ class: K(`
642
+ input__textarea
643
+ input__input--${e(p)}
644
+ `),
645
+ onInput: Z
646
+ }, null, 42, Cn), [
647
+ [w, e(t).focus]
648
+ ])
649
+ ], 2)) : (o(), i("div", {
650
+ key: 3,
651
+ class: K(`
652
+ input__container
653
+ input__container--${e(p)}
654
+ `)
655
+ }, [
656
+ N(V("input", H(n, {
657
+ value: $.value,
658
+ "data-component": "input",
659
+ class: `
660
+ input__input
661
+ input__input--${e(p)}
662
+ ${e(l) && "input__input--icon"}
663
+ ${e(v) && "input__input--readOnly"}
664
+ `,
665
+ onInput: Z,
666
+ onChange: Y[0] || (Y[0] = (C) => h("change", C))
667
+ }), null, 16, On), [
668
+ [w, e(t).focus]
669
+ ]),
670
+ e(l) ? (o(), g(x, {
671
+ key: 0,
672
+ icon: e(t).icon || "magnifying-glass",
673
+ class: K(`
674
+ input__icon
675
+ input__icon--${e(p)}
676
+ `)
677
+ }, null, 8, ["icon", "class"])) : y("", !0),
678
+ e(v) ? (o(), i("div", In, [
679
+ z(bn, null, {
680
+ text: f(() => [
681
+ W("Copiar")
682
+ ]),
683
+ default: f(() => [
684
+ N(z(x, {
685
+ icon: "clipboard",
686
+ onClick: Y[1] || (Y[1] = (C) => c(String(F.modelValue || "")))
687
+ }, null, 512), [
688
+ [te]
689
+ ])
690
+ ]),
691
+ _: 1
692
+ })
693
+ ])) : y("", !0)
694
+ ], 2))
695
+ ]);
696
+ };
697
+ }
698
+ });
699
+ const Oe = /* @__PURE__ */ X(An, [["__scopeId", "data-v-fa830575"]]), Bn = ["value"], wn = {
700
+ key: 1,
701
+ value: ""
702
+ }, Sn = ["value", "data-selected"], jn = /* @__PURE__ */ U({
703
+ __name: "aeria-select",
704
+ props: {
705
+ modelValue: {},
706
+ property: {},
707
+ propertyName: {},
708
+ parentPropertyName: {},
709
+ parentCollection: {},
710
+ readOnly: { type: Boolean },
711
+ booleanRef: { type: Boolean },
712
+ multiple: { type: [Boolean, Number] },
713
+ noOutline: { type: Boolean }
714
+ },
715
+ emits: ["update:modelValue", "change"],
716
+ setup(d, { emit: r }) {
717
+ const a = d, t = r, l = J(null), s = a.property, u = (p) => {
718
+ a.booleanRef && (v.value = p), t("update:modelValue", (p == null ? void 0 : p._id) || p), t("change", (p == null ? void 0 : p._id) || p);
719
+ }, v = a.booleanRef ? (() => {
720
+ const p = J(a.modelValue);
721
+ return Q({
722
+ get: () => {
723
+ switch (p.value) {
724
+ case "true":
725
+ return !0;
726
+ case "false":
727
+ return !1;
728
+ default:
729
+ return null;
730
+ }
731
+ },
732
+ set: (_) => {
733
+ p.value = _;
734
+ }
735
+ });
736
+ })() : Q({
737
+ get: () => a.modelValue,
738
+ set: u
739
+ }), c = (p) => Array.isArray(a.modelValue) ? a.modelValue.includes(p) : a.modelValue === p, h = Q(() => a.multiple ? typeof a.multiple == "number" ? a.multiple : 5 : 1);
740
+ return a.multiple && ue(() => a.modelValue, (p) => {
741
+ var _;
742
+ if (!l.value)
743
+ return;
744
+ const n = l.value.querySelector('option[data-selected="true"]');
745
+ n && n.removeAttribute("data-selected"), (_ = l.value.querySelector(`option[value="${p}"]`)) == null || _.setAttribute("data-selected", "true");
746
+ }), (p, n) => (o(), i("div", {
747
+ class: K({
748
+ select: !0,
749
+ "select--outline": !p.noOutline
750
+ })
751
+ }, [
752
+ V("select", H({
753
+ ref_key: "select",
754
+ ref: l,
755
+ value: e(v)
756
+ }, {
757
+ size: h.value
758
+ }, {
759
+ class: {
760
+ select__select: !0,
761
+ "select__select--multiple": !!a.multiple
762
+ },
763
+ onChange: n[0] || (n[0] = (_) => u(_.target.value))
764
+ }), [
765
+ e(s) && e(s).icon ? (o(), g(x, {
766
+ key: 0,
767
+ icon: e(s).icon
768
+ }, null, 8, ["icon"])) : y("", !0),
769
+ a.multiple ? y("", !0) : (o(), i("option", wn, k(e(M)("none")), 1)),
770
+ (o(!0), i(P, null, D(e(s) && "enum" in e(s) ? e(s).enum : [], (_) => {
771
+ var $;
772
+ return o(), i("option", {
773
+ key: _,
774
+ value: _,
775
+ "data-selected": c(_)
776
+ }, k(($ = e(s)) != null && $.translate ? e(M)(_) : _), 9, Sn);
777
+ }), 128)),
778
+ I(p.$slots, "default", {}, void 0, !0)
779
+ ], 16, Bn)
780
+ ], 2));
781
+ }
782
+ });
783
+ const Qe = /* @__PURE__ */ X(jn, [["__scopeId", "data-v-1f76ec88"]]), Tn = { class: "pagination" }, Ln = ["value"], Rn = { class: "pagination__control" }, zn = { class: "pagination__page-input" }, Mn = /* @__PURE__ */ U({
784
+ __name: "aeria-pagination",
785
+ props: {
786
+ pagination: {}
787
+ },
788
+ emits: ["paginate"],
789
+ setup(d, { emit: r }) {
790
+ const a = d, t = r, l = Q({
791
+ get: () => Math.floor(a.pagination.offset / a.pagination.limit),
792
+ set: (h) => {
793
+ a.pagination.offset = h * a.pagination.limit;
794
+ }
795
+ }), s = Q({
796
+ get: () => a.pagination.limit,
797
+ set: (h) => {
798
+ a.pagination.limit = Number(h);
799
+ }
800
+ }), u = J(l.value ? l.value + 1 : 1), v = Q(() => Math.ceil(a.pagination.recordsTotal / a.pagination.limit)), c = (h) => {
801
+ l.value = h === "previous" ? l.value - 1 : l.value + 1;
802
+ };
803
+ return ue([
804
+ l,
805
+ s
806
+ ], ([h]) => {
807
+ u.value = h + 1, t("paginate", {
808
+ offset: l.value * s.value,
809
+ limit: s.value
810
+ });
811
+ }), (h, p) => (o(), i("div", Tn, [
812
+ z(Qe, {
813
+ modelValue: s.value,
814
+ "onUpdate:modelValue": p[0] || (p[0] = (n) => s.value = n),
815
+ property: {
816
+ enum: [],
817
+ icon: "list"
818
+ },
819
+ class: "pagination__control"
820
+ }, {
821
+ default: f(() => [
822
+ (o(!0), i(P, null, D(e(Rt), (n) => (o(), i("option", {
823
+ key: `limit-${n}`,
824
+ value: n
825
+ }, k(n), 9, Ln))), 128))
826
+ ]),
827
+ _: 1
828
+ }, 8, ["modelValue"]),
829
+ V("div", Rn, [
830
+ z(fe, {
831
+ onClick: p[1] || (p[1] = (n) => l.value = 0)
832
+ }, {
833
+ default: f(() => [
834
+ z(x, {
835
+ reactive: "",
836
+ icon: "caret-double-left"
837
+ })
838
+ ]),
839
+ _: 1
840
+ }),
841
+ z(fe, {
842
+ disabled: l.value === 0,
843
+ onClick: p[2] || (p[2] = (n) => c("previous"))
844
+ }, {
845
+ default: f(() => [
846
+ z(x, {
847
+ reactive: "",
848
+ icon: "caret-left"
849
+ })
850
+ ]),
851
+ _: 1
852
+ }, 8, ["disabled"]),
853
+ V("div", zn, [
854
+ (o(), g(Oe, {
855
+ key: l.value,
856
+ modelValue: u.value,
857
+ "onUpdate:modelValue": p[3] || (p[3] = (n) => u.value = n),
858
+ property: {
859
+ type: "number",
860
+ minimum: 1
861
+ },
862
+ onChange: p[4] || (p[4] = (n) => {
863
+ l.value = u.value === 0 ? 0 : u.value - 1;
864
+ })
865
+ }, null, 8, ["modelValue"])),
866
+ V("span", null, k(e(M)("of")) + " " + k(v.value), 1)
867
+ ]),
868
+ z(fe, {
869
+ disabled: l.value === v.value - 1,
870
+ onClick: p[5] || (p[5] = (n) => c("next"))
871
+ }, {
872
+ default: f(() => [
873
+ z(x, {
874
+ reactive: "",
875
+ icon: "caret-right"
876
+ })
877
+ ]),
878
+ _: 1
879
+ }, 8, ["disabled"]),
880
+ z(fe, {
881
+ onClick: p[6] || (p[6] = (n) => l.value = v.value - 1)
882
+ }, {
883
+ default: f(() => [
884
+ z(x, {
885
+ reactive: "",
886
+ icon: "caret-double-right"
887
+ })
888
+ ]),
889
+ _: 1
890
+ })
891
+ ])
892
+ ]));
893
+ }
894
+ });
895
+ const Fn = /* @__PURE__ */ X(Mn, [["__scopeId", "data-v-41aa1ffc"]]), qn = { class: "checkbox__text" }, Un = ["innerHTML"], En = { class: "checkbox__hint" }, Dn = ["innerHTML"], Hn = {
896
+ inheritAttrs: !1
897
+ }, Qn = /* @__PURE__ */ U({
898
+ ...Hn,
899
+ __name: "aeria-checkbox",
900
+ props: {
901
+ modelValue: {},
902
+ property: {},
903
+ propertyName: {},
904
+ parentPropertyName: {},
905
+ parentCollection: {},
906
+ readOnly: { type: Boolean },
907
+ value: {},
908
+ variant: {}
909
+ },
910
+ emits: ["update:modelValue", "change"],
911
+ setup(d, { emit: r }) {
912
+ const a = d, t = a.property, l = a.readOnly || (t == null ? void 0 : t.readOnly), s = (() => {
913
+ if (t && "type" in t)
914
+ switch (t.type) {
915
+ case "array":
916
+ case "boolean":
917
+ return "checkbox";
918
+ }
919
+ return "radio";
920
+ })(), u = r, v = a.value || !1, c = Q({
921
+ get: () => {
922
+ var p;
923
+ if (t) {
924
+ if ("type" in t && t.type === "boolean")
925
+ return !!a.value;
926
+ if ("items" in t)
927
+ return (p = a.modelValue) == null ? void 0 : p.includes(a.value);
928
+ }
929
+ return a.modelValue === a.value;
930
+ },
931
+ set: () => {
932
+ var p;
933
+ if (!l) {
934
+ if (t) {
935
+ if ("type" in t && t.type === "boolean") {
936
+ u("update:modelValue", !a.modelValue);
937
+ return;
938
+ }
939
+ if ("items" in t) {
940
+ if ((p = a.modelValue) != null && p.includes(v)) {
941
+ u("update:modelValue", a.modelValue.filter((n) => n !== v));
942
+ return;
943
+ }
944
+ u("update:modelValue", [v].concat(a.modelValue || []));
945
+ return;
946
+ }
947
+ }
948
+ u("update:modelValue", a.value);
949
+ }
950
+ }
951
+ }), h = (p) => {
952
+ l && p.preventDefault();
953
+ };
954
+ return (p, n) => {
955
+ var $, b;
956
+ const _ = ne("clickable");
957
+ return N((o(), i("label", {
958
+ class: K(`
959
+ checkbox
960
+ ${e(l) && "checkbox--readOnly"}
961
+ `)
962
+ }, [
963
+ N(V("input", H({
964
+ "onUpdate:modelValue": n[0] || (n[0] = (S) => c.value = S)
965
+ }, {
966
+ type: e(s),
967
+ readOnly: e(l),
968
+ checked: c.value
969
+ }, {
970
+ class: "checkbox__input",
971
+ onClick: h
972
+ }), null, 16), [
973
+ [Ot, c.value]
974
+ ]),
975
+ V("div", qn, [
976
+ V("div", null, [
977
+ p.$slots.description ? I(p.$slots, "description", { key: 0 }, void 0, !0) : e(v) ? (o(), i("div", {
978
+ key: 1,
979
+ innerHTML: ($ = e(t)) != null && $.translate ? e(M)(e(v)) : e(v)
980
+ }, null, 8, Un)) : I(p.$slots, "default", { key: 2 }, void 0, !0)
981
+ ]),
982
+ V("div", En, [
983
+ p.$slots.hint ? I(p.$slots, "hint", { key: 0 }, void 0, !0) : (b = e(t)) != null && b.hint ? (o(), i("div", {
984
+ key: 1,
985
+ innerHTML: e(t).hint
986
+ }, null, 8, Dn)) : y("", !0)
987
+ ])
988
+ ])
989
+ ], 2)), [
990
+ [_]
991
+ ]);
992
+ };
993
+ }
994
+ });
995
+ const Gn = /* @__PURE__ */ X(Qn, [["__scopeId", "data-v-db5fafae"]]), Wn = {
996
+ inheritAttrs: !1
997
+ }, Kn = /* @__PURE__ */ U({
998
+ ...Wn,
999
+ __name: "aeria-options",
1000
+ props: {
1001
+ modelValue: {},
1002
+ propertyName: {},
1003
+ parentPropertyName: {},
1004
+ parentCollection: {},
1005
+ readOnly: { type: Boolean },
1006
+ property: {},
1007
+ columns: { default: 1 }
1008
+ },
1009
+ emits: ["update:modelValue"],
1010
+ setup(d, { emit: r }) {
1011
+ const a = d, t = r, l = a.readOnly || a.property.readOnly, s = "items" in a.property ? a.property.items.enum : a.property.enum, u = (v) => {
1012
+ t("update:modelValue", v);
1013
+ };
1014
+ return yt(() => {
1015
+ a.modelValue || t(
1016
+ "update:modelValue",
1017
+ "items" in a.property ? [] : ""
1018
+ );
1019
+ }), (v, c) => (o(), i("div", {
1020
+ class: "options",
1021
+ style: $e(`
1022
+ --columns: ${v.columns};
1023
+ grid-template-columns: repeat(var(--columns), 1fr);
1024
+ `)
1025
+ }, [
1026
+ (o(!0), i(P, null, D(e(s), (h) => (o(), i("div", {
1027
+ key: `option-${h}`,
1028
+ class: "options__checkbox"
1029
+ }, [
1030
+ z(Gn, H({ ref_for: !0 }, {
1031
+ value: h,
1032
+ readOnly: e(l),
1033
+ property: v.property
1034
+ }, {
1035
+ "model-value": v.modelValue,
1036
+ "onUpdate:modelValue": u
1037
+ }), null, 16, ["model-value"])
1038
+ ]))), 128))
1039
+ ], 4));
1040
+ }
1041
+ });
1042
+ const Xn = /* @__PURE__ */ X(Kn, [["__scopeId", "data-v-39b61318"]]), Yn = (d) => (Ee("data-v-220b2101"), d = d(), De(), d), Jn = { class: "switch-wrapper" }, Zn = /* @__PURE__ */ Yn(() => /* @__PURE__ */ V("div", { class: "switch__slider" }, null, -1)), Pn = { key: 1 }, Nn = {
1043
+ inheritAttrs: !1
1044
+ }, xn = /* @__PURE__ */ U({
1045
+ ...Nn,
1046
+ __name: "aeria-switch",
1047
+ props: {
1048
+ modelValue: {},
1049
+ property: {},
1050
+ propertyName: {},
1051
+ parentPropertyName: {},
1052
+ parentCollection: {},
1053
+ readOnly: { type: Boolean }
1054
+ },
1055
+ emits: ["update:modelValue", "change"],
1056
+ setup(d, { emit: r }) {
1057
+ const a = d, t = r, l = a.property, s = a.readOnly || (l == null ? void 0 : l.readOnly), u = () => {
1058
+ s || (t("change", !a.modelValue), t("update:modelValue", !a.modelValue));
1059
+ };
1060
+ return (v, c) => {
1061
+ var p;
1062
+ const h = ne("clickable");
1063
+ return o(), i("div", Jn, [
1064
+ N((o(), i("a", {
1065
+ class: K(`
1066
+ switch
1067
+ ${v.modelValue && "switch--active"}
1068
+ ${e(s) && "switch--readOnly"}
1069
+ `),
1070
+ onClick: qe(u, ["stop"])
1071
+ }, [
1072
+ Zn,
1073
+ V("div", {
1074
+ class: K(`
1075
+ switch__dummy
1076
+ ${!v.modelValue && "switch__dummy--flex"}
1077
+ `)
1078
+ }, null, 2)
1079
+ ], 2)), [
1080
+ [h, {
1081
+ blocked: e(s)
1082
+ }]
1083
+ ]),
1084
+ v.$slots.default ? I(v.$slots, "default", { key: 0 }, void 0, !0) : (o(), i("div", Pn, k(((p = e(l)) == null ? void 0 : p.description) || v.propertyName), 1))
1085
+ ]);
1086
+ };
1087
+ }
1088
+ });
1089
+ const eo = /* @__PURE__ */ X(xn, [["__scopeId", "data-v-220b2101"]]), kt = (d) => (Ee("data-v-153a2e0f"), d = d(), De(), d), to = { class: "picture" }, no = {
1090
+ key: 0,
1091
+ style: { position: "fixed", top: "50%", left: "50%", transform: "translate(-50%, -50%)" }
1092
+ }, oo = ["src", "alt"], ao = {
1093
+ key: 0,
1094
+ class: "picture__meta"
1095
+ }, lo = ["src"], so = /* @__PURE__ */ kt(() => /* @__PURE__ */ V("line", {
1096
+ x1: "0",
1097
+ y1: "0",
1098
+ x2: "200",
1099
+ y2: "200",
1100
+ stroke: "#000",
1101
+ "vector-effect": "non-scaling-stroke"
1102
+ }, null, -1)), io = /* @__PURE__ */ kt(() => /* @__PURE__ */ V("line", {
1103
+ x1: "200",
1104
+ y1: "0",
1105
+ x2: "0",
1106
+ y2: "200",
1107
+ stroke: "#000",
1108
+ "vector-effect": "non-scaling-stroke"
1109
+ }, null, -1)), ro = [
1110
+ so,
1111
+ io
1112
+ ], uo = { key: 5 }, co = /* @__PURE__ */ U({
1113
+ __name: "aeria-picture",
1114
+ props: {
1115
+ url: {},
1116
+ alt: {},
1117
+ fileId: {},
1118
+ modelValue: {},
1119
+ objectFit: {},
1120
+ bordered: { type: Boolean },
1121
+ width: {},
1122
+ height: {},
1123
+ expandable: { type: Boolean },
1124
+ meta: {}
1125
+ },
1126
+ setup(d) {
1127
+ const r = d, a = Q(() => r.fileId ? `${ht}/file/${r.fileId}/picture` : r.url || r.modelValue), t = J(!1);
1128
+ return (l, s) => {
1129
+ var v;
1130
+ const u = ne("overlay");
1131
+ return o(), i("figure", to, [
1132
+ a.value ? (o(), g(Xe, {
1133
+ key: 0,
1134
+ to: "main"
1135
+ }, [
1136
+ t.value ? N((o(), i("div", no, [
1137
+ V("img", {
1138
+ src: a.value,
1139
+ alt: l.alt,
1140
+ style: `
1141
+ max-height: 60vh;
1142
+ object-fit: contain;
1143
+ `,
1144
+ onClick: s[0] || (s[0] = (c) => t.value = !0)
1145
+ }, null, 8, oo),
1146
+ (v = l.meta) != null && v.owner ? (o(), i("div", ao, " Criado por " + k(l.meta.owner.name) + " em " + k(l.formatDateTime(l.meta.created_at, { hours: !0 })), 1)) : y("", !0)
1147
+ ])), [
1148
+ [u, {
1149
+ click: () => {
1150
+ t.value = !1;
1151
+ }
1152
+ }]
1153
+ ]) : y("", !0)
1154
+ ])) : y("", !0),
1155
+ a.value ? (o(), i("img", {
1156
+ key: 1,
1157
+ src: a.value,
1158
+ class: K(`
1159
+ picture__image
1160
+ ${l.bordered && "picture__image--bordered"}
1161
+ ${l.expandable && "picture__image--expandable"}
1162
+ `),
1163
+ style: $e(`
1164
+ object-fit: ${l.objectFit || "cover"};
1165
+ width: ${l.width || "100%"};
1166
+ height: ${l.height || "100%"};
1167
+ `),
1168
+ onClick: s[1] || (s[1] = () => {
1169
+ l.expandable && (t.value = !0);
1170
+ })
1171
+ }, null, 14, lo)) : l.$slots.fallback ? I(l.$slots, "fallback", { key: 2 }, void 0, !0) : l.$slots.default ? I(l.$slots, "default", { key: 3 }, void 0, !0) : (o(), i("svg", {
1172
+ key: 4,
1173
+ class: K(["picture__background", `
1174
+ ${l.bordered && "picture__image--bordered"}
1175
+ `]),
1176
+ xmlns: "http://www.w3.org/2000/svg",
1177
+ viewBox: "0 0 200 200",
1178
+ preserveAspectRatio: "none",
1179
+ style: $e(`
1180
+ object-fit: ${l.objectFit || "cover"};
1181
+ width: ${l.width || "100%"};
1182
+ height: ${l.height || "100%"};
1183
+ `)
1184
+ }, ro, 6)),
1185
+ l.$slots.caption ? (o(), i("figcaption", uo, [
1186
+ I(l.$slots, "caption", {}, void 0, !0)
1187
+ ])) : y("", !0)
1188
+ ]);
1189
+ };
1190
+ }
1191
+ });
1192
+ const Ue = /* @__PURE__ */ X(co, [["__scopeId", "data-v-153a2e0f"]]), po = { class: "file" }, _o = { key: 0 }, mo = ["href"], fo = {
1193
+ key: 1,
1194
+ class: "file__actions"
1195
+ }, vo = ["accept"], yo = {
1196
+ key: 0,
1197
+ class: "file__buttons"
1198
+ }, ho = {
1199
+ key: 1,
1200
+ class: "file__buttons"
1201
+ }, $o = /* @__PURE__ */ U({
1202
+ __name: "aeria-file",
1203
+ props: {
1204
+ modelValue: {},
1205
+ property: {},
1206
+ propertyName: {},
1207
+ parentPropertyName: {},
1208
+ parentCollection: {},
1209
+ readOnly: { type: Boolean },
1210
+ meta: {},
1211
+ content: {}
1212
+ },
1213
+ emits: ["update:content", "change", "update:modelValue"],
1214
+ setup(d, { emit: r }) {
1215
+ var $;
1216
+ const a = d, t = r, s = Me() ? ge() : null, u = J((($ = a.modelValue) == null ? void 0 : $.file) || null), v = Q(() => {
1217
+ var b;
1218
+ return u.value ? URL.createObjectURL(u.value) : (b = a.modelValue) == null ? void 0 : b.link;
1219
+ }), c = Q(() => {
1220
+ var b, S, T;
1221
+ return /^image\//.test((b = a.modelValue) == null ? void 0 : b.type) && !((S = u.value) != null && S.type) || /^image\//.test((T = u.value) == null ? void 0 : T.type);
1222
+ }), h = (b) => new Promise((S) => {
1223
+ const T = new FileReader();
1224
+ T.onload = () => S(T.result), T.readAsArrayBuffer(b);
1225
+ }), p = () => {
1226
+ a.modelValue.tempId && t("update:modelValue", null), u.value = null;
1227
+ }, n = async (b) => {
1228
+ u.value = b.target.files[0];
1229
+ const S = u.value, T = await h(S);
1230
+ if (s) {
1231
+ const { data: { error: Z, result: B } } = await zt(`${ht}/${s.$id}/upload?name=${S.name}`, T, {
1232
+ params: {
1233
+ method: "POST",
1234
+ headers: {
1235
+ "content-type": S.type || "application/octet-stream",
1236
+ "x-stream-request": "1"
1237
+ }
1238
+ }
1239
+ });
1240
+ if (Z)
1241
+ return;
1242
+ t("update:modelValue", {
1243
+ tempId: B.tempId,
1244
+ file: S
1245
+ });
1246
+ } else
1247
+ t("update:modelValue", S);
1248
+ t("update:content", T), t("change", T);
1249
+ }, _ = async () => {
1250
+ t("update:modelValue", null);
1251
+ };
1252
+ return (b, S) => {
1253
+ var T, Z, B, F, Y, w;
1254
+ return o(), i("div", po, [
1255
+ u.value || (T = b.modelValue) != null && T._id ? (o(), i("div", _o, [
1256
+ c.value ? (o(), g(Ue, {
1257
+ key: 0,
1258
+ modelValue: v.value,
1259
+ "onUpdate:modelValue": S[0] || (S[0] = (te) => v.value = te),
1260
+ alt: "Image preview",
1261
+ expandable: b.readOnly,
1262
+ class: K(`
1263
+ file__image
1264
+ ${!e(s) || ((Z = b.modelValue) == null ? void 0 : Z._id) || "file__image--unsent"}
1265
+ `)
1266
+ }, null, 8, ["modelValue", "expandable", "class"])) : y("", !0),
1267
+ (B = b.modelValue) != null && B._id ? (o(), i("a", {
1268
+ key: 1,
1269
+ href: b.modelValue.download_link
1270
+ }, k(b.modelValue.filename), 9, mo)) : y("", !0)
1271
+ ])) : y("", !0),
1272
+ b.readOnly ? y("", !0) : (o(), i("div", fo, [
1273
+ V("input", {
1274
+ ref: "file",
1275
+ type: "file",
1276
+ accept: (Y = (F = b.property) == null ? void 0 : F.accept) == null ? void 0 : Y.join(","),
1277
+ onChange: n
1278
+ }, null, 40, vo),
1279
+ u.value ? (o(), i("div", yo, [
1280
+ z(re, {
1281
+ small: "",
1282
+ onClick: qe(p, ["prevent"])
1283
+ }, {
1284
+ default: f(() => [
1285
+ W(k(e(M)("action.clear", { capitalize: !0 })), 1)
1286
+ ]),
1287
+ _: 1
1288
+ })
1289
+ ])) : (w = b.modelValue) != null && w._id ? (o(), i("div", ho, [
1290
+ z(re, {
1291
+ small: "",
1292
+ onClick: qe(_, ["prevent"])
1293
+ }, {
1294
+ default: f(() => [
1295
+ W(k(e(M)("action.remove", { capitalize: !0 })), 1)
1296
+ ]),
1297
+ _: 1
1298
+ })
1299
+ ])) : y("", !0)
1300
+ ]))
1301
+ ]);
1302
+ };
1303
+ }
1304
+ });
1305
+ const bo = /* @__PURE__ */ X($o, [["__scopeId", "data-v-aeeec9a8"]]), go = { class: "container" }, ko = {
1306
+ key: 1,
1307
+ class: "container__footer"
1308
+ }, Vo = /* @__PURE__ */ U({
1309
+ __name: "aeria-search-container",
1310
+ props: {
1311
+ observeScroll: { type: Boolean }
1312
+ },
1313
+ emits: ["endReached"],
1314
+ setup(d, { emit: r }) {
1315
+ const a = d, t = r, l = J(null), s = a.observeScroll ? Ye(l, {
1316
+ antecipate: 100
1317
+ }).reachedEnd : null;
1318
+ return s !== null && ue(s, (u) => {
1319
+ u && t("endReached", u);
1320
+ }), (u, v) => (o(), i("div", go, [
1321
+ u.$slots.default ? (o(), i("div", {
1322
+ key: 0,
1323
+ ref_key: "containerEl",
1324
+ ref: l,
1325
+ class: "container__content"
1326
+ }, [
1327
+ I(u.$slots, "default", {}, void 0, !0)
1328
+ ], 512)) : y("", !0),
1329
+ u.$slots.footer ? (o(), i("div", ko, [
1330
+ I(u.$slots, "footer", {}, void 0, !0)
1331
+ ])) : y("", !0)
1332
+ ]));
1333
+ }
1334
+ });
1335
+ const dt = /* @__PURE__ */ X(Vo, [["__scopeId", "data-v-c86e2d2a"]]), Co = { class: "item__values" }, Oo = /* @__PURE__ */ U({
1336
+ __name: "aeria-search-item",
1337
+ props: {
1338
+ item: {},
1339
+ indexes: {},
1340
+ modelValue: {},
1341
+ property: {},
1342
+ readOnly: { type: Boolean }
1343
+ },
1344
+ emits: ["update:modelValue", "change"],
1345
+ setup(d, { emit: r }) {
1346
+ const a = Ie(), t = d, l = r, s = t.property, u = _e(s), v = ge(), c = Q(() => Array.isArray(t.modelValue) ? Array.isArray(t.modelValue) && Object.values(t.modelValue).some(({ _id: _ }) => t.item._id === _) : t.modelValue && t.modelValue._id === t.item._id), h = () => {
1347
+ if (c.value)
1348
+ return;
1349
+ const _ = (b) => b.filter((S) => !!(S != null && S._id)), $ = "items" in s ? _(Array.isArray(t.modelValue) ? t.modelValue : [t.modelValue]) : t.modelValue;
1350
+ l("update:modelValue", Array.isArray($) ? [
1351
+ ...$,
1352
+ t.item
1353
+ ] : t.item), l("change", t.item);
1354
+ }, p = async (_) => {
1355
+ if (u.purge && (_ != null && _.purge)) {
1356
+ const { _id: b } = t.item;
1357
+ await v.$actions.remove({
1358
+ filters: {
1359
+ _id: b
1360
+ }
1361
+ });
1362
+ }
1363
+ const $ = () => {
1364
+ const b = [...t.modelValue], S = b.findIndex((T) => T._id === t.item._id);
1365
+ return b.splice(S, 1), b;
1366
+ };
1367
+ l("update:modelValue", "items" in s ? $() : null);
1368
+ }, n = () => {
1369
+ if (t.readOnly) {
1370
+ a.push({
1371
+ name: "/dashboard/crud/:id",
1372
+ params: {
1373
+ collection: u.$ref,
1374
+ id: t.item._id
1375
+ }
1376
+ });
1377
+ return;
1378
+ }
1379
+ return c.value ? p() : h();
1380
+ };
1381
+ return (_, $) => {
1382
+ const b = ne("clickable");
1383
+ return N((o(), i("div", {
1384
+ class: K({
1385
+ item: !0,
1386
+ "item--selected": c.value
1387
+ }),
1388
+ onClick: n
1389
+ }, [
1390
+ I(_.$slots, "default", {}, void 0, !0),
1391
+ V("div", Co, [
1392
+ (o(!0), i(P, null, D(_.indexes, (S, T) => (o(), i("div", {
1393
+ key: `index-${_.item._id}-${T}`,
1394
+ class: "item__value"
1395
+ }, k(_.item[S]), 1))), 128))
1396
+ ])
1397
+ ], 2)), [
1398
+ [b]
1399
+ ]);
1400
+ };
1401
+ }
1402
+ });
1403
+ const We = /* @__PURE__ */ X(Oo, [["__scopeId", "data-v-e14c02a3"]]), Io = { class: "search__panel" }, Ao = { class: "search__input" }, Bo = ["value"], wo = { style: { flex: "1" } }, So = { key: 1 }, jo = { key: 0 }, To = { key: 1 }, Lo = { class: "search__summary" }, Ro = {
1404
+ key: 1,
1405
+ class: "search"
1406
+ }, zo = { key: 0 }, Fe = 10, Mo = /* @__PURE__ */ U({
1407
+ __name: "aeria-search",
1408
+ props: {
1409
+ modelValue: {},
1410
+ parentPropertyName: {},
1411
+ parentCollection: {},
1412
+ readOnly: { type: Boolean },
1413
+ property: {},
1414
+ propertyName: {},
1415
+ selectOnly: { type: Boolean },
1416
+ panel: { default: void 0 }
1417
+ },
1418
+ emits: ["update:modelValue", "change", "update:panel"],
1419
+ setup(d, { emit: r }) {
1420
+ const a = d, t = _e(a.property), l = a.panel !== void 0 ? Q(() => a.panel) : J(!1), s = r, u = ie(_e(a.property).$ref), v = Me(), c = v ? ge() : null, h = t.indexes;
1421
+ ye(He, _e(a.property).$ref), ye("innerInputLabel", !0), ye("omitInputLabels", !0);
1422
+ const p = J(a.modelValue), n = J({
1423
+ data: [],
1424
+ pagination: {}
1425
+ }), _ = Q(() => n.value.data), $ = Q(() => n.value.pagination), b = J(0), S = J(h[0]), T = J(!1), Z = J({}), B = () => {
1426
+ const L = {};
1427
+ if (v) {
1428
+ const R = e(v);
1429
+ L[R] = c;
1430
+ }
1431
+ return t.constraints ? Ht(t.constraints, L) : {};
1432
+ }, F = () => {
1433
+ _.value.length < $.value.recordsTotal && (b.value += 1, w());
1434
+ }, Y = async () => {
1435
+ if (Object.values(Z.value).every((R) => !(String(R).length > 0)))
1436
+ return u.$actions.custom("getAll", {
1437
+ limit: Fe,
1438
+ offset: b.value * Fe,
1439
+ filters: B()
1440
+ });
1441
+ const L = h.filter((R) => {
1442
+ var m;
1443
+ return ((m = Z.value[R]) == null ? void 0 : m.length) > 0;
1444
+ }).map((R) => ({
1445
+ [R]: {
1446
+ $regex: Z.value[R].trim().replace("(", "\\(").replace(")", "\\)"),
1447
+ $options: "i"
1448
+ }
1449
+ }));
1450
+ return u.$actions.custom("getAll", {
1451
+ limit: Fe,
1452
+ offset: b.value * Fe,
1453
+ filters: {
1454
+ ...B(),
1455
+ ...L.length > 0 && {
1456
+ $or: L
1457
+ }
1458
+ }
1459
+ });
1460
+ }, w = async () => {
1461
+ if (u.loading.getAll)
1462
+ return;
1463
+ const { error: L, result: R } = await Y();
1464
+ if (L) {
1465
+ ie("meta").$actions.spawnToast({
1466
+ text: "Request failed",
1467
+ icon: "warning"
1468
+ });
1469
+ return;
1470
+ }
1471
+ n.value.pagination = R.pagination, b.value === 0 && n.value.data.splice(0), n.value.data.push(...R.data);
1472
+ }, [te] = $t({
1473
+ delay: 800
1474
+ })(() => {
1475
+ b.value = 0, w(), T.value = !1;
1476
+ }), C = () => {
1477
+ T.value = !0, te();
1478
+ }, j = () => {
1479
+ "effect" in l ? s("update:panel", !0) : l.value = !0, w();
1480
+ }, oe = () => {
1481
+ b.value = 0, n.value.data.splice(0), "effect" in l ? s("update:panel", !1) : l.value = !1;
1482
+ }, ae = Q(() => !Object.values(Z.value).some((L) => !!L));
1483
+ ue(ae, (L, R) => {
1484
+ L && !R && w();
1485
+ }), vt(() => {
1486
+ a.selectOnly && w();
1487
+ });
1488
+ const se = (L) => {
1489
+ p.value = L, a.selectOnly || s("update:modelValue", L);
1490
+ }, le = () => {
1491
+ oe(), s("update:modelValue", p.value);
1492
+ };
1493
+ return (L, R) => {
1494
+ const m = ne("clickable");
1495
+ return o(), i("div", null, [
1496
+ e(l) ? (o(), g(Xe, {
1497
+ key: 0,
1498
+ to: "main"
1499
+ }, [
1500
+ z(Ae, {
1501
+ float: "",
1502
+ "close-hint": "",
1503
+ title: `${e(M)("action.select", { capitalize: !0 })} ${e(M)(L.propertyName)}`,
1504
+ "overlay-layer": 65,
1505
+ "model-value": e(l),
1506
+ style: { "--panel-max-width": "36rem" },
1507
+ onClose: oe,
1508
+ onOverlayClick: oe
1509
+ }, {
1510
+ footer: f(() => [
1511
+ z(re, {
1512
+ large: "",
1513
+ onClick: le
1514
+ }, {
1515
+ default: f(() => [
1516
+ W(k(e(M)("action.save", { capitalize: !0 })), 1)
1517
+ ]),
1518
+ _: 1
1519
+ })
1520
+ ]),
1521
+ default: f(() => {
1522
+ var E, G;
1523
+ return [
1524
+ V("div", Io, [
1525
+ V("div", Ao, [
1526
+ e(h).length > 1 ? (o(), g(Qe, {
1527
+ key: 0,
1528
+ modelValue: S.value,
1529
+ "onUpdate:modelValue": R[0] || (R[0] = (O) => S.value = O),
1530
+ onChange: R[1] || (R[1] = (O) => Z.value = {})
1531
+ }, {
1532
+ default: f(() => [
1533
+ (o(!0), i(P, null, D(e(h), (O) => (o(), i("option", {
1534
+ key: `searchfield-${O}`,
1535
+ value: O
1536
+ }, k(e(M)(O)), 9, Bo))), 128))
1537
+ ]),
1538
+ _: 1
1539
+ }, 8, ["modelValue"])) : y("", !0),
1540
+ V("div", wo, [
1541
+ (o(), g(Oe, {
1542
+ key: `field-${S.value}`,
1543
+ modelValue: Z.value[S.value],
1544
+ "onUpdate:modelValue": R[2] || (R[2] = (O) => Z.value[S.value] = O),
1545
+ property: {
1546
+ ...e(u).properties[S.value],
1547
+ inputType: "search"
1548
+ },
1549
+ onInput: C
1550
+ }, null, 8, ["modelValue", "property"]))
1551
+ ])
1552
+ ]),
1553
+ _.value.length ? (o(), g(dt, {
1554
+ key: 0,
1555
+ "observe-scroll": "",
1556
+ onEndReached: F
1557
+ }, {
1558
+ default: f(() => [
1559
+ (o(!0), i(P, null, D(_.value, (O) => (o(), g(We, H({ ref_for: !0 }, {
1560
+ item: O,
1561
+ indexes: e(h),
1562
+ property: L.property
1563
+ }, {
1564
+ key: `matching-${O._id}`,
1565
+ modelValue: p.value,
1566
+ "onUpdate:modelValue": R[3] || (R[3] = (A) => p.value = A)
1567
+ }), null, 16, ["modelValue"]))), 128))
1568
+ ]),
1569
+ _: 1
1570
+ })) : (o(), i("div", So, [
1571
+ T.value ? (o(), i("div", jo, k(e(M)("searching", { capitalize: !0 })) + "... ", 1)) : !e(u).loading.getAll && Object.values(Z.value).filter((O) => !!O).length > 0 && !("items" in L.property && ((E = L.modelValue) != null && E.length) || !Array.isArray(L.modelValue) && ((G = L.modelValue) != null && G._id)) ? (o(), i("div", To, k(e(M)("no_results", { capitalize: !0 })), 1)) : y("", !0)
1572
+ ]))
1573
+ ]),
1574
+ V("div", Lo, k(e(M)("showing", { capitalize: !0 })) + " " + k(_.value.length) + " " + k(e(M)("of")) + " " + k($.value.recordsTotal), 1)
1575
+ ];
1576
+ }),
1577
+ _: 1
1578
+ }, 8, ["title", "model-value"])
1579
+ ])) : y("", !0),
1580
+ L.selectOnly ? y("", !0) : (o(), i("div", Ro, [
1581
+ z(dt, null, ce({
1582
+ default: f(() => {
1583
+ var E;
1584
+ return [
1585
+ "items" in L.property ? (o(), i("div", zo, [
1586
+ (o(!0), i(P, null, D(L.modelValue, (G) => (o(), g(We, H({ ref_for: !0 }, {
1587
+ item: G,
1588
+ indexes: e(h),
1589
+ property: L.property,
1590
+ readOnly: L.readOnly,
1591
+ modelValue: L.modelValue
1592
+ }, {
1593
+ key: `selected-${G._id}`,
1594
+ "onUpdate:modelValue": se
1595
+ }), null, 16))), 128))
1596
+ ])) : (E = L.modelValue) != null && E._id ? (o(), g(We, H({ key: 1 }, {
1597
+ item: L.modelValue,
1598
+ indexes: e(h),
1599
+ property: e(t),
1600
+ modelValue: L.modelValue
1601
+ }, { "onUpdate:modelValue": se }), null, 16)) : y("", !0)
1602
+ ];
1603
+ }),
1604
+ _: 2
1605
+ }, [
1606
+ L.readOnly ? void 0 : {
1607
+ name: "footer",
1608
+ fn: f(() => [
1609
+ N((o(), g(x, {
1610
+ icon: "plus",
1611
+ onClick: j
1612
+ }, {
1613
+ default: f(() => [
1614
+ W(k(e(M)("action.select", { capitalize: !0 })), 1)
1615
+ ]),
1616
+ _: 1
1617
+ })), [
1618
+ [m]
1619
+ ])
1620
+ ]),
1621
+ key: "0"
1622
+ }
1623
+ ]), 1024)
1624
+ ]))
1625
+ ]);
1626
+ };
1627
+ }
1628
+ });
1629
+ const Fo = /* @__PURE__ */ X(Mo, [["__scopeId", "data-v-5fd0bcfa"]]), pt = (d, r) => {
1630
+ const a = "items" in d ? d.items : d, t = {
1631
+ options: Xn,
1632
+ select: Qe,
1633
+ switch: eo,
1634
+ file: bo,
1635
+ search: Fo,
1636
+ input: Oe,
1637
+ form: Ge
1638
+ }, l = (() => {
1639
+ if ("type" in a) {
1640
+ if (a.type === "object")
1641
+ return "form";
1642
+ if (a.type === "boolean")
1643
+ return "switch";
1644
+ }
1645
+ if ("element" in d) {
1646
+ if (d.element === "checkbox" || d.element === "radio")
1647
+ return "options";
1648
+ if (d.element === "select")
1649
+ return "select";
1650
+ }
1651
+ const s = _e(d);
1652
+ return s ? s.inline ? "form" : s.$ref === "file" ? "file" : "search" : "items" in d && d.uniqueItems ? "options" : "enum" in a ? "select" : "input";
1653
+ })();
1654
+ return r[l] ? r[l] : t[l];
1655
+ }, qo = (d, r, a) => {
1656
+ d ?? (d = []);
1657
+ const t = "items" in r ? r.items : r;
1658
+ if ("$ref" in t) {
1659
+ const l = ie(t.$ref, a), s = Re(l.$freshItem);
1660
+ return d.push(s);
1661
+ }
1662
+ return "properties" in t ? d.push(Qt(t)) : "type" in t && t.type === "boolean" ? d.push({}) : d.push(null);
1663
+ }, Uo = (d, r) => {
1664
+ d.splice(r, 1);
1665
+ }, Eo = {
1666
+ key: 0,
1667
+ class: "form__header"
1668
+ }, Do = { class: "form__fieldset" }, Ho = { key: 0 }, Qo = ["innerHTML"], Go = ["onInput"], Wo = { key: 4 }, Ko = { value: "true" }, Xo = { value: "false" }, Yo = {
1669
+ key: 5,
1670
+ style: { display: "grid", "row-gap": ".4rem" }
1671
+ }, Jo = { class: "form__array" }, Zo = { style: { "flex-grow": "1" } }, Po = {
1672
+ key: 7,
1673
+ class: "form__validation-error"
1674
+ }, No = { key: 0 }, xo = { key: 1 }, ea = {
1675
+ key: 2,
1676
+ class: "form__footer"
1677
+ }, ta = /* @__PURE__ */ U({
1678
+ __name: "aeria-form",
1679
+ props: {
1680
+ modelValue: {},
1681
+ property: {},
1682
+ propertyName: {},
1683
+ parentPropertyName: {},
1684
+ parentCollection: {},
1685
+ readOnly: { type: Boolean },
1686
+ form: {},
1687
+ collection: {},
1688
+ searchOnly: { type: Boolean },
1689
+ layout: {},
1690
+ formLayout: {},
1691
+ required: {},
1692
+ formComponents: {},
1693
+ propertyComponents: {},
1694
+ omitFormHeader: { type: Boolean },
1695
+ omitInputLabels: { type: Boolean },
1696
+ innerInputLabel: { type: Boolean },
1697
+ validationErrors: { default: null },
1698
+ highlightRequired: { type: Boolean, default: !0 },
1699
+ focus: { type: Boolean }
1700
+ },
1701
+ emits: ["update:modelValue", "input", "change"],
1702
+ setup(d, { emit: r }) {
1703
+ var R;
1704
+ const a = gt(), t = d, l = r;
1705
+ yt(() => {
1706
+ t.modelValue || l("update:modelValue", t.property && "items" in t.property ? [] : {});
1707
+ });
1708
+ const s = t.property && _e(t.property), u = s ? s.$ref : t.collection || Me(), v = t.readOnly || ((R = t.property) == null ? void 0 : R.readOnly), c = u ? ie(e(u)) : null;
1709
+ !u && process.env.NODE_ENV !== "production" && console.warn(`aeria-form was used without providing storeId or specifying
1710
+ collection prop, some features may not work as intended`);
1711
+ const h = J(!1), p = Q(() => !t.form && t.property ? "properties" in t.property ? t.property.properties : c == null ? void 0 : c.properties : t.form), n = Q(() => t.layout || (c == null ? void 0 : c.description.formLayout)), _ = (m) => {
1712
+ const E = ve(m, t[m]);
1713
+ return t[m] && ye(m, t[m]), E;
1714
+ }, $ = Q(() => t.validationErrors !== null ? t.validationErrors : c == null ? void 0 : c.validationErrors), b = _("formComponents") || {}, S = _("propertyComponents") || {}, T = _("omitFormHeader"), Z = _("omitInputLabels"), B = _("innerInputLabel");
1715
+ u && ye(He, u), ye("searchOnly", t.searchOnly);
1716
+ const F = (m) => p.value ? Object.entries(p.value).filter(([E, G]) => !G.noForm && m([
1717
+ E,
1718
+ G
1719
+ ])) : null, Y = (m) => {
1720
+ var G;
1721
+ if (t.searchOnly || !u)
1722
+ return !0;
1723
+ const E = t.property && "properties" in t.property ? t.property.form : (G = c == null ? void 0 : c.description) == null ? void 0 : G.form;
1724
+ return !E || E.includes(m);
1725
+ }, w = F(([m]) => Y(m)), te = ze(), C = {}, j = (m, E) => {
1726
+ var q, me, Be, we;
1727
+ const G = [], O = ((me = (q = n.value) == null ? void 0 : q.fields) == null ? void 0 : me[m]) || ((we = (Be = n.value) == null ? void 0 : Be.fields) == null ? void 0 : we.$default);
1728
+ if (!E)
1729
+ return;
1730
+ if (O != null && O.if && !t.searchOnly) {
1731
+ const Se = Ke(
1732
+ t.modelValue,
1733
+ O.if
1734
+ );
1735
+ Se.satisfied || (C[m] && (c ? t.modelValue[m] = typeof c.$freshItem[m] == "object" ? Re(c.$freshItem[m]) : c.$freshItem[m] : t.modelValue[m] = [
1736
+ void 0,
1737
+ null
1738
+ ].includes(t.modelValue[m]) ? null : t.modelValue[m].constructor()), G.push("display: none;")), C[m] = Se.satisfied;
1739
+ }
1740
+ const A = te.value.md && (O == null ? void 0 : O.span) || 6;
1741
+ return G.push(`
1742
+ --field-span: ${A};
1743
+ grid-column: span var(--field-span) / span var(--field-span);
1744
+ `), O && (O.verticalSpacing && G.push(`
1745
+ --vertical-spacing: ${O.verticalSpacing};
1746
+ padding: var(--vertical-spacing) 0;
1747
+ `), O.separator && G.push(`
1748
+ border-top: 1px solid var(--theme-border-color);
1749
+ border-width: 1px 0 1px 0;
1750
+ padding: 1rem 0;
1751
+ margin: 1rem 0;
1752
+ `)), G.join("");
1753
+ }, oe = (m) => m === null || m instanceof Object && !Object.keys(m).length, ae = Q(() => t.required ? t.required : t.property && "required" in t.property ? t.property.required : c == null ? void 0 : c.description.required), se = Q(() => t.form ? Mt(
1754
+ t.modelValue,
1755
+ t.form,
1756
+ ae.value,
1757
+ c == null ? void 0 : c.description
1758
+ ) : !0), le = (m, E) => {
1759
+ var G;
1760
+ return (G = $.value) != null && G[m] && (typeof $.value[m].index != "number" || $.value[m].index === E) ? $.value[m].errors : null;
1761
+ }, L = () => {
1762
+ if (!v && !h.value)
1763
+ return h.value = !0, !0;
1764
+ };
1765
+ return (m, E) => {
1766
+ const G = ne("clickable"), O = ne("focus");
1767
+ return o(), i("form", {
1768
+ class: "form",
1769
+ style: $e(`row-gap: ${e(T) ? ".8rem" : "var(--form-internal-gap, 1.6rem);"};`)
1770
+ }, [
1771
+ m.$slots.header && !e(T) ? (o(), i("header", Eo, [
1772
+ I(m.$slots, "header", {}, void 0, !0)
1773
+ ])) : y("", !0),
1774
+ I(m.$slots, "default", {}, void 0, !0),
1775
+ V("fieldset", Do, [
1776
+ (o(!0), i(P, null, D(e(w), ([A, q]) => {
1777
+ var me, Be, we, Se, Je, Ze, Pe, Ne, xe, et, tt, nt, ot;
1778
+ return o(), i("div", {
1779
+ key: `field-${A}`,
1780
+ style: $e(j(A, q)),
1781
+ class: "form__field"
1782
+ }, [
1783
+ (!("type" in q) || q.type !== "boolean" || m.searchOnly) && !q.noLabel && !e(Z) && !e(B) ? (o(), i("label", Ho, [
1784
+ V("div", {
1785
+ class: K({
1786
+ "form__field-label": !0,
1787
+ "form__field-label--section": "items" in q ? "properties" in q.items : "properties" in q,
1788
+ "form__field-required-hint": m.highlightRequired && !e(v) && !m.searchOnly && (!ae.value || e(Gt)(A, ae.value, m.modelValue))
1789
+ })
1790
+ }, k(q.description || e(M)(A)), 3),
1791
+ q.hint ? (o(), i("div", {
1792
+ key: 0,
1793
+ innerHTML: q.hint
1794
+ }, null, 8, Qo)) : y("", !0)
1795
+ ])) : y("", !0),
1796
+ m.$slots[`field-${A}`] ? I(m.$slots, `field-${A}`, H({
1797
+ key: 1,
1798
+ ref_for: !0
1799
+ }, {
1800
+ propery: q,
1801
+ properyName: A,
1802
+ modelValue: m.modelValue
1803
+ }), void 0, !0) : (we = (Be = (me = m.layout) == null ? void 0 : me.fields) == null ? void 0 : Be[A]) != null && we.component && e(S)[m.layout.fields[A].component.name] ? (o(), g(he(e(S)[m.layout.fields[A].component.name]), H({
1804
+ key: 2,
1805
+ modelValue: m.modelValue[A],
1806
+ "onUpdate:modelValue": (ee) => m.modelValue[A] = ee,
1807
+ ref_for: !0
1808
+ }, {
1809
+ readOnly: e(v),
1810
+ property: q,
1811
+ propertyName: A,
1812
+ ...m.layout.fields[A].component.props || {}
1813
+ }, {
1814
+ onInput: (ee) => l("input", A),
1815
+ onChange: E[0] || (E[0] = (ee) => l("change", ee))
1816
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "onInput"])) : "format" in q && ["date", "date-time"].includes(q.format) && m.searchOnly ? (o(), i("div", {
1817
+ key: 3,
1818
+ style: { display: "grid", "grid-template-columns": "repeat(2, 1fr)", "column-gap": "1rem" },
1819
+ onInput: (ee) => l("input", A),
1820
+ onChange: E[1] || (E[1] = (ee) => l("change", ee))
1821
+ }, [
1822
+ z(Oe, H({
1823
+ modelValue: m.modelValue[A].$gte,
1824
+ "onUpdate:modelValue": (ee) => m.modelValue[A].$gte = ee,
1825
+ ref_for: !0
1826
+ }, {
1827
+ property: q,
1828
+ propertyName: A
1829
+ }), null, 16, ["modelValue", "onUpdate:modelValue"]),
1830
+ z(Oe, H({
1831
+ modelValue: m.modelValue[A].$lte,
1832
+ "onUpdate:modelValue": (ee) => m.modelValue[A].$lte = ee,
1833
+ ref_for: !0
1834
+ }, {
1835
+ property: q,
1836
+ propertyName: A
1837
+ }), null, 16, ["modelValue", "onUpdate:modelValue"])
1838
+ ], 40, Go)) : "type" in q && q.type === "boolean" && m.searchOnly ? (o(), i("div", Wo, [
1839
+ z(Qe, H({ ref_for: !0 }, {
1840
+ property: q,
1841
+ propertyName: A
1842
+ }, {
1843
+ "boolean-ref": "",
1844
+ "model-value": m.modelValue[A],
1845
+ onChange: E[2] || (E[2] = (ee) => l("change", ee)),
1846
+ "onUpdate:modelValue": (ee) => {
1847
+ m.modelValue[A] = ee == "true" ? !0 : ee == "false" ? !1 : null;
1848
+ }
1849
+ }), {
1850
+ default: f(() => [
1851
+ V("option", Ko, k(e(M)("yes")), 1),
1852
+ V("option", Xo, k(e(M)("no")), 1)
1853
+ ]),
1854
+ _: 2
1855
+ }, 1040, ["model-value", "onUpdate:modelValue"])
1856
+ ])) : m.modelValue && "items" in q && !q.uniqueItems && (!("$ref" in q.items) || q.items.inline || q.items.$ref === "file") ? (o(), i("div", Yo, [
1857
+ V("div", null, [
1858
+ z(re, {
1859
+ small: "",
1860
+ variant: "alt",
1861
+ icon: "plus",
1862
+ disabled: !("inline" in q.items && q.items.inline) && (((Se = m.modelValue[A]) == null ? void 0 : Se.length) >= q.maxItems || oe((Ze = m.modelValue[A]) == null ? void 0 : Ze[((Je = m.modelValue[A]) == null ? void 0 : Je.length) - 1])),
1863
+ onClick: qe((ee) => {
1864
+ m.modelValue[A] || (m.modelValue[A] = []), e(qo)(m.modelValue[A], q, e(a));
1865
+ }, ["prevent"])
1866
+ }, {
1867
+ default: f(() => [
1868
+ W(k(e(M)("action.add", { capitalize: !0 })), 1)
1869
+ ]),
1870
+ _: 2
1871
+ }, 1032, ["disabled", "onClick"])
1872
+ ]),
1873
+ V("div", Jo, [
1874
+ (o(!0), i(P, null, D(m.modelValue[A], (ee, je) => {
1875
+ var at, lt, st, it, rt, ut;
1876
+ return o(), i("div", {
1877
+ key: `rep-${A}-${e(Ft)(ee, je)}`,
1878
+ class: "form__array-item"
1879
+ }, [
1880
+ V("div", Zo, [
1881
+ (o(), g(he(e(pt)(q, e(b))), H({
1882
+ modelValue: m.modelValue[A][je],
1883
+ "onUpdate:modelValue": (Te) => m.modelValue[A][je] = Te,
1884
+ ref_for: !0
1885
+ }, {
1886
+ readOnly: e(v),
1887
+ property: q.items,
1888
+ propertyName: A,
1889
+ parentCollection: e(u),
1890
+ parentPropertyName: m.parentPropertyName,
1891
+ columns: ((st = (lt = (at = m.layout) == null ? void 0 : at.fields) == null ? void 0 : lt[A]) == null ? void 0 : st.optionsColumns) || ((ut = (rt = (it = m.layout) == null ? void 0 : it.fields) == null ? void 0 : rt.$default) == null ? void 0 : ut.optionsColumns),
1892
+ validationErrors: le(A, je),
1893
+ ...q.componentProps || {}
1894
+ }, {
1895
+ onInput: (Te) => l("input", A),
1896
+ onChange: E[3] || (E[3] = (Te) => l("change", Te))
1897
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "onInput"]))
1898
+ ]),
1899
+ N(z(x, {
1900
+ reactive: "",
1901
+ icon: "trash",
1902
+ onClick: (Te) => e(Uo)(m.modelValue[A], je)
1903
+ }, null, 8, ["onClick"]), [
1904
+ [G]
1905
+ ])
1906
+ ]);
1907
+ }), 128))
1908
+ ])
1909
+ ])) : m.modelValue ? N((o(), g(he(e(pt)(q, e(b))), H({
1910
+ key: 6,
1911
+ modelValue: m.modelValue[A],
1912
+ "onUpdate:modelValue": (ee) => m.modelValue[A] = ee,
1913
+ ref_for: !0
1914
+ }, {
1915
+ readOnly: e(v),
1916
+ property: q,
1917
+ propertyName: A,
1918
+ parentPropertyName: m.parentPropertyName,
1919
+ parentCollection: e(u),
1920
+ columns: ((xe = (Ne = (Pe = m.layout) == null ? void 0 : Pe.fields) == null ? void 0 : Ne[A]) == null ? void 0 : xe.optionsColumns) || ((nt = (tt = (et = m.layout) == null ? void 0 : et.fields) == null ? void 0 : tt.$default) == null ? void 0 : nt.optionsColumns),
1921
+ ...q.componentProps || {},
1922
+ validationErrors: le(A)
1923
+ }, {
1924
+ onInput: (ee) => l("input", A),
1925
+ onChange: E[4] || (E[4] = (ee) => l("change", ee))
1926
+ }), null, 16, ["modelValue", "onUpdate:modelValue", "onInput"])), [
1927
+ [O, L()]
1928
+ ]) : y("", !0),
1929
+ (ot = $.value) != null && ot[A] ? (o(), i("div", Po, [
1930
+ $.value[A].type ? (o(), i("span", No, k(e(M)(`validation_error.${$.value[A].type}`)), 1)) : y("", !0),
1931
+ $.value[A].detail ? (o(), i("span", xo, k(e(M)($.value[A].detail)), 1)) : y("", !0)
1932
+ ])) : y("", !0)
1933
+ ], 4);
1934
+ }), 128))
1935
+ ]),
1936
+ m.$slots.after ? I(m.$slots, "after", { key: 1 }, void 0, !0) : y("", !0),
1937
+ m.$slots.footer ? (o(), i("div", ea, [
1938
+ I(m.$slots, "footer", pe(Ve({
1939
+ isInsertReady: se.value
1940
+ })), void 0, !0)
1941
+ ])) : y("", !0)
1942
+ ], 4);
1943
+ };
1944
+ }
1945
+ });
1946
+ const Ge = /* @__PURE__ */ X(ta, [["__scopeId", "data-v-fb16d65c"]]), na = /* @__PURE__ */ U({
1947
+ __name: "aeria-filter-panel",
1948
+ emits: ["update:modelValue"],
1949
+ setup(d, { emit: r }) {
1950
+ const a = r, t = ge(), l = Ie(), s = () => {
1951
+ t.pagination.offset = 0, t.$actions.filter(), a("update:modelValue", !1), l.push({
1952
+ query: qt(t)
1953
+ });
1954
+ };
1955
+ return (u, v) => (o(), g(Ae, {
1956
+ "close-hint": "",
1957
+ "fixed-right": "",
1958
+ title: u.t("filter_by", { capitalize: !0 }),
1959
+ onClose: v[2] || (v[2] = (c) => a("update:modelValue", !1)),
1960
+ onOverlayClick: v[3] || (v[3] = (c) => a("update:modelValue", !1))
1961
+ }, {
1962
+ footer: f(() => [
1963
+ e(t).filtersCount > 0 ? (o(), g(re, {
1964
+ key: 0,
1965
+ variant: "transparent",
1966
+ onClick: v[1] || (v[1] = (c) => {
1967
+ e(t).$actions.clearFilters(), s(), a("update:modelValue", !1);
1968
+ })
1969
+ }, {
1970
+ default: f(() => [
1971
+ W(k(u.t("action.clear", { capitalize: !0 })) + " ", 1),
1972
+ z(be, null, {
1973
+ default: f(() => [
1974
+ W(k(e(t).filtersCount), 1)
1975
+ ]),
1976
+ _: 1
1977
+ })
1978
+ ]),
1979
+ _: 1
1980
+ })) : y("", !0),
1981
+ z(re, {
1982
+ large: "",
1983
+ icon: "funnel",
1984
+ disabled: !e(t).hasActiveFilters,
1985
+ onClick: s
1986
+ }, {
1987
+ default: f(() => [
1988
+ W(k(u.t("action.filter", { capitalize: !0 })), 1)
1989
+ ]),
1990
+ _: 1
1991
+ }, 8, ["disabled"])
1992
+ ]),
1993
+ default: f(() => [
1994
+ z(Ge, H({
1995
+ modelValue: e(t).filters,
1996
+ "onUpdate:modelValue": v[0] || (v[0] = (c) => e(t).filters = c)
1997
+ }, {
1998
+ searchOnly: !0,
1999
+ form: e(t).availableFilters,
2000
+ layout: e(t).description.formLayout || {}
2001
+ }, { focus: "" }), null, 16, ["modelValue"])
2002
+ ]),
2003
+ _: 1
2004
+ }, 8, ["title"]));
2005
+ }
2006
+ }), oa = /* @__PURE__ */ U({
2007
+ __name: "aeria-insert-panel",
2008
+ props: {
2009
+ collection: {},
2010
+ modelValue: { type: [Boolean, String] },
2011
+ readOnly: { type: Boolean }
2012
+ },
2013
+ emits: ["update:modelValue", "cancel"],
2014
+ setup(d, { emit: r }) {
2015
+ const a = d, t = r, l = ie("meta"), s = ie(a.collection || l.view.collection), u = ve("individualActions", []), v = async () => {
2016
+ const { error: p } = await s.$actions.deepInsert();
2017
+ p || t("update:modelValue", !1);
2018
+ }, { t: c } = Tt(), h = () => {
2019
+ l.$actions.ask({
2020
+ action: () => {
2021
+ s.$actions.clearItem(), s.validationErrors = {}, t("cancel");
2022
+ },
2023
+ body: c("prompt.close_panel")
2024
+ });
2025
+ };
2026
+ return ue(() => s.item._id, (p) => {
2027
+ p === null && t("update:modelValue", !1);
2028
+ }), (p, n) => {
2029
+ const _ = ne("clickable");
2030
+ return o(), g(Ae, {
2031
+ loading: e(s).loading.get,
2032
+ onOverlayClick: h
2033
+ }, ce({
2034
+ extra: f(() => [
2035
+ z(Ce, H({
2036
+ subject: e(s).item,
2037
+ actions: e(u).filter(({ action: $ }) => $ !== "ui/spawnEdit")
2038
+ }, {
2039
+ onActionClick: n[2] || (n[2] = ($) => t("update:modelValue", !1))
2040
+ }), {
2041
+ default: f(() => [
2042
+ e(s).item._id ? N((o(), g(x, {
2043
+ key: 0,
2044
+ reactive: "",
2045
+ icon: "dots-three"
2046
+ }, null, 512)), [
2047
+ [_]
2048
+ ]) : y("", !0)
2049
+ ]),
2050
+ _: 1
2051
+ }, 16)
2052
+ ]),
2053
+ default: f(() => [
2054
+ z(Ge, H({
2055
+ modelValue: e(s).item,
2056
+ "onUpdate:modelValue": n[0] || (n[0] = ($) => e(s).item = $)
2057
+ }, {
2058
+ readOnly: p.readOnly,
2059
+ collection: e(l).view.collection,
2060
+ form: e(s).description.form ? e(s).$actions.useProperties(e(s).description.form) : e(s).properties,
2061
+ layout: e(s).description.formLayout || {}
2062
+ }, {
2063
+ focus: "",
2064
+ onAdd: n[1] || (n[1] = ($) => $.preventDefault())
2065
+ }), ce({ _: 2 }, [
2066
+ D(Object.keys(p.$slots).filter(($) => $.startsWith("field-")), ($) => ({
2067
+ name: $,
2068
+ fn: f((b) => [
2069
+ I(p.$slots, $, pe(Ve(b)))
2070
+ ])
2071
+ }))
2072
+ ]), 1040, ["modelValue"])
2073
+ ]),
2074
+ _: 2
2075
+ }, [
2076
+ p.$slots.header ? {
2077
+ name: "header",
2078
+ fn: f(() => [
2079
+ I(p.$slots, "header")
2080
+ ]),
2081
+ key: "0"
2082
+ } : void 0,
2083
+ p.readOnly ? void 0 : {
2084
+ name: "footer",
2085
+ fn: f(() => [
2086
+ z(re, {
2087
+ variant: "transparent",
2088
+ onClick: h
2089
+ }, {
2090
+ default: f(() => [
2091
+ W(k(e(c)("action.cancel", { capitalize: !0 })), 1)
2092
+ ]),
2093
+ _: 1
2094
+ }),
2095
+ z(re, {
2096
+ large: "",
2097
+ disabled: !e(s).isInsertReady || e(s).loading.get,
2098
+ loading: e(s).loading.insert,
2099
+ onClick: v
2100
+ }, {
2101
+ default: f(() => [
2102
+ W(k(e(c)("action.insert", { capitalize: !0 })), 1)
2103
+ ]),
2104
+ _: 1
2105
+ }, 8, ["disabled", "loading"])
2106
+ ]),
2107
+ key: "1"
2108
+ }
2109
+ ]), 1032, ["loading"]);
2110
+ };
2111
+ }
2112
+ }), Vt = (d, r) => {
2113
+ if (r) {
2114
+ if (!d) {
2115
+ r.filtersPreset = {}, r.preferredTableProperties = [], r.pagination.offset = 0;
2116
+ return;
2117
+ }
2118
+ r.filtersPreset = d.filters || {}, r.preferredTableProperties = d.table ? Array.from(d.table) : [], r.pagination.offset = 0;
2119
+ }
2120
+ }, aa = (d, r = {
2121
+ persistInQuery: !0
2122
+ }) => {
2123
+ const t = Ie().currentRoute;
2124
+ return ue(() => t.value.query.section, (l) => {
2125
+ if (d) {
2126
+ if (d.description.filtersPresets) {
2127
+ const s = l || Object.keys(d.description.filtersPresets)[0];
2128
+ Vt(d.description.filtersPresets[s], d);
2129
+ }
2130
+ if (r.persistInQuery) {
2131
+ const s = t.value.query;
2132
+ s.offset && (d.pagination.offset = +s.offset), s.limit && (d.pagination.limit = +s.limit), s.search && (d.textQuery = s.search, d.filters.$text = {
2133
+ $search: `"${s.search}"`,
2134
+ $caseSensitive: !1
2135
+ });
2136
+ }
2137
+ }
2138
+ }, {
2139
+ immediate: !0
2140
+ });
2141
+ }, la = (d) => (Ee("data-v-7f75c4c2"), d = d(), De(), d), sa = {
2142
+ key: 0,
2143
+ class: "table aeria-surface"
2144
+ }, ia = { key: 0 }, ra = { key: 1 }, ua = { key: 0 }, ca = ["checked"], da = {
2145
+ key: 1,
2146
+ style: { "text-align": "right" }
2147
+ }, pa = { key: 2 }, _a = { key: 3 }, ma = ["onClick"], fa = { key: 0 }, va = ["value"], ya = { class: "table__cell-mobile-label" }, ha = {
2148
+ key: 0,
2149
+ class: "table__cell-container"
2150
+ }, $a = {
2151
+ key: 1,
2152
+ class: "table__cell-container"
2153
+ }, ba = { class: "table__cell-grid" }, ga = { key: 0 }, ka = { key: 1 }, Va = ["href"], Ca = { key: 3 }, Oa = { key: 2 }, Ia = { key: 0 }, Aa = { key: 1 }, Ba = { key: 2 }, wa = {
2154
+ key: 1,
2155
+ class: "no-print"
2156
+ }, Sa = { class: "table__cell-actions" }, ja = {
2157
+ key: 2,
2158
+ class: "no-print table__mobile-actions"
2159
+ }, Ta = ["id"], La = { key: 1 }, Ra = /* @__PURE__ */ la(() => /* @__PURE__ */ V("td", { colspan: 10 }, [
2160
+ /* @__PURE__ */ V("div", { class: "table__empty" }, " Não foram encontrados resultados. ")
2161
+ ], -1)), za = [
2162
+ Ra
2163
+ ], Ma = /* @__PURE__ */ U({
2164
+ __name: "aeria-table",
2165
+ props: {
2166
+ columns: {},
2167
+ rows: {},
2168
+ collection: {},
2169
+ checkbox: { type: Boolean },
2170
+ actions: {},
2171
+ layout: {}
2172
+ },
2173
+ emits: ["itemClick"],
2174
+ setup(d, { emit: r }) {
2175
+ const a = d, t = r, l = ze(), s = a.collection || Me(), u = s ? ie(typeof s == "string" ? s : s.value) : null, v = Q({
2176
+ get: () => u == null ? void 0 : u.selected,
2177
+ set: (_) => u == null ? void 0 : u.$actions.selectManyItems(_, !0)
2178
+ }), c = (_, $) => _ != null && _.button ? typeof _.button == "object" ? Ke($, _.button).satisfied : _.button : !1, h = (_) => {
2179
+ var $;
2180
+ return !l.value.xl || !(($ = a.layout) != null && $.actions) || !a.actions ? [] : a.actions.filter((b) => {
2181
+ const S = a.layout.actions[b.action];
2182
+ return c(S, _);
2183
+ });
2184
+ }, p = (_) => {
2185
+ var $;
2186
+ return a.actions ? !l.value.xl || !(($ = a.layout) != null && $.actions) ? a.actions : a.actions.filter((b) => {
2187
+ const S = a.layout.actions[b.action];
2188
+ if (b.roles) {
2189
+ const T = ie("user");
2190
+ if (!bt(b.roles, T.currentUser.roles))
2191
+ return !1;
2192
+ }
2193
+ return !c(S, _);
2194
+ }) : [];
2195
+ }, n = (_, $) => {
2196
+ var T, Z;
2197
+ const b = [], S = (Z = (T = a.layout) == null ? void 0 : T.actions) == null ? void 0 : Z[$.action];
2198
+ return S != null && S.if && (Ke(
2199
+ _,
2200
+ S.if
2201
+ ).satisfied || b.push("display: none;")), b.join("");
2202
+ };
2203
+ return (_, $) => {
2204
+ var S, T, Z;
2205
+ const b = ne("clickable");
2206
+ return _.columns && Object.keys(_.columns).length > 0 || _.$slots.thead ? (o(), i("table", sa, [
2207
+ _.$slots.thead ? (o(), i("thead", ia, [
2208
+ I(_.$slots, "thead", {}, void 0, !0)
2209
+ ])) : (o(), i("thead", ra, [
2210
+ V("tr", null, [
2211
+ _.checkbox && e(u) && e(l).md ? (o(), i("th", ua, [
2212
+ V("input", {
2213
+ type: "checkbox",
2214
+ checked: e(u).selected.length > 0 && e(u).selected.length === e(u).itemsCount,
2215
+ onChange: $[0] || ($[0] = (B) => e(u).$actions.selectAllItems(B.target.checked))
2216
+ }, null, 40, ca)
2217
+ ])) : y("", !0),
2218
+ (o(!0), i(P, null, D(Object.entries(_.columns), ([B, F], Y) => (o(), i("th", {
2219
+ key: `header-${Y}`,
2220
+ class: "table__header"
2221
+ }, k(F.description || e(M)(B)), 1))), 128)),
2222
+ (S = _.actions) != null && S.length ? (o(), i("th", da)) : y("", !0)
2223
+ ])
2224
+ ])),
2225
+ _.$slots.tbody ? (o(), i("tbody", pa, [
2226
+ I(_.$slots, "tbody", {}, void 0, !0)
2227
+ ])) : (o(), i("tbody", _a, [
2228
+ (o(!0), i(P, null, D(_.rows, (B) => {
2229
+ var F, Y;
2230
+ return o(), i("tr", {
2231
+ key: B._id,
2232
+ onClick: (w) => t("itemClick", B)
2233
+ }, [
2234
+ e(u) && _.checkbox && e(l).md ? (o(), i("td", fa, [
2235
+ N(V("input", {
2236
+ "onUpdate:modelValue": $[1] || ($[1] = (w) => v.value = w),
2237
+ type: "checkbox",
2238
+ value: B._id
2239
+ }, null, 8, va), [
2240
+ [It, v.value]
2241
+ ])
2242
+ ])) : y("", !0),
2243
+ (o(!0), i(P, null, D(Object.entries(_.columns), ([w, te], C) => {
2244
+ var j, oe, ae, se, le, L;
2245
+ return o(), i("td", {
2246
+ key: `column-${B._id}-${C}`
2247
+ }, [
2248
+ V("div", ya, k(te.description || e(M)(w)), 1),
2249
+ `row-${w}` in _.$slots ? (o(), i("div", ha, [
2250
+ I(_.$slots, `row-${w}`, H({ ref_for: !0 }, {
2251
+ store: e(u),
2252
+ column: w,
2253
+ property: te,
2254
+ row: B
2255
+ }), void 0, !0)
2256
+ ])) : (o(), i("div", $a, [
2257
+ V("div", ba, [
2258
+ "type" in te && te.type === "boolean" ? (o(), i("div", ga, [
2259
+ B[w] ? (o(), g(x, {
2260
+ key: 0,
2261
+ icon: "check",
2262
+ "icon-classes": "aeria-blueish"
2263
+ }, {
2264
+ default: f(() => [
2265
+ W(k(e(M)("yes")), 1)
2266
+ ]),
2267
+ _: 1
2268
+ })) : (o(), g(x, {
2269
+ key: 1,
2270
+ icon: "x",
2271
+ "icon-classes": "aeria-redish"
2272
+ }, {
2273
+ default: f(() => [
2274
+ W(k(e(M)("no")), 1)
2275
+ ]),
2276
+ _: 1
2277
+ }))
2278
+ ])) : ((j = e(_e)(te)) == null ? void 0 : j.$ref) === "file" ? (o(), i("div", ka, [
2279
+ /^image/.test((oe = B[w][0]) == null ? void 0 : oe.type) && "items" in te ? (o(), g(Ue, {
2280
+ key: 0,
2281
+ modelValue: B[w][0].link,
2282
+ "onUpdate:modelValue": (R) => B[w][0].link = R,
2283
+ expandable: "",
2284
+ meta: B[w][0],
2285
+ alt: "Row image",
2286
+ class: "table__picture"
2287
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "meta"])) : /^image/.test((ae = B[w]) == null ? void 0 : ae.type) ? (o(), g(Ue, {
2288
+ key: 1,
2289
+ modelValue: B[w].link,
2290
+ "onUpdate:modelValue": (R) => B[w].link = R,
2291
+ expandable: "",
2292
+ meta: B[w],
2293
+ alt: "Row image",
2294
+ class: "table__picture"
2295
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "meta"])) : (se = B[w]) != null && se.link ? (o(), i("a", {
2296
+ key: 2,
2297
+ href: B[w].link,
2298
+ style: { "font-size": "10pt" }
2299
+ }, k(B[w].filename), 9, Va)) : (o(), i("div", Ca, " - "))
2300
+ ])) : (o(), i("div", Oa, [
2301
+ e(u) ? (o(), i("span", Ia, k(e(u).$actions.formatValue({
2302
+ value: B[w],
2303
+ key: w,
2304
+ property: te
2305
+ })), 1)) : (o(), i("span", Aa, k(Array.isArray(B[w]) ? B[w].filter((R) => !!R).join(", ") : [void 0, null].includes(B[w]) ? "-" : B[w]), 1)),
2306
+ ((L = (le = e(_e)(te)) == null ? void 0 : le.indexes) == null ? void 0 : L.length) > 1 ? (o(), i("div", Ba, [
2307
+ (o(!0), i(P, null, D(e(_e)(te).indexes.slice(1, 2), (R, m) => (o(), i("div", {
2308
+ key: `subvalue-${m}`,
2309
+ class: "table__cell-subvalue"
2310
+ }, k(e(u).$actions.formatValue({
2311
+ value: B[w],
2312
+ key: w,
2313
+ property: te,
2314
+ index: R
2315
+ })), 1))), 128))
2316
+ ])) : y("", !0)
2317
+ ]))
2318
+ ])
2319
+ ]))
2320
+ ]);
2321
+ }), 128)),
2322
+ (F = _.actions) != null && F.length && e(l).md ? (o(), i("td", wa, [
2323
+ V("div", Sa, [
2324
+ (o(!0), i(P, null, D(h(B), (w) => (o(), g(re, {
2325
+ key: `action-${w.action}`,
2326
+ small: "",
2327
+ variant: "transparent",
2328
+ icon: w.icon,
2329
+ style: $e(n(B, w)),
2330
+ onClick: (te) => w.click(B)
2331
+ }, {
2332
+ default: f(() => [
2333
+ W(k(e(M)(w.label)), 1)
2334
+ ]),
2335
+ _: 2
2336
+ }, 1032, ["icon", "style", "onClick"]))), 128)),
2337
+ p(B).length > 0 ? (o(), g(Ce, H({
2338
+ key: 0,
2339
+ ref_for: !0
2340
+ }, {
2341
+ subject: B,
2342
+ actions: p(B)
2343
+ }), {
2344
+ default: f(() => [
2345
+ N(z(x, {
2346
+ reactive: "",
2347
+ icon: "dots-three"
2348
+ }, null, 512), [
2349
+ [b]
2350
+ ])
2351
+ ]),
2352
+ _: 2
2353
+ }, 1040)) : y("", !0)
2354
+ ])
2355
+ ])) : (Y = _.actions) != null && Y.length ? (o(), i("td", ja, [
2356
+ V("div", {
2357
+ class: "table__mobile-actions-grid",
2358
+ style: $e(`grid-template-columns: repeat(${h(B).length + (p(B).length ? 1 : 0)}, 1fr);`)
2359
+ }, [
2360
+ (o(!0), i(P, null, D(h(B), (w) => (o(), g(fe, {
2361
+ key: `action-${w.action}`,
2362
+ class: "table__mobile-actions-button",
2363
+ onClick: (te) => w.click(B)
2364
+ }, {
2365
+ default: f(() => [
2366
+ z(x, {
2367
+ icon: w.icon || "gear"
2368
+ }, {
2369
+ default: f(() => [
2370
+ W(k(e(M)(w.label)), 1)
2371
+ ]),
2372
+ _: 2
2373
+ }, 1032, ["icon"])
2374
+ ]),
2375
+ _: 2
2376
+ }, 1032, ["onClick"]))), 128)),
2377
+ p(B).length > 0 ? (o(), g(Ce, H({
2378
+ key: 0,
2379
+ ref_for: !0
2380
+ }, {
2381
+ subject: B,
2382
+ actions: p(B)
2383
+ }), {
2384
+ default: f(() => [
2385
+ z(x, {
2386
+ icon: "dots-three",
2387
+ class: "table__mobile-actions-button"
2388
+ })
2389
+ ]),
2390
+ _: 2
2391
+ }, 1040)) : y("", !0)
2392
+ ], 4)
2393
+ ])) : y("", !0),
2394
+ V("div", {
2395
+ id: `dropdown-${B._id}`
2396
+ }, null, 8, Ta)
2397
+ ], 8, ma);
2398
+ }), 128))
2399
+ ])),
2400
+ V("tfoot", null, [
2401
+ _.$slots.tfoot ? I(_.$slots, "tfoot", { key: 0 }, void 0, !0) : _.columns && !((T = _.rows) != null && T.length) && !((Z = e(u)) != null && Z.loading.getAll) ? (o(), i("tr", La, za)) : y("", !0)
2402
+ ])
2403
+ ])) : y("", !0);
2404
+ };
2405
+ }
2406
+ });
2407
+ const Fa = /* @__PURE__ */ X(Ma, [["__scopeId", "data-v-7f75c4c2"]]), qa = /* @__PURE__ */ U({
2408
+ __name: "aeria-tabular",
2409
+ props: {
2410
+ individualActions: {},
2411
+ layoutOptions: {},
2412
+ componentProps: {}
2413
+ },
2414
+ setup(d) {
2415
+ const r = d, a = ge(), t = Me(), l = Q(() => {
2416
+ const s = {
2417
+ collection: t,
2418
+ checkbox: a.hasSelectionActions,
2419
+ columns: a.tableProperties,
2420
+ rows: a.items,
2421
+ actions: r.individualActions,
2422
+ layout: a.tableLayout
2423
+ };
2424
+ return Object.assign(s, r.componentProps);
2425
+ });
2426
+ return (s, u) => (o(), i("div", null, [
2427
+ s.$slots.inner ? I(s.$slots, "inner", { key: 0 }) : y("", !0),
2428
+ e(a).properties ? (o(), g(Fa, H({ key: 1 }, l.value, {
2429
+ key: e(a).$id
2430
+ }), ce({ _: 2 }, [
2431
+ D(Object.keys(s.$slots).filter((v) => !["inner"].includes(v)), (v) => ({
2432
+ name: v,
2433
+ fn: f((c) => [
2434
+ I(s.$slots, v, pe(Ve(c)))
2435
+ ])
2436
+ }))
2437
+ ]), 1040)) : y("", !0)
2438
+ ]));
2439
+ }
2440
+ }), Ua = /* @__PURE__ */ U({
2441
+ __name: "aeria-grid",
2442
+ props: {
2443
+ list: { type: Boolean }
2444
+ },
2445
+ setup(d) {
2446
+ return (r, a) => (o(), i("div", {
2447
+ class: K(`
2448
+ grid
2449
+ ${r.list && "grid--list"}
2450
+ `)
2451
+ }, [
2452
+ I(r.$slots, "default", {}, void 0, !0)
2453
+ ], 2));
2454
+ }
2455
+ });
2456
+ const Ea = /* @__PURE__ */ X(Ua, [["__scopeId", "data-v-438c4aed"]]), Da = { key: 0 }, Ha = {
2457
+ key: 1,
2458
+ class: "card__information"
2459
+ }, Qa = /* @__PURE__ */ U({
2460
+ __name: "aeria-grid",
2461
+ props: {
2462
+ individualActions: {},
2463
+ hasSelectionActions: { type: Boolean },
2464
+ layoutOptions: {},
2465
+ componentName: {}
2466
+ },
2467
+ setup(d) {
2468
+ const a = d.layoutOptions, t = ge(), l = (s) => Array.isArray(s) ? s[0] : s;
2469
+ return (s, u) => {
2470
+ const v = ne("clickable");
2471
+ return o(), g(Ea, {
2472
+ list: s.componentName === "list"
2473
+ }, {
2474
+ default: f(() => [
2475
+ (o(!0), i(P, null, D(e(t).items, (c) => (o(), g(_n, {
2476
+ key: c,
2477
+ inactive: !!(e(a).active && !c[e(a).active]),
2478
+ horizontal: s.componentName === "list"
2479
+ }, ce({
2480
+ footer: f(() => [
2481
+ e(a).title ? (o(), i("div", Da, k(c[e(a).title]), 1)) : y("", !0),
2482
+ e(a).information ? (o(), i("div", Ha, k(c[e(a).information]), 1)) : y("", !0)
2483
+ ]),
2484
+ actions: f(() => [
2485
+ s.individualActions.length > 0 ? (o(), g(Ce, H({
2486
+ key: 0,
2487
+ ref_for: !0
2488
+ }, {
2489
+ subject: c,
2490
+ actions: s.individualActions
2491
+ }), {
2492
+ default: f(() => [
2493
+ N(z(x, {
2494
+ reactive: "",
2495
+ icon: "dots-three-vertical"
2496
+ }, null, 512), [
2497
+ [v]
2498
+ ])
2499
+ ]),
2500
+ _: 2
2501
+ }, 1040)) : y("", !0)
2502
+ ]),
2503
+ default: f(() => {
2504
+ var h;
2505
+ return [
2506
+ z(Ue, {
2507
+ alt: "Item picture",
2508
+ expandable: "",
2509
+ url: (h = l(c[e(a).picture])) == null ? void 0 : h.link,
2510
+ meta: l(c[e(a).picture])
2511
+ }, null, 8, ["url", "meta"])
2512
+ ];
2513
+ }),
2514
+ _: 2
2515
+ }, [
2516
+ e(a).badge && Array.isArray(c[e(a).badge]) ? {
2517
+ name: "badge",
2518
+ fn: f(() => [
2519
+ (o(!0), i(P, null, D(c[e(a).badge], (h) => (o(), g(be, {
2520
+ key: `${c._id}-${h}`,
2521
+ large: ""
2522
+ }, {
2523
+ default: f(() => [
2524
+ W(k(e(a).translateBadge ? e(M)(h) : h), 1)
2525
+ ]),
2526
+ _: 2
2527
+ }, 1024))), 128))
2528
+ ]),
2529
+ key: "0"
2530
+ } : e(a).badge ? {
2531
+ name: "badge",
2532
+ fn: f(() => [
2533
+ z(be, null, {
2534
+ default: f(() => [
2535
+ W(k(e(a).translateBadge ? e(M)(c[e(a).badge]) : c[e(a).badge]), 1)
2536
+ ]),
2537
+ _: 2
2538
+ }, 1024)
2539
+ ]),
2540
+ key: "1"
2541
+ } : void 0
2542
+ ]), 1032, ["inactive", "horizontal"]))), 128))
2543
+ ]),
2544
+ _: 1
2545
+ }, 8, ["list"]);
2546
+ };
2547
+ }
2548
+ });
2549
+ const _t = /* @__PURE__ */ X(Qa, [["__scopeId", "data-v-113dd7db"]]), Ga = (d) => ({
2550
+ tabular: qa,
2551
+ grid: _t,
2552
+ list: _t
2553
+ })[d], de = J(!1);
2554
+ J(!1);
2555
+ const ke = J(!1), Le = J((...d) => null), mt = J(), Wa = (d) => (Ee("data-v-2f942d7a"), d = d(), De(), d), Ka = {
2556
+ key: 2,
2557
+ class: "crud__controls"
2558
+ }, Xa = {
2559
+ key: 0,
2560
+ class: "crud__search"
2561
+ }, Ya = { class: "crud__actions" }, Ja = { class: "crud__context-badge" }, Za = /* @__PURE__ */ Wa(() => /* @__PURE__ */ V("div", null, "Filtros", -1)), Pa = { key: 0 }, Na = {
2562
+ key: 3,
2563
+ class: "crud__pagination"
2564
+ }, ft = 30, xa = /* @__PURE__ */ U({
2565
+ __name: "aeria-crud",
2566
+ props: {
2567
+ collection: {},
2568
+ noControls: { type: Boolean },
2569
+ noActions: { type: Boolean },
2570
+ noFetch: { type: Boolean },
2571
+ noLayoutToggle: { type: Boolean },
2572
+ layout: {},
2573
+ action: {},
2574
+ componentProps: {},
2575
+ scrollPagination: { type: Boolean },
2576
+ noQueryPersistence: { type: Boolean }
2577
+ },
2578
+ emits: ["uiEvent"],
2579
+ setup(d, { emit: r }) {
2580
+ const a = d, t = r, l = Ie(), s = $t({
2581
+ delay: 600
2582
+ }), u = ie("meta"), v = ze(), { reachedEnd: c, detach: h } = Ye(null, {
2583
+ antecipate: 600
2584
+ }), p = !v.value.md || a.scrollPagination;
2585
+ p && ue(c, (C) => {
2586
+ C && n.pagination.recordsTotal > n.items.length && b.value < ft && (b.value += 1, T());
2587
+ });
2588
+ const n = ie(a.collection);
2589
+ aa(n, {
2590
+ persistInQuery: !a.noQueryPersistence
2591
+ });
2592
+ const _ = gt(), $ = a.action ? e(a.action) : Ut(n, l, _);
2593
+ Le.value = $[0], mt.value = $[1];
2594
+ const b = J(0), S = J(!1), T = async (C) => {
2595
+ n.activeFilters = Object.assign({}, (C == null ? void 0 : C.filters) || n.$filters), Object.assign(n.activeFilters, n.filtersPreset);
2596
+ const j = {
2597
+ filters: n.activeFilters,
2598
+ limit: n.pagination.limit,
2599
+ offset: n.pagination.offset,
2600
+ project: n.preferredTableProperties.length > 0 ? n.preferredTableProperties : n.description.table || Object.keys(n.properties)
2601
+ };
2602
+ b.value > 0 && (j.limit = 15, j.offset = b.value * j.limit), n.description.tableMeta && (j.project = j.project.concat(n.description.tableMeta)), C && Object.assign(j, C), n.loading.getAll = !0;
2603
+ const { error: oe, result: ae } = await n.$actions.retrieveItems(j);
2604
+ if (oe)
2605
+ return;
2606
+ const { data: se, pagination: le } = ae;
2607
+ n.pagination.recordsCount = le.recordsCount, n.pagination.recordsTotal = le.recordsTotal, b.value === 0 && n.items.splice(0), n.items.push(...se), n.loading.getAll = !1, S.value = !0;
2608
+ }, Z = async (C) => {
2609
+ l.push({
2610
+ query: {
2611
+ ...l.currentRoute.value.query,
2612
+ offset: C.offset,
2613
+ limit: C.limit
2614
+ }
2615
+ }), n.pagination.offset = C.offset, n.pagination.limit = C.limit, T();
2616
+ }, B = ve("noResultsComponent", null);
2617
+ ue(() => [
2618
+ l.currentRoute.value.path,
2619
+ l.currentRoute.value.query.section
2620
+ ], async (C, j) => {
2621
+ if (j && j[0] === C[0] && j[1] === C[1])
2622
+ return;
2623
+ const oe = l.currentRoute.value;
2624
+ if (u.view.title = a.collection, u.view.collection = a.collection, !a.noFetch && !oe.query._popstate) {
2625
+ const ae = Et(n, oe);
2626
+ Object.keys(ae).length > 0 && Object.assign(n.filters, ae), await T();
2627
+ }
2628
+ }, {
2629
+ immediate: !0,
2630
+ flush: "post"
2631
+ });
2632
+ const [F] = s((C) => (l.push({
2633
+ query: {
2634
+ search: C || void 0
2635
+ }
2636
+ }), C ? (n.filters = Object.assign(Re(n.freshFilters), {
2637
+ $text: {
2638
+ $search: `"${C}"`,
2639
+ $caseSensitive: !1
2640
+ }
2641
+ }), T({
2642
+ offset: 0
2643
+ })) : (n.filters = Re(n.freshFilters), b.value = 0, T())));
2644
+ ue(() => n.textQuery, (C) => {
2645
+ F(C);
2646
+ });
2647
+ const Y = (C) => {
2648
+ C.currentLayout = C.currentLayout === "tabular" ? C.description.layout.name : "tabular";
2649
+ };
2650
+ At(() => {
2651
+ n.$actions.clearFilters(), n.textQuery = "", h();
2652
+ }), ue(() => mt.value, async (C) => {
2653
+ var ae;
2654
+ const j = Re(C);
2655
+ let oe;
2656
+ if (j)
2657
+ if ((j.name === "spawnEdit" || j.name === "duplicate") && (oe = n.$actions.get({
2658
+ filters: {
2659
+ _id: j.params._id
2660
+ }
2661
+ })), j.name === "spawnAdd")
2662
+ n.$actions.clearItem(), (ae = j.params) != null && ae.item && (n.$actions.setItem(j.params.item), Object.keys(j.params.item).forEach((se) => {
2663
+ delete n.referenceItem[se];
2664
+ })), de.value = "add";
2665
+ else if (j.name === "spawnEdit")
2666
+ n.$actions.setItem(j.params), de.value = "edit";
2667
+ else if (j.name === "duplicate") {
2668
+ await oe;
2669
+ const se = Object.entries(n.item).reduce((le, [L, R]) => {
2670
+ if (!(L in n.properties))
2671
+ return {
2672
+ ...le,
2673
+ [L]: R
2674
+ };
2675
+ const m = n.properties[L];
2676
+ if (m.readOnly)
2677
+ return le;
2678
+ const E = (G) => {
2679
+ const O = _e(m);
2680
+ if (!O)
2681
+ return G;
2682
+ if (O.$ref === "file")
2683
+ return {};
2684
+ if (O.inline && G) {
2685
+ const { _id: A, ...q } = G;
2686
+ return q;
2687
+ }
2688
+ return G;
2689
+ };
2690
+ return R = Array.isArray(R) ? R.map(E) : E(R), {
2691
+ ...le,
2692
+ [L]: R
2693
+ };
2694
+ }, {});
2695
+ n.$actions.setItem(se), delete n.item._id, n.referenceItem = {}, de.value = "duplicate";
2696
+ } else
2697
+ t("uiEvent", j);
2698
+ }, {
2699
+ deep: !0
2700
+ }), ue(() => de, (C) => {
2701
+ C.value === !1 && (u.view.collection = a.collection, n.$actions.clearItem());
2702
+ });
2703
+ const w = Q(() => n.individualActions.map((C) => ({
2704
+ click: Le.value(C),
2705
+ ...C
2706
+ }))), te = Q(() => n.actions.filter((C) => !C.button));
2707
+ return ye(He, Q(() => a.collection)), ye("individualActions", w), (C, j) => {
2708
+ var se, le, L, R, m, E, G;
2709
+ const oe = ne("clickable"), ae = ne("loading");
2710
+ return o(), i(P, null, [
2711
+ e(ke) ? (o(), g(na, {
2712
+ key: e(n).$id,
2713
+ modelValue: e(ke),
2714
+ "onUpdate:modelValue": j[0] || (j[0] = (O) => ct(ke) ? ke.value = O : null)
2715
+ }, null, 8, ["modelValue"])) : y("", !0),
2716
+ e(de) ? (o(), g(oa, {
2717
+ key: 1,
2718
+ modelValue: e(de),
2719
+ "onUpdate:modelValue": j[1] || (j[1] = (O) => ct(de) ? de.value = O : null),
2720
+ "fixed-right": "",
2721
+ onCancel: j[2] || (j[2] = (O) => de.value = !1)
2722
+ }, ce({
2723
+ header: f(() => [
2724
+ V("span", null, k((() => {
2725
+ switch (e(de)) {
2726
+ case "add":
2727
+ return e(M)("action.add", { capitalize: !0 });
2728
+ case "duplicate":
2729
+ return e(M)("action.duplicate", { capitalize: !0 });
2730
+ case "edit":
2731
+ default:
2732
+ return e(M)("action.edit", { capitalize: !0 });
2733
+ }
2734
+ })()), 1),
2735
+ V("span", null, " " + k(e(M)(e(u).view.collection)), 1)
2736
+ ]),
2737
+ _: 2
2738
+ }, [
2739
+ D(Object.keys(C.$slots).filter((O) => O.startsWith("field-")), (O) => ({
2740
+ name: O,
2741
+ fn: f((A) => [
2742
+ I(C.$slots, O, pe(Ve(A)), void 0, !0)
2743
+ ])
2744
+ }))
2745
+ ]), 1032, ["modelValue"])) : y("", !0),
2746
+ !C.noActions && (e(n).description.search || Object.keys(e(n).availableFilters).length > 0 || ((se = e(n)) == null ? void 0 : se.actions.length) > 0 || C.$slots.actions || !C.noLayoutToggle && e(n).description.layout && ((le = e(n).description.layout) == null ? void 0 : le.name) !== "tabular") ? (o(), i("div", Ka, [
2747
+ e(n).description.search ? (o(), i("div", Xa, [
2748
+ z(Oe, H({
2749
+ modelValue: e(n).textQuery,
2750
+ "onUpdate:modelValue": j[3] || (j[3] = (O) => e(n).textQuery = O)
2751
+ }, {
2752
+ property: {
2753
+ type: "string",
2754
+ placeholder: e(n).description.search.placeholder || "Pesquise aqui",
2755
+ inputType: "search"
2756
+ }
2757
+ }), null, 16, ["modelValue"])
2758
+ ])) : y("", !0),
2759
+ V("div", Ya, [
2760
+ te.value.length > 0 || !C.noLayoutToggle && e(n).description.layout && ((L = e(n).description.layout) == null ? void 0 : L.name) !== "tabular" ? (o(), g(Ce, { key: 0 }, ce({
2761
+ default: f(() => [
2762
+ z(re, {
2763
+ variant: "alt",
2764
+ icon: "sliders"
2765
+ }, {
2766
+ default: f(() => [
2767
+ e(n).filtersCount ? (o(), g(be, { key: 0 }, {
2768
+ default: f(() => [
2769
+ W(k(e(n).filtersCount), 1)
2770
+ ]),
2771
+ _: 1
2772
+ })) : y("", !0)
2773
+ ]),
2774
+ _: 1
2775
+ })
2776
+ ]),
2777
+ _: 2
2778
+ }, [
2779
+ Object.keys(e(n).availableFilters).length > 0 ? {
2780
+ name: "filter",
2781
+ fn: f(() => [
2782
+ N((o(), g(x, {
2783
+ icon: "funnel",
2784
+ onClick: j[4] || (j[4] = (O) => ke.value = !0)
2785
+ }, {
2786
+ default: f(() => [
2787
+ W(k(e(M)("filters", { capitalize: !0 })), 1)
2788
+ ]),
2789
+ _: 1
2790
+ })), [
2791
+ [oe]
2792
+ ]),
2793
+ V("div", Ja, [
2794
+ e(n).filtersCount ? (o(), g(be, { key: 0 }, {
2795
+ default: f(() => [
2796
+ W(k(e(n).filtersCount), 1)
2797
+ ]),
2798
+ _: 1
2799
+ })) : y("", !0)
2800
+ ])
2801
+ ]),
2802
+ key: "0"
2803
+ } : void 0,
2804
+ !C.noLayoutToggle && e(n).description.layout && ((R = e(n).description.layout) == null ? void 0 : R.name) !== "tabular" ? {
2805
+ name: "layout-toggle",
2806
+ fn: f(() => [
2807
+ N((o(), g(x, {
2808
+ icon: "table",
2809
+ onClick: j[5] || (j[5] = (O) => Y(e(n)))
2810
+ }, {
2811
+ default: f(() => [
2812
+ W(k(e(M)("change_layout", { capitalize: !0 })), 1)
2813
+ ]),
2814
+ _: 1
2815
+ })), [
2816
+ [oe]
2817
+ ])
2818
+ ]),
2819
+ key: "1"
2820
+ } : void 0,
2821
+ D(te.value, (O, A) => ({
2822
+ name: `action-${A}`,
2823
+ fn: f(() => [
2824
+ O ? (o(), g(x, {
2825
+ key: 0,
2826
+ icon: O.icon || "gear",
2827
+ disabled: e(n).selected.length === 0 && O.selection,
2828
+ onClick: (q) => e(Le)(O)({ _id: e(n).selected.map((me) => me._id) })
2829
+ }, {
2830
+ default: f(() => [
2831
+ W(k(e(M)(O.label, { capitalize: !0 })), 1)
2832
+ ]),
2833
+ _: 2
2834
+ }, 1032, ["icon", "disabled", "onClick"])) : y("", !0)
2835
+ ])
2836
+ }))
2837
+ ]), 1024)) : Object.keys(e(n).availableFilters).length > 0 ? (o(), g(re, {
2838
+ key: 1,
2839
+ variant: "alt",
2840
+ icon: "funnel",
2841
+ onClick: j[6] || (j[6] = (O) => ke.value = !0)
2842
+ }, {
2843
+ default: f(() => [
2844
+ Za,
2845
+ e(n).filtersCount ? (o(), g(be, { key: 0 }, {
2846
+ default: f(() => [
2847
+ W(k(e(n).filtersCount), 1)
2848
+ ]),
2849
+ _: 1
2850
+ })) : y("", !0)
2851
+ ]),
2852
+ _: 1
2853
+ })) : y("", !0),
2854
+ (o(!0), i(P, null, D(e(n).actions.filter((O) => O.button), (O, A) => (o(), g(re, {
2855
+ key: `action-${A}`,
2856
+ icon: O.icon,
2857
+ disabled: e(n).selected.length === 0 && O.selection,
2858
+ onClick: (q) => e(Le)(O)({ _id: e(n).selected.map((me) => me._id) })
2859
+ }, {
2860
+ default: f(() => [
2861
+ W(k(e(M)(O.label, { capitalize: !0 })), 1)
2862
+ ]),
2863
+ _: 2
2864
+ }, 1032, ["icon", "disabled", "onClick"]))), 128)),
2865
+ C.$slots.actions ? I(C.$slots, "actions", { key: 2 }, void 0, !0) : y("", !0)
2866
+ ])
2867
+ ])) : y("", !0),
2868
+ N((o(), i("div", null, [
2869
+ e(n).itemsCount === 0 && !e(n).loading.getAll && S.value && (e(B) || C.$slots.empty) ? (o(), i("div", Pa, [
2870
+ e(B) ? (o(), g(he(e(B)), pe(H({ key: 0 }, {
2871
+ collection: e(n).$id
2872
+ })), {
2873
+ default: f(() => [
2874
+ e(n).filtersCount === 0 && e(n).description.actions && "ui:spawnAdd" in e(n).description.actions ? (o(), g(re, {
2875
+ key: 0,
2876
+ icon: "plus",
2877
+ onClick: j[7] || (j[7] = (O) => e(Le)({
2878
+ action: "ui:spawnAdd"
2879
+ })())
2880
+ }, {
2881
+ default: f(() => [
2882
+ W(k(e(M)("add_first_item", { capitalize: !0 })), 1)
2883
+ ]),
2884
+ _: 1
2885
+ })) : y("", !0)
2886
+ ]),
2887
+ _: 1
2888
+ }, 16)) : I(C.$slots, "empty", pe(H({ key: 1 }, {
2889
+ collection: e(n).$id
2890
+ })), void 0, !0)
2891
+ ])) : C.$slots.component ? I(C.$slots, "component", pe(H({ key: 1 }, {
2892
+ store: e(n)
2893
+ })), void 0, !0) : (o(), g(he(e(Ga)(((m = C.layout) == null ? void 0 : m.name) || e(n).$currentLayout)), H({ key: 2 }, {
2894
+ individualActions: w.value,
2895
+ layoutOptions: ((E = C.layout) == null ? void 0 : E.options) || e(n).layout.options,
2896
+ componentProps: C.componentProps
2897
+ }, {
2898
+ "component-name": ((G = C.layout) == null ? void 0 : G.name) || e(n).$currentLayout
2899
+ }), ce({ _: 2 }, [
2900
+ D(Object.keys(C.$slots).filter((O) => O.startsWith("row-")), (O) => ({
2901
+ name: O,
2902
+ fn: f((A) => [
2903
+ I(C.$slots, O, pe(Ve(A)), void 0, !0)
2904
+ ])
2905
+ })),
2906
+ C.$slots.tfoot ? {
2907
+ name: "tfoot",
2908
+ fn: f(() => [
2909
+ I(C.$slots, "tfoot", {}, void 0, !0)
2910
+ ]),
2911
+ key: "0"
2912
+ } : void 0
2913
+ ]), 1040, ["component-name"]))
2914
+ ])), [
2915
+ [ae, (!e(p) || b.value === ft) && e(n).loading.getAll]
2916
+ ]),
2917
+ !e(n).loading.getAll && e(n).itemsCount > 0 ? (o(), i("div", Na, [
2918
+ z(Fn, {
2919
+ pagination: e(n).pagination,
2920
+ onPaginate: Z
2921
+ }, null, 8, ["pagination"])
2922
+ ])) : y("", !0)
2923
+ ], 64);
2924
+ };
2925
+ }
2926
+ });
2927
+ const zl = /* @__PURE__ */ X(xa, [["__scopeId", "data-v-2f942d7a"]]), el = { class: "prompt" }, tl = /* @__PURE__ */ U({
2928
+ __name: "aeria-prompt",
2929
+ props: {
2930
+ title: {},
2931
+ actions: {}
2932
+ },
2933
+ setup(d) {
2934
+ const r = ie("meta"), a = (t) => {
2935
+ r.$actions.fulfillPrompt(t);
2936
+ };
2937
+ return (t, l) => (o(), g(Ae, {
2938
+ float: "",
2939
+ "fill-footer": "",
2940
+ "close-hint": !1,
2941
+ style: { "--panel-min-width": "32rem" }
2942
+ }, ce({
2943
+ footer: f(() => [
2944
+ V("div", {
2945
+ class: "prompt__actions",
2946
+ style: $e(`grid-template-columns: repeat(${t.actions.length}, 1fr)`)
2947
+ }, [
2948
+ (o(!0), i(P, null, D(t.actions, (s, u) => (o(), g(fe, {
2949
+ key: `action-${u}`,
2950
+ class: K(`
2951
+ prompt__action
2952
+ prompt__action--${s.variant || "primary"}
2953
+ `),
2954
+ onClick: (v) => s.click ? s.click(s) : a(s)
2955
+ }, {
2956
+ default: f(() => [
2957
+ W(k(s.title || s.name), 1)
2958
+ ]),
2959
+ _: 2
2960
+ }, 1032, ["class", "onClick"]))), 128))
2961
+ ], 4)
2962
+ ]),
2963
+ default: f(() => [
2964
+ V("div", el, [
2965
+ I(t.$slots, "default", {}, void 0, !0)
2966
+ ])
2967
+ ]),
2968
+ _: 2
2969
+ }, [
2970
+ t.title ? {
2971
+ name: "title",
2972
+ fn: f(() => [
2973
+ W(k(t.title), 1)
2974
+ ]),
2975
+ key: "0"
2976
+ } : void 0
2977
+ ]), 1024));
2978
+ }
2979
+ });
2980
+ const nl = /* @__PURE__ */ X(tl, [["__scopeId", "data-v-5443f297"]]), ol = { class: "toast__content" }, al = { class: "toast__time" }, ll = /* @__PURE__ */ U({
2981
+ __name: "aeria-toast",
2982
+ props: {
2983
+ idx: {},
2984
+ itr: {},
2985
+ date: {},
2986
+ icon: {}
2987
+ },
2988
+ setup(d) {
2989
+ const r = ie("meta");
2990
+ return (a, t) => {
2991
+ const l = ne("clickable");
2992
+ return N((o(), i("div", {
2993
+ class: K({
2994
+ toast: !0,
2995
+ "toast--animate": e(r).toasts[0].itr === a.itr
2996
+ }),
2997
+ onAnimationend: t[0] || (t[0] = (s) => e(r).$actions.popToast()),
2998
+ onClick: t[1] || (t[1] = (s) => e(r).$actions.popToast(a.itr))
2999
+ }, [
3000
+ z(x, H(
3001
+ a.icon ? { icon: a.icon } : { icon: "warning-circle" },
3002
+ { style: { "--icon-size": "4rem", "--icon-color": "var(--theme-brand-color-shade-3)" } }
3003
+ ), null, 16),
3004
+ V("div", ol, [
3005
+ I(a.$slots, "default", {}, void 0, !0),
3006
+ V("div", al, k(a.formatDateTime(a.date, { hoursOnly: !0 })), 1)
3007
+ ])
3008
+ ], 34)), [
3009
+ [l]
3010
+ ]);
3011
+ };
3012
+ }
3013
+ });
3014
+ const sl = /* @__PURE__ */ X(ll, [["__scopeId", "data-v-21bbe178"]]), il = ["innerHTML"], rl = { class: "main__toasts" }, ul = ["innerHTML"], cl = /* @__PURE__ */ U({
3015
+ __name: "aeria-main",
3016
+ setup(d) {
3017
+ const r = ie("meta"), a = Q(() => r.themeOverride || r.theme);
3018
+ return (t, l) => {
3019
+ const s = Bt("router-view");
3020
+ return o(), i("main", {
3021
+ id: "main",
3022
+ class: K(`
3023
+ main
3024
+ main--${a.value}
3025
+ ${a.value === "dark" && "tw-dark"}
3026
+ `)
3027
+ }, [
3028
+ (o(), g(wt, null, {
3029
+ default: f(() => [
3030
+ z(s, null, {
3031
+ default: f(({ Component: u }) => [
3032
+ (o(), g(he(u), null, ce({ _: 2 }, [
3033
+ D(Object.keys(t.$slots), (v) => ({
3034
+ name: v,
3035
+ fn: f(() => [
3036
+ I(t.$slots, v, {}, void 0, !0)
3037
+ ])
3038
+ }))
3039
+ ]), 1024))
3040
+ ]),
3041
+ _: 3
3042
+ })
3043
+ ]),
3044
+ _: 3
3045
+ })),
3046
+ I(t.$slots, "default", {}, void 0, !0),
3047
+ z(Ae, H({
3048
+ modelValue: e(r).modal.visible,
3049
+ "onUpdate:modelValue": l[0] || (l[0] = (u) => e(r).modal.visible = u),
3050
+ float: "",
3051
+ "close-hint": ""
3052
+ }, e(r).modal, {
3053
+ "overlay-layer": 70,
3054
+ onOverlayClick: l[1] || (l[1] = (u) => e(r).modal.visible = !1)
3055
+ }), {
3056
+ default: f(() => [
3057
+ e(r).modal.body ? (o(), i("div", {
3058
+ key: 0,
3059
+ style: { "white-space": "pre-wrap" },
3060
+ innerHTML: e(r).modal.body
3061
+ }, null, 8, il)) : y("", !0),
3062
+ e(r).modal.component ? (o(), g(he(e(r).modal.component), { key: 1 })) : y("", !0)
3063
+ ]),
3064
+ _: 1
3065
+ }, 16, ["modelValue"]),
3066
+ e(r).prompt.visible ? (o(), g(nl, pe(H({ key: 0 }, e(r).prompt)), {
3067
+ default: f(() => [
3068
+ W(k(e(r).prompt.body), 1)
3069
+ ]),
3070
+ _: 1
3071
+ }, 16)) : y("", !0),
3072
+ V("div", rl, [
3073
+ (o(!0), i(P, null, D(e(r).toasts, (u) => (o(), g(sl, H({ ref_for: !0 }, u, {
3074
+ key: `toast-${u.itr}`
3075
+ }), {
3076
+ default: f(() => [
3077
+ V("div", {
3078
+ innerHTML: e(M)(u.text)
3079
+ }, null, 8, ul)
3080
+ ]),
3081
+ _: 2
3082
+ }, 1040))), 128))
3083
+ ])
3084
+ ], 2);
3085
+ };
3086
+ }
3087
+ });
3088
+ const Ml = /* @__PURE__ */ X(cl, [["__scopeId", "data-v-1166be3d"]]);
3089
+ const dl = {}, pl = { class: "menu" };
3090
+ function _l(d, r) {
3091
+ return o(), i("menu", pl, [
3092
+ (o(!0), i(P, null, D(Object.keys(d.$slots), (a) => (o(), i("div", {
3093
+ key: a,
3094
+ class: "menu__entry"
3095
+ }, [
3096
+ I(d.$slots, a, {}, void 0, !0)
3097
+ ]))), 128))
3098
+ ]);
3099
+ }
3100
+ const Fl = /* @__PURE__ */ X(dl, [["render", _l], ["__scopeId", "data-v-3cfef7fb"]]), ml = { class: "tabs" }, fl = {
3101
+ key: 0,
3102
+ class: "tabs__horizontal"
3103
+ }, vl = {
3104
+ key: 0,
3105
+ class: "tabs__tab tabs__tab--info"
3106
+ }, yl = ["onClick"], hl = {
3107
+ key: 1,
3108
+ class: "tabs__context-menu"
3109
+ }, $l = ["onClick"], bl = /* @__PURE__ */ U({
3110
+ __name: "aeria-tabs",
3111
+ props: {
3112
+ query: {},
3113
+ param: {},
3114
+ dropdown: { type: Boolean }
3115
+ },
3116
+ setup(d) {
3117
+ const r = d, a = St(), t = Ie(), l = ze(), s = "query" in r && r.query ? "query" : "params", u = Q(() => {
3118
+ const c = t.currentRoute.value[s][r.query || r.param];
3119
+ return c || Object.keys(a)[0];
3120
+ }), v = (c) => {
3121
+ if (s === "query") {
3122
+ t.push({
3123
+ query: {
3124
+ ...t.currentRoute.value.query,
3125
+ [r.query]: c
3126
+ }
3127
+ });
3128
+ return;
3129
+ }
3130
+ t.push({
3131
+ params: {
3132
+ [r.param]: c
3133
+ }
3134
+ });
3135
+ };
3136
+ return (c, h) => {
3137
+ const p = ne("clickable");
3138
+ return o(), i("div", ml, [
3139
+ e(l).md && !c.dropdown ? (o(), i("div", fl, [
3140
+ c.$slots.default ? (o(), i("div", vl, [
3141
+ I(c.$slots, "default", {}, void 0, !0)
3142
+ ])) : y("", !0),
3143
+ (o(!0), i(P, null, D(Object.keys(c.$slots).filter((n) => n !== "default"), (n, _) => (o(), i("div", {
3144
+ key: n,
3145
+ class: K({
3146
+ tabs__tab: !0,
3147
+ "tabs__tab--current": n === u.value || !u.value && _ === 0
3148
+ }),
3149
+ onClick: ($) => v(n)
3150
+ }, [
3151
+ I(c.$slots, n, {}, void 0, !0)
3152
+ ], 10, yl))), 128))
3153
+ ])) : (o(), i("div", hl, [
3154
+ z(Ce, null, ce({
3155
+ default: f(() => [
3156
+ N((o(), g(x, {
3157
+ "icon-right": "",
3158
+ icon: "caret-down",
3159
+ style: { "--icon-color": "var(--theme-brand-color-shade-1)" },
3160
+ class: "tabs__context-menu-icon"
3161
+ }, {
3162
+ default: f(() => [
3163
+ I(c.$slots, u.value, {}, void 0, !0)
3164
+ ]),
3165
+ _: 3
3166
+ })), [
3167
+ [p]
3168
+ ])
3169
+ ]),
3170
+ _: 2
3171
+ }, [
3172
+ D(Object.keys(c.$slots).filter((n) => n !== "default"), (n) => ({
3173
+ name: n,
3174
+ fn: f(() => [
3175
+ V("div", {
3176
+ onClick: (_) => v(n)
3177
+ }, [
3178
+ I(c.$slots, n, {}, void 0, !0)
3179
+ ], 8, $l)
3180
+ ])
3181
+ }))
3182
+ ]), 1024)
3183
+ ]))
3184
+ ]);
3185
+ };
3186
+ }
3187
+ });
3188
+ const gl = /* @__PURE__ */ X(bl, [["__scopeId", "data-v-4dd516ec"]]), kl = U({
3189
+ props: {
3190
+ initialValue: String,
3191
+ promise: Promise
3192
+ },
3193
+ setup(d) {
3194
+ const r = J(d.initialValue);
3195
+ return d.promise instanceof Promise && d.promise.then((a) => {
3196
+ r.value = a;
3197
+ }), () => jt("div", r.value);
3198
+ }
3199
+ }), Vl = ["onClick"], Cl = { key: 1 }, Ol = /* @__PURE__ */ U({
3200
+ __name: "aeria-crud-topbar",
3201
+ props: {
3202
+ collection: {}
3203
+ },
3204
+ setup(d) {
3205
+ const r = d, t = Ie().currentRoute, l = Q(() => {
3206
+ try {
3207
+ const s = r.collection ? r.collection : t.value.meta.collection || t.value.params.collection;
3208
+ return ge(s);
3209
+ } catch {
3210
+ return null;
3211
+ }
3212
+ });
3213
+ return (s, u) => l.value && l.value.description.filtersPresets ? (o(), g(gl, {
3214
+ key: 0,
3215
+ dropdown: "",
3216
+ query: "section"
3217
+ }, ce({ _: 2 }, [
3218
+ D(Object.entries(l.value.description.filtersPresets), ([v, c]) => ({
3219
+ name: v,
3220
+ fn: f(() => [
3221
+ V("div", {
3222
+ class: "topbar__preset",
3223
+ onClick: (h) => e(Vt)(c, l.value)
3224
+ }, [
3225
+ c.icon ? (o(), g(x, {
3226
+ key: 0,
3227
+ icon: c.icon
3228
+ }, {
3229
+ default: f(() => [
3230
+ W(k(c.label || e(M)(v, { plural: !0 })), 1)
3231
+ ]),
3232
+ _: 2
3233
+ }, 1032, ["icon"])) : (o(), i("div", Cl, k(c.label || e(M)(v, { plural: !0 })), 1)),
3234
+ c.badgeFunction ? (o(), g(be, { key: 2 }, {
3235
+ default: f(() => [
3236
+ z(e(kl), {
3237
+ "initial-value": "0",
3238
+ promise: l.value.$functions[c.badgeFunction]({ filters: c.filters })
3239
+ }, null, 8, ["promise"])
3240
+ ]),
3241
+ _: 2
3242
+ }, 1024)) : y("", !0)
3243
+ ], 8, Vl)
3244
+ ])
3245
+ }))
3246
+ ]), 1024)) : y("", !0);
3247
+ }
3248
+ });
3249
+ const Il = /* @__PURE__ */ X(Ol, [["__scopeId", "data-v-326eee9d"]]), Al = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3250
+ __proto__: null,
3251
+ default: Il
3252
+ }, Symbol.toStringTag, { value: "Module" })), ql = /* @__PURE__ */ U({
3253
+ __name: "aeria-password-form",
3254
+ props: {
3255
+ modelValue: {}
3256
+ },
3257
+ emits: ["update:modelValue"],
3258
+ setup(d) {
3259
+ const r = d;
3260
+ ye(He, null);
3261
+ const a = Dt(), t = Q(() => a(
3262
+ r.modelValue.password,
3263
+ r.modelValue.confirmation
3264
+ ));
3265
+ return (l, s) => (o(), g(Ge, {
3266
+ form: {
3267
+ password: {
3268
+ type: "string",
3269
+ icon: "key",
3270
+ inputType: "password"
3271
+ },
3272
+ confirmation: {
3273
+ type: "string",
3274
+ icon: "key",
3275
+ inputType: "password"
3276
+ }
3277
+ },
3278
+ "model-value": l.modelValue,
3279
+ "onUpdate:modelValue": s[0] || (s[0] = (u) => l.$emit("update:modelValue", u))
3280
+ }, {
3281
+ after: f(() => [
3282
+ V("div", null, k(t.value || "Senhas conferem"), 1),
3283
+ I(l.$slots, "default", pe(Ve({ passwordError: t.value })))
3284
+ ]),
3285
+ _: 3
3286
+ }, 8, ["model-value"]));
3287
+ }
3288
+ }), Ul = (d, r = []) => ({
3289
+ path: "/user",
3290
+ name: "/builtin:user",
3291
+ component: d,
3292
+ children: r.concat([
3293
+ {
3294
+ path: "invite/:id",
3295
+ name: "/user/invite/:id",
3296
+ redirect: (a) => ({
3297
+ path: "/user/signup",
3298
+ params: {
3299
+ inviteId: a.params.id
3300
+ }
3301
+ })
3302
+ },
3303
+ {
3304
+ path: "signin",
3305
+ name: "/user/signin",
3306
+ component: () => import("./signin-78854e9e.js"),
3307
+ meta: {
3308
+ title: "Autenticação"
3309
+ }
3310
+ },
3311
+ {
3312
+ path: "signup",
3313
+ name: "/user/signup",
3314
+ component: () => import("./signup-42edefc2.js"),
3315
+ meta: {
3316
+ title: "Registro"
3317
+ }
3318
+ },
3319
+ {
3320
+ path: "activation",
3321
+ name: "/user/activation",
3322
+ component: () => import("./activation-d3f6dc73.js"),
3323
+ meta: {
3324
+ title: "Ativação"
3325
+ }
3326
+ }
3327
+ ])
3328
+ }), El = (d, r = []) => ({
3329
+ path: "/dashboard",
3330
+ name: "/builtin:dashboard",
3331
+ component: d,
3332
+ redirect: {
3333
+ name: "/dashboard/"
3334
+ },
3335
+ meta: {
3336
+ title: "Dashboard"
3337
+ },
3338
+ children: r.concat([
3339
+ {
3340
+ path: "c/:collection",
3341
+ name: "/dashboard/crud",
3342
+ props: !0,
3343
+ components: {
3344
+ default: () => import("./index-38b13e16.js"),
3345
+ topbar: () => Promise.resolve().then(() => Al)
3346
+ },
3347
+ meta: {
3348
+ title: "%viewTitle%"
3349
+ }
3350
+ },
3351
+ {
3352
+ path: "c/:collection/:id/:section?",
3353
+ name: "/dashboard/crud/:id",
3354
+ props: !0,
3355
+ components: {
3356
+ default: () => import("./_id_-149df831.js")
3357
+ },
3358
+ meta: {
3359
+ title: "%viewTitle%"
3360
+ }
3361
+ },
3362
+ {
3363
+ path: "user",
3364
+ name: "/dashboard/user",
3365
+ meta: {
3366
+ title: "user",
3367
+ icon: "users",
3368
+ collection: "user"
3369
+ },
3370
+ redirect: "/dashboard/c/user",
3371
+ children: [
3372
+ {
3373
+ path: "profile",
3374
+ component: () => import("./index-1bbeba72.js"),
3375
+ meta: {
3376
+ title: "Meu perfil",
3377
+ icon: "user-square"
3378
+ }
3379
+ },
3380
+ {
3381
+ path: "changepass",
3382
+ name: "/dashboard/user/changepass",
3383
+ component: () => import("./index-87c76c28.js"),
3384
+ meta: {
3385
+ title: "Mudar senha",
3386
+ icon: "lock"
3387
+ }
3388
+ }
3389
+ ]
3390
+ }
3391
+ ])
3392
+ });
3393
+ export {
3394
+ Ge as A,
3395
+ kl as B,
3396
+ nl as C,
3397
+ sl as D,
3398
+ Il as E,
3399
+ Ul as F,
3400
+ El as G,
3401
+ ql as _,
3402
+ re as a,
3403
+ x as b,
3404
+ Gn as c,
3405
+ zl as d,
3406
+ oa as e,
3407
+ Ue as f,
3408
+ Fl as g,
3409
+ Ae as h,
3410
+ X as i,
3411
+ Rl as j,
3412
+ be as k,
3413
+ fe as l,
3414
+ _n as m,
3415
+ Ce as n,
3416
+ Ea as o,
3417
+ bn as p,
3418
+ Ml as q,
3419
+ Fn as r,
3420
+ Fa as s,
3421
+ gl as t,
3422
+ bo as u,
3423
+ Oe as v,
3424
+ Xn as w,
3425
+ Fo as x,
3426
+ Qe as y,
3427
+ eo as z
3428
+ };