@opengis/form 0.0.49 → 0.0.50

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.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { defineComponent as U, ref as w, onMounted as ke, onUnmounted as Ye, createElementBlock as d, openBlock as u, createCommentVNode as D, renderSlot as Le, createElementVNode as l, toDisplayString as W, mergeProps as Te, computed as S, normalizeStyle as be, createTextVNode as ge, normalizeProps as ot, guardReactiveProps as nt, normalizeClass as E, mergeModels as ie, useModel as ue, withDirectives as ne, unref as ee, vModelText as ve, vModelCheckbox as Ct, createVNode as A, createBlock as me, resolveDynamicComponent as Fe, withCtx as Be, withModifiers as we, onBeforeUnmount as at, watch as re, createStaticVNode as ye, vModelRadio as Vt, Fragment as se, renderList as ce, reactive as Nt, vModelDynamic as qt, vShow as Xe, inject as ze, resolveComponent as mt, Transition as st, Teleport as Mt, nextTick as Ie, getCurrentInstance as Wt, watchEffect as Gt, toRef as Zt, provide as vt } from "vue";
1
+ import { defineComponent as U, ref as w, onMounted as ke, onUnmounted as Ye, createElementBlock as d, openBlock as i, createCommentVNode as D, renderSlot as Le, createElementVNode as l, toDisplayString as G, mergeProps as Te, computed as B, normalizeStyle as be, createTextVNode as ge, normalizeProps as ot, guardReactiveProps as nt, normalizeClass as E, mergeModels as re, useModel as ue, withDirectives as ne, unref as ee, vModelText as ve, vModelCheckbox as Ct, createVNode as A, createBlock as me, resolveDynamicComponent as Fe, withCtx as Be, withModifiers as we, onBeforeUnmount as at, watch as ie, createStaticVNode as ye, vModelRadio as Vt, Fragment as se, renderList as pe, reactive as Nt, vModelDynamic as qt, vShow as Xe, inject as ze, resolveComponent as mt, Transition as st, Teleport as Mt, nextTick as Ie, getCurrentInstance as Wt, watchEffect as Gt, toRef as Zt, provide as vt } from "vue";
2
2
  import { notify as de, VsModal as Lt, modal as Kt } from "@opengis/core";
3
3
  const Jt = { class: "w-full relative" }, Yt = {
4
4
  key: 0,
@@ -24,22 +24,22 @@ const Jt = { class: "w-full relative" }, Yt = {
24
24
  columns: {}
25
25
  },
26
26
  setup(o) {
27
- const e = w("uk"), t = (s) => {
28
- s.detail.key === "locale" && (e.value = s.detail.newValue);
27
+ const e = w("uk"), t = (a) => {
28
+ a.detail.key === "locale" && (e.value = a.detail.newValue);
29
29
  };
30
30
  return ke(() => {
31
31
  e.value = localStorage.locale, window.addEventListener("storage", t);
32
32
  }), Ye(() => {
33
33
  window.removeEventListener("resize", t);
34
- }), (s, n) => (u(), d("div", Jt, [
35
- s.ua || s.label ? (u(), d("div", Yt, [
36
- l("span", Xt, W(s.item[e.value] || s.ua || s.label), 1),
37
- s.item?.rules?.includes("required") ? (u(), d("span", Qt, "*")) : D("", !0)
34
+ }), (a, n) => (i(), d("div", Jt, [
35
+ a.ua || a.label ? (i(), d("div", Yt, [
36
+ l("span", Xt, G(a.item[e.value] || a.ua || a.label), 1),
37
+ a.item?.rules?.includes("required") ? (i(), d("span", Qt, "*")) : D("", !0)
38
38
  ])) : D("", !0),
39
- Le(s.$slots, "default", Te(s.$attrs, {
40
- class: { "opacity-60": s.item.disabled }
39
+ Le(a.$slots, "default", Te(a.$attrs, {
40
+ class: { "opacity-60": a.item.disabled }
41
41
  })),
42
- s.error ? (u(), d("span", el, W(s.error), 1)) : D("", !0)
42
+ a.error ? (i(), d("span", el, G(a.error), 1)) : D("", !0)
43
43
  ]));
44
44
  }
45
45
  }), ll = { class: "w-full relative flex flex-row items-center gap-2" }, ol = {
@@ -63,39 +63,39 @@ const Jt = { class: "w-full relative" }, Yt = {
63
63
  columns: { default: () => ({ container: 12, label: 3 }) }
64
64
  },
65
65
  setup(o) {
66
- const e = o, t = S(() => e.columns ?? { container: 12, label: 3 }), s = S(() => {
67
- const { container: i, label: c } = t.value;
68
- return !i || i <= 0 ? 0 : Math.min(Math.max(c ?? 0, 0), i) / i;
69
- }), n = S(() => e.item?.type === "html" || s.value <= 0 ? !1 : !!(e.ua || e.label)), a = S(() => {
66
+ const e = o, t = B(() => e.columns ?? { container: 12, label: 3 }), a = B(() => {
67
+ const { container: u, label: c } = t.value;
68
+ return !u || u <= 0 ? 0 : Math.min(Math.max(c ?? 0, 0), u) / u;
69
+ }), n = B(() => e.item?.type === "html" || a.value <= 0 ? !1 : !!(e.ua || e.label)), s = B(() => {
70
70
  if (!n.value) return {};
71
- const i = `${s.value * 100}%`;
72
- return { flexBasis: i, maxWidth: i };
73
- }), r = S(() => {
74
- const { container: i, label: c } = t.value;
75
- if (!i || i <= 0) return {};
71
+ const u = `${a.value * 100}%`;
72
+ return { flexBasis: u, maxWidth: u };
73
+ }), r = B(() => {
74
+ const { container: u, label: c } = t.value;
75
+ if (!u || u <= 0) return {};
76
76
  if (e.item?.type === "html") return { flexBasis: "100%", maxWidth: "100%" };
77
77
  if (!n.value) return { flexBasis: "100%", maxWidth: "100%" };
78
- const p = Math.max(i - Math.max(c ?? 0, 0), 0) / i;
78
+ const p = Math.max(u - Math.max(c ?? 0, 0), 0) / u;
79
79
  if (!p) return {};
80
80
  const f = `${p * 100}%`;
81
81
  return { flexBasis: f, maxWidth: f };
82
82
  });
83
- return (i, c) => (u(), d("div", ll, [
84
- n.value ? (u(), d("span", {
83
+ return (u, c) => (i(), d("div", ll, [
84
+ n.value ? (i(), d("span", {
85
85
  key: 0,
86
86
  class: "text-sm text-gray-900 font-medium flex shrink-0",
87
- style: be(a.value)
87
+ style: be(s.value)
88
88
  }, [
89
- ge(W(i.ua || i.label) + " ", 1),
90
- i.item?.rules?.includes("required") && (i.ua || i.label) ? (u(), d("span", ol, "*")) : D("", !0)
89
+ ge(G(u.ua || u.label) + " ", 1),
90
+ u.item?.rules?.includes("required") && (u.ua || u.label) ? (i(), d("span", ol, "*")) : D("", !0)
91
91
  ], 4)) : D("", !0),
92
92
  l("div", {
93
93
  class: "flex-1 min-w-0",
94
94
  style: be(r.value)
95
95
  }, [
96
- Le(i.$slots, "default", ot(nt(i.$attrs)))
96
+ Le(u.$slots, "default", ot(nt(u.$attrs)))
97
97
  ], 4),
98
- i.error ? (u(), d("span", nl, W(i.error), 1)) : D("", !0)
98
+ u.error ? (i(), d("span", nl, G(u.error), 1)) : D("", !0)
99
99
  ]));
100
100
  }
101
101
  }), sl = { class: "w-full relative" }, rl = {
@@ -116,9 +116,9 @@ const Jt = { class: "w-full relative" }, Yt = {
116
116
  columns: {}
117
117
  },
118
118
  setup(o) {
119
- return (e, t) => (u(), d("div", sl, [
119
+ return (e, t) => (i(), d("div", sl, [
120
120
  Le(e.$slots, "default", ot(nt(e.$attrs))),
121
- e.error ? (u(), d("span", rl, W(e.error), 1)) : D("", !0)
121
+ e.error ? (i(), d("span", rl, G(e.error), 1)) : D("", !0)
122
122
  ]));
123
123
  }
124
124
  }), ul = { class: "flex-1 min-w-0" }, dl = {
@@ -149,9 +149,9 @@ const Jt = { class: "w-full relative" }, Yt = {
149
149
  },
150
150
  setup(o) {
151
151
  const e = o, t = w("uk");
152
- S(() => (e.item ?? {})?.[t.value] ?? e.ua ?? e.label ?? "");
153
- const s = S(() => e.item?.description ?? ""), n = S(() => Array.isArray(e.item?.rules) && e.item.rules.includes("required")), a = S(() => (typeof e.error == "string" ? e.error : "") ?? ""), r = (i) => {
154
- i.key === "locale" && (t.value = i.newValue ?? "uk");
152
+ B(() => (e.item ?? {})?.[t.value] ?? e.ua ?? e.label ?? "");
153
+ const a = B(() => e.item?.description ?? ""), n = B(() => Array.isArray(e.item?.rules) && e.item.rules.includes("required")), s = B(() => (typeof e.error == "string" ? e.error : "") ?? ""), r = (u) => {
154
+ u.key === "locale" && (t.value = u.newValue ?? "uk");
155
155
  };
156
156
  return ke(() => {
157
157
  try {
@@ -161,24 +161,24 @@ const Jt = { class: "w-full relative" }, Yt = {
161
161
  window.addEventListener("storage", r);
162
162
  }), Ye(() => {
163
163
  window.removeEventListener("storage", r);
164
- }), (i, c) => (u(), d("div", {
165
- class: E(["w-full relative", { "opacity-60": i.item?.disabled }])
164
+ }), (u, c) => (i(), d("div", {
165
+ class: E(["w-full relative", { "opacity-60": u.item?.disabled }])
166
166
  }, [
167
167
  l("div", {
168
- class: E(["gap-2 md:flex-row md:items-center md:justify-between", [["switcher", "native-select"].includes(i.item.type) ? "flex flex-col" : ""]])
168
+ class: E(["gap-2 md:flex-row md:items-center md:justify-between", [["switcher", "native-select"].includes(u.item.type) ? "flex flex-col" : ""]])
169
169
  }, [
170
170
  l("div", ul, [
171
- i.ua || i.label ? (u(), d("p", dl, [
172
- l("span", cl, W(i.item[t.value] || i.ua || i.label), 1),
173
- n.value ? (u(), d("span", pl, "*")) : D("", !0)
171
+ u.ua || u.label ? (i(), d("p", dl, [
172
+ l("span", cl, G(u.item[t.value] || u.ua || u.label), 1),
173
+ n.value ? (i(), d("span", pl, "*")) : D("", !0)
174
174
  ])) : D("", !0),
175
- s.value ? (u(), d("p", fl, W(s.value), 1)) : D("", !0)
175
+ a.value ? (i(), d("p", fl, G(a.value), 1)) : D("", !0)
176
176
  ]),
177
177
  l("div", ml, [
178
- Le(i.$slots, "default", ot(nt(i.$attrs)))
178
+ Le(u.$slots, "default", ot(nt(u.$attrs)))
179
179
  ])
180
180
  ], 2),
181
- a.value ? (u(), d("p", vl, W(a.value), 1)) : D("", !0)
181
+ s.value ? (i(), d("p", vl, G(s.value), 1)) : D("", !0)
182
182
  ], 2));
183
183
  }
184
184
  }), gl = {
@@ -189,7 +189,7 @@ const Jt = { class: "w-full relative" }, Yt = {
189
189
  };
190
190
  function _e(o) {
191
191
  return {
192
- inputClass: S(() => {
192
+ inputClass: B(() => {
193
193
  const t = `disabled:opacity-50 disabled:cursor-not-allowed outline-none focus:ring-2 focus:ring-ring focus:ring-${o?.primaryColor || "blue"}-500 border border-solid border-stone-200 rounded-md text-sm text-stone-800 placeholder:text-stone-400 `;
194
194
  return o?.size === "sm" ? `${t}h-[32px]` : `${t}h-[38px]`;
195
195
  })
@@ -197,7 +197,7 @@ function _e(o) {
197
197
  }
198
198
  const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
199
199
  __name: "vs-input-password",
200
- props: /* @__PURE__ */ ie({
200
+ props: /* @__PURE__ */ re({
201
201
  style: { default: () => ({}) },
202
202
  customClass: { default: "" },
203
203
  disabled: { type: Boolean, default: !1 },
@@ -211,10 +211,10 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
211
211
  }),
212
212
  emits: ["update:modelValue"],
213
213
  setup(o) {
214
- const e = o, { inputClass: t } = _e(e.style), s = ue(o, "modelValue");
215
- return (n, a) => ne((u(), d("input", {
214
+ const e = o, { inputClass: t } = _e(e.style), a = ue(o, "modelValue");
215
+ return (n, s) => ne((i(), d("input", {
216
216
  type: "password",
217
- "onUpdate:modelValue": a[0] || (a[0] = (r) => s.value = r),
217
+ "onUpdate:modelValue": s[0] || (s[0] = (r) => a.value = r),
218
218
  placeholder: n.placeholder,
219
219
  disabled: n.disabled,
220
220
  class: E(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [ee(t), { "!border-red-600": n.error }]]),
@@ -222,12 +222,12 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
222
222
  border: "1px solid #CFD9E0"
223
223
  }
224
224
  }, null, 10, bl)), [
225
- [ve, s.value]
225
+ [ve, a.value]
226
226
  ]);
227
227
  }
228
228
  }), xl = ["placeholder", "disabled"], Je = /* @__PURE__ */ U({
229
229
  __name: "vs-input-text",
230
- props: /* @__PURE__ */ ie({
230
+ props: /* @__PURE__ */ re({
231
231
  style: { default: () => ({}) },
232
232
  customClass: { default: "" },
233
233
  disabled: { type: Boolean, default: !1 },
@@ -241,10 +241,10 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
241
241
  }),
242
242
  emits: ["update:modelValue"],
243
243
  setup(o) {
244
- const e = o, { inputClass: t } = _e(e.style), s = ue(o, "modelValue");
245
- return (n, a) => ne((u(), d("input", {
244
+ const e = o, { inputClass: t } = _e(e.style), a = ue(o, "modelValue");
245
+ return (n, s) => ne((i(), d("input", {
246
246
  type: "text",
247
- "onUpdate:modelValue": a[0] || (a[0] = (r) => s.value = r),
247
+ "onUpdate:modelValue": s[0] || (s[0] = (r) => a.value = r),
248
248
  placeholder: n.placeholder,
249
249
  disabled: n.disabled,
250
250
  class: E(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [ee(t), { "!border-red-600": n.error }]]),
@@ -252,12 +252,12 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
252
252
  border: "1px solid #CFD9E0"
253
253
  }
254
254
  }, null, 10, xl)), [
255
- [ve, s.value]
255
+ [ve, a.value]
256
256
  ]);
257
257
  }
258
258
  }), wl = ["placeholder", "min", "max"], kl = /* @__PURE__ */ U({
259
259
  __name: "vs-input-number",
260
- props: /* @__PURE__ */ ie({
260
+ props: /* @__PURE__ */ re({
261
261
  min: {},
262
262
  max: {},
263
263
  style: { default: () => ({}) },
@@ -273,11 +273,11 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
273
273
  }),
274
274
  emits: ["update:modelValue"],
275
275
  setup(o) {
276
- const e = o, { inputClass: t } = _e(e.style), s = ue(o, "modelValue");
277
- return (n, a) => ne((u(), d("input", {
276
+ const e = o, { inputClass: t } = _e(e.style), a = ue(o, "modelValue");
277
+ return (n, s) => ne((i(), d("input", {
278
278
  type: "number",
279
279
  step: "any",
280
- "onUpdate:modelValue": a[0] || (a[0] = (r) => s.value = r),
280
+ "onUpdate:modelValue": s[0] || (s[0] = (r) => a.value = r),
281
281
  placeholder: n.placeholder,
282
282
  class: E(["py-1.5 px-3 block w-full bg-white", [ee(t)]]),
283
283
  style: {
@@ -286,13 +286,13 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
286
286
  min: n.min,
287
287
  max: n.max
288
288
  }, null, 10, wl)), [
289
- [ve, s.value]
289
+ [ve, a.value]
290
290
  ]);
291
291
  }
292
292
  }), X = (o, e) => {
293
293
  const t = o.__vccOpts || o;
294
- for (const [s, n] of e)
295
- t[s] = n;
294
+ for (const [a, n] of e)
295
+ t[a] = n;
296
296
  return t;
297
297
  }, _l = {}, $l = {
298
298
  xmlns: "http://www.w3.org/2000/svg",
@@ -305,7 +305,7 @@ const bl = ["placeholder", "disabled"], yl = /* @__PURE__ */ U({
305
305
  class: "icon icon-tabler icons-tabler-outline icon-tabler-check"
306
306
  };
307
307
  function Cl(o, e) {
308
- return u(), d("svg", $l, e[0] || (e[0] = [
308
+ return i(), d("svg", $l, e[0] || (e[0] = [
309
309
  l("path", {
310
310
  stroke: "none",
311
311
  d: "M0 0h24v24H0z",
@@ -327,27 +327,27 @@ const Vl = /* @__PURE__ */ X(_l, [["render", Cl]]), Ml = { class: "flex items-ce
327
327
  },
328
328
  emits: ["update:modelValue"],
329
329
  setup(o, { emit: e }) {
330
- const t = e, s = o, n = S({
331
- get: () => s.modelValue,
332
- set: (a) => t("update:modelValue", a)
330
+ const t = e, a = o, n = B({
331
+ get: () => a.modelValue,
332
+ set: (s) => t("update:modelValue", s)
333
333
  });
334
- return (a, r) => (u(), d("div", Ml, [
334
+ return (s, r) => (i(), d("div", Ml, [
335
335
  ne(l("input", {
336
336
  type: "checkbox",
337
- value: a.value,
338
- "onUpdate:modelValue": r[0] || (r[0] = (i) => n.value = i),
339
- class: E(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer", { "!cursor-not-allowed": a.disabled }]),
340
- id: a.id,
341
- disabled: a.disabled
337
+ value: s.value,
338
+ "onUpdate:modelValue": r[0] || (r[0] = (u) => n.value = u),
339
+ class: E(["shrink-0 border border-solid hidden border-gray-700 w-3.5 h-3.5 rounded text-blue-600 focus:ring-offset-0 dark:bg-neutral-800 dark:border-neutral-700 cursor-pointer", { "!cursor-not-allowed": s.disabled }]),
340
+ id: s.id,
341
+ disabled: s.disabled
342
342
  }, null, 10, Ll), [
343
343
  [Ct, n.value]
344
344
  ]),
345
345
  l("label", {
346
- for: a.id,
347
- class: E(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300", { "!cursor-not-allowed": a.disabled }])
346
+ for: s.id,
347
+ class: E(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300", { "!cursor-not-allowed": s.disabled }])
348
348
  }, [
349
349
  l("div", {
350
- class: E(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [n.value ? "bg-blue-600 border-blue-600" : "bg-white border-gray-600", a.error ? "border-red-600" : ""]])
350
+ class: E(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [n.value ? "bg-blue-600 border-blue-600" : "bg-white border-gray-600", s.error ? "border-red-600" : ""]])
351
351
  }, [
352
352
  A(Vl, {
353
353
  height: "12",
@@ -355,8 +355,8 @@ const Vl = /* @__PURE__ */ X(_l, [["render", Cl]]), Ml = { class: "flex items-ce
355
355
  })
356
356
  ], 2),
357
357
  l("span", Bl, [
358
- Le(a.$slots, "default", {}, () => [
359
- ge(W(a.label), 1)
358
+ Le(s.$slots, "default", {}, () => [
359
+ ge(G(s.label), 1)
360
360
  ])
361
361
  ])
362
362
  ], 10, Sl)
@@ -379,41 +379,41 @@ const Vl = /* @__PURE__ */ X(_l, [["render", Cl]]), Ml = { class: "flex items-ce
379
379
  },
380
380
  emits: ["update:modelValue"],
381
381
  setup(o, { emit: e }) {
382
- const t = o, s = e, n = S({
382
+ const t = o, a = e, n = B({
383
383
  get: () => t.modelValue,
384
- set: (i) => {
385
- s("update:modelValue", i);
384
+ set: (u) => {
385
+ a("update:modelValue", u);
386
386
  }
387
- }), a = S(() => Array.isArray(n.value) ? n.value.includes(t.value) : n.value === !0 || n.value === t.value), r = S(() => t.style?.size === "xs" ? "p-1.5 text-xs" : t.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs");
388
- return (i, c) => (u(), d("label", {
389
- class: E(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg", [r.value, a.value ? "ring-blue-500" : "border border-gray-200 ring-transparent"]])
387
+ }), s = B(() => Array.isArray(n.value) ? n.value.includes(t.value) : n.value === !0 || n.value === t.value), r = B(() => t.style?.size === "xs" ? "p-1.5 text-xs" : t.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs");
388
+ return (u, c) => (i(), d("label", {
389
+ class: E(["group relative flex justify-center items-center gap-x-3 text-center bg-white text-gray-800 ring-ring ring-2 cursor-pointer rounded-lg", [r.value, s.value ? "ring-blue-500" : "border border-gray-200 ring-transparent"]])
390
390
  }, [
391
391
  ne(l("input", {
392
392
  type: "checkbox",
393
393
  class: "hidden",
394
- name: i.id,
395
- value: i.value,
394
+ name: u.id,
395
+ value: u.value,
396
396
  "onUpdate:modelValue": c[0] || (c[0] = (p) => n.value = p),
397
- disabled: i.disabled
397
+ disabled: u.disabled
398
398
  }, null, 8, El), [
399
399
  [Ct, n.value]
400
400
  ]),
401
401
  l("span", Il, [
402
- i.icon || i.imgUrl ? (u(), d("span", zl, [
403
- i.icon ? (u(), d("i", {
402
+ u.icon || u.imgUrl ? (i(), d("span", zl, [
403
+ u.icon ? (i(), d("i", {
404
404
  key: 0,
405
- class: E(i.icon)
405
+ class: E(u.icon)
406
406
  }, null, 2)) : D("", !0),
407
- i.imgUrl ? (u(), d("img", {
407
+ u.imgUrl ? (i(), d("img", {
408
408
  key: 1,
409
- src: i.imgUrl,
409
+ src: u.imgUrl,
410
410
  width: "16",
411
411
  height: "16",
412
412
  alt: "icon"
413
413
  }, null, 8, Al)) : D("", !0)
414
414
  ])) : D("", !0),
415
- Le(i.$slots, "default", {}, () => [
416
- ge(W(i.label), 1)
415
+ Le(u.$slots, "default", {}, () => [
416
+ ge(G(u.label), 1)
417
417
  ])
418
418
  ])
419
419
  ], 2));
@@ -435,32 +435,32 @@ const Vl = /* @__PURE__ */ X(_l, [["render", Cl]]), Ml = { class: "flex items-ce
435
435
  },
436
436
  emits: ["update:modelValue"],
437
437
  setup(o, { emit: e }) {
438
- const t = o, s = e, n = `radio-${Math.floor(Math.random() * 1e4)}`, a = S({
438
+ const t = o, a = e, n = `radio-${Math.floor(Math.random() * 1e4)}`, s = B({
439
439
  get: () => Array.isArray(t.modelValue) ? Array.isArray(t.modelValue) && t.modelValue.includes(t.value) : t.modelValue,
440
- set: (i) => {
440
+ set: (u) => {
441
441
  if (Array.isArray(t.modelValue)) {
442
442
  let c = [...t.modelValue];
443
- i ? c.includes(t.value) || c.push(t.value) : c = c.filter((p) => p !== t.value), s("update:modelValue", c);
443
+ u ? c.includes(t.value) || c.push(t.value) : c = c.filter((p) => p !== t.value), a("update:modelValue", c);
444
444
  } else
445
- s("update:modelValue", i);
445
+ a("update:modelValue", u);
446
446
  }
447
447
  }), r = w(`vs-checkbox-${t.view || "default"}`);
448
- return (i, c) => (u(), d("div", Fl, [
449
- (u(), me(Fe(r.value === "vs-checkbox-buttons" ? ee(Tl) : ee(jl)), {
450
- value: i.value,
451
- label: i.label,
452
- info: i.option?.info,
453
- disabled: i.disabled,
454
- modelValue: a.value,
455
- "onUpdate:modelValue": c[0] || (c[0] = (p) => a.value = p),
448
+ return (u, c) => (i(), d("div", Fl, [
449
+ (i(), me(Fe(r.value === "vs-checkbox-buttons" ? ee(Tl) : ee(jl)), {
450
+ value: u.value,
451
+ label: u.label,
452
+ info: u.option?.info,
453
+ disabled: u.disabled,
454
+ modelValue: s.value,
455
+ "onUpdate:modelValue": c[0] || (c[0] = (p) => s.value = p),
456
456
  id: n,
457
- icon: i.icon,
458
- imgUrl: i.imgUrl,
459
- style: be(i.style),
460
- error: i.error
457
+ icon: u.icon,
458
+ imgUrl: u.imgUrl,
459
+ style: be(u.style),
460
+ error: u.error
461
461
  }, {
462
462
  default: Be(() => [
463
- ge(W(i.label), 1)
463
+ ge(G(u.label), 1)
464
464
  ]),
465
465
  _: 1
466
466
  }, 8, ["value", "label", "info", "disabled", "modelValue", "icon", "imgUrl", "style", "error"]))
@@ -477,7 +477,7 @@ const Vl = /* @__PURE__ */ X(_l, [["render", Cl]]), Ml = { class: "flex items-ce
477
477
  class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"
478
478
  };
479
479
  function Ul(o, e) {
480
- return u(), d("svg", Dl, e[0] || (e[0] = [
480
+ return i(), d("svg", Dl, e[0] || (e[0] = [
481
481
  l("path", {
482
482
  stroke: "none",
483
483
  d: "M0 0h24v24H0z",
@@ -497,7 +497,7 @@ const Pl = /* @__PURE__ */ X(Ol, [["render", Ul]]), Rl = {}, Hl = {
497
497
  class: "icon icon-tabler icons-tabler-outline icon-tabler-x"
498
498
  };
499
499
  function Nl(o, e) {
500
- return u(), d("svg", Hl, e[0] || (e[0] = [
500
+ return i(), d("svg", Hl, e[0] || (e[0] = [
501
501
  l("path", {
502
502
  stroke: "none",
503
503
  d: "M0 0h24v24H0z",
@@ -519,7 +519,7 @@ const ql = /* @__PURE__ */ X(Rl, [["render", Nl]]), Wl = {}, Gl = {
519
519
  "stroke-linejoin": "round"
520
520
  };
521
521
  function Zl(o, e) {
522
- return u(), d("svg", Gl, e[0] || (e[0] = [
522
+ return i(), d("svg", Gl, e[0] || (e[0] = [
523
523
  l("path", {
524
524
  stroke: "none",
525
525
  d: "M0 0h24v24H0z",
@@ -538,7 +538,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
538
538
  class: "text-red-500 text-[14px]"
539
539
  }, Xl = ["title"], Ql = ["disabled"], Bt = /* @__PURE__ */ U({
540
540
  __name: "vs-input-switcher",
541
- props: /* @__PURE__ */ ie({
541
+ props: /* @__PURE__ */ re({
542
542
  rules: { default: () => [] },
543
543
  view: { default: "checkbox" },
544
544
  label: { default: "" },
@@ -558,29 +558,29 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
558
558
  emits: ["update:modelValue"],
559
559
  setup(o) {
560
560
  const e = o, t = ue(o, "modelValue");
561
- return (s, n) => e.view === "checkbox" ? (u(), d("div", Jl, [
561
+ return (a, n) => e.view === "checkbox" ? (i(), d("div", Jl, [
562
562
  A(St, {
563
563
  modelValue: t.value,
564
- "onUpdate:modelValue": n[0] || (n[0] = (a) => t.value = a),
565
- label: s.text,
566
- error: s.error || ""
564
+ "onUpdate:modelValue": n[0] || (n[0] = (s) => t.value = s),
565
+ label: a.text,
566
+ error: a.error || ""
567
567
  }, null, 8, ["modelValue", "label", "error"]),
568
- s.rules?.includes("required") ? (u(), d("span", Yl, "*")) : D("", !0),
569
- s.i ? (u(), d("button", {
568
+ a.rules?.includes("required") ? (i(), d("span", Yl, "*")) : D("", !0),
569
+ a.i ? (i(), d("button", {
570
570
  key: 1,
571
571
  class: "cursor-pointer",
572
- title: s.i,
572
+ title: a.i,
573
573
  onClick: n[1] || (n[1] = we(() => {
574
574
  }, ["prevent"]))
575
575
  }, [
576
576
  A(ee(Kl), { class: "text-gray-500 w-[14px] h-[14px]" })
577
577
  ], 8, Xl)) : D("", !0)
578
- ])) : (u(), d("button", {
578
+ ])) : (i(), d("button", {
579
579
  key: 1,
580
580
  type: "button",
581
- class: E(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50", [t.value ? `bg-${s.style?.primaryColor || "blue"}-500` : "bg-stone-200", s.customClass]]),
582
- disabled: s.disabled,
583
- onClick: n[2] || (n[2] = (a) => t.value = !t.value)
581
+ class: E(["inline-flex h-5 w-9 shrink-0 px-[2px] cursor-pointer items-center rounded-full shadow-sm disabled:cursor-not-allowed disabled:opacity-50", [t.value ? `bg-${a.style?.primaryColor || "blue"}-500` : "bg-stone-200", a.customClass]]),
582
+ disabled: a.disabled,
583
+ onClick: n[2] || (n[2] = (s) => t.value = !t.value)
584
584
  }, [
585
585
  l("span", {
586
586
  "data-state": "checked",
@@ -602,7 +602,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
602
602
  placeholder: {}
603
603
  },
604
604
  setup(o) {
605
- return (e, t) => (u(), d("div", {
605
+ return (e, t) => (i(), d("div", {
606
606
  id: e.name,
607
607
  class: E(["text-gray-900", e.customClass]),
608
608
  innerHTML: e.html ? e.html : e.text
@@ -610,7 +610,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
610
610
  }
611
611
  }), to = ["placeholder", "disabled", "name"], lo = /* @__PURE__ */ U({
612
612
  __name: "vs-input-mask",
613
- props: /* @__PURE__ */ ie({
613
+ props: /* @__PURE__ */ re({
614
614
  name: {},
615
615
  mask: { default: "" },
616
616
  unmask: { type: Boolean, default: !1 },
@@ -626,12 +626,12 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
626
626
  }),
627
627
  emits: ["update:modelValue"],
628
628
  setup(o) {
629
- const e = o, { inputClass: t } = _e(e.style), s = ue(o, "modelValue"), n = w(null);
630
- let a = null;
629
+ const e = o, { inputClass: t } = _e(e.style), a = ue(o, "modelValue"), n = w(null);
630
+ let s = null;
631
631
  return ke(async () => {
632
632
  if (n.value) {
633
633
  const { default: r } = await import("./index-W-qQIppj.js");
634
- a = r(n.value, {
634
+ s = r(n.value, {
635
635
  mask: e.mask || "",
636
636
  definitions: {
637
637
  9: /[0-9]/,
@@ -639,16 +639,16 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
639
639
  "*": /[a-zA-Z0-9]/
640
640
  },
641
641
  lazy: !1
642
- }), a.on("accept", () => {
643
- s.value = e.unmask ? a.unmaskedValue : a.value;
644
- }), a.on("complete", () => {
645
- s.value = e.unmask ? a.unmaskedValue : a.value;
646
- }), a.value = s.value ?? "";
642
+ }), s.on("accept", () => {
643
+ a.value = e.unmask ? s.unmaskedValue : s.value;
644
+ }), s.on("complete", () => {
645
+ a.value = e.unmask ? s.unmaskedValue : s.value;
646
+ }), s.value = a.value ?? "";
647
647
  }
648
648
  }), at(() => {
649
- a?.destroy();
650
- }), re(() => e.mask, (r) => {
651
- a && a.updateOptions({
649
+ s?.destroy();
650
+ }), ie(() => e.mask, (r) => {
651
+ s && s.updateOptions({
652
652
  mask: r,
653
653
  definitions: {
654
654
  9: /[0-9]/,
@@ -656,9 +656,9 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
656
656
  "*": /[a-zA-Z0-9]/
657
657
  }
658
658
  });
659
- }), re(s, (r) => {
660
- a && a.unmaskedValue !== r && (a.value = r || "");
661
- }), (r, i) => (u(), d("input", {
659
+ }), ie(a, (r) => {
660
+ s && s.unmaskedValue !== r && (s.value = r || "");
661
+ }), (r, u) => (i(), d("input", {
662
662
  type: "text",
663
663
  ref_key: "inputEl",
664
664
  ref: n,
@@ -673,7 +673,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
673
673
  }
674
674
  }), oo = { class: "relative w-full bg-white rounded-lg" }, no = ["placeholder", "disabled"], ao = /* @__PURE__ */ U({
675
675
  __name: "vs-input-email",
676
- props: /* @__PURE__ */ ie({
676
+ props: /* @__PURE__ */ re({
677
677
  style: { default: () => ({}) },
678
678
  customClass: { default: "" },
679
679
  disabled: { type: Boolean, default: !1 },
@@ -687,12 +687,12 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
687
687
  }),
688
688
  emits: ["update:modelValue"],
689
689
  setup(o) {
690
- const e = o, { inputClass: t } = _e(e.style), s = ue(o, "modelValue");
691
- return (n, a) => (u(), d("div", oo, [
692
- a[1] || (a[1] = ye('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>', 1)),
690
+ const e = o, { inputClass: t } = _e(e.style), a = ue(o, "modelValue");
691
+ return (n, s) => (i(), d("div", oo, [
692
+ s[1] || (s[1] = ye('<div class="absolute bottom-2/4 translate-y-2/4 left-[10px] cursor-pointer"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="stroke-gray-500 transition-all"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M3 7a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-10z"></path><path d="M3 7l9 6l9 -6"></path></svg></div>', 1)),
693
693
  ne(l("input", {
694
694
  type: "email",
695
- "onUpdate:modelValue": a[0] || (a[0] = (r) => s.value = r),
695
+ "onUpdate:modelValue": s[0] || (s[0] = (r) => a.value = r),
696
696
  placeholder: n.placeholder,
697
697
  disabled: n.disabled,
698
698
  class: E(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [ee(t), { "!border-red-600": n.error }]]),
@@ -700,13 +700,13 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
700
700
  border: "1px solid #CFD9E0"
701
701
  }
702
702
  }, null, 10, no), [
703
- [ve, s.value]
703
+ [ve, a.value]
704
704
  ])
705
705
  ]));
706
706
  }
707
707
  }), so = ["value", "disabled"], ro = { class: "text-[13px] text-gray-700" }, io = /* @__PURE__ */ U({
708
708
  __name: "vs-input-radio-default",
709
- props: /* @__PURE__ */ ie({
709
+ props: /* @__PURE__ */ re({
710
710
  style: {},
711
711
  customClass: { default: "" },
712
712
  disabled: { type: Boolean, default: !1 },
@@ -723,11 +723,11 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
723
723
  emits: ["update:modelValue"],
724
724
  setup(o) {
725
725
  const e = ue(o, "modelValue");
726
- return (t, s) => (u(), d("label", {
726
+ return (t, a) => (i(), d("label", {
727
727
  class: E(["flex items-center gap-0", [t.customClass]])
728
728
  }, [
729
729
  ne(l("input", {
730
- "onUpdate:modelValue": s[0] || (s[0] = (n) => e.value = n),
730
+ "onUpdate:modelValue": a[0] || (a[0] = (n) => e.value = n),
731
731
  type: "radio",
732
732
  value: t.value,
733
733
  disabled: t.disabled,
@@ -741,17 +741,17 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
741
741
  t.disabled ? "opacity-50 cursor-not-allowed" : ""
742
742
  ]])
743
743
  }, [
744
- e.value == t.value ? (u(), d("span", {
744
+ e.value == t.value ? (i(), d("span", {
745
745
  key: 0,
746
746
  class: E(["w-[12px] h-[12px] shrink-0 rounded-full", [`bg-${t.style?.primaryColor || "blue"}-500`]])
747
747
  }, null, 2)) : D("", !0)
748
748
  ], 2),
749
- l("span", ro, W(t.text), 1)
749
+ l("span", ro, G(t.text), 1)
750
750
  ], 2));
751
751
  }
752
752
  }), uo = ["value", "disabled"], co = { class: "text-[13px] text-gray-700" }, po = /* @__PURE__ */ U({
753
753
  __name: "vs-input-radio-buttons",
754
- props: /* @__PURE__ */ ie({
754
+ props: /* @__PURE__ */ re({
755
755
  style: {},
756
756
  customClass: { default: "" },
757
757
  disabled: { type: Boolean, default: !1 },
@@ -768,14 +768,14 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
768
768
  emits: ["update:modelValue"],
769
769
  setup(o) {
770
770
  const e = ue(o, "modelValue");
771
- return (t, s) => (u(), d("label", {
771
+ return (t, a) => (i(), d("label", {
772
772
  class: E(["flex items-center border rounded-lg px-2 py-1", [
773
773
  e.value == t.value ? `ring-2 ring-ring ring-${t.style?.primaryColor || "blue"}-500` : "",
774
774
  t.customClass
775
775
  ]])
776
776
  }, [
777
777
  ne(l("input", {
778
- "onUpdate:modelValue": s[0] || (s[0] = (n) => e.value = n),
778
+ "onUpdate:modelValue": a[0] || (a[0] = (n) => e.value = n),
779
779
  type: "radio",
780
780
  value: t.value,
781
781
  disabled: t.disabled,
@@ -783,7 +783,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
783
783
  }, null, 8, uo), [
784
784
  [Vt, e.value]
785
785
  ]),
786
- l("span", co, W(t.text), 1)
786
+ l("span", co, G(t.text), 1)
787
787
  ], 2));
788
788
  }
789
789
  }), fo = {
@@ -791,7 +791,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
791
791
  "vs-input-radio-buttons": po
792
792
  }, gt = /* @__PURE__ */ U({
793
793
  __name: "vs-input-radio",
794
- props: /* @__PURE__ */ ie({
794
+ props: /* @__PURE__ */ re({
795
795
  options: {},
796
796
  position: { default: "vertical" },
797
797
  view: { default: "default" },
@@ -808,17 +808,17 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
808
808
  }),
809
809
  emits: ["update:modelValue"],
810
810
  setup(o) {
811
- const e = o, t = ue(o, "modelValue"), s = S(() => fo[`vs-input-radio-${e.view}`]);
812
- return (n, a) => (u(), d("div", {
811
+ const e = o, t = ue(o, "modelValue"), a = B(() => fo[`vs-input-radio-${e.view}`]);
812
+ return (n, s) => (i(), d("div", {
813
813
  class: E([n.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
814
814
  }, [
815
- (u(!0), d(se, null, ce(n.options, (r) => (u(), me(Fe(s.value), Te({
815
+ (i(!0), d(se, null, pe(n.options, (r) => (i(), me(Fe(a.value), Te({
816
816
  key: r?.id,
817
817
  text: r.text,
818
818
  value: r.id.toString(),
819
819
  checked: t.value === r.id,
820
820
  modelValue: t.value,
821
- "onUpdate:modelValue": a[0] || (a[0] = (i) => t.value = i)
821
+ "onUpdate:modelValue": s[0] || (s[0] = (u) => t.value = u)
822
822
  }, { ref_for: !0 }, n.$attrs), null, 16, ["text", "value", "checked", "modelValue"]))), 128))
823
823
  ], 2));
824
824
  }
@@ -841,7 +841,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
841
841
  },
842
842
  emits: ["update:modelValue"],
843
843
  setup(o, { emit: e }) {
844
- const t = o, s = e, n = w([]), a = Nt({}), r = (f) => f?.value || f?.id || f?.text || f, i = (f) => f.text || String(f), c = (f) => `lg:col-span-${f || 12}`, p = async () => {
844
+ const t = o, a = e, n = w([]), s = Nt({}), r = (f) => f?.value || f?.id || f?.text || f, u = (f) => f.text || String(f), c = (f) => `lg:col-span-${f || 12}`, p = async () => {
845
845
  try {
846
846
  const f = await fetch(`/api/suggest/${t.data}`).then((m) => m.json());
847
847
  n.value = f?.data || f;
@@ -849,32 +849,32 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
849
849
  console.error(f);
850
850
  }
851
851
  };
852
- return re(
852
+ return ie(
853
853
  () => t.modelValue,
854
854
  (f) => {
855
855
  if (typeof f == "boolean" && n.value.length === 1) {
856
856
  const m = r(n.value[0]);
857
- a[m] = f;
857
+ s[m] = f;
858
858
  } else if (Array.isArray(f)) {
859
859
  const m = new Set(f);
860
- n.value.forEach((b) => {
861
- if (!b.disabled) {
862
- const B = r(b);
863
- a[B] = m.has(B);
860
+ n.value.forEach((y) => {
861
+ if (!y.disabled) {
862
+ const S = r(y);
863
+ s[S] = m.has(S);
864
864
  }
865
865
  });
866
866
  }
867
867
  },
868
868
  { immediate: !0 }
869
- ), re(
870
- a,
869
+ ), ie(
870
+ s,
871
871
  () => {
872
872
  if (!n.value.length) {
873
- s("update:modelValue", null);
873
+ a("update:modelValue", null);
874
874
  return;
875
875
  }
876
- const f = Object.entries(a).filter(([, m]) => m).map(([m]) => m);
877
- s("update:modelValue", f.length === 0 ? [] : f);
876
+ const f = Object.entries(s).filter(([, m]) => m).map(([m]) => m);
877
+ a("update:modelValue", f.length === 0 ? [] : f);
878
878
  },
879
879
  { deep: !0 }
880
880
  ), ke(() => {
@@ -882,43 +882,43 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
882
882
  p().then(() => {
883
883
  if (typeof t.modelValue == "boolean" && n.value.length === 1) {
884
884
  const f = r(n.value[0]);
885
- a[f] = t.modelValue;
885
+ s[f] = t.modelValue;
886
886
  } else if (Array.isArray(t.modelValue)) {
887
887
  const f = new Set(t.modelValue);
888
888
  n.value.forEach((m) => {
889
889
  if (!m.disabled) {
890
- const b = r(m);
891
- a[b] = f.has(b);
890
+ const y = r(m);
891
+ s[y] = f.has(y);
892
892
  }
893
893
  });
894
894
  }
895
895
  });
896
896
  else if (n.value = t.options, typeof t.modelValue == "boolean" && n.value.length === 1) {
897
897
  const f = r(n.value[0]);
898
- a[f] = t.modelValue;
898
+ s[f] = t.modelValue;
899
899
  } else if (Array.isArray(t.modelValue)) {
900
900
  const f = new Set(t.modelValue);
901
901
  n.value.forEach((m) => {
902
902
  if (!m.disabled) {
903
- const b = r(m);
904
- a[b] = f.has(b);
903
+ const y = r(m);
904
+ s[y] = f.has(y);
905
905
  }
906
906
  });
907
907
  }
908
- }), (f, m) => (u(), d("div", {
908
+ }), (f, m) => (i(), d("div", {
909
909
  class: E(["p-0 w-full gap-[6px]", [f.position === "vertical" ? "flex-col" : "", f.colSpan ? "grid" : "flex justify-start"]])
910
910
  }, [
911
- (u(!0), d(se, null, ce(n.value, (b) => (u(), me(St, {
912
- modelValue: a[r(b)],
913
- "onUpdate:modelValue": (B) => a[r(b)] = B,
914
- value: r(b),
911
+ (i(!0), d(se, null, pe(n.value, (y) => (i(), me(St, {
912
+ modelValue: s[r(y)],
913
+ "onUpdate:modelValue": (S) => s[r(y)] = S,
914
+ value: r(y),
915
915
  class: E(c(f.colSpan)),
916
- disabled: b.disabled,
917
- label: i(b),
918
- key: r(b),
919
- icon: b?.icon,
920
- imgUrl: b?.imgUrl,
921
- option: b,
916
+ disabled: y.disabled,
917
+ label: u(y),
918
+ key: r(y),
919
+ icon: y?.icon,
920
+ imgUrl: y?.imgUrl,
921
+ option: y,
922
922
  view: f.view
923
923
  }, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "icon", "imgUrl", "option", "view"]))), 128))
924
924
  ], 2));
@@ -938,15 +938,15 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
938
938
  emits: ["update:modelValue"],
939
939
  setup(o, { emit: e }) {
940
940
  const t = o;
941
- function s(c) {
941
+ function a(c) {
942
942
  return c ? t.mode === "datetime" ? (c.includes("T") ? c : null) || c + (c.includes(" ") ? "" : "T00:00") : c?.split(" ")[0] : null;
943
943
  }
944
- const { inputClass: n } = _e(t.style), a = e, r = S({
945
- get: () => s(t.modelValue),
946
- set: (c) => a("update:modelValue", c)
947
- }), i = S(() => t.mode === "datetime" ? "datetime-local" : t.mode);
948
- return (c, p) => ne((u(), d("input", {
949
- type: i.value,
944
+ const { inputClass: n } = _e(t.style), s = e, r = B({
945
+ get: () => a(t.modelValue),
946
+ set: (c) => s("update:modelValue", c)
947
+ }), u = B(() => t.mode === "datetime" ? "datetime-local" : t.mode);
948
+ return (c, p) => ne((i(), d("input", {
949
+ type: u.value,
950
950
  "onUpdate:modelValue": p[0] || (p[0] = (f) => r.value = f),
951
951
  placeholder: c.placeholder,
952
952
  disabled: c.disabled,
@@ -959,11 +959,11 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
959
959
  [qt, r.value]
960
960
  ]);
961
961
  }
962
- }), bt = async (o, e, t, s) => {
962
+ }), bt = async (o, e, t, a) => {
963
963
  try {
964
964
  const n = new FormData();
965
965
  return n.append("unique", "true"), n.append("file", o), (await fetch(
966
- `/file/upload/uploads?id=${e || ""}&form=${t || ""}&table=${s || ""}`,
966
+ `/file/upload/uploads?id=${e || ""}&form=${t || ""}&table=${a || ""}`,
967
967
  {
968
968
  method: "POST",
969
969
  body: n
@@ -985,8 +985,8 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
985
985
  }
986
986
  }, yt = async (o) => {
987
987
  try {
988
- const e = await fetch(`file/download/files/uploads${o}`), t = await e.arrayBuffer(), s = e.headers["content-type"], n = new TextDecoder("utf-8").decode(t), a = new Blob([n], { type: s }), r = document.createElement("a");
989
- r.setAttribute("download", o), r.href = window.URL.createObjectURL(a), r.click();
988
+ const e = await fetch(`file/download/files/uploads${o}`), t = await e.arrayBuffer(), a = e.headers["content-type"], n = new TextDecoder("utf-8").decode(t), s = new Blob([n], { type: a }), r = document.createElement("a");
989
+ r.setAttribute("download", o), r.href = window.URL.createObjectURL(s), r.click();
990
990
  } catch (e) {
991
991
  console.error(e.message);
992
992
  }
@@ -1002,7 +1002,7 @@ const Kl = /* @__PURE__ */ X(Wl, [["render", Zl]]), Jl = {
1002
1002
  "stroke-linejoin": "round"
1003
1003
  };
1004
1004
  function wo(o, e) {
1005
- return u(), d("svg", xo, e[0] || (e[0] = [
1005
+ return i(), d("svg", xo, e[0] || (e[0] = [
1006
1006
  l("path", { d: "M5 12h14" }, null, -1),
1007
1007
  l("path", { d: "M12 5v14" }, null, -1)
1008
1008
  ]));
@@ -1019,8 +1019,8 @@ const Re = /* @__PURE__ */ X(yo, [["render", wo]]), ko = {}, _o = {
1019
1019
  "stroke-linecap": "round",
1020
1020
  "stroke-linejoin": "round"
1021
1021
  };
1022
- function $o(o, e, t, s, n, a) {
1023
- return u(), d("svg", _o, e[0] || (e[0] = [
1022
+ function $o(o, e, t, a, n, s) {
1023
+ return i(), d("svg", _o, e[0] || (e[0] = [
1024
1024
  ye('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><line x1="9" y1="9" x2="10" y2="9"></line><line x1="9" y1="13" x2="15" y2="13"></line><line x1="9" y1="17" x2="15" y2="17"></line>', 6)
1025
1025
  ]));
1026
1026
  }
@@ -1036,8 +1036,8 @@ const Co = /* @__PURE__ */ X(ko, [["render", $o]]), Vo = {}, Mo = {
1036
1036
  "stroke-linecap": "round",
1037
1037
  "stroke-linejoin": "round"
1038
1038
  };
1039
- function Lo(o, e, t, s, n, a) {
1040
- return u(), d("svg", Mo, e[0] || (e[0] = [
1039
+ function Lo(o, e, t, a, n, s) {
1040
+ return i(), d("svg", Mo, e[0] || (e[0] = [
1041
1041
  l("path", {
1042
1042
  stroke: "none",
1043
1043
  d: "M0 0h24v24H0z",
@@ -1076,7 +1076,7 @@ const So = /* @__PURE__ */ X(Vo, [["render", Lo]]), Bo = {}, jo = {
1076
1076
  "stroke-linejoin": "round"
1077
1077
  };
1078
1078
  function Eo(o, e) {
1079
- return u(), d("svg", jo, e[0] || (e[0] = [
1079
+ return i(), d("svg", jo, e[0] || (e[0] = [
1080
1080
  ye('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M9 9l1 0"></path><path d="M9 13l6 0"></path><path d="M9 17l6 0"></path>', 6)
1081
1081
  ]));
1082
1082
  }
@@ -1092,8 +1092,8 @@ const jt = /* @__PURE__ */ X(Bo, [["render", Eo]]), Io = {}, zo = {
1092
1092
  "stroke-linecap": "round",
1093
1093
  "stroke-linejoin": "round"
1094
1094
  };
1095
- function Ao(o, e, t, s, n, a) {
1096
- return u(), d("svg", zo, e[0] || (e[0] = [
1095
+ function Ao(o, e, t, a, n, s) {
1096
+ return i(), d("svg", zo, e[0] || (e[0] = [
1097
1097
  ye('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M6 20.735a2 2 0 0 1 -1 -1.735v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-1"></path><path d="M11 17a2 2 0 0 1 2 2v2a1 1 0 0 1 -1 1h-2a1 1 0 0 1 -1 -1v-2a2 2 0 0 1 2 -2z"></path><line x1="11" y1="5" x2="10" y2="5"></line><line x1="13" y1="7" x2="12" y2="7"></line><line x1="11" y1="9" x2="10" y2="9"></line><line x1="13" y1="11" x2="12" y2="11"></line><line x1="11" y1="13" x2="10" y2="13"></line><line x1="13" y1="15" x2="12" y2="15"></line>', 9)
1098
1098
  ]));
1099
1099
  }
@@ -1109,8 +1109,8 @@ const To = /* @__PURE__ */ X(Io, [["render", Ao]]), Fo = {}, Oo = {
1109
1109
  "stroke-linecap": "round",
1110
1110
  "stroke-linejoin": "round"
1111
1111
  };
1112
- function Do(o, e, t, s, n, a) {
1113
- return u(), d("svg", Oo, e[0] || (e[0] = [
1112
+ function Do(o, e, t, a, n, s) {
1113
+ return i(), d("svg", Oo, e[0] || (e[0] = [
1114
1114
  ye('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path><path d="M10 13l-1 2l1 2"></path><path d="M14 13l1 2l-1 2"></path>', 5)
1115
1115
  ]));
1116
1116
  }
@@ -1140,7 +1140,7 @@ const Uo = /* @__PURE__ */ X(Fo, [["render", Do]]), Po = (o) => {
1140
1140
  class: "icon icon-tabler icons-tabler-outline icon-tabler-trash"
1141
1141
  };
1142
1142
  function qo(o, e) {
1143
- return u(), d("svg", No, e[0] || (e[0] = [
1143
+ return i(), d("svg", No, e[0] || (e[0] = [
1144
1144
  ye('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M4 7l16 0"></path><path d="M10 11l0 6"></path><path d="M14 11l0 6"></path><path d="M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12"></path><path d="M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3"></path>', 6)
1145
1145
  ]));
1146
1146
  }
@@ -1157,7 +1157,7 @@ const Qe = /* @__PURE__ */ X(Ho, [["render", qo]]), Wo = {}, Go = {
1157
1157
  class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
1158
1158
  };
1159
1159
  function Zo(o, e) {
1160
- return u(), d("svg", Go, e[0] || (e[0] = [
1160
+ return i(), d("svg", Go, e[0] || (e[0] = [
1161
1161
  l("path", {
1162
1162
  stroke: "none",
1163
1163
  d: "M0 0h24v24H0z",
@@ -1170,7 +1170,7 @@ function Zo(o, e) {
1170
1170
  }
1171
1171
  const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file" }, Jo = { class: "absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center" }, Yo = /* @__PURE__ */ U({
1172
1172
  __name: "vs-input-file-list-item",
1173
- props: /* @__PURE__ */ ie({
1173
+ props: /* @__PURE__ */ re({
1174
1174
  format: {},
1175
1175
  multiple: { type: Boolean },
1176
1176
  style: {},
@@ -1188,19 +1188,19 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
1188
1188
  }),
1189
1189
  emits: ["update:value", "update:item"],
1190
1190
  setup(o) {
1191
- const e = ue(o, "value"), t = ue(o, "item"), s = o;
1192
- return (n, a) => (u(), d("div", Ko, [
1193
- (u(), me(Fe(ee(Ro)(t.value)), {
1191
+ const e = ue(o, "value"), t = ue(o, "item"), a = o;
1192
+ return (n, s) => (i(), d("div", Ko, [
1193
+ (i(), me(Fe(ee(Ro)(t.value)), {
1194
1194
  src: t.value,
1195
1195
  alt: "file",
1196
1196
  class: "w-full h-full object-cover cursor-pointer",
1197
- onClick: a[0] || (a[0] = (r) => ee(yt)(t.value))
1197
+ onClick: s[0] || (s[0] = (r) => ee(yt)(t.value))
1198
1198
  }, null, 8, ["src"])),
1199
1199
  l("div", Jo, [
1200
1200
  l("button", {
1201
1201
  type: "button",
1202
- onClick: a[1] || (a[1] = (r) => {
1203
- ee(bo)(t.value), e.value = s.multiple ? e.value?.filter((i) => i !== t.value) : "";
1202
+ onClick: s[1] || (s[1] = (r) => {
1203
+ ee(bo)(t.value), e.value = a.multiple ? e.value?.filter((u) => u !== t.value) : "";
1204
1204
  }),
1205
1205
  class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"
1206
1206
  }, [
@@ -1208,7 +1208,7 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
1208
1208
  ]),
1209
1209
  l("button", {
1210
1210
  type: "button",
1211
- onClick: a[2] || (a[2] = (r) => ee(yt)(t.value)),
1211
+ onClick: s[2] || (s[2] = (r) => ee(yt)(t.value)),
1212
1212
  class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"
1213
1213
  }, [
1214
1214
  A(Et, { class: "w-4 h-4" })
@@ -1221,7 +1221,7 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
1221
1221
  class: "flex items-center flex-wrap gap-2"
1222
1222
  }, tn = /* @__PURE__ */ U({
1223
1223
  __name: "vs-input-file",
1224
- props: /* @__PURE__ */ ie({
1224
+ props: /* @__PURE__ */ re({
1225
1225
  format: {},
1226
1226
  multiple: { type: Boolean },
1227
1227
  style: {},
@@ -1235,59 +1235,59 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
1235
1235
  modelValue: {},
1236
1236
  modelModifiers: {}
1237
1237
  }),
1238
- emits: ["update:modelValue"],
1239
- setup(o) {
1240
- const e = o, t = ue(o, "modelValue"), s = w(null), n = (r) => Array.isArray(t.value) && t.value[r] || "", a = async (r) => {
1241
- const { files: i } = r.target;
1242
- if (!(!i || i.length === 0))
1243
- if (e.multiple) {
1244
- const c = Array.from(i).map(async (b) => e.format && !b.name.endsWith(e.format) ? null : await bt(b, "1", "form", "table")), m = (await Promise.all(c)).filter((b) => b !== null).map((b) => b?.file_path).filter(Boolean);
1245
- t.value = [...t.value || [], ...m];
1238
+ emits: /* @__PURE__ */ re(["change"], ["update:modelValue"]),
1239
+ setup(o, { emit: e }) {
1240
+ const t = o, a = ue(o, "modelValue"), n = e, s = w(null), r = (c) => Array.isArray(a.value) && a.value[c] || "", u = async (c) => {
1241
+ const { files: p } = c.target;
1242
+ if (!(!p || p.length === 0))
1243
+ if (t.multiple) {
1244
+ const f = Array.from(p).map(async (q) => t.format && !q.name.endsWith(t.format) ? null : await bt(q, "1", "form", "table")), S = (await Promise.all(f)).filter((q) => q !== null).map((q) => q?.file_path).filter(Boolean);
1245
+ a.value = [...a.value || [], ...S], n("change", a.value);
1246
1246
  } else {
1247
- const c = i[0];
1248
- if (e.format && !c.name.endsWith(e.format))
1247
+ const f = p[0];
1248
+ if (t.format && !f.name.endsWith(t.format))
1249
1249
  return;
1250
- const p = await bt(c, "1", "form", "table");
1251
- t.value = p?.file_path;
1250
+ const m = await bt(f, "1", "form", "table");
1251
+ a.value = m?.file_path, n("change", a.value || "");
1252
1252
  }
1253
1253
  };
1254
- return (r, i) => (u(), d("div", Xo, [
1254
+ return (c, p) => (i(), d("div", Xo, [
1255
1255
  l("input", {
1256
1256
  class: "hidden",
1257
1257
  ref_key: "fileInput",
1258
1258
  ref: s,
1259
1259
  type: "file",
1260
- multiple: r.multiple,
1261
- onChange: a
1260
+ multiple: c.multiple,
1261
+ onChange: u
1262
1262
  }, null, 40, Qo),
1263
- !r.multiple && t.value ? (u(), me(xt, {
1263
+ !c.multiple && a.value ? (i(), me(xt, {
1264
1264
  key: 0,
1265
- item: t.value,
1266
- "onUpdate:item": i[0] || (i[0] = (c) => t.value = c),
1267
- value: t.value,
1268
- "onUpdate:value": i[1] || (i[1] = (c) => t.value = c)
1269
- }, null, 8, ["item", "value"])) : r.multiple ? (u(), d("div", en, [
1270
- (u(!0), d(se, null, ce(t.value, (c, p) => (u(), me(xt, {
1271
- multiple: r.multiple,
1272
- key: p,
1273
- value: t.value,
1274
- "onUpdate:value": i[2] || (i[2] = (f) => t.value = f),
1275
- item: n(p)
1265
+ item: a.value,
1266
+ "onUpdate:item": p[0] || (p[0] = (f) => a.value = f),
1267
+ value: a.value,
1268
+ "onUpdate:value": p[1] || (p[1] = (f) => a.value = f)
1269
+ }, null, 8, ["item", "value"])) : c.multiple ? (i(), d("div", en, [
1270
+ (i(!0), d(se, null, pe(a.value, (f, m) => (i(), me(xt, {
1271
+ multiple: c.multiple,
1272
+ key: m,
1273
+ value: a.value,
1274
+ "onUpdate:value": p[2] || (p[2] = (y) => a.value = y),
1275
+ item: r(m)
1276
1276
  }, null, 8, ["multiple", "value", "item"]))), 128)),
1277
1277
  l("div", {
1278
- onClick: i[3] || (i[3] = (c) => !r.disabled && s.value?.click()),
1278
+ onClick: p[3] || (p[3] = (f) => !c.disabled && s.value?.click()),
1279
1279
  class: E([
1280
1280
  "h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-[#CFD9E0] rounded-lg flex items-center justify-center transition-all duration-300",
1281
- r.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
1281
+ c.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
1282
1282
  ])
1283
1283
  }, [
1284
1284
  A(Re, { class: "w-6 h-6" })
1285
1285
  ], 2)
1286
1286
  ])) : D("", !0),
1287
- r.multiple ? D("", !0) : (u(), d("div", {
1287
+ c.multiple ? D("", !0) : (i(), d("div", {
1288
1288
  key: 2,
1289
- onClick: i[4] || (i[4] = (c) => s.value?.click()),
1290
- class: E([r.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500", "h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])
1289
+ onClick: p[4] || (p[4] = (f) => s.value?.click()),
1290
+ class: E([c.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500", "h-[120px] w-[120px] border text-gray-300 hover:text-blue-500 border-dashed border-gray-300 rounded-lg flex items-center justify-center cursor-pointer hover:border-blue-500 transition-all duration-300 hover:bg-blue-50"])
1291
1291
  }, [
1292
1292
  A(Re, { class: "w-6 h-6" })
1293
1293
  ], 2))
@@ -1299,7 +1299,7 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
1299
1299
  item: { default: null }
1300
1300
  },
1301
1301
  setup(o) {
1302
- const e = o, t = S(() => {
1302
+ const e = o, t = B(() => {
1303
1303
  try {
1304
1304
  return new Date(e.item.cdate).toLocaleDateString("uk-UA", {
1305
1305
  day: "2-digit",
@@ -1310,24 +1310,24 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
1310
1310
  return "";
1311
1311
  }
1312
1312
  });
1313
- function s(n) {
1313
+ function a(n) {
1314
1314
  if (n < 1024)
1315
1315
  return `${n} B`;
1316
- const a = n / 1024;
1317
- return a < 1024 ? `${a.toFixed(2)} KB` : `${(a / 1024).toFixed(2)} MB`;
1316
+ const s = n / 1024;
1317
+ return s < 1024 ? `${s.toFixed(2)} KB` : `${(s / 1024).toFixed(2)} MB`;
1318
1318
  }
1319
- return (n, a) => (u(), d(se, null, [
1320
- a[1] || (a[1] = ye('<div class="flex items-center justify-center h-[30px] w-[30px]"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg></div>', 1)),
1319
+ return (n, s) => (i(), d(se, null, [
1320
+ s[1] || (s[1] = ye('<div class="flex items-center justify-center h-[30px] w-[30px]"><svg xmlns="http://www.w3.org/2000/svg" height="24" width="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="icon icon-tabler icons-tabler-outline icon-tabler-file"><path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M14 3v4a1 1 0 0 0 1 1h4"></path><path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path></svg></div>', 1)),
1321
1321
  l("div", ln, [
1322
- l("p", on, W(n.item?.uploaded_name), 1),
1322
+ l("p", on, G(n.item?.uploaded_name), 1),
1323
1323
  l("p", nn, [
1324
- l("span", null, W(n.item?.username), 1),
1324
+ l("span", null, G(n.item?.username), 1),
1325
1325
  ne(l("span", an, "|", 512), [
1326
1326
  [Xe, n.item?.username]
1327
1327
  ]),
1328
- l("span", null, W(t.value), 1),
1329
- a[0] || (a[0] = l("span", { class: "px-[5px]" }, "|", -1)),
1330
- l("span", sn, W(s(n.item?.size)), 1)
1328
+ l("span", null, G(t.value), 1),
1329
+ s[0] || (s[0] = l("span", { class: "px-[5px]" }, "|", -1)),
1330
+ l("span", sn, G(a(n.item?.size)), 1)
1331
1331
  ])
1332
1332
  ])
1333
1333
  ], 64));
@@ -1353,50 +1353,50 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
1353
1353
  },
1354
1354
  emits: ["update", "openModal", "openLightbox"],
1355
1355
  setup(o, { emit: e }) {
1356
- const t = o, s = e;
1356
+ const t = o, a = e;
1357
1357
  function n(f) {
1358
1358
  return ["pdf", "json"].includes(f.ext);
1359
1359
  }
1360
- function a(f) {
1360
+ function s(f) {
1361
1361
  return ["ppt", "pptx", "doc", "docx", "xls", "xlsx"].includes(f.ext);
1362
1362
  }
1363
1363
  function r(f) {
1364
1364
  const m = document.createElement("a");
1365
1365
  m.setAttribute("download", f?.uploaded_name), m.href = f?.file_path, m.click();
1366
1366
  }
1367
- async function i() {
1367
+ async function u() {
1368
1368
  try {
1369
1369
  await fetch(
1370
1370
  `${t.prefix}/widget/file/${t.item.entity_id}/${t.item.file_id}`
1371
- ), s("update");
1371
+ ), a("update");
1372
1372
  } catch (f) {
1373
1373
  console.error(f);
1374
1374
  }
1375
1375
  }
1376
1376
  function c() {
1377
- s("openModal", {
1377
+ a("openModal", {
1378
1378
  title: "Ви впевнені?",
1379
1379
  message: "Ви впевнені, що хочете видалити цей файл?",
1380
1380
  confirmButtonText: "Так, я впевнена/ий",
1381
1381
  cancelButtonText: "Скасувати",
1382
- confirm: i,
1382
+ confirm: u,
1383
1383
  updateListOnConfirm: !0
1384
1384
  });
1385
1385
  }
1386
1386
  function p(f) {
1387
- (t.item.ext === "jpg" || t.item.ext === "png") && s("openLightbox", { item: t.item, index: f });
1387
+ (t.item.ext === "jpg" || t.item.ext === "png") && a("openLightbox", { item: t.item, index: f });
1388
1388
  }
1389
- return (f, m) => (u(), d("div", rn, [
1390
- f.item.ext === "jpg" || f.item.ext === "png" ? (u(), d("div", un, [
1389
+ return (f, m) => (i(), d("div", rn, [
1390
+ f.item.ext === "jpg" || f.item.ext === "png" ? (i(), d("div", un, [
1391
1391
  l("div", {
1392
1392
  class: "max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",
1393
- onClick: m[0] || (m[0] = (b) => p(f.index))
1393
+ onClick: m[0] || (m[0] = (y) => p(f.index))
1394
1394
  }, [
1395
1395
  A(Ke, { item: f.item }, null, 8, ["item"])
1396
1396
  ])
1397
- ])) : n(f.item) ? (u(), d("div", dn, [
1397
+ ])) : n(f.item) ? (i(), d("div", dn, [
1398
1398
  A(Ke, { item: f.item }, null, 8, ["item"])
1399
- ])) : a(f.item) ? (u(), d("div", cn, [
1399
+ ])) : s(f.item) ? (i(), d("div", cn, [
1400
1400
  l("a", {
1401
1401
  href: `/api/file-preview?id=${f.item.file_id}`,
1402
1402
  target: "_blank",
@@ -1404,7 +1404,7 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
1404
1404
  }, [
1405
1405
  A(Ke, { item: f.item }, null, 8, ["item"])
1406
1406
  ], 8, pn)
1407
- ])) : (u(), d("div", fn, [
1407
+ ])) : (i(), d("div", fn, [
1408
1408
  A(Ke, { item: f.item }, null, 8, ["item"])
1409
1409
  ])),
1410
1410
  l("div", mn, [
@@ -1412,7 +1412,7 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
1412
1412
  l("div", hn, [
1413
1413
  l("button", {
1414
1414
  class: "inline-flex p-[6px] justify-center items-center gap-x-2 rounded-lg border border-transparent text-gray-500 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none dark:text-neutral-400 focus:outline-none focus:bg-gray-100 dark:hover:bg-neutral-700 dark:focus:bg-neutral-700",
1415
- onClick: m[1] || (m[1] = (b) => r(f.item))
1415
+ onClick: m[1] || (m[1] = (y) => r(f.item))
1416
1416
  }, [
1417
1417
  A(Et, {
1418
1418
  height: "14",
@@ -1425,7 +1425,7 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
1425
1425
  l("button", {
1426
1426
  type: "button",
1427
1427
  class: "size-[30px] inline-flex justify-center items-center gap-x-2 rounded-lg border border-transparent text-red-600 hover:bg-red-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-red-100 dark:text-red-500 dark:hover:bg-red-500/20 dark:focus:bg-red-500/20",
1428
- onClick: m[2] || (m[2] = (b) => c())
1428
+ onClick: m[2] || (m[2] = (y) => c())
1429
1429
  }, [
1430
1430
  A(Qe, {
1431
1431
  height: "14",
@@ -1450,7 +1450,7 @@ const Et = /* @__PURE__ */ X(Wo, [["render", Zo]]), Ko = { class: "h-[120px] w-[
1450
1450
  class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
1451
1451
  };
1452
1452
  function wn(o, e) {
1453
- return u(), d("svg", xn, e[0] || (e[0] = [
1453
+ return i(), d("svg", xn, e[0] || (e[0] = [
1454
1454
  l("path", {
1455
1455
  stroke: "none",
1456
1456
  d: "M0 0h24v24H0z",
@@ -1482,9 +1482,9 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
1482
1482
  },
1483
1483
  emits: ["update"],
1484
1484
  setup(o, { emit: e }) {
1485
- const t = o, s = ze("form"), n = S(() => s.value.formId), a = w(!1), r = w(0), i = e, c = w(!1), p = w({}), f = w([]), m = w(""), b = S(() => Array.isArray(f.value) ? f.value.filter((I) => I.ext === "jpg" || I.ext === "png").map((I) => I?.file_path) : []), B = S(() => m.value === "" ? f.value : f.value.filter((I) => I?.uploaded_name?.includes(m.value))), Y = (I) => {
1486
- const v = b.value.findIndex((x) => x === I.item.file_path);
1487
- v !== -1 && (a.value = !0, r.value = v);
1485
+ const t = o, a = ze("form"), n = B(() => a.value.formId), s = w(!1), r = w(0), u = e, c = w(!1), p = w({}), f = w([]), m = w(""), y = B(() => Array.isArray(f.value) ? f.value.filter((I) => I.ext === "jpg" || I.ext === "png").map((I) => I?.file_path) : []), S = B(() => m.value === "" ? f.value : f.value.filter((I) => I?.uploaded_name?.includes(m.value))), q = (I) => {
1486
+ const v = y.value.findIndex((x) => x === I.item.file_path);
1487
+ v !== -1 && (s.value = !0, r.value = v);
1488
1488
  }, R = async () => {
1489
1489
  try {
1490
1490
  const I = await fetch(`${t.prefix}/widget/file/${n.value}`).then((v) => v.json());
@@ -1492,14 +1492,14 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
1492
1492
  } catch (I) {
1493
1493
  console.error(I);
1494
1494
  }
1495
- }, Z = async (I) => {
1495
+ }, K = async (I) => {
1496
1496
  await Promise.all(
1497
1497
  Array.from(I.target.files).map(async (v) => {
1498
1498
  const x = new FormData();
1499
1499
  x.append("file", v);
1500
1500
  try {
1501
1501
  const V = `${t.prefix}/widget/file/${n.value}`, _ = await fetch(V, { method: "POST", body: x });
1502
- return _.ok ? (i("update", "file-list"), v) : (de({
1502
+ return _.ok ? (u("update", "file-list"), v) : (de({
1503
1503
  type: _.status >= 400 && _.status < 500 ? "warning" : "error",
1504
1504
  title: "Error",
1505
1505
  message: `Error code: ${_.status}`
@@ -1523,21 +1523,21 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
1523
1523
  }, H = (I) => {
1524
1524
  p.value = T(I), c.value = !0;
1525
1525
  };
1526
- return re(n, (I) => {
1526
+ return ie(n, (I) => {
1527
1527
  I && R();
1528
1528
  }), ke(() => {
1529
1529
  n.value && R();
1530
1530
  }), (I, v) => {
1531
1531
  const x = mt("Lightbox"), V = mt("MessageBox");
1532
- return u(), d("div", _n, [
1532
+ return i(), d("div", _n, [
1533
1533
  l("div", $n, [
1534
- l("h2", Cn, " Файлів: " + W(f.value?.length), 1),
1534
+ l("h2", Cn, " Файлів: " + G(f.value?.length), 1),
1535
1535
  l("div", Vn, [
1536
1536
  l("label", null, [
1537
1537
  l("input", {
1538
1538
  type: "file",
1539
1539
  class: "hidden",
1540
- onChange: v[0] || (v[0] = (_) => Z(_))
1540
+ onChange: v[0] || (v[0] = (_) => K(_))
1541
1541
  }, null, 32),
1542
1542
  l("div", Mn, [
1543
1543
  A(kn, {
@@ -1548,7 +1548,7 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
1548
1548
  ])
1549
1549
  ])
1550
1550
  ]),
1551
- f.value?.length > 4 ? (u(), d("div", Ln, [
1551
+ f.value?.length > 4 ? (i(), d("div", Ln, [
1552
1552
  l("div", null, [
1553
1553
  l("div", Sn, [
1554
1554
  v[8] || (v[8] = l("div", { class: "absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5" }, [
@@ -1588,26 +1588,26 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
1588
1588
  ])
1589
1589
  ])
1590
1590
  ])) : D("", !0),
1591
- f.value?.length ? (u(), d("div", Bn, [
1592
- (u(!0), d(se, null, ce(B.value, (_, F) => (u(), me(bn, {
1591
+ f.value?.length ? (i(), d("div", Bn, [
1592
+ (i(!0), d(se, null, pe(S.value, (_, F) => (i(), me(bn, {
1593
1593
  key: F,
1594
1594
  prefix: I.prefix,
1595
1595
  item: _,
1596
1596
  index: F,
1597
1597
  onUpdate: v[2] || (v[2] = (te) => I.$emit("update", "file-list")),
1598
1598
  onOpenModal: v[3] || (v[3] = (te) => H(te)),
1599
- onOpenLightbox: v[4] || (v[4] = (te) => Y(te))
1599
+ onOpenLightbox: v[4] || (v[4] = (te) => q(te))
1600
1600
  }, null, 8, ["prefix", "item", "index"]))), 128)),
1601
- B.value.length ? D("", !0) : (u(), d("div", jn, v[9] || (v[9] = [
1601
+ S.value.length ? D("", !0) : (i(), d("div", jn, v[9] || (v[9] = [
1602
1602
  l("p", { class: "text-sm text-gray-600 font-sm" }, " Файлів з такою назвою не існує, введіть інше пошукове слово ", -1)
1603
1603
  ])))
1604
1604
  ])) : D("", !0),
1605
1605
  A(x, {
1606
- modelValue: a.value,
1607
- "onUpdate:modelValue": v[5] || (v[5] = (_) => a.value = _),
1606
+ modelValue: s.value,
1607
+ "onUpdate:modelValue": v[5] || (v[5] = (_) => s.value = _),
1608
1608
  startIndex: r.value,
1609
1609
  "onUpdate:index": v[6] || (v[6] = (_) => r.value = _),
1610
- images: b.value
1610
+ images: y.value
1611
1611
  }, null, 8, ["modelValue", "startIndex", "images"]),
1612
1612
  A(V, Te({
1613
1613
  modelValue: c.value,
@@ -1635,24 +1635,24 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
1635
1635
  },
1636
1636
  setup(o) {
1637
1637
  const e = o, t = w(e.isOpen);
1638
- return re(
1638
+ return ie(
1639
1639
  () => e.isOpen,
1640
- (s) => {
1641
- t.value = s;
1640
+ (a) => {
1641
+ t.value = a;
1642
1642
  }
1643
- ), (s, n) => (u(), d("div", null, [
1643
+ ), (a, n) => (i(), d("div", null, [
1644
1644
  l("div", In, [
1645
- l("p", zn, W(o.title), 1),
1645
+ l("p", zn, G(o.title), 1),
1646
1646
  A(Bt, {
1647
1647
  modelValue: t.value,
1648
- "onUpdate:modelValue": n[0] || (n[0] = (a) => t.value = a),
1648
+ "onUpdate:modelValue": n[0] || (n[0] = (s) => t.value = s),
1649
1649
  style: be(o.style)
1650
1650
  }, null, 8, ["modelValue", "style"])
1651
1651
  ]),
1652
1652
  A(st, { name: "slide-fade" }, {
1653
1653
  default: Be(() => [
1654
1654
  ne(l("div", An, [
1655
- Le(s.$slots, "default", {}, void 0, !0)
1655
+ Le(a.$slots, "default", {}, void 0, !0)
1656
1656
  ], 512), [
1657
1657
  [Xe, t.value]
1658
1658
  ])
@@ -1679,26 +1679,26 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
1679
1679
  },
1680
1680
  setup(o) {
1681
1681
  const e = o, t = w(e.isOpen);
1682
- return re(
1682
+ return ie(
1683
1683
  () => e.isOpen,
1684
- (s) => {
1685
- t.value = s;
1684
+ (a) => {
1685
+ t.value = a;
1686
1686
  }
1687
- ), (s, n) => (u(), d("div", null, [
1687
+ ), (a, n) => (i(), d("div", null, [
1688
1688
  l("button", {
1689
1689
  type: "button",
1690
- onClick: n[0] || (n[0] = (a) => t.value = !t.value),
1690
+ onClick: n[0] || (n[0] = (s) => t.value = !t.value),
1691
1691
  class: "flex items-center gap-2"
1692
1692
  }, [
1693
1693
  A(ee(Pl), {
1694
1694
  class: E(["h-4 w-4 duration-300", [t.value ? "-rotate-180" : ""]])
1695
1695
  }, null, 8, ["class"]),
1696
- l("span", On, W(o.title), 1)
1696
+ l("span", On, G(o.title), 1)
1697
1697
  ]),
1698
1698
  A(st, { name: "slide-fade" }, {
1699
1699
  default: Be(() => [
1700
1700
  ne(l("div", Dn, [
1701
- Le(s.$slots, "default", {}, void 0, !0)
1701
+ Le(a.$slots, "default", {}, void 0, !0)
1702
1702
  ], 512), [
1703
1703
  [Xe, t.value]
1704
1704
  ])
@@ -1720,9 +1720,9 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
1720
1720
  }
1721
1721
  },
1722
1722
  setup(o) {
1723
- return (e, t) => (u(), d("div", null, [
1723
+ return (e, t) => (i(), d("div", null, [
1724
1724
  l("div", Rn, [
1725
- l("p", null, W(o.title), 1)
1725
+ l("p", null, G(o.title), 1)
1726
1726
  ]),
1727
1727
  Le(e.$slots, "default")
1728
1728
  ]));
@@ -1795,26 +1795,26 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
1795
1795
  }
1796
1796
  },
1797
1797
  setup(o) {
1798
- const e = o, t = ze("formValues", { default: {} }), s = ze("form"), n = S(() => e.schema?.filter((r) => {
1799
- const i = r?.conditions;
1800
- if (!i) return !0;
1801
- const c = Array.isArray(i) ? i[0] : i, p = t?.value?.[c];
1802
- return It(p, i);
1803
- })), a = S(() => Nn[e.view]);
1804
- return (r, i) => o.schema?.length ? (u(), me(Fe(a.value), {
1798
+ const e = o, t = ze("formValues", { default: {} }), a = ze("form"), n = B(() => e.schema?.filter((r) => {
1799
+ const u = r?.conditions;
1800
+ if (!u) return !0;
1801
+ const c = Array.isArray(u) ? u[0] : u, p = t?.value?.[c];
1802
+ return It(p, u);
1803
+ })), s = B(() => Nn[e.view]);
1804
+ return (r, u) => o.schema?.length ? (i(), me(Fe(s.value), {
1805
1805
  key: 0,
1806
1806
  title: o.title,
1807
1807
  style: be(o.style)
1808
1808
  }, {
1809
1809
  default: Be(() => [
1810
- (u(!0), d(se, null, ce(n.value, (c) => (u(), me(zt, Te({
1810
+ (i(!0), d(se, null, pe(n.value, (c) => (i(), me(zt, Te({
1811
1811
  key: c.name
1812
1812
  }, { ref_for: !0 }, c, {
1813
1813
  item: c,
1814
1814
  modelValue: ee(t)[c.name],
1815
1815
  "onUpdate:modelValue": (p) => ee(t)[c.name] = p,
1816
1816
  style: o.style,
1817
- error: ee(s)?.errors?.[c.name]
1817
+ error: ee(a)?.errors?.[c.name]
1818
1818
  }), null, 16, ["item", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
1819
1819
  ]),
1820
1820
  _: 1
@@ -1854,106 +1854,106 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
1854
1854
  },
1855
1855
  emits: ["change", "update:modelValue"],
1856
1856
  setup(o, { emit: e }) {
1857
- const t = o, s = e, n = S(() => t.multiple), a = S(() => t.disabled);
1857
+ const t = o, a = e, n = B(() => t.multiple), s = B(() => t.disabled);
1858
1858
  _e(t.style);
1859
- const r = S({
1859
+ const r = B({
1860
1860
  get: () => t.modelValue,
1861
- set: (h) => s("update:modelValue", h)
1861
+ set: (h) => a("update:modelValue", h)
1862
1862
  });
1863
1863
  !r.value && t.defaultValue && (r.value = t.defaultValue);
1864
- const i = w(null), c = w(null), p = w(null), f = w(null), m = w(!1), b = w(!1), B = w(null), Y = w([]), R = w(-1), Z = w([]), T = w(""), H = w(null), I = w("bottom"), v = w({}), x = w([]), V = S(() => {
1864
+ const u = w(null), c = w(null), p = w(null), f = w(null), m = w(!1), y = w(!1), S = w(null), q = w([]), R = w(-1), K = w([]), T = w(""), H = w(null), I = w("bottom"), v = w({}), x = w([]), V = B(() => {
1865
1865
  if (!x.value.length) return [];
1866
- const h = new Map(Y.value.map((g) => [g.id?.toString(), g]));
1866
+ const h = new Map(q.value.map((g) => [g.id?.toString(), g]));
1867
1867
  return x.value.map((g) => h.get(g?.toString())).filter((g) => !!g);
1868
- }), _ = S(() => t.placeholder || "Select..."), F = S(() => q(B.value)), te = S(() => n.value ? !x.value.length && T.value === "" : !F.value && T.value === ""), K = S(() => a.value ? !1 : n.value ? x.value.length > 0 : !!r.value), M = (h) => n.value ? x.value.some((g) => g?.toString() === h?.toString()) : r.value?.toString() === h?.toString(), G = S(() => {
1869
- let h = Y.value ?? [];
1868
+ }), _ = B(() => t.placeholder || "Select..."), F = B(() => W(S.value)), te = B(() => n.value ? !x.value.length && T.value === "" : !F.value && T.value === ""), J = B(() => s.value ? !1 : n.value ? x.value.length > 0 : !!r.value), M = (h) => n.value ? x.value.some((g) => g?.toString() === h?.toString()) : r.value?.toString() === h?.toString(), Z = B(() => {
1869
+ let h = q.value ?? [];
1870
1870
  if (!t.data && T.value.trim() !== "") {
1871
1871
  const g = T.value.toLowerCase();
1872
- h = h.filter(($) => {
1873
- const P = q($).toLowerCase(), ae = $.text?.toLowerCase?.() || "";
1872
+ h = h.filter((C) => {
1873
+ const P = W(C).toLowerCase(), ae = C.text?.toLowerCase?.() || "";
1874
1874
  return P.includes(g) || ae.includes(g);
1875
1875
  });
1876
1876
  }
1877
1877
  if (n.value && x.value.length) {
1878
- const g = new Set(x.value.map(($) => $?.toString()));
1879
- h = h.filter(($) => !g.has($.id?.toString()));
1878
+ const g = new Set(x.value.map((C) => C?.toString()));
1879
+ h = h.filter((C) => !g.has(C.id?.toString()));
1880
1880
  }
1881
1881
  return h;
1882
- }), N = ze("values"), le = /\{\{\s*([^}]+?)\s*\}\}/g, z = (h) => (h ? String(h) : "").replace(/<[^>]*>/g, "").trim(), j = S(() => t.slot ?? t?.optionTemplate ?? ""), C = (h) => {
1882
+ }), N = ze("values"), le = /\{\{\s*([^}]+?)\s*\}\}/g, z = (h) => (h ? String(h) : "").replace(/<[^>]*>/g, "").trim(), j = B(() => t.slot ?? t?.optionTemplate ?? ""), $ = (h) => {
1883
1883
  if (!h) return "";
1884
1884
  const g = j.value;
1885
- return g ? g.replace(le, ($, P) => {
1885
+ return g ? g.replace(le, (C, P) => {
1886
1886
  const ae = P.trim(), fe = h[ae];
1887
1887
  return fe != null ? String(fe) : "";
1888
1888
  }) : h.text ?? "";
1889
- }, q = (h) => {
1889
+ }, W = (h) => {
1890
1890
  if (!h) return "";
1891
1891
  if (!j.value) return h.text ?? "";
1892
- const $ = C(h);
1893
- return z($) || h.text || "";
1892
+ const C = $(h);
1893
+ return z(C) || h.text || "";
1894
1894
  }, oe = (h) => {
1895
- t.set && N?.value && Object.entries(t.set).forEach(([g, $]) => {
1895
+ t.set && N?.value && Object.entries(t.set).forEach(([g, C]) => {
1896
1896
  if (!g) return;
1897
- const P = h ? h[$] : null;
1897
+ const P = h ? h[C] : null;
1898
1898
  N.value[g] = P ?? null;
1899
1899
  });
1900
- }, pe = S(() => t.parent ? N?.value?.[t.parent] ?? null : null), Me = async (h) => {
1900
+ }, ce = B(() => t.parent ? N?.value?.[t.parent] ?? null : null), Ve = async (h) => {
1901
1901
  if (!t.data) {
1902
1902
  let g = t.options ?? [];
1903
1903
  if (h?.trim()) {
1904
- const $ = h.toLowerCase();
1904
+ const C = h.toLowerCase();
1905
1905
  g = g.filter((P) => {
1906
- const ae = q(P).toLowerCase(), fe = P.text?.toLowerCase?.() || "";
1907
- return ae.includes($) || fe.includes($);
1906
+ const ae = W(P).toLowerCase(), fe = P.text?.toLowerCase?.() || "";
1907
+ return ae.includes(C) || fe.includes(C);
1908
1908
  });
1909
1909
  }
1910
1910
  return g;
1911
1911
  }
1912
1912
  try {
1913
- const g = t.host ?? "", $ = t.prefix ?? "api", P = t.api ?? `/${$}/suggest/${t.data}`, ae = `${g}${P}`, fe = new URLSearchParams();
1914
- return fe.set("json", "1"), h && fe.set("key", h), pe.value !== void 0 && pe.value !== null && pe.value !== "" && fe.set("parent", String(pe.value)), (await fetch(`${ae}?${fe.toString()}`).then((Ae) => Ae.json()))?.data ?? [];
1913
+ const g = t.host ?? "", C = t.prefix ?? "api", P = t.api ?? `/${C}/suggest/${t.data}`, ae = `${g}${P}`, fe = new URLSearchParams();
1914
+ return fe.set("json", "1"), h && fe.set("key", h), ce.value !== void 0 && ce.value !== null && ce.value !== "" && fe.set("parent", String(ce.value)), (await fetch(`${ae}?${fe.toString()}`).then((Ae) => Ae.json()))?.data ?? [];
1915
1915
  } catch {
1916
1916
  return [];
1917
1917
  }
1918
1918
  }, Ne = async () => {
1919
- t.data ? Y.value = await Me(T.value) : Y.value = t.options ? [...t.options] : [];
1919
+ t.data ? q.value = await Ve(T.value) : q.value = t.options ? [...t.options] : [];
1920
1920
  }, qe = async (h) => {
1921
1921
  if (h == null) return null;
1922
- const g = Y.value?.find((P) => P?.id?.toString() === String(h));
1923
- return g || ((await Me(String(h)))?.[0] ?? null);
1922
+ const g = q.value?.find((P) => P?.id?.toString() === String(h));
1923
+ return g || ((await Ve(String(h)))?.[0] ?? null);
1924
1924
  }, et = async (h) => {
1925
- const g = new Set(Y.value.map((P) => P.id?.toString())), $ = h.filter((P) => !g.has(P?.toString()));
1926
- $.length && await $.reduce(async (P, ae) => {
1925
+ const g = new Set(q.value.map((P) => P.id?.toString())), C = h.filter((P) => !g.has(P?.toString()));
1926
+ C.length && await C.reduce(async (P, ae) => {
1927
1927
  await P;
1928
1928
  const fe = await qe(ae);
1929
- fe && Y.value.push(fe);
1929
+ fe && q.value.push(fe);
1930
1930
  }, Promise.resolve());
1931
1931
  }, Oe = async () => {
1932
- a.value || (m.value = !0, await Ne(), await Ie(() => {
1933
- Ve(), H.value?.focus(), G.value.length ? R.value = 0 : R.value = -1;
1932
+ s.value || (m.value = !0, await Ne(), await Ie(() => {
1933
+ Me(), H.value?.focus(), Z.value.length ? R.value = 0 : R.value = -1;
1934
1934
  }));
1935
1935
  }, $e = () => {
1936
1936
  m.value = !1, R.value = -1;
1937
- }, y = async (h) => {
1938
- if (a.value) return;
1937
+ }, b = async (h) => {
1938
+ if (s.value) return;
1939
1939
  !m.value ? await Oe() : $e();
1940
1940
  }, k = async () => {
1941
1941
  m.value ? H.value?.focus() : await Oe();
1942
- }, J = () => {
1943
- n.value ? (x.value = [], r.value = [], s("change", [])) : (B.value = null, r.value = null, s("change", null)), oe(null), T.value = "", Ie(() => H.value?.focus());
1942
+ }, Y = () => {
1943
+ n.value ? (x.value = [], r.value = [], a("change", [])) : (S.value = null, r.value = null, a("change", null)), oe(null), T.value = "", Ie(() => H.value?.focus());
1944
1944
  }, O = (h) => {
1945
- n.value && (x.value = x.value.filter((g) => g?.toString() !== h?.toString()), r.value = [...x.value], s("change", r.value), Ie(() => H.value?.focus()));
1945
+ n.value && (x.value = x.value.filter((g) => g?.toString() !== h?.toString()), r.value = [...x.value], a("change", r.value), Ie(() => H.value?.focus()));
1946
1946
  }, Q = (h) => {
1947
- n.value ? (M(h.id) || (x.value = [...x.value, h.id], r.value = [...x.value], s("change", r.value)), T.value = "", Ie(() => {
1948
- H.value?.focus(), R.value = Math.min(R.value, G.value.length - 1);
1949
- }), oe(null)) : (B.value = h, r.value = h.id, s("change", r.value), T.value = "", $e(), oe(h));
1947
+ n.value ? (M(h.id) || (x.value = [...x.value, h.id], r.value = [...x.value], a("change", r.value)), T.value = "", Ie(() => {
1948
+ H.value?.focus(), R.value = Math.min(R.value, Z.value.length - 1);
1949
+ }), oe(null)) : (S.value = h, r.value = h.id, a("change", r.value), T.value = "", $e(), oe(h));
1950
1950
  }, he = (h) => {
1951
1951
  M(h.id) || Q(h);
1952
1952
  }, Ce = (h, g) => {
1953
1953
  if (!h || !g) return;
1954
- const $ = h.offsetTop, P = $ + h.offsetHeight, ae = g.scrollTop, fe = ae + g.clientHeight;
1954
+ const C = h.offsetTop, P = C + h.offsetHeight, ae = g.scrollTop, fe = ae + g.clientHeight;
1955
1955
  let Ee = g.scrollTop;
1956
- $ < ae ? Ee = $ - 80 : P > fe && (Ee = P - g.clientHeight + 4);
1956
+ C < ae ? Ee = C - 80 : P > fe && (Ee = P - g.clientHeight + 4);
1957
1957
  const Ae = g;
1958
1958
  Ae.scrollTop = Ee;
1959
1959
  }, Se = (h) => {
@@ -1961,19 +1961,19 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
1961
1961
  for (; g; ) {
1962
1962
  if (g.classList.contains("ui-dialog__content"))
1963
1963
  return g;
1964
- const $ = window.getComputedStyle(g), P = $.overflow + $.overflowY + $.overflowX;
1964
+ const C = window.getComputedStyle(g), P = C.overflow + C.overflowY + C.overflowX;
1965
1965
  if (P.includes("auto") || P.includes("scroll") || g === document.body || g === document.documentElement)
1966
1966
  return g;
1967
1967
  g = g.parentElement;
1968
1968
  }
1969
1969
  return document.body;
1970
- }, Ve = () => {
1970
+ }, Me = () => {
1971
1971
  if (!c.value) return;
1972
- const h = c.value.getBoundingClientRect(), g = window.innerHeight || document.documentElement.clientHeight, $ = window.innerWidth || document.documentElement.clientWidth, P = 8, ae = 8, fe = t.maxHeight || 300, Ee = g - h.bottom - ae - P, Ae = h.top - ae - P, Ze = Ee >= Ae, lt = Math.max($ - P * 2, 0);
1972
+ const h = c.value.getBoundingClientRect(), g = window.innerHeight || document.documentElement.clientHeight, C = window.innerWidth || document.documentElement.clientWidth, P = 8, ae = 8, fe = t.maxHeight || 300, Ee = g - h.bottom - ae - P, Ae = h.top - ae - P, Ze = Ee >= Ae, lt = Math.max(C - P * 2, 0);
1973
1973
  let { width: De } = h;
1974
1974
  lt > 0 && De > lt && (De = lt);
1975
1975
  let { left: Ue } = h;
1976
- Ue + De + P > $ && (Ue = $ - De - P), Ue = Math.max(Ue, P);
1976
+ Ue + De + P > C && (Ue = C - De - P), Ue = Math.max(Ue, P);
1977
1977
  const Ht = Math.min(
1978
1978
  fe,
1979
1979
  Math.max(Ze ? Ee : Ae, 50)
@@ -1988,37 +1988,37 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
1988
1988
  top: Ze ? `${h.bottom + ae}px` : `${h.top - ae}px`
1989
1989
  };
1990
1990
  }, je = async (h) => {
1991
- a.value || !m.value && (h.key === "ArrowDown" || h.key === "ArrowUp") && (h.preventDefault(), await Oe());
1991
+ s.value || !m.value && (h.key === "ArrowDown" || h.key === "ArrowUp") && (h.preventDefault(), await Oe());
1992
1992
  }, Tt = (h) => {
1993
1993
  if (!m.value) return;
1994
1994
  const { key: g } = h;
1995
1995
  if (g === "ArrowDown")
1996
- h.preventDefault(), R.value + 1 < G.value.length && (R.value += 1, Ce(Z.value[R.value], p.value));
1996
+ h.preventDefault(), R.value + 1 < Z.value.length && (R.value += 1, Ce(K.value[R.value], p.value));
1997
1997
  else if (g === "ArrowUp")
1998
- h.preventDefault(), R.value > 0 && (R.value -= 1, Ce(Z.value[R.value], p.value));
1998
+ h.preventDefault(), R.value > 0 && (R.value -= 1, Ce(K.value[R.value], p.value));
1999
1999
  else if (g === "Enter") {
2000
2000
  h.preventDefault();
2001
- const $ = G.value[R.value];
2002
- $ && Q($), H.value?.blur();
2003
- } else g === "Escape" ? (h.preventDefault(), $e()) : g === "Backspace" ? n.value && T.value === "" && x.value.length && (x.value = x.value.slice(0, -1), r.value = [...x.value], s("change", r.value)) : g === "Home" ? (R.value = 0, Ce(Z.value[0], p.value)) : g === "End" ? (R.value = G.value.length - 1, Ce(Z.value[R.value], p.value)) : g === "Tab" && $e();
2001
+ const C = Z.value[R.value];
2002
+ C && Q(C), H.value?.blur();
2003
+ } else g === "Escape" ? (h.preventDefault(), $e()) : g === "Backspace" ? n.value && T.value === "" && x.value.length && (x.value = x.value.slice(0, -1), r.value = [...x.value], a("change", r.value)) : g === "Home" ? (R.value = 0, Ce(K.value[0], p.value)) : g === "End" ? (R.value = Z.value.length - 1, Ce(K.value[R.value], p.value)) : g === "Tab" && $e();
2004
2004
  }, Ft = () => {
2005
- a.value || (b.value = !0);
2005
+ s.value || (y.value = !0);
2006
2006
  }, Ot = () => {
2007
- b.value = !1, T.value = "";
2007
+ y.value = !1, T.value = "";
2008
2008
  }, rt = (h) => {
2009
2009
  h.key === "Escape" && m.value && $e();
2010
2010
  }, it = (h) => {
2011
2011
  const g = h.target;
2012
- i.value?.contains(g) || f.value?.contains(g) || $e();
2012
+ u.value?.contains(g) || f.value?.contains(g) || $e();
2013
2013
  }, ut = (h) => {
2014
- m.value && p.value && !p.value.contains(h.target) && Ve();
2014
+ m.value && p.value && !p.value.contains(h.target) && Me();
2015
2015
  }, dt = () => {
2016
- m.value && Ve();
2016
+ m.value && Me();
2017
2017
  }, ct = () => {
2018
- m.value && Ve();
2018
+ m.value && Me();
2019
2019
  };
2020
- re(() => t.options, (h) => {
2021
- h?.length && (Y.value = [...h], We());
2020
+ ie(() => t.options, (h) => {
2021
+ h?.length && (q.value = [...h], We());
2022
2022
  }, { immediate: !0 });
2023
2023
  async function We() {
2024
2024
  if (n.value)
@@ -2028,13 +2028,13 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
2028
2028
  const h = r.value[0] ?? null;
2029
2029
  r.value = h ?? null;
2030
2030
  }
2031
- B.value = await qe(r.value), oe(B.value ?? null);
2031
+ S.value = await qe(r.value), oe(S.value ?? null);
2032
2032
  }
2033
2033
  }
2034
- re(r, () => {
2034
+ ie(r, () => {
2035
2035
  We();
2036
2036
  }), ke(async () => {
2037
- addEventListener("keydown", rt), addEventListener("scroll", ut, !0), addEventListener("resize", dt), document.addEventListener("click", it, !0), c.value && Se(c.value).addEventListener("scroll", ct, !0), t.options?.length ? Y.value = [...t.options] : t.data && (Y.value = await Me("")), await We();
2037
+ addEventListener("keydown", rt), addEventListener("scroll", ut, !0), addEventListener("resize", dt), document.addEventListener("click", it, !0), c.value && Se(c.value).addEventListener("scroll", ct, !0), t.options?.length ? q.value = [...t.options] : t.data && (q.value = await Ve("")), await We();
2038
2038
  }), Ye(() => {
2039
2039
  removeEventListener("keydown", rt), removeEventListener("scroll", ut, !0), removeEventListener("resize", dt), document.removeEventListener("click", it, !0), c.value && Se(c.value).removeEventListener("scroll", ct, !0);
2040
2040
  });
@@ -2042,14 +2042,14 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
2042
2042
  async function Dt() {
2043
2043
  if (!t.add?.token || ft?.value.validate())
2044
2044
  return;
2045
- const g = t.add.api ?? `/api/table/${t.add.token}`, { id: $ } = await fetch(g, {
2045
+ const g = t.add.api ?? `/api/table/${t.add.token}`, { id: C } = await fetch(g, {
2046
2046
  method: "POST",
2047
2047
  headers: { "Content-Type": "application/json" },
2048
2048
  body: JSON.stringify(tt.value)
2049
2049
  }).then((P) => P.json());
2050
2050
  if (!t.options?.length && t.data) {
2051
- const { data: P } = await fetch(`${t.api ?? `/api/suggest/${t.data}`}?val=${$}`).then((ae) => ae.json());
2052
- B.value = P[0], Y.value.push(P[0]), r.value = $;
2051
+ const { data: P } = await fetch(`${t.api ?? `/api/suggest/${t.data}`}?val=${C}`).then((ae) => ae.json());
2052
+ S.value = P[0], q.value.push(P[0]), r.value = C;
2053
2053
  }
2054
2054
  Ge.value = !1, de({ title: "Success!", message: "Object created." });
2055
2055
  }
@@ -2059,26 +2059,26 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
2059
2059
  return pt.value = h.schema, Ge.value = !0, null;
2060
2060
  }
2061
2061
  function Pt(h, g = 200) {
2062
- let $;
2062
+ let C;
2063
2063
  return (...P) => {
2064
- $ && clearTimeout($), $ = window.setTimeout(() => h(...P), g);
2064
+ C && clearTimeout(C), C = window.setTimeout(() => h(...P), g);
2065
2065
  };
2066
2066
  }
2067
2067
  const Rt = Pt(async (h) => {
2068
- Y.value = await Me(h);
2068
+ q.value = await Ve(h);
2069
2069
  }, 200);
2070
- return re(T, (h) => {
2070
+ return ie(T, (h) => {
2071
2071
  t.data && Rt(h.trim());
2072
- }), re(() => t.options, (h) => {
2073
- !t.data && h?.length && (Y.value = [...h], We());
2074
- }, { immediate: !0 }), re(() => t.parent ?? t.parentValue, () => {
2072
+ }), ie(() => t.options, (h) => {
2073
+ !t.data && h?.length && (q.value = [...h], We());
2074
+ }, { immediate: !0 }), ie(() => t.parent ?? t.parentValue, () => {
2075
2075
  t.data && Ne();
2076
- }), re(pe, async () => {
2077
- t.data && (n.value ? (x.value = [], r.value = [], s("change", [])) : (B.value = null, r.value = null, s("change", null)));
2078
- }), (h, g) => (u(), d(se, null, [
2076
+ }), ie(ce, async () => {
2077
+ t.data && (n.value ? (x.value = [], r.value = [], a("change", [])) : (S.value = null, r.value = null, a("change", null)));
2078
+ }), (h, g) => (i(), d(se, null, [
2079
2079
  A(ee(Lt), {
2080
2080
  visible: Ge.value,
2081
- "onUpdate:visible": g[1] || (g[1] = ($) => Ge.value = $),
2081
+ "onUpdate:visible": g[1] || (g[1] = (C) => Ge.value = C),
2082
2082
  title: "Додати",
2083
2083
  buttonText: "Додати",
2084
2084
  onDone: Dt,
@@ -2088,7 +2088,7 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
2088
2088
  A(He, {
2089
2089
  schema: pt.value,
2090
2090
  modelValue: tt.value,
2091
- "onUpdate:modelValue": g[0] || (g[0] = ($) => tt.value = $),
2091
+ "onUpdate:modelValue": g[0] || (g[0] = (C) => tt.value = C),
2092
2092
  ref_key: "addForm",
2093
2093
  ref: ft
2094
2094
  }, null, 8, ["schema", "modelValue"])
@@ -2098,7 +2098,7 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
2098
2098
  l("div", {
2099
2099
  class: "flex gap-1 w-full",
2100
2100
  ref_key: "selectRoot",
2101
- ref: i,
2101
+ ref: u,
2102
2102
  onClick: g[4] || (g[4] = we(() => {
2103
2103
  }, ["stop"]))
2104
2104
  }, [
@@ -2120,47 +2120,47 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
2120
2120
  class: E([
2121
2121
  "flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
2122
2122
  "border-gray-300 hover:border-gray-400",
2123
- m.value || b.value ? "border-blue-500 ring-1 ring-blue-500" : "",
2124
- a.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
2123
+ m.value || y.value ? "border-blue-500 ring-1 ring-blue-500" : "",
2124
+ s.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
2125
2125
  ]),
2126
2126
  role: "combobox",
2127
2127
  "aria-expanded": m.value,
2128
2128
  "aria-haspopup": "listbox",
2129
2129
  onKeydown: je,
2130
2130
  onClick: k,
2131
- "data-focus": m.value || b.value ? "true" : "false"
2131
+ "data-focus": m.value || y.value ? "true" : "false"
2132
2132
  }, [
2133
2133
  l("div", {
2134
2134
  class: "flex flex-1 items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",
2135
2135
  ref_key: "triggerRef",
2136
2136
  ref: c
2137
2137
  }, [
2138
- n.value && x.value.length ? (u(!0), d(se, { key: 0 }, ce(V.value, ($) => (u(), d("div", {
2138
+ n.value && x.value.length ? (i(!0), d(se, { key: 0 }, pe(V.value, (C) => (i(), d("div", {
2139
2139
  class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border",
2140
- key: $.id
2140
+ key: C.id
2141
2141
  }, [
2142
2142
  l("div", aa, [
2143
- $?.color ? (u(), d("span", {
2143
+ C?.color ? (i(), d("span", {
2144
2144
  key: 0,
2145
2145
  class: "w-[16px] h-[16px] rounded-md block ml-1.5",
2146
- style: be({ backgroundColor: $?.color })
2146
+ style: be({ backgroundColor: C?.color })
2147
2147
  }, null, 4)) : D("", !0),
2148
2148
  l("div", {
2149
2149
  class: "truncate text-gray-900 overflow-hidden",
2150
- title: q($)
2150
+ title: W(C)
2151
2151
  }, [
2152
- j.value ? (u(), d("span", {
2152
+ j.value ? (i(), d("span", {
2153
2153
  key: 0,
2154
- innerHTML: C($)
2155
- }, null, 8, ra)) : (u(), d(se, { key: 1 }, [
2156
- ge(W($.text), 1)
2154
+ innerHTML: $(C)
2155
+ }, null, 8, ra)) : (i(), d(se, { key: 1 }, [
2156
+ ge(G(C.text), 1)
2157
2157
  ], 64))
2158
2158
  ], 8, sa)
2159
2159
  ]),
2160
2160
  l("div", {
2161
2161
  role: "button",
2162
2162
  class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
2163
- onClick: we((P) => O($.id), ["stop"])
2163
+ onClick: we((P) => O(C.id), ["stop"])
2164
2164
  }, g[5] || (g[5] = [
2165
2165
  l("svg", {
2166
2166
  height: "14",
@@ -2173,28 +2173,28 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
2173
2173
  l("path", { d: "M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z" })
2174
2174
  ], -1)
2175
2175
  ]), 8, ia)
2176
- ]))), 128)) : !n.value && !b.value && F.value && T.value === "" ? (u(), d("div", {
2176
+ ]))), 128)) : !n.value && !y.value && F.value && T.value === "" ? (i(), d("div", {
2177
2177
  key: 1,
2178
2178
  class: E(["truncate text-gray-900"]),
2179
2179
  title: F.value
2180
2180
  }, [
2181
- B.value?.color ? (u(), d("span", {
2181
+ S.value?.color ? (i(), d("span", {
2182
2182
  key: 0,
2183
2183
  class: "w-[14px] h-[14px] rounded-md block mr-1 mt-1 absolute",
2184
- style: be({ backgroundColor: B.value?.color })
2184
+ style: be({ backgroundColor: S.value?.color })
2185
2185
  }, null, 4)) : D("", !0),
2186
- j.value ? (u(), d("span", {
2186
+ j.value ? (i(), d("span", {
2187
2187
  key: 1,
2188
- class: E({ "pl-5": B.value?.color }),
2189
- innerHTML: C(B.value)
2190
- }, null, 10, da)) : (u(), d("span", {
2188
+ class: E({ "pl-5": S.value?.color }),
2189
+ innerHTML: $(S.value)
2190
+ }, null, 10, da)) : (i(), d("span", {
2191
2191
  key: 2,
2192
- class: E({ "pl-5": B.value?.color })
2193
- }, W(B.value?.text), 3))
2192
+ class: E({ "pl-5": S.value?.color })
2193
+ }, G(S.value?.text), 3))
2194
2194
  ], 8, ua)) : D("", !0),
2195
- te.value ? (u(), d("div", ca, W(_.value), 1)) : D("", !0),
2195
+ te.value ? (i(), d("div", ca, G(_.value), 1)) : D("", !0),
2196
2196
  l("div", pa, [
2197
- !a.value && h.search ? ne((u(), d("input", {
2197
+ !s.value && h.search ? ne((i(), d("input", {
2198
2198
  key: 0,
2199
2199
  ref_key: "inputRef",
2200
2200
  ref: H,
@@ -2206,8 +2206,8 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
2206
2206
  type: "text",
2207
2207
  tabindex: "0",
2208
2208
  "aria-autocomplete": "list",
2209
- placeholder: (n.value && x.value.length ? " " : null) || b.value && !T.value?.length && F.value || " ",
2210
- "onUpdate:modelValue": g[2] || (g[2] = ($) => T.value = $),
2209
+ placeholder: (n.value && x.value.length ? " " : null) || y.value && !T.value?.length && F.value || " ",
2210
+ "onUpdate:modelValue": g[2] || (g[2] = (C) => T.value = C),
2211
2211
  onFocus: Ft,
2212
2212
  onBlur: Ot,
2213
2213
  onKeydown: Tt
@@ -2217,13 +2217,13 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
2217
2217
  ])
2218
2218
  ], 512),
2219
2219
  l("div", ma, [
2220
- K.value ? (u(), d("button", {
2220
+ J.value ? (i(), d("button", {
2221
2221
  key: 0,
2222
2222
  type: "button",
2223
2223
  class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
2224
2224
  "aria-hidden": "true",
2225
- disabled: a.value,
2226
- onClick: we(J, ["stop"])
2225
+ disabled: s.value,
2226
+ onClick: we(Y, ["stop"])
2227
2227
  }, g[6] || (g[6] = [
2228
2228
  l("svg", {
2229
2229
  height: "20",
@@ -2239,8 +2239,8 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
2239
2239
  type: "button",
2240
2240
  class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
2241
2241
  "aria-hidden": "true",
2242
- disabled: a.value,
2243
- onClick: g[3] || (g[3] = we(($) => y(), ["stop"])),
2242
+ disabled: s.value,
2243
+ onClick: g[3] || (g[3] = we((C) => b(), ["stop"])),
2244
2244
  title: m.value ? "Закрити список" : "Відкрити список"
2245
2245
  }, g[7] || (g[7] = [
2246
2246
  l("svg", {
@@ -2254,8 +2254,8 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
2254
2254
  ]), 8, ha)
2255
2255
  ])
2256
2256
  ], 42, na),
2257
- (u(), me(Mt, { to: "body" }, [
2258
- m.value ? (u(), d("div", {
2257
+ (i(), me(Mt, { to: "body" }, [
2258
+ m.value ? (i(), d("div", {
2259
2259
  key: 0,
2260
2260
  ref_key: "dropdownRef",
2261
2261
  ref: f,
@@ -2271,50 +2271,50 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
2271
2271
  ref_key: "listRef",
2272
2272
  ref: p
2273
2273
  }, [
2274
- G.value.length ? (u(!0), d(se, { key: 0 }, ce(G.value, ($, P) => (u(), d("div", {
2275
- key: $.id,
2274
+ Z.value.length ? (i(!0), d(se, { key: 0 }, pe(Z.value, (C, P) => (i(), d("div", {
2275
+ key: C.id,
2276
2276
  ref_for: !0,
2277
- ref: (ae) => Z.value[P] = ae,
2277
+ ref: (ae) => K.value[P] = ae,
2278
2278
  class: E([
2279
2279
  "flex px-3 py-2 cursor-default select-none text-gray-900 ",
2280
- M($.id) ? "bg-blue-500 text-white" : "bg-white hover:bg-blue-100",
2281
- R.value === P && !M($.id) ? "bg-blue-100" : ""
2280
+ M(C.id) ? "bg-blue-500 text-white" : "bg-white hover:bg-blue-100",
2281
+ R.value === P && !M(C.id) ? "bg-blue-100" : ""
2282
2282
  ]),
2283
- "aria-disabled": M($.id) ? "true" : "false",
2283
+ "aria-disabled": M(C.id) ? "true" : "false",
2284
2284
  role: "option",
2285
2285
  tabindex: "-1",
2286
- onClick: (ae) => he($)
2286
+ onClick: (ae) => he(C)
2287
2287
  }, [
2288
- $?.color ? (u(), d("span", {
2288
+ C?.color ? (i(), d("span", {
2289
2289
  key: 0,
2290
2290
  class: "w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",
2291
- style: be({ backgroundColor: $?.color })
2291
+ style: be({ backgroundColor: C?.color })
2292
2292
  }, null, 4)) : D("", !0),
2293
2293
  l("div", {
2294
2294
  class: E([
2295
2295
  "leading-[19px]",
2296
- R.value === $.id ? "text-white" : "",
2296
+ R.value === C.id ? "text-white" : "",
2297
2297
  // active style like react-select
2298
2298
  (R.value === P, "")
2299
2299
  ])
2300
2300
  }, [
2301
- j.value ? (u(), d("span", {
2301
+ j.value ? (i(), d("span", {
2302
2302
  key: 0,
2303
- innerHTML: C($)
2304
- }, null, 8, ba)) : (u(), d(se, { key: 1 }, [
2305
- ge(W($.text), 1)
2303
+ innerHTML: $(C)
2304
+ }, null, 8, ba)) : (i(), d(se, { key: 1 }, [
2305
+ ge(G(C.text), 1)
2306
2306
  ], 64))
2307
2307
  ], 2)
2308
- ], 10, ga))), 128)) : (u(), d("div", ya, " No options "))
2308
+ ], 10, ga))), 128)) : (i(), d("div", ya, " No options "))
2309
2309
  ], 4)
2310
2310
  ], 4)) : D("", !0)
2311
2311
  ]))
2312
2312
  ], 2),
2313
- t.add ? (u(), d("button", {
2313
+ t.add ? (i(), d("button", {
2314
2314
  key: 0,
2315
2315
  onClick: Ut,
2316
2316
  class: "bg-white hover:bg-gray-100 text-sm text-gray-900 py-[10px] px-3 border border-stone-200 rounded-md h-[38px] flex items-center gap-2",
2317
- disabled: a.value,
2317
+ disabled: s.value,
2318
2318
  type: "button"
2319
2319
  }, [
2320
2320
  A(Re, {
@@ -2328,7 +2328,7 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
2328
2328
  }
2329
2329
  }), wa = ["placeholder", "disabled"], ka = /* @__PURE__ */ U({
2330
2330
  __name: "vs-input-textarea",
2331
- props: /* @__PURE__ */ ie({
2331
+ props: /* @__PURE__ */ re({
2332
2332
  style: { default: () => ({}) },
2333
2333
  customClass: { default: "" },
2334
2334
  disabled: { type: Boolean, default: !1 },
@@ -2342,9 +2342,9 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
2342
2342
  }),
2343
2343
  emits: ["update:modelValue"],
2344
2344
  setup(o) {
2345
- const e = o, { inputClass: t } = _e(e.style), s = ue(o, "modelValue");
2346
- return (n, a) => ne((u(), d("textarea", {
2347
- "onUpdate:modelValue": a[0] || (a[0] = (r) => s.value = r),
2345
+ const e = o, { inputClass: t } = _e(e.style), a = ue(o, "modelValue");
2346
+ return (n, s) => ne((i(), d("textarea", {
2347
+ "onUpdate:modelValue": s[0] || (s[0] = (r) => a.value = r),
2348
2348
  placeholder: n.placeholder,
2349
2349
  disabled: n.disabled,
2350
2350
  row: "2",
@@ -2353,7 +2353,7 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
2353
2353
  border: "1px solid #CFD9E0"
2354
2354
  }
2355
2355
  }, null, 10, wa)), [
2356
- [ve, s.value]
2356
+ [ve, a.value]
2357
2357
  ]);
2358
2358
  }
2359
2359
  }), _a = {}, $a = {
@@ -2367,7 +2367,7 @@ const kn = /* @__PURE__ */ X(yn, [["render", wn]]), _n = { class: "flex flex-col
2367
2367
  class: "icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"
2368
2368
  };
2369
2369
  function Ca(o, e) {
2370
- return u(), d("svg", $a, e[0] || (e[0] = [
2370
+ return i(), d("svg", $a, e[0] || (e[0] = [
2371
2371
  l("path", {
2372
2372
  stroke: "none",
2373
2373
  d: "M0 0h24v24H0z",
@@ -2388,7 +2388,7 @@ const Va = /* @__PURE__ */ X(_a, [["render", Ca]]), Ma = {}, La = {
2388
2388
  "stroke-linejoin": "round"
2389
2389
  };
2390
2390
  function Sa(o, e) {
2391
- return u(), d("svg", La, e[0] || (e[0] = [
2391
+ return i(), d("svg", La, e[0] || (e[0] = [
2392
2392
  l("path", { d: "m3 16 4 4 4-4" }, null, -1),
2393
2393
  l("path", { d: "M7 20V4" }, null, -1),
2394
2394
  l("path", { d: "m21 8-4-4-4 4" }, null, -1),
@@ -2407,7 +2407,7 @@ const Ba = /* @__PURE__ */ X(Ma, [["render", Sa]]), ja = {}, Ea = {
2407
2407
  "stroke-linejoin": "round"
2408
2408
  };
2409
2409
  function Ia(o, e) {
2410
- return u(), d("svg", Ea, e[0] || (e[0] = [
2410
+ return i(), d("svg", Ea, e[0] || (e[0] = [
2411
2411
  l("path", {
2412
2412
  stroke: "none",
2413
2413
  d: "M0 0h24v24H0z",
@@ -2428,7 +2428,7 @@ const za = /* @__PURE__ */ X(ja, [["render", Ia]]), Aa = {}, Ta = {
2428
2428
  "stroke-linejoin": "round"
2429
2429
  };
2430
2430
  function Fa(o, e) {
2431
- return u(), d("svg", Ta, e[0] || (e[0] = [
2431
+ return i(), d("svg", Ta, e[0] || (e[0] = [
2432
2432
  l("path", {
2433
2433
  stroke: "none",
2434
2434
  d: "M0 0h24v24H0z",
@@ -2449,7 +2449,7 @@ const Oa = /* @__PURE__ */ X(Aa, [["render", Fa]]), Da = {}, Ua = {
2449
2449
  "stroke-linejoin": "round"
2450
2450
  };
2451
2451
  function Pa(o, e) {
2452
- return u(), d("svg", Ua, e[0] || (e[0] = [
2452
+ return i(), d("svg", Ua, e[0] || (e[0] = [
2453
2453
  ye('<circle cx="9" cy="12" r="1"></circle><circle cx="9" cy="5" r="1"></circle><circle cx="9" cy="19" r="1"></circle><circle cx="15" cy="12" r="1"></circle><circle cx="15" cy="5" r="1"></circle><circle cx="15" cy="19" r="1"></circle>', 6)
2454
2454
  ]));
2455
2455
  }
@@ -2459,7 +2459,7 @@ const kt = /* @__PURE__ */ X(Da, [["render", Pa]]), Ra = {}, Ha = {
2459
2459
  xmlns: "http://www.w3.org/2000/svg"
2460
2460
  };
2461
2461
  function Na(o, e) {
2462
- return u(), d("svg", Ha, e[0] || (e[0] = [
2462
+ return i(), d("svg", Ha, e[0] || (e[0] = [
2463
2463
  ye('<rect x="27" y="50.5" width="124" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="27" y="50.5" width="124" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-50 dark:stroke-neutral-700/10"></rect><rect x="34.5" y="58" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="61" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="66.5" y="73" width="77" height="6" rx="3" fill="currentColor" class="fill-gray-50 dark:fill-neutral-700/30"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" fill="currentColor" class="fill-white dark:fill-neutral-800"></rect><rect x="19.5" y="28.5" width="139" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/30"></rect><rect x="27" y="36" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="39" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><rect x="59" y="51" width="92" height="6" rx="3" fill="currentColor" class="fill-gray-100 dark:fill-neutral-700/70"></rect><g filter="url(#filter1)"><rect x="12" y="6" width="154" height="40" rx="8" fill="currentColor" class="fill-white dark:fill-neutral-800" shape-rendering="crispEdges"></rect><rect x="12.5" y="6.5" width="153" height="39" rx="7.5" stroke="currentColor" class="stroke-gray-100 dark:stroke-neutral-700/60" shape-rendering="crispEdges"></rect><rect x="20" y="14" width="24" height="24" rx="4" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="17" width="60" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect><rect x="52" y="29" width="106" height="6" rx="3" fill="currentColor" class="fill-gray-200 dark:fill-neutral-700"></rect></g><defs><filter id="filter1" x="0" y="0" width="178" height="64" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"><feFlood flood-opacity="0" result="BackgroundImageFix"></feFlood><feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"></feColorMatrix><feOffset dy="6"></feOffset><feGaussianBlur stdDeviation="6"></feGaussianBlur><feComposite in2="hardAlpha" operator="out"></feComposite><feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.03 0"></feColorMatrix><feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_1187_14810"></feBlend><feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_1187_14810" result="shape"></feBlend></filter></defs>', 12)
2464
2464
  ]));
2465
2465
  }
@@ -2473,7 +2473,7 @@ const qa = /* @__PURE__ */ X(Ra, [["render", Na]]), Wa = {}, Ga = {
2473
2473
  "stroke-linejoin": "round"
2474
2474
  };
2475
2475
  function Za(o, e) {
2476
- return u(), d("svg", Ga, e[0] || (e[0] = [
2476
+ return i(), d("svg", Ga, e[0] || (e[0] = [
2477
2477
  l("path", { d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z" }, null, -1)
2478
2478
  ]));
2479
2479
  }
@@ -2492,7 +2492,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
2492
2492
  class: "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors"
2493
2493
  }, _s = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]" }, $s = { class: "flex items-center justify-center gap-2" }, Cs = ["onClick"], Vs = ["onClick"], Ms = { class: "vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, Ls = /* @__PURE__ */ U({
2494
2494
  __name: "vs-input-datatable",
2495
- props: /* @__PURE__ */ ie({
2495
+ props: /* @__PURE__ */ re({
2496
2496
  colModel: {},
2497
2497
  style: {},
2498
2498
  customClass: {},
@@ -2507,56 +2507,56 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
2507
2507
  }),
2508
2508
  emits: ["update:modelValue"],
2509
2509
  setup(o) {
2510
- const e = o, t = ue(o, "modelValue"), s = w({}), n = w(""), a = S(() => {
2510
+ const e = o, t = ue(o, "modelValue"), a = w({}), n = w(""), s = B(() => {
2511
2511
  if (!n.value) return t.value ?? [];
2512
2512
  const z = n.value.toLowerCase();
2513
- return t.value.filter((j) => e.colModel?.some((C) => {
2514
- const q = j[C.key];
2515
- return q ? Array.isArray(q) ? q.join(", ").toLowerCase().includes(z) : String(q).toLowerCase().includes(z) : !1;
2513
+ return t.value.filter((j) => e.colModel?.some(($) => {
2514
+ const W = j[$.key];
2515
+ return W ? Array.isArray(W) ? W.join(", ").toLowerCase().includes(z) : String(W).toLowerCase().includes(z) : !1;
2516
2516
  }));
2517
- }), r = w(null), i = w(null), c = w(!1), p = w(null), f = w({ top: 0, left: 0 }), m = (z) => {
2517
+ }), r = w(null), u = w(null), c = w(!1), p = w(null), f = w({ top: 0, left: 0 }), m = (z) => {
2518
2518
  r.value = z;
2519
- }, b = (z) => {
2520
- i.value = z;
2521
- }, B = (z) => {
2519
+ }, y = (z) => {
2520
+ u.value = z;
2521
+ }, S = (z) => {
2522
2522
  if (r.value === null || r.value === z) {
2523
- r.value = null, i.value = null;
2523
+ r.value = null, u.value = null;
2524
2524
  return;
2525
2525
  }
2526
- const j = [...t.value], [C] = j.splice(r.value, 1);
2527
- j.splice(z, 0, C), t.value = j, r.value = null, i.value = null;
2528
- }, Y = (z) => {
2529
- const C = z.currentTarget.getBoundingClientRect();
2530
- f.value = { top: C.bottom + window.scrollY, left: C.left + window.scrollX }, c.value = !c.value;
2526
+ const j = [...t.value], [$] = j.splice(r.value, 1);
2527
+ j.splice(z, 0, $), t.value = j, r.value = null, u.value = null;
2528
+ }, q = (z) => {
2529
+ const $ = z.currentTarget.getBoundingClientRect();
2530
+ f.value = { top: $.bottom + window.scrollY, left: $.left + window.scrollX }, c.value = !c.value;
2531
2531
  }, R = () => {
2532
2532
  p.value && p.value.click();
2533
- }, Z = (z) => {
2534
- const j = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp", ".svg", ".ico", ".tiff", ".tif"], C = z.toLowerCase();
2535
- return j.some((q) => C.endsWith(q));
2533
+ }, K = (z) => {
2534
+ const j = [".jpg", ".jpeg", ".png", ".gif", ".bmp", ".webp", ".svg", ".ico", ".tiff", ".tif"], $ = z.toLowerCase();
2535
+ return j.some((W) => $.endsWith(W));
2536
2536
  }, T = (z) => {
2537
- const C = z.target.files?.[0];
2538
- if (!C) return;
2539
- const q = new FileReader();
2540
- q.onload = (oe) => {
2537
+ const $ = z.target.files?.[0];
2538
+ if (!$) return;
2539
+ const W = new FileReader();
2540
+ W.onload = (oe) => {
2541
2541
  try {
2542
- const pe = oe.target?.result;
2543
- if (typeof pe == "string") {
2544
- const Me = JSON.parse(pe);
2545
- Array.isArray(Me) && t.value.push(...Me);
2542
+ const ce = oe.target?.result;
2543
+ if (typeof ce == "string") {
2544
+ const Ve = JSON.parse(ce);
2545
+ Array.isArray(Ve) && t.value.push(...Ve);
2546
2546
  }
2547
- } catch (pe) {
2548
- console.error("Error parsing file:", pe);
2547
+ } catch (ce) {
2548
+ console.error("Error parsing file:", ce);
2549
2549
  }
2550
- }, q.readAsText(C);
2550
+ }, W.readAsText($);
2551
2551
  }, H = () => {
2552
- const z = JSON.stringify(t.value, null, 2), j = new Blob([z], { type: "application/json" }), C = URL.createObjectURL(j), q = document.createElement("a");
2553
- q.href = C, q.download = "data.json", q.click(), URL.revokeObjectURL(C);
2552
+ const z = JSON.stringify(t.value, null, 2), j = new Blob([z], { type: "application/json" }), $ = URL.createObjectURL(j), W = document.createElement("a");
2553
+ W.href = $, W.download = "data.json", W.click(), URL.revokeObjectURL($);
2554
2554
  };
2555
2555
  ke(async () => {
2556
2556
  const z = e.colModel?.filter((j) => j.data);
2557
2557
  z?.length && Promise.all(z.map(async (j) => {
2558
- const q = await (await fetch(`/api/suggest/${j.data}`)).json();
2559
- s.value[j.key] = q.data;
2558
+ const W = await (await fetch(`/api/suggest/${j.data}`)).json();
2559
+ a.value[j.key] = W.data;
2560
2560
  }));
2561
2561
  });
2562
2562
  const I = w(""), v = w(!1);
@@ -2565,29 +2565,29 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
2565
2565
  async function te() {
2566
2566
  I.value = "Додати", v.value = !0, x = "add", _.value = {};
2567
2567
  }
2568
- function K(z, j) {
2569
- const C = j.key || j.name;
2570
- return s.value[C] && z[C] ? s.value[C].find((q) => q.id.toString() === z[C].toString())?.text ?? z[C] : z[C] || "-";
2568
+ function J(z, j) {
2569
+ const $ = j.key || j.name;
2570
+ return a.value[$] && z[$] ? a.value[$].find((W) => W.id.toString() === z[$].toString())?.text ?? z[$] : z[$] || "-";
2571
2571
  }
2572
2572
  async function M(z, j) {
2573
2573
  I.value = "Редагувати", v.value = !0, x = "edit", V = j, _.value = { ...z };
2574
2574
  }
2575
- function G() {
2575
+ function Z() {
2576
2576
  const z = F.value.validate();
2577
2577
  if (z) {
2578
- de({ type: "warning", title: "Помилка валідації", message: Object.entries(z).map(([j, C]) => `${j}: ${C}`).join(`
2578
+ de({ type: "warning", title: "Помилка валідації", message: Object.entries(z).map(([j, $]) => `${j}: ${$}`).join(`
2579
2579
  `) });
2580
2580
  return;
2581
2581
  }
2582
- x === "add" ? Array.isArray(t.value) ? t.value = [...t.value, _.value] : t.value = [_.value] : t.value = t.value.map((j, C) => C === V ? _.value : j), v.value = !1;
2582
+ x === "add" ? Array.isArray(t.value) ? t.value = [...t.value, _.value] : t.value = [_.value] : t.value = t.value.map((j, $) => $ === V ? _.value : j), v.value = !1;
2583
2583
  }
2584
2584
  function N(z) {
2585
- t.value = t.value.filter((j, C) => C !== z);
2585
+ t.value = t.value.filter((j, $) => $ !== z);
2586
2586
  }
2587
2587
  function le() {
2588
2588
  v.value = !1;
2589
2589
  }
2590
- return (z, j) => (u(), d("div", Ja, [
2590
+ return (z, j) => (i(), d("div", Ja, [
2591
2591
  l("div", Ya, [
2592
2592
  l("div", Xa, [
2593
2593
  A(Va, {
@@ -2597,7 +2597,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
2597
2597
  }),
2598
2598
  ne(l("input", {
2599
2599
  type: "text",
2600
- "onUpdate:modelValue": j[0] || (j[0] = (C) => n.value = C),
2600
+ "onUpdate:modelValue": j[0] || (j[0] = ($) => n.value = $),
2601
2601
  placeholder: "Пошук",
2602
2602
  class: "py-2 px-3 pl-10 w-full bg-gray-100 h-[36px] rounded-[8px] text-[15px] leading-[18px] focus:border-1 text-stone-800 placeholder:text-[#6B7280] focus:outline-blue-500 focus:outline-2"
2603
2603
  }, null, 512), [
@@ -2617,7 +2617,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
2617
2617
  l("div", ts, [
2618
2618
  l("div", ls, [
2619
2619
  l("button", {
2620
- onClick: Y,
2620
+ onClick: q,
2621
2621
  class: "bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"
2622
2622
  }, [
2623
2623
  A(Ba, {
@@ -2629,8 +2629,8 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
2629
2629
  ])
2630
2630
  ])
2631
2631
  ]),
2632
- (u(), me(Mt, { to: "body" }, [
2633
- c.value ? (u(), d("div", {
2632
+ (i(), me(Mt, { to: "body" }, [
2633
+ c.value ? (i(), d("div", {
2634
2634
  key: 0,
2635
2635
  class: "text-slate-700 vsTailwind vs-popover__content bottom",
2636
2636
  style: be([{ width: "fit-content", "z-index": "10002", position: "fixed" }, { position: "absolute", top: f.value.top + "px", left: f.value.left + "px" }])
@@ -2646,7 +2646,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
2646
2646
  width: "14",
2647
2647
  height: "14"
2648
2648
  }),
2649
- j[4] || (j[4] = ge(" Імпортувати "))
2649
+ j[4] || (j[4] = ge(" Імпортувати ", -1))
2650
2650
  ]),
2651
2651
  l("button", {
2652
2652
  onClick: H,
@@ -2658,7 +2658,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
2658
2658
  width: "14",
2659
2659
  height: "14"
2660
2660
  }),
2661
- j[5] || (j[5] = ge(" Експортувати "))
2661
+ j[5] || (j[5] = ge(" Експортувати ", -1))
2662
2662
  ])
2663
2663
  ])
2664
2664
  ])
@@ -2670,7 +2670,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
2670
2670
  class: "text-slate-700 bg-white hover:bg-gray-100 font-semibold text-[15px] leadig-[18.5px] py-[10px] px-[12px] border border-[#E5E7EB] rounded-[8px] h-[38px] max-h-[38px] gap-[8px] flex items-center"
2671
2671
  }, [
2672
2672
  A(Re),
2673
- j[6] || (j[6] = ge(" Додати "))
2673
+ j[6] || (j[6] = ge(" Додати ", -1))
2674
2674
  ])
2675
2675
  ]),
2676
2676
  l("div", ss, [
@@ -2684,17 +2684,17 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
2684
2684
  class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
2685
2685
  })
2686
2686
  ]),
2687
- (u(!0), d(se, null, ce(z.colModel, (C) => (u(), d("th", {
2688
- key: C.key,
2687
+ (i(!0), d(se, null, pe(z.colModel, ($) => (i(), d("th", {
2688
+ key: $.key,
2689
2689
  class: "h-10 px-2 text-left align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 min-w-[150px]"
2690
- }, W(C.ua || C.label), 1))), 128)),
2690
+ }, G($.ua || $.label), 1))), 128)),
2691
2691
  j[7] || (j[7] = l("th", { class: "h-10 px-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] font-semibold text-slate-700 dark:text-slate-300 text-center" }, " Дії ", -1))
2692
2692
  ])
2693
2693
  ]),
2694
2694
  l("tbody", {
2695
- class: E({ "[&_tr:last-child]:border-0": !i.value })
2695
+ class: E({ "[&_tr:last-child]:border-0": !u.value })
2696
2696
  }, [
2697
- a.value.length === 0 ? (u(), d("td", cs, [
2697
+ s.value.length === 0 ? (i(), d("td", cs, [
2698
2698
  l("div", ps, [
2699
2699
  l("div", fs, [
2700
2700
  A(qa, { class: "w-48 mx-auto" }),
@@ -2705,16 +2705,16 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
2705
2705
  ])
2706
2706
  ])
2707
2707
  ])) : D("", !0),
2708
- (u(!0), d(se, null, ce(a.value, (C, q) => (u(), d("tr", {
2709
- key: C.id,
2708
+ (i(!0), d(se, null, pe(s.value, ($, W) => (i(), d("tr", {
2709
+ key: $.id,
2710
2710
  class: E(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move", {
2711
- "opacity-50": r.value === q,
2712
- "border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20": i.value === q
2711
+ "opacity-50": r.value === W,
2712
+ "border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20": u.value === W
2713
2713
  }]),
2714
2714
  draggable: "true",
2715
- onDragstart: (oe) => m(q),
2716
- onDragover: we((oe) => b(q), ["prevent"]),
2717
- onDrop: (oe) => B(q)
2715
+ onDragstart: (oe) => m(W),
2716
+ onDragover: we((oe) => y(W), ["prevent"]),
2717
+ onDrop: (oe) => S(W)
2718
2718
  }, [
2719
2719
  l("td", vs, [
2720
2720
  l("div", hs, [
@@ -2725,31 +2725,31 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
2725
2725
  })
2726
2726
  ])
2727
2727
  ]),
2728
- (u(!0), d(se, null, ce(z.colModel, (oe) => (u(), d("td", {
2728
+ (i(!0), d(se, null, pe(z.colModel, (oe) => (i(), d("td", {
2729
2729
  key: oe.key,
2730
2730
  class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"
2731
2731
  }, [
2732
- oe.type === "file" ? (u(), d("div", gs, [
2733
- Z(K(C, oe)) ? (u(), d("div", bs, [
2732
+ oe.type === "file" ? (i(), d("div", gs, [
2733
+ K(J($, oe)) ? (i(), d("div", bs, [
2734
2734
  l("img", {
2735
- src: K(C, oe),
2735
+ src: J($, oe),
2736
2736
  alt: "alt",
2737
2737
  width: "45",
2738
2738
  class: "rounded-md max-w-[45px] h-[45px] object-cover"
2739
2739
  }, null, 8, ys)
2740
- ])) : (u(), d("div", xs, [
2740
+ ])) : (i(), d("div", xs, [
2741
2741
  A(jt, { class: "w-[25px] min-w-[25px] h-[25px]" })
2742
2742
  ]))
2743
- ])) : oe.type === "tiptap-editor" ? (u(), d("div", {
2743
+ ])) : oe.type === "tiptap-editor" ? (i(), d("div", {
2744
2744
  key: 1,
2745
2745
  class: "inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent bg-slate-100 dark:bg-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-600 transition-colors",
2746
- innerHTML: K(C, oe)
2747
- }, null, 8, ws)) : (u(), d("div", ks, W(K(C, oe)), 1))
2746
+ innerHTML: J($, oe)
2747
+ }, null, 8, ws)) : (i(), d("div", ks, G(J($, oe)), 1))
2748
2748
  ]))), 128)),
2749
2749
  l("td", _s, [
2750
2750
  l("div", $s, [
2751
2751
  l("button", {
2752
- onClick: (oe) => M(C, q),
2752
+ onClick: (oe) => M($, W),
2753
2753
  class: "text-slate-700 inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-blue-50 dark:hover:bg-slate-600 hover:border-blue-300 dark:hover:border-slate-500 hover:text-blue-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"
2754
2754
  }, [
2755
2755
  A(Ka, {
@@ -2759,7 +2759,7 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
2759
2759
  })
2760
2760
  ], 8, Cs),
2761
2761
  l("button", {
2762
- onClick: (oe) => N(q),
2762
+ onClick: (oe) => N(W),
2763
2763
  class: "text-slate-700 inline-flex items-center justify-center whitespace-nowrap font-medium focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 border rounded-md text-xs h-7 w-7 p-0 border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 hover:bg-red-50 dark:hover:bg-slate-600 hover:border-red-300 dark:hover:border-slate-500 hover:text-red-600 dark:hover:text-slate-200 transition-all duration-200 shadow-sm"
2764
2764
  }, [
2765
2765
  A(Qe, {
@@ -2784,18 +2784,18 @@ const Ka = /* @__PURE__ */ X(Wa, [["render", Za]]), Ja = { class: "vs-datatable
2784
2784
  A(He, {
2785
2785
  schema: e.colModel,
2786
2786
  values: _.value,
2787
- "onUpdate:values": j[1] || (j[1] = (C) => _.value = C),
2787
+ "onUpdate:values": j[1] || (j[1] = ($) => _.value = $),
2788
2788
  form: F.value,
2789
- "onUpdate:form": j[2] || (j[2] = (C) => F.value = C)
2789
+ "onUpdate:form": j[2] || (j[2] = ($) => F.value = $)
2790
2790
  }, null, 8, ["schema", "values", "form"]),
2791
2791
  l("div", Ms, [
2792
2792
  l("button", {
2793
2793
  type: "button",
2794
- onClick: j[3] || (j[3] = (C) => v.value = !1),
2794
+ onClick: j[3] || (j[3] = ($) => v.value = !1),
2795
2795
  class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-red-500 hover:border-red-500 hover:bg-red-500 focus:ring-red-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 mr-2"
2796
2796
  }, " Скасувати "),
2797
2797
  l("button", {
2798
- onClick: G,
2798
+ onClick: Z,
2799
2799
  type: "button",
2800
2800
  class: "vs-button inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border-1 border-transparent text-white bg-blue-500 hover:bg-blue-600 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1"
2801
2801
  }, " Зберегти ")
@@ -2950,7 +2950,7 @@ const js = {}, Es = {
2950
2950
  class: "icon icon-tabler icons-tabler-outline icon-tabler-map-pin"
2951
2951
  };
2952
2952
  function Is(o, e) {
2953
- return u(), d("svg", Es, e[0] || (e[0] = [
2953
+ return i(), d("svg", Es, e[0] || (e[0] = [
2954
2954
  l("path", {
2955
2955
  stroke: "none",
2956
2956
  d: "M0 0h24v24H0z",
@@ -2971,7 +2971,7 @@ const zs = /* @__PURE__ */ X(js, [["render", Is]]), As = {}, Ts = {
2971
2971
  class: "icon icon-tabler icons-tabler-outline icon-tabler-line"
2972
2972
  };
2973
2973
  function Fs(o, e) {
2974
- return u(), d("svg", Ts, e[0] || (e[0] = [
2974
+ return i(), d("svg", Ts, e[0] || (e[0] = [
2975
2975
  l("path", {
2976
2976
  stroke: "none",
2977
2977
  d: "M0 0h24v24H0z",
@@ -2993,7 +2993,7 @@ const Os = /* @__PURE__ */ X(As, [["render", Fs]]), Ds = {}, Us = {
2993
2993
  class: "icon icon-tabler icons-tabler-outline icon-tabler-polygon"
2994
2994
  };
2995
2995
  function Ps(o, e) {
2996
- return u(), d("svg", Us, e[0] || (e[0] = [
2996
+ return i(), d("svg", Us, e[0] || (e[0] = [
2997
2997
  ye('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M12 5m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M19 8m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M5 11m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M15 19m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0"></path><path d="M6.5 9.5l3.5 -3"></path><path d="M14 5.5l3 1.5"></path><path d="M18.5 10l-2.5 7"></path><path d="M13.5 17.5l-7 -5"></path>', 9)
2998
2998
  ]));
2999
2999
  }
@@ -3008,7 +3008,7 @@ const Rs = /* @__PURE__ */ X(Ds, [["render", Ps]]), Hs = {}, Ns = {
3008
3008
  class: "icon icon-tabler icons-tabler-outline icon-tabler-topology-ring-3"
3009
3009
  };
3010
3010
  function qs(o, e) {
3011
- return u(), d("svg", Ns, e[0] || (e[0] = [
3011
+ return i(), d("svg", Ns, e[0] || (e[0] = [
3012
3012
  ye('<path stroke="none" d="M0 0h24v24H0z" fill="none"></path><path d="M8 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 18a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M20 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M8 6a2 2 0 1 0 -4 0a2 2 0 0 0 4 0z"></path><path d="M6 8v8"></path><path d="M18 16v-8"></path><path d="M8 6h8"></path><path d="M16 18h-8"></path>', 9)
3013
3013
  ]));
3014
3014
  }
@@ -3021,7 +3021,7 @@ const Ws = /* @__PURE__ */ X(Hs, [["render", qs]]), Gs = {}, Zs = {
3021
3021
  class: "fullscreen-icon"
3022
3022
  };
3023
3023
  function Ks(o, e) {
3024
- return u(), d("svg", Zs, e[0] || (e[0] = [
3024
+ return i(), d("svg", Zs, e[0] || (e[0] = [
3025
3025
  l("title", null, null, -1),
3026
3026
  l("desc", null, null, -1),
3027
3027
  l("defs", null, null, -1),
@@ -3060,48 +3060,48 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3060
3060
  },
3061
3061
  emits: ["goToCoordinates"],
3062
3062
  setup(o, { emit: e }) {
3063
- const t = o, s = e, n = ["here", "xy", "parcel"], a = S(() => {
3063
+ const t = o, a = e, n = ["here", "xy", "parcel"], s = B(() => {
3064
3064
  const v = t.config?.tools?.filter((x) => n.includes(x));
3065
3065
  return v && v.length ? v : n;
3066
- }), r = S(() => t.config?.placeholder?.trim() || "Пошук…"), i = w(a.value[0] ?? n[0]);
3067
- re(a, (v) => {
3068
- v.includes(i.value) || (i.value = v[0]);
3066
+ }), r = B(() => t.config?.placeholder?.trim() || "Пошук…"), u = w(s.value[0] ?? n[0]);
3067
+ ie(s, (v) => {
3068
+ v.includes(u.value) || (u.value = v[0]);
3069
3069
  });
3070
3070
  const c = w(""), p = w(!1), f = w(null);
3071
- re(i, () => {
3071
+ ie(u, () => {
3072
3072
  c.value = "", p.value = !1;
3073
3073
  });
3074
3074
  function m(v) {
3075
- i.value = v;
3075
+ u.value = v;
3076
3076
  }
3077
- function b(v) {
3077
+ function y(v) {
3078
3078
  if (!p.value) return;
3079
3079
  const x = f.value;
3080
3080
  x && !x.contains(v.target) && (p.value = !1);
3081
3081
  }
3082
3082
  ke(() => {
3083
- window.addEventListener("click", b, !0);
3083
+ window.addEventListener("click", y, !0);
3084
3084
  }), at(() => {
3085
- window.removeEventListener("click", b, !0);
3085
+ window.removeEventListener("click", y, !0);
3086
3086
  });
3087
- function B(v) {
3087
+ function S(v) {
3088
3088
  return v === "xy" ? "Координати" : v === "parcel" ? "Кадастр" : "Адреси";
3089
3089
  }
3090
- function Y(v) {
3090
+ function q(v) {
3091
3091
  const x = v.replace(/[,]+/g, " ").trim();
3092
3092
  if (!x) return null;
3093
3093
  const V = x.split(/\s+/).filter(Boolean);
3094
3094
  if (V.length < 2) return null;
3095
3095
  const _ = V.slice(0, 2).map(Number);
3096
3096
  if (!_.every((le) => Number.isFinite(le))) return null;
3097
- let [F, te] = _, K = F, M = te;
3098
- const G = (le) => Math.abs(le) <= 90, N = (le) => Math.abs(le) <= 180;
3099
- if (!G(K) || !N(M))
3100
- if (G(M) && N(K))
3101
- K = te, M = F;
3097
+ let [F, te] = _, J = F, M = te;
3098
+ const Z = (le) => Math.abs(le) <= 90, N = (le) => Math.abs(le) <= 180;
3099
+ if (!Z(J) || !N(M))
3100
+ if (Z(M) && N(J))
3101
+ J = te, M = F;
3102
3102
  else
3103
3103
  return null;
3104
- return { lat: K, lng: M };
3104
+ return { lat: J, lng: M };
3105
3105
  }
3106
3106
  function R(v) {
3107
3107
  return (v?.items || []).map((V, _) => ({
@@ -3111,7 +3111,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3111
3111
  lng: Number(V?.position?.lng)
3112
3112
  })).filter((V) => Number.isFinite(V.lat) && Number.isFinite(V.lng));
3113
3113
  }
3114
- function Z(v) {
3114
+ function K(v) {
3115
3115
  const x = v?.result || v?.data || v;
3116
3116
  if (!x) return [];
3117
3117
  const V = x.geom_centroid;
@@ -3133,13 +3133,13 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3133
3133
  return V.every((F, te) => F.length === _[te] && /^\d+$/.test(F));
3134
3134
  }
3135
3135
  function H(v) {
3136
- s("goToCoordinates", [v.lat, v.lng]);
3136
+ a("goToCoordinates", [v.lat, v.lng]);
3137
3137
  }
3138
3138
  async function I() {
3139
3139
  const v = c.value.trim();
3140
3140
  if (v) {
3141
- if (i.value === "xy") {
3142
- const x = Y(v);
3141
+ if (u.value === "xy") {
3142
+ const x = q(v);
3143
3143
  if (!x) {
3144
3144
  de({ type: "warning", title: "Пошук координат", message: "Не знайдено або невірний формат координат" });
3145
3145
  return;
@@ -3148,8 +3148,8 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3148
3148
  return;
3149
3149
  }
3150
3150
  try {
3151
- const x = new URL(i.value === "here" ? lr : or);
3152
- if (i.value === "here")
3151
+ const x = new URL(u.value === "here" ? lr : or);
3152
+ if (u.value === "here")
3153
3153
  x.searchParams.set("searchtext", v);
3154
3154
  else {
3155
3155
  if (!T(v)) {
@@ -3160,7 +3160,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3160
3160
  }
3161
3161
  const V = await fetch(x.toString());
3162
3162
  if (!V.ok) throw new Error(`HTTP ${V.status}`);
3163
- const _ = await V.json(), F = i.value === "here" ? R(_) : Z(_);
3163
+ const _ = await V.json(), F = u.value === "here" ? R(_) : K(_);
3164
3164
  if (!F.length)
3165
3165
  de({ type: "warning", title: "Пошук", message: "Не знайдено результатів" });
3166
3166
  else {
@@ -3173,12 +3173,12 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3173
3173
  }
3174
3174
  }
3175
3175
  }
3176
- return (v, x) => (u(), d("div", Ys, [
3176
+ return (v, x) => (i(), d("div", Ys, [
3177
3177
  l("form", {
3178
3178
  class: "flex gap-2",
3179
3179
  onSubmit: we(I, ["prevent"])
3180
3180
  }, [
3181
- a.value.length > 1 ? (u(), d("div", {
3181
+ s.value.length > 1 ? (i(), d("div", {
3182
3182
  key: 0,
3183
3183
  ref_key: "dropdownRef",
3184
3184
  ref: f,
@@ -3189,8 +3189,8 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3189
3189
  class: "vstSelect-input transition-all text-left bg-white border border-gray-200 text-gray-900 rounded-lg focus:ring-blue-500 focus:border-blue-100 block w-full py-1.5 px-3 text-sm cursor-pointer flex items-center justify-between gap-2",
3190
3190
  onClick: x[0] || (x[0] = (V) => p.value = !p.value)
3191
3191
  }, [
3192
- l("span", null, W(B(i.value)), 1),
3193
- (u(), d("svg", {
3192
+ l("span", null, G(S(u.value)), 1),
3193
+ (i(), d("svg", {
3194
3194
  class: E(["w-4 h-4 text-gray-500 transition-transform", { "rotate-180": p.value }]),
3195
3195
  viewBox: "0 0 24 24",
3196
3196
  fill: "none",
@@ -3205,13 +3205,13 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3205
3205
  }, null, -1)
3206
3206
  ]), 2))
3207
3207
  ]),
3208
- p.value ? (u(), d("div", Xs, [
3208
+ p.value ? (i(), d("div", Xs, [
3209
3209
  l("ul", null, [
3210
- (u(!0), d(se, null, ce(a.value, (V) => (u(), d("li", {
3210
+ (i(!0), d(se, null, pe(s.value, (V) => (i(), d("li", {
3211
3211
  key: V,
3212
3212
  class: "px-3 py-2 cursor-pointer hover:bg-gray-100",
3213
3213
  onClick: (_) => m(V)
3214
- }, W(B(V)), 9, Qs))), 128))
3214
+ }, G(S(V)), 9, Qs))), 128))
3215
3215
  ])
3216
3216
  ])) : D("", !0)
3217
3217
  ], 512)) : D("", !0),
@@ -3260,16 +3260,16 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3260
3260
  },
3261
3261
  emits: ["onLayerChange"],
3262
3262
  setup(o, { emit: e }) {
3263
- const s = w(Object.keys(o.basemaps)[0]), n = e;
3264
- function a(r) {
3265
- n("onLayerChange", r), s.value = r;
3263
+ const a = w(Object.keys(o.basemaps)[0]), n = e;
3264
+ function s(r) {
3265
+ n("onLayerChange", r), a.value = r;
3266
3266
  }
3267
- return (r, i) => (u(), d("div", sr, [
3267
+ return (r, u) => (i(), d("div", sr, [
3268
3268
  l("div", rr, [
3269
- (u(!0), d(se, null, ce(r.basemaps, (c, p) => (u(), d("div", {
3269
+ (i(!0), d(se, null, pe(r.basemaps, (c, p) => (i(), d("div", {
3270
3270
  key: p,
3271
- class: E(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm", { "ring-2 ring-blue-500 border-blue-300": s.value === p }]),
3272
- onClick: (f) => a(p),
3271
+ class: E(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm", { "ring-2 ring-blue-500 border-blue-300": a.value === p }]),
3272
+ onClick: (f) => s(p),
3273
3273
  title: c.name || p,
3274
3274
  role: "button",
3275
3275
  tabindex: "0"
@@ -3310,59 +3310,59 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3310
3310
  },
3311
3311
  emits: ["update:modelValue"],
3312
3312
  setup(o, { emit: e }) {
3313
- const t = Wt(), s = o, n = e, a = w(!1), r = w("");
3314
- function i() {
3315
- const y = navigator.platform.toUpperCase().indexOf("MAC") >= 0;
3313
+ const t = Wt(), a = o, n = e, s = w(!1), r = w("");
3314
+ function u() {
3315
+ const b = navigator.platform.toUpperCase().indexOf("MAC") >= 0;
3316
3316
  return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ? "Використовуйте два пальці для зуму карти." : "Використовуйте Ctrl + прокрутка для зуму карти.";
3317
3317
  }
3318
3318
  const c = w(null);
3319
- let p, f, m, b = null;
3320
- const B = w(null), Y = (y) => {
3321
- y.ctrlKey && y.preventDefault();
3319
+ let p, f, m, y = null;
3320
+ const S = w(null), q = (b) => {
3321
+ b.ctrlKey && b.preventDefault();
3322
3322
  };
3323
3323
  function R() {
3324
- if (!s.handleZoom) return null;
3325
- let y;
3324
+ if (!a.handleZoom) return null;
3325
+ let b;
3326
3326
  const k = (O) => {
3327
3327
  const Q = O.ctrlKey || O.metaKey, he = O.shiftKey;
3328
3328
  if (!Q && !he) {
3329
- a.value = !0, r.value = i(), clearTimeout(y), y = window.setTimeout(() => {
3330
- a.value = !1;
3329
+ s.value = !0, r.value = u(), clearTimeout(b), b = window.setTimeout(() => {
3330
+ s.value = !1;
3331
3331
  }, 1e3);
3332
3332
  return;
3333
3333
  }
3334
- a.value = !1, p.scrollWheelZoom.enable(), setTimeout(() => {
3334
+ s.value = !1, p.scrollWheelZoom.enable(), setTimeout(() => {
3335
3335
  p.scrollWheelZoom.disable();
3336
3336
  }, 100);
3337
- }, J = (O) => {
3337
+ }, Y = (O) => {
3338
3338
  if (O.touches.length === 1) {
3339
- a.value = !0, r.value = i(), clearTimeout(y), y = window.setTimeout(() => {
3340
- a.value = !1;
3339
+ s.value = !0, r.value = u(), clearTimeout(b), b = window.setTimeout(() => {
3340
+ s.value = !1;
3341
3341
  }, 3e3);
3342
3342
  return;
3343
3343
  }
3344
- a.value = !1;
3344
+ s.value = !1;
3345
3345
  };
3346
- return c.value && (c.value.addEventListener("wheel", k, { passive: !1 }), c.value.addEventListener("touchstart", J, { passive: !0 })), p && p.on("wheel", (O) => {
3346
+ return c.value && (c.value.addEventListener("wheel", k, { passive: !1 }), c.value.addEventListener("touchstart", Y, { passive: !0 })), p && p.on("wheel", (O) => {
3347
3347
  const Q = O.originalEvent.ctrlKey || O.originalEvent.metaKey, he = O.originalEvent.shiftKey;
3348
3348
  !Q && !he && (O.originalEvent.preventDefault(), O.originalEvent.stopPropagation());
3349
3349
  }), () => {
3350
- c.value && (c.value.removeEventListener("wheel", k), c.value.removeEventListener("touchstart", J)), p && p.off("wheel"), clearTimeout(y);
3350
+ c.value && (c.value.removeEventListener("wheel", k), c.value.removeEventListener("touchstart", Y)), p && p.off("wheel"), clearTimeout(b);
3351
3351
  };
3352
3352
  }
3353
- const Z = w(null), T = w(6), H = w(0), I = w(t?.appContext.config.globalProperties.$settings?.center || [50, 30]), v = w(null), x = Oe();
3353
+ const K = w(null), T = w(6), H = w(0), I = w(t?.appContext.config.globalProperties.$settings?.center || [50, 30]), v = w(null), x = Oe();
3354
3354
  let V;
3355
3355
  const _ = w("topo100");
3356
- function F(y) {
3357
- return y ? y.type === "Polygon" ? {
3356
+ function F(b) {
3357
+ return b ? b.type === "Polygon" ? {
3358
3358
  type: "MultiPolygon",
3359
- coordinates: [y.coordinates]
3360
- } : (y.type === "MultiPolygon", y) : null;
3359
+ coordinates: [b.coordinates]
3360
+ } : (b.type === "MultiPolygon", b) : null;
3361
3361
  }
3362
3362
  function te() {
3363
- return new Promise((y, k) => {
3364
- window.L && window.L.Draw && y(0);
3365
- const J = (Q) => {
3363
+ return new Promise((b, k) => {
3364
+ window.L && window.L.Draw && b(0);
3365
+ const Y = (Q) => {
3366
3366
  if (Array.from(document.styleSheets).some((Se) => Se?.href?.includes(Q))) return;
3367
3367
  const Ce = document.createElement("link");
3368
3368
  Ce.rel = "stylesheet", Ce.href = Q, document.head.appendChild(Ce);
@@ -3372,14 +3372,14 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3372
3372
  Se.addEventListener("load", () => he()), Se.addEventListener("error", (je) => Ce(je));
3373
3373
  return;
3374
3374
  }
3375
- const Ve = document.createElement("script");
3376
- Ve.src = Q, Ve.async = !0, Ve.onload = () => he(), Ve.onerror = (je) => Ce(je), document.body.appendChild(Ve);
3375
+ const Me = document.createElement("script");
3376
+ Me.src = Q, Me.async = !0, Me.onload = () => he(), Me.onerror = (je) => Ce(je), document.body.appendChild(Me);
3377
3377
  });
3378
- J("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), J("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"), O("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(() => O("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(() => y(0)).catch(k);
3378
+ Y("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), Y("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"), O("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(() => O("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(() => b(0)).catch(k);
3379
3379
  });
3380
3380
  }
3381
- function K() {
3382
- const y = f.toGeoJSON(), k = [], J = (Q) => {
3381
+ function J() {
3382
+ const b = f.toGeoJSON(), k = [], Y = (Q) => {
3383
3383
  if (Q)
3384
3384
  switch (Q.type) {
3385
3385
  case "Polygon":
@@ -3389,99 +3389,99 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3389
3389
  k.push(...Q.coordinates);
3390
3390
  break;
3391
3391
  case "GeometryCollection":
3392
- (Q.geometries || []).forEach(J);
3392
+ (Q.geometries || []).forEach(Y);
3393
3393
  break;
3394
3394
  }
3395
3395
  };
3396
- (y?.features || []).forEach((Q) => J(Q.geometry));
3396
+ (b?.features || []).forEach((Q) => Y(Q.geometry));
3397
3397
  const O = k.length ? { type: "MultiPolygon", coordinates: k } : null;
3398
3398
  n("update:modelValue", O ? F(O) : null), H.value = f.getLayers().length;
3399
3399
  }
3400
- function M(y = 30) {
3400
+ function M(b = 30) {
3401
3401
  const k = f.getLayers();
3402
3402
  if (!k.length) return;
3403
3403
  const O = L.featureGroup(k).getBounds();
3404
- O && O.isValid() && p.fitBounds(O, { padding: [y, y] });
3404
+ O && O.isValid() && p.fitBounds(O, { padding: [b, b] });
3405
3405
  }
3406
- function G() {
3407
- B.value?.click();
3406
+ function Z() {
3407
+ S.value?.click();
3408
3408
  }
3409
3409
  const N = w("");
3410
- function le(y) {
3411
- return y instanceof L.Circle ? "Circle" : y instanceof L.Rectangle ? "Rectangle" : y instanceof L.Polygon && !(y instanceof L.Rectangle) ? "Polygon" : y instanceof L.Polyline && !(y instanceof L.Polygon) ? "Polyline" : y instanceof L.Marker ? "Point" : "Feature";
3410
+ function le(b) {
3411
+ return b instanceof L.Circle ? "Circle" : b instanceof L.Rectangle ? "Rectangle" : b instanceof L.Polygon && !(b instanceof L.Rectangle) ? "Polygon" : b instanceof L.Polyline && !(b instanceof L.Polygon) ? "Polyline" : b instanceof L.Marker ? "Point" : "Feature";
3412
3412
  }
3413
- function z(y) {
3414
- if (y instanceof L.Circle) {
3415
- const k = y.getRadius();
3413
+ function z(b) {
3414
+ if (b instanceof L.Circle) {
3415
+ const k = b.getRadius();
3416
3416
  return Math.PI * (k * k) / 1e6;
3417
3417
  }
3418
- if (y instanceof L.Polygon || y instanceof L.Rectangle)
3418
+ if (b instanceof L.Polygon || b instanceof L.Rectangle)
3419
3419
  try {
3420
- const k = y.getLatLngs(), J = Array.isArray(k[0]) ? k[0] : k, O = L.GeometryUtil?.geodesicArea ? L.GeometryUtil.geodesicArea(J) : 0;
3420
+ const k = b.getLatLngs(), Y = Array.isArray(k[0]) ? k[0] : k, O = L.GeometryUtil?.geodesicArea ? L.GeometryUtil.geodesicArea(Y) : 0;
3421
3421
  return O ? O / 1e6 : 0;
3422
3422
  } catch {
3423
3423
  return null;
3424
3424
  }
3425
3425
  return null;
3426
3426
  }
3427
- function j(y) {
3428
- return y instanceof L.Circle ? y.getLatLng() : y.getBounds ? y.getBounds().getCenter() : y.getLatLng ? y.getLatLng() : p.getCenter();
3427
+ function j(b) {
3428
+ return b instanceof L.Circle ? b.getLatLng() : b.getBounds ? b.getBounds().getCenter() : b.getLatLng ? b.getLatLng() : p.getCenter();
3429
3429
  }
3430
- function C() {
3431
- const y = f.getLayers();
3432
- if (!y.length) {
3430
+ function $() {
3431
+ const b = f.getLayers();
3432
+ if (!b.length) {
3433
3433
  v.value = null, H.value = 0;
3434
3434
  return;
3435
3435
  }
3436
- const k = y[y.length - 1], J = le(k), O = j(k), Q = z(k);
3436
+ const k = b[b.length - 1], Y = le(k), O = j(k), Q = z(k);
3437
3437
  v.value = {
3438
- type: J,
3438
+ type: Y,
3439
3439
  center: O,
3440
3440
  areaKm2: Q,
3441
3441
  layer: k
3442
- }, H.value = y.length;
3442
+ }, H.value = b.length;
3443
3443
  }
3444
- function q() {
3445
- const y = v.value?.layer;
3446
- y && (y instanceof L.Circle && y.getBounds ? p.fitBounds(y.getBounds(), { padding: [30, 30] }) : y.getBounds ? p.fitBounds(y.getBounds(), { padding: [30, 30] }) : y.getLatLng && p.setView(y.getLatLng(), Math.max(T.value, 14)));
3444
+ function W() {
3445
+ const b = v.value?.layer;
3446
+ b && (b instanceof L.Circle && b.getBounds ? p.fitBounds(b.getBounds(), { padding: [30, 30] }) : b.getBounds ? p.fitBounds(b.getBounds(), { padding: [30, 30] }) : b.getLatLng && p.setView(b.getLatLng(), Math.max(T.value, 14)));
3447
3447
  }
3448
3448
  function oe() {
3449
- const y = v.value?.layer;
3450
- y && (f.removeLayer(y), K(), C());
3449
+ const b = v.value?.layer;
3450
+ b && (f.removeLayer(b), J(), $());
3451
3451
  }
3452
3452
  ke(async () => {
3453
- document.addEventListener("wheel", Y, { passive: !1 }), await te(), L.drawLocal = Ss;
3454
- const y = s.handleZoom;
3453
+ document.addEventListener("wheel", q, { passive: !1 }), await te(), L.drawLocal = Ss;
3454
+ const b = a.handleZoom;
3455
3455
  p = L.map(c.value, {
3456
3456
  zoomControl: !1,
3457
- scrollWheelZoom: !y
3457
+ scrollWheelZoom: !b
3458
3458
  }).setView(I.value, 10), setTimeout(() => {
3459
- b = R();
3459
+ y = R();
3460
3460
  }, 100), L.control.zoom({ position: "bottomright" }).addTo(p), _.value = Object.keys(x)[0], V = L.tileLayer(x[_.value].url, { maxZoom: 19, minZoom: 6 }).addTo(p), f = new L.FeatureGroup().addTo(p), p.on(L.Draw.Event.CREATED, (O) => {
3461
3461
  const { layer: Q } = O;
3462
- f.clearLayers(), f.addLayer(Q), K(), C(), M(), N.value = "";
3462
+ f.clearLayers(), f.addLayer(Q), J(), $(), M(), N.value = "";
3463
3463
  }), p.on(L.Draw.Event.EDITED, () => {
3464
- K(), C(), M();
3464
+ J(), $(), M();
3465
3465
  }), p.on(L.Draw.Event.DELETED, () => {
3466
- K(), C(), M();
3466
+ J(), $(), M();
3467
3467
  });
3468
3468
  let k = !1;
3469
3469
  p.on("mousemove", (O) => {
3470
- k || (p.invalidateSize(), k = !0), Z.value = O.latlng;
3470
+ k || (p.invalidateSize(), k = !0), K.value = O.latlng;
3471
3471
  }), p.on("zoomend", () => {
3472
3472
  T.value = p.getZoom();
3473
3473
  });
3474
- const J = Bs(s.modelValue);
3475
- if (J) {
3474
+ const Y = Bs(a.modelValue);
3475
+ if (Y) {
3476
3476
  const O = [];
3477
- L.geoJSON(J).eachLayer((Q) => O.push(Q)), O.length && f.addLayer(O[0]), K(), C(), M();
3477
+ L.geoJSON(Y).eachLayer((Q) => O.push(Q)), O.length && f.addLayer(O[0]), J(), $(), M();
3478
3478
  }
3479
3479
  }), Ye(() => {
3480
- document.removeEventListener("wheel", Y), b && b();
3480
+ document.removeEventListener("wheel", q), y && y();
3481
3481
  });
3482
- function pe(y) {
3482
+ function ce(b) {
3483
3483
  if (p) {
3484
- switch (m && m.disable(), y) {
3484
+ switch (m && m.disable(), b) {
3485
3485
  case "marker":
3486
3486
  m = new L.Draw.Marker(p);
3487
3487
  break;
@@ -3498,16 +3498,16 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3498
3498
  m = new L.Draw.Rectangle(p);
3499
3499
  break;
3500
3500
  }
3501
- m && (m.enable(), N.value = y);
3501
+ m && (m.enable(), N.value = b);
3502
3502
  }
3503
3503
  }
3504
- function Me() {
3505
- const y = f.toGeoJSON(), k = new Blob([JSON.stringify(y, null, 2)], { type: "application/json" }), J = URL.createObjectURL(k), O = document.createElement("a");
3506
- O.href = J, O.download = "data.geojson", O.click(), URL.revokeObjectURL(J);
3504
+ function Ve() {
3505
+ const b = f.toGeoJSON(), k = new Blob([JSON.stringify(b, null, 2)], { type: "application/json" }), Y = URL.createObjectURL(k), O = document.createElement("a");
3506
+ O.href = Y, O.download = "data.geojson", O.click(), URL.revokeObjectURL(Y);
3507
3507
  }
3508
- function Ne(y) {
3509
- const k = y.target, J = k.files?.[0];
3510
- if (!J) return;
3508
+ function Ne(b) {
3509
+ const k = b.target, Y = k.files?.[0];
3510
+ if (!Y) return;
3511
3511
  const O = new FileReader();
3512
3512
  O.onload = () => {
3513
3513
  if (typeof O.result == "string")
@@ -3515,37 +3515,37 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3515
3515
  const Q = JSON.parse(O.result);
3516
3516
  f.clearLayers(), Q && L.geoJSON({ type: "Feature", geometry: Q }).eachLayer((he) => {
3517
3517
  f.addLayer(he);
3518
- }), K(), C(), M();
3518
+ }), J(), $(), M();
3519
3519
  } finally {
3520
3520
  k.value = "";
3521
3521
  }
3522
- }, O.readAsText(J);
3522
+ }, O.readAsText(Y);
3523
3523
  }
3524
- function qe(y) {
3525
- p && (V && p.removeLayer(V), V = L.tileLayer(x[y].url, { maxZoom: 19, minZoom: 6 }).addTo(p), _.value = y);
3524
+ function qe(b) {
3525
+ p && (V && p.removeLayer(V), V = L.tileLayer(x[b].url, { maxZoom: 19, minZoom: 6 }).addTo(p), _.value = b);
3526
3526
  }
3527
- function et(y) {
3528
- const k = L.latLng(y[0], y[1]);
3527
+ function et(b) {
3528
+ const k = L.latLng(b[0], b[1]);
3529
3529
  p.setView(k, 13);
3530
3530
  }
3531
- re(
3532
- () => s.modelValue,
3533
- (y) => {
3534
- const k = F(y);
3535
- if (y && k !== y) {
3531
+ ie(
3532
+ () => a.modelValue,
3533
+ (b) => {
3534
+ const k = F(b);
3535
+ if (b && k !== b) {
3536
3536
  n("update:modelValue", k);
3537
3537
  return;
3538
3538
  }
3539
- f.clearLayers(), k && L.geoJSON({ type: "Feature", geometry: k }).eachLayer((J) => {
3540
- f.addLayer(J), J.dragging?.enable(), J.dragging?.enabled(), J.on("dragend", (O) => {
3539
+ f.clearLayers(), k && L.geoJSON({ type: "Feature", geometry: k }).eachLayer((Y) => {
3540
+ f.addLayer(Y), Y.dragging?.enable(), Y.dragging?.enabled(), Y.on("dragend", (O) => {
3541
3541
  const he = O.target.getLatLng();
3542
3542
  n("update:modelValue", { type: "Point", coordinates: [he.lng, he.lat] });
3543
3543
  });
3544
- }), H.value = f.getLayers().length, C(), M();
3544
+ }), H.value = f.getLayers().length, $(), M();
3545
3545
  }
3546
3546
  );
3547
3547
  function Oe() {
3548
- return t?.appContext.config.globalProperties.$settings?.basemaps ? t?.appContext.config.globalProperties.$settings?.basemaps.map((y, k) => Object.assign(y, { key: `b${k}`, preview: y.preview || y.url.replace("{z}/{x}/{y}.png", "13/4790/2762.png") })).reduce((y, k) => ({ ...y, [k.key]: k }), {}) : {
3548
+ return t?.appContext.config.globalProperties.$settings?.basemaps ? t?.appContext.config.globalProperties.$settings?.basemaps.map((b, k) => Object.assign(b, { key: `b${k}`, preview: b.preview || b.url.replace("{z}/{x}/{y}.png", "13/4790/2762.png") })).reduce((b, k) => ({ ...b, [k.key]: k }), {}) : {
3549
3549
  topo100: {
3550
3550
  url: "https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",
3551
3551
  preview: "https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"
@@ -3561,11 +3561,11 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3561
3561
  };
3562
3562
  }
3563
3563
  const $e = w(!1);
3564
- return re($e, () => {
3564
+ return ie($e, () => {
3565
3565
  setTimeout(() => {
3566
3566
  p.invalidateSize();
3567
3567
  }, 50);
3568
- }), (y, k) => (u(), d("div", {
3568
+ }), (b, k) => (i(), d("div", {
3569
3569
  class: E(["leaflet-map-wrapper relative w-full h-[400px]", { fullscreen: $e.value }])
3570
3570
  }, [
3571
3571
  l("div", {
@@ -3583,9 +3583,9 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3583
3583
  "leave-to-class": "opacity-0"
3584
3584
  }, {
3585
3585
  default: Be(() => [
3586
- a.value && s.handleZoom ? (u(), d("div", cr, [
3586
+ s.value && a.handleZoom ? (i(), d("div", cr, [
3587
3587
  l("div", pr, [
3588
- l("p", fr, W(r.value), 1)
3588
+ l("p", fr, G(r.value), 1)
3589
3589
  ])
3590
3590
  ])) : D("", !0)
3591
3591
  ]),
@@ -3598,18 +3598,18 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3598
3598
  l("button", {
3599
3599
  type: "button",
3600
3600
  class: "inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white hover:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:ring-offset-1 transition",
3601
- onClick: G
3601
+ onClick: Z
3602
3602
  }, "Import"),
3603
3603
  l("button", {
3604
3604
  type: "button",
3605
3605
  class: "inline-flex items-center gap-2 text-sm font-medium border rounded-md px-3 py-2 bg-white text-blue-600 border-stone-200 hover:bg-blue-500 hover:text-white hover:border-blue-500 focus:outline-none focus:ring-1 focus:ring-blue-500 focus:ring-offset-1 transition disabled:opacity-50 disabled:cursor-not-allowed disabled:bg-gray-100 disabled:text-gray-400 disabled:border-gray-200 disabled:hover:bg-gray-100 disabled:hover:text-gray-400",
3606
- onClick: Me,
3606
+ onClick: Ve,
3607
3607
  disabled: H.value === 0
3608
3608
  }, "Export", 8, gr)
3609
3609
  ]),
3610
3610
  l("input", {
3611
3611
  ref_key: "importRef",
3612
- ref: B,
3612
+ ref: S,
3613
3613
  type: "file",
3614
3614
  onChange: Ne,
3615
3615
  accept: ".json,.geojson",
@@ -3624,7 +3624,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3624
3624
  "aria-pressed": N.value === "marker",
3625
3625
  title: "Point (P)",
3626
3626
  "aria-label": "Draw point",
3627
- onClick: k[0] || (k[0] = (J) => pe("marker"))
3627
+ onClick: k[0] || (k[0] = (Y) => ce("marker"))
3628
3628
  }, [
3629
3629
  A(zs)
3630
3630
  ], 10, xr),
@@ -3633,7 +3633,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3633
3633
  "aria-pressed": N.value === "polyline",
3634
3634
  title: "Line (L)",
3635
3635
  "aria-label": "Draw polyline",
3636
- onClick: k[1] || (k[1] = (J) => pe("polyline"))
3636
+ onClick: k[1] || (k[1] = (Y) => ce("polyline"))
3637
3637
  }, [
3638
3638
  A(Os)
3639
3639
  ], 10, wr),
@@ -3642,7 +3642,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3642
3642
  "aria-pressed": N.value === "polygon",
3643
3643
  title: "Polygon (G)",
3644
3644
  "aria-label": "Draw polygon",
3645
- onClick: k[2] || (k[2] = (J) => pe("polygon"))
3645
+ onClick: k[2] || (k[2] = (Y) => ce("polygon"))
3646
3646
  }, [
3647
3647
  A(Rs)
3648
3648
  ], 10, kr),
@@ -3651,13 +3651,13 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3651
3651
  "aria-pressed": N.value === "rectangle",
3652
3652
  title: "Rectangle (R)",
3653
3653
  "aria-label": "Draw rectangle",
3654
- onClick: k[3] || (k[3] = (J) => pe("rectangle"))
3654
+ onClick: k[3] || (k[3] = (Y) => ce("rectangle"))
3655
3655
  }, [
3656
3656
  A(Ws)
3657
3657
  ], 10, _r),
3658
3658
  l("button", {
3659
3659
  class: "vs-btn mt-5",
3660
- onClick: k[4] || (k[4] = (J) => {
3660
+ onClick: k[4] || (k[4] = (Y) => {
3661
3661
  $e.value = !$e.value;
3662
3662
  }),
3663
3663
  title: "Full Screen",
@@ -3676,34 +3676,34 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3676
3676
  }, null, 8, ["basemaps"])
3677
3677
  ], 2),
3678
3678
  l("div", $r, [
3679
- v.value ? (u(), d("div", Cr, [
3679
+ v.value ? (i(), d("div", Cr, [
3680
3680
  l("div", Vr, [
3681
- k[7] || (k[7] = ge(" Тип: ")),
3682
- l("span", Mr, W(v.value.type), 1)
3681
+ k[7] || (k[7] = ge(" Тип: ", -1)),
3682
+ l("span", Mr, G(v.value.type), 1)
3683
3683
  ]),
3684
3684
  l("div", Lr, [
3685
3685
  l("div", Sr, [
3686
- k[8] || (k[8] = ge(" Центр: ")),
3687
- l("b", null, W(v.value.center.lat.toFixed(5)) + ", " + W(v.value.center.lng.toFixed(5)), 1)
3686
+ k[8] || (k[8] = ge(" Центр: ", -1)),
3687
+ l("b", null, G(v.value.center.lat.toFixed(5)) + ", " + G(v.value.center.lng.toFixed(5)), 1)
3688
3688
  ]),
3689
- v.value.areaKm2 !== null ? (u(), d("div", Br, [
3690
- k[9] || (k[9] = ge(" Площа: ")),
3691
- l("b", null, W(v.value.areaKm2.toFixed(1)) + "км²", 1)
3692
- ])) : (u(), d("div", jr, k[10] || (k[10] = [
3693
- ge(" Площа: "),
3689
+ v.value.areaKm2 !== null ? (i(), d("div", Br, [
3690
+ k[9] || (k[9] = ge(" Площа: ", -1)),
3691
+ l("b", null, G(v.value.areaKm2.toFixed(1)) + "км²", 1)
3692
+ ])) : (i(), d("div", jr, k[10] || (k[10] = [
3693
+ ge(" Площа: ", -1),
3694
3694
  l("b", null, "—", -1)
3695
3695
  ]))),
3696
3696
  l("button", {
3697
3697
  class: "tool bg-gray-100 py-1.5 px-2 rounded-lg text-md mr-1 cursor-pointer hover:bg-blue-500 hover:text-white transition-all",
3698
3698
  title: "Наблизити",
3699
- onClick: k[5] || (k[5] = (J) => q())
3699
+ onClick: k[5] || (k[5] = (Y) => W())
3700
3700
  }, k[11] || (k[11] = [
3701
3701
  ye('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="w-3 h-3" data-v-66e4a27d><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" data-v-66e4a27d></path><path d="M7 10l6 0" data-v-66e4a27d></path><path d="M10 7l0 6" data-v-66e4a27d></path><path d="M21 21l-6 -6" data-v-66e4a27d></path></svg>', 1)
3702
3702
  ])),
3703
3703
  l("button", {
3704
3704
  class: "tool bg-gray-100 py-1.5 px-2 rounded-lg text-md cursor-pointer hover:bg-blue-500 hover:text-white transition-all",
3705
3705
  title: "Видалити",
3706
- onClick: k[6] || (k[6] = (J) => oe())
3706
+ onClick: k[6] || (k[6] = (Y) => oe())
3707
3707
  }, [
3708
3708
  A(Qe, { class: "w-3 h-3" })
3709
3709
  ])
@@ -3717,7 +3717,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3717
3717
  class: "absolute text-gray-500 truncate pl-2"
3718
3718
  }, Dr = { class: "flex-1 min-w-[2px]" }, Ur = ["placeholder"], Pr = { class: "flex items-center shrink-0" }, Rr = ["disabled"], Hr = /* @__PURE__ */ U({
3719
3719
  __name: "vs-input-tag",
3720
- props: /* @__PURE__ */ ie({
3720
+ props: /* @__PURE__ */ re({
3721
3721
  unique: { type: Boolean, default: !0 },
3722
3722
  style: { default: () => ({}) },
3723
3723
  customClass: { default: "" },
@@ -3730,32 +3730,32 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3730
3730
  modelValue: { default: [] },
3731
3731
  modelModifiers: {}
3732
3732
  }),
3733
- emits: /* @__PURE__ */ ie(["update:modelValue"], ["update:modelValue"]),
3733
+ emits: /* @__PURE__ */ re(["update:modelValue"], ["update:modelValue"]),
3734
3734
  setup(o, { emit: e }) {
3735
- const t = o, s = e;
3735
+ const t = o, a = e;
3736
3736
  _e(t.style);
3737
- const n = w(null), a = w(null), r = w(null), i = w(!1), c = w(""), p = ue(o, "modelValue"), f = S(() => t.placeholder || "Add tag…"), m = S(() => p.value?.length === 0 && c.value === ""), b = S(() => !t.disabled && p.value?.length > 0), B = S(() => t.disabled), Y = async () => {
3738
- B.value || await Ie(() => r.value?.focus());
3737
+ const n = w(null), s = w(null), r = w(null), u = w(!1), c = w(""), p = ue(o, "modelValue"), f = B(() => t.placeholder || "Add tag…"), m = B(() => p.value?.length === 0 && c.value === ""), y = B(() => !t.disabled && p.value?.length > 0), S = B(() => t.disabled), q = async () => {
3738
+ S.value || await Ie(() => r.value?.focus());
3739
3739
  }, R = (V) => {
3740
3740
  const _ = V.trim();
3741
3741
  _ !== "" && (!p.value || !Array.isArray(p.value) ? p.value = [_] : t.unique ? p.value.includes(_) || (p.value = [...p.value, _]) : p.value = [...p.value, _], c.value = "");
3742
- }, Z = () => {
3742
+ }, K = () => {
3743
3743
  const V = c.value;
3744
3744
  V.trim() !== "" && R(V), c.value = "";
3745
3745
  }, T = (V) => {
3746
3746
  const _ = p.value.slice();
3747
- _.splice(V, 1), s("update:modelValue", _);
3747
+ _.splice(V, 1), a("update:modelValue", _);
3748
3748
  }, H = () => {
3749
- s("update:modelValue", []);
3749
+ a("update:modelValue", []);
3750
3750
  }, I = () => {
3751
- B.value || (i.value = !0);
3751
+ S.value || (u.value = !0);
3752
3752
  }, v = () => {
3753
- i.value = !1;
3753
+ u.value = !1;
3754
3754
  }, x = (V) => {
3755
3755
  const { key: _ } = V;
3756
- _ === "Enter" ? (V.preventDefault(), Z()) : _ === "Backspace" && c.value === "" && p.value.length > 0 && T(p.value.length - 1);
3756
+ _ === "Enter" ? (V.preventDefault(), K()) : _ === "Backspace" && c.value === "" && p.value.length > 0 && T(p.value.length - 1);
3757
3757
  };
3758
- return (V, _) => (u(), d("div", {
3758
+ return (V, _) => (i(), d("div", {
3759
3759
  class: "flex gap-1 w-full",
3760
3760
  ref_key: "root",
3761
3761
  ref: n,
@@ -3771,28 +3771,28 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3771
3771
  class: E([
3772
3772
  "flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
3773
3773
  "border-gray-300 hover:border-gray-400",
3774
- i.value ? "border-blue-500 ring-1 ring-blue-500" : "",
3775
- B.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
3774
+ u.value ? "border-blue-500 ring-1 ring-blue-500" : "",
3775
+ S.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
3776
3776
  ]),
3777
- "data-focus": i.value ? "true" : "false",
3778
- onClick: Y
3777
+ "data-focus": u.value ? "true" : "false",
3778
+ onClick: q
3779
3779
  }, [
3780
3780
  l("div", {
3781
3781
  class: "flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",
3782
3782
  ref_key: "chipsRef",
3783
- ref: a
3783
+ ref: s
3784
3784
  }, [
3785
- (u(!0), d(se, null, ce(p.value, (F, te) => (u(), d("div", {
3785
+ (i(!0), d(se, null, pe(p.value, (F, te) => (i(), d("div", {
3786
3786
  key: te,
3787
3787
  class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"
3788
3788
  }, [
3789
3789
  l("div", Ar, [
3790
- l("div", Tr, W(F), 1)
3790
+ l("div", Tr, G(F), 1)
3791
3791
  ]),
3792
3792
  l("div", {
3793
3793
  role: "button",
3794
3794
  class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
3795
- onClick: we((K) => T(te), ["stop"]),
3795
+ onClick: we((J) => T(te), ["stop"]),
3796
3796
  "aria-label": `Remove ${F}`
3797
3797
  }, _[2] || (_[2] = [
3798
3798
  l("svg", {
@@ -3807,9 +3807,9 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3807
3807
  ], -1)
3808
3808
  ]), 8, Fr)
3809
3809
  ]))), 128)),
3810
- m.value ? (u(), d("div", Or, W(f.value), 1)) : D("", !0),
3810
+ m.value ? (i(), d("div", Or, G(f.value), 1)) : D("", !0),
3811
3811
  l("div", Dr, [
3812
- B.value ? D("", !0) : ne((u(), d("input", {
3812
+ S.value ? D("", !0) : ne((i(), d("input", {
3813
3813
  key: 0,
3814
3814
  ref_key: "inputRef",
3815
3815
  ref: r,
@@ -3832,12 +3832,12 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3832
3832
  ])
3833
3833
  ], 512),
3834
3834
  l("div", Pr, [
3835
- b.value ? (u(), d("button", {
3835
+ y.value ? (i(), d("button", {
3836
3836
  key: 0,
3837
3837
  type: "button",
3838
3838
  class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
3839
3839
  "aria-label": "Clear all tags",
3840
- disabled: B.value,
3840
+ disabled: S.value,
3841
3841
  onClick: we(H, ["stop"])
3842
3842
  }, _[3] || (_[3] = [
3843
3843
  l("svg", {
@@ -3856,7 +3856,7 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3856
3856
  }
3857
3857
  }), Nr = { class: "relative flex gap-1 bg-white w-full" }, qr = ["disabled", "placeholder"], Wr = /* @__PURE__ */ U({
3858
3858
  __name: "vs-input-slug",
3859
- props: /* @__PURE__ */ ie({
3859
+ props: /* @__PURE__ */ re({
3860
3860
  disabled: { type: Boolean },
3861
3861
  placeholder: {},
3862
3862
  parent: {}
@@ -3866,9 +3866,9 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3866
3866
  }),
3867
3867
  emits: ["update:modelValue"],
3868
3868
  setup(o) {
3869
- const e = ze("values"), t = o, s = ue(o, "modelValue");
3869
+ const e = ze("values"), t = o, a = ue(o, "modelValue");
3870
3870
  function n(r) {
3871
- const i = {
3871
+ const u = {
3872
3872
  а: "a",
3873
3873
  б: "b",
3874
3874
  в: "v",
@@ -3907,25 +3907,25 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3907
3907
  ї: "yi",
3908
3908
  ґ: "g"
3909
3909
  };
3910
- return r.toLowerCase().split("").map((c) => i[c] || c).join("").replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
3910
+ return r.toLowerCase().split("").map((c) => u[c] || c).join("").replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
3911
3911
  }
3912
- const a = () => {
3913
- const r = e?.value?.[t.parent || ""]?.toString(), i = n(r);
3914
- s.value = i.toString();
3912
+ const s = () => {
3913
+ const r = e?.value?.[t.parent || ""]?.toString(), u = n(r);
3914
+ a.value = u.toString();
3915
3915
  };
3916
- return (r, i) => (u(), d("div", Nr, [
3916
+ return (r, u) => (i(), d("div", Nr, [
3917
3917
  ne(l("input", {
3918
3918
  ref: "vsText",
3919
3919
  disabled: r.disabled,
3920
3920
  placeholder: r.placeholder,
3921
- "onUpdate:modelValue": i[0] || (i[0] = (c) => s.value = c),
3921
+ "onUpdate:modelValue": u[0] || (u[0] = (c) => a.value = c),
3922
3922
  class: "block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"
3923
3923
  }, null, 8, qr), [
3924
- [ve, s.value]
3924
+ [ve, a.value]
3925
3925
  ]),
3926
3926
  l("button", {
3927
3927
  class: "px-2 bg-gray-100 border rounded-lg hover:bg-gray-200",
3928
- onClick: a
3928
+ onClick: s
3929
3929
  }, " Gen ")
3930
3930
  ]));
3931
3931
  }
@@ -3945,56 +3945,56 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
3945
3945
  },
3946
3946
  emits: ["update:modelValue"],
3947
3947
  setup(o, { emit: e }) {
3948
- const t = (Z) => `${Z}-${Math.random().toString(36).substring(2, 15)}`, s = ze("values"), n = o, a = e, r = n.addButtonText ?? "Додати", i = n.ignore ?? [], c = w([]), p = w(null);
3948
+ const t = (K) => `${K}-${Math.random().toString(36).substring(2, 15)}`, a = ze("values"), n = o, s = e, r = n.addButtonText ?? "Додати", u = n.ignore ?? [], c = w([]), p = w(null);
3949
3949
  (() => {
3950
- const Z = n.parent && s?.value?.[n.parent] || n.modelValue || {};
3951
- c.value = Object.entries(Z).filter(([T]) => !i.includes(T)).map(([T, H]) => ({
3950
+ const K = n.parent && a?.value?.[n.parent] || n.modelValue || {};
3951
+ c.value = Object.entries(K).filter(([T]) => !u.includes(T)).map(([T, H]) => ({
3952
3952
  id: t("key-value-"),
3953
3953
  key: T,
3954
3954
  value: H
3955
3955
  }));
3956
3956
  })();
3957
- function m(Z) {
3958
- p.value = Z;
3957
+ function m(K) {
3958
+ p.value = K;
3959
3959
  }
3960
- function b(Z) {
3961
- if (p.value === null || p.value === Z) return;
3960
+ function y(K) {
3961
+ if (p.value === null || p.value === K) return;
3962
3962
  const T = c.value.splice(p.value, 1)[0];
3963
- c.value.splice(Z, 0, T), p.value = null;
3963
+ c.value.splice(K, 0, T), p.value = null;
3964
3964
  }
3965
- const B = S(
3966
- () => c.value.some((Z) => Z.key && !Z.value || !Z.key && Z.value)
3967
- ), Y = () => {
3965
+ const S = B(
3966
+ () => c.value.some((K) => K.key && !K.value || !K.key && K.value)
3967
+ ), q = () => {
3968
3968
  c.value.push({ id: t("key-value-"), key: "", value: "" });
3969
- }, R = (Z) => {
3970
- c.value = c.value.filter((T) => T.id !== Z);
3969
+ }, R = (K) => {
3970
+ c.value = c.value.filter((T) => T.id !== K);
3971
3971
  };
3972
- return re(
3972
+ return ie(
3973
3973
  c,
3974
- (Z) => {
3974
+ (K) => {
3975
3975
  const T = {};
3976
- Z.forEach((I) => {
3976
+ K.forEach((I) => {
3977
3977
  I.key && I.value !== void 0 && (T[I.key] = I.value);
3978
3978
  });
3979
3979
  const H = {};
3980
- i.length && i.forEach((I) => {
3981
- H[I] = n.parent ? s?.value?.[n.parent]?.[I] : void 0;
3982
- }), s?.value && n.parent && (s.value[n.parent] = {
3980
+ u.length && u.forEach((I) => {
3981
+ H[I] = n.parent ? a?.value?.[n.parent]?.[I] : void 0;
3982
+ }), a?.value && n.parent && (a.value[n.parent] = {
3983
3983
  ...H,
3984
3984
  ...T
3985
- }), a("update:modelValue", T);
3985
+ }), s("update:modelValue", T);
3986
3986
  },
3987
3987
  { deep: !0 }
3988
- ), (Z, T) => (u(), d("div", Zr, [
3988
+ ), (K, T) => (i(), d("div", Zr, [
3989
3989
  l("div", Kr, [
3990
- (u(!0), d(se, null, ce(c.value, (H, I) => (u(), d("div", {
3990
+ (i(!0), d(se, null, pe(c.value, (H, I) => (i(), d("div", {
3991
3991
  key: H.id,
3992
3992
  class: E(["flex items-center gap-2 w-full", { "opacity-50": p.value === I }]),
3993
3993
  draggable: "true",
3994
3994
  onDragstart: (v) => m(I),
3995
3995
  onDragover: T[0] || (T[0] = we(() => {
3996
3996
  }, ["prevent"])),
3997
- onDrop: (v) => b(I)
3997
+ onDrop: (v) => y(I)
3998
3998
  }, [
3999
3999
  T[1] || (T[1] = ye('<button class="cursor-move" data-v-a0f7fbfc><svg fill="#000000" width="20" height="20" viewBox="0 0 36 36" data-v-a0f7fbfc><circle cx="15" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="12" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="24" r="1.5" data-v-a0f7fbfc></circle><circle cx="21" cy="18" r="1.5" data-v-a0f7fbfc></circle><circle cx="15" cy="18" r="1.5" data-v-a0f7fbfc></circle></svg></button>', 1)),
4000
4000
  l("div", Yr, [
@@ -4022,19 +4022,19 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
4022
4022
  ], 8, Qr)
4023
4023
  ], 42, Jr))), 128))
4024
4024
  ], 512),
4025
- c.value.length ? D("", !0) : (u(), d("span", ei, " Дані для відображення відсутні ")),
4025
+ c.value.length ? D("", !0) : (i(), d("span", ei, " Дані для відображення відсутні ")),
4026
4026
  l("div", ti, [
4027
4027
  l("button", {
4028
4028
  type: "button",
4029
- onClick: Y,
4030
- disabled: B.value,
4029
+ onClick: q,
4030
+ disabled: S.value,
4031
4031
  class: "py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"
4032
4032
  }, [
4033
4033
  A(Re, {
4034
4034
  height: "14",
4035
4035
  width: "14"
4036
4036
  }),
4037
- ge(" " + W(ee(r)), 1)
4037
+ ge(" " + G(ee(r)), 1)
4038
4038
  ], 8, li)
4039
4039
  ])
4040
4040
  ]));
@@ -4052,26 +4052,26 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
4052
4052
  },
4053
4053
  emits: ["update:modelValue"],
4054
4054
  setup(o, { emit: e }) {
4055
- const t = o, { inputClass: s } = _e(t.style), n = e, a = S({
4055
+ const t = o, { inputClass: a } = _e(t.style), n = e, s = B({
4056
4056
  get: () => t.modelValue || "#000000",
4057
4057
  set: (r) => n("update:modelValue", r)
4058
4058
  });
4059
- return (r, i) => (u(), d("div", ai, [
4059
+ return (r, u) => (i(), d("div", ai, [
4060
4060
  ne(l("input", {
4061
4061
  type: "color",
4062
- "onUpdate:modelValue": i[0] || (i[0] = (c) => a.value = c),
4062
+ "onUpdate:modelValue": u[0] || (u[0] = (c) => s.value = c),
4063
4063
  disabled: r.disabled,
4064
4064
  ref: "color",
4065
- class: E(["py-1.5 px-1 block w-full bg-white cursor-pointer max-w-[50px]", [r.modelValue ? "" : "text-opacity-50", ee(s)].join(" ")]),
4065
+ class: E(["py-1.5 px-1 block w-full bg-white cursor-pointer max-w-[50px]", [r.modelValue ? "" : "text-opacity-50", ee(a)].join(" ")]),
4066
4066
  style: { border: "1px solid #CFD9E0" }
4067
4067
  }, null, 10, si), [
4068
- [ve, a.value]
4068
+ [ve, s.value]
4069
4069
  ]),
4070
4070
  ne(l("input", {
4071
4071
  class: "text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2",
4072
- "onUpdate:modelValue": i[1] || (i[1] = (c) => a.value = c)
4072
+ "onUpdate:modelValue": u[1] || (u[1] = (c) => s.value = c)
4073
4073
  }, null, 512), [
4074
- [ve, a.value]
4074
+ [ve, s.value]
4075
4075
  ])
4076
4076
  ]));
4077
4077
  }
@@ -4091,35 +4091,35 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
4091
4091
  },
4092
4092
  emits: ["update:modelValue"],
4093
4093
  setup(o, { emit: e }) {
4094
- const t = o, { inputClass: s } = _e(t.style), n = e, a = S({
4094
+ const t = o, { inputClass: a } = _e(t.style), n = e, s = B({
4095
4095
  get: () => Number(t.modelValue ?? t.min),
4096
4096
  set: (r) => n("update:modelValue", Number(r))
4097
4097
  });
4098
- return (r, i) => (u(), d("div", ii, [
4098
+ return (r, u) => (i(), d("div", ii, [
4099
4099
  ne(l("input", {
4100
4100
  type: "range",
4101
- "onUpdate:modelValue": i[0] || (i[0] = (c) => a.value = c),
4101
+ "onUpdate:modelValue": u[0] || (u[0] = (c) => s.value = c),
4102
4102
  min: r.min,
4103
4103
  max: r.max,
4104
4104
  step: r.step,
4105
4105
  disabled: r.disabled,
4106
4106
  ref: "range",
4107
- class: E(["w-full cursor-pointer accent-blue-500", [r.modelValue ? "" : "text-opacity-50", ee(s)].join(" ")])
4107
+ class: E(["w-full cursor-pointer accent-blue-500", [r.modelValue ? "" : "text-opacity-50", ee(a)].join(" ")])
4108
4108
  }, null, 10, ui), [
4109
- [ve, a.value]
4109
+ [ve, s.value]
4110
4110
  ]),
4111
4111
  ne(l("input", {
4112
4112
  class: "text-sm text-gray-600 border border-solid border-stone-200 rounded-md p-2 max-w-[100px]",
4113
4113
  type: "number",
4114
- "onUpdate:modelValue": i[1] || (i[1] = (c) => a.value = c)
4114
+ "onUpdate:modelValue": u[1] || (u[1] = (c) => s.value = c)
4115
4115
  }, null, 512), [
4116
- [ve, a.value]
4116
+ [ve, s.value]
4117
4117
  ])
4118
4118
  ]));
4119
4119
  }
4120
4120
  }), ci = ["type", "value", "onInput", "placeholder", "disabled"], pi = /* @__PURE__ */ U({
4121
4121
  __name: "vs-input-array",
4122
- props: /* @__PURE__ */ ie({
4122
+ props: /* @__PURE__ */ re({
4123
4123
  count: { default: 1 },
4124
4124
  limit: { default: (o) => o.count ?? 1 },
4125
4125
  inputType: { default: "text" },
@@ -4136,28 +4136,28 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
4136
4136
  }),
4137
4137
  emits: ["update:modelValue"],
4138
4138
  setup(o) {
4139
- const e = o, { inputClass: t } = _e(e.style), s = ue(o, "modelValue");
4139
+ const e = o, { inputClass: t } = _e(e.style), a = ue(o, "modelValue");
4140
4140
  Gt(() => {
4141
- const a = s.value?.length ?? 0;
4142
- a < e.count && (s.value = [
4143
- ...s.value ?? [],
4144
- ...Array(e.count - a)
4141
+ const s = a.value?.length ?? 0;
4142
+ s < e.count && (a.value = [
4143
+ ...a.value ?? [],
4144
+ ...Array(e.count - s)
4145
4145
  ]);
4146
4146
  });
4147
- function n(a, r) {
4148
- const i = a.target.value, c = [...s.value];
4149
- c[r] = e.inputType === "text" ? i : Number(i), s.value = c;
4147
+ function n(s, r) {
4148
+ const u = s.target.value, c = [...a.value];
4149
+ c[r] = e.inputType === "text" ? u : Number(u), a.value = c;
4150
4150
  }
4151
- return (a, r) => (u(), d("div", {
4152
- class: E(["grid gap-2", `grid-cols-${a.limit}`])
4151
+ return (s, r) => (i(), d("div", {
4152
+ class: E(["grid gap-2", `grid-cols-${s.limit}`])
4153
4153
  }, [
4154
- (u(!0), d(se, null, ce(a.count, (i) => (u(), d("input", {
4155
- type: a.inputType,
4156
- value: s.value?.[i - 1] ?? "",
4157
- onInput: (c) => n(c, i - 1),
4158
- placeholder: a.placeholder,
4159
- disabled: a.disabled,
4160
- class: E(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [ee(t), { "!border-red-600": a.error }]]),
4154
+ (i(!0), d(se, null, pe(s.count, (u) => (i(), d("input", {
4155
+ type: s.inputType,
4156
+ value: a.value?.[u - 1] ?? "",
4157
+ onInput: (c) => n(c, u - 1),
4158
+ placeholder: s.placeholder,
4159
+ disabled: s.disabled,
4160
+ class: E(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [ee(t), { "!border-red-600": s.error }]]),
4161
4161
  style: {
4162
4162
  border: "1px solid #CFD9E0"
4163
4163
  }
@@ -4203,33 +4203,33 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
4203
4203
  },
4204
4204
  setup(o) {
4205
4205
  const e = o, t = ze("values");
4206
- async function s() {
4206
+ async function a() {
4207
4207
  try {
4208
4208
  if (!e.api) return;
4209
- const n = e.api.replace("{{value}}", e.value), a = await fetch(n);
4210
- if (!a.ok) {
4209
+ const n = e.api.replace("{{value}}", e.value), s = await fetch(n);
4210
+ if (!s.ok) {
4211
4211
  de({ type: "warning", title: "Validation", message: "При спробі завантажити дані виникла помилка." });
4212
4212
  return;
4213
4213
  }
4214
- const r = await a.json();
4214
+ const r = await s.json();
4215
4215
  if (!e.set || !t) return;
4216
- for (const [i, c] of Object.entries(e.set))
4217
- t.value[i] = r.result[c];
4216
+ for (const [u, c] of Object.entries(e.set))
4217
+ t.value[u] = r.result[c];
4218
4218
  } catch (n) {
4219
4219
  console.error(e.error, n);
4220
4220
  }
4221
4221
  }
4222
- return (n, a) => (u(), d("button", {
4223
- onClick: s,
4222
+ return (n, s) => (i(), d("button", {
4223
+ onClick: a,
4224
4224
  class: "vs-button relative inline-flex border-solid justify-center items-center gap-2 rounded-md font-semibold focus:outline-none text-sm transition-all border !border-gray-200 hover:text-white bg-white text-blue-500 hover:border-blue-500 hover:bg-blue-500 focus:ring-blue-500 py-1.5 px-5 focus:ring-1 focus:ring-offset-1 ml-0 md:ml-2 mt-2 md:mt-0 py-[8px] md:w-2/4 whitespace-nowrap w-full"
4225
- }, W(n.button), 1));
4225
+ }, G(n.button), 1));
4226
4226
  }
4227
4227
  }), vi = { class: "flex flex-col gap-1 w-full" }, hi = {
4228
4228
  key: 0,
4229
4229
  class: "text-sm text-gray-500"
4230
4230
  }, zt = /* @__PURE__ */ U({
4231
4231
  __name: "vs-compact-form-layout",
4232
- props: /* @__PURE__ */ ie({
4232
+ props: /* @__PURE__ */ re({
4233
4233
  item: { default: {} },
4234
4234
  layout: { default: "default" },
4235
4235
  style: { default: {} },
@@ -4242,21 +4242,21 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
4242
4242
  }),
4243
4243
  emits: ["update:modelValue"],
4244
4244
  setup(o) {
4245
- const e = o, t = ue(o, "modelValue"), s = S(() => gl[`${e.layout}`]), n = S(() => fi?.[`vs-input-${e.item.type}`]), a = S(() => {
4246
- const i = ee(n);
4247
- if (!i) return /* @__PURE__ */ new Set();
4248
- const c = i.props ?? i.__vccOpts?.props;
4245
+ const e = o, t = ue(o, "modelValue"), a = B(() => gl[`${e.layout}`]), n = B(() => fi?.[`vs-input-${e.item.type}`]), s = B(() => {
4246
+ const u = ee(n);
4247
+ if (!u) return /* @__PURE__ */ new Set();
4248
+ const c = u.props ?? u.__vccOpts?.props;
4249
4249
  if (!c) return /* @__PURE__ */ new Set();
4250
4250
  const p = Array.isArray(c) ? c : Object.keys(c);
4251
4251
  return new Set(p);
4252
- }), r = S(() => {
4253
- const i = e.item ?? {}, c = a.value;
4254
- return c.size ? Object.fromEntries(Object.entries(i).filter(([p]) => c.has(p))) : {};
4252
+ }), r = B(() => {
4253
+ const u = e.item ?? {}, c = s.value;
4254
+ return c.size ? Object.fromEntries(Object.entries(u).filter(([p]) => c.has(p))) : {};
4255
4255
  });
4256
- return (i, c) => ne((u(), me(Fe(s.value), {
4256
+ return (u, c) => ne((i(), me(Fe(a.value), {
4257
4257
  ua: e.item.ua,
4258
4258
  error: e.error || "",
4259
- item: i.item,
4259
+ item: u.item,
4260
4260
  columns: e.columns,
4261
4261
  label: e.item.label
4262
4262
  }, {
@@ -4265,18 +4265,18 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
4265
4265
  class: E(["flex w-full", `${e.item.type}-component`])
4266
4266
  }, [
4267
4267
  l("div", vi, [
4268
- (u(), me(Fe(n.value), Te(r.value, {
4268
+ (i(), me(Fe(n.value), Te(r.value, {
4269
4269
  modelValue: t.value,
4270
4270
  "onUpdate:modelValue": c[0] || (c[0] = (p) => t.value = p)
4271
4271
  }), null, 16, ["modelValue"])),
4272
- i.item.description && e.layout !== "settings" ? (u(), d("p", hi, W(i.item.description), 1)) : D("", !0)
4272
+ u.item.description && e.layout !== "settings" ? (i(), d("p", hi, G(u.item.description), 1)) : D("", !0)
4273
4273
  ]),
4274
- i.item.behavior?.api && i.item.behavior?.button ? (u(), me(mi, Te({ key: 0 }, i.item.behavior, { value: t.value }), null, 16, ["value"])) : D("", !0)
4274
+ u.item.behavior?.api && u.item.behavior?.button ? (i(), me(mi, Te({ key: 0 }, u.item.behavior, { value: t.value }), null, 16, ["value"])) : D("", !0)
4275
4275
  ], 2)
4276
4276
  ]),
4277
4277
  _: 1
4278
4278
  }, 8, ["ua", "error", "item", "columns", "label"])), [
4279
- [Xe, !i.item.hidden]
4279
+ [Xe, !u.item.hidden]
4280
4280
  ]);
4281
4281
  }
4282
4282
  }), gi = { class: "text-sm text-gray-800 mb-[4px] font-medium dark:text-neutral-300" }, bi = { class: "vs-compact-form-navigation__rail mt-[6px]" }, yi = ["onClick"], xi = /* @__PURE__ */ U({
@@ -4284,38 +4284,38 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
4284
4284
  props: {
4285
4285
  target: {},
4286
4286
  scrollContainer: {},
4287
- title: { default: "Навігація по формі" },
4287
+ title: { default: "Навігація" },
4288
4288
  enabled: { type: Boolean, default: !0 },
4289
4289
  width: { default: 400 }
4290
4290
  },
4291
4291
  setup(o, { expose: e }) {
4292
- const t = o, s = w([]), n = w(""), a = w(""), r = S(() => !!t.enabled), i = S(() => [
4292
+ const t = o, a = w([]), n = w(""), s = w(""), r = B(() => !!t.enabled), u = B(() => [
4293
4293
  "vs-compact-form-navigation flex flex-col pl-[6px] pt-[8px] pr-[8px]",
4294
4294
  "sticky top-0 self-start shrink-0",
4295
4295
  "max-h-full min-h-0 overflow-y-auto"
4296
- ]), c = S(() => {
4296
+ ]), c = B(() => {
4297
4297
  const M = t.width;
4298
4298
  if (M == null) return {};
4299
- const G = typeof M == "number" ? `${M}px` : `${M}`;
4300
- return { width: G, minWidth: G };
4299
+ const Z = typeof M == "number" ? `${M}px` : `${M}`;
4300
+ return { width: Z, minWidth: Z };
4301
4301
  });
4302
- let p = null, f = 0, m = 0, b = null, B = null, Y = null;
4303
- const R = () => te(), Z = () => H();
4304
- re(
4302
+ let p = null, f = 0, m = 0, y = null, S = null, q = null;
4303
+ const R = () => te(), K = () => H();
4304
+ ie(
4305
4305
  () => t.target,
4306
4306
  async (M) => {
4307
4307
  if (V(), !M) {
4308
- b = null, s.value = [], n.value = "";
4308
+ y = null, a.value = [], n.value = "";
4309
4309
  return;
4310
4310
  }
4311
- b = M, r.value && (await Ie(), x(M), H());
4311
+ y = M, r.value && (await Ie(), x(M), H());
4312
4312
  },
4313
4313
  { immediate: !0 }
4314
- ), re(
4314
+ ), ie(
4315
4315
  () => t.scrollContainer,
4316
4316
  (M) => {
4317
4317
  if (!r.value) {
4318
- B = M ?? null;
4318
+ S = M ?? null;
4319
4319
  return;
4320
4320
  }
4321
4321
  T(M ?? null), Ie(() => H());
@@ -4324,21 +4324,21 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
4324
4324
  ), ke(() => {
4325
4325
  t.scrollContainer || T(null), H();
4326
4326
  }), at(() => {
4327
- V(), T(null, !0), b = null, typeof window < "u" && (f && window.cancelAnimationFrame(f), m && window.cancelAnimationFrame(m));
4327
+ V(), T(null, !0), y = null, typeof window < "u" && (f && window.cancelAnimationFrame(f), m && window.cancelAnimationFrame(m));
4328
4328
  });
4329
- function T(M, G = !1) {
4330
- if (Y && (Y(), Y = null), G) {
4331
- B = null;
4329
+ function T(M, Z = !1) {
4330
+ if (q && (q(), q = null), Z) {
4331
+ S = null;
4332
4332
  return;
4333
4333
  }
4334
- if (B = M ?? null, typeof window > "u") return;
4334
+ if (S = M ?? null, typeof window > "u") return;
4335
4335
  const N = M ?? window, le = window;
4336
- N.addEventListener("scroll", R, { passive: !0 }), le.addEventListener("resize", Z), Y = () => {
4337
- N.removeEventListener("scroll", R), le.removeEventListener("resize", Z);
4336
+ N.addEventListener("scroll", R, { passive: !0 }), le.addEventListener("resize", K), q = () => {
4337
+ N.removeEventListener("scroll", R), le.removeEventListener("resize", K);
4338
4338
  };
4339
4339
  }
4340
4340
  function H() {
4341
- if (!r.value || !b) return;
4341
+ if (!r.value || !y) return;
4342
4342
  f && typeof window < "u" && window.cancelAnimationFrame(f);
4343
4343
  const M = () => {
4344
4344
  I(), f = 0;
@@ -4346,22 +4346,22 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
4346
4346
  typeof window > "u" ? M() : f = window.requestAnimationFrame(M);
4347
4347
  }
4348
4348
  function I() {
4349
- if (!r.value || !b) return;
4350
- const M = Array.from(b.querySelectorAll("h1, h2")), G = /* @__PURE__ */ new Set(), N = [];
4349
+ if (!r.value || !y) return;
4350
+ const M = Array.from(y.querySelectorAll("h1, h2")), Z = /* @__PURE__ */ new Set(), N = [];
4351
4351
  M.forEach((le, z) => {
4352
4352
  const j = le.textContent?.trim() ?? "";
4353
4353
  if (!j) return;
4354
- let C = (le.getAttribute("id") ?? "").trim();
4355
- C || (C = v(j) || `heading-${z + 1}`);
4356
- let q = C, oe = 1;
4357
- for (; G.has(q); )
4358
- q = `${C}-${oe++}`;
4359
- le.id !== q && (le.id = q), G.add(q), N.push({
4360
- id: q,
4354
+ let $ = (le.getAttribute("id") ?? "").trim();
4355
+ $ || ($ = v(j) || `heading-${z + 1}`);
4356
+ let W = $, oe = 1;
4357
+ for (; Z.has(W); )
4358
+ W = `${$}-${oe += 1}`;
4359
+ le.id !== W && Object.assign(le, { id: W }), Z.add(W), N.push({
4360
+ id: W,
4361
4361
  text: j,
4362
4362
  level: le.tagName.toLowerCase() === "h1" ? 1 : 2
4363
4363
  });
4364
- }), s.value = N, N.length || (n.value = ""), F();
4364
+ }), a.value = N, N.length || (n.value = ""), F();
4365
4365
  }
4366
4366
  function v(M) {
4367
4367
  return M.toLowerCase().replace(/[^a-z0-9\s-]/g, "").trim().replace(/\s+/g, "-");
@@ -4373,46 +4373,47 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
4373
4373
  p && (p.disconnect(), p = null);
4374
4374
  }
4375
4375
  function _(M) {
4376
- const G = B;
4377
- if (!G)
4376
+ const Z = S;
4377
+ if (!Z)
4378
4378
  return typeof window > "u" ? M.offsetTop : M.getBoundingClientRect().top + window.scrollY;
4379
- const N = M.getBoundingClientRect(), le = G.getBoundingClientRect();
4380
- return N.top - le.top + G.scrollTop;
4379
+ const N = M.getBoundingClientRect(), le = Z.getBoundingClientRect();
4380
+ return N.top - le.top + Z.scrollTop;
4381
4381
  }
4382
4382
  function F() {
4383
- if (!r.value || !s.value.length) return;
4384
- const M = B, G = M ? M.scrollTop : typeof window < "u" ? window.scrollY : 0, N = M ? M.clientHeight : typeof window < "u" ? window.innerHeight : 0, le = G + N;
4383
+ if (!r.value || !a.value.length) return;
4384
+ const M = S, Z = (M ? M.scrollTop : null) || (typeof window < "u" ? window.scrollY : 0), N = (M ? M.clientHeight : null) || (typeof window < "u" ? window.innerHeight : 0), le = Z + N;
4385
4385
  let z = null;
4386
- for (const C of s.value) {
4387
- const q = document.getElementById(C.id);
4388
- if (!q) continue;
4389
- const oe = _(q);
4390
- oe + q.offsetHeight > G && oe < le && (z = C.id);
4386
+ for (let $ = 0; $ < a.value.length; $ += 1) {
4387
+ const W = a.value[$], oe = document.getElementById(W.id);
4388
+ if (oe) {
4389
+ const ce = _(oe);
4390
+ ce + oe.offsetHeight > Z && ce < le && (z = W.id);
4391
+ }
4391
4392
  }
4392
- !z && a.value && (z = a.value), z && (a.value = z);
4393
+ !z && s.value && (z = s.value), z && (s.value = z);
4393
4394
  const j = M ? M.scrollHeight - M.clientHeight : document.documentElement.scrollHeight - window.innerHeight;
4394
- G + 5 >= j && (z = s.value[s.value.length - 1].id), z && (n.value = z);
4395
+ Z + 5 >= j && (z = a.value[a.value.length - 1].id), z && (n.value = z);
4395
4396
  }
4396
4397
  function te() {
4397
4398
  r.value && (m && window.cancelAnimationFrame(m), m = window.requestAnimationFrame(() => {
4398
4399
  F(), m = 0;
4399
4400
  }));
4400
4401
  }
4401
- function K(M) {
4402
+ function J(M) {
4402
4403
  if (!r.value) return;
4403
- const G = document.getElementById(M);
4404
- if (!G) return;
4405
- const N = B, le = Math.max(0, _(G));
4404
+ const Z = document.getElementById(M);
4405
+ if (!Z) return;
4406
+ const N = S, le = Math.max(0, _(Z));
4406
4407
  N ? N.scrollTo({ top: le, behavior: "smooth" }) : typeof window < "u" && window.scrollTo({ top: le, behavior: "smooth" });
4407
4408
  }
4408
- return e({ refresh: H }), (M, G) => r.value && s.value.length ? (u(), d("div", {
4409
+ return e({ refresh: H }), (M, Z) => r.value && a.value.length ? (i(), d("div", {
4409
4410
  key: 0,
4410
- class: E(i.value),
4411
+ class: E(u.value),
4411
4412
  style: be(c.value)
4412
4413
  }, [
4413
- l("h2", gi, W(M.title), 1),
4414
+ l("h2", gi, G(M.title), 1),
4414
4415
  l("div", bi, [
4415
- (u(!0), d(se, null, ce(s.value, (N) => (u(), d("div", {
4416
+ (i(!0), d(se, null, pe(a.value, (N) => (i(), d("div", {
4416
4417
  key: N.id,
4417
4418
  class: E([
4418
4419
  "vs-compact-form-navigation__item relative",
@@ -4422,20 +4423,20 @@ const Js = /* @__PURE__ */ X(Gs, [["render", Ks]]), Ys = { class: "map-search-wi
4422
4423
  }, [
4423
4424
  l("button", {
4424
4425
  type: "button",
4425
- onClick: (le) => K(N.id),
4426
+ onClick: (le) => J(N.id),
4426
4427
  class: E([
4427
4428
  "vs-compact-form-navigation__button flex gap-x-3 py-[6px] pr-3 text-sm duration-200 hover:text-gray-800",
4428
- N.level === 2 ? "pl-[12px]" : "pl-[16px]",
4429
+ N.level === 2 ? "pl-[15px]" : "pl-[18px]",
4429
4430
  N.id === n.value ? "text-gray-800" : "text-gray-500"
4430
4431
  ])
4431
4432
  }, [
4432
- l("span", null, W(N.text), 1)
4433
+ l("span", null, G(N.text), 1)
4433
4434
  ], 10, yi)
4434
4435
  ], 2))), 128))
4435
4436
  ])
4436
4437
  ], 6)) : D("", !0);
4437
4438
  }
4438
- }), wi = /* @__PURE__ */ X(xi, [["__scopeId", "data-v-faeb2c41"]]), At = {
4439
+ }), wi = /* @__PURE__ */ X(xi, [["__scopeId", "data-v-1584a562"]]), At = {
4439
4440
  required: "Це поле є обов’язковим",
4440
4441
  email: "Неправильний email"
4441
4442
  }, ki = (o) => o ? !1 : At.required, _i = (o) => {
@@ -4476,57 +4477,57 @@ function _t(o) {
4476
4477
  }
4477
4478
  function Li(o, e = !1) {
4478
4479
  if (Array.isArray(o)) {
4479
- const s = [];
4480
+ const a = [];
4480
4481
  return o.forEach((n) => {
4481
- const a = { ...n };
4482
- a.name = (n.name || n.id || n.key || "").toString(), a.type = _t(n.type), a.label = n.label || n.ua, a.rules = n.rules || n.validators, a.type === "email" && !a.rules && (a.rules = ["email"]), n.data && (a.api = `/api/suggest/${n.data}`), a.disabled = e || a.disabled, s.push(a);
4483
- }), s;
4482
+ const s = { ...n };
4483
+ s.name = (n.name || n.id || n.key || "").toString(), s.type = _t(n.type), s.label = n.label || n.ua, s.rules = n.rules || n.validators, s.type === "email" && !s.rules && (s.rules = ["email"]), n.data && (s.api = `/api/suggest/${n.data}`), s.disabled = e || s.disabled, a.push(s);
4484
+ }), a;
4484
4485
  }
4485
4486
  const t = [];
4486
- return Object.entries(o).forEach((s) => {
4487
+ return Object.entries(o).forEach((a) => {
4487
4488
  const n = {
4488
- name: s[0],
4489
- ...s[1],
4490
- type: _t(s[1].type),
4491
- label: s[1].label || s[1].ua,
4492
- rules: s[1].rules || s[1].validators,
4489
+ name: a[0],
4490
+ ...a[1],
4491
+ type: _t(a[1].type),
4492
+ label: a[1].label || a[1].ua,
4493
+ rules: a[1].rules || a[1].validators,
4493
4494
  disabled: e
4494
4495
  };
4495
- n.type === "email" && !n.rules && (n.rules = ["email"]), s[1].type.includes("list") && (n.multiple = !0), !n.api && s[1].data && (n.api = `/api/suggest/${s[1].data}`), t.push(n);
4496
+ n.type === "email" && !n.rules && (n.rules = ["email"]), a[1].type.includes("list") && (n.multiple = !0), !n.api && a[1].data && (n.api = `/api/suggest/${a[1].data}`), t.push(n);
4496
4497
  }), t;
4497
4498
  }
4498
4499
  function Si(o, e, t = !1) {
4499
- const s = S(() => Li(
4500
+ const a = B(() => Li(
4500
4501
  (Array.isArray(e), e),
4501
4502
  typeof t == "boolean" ? t : t.value
4502
4503
  )), n = w({});
4503
- function a(p) {
4504
+ function s(p) {
4504
4505
  const f = p?.conditions;
4505
4506
  if (!f) return !0;
4506
- const m = Array.isArray(f) ? f[0] : f, b = o?.value?.[m];
4507
- return It(b, f);
4507
+ const m = Array.isArray(f) ? f[0] : f, y = o?.value?.[m];
4508
+ return It(y, f);
4508
4509
  }
4509
- const r = (p = s.value, f = !0) => (p.forEach((m) => {
4510
+ const r = (p = a.value, f = !0) => (p.forEach((m) => {
4510
4511
  if (m.rules) {
4511
- if (!a(m)) {
4512
+ if (!s(m)) {
4512
4513
  delete n.value[m.name];
4513
4514
  return;
4514
4515
  }
4515
- let b = !1, B = null;
4516
- m.rules.forEach((Y) => {
4517
- const R = Vi(o.value[m.name], Y);
4518
- R && (b = !0, !B && typeof R == "string" && (B = R));
4519
- }), b && B ? n.value[m.name] = B : delete n.value[m.name];
4516
+ let y = !1, S = null;
4517
+ m.rules.forEach((q) => {
4518
+ const R = Vi(o.value[m.name], q);
4519
+ R && (y = !0, !S && typeof R == "string" && (S = R));
4520
+ }), y && S ? n.value[m.name] = S : delete n.value[m.name];
4520
4521
  }
4521
4522
  m.schema && r(m.schema, !1);
4522
- }), f && Object.values(n.value).some(Boolean) ? n.value : null), i = S(() => s.value?.filter((p) => a(p)));
4523
+ }), f && Object.values(n.value).some(Boolean) ? n.value : null), u = B(() => a.value?.filter((p) => s(p)));
4523
4524
  return {
4524
4525
  errors: n,
4525
4526
  validate: r,
4526
4527
  reset: () => {
4527
4528
  o.value = {}, n.value = {};
4528
4529
  },
4529
- visibleSchema: i
4530
+ visibleSchema: u
4530
4531
  };
4531
4532
  }
4532
4533
  const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
@@ -4536,7 +4537,7 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
4536
4537
  class: "mt-1 shrink-0 h-[1px] w-full bg-slate-100 dark:bg-slate-600"
4537
4538
  }, He = /* @__PURE__ */ U({
4538
4539
  __name: "vs-compact-form",
4539
- props: /* @__PURE__ */ ie({
4540
+ props: /* @__PURE__ */ re({
4540
4541
  schema: { default: () => [] },
4541
4542
  style: { default: () => ({}) },
4542
4543
  modelValue: {},
@@ -4552,24 +4553,24 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
4552
4553
  values: { default: () => ({}) },
4553
4554
  valuesModifiers: {}
4554
4555
  }),
4555
- emits: /* @__PURE__ */ ie(["handle-submit", "update:modelValue"], ["update:form", "update:values"]),
4556
+ emits: /* @__PURE__ */ re(["handle-submit", "update:modelValue"], ["update:form", "update:values"]),
4556
4557
  setup(o, { expose: e, emit: t }) {
4557
- const s = t, n = o, a = ue(o, "form"), r = ue(o, "values"), {
4558
- errors: i,
4558
+ const a = t, n = o, s = ue(o, "form"), r = ue(o, "values"), {
4559
+ errors: u,
4559
4560
  validate: c,
4560
4561
  reset: p,
4561
4562
  visibleSchema: f
4562
- } = Si(r, n.schema, Zt(n, "disabled")), m = w(null), b = w(null), B = S(() => n.navigation), Y = S(() => n.navWidth), R = S(() => n.style?.columns), Z = Object.freeze({ container: 12, label: 3 }), T = S(() => n.columns ?? R.value ?? Z), H = S(() => n.columns != null || R.value != null), I = S(() => H.value ? "horizontal" : n.layout), v = (F) => F?.columns ? "horizontal" : I.value, x = (F) => F?.columns ?? T.value, V = () => {
4563
- s("update:modelValue", r.value), c(), s("handle-submit", r.value);
4563
+ } = Si(r, n.schema, Zt(n, "disabled")), m = w(null), y = w(null), S = B(() => n.navigation), q = B(() => n.navWidth), R = B(() => n.style?.columns), K = Object.freeze({ container: 12, label: 3 }), T = B(() => n.columns ?? R.value ?? K), H = B(() => n.columns != null || R.value != null), I = B(() => H.value ? "horizontal" : n.layout), v = (F) => F?.columns ? "horizontal" : I.value, x = (F) => F?.columns ?? T.value, V = () => {
4564
+ a("update:modelValue", r.value), c(), a("handle-submit", r.value);
4564
4565
  };
4565
4566
  e({
4566
4567
  validate: c,
4567
4568
  reset: p,
4568
- errors: i
4569
+ errors: u
4569
4570
  }), ke(() => {
4570
- n.modelValue && (r.value = n.modelValue), a.value = {
4571
+ n.modelValue && (r.value = n.modelValue), s.value = {
4571
4572
  value: r.value,
4572
- errors: i.value,
4573
+ errors: u.value,
4573
4574
  reset: p,
4574
4575
  validate: c,
4575
4576
  formId: n.formId
@@ -4578,14 +4579,14 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
4578
4579
  function _(F, te) {
4579
4580
  if (F === te) return !0;
4580
4581
  if (typeof F != "object" || typeof te != "object" || !F || !te) return !1;
4581
- const K = Object.keys(F), M = Object.keys(te);
4582
- return K.length !== M.length ? !1 : K.every((G) => F[G] === te[G]);
4582
+ const J = Object.keys(F), M = Object.keys(te);
4583
+ return J.length !== M.length ? !1 : J.every((Z) => F[Z] === te[Z]);
4583
4584
  }
4584
- return vt("form", a), vt("values", r), (F, te) => (u(), d("div", Bi, [
4585
+ return vt("form", s), vt("values", r), (F, te) => (i(), d("div", Bi, [
4585
4586
  l("div", {
4586
4587
  class: "flex-1 min-h-0 overflow-y-auto",
4587
4588
  ref_key: "formScrollContainer",
4588
- ref: b
4589
+ ref: y
4589
4590
  }, [
4590
4591
  l("form", {
4591
4592
  ref_key: "formRef",
@@ -4593,31 +4594,31 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
4593
4594
  onSubmit: we(V, ["prevent"]),
4594
4595
  class: E(["grid grid-cols-12 p-1", I.value === "default" ? "gap-6" : "gap-4"])
4595
4596
  }, [
4596
- (u(!0), d(se, null, ce(ee(f), (K, M) => (u(), d("div", {
4597
- key: K.name,
4598
- class: E(v(K) === "horizontal" ? "col-span-12" : `col-span-${K.col || 12}`)
4597
+ (i(!0), d(se, null, pe(ee(f), (J, M) => (i(), d("div", {
4598
+ key: J.name,
4599
+ class: E(v(J) === "horizontal" ? "col-span-12" : `col-span-${J.col || 12}`)
4599
4600
  }, [
4600
4601
  A(zt, {
4601
4602
  style: be(F.style),
4602
- item: K,
4603
- layout: v(K),
4604
- columns: x(K),
4605
- "model-value": r.value[K.name],
4606
- "onUpdate:modelValue": (G) => {
4607
- const N = r.value[K.name];
4608
- _(N, G) || (r.value[K.name] = G);
4603
+ item: J,
4604
+ layout: v(J),
4605
+ columns: x(J),
4606
+ "model-value": r.value[J.name],
4607
+ "onUpdate:modelValue": (Z) => {
4608
+ const N = r.value[J.name];
4609
+ _(N, Z) || (r.value[J.name] = Z);
4609
4610
  },
4610
- error: ee(i)[K.name]
4611
+ error: ee(u)[J.name]
4611
4612
  }, null, 8, ["style", "item", "layout", "columns", "model-value", "onUpdate:modelValue", "error"]),
4612
- v(K) === "settings" && M + 1 !== ee(f).length ? (u(), d("div", ji)) : D("", !0)
4613
+ v(J) === "settings" && M + 1 !== ee(f).length ? (i(), d("div", ji)) : D("", !0)
4613
4614
  ], 2))), 128))
4614
4615
  ], 34)
4615
4616
  ], 512),
4616
4617
  A(wi, {
4617
4618
  target: m.value,
4618
- "scroll-container": b.value,
4619
- enabled: B.value,
4620
- width: Y.value
4619
+ "scroll-container": y.value,
4620
+ enabled: S.value,
4621
+ width: q.value
4621
4622
  }, null, 8, ["target", "scroll-container", "enabled", "width"])
4622
4623
  ]));
4623
4624
  }
@@ -4632,55 +4633,55 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
4632
4633
  },
4633
4634
  emits: ["close", "save", "edit"],
4634
4635
  setup(o, { emit: e }) {
4635
- const t = o, s = e, n = w(t.schema), a = w(t.defaultValue ? JSON.parse(JSON.stringify(t.defaultValue)) : {}), r = w({}), i = w(), c = w(t.mode);
4636
+ const t = o, a = e, n = w(t.schema), s = w(t.defaultValue ? JSON.parse(JSON.stringify(t.defaultValue)) : {}), r = w({}), u = w(), c = w(t.mode);
4636
4637
  async function p() {
4637
4638
  const m = r.value.validate();
4638
4639
  if (m) {
4639
- de({ type: "warning", title: "Помилка валідації", message: Object.entries(m).map(([b, B]) => `${b}: ${B}`).join(`
4640
+ de({ type: "warning", title: "Помилка валідації", message: Object.entries(m).map(([y, S]) => `${y}: ${S}`).join(`
4640
4641
  `) });
4641
4642
  return;
4642
4643
  }
4643
- if (i.value)
4644
+ if (u.value)
4644
4645
  try {
4645
- const b = await fetch(`/api/table/${i.value}`, {
4646
+ const y = await fetch(`/api/table/${u.value}`, {
4646
4647
  method: c.value === "add" ? "POST" : "PUT",
4647
4648
  headers: {
4648
4649
  "Content-Type": "application/json"
4649
4650
  },
4650
- body: JSON.stringify(a.value)
4651
+ body: JSON.stringify(s.value)
4651
4652
  });
4652
- if (b.ok)
4653
- await b.json(), de({
4653
+ if (y.ok)
4654
+ await y.json(), de({
4654
4655
  type: "success",
4655
4656
  title: "Успішно",
4656
4657
  message: `Дані успішно ${c.value === "add" ? "збережено" : "оновлено"}`
4657
- }), s("save", a.value);
4658
- else if (b.status === 400) {
4659
- const B = await b.json().catch(() => ({}));
4658
+ }), a("save", s.value);
4659
+ else if (y.status === 400) {
4660
+ const S = await y.json().catch(() => ({}));
4660
4661
  de({
4661
4662
  type: "warning",
4662
4663
  title: "Помилка валідації",
4663
- message: B.message || "Некоректні дані (400)"
4664
+ message: S.message || "Некоректні дані (400)"
4664
4665
  });
4665
- } else b.status === 500 ? de({
4666
+ } else y.status === 500 ? de({
4666
4667
  type: "error",
4667
4668
  title: "Серверна помилка",
4668
4669
  message: "Виникла помилка на сервері (500)"
4669
4670
  }) : de({
4670
4671
  type: "error",
4671
4672
  title: "Помилка",
4672
- message: `Статус: ${b.status}`
4673
+ message: `Статус: ${y.status}`
4673
4674
  });
4674
- } catch (b) {
4675
+ } catch (y) {
4675
4676
  de({
4676
4677
  type: "error",
4677
4678
  title: "Помилка з’єднання",
4678
- message: b.message || "Не вдалося виконати запит"
4679
+ message: y.message || "Не вдалося виконати запит"
4679
4680
  });
4680
4681
  }
4681
4682
  }
4682
4683
  function f() {
4683
- s("close");
4684
+ a("close");
4684
4685
  }
4685
4686
  return ke(async () => {
4686
4687
  try {
@@ -4694,11 +4695,11 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
4694
4695
  });
4695
4696
  return;
4696
4697
  }
4697
- const b = await m.json();
4698
- n.value = b.schema, i.value = b.token;
4698
+ const y = await m.json();
4699
+ n.value = y.schema, u.value = y.token;
4699
4700
  } else if (t.token) {
4700
- i.value = t.token;
4701
- const m = await fetch(`/api/form/${i.value}`);
4701
+ u.value = t.token;
4702
+ const m = await fetch(`/api/form/${u.value}`);
4702
4703
  if (!m.ok) {
4703
4704
  de({
4704
4705
  type: m.status >= 400 && m.status < 500 ? "warning" : "error",
@@ -4707,8 +4708,8 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
4707
4708
  });
4708
4709
  return;
4709
4710
  }
4710
- const b = await m.json();
4711
- n.value = b.schema, b.data ? a.value = b.data : c.value = "add";
4711
+ const y = await m.json();
4712
+ n.value = y.schema, y.data ? s.value = y.data : c.value = "add";
4712
4713
  }
4713
4714
  } catch (m) {
4714
4715
  de({
@@ -4717,16 +4718,16 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
4717
4718
  message: m.message || "Unexpected error"
4718
4719
  }), console.error(m);
4719
4720
  }
4720
- }), (m, b) => (u(), d("div", Ei, [
4721
+ }), (m, y) => (i(), d("div", Ei, [
4721
4722
  l("div", Ii, [
4722
4723
  l("div", zi, [
4723
4724
  l("div", Ai, [
4724
- l("h3", Ti, W(c.value === "add" ? "Додати" : "Змінити"), 1),
4725
+ l("h3", Ti, G(c.value === "add" ? "Додати" : "Змінити"), 1),
4725
4726
  l("button", {
4726
4727
  onClick: f,
4727
4728
  type: "button",
4728
4729
  class: "size-8 inline-flex justify-center items-center gap-x-2 rounded-full border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 focus:outline-none focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:hover:bg-neutral-600 dark:text-neutral-400 dark:focus:bg-neutral-600"
4729
- }, b[2] || (b[2] = [
4730
+ }, y[2] || (y[2] = [
4730
4731
  l("span", { class: "sr-only" }, "Close", -1),
4731
4732
  l("svg", {
4732
4733
  class: "flex-shrink-0 w-4 h-4",
@@ -4746,13 +4747,13 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
4746
4747
  ]))
4747
4748
  ]),
4748
4749
  l("div", Fi, [
4749
- n.value ? (u(), me(He, {
4750
+ n.value ? (i(), me(He, {
4750
4751
  key: 0,
4751
4752
  schema: n.value,
4752
- values: a.value,
4753
- "onUpdate:values": b[0] || (b[0] = (B) => a.value = B),
4753
+ values: s.value,
4754
+ "onUpdate:values": y[0] || (y[0] = (S) => s.value = S),
4754
4755
  form: r.value,
4755
- "onUpdate:form": b[1] || (b[1] = (B) => r.value = B)
4756
+ "onUpdate:form": y[1] || (y[1] = (S) => r.value = S)
4756
4757
  }, null, 8, ["schema", "values", "form"])) : D("", !0)
4757
4758
  ]),
4758
4759
  l("div", { class: "vs-form__head mr-5 mb-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, [
@@ -4784,8 +4785,8 @@ const Bi = { class: "flex w-full h-full min-h-0 gap-6" }, ji = {
4784
4785
  onClose: () => {
4785
4786
  e(null), t();
4786
4787
  },
4787
- onSave: (s) => {
4788
- e(s), t();
4788
+ onSave: (a) => {
4789
+ e(a), t();
4789
4790
  }
4790
4791
  }
4791
4792
  });