@aeria-ui/ui 0.0.19 → 0.0.21

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