@vc-shell/framework 2.5.0 → 2.6.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/dist/ai-agent/index.js +3 -3
  2. package/dist/chunks/ExtensionPoint.vue_vue_type_style_index_0_lang-B1R06zHa.js.map +1 -1
  3. package/dist/chunks/VcAiAgentPanel.vue_vue_type_script_setup_true_lang-y-eKcMMU.js +1372 -0
  4. package/dist/chunks/VcAiAgentPanel.vue_vue_type_script_setup_true_lang-y-eKcMMU.js.map +1 -0
  5. package/dist/chunks/{VcAiAgentPanel.vue_vue_type_style_index_0_lang-CZdY18Hq.js → VcAiAgentPanel.vue_vue_type_style_index_0_lang-JB7OKRk6.js} +76 -70
  6. package/dist/chunks/{VcAiAgentPanel.vue_vue_type_style_index_0_lang-CZdY18Hq.js.map → VcAiAgentPanel.vue_vue_type_style_index_0_lang-JB7OKRk6.js.map} +1 -1
  7. package/dist/chunks/VcScheduler.vue_vue_type_script_setup_true_lang-dbUBuyX1.js +20634 -0
  8. package/dist/chunks/VcScheduler.vue_vue_type_script_setup_true_lang-dbUBuyX1.js.map +1 -0
  9. package/dist/chunks/VcScheduler.vue_vue_type_style_index_0_lang-BFmpC0MN.js +4836 -0
  10. package/dist/chunks/VcScheduler.vue_vue_type_style_index_0_lang-BFmpC0MN.js.map +1 -0
  11. package/dist/chunks/{dashboard-feed-row.vue_vue_type_script_setup_true_lang-BCsJG_hk.js → dashboard-feed-row.vue_vue_type_script_setup_true_lang-f8MTDeS0.js} +271 -258
  12. package/dist/chunks/dashboard-feed-row.vue_vue_type_script_setup_true_lang-f8MTDeS0.js.map +1 -0
  13. package/dist/chunks/index-BuTo_Lx8.js.map +1 -1
  14. package/dist/chunks/{index-B7RhGTNx.js → index-DLsURdJp.js} +2 -2
  15. package/dist/chunks/index-DLsURdJp.js.map +1 -0
  16. package/dist/chunks/{vendor-vueuse-components-CoR2FSn3.js → vendor-vueuse-components-B3XvEasa.js} +1 -1
  17. package/dist/chunks/{vendor-vueuse-components-CoR2FSn3.js.map → vendor-vueuse-components-B3XvEasa.js.map} +1 -1
  18. package/dist/chunks/{vendor-vueuse-core-BFa9je5E.js → vendor-vueuse-core-_wFDcFkI.js} +1 -1
  19. package/dist/chunks/{vendor-vueuse-core-BFa9je5E.js.map → vendor-vueuse-core-_wFDcFkI.js.map} +1 -1
  20. package/dist/chunks/{vendor-vueuse-shared-kZH3-Km1.js → vendor-vueuse-shared-CiuC98Kk.js} +28 -44
  21. package/dist/chunks/{vendor-vueuse-shared-kZH3-Km1.js.map → vendor-vueuse-shared-CiuC98Kk.js.map} +1 -1
  22. package/dist/core/blade-navigation/types/index.d.ts +24 -0
  23. package/dist/core/blade-navigation/types/index.d.ts.map +1 -1
  24. package/dist/core/blade-navigation/utils/navigateToMainRoute.d.ts +12 -2
  25. package/dist/core/blade-navigation/utils/navigateToMainRoute.d.ts.map +1 -1
  26. package/dist/core/blade-navigation/utils/restoreFromUrl.d.ts.map +1 -1
  27. package/dist/core/blade-navigation/utils/urlSync.d.ts +28 -2
  28. package/dist/core/blade-navigation/utils/urlSync.d.ts.map +1 -1
  29. package/dist/core/composables/index.d.ts +0 -1
  30. package/dist/core/composables/index.d.ts.map +1 -1
  31. package/dist/core/composables/useAssets/index.d.ts.map +1 -1
  32. package/dist/core/composables/useAssetsManager/index.d.ts.map +1 -1
  33. package/dist/core/composables/useAssetsManager/uploadAssets.d.ts +37 -0
  34. package/dist/core/composables/useAssetsManager/uploadAssets.d.ts.map +1 -0
  35. package/dist/core/composables/useBlade/index.d.ts.map +1 -1
  36. package/dist/core/composables/useBladeNavigationAdapter/index.d.ts.map +1 -1
  37. package/dist/core/composables/useDynamicProperties/resolveControlKind.d.ts +23 -0
  38. package/dist/core/composables/useDynamicProperties/resolveControlKind.d.ts.map +1 -0
  39. package/dist/core/composables/useLatestRequest/index.d.ts +25 -8
  40. package/dist/core/composables/useLatestRequest/index.d.ts.map +1 -1
  41. package/dist/core/composables/useModificationTracker/index.d.ts +11 -0
  42. package/dist/core/composables/useModificationTracker/index.d.ts.map +1 -1
  43. package/dist/core/composables/usePopup/index.d.ts.map +1 -1
  44. package/dist/core/composables/useSidebarState/_internal.d.ts +37 -0
  45. package/dist/core/composables/useSidebarState/_internal.d.ts.map +1 -0
  46. package/dist/core/composables/useSidebarState/index.d.ts +4 -27
  47. package/dist/core/composables/useSidebarState/index.d.ts.map +1 -1
  48. package/dist/core/composables/useToolbar/index.d.ts +8 -0
  49. package/dist/core/composables/useToolbar/index.d.ts.map +1 -1
  50. package/dist/core/interceptors/index.d.ts.map +1 -1
  51. package/dist/core/plugins/signalR/index.d.ts.map +1 -1
  52. package/dist/core/services/index.d.ts +0 -1
  53. package/dist/core/services/index.d.ts.map +1 -1
  54. package/dist/core/utilities/focus.d.ts +14 -0
  55. package/dist/core/utilities/focus.d.ts.map +1 -1
  56. package/dist/dashboard/index.js +1 -1
  57. package/dist/framework.js +1732 -1715
  58. package/dist/framework.js.map +1 -1
  59. package/dist/index.css +1 -1
  60. package/dist/injection-keys.d.ts.map +1 -1
  61. package/dist/locales/de.js +7 -1
  62. package/dist/locales/en.js +7 -1
  63. package/dist/locales/en.json +7 -1
  64. package/dist/locales/types.d.ts +6 -0
  65. package/dist/shell/_internal/blade-navigation/components/vc-blade-navigation/vc-blade-navigation-new.vue.d.ts.map +1 -1
  66. package/dist/shell/_internal/blade-navigation/components/vc-blade-slot/vc-blade-slot.vue.d.ts +1 -0
  67. package/dist/shell/_internal/blade-navigation/components/vc-blade-slot/vc-blade-slot.vue.d.ts.map +1 -1
  68. package/dist/shell/_internal/blade-navigation/plugin-v2.d.ts.map +1 -1
  69. package/dist/shell/dashboard/draggable-dashboard/DraggableDashboard.vue.d.ts +5 -2
  70. package/dist/shell/dashboard/draggable-dashboard/DraggableDashboard.vue.d.ts.map +1 -1
  71. package/dist/shell/dashboard/draggable-dashboard/GridstackDashboard.vue.d.ts.map +1 -1
  72. package/dist/shell/dashboard/draggable-dashboard/composables/useGridstack.d.ts +2 -0
  73. package/dist/shell/dashboard/draggable-dashboard/composables/useGridstack.d.ts.map +1 -1
  74. package/dist/test-helpers.d.ts.map +1 -1
  75. package/dist/tsconfig.tsbuildinfo +1 -1
  76. package/dist/ui/components/atoms/vc-button/vc-button.vue.d.ts.map +1 -1
  77. package/dist/ui/components/molecules/vc-editor/vc-editor.vue.d.ts.map +1 -1
  78. package/dist/ui/components/molecules/vc-popover/vc-popover.vue.d.ts +10 -0
  79. package/dist/ui/components/molecules/vc-popover/vc-popover.vue.d.ts.map +1 -1
  80. package/dist/ui/components/organisms/vc-app/_internal/app-bar/components/AppHubPopover.vue.d.ts +2 -0
  81. package/dist/ui/components/organisms/vc-app/_internal/app-bar/components/AppHubPopover.vue.d.ts.map +1 -1
  82. package/dist/ui/components/organisms/vc-app/_internal/layouts/DesktopLayout.vue.d.ts.map +1 -1
  83. package/dist/ui/components/organisms/vc-auth-layout/vc-auth-layout.vue.d.ts.map +1 -1
  84. package/dist/ui/components/organisms/vc-blade/_internal/BladeHeader.vue.d.ts.map +1 -1
  85. package/dist/ui/components/organisms/vc-blade/vc-blade.vue.d.ts.map +1 -1
  86. package/dist/ui/components/organisms/vc-data-table/VcDataTable.vue.d.ts +3 -3
  87. package/dist/ui/components/organisms/vc-data-table/VcDataTable.vue.d.ts.map +1 -1
  88. package/dist/ui/components/organisms/vc-data-table/components/VcColumn.vue.d.ts +5 -4
  89. package/dist/ui/components/organisms/vc-data-table/components/VcColumn.vue.d.ts.map +1 -1
  90. package/dist/ui/components/organisms/vc-data-table/components/cells/DynamicCellRenderer.vue.d.ts +30 -6
  91. package/dist/ui/components/organisms/vc-data-table/components/cells/DynamicCellRenderer.vue.d.ts.map +1 -1
  92. package/dist/ui/components/organisms/vc-data-table/composables/builtinCells.d.ts +12 -0
  93. package/dist/ui/components/organisms/vc-data-table/composables/builtinCells.d.ts.map +1 -0
  94. package/dist/ui/components/organisms/vc-data-table/composables/useCellRegistry.d.ts +10 -4
  95. package/dist/ui/components/organisms/vc-data-table/composables/useCellRegistry.d.ts.map +1 -1
  96. package/dist/ui/components/organisms/vc-data-table/composables/useDataTableOrchestrator.d.ts.map +1 -1
  97. package/dist/ui/components/organisms/vc-data-table/index.d.ts +2 -0
  98. package/dist/ui/components/organisms/vc-data-table/index.d.ts.map +1 -1
  99. package/dist/ui/components/organisms/vc-data-table/keys.d.ts +0 -10
  100. package/dist/ui/components/organisms/vc-data-table/keys.d.ts.map +1 -1
  101. package/dist/ui/components/organisms/vc-data-table/types.d.ts +7 -2
  102. package/dist/ui/components/organisms/vc-data-table/types.d.ts.map +1 -1
  103. package/dist/ui/components/organisms/vc-dynamic-property/vc-dynamic-property.vue.d.ts.map +1 -1
  104. package/dist/ui/components/organisms/vc-scheduler/VcScheduler.vue.d.ts +1 -1
  105. package/dist/ui/components/organisms/vc-scheduler/VcScheduler.vue.d.ts.map +1 -1
  106. package/dist/ui/components/organisms/vc-scheduler/_internal/editor/SchedulerEventEditor.vue.d.ts.map +1 -1
  107. package/dist/ui/components/organisms/vc-scheduler/_internal/month/MonthEventPopover.vue.d.ts +2 -2
  108. package/dist/ui/components/organisms/vc-scheduler/_internal/month/MonthEventPopover.vue.d.ts.map +1 -1
  109. package/dist/ui/components/organisms/vc-scheduler/_internal/month/MonthMorePopover.vue.d.ts.map +1 -1
  110. package/dist/ui/components/organisms/vc-scheduler/_internal/quick-create/QuickCreatePopover.vue.d.ts.map +1 -1
  111. package/dist/ui/components/organisms/vc-scheduler/composables/useAnchoredPanelFocus.d.ts +20 -0
  112. package/dist/ui/components/organisms/vc-scheduler/composables/useAnchoredPanelFocus.d.ts.map +1 -0
  113. package/dist/ui/index.js +153 -150
  114. package/package.json +4 -4
  115. package/dist/chunks/VcAiAgentPanel.vue_vue_type_script_setup_true_lang-9mBLzIi1.js +0 -1402
  116. package/dist/chunks/VcAiAgentPanel.vue_vue_type_script_setup_true_lang-9mBLzIi1.js.map +0 -1
  117. package/dist/chunks/VcScheduler.vue_vue_type_script_setup_true_lang-BmlVL_rn.js +0 -21212
  118. package/dist/chunks/VcScheduler.vue_vue_type_script_setup_true_lang-BmlVL_rn.js.map +0 -1
  119. package/dist/chunks/VcScheduler.vue_vue_type_style_index_0_lang-BTg4PjTB.js +0 -4125
  120. package/dist/chunks/VcScheduler.vue_vue_type_style_index_0_lang-BTg4PjTB.js.map +0 -1
  121. package/dist/chunks/dashboard-feed-row.vue_vue_type_script_setup_true_lang-BCsJG_hk.js.map +0 -1
  122. package/dist/chunks/index-B7RhGTNx.js.map +0 -1
  123. package/dist/core/composables/useMenuExpanded/index.d.ts +0 -9
  124. package/dist/core/composables/useMenuExpanded/index.d.ts.map +0 -1
  125. package/dist/core/services/global-search-service/index.d.ts +0 -10
  126. package/dist/core/services/global-search-service/index.d.ts.map +0 -1
  127. package/dist/ui/components/organisms/vc-blade/useBladeSkeleton.d.ts +0 -16
  128. package/dist/ui/components/organisms/vc-blade/useBladeSkeleton.d.ts.map +0 -1
@@ -0,0 +1,4836 @@
1
+ import { mergeProps as ne, computed as $, toValue as ge, inject as Y, useId as an, ref as S, onBeforeUnmount as lt, reactive as Ye, provide as $t, getCurrentScope as ln, onScopeDispose as on, getCurrentInstance as qe, onErrorCaptured as rn, nextTick as he, defineComponent as V, watch as H, unref as r, openBlock as v, createElementBlock as y, normalizeClass as j, createBlock as N, createCommentVNode as w, renderSlot as C, createElementVNode as L, toDisplayString as T, Fragment as we, renderList as ot, normalizeStyle as Me, resolveDynamicComponent as it, withCtx as O, withKeys as Z, withModifiers as G, createVNode as x, watchEffect as Qe, shallowReactive as _e, markRaw as et, createSlots as ie, createTextVNode as Q, Transition as Ae, withDirectives as rt, vModelText as sn, useAttrs as wt, vModelDynamic as un, onMounted as Ue, onUnmounted as Ot, Teleport as cn, normalizeProps as xe, guardReactiveProps as Te } from "vue";
2
+ import { c as de, ai as dn, O as fn, v as vn, r as gn, o as mn, I as pn, q as bn, p as yn, B as Et, b as hn, i as kn, _ as U, T as Lt, a as Bt, V as In, w as Sn, u as $n } from "./VcAiAgentPanel.vue_vue_type_style_index_0_lang-JB7OKRk6.js";
3
+ import { defineRule as Oe, Field as wn } from "vee-validate";
4
+ import { a as bt } from "./vendor-vee-validate-rules-4oWUZPpG.js";
5
+ import { a as Ct, s as On, c as En, b as Je, e as Re } from "./vendor-lodash-es-D2n90GJy.js";
6
+ import { X as Ln } from "./vendor-microsoft-applicationinsights-core-js-CR3vyuZc.js";
7
+ import { d as xt, e as Bn, f as Cn, g as xn } from "./vendor-vueuse-core-_wFDcFkI.js";
8
+ import { c as Tn, u as Ie } from "./vendor-vue-i18n-LO-EJStU.js";
9
+ import { j as Rn } from "./vendor-vueuse-shared-CiuC98Kk.js";
10
+ import { k as Mn } from "./vendor-tiptap-core-CZbeo7XQ.js";
11
+ import "./vendor-tiptap-extension-text-style-Bc6nvmn0.js";
12
+ import { q as An } from "./vendor-vuepic-vue-datepicker-D0bvbIbh.js";
13
+ import { C as Nn, u as Dn } from "./vendor-vue-currency-input-CckB4kjx.js";
14
+ import { u as Vn } from "./vendor-floating-ui-vue-sCrhit51.js";
15
+ import { f as Tt, s as Rt, o as tt, b as Pn } from "./vendor-floating-ui-dom-BvVXFZ4B.js";
16
+ import { v as Fn } from "./vendor-vueuse-components-B3XvEasa.js";
17
+ import { p as Mt } from "./vendor-dompurify-DpIUMBYC.js";
18
+ import { S as ye, h as zn, T as qn } from "./vendor-date-fns-C-55OMpS.js";
19
+ import { t as Un } from "./vendor-truncate-html-ChA1T5zy.js";
20
+ const ke = Tn({
21
+ legacy: !1,
22
+ globalInjection: !0,
23
+ locale: "en",
24
+ fallbackLocale: "en",
25
+ formatFallbackMessages: !0
26
+ });
27
+ function nt() {
28
+ return Math.random().toString(36).substring(2, 9);
29
+ }
30
+ class re extends Error {
31
+ constructor(t, n, a) {
32
+ super(t), this.code = n, this.context = a, this.name = "FrameworkError", Error.captureStackTrace && Error.captureStackTrace(this, re);
33
+ }
34
+ toJSON() {
35
+ return {
36
+ name: this.name,
37
+ code: this.code,
38
+ message: this.message,
39
+ context: this.context,
40
+ stack: this.stack
41
+ };
42
+ }
43
+ }
44
+ class Pi extends re {
45
+ constructor(t, n) {
46
+ super(t, "VALIDATION_ERROR", n), this.name = "ValidationError";
47
+ }
48
+ }
49
+ class Fi extends re {
50
+ constructor(t, n) {
51
+ super(t, "SERVICE_ERROR", n), this.name = "ServiceError";
52
+ }
53
+ }
54
+ class Kn extends re {
55
+ constructor(t, n) {
56
+ super(`${t} not provided. Make sure to call the corresponding 'provide' function.`, "INJECTION_ERROR", {
57
+ serviceName: t,
58
+ ...n
59
+ }), this.name = "InjectionError";
60
+ }
61
+ }
62
+ class zi extends re {
63
+ constructor(t, n, a) {
64
+ super(`Failed to register '${t}': ${n}`, "REGISTRATION_ERROR", {
65
+ componentName: t,
66
+ ...a
67
+ }), this.name = "RegistrationError";
68
+ }
69
+ }
70
+ class qi extends re {
71
+ constructor(t, n, a) {
72
+ super(t, "BLADE_ERROR", {
73
+ bladeId: n,
74
+ ...a
75
+ }), this.name = "BladeError";
76
+ }
77
+ }
78
+ class Ui extends re {
79
+ constructor(t, n, a) {
80
+ super(`Failed to load module '${t}': ${n}`, "MODULE_LOAD_ERROR", {
81
+ moduleId: t,
82
+ ...a
83
+ }), this.name = "ModuleLoadError";
84
+ }
85
+ }
86
+ function Wn(e) {
87
+ return e instanceof re;
88
+ }
89
+ function Ki(e, t = "UNKNOWN_ERROR") {
90
+ return Wn(e) ? e : e instanceof Error ? new re(e.message, t, {
91
+ originalError: e.name,
92
+ stack: e.stack
93
+ }) : new re(String(e), t);
94
+ }
95
+ class me extends Error {
96
+ details;
97
+ originalError;
98
+ constructor(t, n, a) {
99
+ super(t), this.name = "DisplayableError", this.details = n, this.originalError = a;
100
+ }
101
+ }
102
+ function jn(e) {
103
+ return e instanceof Error && typeof e.status == "number" && typeof e.response == "string";
104
+ }
105
+ function Pe(e) {
106
+ if (e instanceof me)
107
+ return e;
108
+ if (jn(e)) {
109
+ const { status: t, response: n } = e;
110
+ try {
111
+ return Pe(JSON.parse(n));
112
+ } catch {
113
+ const a = `${t}: ${e.message || "Error"}`;
114
+ return new me(a, n || e.message, e);
115
+ }
116
+ }
117
+ if (e instanceof Error && "response" in e && e.response)
118
+ return Pe(e.response);
119
+ if (e instanceof Error)
120
+ return new me(e.message, e.stack || String(e), e);
121
+ if (typeof e == "string")
122
+ try {
123
+ const t = JSON.parse(e);
124
+ return Pe(t);
125
+ } catch {
126
+ return new me(e, e, e);
127
+ }
128
+ if (typeof e == "object" && e !== null) {
129
+ const t = e;
130
+ if ("status" in t && "data" in t) {
131
+ const o = t.status, i = t.statusText || "Error", l = `${o}: ${i}`, s = t.data;
132
+ let u = "";
133
+ return s ? typeof s.exceptionMessage == "string" ? u = s.exceptionMessage : typeof s.message == "string" ? u = s.message : Array.isArray(s.errors) ? u = s.errors.join(`
134
+ `) : typeof s == "string" ? u = s : u = JSON.stringify(s, null, 2) : u = JSON.stringify(t, null, 2), new me(l, u, e);
135
+ }
136
+ const n = t.message || "An unexpected error occurred.", a = t.stack || JSON.stringify(t, null, 2);
137
+ return new me(n, a, e);
138
+ }
139
+ return new me("An unknown error occurred.", String(e), e);
140
+ }
141
+ const Hn = [
142
+ ["LLLL", "PPPp"],
143
+ ["LLL", "PPp"],
144
+ ["LTS", "pp"],
145
+ ["LT", "p"],
146
+ ["LL", "PP"],
147
+ ["L", "P"]
148
+ ], Gn = [
149
+ [/YYYY/g, "yyyy"],
150
+ [/YY/g, "yy"],
151
+ [/dddd/g, "EEEE"],
152
+ [/ddd/g, "EEE"],
153
+ [/DD/g, "dd"],
154
+ [/Do/g, "do"],
155
+ [/D(?![\w])/g, "d"],
156
+ [/A/g, "a"]
157
+ ];
158
+ function Yn(e) {
159
+ let t = e;
160
+ for (const [n, a] of Hn)
161
+ t = t.split(n).join(a);
162
+ for (const [n, a] of Gn)
163
+ t = t.replace(n, a);
164
+ return t;
165
+ }
166
+ const ue = /* @__PURE__ */ new Map();
167
+ ue.set("en-US", ye);
168
+ ue.set("en", ye);
169
+ async function Jn(e) {
170
+ if (ue.has(e))
171
+ return ue.get(e);
172
+ try {
173
+ const t = await import(
174
+ /* @vite-ignore */
175
+ `date-fns/locale/${e}`
176
+ ), n = e.replace("-", ""), a = t.default ?? t[n] ?? ye;
177
+ return ue.set(e, a), a;
178
+ } catch {
179
+ const t = e.split("-")[0];
180
+ if (t !== e)
181
+ try {
182
+ const n = await import(
183
+ /* @vite-ignore */
184
+ `date-fns/locale/${t}`
185
+ ), a = n.default ?? n[t] ?? ye;
186
+ return ue.set(e, a), a;
187
+ } catch {
188
+ }
189
+ return ue.set(e, ye), ye;
190
+ }
191
+ }
192
+ function At(e) {
193
+ return ue.has(e) ? ue.get(e) : (Jn(e), ye);
194
+ }
195
+ function Nt(e) {
196
+ if (e == null || e === "") return null;
197
+ if (e instanceof Date) return isNaN(e.getTime()) ? null : e;
198
+ const t = new Date(e);
199
+ return isNaN(t.getTime()) ? null : t;
200
+ }
201
+ function Xn(e, t) {
202
+ const n = Nt(e);
203
+ if (!n) return "";
204
+ const a = t ? At(t) : void 0;
205
+ return qn(n, { addSuffix: !0, locale: a });
206
+ }
207
+ function Zn(e, t, n) {
208
+ const a = Nt(e);
209
+ if (!a) return "";
210
+ const o = Yn(t), i = n ? At(n) : void 0;
211
+ return zn(a, o, { locale: i });
212
+ }
213
+ const Qn = de("color-utils");
214
+ function _n(e) {
215
+ if (!e || typeof e != "string")
216
+ return null;
217
+ try {
218
+ const t = document.createElement("canvas");
219
+ t.width = 1, t.height = 1;
220
+ const n = t.getContext("2d");
221
+ return !n || (n.fillStyle = e.trim(), n.fillStyle === "#000000" && e.trim().toLowerCase() !== "black") ? null : n.fillStyle;
222
+ } catch (t) {
223
+ return Qn.warn("Error converting color name to hex:", t), null;
224
+ }
225
+ }
226
+ function ea(e) {
227
+ if (!e || typeof e != "string")
228
+ return !1;
229
+ const t = e.startsWith("#") ? e : `#${e}`;
230
+ return /^#[0-9A-Fa-f]{6}$/.test(t);
231
+ }
232
+ function yt(e) {
233
+ return !e || typeof e != "string" ? "" : e.startsWith("#") ? e : `#${e}`;
234
+ }
235
+ function ta(e, t) {
236
+ if (!e || !t || e.includes(`_${t}`)) return e;
237
+ const n = e.lastIndexOf("/"), a = e.indexOf("?", n), i = (a > -1 ? e.slice(n + 1, a) : e.slice(n + 1)).lastIndexOf(".");
238
+ if (i <= 0)
239
+ return e;
240
+ const l = n + 1 + i, s = e.slice(0, l), u = e.slice(l);
241
+ return `${s}_${t}${u}`;
242
+ }
243
+ function Wi(e) {
244
+ return e <= 64 ? "64x64" : e <= 128 ? "128x128" : e <= 168 ? "168x168" : e <= 216 ? "216x216" : e <= 348 ? "348x348" : "lg";
245
+ }
246
+ function na(e) {
247
+ let t = null;
248
+ return {
249
+ register(n) {
250
+ t = n, e?.(t);
251
+ },
252
+ get() {
253
+ return t;
254
+ },
255
+ reset() {
256
+ t = null, e?.(t);
257
+ }
258
+ };
259
+ }
260
+ function ji() {
261
+ const e = /* @__PURE__ */ new Map();
262
+ return {
263
+ register(t, n) {
264
+ e.set(t, n);
265
+ },
266
+ get(t) {
267
+ return e.get(t);
268
+ },
269
+ reset() {
270
+ e.clear();
271
+ }
272
+ };
273
+ }
274
+ const st = () => {
275
+ const e = dn();
276
+ return {
277
+ user: e.user,
278
+ loading: e.loading,
279
+ isAdministrator: e.isAdministrator,
280
+ isAuthenticated: e.isAuthenticated,
281
+ validateToken: e.validateToken,
282
+ validatePassword: e.validatePassword,
283
+ resetPasswordByToken: e.resetPasswordByToken,
284
+ getLoginType: e.getLoginType,
285
+ loadUser: e.loadUser,
286
+ requestPasswordReset: e.requestPasswordReset,
287
+ changeUserPassword: e.changeUserPassword,
288
+ signIn: e.signIn,
289
+ signOut: e.signOut
290
+ };
291
+ };
292
+ function aa() {
293
+ const { user: e } = st();
294
+ function t(n) {
295
+ const a = e.value?.permissions ?? [];
296
+ if (!n || Array.isArray(n) && n.length === 0 || e.value?.isAdministrator)
297
+ return !0;
298
+ if (Array.isArray(n))
299
+ return n.some((o) => a.includes(o));
300
+ if (typeof n == "string")
301
+ return a.includes(n);
302
+ throw new Error("Permissions must be a string or an array of strings");
303
+ }
304
+ return {
305
+ hasAccess: t
306
+ };
307
+ }
308
+ const be = de("notification"), ve = na();
309
+ function la(e) {
310
+ ve.register(e);
311
+ }
312
+ function Ne(e, t) {
313
+ const n = ve.get();
314
+ if (!n) {
315
+ be.debug("Backend not yet registered — notification call ignored.");
316
+ return;
317
+ }
318
+ return t = ne(
319
+ n.defaultOptions,
320
+ t
321
+ ), (!t.notificationId || typeof t.notificationId != "string" && typeof t.notificationId != "number") && (t.notificationId = nt()), t = {
322
+ ...t,
323
+ content: e
324
+ }, n.appendInstance(t), t.notificationId;
325
+ }
326
+ const se = (e, t) => Ne(e, { ...t, type: "default" });
327
+ se.error = (e, t) => Ne(e, { ...t, type: "error" });
328
+ se.warning = (e, t) => Ne(e, { ...t, type: "warning" });
329
+ se.success = (e, t) => Ne(e, { ...t, type: "success" });
330
+ se.clearAll = () => {
331
+ ve.get()?.actions.clear();
332
+ };
333
+ se.remove = (e) => {
334
+ const t = ve.get();
335
+ t && (e ? t.actions.dismiss(e) : t.actions.clear());
336
+ };
337
+ se.update = (e, t) => {
338
+ const n = ve.get();
339
+ if (!n) return e;
340
+ if (!n.hasNotification(e))
341
+ return be.warn(`Cannot update: notification with ID ${e} not found`), e;
342
+ const a = n.getNotification(String(e));
343
+ if (a)
344
+ if (t.position && t.position !== a.position) {
345
+ const o = {
346
+ ...a,
347
+ ...t,
348
+ updateId: nt(),
349
+ notificationId: e
350
+ };
351
+ let i;
352
+ if (t.content !== void 0 ? (i = t.content, delete o.content) : a.content && (i = a.content, delete o.content), i)
353
+ return n.actions.remove(e), Ne(i, o);
354
+ } else {
355
+ const o = {
356
+ ...t,
357
+ updateId: nt(),
358
+ notificationId: e
359
+ };
360
+ return n.actions.update(o), e;
361
+ }
362
+ return e;
363
+ };
364
+ se.setPosition = (e) => {
365
+ const t = ve.get();
366
+ t && (t.defaultOptions.position = e);
367
+ };
368
+ se.clearPosition = (e) => {
369
+ const t = ve.get();
370
+ if (!t) return;
371
+ t.getAllNotifications().filter((a) => (a.position || t.defaultOptions.position) === e).forEach((a) => {
372
+ a.notificationId && t.actions.dismiss(a.notificationId);
373
+ });
374
+ };
375
+ se.debug = () => {
376
+ const e = ve.get();
377
+ if (!e)
378
+ return be.debug("Backend not registered"), { active: [], defaultOptions: {} };
379
+ Object.entries(e.defaultOptions).forEach(([n, a]) => {
380
+ be.debug(`Default option ${n}: `, a);
381
+ }), Object.entries(e.actions).forEach(([n]) => {
382
+ be.debug(`Available action: ${n}`);
383
+ });
384
+ const t = e.getAllNotifications().reduce((n, a) => {
385
+ const o = a.position || e.defaultOptions.position;
386
+ return n[o] || (n[o] = []), n[o].push({
387
+ id: a.notificationId || "unknown",
388
+ type: a.type,
389
+ content: typeof a.content == "string" ? a.content : "[Component]"
390
+ }), n;
391
+ }, {});
392
+ return Object.entries(t).forEach(([n, a]) => {
393
+ be.debug(`Position ${n}: ${a.length} notifications`), a.forEach((o) => be.debug(` - ${o.id} (${o.type}): ${o.content}`));
394
+ }), {
395
+ active: e.getAllNotifications(),
396
+ defaultOptions: e.defaultOptions
397
+ };
398
+ };
399
+ const oa = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
400
+ __proto__: null,
401
+ notification: se,
402
+ setNotificationBackend: la
403
+ }, Symbol.toStringTag, { value: "Module" }));
404
+ function ia(e, t, n = {}) {
405
+ const a = $(() => ge(n.placement) ?? "bottom"), o = $(() => ge(n.strategy) ?? "absolute"), i = $(() => {
406
+ const u = ge(n.middleware);
407
+ if (u?.length)
408
+ return u;
409
+ const f = [];
410
+ ge(n.enableFlip) !== !1 && f.push(Tt({ padding: n.shiftPadding ?? 8 })), ge(n.enableShift) !== !1 && f.push(Rt({ padding: n.shiftPadding ?? 8 }));
411
+ const m = ge(n.offset);
412
+ return typeof m == "number" ? f.push(tt(m)) : f.push(
413
+ tt({
414
+ mainAxis: m?.mainAxis ?? 0,
415
+ crossAxis: m?.crossAxis ?? 0,
416
+ alignmentAxis: m?.alignmentAxis
417
+ })
418
+ ), f;
419
+ }), l = Vn(e, t, {
420
+ placement: a,
421
+ strategy: o,
422
+ whileElementsMounted: ge(n.autoUpdate) === !1 ? void 0 : Pn,
423
+ middleware: i
424
+ }), s = $(() => ({
425
+ position: o.value,
426
+ top: `${l.y.value ?? 0}px`,
427
+ left: `${l.x.value ?? 0}px`
428
+ }));
429
+ return {
430
+ ...l,
431
+ floatingStyle: s,
432
+ resolvedPlacement: a,
433
+ resolvedStrategy: o
434
+ };
435
+ }
436
+ const ra = Symbol("vc-input-group-context");
437
+ function Ke(e) {
438
+ const t = Y(ra, null), n = an(), a = $(() => `vc-field-${n}`), o = $(() => `${a.value}-label`), i = $(() => `${a.value}-error`), l = $(() => `${a.value}-hint`), s = $(() => !!e.error || !!e.errorMessage || !!t?.invalid.value), u = $(() => !!e.disabled || !!t?.disabled.value), f = $(() => t?.name.value || e.name), m = $(() => e.required ? !0 : void 0), g = $(() => {
439
+ const d = /* @__PURE__ */ new Set();
440
+ return t?.describedBy.value && t.describedBy.value.split(/\s+/).forEach((c) => d.add(c)), e.errorMessage && d.add(i.value), e.hint && d.add(l.value), d.size ? Array.from(d).join(" ") : void 0;
441
+ });
442
+ return {
443
+ fieldId: a,
444
+ labelId: o,
445
+ errorId: i,
446
+ hintId: l,
447
+ invalid: s,
448
+ resolvedDisabled: u,
449
+ resolvedName: f,
450
+ ariaRequired: m,
451
+ ariaDescribedBy: g,
452
+ groupContext: t
453
+ };
454
+ }
455
+ function sa(e, t = {}) {
456
+ const { speed: n = 2 } = t, a = S(!1), o = S(!1);
457
+ let i = null;
458
+ function l() {
459
+ const f = e.value;
460
+ if (!f) {
461
+ a.value = !1, o.value = !1;
462
+ return;
463
+ }
464
+ a.value = f.scrollTop > 0, o.value = Math.ceil(f.scrollTop) < f.scrollHeight - f.clientHeight;
465
+ }
466
+ function s(f) {
467
+ u();
468
+ const m = e.value;
469
+ if (!m) return;
470
+ function g() {
471
+ m && (m.scrollTop += f === "up" ? -n : n, l(), i = requestAnimationFrame(g));
472
+ }
473
+ i = requestAnimationFrame(g);
474
+ }
475
+ function u() {
476
+ i !== null && (cancelAnimationFrame(i), i = null);
477
+ }
478
+ return xt(e, l), lt(() => {
479
+ u();
480
+ }), {
481
+ canScrollUp: a,
482
+ canScrollDown: o,
483
+ startScroll: s,
484
+ stopScroll: u,
485
+ updateScrollState: l
486
+ };
487
+ }
488
+ function Se() {
489
+ return Y(fn, S(!1));
490
+ }
491
+ Object.keys(bt).forEach((e) => {
492
+ Oe(e, bt[e]);
493
+ });
494
+ const ua = (e, [t, n]) => {
495
+ if (!e?.files || !e.files?.length)
496
+ return !0;
497
+ const a = (l, s, u) => {
498
+ const f = window.URL || window.webkitURL;
499
+ return new Promise((m) => {
500
+ const g = new Image(), d = f.createObjectURL(l);
501
+ g.onerror = () => {
502
+ f.revokeObjectURL(d), m(!1);
503
+ }, g.onload = () => {
504
+ f.revokeObjectURL(d);
505
+ const c = g.width >= Number(s) && g.height >= Number(u);
506
+ m(c ? !0 : ke.global.t("messages.min_dimensions.error", { width: s, height: u }));
507
+ }, g.src = d;
508
+ });
509
+ }, o = [], i = e.files;
510
+ for (let l = 0; l < i.length; l++) {
511
+ if (!/\.(jpg|svg|jpeg|png|bmp|gif)$/i.test(i[l].name))
512
+ return Promise.resolve(ke.global.t("messages.min_dimensions.not_image_error"));
513
+ o.push(i[l]);
514
+ }
515
+ return Promise.all(o.map((l) => a(l, t, n))).then((l) => {
516
+ const s = l.find((u) => u !== !0);
517
+ return s === !1 || typeof s == "string" ? s : !0;
518
+ });
519
+ };
520
+ Oe("mindimensions", ua);
521
+ const ca = (e, [t]) => {
522
+ if (!e?.files || !e.files?.length)
523
+ return !0;
524
+ const n = t * 1e3, a = (s) => s.size > n, o = [];
525
+ for (let s = 0; s < e.files.length; s++)
526
+ o.push(e.files[s]);
527
+ return o.map((s) => a(s)).find((s) => s === !0) ? ke.global.t("messages.file_weight", { size: t }) : !0;
528
+ };
529
+ Oe("fileWeight", ca);
530
+ const Dt = (e, [t], n, a) => {
531
+ if (!e || typeof e == "string" && !e.length)
532
+ return !0;
533
+ let o, i;
534
+ return e instanceof Date && (o = e), t instanceof Date && (i = t), typeof e == "string" && (o = new Date(e)), typeof t == "string" && (i = new Date(t)), o?.getTime && o?.getTime() > 0 && i?.getTime && i?.getTime() > 0 && n(i.getTime(), o.getTime()) ? a : !0;
535
+ }, da = (e, [t]) => Dt(e, [t], (n, a) => n < a, ke.global.t("messages.before"));
536
+ Oe("before", da);
537
+ const fa = (e, [t]) => Dt(e, [t], (n, a) => n > a, ke.global.t("messages.after"));
538
+ Oe("after", fa);
539
+ const va = (e) => Number.isSafeInteger(parseInt(e)) ? !0 : ke.global.t("messages.bigint");
540
+ Oe("bigint", va);
541
+ function Ee(e) {
542
+ const t = de(`${e.name}-bus`), n = /* @__PURE__ */ new Map(), a = /* @__PURE__ */ new Set();
543
+ function o(d) {
544
+ const c = e.getKey(d);
545
+ n.set(c, d), a.size > 0 && m((b) => {
546
+ try {
547
+ e.registerIntoService(b, d);
548
+ } catch (h) {
549
+ t.warn(`Failed to live-register item (key=${c}):`, h);
550
+ }
551
+ });
552
+ }
553
+ function i(d) {
554
+ n.delete(d), e.unregisterFromService && a.size > 0 && a.forEach((c) => {
555
+ try {
556
+ e.unregisterFromService(c, d);
557
+ } catch (b) {
558
+ t.warn(`Failed to live-unregister item (id=${d}):`, b);
559
+ }
560
+ });
561
+ }
562
+ function l(d) {
563
+ for (const [c, b] of n)
564
+ d(b) && n.delete(c);
565
+ }
566
+ function s() {
567
+ return Array.from(n.values());
568
+ }
569
+ function u(d) {
570
+ a.add(d), n.forEach((c, b) => {
571
+ try {
572
+ e.registerIntoService(d, c);
573
+ } catch (h) {
574
+ t.warn(`Failed to replay item (key=${b}):`, h);
575
+ }
576
+ });
577
+ }
578
+ function f(d) {
579
+ a.delete(d);
580
+ }
581
+ function m(d) {
582
+ a.forEach((c) => d(c));
583
+ }
584
+ function g() {
585
+ return a.values().next().value;
586
+ }
587
+ return {
588
+ preregister: o,
589
+ unregister: i,
590
+ removePreregistered: l,
591
+ getPreregistered: s,
592
+ replayInto: u,
593
+ dispose: f,
594
+ broadcast: m,
595
+ getFirstInstance: g,
596
+ get instanceCount() {
597
+ return a.size;
598
+ }
599
+ };
600
+ }
601
+ function Vt(e) {
602
+ const t = Ye({}), n = Ye([]), a = Ye(/* @__PURE__ */ new Map());
603
+ function o(d) {
604
+ a.set(d, (a.get(d) ?? 0) + 1);
605
+ }
606
+ function i(d) {
607
+ const c = a.get(d);
608
+ if (!c || c <= 1) {
609
+ a.delete(d);
610
+ return;
611
+ }
612
+ a.set(d, c - 1);
613
+ }
614
+ function l(d, c) {
615
+ const b = c.toLowerCase();
616
+ t[b] || (t[b] = []);
617
+ const h = t[b].find((p) => p.id === d.id);
618
+ if (h) {
619
+ Object.assign(h, d, { bladeId: b });
620
+ return;
621
+ }
622
+ const B = { ...d, bladeId: b };
623
+ t[b].push(B), n.push(e.createRegistration(b, B)), o(d.id);
624
+ }
625
+ function s(d, c) {
626
+ const b = c.toLowerCase(), h = t[b];
627
+ if (h) {
628
+ const p = h.findIndex((I) => I.id === d);
629
+ if (p !== -1) {
630
+ const [I] = h.splice(p, 1);
631
+ I && i(I.id);
632
+ }
633
+ }
634
+ const B = n.findIndex(
635
+ (p) => e.getRegistrationBladeId(p) === b && e.getRegistrationItemId(p) === d
636
+ );
637
+ B !== -1 && n.splice(B, 1);
638
+ }
639
+ function u(d) {
640
+ const c = d ? d.toLowerCase() : "";
641
+ return [...t[c] || []];
642
+ }
643
+ function f(d) {
644
+ const c = d.toLowerCase(), b = t[c];
645
+ b && (b.forEach((B) => i(B.id)), delete t[c]), n.map((B, p) => e.getRegistrationBladeId(B) === c ? p : -1).filter((B) => B !== -1).reverse().forEach((B) => {
646
+ n.splice(B, 1);
647
+ });
648
+ }
649
+ function m(d, c, b) {
650
+ const h = c.toLowerCase(), B = t[h]?.find((p) => p.id === d);
651
+ B && Object.assign(B, b, { bladeId: h });
652
+ }
653
+ function g(d) {
654
+ return a.has(d);
655
+ }
656
+ return {
657
+ registry: t,
658
+ registrations: n,
659
+ register: l,
660
+ unregister: s,
661
+ get: u,
662
+ clear: f,
663
+ update: m,
664
+ isRegistered: g
665
+ };
666
+ }
667
+ function ga(e) {
668
+ const t = S(/* @__PURE__ */ new Map()), n = $(() => Array.from(t.value.values()).sort((i, l) => (i.order ?? 0) - (l.order ?? 0)));
669
+ function a(i) {
670
+ const l = e.getId(i) || crypto.randomUUID(), s = e.createItem(i, t.value.size);
671
+ return t.value.set(l, { ...s, id: l }), l;
672
+ }
673
+ function o(i) {
674
+ t.value.delete(i);
675
+ }
676
+ return {
677
+ itemsMap: t,
678
+ sortedItems: n,
679
+ register: a,
680
+ unregister: o
681
+ };
682
+ }
683
+ function Pt(e) {
684
+ const t = ga({
685
+ createItem: e.createItem,
686
+ getId: e.getId
687
+ }), n = {
688
+ register: (a) => t.register(a),
689
+ unregister: (a) => t.unregister(a),
690
+ items: t.sortedItems
691
+ };
692
+ return e.bus.replayInto(n), n;
693
+ }
694
+ function ze(e) {
695
+ return e.id !== void 0 ? `id:${String(e.id)}` : e.routeId ? `route:${e.routeId}` : e.url ? `url:${e.url}` : e.groupConfig?.id ? `gc:${e.groupConfig.id}:${e.title}` : e.group ? `g:${e.group}:${e.title}` : `hash:${JSON.stringify(Ct(e, "title"))}`;
696
+ }
697
+ const De = S(/* @__PURE__ */ new Map()), ce = Ee({
698
+ name: "menu-service",
699
+ getKey: ze,
700
+ registerIntoService: (e, t) => e.addMenuItem(t)
701
+ });
702
+ function Hi(e) {
703
+ ce.preregister(e);
704
+ }
705
+ function Gi(e) {
706
+ ce.removePreregistered((t) => ut(t, e)), ce.broadcast((t) => t.removeMenuItem(e));
707
+ }
708
+ function Yi(e, t) {
709
+ De.value.set(e, t), ce.broadcast((n) => {
710
+ n.menuBadges.value.set(e, t);
711
+ });
712
+ }
713
+ function Ji(e) {
714
+ const t = ce.getFirstInstance();
715
+ return t ? t.menuBadges.value.get(e) : De.value.get(e);
716
+ }
717
+ function Xi(e) {
718
+ De.value.delete(e), ce.broadcast((t) => {
719
+ t.menuBadges.value.delete(e);
720
+ });
721
+ }
722
+ function Zi() {
723
+ return ce.getFirstInstance()?.menuBadges ?? De;
724
+ }
725
+ const at = 1 / 0, ma = 1 / 0;
726
+ function ut(e, t) {
727
+ return ze(e) === ze(t);
728
+ }
729
+ function pa(e) {
730
+ return e.groupConfig ? {
731
+ groupId: e.groupConfig.id,
732
+ groupTitle: e.groupConfig.title || e.groupConfig.id,
733
+ groupIcon: e.groupConfig.icon,
734
+ groupPriority: e.groupConfig.priority,
735
+ groupPermissions: e.groupConfig.permissions
736
+ } : {
737
+ groupId: "group_" + On(e.group),
738
+ groupTitle: e.group,
739
+ groupIcon: e.groupIcon,
740
+ groupPriority: e.priority,
741
+ groupPermissions: void 0
742
+ };
743
+ }
744
+ function ba(e, t) {
745
+ return (e.priority ?? at) - (t.priority ?? at);
746
+ }
747
+ function ya(e, t) {
748
+ const n = (a) => a.inGroupPriority ?? a.priority ?? ma;
749
+ return n(e) - n(t);
750
+ }
751
+ function ha(e, t) {
752
+ const n = pa(e), a = {
753
+ ...Ct(e, ["group", "groupIcon", "groupPriority", "groupConfig"])
754
+ }, o = t.get(n.groupId);
755
+ if (o) {
756
+ const i = [...o.children ?? []], l = i.findIndex((s) => ut(s, a));
757
+ l > -1 ? i[l] = a : i.push(a), t.set(n.groupId, {
758
+ ...o,
759
+ children: i,
760
+ ...e.groupConfig?.title && { title: e.groupConfig.title },
761
+ ...e.groupConfig?.icon !== void 0 && { groupIcon: e.groupConfig.icon },
762
+ ...e.groupConfig?.priority !== void 0 && { priority: e.groupConfig.priority },
763
+ ...e.groupConfig?.permissions !== void 0 && { permissions: e.groupConfig.permissions }
764
+ });
765
+ } else
766
+ t.set(n.groupId, {
767
+ groupId: n.groupId,
768
+ groupIcon: n.groupIcon ?? "",
769
+ title: n.groupTitle,
770
+ children: [a],
771
+ priority: n.groupPriority ?? e.priority ?? at,
772
+ permissions: n.groupPermissions
773
+ });
774
+ }
775
+ function ht(e) {
776
+ const t = /* @__PURE__ */ new Map(), n = /* @__PURE__ */ new Map();
777
+ for (const a of e)
778
+ a.group || a.groupConfig ? ha(a, t) : a.title && n.set(ze(a), { ...a });
779
+ return ka([...t.values(), ...n.values()]);
780
+ }
781
+ function ka(e) {
782
+ return e.map(
783
+ (t) => ({
784
+ ...t,
785
+ children: t.children ? [...t.children].sort(ya) : void 0
786
+ })
787
+ ).sort(ba);
788
+ }
789
+ function Ia() {
790
+ const e = S([]);
791
+ let t = [];
792
+ const n = S(new Map(De.value));
793
+ function a(l) {
794
+ t.push(l), e.value = ht(t);
795
+ }
796
+ function o(l) {
797
+ const s = t.length;
798
+ t = t.filter((u) => !ut(u, l)), t.length !== s && (e.value = ht(t));
799
+ }
800
+ const i = {
801
+ addMenuItem: a,
802
+ menuItems: e,
803
+ removeMenuItem: o,
804
+ menuBadges: n
805
+ };
806
+ return ce.replayInto(i), i;
807
+ }
808
+ function We(e) {
809
+ const { key: t, create: n, bus: a, name: o, onMissing: i } = e;
810
+ function l() {
811
+ const u = Y(t, null);
812
+ if (u)
813
+ return u;
814
+ const f = n();
815
+ return $t(t, f), ln() && on(() => a.dispose(f)), f;
816
+ }
817
+ function s() {
818
+ const u = Y(t, null);
819
+ if (!u)
820
+ throw i?.(), new Kn(o);
821
+ return u;
822
+ }
823
+ return {
824
+ provide: l,
825
+ use: s
826
+ };
827
+ }
828
+ const Sa = de("use-menu-service"), Ft = We({
829
+ key: vn,
830
+ create: Ia,
831
+ bus: ce,
832
+ name: "MenuService",
833
+ onMissing: () => Sa.error("Menu service not found in current context. Injection chain:", qe())
834
+ });
835
+ function Qi() {
836
+ return Ft.provide();
837
+ }
838
+ function _i() {
839
+ return Ft.use();
840
+ }
841
+ function je() {
842
+ return {
843
+ isMobile: Y(yn, S(!1)),
844
+ isDesktop: Y(bn, S(!0)),
845
+ isPhone: Y(pn, S(!1)),
846
+ isTablet: Y(mn, S(!1)),
847
+ isTouch: Y(gn, !1)
848
+ };
849
+ }
850
+ const $a = Symbol("AppInsightsOptions"), wa = Symbol("AppInsightsInstance");
851
+ function Oa() {
852
+ const e = Y(wa, null), { user: t } = st(), n = Y($a, void 0);
853
+ function a() {
854
+ const o = n?.appName ? `[${n.appName}] ` : "", i = (u) => `${o}${u.name}`;
855
+ function l(u) {
856
+ if (!e) return;
857
+ const f = i(u);
858
+ e.context.telemetryTrace.traceID = Ln(), e.context.telemetryTrace.name = u.name, e.startTrackPage(f);
859
+ }
860
+ function s(u) {
861
+ if (!e) return;
862
+ const f = i(u), m = location.protocol + "//" + location.host + u.fullPath;
863
+ e.stopTrackPage(f, m, {
864
+ userId: t.value?.id ?? "",
865
+ userName: t.value?.userName ?? ""
866
+ });
867
+ }
868
+ return {
869
+ beforeEach: l,
870
+ afterEach: s
871
+ };
872
+ }
873
+ return {
874
+ setupPageTracking: a(),
875
+ appInsights: e
876
+ };
877
+ }
878
+ const Ea = de("use-error-handler");
879
+ function La(e) {
880
+ const t = S(null), n = qe(), { appInsights: a } = Oa(), { user: o } = st(), i = S(!1);
881
+ function l() {
882
+ t.value = null, n && n.emit("reset");
883
+ }
884
+ return rn((s) => {
885
+ if (i.value)
886
+ return !e;
887
+ i.value = !0;
888
+ const u = Pe(s);
889
+ return t.value = u, a && a.trackException({
890
+ exception: u,
891
+ properties: {
892
+ userId: o.value?.id ?? "",
893
+ userName: o.value?.userName ?? ""
894
+ }
895
+ }), Ea.error("Captured Error:", u.originalError), n && n.emit("error", u), he(() => {
896
+ i.value = !1;
897
+ }), !e;
898
+ }), {
899
+ error: t,
900
+ reset: l
901
+ };
902
+ }
903
+ const Fe = /* @__PURE__ */ new WeakMap();
904
+ function er(e, t, n) {
905
+ Fe.set(e, { timerId: t, notifId: n });
906
+ }
907
+ function Ba(e) {
908
+ if (e && typeof e == "object") {
909
+ const t = Fe.get(e), n = "originalError" in e && e.originalError && typeof e.originalError == "object" ? e.originalError : void 0, a = t ?? (n ? Fe.get(n) : void 0), o = t ? e : n;
910
+ if (a && o)
911
+ return clearTimeout(a.timerId), Promise.resolve().then(() => oa).then(({ notification: i }) => {
912
+ i.remove(a.notifId);
913
+ }), Fe.delete(o), !0;
914
+ }
915
+ return !1;
916
+ }
917
+ const tr = V({
918
+ name: "ErrorInterceptor",
919
+ props: {
920
+ capture: {
921
+ default: !1,
922
+ type: Boolean
923
+ }
924
+ },
925
+ emits: {
926
+ error(e) {
927
+ return e && e instanceof Error || typeof e == "string";
928
+ },
929
+ reset() {
930
+ return !0;
931
+ }
932
+ },
933
+ setup(e, { slots: t }) {
934
+ const n = Y(Et, void 0), a = Y(hn, void 0), o = !!(n && a), { error: i, reset: l } = La(o || e.capture);
935
+ return o && H(i, (s) => {
936
+ const u = n.value.id;
937
+ if (s) {
938
+ if (Ba(s), kn())
939
+ return;
940
+ a.setBladeError(u, s);
941
+ } else
942
+ a.clearBladeError(u);
943
+ }), () => t.default?.({
944
+ error: i.value,
945
+ reset: l
946
+ });
947
+ }
948
+ }), Ca = Symbol("vc-button-group"), xa = ["type", "disabled", "aria-disabled", "aria-label", "aria-busy", "aria-pressed"], Ta = {
949
+ key: 2,
950
+ class: "vc-button__title"
951
+ }, Ra = /* @__PURE__ */ V({
952
+ __name: "vc-button",
953
+ props: {
954
+ icon: {},
955
+ iconClass: {},
956
+ iconSize: { default: "s" },
957
+ variant: { default: "primary" },
958
+ disabled: { type: Boolean },
959
+ size: { default: "default" },
960
+ selected: { type: Boolean },
961
+ text: { type: Boolean },
962
+ type: { default: "button" },
963
+ loading: { type: Boolean, default: !1 },
964
+ ariaLabel: {}
965
+ },
966
+ emits: ["click"],
967
+ setup(e, { emit: t }) {
968
+ const n = {
969
+ base: "default",
970
+ xs: "sm"
971
+ }, a = e, o = Se(), i = t, l = Y(Ca, null), s = $(() => {
972
+ const c = l?.size?.value ?? a.size;
973
+ return n[c] ?? c;
974
+ }), u = S(null), f = $(() => a.disabled || a.loading), m = S(!1);
975
+ H(f, (c) => {
976
+ m.value = c && u.value === document.activeElement;
977
+ });
978
+ const g = $(() => [
979
+ "vc-button",
980
+ {
981
+ [`vc-button-${a.variant}`]: a.variant,
982
+ [`vc-button--${s.value}`]: s.value,
983
+ "vc-button--selected": a.selected,
984
+ "vc-button--text": a.text,
985
+ "vc-button--disabled": f.value,
986
+ "vc-button--loading": a.loading
987
+ }
988
+ ]);
989
+ function d(c) {
990
+ c.preventDefault(), !f.value && i("click", c);
991
+ }
992
+ return (c, b) => r(o) ? w("", !0) : (v(), y("button", {
993
+ key: 0,
994
+ ref_key: "buttonRef",
995
+ ref: u,
996
+ class: j(g.value),
997
+ type: e.type,
998
+ disabled: f.value && !m.value,
999
+ "aria-disabled": m.value || void 0,
1000
+ "aria-label": e.ariaLabel,
1001
+ "aria-busy": e.loading || void 0,
1002
+ "aria-pressed": e.selected || void 0,
1003
+ onBlur: b[0] || (b[0] = (h) => m.value = !1),
1004
+ onClick: d
1005
+ }, [
1006
+ e.loading ? (v(), N(r(U), {
1007
+ key: 0,
1008
+ icon: "lucide-loader-2",
1009
+ class: "vc-button__icon tw-animate-spin",
1010
+ size: e.iconSize
1011
+ }, null, 8, ["size"])) : e.icon ? (v(), N(r(U), {
1012
+ key: 1,
1013
+ class: j(["vc-button--icon", e.iconClass]),
1014
+ icon: e.icon,
1015
+ size: e.iconSize
1016
+ }, null, 8, ["class", "icon", "size"])) : w("", !0),
1017
+ c.$slots.default ? (v(), y("span", Ta, [
1018
+ C(c.$slots, "default")
1019
+ ])) : w("", !0)
1020
+ ], 42, xa));
1021
+ }
1022
+ }), ct = Ee({
1023
+ name: "toolbar-service",
1024
+ getKey: (e) => `${e.bladeId.toLowerCase()}::${e.toolbarItem.id}`,
1025
+ registerIntoService: (e, t) => e.registerToolbarItem(t.toolbarItem, t.bladeId)
1026
+ });
1027
+ function nr(e, t) {
1028
+ const n = t.toLowerCase();
1029
+ ct.preregister({
1030
+ bladeId: n,
1031
+ toolbarItem: e
1032
+ });
1033
+ }
1034
+ function zt() {
1035
+ const e = Vt({
1036
+ createRegistration: (s, u) => ({ bladeId: s, toolbarItem: u }),
1037
+ getRegistrationBladeId: (s) => s.bladeId,
1038
+ getRegistrationItemId: (s) => s.toolbarItem.id
1039
+ }), t = (s, u) => {
1040
+ e.register(s, u);
1041
+ }, n = (s, u) => {
1042
+ e.unregister(s, u);
1043
+ }, a = (s) => {
1044
+ const u = s ? s.toLowerCase() : "", f = e.get(u), m = e.get("*"), g = [...f], d = new Set(g.map((c) => c.id));
1045
+ return m.forEach((c) => {
1046
+ d.has(c.id) || g.push(c);
1047
+ }), [...g];
1048
+ }, o = (s) => {
1049
+ e.clear(s);
1050
+ }, i = ({
1051
+ id: s,
1052
+ bladeId: u,
1053
+ toolbarItem: f
1054
+ }) => {
1055
+ e.update(s, u, f);
1056
+ }, l = {
1057
+ registerToolbarItem: t,
1058
+ unregisterToolbarItem: n,
1059
+ getToolbarItems: a,
1060
+ clearBladeToolbarItems: o,
1061
+ registeredToolbarItems: e.registrations,
1062
+ isToolbarItemRegistered: (s) => e.isRegistered(s),
1063
+ updateToolbarItem: i
1064
+ };
1065
+ return ct.replayInto(l), l;
1066
+ }
1067
+ const Ma = "fallback-blade-id";
1068
+ let Xe = null;
1069
+ const Aa = We({
1070
+ key: Lt,
1071
+ create: zt,
1072
+ bus: ct,
1073
+ name: "ToolbarService"
1074
+ });
1075
+ function ar() {
1076
+ return Aa.provide();
1077
+ }
1078
+ function lr(e = {}) {
1079
+ const { autoCleanup: t = !0 } = e, n = Y(Lt, null);
1080
+ !n && !Xe && (Xe = zt());
1081
+ const a = n || Xe;
1082
+ if (!a)
1083
+ throw new Error("Toolbar service is not available");
1084
+ const o = Y(Et, void 0), i = $(() => o?.value?.id ?? Ma), l = (c) => c ?? i.value, s = (c, b) => {
1085
+ a.registerToolbarItem(c, l(b));
1086
+ }, u = (c, b) => {
1087
+ a.unregisterToolbarItem(c, l(b));
1088
+ }, f = (c, b, h) => {
1089
+ a.updateToolbarItem({ id: c, bladeId: l(h), toolbarItem: b });
1090
+ }, m = (c) => a.getToolbarItems(l(c)), g = (c) => {
1091
+ a.clearBladeToolbarItems(l(c));
1092
+ };
1093
+ return qe() && t && lt(() => {
1094
+ g();
1095
+ }), {
1096
+ registerToolbarItem: s,
1097
+ unregisterToolbarItem: u,
1098
+ updateToolbarItem: f,
1099
+ getToolbarItems: m,
1100
+ clearBladeToolbarItems: g,
1101
+ isToolbarItemRegistered: a.isToolbarItemRegistered,
1102
+ registeredToolbarItems: a.registeredToolbarItems
1103
+ };
1104
+ }
1105
+ const Na = ["aria-label"], Da = { class: "tw-sr-only" }, Va = ["aria-label"], Pa = { class: "tw-sr-only" }, le = /* @__PURE__ */ V({
1106
+ __name: "vc-skeleton",
1107
+ props: {
1108
+ variant: { default: "text" },
1109
+ rows: { default: 1 },
1110
+ width: {},
1111
+ height: {},
1112
+ animated: { type: Boolean, default: !0 },
1113
+ ariaLabel: { default: "Loading..." }
1114
+ },
1115
+ setup(e) {
1116
+ const t = e;
1117
+ function n(o) {
1118
+ return o === t.rows ? "60%" : "100%";
1119
+ }
1120
+ function a(o) {
1121
+ if (o !== void 0)
1122
+ return typeof o == "number" ? `${o}px` : o;
1123
+ }
1124
+ return (o, i) => e.variant === "text" ? (v(), y("div", {
1125
+ key: 0,
1126
+ class: j(["vc-skeleton", {
1127
+ "vc-skeleton--animated": e.animated
1128
+ }]),
1129
+ role: "status",
1130
+ "aria-busy": "true",
1131
+ "aria-label": e.ariaLabel
1132
+ }, [
1133
+ L("span", Da, T(e.ariaLabel), 1),
1134
+ (v(!0), y(we, null, ot(e.rows, (l) => (v(), y("div", {
1135
+ key: l,
1136
+ class: "vc-skeleton__row",
1137
+ style: Me({
1138
+ width: n(l)
1139
+ }),
1140
+ "aria-hidden": "true"
1141
+ }, null, 4))), 128))
1142
+ ], 10, Na)) : (v(), y("div", {
1143
+ key: 1,
1144
+ class: j(["vc-skeleton__shape", [`vc-skeleton__shape--${e.variant}`, { "tw-animate-pulse": e.animated }]]),
1145
+ style: Me({
1146
+ width: a(e.width),
1147
+ height: a(e.height)
1148
+ }),
1149
+ role: "status",
1150
+ "aria-busy": "true",
1151
+ "aria-label": e.ariaLabel
1152
+ }, [
1153
+ L("span", Pa, T(e.ariaLabel), 1)
1154
+ ], 14, Va));
1155
+ }
1156
+ }), or = /* @__PURE__ */ V({
1157
+ __name: "vc-container",
1158
+ props: {
1159
+ shadow: { type: Boolean },
1160
+ noPadding: { type: Boolean },
1161
+ ariaLabel: {}
1162
+ },
1163
+ emits: ["scroll"],
1164
+ setup(e, { expose: t, emit: n }) {
1165
+ const a = n, o = S(), i = S(!1), l = () => {
1166
+ o.value && o.value.scroll(0, 0);
1167
+ };
1168
+ function s(u) {
1169
+ a("scroll", u);
1170
+ }
1171
+ return xt(o, () => {
1172
+ i.value = !!(o.value && o.value.clientHeight < o.value.scrollHeight);
1173
+ }), t({
1174
+ scrollTop: l,
1175
+ component: o
1176
+ }), (u, f) => (v(), N(it(e.ariaLabel ? "section" : "div"), {
1177
+ class: j([
1178
+ "vc-container",
1179
+ {
1180
+ "vc-container--shadow": e.shadow && i.value,
1181
+ "vc-container--nopadding": e.noPadding
1182
+ }
1183
+ ]),
1184
+ "aria-label": e.ariaLabel
1185
+ }, {
1186
+ default: O(() => [
1187
+ L("div", {
1188
+ ref_key: "component",
1189
+ ref: o,
1190
+ class: "vc-container__inner",
1191
+ tabindex: "0",
1192
+ onScroll: s
1193
+ }, [
1194
+ C(u.$slots, "default")
1195
+ ], 544)
1196
+ ]),
1197
+ _: 3
1198
+ }, 8, ["class", "aria-label"]));
1199
+ }
1200
+ }), Fa = ["id", "role"], za = /* @__PURE__ */ V({
1201
+ __name: "vc-hint",
1202
+ props: {
1203
+ id: {},
1204
+ error: { type: Boolean }
1205
+ },
1206
+ setup(e) {
1207
+ return (t, n) => (v(), y("div", {
1208
+ id: e.id,
1209
+ class: j(["vc-hint", {
1210
+ "vc-hint--error": e.error
1211
+ }]),
1212
+ role: e.error ? "alert" : void 0
1213
+ }, [
1214
+ C(t.$slots, "default")
1215
+ ], 10, Fa));
1216
+ }
1217
+ }), fe = za, qa = ["role", "tabindex", "aria-label", "onKeydown"], Ua = {
1218
+ key: 0,
1219
+ class: "vc-image__placeholder",
1220
+ "aria-hidden": "true"
1221
+ }, Ka = /* @__PURE__ */ V({
1222
+ __name: "vc-image",
1223
+ props: {
1224
+ aspect: { default: "1x1" },
1225
+ rounded: { type: Boolean },
1226
+ bordered: { type: Boolean },
1227
+ clickable: { type: Boolean },
1228
+ src: {},
1229
+ size: { default: "auto" },
1230
+ background: { default: "cover" },
1231
+ emptyIcon: { default: "lucide-image" },
1232
+ alt: {},
1233
+ thumbnailSize: {}
1234
+ },
1235
+ emits: ["click"],
1236
+ setup(e, { emit: t }) {
1237
+ const n = de("vc-image"), a = e, o = t;
1238
+ function i(g) {
1239
+ if (!g) return g;
1240
+ try {
1241
+ const d = new URL(g);
1242
+ if (d.protocol === "http:" && window.location.protocol === "https:")
1243
+ return d.protocol = "https:", d.href;
1244
+ } catch {
1245
+ n.warn("Invalid URL:", g);
1246
+ }
1247
+ return g;
1248
+ }
1249
+ const l = $(() => ta(a.src, a.thumbnailSize) ?? a.src), s = S(!1), u = $(() => s.value ? a.src : l.value);
1250
+ H(
1251
+ () => [a.src, a.thumbnailSize],
1252
+ () => {
1253
+ s.value = !1;
1254
+ }
1255
+ ), H(
1256
+ u,
1257
+ (g) => {
1258
+ if (!g || !a.thumbnailSize || s.value || g === a.src) return;
1259
+ const d = new Image();
1260
+ d.src = i(g), d.onerror = () => {
1261
+ s.value = !0;
1262
+ };
1263
+ },
1264
+ { immediate: !0 }
1265
+ );
1266
+ const f = $(() => {
1267
+ if (u.value) {
1268
+ const g = i(u.value);
1269
+ return `background: url(${CSS.escape(g)}) center / ${a.background} no-repeat`;
1270
+ }
1271
+ });
1272
+ function m() {
1273
+ a.clickable && o("click");
1274
+ }
1275
+ return (g, d) => (v(), y("div", {
1276
+ class: j(["vc-image", [`vc-image_${e.size}`]])
1277
+ }, [
1278
+ L("div", {
1279
+ class: j([
1280
+ "vc-image__container",
1281
+ `vc-image_${e.aspect}`,
1282
+ {
1283
+ "vc-image__container--rounded": e.rounded,
1284
+ "vc-image__container--bordered": e.bordered,
1285
+ "vc-image__container--clickable": e.clickable
1286
+ }
1287
+ ]),
1288
+ style: Me(f.value),
1289
+ role: e.clickable ? "button" : e.src && e.alt ? "img" : void 0,
1290
+ tabindex: e.clickable ? 0 : void 0,
1291
+ "aria-label": e.alt || (e.clickable ? g.$t("COMPONENTS.ATOMS.VC_IMAGE.LABEL") : void 0),
1292
+ onClick: m,
1293
+ onKeydown: [
1294
+ Z(G(m, ["prevent"]), ["enter"]),
1295
+ Z(G(m, ["prevent"]), ["space"])
1296
+ ]
1297
+ }, [
1298
+ e.src ? w("", !0) : (v(), y("div", Ua, [
1299
+ x(r(U), {
1300
+ icon: e.emptyIcon,
1301
+ size: "xl"
1302
+ }, null, 8, ["icon"])
1303
+ ]))
1304
+ ], 46, qa)
1305
+ ], 2));
1306
+ }
1307
+ }), Wa = { class: "vc-label__text" }, ja = { class: "vc-label__content" }, Ha = {
1308
+ key: 0,
1309
+ class: "vc-label__required",
1310
+ "aria-hidden": "true"
1311
+ }, Ga = {
1312
+ key: 0,
1313
+ class: "vc-label__tooltip"
1314
+ }, Ya = {
1315
+ key: 1,
1316
+ class: "vc-label__language"
1317
+ }, He = /* @__PURE__ */ V({
1318
+ __name: "vc-label",
1319
+ props: {
1320
+ required: { type: Boolean },
1321
+ tooltipIcon: { default: "lucide-info" },
1322
+ multilanguage: { type: Boolean },
1323
+ currentLanguage: {},
1324
+ error: { type: Boolean },
1325
+ htmlFor: {}
1326
+ },
1327
+ setup(e) {
1328
+ return (t, n) => (v(), N(it(e.htmlFor ? "label" : "div"), {
1329
+ class: j(["vc-label", {
1330
+ "vc-label--error": e.error
1331
+ }]),
1332
+ for: e.htmlFor || void 0
1333
+ }, {
1334
+ default: O(() => [
1335
+ L("div", Wa, [
1336
+ L("span", ja, [
1337
+ C(t.$slots, "default")
1338
+ ]),
1339
+ e.required ? (v(), y("span", Ha, "*")) : w("", !0)
1340
+ ]),
1341
+ t.$slots.tooltip ? (v(), y("span", Ga, [
1342
+ x(r(Bt), { placement: "top-start" }, {
1343
+ tooltip: O(() => [
1344
+ C(t.$slots, "tooltip")
1345
+ ]),
1346
+ default: O(() => [
1347
+ x(r(U), {
1348
+ class: "vc-label__tooltip-icon",
1349
+ icon: e.tooltipIcon,
1350
+ size: "s"
1351
+ }, null, 8, ["icon"])
1352
+ ]),
1353
+ _: 3
1354
+ })
1355
+ ])) : w("", !0),
1356
+ e.multilanguage ? (v(), y("div", Ya, T(e.currentLanguage), 1)) : w("", !0)
1357
+ ]),
1358
+ _: 3
1359
+ }, 8, ["class", "for"]));
1360
+ }
1361
+ }), Ja = ["disabled", "aria-disabled"], Xa = { class: "vc-link__text" }, Za = /* @__PURE__ */ V({
1362
+ __name: "vc-link",
1363
+ props: {
1364
+ active: { type: Boolean },
1365
+ disabled: { type: Boolean },
1366
+ onClick: { type: Function }
1367
+ },
1368
+ emits: ["click"],
1369
+ setup(e, { emit: t }) {
1370
+ const n = e, a = t;
1371
+ function o() {
1372
+ n.disabled || a("click");
1373
+ }
1374
+ return (i, l) => (v(), y("button", {
1375
+ type: "button",
1376
+ class: j(["vc-link", {
1377
+ "vc-link--active": e.active,
1378
+ "vc-link--disabled": e.disabled
1379
+ }]),
1380
+ disabled: e.disabled,
1381
+ "aria-disabled": e.disabled,
1382
+ onClick: o
1383
+ }, [
1384
+ L("span", Xa, [
1385
+ C(i.$slots, "default")
1386
+ ])
1387
+ ], 10, Ja));
1388
+ }
1389
+ }), Qa = Za, _a = ["aria-label"], el = { class: "vc-status__content" }, tl = /* @__PURE__ */ V({
1390
+ __name: "vc-status",
1391
+ props: {
1392
+ variant: { default: "info" },
1393
+ extend: { type: Boolean },
1394
+ dot: { type: Boolean, default: !1 }
1395
+ },
1396
+ setup(e) {
1397
+ return (t, n) => (v(), y("div", {
1398
+ class: j(["vc-status", [
1399
+ `vc-status--${e.variant}`,
1400
+ {
1401
+ "vc-status--extended": e.extend,
1402
+ "vc-status--dot": e.dot
1403
+ }
1404
+ ]]),
1405
+ role: "status",
1406
+ "aria-label": e.dot ? e.variant : void 0
1407
+ }, [
1408
+ L("div", el, [
1409
+ C(t.$slots, "default")
1410
+ ])
1411
+ ], 10, _a));
1412
+ }
1413
+ }), nl = ["aria-label"], al = /* @__PURE__ */ V({
1414
+ __name: "vc-status-icon",
1415
+ props: {
1416
+ status: { type: Boolean }
1417
+ },
1418
+ setup(e) {
1419
+ return (t, n) => (v(), y("div", {
1420
+ class: "vc-status-icon",
1421
+ role: "img",
1422
+ "aria-label": e.status ? "Active" : "Inactive"
1423
+ }, [
1424
+ e.status ? (v(), N(r(U), {
1425
+ key: 0,
1426
+ icon: "lucide-circle-check",
1427
+ class: "vc-status-icon__icon vc-status-icon__icon--success",
1428
+ "aria-hidden": "true"
1429
+ })) : (v(), N(r(U), {
1430
+ key: 1,
1431
+ icon: "lucide-circle-x",
1432
+ class: "vc-status-icon__icon vc-status-icon__icon--inactive",
1433
+ "aria-hidden": "true"
1434
+ }))
1435
+ ], 8, nl));
1436
+ }
1437
+ }), ll = ["aria-label"], kt = 40, ol = /* @__PURE__ */ V({
1438
+ __name: "vc-scrollable-container",
1439
+ props: {
1440
+ speed: { default: void 0 }
1441
+ },
1442
+ setup(e, { expose: t }) {
1443
+ const n = e, a = S(null), o = {};
1444
+ n.speed !== void 0 && (o.speed = n.speed);
1445
+ const { canScrollUp: i, canScrollDown: l, startScroll: s, stopScroll: u, updateScrollState: f } = sa(
1446
+ a,
1447
+ o
1448
+ );
1449
+ function m(g) {
1450
+ if (!a.value) return;
1451
+ const d = g === "up" ? -kt : kt;
1452
+ a.value.scrollBy({ top: d, behavior: "smooth" });
1453
+ }
1454
+ return t({
1455
+ viewportRef: a,
1456
+ updateScrollState: f
1457
+ }), (g, d) => (v(), y("div", {
1458
+ class: "vc-scrollable-container",
1459
+ role: "region",
1460
+ "aria-label": g.$t("COMPONENTS.ATOMS.VC_SCROLLABLE_CONTAINER.LABEL")
1461
+ }, [
1462
+ L("div", {
1463
+ class: j(["vc-scrollable-container__arrow", { "vc-scrollable-container__arrow--hidden": !r(i) }]),
1464
+ "aria-hidden": "true",
1465
+ onPointerenter: d[0] || (d[0] = (c) => r(s)("up")),
1466
+ onPointerleave: d[1] || (d[1] = //@ts-ignore
1467
+ (...c) => r(u) && r(u)(...c))
1468
+ }, [
1469
+ C(g.$slots, "arrow-up", {}, () => [
1470
+ x(r(U), {
1471
+ icon: "lucide-chevron-up",
1472
+ size: "xs"
1473
+ })
1474
+ ])
1475
+ ], 34),
1476
+ L("div", {
1477
+ ref_key: "viewportRef",
1478
+ ref: a,
1479
+ class: "vc-scrollable-container__viewport",
1480
+ tabindex: "0",
1481
+ onScroll: d[2] || (d[2] = //@ts-ignore
1482
+ (...c) => r(f) && r(f)(...c)),
1483
+ onKeydown: [
1484
+ d[3] || (d[3] = Z(G((c) => m("up"), ["prevent"]), ["up"])),
1485
+ d[4] || (d[4] = Z(G((c) => m("down"), ["prevent"]), ["down"]))
1486
+ ]
1487
+ }, [
1488
+ C(g.$slots, "default")
1489
+ ], 544),
1490
+ L("div", {
1491
+ class: j(["vc-scrollable-container__arrow", { "vc-scrollable-container__arrow--hidden": !r(l) }]),
1492
+ "aria-hidden": "true",
1493
+ onPointerenter: d[5] || (d[5] = (c) => r(s)("down")),
1494
+ onPointerleave: d[6] || (d[6] = //@ts-ignore
1495
+ (...c) => r(u) && r(u)(...c))
1496
+ }, [
1497
+ C(g.$slots, "arrow-down", {}, () => [
1498
+ x(r(U), {
1499
+ icon: "lucide-chevron-down",
1500
+ size: "xs"
1501
+ })
1502
+ ])
1503
+ ], 34)
1504
+ ], 8, ll));
1505
+ }
1506
+ }), dt = /* @__PURE__ */ new Map();
1507
+ function il(e) {
1508
+ return e?.map((t) => t.toLowerCase());
1509
+ }
1510
+ function ir(e) {
1511
+ dt.set(e.id, {
1512
+ ...e,
1513
+ targetBlades: il(e.targetBlades)
1514
+ });
1515
+ }
1516
+ function rl(e) {
1517
+ const t = e.toLowerCase();
1518
+ return Array.from(dt.values()).filter((n) => !n.targetBlades || n.targetBlades.includes(t)).map((n) => ({ ...n, targetBlades: n.targetBlades ? [...n.targetBlades] : void 0 }));
1519
+ }
1520
+ function sl() {
1521
+ return Array.from(dt.values()).map((e) => ({
1522
+ ...e,
1523
+ targetBlades: e.targetBlades ? [...e.targetBlades] : void 0
1524
+ }));
1525
+ }
1526
+ function ul(e) {
1527
+ return En(e);
1528
+ }
1529
+ const qt = Ee({
1530
+ name: "widget-service",
1531
+ getKey: (e) => `${e.bladeId.toLowerCase()}::${e.widget.id}`,
1532
+ registerIntoService: (e, t) => e.registerWidget(t.widget, t.bladeId)
1533
+ });
1534
+ function rr(e, t) {
1535
+ const n = t.toLowerCase();
1536
+ qt.preregister({
1537
+ bladeId: n,
1538
+ widget: e
1539
+ });
1540
+ }
1541
+ function sr() {
1542
+ const e = Vt({
1543
+ createRegistration: (a, o) => ({ bladeId: a, widget: o }),
1544
+ getRegistrationBladeId: (a) => a.bladeId,
1545
+ getRegistrationItemId: (a) => a.widget.id
1546
+ }), n = {
1547
+ registerWidget: (a, o) => e.register(a, o),
1548
+ unregisterWidget: (a, o) => e.unregister(a, o),
1549
+ getWidgets: (a) => e.get(a),
1550
+ updateWidget: ({ id: a, bladeId: o, widget: i }) => e.update(a, o, i),
1551
+ getExternalWidgetsForBlade: (a) => rl(a.toLowerCase()),
1552
+ getAllExternalWidgets: sl,
1553
+ cloneWidget: ul
1554
+ };
1555
+ return qt.replayInto(n), n;
1556
+ }
1557
+ const cl = de("use-theme"), pe = S([
1558
+ { key: "light", localizationKey: "CORE.THEMES.LIGHT" },
1559
+ { key: "dark", localizationKey: "CORE.THEMES.DARK" }
1560
+ ]), ur = Rn(() => {
1561
+ const { t: e } = ke.global;
1562
+ function t(f) {
1563
+ (Array.isArray(f) ? f : [f]).forEach((m) => {
1564
+ pe.value.some((g) => g.key === m.key) || pe.value.push(m);
1565
+ });
1566
+ }
1567
+ function n(f) {
1568
+ (Array.isArray(f) ? f : [f]).forEach((m) => {
1569
+ const g = pe.value.findIndex((d) => d.key === m);
1570
+ g >= 0 && pe.value.splice(g, 1);
1571
+ });
1572
+ }
1573
+ const a = $(() => pe.value.map((f) => f.key)), o = Bn({
1574
+ attribute: "data-theme",
1575
+ emitAuto: !0,
1576
+ initialValue: "light",
1577
+ // Should align with a default theme in _themeRegistry
1578
+ modes: {
1579
+ // Dynamically build modes from registered theme keys
1580
+ ...a.value.reduce(
1581
+ (f, m) => (f[m] = m, f),
1582
+ {}
1583
+ )
1584
+ }
1585
+ }), { state: i, next: l } = Cn(a, { initialValue: o });
1586
+ Qe(() => {
1587
+ i.value && (o.value = i.value);
1588
+ });
1589
+ function s(f) {
1590
+ a.value.includes(f) ? i.value = f : cl.warn(`Attempted to set an unregistered theme: ${f}`);
1591
+ }
1592
+ const u = $(() => {
1593
+ const f = pe.value.find((m) => m.key === i.value);
1594
+ return f ? f.localizationKey ? e(f.localizationKey) : Je(f.key) : i.value ? Je(i.value) : "";
1595
+ });
1596
+ return {
1597
+ themes: $(
1598
+ () => pe.value.map((f) => ({
1599
+ key: f.key,
1600
+ name: f.localizationKey ? e(f.localizationKey) : Je(f.key)
1601
+ }))
1602
+ ),
1603
+ currentThemeKey: i,
1604
+ currentLocalizedName: u,
1605
+ next: l,
1606
+ register: t,
1607
+ unregister: n,
1608
+ setTheme: s
1609
+ };
1610
+ }), ft = Ee({
1611
+ name: "dashboard-service",
1612
+ getKey: (e) => e.id,
1613
+ registerIntoService: (e, t) => e.registerWidget(t)
1614
+ });
1615
+ function cr(e) {
1616
+ ft.preregister(e);
1617
+ }
1618
+ const dl = () => ({
1619
+ widgets: _e(/* @__PURE__ */ new Map()),
1620
+ layout: _e(/* @__PURE__ */ new Map())
1621
+ });
1622
+ function fl(e = {}) {
1623
+ const t = dl(), n = e.hasAccess ?? (() => !0), s = {
1624
+ registerWidget: (u) => {
1625
+ if (t.widgets.has(u.id))
1626
+ throw new Error(`Widget with id ${u.id} already registered`);
1627
+ t.widgets.set(u.id, {
1628
+ ...u,
1629
+ permissions: u.permissions ? [...u.permissions] : void 0,
1630
+ position: u.position ? { ...u.position } : void 0,
1631
+ props: u.props ? { ...u.props } : void 0
1632
+ }), u.position && t.layout.set(u.id, { ...u.position });
1633
+ },
1634
+ getWidgets: () => Array.from(t.widgets.values()).filter((u) => !u.permissions || u.permissions.length === 0 || n(u.permissions)).map((u) => ({
1635
+ ...u,
1636
+ permissions: u.permissions ? [...u.permissions] : void 0,
1637
+ position: u.position ? { ...u.position } : void 0,
1638
+ props: u.props ? { ...u.props } : void 0
1639
+ })),
1640
+ updateWidgetPosition: (u, f) => {
1641
+ if (!t.widgets.has(u))
1642
+ throw new Error(`Widget with id ${u} not found`);
1643
+ t.layout.set(u, { ...f });
1644
+ },
1645
+ getLayout: () => new Map(t.layout)
1646
+ };
1647
+ return ft.replayInto(s), s;
1648
+ }
1649
+ const It = de("use-dashboard"), Ut = We({
1650
+ key: In,
1651
+ bus: ft,
1652
+ name: "DashboardService",
1653
+ create: () => {
1654
+ let e = () => !0;
1655
+ try {
1656
+ const { hasAccess: t } = aa();
1657
+ e = (n) => t(n);
1658
+ } catch (t) {
1659
+ It.warn("Permissions composable unavailable, dashboard falls back to allow-all access check", t);
1660
+ }
1661
+ return fl({
1662
+ hasAccess: e
1663
+ });
1664
+ },
1665
+ onMissing: () => It.error("Dashboard service not found")
1666
+ });
1667
+ function dr() {
1668
+ return Ut.provide();
1669
+ }
1670
+ function fr() {
1671
+ return Ut.use();
1672
+ }
1673
+ const Kt = Ee({
1674
+ name: "app-bar-menu-service",
1675
+ getKey: (e) => e.id || crypto.randomUUID(),
1676
+ registerIntoService: (e, t) => e.register(t),
1677
+ unregisterFromService: (e, t) => e.unregister(t)
1678
+ });
1679
+ function vr(e) {
1680
+ Kt.preregister(e);
1681
+ }
1682
+ function gr() {
1683
+ return Pt({
1684
+ bus: Kt,
1685
+ createItem: (e, t) => ({
1686
+ id: e.id || "",
1687
+ order: e.order ?? t,
1688
+ title: e.title,
1689
+ icon: typeof e.icon == "object" ? et(e.icon) : e.icon,
1690
+ component: e.component ? et(e.component) : void 0,
1691
+ props: e.props,
1692
+ onClick: e.onClick,
1693
+ slot: e.slot,
1694
+ badge: e.badge,
1695
+ searchTerms: e.searchTerms
1696
+ }),
1697
+ getId: (e) => e.id || ""
1698
+ });
1699
+ }
1700
+ const vt = Ee({
1701
+ name: "settings-menu-service",
1702
+ getKey: (e) => e.id || crypto.randomUUID(),
1703
+ registerIntoService: (e, t) => e.register(t),
1704
+ unregisterFromService: (e, t) => e.unregister(t)
1705
+ });
1706
+ function mr(e) {
1707
+ vt.preregister(e);
1708
+ }
1709
+ function vl() {
1710
+ return Pt({
1711
+ bus: vt,
1712
+ createItem: (e, t) => ({
1713
+ id: e.id || "",
1714
+ order: e.order ?? t,
1715
+ group: e.group,
1716
+ component: et(e.component),
1717
+ props: e.props
1718
+ }),
1719
+ getId: (e) => e.id || ""
1720
+ });
1721
+ }
1722
+ const gl = de("use-settings-menu"), Wt = We({
1723
+ key: Sn,
1724
+ create: vl,
1725
+ bus: vt,
1726
+ name: "SettingsMenuService",
1727
+ onMissing: () => gl.error("Settings menu service not found")
1728
+ });
1729
+ function pr() {
1730
+ return Wt.provide();
1731
+ }
1732
+ function br() {
1733
+ return Wt.use();
1734
+ }
1735
+ const ml = {
1736
+ key: 0,
1737
+ class: "vc-date-picker vc-date-picker--skeleton"
1738
+ }, pl = { class: "vc-date-picker__field-container" }, bl = { class: "vc-date-picker__field" }, yl = ["aria-label"], hl = {
1739
+ key: 0,
1740
+ class: "vc-date-picker__loading"
1741
+ }, kl = { key: 0 }, Il = { key: 1 }, Sl = /* @__PURE__ */ V({
1742
+ __name: "vc-date-picker",
1743
+ props: {
1744
+ modelValue: {},
1745
+ type: { default: "date" },
1746
+ datePickerOptions: {},
1747
+ placeholder: {},
1748
+ hint: {},
1749
+ clearable: { type: Boolean },
1750
+ loading: { type: Boolean },
1751
+ autofocus: { type: Boolean },
1752
+ size: { default: "default" },
1753
+ multilanguage: { type: Boolean },
1754
+ currentLanguage: {},
1755
+ label: {},
1756
+ tooltip: {},
1757
+ disabled: { type: Boolean },
1758
+ required: { type: Boolean },
1759
+ name: { default: "Field" },
1760
+ error: { type: Boolean },
1761
+ errorMessage: {}
1762
+ },
1763
+ emits: ["update:modelValue", "blur", "focus"],
1764
+ setup(e, { emit: t }) {
1765
+ const n = e, a = t, o = Se(), { isMobile: i, isDesktop: l } = je(), { labelId: s, errorId: u, hintId: f, invalid: m, resolvedDisabled: g, ariaRequired: d, ariaDescribedBy: c } = Ke(n), b = S(!1), h = window.navigator.language, B = S(n.modelValue), p = S(null), I = $(() => n.type === "date" && "9999-12-31" || void 0), P = (() => {
1766
+ const k = new Intl.DateTimeFormat(h, { hour: "numeric" }).format();
1767
+ return Number.isInteger(Number(k));
1768
+ })(), J = $(() => {
1769
+ const k = n.type === "datetime-local", R = new Intl.DateTimeFormat(h, {
1770
+ year: "numeric",
1771
+ month: "2-digit",
1772
+ day: "2-digit",
1773
+ ...k ? { hour: "2-digit", minute: "2-digit", hour12: !P } : {}
1774
+ }).formatToParts(new Date(2e3, 0, 15, 13, 30)), K = {
1775
+ year: "yyyy",
1776
+ month: "MM",
1777
+ day: "dd",
1778
+ hour: P ? "HH" : "hh",
1779
+ minute: "mm",
1780
+ dayPeriod: "aa"
1781
+ };
1782
+ return R.map((te) => K[te.type] ?? te.value).join("");
1783
+ }), ae = $(() => {
1784
+ if (!n.datePickerOptions?.textInput) return n.datePickerOptions;
1785
+ const k = { ...n.datePickerOptions }, R = typeof k.textInput == "object" ? k.textInput : {};
1786
+ return k.textInput = {
1787
+ format: J.value,
1788
+ rangeSeparator: " - ",
1789
+ ...R
1790
+ }, k;
1791
+ }), ee = (k) => {
1792
+ const R = {
1793
+ year: "numeric",
1794
+ month: "numeric",
1795
+ day: "numeric"
1796
+ };
1797
+ n.type === "datetime-local" && (R.hour = "numeric", R.minute = "numeric", R.hour12 = !P);
1798
+ const K = (te) => new Intl.DateTimeFormat(h, R).format(te);
1799
+ return Array.isArray(k) ? k.map((te) => te != null ? K(te) : "").join(" - ") : K(k);
1800
+ };
1801
+ H(
1802
+ () => n.modelValue,
1803
+ (k) => {
1804
+ B.value !== k && (B.value = k);
1805
+ }
1806
+ ), H(B, (k, R) => {
1807
+ k !== R && k !== n.modelValue && (p.value = null, a("update:modelValue", k));
1808
+ });
1809
+ function F() {
1810
+ B.value = null, a("update:modelValue", null);
1811
+ }
1812
+ function D(k) {
1813
+ p.value = k;
1814
+ }
1815
+ function z() {
1816
+ p.value = null;
1817
+ }
1818
+ function W(k) {
1819
+ p.value != null && (B.value = [p.value, null], p.value = null), b.value = !1, a("blur", k);
1820
+ }
1821
+ function X() {
1822
+ b.value = !0, a("focus");
1823
+ }
1824
+ return (k, R) => r(o) ? (v(), y("div", ml, [
1825
+ e.label ? (v(), N(r(le), {
1826
+ key: 0,
1827
+ variant: "block",
1828
+ width: 60 + (e.label?.length || 0) * 4,
1829
+ height: 11
1830
+ }, null, 8, ["width"])) : w("", !0),
1831
+ x(r(le), {
1832
+ variant: "block",
1833
+ width: "100%",
1834
+ height: 36
1835
+ })
1836
+ ])) : (v(), y("div", {
1837
+ key: 1,
1838
+ class: j(["vc-date-picker", [
1839
+ {
1840
+ "vc-date-picker--error": r(m),
1841
+ "vc-date-picker--disabled": r(g),
1842
+ "vc-date-picker--focused": b.value
1843
+ }
1844
+ ]])
1845
+ }, [
1846
+ e.label ? (v(), N(r(He), {
1847
+ key: 0,
1848
+ id: r(s),
1849
+ class: "vc-date-picker__label",
1850
+ required: e.required,
1851
+ multilanguage: e.multilanguage,
1852
+ "current-language": e.currentLanguage,
1853
+ error: r(m)
1854
+ }, ie({
1855
+ default: O(() => [
1856
+ L("span", null, T(e.label), 1)
1857
+ ]),
1858
+ _: 2
1859
+ }, [
1860
+ e.tooltip ? {
1861
+ name: "tooltip",
1862
+ fn: O(() => [
1863
+ Q(T(e.tooltip), 1)
1864
+ ]),
1865
+ key: "0"
1866
+ } : void 0
1867
+ ]), 1032, ["id", "required", "multilanguage", "current-language", "error"])) : w("", !0),
1868
+ L("div", {
1869
+ class: j(["vc-date-picker__field-wrapper", {
1870
+ "vc-date-picker__field-wrapper--default": e.size === "default",
1871
+ "vc-date-picker__field-wrapper--small": e.size === "small"
1872
+ }])
1873
+ }, [
1874
+ L("div", pl, [
1875
+ L("div", bl, [
1876
+ x(r(An), ne({
1877
+ modelValue: B.value,
1878
+ "onUpdate:modelValue": R[0] || (R[0] = (K) => B.value = K),
1879
+ placeholder: e.placeholder || (e.type === "datetime-local" ? k.$t("COMPONENTS.MOLECULES.VC_INPUT.DATE_TIME_PLACEHOLDER") : k.$t("COMPONENTS.MOLECULES.VC_INPUT.DATE_PLACEHOLDER")),
1880
+ disabled: r(g),
1881
+ name: e.name,
1882
+ autofocus: e.autofocus,
1883
+ "max-date": I.value,
1884
+ "time-picker-inline": "",
1885
+ "enable-time-picker": e.type === "datetime-local",
1886
+ format: ee,
1887
+ locale: r(h),
1888
+ "start-time": { hours: 0, minutes: 0 },
1889
+ clearable: !1,
1890
+ config: { closeOnAutoApply: !1 },
1891
+ "auto-apply": "",
1892
+ "teleport-center": r(i),
1893
+ is24: r(P)
1894
+ }, ae.value, {
1895
+ teleport: r(l) ? "body" : void 0,
1896
+ "aria-invalid": r(m) || void 0,
1897
+ "aria-required": r(d),
1898
+ "aria-describedby": r(c),
1899
+ "aria-labelledby": e.label ? r(s) : void 0,
1900
+ class: "vc-date-picker__input",
1901
+ tabindex: "0",
1902
+ onFocus: X,
1903
+ onClosed: W,
1904
+ onRangeStart: D,
1905
+ onRangeEnd: z,
1906
+ onTooltipOpen: X,
1907
+ onTooltipClose: W
1908
+ }), null, 16, ["modelValue", "placeholder", "disabled", "name", "autofocus", "max-date", "enable-time-picker", "locale", "teleport-center", "is24", "teleport", "aria-invalid", "aria-required", "aria-describedby", "aria-labelledby"]),
1909
+ e.clearable && B.value && !e.disabled ? (v(), y("button", {
1910
+ key: 0,
1911
+ type: "button",
1912
+ class: "vc-date-picker__clear",
1913
+ "aria-label": k.$t("COMPONENTS.MOLECULES.VC_DATE_PICKER.CLEAR"),
1914
+ onClick: F
1915
+ }, [
1916
+ x(r(U), {
1917
+ size: "xs",
1918
+ icon: "lucide-x"
1919
+ })
1920
+ ], 8, yl)) : w("", !0)
1921
+ ]),
1922
+ e.loading ? (v(), y("div", hl, [
1923
+ x(r(U), {
1924
+ icon: "lucide-loader-2",
1925
+ class: "vc-date-picker__loading-icon",
1926
+ size: "m"
1927
+ })
1928
+ ])) : w("", !0)
1929
+ ])
1930
+ ], 2),
1931
+ x(Ae, {
1932
+ name: "slide-up",
1933
+ mode: "out-in"
1934
+ }, {
1935
+ default: O(() => [
1936
+ r(m) && e.errorMessage ? (v(), y("div", kl, [
1937
+ x(r(fe), {
1938
+ id: r(u),
1939
+ class: "vc-date-picker__hint-error",
1940
+ error: !0
1941
+ }, {
1942
+ default: O(() => [
1943
+ Q(T(e.errorMessage), 1)
1944
+ ]),
1945
+ _: 1
1946
+ }, 8, ["id"])
1947
+ ])) : (v(), y("div", Il, [
1948
+ e.hint ? (v(), N(r(fe), {
1949
+ key: 0,
1950
+ id: r(f),
1951
+ class: "vc-date-picker__desc"
1952
+ }, {
1953
+ default: O(() => [
1954
+ Q(T(e.hint), 1)
1955
+ ]),
1956
+ _: 1
1957
+ }, 8, ["id"])) : w("", !0)
1958
+ ]))
1959
+ ]),
1960
+ _: 1
1961
+ })
1962
+ ], 2));
1963
+ }
1964
+ }), $l = {
1965
+ key: 0,
1966
+ class: "vc-color-input vc-color-input--skeleton"
1967
+ }, wl = { class: "vc-color-input__field-container" }, Ol = { class: "vc-color-input__field" }, El = ["id", "placeholder", "disabled", "name", "autofocus", "aria-invalid", "aria-required", "aria-describedby", "aria-labelledby"], Ll = { class: "vc-color-input__color-container" }, Bl = ["aria-label"], Cl = ["value"], xl = ["aria-label"], Tl = {
1968
+ key: 0,
1969
+ class: "vc-color-input__loading"
1970
+ }, Rl = { key: 0 }, Ml = { key: 1 }, Al = /* @__PURE__ */ V({
1971
+ __name: "vc-color-input",
1972
+ props: {
1973
+ modelValue: {},
1974
+ placeholder: {},
1975
+ hint: {},
1976
+ clearable: { type: Boolean },
1977
+ loading: { type: Boolean },
1978
+ autofocus: { type: Boolean },
1979
+ size: { default: "default" },
1980
+ multilanguage: { type: Boolean },
1981
+ currentLanguage: {},
1982
+ label: {},
1983
+ tooltip: {},
1984
+ disabled: { type: Boolean },
1985
+ required: { type: Boolean },
1986
+ name: { default: "Field" },
1987
+ error: { type: Boolean },
1988
+ errorMessage: {}
1989
+ },
1990
+ emits: ["update:modelValue", "blur", "focus"],
1991
+ setup(e, { expose: t, emit: n }) {
1992
+ const a = Se(), o = e, i = n, {
1993
+ fieldId: l,
1994
+ labelId: s,
1995
+ errorId: u,
1996
+ hintId: f,
1997
+ invalid: m,
1998
+ resolvedDisabled: g,
1999
+ ariaRequired: d,
2000
+ ariaDescribedBy: c
2001
+ } = Ke(o), b = S(!1), h = S(!1), B = S(), p = S(), I = S(o.modelValue ?? ""), P = S("");
2002
+ function J(k) {
2003
+ if (!k || typeof k != "string") {
2004
+ P.value = "";
2005
+ return;
2006
+ }
2007
+ const R = k.trim();
2008
+ if (ea(R)) {
2009
+ P.value = yt(R);
2010
+ return;
2011
+ }
2012
+ const K = _n(R);
2013
+ K && (P.value = K);
2014
+ }
2015
+ H(
2016
+ () => o.modelValue,
2017
+ (k) => {
2018
+ h.value || (h.value = !0, I.value = k ?? "", he(() => {
2019
+ J(k ?? ""), h.value = !1;
2020
+ }));
2021
+ },
2022
+ { immediate: !0 }
2023
+ ), H(P, (k) => {
2024
+ k && p.value && (p.value.value = k);
2025
+ });
2026
+ function ae() {
2027
+ h.value || (h.value = !0, i("update:modelValue", I.value || null), he(() => {
2028
+ J(I.value), h.value = !1;
2029
+ }));
2030
+ }
2031
+ function ee(k) {
2032
+ const R = k.target;
2033
+ if (R?.value) {
2034
+ const K = yt(R.value);
2035
+ P.value = K, I.value = K, i("update:modelValue", K);
2036
+ }
2037
+ }
2038
+ function F() {
2039
+ p.value?.click();
2040
+ }
2041
+ function D() {
2042
+ I.value = "", P.value = "", i("update:modelValue", null);
2043
+ }
2044
+ function z(k) {
2045
+ b.value = !1, i("blur", k);
2046
+ }
2047
+ function W() {
2048
+ b.value = !0, i("focus");
2049
+ }
2050
+ function X() {
2051
+ B.value?.focus();
2052
+ }
2053
+ return t({ focus: X }), (k, R) => r(a) ? (v(), y("div", $l, [
2054
+ e.label ? (v(), N(r(le), {
2055
+ key: 0,
2056
+ variant: "block",
2057
+ width: 60 + (e.label?.length || 0) * 4,
2058
+ height: 11
2059
+ }, null, 8, ["width"])) : w("", !0),
2060
+ x(r(le), {
2061
+ variant: "block",
2062
+ width: "100%",
2063
+ height: 36
2064
+ })
2065
+ ])) : (v(), y("div", {
2066
+ key: 1,
2067
+ class: j(["vc-color-input", [
2068
+ {
2069
+ "vc-color-input--error": r(m),
2070
+ "vc-color-input--disabled": r(g),
2071
+ "vc-color-input--focused": b.value
2072
+ }
2073
+ ]])
2074
+ }, [
2075
+ e.label ? (v(), N(r(He), {
2076
+ key: 0,
2077
+ id: r(s),
2078
+ "html-for": r(l),
2079
+ class: "vc-color-input__label",
2080
+ required: e.required,
2081
+ multilanguage: e.multilanguage,
2082
+ "current-language": e.currentLanguage,
2083
+ error: r(m)
2084
+ }, ie({
2085
+ default: O(() => [
2086
+ L("span", null, T(e.label), 1)
2087
+ ]),
2088
+ _: 2
2089
+ }, [
2090
+ e.tooltip ? {
2091
+ name: "tooltip",
2092
+ fn: O(() => [
2093
+ Q(T(e.tooltip), 1)
2094
+ ]),
2095
+ key: "0"
2096
+ } : void 0
2097
+ ]), 1032, ["id", "html-for", "required", "multilanguage", "current-language", "error"])) : w("", !0),
2098
+ L("div", {
2099
+ class: j(["vc-color-input__field-wrapper", {
2100
+ "vc-color-input__field-wrapper--default": e.size === "default",
2101
+ "vc-color-input__field-wrapper--small": e.size === "small"
2102
+ }])
2103
+ }, [
2104
+ L("div", wl, [
2105
+ L("div", Ol, [
2106
+ rt(L("input", {
2107
+ id: r(l),
2108
+ ref_key: "inputRef",
2109
+ ref: B,
2110
+ "onUpdate:modelValue": R[0] || (R[0] = (K) => I.value = K),
2111
+ placeholder: e.placeholder,
2112
+ type: "text",
2113
+ disabled: r(g),
2114
+ name: e.name,
2115
+ autofocus: e.autofocus,
2116
+ "aria-invalid": r(m) || void 0,
2117
+ "aria-required": r(d),
2118
+ "aria-describedby": r(c),
2119
+ "aria-labelledby": e.label ? r(s) : void 0,
2120
+ class: "vc-color-input__input",
2121
+ tabindex: "0",
2122
+ onBlur: z,
2123
+ onFocus: W,
2124
+ onInput: ae
2125
+ }, null, 40, El), [
2126
+ [sn, I.value]
2127
+ ]),
2128
+ L("div", Ll, [
2129
+ L("button", {
2130
+ type: "button",
2131
+ class: "vc-color-input__color-square",
2132
+ style: Me({ backgroundColor: P.value || "#ffffff" }),
2133
+ "aria-label": `Pick color${P.value ? ": " + P.value : ""}`,
2134
+ onClick: F
2135
+ }, null, 12, Bl),
2136
+ L("input", {
2137
+ ref_key: "colorPickerRef",
2138
+ ref: p,
2139
+ type: "color",
2140
+ value: P.value,
2141
+ class: "vc-color-input__color-picker-hidden",
2142
+ tabindex: "-1",
2143
+ "aria-hidden": "true",
2144
+ onChange: ee
2145
+ }, null, 40, Cl)
2146
+ ]),
2147
+ e.clearable && I.value && !e.disabled ? (v(), y("button", {
2148
+ key: 0,
2149
+ type: "button",
2150
+ class: "vc-color-input__clear",
2151
+ "aria-label": k.$t("COMPONENTS.MOLECULES.VC_COLOR_INPUT.CLEAR"),
2152
+ onClick: D
2153
+ }, [
2154
+ x(r(U), {
2155
+ size: "xs",
2156
+ icon: "lucide-x"
2157
+ })
2158
+ ], 8, xl)) : w("", !0)
2159
+ ]),
2160
+ e.loading ? (v(), y("div", Tl, [
2161
+ x(r(U), {
2162
+ icon: "lucide-loader-2",
2163
+ class: "vc-color-input__loading-icon",
2164
+ size: "m"
2165
+ })
2166
+ ])) : w("", !0)
2167
+ ])
2168
+ ], 2),
2169
+ x(Ae, {
2170
+ name: "slide-up",
2171
+ mode: "out-in"
2172
+ }, {
2173
+ default: O(() => [
2174
+ r(m) && e.errorMessage ? (v(), y("div", Rl, [
2175
+ x(r(fe), {
2176
+ id: r(u),
2177
+ class: "vc-color-input__hint-error",
2178
+ error: !0
2179
+ }, {
2180
+ default: O(() => [
2181
+ Q(T(e.errorMessage), 1)
2182
+ ]),
2183
+ _: 1
2184
+ }, 8, ["id"])
2185
+ ])) : (v(), y("div", Ml, [
2186
+ e.hint ? (v(), N(r(fe), {
2187
+ key: 0,
2188
+ id: r(f),
2189
+ class: "vc-color-input__desc"
2190
+ }, {
2191
+ default: O(() => [
2192
+ Q(T(e.hint), 1)
2193
+ ]),
2194
+ _: 1
2195
+ }, 8, ["id"])) : w("", !0)
2196
+ ]))
2197
+ ]),
2198
+ _: 1
2199
+ })
2200
+ ], 2));
2201
+ }
2202
+ }), Nl = { class: "vc-input__container" }, Dl = {
2203
+ key: 0,
2204
+ class: "vc-input__prepend"
2205
+ }, Vl = { class: "vc-input__field-container" }, Pl = {
2206
+ key: 0,
2207
+ class: "vc-input__prepend-inner"
2208
+ }, Fl = { class: "vc-input__field" }, zl = {
2209
+ key: 0,
2210
+ class: "vc-input__prefix"
2211
+ }, ql = ["id", "placeholder", "type", "disabled", "name", "maxlength", "autofocus", "autocomplete", "aria-invalid", "aria-required", "aria-describedby", "aria-labelledby"], Ul = {
2212
+ key: 1,
2213
+ class: "vc-input__suffix"
2214
+ }, Kl = ["aria-label"], Wl = ["aria-label"], jl = {
2215
+ key: 1,
2216
+ class: "vc-input__append-inner"
2217
+ }, Hl = {
2218
+ key: 2,
2219
+ class: "vc-input__loading"
2220
+ }, Gl = {
2221
+ key: 1,
2222
+ class: "vc-input__append"
2223
+ }, Yl = { key: 0 }, Jl = { key: 1 }, gt = /* @__PURE__ */ V({
2224
+ inheritAttrs: !1,
2225
+ __name: "vc-input",
2226
+ props: {
2227
+ modelValue: {},
2228
+ type: { default: "text" },
2229
+ prefix: {},
2230
+ suffix: {},
2231
+ debounce: {},
2232
+ maxlength: { default: "1024" },
2233
+ step: { default: "1" },
2234
+ autocomplete: {},
2235
+ datePickerOptions: {},
2236
+ placeholder: {},
2237
+ hint: {},
2238
+ clearable: { type: Boolean },
2239
+ loading: { type: Boolean },
2240
+ autofocus: { type: Boolean },
2241
+ size: { default: "default" },
2242
+ multilanguage: { type: Boolean },
2243
+ currentLanguage: {},
2244
+ label: {},
2245
+ tooltip: {},
2246
+ disabled: { type: Boolean },
2247
+ required: { type: Boolean },
2248
+ name: { default: "Field" },
2249
+ error: { type: Boolean },
2250
+ errorMessage: {}
2251
+ },
2252
+ emits: ["update:modelValue", "blur", "focus"],
2253
+ setup(e, { emit: t }) {
2254
+ const n = e, a = wt(), o = $(() => {
2255
+ const { class: E, ...q } = a;
2256
+ return q;
2257
+ }), i = t, l = Se(), {
2258
+ fieldId: s,
2259
+ labelId: u,
2260
+ errorId: f,
2261
+ hintId: m,
2262
+ invalid: g,
2263
+ resolvedDisabled: d,
2264
+ resolvedName: c,
2265
+ ariaRequired: b,
2266
+ ariaDescribedBy: h
2267
+ } = Ke(n);
2268
+ let B, p;
2269
+ const I = S(), P = S(), J = S(r(n.type)), ae = S(!1), ee = S(), F = $({
2270
+ get() {
2271
+ return J.value === "integer" ? "number" : J.value;
2272
+ },
2273
+ set(E) {
2274
+ J.value = E;
2275
+ }
2276
+ }), D = $(() => r(n.modelValue)), z = $({
2277
+ get() {
2278
+ return (n.type === "integer" || n.type === "number") && isNaN(I.value) ? "" : I.value;
2279
+ },
2280
+ set(E) {
2281
+ (n.type === "number" || n.type === "integer") && E < 0 ? I.value = Math.abs(E) : I.value = E, X(I.value);
2282
+ }
2283
+ });
2284
+ H(
2285
+ D,
2286
+ (E) => {
2287
+ n.type === "number" && E !== null ? ee.value = parseFloat(E) : n.type === "integer" && E !== null ? ee.value = Math.trunc(E) : ee.value = E, I.value !== ee.value && (I.value = ee.value);
2288
+ },
2289
+ { immediate: !0 }
2290
+ );
2291
+ function W(E) {
2292
+ const q = ["Backspace", "Delete", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], A = E.key;
2293
+ if ((n.type === "number" || n.type === "integer") && (A === "-" || A === "e" || A === "+") && E.preventDefault(), n.type === "integer" && !/^\d$/.test(A) && !q.includes(A)) {
2294
+ E.preventDefault();
2295
+ return;
2296
+ }
2297
+ }
2298
+ function X(E) {
2299
+ k(E);
2300
+ }
2301
+ function k(E) {
2302
+ p = () => {
2303
+ if (ee.value !== E) {
2304
+ let q;
2305
+ n.type === "number" && E !== null && E !== void 0 ? q = E !== "" ? parseFloat(E) : null : n.type === "integer" && E !== null && E !== void 0 ? q = E !== "" ? Math.trunc(parseInt(E)) : null : q = E, i("update:modelValue", q);
2306
+ }
2307
+ p = void 0;
2308
+ }, n.debounce !== void 0 ? (clearTimeout(B), B = setTimeout(p, +n.debounce)) : p();
2309
+ }
2310
+ function R() {
2311
+ I.value = null, i("update:modelValue", null);
2312
+ }
2313
+ function K(E) {
2314
+ ae.value = !1, i("blur", E);
2315
+ }
2316
+ function te() {
2317
+ P.value?.focus();
2318
+ }
2319
+ function Ve() {
2320
+ ae.value = !0, i("focus");
2321
+ }
2322
+ return (E, q) => r(l) ? (v(), y("div", ne({ key: 0 }, o.value, {
2323
+ class: ["vc-input vc-input--skeleton", E.$attrs.class]
2324
+ }), [
2325
+ e.label ? (v(), N(r(le), {
2326
+ key: 0,
2327
+ variant: "block",
2328
+ width: 60 + (e.label?.length || 0) * 4,
2329
+ height: 11
2330
+ }, null, 8, ["width"])) : w("", !0),
2331
+ x(r(le), {
2332
+ variant: "block",
2333
+ width: "100%",
2334
+ height: 36
2335
+ })
2336
+ ], 16)) : e.type === "date" || e.type === "datetime-local" ? (v(), N(r(Sl), ne({ key: 1 }, r(a), {
2337
+ "model-value": e.modelValue,
2338
+ type: e.type,
2339
+ "date-picker-options": e.datePickerOptions,
2340
+ label: e.label,
2341
+ placeholder: e.placeholder,
2342
+ hint: e.hint,
2343
+ disabled: e.disabled,
2344
+ error: e.error,
2345
+ "error-message": e.errorMessage,
2346
+ required: e.required,
2347
+ clearable: e.clearable,
2348
+ loading: e.loading,
2349
+ autofocus: e.autofocus,
2350
+ size: e.size,
2351
+ tooltip: e.tooltip,
2352
+ multilanguage: e.multilanguage,
2353
+ "current-language": e.currentLanguage,
2354
+ name: e.name,
2355
+ "onUpdate:modelValue": q[0] || (q[0] = (A) => i("update:modelValue", A ?? null)),
2356
+ onBlur: q[1] || (q[1] = (A) => i("blur", A)),
2357
+ onFocus: q[2] || (q[2] = (A) => i("focus"))
2358
+ }), null, 16, ["model-value", "type", "date-picker-options", "label", "placeholder", "hint", "disabled", "error", "error-message", "required", "clearable", "loading", "autofocus", "size", "tooltip", "multilanguage", "current-language", "name"])) : e.type === "color" ? (v(), N(r(Al), ne({ key: 2 }, r(a), {
2359
+ "model-value": e.modelValue ?? null,
2360
+ label: e.label,
2361
+ placeholder: e.placeholder,
2362
+ hint: e.hint,
2363
+ disabled: e.disabled,
2364
+ error: e.error,
2365
+ "error-message": e.errorMessage,
2366
+ required: e.required,
2367
+ clearable: e.clearable,
2368
+ loading: e.loading,
2369
+ autofocus: e.autofocus,
2370
+ size: e.size,
2371
+ tooltip: e.tooltip,
2372
+ multilanguage: e.multilanguage,
2373
+ "current-language": e.currentLanguage,
2374
+ name: e.name,
2375
+ "onUpdate:modelValue": q[3] || (q[3] = (A) => i("update:modelValue", A)),
2376
+ onBlur: q[4] || (q[4] = (A) => i("blur", A)),
2377
+ onFocus: q[5] || (q[5] = (A) => i("focus"))
2378
+ }), null, 16, ["model-value", "label", "placeholder", "hint", "disabled", "error", "error-message", "required", "clearable", "loading", "autofocus", "size", "tooltip", "multilanguage", "current-language", "name"])) : (v(), y("div", ne({ key: 3 }, o.value, {
2379
+ class: ["vc-input", [
2380
+ E.$attrs.class,
2381
+ `vc-input--${e.type}`,
2382
+ {
2383
+ "vc-input--clearable": e.clearable,
2384
+ "vc-input--error": r(g),
2385
+ "vc-input--disabled": r(d),
2386
+ "vc-input--focused": ae.value
2387
+ }
2388
+ ]]
2389
+ }), [
2390
+ e.label ? (v(), N(r(He), {
2391
+ key: 0,
2392
+ id: r(u),
2393
+ "html-for": r(s),
2394
+ class: "vc-input__label",
2395
+ required: e.required,
2396
+ multilanguage: e.multilanguage,
2397
+ "current-language": e.currentLanguage,
2398
+ error: r(g)
2399
+ }, ie({
2400
+ default: O(() => [
2401
+ L("span", null, T(e.label), 1)
2402
+ ]),
2403
+ _: 2
2404
+ }, [
2405
+ e.tooltip ? {
2406
+ name: "tooltip",
2407
+ fn: O(() => [
2408
+ Q(T(e.tooltip), 1)
2409
+ ]),
2410
+ key: "0"
2411
+ } : void 0
2412
+ ]), 1032, ["id", "html-for", "required", "multilanguage", "current-language", "error"])) : w("", !0),
2413
+ L("div", Nl, [
2414
+ E.$slots.prepend ? (v(), y("div", Dl, [
2415
+ C(E.$slots, "prepend", { focus: te })
2416
+ ])) : w("", !0),
2417
+ L("div", {
2418
+ class: j(["vc-input__field-wrapper", {
2419
+ "vc-input__field-wrapper--default": e.size === "default",
2420
+ "vc-input__field-wrapper--small": e.size === "small"
2421
+ }])
2422
+ }, [
2423
+ L("div", Vl, [
2424
+ E.$slots["prepend-inner"] ? (v(), y("div", Pl, [
2425
+ C(E.$slots, "prepend-inner", { focus: te })
2426
+ ])) : w("", !0),
2427
+ L("div", Fl, [
2428
+ e.prefix ? (v(), y("div", zl, T(e.prefix), 1)) : w("", !0),
2429
+ C(E.$slots, "control", {
2430
+ editable: r(d),
2431
+ focused: e.autofocus,
2432
+ modelValue: z.value,
2433
+ emitValue: k,
2434
+ placeholder: e.placeholder
2435
+ }, () => [
2436
+ rt(L("input", {
2437
+ id: r(s),
2438
+ ref_key: "inputRef",
2439
+ ref: P,
2440
+ "onUpdate:modelValue": q[6] || (q[6] = (A) => z.value = A),
2441
+ placeholder: e.placeholder,
2442
+ type: F.value,
2443
+ disabled: r(d),
2444
+ name: r(c),
2445
+ maxlength: e.maxlength,
2446
+ autofocus: e.autofocus,
2447
+ autocomplete: e.autocomplete,
2448
+ "aria-invalid": r(g) || void 0,
2449
+ "aria-required": r(b),
2450
+ "aria-describedby": r(h),
2451
+ "aria-labelledby": e.label ? r(u) : void 0,
2452
+ class: "vc-input__input",
2453
+ tabindex: "0",
2454
+ onKeydown: W,
2455
+ onBlur: K,
2456
+ onFocus: Ve
2457
+ }, null, 40, ql), [
2458
+ [un, z.value]
2459
+ ])
2460
+ ]),
2461
+ e.suffix ? (v(), y("div", Ul, T(e.suffix), 1)) : w("", !0),
2462
+ e.clearable && ee.value && !r(d) && e.type !== "password" ? (v(), y("button", {
2463
+ key: 2,
2464
+ type: "button",
2465
+ class: "vc-input__clear",
2466
+ "aria-label": E.$t("COMPONENTS.CONTROLS.CLEAR"),
2467
+ onClick: R
2468
+ }, [
2469
+ x(r(U), {
2470
+ size: "xs",
2471
+ icon: "lucide-x"
2472
+ })
2473
+ ], 8, Kl)) : w("", !0),
2474
+ e.type === "password" ? (v(), y("button", {
2475
+ key: 3,
2476
+ type: "button",
2477
+ class: "vc-input__showhide",
2478
+ "aria-label": J.value === "password" ? E.$t("COMPONENTS.CONTROLS.SHOW_PASSWORD") : E.$t("COMPONENTS.CONTROLS.HIDE_PASSWORD"),
2479
+ onClick: q[7] || (q[7] = (A) => J.value = J.value === "password" ? "text" : "password")
2480
+ }, [
2481
+ x(r(U), {
2482
+ size: "s",
2483
+ icon: J.value === "password" ? "lucide-eye-off" : "lucide-eye"
2484
+ }, null, 8, ["icon"])
2485
+ ], 8, Wl)) : w("", !0)
2486
+ ]),
2487
+ E.$slots["append-inner"] ? (v(), y("div", jl, [
2488
+ C(E.$slots, "append-inner", { focus: te })
2489
+ ])) : w("", !0),
2490
+ e.loading ? (v(), y("div", Hl, [
2491
+ x(r(U), {
2492
+ icon: "lucide-loader-2",
2493
+ class: "vc-input__loading-icon",
2494
+ size: "m"
2495
+ })
2496
+ ])) : w("", !0)
2497
+ ])
2498
+ ], 2),
2499
+ E.$slots.append ? (v(), y("div", Gl, [
2500
+ C(E.$slots, "append", { focus: te })
2501
+ ])) : w("", !0)
2502
+ ]),
2503
+ x(Ae, {
2504
+ name: "slide-up",
2505
+ mode: "out-in"
2506
+ }, {
2507
+ default: O(() => [
2508
+ r(g) && e.errorMessage ? (v(), y("div", Yl, [
2509
+ C(E.$slots, "error", {}, () => [
2510
+ x(r(fe), {
2511
+ id: r(f),
2512
+ class: "vc-input__hint-error",
2513
+ error: !0
2514
+ }, {
2515
+ default: O(() => [
2516
+ Q(T(e.errorMessage), 1)
2517
+ ]),
2518
+ _: 1
2519
+ }, 8, ["id"])
2520
+ ])
2521
+ ])) : (v(), y("div", Jl, [
2522
+ C(E.$slots, "hint", {}, () => [
2523
+ e.hint ? (v(), N(r(fe), {
2524
+ key: 0,
2525
+ id: r(m),
2526
+ class: "vc-input__desc"
2527
+ }, {
2528
+ default: O(() => [
2529
+ Q(T(e.hint), 1)
2530
+ ]),
2531
+ _: 1
2532
+ }, 8, ["id"])) : w("", !0)
2533
+ ])
2534
+ ]))
2535
+ ]),
2536
+ _: 3
2537
+ })
2538
+ ], 16));
2539
+ }
2540
+ }), yr = Mn.create({
2541
+ name: "fontSize",
2542
+ addOptions() {
2543
+ return {
2544
+ types: ["textStyle"]
2545
+ };
2546
+ },
2547
+ addGlobalAttributes() {
2548
+ return [
2549
+ {
2550
+ types: this.options.types,
2551
+ attributes: {
2552
+ fontSize: {
2553
+ default: null,
2554
+ parseHTML: (e) => e.style.fontSize?.replace(/['"]+/g, ""),
2555
+ renderHTML: (e) => e.fontSize ? {
2556
+ style: `font-size: ${e.fontSize}`
2557
+ } : {}
2558
+ }
2559
+ }
2560
+ }
2561
+ ];
2562
+ },
2563
+ addCommands() {
2564
+ return {
2565
+ setFontSize: (e) => ({ chain: t }) => t().setMark("textStyle", { fontSize: e }).run(),
2566
+ unsetFontSize: () => ({ chain: e }) => e().setMark("textStyle", { fontSize: null }).run()
2567
+ };
2568
+ }
2569
+ });
2570
+ function Xl(e = {}) {
2571
+ const {
2572
+ containerSelector: t = '[role="menu"]',
2573
+ itemSelector: n = '[tabindex="0"]',
2574
+ onEnter: a,
2575
+ onEscape: o,
2576
+ loop: i = !0
2577
+ } = e, l = S(null), s = S(-1), u = (p) => {
2578
+ (s.value >= p.length || s.value < 0) && (s.value = p.length > 0 ? 0 : -1);
2579
+ }, f = (p) => {
2580
+ if (!l.value) return;
2581
+ const I = Array.from(l.value.querySelectorAll(n));
2582
+ if (I.length)
2583
+ switch (u(I), p.key) {
2584
+ case "Tab":
2585
+ m(p, I);
2586
+ break;
2587
+ case "ArrowDown":
2588
+ p.preventDefault(), g(I);
2589
+ break;
2590
+ case "ArrowUp":
2591
+ p.preventDefault(), d(I);
2592
+ break;
2593
+ case "Enter":
2594
+ case " ":
2595
+ if (s.value >= 0 && s.value < I.length) {
2596
+ const P = I[s.value];
2597
+ P && (p.preventDefault(), a ? a(P) : typeof P.click == "function" && P.click());
2598
+ }
2599
+ break;
2600
+ case "Escape":
2601
+ o && (p.preventDefault(), o());
2602
+ break;
2603
+ }
2604
+ }, m = (p, I) => {
2605
+ p.shiftKey ? d(I) : g(I);
2606
+ }, g = (p) => {
2607
+ if (!p.length) return;
2608
+ if (u(p), s.value < p.length - 1)
2609
+ s.value++;
2610
+ else if (i)
2611
+ s.value = 0;
2612
+ else
2613
+ return;
2614
+ const I = p[s.value];
2615
+ I && typeof I.focus == "function" && I.focus();
2616
+ }, d = (p) => {
2617
+ if (!p.length) return;
2618
+ if (u(p), s.value > 0)
2619
+ s.value--;
2620
+ else if (i)
2621
+ s.value = p.length - 1;
2622
+ else
2623
+ return;
2624
+ const I = p[s.value];
2625
+ I && typeof I.focus == "function" && I.focus();
2626
+ }, c = (p) => {
2627
+ if (!p.length) return;
2628
+ s.value = 0;
2629
+ const I = p[0];
2630
+ I && typeof I.focus == "function" && I.focus();
2631
+ }, b = (p) => {
2632
+ if (!p.length) return;
2633
+ s.value = p.length - 1;
2634
+ const I = p[p.length - 1];
2635
+ I && typeof I.focus == "function" && I.focus();
2636
+ }, h = (p) => {
2637
+ l.value && l.value.removeEventListener("keydown", f), l.value = p, p.addEventListener("keydown", f);
2638
+ }, B = () => {
2639
+ l.value && (l.value.removeEventListener("keydown", f), l.value = null);
2640
+ };
2641
+ return Ue(() => {
2642
+ if (typeof document < "u" && t) {
2643
+ const p = document.querySelector(t);
2644
+ p && h(p);
2645
+ }
2646
+ }), lt(() => {
2647
+ B();
2648
+ }), {
2649
+ initKeyboardNavigation: h,
2650
+ cleanupKeyboardNavigation: B,
2651
+ focusNextElement: () => {
2652
+ if (l.value) {
2653
+ const p = Array.from(l.value.querySelectorAll(n));
2654
+ g(p);
2655
+ }
2656
+ },
2657
+ focusPreviousElement: () => {
2658
+ if (l.value) {
2659
+ const p = Array.from(l.value.querySelectorAll(n));
2660
+ d(p);
2661
+ }
2662
+ },
2663
+ focusFirstElement: () => {
2664
+ if (l.value) {
2665
+ const p = Array.from(l.value.querySelectorAll(n));
2666
+ c(p);
2667
+ }
2668
+ },
2669
+ focusLastElement: () => {
2670
+ if (l.value) {
2671
+ const p = Array.from(l.value.querySelectorAll(n));
2672
+ b(p);
2673
+ }
2674
+ },
2675
+ setFocusedIndex: (p) => {
2676
+ if (l.value) {
2677
+ const I = Array.from(l.value.querySelectorAll(n));
2678
+ p >= 0 && p < I.length && (s.value = p);
2679
+ }
2680
+ },
2681
+ getFocusedIndex: () => s.value
2682
+ };
2683
+ }
2684
+ function St(e, t) {
2685
+ const n = e !== void 0 ? e : t;
2686
+ return typeof n == "function" ? n : (a) => a === null || typeof a != "object" ? a : n && n in a ? a[n] : a;
2687
+ }
2688
+ function Zl(e) {
2689
+ const t = $(() => St(e.optionValue(), "id")), n = $(() => St(e.optionLabel(), "title"));
2690
+ function a(l, s, u, f) {
2691
+ const m = (g) => Re(t.value(g), l);
2692
+ return u.find(m) || f.find(m) || s.find(m) || l;
2693
+ }
2694
+ function o(l) {
2695
+ return n.value(l);
2696
+ }
2697
+ function i(l) {
2698
+ return l != null && ("" + l).length > 0;
2699
+ }
2700
+ return {
2701
+ getOptionValue: t,
2702
+ getOptionLabel: n,
2703
+ getOption: a,
2704
+ getEmittingOptionValue: o,
2705
+ fieldValueIsFilled: i
2706
+ };
2707
+ }
2708
+ function Ql() {
2709
+ const e = S(null), t = S(!1);
2710
+ let n = null, a = null;
2711
+ function o() {
2712
+ if (e.value && !t.value) {
2713
+ const l = e.value.getBoundingClientRect();
2714
+ l.top < window.innerHeight && l.bottom > 0 && l.left < window.innerWidth && l.right > 0 && (t.value = !0);
2715
+ }
2716
+ }
2717
+ function i() {
2718
+ if (!t.value && e.value) {
2719
+ const l = e.value.getBoundingClientRect();
2720
+ l.top < window.innerHeight && l.bottom > 0 && l.left < window.innerWidth && l.right > 0 && (t.value = !0);
2721
+ }
2722
+ }
2723
+ return Ue(() => {
2724
+ e.value && (n = new IntersectionObserver(
2725
+ ([l]) => {
2726
+ t.value = l.isIntersecting;
2727
+ },
2728
+ { threshold: 0.1 }
2729
+ ), n.observe(e.value), a = setTimeout(o, 100));
2730
+ }), Ot(() => {
2731
+ a !== null && (clearTimeout(a), a = null), n && e.value && n.unobserve(e.value), n && n.disconnect();
2732
+ }), {
2733
+ selectRootRef: e,
2734
+ isSelectVisible: t,
2735
+ ensureVisibility: i
2736
+ };
2737
+ }
2738
+ function _l(e) {
2739
+ const t = S(!1), n = S(!1), a = S(null), o = S(null);
2740
+ function i() {
2741
+ return {
2742
+ name: "sameWidth",
2743
+ fn({ rects: f }) {
2744
+ return {
2745
+ data: {
2746
+ width: e.outline() ? `${f.reference.width}px` : "max-content"
2747
+ }
2748
+ };
2749
+ }
2750
+ };
2751
+ }
2752
+ const l = ia(a, o, {
2753
+ placement: $(() => e.placement),
2754
+ middleware: $(() => [
2755
+ Tt({ fallbackPlacements: ["top", "bottom"] }),
2756
+ Rt({ mainAxis: !1 }),
2757
+ i(),
2758
+ tt({ mainAxis: 4 })
2759
+ ])
2760
+ }), s = $(() => ({
2761
+ top: `${l.y.value ?? 0}px`,
2762
+ left: `${l.x.value ?? 0}px`,
2763
+ width: l.middlewareData.value.sameWidth?.width
2764
+ }));
2765
+ H(
2766
+ () => l.isPositioned.value,
2767
+ (f) => {
2768
+ f && l.update();
2769
+ }
2770
+ );
2771
+ function u() {
2772
+ e.disabled() || (!t.value && !e.isSelectVisible.value && e.ensureVisibility(), t.value = !t.value);
2773
+ }
2774
+ return {
2775
+ isOpened: t,
2776
+ isFocused: n,
2777
+ dropdownToggleRef: a,
2778
+ dropdownRef: o,
2779
+ popper: l,
2780
+ dropdownStyle: s,
2781
+ toggleDropdown: u
2782
+ };
2783
+ }
2784
+ function eo(e) {
2785
+ const t = S([]), n = S(null), a = S(0), o = S(!1), i = S(!1), l = S(), s = S([]), u = S(!1), f = /* @__PURE__ */ new Map();
2786
+ let m = !1, g;
2787
+ const d = $(() => n.value ?? t.value), c = $(() => t.value.length < a.value);
2788
+ function b(F) {
2789
+ for (const D of F) {
2790
+ const z = String(e.getOptionValue.value(D));
2791
+ f.set(z, D);
2792
+ }
2793
+ }
2794
+ async function h() {
2795
+ if (m)
2796
+ return;
2797
+ const F = e.options();
2798
+ if (typeof F == "function")
2799
+ try {
2800
+ o.value = !0;
2801
+ const D = await F(void 0, 0);
2802
+ t.value = D?.results ?? [], a.value = D?.totalCount ?? 0, b(t.value), m = !0;
2803
+ } catch (D) {
2804
+ console.error("useSelectDataSource: error loading options", D), t.value = [], a.value = 0;
2805
+ } finally {
2806
+ o.value = !1;
2807
+ }
2808
+ else Array.isArray(F) && (t.value = [...F], a.value = t.value.length, b(t.value), m = !0);
2809
+ }
2810
+ function B() {
2811
+ n.value = null, l.value = void 0, g && (clearTimeout(g), g = void 0);
2812
+ }
2813
+ async function p() {
2814
+ const F = e.options();
2815
+ if (!(typeof F != "function" || o.value))
2816
+ try {
2817
+ o.value = !0;
2818
+ const D = await F(l.value, t.value.length), z = new Set(t.value.map((X) => String(e.getOptionValue.value(X)))), W = (D?.results ?? []).filter(
2819
+ (X) => !z.has(String(e.getOptionValue.value(X)))
2820
+ );
2821
+ t.value = [...t.value, ...W], a.value = D?.totalCount ?? a.value, b(W);
2822
+ } catch (D) {
2823
+ console.error("useSelectDataSource: error loading more", D);
2824
+ } finally {
2825
+ o.value = !1;
2826
+ }
2827
+ }
2828
+ async function I(F) {
2829
+ l.value = F;
2830
+ const D = e.options();
2831
+ if (typeof D == "function")
2832
+ try {
2833
+ i.value = !0;
2834
+ const z = await D(F);
2835
+ n.value = z?.results ?? [], a.value = z?.totalCount ?? 0, b(n.value);
2836
+ } catch (z) {
2837
+ console.error("useSelectDataSource: error searching", z), n.value = [];
2838
+ } finally {
2839
+ i.value = !1;
2840
+ }
2841
+ else
2842
+ n.value = t.value.filter((z) => {
2843
+ const W = e.getOptionLabel.value(z);
2844
+ return String(W).toLowerCase().includes(F.toLowerCase());
2845
+ });
2846
+ }
2847
+ function P(F) {
2848
+ if (!F?.target) return;
2849
+ const D = F.target.value, z = Number(e.debounce());
2850
+ g && clearTimeout(g), z > 0 ? g = setTimeout(() => {
2851
+ e.emit.search(D), I(D);
2852
+ }, z) : (e.emit.search(D), I(D));
2853
+ }
2854
+ function J() {
2855
+ n.value = null, l.value = void 0, g && (clearTimeout(g), g = void 0), a.value = t.value.length;
2856
+ }
2857
+ async function ae(F) {
2858
+ if (F.length === 0) return [];
2859
+ const z = F.filter((k) => !f.has(String(k))).filter((k) => {
2860
+ const R = t.value.find((K) => Re(e.getOptionValue.value(K), k));
2861
+ return R ? (f.set(String(k), R), !1) : !0;
2862
+ }), W = e.options();
2863
+ if (z.length > 0 && typeof W == "function") {
2864
+ try {
2865
+ u.value = !0;
2866
+ const R = await W(void 0, void 0, z);
2867
+ R?.results && b(R.results);
2868
+ } catch (R) {
2869
+ console.error("useSelectDataSource: error resolving", R);
2870
+ } finally {
2871
+ u.value = !1;
2872
+ }
2873
+ z.filter((R) => !f.has(String(R))).length > 0 && !m && await h();
2874
+ } else if (z.length > 0 && Array.isArray(W))
2875
+ for (const k of W) {
2876
+ const R = String(e.getOptionValue.value(k));
2877
+ z.includes(R) && f.set(R, k);
2878
+ }
2879
+ const X = F.map((k) => f.get(String(k))).filter(Boolean);
2880
+ return s.value = X, X;
2881
+ }
2882
+ async function ee() {
2883
+ t.value = [], n.value = null, a.value = 0, f.clear(), s.value = [], m = !1, await h();
2884
+ }
2885
+ return H(
2886
+ e.options,
2887
+ async () => {
2888
+ t.value = [], n.value = null, a.value = 0, f.clear(), m = !1;
2889
+ const F = e.options();
2890
+ if (Array.isArray(F) && (t.value = [...F], a.value = t.value.length, b(t.value), m = !0, s.value.length === 0)) {
2891
+ const D = s.value;
2892
+ (D.length === 0 ? t.value.filter((W) => {
2893
+ const X = String(e.getOptionValue.value(W));
2894
+ return f.has(X);
2895
+ }) : D).length;
2896
+ }
2897
+ },
2898
+ { deep: !1 }
2899
+ ), {
2900
+ displayItems: d,
2901
+ loading: o,
2902
+ searchLoading: i,
2903
+ hasMore: c,
2904
+ filterString: l,
2905
+ resolvedDefaults: s,
2906
+ defaultOptionLoading: u,
2907
+ cachedItems: t,
2908
+ open: h,
2909
+ close: B,
2910
+ onInput: P,
2911
+ clearSearch: J,
2912
+ loadMore: p,
2913
+ resolve: ae,
2914
+ refresh: ee
2915
+ };
2916
+ }
2917
+ function to(e) {
2918
+ let t = [];
2919
+ const n = $(() => {
2920
+ const g = e.mapOptions() === !0 && e.multiple() !== !0, d = e.modelValue() !== void 0 && (e.modelValue() !== null || g === !0) ? e.multiple() === !0 && Array.isArray(e.modelValue()) ? e.modelValue() : [e.modelValue()] : [];
2921
+ if (e.mapOptions() === !0 && Array.isArray(e.displayItems.value) === !0) {
2922
+ const c = e.mapOptions() === !0 && t !== void 0 ? t : [], b = d.map((h) => {
2923
+ const B = e.getOption(h, c, e.resolvedDefaults.value, e.displayItems.value);
2924
+ if (B === h && e.cachedItems.value.length > 0) {
2925
+ const p = e.getOption(h, c, e.resolvedDefaults.value, e.cachedItems.value);
2926
+ if (p !== h) return p;
2927
+ }
2928
+ return B;
2929
+ });
2930
+ return e.modelValue() === null && g === !0 ? b.filter((h) => h !== null) : b;
2931
+ }
2932
+ return d;
2933
+ });
2934
+ H(
2935
+ n,
2936
+ (g) => {
2937
+ t = g;
2938
+ },
2939
+ { immediate: !0 }
2940
+ );
2941
+ const a = $(() => n.value.map((g) => e.getOptionValue.value(g)));
2942
+ function o(g) {
2943
+ const d = e.getOptionValue.value(g);
2944
+ return a.value.find((c) => Re(c, d)) !== void 0;
2945
+ }
2946
+ const i = $(
2947
+ () => n.value.map((g, d) => ({
2948
+ index: d,
2949
+ opt: g,
2950
+ selected: !0,
2951
+ toggleOption: u,
2952
+ removeAtIndex: f
2953
+ }))
2954
+ ), l = $(() => e.fieldValueIsFilled(n.value)), s = $(() => e.displayItems.value.map((g, d) => ({
2955
+ index: d,
2956
+ opt: g,
2957
+ selected: o(g) === !0,
2958
+ label: e.getOptionLabel.value(g),
2959
+ toggleOption: u
2960
+ })));
2961
+ function u(g) {
2962
+ if (g === void 0)
2963
+ return;
2964
+ const d = e.getOptionValue.value(g);
2965
+ if (e.multiple() !== !0) {
2966
+ (n.value.length === 0 || Re(e.getOptionValue.value(n.value[0]), d) !== !0) && e.emit.updateModelValue(e.emitValue() === !0 ? d : g), e.isOpened.value = !1, e.emit.close();
2967
+ return;
2968
+ }
2969
+ if (n.value.length === 0) {
2970
+ const h = e.emitValue() === !0 ? d : g;
2971
+ e.emit.updateModelValue(e.multiple() === !0 ? [h] : h);
2972
+ return;
2973
+ }
2974
+ const c = e.modelValue().slice(), b = a.value.findIndex((h) => Re(h, d));
2975
+ if (b > -1)
2976
+ c.splice(b, 1);
2977
+ else {
2978
+ const h = e.emitValue() === !0 ? d : g;
2979
+ c.push(h);
2980
+ }
2981
+ e.emit.updateModelValue(c), e.isOpened.value && e.popperUpdate();
2982
+ }
2983
+ function f(g) {
2984
+ if (g > -1 && g < n.value.length)
2985
+ if (e.multiple() === !0) {
2986
+ const d = e.modelValue().slice();
2987
+ d.splice(g, 1), e.emit.updateModelValue(d);
2988
+ } else
2989
+ e.emit.updateModelValue(null);
2990
+ }
2991
+ function m() {
2992
+ if (e.multiple()) {
2993
+ e.emit.updateModelValue([]);
2994
+ return;
2995
+ }
2996
+ e.emit.updateModelValue(null);
2997
+ }
2998
+ return {
2999
+ innerValue: n,
3000
+ selectedScope: i,
3001
+ hasValue: l,
3002
+ innerOptionsValue: a,
3003
+ optionScope: s,
3004
+ toggleOption: u,
3005
+ removeAtIndex: f,
3006
+ isOptionSelected: o,
3007
+ onReset: m
3008
+ };
3009
+ }
3010
+ const no = { class: "vc-select__control" }, ao = {
3011
+ key: 0,
3012
+ class: "vc-select__prepend"
3013
+ }, lo = { class: "vc-select__field" }, oo = { class: "vc-select__field-inner" }, io = { class: "vc-select__field-content" }, ro = {
3014
+ key: 0,
3015
+ class: "vc-select__prepend-inner"
3016
+ }, so = { class: "vc-select__field-main" }, uo = {
3017
+ key: 0,
3018
+ class: "vc-select__prefix"
3019
+ }, co = ["aria-expanded", "aria-controls", "aria-labelledby", "aria-describedby", "aria-required", "aria-invalid"], fo = {
3020
+ key: 0,
3021
+ class: "vc-select__placeholder"
3022
+ }, vo = {
3023
+ key: 1,
3024
+ class: "vc-select__selected"
3025
+ }, go = { class: "vc-select__multiple-item" }, mo = {
3026
+ key: 0,
3027
+ class: "vc-select__loading"
3028
+ }, po = { key: 1 }, bo = ["aria-label", "onClick", "onKeydown"], yo = {
3029
+ key: 0,
3030
+ class: "vc-select__loading"
3031
+ }, ho = {
3032
+ key: 1,
3033
+ class: "vc-select__suffix"
3034
+ }, ko = ["aria-label"], Io = {
3035
+ key: 1,
3036
+ class: "vc-select__append-inner"
3037
+ }, So = {
3038
+ key: 2,
3039
+ class: "vc-select__loading-icon"
3040
+ }, $o = ["aria-label"], wo = { class: "vc-select__chevron" }, Oo = { class: "vc-select__hint-error" }, Eo = { key: 0 }, Lo = { key: 1 }, Bo = {
3041
+ key: 1,
3042
+ class: "vc-select__append"
3043
+ }, Co = /* @__PURE__ */ V({
3044
+ __name: "SelectTrigger",
3045
+ props: {
3046
+ isOpened: { type: Boolean },
3047
+ hasValue: { type: Boolean },
3048
+ selectedScope: {},
3049
+ multiple: { type: Boolean },
3050
+ loading: { type: Boolean },
3051
+ disabled: { type: Boolean },
3052
+ clearable: { type: Boolean },
3053
+ placeholder: {},
3054
+ prefix: {},
3055
+ suffix: {},
3056
+ size: {},
3057
+ error: { type: Boolean },
3058
+ errorMessage: {},
3059
+ hint: {},
3060
+ listLoading: { type: Boolean },
3061
+ defaultOptionLoading: { type: Boolean },
3062
+ listboxId: {},
3063
+ labelId: {},
3064
+ label: {},
3065
+ ariaDescribedBy: {},
3066
+ ariaRequired: { type: Boolean },
3067
+ errorId: {},
3068
+ hintId: {},
3069
+ toggleDropdown: { type: Function },
3070
+ getOptionLabel: { type: Function },
3071
+ getEmittingOptionValue: { type: Function }
3072
+ },
3073
+ emits: ["focus", "blur", "reset", "removeAtIndex"],
3074
+ setup(e, { expose: t }) {
3075
+ const { t: n } = Ie({ useScope: "global" }), a = S(null);
3076
+ return t({
3077
+ toggleRef: a
3078
+ }), (o, i) => (v(), y("div", {
3079
+ ref_key: "toggleRef",
3080
+ ref: a,
3081
+ class: "vc-select__dropdown-toggle"
3082
+ }, [
3083
+ C(o.$slots, "control", {
3084
+ toggleHandler: e.toggleDropdown,
3085
+ isOpened: e.isOpened
3086
+ }, () => [
3087
+ L("div", no, [
3088
+ o.$slots.prepend ? (v(), y("div", ao, [
3089
+ C(o.$slots, "prepend")
3090
+ ])) : w("", !0),
3091
+ L("div", {
3092
+ class: j(["vc-select__field-wrapper", {
3093
+ "vc-select__field-wrapper--default": e.size === "default",
3094
+ "vc-select__field-wrapper--small": e.size === "small"
3095
+ }])
3096
+ }, [
3097
+ L("div", lo, [
3098
+ L("div", oo, [
3099
+ L("div", io, [
3100
+ o.$slots["prepend-inner"] ? (v(), y("div", ro, [
3101
+ C(o.$slots, "prepend-inner")
3102
+ ])) : w("", !0),
3103
+ L("div", so, [
3104
+ e.prefix ? (v(), y("div", uo, T(e.prefix), 1)) : w("", !0),
3105
+ L("div", {
3106
+ "data-test-id": "dropdown-toggle",
3107
+ class: "vc-select__input",
3108
+ role: "combobox",
3109
+ tabindex: "0",
3110
+ "aria-expanded": e.isOpened,
3111
+ "aria-haspopup": "listbox",
3112
+ "aria-controls": e.isOpened ? e.listboxId : void 0,
3113
+ "aria-labelledby": e.label ? e.labelId : void 0,
3114
+ "aria-describedby": e.ariaDescribedBy,
3115
+ "aria-required": e.ariaRequired,
3116
+ "aria-invalid": e.error || void 0,
3117
+ onClick: i[0] || (i[0] = G(
3118
+ //@ts-ignore
3119
+ (...l) => e.toggleDropdown && e.toggleDropdown(...l),
3120
+ ["stop"]
3121
+ )),
3122
+ onKeydown: [
3123
+ i[1] || (i[1] = Z(G(
3124
+ //@ts-ignore
3125
+ (...l) => e.toggleDropdown && e.toggleDropdown(...l),
3126
+ ["stop"]
3127
+ ), ["enter"])),
3128
+ i[2] || (i[2] = Z(G(
3129
+ //@ts-ignore
3130
+ (...l) => e.toggleDropdown && e.toggleDropdown(...l),
3131
+ ["stop"]
3132
+ ), ["space"]))
3133
+ ],
3134
+ onFocus: i[3] || (i[3] = (l) => o.$emit("focus")),
3135
+ onBlur: i[4] || (i[4] = (l) => o.$emit("blur"))
3136
+ }, [
3137
+ e.hasValue ? e.selectedScope && e.selectedScope.length && e.hasValue ? (v(), y("div", vo, [
3138
+ (v(!0), y(we, null, ot(e.selectedScope, (l, s) => (v(), y("div", {
3139
+ key: s,
3140
+ class: "vc-select__selected-item"
3141
+ }, [
3142
+ e.multiple ? C(o.$slots, "selected-item", ne({
3143
+ key: 0,
3144
+ ref_for: !0
3145
+ }, l), () => [
3146
+ L("div", go, [
3147
+ e.loading ? (v(), y("span", mo, T(r(n)("COMPONENTS.MOLECULES.VC_SELECT.LOADING")), 1)) : (v(), y("span", po, T(e.getOptionLabel(l.opt)), 1)),
3148
+ e.disabled ? w("", !0) : (v(), y("button", {
3149
+ key: 2,
3150
+ type: "button",
3151
+ class: "vc-select__chip-remove",
3152
+ "aria-label": `Remove ${e.getOptionLabel(l.opt) || ""}`,
3153
+ tabindex: "0",
3154
+ onClick: G((u) => o.$emit("removeAtIndex", l.index), ["stop"]),
3155
+ onKeydown: Z(G((u) => o.$emit("removeAtIndex", l.index), ["stop", "prevent"]), ["enter"])
3156
+ }, [
3157
+ x(r(U), {
3158
+ class: "vc-select__icon-remove",
3159
+ icon: "lucide-x",
3160
+ size: "xs"
3161
+ })
3162
+ ], 40, bo))
3163
+ ])
3164
+ ]) : e.multiple ? w("", !0) : (v(), y(we, { key: 1 }, [
3165
+ e.loading ? (v(), y("span", yo, T(r(n)("COMPONENTS.MOLECULES.VC_SELECT.LOADING")), 1)) : C(o.$slots, "selected-item", ne({
3166
+ key: 1,
3167
+ ref_for: !0
3168
+ }, l), () => [
3169
+ Q(T(e.loading ? r(n)("COMPONENTS.MOLECULES.VC_SELECT.LOADING") : e.getEmittingOptionValue(l.opt)), 1)
3170
+ ])
3171
+ ], 64))
3172
+ ]))), 128))
3173
+ ])) : w("", !0) : (v(), y("div", fo, [
3174
+ e.placeholder ? (v(), y(we, { key: 0 }, [
3175
+ Q(T(e.placeholder), 1)
3176
+ ], 64)) : (v(), y(we, { key: 1 }, [
3177
+ Q(T(r(n)("COMPONENTS.MOLECULES.VC_SELECT.CLICK_TO_SELECT")), 1)
3178
+ ], 64))
3179
+ ]))
3180
+ ], 40, co),
3181
+ e.suffix ? (v(), y("div", ho, T(e.suffix), 1)) : w("", !0),
3182
+ e.clearable && e.hasValue && !e.disabled ? (v(), y("div", {
3183
+ key: 2,
3184
+ class: "vc-select__clear",
3185
+ role: "button",
3186
+ "aria-label": o.$t("COMPONENTS.CONTROLS.CLEAR_SELECTION"),
3187
+ tabindex: "0",
3188
+ onClick: i[5] || (i[5] = (l) => o.$emit("reset")),
3189
+ onKeydown: [
3190
+ i[6] || (i[6] = Z((l) => o.$emit("reset"), ["enter"])),
3191
+ i[7] || (i[7] = Z((l) => o.$emit("reset"), ["space"]))
3192
+ ]
3193
+ }, [
3194
+ x(r(U), {
3195
+ size: "xs",
3196
+ icon: "lucide-x"
3197
+ })
3198
+ ], 40, ko)) : w("", !0)
3199
+ ]),
3200
+ o.$slots["append-inner"] ? (v(), y("div", Io, [
3201
+ C(o.$slots, "append-inner")
3202
+ ])) : w("", !0),
3203
+ e.loading || e.listLoading || e.defaultOptionLoading ? (v(), y("div", So, [
3204
+ x(r(U), {
3205
+ icon: "lucide-loader-2",
3206
+ class: "tw-animate-spin",
3207
+ size: "m"
3208
+ })
3209
+ ])) : w("", !0),
3210
+ e.disabled ? w("", !0) : (v(), y("div", {
3211
+ key: 3,
3212
+ class: "vc-select__chevron-container",
3213
+ role: "button",
3214
+ "aria-label": o.$t("COMPONENTS.CONTROLS.TOGGLE_DROPDOWN"),
3215
+ tabindex: "0",
3216
+ onClick: i[8] || (i[8] = G(
3217
+ //@ts-ignore
3218
+ (...l) => e.toggleDropdown && e.toggleDropdown(...l),
3219
+ ["stop"]
3220
+ )),
3221
+ onKeydown: [
3222
+ i[9] || (i[9] = Z(G(
3223
+ //@ts-ignore
3224
+ (...l) => e.toggleDropdown && e.toggleDropdown(...l),
3225
+ ["stop"]
3226
+ ), ["enter"])),
3227
+ i[10] || (i[10] = Z(G(
3228
+ //@ts-ignore
3229
+ (...l) => e.toggleDropdown && e.toggleDropdown(...l),
3230
+ ["stop"]
3231
+ ), ["space"]))
3232
+ ]
3233
+ }, [
3234
+ L("div", wo, [
3235
+ x(r(U), {
3236
+ size: "s",
3237
+ icon: "lucide-chevron-down"
3238
+ })
3239
+ ])
3240
+ ], 40, $o))
3241
+ ])
3242
+ ])
3243
+ ]),
3244
+ L("div", Oo, [
3245
+ x(Ae, {
3246
+ name: "slide-up",
3247
+ mode: "out-in"
3248
+ }, {
3249
+ default: O(() => [
3250
+ e.error && e.errorMessage ? (v(), y("div", Eo, [
3251
+ C(o.$slots, "error", {}, () => [
3252
+ x(r(fe), {
3253
+ id: e.errorId,
3254
+ class: "vc-select__error-message",
3255
+ error: !0
3256
+ }, {
3257
+ default: O(() => [
3258
+ Q(T(e.errorMessage), 1)
3259
+ ]),
3260
+ _: 1
3261
+ }, 8, ["id"])
3262
+ ])
3263
+ ])) : (v(), y("div", Lo, [
3264
+ C(o.$slots, "hint", {}, () => [
3265
+ e.hint ? (v(), N(r(fe), {
3266
+ key: 0,
3267
+ id: e.hintId,
3268
+ class: "vc-select__hint"
3269
+ }, {
3270
+ default: O(() => [
3271
+ Q(T(e.hint), 1)
3272
+ ]),
3273
+ _: 1
3274
+ }, 8, ["id"])) : w("", !0)
3275
+ ])
3276
+ ]))
3277
+ ]),
3278
+ _: 3
3279
+ })
3280
+ ])
3281
+ ], 2),
3282
+ o.$slots.append ? (v(), y("div", Bo, [
3283
+ C(o.$slots, "append")
3284
+ ])) : w("", !0)
3285
+ ])
3286
+ ])
3287
+ ], 512));
3288
+ }
3289
+ }), xo = ["id", "aria-label"], To = ["aria-label"], Ro = ["aria-selected", "data-index", "onClick", "onKeydown"], Mo = {
3290
+ key: 0,
3291
+ class: "vc-select__check-icon"
3292
+ }, Ao = {
3293
+ key: 0,
3294
+ class: "vc-select__list-loading-indicator"
3295
+ }, No = { class: "tw-ml-1" }, Do = {
3296
+ key: 1,
3297
+ class: "vc-select__no-options"
3298
+ }, Vo = { class: "vc-select__no-options-text" }, Po = /* @__PURE__ */ V({
3299
+ __name: "SelectDropdown",
3300
+ props: {
3301
+ isOpened: { type: Boolean },
3302
+ listboxId: {},
3303
+ ariaLabel: {},
3304
+ dropdownStyle: {},
3305
+ searchable: { type: Boolean },
3306
+ optionScope: {},
3307
+ listLoading: { type: Boolean },
3308
+ optionsListLength: {},
3309
+ hasNextPage: { type: Boolean },
3310
+ dropdownToggleRef: {}
3311
+ },
3312
+ emits: ["input", "clickOutside"],
3313
+ setup(e, { expose: t, emit: n }) {
3314
+ const a = e, o = n, { t: i } = Ie({ useScope: "global" }), { teleportTarget: l } = $n(), s = S(null), u = S(null), f = S(null), m = S(null), g = $(() => f.value?.viewportRef ?? null);
3315
+ function d(c) {
3316
+ const b = g.value;
3317
+ if (!b) return;
3318
+ if (b.contains(c.target)) {
3319
+ const B = b.scrollTop <= 0 && c.deltaY < 0, p = Math.ceil(b.scrollTop) >= b.scrollHeight - b.clientHeight && c.deltaY > 0;
3320
+ (B || p) && c.preventDefault();
3321
+ } else
3322
+ c.preventDefault(), b.scrollTop += c.deltaY;
3323
+ f.value?.updateScrollState();
3324
+ }
3325
+ return H(
3326
+ () => a.isOpened,
3327
+ (c) => {
3328
+ c && he(() => f.value?.updateScrollState());
3329
+ }
3330
+ ), H(
3331
+ () => a.optionScope.length,
3332
+ () => {
3333
+ a.isOpened && he(() => f.value?.updateScrollState());
3334
+ }
3335
+ ), t({
3336
+ dropdownElRef: s,
3337
+ searchInputRef: u,
3338
+ viewportRef: g,
3339
+ loadMoreRef: m
3340
+ }), (c, b) => (v(), N(cn, { to: r(l) }, [
3341
+ x(Ae, { name: "select-dropdown" }, {
3342
+ default: O(() => [
3343
+ e.isOpened ? rt((v(), y("div", {
3344
+ key: 0,
3345
+ id: e.listboxId,
3346
+ ref_key: "dropdownElRef",
3347
+ ref: s,
3348
+ "data-test-id": "dropdown",
3349
+ class: "vc-select__dropdown",
3350
+ role: "listbox",
3351
+ "aria-label": e.ariaLabel,
3352
+ style: Me(e.dropdownStyle),
3353
+ onWheel: d
3354
+ }, [
3355
+ e.searchable ? (v(), y("input", {
3356
+ key: 0,
3357
+ ref_key: "searchInputRef",
3358
+ ref: u,
3359
+ class: "vc-select__search-input",
3360
+ tabindex: "0",
3361
+ "aria-label": c.$t("COMPONENTS.CONTROLS.SEARCH_OPTIONS"),
3362
+ autocomplete: "off",
3363
+ onInput: b[0] || (b[0] = (h) => o("input", h)),
3364
+ onKeydown: [
3365
+ b[1] || (b[1] = Z(G(() => {
3366
+ }, ["stop"]), ["space"])),
3367
+ b[2] || (b[2] = Z(G(() => {
3368
+ }, ["stop"]), ["enter"]))
3369
+ ]
3370
+ }, null, 40, To)) : w("", !0),
3371
+ x(r(ol), {
3372
+ ref_key: "scrollContainerRef",
3373
+ ref: f,
3374
+ class: "vc-select__scroll-container"
3375
+ }, {
3376
+ default: O(() => [
3377
+ (v(!0), y(we, null, ot(e.optionScope, (h, B) => (v(), y("div", {
3378
+ key: B,
3379
+ class: j(["vc-select__option", { "vc-select__option--selected": h.selected }]),
3380
+ "data-test-id": "option",
3381
+ role: "option",
3382
+ "aria-selected": h.selected,
3383
+ tabindex: "0",
3384
+ "data-index": B,
3385
+ onClick: (p) => h.toggleOption(h.opt),
3386
+ onKeydown: [
3387
+ Z((p) => h.toggleOption(h.opt), ["enter"]),
3388
+ Z((p) => h.toggleOption(h.opt), ["space"])
3389
+ ]
3390
+ }, [
3391
+ C(c.$slots, "option", ne({ ref_for: !0 }, h), () => [
3392
+ Q(T(h.label), 1)
3393
+ ]),
3394
+ h.selected ? (v(), y("span", Mo, [
3395
+ x(r(U), {
3396
+ icon: "lucide-check",
3397
+ size: "xs"
3398
+ })
3399
+ ])) : w("", !0)
3400
+ ], 42, Ro))), 128)),
3401
+ e.listLoading ? (v(), y("div", Ao, [
3402
+ x(r(U), {
3403
+ icon: "lucide-loader-2",
3404
+ class: "tw-animate-spin",
3405
+ size: "m"
3406
+ }),
3407
+ L("span", No, T(e.optionsListLength > 0 ? r(i)("COMPONENTS.MOLECULES.VC_SELECT.LOADING_MORE") : r(i)("COMPONENTS.MOLECULES.VC_SELECT.LOADING")), 1)
3408
+ ])) : w("", !0),
3409
+ !e.listLoading && !e.optionsListLength ? (v(), y("div", Do, [
3410
+ C(c.$slots, "no-options", {}, () => [
3411
+ L("span", Vo, T(r(i)("COMPONENTS.MOLECULES.VC_SELECT.NO_OPTIONS")), 1)
3412
+ ])
3413
+ ])) : w("", !0),
3414
+ e.hasNextPage && !e.listLoading ? (v(), y("span", {
3415
+ key: 2,
3416
+ ref_key: "loadMoreRef",
3417
+ ref: m,
3418
+ class: "vc-select__load-more-trigger"
3419
+ }, null, 512)) : w("", !0)
3420
+ ]),
3421
+ _: 3
3422
+ }, 512)
3423
+ ], 44, xo)), [
3424
+ [r(Fn), [() => o("clickOutside"), { ignore: [e.dropdownToggleRef] }]]
3425
+ ]) : w("", !0)
3426
+ ]),
3427
+ _: 3
3428
+ })
3429
+ ], 8, ["to"]));
3430
+ }
3431
+ }), Fo = ["innerHTML"], zo = { class: "vc-select__field-container" }, qo = /* @__PURE__ */ V({
3432
+ inheritAttrs: !1,
3433
+ __name: "vc-select",
3434
+ props: {
3435
+ label: {},
3436
+ tooltip: {},
3437
+ disabled: { type: Boolean },
3438
+ required: { type: Boolean },
3439
+ name: { default: "Field" },
3440
+ error: { type: Boolean },
3441
+ errorMessage: {},
3442
+ mapOptions: { type: Boolean, default: !0 },
3443
+ hint: {},
3444
+ prefix: {},
3445
+ suffix: {},
3446
+ loading: { type: Boolean },
3447
+ clearable: { type: Boolean, default: !0 },
3448
+ multiple: { type: Boolean },
3449
+ options: { type: [Function, Array], default: () => [] },
3450
+ optionValue: { type: [Function, String], default: "id" },
3451
+ optionLabel: { type: [Function, String], default: "title" },
3452
+ debounce: { default: 500 },
3453
+ placeholder: {},
3454
+ searchable: { type: Boolean },
3455
+ multilanguage: { type: Boolean },
3456
+ currentLanguage: {},
3457
+ size: { default: "default" },
3458
+ outline: { type: Boolean, default: !0 },
3459
+ placement: { default: "bottom" },
3460
+ modelValue: {},
3461
+ emitValue: { type: Boolean, default: !0 }
3462
+ },
3463
+ emits: ["update:modelValue", "search", "close"],
3464
+ setup(e, { emit: t }) {
3465
+ const n = e, a = wt(), o = $(() => {
3466
+ const { class: M, ..._ } = a;
3467
+ return _;
3468
+ }), i = t, { t: l } = Ie({ useScope: "global" }), s = Se(), {
3469
+ fieldId: u,
3470
+ labelId: f,
3471
+ errorId: m,
3472
+ hintId: g,
3473
+ invalid: d,
3474
+ resolvedDisabled: c,
3475
+ resolvedName: b,
3476
+ ariaRequired: h,
3477
+ ariaDescribedBy: B
3478
+ } = Ke(n), p = $(() => `${u.value}-listbox`), I = S(null), P = S(null), { selectRootRef: J, isSelectVisible: ae, ensureVisibility: ee } = Ql(), { getOptionValue: F, getOptionLabel: D, getOption: z, getEmittingOptionValue: W, fieldValueIsFilled: X } = Zl({
3479
+ optionValue: () => n.optionValue,
3480
+ optionLabel: () => n.optionLabel
3481
+ }), { isOpened: k, isFocused: R, dropdownToggleRef: K, dropdownRef: te, popper: Ve, dropdownStyle: E, toggleDropdown: q } = _l({
3482
+ placement: n.placement,
3483
+ outline: () => n.outline,
3484
+ isSelectVisible: ae,
3485
+ selectRootRef: J,
3486
+ disabled: () => n.disabled ?? !1,
3487
+ ensureVisibility: ee
3488
+ });
3489
+ Qe(() => {
3490
+ K.value = I.value?.toggleRef ?? null;
3491
+ }), Qe(() => {
3492
+ te.value = P.value?.dropdownElRef ?? null;
3493
+ });
3494
+ const A = eo({
3495
+ options: () => n.options,
3496
+ getOptionValue: F,
3497
+ getOptionLabel: D,
3498
+ isSelectVisible: ae,
3499
+ debounce: () => n.debounce ?? 500,
3500
+ emit: {
3501
+ search: (M) => i("search", M)
3502
+ }
3503
+ }), { selectedScope: Jt, hasValue: Xt, optionScope: Le, removeAtIndex: Zt, onReset: Qt } = to({
3504
+ modelValue: () => n.modelValue,
3505
+ multiple: () => n.multiple,
3506
+ emitValue: () => n.emitValue ?? !0,
3507
+ mapOptions: () => n.mapOptions ?? !0,
3508
+ displayItems: A.displayItems,
3509
+ resolvedDefaults: A.resolvedDefaults,
3510
+ cachedItems: A.cachedItems,
3511
+ getOptionValue: F,
3512
+ getOptionLabel: D,
3513
+ getOption: z,
3514
+ fieldValueIsFilled: X,
3515
+ isOpened: k,
3516
+ popperUpdate: () => Ve.update(),
3517
+ emit: {
3518
+ updateModelValue: (M) => i("update:modelValue", M),
3519
+ close: () => i("close")
3520
+ }
3521
+ }), _t = $(() => P.value?.loadMoreRef ?? null), en = $(() => P.value?.viewportRef ?? null);
3522
+ xn(
3523
+ _t,
3524
+ ([{ isIntersecting: M }]) => {
3525
+ M && A.hasMore.value && A.loadMore();
3526
+ },
3527
+ { threshold: 1, root: en }
3528
+ );
3529
+ const Ge = Xl({
3530
+ onEnter: (M) => {
3531
+ const _ = parseInt(M.getAttribute("data-index") || "0", 10);
3532
+ Le.value && Le.value[_] && Le.value[_].toggleOption(Le.value[_].opt);
3533
+ },
3534
+ onEscape: () => {
3535
+ k.value = !1, i("close"), he(() => {
3536
+ I.value?.toggleRef?.querySelector('[role="combobox"]')?.focus();
3537
+ });
3538
+ }
3539
+ });
3540
+ function tn() {
3541
+ k.value = !1, i("close");
3542
+ }
3543
+ return H(k, async (M) => {
3544
+ M ? (await A.open(), he(() => {
3545
+ Ve.update();
3546
+ const _ = P.value?.dropdownElRef, oe = P.value?.searchInputRef;
3547
+ if (_)
3548
+ if (Ge.initKeyboardNavigation(_), n.searchable && oe)
3549
+ oe.focus();
3550
+ else {
3551
+ const Be = _.querySelector(
3552
+ '.vc-select__option[tabindex="0"], .vc-select__search-input[tabindex="0"]'
3553
+ );
3554
+ Be ? Be.focus() : Ge.focusFirstElement();
3555
+ }
3556
+ })) : (Ge.cleanupKeyboardNavigation(), A.close());
3557
+ }), H(
3558
+ () => n.modelValue,
3559
+ async (M) => {
3560
+ if (M == null || Array.isArray(M) && M.length === 0) {
3561
+ A.resolvedDefaults.value = [];
3562
+ return;
3563
+ }
3564
+ const _ = n.emitValue ?? !0;
3565
+ if (n.mapOptions ?? !0) {
3566
+ const Be = Array.isArray(M) ? M : [M], pt = _ ? Be : Be.filter((Ce) => Ce != null && typeof Ce != "object");
3567
+ if (pt.length > 0) {
3568
+ const Ce = pt.filter((nn) => nn != null).map(String);
3569
+ Ce.length > 0 && await A.resolve(Ce);
3570
+ }
3571
+ }
3572
+ },
3573
+ { immediate: !0 }
3574
+ ), (M, _) => r(s) ? (v(), y("div", ne({ key: 0 }, o.value, {
3575
+ class: ["vc-select vc-select--skeleton", M.$attrs.class]
3576
+ }), [
3577
+ e.label ? (v(), N(r(le), {
3578
+ key: 0,
3579
+ variant: "block",
3580
+ width: 60 + (e.label?.length || 0) * 4,
3581
+ height: 11
3582
+ }, null, 8, ["width"])) : w("", !0),
3583
+ x(r(le), {
3584
+ variant: "block",
3585
+ width: "100%",
3586
+ height: 36
3587
+ })
3588
+ ], 16)) : (v(), y("div", ne({
3589
+ key: 1,
3590
+ ref_key: "selectRootRef",
3591
+ ref: J
3592
+ }, o.value, {
3593
+ class: ["vc-select", [
3594
+ M.$attrs.class,
3595
+ {
3596
+ "vc-select--opened": r(k),
3597
+ "vc-select--error": r(d),
3598
+ "vc-select--disabled": r(c),
3599
+ "vc-select--has-hint-or-error": r(d) || e.hint,
3600
+ "vc-select--no-outline": !e.outline,
3601
+ "vc-select--focused": r(R)
3602
+ }
3603
+ ]]
3604
+ }), [
3605
+ e.label ? (v(), N(r(He), {
3606
+ key: 0,
3607
+ id: r(f),
3608
+ class: "vc-select__label",
3609
+ required: e.required,
3610
+ multilanguage: e.multilanguage,
3611
+ "current-language": e.currentLanguage,
3612
+ error: r(d)
3613
+ }, ie({
3614
+ default: O(() => [
3615
+ L("span", null, T(e.label), 1)
3616
+ ]),
3617
+ _: 2
3618
+ }, [
3619
+ e.tooltip ? {
3620
+ name: "tooltip",
3621
+ fn: O(() => [
3622
+ L("span", {
3623
+ innerHTML: r(Mt).sanitize(e.tooltip)
3624
+ }, null, 8, Fo)
3625
+ ]),
3626
+ key: "0"
3627
+ } : void 0
3628
+ ]), 1032, ["id", "required", "multilanguage", "current-language", "error"])) : w("", !0),
3629
+ L("div", zo, [
3630
+ x(Co, {
3631
+ ref_key: "selectTriggerRef",
3632
+ ref: I,
3633
+ "is-opened": r(k),
3634
+ "has-value": r(Xt),
3635
+ "selected-scope": r(Jt),
3636
+ multiple: e.multiple,
3637
+ loading: e.loading,
3638
+ disabled: r(c),
3639
+ clearable: e.clearable,
3640
+ placeholder: e.placeholder,
3641
+ prefix: e.prefix,
3642
+ suffix: e.suffix,
3643
+ size: e.size,
3644
+ error: r(d),
3645
+ "error-message": e.errorMessage,
3646
+ hint: e.hint,
3647
+ "list-loading": r(A).loading.value || r(A).searchLoading.value,
3648
+ "default-option-loading": r(A).defaultOptionLoading.value,
3649
+ "listbox-id": p.value,
3650
+ "label-id": r(f),
3651
+ label: e.label,
3652
+ "aria-described-by": r(B),
3653
+ "aria-required": r(h),
3654
+ "error-id": r(m),
3655
+ "hint-id": r(g),
3656
+ "toggle-dropdown": r(q),
3657
+ "get-option-label": r(D),
3658
+ "get-emitting-option-value": r(W),
3659
+ onFocus: _[0] || (_[0] = (oe) => R.value = !0),
3660
+ onBlur: _[1] || (_[1] = (oe) => R.value = !1),
3661
+ onReset: r(Qt),
3662
+ onRemoveAtIndex: r(Zt)
3663
+ }, ie({ _: 2 }, [
3664
+ M.$slots.control ? {
3665
+ name: "control",
3666
+ fn: O((oe) => [
3667
+ C(M.$slots, "control", xe(Te(oe)))
3668
+ ]),
3669
+ key: "0"
3670
+ } : void 0,
3671
+ M.$slots.prepend ? {
3672
+ name: "prepend",
3673
+ fn: O(() => [
3674
+ C(M.$slots, "prepend")
3675
+ ]),
3676
+ key: "1"
3677
+ } : void 0,
3678
+ M.$slots.append ? {
3679
+ name: "append",
3680
+ fn: O(() => [
3681
+ C(M.$slots, "append")
3682
+ ]),
3683
+ key: "2"
3684
+ } : void 0,
3685
+ M.$slots["prepend-inner"] ? {
3686
+ name: "prepend-inner",
3687
+ fn: O(() => [
3688
+ C(M.$slots, "prepend-inner")
3689
+ ]),
3690
+ key: "3"
3691
+ } : void 0,
3692
+ M.$slots["append-inner"] ? {
3693
+ name: "append-inner",
3694
+ fn: O(() => [
3695
+ C(M.$slots, "append-inner")
3696
+ ]),
3697
+ key: "4"
3698
+ } : void 0,
3699
+ M.$slots["selected-item"] ? {
3700
+ name: "selected-item",
3701
+ fn: O((oe) => [
3702
+ C(M.$slots, "selected-item", xe(Te(oe)))
3703
+ ]),
3704
+ key: "5"
3705
+ } : void 0,
3706
+ M.$slots.error ? {
3707
+ name: "error",
3708
+ fn: O(() => [
3709
+ C(M.$slots, "error")
3710
+ ]),
3711
+ key: "6"
3712
+ } : void 0,
3713
+ M.$slots.hint ? {
3714
+ name: "hint",
3715
+ fn: O(() => [
3716
+ C(M.$slots, "hint")
3717
+ ]),
3718
+ key: "7"
3719
+ } : void 0
3720
+ ]), 1032, ["is-opened", "has-value", "selected-scope", "multiple", "loading", "disabled", "clearable", "placeholder", "prefix", "suffix", "size", "error", "error-message", "hint", "list-loading", "default-option-loading", "listbox-id", "label-id", "label", "aria-described-by", "aria-required", "error-id", "hint-id", "toggle-dropdown", "get-option-label", "get-emitting-option-value", "onReset", "onRemoveAtIndex"]),
3721
+ x(Po, ne({
3722
+ ref_key: "selectDropdownRef",
3723
+ ref: P,
3724
+ "is-opened": r(k),
3725
+ "listbox-id": p.value
3726
+ }, { ariaLabel: e.label || e.name }, {
3727
+ "dropdown-style": r(E),
3728
+ searchable: e.searchable,
3729
+ "option-scope": r(Le),
3730
+ "list-loading": r(A).loading.value || r(A).searchLoading.value,
3731
+ "options-list-length": r(A).displayItems.value.length,
3732
+ "has-next-page": r(A).hasMore.value,
3733
+ "dropdown-toggle-ref": I.value?.toggleRef ?? null,
3734
+ onInput: r(A).onInput,
3735
+ onClickOutside: tn
3736
+ }), ie({ _: 2 }, [
3737
+ M.$slots.option ? {
3738
+ name: "option",
3739
+ fn: O((oe) => [
3740
+ C(M.$slots, "option", xe(Te(oe)))
3741
+ ]),
3742
+ key: "0"
3743
+ } : void 0,
3744
+ M.$slots["no-options"] ? {
3745
+ name: "no-options",
3746
+ fn: O(() => [
3747
+ C(M.$slots, "no-options")
3748
+ ]),
3749
+ key: "1"
3750
+ } : void 0
3751
+ ]), 1040, ["is-opened", "listbox-id", "dropdown-style", "searchable", "option-scope", "list-loading", "options-list-length", "has-next-page", "dropdown-toggle-ref", "onInput"])
3752
+ ])
3753
+ ], 16));
3754
+ }
3755
+ }), Uo = {
3756
+ key: 0,
3757
+ class: "vc-input-dropdown vc-input-dropdown--skeleton"
3758
+ }, Ko = { class: "tw-flex tw-items-center" }, Wo = ["aria-label", "aria-expanded", "onClick", "onKeydown"], jo = /* @__PURE__ */ V({
3759
+ __name: "vc-input-dropdown",
3760
+ props: {
3761
+ modelValue: {},
3762
+ prefix: {},
3763
+ suffix: {},
3764
+ debounce: { default: 0 },
3765
+ maxlength: {},
3766
+ option: {},
3767
+ options: {},
3768
+ optionValue: {},
3769
+ optionLabel: {},
3770
+ searchable: { type: Boolean, default: !1 },
3771
+ inputType: { default: "text" },
3772
+ placeholder: {},
3773
+ hint: {},
3774
+ clearable: { type: Boolean },
3775
+ loading: { type: Boolean },
3776
+ autofocus: { type: Boolean },
3777
+ size: {},
3778
+ multilanguage: { type: Boolean },
3779
+ currentLanguage: {},
3780
+ label: {},
3781
+ tooltip: {},
3782
+ disabled: { type: Boolean },
3783
+ required: { type: Boolean },
3784
+ name: {},
3785
+ error: { type: Boolean },
3786
+ errorMessage: {}
3787
+ },
3788
+ emits: ["update:model-value", "update:option", "change", "blur"],
3789
+ setup(e) {
3790
+ const t = Se();
3791
+ return (n, a) => r(t) ? (v(), y("div", Uo, [
3792
+ e.label ? (v(), N(r(le), {
3793
+ key: 0,
3794
+ variant: "block",
3795
+ width: 60 + (e.label?.length || 0) * 4,
3796
+ height: 11
3797
+ }, null, 8, ["width"])) : w("", !0),
3798
+ x(r(le), {
3799
+ variant: "block",
3800
+ width: "100%",
3801
+ height: 36
3802
+ })
3803
+ ])) : (v(), N(r(qo), {
3804
+ key: 1,
3805
+ class: "vc-input-dropdown",
3806
+ options: e.options,
3807
+ "option-label": e.optionLabel,
3808
+ "option-value": e.optionValue,
3809
+ searchable: e.searchable,
3810
+ debounce: e.debounce,
3811
+ disabled: e.disabled,
3812
+ label: e.label,
3813
+ required: e.required,
3814
+ "model-value": e.option,
3815
+ tooltip: e.tooltip,
3816
+ multilanguage: e.multilanguage,
3817
+ "current-language": e.currentLanguage,
3818
+ "onUpdate:modelValue": a[2] || (a[2] = (o) => n.$emit("update:option", o))
3819
+ }, {
3820
+ option: O((o) => [
3821
+ C(n.$slots, "option", xe(Te(o)))
3822
+ ]),
3823
+ control: O(({ toggleHandler: o, isOpened: i }) => [
3824
+ x(r(gt), {
3825
+ placeholder: e.placeholder,
3826
+ hint: e.hint,
3827
+ clearable: e.clearable,
3828
+ prefix: e.prefix,
3829
+ suffix: e.suffix,
3830
+ name: e.name,
3831
+ "model-value": e.modelValue,
3832
+ loading: e.loading,
3833
+ disabled: e.disabled,
3834
+ autofocus: e.autofocus,
3835
+ error: e.error,
3836
+ "error-message": e.errorMessage,
3837
+ maxlength: e.maxlength,
3838
+ type: e.inputType,
3839
+ class: "vc-input-dropdown__input",
3840
+ "onUpdate:modelValue": a[0] || (a[0] = (l) => n.$emit("update:model-value", l)),
3841
+ onBlur: a[1] || (a[1] = (l) => n.$emit("blur", l))
3842
+ }, ie({
3843
+ "append-inner": O(() => [
3844
+ L("div", Ko, [
3845
+ C(n.$slots, "button", { toggleHandler: o }, () => [
3846
+ e.options && e.options.length ? (v(), y("button", {
3847
+ key: 0,
3848
+ type: "button",
3849
+ class: "vc-input-dropdown__toggle-button",
3850
+ tabindex: "0",
3851
+ "aria-label": n.$t("COMPONENTS.CONTROLS.SELECT_OPTION"),
3852
+ "aria-expanded": i,
3853
+ "aria-haspopup": "listbox",
3854
+ onClick: G(o, ["stop", "prevent"]),
3855
+ onKeydown: [
3856
+ Z(G(o, ["stop", "prevent"]), ["enter"]),
3857
+ Z(G(o, ["stop", "prevent"]), ["space"])
3858
+ ]
3859
+ }, T(r(e.option)), 41, Wo)) : w("", !0)
3860
+ ]),
3861
+ e.options && e.options.length ? (v(), N(r(Ra), {
3862
+ key: 0,
3863
+ icon: i ? "lucide-chevron-up" : "lucide-chevron-down",
3864
+ "icon-size": "s",
3865
+ text: "",
3866
+ "aria-label": n.$t("COMPONENTS.CONTROLS.TOGGLE_DROPDOWN"),
3867
+ "icon-class": "vc-input-dropdown__toggle-button-icon",
3868
+ onClick: G(o, ["stop", "prevent"])
3869
+ }, null, 8, ["icon", "aria-label", "onClick"])) : w("", !0)
3870
+ ]),
3871
+ n.$slots["append-inner"] ? C(n.$slots, "append-inner", { key: 0 }) : w("", !0)
3872
+ ]),
3873
+ _: 2
3874
+ }, [
3875
+ n.$slots.control ? {
3876
+ name: "control",
3877
+ fn: O((l) => [
3878
+ C(n.$slots, "control", xe(Te(l)))
3879
+ ]),
3880
+ key: "0"
3881
+ } : void 0,
3882
+ n.$slots["prepend-inner"] ? {
3883
+ name: "prepend-inner",
3884
+ fn: O(() => [
3885
+ C(n.$slots, "prepend-inner")
3886
+ ]),
3887
+ key: "1"
3888
+ } : void 0,
3889
+ n.$slots.append ? {
3890
+ name: "append",
3891
+ fn: O(() => [
3892
+ C(n.$slots, "append")
3893
+ ]),
3894
+ key: "2"
3895
+ } : void 0,
3896
+ n.$slots.prepend ? {
3897
+ name: "prepend",
3898
+ fn: O(() => [
3899
+ C(n.$slots, "prepend")
3900
+ ]),
3901
+ key: "3"
3902
+ } : void 0
3903
+ ]), 1032, ["placeholder", "hint", "clearable", "prefix", "suffix", "name", "model-value", "loading", "disabled", "autofocus", "error", "error-message", "maxlength", "type"])
3904
+ ]),
3905
+ _: 3
3906
+ }, 8, ["options", "option-label", "option-value", "searchable", "debounce", "disabled", "label", "required", "model-value", "tooltip", "multilanguage", "current-language"]));
3907
+ }
3908
+ }), Ho = {
3909
+ key: 0,
3910
+ class: "vc-input-currency vc-input-currency--skeleton"
3911
+ }, Go = ["disabled", "placeholder", "aria-label"], Yo = /* @__PURE__ */ V({
3912
+ __name: "vc-input-currency",
3913
+ props: {
3914
+ modelValue: {},
3915
+ placeholder: {},
3916
+ hint: {},
3917
+ clearable: { type: Boolean },
3918
+ prefix: {},
3919
+ suffix: {},
3920
+ loading: { type: Boolean },
3921
+ debounce: { default: 0 },
3922
+ autofocus: { type: Boolean },
3923
+ maxlength: {},
3924
+ option: {},
3925
+ options: {},
3926
+ optionValue: {},
3927
+ optionLabel: {},
3928
+ currencyDisplay: { default: Nn.hidden },
3929
+ precision: { default: 2 },
3930
+ searchable: { type: Boolean, default: !1 },
3931
+ label: {},
3932
+ tooltip: {},
3933
+ disabled: { type: Boolean },
3934
+ required: { type: Boolean },
3935
+ name: {},
3936
+ error: { type: Boolean },
3937
+ errorMessage: {}
3938
+ },
3939
+ emits: ["update:model-value", "update:option", "change", "blur"],
3940
+ setup(e, { emit: t }) {
3941
+ const n = e, a = t, o = Se(), { inputRef: i, setOptions: l, numberValue: s, setValue: u } = Dn(
3942
+ {
3943
+ locale: navigator.language,
3944
+ currency: n.option || "USD",
3945
+ currencyDisplay: n.currencyDisplay,
3946
+ hideGroupingSeparatorOnFocus: !1,
3947
+ precision: n.precision,
3948
+ hideCurrencySymbolOnFocus: !1,
3949
+ hideNegligibleDecimalDigitsOnFocus: !1
3950
+ }
3951
+ );
3952
+ H(
3953
+ () => n.option,
3954
+ (c) => {
3955
+ c && l({
3956
+ locale: navigator.language,
3957
+ currency: c,
3958
+ currencyDisplay: n.currencyDisplay,
3959
+ hideGroupingSeparatorOnFocus: !1,
3960
+ precision: n.precision,
3961
+ hideCurrencySymbolOnFocus: !1,
3962
+ hideNegligibleDecimalDigitsOnFocus: !1
3963
+ });
3964
+ }
3965
+ ), H(
3966
+ () => n.modelValue,
3967
+ (c) => {
3968
+ u(c);
3969
+ }
3970
+ ), H(s, (c) => {
3971
+ a("update:model-value", c);
3972
+ });
3973
+ function f(c) {
3974
+ i.value && (i.value.value = c), s.value = typeof c == "number" ? c : c === null ? null : parseFloat(String(c)) || null, a("update:model-value", s.value);
3975
+ }
3976
+ function m(c) {
3977
+ a("blur", c);
3978
+ }
3979
+ function g(c) {
3980
+ if ((c.key === "-" || c.key === "e") && c.preventDefault(), c.key !== "Tab") {
3981
+ if (c.key === "Enter") {
3982
+ c.target && c.target.blur();
3983
+ const b = Array.from(document.querySelectorAll('[tabindex="0"]:not(:disabled)')), h = b.indexOf(c.target);
3984
+ h >= 0 && h < b.length - 1 && b[h + 1].focus();
3985
+ }
3986
+ }
3987
+ }
3988
+ function d(c) {
3989
+ const b = c.clipboardData?.getData("text/plain");
3990
+ typeof b < "u" && parseInt(b) < 0 && c.preventDefault();
3991
+ }
3992
+ return (c, b) => r(o) ? (v(), y("div", Ho, [
3993
+ e.label ? (v(), N(r(le), {
3994
+ key: 0,
3995
+ variant: "block",
3996
+ width: 60 + (e.label?.length || 0) * 4,
3997
+ height: 11
3998
+ }, null, 8, ["width"])) : w("", !0),
3999
+ x(r(le), {
4000
+ variant: "block",
4001
+ width: "100%",
4002
+ height: 36
4003
+ })
4004
+ ])) : (v(), N(r(jo), {
4005
+ key: 1,
4006
+ class: "vc-input-currency",
4007
+ options: e.options,
4008
+ "option-label": e.optionLabel,
4009
+ "option-value": e.optionValue,
4010
+ searchable: e.searchable,
4011
+ debounce: e.debounce,
4012
+ disabled: e.disabled,
4013
+ label: e.label,
4014
+ required: e.required,
4015
+ option: e.option,
4016
+ "model-value": r(s),
4017
+ tooltip: e.tooltip,
4018
+ placeholder: e.placeholder,
4019
+ hint: e.hint,
4020
+ clearable: e.clearable,
4021
+ prefix: e.prefix,
4022
+ suffix: e.suffix,
4023
+ name: e.name,
4024
+ loading: e.loading,
4025
+ autofocus: e.autofocus,
4026
+ error: e.error,
4027
+ "error-message": e.errorMessage,
4028
+ maxlength: e.maxlength,
4029
+ "input-type": "number",
4030
+ "onUpdate:modelValue": f,
4031
+ "onUpdate:option": b[0] || (b[0] = (h) => c.$emit("update:option", h)),
4032
+ onBlur: m
4033
+ }, {
4034
+ control: O(({ placeholder: h }) => [
4035
+ L("input", {
4036
+ ref_key: "inputRef",
4037
+ ref: i,
4038
+ type: "text",
4039
+ disabled: e.disabled,
4040
+ placeholder: h,
4041
+ "aria-label": e.label || void 0,
4042
+ class: "vc-input-currency__control",
4043
+ tabindex: "0",
4044
+ onBlur: m,
4045
+ onKeydown: g,
4046
+ onPaste: d
4047
+ }, null, 40, Go)
4048
+ ]),
4049
+ _: 1
4050
+ }, 8, ["options", "option-label", "option-value", "searchable", "debounce", "disabled", "label", "required", "option", "model-value", "tooltip", "placeholder", "hint", "clearable", "prefix", "suffix", "name", "loading", "autofocus", "error", "error-message", "maxlength"]));
4051
+ }
4052
+ }), jt = Symbol("VcAppBarState"), Jo = {
4053
+ activeWidgetId: S(null),
4054
+ activeMobileActionId: S(null)
4055
+ };
4056
+ function hr() {
4057
+ const e = {
4058
+ activeWidgetId: S(null),
4059
+ activeMobileActionId: S(null)
4060
+ };
4061
+ return $t(jt, e), e;
4062
+ }
4063
+ function kr() {
4064
+ return Y(jt, Jo);
4065
+ }
4066
+ const Ir = Symbol("TableContext"), Xo = Symbol("ColumnCollector"), Sr = Symbol("FillerWidth"), $r = Symbol("IsColumnReordering"), wr = (e, t) => {
4067
+ const n = e.__vccOpts || e;
4068
+ for (const [a, o] of t)
4069
+ n[a] = o;
4070
+ return n;
4071
+ }, Or = V({
4072
+ name: "VcColumn",
4073
+ inheritAttrs: !1,
4074
+ props: {
4075
+ // === Identity ===
4076
+ /** Unique column identifier (must be unique within the table) */
4077
+ id: {
4078
+ type: String,
4079
+ required: !0
4080
+ },
4081
+ /** Data field path to read from each item (default: same as `id`) */
4082
+ field: {
4083
+ type: String,
4084
+ default: void 0
4085
+ },
4086
+ // === Display ===
4087
+ /** Column header title text */
4088
+ title: {
4089
+ type: String,
4090
+ default: void 0
4091
+ },
4092
+ /** Cell formatter type — determines how cell value is rendered */
4093
+ type: {
4094
+ type: String,
4095
+ default: "text"
4096
+ },
4097
+ /** Field name to read currency code from (used with `type="money"`, default: `"currency"`) */
4098
+ currencyField: {
4099
+ type: String,
4100
+ default: "currency"
4101
+ },
4102
+ /** Date/number format string (e.g. `"DD.MM.YYYY"`) */
4103
+ format: {
4104
+ type: String,
4105
+ default: void 0
4106
+ },
4107
+ // === Sizing ===
4108
+ /** Column width in px or CSS string (e.g. `200`, `"150px"`) */
4109
+ width: {
4110
+ type: [String, Number],
4111
+ default: void 0
4112
+ },
4113
+ /** Minimum column width (default: `60px`) */
4114
+ minWidth: {
4115
+ type: [String, Number],
4116
+ default: void 0
4117
+ },
4118
+ /** Maximum column width */
4119
+ maxWidth: {
4120
+ type: [String, Number],
4121
+ default: void 0
4122
+ },
4123
+ // === Alignment ===
4124
+ /** Cell text alignment */
4125
+ align: {
4126
+ type: String,
4127
+ default: void 0
4128
+ },
4129
+ /** Header text alignment (default: same as `align`) */
4130
+ headerAlign: {
4131
+ type: String,
4132
+ default: void 0
4133
+ },
4134
+ // === Sorting ===
4135
+ /** Whether the column is sortable (shows sort icon on hover) */
4136
+ sortable: {
4137
+ type: Boolean,
4138
+ default: !1
4139
+ },
4140
+ /** Override backend field name for sorting (default: column `id`) */
4141
+ sortField: {
4142
+ type: String,
4143
+ default: void 0
4144
+ },
4145
+ // === Filtering ===
4146
+ /** Declarative filter config: `true` for text, `"field"` for text with custom field, or object for select/dateRange */
4147
+ filter: {
4148
+ type: [Boolean, String, Object],
4149
+ default: void 0
4150
+ },
4151
+ /** Override backend field name for filtering (default: column `id`) */
4152
+ filterField: {
4153
+ type: String,
4154
+ default: void 0
4155
+ },
4156
+ /** Placeholder text for the filter input */
4157
+ filterPlaceholder: {
4158
+ type: String,
4159
+ default: void 0
4160
+ },
4161
+ // === Visibility ===
4162
+ /** Whether the column is visible (default: `true`). Hidden columns can be toggled via column switcher */
4163
+ visible: {
4164
+ type: Boolean,
4165
+ default: !0
4166
+ },
4167
+ /** If `true`, column stays visible even when `showAllColumns=false` (e.g. when blade narrows) */
4168
+ alwaysVisible: {
4169
+ type: Boolean,
4170
+ default: !1
4171
+ },
4172
+ // === Editing ===
4173
+ /** Whether the cell is editable (enables inline edit on click) */
4174
+ editable: {
4175
+ type: Boolean,
4176
+ default: !1
4177
+ },
4178
+ /** Validation rules for the editable cell (field name → validator) */
4179
+ rules: {
4180
+ type: Object,
4181
+ default: void 0
4182
+ },
4183
+ // === Styling ===
4184
+ /** Custom CSS class applied to the entire column (header + body cells) */
4185
+ class: {
4186
+ type: String,
4187
+ default: void 0
4188
+ },
4189
+ /** Custom CSS class applied only to the header cell */
4190
+ headerClass: {
4191
+ type: String,
4192
+ default: void 0
4193
+ },
4194
+ /** Custom CSS class applied only to body cells */
4195
+ bodyClass: {
4196
+ type: String,
4197
+ default: void 0
4198
+ },
4199
+ /** Number of lines to clamp cell text to (`0` = no clamp, default: `2`) */
4200
+ lineClamp: {
4201
+ type: Number,
4202
+ default: 2
4203
+ },
4204
+ // === Special modes ===
4205
+ /** Renders a selection checkbox column (`"single"` = radio, `"multiple"` = checkbox) */
4206
+ selectionMode: {
4207
+ type: String,
4208
+ default: void 0
4209
+ },
4210
+ /** Renders row edit save/cancel buttons in this column */
4211
+ rowEditor: {
4212
+ type: Boolean,
4213
+ default: !1
4214
+ },
4215
+ /** Renders a drag handle for row reordering */
4216
+ rowReorder: {
4217
+ type: Boolean,
4218
+ default: !1
4219
+ },
4220
+ /** Renders an expand/collapse toggle for row expansion */
4221
+ expander: {
4222
+ type: Boolean,
4223
+ default: !1
4224
+ },
4225
+ // === Mobile ===
4226
+ /**
4227
+ * Mobile card role — determines how column is displayed on mobile.
4228
+ * - `"title"`: Primary identifier, displayed at top (full width, bold)
4229
+ * - `"image"`: Visual element, displayed on left side
4230
+ * - `"field"`: Data with label, auto-distributed in 2x2 grid (max 4)
4231
+ * - `"status"`: Status badge, displayed at bottom (multiple allowed)
4232
+ */
4233
+ mobileRole: {
4234
+ type: String,
4235
+ default: void 0
4236
+ },
4237
+ /** Explicit grid position for mobile card layout */
4238
+ mobilePosition: {
4239
+ type: String,
4240
+ default: void 0
4241
+ },
4242
+ /** Whether column is visible on mobile (default: `true` — hidden unless `mobileRole` is specified) */
4243
+ mobileVisible: {
4244
+ type: Boolean,
4245
+ default: !0
4246
+ }
4247
+ },
4248
+ setup(e, { slots: t }) {
4249
+ const n = Y(Xo, null), a = qe();
4250
+ return Ue(() => {
4251
+ n && a && n.add({
4252
+ instance: a,
4253
+ props: e,
4254
+ slots: t
4255
+ });
4256
+ }), Ot(() => {
4257
+ n && a && n.delete(a);
4258
+ }), () => null;
4259
+ }
4260
+ }), $e = _e(/* @__PURE__ */ new Map());
4261
+ function Ht() {
4262
+ return {
4263
+ register: (l) => {
4264
+ $e.set(l.type, l);
4265
+ },
4266
+ get: (l) => $e.get(l),
4267
+ has: (l) => $e.has(l),
4268
+ getRegisteredTypes: () => Array.from($e.keys()),
4269
+ unregister: (l) => $e.delete(l),
4270
+ clear: () => {
4271
+ $e.clear();
4272
+ }
4273
+ };
4274
+ }
4275
+ const Zo = { class: "vc-table-cell-editable__error-tooltip" }, mt = /* @__PURE__ */ V({
4276
+ __name: "CellEditableWrapper",
4277
+ props: {
4278
+ label: {},
4279
+ fieldName: {},
4280
+ modelValue: {},
4281
+ rules: {},
4282
+ validateOnMount: { type: Boolean }
4283
+ },
4284
+ setup(e) {
4285
+ const t = e, n = S(null);
4286
+ return Ue(() => {
4287
+ const a = t.modelValue === void 0 || t.modelValue === null || t.modelValue === "";
4288
+ (t.validateOnMount || a && t.rules) && n.value?.validate();
4289
+ }), (a, o) => (v(), N(r(wn), {
4290
+ ref_key: "fieldRef",
4291
+ ref: n,
4292
+ label: e.label,
4293
+ name: e.fieldName,
4294
+ "model-value": e.modelValue,
4295
+ rules: e.rules
4296
+ }, {
4297
+ default: O(({ errors: i, errorMessage: l }) => [
4298
+ x(Bt, { placement: "bottom" }, ie({
4299
+ default: O(() => [
4300
+ C(a.$slots, "default", {
4301
+ errors: i,
4302
+ errorMessage: l
4303
+ })
4304
+ ]),
4305
+ _: 2
4306
+ }, [
4307
+ l ? {
4308
+ name: "tooltip",
4309
+ fn: O(() => [
4310
+ L("div", Zo, T(l), 1)
4311
+ ]),
4312
+ key: "0"
4313
+ } : void 0
4314
+ ]), 1024)
4315
+ ]),
4316
+ _: 3
4317
+ }, 8, ["label", "name", "model-value", "rules"]));
4318
+ }
4319
+ }), Qo = {
4320
+ key: 1,
4321
+ class: "vc-table-cell-default"
4322
+ }, Gt = /* @__PURE__ */ V({
4323
+ __name: "CellDefault",
4324
+ props: {
4325
+ value: {},
4326
+ editable: { type: Boolean },
4327
+ label: {},
4328
+ fieldName: {},
4329
+ fieldId: {},
4330
+ rules: {},
4331
+ rowIndex: {},
4332
+ validateOnMount: { type: Boolean }
4333
+ },
4334
+ emits: ["update", "blur"],
4335
+ setup(e, { emit: t }) {
4336
+ const n = e, a = t, { isMobile: o, isDesktop: i } = je(), l = (s) => {
4337
+ s && s.length > 0 || a("blur", { row: n.rowIndex, field: n.fieldId || "" });
4338
+ };
4339
+ return (s, u) => e.editable ? (v(), N(mt, {
4340
+ key: 0,
4341
+ label: e.label || "",
4342
+ "field-name": e.fieldName || "",
4343
+ "model-value": e.value,
4344
+ rules: e.rules,
4345
+ "validate-on-mount": e.validateOnMount
4346
+ }, {
4347
+ default: O(({ errors: f, errorMessage: m }) => [
4348
+ x(gt, {
4349
+ "model-value": e.value,
4350
+ class: "vc-table-cell-default__input",
4351
+ error: f.length > 0,
4352
+ "error-message": r(o) ? m : void 0,
4353
+ "onUpdate:modelValue": u[0] || (u[0] = (g) => s.$emit("update", { field: e.fieldId || "", value: g })),
4354
+ onBlur: (g) => l(f)
4355
+ }, ie({ _: 2 }, [
4356
+ r(i) && f.length > 0 ? {
4357
+ name: "append-inner",
4358
+ fn: O(() => [
4359
+ x(r(U), {
4360
+ icon: "lucide-circle-alert",
4361
+ class: "vc-table-cell-default__error-icon"
4362
+ })
4363
+ ]),
4364
+ key: "0"
4365
+ } : void 0
4366
+ ]), 1032, ["model-value", "error", "error-message", "onBlur"])
4367
+ ]),
4368
+ _: 1
4369
+ }, 8, ["label", "field-name", "model-value", "rules", "validate-on-mount"])) : (v(), y("span", Qo, T(e.value), 1));
4370
+ }
4371
+ }), _o = {
4372
+ key: 1,
4373
+ class: "vc-table-cell-money"
4374
+ }, ei = {
4375
+ key: 2,
4376
+ class: "vc-table-cell-money vc-table-cell-money--not-set"
4377
+ }, ti = /* @__PURE__ */ V({
4378
+ __name: "CellMoney",
4379
+ props: {
4380
+ value: {},
4381
+ currency: {},
4382
+ editable: { type: Boolean },
4383
+ label: {},
4384
+ fieldName: {},
4385
+ fieldId: {},
4386
+ rules: {},
4387
+ rowIndex: {},
4388
+ validateOnMount: { type: Boolean }
4389
+ },
4390
+ emits: ["update", "blur"],
4391
+ setup(e, { emit: t }) {
4392
+ const n = e, a = t, { t: o } = Ie({ useScope: "global" }), i = window.navigator.language, { isMobile: l, isDesktop: s } = je(), u = $(() => typeof n.value > "u" || n.value === null || Number(n.value) === 0), f = $(() => {
4393
+ const g = Number(n.value);
4394
+ return isNaN(g) ? String(n.value) : new Intl.NumberFormat(i, {
4395
+ style: "currency",
4396
+ currency: n.currency || "USD"
4397
+ }).format(g);
4398
+ }), m = (g) => {
4399
+ g && g.length > 0 || a("blur", { row: n.rowIndex, field: n.fieldId || "" });
4400
+ };
4401
+ return (g, d) => e.editable ? (v(), N(mt, {
4402
+ key: 0,
4403
+ label: e.label || "",
4404
+ "field-name": e.fieldName || "",
4405
+ "model-value": e.value,
4406
+ rules: e.rules,
4407
+ "validate-on-mount": e.validateOnMount
4408
+ }, {
4409
+ default: O(({ errors: c, errorMessage: b }) => [
4410
+ x(Yo, {
4411
+ "model-value": e.value,
4412
+ options: [],
4413
+ option: e.currency || "USD",
4414
+ "currency-display": "symbol",
4415
+ class: "vc-table-cell-money__input",
4416
+ error: c.length > 0,
4417
+ "error-message": r(l) ? b : void 0,
4418
+ "onUpdate:modelValue": d[0] || (d[0] = (h) => g.$emit("update", { field: e.fieldId || "", value: h })),
4419
+ onBlur: (h) => m(c)
4420
+ }, ie({ _: 2 }, [
4421
+ r(s) && c.length > 0 ? {
4422
+ name: "append-inner",
4423
+ fn: O(() => [
4424
+ x(r(U), {
4425
+ icon: "lucide-circle-alert",
4426
+ class: "vc-table-cell-money__error-icon"
4427
+ })
4428
+ ]),
4429
+ key: "0"
4430
+ } : void 0
4431
+ ]), 1032, ["model-value", "option", "error", "error-message", "onBlur"])
4432
+ ]),
4433
+ _: 1
4434
+ }, 8, ["label", "field-name", "model-value", "rules", "validate-on-mount"])) : u.value ? (v(), y("span", ei, T(r(o)("COMPONENTS.ORGANISMS.VC_TABLE.NOT_SET")), 1)) : (v(), y("span", _o, T(f.value), 1));
4435
+ }
4436
+ }), ni = {
4437
+ key: 1,
4438
+ class: "vc-table-cell-number"
4439
+ }, ai = {
4440
+ key: 2,
4441
+ class: "vc-table-cell-number vc-table-cell-number--not-set"
4442
+ }, li = /* @__PURE__ */ V({
4443
+ __name: "CellNumber",
4444
+ props: {
4445
+ value: {},
4446
+ editable: { type: Boolean },
4447
+ label: {},
4448
+ fieldName: {},
4449
+ fieldId: {},
4450
+ rules: {},
4451
+ rowIndex: {},
4452
+ validateOnMount: { type: Boolean }
4453
+ },
4454
+ emits: ["update", "blur"],
4455
+ setup(e, { emit: t }) {
4456
+ const n = e, a = t, { t: o } = Ie({ useScope: "global" }), { isMobile: i, isDesktop: l } = je(), s = $(() => {
4457
+ if (n.value === null || n.value === void 0) return !0;
4458
+ const m = Number(n.value);
4459
+ return isNaN(m) || m < 0;
4460
+ }), u = $(() => {
4461
+ const m = Number(n.value);
4462
+ return isNaN(m) ? String(n.value) : m.toFixed(0);
4463
+ }), f = (m) => {
4464
+ m && m.length > 0 || a("blur", { row: n.rowIndex, field: n.fieldId || "" });
4465
+ };
4466
+ return (m, g) => e.editable ? (v(), N(mt, {
4467
+ key: 0,
4468
+ label: e.label || "",
4469
+ "field-name": e.fieldName || "",
4470
+ "model-value": e.value,
4471
+ rules: e.rules,
4472
+ "validate-on-mount": e.validateOnMount
4473
+ }, {
4474
+ default: O(({ errors: d, errorMessage: c }) => [
4475
+ x(gt, {
4476
+ "model-value": e.value,
4477
+ class: "vc-table-cell-number__input",
4478
+ type: "number",
4479
+ error: d.length > 0,
4480
+ "error-message": r(i) ? c : void 0,
4481
+ "onUpdate:modelValue": g[0] || (g[0] = (b) => m.$emit("update", { field: e.fieldId || "", value: b })),
4482
+ onBlur: (b) => f(d)
4483
+ }, ie({ _: 2 }, [
4484
+ r(l) && d.length > 0 ? {
4485
+ name: "append-inner",
4486
+ fn: O(() => [
4487
+ x(r(U), {
4488
+ icon: "lucide-circle-alert",
4489
+ class: "vc-table-cell-number__error-icon"
4490
+ })
4491
+ ]),
4492
+ key: "0"
4493
+ } : void 0
4494
+ ]), 1032, ["model-value", "error", "error-message", "onBlur"])
4495
+ ]),
4496
+ _: 1
4497
+ }, 8, ["label", "field-name", "model-value", "rules", "validate-on-mount"])) : s.value ? (v(), y("span", ai, T(r(o)("COMPONENTS.ORGANISMS.VC_TABLE.NOT_SET")), 1)) : (v(), y("span", ni, T(u.value), 1));
4498
+ }
4499
+ }), oi = {
4500
+ key: 0,
4501
+ class: "vc-table-cell-date"
4502
+ }, ii = {
4503
+ key: 1,
4504
+ class: "vc-table-cell-date vc-table-cell-date--not-set"
4505
+ }, Ze = /* @__PURE__ */ V({
4506
+ __name: "CellDate",
4507
+ props: {
4508
+ value: {},
4509
+ variant: {},
4510
+ format: {}
4511
+ },
4512
+ setup(e) {
4513
+ const t = e, { t: n } = Ie({ useScope: "global" }), a = window.navigator.language, o = $(() => {
4514
+ if (!t.value) return "";
4515
+ if (t.format)
4516
+ return Zn(t.value, t.format, a);
4517
+ const i = t.value instanceof Date ? t.value : new Date(t.value), l = t.variant || "date";
4518
+ return l === "time" ? i.toLocaleTimeString(a) : l === "date-time" ? i.toLocaleString(a) : i.toLocaleDateString(a);
4519
+ });
4520
+ return (i, l) => e.value ? (v(), y("span", oi, T(o.value), 1)) : (v(), y("span", ii, T(r(n)("COMPONENTS.ORGANISMS.VC_TABLE.NOT_SET")), 1));
4521
+ }
4522
+ }), ri = ["title"], si = {
4523
+ key: 1,
4524
+ class: "vc-table-cell-date-ago vc-table-cell-date-ago--not-set"
4525
+ }, ui = /* @__PURE__ */ V({
4526
+ __name: "CellDateAgo",
4527
+ props: {
4528
+ value: {}
4529
+ },
4530
+ setup(e) {
4531
+ const t = e, { t: n } = Ie({ useScope: "global" }), a = window.navigator.language, o = $(() => t.value ? (t.value instanceof Date ? t.value : new Date(t.value)).toLocaleString(a) : ""), i = $(() => t.value ? Xn(t.value) : "");
4532
+ return (l, s) => e.value ? (v(), y("span", {
4533
+ key: 0,
4534
+ class: "vc-table-cell-date-ago",
4535
+ title: o.value
4536
+ }, T(i.value), 9, ri)) : (v(), y("span", si, T(r(n)("COMPONENTS.ORGANISMS.VC_TABLE.NOT_SET")), 1));
4537
+ }
4538
+ }), ci = /* @__PURE__ */ V({
4539
+ __name: "CellImage",
4540
+ props: {
4541
+ value: {},
4542
+ emptyIcon: {}
4543
+ },
4544
+ setup(e) {
4545
+ return (t, n) => (v(), N(r(Ka), {
4546
+ class: "vc-table-cell-image",
4547
+ bordered: !0,
4548
+ size: "s",
4549
+ aspect: "1x1",
4550
+ src: e.value,
4551
+ "empty-icon": e.emptyIcon,
4552
+ background: "contain",
4553
+ "thumbnail-size": "sm"
4554
+ }, null, 8, ["src", "empty-icon"]));
4555
+ }
4556
+ }), di = /* @__PURE__ */ V({
4557
+ __name: "CellStatus",
4558
+ props: {
4559
+ value: {}
4560
+ },
4561
+ setup(e) {
4562
+ return (t, n) => (v(), N(r(tl), { class: "vc-table-cell-status" }, {
4563
+ default: O(() => [
4564
+ Q(T(e.value), 1)
4565
+ ]),
4566
+ _: 1
4567
+ }));
4568
+ }
4569
+ }), fi = { class: "vc-table-cell-status-icon" }, vi = /* @__PURE__ */ V({
4570
+ __name: "CellStatusIcon",
4571
+ props: {
4572
+ value: {}
4573
+ },
4574
+ setup(e) {
4575
+ return (t, n) => (v(), y("div", fi, [
4576
+ typeof e.value == "boolean" ? (v(), N(r(al), {
4577
+ key: 0,
4578
+ status: e.value
4579
+ }, null, 8, ["status"])) : w("", !0)
4580
+ ]));
4581
+ }
4582
+ }), gi = /* @__PURE__ */ V({
4583
+ __name: "CellLink",
4584
+ props: {
4585
+ value: {}
4586
+ },
4587
+ setup(e) {
4588
+ return (t, n) => (v(), N(r(Qa), { class: "vc-table-cell-link" }, {
4589
+ default: O(() => [
4590
+ Q(T(e.value), 1)
4591
+ ]),
4592
+ _: 1
4593
+ }));
4594
+ }
4595
+ }), mi = ["innerHTML"], pi = 500, bi = /* @__PURE__ */ V({
4596
+ __name: "CellHtml",
4597
+ props: {
4598
+ value: {},
4599
+ maxLength: {}
4600
+ },
4601
+ setup(e) {
4602
+ const t = e, n = /* @__PURE__ */ new Map();
4603
+ function a(l) {
4604
+ if (n.has(l))
4605
+ return n.get(l);
4606
+ const s = Mt.sanitize(l, {
4607
+ ALLOWED_TAGS: [
4608
+ "p",
4609
+ "br",
4610
+ "strong",
4611
+ "em",
4612
+ "u",
4613
+ "s",
4614
+ "h1",
4615
+ "h2",
4616
+ "h3",
4617
+ "h4",
4618
+ "h5",
4619
+ "h6",
4620
+ "ul",
4621
+ "ol",
4622
+ "li",
4623
+ "blockquote",
4624
+ "pre",
4625
+ "code",
4626
+ "a",
4627
+ "img",
4628
+ "table",
4629
+ "thead",
4630
+ "tbody",
4631
+ "tr",
4632
+ "th",
4633
+ "td",
4634
+ "hr",
4635
+ "div",
4636
+ "span"
4637
+ ],
4638
+ ALLOWED_ATTR: ["href", "src", "alt", "title", "class", "id", "colspan", "rowspan", "align", "valign"],
4639
+ FORBID_TAGS: ["script", "object", "embed", "form", "input"],
4640
+ FORBID_ATTR: ["onerror", "onload", "onclick", "onmouseover", "onfocus", "onblur", "style"]
4641
+ });
4642
+ if (n.size >= pi) {
4643
+ const u = n.keys().next().value;
4644
+ u !== void 0 && n.delete(u);
4645
+ }
4646
+ return n.set(l, s), s;
4647
+ }
4648
+ const o = $(() => t.value ? a(String(t.value)) : ""), i = $(() => Un(o.value, t.maxLength || 30));
4649
+ return (l, s) => (v(), y("div", {
4650
+ class: "vc-table-cell-html",
4651
+ innerHTML: i.value
4652
+ }, null, 8, mi));
4653
+ }
4654
+ }), Yt = [
4655
+ { type: "text", component: Gt, config: { editable: !0 } },
4656
+ { type: "number", component: li, config: { editable: !0 } },
4657
+ { type: "money", component: ti, config: { editable: !0 } },
4658
+ { type: "date", component: Ze, config: { editable: !1 } },
4659
+ { type: "time", component: Ze, config: { editable: !1 } },
4660
+ { type: "datetime", component: Ze, config: { editable: !1 } },
4661
+ { type: "date-ago", component: ui, config: { editable: !1 } },
4662
+ { type: "image", component: ci, config: { editable: !1 } },
4663
+ { type: "status", component: di, config: { editable: !1 } },
4664
+ { type: "status-icon", component: vi, config: { editable: !1 } },
4665
+ { type: "link", component: gi, config: { editable: !1 } },
4666
+ { type: "html", component: bi, config: { editable: !1 } }
4667
+ ], Er = Object.freeze(Yt.map((e) => e.type));
4668
+ function yi() {
4669
+ const { register: e, has: t } = Ht();
4670
+ for (const n of Yt)
4671
+ t(n.type) || e(n);
4672
+ }
4673
+ yi();
4674
+ const Lr = /* @__PURE__ */ V({
4675
+ __name: "DynamicCellRenderer",
4676
+ props: {
4677
+ type: {},
4678
+ value: {},
4679
+ editable: { type: Boolean },
4680
+ label: {},
4681
+ fieldName: {},
4682
+ fieldId: {},
4683
+ rules: {},
4684
+ rowIndex: {},
4685
+ currency: {},
4686
+ format: {},
4687
+ variant: {},
4688
+ validateOnMount: { type: Boolean }
4689
+ },
4690
+ emits: ["update", "blur"],
4691
+ setup(e) {
4692
+ const { get: t } = Ht(), n = e, a = $(() => t(n.type)?.component || Gt), o = $(() => {
4693
+ const l = t(n.type)?.config?.editable ?? !1, s = {
4694
+ value: n.value
4695
+ };
4696
+ return l && n.editable && (s.editable = n.editable, s.label = n.label, s.fieldName = n.fieldName, s.fieldId = n.fieldId, s.rules = n.rules, s.rowIndex = n.rowIndex, n.validateOnMount && (s.validateOnMount = !0)), n.type === "money" && n.currency && (s.currency = n.currency), (n.type === "date" || n.type === "time" || n.type === "datetime") && n.variant && (s.variant = n.variant), n.format && (s.format = n.format), s;
4697
+ });
4698
+ return (i, l) => (v(), N(it(a.value), ne(o.value, {
4699
+ onUpdate: l[0] || (l[0] = (s) => i.$emit("update", s)),
4700
+ onBlur: l[1] || (l[1] = (s) => i.$emit("blur", s))
4701
+ }), null, 16));
4702
+ }
4703
+ }), Br = V({
4704
+ name: "SlotProxy",
4705
+ props: {
4706
+ slotFn: { type: Function, required: !0 },
4707
+ scope: { type: Object, default: () => ({}) }
4708
+ },
4709
+ setup(e) {
4710
+ return () => e.slotFn(e.scope);
4711
+ }
4712
+ }), Cr = (e, t) => {
4713
+ const n = t.arg ? parseInt(t.arg, 10) : 9e3, a = typeof t.value == "object" ? t.value : { blur: !0 };
4714
+ t.value ? (e.classList.add("v-loading"), a.size && e.setAttribute("data-loading-size", a.size), a.color && e.style.setProperty("--v-loading-spinner-color", a.color), a.blur === !1 && e.classList.add("v-loading--no-blur"), a.fullscreen && e.classList.add("v-loading--fullscreen"), e.style.setProperty("--v-loading-z-index", `${n}`)) : (e.classList.remove("v-loading", "v-loading--no-blur", "v-loading--fullscreen"), e.removeAttribute("data-loading-size"), e.style.removeProperty("--v-loading-z-index"), e.style.removeProperty("--v-loading-spinner-color"));
4715
+ };
4716
+ export {
4717
+ zt as $,
4718
+ Cr as A,
4719
+ Er as B,
4720
+ hr as C,
4721
+ yi as D,
4722
+ kr as E,
4723
+ Se as F,
4724
+ Ht as G,
4725
+ ia as H,
4726
+ Ke as I,
4727
+ sa as J,
4728
+ wr as K,
4729
+ fr as L,
4730
+ or as M,
4731
+ aa as N,
4732
+ st as O,
4733
+ se as P,
4734
+ ke as Q,
4735
+ Pe as R,
4736
+ er as S,
4737
+ Kn as T,
4738
+ nt as U,
4739
+ fe as V,
4740
+ la as W,
4741
+ je as X,
4742
+ ur as Y,
4743
+ sr as Z,
4744
+ Ze as _,
4745
+ Ca as a,
4746
+ Xo as a$,
4747
+ gr as a0,
4748
+ Ia as a1,
4749
+ vl as a2,
4750
+ $a as a3,
4751
+ wa as a4,
4752
+ Oa as a5,
4753
+ qi as a6,
4754
+ me as a7,
4755
+ Ma as a8,
4756
+ re as a9,
4757
+ Qi as aA,
4758
+ pr as aB,
4759
+ ar as aC,
4760
+ cr as aD,
4761
+ ir as aE,
4762
+ nr as aF,
4763
+ rr as aG,
4764
+ Xi as aH,
4765
+ Gi as aI,
4766
+ Jn as aJ,
4767
+ At as aK,
4768
+ Yi as aL,
4769
+ La as aM,
4770
+ _i as aN,
4771
+ br as aO,
4772
+ lr as aP,
4773
+ Ki as aQ,
4774
+ tr as aR,
4775
+ Kt as aS,
4776
+ yr as aT,
4777
+ Xl as aU,
4778
+ ra as aV,
4779
+ Ir as aW,
4780
+ Sr as aX,
4781
+ $r as aY,
4782
+ Br as aZ,
4783
+ Lr as a_,
4784
+ Ui as aa,
4785
+ zi as ab,
4786
+ Fi as ac,
4787
+ Pi as ad,
4788
+ vr as ae,
4789
+ Hi as af,
4790
+ mr as ag,
4791
+ fa as ah,
4792
+ da as ai,
4793
+ va as aj,
4794
+ _n as ak,
4795
+ Yn as al,
4796
+ na as am,
4797
+ ji as an,
4798
+ ca as ao,
4799
+ Xn as ap,
4800
+ Zn as aq,
4801
+ Wi as ar,
4802
+ Ji as as,
4803
+ Zi as at,
4804
+ ta as au,
4805
+ Wn as av,
4806
+ ea as aw,
4807
+ ua as ax,
4808
+ yt as ay,
4809
+ dr as az,
4810
+ ui as b,
4811
+ oa as b0,
4812
+ Gt as c,
4813
+ mt as d,
4814
+ bi as e,
4815
+ ci as f,
4816
+ gi as g,
4817
+ ti as h,
4818
+ li as i,
4819
+ di as j,
4820
+ vi as k,
4821
+ Ra as l,
4822
+ Al as m,
4823
+ Or as n,
4824
+ Sl as o,
4825
+ Ka as p,
4826
+ gt as q,
4827
+ Yo as r,
4828
+ jo as s,
4829
+ He as t,
4830
+ Qa as u,
4831
+ ol as v,
4832
+ qo as w,
4833
+ le as x,
4834
+ tl as y,
4835
+ al as z
4836
+ };