@opengis/form 0.0.23 → 0.0.24

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,5 +1,5 @@
1
- import { defineComponent as O, ref as x, onMounted as ue, onUnmounted as Ee, createElementBlock as u, openBlock as i, normalizeClass as V, createCommentVNode as j, renderSlot as ge, createElementVNode as l, toDisplayString as F, normalizeProps as Fe, guardReactiveProps as De, createTextVNode as se, computed as D, mergeModels as Q, useModel as X, withDirectives as K, unref as J, vModelText as de, vModelCheckbox as Ye, createVNode as B, createBlock as te, resolveDynamicComponent as _e, normalizeStyle as he, withCtx as $e, withModifiers as ne, onBeforeUnmount as dt, watch as ie, createStaticVNode as re, vModelRadio as et, Fragment as ee, renderList as le, mergeProps as Le, reactive as ct, vShow as Ue, inject as Be, resolveComponent as Ne, Transition as tt, nextTick as Me, Teleport as pt, provide as He } from "vue";
2
- import { notify as pe, modal as ft, TooltipDirective as qe, VsModal as vt } from "@opengis/core";
1
+ import { defineComponent as E, ref as x, onMounted as pe, onUnmounted as Ue, createElementBlock as u, openBlock as i, normalizeClass as M, createCommentVNode as z, renderSlot as ke, createElementVNode as l, toDisplayString as F, normalizeProps as Te, guardReactiveProps as Re, createTextVNode as ie, computed as T, mergeModels as W, useModel as Q, withDirectives as X, unref as G, vModelText as fe, vModelCheckbox as Xe, createVNode as I, createBlock as te, resolveDynamicComponent as Ve, normalizeStyle as we, withCtx as Me, withModifiers as ce, onBeforeUnmount as ut, watch as ue, createStaticVNode as re, vModelRadio as Ye, Fragment as ee, renderList as le, mergeProps as je, reactive as dt, vShow as Pe, inject as ze, resolveComponent as Ne, Transition as et, nextTick as Be, Teleport as ct, getCurrentInstance as pt, provide as He } from "vue";
2
+ import { notify as me, modal as ft, VsModal as vt } from "@opengis/core";
3
3
  const mt = {
4
4
  key: 0,
5
5
  class: "text-[14px] font-medium text-gray-900 mb-2"
@@ -9,7 +9,7 @@ const mt = {
9
9
  }, bt = {
10
10
  key: 1,
11
11
  class: "text-red-500 text-[10px] absolute bottom-[-14px]"
12
- }, yt = /* @__PURE__ */ O({
12
+ }, yt = /* @__PURE__ */ E({
13
13
  __name: "vs-layout-default",
14
14
  props: {
15
15
  ua: { default: "" },
@@ -23,22 +23,22 @@ const mt = {
23
23
  label: { default: "" }
24
24
  },
25
25
  setup(o) {
26
- const e = x("uk"), t = (n) => {
27
- n.detail.key === "locale" && (e.value = n.detail.newValue);
26
+ const e = x("uk"), t = (r) => {
27
+ r.detail.key === "locale" && (e.value = r.detail.newValue);
28
28
  };
29
- return ue(() => {
29
+ return pe(() => {
30
30
  e.value = localStorage.locale, window.addEventListener("storage", t);
31
- }), Ee(() => {
31
+ }), Ue(() => {
32
32
  window.removeEventListener("resize", t);
33
- }), (n, s) => (i(), u("div", {
34
- class: V(["w-full relative", { "opacity-60": n.item.disabled }])
33
+ }), (r, s) => (i(), u("div", {
34
+ class: M(["w-full relative", { "opacity-60": r.item.disabled }])
35
35
  }, [
36
- n.ua || n.label ? (i(), u("div", mt, [
37
- l("span", ht, F(n.item[e.value] || n.ua || n.label), 1),
38
- n.item?.rules?.includes("required") ? (i(), u("span", gt, "*")) : j("", !0)
39
- ])) : j("", !0),
40
- ge(n.$slots, "default", Fe(De(n.$attrs))),
41
- n.error ? (i(), u("span", bt, F(n.error), 1)) : j("", !0)
36
+ r.ua || r.label ? (i(), u("div", mt, [
37
+ l("span", ht, F(r.item[e.value] || r.ua || r.label), 1),
38
+ r.item?.rules?.includes("required") ? (i(), u("span", gt, "*")) : z("", !0)
39
+ ])) : z("", !0),
40
+ ke(r.$slots, "default", Te(Re(r.$attrs))),
41
+ r.error ? (i(), u("span", bt, F(r.error), 1)) : z("", !0)
42
42
  ], 2));
43
43
  }
44
44
  }), xt = { class: "w-full relative flex flex-row items-center gap-2" }, wt = {
@@ -50,7 +50,7 @@ const mt = {
50
50
  }, _t = {
51
51
  key: 1,
52
52
  class: "text-red-500 text-[10px] absolute bottom-[-14px]"
53
- }, $t = /* @__PURE__ */ O({
53
+ }, $t = /* @__PURE__ */ E({
54
54
  __name: "vs-layout-horizontal",
55
55
  props: {
56
56
  ua: { default: "" },
@@ -66,17 +66,17 @@ const mt = {
66
66
  setup(o) {
67
67
  return (e, t) => (i(), u("div", xt, [
68
68
  e.item?.type !== "html" ? (i(), u("span", wt, [
69
- se(F(e.ua || e.label) + " ", 1),
70
- e.item?.rules?.includes("required") && (e.ua || e.label) ? (i(), u("span", kt, "*")) : j("", !0)
71
- ])) : j("", !0),
72
- ge(e.$slots, "default", Fe(De(e.$attrs))),
73
- e.error ? (i(), u("span", _t, F(e.error), 1)) : j("", !0)
69
+ ie(F(e.ua || e.label) + " ", 1),
70
+ e.item?.rules?.includes("required") && (e.ua || e.label) ? (i(), u("span", kt, "*")) : z("", !0)
71
+ ])) : z("", !0),
72
+ ke(e.$slots, "default", Te(Re(e.$attrs))),
73
+ e.error ? (i(), u("span", _t, F(e.error), 1)) : z("", !0)
74
74
  ]));
75
75
  }
76
76
  }), Ct = { class: "w-full relative" }, Vt = {
77
77
  key: 0,
78
78
  class: "text-red-500 text-[10px] absolute bottom-[-14px]"
79
- }, Mt = /* @__PURE__ */ O({
79
+ }, Mt = /* @__PURE__ */ E({
80
80
  __name: "vs-layout-inline",
81
81
  props: {
82
82
  ua: { default: "" },
@@ -91,8 +91,8 @@ const mt = {
91
91
  },
92
92
  setup(o) {
93
93
  return (e, t) => (i(), u("div", Ct, [
94
- ge(e.$slots, "default", Fe(De(e.$attrs))),
95
- e.error ? (i(), u("span", Vt, F(e.error), 1)) : j("", !0)
94
+ ke(e.$slots, "default", Te(Re(e.$attrs))),
95
+ e.error ? (i(), u("span", Vt, F(e.error), 1)) : z("", !0)
96
96
  ]));
97
97
  }
98
98
  }), Lt = {
@@ -100,17 +100,17 @@ const mt = {
100
100
  horizontal: $t,
101
101
  inline: Mt
102
102
  };
103
- function be(o) {
103
+ function _e(o) {
104
104
  return {
105
- inputClass: D(() => {
105
+ inputClass: T(() => {
106
106
  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 `;
107
107
  return o?.size === "sm" ? `${t}h-[32px]` : `${t}h-[38px]`;
108
108
  })
109
109
  };
110
110
  }
111
- const St = ["placeholder", "disabled"], Ge = /* @__PURE__ */ O({
111
+ const St = ["placeholder", "disabled"], qe = /* @__PURE__ */ E({
112
112
  __name: "vs-input-text",
113
- props: /* @__PURE__ */ Q({
113
+ props: /* @__PURE__ */ W({
114
114
  style: { default: () => ({}) },
115
115
  customClass: { default: "" },
116
116
  disabled: { type: Boolean, default: !1 },
@@ -124,23 +124,23 @@ const St = ["placeholder", "disabled"], Ge = /* @__PURE__ */ O({
124
124
  }),
125
125
  emits: ["update:modelValue"],
126
126
  setup(o) {
127
- const e = o, { inputClass: t } = be(e.style), n = X(o, "modelValue");
128
- return (s, a) => K((i(), u("input", {
127
+ const e = o, { inputClass: t } = _e(e.style), r = Q(o, "modelValue");
128
+ return (s, n) => X((i(), u("input", {
129
129
  type: "text",
130
- "onUpdate:modelValue": a[0] || (a[0] = (r) => n.value = r),
130
+ "onUpdate:modelValue": n[0] || (n[0] = (a) => r.value = a),
131
131
  placeholder: s.placeholder,
132
132
  disabled: s.disabled,
133
- class: V(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [J(t), { "!border-red-600": s.error }]]),
133
+ class: M(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [G(t), { "!border-red-600": s.error }]]),
134
134
  style: {
135
135
  border: "1px solid #CFD9E0"
136
136
  }
137
137
  }, null, 10, St)), [
138
- [de, n.value]
138
+ [fe, r.value]
139
139
  ]);
140
140
  }
141
- }), Bt = ["placeholder"], jt = /* @__PURE__ */ O({
141
+ }), Bt = ["placeholder"], jt = /* @__PURE__ */ E({
142
142
  __name: "vs-input-number",
143
- props: /* @__PURE__ */ Q({
143
+ props: /* @__PURE__ */ W({
144
144
  style: { default: () => ({}) },
145
145
  customClass: {},
146
146
  disabled: { type: Boolean },
@@ -154,24 +154,24 @@ const St = ["placeholder", "disabled"], Ge = /* @__PURE__ */ O({
154
154
  }),
155
155
  emits: ["update:modelValue"],
156
156
  setup(o) {
157
- const e = o, { inputClass: t } = be(e.style), n = X(o, "modelValue");
158
- return (s, a) => K((i(), u("input", {
157
+ const e = o, { inputClass: t } = _e(e.style), r = Q(o, "modelValue");
158
+ return (s, n) => X((i(), u("input", {
159
159
  type: "number",
160
160
  step: "any",
161
- "onUpdate:modelValue": a[0] || (a[0] = (r) => n.value = r),
161
+ "onUpdate:modelValue": n[0] || (n[0] = (a) => r.value = a),
162
162
  placeholder: s.placeholder,
163
- class: V(["py-1.5 px-3 block w-full", [J(t)]]),
163
+ class: M(["py-1.5 px-3 block w-full bg-white", [G(t)]]),
164
164
  style: {
165
165
  border: "1px solid #CFD9E0"
166
166
  }
167
167
  }, null, 10, Bt)), [
168
- [de, n.value]
168
+ [fe, r.value]
169
169
  ]);
170
170
  }
171
- }), R = (o, e) => {
171
+ }), P = (o, e) => {
172
172
  const t = o.__vccOpts || o;
173
- for (const [n, s] of e)
174
- t[n] = s;
173
+ for (const [r, s] of e)
174
+ t[r] = s;
175
175
  return t;
176
176
  }, It = {}, zt = {
177
177
  xmlns: "http://www.w3.org/2000/svg",
@@ -193,7 +193,7 @@ function At(o, e) {
193
193
  l("path", { d: "M5 12l5 5l10 -10" }, null, -1)
194
194
  ]));
195
195
  }
196
- const Ot = /* @__PURE__ */ R(It, [["render", At]]), Et = { class: "flex items-center gap-[4px]" }, Ft = ["value", "id", "disabled"], Dt = ["for"], Ut = { class: "text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400" }, Tt = /* @__PURE__ */ O({
196
+ const Ot = /* @__PURE__ */ P(It, [["render", At]]), Et = { class: "flex items-center gap-[4px]" }, Ft = ["value", "id", "disabled"], Dt = ["for"], Ut = { class: "text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400" }, Tt = /* @__PURE__ */ E({
197
197
  __name: "vs-checkbox-default",
198
198
  props: {
199
199
  value: { default: "" },
@@ -206,36 +206,36 @@ const Ot = /* @__PURE__ */ R(It, [["render", At]]), Et = { class: "flex items-ce
206
206
  },
207
207
  emits: ["update:modelValue"],
208
208
  setup(o, { emit: e }) {
209
- const t = e, n = o, s = D({
210
- get: () => n.modelValue,
211
- set: (a) => t("update:modelValue", a)
209
+ const t = e, r = o, s = T({
210
+ get: () => r.modelValue,
211
+ set: (n) => t("update:modelValue", n)
212
212
  });
213
- return (a, r) => (i(), u("div", Et, [
214
- K(l("input", {
213
+ return (n, a) => (i(), u("div", Et, [
214
+ X(l("input", {
215
215
  type: "checkbox",
216
- value: a.value,
217
- "onUpdate:modelValue": r[0] || (r[0] = (d) => s.value = d),
218
- class: V(["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 }]),
219
- id: a.id,
220
- disabled: a.disabled
216
+ value: n.value,
217
+ "onUpdate:modelValue": a[0] || (a[0] = (d) => s.value = d),
218
+ class: M(["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": n.disabled }]),
219
+ id: n.id,
220
+ disabled: n.disabled
221
221
  }, null, 10, Ft), [
222
- [Ye, s.value]
222
+ [Xe, s.value]
223
223
  ]),
224
224
  l("label", {
225
- for: a.id,
226
- class: V(["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 }])
225
+ for: n.id,
226
+ class: M(["flex flex-1 checkbox-label items-center gap-x-2 cursor-pointer text-sm text-gray-800 dark:text-neutral-300", { "!cursor-not-allowed": n.disabled }])
227
227
  }, [
228
228
  l("div", {
229
- class: V(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [s.value ? "bg-blue-600 border-blue-600" : "bg-white border-gray-600", a.error ? "border-red-600" : ""]])
229
+ class: M(["h-[16px] text-white w-[16px] flex items-center justify-center shrink-0 border rounded", [s.value ? "bg-blue-600 border-blue-600" : "bg-white border-gray-600", n.error ? "border-red-600" : ""]])
230
230
  }, [
231
- B(Ot, {
231
+ I(Ot, {
232
232
  height: "12",
233
233
  width: "12"
234
234
  })
235
235
  ], 2),
236
236
  l("span", Ut, [
237
- ge(a.$slots, "default", {}, () => [
238
- se(F(a.label), 1)
237
+ ke(n.$slots, "default", {}, () => [
238
+ ie(F(n.label), 1)
239
239
  ])
240
240
  ])
241
241
  ], 10, Dt)
@@ -244,7 +244,7 @@ const Ot = /* @__PURE__ */ R(It, [["render", At]]), Et = { class: "flex items-ce
244
244
  }), Rt = ["name", "value", "disabled"], Pt = { class: "flex items-center gap-[6px] text-[14px]" }, Nt = {
245
245
  key: 0,
246
246
  class: "text-[16px]"
247
- }, Ht = ["src"], qt = /* @__PURE__ */ O({
247
+ }, Ht = ["src"], qt = /* @__PURE__ */ E({
248
248
  __name: "vs-checkbox-buttons",
249
249
  props: {
250
250
  value: { type: [String, Number, Boolean], default: "" },
@@ -258,16 +258,16 @@ const Ot = /* @__PURE__ */ R(It, [["render", At]]), Et = { class: "flex items-ce
258
258
  },
259
259
  emits: ["update:modelValue"],
260
260
  setup(o, { emit: e }) {
261
- const t = o, n = e, s = D({
261
+ const t = o, r = e, s = T({
262
262
  get: () => t.modelValue,
263
263
  set: (d) => {
264
- n("update:modelValue", d);
264
+ r("update:modelValue", d);
265
265
  }
266
- }), a = D(() => Array.isArray(s.value) ? s.value.includes(t.value) : s.value === !0 || s.value === t.value), r = D(() => t.style?.size === "xs" ? "p-1.5 text-xs" : t.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs");
266
+ }), n = T(() => Array.isArray(s.value) ? s.value.includes(t.value) : s.value === !0 || s.value === t.value), a = T(() => t.style?.size === "xs" ? "p-1.5 text-xs" : t.style?.size === "lg" ? "p-3.5 text-[20px]" : "p-2.5 text-xs");
267
267
  return (d, p) => (i(), u("label", {
268
- class: V(["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"]])
268
+ class: M(["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", [a.value, n.value ? "ring-blue-500" : "border border-gray-200 ring-transparent"]])
269
269
  }, [
270
- K(l("input", {
270
+ X(l("input", {
271
271
  type: "checkbox",
272
272
  class: "hidden",
273
273
  name: d.id,
@@ -275,29 +275,29 @@ const Ot = /* @__PURE__ */ R(It, [["render", At]]), Et = { class: "flex items-ce
275
275
  "onUpdate:modelValue": p[0] || (p[0] = (f) => s.value = f),
276
276
  disabled: d.disabled
277
277
  }, null, 8, Rt), [
278
- [Ye, s.value]
278
+ [Xe, s.value]
279
279
  ]),
280
280
  l("span", Pt, [
281
281
  d.icon || d.imgUrl ? (i(), u("span", Nt, [
282
282
  d.icon ? (i(), u("i", {
283
283
  key: 0,
284
- class: V(d.icon)
285
- }, null, 2)) : j("", !0),
284
+ class: M(d.icon)
285
+ }, null, 2)) : z("", !0),
286
286
  d.imgUrl ? (i(), u("img", {
287
287
  key: 1,
288
288
  src: d.imgUrl,
289
289
  width: "16",
290
290
  height: "16",
291
291
  alt: "icon"
292
- }, null, 8, Ht)) : j("", !0)
293
- ])) : j("", !0),
294
- ge(d.$slots, "default", {}, () => [
295
- se(F(d.label), 1)
292
+ }, null, 8, Ht)) : z("", !0)
293
+ ])) : z("", !0),
294
+ ke(d.$slots, "default", {}, () => [
295
+ ie(F(d.label), 1)
296
296
  ])
297
297
  ])
298
298
  ], 2));
299
299
  }
300
- }), Gt = { class: "flex items-center" }, lt = /* @__PURE__ */ O({
300
+ }), Gt = { class: "flex items-center" }, tt = /* @__PURE__ */ E({
301
301
  __name: "vs-input-checkbox-item",
302
302
  props: {
303
303
  value: { default: "" },
@@ -314,32 +314,32 @@ const Ot = /* @__PURE__ */ R(It, [["render", At]]), Et = { class: "flex items-ce
314
314
  },
315
315
  emits: ["update:modelValue"],
316
316
  setup(o, { emit: e }) {
317
- const t = o, n = e, s = `radio-${Math.floor(Math.random() * 1e4)}`, a = D({
317
+ const t = o, r = e, s = `radio-${Math.floor(Math.random() * 1e4)}`, n = T({
318
318
  get: () => Array.isArray(t.modelValue) ? Array.isArray(t.modelValue) && t.modelValue.includes(t.value) : t.modelValue,
319
319
  set: (d) => {
320
320
  if (Array.isArray(t.modelValue)) {
321
321
  let p = [...t.modelValue];
322
- d ? p.includes(t.value) || p.push(t.value) : p = p.filter((f) => f !== t.value), n("update:modelValue", p);
322
+ d ? p.includes(t.value) || p.push(t.value) : p = p.filter((f) => f !== t.value), r("update:modelValue", p);
323
323
  } else
324
- n("update:modelValue", d);
324
+ r("update:modelValue", d);
325
325
  }
326
- }), r = x(`vs-checkbox-${t.view || "default"}`);
326
+ }), a = x(`vs-checkbox-${t.view || "default"}`);
327
327
  return (d, p) => (i(), u("div", Gt, [
328
- (i(), te(_e(r.value === "vs-checkbox-buttons" ? J(qt) : J(Tt)), {
328
+ (i(), te(Ve(a.value === "vs-checkbox-buttons" ? G(qt) : G(Tt)), {
329
329
  value: d.value,
330
330
  label: d.label,
331
331
  info: d.option?.info,
332
332
  disabled: d.disabled,
333
- modelValue: a.value,
334
- "onUpdate:modelValue": p[0] || (p[0] = (f) => a.value = f),
333
+ modelValue: n.value,
334
+ "onUpdate:modelValue": p[0] || (p[0] = (f) => n.value = f),
335
335
  id: s,
336
336
  icon: d.icon,
337
337
  imgUrl: d.imgUrl,
338
- style: he(d.style),
338
+ style: we(d.style),
339
339
  error: d.error
340
340
  }, {
341
- default: $e(() => [
342
- se(F(d.label), 1)
341
+ default: Me(() => [
342
+ ie(F(d.label), 1)
343
343
  ]),
344
344
  _: 1
345
345
  }, 8, ["value", "label", "info", "disabled", "modelValue", "icon", "imgUrl", "style", "error"]))
@@ -365,7 +365,7 @@ function Zt(o, e) {
365
365
  l("path", { d: "M6 9l6 6l6 -6" }, null, -1)
366
366
  ]));
367
367
  }
368
- const Wt = /* @__PURE__ */ R(Jt, [["render", Zt]]), Qt = {}, Xt = {
368
+ const Wt = /* @__PURE__ */ P(Jt, [["render", Zt]]), Qt = {}, Xt = {
369
369
  xmlns: "http://www.w3.org/2000/svg",
370
370
  width: "24",
371
371
  height: "24",
@@ -388,15 +388,15 @@ function Yt(o, e) {
388
388
  l("path", { d: "M12 3c7.2 0 9 1.8 9 9s-1.8 9 -9 9s-9 -1.8 -9 -9s1.8 -9 9 -9z" }, null, -1)
389
389
  ]));
390
390
  }
391
- const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
391
+ const el = /* @__PURE__ */ P(Qt, [["render", Yt]]), tl = {
392
392
  key: 0,
393
393
  class: "flex items-start gap-x-1"
394
394
  }, ll = {
395
395
  key: 0,
396
396
  class: "text-red-500 text-[14px]"
397
- }, ol = ["title"], al = ["disabled"], ot = /* @__PURE__ */ O({
397
+ }, ol = ["title"], al = ["disabled"], lt = /* @__PURE__ */ E({
398
398
  __name: "vs-input-switcher",
399
- props: /* @__PURE__ */ Q({
399
+ props: /* @__PURE__ */ W({
400
400
  rules: { default: () => [] },
401
401
  view: { default: "checkbox" },
402
402
  label: { default: "" },
@@ -415,38 +415,38 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
415
415
  }),
416
416
  emits: ["update:modelValue"],
417
417
  setup(o) {
418
- const e = o, t = X(o, "modelValue");
419
- return (n, s) => e.view === "checkbox" ? (i(), u("div", tl, [
420
- B(lt, {
418
+ const e = o, t = Q(o, "modelValue");
419
+ return (r, s) => e.view === "checkbox" ? (i(), u("div", tl, [
420
+ I(tt, {
421
421
  modelValue: t.value,
422
- "onUpdate:modelValue": s[0] || (s[0] = (a) => t.value = a),
423
- label: n.text,
424
- error: n.error || ""
422
+ "onUpdate:modelValue": s[0] || (s[0] = (n) => t.value = n),
423
+ label: r.text,
424
+ error: r.error || ""
425
425
  }, null, 8, ["modelValue", "label", "error"]),
426
- n.rules?.includes("required") ? (i(), u("span", ll, "*")) : j("", !0),
427
- n.i ? (i(), u("button", {
426
+ r.rules?.includes("required") ? (i(), u("span", ll, "*")) : z("", !0),
427
+ r.i ? (i(), u("button", {
428
428
  key: 1,
429
429
  class: "cursor-pointer",
430
- title: n.i,
431
- onClick: s[1] || (s[1] = ne(() => {
430
+ title: r.i,
431
+ onClick: s[1] || (s[1] = ce(() => {
432
432
  }, ["prevent"]))
433
433
  }, [
434
- B(J(el), { class: "text-gray-500 w-[14px] h-[14px]" })
435
- ], 8, ol)) : j("", !0)
434
+ I(G(el), { class: "text-gray-500 w-[14px] h-[14px]" })
435
+ ], 8, ol)) : z("", !0)
436
436
  ])) : (i(), u("button", {
437
437
  key: 1,
438
438
  type: "button",
439
- class: V(["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-${n.style?.primaryColor || "blue"}-500` : "bg-stone-200", n.customClass]]),
440
- disabled: n.disabled,
441
- onClick: s[2] || (s[2] = (a) => t.value = !t.value)
439
+ class: M(["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-${r.style?.primaryColor || "blue"}-500` : "bg-stone-200", r.customClass]]),
440
+ disabled: r.disabled,
441
+ onClick: s[2] || (s[2] = (n) => t.value = !t.value)
442
442
  }, [
443
443
  l("span", {
444
444
  "data-state": "checked",
445
- class: V(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform", [t.value ? "translate-x-4" : "translate-x-0"]])
445
+ class: M(["pointer-events-none block h-4 w-4 rounded-full bg-white shadow-lg ring-0 transition-transform", [t.value ? "translate-x-4" : "translate-x-0"]])
446
446
  }, null, 2)
447
447
  ], 10, al));
448
448
  }
449
- }), sl = ["innerHTML"], Je = /* @__PURE__ */ O({
449
+ }), sl = ["innerHTML"], Ge = /* @__PURE__ */ E({
450
450
  __name: "vs-input-static",
451
451
  props: {
452
452
  text: { default: "" },
@@ -461,13 +461,13 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
461
461
  },
462
462
  setup(o) {
463
463
  return (e, t) => (i(), u("div", {
464
- class: V(e.customClass),
464
+ class: M(e.customClass),
465
465
  innerHTML: e.html ? e.html : e.text
466
466
  }, null, 10, sl));
467
467
  }
468
- }), rl = ["placeholder", "disabled", "name"], nl = /* @__PURE__ */ O({
468
+ }), rl = ["placeholder", "disabled", "name"], nl = /* @__PURE__ */ E({
469
469
  __name: "vs-input-mask",
470
- props: /* @__PURE__ */ Q({
470
+ props: /* @__PURE__ */ W({
471
471
  name: {},
472
472
  mask: { default: "" },
473
473
  unmask: { type: Boolean, default: !1 },
@@ -483,12 +483,12 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
483
483
  }),
484
484
  emits: ["update:modelValue"],
485
485
  setup(o) {
486
- const e = o, { inputClass: t } = be(e.style), n = X(o, "modelValue"), s = x(null);
487
- let a = null;
488
- return ue(async () => {
486
+ const e = o, { inputClass: t } = _e(e.style), r = Q(o, "modelValue"), s = x(null);
487
+ let n = null;
488
+ return pe(async () => {
489
489
  if (s.value) {
490
- const { default: r } = await import("./index-W-qQIppj.js");
491
- a = r(s.value, {
490
+ const { default: a } = await import("./index-W-qQIppj.js");
491
+ n = a(s.value, {
492
492
  mask: e.mask || "",
493
493
  definitions: {
494
494
  9: /[0-9]/,
@@ -496,41 +496,41 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
496
496
  "*": /[a-zA-Z0-9]/
497
497
  },
498
498
  lazy: !1
499
- }), a.on("accept", () => {
500
- n.value = e.unmask ? a.unmaskedValue : a.value;
501
- }), a.on("complete", () => {
502
- n.value = e.unmask ? a.unmaskedValue : a.value;
503
- }), a.value = n.value ?? "";
499
+ }), n.on("accept", () => {
500
+ r.value = e.unmask ? n.unmaskedValue : n.value;
501
+ }), n.on("complete", () => {
502
+ r.value = e.unmask ? n.unmaskedValue : n.value;
503
+ }), n.value = r.value ?? "";
504
504
  }
505
- }), dt(() => {
506
- a?.destroy();
507
- }), ie(() => e.mask, (r) => {
508
- a && a.updateOptions({
509
- mask: r,
505
+ }), ut(() => {
506
+ n?.destroy();
507
+ }), ue(() => e.mask, (a) => {
508
+ n && n.updateOptions({
509
+ mask: a,
510
510
  definitions: {
511
511
  9: /[0-9]/,
512
512
  A: /[a-zA-Z]/,
513
513
  "*": /[a-zA-Z0-9]/
514
514
  }
515
515
  });
516
- }), ie(n, (r) => {
517
- a && a.unmaskedValue !== r && (a.value = r || "");
518
- }), (r, d) => (i(), u("input", {
516
+ }), ue(r, (a) => {
517
+ n && n.unmaskedValue !== a && (n.value = a || "");
518
+ }), (a, d) => (i(), u("input", {
519
519
  type: "text",
520
520
  ref_key: "inputEl",
521
521
  ref: s,
522
- placeholder: r.placeholder,
523
- disabled: r.disabled,
524
- name: r.name,
525
- class: V(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [J(t)]]),
522
+ placeholder: a.placeholder,
523
+ disabled: a.disabled,
524
+ name: a.name,
525
+ class: M(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [G(t)]]),
526
526
  style: {
527
527
  border: "1px solid #CFD9E0"
528
528
  }
529
529
  }, null, 10, rl));
530
530
  }
531
- }), il = { class: "relative w-full bg-white rounded-lg" }, ul = ["placeholder", "disabled"], dl = /* @__PURE__ */ O({
531
+ }), il = { class: "relative w-full bg-white rounded-lg" }, ul = ["placeholder", "disabled"], dl = /* @__PURE__ */ E({
532
532
  __name: "vs-input-email",
533
- props: /* @__PURE__ */ Q({
533
+ props: /* @__PURE__ */ W({
534
534
  style: { default: () => ({}) },
535
535
  customClass: { default: "" },
536
536
  disabled: { type: Boolean, default: !1 },
@@ -544,26 +544,26 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
544
544
  }),
545
545
  emits: ["update:modelValue"],
546
546
  setup(o) {
547
- const e = o, { inputClass: t } = be(e.style), n = X(o, "modelValue");
548
- return (s, a) => (i(), u("div", il, [
549
- a[1] || (a[1] = re('<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)),
550
- K(l("input", {
547
+ const e = o, { inputClass: t } = _e(e.style), r = Q(o, "modelValue");
548
+ return (s, n) => (i(), u("div", il, [
549
+ n[1] || (n[1] = re('<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)),
550
+ X(l("input", {
551
551
  type: "email",
552
- "onUpdate:modelValue": a[0] || (a[0] = (r) => n.value = r),
552
+ "onUpdate:modelValue": n[0] || (n[0] = (a) => r.value = a),
553
553
  placeholder: s.placeholder,
554
554
  disabled: s.disabled,
555
- class: V(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f]", [J(t), { "!border-red-600": s.error }]]),
555
+ class: M(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [G(t), { "!border-red-600": s.error }]]),
556
556
  style: {
557
557
  border: "1px solid #CFD9E0"
558
558
  }
559
559
  }, null, 10, ul), [
560
- [de, n.value]
560
+ [fe, r.value]
561
561
  ])
562
562
  ]));
563
563
  }
564
- }), cl = ["value", "disabled"], pl = { class: "text-[13px] text-gray-700" }, fl = /* @__PURE__ */ O({
564
+ }), cl = ["value", "disabled"], pl = { class: "text-[13px] text-gray-700" }, fl = /* @__PURE__ */ E({
565
565
  __name: "vs-input-radio-default",
566
- props: /* @__PURE__ */ Q({
566
+ props: /* @__PURE__ */ W({
567
567
  style: {},
568
568
  customClass: { default: "" },
569
569
  disabled: { type: Boolean, default: !1 },
@@ -579,36 +579,36 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
579
579
  }),
580
580
  emits: ["update:modelValue"],
581
581
  setup(o) {
582
- const e = X(o, "modelValue");
583
- return (t, n) => (i(), u("label", {
584
- class: V(["flex items-center gap-0", [t.customClass]])
582
+ const e = Q(o, "modelValue");
583
+ return (t, r) => (i(), u("label", {
584
+ class: M(["flex items-center gap-0", [t.customClass]])
585
585
  }, [
586
- K(l("input", {
587
- "onUpdate:modelValue": n[0] || (n[0] = (s) => e.value = s),
586
+ X(l("input", {
587
+ "onUpdate:modelValue": r[0] || (r[0] = (s) => e.value = s),
588
588
  type: "radio",
589
589
  value: t.value,
590
590
  disabled: t.disabled,
591
591
  class: "hidden"
592
592
  }, null, 8, cl), [
593
- [et, e.value]
593
+ [Ye, e.value]
594
594
  ]),
595
595
  l("span", {
596
- class: V(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]", [
596
+ class: M(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]", [
597
597
  `border-${t.style?.primaryColor || "blue"}-500`,
598
598
  t.disabled ? "opacity-50 cursor-not-allowed" : ""
599
599
  ]])
600
600
  }, [
601
601
  e.value == t.value ? (i(), u("span", {
602
602
  key: 0,
603
- class: V(["w-[12px] h-[12px] shrink-0 rounded-full", [`bg-${t.style?.primaryColor || "blue"}-500`]])
604
- }, null, 2)) : j("", !0)
603
+ class: M(["w-[12px] h-[12px] shrink-0 rounded-full", [`bg-${t.style?.primaryColor || "blue"}-500`]])
604
+ }, null, 2)) : z("", !0)
605
605
  ], 2),
606
606
  l("span", pl, F(t.text), 1)
607
607
  ], 2));
608
608
  }
609
- }), vl = ["value", "disabled"], ml = { class: "text-[13px] text-gray-700" }, hl = /* @__PURE__ */ O({
609
+ }), vl = ["value", "disabled"], ml = { class: "text-[13px] text-gray-700" }, hl = /* @__PURE__ */ E({
610
610
  __name: "vs-input-radio-buttons",
611
- props: /* @__PURE__ */ Q({
611
+ props: /* @__PURE__ */ W({
612
612
  style: {},
613
613
  customClass: { default: "" },
614
614
  disabled: { type: Boolean, default: !1 },
@@ -624,21 +624,21 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
624
624
  }),
625
625
  emits: ["update:modelValue"],
626
626
  setup(o) {
627
- const e = X(o, "modelValue");
628
- return (t, n) => (i(), u("label", {
629
- class: V(["flex items-center border rounded-lg px-2 py-1", [
627
+ const e = Q(o, "modelValue");
628
+ return (t, r) => (i(), u("label", {
629
+ class: M(["flex items-center border rounded-lg px-2 py-1", [
630
630
  e.value == t.value ? `ring-2 ring-ring ring-${t.style?.primaryColor || "blue"}-500` : "",
631
631
  t.customClass
632
632
  ]])
633
633
  }, [
634
- K(l("input", {
635
- "onUpdate:modelValue": n[0] || (n[0] = (s) => e.value = s),
634
+ X(l("input", {
635
+ "onUpdate:modelValue": r[0] || (r[0] = (s) => e.value = s),
636
636
  type: "radio",
637
637
  value: t.value,
638
638
  disabled: t.disabled,
639
639
  class: "hidden"
640
640
  }, null, 8, vl), [
641
- [et, e.value]
641
+ [Ye, e.value]
642
642
  ]),
643
643
  l("span", ml, F(t.text), 1)
644
644
  ], 2));
@@ -646,9 +646,9 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
646
646
  }), gl = {
647
647
  "vs-input-radio-default": fl,
648
648
  "vs-input-radio-buttons": hl
649
- }, Ke = /* @__PURE__ */ O({
649
+ }, Je = /* @__PURE__ */ E({
650
650
  __name: "vs-input-radio",
651
- props: /* @__PURE__ */ Q({
651
+ props: /* @__PURE__ */ W({
652
652
  options: {},
653
653
  position: { default: "vertical" },
654
654
  view: { default: "default" },
@@ -665,21 +665,21 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
665
665
  }),
666
666
  emits: ["update:modelValue"],
667
667
  setup(o) {
668
- const e = o, t = X(o, "modelValue"), n = D(() => gl[`vs-input-radio-${e.view}`]);
669
- return (s, a) => (i(), u("div", {
670
- class: V([s.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
668
+ const e = o, t = Q(o, "modelValue"), r = T(() => gl[`vs-input-radio-${e.view}`]);
669
+ return (s, n) => (i(), u("div", {
670
+ class: M([s.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
671
671
  }, [
672
- (i(!0), u(ee, null, le(s.options, (r) => (i(), te(_e(n.value), Le({
673
- key: r?.id,
674
- text: r.text,
675
- value: r.id.toString(),
676
- checked: t.value === r.id,
672
+ (i(!0), u(ee, null, le(s.options, (a) => (i(), te(Ve(r.value), je({
673
+ key: a?.id,
674
+ text: a.text,
675
+ value: a.id.toString(),
676
+ checked: t.value === a.id,
677
677
  modelValue: t.value,
678
- "onUpdate:modelValue": a[0] || (a[0] = (d) => t.value = d)
678
+ "onUpdate:modelValue": n[0] || (n[0] = (d) => t.value = d)
679
679
  }, { ref_for: !0 }, s.$attrs), null, 16, ["text", "value", "checked", "modelValue"]))), 128))
680
680
  ], 2));
681
681
  }
682
- }), bl = /* @__PURE__ */ O({
682
+ }), bl = /* @__PURE__ */ E({
683
683
  __name: "vs-input-checkbox",
684
684
  props: {
685
685
  options: { default: () => [] },
@@ -698,81 +698,81 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
698
698
  },
699
699
  emits: ["update:modelValue"],
700
700
  setup(o, { emit: e }) {
701
- const t = o, n = e, s = x([]), a = ct({}), r = (c) => c?.value || c?.id || c?.text || c, d = (c) => c.text || String(c), p = (c) => `lg:col-span-${c || 12}`, f = async () => {
701
+ const t = o, r = e, s = x([]), n = dt({}), a = (c) => c?.value || c?.id || c?.text || c, d = (c) => c.text || String(c), p = (c) => `lg:col-span-${c || 12}`, f = async () => {
702
702
  try {
703
- const c = await fetch(`/api/suggest/${t.data}`).then((g) => g.json());
703
+ const c = await fetch(`/api/suggest/${t.data}`).then((b) => b.json());
704
704
  s.value = c?.data || c;
705
705
  } catch (c) {
706
706
  console.error(c);
707
707
  }
708
708
  };
709
- return ie(
709
+ return ue(
710
710
  () => t.modelValue,
711
711
  (c) => {
712
712
  if (typeof c == "boolean" && s.value.length === 1) {
713
- const g = r(s.value[0]);
714
- a[g] = c;
713
+ const b = a(s.value[0]);
714
+ n[b] = c;
715
715
  } else if (Array.isArray(c)) {
716
- const g = new Set(c);
716
+ const b = new Set(c);
717
717
  s.value.forEach((v) => {
718
718
  if (!v.disabled) {
719
- const C = r(v);
720
- a[C] = g.has(C);
719
+ const C = a(v);
720
+ n[C] = b.has(C);
721
721
  }
722
722
  });
723
723
  }
724
724
  },
725
725
  { immediate: !0 }
726
- ), ie(
727
- a,
726
+ ), ue(
727
+ n,
728
728
  () => {
729
729
  if (!s.value.length) {
730
- n("update:modelValue", null);
730
+ r("update:modelValue", null);
731
731
  return;
732
732
  }
733
- const c = Object.entries(a).filter(([, g]) => g).map(([g]) => g);
734
- n("update:modelValue", c.length === 0 ? [] : c);
733
+ const c = Object.entries(n).filter(([, b]) => b).map(([b]) => b);
734
+ r("update:modelValue", c.length === 0 ? [] : c);
735
735
  },
736
736
  { deep: !0 }
737
- ), ue(() => {
737
+ ), pe(() => {
738
738
  if (t.data)
739
739
  f().then(() => {
740
740
  if (typeof t.modelValue == "boolean" && s.value.length === 1) {
741
- const c = r(s.value[0]);
742
- a[c] = t.modelValue;
741
+ const c = a(s.value[0]);
742
+ n[c] = t.modelValue;
743
743
  } else if (Array.isArray(t.modelValue)) {
744
744
  const c = new Set(t.modelValue);
745
- s.value.forEach((g) => {
746
- if (!g.disabled) {
747
- const v = r(g);
748
- a[v] = c.has(v);
745
+ s.value.forEach((b) => {
746
+ if (!b.disabled) {
747
+ const v = a(b);
748
+ n[v] = c.has(v);
749
749
  }
750
750
  });
751
751
  }
752
752
  });
753
753
  else if (s.value = t.options, typeof t.modelValue == "boolean" && s.value.length === 1) {
754
- const c = r(s.value[0]);
755
- a[c] = t.modelValue;
754
+ const c = a(s.value[0]);
755
+ n[c] = t.modelValue;
756
756
  } else if (Array.isArray(t.modelValue)) {
757
757
  const c = new Set(t.modelValue);
758
- s.value.forEach((g) => {
759
- if (!g.disabled) {
760
- const v = r(g);
761
- a[v] = c.has(v);
758
+ s.value.forEach((b) => {
759
+ if (!b.disabled) {
760
+ const v = a(b);
761
+ n[v] = c.has(v);
762
762
  }
763
763
  });
764
764
  }
765
- }), (c, g) => (i(), u("div", {
766
- class: V(["p-0 w-full gap-[6px]", [c.position === "vertical" ? "flex-col" : "", c.colSpan ? "grid" : "flex justify-start"]])
765
+ }), (c, b) => (i(), u("div", {
766
+ class: M(["p-0 w-full gap-[6px]", [c.position === "vertical" ? "flex-col" : "", c.colSpan ? "grid" : "flex justify-start"]])
767
767
  }, [
768
- (i(!0), u(ee, null, le(s.value, (v) => (i(), te(lt, {
769
- modelValue: a[r(v)],
770
- "onUpdate:modelValue": (C) => a[r(v)] = C,
771
- value: r(v),
772
- class: V(p(c.colSpan)),
768
+ (i(!0), u(ee, null, le(s.value, (v) => (i(), te(tt, {
769
+ modelValue: n[a(v)],
770
+ "onUpdate:modelValue": (C) => n[a(v)] = C,
771
+ value: a(v),
772
+ class: M(p(c.colSpan)),
773
773
  disabled: v.disabled,
774
774
  label: d(v),
775
- key: r(v),
775
+ key: a(v),
776
776
  icon: v?.icon,
777
777
  imgUrl: v?.imgUrl,
778
778
  option: v,
@@ -780,7 +780,7 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
780
780
  }, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "icon", "imgUrl", "option", "view"]))), 128))
781
781
  ], 2));
782
782
  }
783
- }), yl = /* @__PURE__ */ R(bl, [["__scopeId", "data-v-91f3584a"]]), xl = ["placeholder", "disabled"], wl = /* @__PURE__ */ O({
783
+ }), yl = /* @__PURE__ */ P(bl, [["__scopeId", "data-v-91f3584a"]]), xl = ["placeholder", "disabled"], wl = /* @__PURE__ */ E({
784
784
  __name: "vs-input-date1",
785
785
  props: {
786
786
  style: { default: () => ({}) },
@@ -793,36 +793,36 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
793
793
  },
794
794
  emits: ["update:modelValue"],
795
795
  setup(o, { emit: e }) {
796
- const t = o, { inputClass: n } = be(t.style), s = e, a = D({
796
+ const t = o, { inputClass: r } = _e(t.style), s = e, n = T({
797
797
  get: () => t.modelValue?.split(" ")[0],
798
- set: (r) => s("update:modelValue", r)
798
+ set: (a) => s("update:modelValue", a)
799
799
  });
800
- return (r, d) => K((i(), u("input", {
800
+ return (a, d) => X((i(), u("input", {
801
801
  type: "date",
802
- "onUpdate:modelValue": d[0] || (d[0] = (p) => a.value = p),
803
- placeholder: r.placeholder,
804
- disabled: r.disabled,
802
+ "onUpdate:modelValue": d[0] || (d[0] = (p) => n.value = p),
803
+ placeholder: a.placeholder,
804
+ disabled: a.disabled,
805
805
  ref: "date",
806
- class: V(["py-1.5 px-3 block w-full placeholder:text[#767f8f]", [r.modelValue ? "" : "text-opacity-50", J(n)].join(" ")]),
806
+ class: M(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [a.modelValue ? "" : "text-opacity-50", G(r)].join(" ")]),
807
807
  style: {
808
808
  border: "1px solid #CFD9E0"
809
809
  }
810
810
  }, null, 10, xl)), [
811
- [de, a.value]
811
+ [fe, n.value]
812
812
  ]);
813
813
  }
814
- }), kl = async (o, e, t, n) => {
814
+ }), kl = async (o, e, t, r) => {
815
815
  try {
816
816
  const s = new FormData();
817
817
  return s.append("unique", "true"), s.append("file", o), (await fetch(
818
- `/file/upload/uploads?id=${e || ""}&form=${t || ""}&table=${n || ""}`,
818
+ `/file/upload/uploads?id=${e || ""}&form=${t || ""}&table=${r || ""}`,
819
819
  {
820
820
  method: "POST",
821
821
  body: s
822
822
  }
823
- ).then((r) => r.json()))?.result;
823
+ ).then((a) => a.json()))?.result;
824
824
  } catch (s) {
825
- return pe({
825
+ return me({
826
826
  type: "error",
827
827
  title: "Помилка!",
828
828
  message: "Сталась помилка під час завантаження файлу",
@@ -835,10 +835,10 @@ const el = /* @__PURE__ */ R(Qt, [["render", Yt]]), tl = {
835
835
  } catch (e) {
836
836
  return console.error(e), !1;
837
837
  }
838
- }, Ze = async (o) => {
838
+ }, Ke = async (o) => {
839
839
  try {
840
- const e = await fetch(`file/download/files/uploads${o}`), t = await e.arrayBuffer(), n = e.headers["content-type"], s = new TextDecoder("utf-8").decode(t), a = new Blob([s], { type: n }), r = document.createElement("a");
841
- r.setAttribute("download", o), r.href = window.URL.createObjectURL(a), r.click();
840
+ const e = await fetch(`file/download/files/uploads${o}`), t = await e.arrayBuffer(), r = e.headers["content-type"], s = new TextDecoder("utf-8").decode(t), n = new Blob([s], { type: r }), a = document.createElement("a");
841
+ a.setAttribute("download", o), a.href = window.URL.createObjectURL(n), a.click();
842
842
  } catch (e) {
843
843
  console.error(e.message);
844
844
  }
@@ -859,7 +859,7 @@ function Vl(o, e) {
859
859
  l("path", { d: "M12 5v14" }, null, -1)
860
860
  ]));
861
861
  }
862
- const je = /* @__PURE__ */ R($l, [["render", Vl]]), Ml = {}, Ll = {
862
+ const Ae = /* @__PURE__ */ P($l, [["render", Vl]]), Ml = {}, Ll = {
863
863
  xmlns: "http://www.w3.org/2000/svg",
864
864
  class: "icon icon-tabler icon-tabler-file-text",
865
865
  width: "44",
@@ -871,12 +871,12 @@ const je = /* @__PURE__ */ R($l, [["render", Vl]]), Ml = {}, Ll = {
871
871
  "stroke-linecap": "round",
872
872
  "stroke-linejoin": "round"
873
873
  };
874
- function Sl(o, e, t, n, s, a) {
874
+ function Sl(o, e, t, r, s, n) {
875
875
  return i(), u("svg", Ll, e[0] || (e[0] = [
876
876
  re('<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)
877
877
  ]));
878
878
  }
879
- const Bl = /* @__PURE__ */ R(Ml, [["render", Sl]]), jl = {}, Il = {
879
+ const Bl = /* @__PURE__ */ P(Ml, [["render", Sl]]), jl = {}, Il = {
880
880
  xmlns: "http://www.w3.org/2000/svg",
881
881
  class: "icon icon-tabler icon-tabler-table",
882
882
  width: "44",
@@ -888,7 +888,7 @@ const Bl = /* @__PURE__ */ R(Ml, [["render", Sl]]), jl = {}, Il = {
888
888
  "stroke-linecap": "round",
889
889
  "stroke-linejoin": "round"
890
890
  };
891
- function zl(o, e, t, n, s, a) {
891
+ function zl(o, e, t, r, s, n) {
892
892
  return i(), u("svg", Il, e[0] || (e[0] = [
893
893
  l("path", {
894
894
  stroke: "none",
@@ -916,7 +916,7 @@ function zl(o, e, t, n, s, a) {
916
916
  }, null, -1)
917
917
  ]));
918
918
  }
919
- const Al = /* @__PURE__ */ R(jl, [["render", zl]]), Ol = {}, El = {
919
+ const Al = /* @__PURE__ */ P(jl, [["render", zl]]), Ol = {}, El = {
920
920
  xmlns: "http://www.w3.org/2000/svg",
921
921
  width: "24",
922
922
  height: "24",
@@ -928,12 +928,12 @@ const Al = /* @__PURE__ */ R(jl, [["render", zl]]), Ol = {}, El = {
928
928
  "stroke-linejoin": "round",
929
929
  class: "icon icon-tabler icons-tabler-outline icon-tabler-file-unknown"
930
930
  };
931
- function Fl(o, e, t, n, s, a) {
931
+ function Fl(o, e, t, r, s, n) {
932
932
  return i(), u("svg", El, e[0] || (e[0] = [
933
933
  re('<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="M12 17v.01"></path><path d="M12 14a1.5 1.5 0 1 0 -1.14 -2.474"></path>', 5)
934
934
  ]));
935
935
  }
936
- const Dl = /* @__PURE__ */ R(Ol, [["render", Fl]]), Ul = {}, Tl = {
936
+ const Dl = /* @__PURE__ */ P(Ol, [["render", Fl]]), Ul = {}, Tl = {
937
937
  xmlns: "http://www.w3.org/2000/svg",
938
938
  class: "icon icon-tabler icon-tabler-file-zip",
939
939
  width: "44",
@@ -945,12 +945,12 @@ const Dl = /* @__PURE__ */ R(Ol, [["render", Fl]]), Ul = {}, Tl = {
945
945
  "stroke-linecap": "round",
946
946
  "stroke-linejoin": "round"
947
947
  };
948
- function Rl(o, e, t, n, s, a) {
948
+ function Rl(o, e, t, r, s, n) {
949
949
  return i(), u("svg", Tl, e[0] || (e[0] = [
950
950
  re('<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)
951
951
  ]));
952
952
  }
953
- const Pl = /* @__PURE__ */ R(Ul, [["render", Rl]]), Nl = {}, Hl = {
953
+ const Pl = /* @__PURE__ */ P(Ul, [["render", Rl]]), Nl = {}, Hl = {
954
954
  xmlns: "http://www.w3.org/2000/svg",
955
955
  class: "icon icon-tabler icon-tabler-file-code",
956
956
  width: "44",
@@ -962,12 +962,12 @@ const Pl = /* @__PURE__ */ R(Ul, [["render", Rl]]), Nl = {}, Hl = {
962
962
  "stroke-linecap": "round",
963
963
  "stroke-linejoin": "round"
964
964
  };
965
- function ql(o, e, t, n, s, a) {
965
+ function ql(o, e, t, r, s, n) {
966
966
  return i(), u("svg", Hl, e[0] || (e[0] = [
967
967
  re('<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)
968
968
  ]));
969
969
  }
970
- const Gl = /* @__PURE__ */ R(Nl, [["render", ql]]), Jl = (o) => {
970
+ const Gl = /* @__PURE__ */ P(Nl, [["render", ql]]), Jl = (o) => {
971
971
  if (!o) return "";
972
972
  const e = o?.split(".");
973
973
  return e[e.length - 1];
@@ -997,7 +997,7 @@ function Ql(o, e) {
997
997
  re('<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)
998
998
  ]));
999
999
  }
1000
- const ze = /* @__PURE__ */ R(Zl, [["render", Ql]]), Xl = {}, Yl = {
1000
+ const Ee = /* @__PURE__ */ P(Zl, [["render", Ql]]), Xl = {}, Yl = {
1001
1001
  xmlns: "http://www.w3.org/2000/svg",
1002
1002
  width: "24",
1003
1003
  height: "24",
@@ -1021,9 +1021,9 @@ function eo(o, e) {
1021
1021
  l("path", { d: "M12 4l0 12" }, null, -1)
1022
1022
  ]));
1023
1023
  }
1024
- const at = /* @__PURE__ */ R(Xl, [["render", eo]]), to = { class: "h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file" }, lo = { class: "absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center" }, oo = /* @__PURE__ */ O({
1024
+ const ot = /* @__PURE__ */ P(Xl, [["render", eo]]), to = { class: "h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file" }, lo = { class: "absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center" }, oo = /* @__PURE__ */ E({
1025
1025
  __name: "vs-input-file-list-item",
1026
- props: /* @__PURE__ */ Q({
1026
+ props: /* @__PURE__ */ W({
1027
1027
  format: {},
1028
1028
  multiple: { type: Boolean },
1029
1029
  style: {},
@@ -1041,40 +1041,40 @@ const at = /* @__PURE__ */ R(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
1041
1041
  }),
1042
1042
  emits: ["update:value", "update:item"],
1043
1043
  setup(o) {
1044
- const e = X(o, "value"), t = X(o, "item"), n = o;
1045
- return (s, a) => (i(), u("div", to, [
1046
- (i(), te(_e(J(Kl)(t.value)), {
1044
+ const e = Q(o, "value"), t = Q(o, "item"), r = o;
1045
+ return (s, n) => (i(), u("div", to, [
1046
+ (i(), te(Ve(G(Kl)(t.value)), {
1047
1047
  src: t.value,
1048
1048
  alt: "file",
1049
1049
  class: "w-full h-full object-cover cursor-pointer",
1050
- onClick: a[0] || (a[0] = (r) => J(Ze)(t.value))
1050
+ onClick: n[0] || (n[0] = (a) => G(Ke)(t.value))
1051
1051
  }, null, 8, ["src"])),
1052
1052
  l("div", lo, [
1053
1053
  l("button", {
1054
1054
  type: "button",
1055
- onClick: a[1] || (a[1] = (r) => {
1056
- J(_l)(t.value), e.value = n.multiple ? e.value?.filter((d) => d !== t.value) : "";
1055
+ onClick: n[1] || (n[1] = (a) => {
1056
+ G(_l)(t.value), e.value = r.multiple ? e.value?.filter((d) => d !== t.value) : "";
1057
1057
  }),
1058
1058
  class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"
1059
1059
  }, [
1060
- B(ze, { class: "w-4 h-4" })
1060
+ I(Ee, { class: "w-4 h-4" })
1061
1061
  ]),
1062
1062
  l("button", {
1063
1063
  type: "button",
1064
- onClick: a[2] || (a[2] = (r) => J(Ze)(t.value)),
1064
+ onClick: n[2] || (n[2] = (a) => G(Ke)(t.value)),
1065
1065
  class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"
1066
1066
  }, [
1067
- B(at, { class: "w-4 h-4" })
1067
+ I(ot, { class: "w-4 h-4" })
1068
1068
  ])
1069
1069
  ])
1070
1070
  ]));
1071
1071
  }
1072
- }), We = /* @__PURE__ */ R(oo, [["__scopeId", "data-v-0ca886b3"]]), ao = { class: "flex items-center gap-x-2" }, so = {
1072
+ }), Ze = /* @__PURE__ */ P(oo, [["__scopeId", "data-v-0ca886b3"]]), ao = { class: "flex items-center gap-x-2" }, so = {
1073
1073
  key: 1,
1074
1074
  class: "flex items-center flex-wrap gap-2"
1075
- }, ro = /* @__PURE__ */ O({
1075
+ }, ro = /* @__PURE__ */ E({
1076
1076
  __name: "vs-input-file",
1077
- props: /* @__PURE__ */ Q({
1077
+ props: /* @__PURE__ */ W({
1078
1078
  format: {},
1079
1079
  multiple: { type: Boolean },
1080
1080
  style: {},
@@ -1090,65 +1090,65 @@ const at = /* @__PURE__ */ R(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
1090
1090
  }),
1091
1091
  emits: ["update:modelValue"],
1092
1092
  setup(o) {
1093
- const e = o, t = X(o, "modelValue"), n = x(null), s = (r) => Array.isArray(t.value) && t.value[r] || "", a = async (r) => {
1093
+ const e = o, t = Q(o, "modelValue"), r = x(null), s = (a) => Array.isArray(t.value) && t.value[a] || "", n = async (a) => {
1094
1094
  if (e.format) {
1095
- const f = r.target.files?.[0];
1095
+ const f = a.target.files?.[0];
1096
1096
  if (!f || !f.name.endsWith(e.format))
1097
1097
  return;
1098
1098
  }
1099
- const d = r.target.files?.[0];
1099
+ const d = a.target.files?.[0];
1100
1100
  if (!d) return;
1101
1101
  const p = await kl(d, "1", "form", "table");
1102
1102
  t.value = e.multiple ? [...t.value || [], p?.file_path] : p?.file_path;
1103
1103
  };
1104
- return (r, d) => (i(), u("div", ao, [
1104
+ return (a, d) => (i(), u("div", ao, [
1105
1105
  l("input", {
1106
1106
  class: "hidden",
1107
1107
  ref_key: "fileInput",
1108
- ref: n,
1108
+ ref: r,
1109
1109
  type: "file",
1110
- onChange: a
1110
+ onChange: n
1111
1111
  }, null, 544),
1112
- !r.multiple && t.value ? (i(), te(We, {
1112
+ !a.multiple && t.value ? (i(), te(Ze, {
1113
1113
  key: 0,
1114
1114
  item: t.value,
1115
1115
  "onUpdate:item": d[0] || (d[0] = (p) => t.value = p),
1116
1116
  value: t.value,
1117
1117
  "onUpdate:value": d[1] || (d[1] = (p) => t.value = p)
1118
- }, null, 8, ["item", "value"])) : r.multiple ? (i(), u("div", so, [
1119
- (i(!0), u(ee, null, le(t.value, (p, f) => (i(), te(We, {
1120
- multiple: r.multiple,
1118
+ }, null, 8, ["item", "value"])) : a.multiple ? (i(), u("div", so, [
1119
+ (i(!0), u(ee, null, le(t.value, (p, f) => (i(), te(Ze, {
1120
+ multiple: a.multiple,
1121
1121
  key: f,
1122
1122
  value: t.value,
1123
1123
  "onUpdate:value": d[2] || (d[2] = (c) => t.value = c),
1124
1124
  item: s(f)
1125
1125
  }, null, 8, ["multiple", "value", "item"]))), 128)),
1126
1126
  l("div", {
1127
- onClick: d[3] || (d[3] = (p) => !r.disabled && n.value?.click()),
1128
- class: V([
1127
+ onClick: d[3] || (d[3] = (p) => !a.disabled && r.value?.click()),
1128
+ class: M([
1129
1129
  "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",
1130
- r.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
1130
+ a.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
1131
1131
  ])
1132
1132
  }, [
1133
- B(je, { class: "w-6 h-6" })
1133
+ I(Ae, { class: "w-6 h-6" })
1134
1134
  ], 2)
1135
- ])) : j("", !0),
1136
- r.multiple ? j("", !0) : (i(), u("div", {
1135
+ ])) : z("", !0),
1136
+ a.multiple ? z("", !0) : (i(), u("div", {
1137
1137
  key: 2,
1138
- onClick: d[4] || (d[4] = (p) => n.value?.click()),
1139
- class: V([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"])
1138
+ onClick: d[4] || (d[4] = (p) => r.value?.click()),
1139
+ class: M([a.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"])
1140
1140
  }, [
1141
- B(je, { class: "w-6 h-6" })
1141
+ I(Ae, { class: "w-6 h-6" })
1142
1142
  ], 2))
1143
1143
  ]));
1144
1144
  }
1145
- }), no = { class: "max-w-[55vw]" }, io = { class: "text-sm font-semibold text-gray-800 truncate dark:text-neutral-200" }, uo = { class: "flex items-center text-xs text-gray-500 truncate dark:text-neutral-500" }, co = { class: "px-[5px]" }, po = { class: "" }, Se = /* @__PURE__ */ O({
1145
+ }), no = { class: "max-w-[55vw]" }, io = { class: "text-sm font-semibold text-gray-800 truncate dark:text-neutral-200" }, uo = { class: "flex items-center text-xs text-gray-500 truncate dark:text-neutral-500" }, co = { class: "px-[5px]" }, po = { class: "" }, Ie = /* @__PURE__ */ E({
1146
1146
  __name: "vs-widget-file-info",
1147
1147
  props: {
1148
1148
  item: { default: null }
1149
1149
  },
1150
1150
  setup(o) {
1151
- const e = o, t = D(() => {
1151
+ const e = o, t = T(() => {
1152
1152
  try {
1153
1153
  return new Date(e.item.cdate).toLocaleDateString("uk-UA", {
1154
1154
  day: "2-digit",
@@ -1159,24 +1159,24 @@ const at = /* @__PURE__ */ R(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
1159
1159
  return "";
1160
1160
  }
1161
1161
  });
1162
- function n(s) {
1162
+ function r(s) {
1163
1163
  if (s < 1024)
1164
1164
  return `${s} B`;
1165
- const a = s / 1024;
1166
- return a < 1024 ? `${a.toFixed(2)} KB` : `${(a / 1024).toFixed(2)} MB`;
1165
+ const n = s / 1024;
1166
+ return n < 1024 ? `${n.toFixed(2)} KB` : `${(n / 1024).toFixed(2)} MB`;
1167
1167
  }
1168
- return (s, a) => (i(), u(ee, null, [
1169
- a[1] || (a[1] = re('<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)),
1168
+ return (s, n) => (i(), u(ee, null, [
1169
+ n[1] || (n[1] = re('<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)),
1170
1170
  l("div", no, [
1171
1171
  l("p", io, F(s.item?.uploaded_name), 1),
1172
1172
  l("p", uo, [
1173
1173
  l("span", null, F(s.item?.username), 1),
1174
- K(l("span", co, "|", 512), [
1175
- [Ue, s.item?.username]
1174
+ X(l("span", co, "|", 512), [
1175
+ [Pe, s.item?.username]
1176
1176
  ]),
1177
1177
  l("span", null, F(t.value), 1),
1178
- a[0] || (a[0] = l("span", { class: "px-[5px]" }, "|", -1)),
1179
- l("span", po, F(n(s.item?.size)), 1)
1178
+ n[0] || (n[0] = l("span", { class: "px-[5px]" }, "|", -1)),
1179
+ l("span", po, F(r(s.item?.size)), 1)
1180
1180
  ])
1181
1181
  ])
1182
1182
  ], 64));
@@ -1193,7 +1193,7 @@ const at = /* @__PURE__ */ R(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
1193
1193
  }, go = ["href"], bo = {
1194
1194
  key: 3,
1195
1195
  class: "flex gap-x-3 w-full items-center"
1196
- }, yo = { class: "lg:absolute lg:top-3 lg:end-1 opacity-100" }, xo = { class: "p-0.5 sm:p-1 inline-flex items-center gap-0.5 bg-white rounded-lg dark:bg-neutral-800 dark:border-neutral-700" }, wo = { class: "inline-block" }, ko = { class: "inline-block" }, _o = /* @__PURE__ */ O({
1196
+ }, yo = { class: "lg:absolute lg:top-3 lg:end-1 opacity-100" }, xo = { class: "p-0.5 sm:p-1 inline-flex items-center gap-0.5 bg-white rounded-lg dark:bg-neutral-800 dark:border-neutral-700" }, wo = { class: "inline-block" }, ko = { class: "inline-block" }, _o = /* @__PURE__ */ E({
1197
1197
  __name: "vs-widget-file-item",
1198
1198
  props: {
1199
1199
  item: { default: null },
@@ -1202,28 +1202,28 @@ const at = /* @__PURE__ */ R(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
1202
1202
  },
1203
1203
  emits: ["update", "openModal", "openLightbox"],
1204
1204
  setup(o, { emit: e }) {
1205
- const t = o, n = e;
1205
+ const t = o, r = e;
1206
1206
  function s(c) {
1207
1207
  return ["pdf", "json"].includes(c.ext);
1208
1208
  }
1209
- function a(c) {
1209
+ function n(c) {
1210
1210
  return ["ppt", "pptx", "doc", "docx", "xls", "xlsx"].includes(c.ext);
1211
1211
  }
1212
- function r(c) {
1213
- const g = document.createElement("a");
1214
- g.setAttribute("download", c?.uploaded_name), g.href = c?.file_path, g.click();
1212
+ function a(c) {
1213
+ const b = document.createElement("a");
1214
+ b.setAttribute("download", c?.uploaded_name), b.href = c?.file_path, b.click();
1215
1215
  }
1216
1216
  async function d() {
1217
1217
  try {
1218
1218
  await fetch(
1219
1219
  `${t.prefix}/widget/file/${t.item.entity_id}/${t.item.file_id}`
1220
- ), n("update");
1220
+ ), r("update");
1221
1221
  } catch (c) {
1222
1222
  console.error(c);
1223
1223
  }
1224
1224
  }
1225
1225
  function p() {
1226
- n("openModal", {
1226
+ r("openModal", {
1227
1227
  title: "Ви впевнені?",
1228
1228
  message: "Ви впевнені, що хочете видалити цей файл?",
1229
1229
  confirmButtonText: "Так, я впевнена/ий",
@@ -1233,50 +1233,50 @@ const at = /* @__PURE__ */ R(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
1233
1233
  });
1234
1234
  }
1235
1235
  function f(c) {
1236
- (t.item.ext === "jpg" || t.item.ext === "png") && n("openLightbox", { item: t.item, index: c });
1236
+ (t.item.ext === "jpg" || t.item.ext === "png") && r("openLightbox", { item: t.item, index: c });
1237
1237
  }
1238
- return (c, g) => (i(), u("div", fo, [
1238
+ return (c, b) => (i(), u("div", fo, [
1239
1239
  c.item.ext === "jpg" || c.item.ext === "png" ? (i(), u("div", vo, [
1240
1240
  l("div", {
1241
1241
  class: "max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",
1242
- onClick: g[0] || (g[0] = (v) => f(c.index))
1242
+ onClick: b[0] || (b[0] = (v) => f(c.index))
1243
1243
  }, [
1244
- B(Se, { item: c.item }, null, 8, ["item"])
1244
+ I(Ie, { item: c.item }, null, 8, ["item"])
1245
1245
  ])
1246
1246
  ])) : s(c.item) ? (i(), u("div", mo, [
1247
- B(Se, { item: c.item }, null, 8, ["item"])
1248
- ])) : a(c.item) ? (i(), u("div", ho, [
1247
+ I(Ie, { item: c.item }, null, 8, ["item"])
1248
+ ])) : n(c.item) ? (i(), u("div", ho, [
1249
1249
  l("a", {
1250
1250
  href: `/api/file-preview?id=${c.item.file_id}`,
1251
1251
  target: "_blank",
1252
1252
  class: "flex gap-x-3 w-full items-center"
1253
1253
  }, [
1254
- B(Se, { item: c.item }, null, 8, ["item"])
1254
+ I(Ie, { item: c.item }, null, 8, ["item"])
1255
1255
  ], 8, go)
1256
1256
  ])) : (i(), u("div", bo, [
1257
- B(Se, { item: c.item }, null, 8, ["item"])
1257
+ I(Ie, { item: c.item }, null, 8, ["item"])
1258
1258
  ])),
1259
1259
  l("div", yo, [
1260
1260
  l("div", xo, [
1261
1261
  l("div", wo, [
1262
1262
  l("button", {
1263
1263
  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",
1264
- onClick: g[1] || (g[1] = (v) => r(c.item))
1264
+ onClick: b[1] || (b[1] = (v) => a(c.item))
1265
1265
  }, [
1266
- B(at, {
1266
+ I(ot, {
1267
1267
  height: "14",
1268
1268
  width: "14"
1269
1269
  })
1270
1270
  ])
1271
1271
  ]),
1272
- g[3] || (g[3] = l("div", { class: "w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700" }, null, -1)),
1272
+ b[3] || (b[3] = l("div", { class: "w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700" }, null, -1)),
1273
1273
  l("div", ko, [
1274
1274
  l("button", {
1275
1275
  type: "button",
1276
1276
  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",
1277
- onClick: g[2] || (g[2] = (v) => p())
1277
+ onClick: b[2] || (b[2] = (v) => p())
1278
1278
  }, [
1279
- B(ze, {
1279
+ I(Ee, {
1280
1280
  height: "14",
1281
1281
  width: "14"
1282
1282
  })
@@ -1310,13 +1310,13 @@ function Vo(o, e) {
1310
1310
  l("path", { d: "M12 4l0 12" }, null, -1)
1311
1311
  ]));
1312
1312
  }
1313
- const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full" }, So = { class: "flex w-full mb-[12px] items-center gap-x-2" }, Bo = { class: "font-semibold text-gray-800 dark:text-neutral-200 text-[14px]" }, jo = { class1: "ml-auto" }, Io = { class: "py-1.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 cursor-pointer hover:bg-gray-200 text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700" }, zo = {
1313
+ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full" }, So = { class: "flex w-full mb-[12px] items-center gap-x-2" }, Bo = { class: "font-semibold text-gray-800 dark:text-neutral-200 text-[14px]" }, jo = { class1: "ml-auto" }, Io = { class: "py-1.5 px-4 inline-flex items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 cursor-pointer hover:bg-gray-200 text-gray-800 shadow-2xs hover:bg-gray-50 focus:outline-hidden focus:bg-gray-50 disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-800 dark:border-neutral-700 dark:text-white dark:hover:bg-neutral-700 dark:focus:bg-neutral-700" }, zo = {
1314
1314
  key: 0,
1315
1315
  class: "py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"
1316
1316
  }, Ao = { class: "relative" }, Oo = {
1317
1317
  key: 1,
1318
1318
  class: "space-y-3 max-h-[300px] overflow-y-auto [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500"
1319
- }, Eo = { key: 0 }, Fo = /* @__PURE__ */ O({
1319
+ }, Eo = { key: 0 }, Fo = /* @__PURE__ */ E({
1320
1320
  __name: "vs-input-file-list",
1321
1321
  props: {
1322
1322
  id: { default: "" },
@@ -1331,45 +1331,45 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
1331
1331
  },
1332
1332
  emits: ["update"],
1333
1333
  setup(o, { emit: e }) {
1334
- const t = o, n = Be("form"), s = D(() => n.value.formId), a = x(!1), r = x(0), d = e, p = x(!1), f = x({}), c = x([]), g = x(""), v = D(() => Array.isArray(c.value) ? c.value.filter((b) => b.ext === "jpg" || b.ext === "png").map((b) => b?.file_path) : []), C = D(() => g.value === "" ? c.value : c.value.filter((b) => b?.uploaded_name?.includes(g.value))), z = (b) => {
1335
- const h = v.value.findIndex((Z) => Z === b.item.file_path);
1336
- h !== -1 && (a.value = !0, r.value = h);
1337
- }, U = async () => {
1334
+ const t = o, r = ze("form"), s = T(() => r.value.formId), n = x(!1), a = x(0), d = e, p = x(!1), f = x({}), c = x([]), b = x(""), v = T(() => Array.isArray(c.value) ? c.value.filter((h) => h.ext === "jpg" || h.ext === "png").map((h) => h?.file_path) : []), C = T(() => b.value === "" ? c.value : c.value.filter((h) => h?.uploaded_name?.includes(b.value))), V = (h) => {
1335
+ const g = v.value.findIndex((K) => K === h.item.file_path);
1336
+ g !== -1 && (n.value = !0, a.value = g);
1337
+ }, D = async () => {
1338
1338
  try {
1339
- const b = await fetch(`${t.prefix}/widget/file/${s.value}`).then((h) => h.json());
1340
- c.value = b?.rows;
1341
- } catch (b) {
1342
- console.error(b);
1339
+ const h = await fetch(`${t.prefix}/widget/file/${s.value}`).then((g) => g.json());
1340
+ c.value = h?.rows;
1341
+ } catch (h) {
1342
+ console.error(h);
1343
1343
  }
1344
- }, T = async (b) => {
1344
+ }, U = async (h) => {
1345
1345
  await Promise.all(
1346
- Array.from(b.target.files).map(async (h) => {
1347
- const Z = new FormData();
1348
- Z.append("file", h);
1346
+ Array.from(h.target.files).map(async (g) => {
1347
+ const K = new FormData();
1348
+ K.append("file", g);
1349
1349
  try {
1350
- const P = `${t.prefix}/widget/file/${s.value}`;
1351
- return await fetch(P, { method: "POST", body: Z }), d("update", "file-list"), h;
1352
- } catch (P) {
1353
- return console.error(P), null;
1350
+ const A = `${t.prefix}/widget/file/${s.value}`;
1351
+ return await fetch(A, { method: "POST", body: K }), d("update", "file-list"), g;
1352
+ } catch (A) {
1353
+ return console.error(A), null;
1354
1354
  }
1355
1355
  })
1356
- ), await U();
1357
- }, N = (b) => {
1358
- const h = { ...b };
1359
- return b.cancel || (h.cancel = () => {
1356
+ ), await D();
1357
+ }, N = (h) => {
1358
+ const g = { ...h };
1359
+ return h.cancel || (g.cancel = () => {
1360
1360
  p.value = !1;
1361
- }), b.updateListOnConfirm && (h.confirm = async () => {
1362
- await b.confirm(), p.value = !1, U();
1363
- }), h;
1364
- }, _ = (b) => {
1365
- f.value = N(b), p.value = !0;
1361
+ }), h.updateListOnConfirm && (g.confirm = async () => {
1362
+ await h.confirm(), p.value = !1, D();
1363
+ }), g;
1364
+ }, $ = (h) => {
1365
+ f.value = N(h), p.value = !0;
1366
1366
  };
1367
- return ie(s, (b) => {
1368
- b && U();
1369
- }), ue(() => {
1370
- s.value && U();
1371
- }), (b, h) => {
1372
- const Z = Ne("Lightbox"), P = Ne("MessageBox");
1367
+ return ue(s, (h) => {
1368
+ h && D();
1369
+ }), pe(() => {
1370
+ s.value && D();
1371
+ }), (h, g) => {
1372
+ const K = Ne("Lightbox"), A = Ne("MessageBox");
1373
1373
  return i(), u("div", Lo, [
1374
1374
  l("div", So, [
1375
1375
  l("h2", Bo, " Файлів: " + F(c.value?.length), 1),
@@ -1378,10 +1378,10 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
1378
1378
  l("input", {
1379
1379
  type: "file",
1380
1380
  class: "hidden",
1381
- onChange: h[0] || (h[0] = (M) => T(M))
1381
+ onChange: g[0] || (g[0] = (S) => U(S))
1382
1382
  }, null, 32),
1383
1383
  l("div", Io, [
1384
- B(Mo, {
1384
+ I(Mo, {
1385
1385
  height: "16",
1386
1386
  width: "16"
1387
1387
  })
@@ -1392,7 +1392,7 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
1392
1392
  c.value?.length > 4 ? (i(), u("div", zo, [
1393
1393
  l("div", null, [
1394
1394
  l("div", Ao, [
1395
- h[8] || (h[8] = l("div", { class: "absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5" }, [
1395
+ g[8] || (g[8] = l("div", { class: "absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5" }, [
1396
1396
  l("svg", {
1397
1397
  class: "flex-shrink-0 text-gray-500 size-4 dark:text-neutral-400",
1398
1398
  xmlns: "http://www.w3.org/2000/svg",
@@ -1413,52 +1413,52 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
1413
1413
  l("path", { d: "m21 21-4.3-4.3" })
1414
1414
  ])
1415
1415
  ], -1)),
1416
- K(l("input", {
1416
+ X(l("input", {
1417
1417
  type: "text",
1418
- "onUpdate:modelValue": h[1] || (h[1] = (M) => g.value = M),
1418
+ "onUpdate:modelValue": g[1] || (g[1] = (S) => b.value = S),
1419
1419
  class: "py-2 px-3 ps-10 pe-16 block w-full bg-gray-200 xl:bg-gray-100 rounded-lg text-sm focus:border-blue-500 h-[40px] focus:border-2 focus:outline-none disabled:opacity-50 disabled:pointer-events-none dark:bg-neutral-700 dark:border-transparent dark:text-neutral-400 dark:placeholder:text-neutral-400 dark:focus:ring-neutral-600",
1420
1420
  placeholder: "Введіть назву файлу"
1421
1421
  }, null, 512), [
1422
1422
  [
1423
- de,
1424
- g.value,
1423
+ fe,
1424
+ b.value,
1425
1425
  void 0,
1426
1426
  { trim: !0 }
1427
1427
  ]
1428
1428
  ])
1429
1429
  ])
1430
1430
  ])
1431
- ])) : j("", !0),
1431
+ ])) : z("", !0),
1432
1432
  c.value?.length ? (i(), u("div", Oo, [
1433
- (i(!0), u(ee, null, le(C.value, (M, H) => (i(), te(_o, {
1434
- key: H,
1435
- prefix: b.prefix,
1436
- item: M,
1437
- index: H,
1438
- onUpdate: h[2] || (h[2] = (Y) => b.$emit("update", "file-list")),
1439
- onOpenModal: h[3] || (h[3] = (Y) => _(Y)),
1440
- onOpenLightbox: h[4] || (h[4] = (Y) => z(Y))
1433
+ (i(!0), u(ee, null, le(C.value, (S, J) => (i(), te(_o, {
1434
+ key: J,
1435
+ prefix: h.prefix,
1436
+ item: S,
1437
+ index: J,
1438
+ onUpdate: g[2] || (g[2] = (Y) => h.$emit("update", "file-list")),
1439
+ onOpenModal: g[3] || (g[3] = (Y) => $(Y)),
1440
+ onOpenLightbox: g[4] || (g[4] = (Y) => V(Y))
1441
1441
  }, null, 8, ["prefix", "item", "index"]))), 128)),
1442
- C.value.length ? j("", !0) : (i(), u("div", Eo, h[9] || (h[9] = [
1442
+ C.value.length ? z("", !0) : (i(), u("div", Eo, g[9] || (g[9] = [
1443
1443
  l("p", { class: "text-sm text-gray-600 font-sm" }, " Файлів з такою назвою не існує, введіть інше пошукове слово ", -1)
1444
1444
  ])))
1445
- ])) : j("", !0),
1446
- B(Z, {
1447
- modelValue: a.value,
1448
- "onUpdate:modelValue": h[5] || (h[5] = (M) => a.value = M),
1449
- startIndex: r.value,
1450
- "onUpdate:index": h[6] || (h[6] = (M) => r.value = M),
1445
+ ])) : z("", !0),
1446
+ I(K, {
1447
+ modelValue: n.value,
1448
+ "onUpdate:modelValue": g[5] || (g[5] = (S) => n.value = S),
1449
+ startIndex: a.value,
1450
+ "onUpdate:index": g[6] || (g[6] = (S) => a.value = S),
1451
1451
  images: v.value
1452
1452
  }, null, 8, ["modelValue", "startIndex", "images"]),
1453
- B(P, Le({
1453
+ I(A, je({
1454
1454
  modelValue: p.value,
1455
- "onUpdate:modelValue": h[7] || (h[7] = (M) => p.value = M),
1455
+ "onUpdate:modelValue": g[7] || (g[7] = (S) => p.value = S),
1456
1456
  onConfirm: f.value.confirm
1457
1457
  }, f.value), null, 16, ["modelValue", "onConfirm"])
1458
1458
  ]);
1459
1459
  };
1460
1460
  }
1461
- }), Do = { class: "flex items-center justify-between" }, Uo = { class: "text-[16px] text-gray-900 font-medium" }, To = { class: "grid gap-3" }, Ro = /* @__PURE__ */ O({
1461
+ }), Do = { class: "flex items-center justify-between" }, Uo = { class: "text-[16px] text-gray-900 font-medium" }, To = { class: "grid gap-3" }, Ro = /* @__PURE__ */ E({
1462
1462
  __name: "vs-container-switcher",
1463
1463
  props: {
1464
1464
  title: {
@@ -1476,33 +1476,33 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
1476
1476
  },
1477
1477
  setup(o) {
1478
1478
  const e = o, t = x(e.isOpen);
1479
- return ie(
1479
+ return ue(
1480
1480
  () => e.isOpen,
1481
- (n) => {
1482
- t.value = n;
1481
+ (r) => {
1482
+ t.value = r;
1483
1483
  }
1484
- ), (n, s) => (i(), u("div", null, [
1484
+ ), (r, s) => (i(), u("div", null, [
1485
1485
  l("div", Do, [
1486
1486
  l("p", Uo, F(o.title), 1),
1487
- B(ot, {
1487
+ I(lt, {
1488
1488
  modelValue: t.value,
1489
- "onUpdate:modelValue": s[0] || (s[0] = (a) => t.value = a),
1490
- style: he(o.style)
1489
+ "onUpdate:modelValue": s[0] || (s[0] = (n) => t.value = n),
1490
+ style: we(o.style)
1491
1491
  }, null, 8, ["modelValue", "style"])
1492
1492
  ]),
1493
- B(tt, { name: "slide-fade" }, {
1494
- default: $e(() => [
1495
- K(l("div", To, [
1496
- ge(n.$slots, "default", {}, void 0, !0)
1493
+ I(et, { name: "slide-fade" }, {
1494
+ default: Me(() => [
1495
+ X(l("div", To, [
1496
+ ke(r.$slots, "default", {}, void 0, !0)
1497
1497
  ], 512), [
1498
- [Ue, t.value]
1498
+ [Pe, t.value]
1499
1499
  ])
1500
1500
  ]),
1501
1501
  _: 3
1502
1502
  })
1503
1503
  ]));
1504
1504
  }
1505
- }), Po = /* @__PURE__ */ R(Ro, [["__scopeId", "data-v-90320b87"]]), No = { class: "text-[16px] text-gray-900 font-medium" }, Ho = { class: "grid gap-3" }, qo = /* @__PURE__ */ O({
1505
+ }), Po = /* @__PURE__ */ P(Ro, [["__scopeId", "data-v-90320b87"]]), No = { class: "text-[16px] text-gray-900 font-medium" }, Ho = { class: "grid gap-3" }, qo = /* @__PURE__ */ E({
1506
1506
  __name: "vs-container-accordion",
1507
1507
  props: {
1508
1508
  title: {
@@ -1520,35 +1520,35 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
1520
1520
  },
1521
1521
  setup(o) {
1522
1522
  const e = o, t = x(e.isOpen);
1523
- return ie(
1523
+ return ue(
1524
1524
  () => e.isOpen,
1525
- (n) => {
1526
- t.value = n;
1525
+ (r) => {
1526
+ t.value = r;
1527
1527
  }
1528
- ), (n, s) => (i(), u("div", null, [
1528
+ ), (r, s) => (i(), u("div", null, [
1529
1529
  l("button", {
1530
1530
  type: "button",
1531
- onClick: s[0] || (s[0] = (a) => t.value = !t.value),
1531
+ onClick: s[0] || (s[0] = (n) => t.value = !t.value),
1532
1532
  class: "flex items-center gap-2"
1533
1533
  }, [
1534
- B(J(Wt), {
1535
- class: V(["h-4 w-4 duration-300", [t.value ? "-rotate-180" : ""]])
1534
+ I(G(Wt), {
1535
+ class: M(["h-4 w-4 duration-300", [t.value ? "-rotate-180" : ""]])
1536
1536
  }, null, 8, ["class"]),
1537
1537
  l("span", No, F(o.title), 1)
1538
1538
  ]),
1539
- B(tt, { name: "slide-fade" }, {
1540
- default: $e(() => [
1541
- K(l("div", Ho, [
1542
- ge(n.$slots, "default", {}, void 0, !0)
1539
+ I(et, { name: "slide-fade" }, {
1540
+ default: Me(() => [
1541
+ X(l("div", Ho, [
1542
+ ke(r.$slots, "default", {}, void 0, !0)
1543
1543
  ], 512), [
1544
- [Ue, t.value]
1544
+ [Pe, t.value]
1545
1545
  ])
1546
1546
  ]),
1547
1547
  _: 3
1548
1548
  })
1549
1549
  ]));
1550
1550
  }
1551
- }), Go = /* @__PURE__ */ R(qo, [["__scopeId", "data-v-590eff11"]]), Jo = { class: "flex items-center justify-between" }, Ko = /* @__PURE__ */ O({
1551
+ }), Go = /* @__PURE__ */ P(qo, [["__scopeId", "data-v-590eff11"]]), Jo = { class: "flex items-center justify-between" }, Ko = /* @__PURE__ */ E({
1552
1552
  __name: "vs-container-default",
1553
1553
  props: {
1554
1554
  title: {
@@ -1565,14 +1565,14 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
1565
1565
  l("div", Jo, [
1566
1566
  l("p", null, F(o.title), 1)
1567
1567
  ]),
1568
- ge(e.$slots, "default")
1568
+ ke(e.$slots, "default")
1569
1569
  ]));
1570
1570
  }
1571
1571
  }), Zo = {
1572
1572
  switcher: Po,
1573
1573
  accordion: Go,
1574
1574
  default: Ko
1575
- }, ae = {
1575
+ }, se = {
1576
1576
  Equal: "==",
1577
1577
  Inequal: "!=",
1578
1578
  Higer: ">",
@@ -1585,37 +1585,37 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
1585
1585
  Contain: "*",
1586
1586
  In: "in",
1587
1587
  NotIn: "not_in"
1588
- }, Wo = (o, e) => String(o) === String(e), Qo = (o, e) => String(o) !== String(e), Xo = (o, e) => o > e, Yo = (o, e) => o >= e, ea = (o, e) => o < e, ta = (o, e) => o <= e, la = (o, e) => Array.isArray(e) && e.length === 2 ? o >= e[0] && o <= e[1] : !1, oa = (o, e) => String(o).startsWith(String(e)), aa = (o, e) => String(o).endsWith(String(e)), sa = (o, e) => String(o).includes(String(e)), ra = (o, e) => Array.isArray(e) ? e.includes(o) : !1, na = (o, e) => Array.isArray(e) ? !e.includes(o) : !0, st = (o, e) => {
1588
+ }, Wo = (o, e) => String(o) === String(e), Qo = (o, e) => String(o) !== String(e), Xo = (o, e) => o > e, Yo = (o, e) => o >= e, ea = (o, e) => o < e, ta = (o, e) => o <= e, la = (o, e) => Array.isArray(e) && e.length === 2 ? o >= e[0] && o <= e[1] : !1, oa = (o, e) => String(o).startsWith(String(e)), aa = (o, e) => String(o).endsWith(String(e)), sa = (o, e) => String(o).includes(String(e)), ra = (o, e) => Array.isArray(e) ? e.includes(o) : !1, na = (o, e) => Array.isArray(e) ? !e.includes(o) : !0, at = (o, e) => {
1589
1589
  if (!e) return !0;
1590
1590
  switch (e?.[1]) {
1591
- case ae.Equal:
1591
+ case se.Equal:
1592
1592
  return Wo(o, e?.[2]);
1593
- case ae.Inequal:
1593
+ case se.Inequal:
1594
1594
  return Qo(o, e?.[2]);
1595
- case ae.Higer:
1595
+ case se.Higer:
1596
1596
  return Xo(o, e?.[2]);
1597
- case ae.HigerOrEqual:
1597
+ case se.HigerOrEqual:
1598
1598
  return Yo(o, e?.[2]);
1599
- case ae.Lower:
1599
+ case se.Lower:
1600
1600
  return ea(o, e?.[2]);
1601
- case ae.LowerOrEqual:
1601
+ case se.LowerOrEqual:
1602
1602
  return ta(o, e?.[2]);
1603
- case ae.Between:
1603
+ case se.Between:
1604
1604
  return la(o, e?.[2]);
1605
- case ae.StartWith:
1605
+ case se.StartWith:
1606
1606
  return oa(o, e?.[2]);
1607
- case ae.EndWith:
1607
+ case se.EndWith:
1608
1608
  return aa(o, e?.[2]);
1609
- case ae.Contain:
1609
+ case se.Contain:
1610
1610
  return sa(o, e?.[2]);
1611
- case ae.In:
1611
+ case se.In:
1612
1612
  return ra(o, e?.[2]);
1613
- case ae.NotIn:
1613
+ case se.NotIn:
1614
1614
  return na(o, e?.[2]);
1615
1615
  default:
1616
1616
  return !0;
1617
1617
  }
1618
- }, ia = /* @__PURE__ */ O({
1618
+ }, ia = /* @__PURE__ */ E({
1619
1619
  __name: "vs-input-container",
1620
1620
  props: {
1621
1621
  style: {
@@ -1636,32 +1636,32 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
1636
1636
  }
1637
1637
  },
1638
1638
  setup(o) {
1639
- const e = o, t = Be("formValues", { default: {} }), n = Be("form"), s = D(() => e.schema?.filter((r) => {
1640
- const d = r?.conditions;
1639
+ const e = o, t = ze("formValues", { default: {} }), r = ze("form"), s = T(() => e.schema?.filter((a) => {
1640
+ const d = a?.conditions;
1641
1641
  if (!d) return !0;
1642
1642
  const p = Array.isArray(d) ? d[0] : d, f = t?.value?.[p];
1643
- return st(f, d);
1644
- })), a = D(() => Zo[e.view]);
1645
- return (r, d) => o.schema?.length ? (i(), te(_e(a.value), {
1643
+ return at(f, d);
1644
+ })), n = T(() => Zo[e.view]);
1645
+ return (a, d) => o.schema?.length ? (i(), te(Ve(n.value), {
1646
1646
  key: 0,
1647
1647
  title: o.title,
1648
- style: he(o.style)
1648
+ style: we(o.style)
1649
1649
  }, {
1650
- default: $e(() => [
1651
- (i(!0), u(ee, null, le(s.value, (p) => (i(), te(rt, Le({
1650
+ default: Me(() => [
1651
+ (i(!0), u(ee, null, le(s.value, (p) => (i(), te(st, je({
1652
1652
  key: p.name
1653
1653
  }, { ref_for: !0 }, p, {
1654
1654
  item: p,
1655
- modelValue: J(t)[p.name],
1656
- "onUpdate:modelValue": (f) => J(t)[p.name] = f,
1655
+ modelValue: G(t)[p.name],
1656
+ "onUpdate:modelValue": (f) => G(t)[p.name] = f,
1657
1657
  style: o.style,
1658
- error: J(n)?.errors?.[p.name]
1658
+ error: G(r)?.errors?.[p.name]
1659
1659
  }), null, 16, ["item", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
1660
1660
  ]),
1661
1661
  _: 1
1662
- }, 8, ["title", "style"])) : j("", !0);
1662
+ }, 8, ["title", "style"])) : z("", !0);
1663
1663
  }
1664
- }), ua = { class: "relative" }, da = { class: "w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50" }, ca = { class: "m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl lg:w-7/12 w-11/12" }, pa = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, fa = { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, va = { class: "p-4 mim-h-0 h-full overflow-auto" }, ma = /* @__PURE__ */ O({
1664
+ }), ua = { class: "relative" }, da = { class: "w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50" }, ca = { class: "m-[10px] fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 min-h-0 h-fit max-h-[80vh] overflow-hidden opacity-1 flex flex-col bg-white dark:bg-[#1A1A1A] border dark:border-[#454545] pointer-events-auto shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-xl lg:w-7/12 w-11/12" }, pa = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, fa = { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, va = { class: "p-4 mim-h-0 h-full overflow-auto" }, ma = /* @__PURE__ */ E({
1665
1665
  __name: "modal-edit",
1666
1666
  props: {
1667
1667
  schema: {},
@@ -1672,11 +1672,11 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
1672
1672
  },
1673
1673
  emits: ["close", "save", "edit"],
1674
1674
  setup(o, { emit: e }) {
1675
- const t = o, n = e, s = x(t.schema), a = x(t.defaultValue ? JSON.parse(JSON.stringify(t.defaultValue)) : {}), r = x({}), d = x(), p = x(t.mode);
1675
+ const t = o, r = e, s = x(t.schema), n = x(t.defaultValue ? JSON.parse(JSON.stringify(t.defaultValue)) : {}), a = x({}), d = x(), p = x(t.mode);
1676
1676
  async function f() {
1677
- const g = r.value.validate();
1678
- if (g) {
1679
- pe({ type: "warning", title: "Помилка валідації", message: Object.entries(g).map(([v, C]) => `${v}: ${C}`).join(`
1677
+ const b = a.value.validate();
1678
+ if (b) {
1679
+ me({ type: "warning", title: "Помилка валідації", message: Object.entries(b).map(([v, C]) => `${v}: ${C}`).join(`
1680
1680
  `) });
1681
1681
  return;
1682
1682
  }
@@ -1687,32 +1687,32 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
1687
1687
  headers: {
1688
1688
  "Content-Type": "application/json"
1689
1689
  },
1690
- body: JSON.stringify(a.value)
1690
+ body: JSON.stringify(n.value)
1691
1691
  });
1692
1692
  if (v.ok)
1693
- await v.json(), pe({
1693
+ await v.json(), me({
1694
1694
  type: "success",
1695
1695
  title: "Успішно",
1696
1696
  message: `Дані успішно ${p.value === "add" ? "збережено" : "оновлено"}`
1697
- }), n("save", a.value);
1697
+ }), r("save", n.value);
1698
1698
  else if (v.status === 400) {
1699
1699
  const C = await v.json().catch(() => ({}));
1700
- pe({
1700
+ me({
1701
1701
  type: "warning",
1702
1702
  title: "Помилка валідації",
1703
1703
  message: C.message || "Некоректні дані (400)"
1704
1704
  });
1705
- } else v.status === 500 ? pe({
1705
+ } else v.status === 500 ? me({
1706
1706
  type: "error",
1707
1707
  title: "Серверна помилка",
1708
1708
  message: "Виникла помилка на сервері (500)"
1709
- }) : pe({
1709
+ }) : me({
1710
1710
  type: "error",
1711
1711
  title: "Помилка",
1712
1712
  message: `Статус: ${v.status}`
1713
1713
  });
1714
1714
  } catch (v) {
1715
- pe({
1715
+ me({
1716
1716
  type: "error",
1717
1717
  title: "Помилка з’єднання",
1718
1718
  message: v.message || "Не вдалося виконати запит"
@@ -1720,18 +1720,18 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
1720
1720
  }
1721
1721
  }
1722
1722
  function c() {
1723
- n("close");
1723
+ r("close");
1724
1724
  }
1725
- return ue(async () => {
1725
+ return pe(async () => {
1726
1726
  if (t.form) {
1727
- const g = await fetch(`/api/template/form/${t.form}`).then((v) => v.json());
1728
- s.value = g.schema, d.value = g.token;
1727
+ const b = await fetch(`/api/template/form/${t.form}`).then((v) => v.json());
1728
+ s.value = b.schema, d.value = b.token;
1729
1729
  } else if (t.token) {
1730
1730
  d.value = t.token;
1731
- const g = await fetch(`/api/form/${d.value}`).then((v) => v.json());
1732
- s.value = g.schema, g.data ? a.value = g.data : p.value = "add";
1731
+ const b = await fetch(`/api/form/${d.value}`).then((v) => v.json());
1732
+ s.value = b.schema, b.data ? n.value = b.data : p.value = "add";
1733
1733
  }
1734
- }), (g, v) => (i(), u("div", ua, [
1734
+ }), (b, v) => (i(), u("div", ua, [
1735
1735
  l("div", da, [
1736
1736
  l("div", ca, [
1737
1737
  l("div", pa, [
@@ -1760,14 +1760,14 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
1760
1760
  ]))
1761
1761
  ]),
1762
1762
  l("div", va, [
1763
- s.value ? (i(), te(Ie, {
1763
+ s.value ? (i(), te(Oe, {
1764
1764
  key: 0,
1765
1765
  schema: s.value,
1766
- values: a.value,
1767
- "onUpdate:values": v[0] || (v[0] = (C) => a.value = C),
1768
- form: r.value,
1769
- "onUpdate:form": v[1] || (v[1] = (C) => r.value = C)
1770
- }, null, 8, ["schema", "values", "form"])) : j("", !0)
1766
+ values: n.value,
1767
+ "onUpdate:values": v[0] || (v[0] = (C) => n.value = C),
1768
+ form: a.value,
1769
+ "onUpdate:form": v[1] || (v[1] = (C) => a.value = C)
1770
+ }, null, 8, ["schema", "values", "form"])) : z("", !0)
1771
1771
  ]),
1772
1772
  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" }, [
1773
1773
  l("button", {
@@ -1785,7 +1785,7 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
1785
1785
  ])
1786
1786
  ]));
1787
1787
  }
1788
- }), Oe = (o = { mode: "edit", schema: null }) => new Promise((e) => {
1788
+ }), De = (o = { mode: "edit", schema: null }) => new Promise((e) => {
1789
1789
  const { close: t } = ft({
1790
1790
  title: o.mode === "add" ? "Додати" : "Редагувати",
1791
1791
  template: "",
@@ -1798,12 +1798,12 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
1798
1798
  onClose: () => {
1799
1799
  e(null), t();
1800
1800
  },
1801
- onSave: (n) => {
1802
- e(n), t();
1801
+ onSave: (r) => {
1802
+ e(r), t();
1803
1803
  }
1804
1804
  }
1805
1805
  });
1806
- }), ha = ["aria-expanded", "data-focus"], ga = { class: "flex items-center" }, ba = { class: "truncate text-gray-900 overflow-hidden" }, ya = ["onClick"], xa = ["title"], wa = {
1806
+ }), ha = ["aria-expanded", "data-focus"], ga = { class: "flex items-center" }, ba = ["title"], ya = ["onClick"], xa = ["title"], wa = {
1807
1807
  key: 2,
1808
1808
  class: "text-gray-500 truncate"
1809
1809
  }, ka = { class: "flex-1 min-w-[2px]" }, _a = ["placeholder"], $a = { class: "flex items-center shrink-0" }, Ca = ["disabled"], Va = ["disabled"], Ma = {
@@ -1813,7 +1813,7 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
1813
1813
  }, La = ["aria-disabled", "onClick"], Sa = {
1814
1814
  key: 1,
1815
1815
  class: "px-3 py-2 text-center text-gray-500"
1816
- }, Ba = ["disabled"], ja = /* @__PURE__ */ O({
1816
+ }, Ba = ["disabled"], ja = /* @__PURE__ */ E({
1817
1817
  __name: "vs-input-select",
1818
1818
  props: {
1819
1819
  multiple: { type: Boolean, default: !1 },
@@ -1837,141 +1837,141 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
1837
1837
  },
1838
1838
  emits: ["change", "update:modelValue"],
1839
1839
  setup(o, { emit: e }) {
1840
- const t = o, n = e, s = D(() => t.multiple), a = D(() => t.disabled);
1841
- be(t.style);
1842
- const r = D({
1840
+ const t = o, r = e, s = T(() => t.multiple), n = T(() => t.disabled);
1841
+ _e(t.style);
1842
+ const a = T({
1843
1843
  get: () => t.modelValue,
1844
- set: (w) => n("update:modelValue", w)
1844
+ set: (w) => r("update:modelValue", w)
1845
1845
  });
1846
- !r.value && t.defaultValue && (r.value = t.defaultValue);
1847
- const d = x(null), p = x(null), f = x(null), c = x(!1), g = x(!1), v = x(null), C = x([]), z = x(-1), U = x([]), T = x(""), N = x(null), _ = x([]), b = D(() => {
1848
- if (!_.value.length) return [];
1846
+ !a.value && t.defaultValue && (a.value = t.defaultValue);
1847
+ const d = x(null), p = x(null), f = x(null), c = x(!1), b = x(!1), v = x(null), C = x([]), V = x(-1), D = x([]), U = x(""), N = x(null), $ = x([]), h = T(() => {
1848
+ if (!$.value.length) return [];
1849
1849
  const w = new Map(C.value.map((k) => [k.id?.toString(), k]));
1850
- return _.value.map((k) => w.get(k?.toString())).filter((k) => !!k);
1851
- }), h = D(() => t.placeholder || "Select..."), Z = D(() => s.value ? !_.value.length && T.value === "" : !v.value?.text && T.value === ""), P = D(() => a.value ? !1 : s.value ? _.value.length > 0 : !!r.value), M = (w) => s.value ? _.value.some((k) => k?.toString() === w?.toString()) : r.value?.toString() === w?.toString(), H = D(() => {
1850
+ return $.value.map((k) => w.get(k?.toString())).filter((k) => !!k);
1851
+ }), g = T(() => t.placeholder || "Select..."), K = T(() => s.value ? !$.value.length && U.value === "" : !v.value?.text && U.value === ""), A = T(() => n.value ? !1 : s.value ? $.value.length > 0 : !!a.value), S = (w) => s.value ? $.value.some((k) => k?.toString() === w?.toString()) : a.value?.toString() === w?.toString(), J = T(() => {
1852
1852
  let w = C.value ?? [];
1853
- if (T.value.trim() !== "") {
1854
- const k = T.value.toLowerCase();
1855
- w = w.filter((A) => A.text?.toLowerCase?.().includes(k));
1853
+ if (U.value.trim() !== "") {
1854
+ const k = U.value.toLowerCase();
1855
+ w = w.filter((O) => O.text?.toLowerCase?.().includes(k));
1856
1856
  }
1857
- if (s.value && _.value.length) {
1858
- const k = new Set(_.value.map((A) => A?.toString()));
1859
- w = w.filter((A) => !k.has(A.id?.toString()));
1857
+ if (s.value && $.value.length) {
1858
+ const k = new Set($.value.map((O) => O?.toString()));
1859
+ w = w.filter((O) => !k.has(O.id?.toString()));
1860
1860
  }
1861
1861
  return w;
1862
1862
  }), Y = async (w) => {
1863
1863
  if (!t.data) return [];
1864
1864
  try {
1865
- const k = t.api ? t.api : `/suggest/${t.data}`, A = "?json=1", W = w ? `&val=${encodeURIComponent(w)}` : "";
1866
- return (await fetch(k.concat(A, W)).then((ke) => ke.json())).data ?? [];
1865
+ const k = t.api ? t.api : `/suggest/${t.data}`, O = "?json=1", Z = w ? `&val=${encodeURIComponent(w)}` : "";
1866
+ return (await fetch(k.concat(O, Z)).then((Ce) => Ce.json())).data ?? [];
1867
1867
  } catch {
1868
1868
  return [];
1869
1869
  }
1870
- }, we = async () => {
1871
- t.options?.length ? C.value = [...t.options] : t.data && (C.value = await Y(T.value));
1872
- }, ce = async (w) => {
1870
+ }, ae = async () => {
1871
+ t.options?.length ? C.value = [...t.options] : t.data && (C.value = await Y(U.value));
1872
+ }, $e = async (w) => {
1873
1873
  if (w == null) return null;
1874
- const k = C.value?.find((W) => W?.id?.toString() === String(w));
1874
+ const k = C.value?.find((Z) => Z?.id?.toString() === String(w));
1875
1875
  return k || ((await Y(String(w)))?.[0] ?? null);
1876
- }, Ce = async (w) => {
1877
- const k = new Set(C.value.map((W) => W.id?.toString())), A = w.filter((W) => !k.has(W?.toString()));
1878
- A.length && await A.reduce(async (W, me) => {
1879
- await W;
1880
- const ke = await ce(me);
1881
- ke && C.value.push(ke);
1876
+ }, Le = async (w) => {
1877
+ const k = new Set(C.value.map((Z) => Z.id?.toString())), O = w.filter((Z) => !k.has(Z?.toString()));
1878
+ O.length && await O.reduce(async (Z, xe) => {
1879
+ await Z;
1880
+ const Ce = await $e(xe);
1881
+ Ce && C.value.push(Ce);
1882
1882
  }, Promise.resolve());
1883
- }, I = async () => {
1884
- a.value || (c.value = !0, await we(), await Me(() => {
1885
- N.value?.focus(), H.value.length ? z.value = 0 : z.value = -1;
1883
+ }, B = async () => {
1884
+ n.value || (c.value = !0, await ae(), await Be(() => {
1885
+ N.value?.focus(), J.value.length ? V.value = 0 : V.value = -1;
1886
1886
  }));
1887
- }, $ = () => {
1888
- c.value = !1, z.value = -1;
1889
- }, S = async (w) => {
1890
- if (a.value) return;
1891
- !c.value ? await I() : $();
1887
+ }, _ = () => {
1888
+ c.value = !1, V.value = -1;
1889
+ }, j = async (w) => {
1890
+ if (n.value) return;
1891
+ !c.value ? await B() : _();
1892
1892
  }, q = async () => {
1893
- c.value ? N.value?.focus() : await I();
1894
- }, m = () => {
1895
- s.value ? (_.value = [], r.value = [], n("change", [])) : (v.value = null, r.value = null, n("change", null)), T.value = "", Me(() => N.value?.focus());
1896
- }, y = (w) => {
1897
- s.value && (_.value = _.value.filter((k) => k?.toString() !== w?.toString()), r.value = [..._.value], n("change", r.value), Me(() => N.value?.focus()));
1898
- }, E = (w) => {
1899
- s.value ? (M(w.id) || (_.value = [..._.value, w.id], r.value = [..._.value], n("change", r.value)), T.value = "", Me(() => {
1900
- N.value?.focus(), z.value = Math.min(z.value, H.value.length - 1);
1901
- })) : (v.value = w, r.value = w.id, n("change", r.value), T.value = "", $());
1902
- }, G = (w) => {
1903
- M(w.id) || E(w);
1904
- }, oe = (w, k) => {
1893
+ c.value ? N.value?.focus() : await B();
1894
+ }, oe = () => {
1895
+ s.value ? ($.value = [], a.value = [], r("change", [])) : (v.value = null, a.value = null, r("change", null)), U.value = "", Be(() => N.value?.focus());
1896
+ }, he = (w) => {
1897
+ s.value && ($.value = $.value.filter((k) => k?.toString() !== w?.toString()), a.value = [...$.value], r("change", a.value), Be(() => N.value?.focus()));
1898
+ }, de = (w) => {
1899
+ s.value ? (S(w.id) || ($.value = [...$.value, w.id], a.value = [...$.value], r("change", a.value)), U.value = "", Be(() => {
1900
+ N.value?.focus(), V.value = Math.min(V.value, J.value.length - 1);
1901
+ })) : (v.value = w, a.value = w.id, r("change", a.value), U.value = "", _());
1902
+ }, m = (w) => {
1903
+ S(w.id) || de(w);
1904
+ }, y = (w, k) => {
1905
1905
  if (!w || !k) return;
1906
- const A = w.offsetTop, W = A + w.offsetHeight, me = k.scrollTop, ke = me + k.clientHeight;
1907
- let Ae = k.scrollTop;
1908
- A < me ? Ae = A - 80 : W > ke && (Ae = W - k.clientHeight + 4);
1909
- const ut = k;
1910
- ut.scrollTop = Ae;
1911
- }, Ve = async (w) => {
1912
- a.value || !c.value && (w.key === "ArrowDown" || w.key === "ArrowUp") && (w.preventDefault(), await I());
1913
- }, fe = (w) => {
1906
+ const O = w.offsetTop, Z = O + w.offsetHeight, xe = k.scrollTop, Ce = xe + k.clientHeight;
1907
+ let Fe = k.scrollTop;
1908
+ O < xe ? Fe = O - 80 : Z > Ce && (Fe = Z - k.clientHeight + 4);
1909
+ const it = k;
1910
+ it.scrollTop = Fe;
1911
+ }, R = async (w) => {
1912
+ n.value || !c.value && (w.key === "ArrowDown" || w.key === "ArrowUp") && (w.preventDefault(), await B());
1913
+ }, H = (w) => {
1914
1914
  if (!c.value) return;
1915
1915
  const { key: k } = w;
1916
1916
  if (k === "ArrowDown")
1917
- w.preventDefault(), z.value + 1 < H.value.length && (z.value += 1, oe(U.value[z.value], f.value));
1917
+ w.preventDefault(), V.value + 1 < J.value.length && (V.value += 1, y(D.value[V.value], f.value));
1918
1918
  else if (k === "ArrowUp")
1919
- w.preventDefault(), z.value > 0 && (z.value -= 1, oe(U.value[z.value], f.value));
1919
+ w.preventDefault(), V.value > 0 && (V.value -= 1, y(D.value[V.value], f.value));
1920
1920
  else if (k === "Enter") {
1921
1921
  w.preventDefault();
1922
- const A = H.value[z.value];
1923
- A && E(A);
1924
- } else k === "Escape" ? (w.preventDefault(), $()) : k === "Backspace" ? s.value && T.value === "" && _.value.length && (_.value = _.value.slice(0, -1), r.value = [..._.value], n("change", r.value)) : k === "Home" ? (z.value = 0, oe(U.value[0], f.value)) : k === "End" ? (z.value = H.value.length - 1, oe(U.value[z.value], f.value)) : k === "Tab" && $();
1925
- }, ye = () => {
1926
- a.value || (g.value = !0);
1927
- }, xe = () => {
1928
- g.value = !1, T.value = "";
1922
+ const O = J.value[V.value];
1923
+ O && de(O);
1924
+ } else k === "Escape" ? (w.preventDefault(), _()) : k === "Backspace" ? s.value && U.value === "" && $.value.length && ($.value = $.value.slice(0, -1), a.value = [...$.value], r("change", a.value)) : k === "Home" ? (V.value = 0, y(D.value[0], f.value)) : k === "End" ? (V.value = J.value.length - 1, y(D.value[V.value], f.value)) : k === "Tab" && _();
1925
+ }, ne = () => {
1926
+ n.value || (b.value = !0);
1927
+ }, Se = () => {
1928
+ b.value = !1, U.value = "";
1929
1929
  }, ve = (w) => {
1930
- w.key === "Escape" && c.value && $();
1931
- }, Te = (w) => {
1932
- d.value && (d.value.contains(w.target) || $());
1933
- }, Re = (w) => {
1934
- c.value && f.value && !f.value.contains(w.target) && $();
1930
+ w.key === "Escape" && c.value && _();
1931
+ }, ge = (w) => {
1932
+ d.value && (d.value.contains(w.target) || _());
1933
+ }, be = (w) => {
1934
+ c.value && f.value && !f.value.contains(w.target) && _();
1935
1935
  };
1936
- ie(() => t.options, (w) => {
1936
+ ue(() => t.options, (w) => {
1937
1937
  w?.length && (C.value = [...w]);
1938
1938
  }, { immediate: !0 });
1939
- const Pe = async () => {
1939
+ const ye = async () => {
1940
1940
  if (s.value)
1941
- Array.isArray(r.value) ? _.value = [...r.value] : (_.value = r.value == null ? [] : [r.value], r.value = [..._.value]), !t.options?.length && t.data && await Ce(_.value);
1941
+ Array.isArray(a.value) ? $.value = [...a.value] : ($.value = a.value == null ? [] : [a.value], a.value = [...$.value]), !t.options?.length && t.data && await Le($.value);
1942
1942
  else {
1943
- if (Array.isArray(r.value)) {
1944
- const w = r.value[0] ?? null;
1945
- r.value = w ?? null;
1943
+ if (Array.isArray(a.value)) {
1944
+ const w = a.value[0] ?? null;
1945
+ a.value = w ?? null;
1946
1946
  }
1947
- v.value = await ce(r.value);
1947
+ v.value = await $e(a.value);
1948
1948
  }
1949
1949
  };
1950
- ie(r, () => {
1951
- Pe();
1952
- }), ue(async () => {
1953
- addEventListener("keydown", ve), addEventListener("scroll", Re, !0), document.addEventListener("click", Te, !0), t.options?.length ? C.value = [...t.options] : t.data && (C.value = await Y("")), await Pe();
1954
- }), Ee(() => {
1955
- removeEventListener("keydown", ve), removeEventListener("scroll", Re, !0), document.removeEventListener("click", Te, !0);
1950
+ ue(a, () => {
1951
+ ye();
1952
+ }), pe(async () => {
1953
+ addEventListener("keydown", ve), addEventListener("scroll", be, !0), document.addEventListener("click", ge, !0), t.options?.length ? C.value = [...t.options] : t.data && (C.value = await Y("")), await ye();
1954
+ }), Ue(() => {
1955
+ removeEventListener("keydown", ve), removeEventListener("scroll", be, !0), document.removeEventListener("click", ge, !0);
1956
1956
  });
1957
- async function it() {
1957
+ async function nt() {
1958
1958
  if (!t.add) return;
1959
- const w = await Oe({ form: t.add.form, mode: "add" });
1959
+ const w = await De({ form: t.add.form, mode: "add" });
1960
1960
  w && (await fetch(`/api/table/${t.add.token}`, {
1961
1961
  method: "POST",
1962
1962
  headers: { "Content-Type": "application/json" },
1963
1963
  body: JSON.stringify(w)
1964
- }).then((k) => k.json()), !t.options?.length && t.data && (C.value = await Y(T.value)));
1964
+ }).then((k) => k.json()), !t.options?.length && t.data && (C.value = await Y(U.value)));
1965
1965
  }
1966
1966
  return (w, k) => (i(), u("div", {
1967
1967
  class: "flex gap-1 w-full",
1968
1968
  ref_key: "selectRoot",
1969
1969
  ref: d,
1970
- onClick: k[2] || (k[2] = ne(() => {
1970
+ onClick: k[2] || (k[2] = ce(() => {
1971
1971
  }, ["stop"]))
1972
1972
  }, [
1973
1973
  l("div", {
1974
- class: V(["relative w-full font-sans", t.customClass])
1974
+ class: M(["relative w-full font-sans", t.customClass])
1975
1975
  }, [
1976
1976
  k[7] || (k[7] = l("span", {
1977
1977
  id: "react-select-live-region",
@@ -1985,44 +1985,43 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
1985
1985
  class: "sr-only"
1986
1986
  }, null, -1)),
1987
1987
  l("div", {
1988
- class: V([
1988
+ class: M([
1989
1989
  "flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
1990
1990
  "border-gray-300 hover:border-gray-400",
1991
- c.value || g.value ? "border-blue-500 ring-1 ring-blue-500" : "",
1992
- a.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
1991
+ c.value || b.value ? "border-blue-500 ring-1 ring-blue-500" : "",
1992
+ n.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
1993
1993
  ]),
1994
1994
  role: "combobox",
1995
1995
  "aria-expanded": c.value,
1996
1996
  "aria-haspopup": "listbox",
1997
- onKeydown: Ve,
1997
+ onKeydown: R,
1998
1998
  onClick: q,
1999
- "data-focus": c.value || g.value ? "true" : "false"
1999
+ "data-focus": c.value || b.value ? "true" : "false"
2000
2000
  }, [
2001
2001
  l("div", {
2002
2002
  class: "flex flex-1 items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",
2003
2003
  ref_key: "triggerRef",
2004
2004
  ref: p
2005
2005
  }, [
2006
- s.value && _.value.length ? (i(!0), u(ee, { key: 0 }, le(b.value, (A) => (i(), u("div", {
2006
+ s.value && $.value.length ? (i(!0), u(ee, { key: 0 }, le(h.value, (O) => (i(), u("div", {
2007
2007
  class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border",
2008
- key: A.id
2008
+ key: O.id
2009
2009
  }, [
2010
2010
  l("div", ga, [
2011
- A?.color ? (i(), u("span", {
2011
+ O?.color ? (i(), u("span", {
2012
2012
  key: 0,
2013
2013
  class: "w-[16px] h-[16px] rounded-md block ml-1.5",
2014
- style: he({ backgroundColor: A?.color })
2015
- }, null, 4)) : j("", !0),
2016
- K((i(), u("div", ba, [
2017
- se(F(A.text), 1)
2018
- ])), [
2019
- [J(qe), A.text]
2020
- ])
2014
+ style: we({ backgroundColor: O?.color })
2015
+ }, null, 4)) : z("", !0),
2016
+ l("div", {
2017
+ class: "truncate text-gray-900 overflow-hidden",
2018
+ title: O.text
2019
+ }, F(O.text), 9, ba)
2021
2020
  ]),
2022
2021
  l("div", {
2023
2022
  role: "button",
2024
2023
  class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
2025
- onClick: ne((W) => y(A.id), ["stop"])
2024
+ onClick: ce((Z) => he(O.id), ["stop"])
2026
2025
  }, k[3] || (k[3] = [
2027
2026
  l("svg", {
2028
2027
  height: "14",
@@ -2035,25 +2034,23 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
2035
2034
  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" })
2036
2035
  ], -1)
2037
2036
  ]), 8, ya)
2038
- ]))), 128)) : !s.value && !g.value && v.value?.text && T.value === "" ? K((i(), u("div", {
2037
+ ]))), 128)) : !s.value && !b.value && v.value?.text && U.value === "" ? (i(), u("div", {
2039
2038
  key: 1,
2040
- class: V(["truncate text-gray-900"]),
2039
+ class: M(["truncate text-gray-900"]),
2041
2040
  title: v.value.text
2042
2041
  }, [
2043
2042
  v.value?.color ? (i(), u("span", {
2044
2043
  key: 0,
2045
2044
  class: "w-[14px] h-[14px] rounded-md block mr-1 mt-1 absolute",
2046
- style: he({ backgroundColor: v.value?.color })
2047
- }, null, 4)) : j("", !0),
2045
+ style: we({ backgroundColor: v.value?.color })
2046
+ }, null, 4)) : z("", !0),
2048
2047
  l("span", {
2049
- class: V({ "pl-5": v.value?.color })
2048
+ class: M({ "pl-5": v.value?.color })
2050
2049
  }, F(v.value.text), 3)
2051
- ], 8, xa)), [
2052
- [J(qe), v.value.text]
2053
- ]) : j("", !0),
2054
- Z.value ? (i(), u("div", wa, F(h.value), 1)) : j("", !0),
2050
+ ], 8, xa)) : z("", !0),
2051
+ K.value ? (i(), u("div", wa, F(g.value), 1)) : z("", !0),
2055
2052
  l("div", ka, [
2056
- !a.value && w.search ? K((i(), u("input", {
2053
+ !n.value && w.search ? X((i(), u("input", {
2057
2054
  key: 0,
2058
2055
  ref_key: "inputRef",
2059
2056
  ref: N,
@@ -2065,24 +2062,24 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
2065
2062
  type: "text",
2066
2063
  tabindex: "0",
2067
2064
  "aria-autocomplete": "list",
2068
- placeholder: (s.value && _.value.length ? " " : null) || (g.value && !T.value?.length ? v.value?.text : " "),
2069
- "onUpdate:modelValue": k[0] || (k[0] = (A) => T.value = A),
2070
- onFocus: ye,
2071
- onBlur: xe,
2072
- onKeydown: fe
2065
+ placeholder: (s.value && $.value.length ? " " : null) || (b.value && !U.value?.length ? v.value?.text : " "),
2066
+ "onUpdate:modelValue": k[0] || (k[0] = (O) => U.value = O),
2067
+ onFocus: ne,
2068
+ onBlur: Se,
2069
+ onKeydown: H
2073
2070
  }, null, 40, _a)), [
2074
- [de, T.value]
2075
- ]) : j("", !0)
2071
+ [fe, U.value]
2072
+ ]) : z("", !0)
2076
2073
  ])
2077
2074
  ], 512),
2078
2075
  l("div", $a, [
2079
- P.value ? (i(), u("button", {
2076
+ A.value ? (i(), u("button", {
2080
2077
  key: 0,
2081
2078
  type: "button",
2082
2079
  class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
2083
2080
  "aria-hidden": "true",
2084
- disabled: a.value,
2085
- onClick: ne(m, ["stop"])
2081
+ disabled: n.value,
2082
+ onClick: ce(oe, ["stop"])
2086
2083
  }, k[4] || (k[4] = [
2087
2084
  l("svg", {
2088
2085
  height: "20",
@@ -2092,14 +2089,14 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
2092
2089
  }, [
2093
2090
  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" })
2094
2091
  ], -1)
2095
- ]), 8, Ca)) : j("", !0),
2092
+ ]), 8, Ca)) : z("", !0),
2096
2093
  k[6] || (k[6] = l("div", { class: "self-stretch w-px bg-[#ccc] my-[1px]" }, null, -1)),
2097
2094
  l("button", {
2098
2095
  type: "button",
2099
2096
  class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
2100
2097
  "aria-hidden": "true",
2101
- disabled: a.value,
2102
- onClick: k[1] || (k[1] = ne((A) => S(), ["stop"]))
2098
+ disabled: n.value,
2099
+ onClick: k[1] || (k[1] = ce((O) => j(), ["stop"]))
2103
2100
  }, k[5] || (k[5] = [
2104
2101
  l("svg", {
2105
2102
  height: "20",
@@ -2118,55 +2115,55 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
2118
2115
  ref_key: "listRef",
2119
2116
  ref: f
2120
2117
  }, [
2121
- H.value.length ? (i(!0), u(ee, { key: 0 }, le(H.value, (A, W) => (i(), u("div", {
2122
- key: A.id,
2118
+ J.value.length ? (i(!0), u(ee, { key: 0 }, le(J.value, (O, Z) => (i(), u("div", {
2119
+ key: O.id,
2123
2120
  ref_for: !0,
2124
- ref: (me) => U.value[W] = me,
2125
- class: V([
2121
+ ref: (xe) => D.value[Z] = xe,
2122
+ class: M([
2126
2123
  "flex px-3 py-2 cursor-default select-none hover:bg-blue-300",
2127
- z.value === W ? "bg-blue-300" : "",
2128
- M(A.id) ? "text-white bg-blue-500" : "text-gray-900 bg-white"
2124
+ V.value === Z ? "bg-blue-300" : "",
2125
+ S(O.id) ? "text-white bg-blue-500" : "text-gray-900 bg-white"
2129
2126
  ]),
2130
- "aria-disabled": M(A.id) ? "true" : "false",
2127
+ "aria-disabled": S(O.id) ? "true" : "false",
2131
2128
  role: "option",
2132
2129
  tabindex: "-1",
2133
- onClick: (me) => G(A)
2130
+ onClick: (xe) => m(O)
2134
2131
  }, [
2135
- A?.color ? (i(), u("span", {
2132
+ O?.color ? (i(), u("span", {
2136
2133
  key: 0,
2137
2134
  class: "w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",
2138
- style: he({ backgroundColor: A?.color })
2139
- }, null, 4)) : j("", !0),
2135
+ style: we({ backgroundColor: O?.color })
2136
+ }, null, 4)) : z("", !0),
2140
2137
  l("div", {
2141
- class: V([
2138
+ class: M([
2142
2139
  "leading-[19px]",
2143
- z.value === A.id ? "text-white" : "",
2140
+ V.value === O.id ? "text-white" : "",
2144
2141
  // active style like react-select
2145
- (z.value === W, "")
2142
+ (V.value === Z, "")
2146
2143
  ])
2147
- }, F(A.text), 3)
2144
+ }, F(O.text), 3)
2148
2145
  ], 10, La))), 128)) : (i(), u("div", Sa, " No options "))
2149
2146
  ], 512)
2150
- ])) : j("", !0)
2147
+ ])) : z("", !0)
2151
2148
  ], 2),
2152
2149
  t.add ? (i(), u("button", {
2153
2150
  key: 0,
2154
- onClick: it,
2151
+ onClick: nt,
2155
2152
  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",
2156
- disabled: a.value,
2153
+ disabled: n.value,
2157
2154
  type: "button"
2158
2155
  }, [
2159
- B(je, {
2156
+ I(Ae, {
2160
2157
  width: "16",
2161
2158
  height: "16"
2162
2159
  }),
2163
2160
  k[9] || (k[9] = l("span", null, "Додати", -1))
2164
- ], 8, Ba)) : j("", !0)
2161
+ ], 8, Ba)) : z("", !0)
2165
2162
  ], 512));
2166
2163
  }
2167
- }), Ia = ["placeholder", "disabled"], za = /* @__PURE__ */ O({
2164
+ }), Ia = ["placeholder", "disabled"], za = /* @__PURE__ */ E({
2168
2165
  __name: "vs-input-textarea",
2169
- props: /* @__PURE__ */ Q({
2166
+ props: /* @__PURE__ */ W({
2170
2167
  style: { default: () => ({}) },
2171
2168
  customClass: { default: "" },
2172
2169
  disabled: { type: Boolean, default: !1 },
@@ -2180,18 +2177,18 @@ const Mo = /* @__PURE__ */ R($o, [["render", Vo]]), Lo = { class: "flex flex-col
2180
2177
  }),
2181
2178
  emits: ["update:modelValue"],
2182
2179
  setup(o) {
2183
- const e = o, { inputClass: t } = be(e.style), n = X(o, "modelValue");
2184
- return (s, a) => K((i(), u("textarea", {
2185
- "onUpdate:modelValue": a[0] || (a[0] = (r) => n.value = r),
2180
+ const e = o, { inputClass: t } = _e(e.style), r = Q(o, "modelValue");
2181
+ return (s, n) => X((i(), u("textarea", {
2182
+ "onUpdate:modelValue": n[0] || (n[0] = (a) => r.value = a),
2186
2183
  placeholder: s.placeholder,
2187
2184
  disabled: s.disabled,
2188
2185
  row: "2",
2189
- class: V(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto", [J(t)]]),
2186
+ class: M(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto bg-white", [G(t)]]),
2190
2187
  style: {
2191
2188
  border: "1px solid #CFD9E0"
2192
2189
  }
2193
2190
  }, null, 10, Ia)), [
2194
- [de, n.value]
2191
+ [fe, r.value]
2195
2192
  ]);
2196
2193
  }
2197
2194
  }), Aa = {}, Oa = {
@@ -2215,7 +2212,7 @@ function Ea(o, e) {
2215
2212
  l("path", { d: "M21 21l-6 -6" }, null, -1)
2216
2213
  ]));
2217
2214
  }
2218
- const Fa = /* @__PURE__ */ R(Aa, [["render", Ea]]), Da = {}, Ua = {
2215
+ const Fa = /* @__PURE__ */ P(Aa, [["render", Ea]]), Da = {}, Ua = {
2219
2216
  class: "flex-shrink-0 mt-0.5 size-3.5",
2220
2217
  xmlns: "http://www.w3.org/2000/svg",
2221
2218
  viewBox: "0 0 24 24",
@@ -2233,7 +2230,7 @@ function Ta(o, e) {
2233
2230
  l("path", { d: "M17 4v16" }, null, -1)
2234
2231
  ]));
2235
2232
  }
2236
- const Ra = /* @__PURE__ */ R(Da, [["render", Ta]]), Pa = {}, Na = {
2233
+ const Ra = /* @__PURE__ */ P(Da, [["render", Ta]]), Pa = {}, Na = {
2237
2234
  xmlns: "http://www.w3.org/2000/svg",
2238
2235
  width: "14",
2239
2236
  height: "14",
@@ -2256,7 +2253,7 @@ function Ha(o, e) {
2256
2253
  l("path", { d: "M12 4l0 12" }, null, -1)
2257
2254
  ]));
2258
2255
  }
2259
- const qa = /* @__PURE__ */ R(Pa, [["render", Ha]]), Ga = {}, Ja = {
2256
+ const qa = /* @__PURE__ */ P(Pa, [["render", Ha]]), Ga = {}, Ja = {
2260
2257
  xmlns: "http://www.w3.org/2000/svg",
2261
2258
  viewBox: "0 0 24 24",
2262
2259
  fill: "none",
@@ -2277,7 +2274,7 @@ function Ka(o, e) {
2277
2274
  l("path", { d: "M12 4l0 12" }, null, -1)
2278
2275
  ]));
2279
2276
  }
2280
- const Za = /* @__PURE__ */ R(Ga, [["render", Ka]]), Wa = {}, Qa = {
2277
+ const Za = /* @__PURE__ */ P(Ga, [["render", Ka]]), Wa = {}, Qa = {
2281
2278
  xmlns: "http://www.w3.org/2000/svg",
2282
2279
  viewBox: "0 0 24 24",
2283
2280
  fill: "none",
@@ -2291,7 +2288,7 @@ function Xa(o, e) {
2291
2288
  re('<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)
2292
2289
  ]));
2293
2290
  }
2294
- const Qe = /* @__PURE__ */ R(Wa, [["render", Xa]]), Ya = {}, es = {
2291
+ const We = /* @__PURE__ */ P(Wa, [["render", Xa]]), Ya = {}, es = {
2295
2292
  viewBox: "0 0 178 90",
2296
2293
  fill: "none",
2297
2294
  xmlns: "http://www.w3.org/2000/svg"
@@ -2301,7 +2298,7 @@ function ts(o, e) {
2301
2298
  re('<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)
2302
2299
  ]));
2303
2300
  }
2304
- const ls = /* @__PURE__ */ R(Ya, [["render", ts]]), os = {}, as = {
2301
+ const ls = /* @__PURE__ */ P(Ya, [["render", ts]]), os = {}, as = {
2305
2302
  xmlns: "http://www.w3.org/2000/svg",
2306
2303
  viewBox: "0 0 24 24",
2307
2304
  fill: "none",
@@ -2315,13 +2312,13 @@ function ss(o, e) {
2315
2312
  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)
2316
2313
  ]));
2317
2314
  }
2318
- const rs = /* @__PURE__ */ R(os, [["render", ss]]), ns = { class: "vs-datatable border rounded-xl w-full flex-grow" }, is = { class: "flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]" }, us = { class: "relative w-full" }, ds = { class: "table-wrapper flex gap-2" }, cs = { class: "vs-popover inline-block text-slate-700" }, ps = { class: "text-center" }, fs = { class: "" }, vs = { class: "py-1 px-0 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, ms = { class: "flex flex-col p-[1px] gap-[2px] w-[140px]" }, hs = { class: "text-sm items-center text-gray-800 flex gap-1" }, gs = { class: "w-full overflow-x-auto" }, bs = { class: "w-full table-auto caption-bottom text-sm" }, ys = { class: "[&_tr]:border-b" }, xs = { class: "border-b data-[state=selected]:bg-muted bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors" }, ws = { class: "h-10 px-2 align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] w-12 text-center" }, ks = {
2315
+ const rs = /* @__PURE__ */ P(os, [["render", ss]]), ns = { class: "vs-datatable border rounded-xl w-full flex-grow" }, is = { class: "flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]" }, us = { class: "relative w-full" }, ds = { class: "table-wrapper flex gap-2" }, cs = { class: "vs-popover inline-block text-slate-700" }, ps = { class: "text-center" }, fs = { class: "" }, vs = { class: "py-1 px-0 w-full text-sm text-stone-800 bg-white shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:text-neutral-200 dark:focus:bg-neutral-800 after:h-4 after:absolute after:-bottom-4 after:start-0 after:w-full before:h-4 before:absolute before:-top-4 before:start-0 before:w-full" }, ms = { class: "flex flex-col p-[1px] gap-[2px] w-[140px]" }, hs = { class: "text-sm items-center text-gray-800 flex gap-1" }, gs = { class: "w-full overflow-x-auto" }, bs = { class: "w-full table-auto caption-bottom text-sm" }, ys = { class: "[&_tr]:border-b" }, xs = { class: "border-b data-[state=selected]:bg-muted bg-slate-50/50 dark:bg-slate-700/50 hover:bg-slate-50/80 dark:hover:bg-slate-700/80 transition-colors" }, ws = { class: "h-10 px-2 align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] w-12 text-center" }, ks = {
2319
2316
  key: 0,
2320
2317
  colspan: "100%",
2321
2318
  class: "text-center"
2322
- }, _s = { class: "w-full" }, $s = { class: "p-5 min-h-[200px] flex flex-col justify-center items-center text-center" }, Cs = ["onDragstart", "onDragover", "onDrop"], Vs = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center" }, Ms = { class: "flex items-center justify-center" }, Ls = { 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" }, Ss = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]" }, Bs = { class: "flex items-center justify-center gap-2" }, js = ["onClick"], Is = ["onClick"], zs = { class: "vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, As = /* @__PURE__ */ O({
2319
+ }, _s = { class: "w-full" }, $s = { class: "p-5 min-h-[200px] flex flex-col justify-center items-center text-center" }, Cs = ["onDragstart", "onDragover", "onDrop"], Vs = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center" }, Ms = { class: "flex items-center justify-center" }, Ls = { 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" }, Ss = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]" }, Bs = { class: "flex items-center justify-center gap-2" }, js = ["onClick"], Is = ["onClick"], zs = { class: "vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, As = /* @__PURE__ */ E({
2323
2320
  __name: "vs-input-datatable",
2324
- props: /* @__PURE__ */ Q({
2321
+ props: /* @__PURE__ */ W({
2325
2322
  colModel: {},
2326
2323
  style: {},
2327
2324
  customClass: {},
@@ -2336,100 +2333,100 @@ const rs = /* @__PURE__ */ R(os, [["render", ss]]), ns = { class: "vs-datatable
2336
2333
  }),
2337
2334
  emits: ["update:modelValue"],
2338
2335
  setup(o) {
2339
- const e = o, t = X(o, "modelValue"), n = x({}), s = x(""), a = D(() => {
2336
+ const e = o, t = Q(o, "modelValue"), r = x({}), s = x(""), n = T(() => {
2340
2337
  if (!s.value) return t.value ?? [];
2341
- const I = s.value.toLowerCase();
2342
- return t.value.filter(($) => e.colModel?.some((S) => {
2343
- const q = $[S.key];
2344
- return q ? Array.isArray(q) ? q.join(", ").toLowerCase().includes(I) : String(q).toLowerCase().includes(I) : !1;
2338
+ const B = s.value.toLowerCase();
2339
+ return t.value.filter((_) => e.colModel?.some((j) => {
2340
+ const q = _[j.key];
2341
+ return q ? Array.isArray(q) ? q.join(", ").toLowerCase().includes(B) : String(q).toLowerCase().includes(B) : !1;
2345
2342
  }));
2346
- }), r = x(null), d = x(null), p = x(!1), f = x(null), c = x({ top: 0, left: 0 }), g = (I) => {
2347
- r.value = I;
2348
- }, v = (I) => {
2349
- d.value = I;
2350
- }, C = (I) => {
2351
- if (r.value === null || r.value === I) {
2352
- r.value = null, d.value = null;
2343
+ }), a = x(null), d = x(null), p = x(!1), f = x(null), c = x({ top: 0, left: 0 }), b = (B) => {
2344
+ a.value = B;
2345
+ }, v = (B) => {
2346
+ d.value = B;
2347
+ }, C = (B) => {
2348
+ if (a.value === null || a.value === B) {
2349
+ a.value = null, d.value = null;
2353
2350
  return;
2354
2351
  }
2355
- const $ = [...t.value], [S] = $.splice(r.value, 1);
2356
- $.splice(I, 0, S), t.value = $, r.value = null, d.value = null;
2357
- }, z = (I) => {
2358
- const S = I.currentTarget.getBoundingClientRect();
2359
- c.value = { top: S.bottom + window.scrollY, left: S.left + window.scrollX }, p.value = !p.value;
2360
- }, U = () => {
2352
+ const _ = [...t.value], [j] = _.splice(a.value, 1);
2353
+ _.splice(B, 0, j), t.value = _, a.value = null, d.value = null;
2354
+ }, V = (B) => {
2355
+ const j = B.currentTarget.getBoundingClientRect();
2356
+ c.value = { top: j.bottom + window.scrollY, left: j.left + window.scrollX }, p.value = !p.value;
2357
+ }, D = () => {
2361
2358
  f.value && f.value.click();
2362
- }, T = (I) => {
2363
- const S = I.target.files?.[0];
2364
- if (!S) return;
2359
+ }, U = (B) => {
2360
+ const j = B.target.files?.[0];
2361
+ if (!j) return;
2365
2362
  const q = new FileReader();
2366
- q.onload = (m) => {
2363
+ q.onload = (oe) => {
2367
2364
  try {
2368
- const y = m.target?.result;
2369
- if (typeof y == "string") {
2370
- const E = JSON.parse(y);
2371
- Array.isArray(E) && t.value.push(...E);
2365
+ const he = oe.target?.result;
2366
+ if (typeof he == "string") {
2367
+ const de = JSON.parse(he);
2368
+ Array.isArray(de) && t.value.push(...de);
2372
2369
  }
2373
- } catch (y) {
2374
- console.error("Error parsing file:", y);
2370
+ } catch (he) {
2371
+ console.error("Error parsing file:", he);
2375
2372
  }
2376
- }, q.readAsText(S);
2373
+ }, q.readAsText(j);
2377
2374
  }, N = () => {
2378
- const I = JSON.stringify(t.value, null, 2), $ = new Blob([I], { type: "application/json" }), S = URL.createObjectURL($), q = document.createElement("a");
2379
- q.href = S, q.download = "data.json", q.click(), URL.revokeObjectURL(S);
2375
+ const B = JSON.stringify(t.value, null, 2), _ = new Blob([B], { type: "application/json" }), j = URL.createObjectURL(_), q = document.createElement("a");
2376
+ q.href = j, q.download = "data.json", q.click(), URL.revokeObjectURL(j);
2380
2377
  };
2381
- ue(async () => {
2382
- const I = e.colModel?.filter(($) => $.data);
2383
- I?.length && Promise.all(I.map(async ($) => {
2384
- n.value[$.key] = await fetch(`/api/suggest/${$.data}`).then((S) => S.json());
2378
+ pe(async () => {
2379
+ const B = e.colModel?.filter((_) => _.data);
2380
+ B?.length && Promise.all(B.map(async (_) => {
2381
+ r.value[_.key] = await fetch(`/api/suggest/${_.data}`).then((j) => j.json());
2385
2382
  }));
2386
2383
  });
2387
- const _ = x(""), b = x(!1);
2388
- let h = "edit", Z = 0;
2389
- const P = x({}), M = x({});
2390
- async function H() {
2391
- _.value = "Додати", b.value = !0, h = "add", P.value = {};
2384
+ const $ = x(""), h = x(!1);
2385
+ let g = "edit", K = 0;
2386
+ const A = x({}), S = x({});
2387
+ async function J() {
2388
+ $.value = "Додати", h.value = !0, g = "add", A.value = {};
2392
2389
  }
2393
- function Y(I, $) {
2394
- return n.value[$.key] && I[$.key] ? n.value[$.key].find((S) => S.id.toString() === I[$.key].toString())?.text ?? I[$.key] : I[$.key] || "-";
2390
+ function Y(B, _) {
2391
+ return r.value[_.key] && B[_.key] ? r.value[_.key].find((j) => j.id.toString() === B[_.key].toString())?.text ?? B[_.key] : B[_.key] || "-";
2395
2392
  }
2396
- async function we(I, $) {
2397
- _.value = "Редагувати", b.value = !0, h = "edit", Z = $, P.value = { ...I };
2393
+ async function ae(B, _) {
2394
+ $.value = "Редагувати", h.value = !0, g = "edit", K = _, A.value = { ...B };
2398
2395
  }
2399
- function ce() {
2400
- const I = M.value.validate();
2401
- if (I) {
2402
- pe({ type: "warning", title: "Помилка валідації", message: Object.entries(I).map(([$, S]) => `${$}: ${S}`).join(`
2396
+ function $e() {
2397
+ const B = S.value.validate();
2398
+ if (B) {
2399
+ me({ type: "warning", title: "Помилка валідації", message: Object.entries(B).map(([_, j]) => `${_}: ${j}`).join(`
2403
2400
  `) });
2404
2401
  return;
2405
2402
  }
2406
- h === "add" ? Array.isArray(t.value) ? t.value = [...t.value, P.value] : t.value = [P.value] : t.value = t.value.map(($, S) => S === Z ? P.value : $), b.value = !1;
2403
+ g === "add" ? Array.isArray(t.value) ? t.value = [...t.value, A.value] : t.value = [A.value] : t.value = t.value.map((_, j) => j === K ? A.value : _), h.value = !1;
2407
2404
  }
2408
- function Ce(I) {
2409
- t.value = t.value.filter(($, S) => S !== I);
2405
+ function Le(B) {
2406
+ t.value = t.value.filter((_, j) => j !== B);
2410
2407
  }
2411
- return (I, $) => (i(), u("div", ns, [
2408
+ return (B, _) => (i(), u("div", ns, [
2412
2409
  l("div", is, [
2413
2410
  l("div", us, [
2414
- B(Fa, {
2411
+ I(Fa, {
2415
2412
  width: "14",
2416
2413
  height: "14",
2417
2414
  class: "absolute left-3 top-1/2 transform -translate-y-1/2 text-stone-500"
2418
2415
  }),
2419
- K(l("input", {
2416
+ X(l("input", {
2420
2417
  type: "text",
2421
- "onUpdate:modelValue": $[0] || ($[0] = (S) => s.value = S),
2418
+ "onUpdate:modelValue": _[0] || (_[0] = (j) => s.value = j),
2422
2419
  placeholder: "Пошук",
2423
2420
  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"
2424
2421
  }, null, 512), [
2425
- [de, s.value]
2422
+ [fe, s.value]
2426
2423
  ])
2427
2424
  ]),
2428
2425
  l("div", ds, [
2429
2426
  l("input", {
2430
2427
  ref_key: "fileInput",
2431
2428
  ref: f,
2432
- onChange: T,
2429
+ onChange: U,
2433
2430
  class: "hidden",
2434
2431
  accept: ".json",
2435
2432
  type: "file"
@@ -2438,10 +2435,10 @@ const rs = /* @__PURE__ */ R(os, [["render", ss]]), ns = { class: "vs-datatable
2438
2435
  l("div", ps, [
2439
2436
  l("div", fs, [
2440
2437
  l("button", {
2441
- onClick: z,
2438
+ onClick: V,
2442
2439
  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"
2443
2440
  }, [
2444
- B(Ra, {
2441
+ I(Ra, {
2445
2442
  height: "16",
2446
2443
  width: "16"
2447
2444
  })
@@ -2450,48 +2447,48 @@ const rs = /* @__PURE__ */ R(os, [["render", ss]]), ns = { class: "vs-datatable
2450
2447
  ])
2451
2448
  ])
2452
2449
  ]),
2453
- (i(), te(pt, { to: "body" }, [
2450
+ (i(), te(ct, { to: "body" }, [
2454
2451
  p.value ? (i(), u("div", {
2455
2452
  key: 0,
2456
2453
  class: "text-slate-700 vsTailwind vs-popover__content bottom",
2457
- style: he([{ width: "fit-content", "z-index": "10002", position: "fixed" }, { position: "absolute", top: c.value.top + "px", left: c.value.left + "px" }])
2454
+ style: we([{ width: "fit-content", "z-index": "10002", position: "fixed" }, { position: "absolute", top: c.value.top + "px", left: c.value.left + "px" }])
2458
2455
  }, [
2459
2456
  l("div", vs, [
2460
2457
  l("div", ms, [
2461
2458
  l("button", {
2462
- onClick: U,
2459
+ onClick: D,
2463
2460
  class: "text-slate-700 flex items-center gap-1 px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"
2464
2461
  }, [
2465
- B(qa, {
2462
+ I(qa, {
2466
2463
  class: "text-black",
2467
2464
  width: "14",
2468
2465
  height: "14"
2469
2466
  }),
2470
- $[4] || ($[4] = se(" Імпортувати "))
2467
+ _[4] || (_[4] = ie(" Імпортувати "))
2471
2468
  ]),
2472
2469
  l("button", {
2473
2470
  onClick: N,
2474
2471
  class: "text-slate-700 flex items-center px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"
2475
2472
  }, [
2476
2473
  l("span", hs, [
2477
- B(Za, {
2474
+ I(Za, {
2478
2475
  class: "text-black",
2479
2476
  width: "14",
2480
2477
  height: "14"
2481
2478
  }),
2482
- $[5] || ($[5] = se(" Експортувати "))
2479
+ _[5] || (_[5] = ie(" Експортувати "))
2483
2480
  ])
2484
2481
  ])
2485
2482
  ])
2486
2483
  ])
2487
- ], 4)) : j("", !0)
2484
+ ], 4)) : z("", !0)
2488
2485
  ])),
2489
2486
  l("button", {
2490
- onClick: H,
2487
+ onClick: J,
2491
2488
  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"
2492
2489
  }, [
2493
- B(je),
2494
- $[6] || ($[6] = se(" Додати "))
2490
+ I(Ae),
2491
+ _[6] || (_[6] = ie(" Додати "))
2495
2492
  ])
2496
2493
  ]),
2497
2494
  l("div", gs, [
@@ -2499,76 +2496,76 @@ const rs = /* @__PURE__ */ R(os, [["render", ss]]), ns = { class: "vs-datatable
2499
2496
  l("thead", ys, [
2500
2497
  l("tr", xs, [
2501
2498
  l("th", ws, [
2502
- B(Qe, {
2499
+ I(We, {
2503
2500
  width: "24",
2504
2501
  height: "24",
2505
2502
  class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
2506
2503
  })
2507
2504
  ]),
2508
- (i(!0), u(ee, null, le(I.colModel, (S) => (i(), u("th", {
2509
- key: S.key,
2505
+ (i(!0), u(ee, null, le(B.colModel, (j) => (i(), u("th", {
2506
+ key: j.key,
2510
2507
  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]"
2511
- }, F(S.ua || S.label), 1))), 128)),
2512
- $[7] || ($[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))
2508
+ }, F(j.ua || j.label), 1))), 128)),
2509
+ _[7] || (_[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))
2513
2510
  ])
2514
2511
  ]),
2515
2512
  l("tbody", {
2516
- class: V({ "[&_tr:last-child]:border-0": !d.value })
2513
+ class: M({ "[&_tr:last-child]:border-0": !d.value })
2517
2514
  }, [
2518
- a.value.length === 0 ? (i(), u("td", ks, [
2515
+ n.value.length === 0 ? (i(), u("td", ks, [
2519
2516
  l("div", _s, [
2520
2517
  l("div", $s, [
2521
- B(ls, { class: "w-48 mx-auto" }),
2522
- $[8] || ($[8] = l("div", { class: "max-w-sm mx-auto mt-6" }, [
2518
+ I(ls, { class: "w-48 mx-auto" }),
2519
+ _[8] || (_[8] = l("div", { class: "max-w-sm mx-auto mt-6" }, [
2523
2520
  l("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "Нічого не знайдено"),
2524
2521
  l("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
2525
2522
  ], -1))
2526
2523
  ])
2527
2524
  ])
2528
- ])) : j("", !0),
2529
- (i(!0), u(ee, null, le(a.value, (S, q) => (i(), u("tr", {
2530
- key: S.id,
2531
- class: V(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move", {
2532
- "opacity-50": r.value === q,
2525
+ ])) : z("", !0),
2526
+ (i(!0), u(ee, null, le(n.value, (j, q) => (i(), u("tr", {
2527
+ key: j.id,
2528
+ class: M(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move", {
2529
+ "opacity-50": a.value === q,
2533
2530
  "border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20": d.value === q
2534
2531
  }]),
2535
2532
  draggable: "true",
2536
- onDragstart: (m) => g(q),
2537
- onDragover: ne((m) => v(q), ["prevent"]),
2538
- onDrop: (m) => C(q)
2533
+ onDragstart: (oe) => b(q),
2534
+ onDragover: ce((oe) => v(q), ["prevent"]),
2535
+ onDrop: (oe) => C(q)
2539
2536
  }, [
2540
2537
  l("td", Vs, [
2541
2538
  l("div", Ms, [
2542
- B(Qe, {
2539
+ I(We, {
2543
2540
  width: "24",
2544
2541
  height: "24",
2545
2542
  class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
2546
2543
  })
2547
2544
  ])
2548
2545
  ]),
2549
- (i(!0), u(ee, null, le(I.colModel, (m) => (i(), u("td", {
2550
- key: m.key,
2546
+ (i(!0), u(ee, null, le(B.colModel, (oe) => (i(), u("td", {
2547
+ key: oe.key,
2551
2548
  class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"
2552
2549
  }, [
2553
- l("div", Ls, F(Y(S, m)), 1)
2550
+ l("div", Ls, F(Y(j, oe)), 1)
2554
2551
  ]))), 128)),
2555
2552
  l("td", Ss, [
2556
2553
  l("div", Bs, [
2557
2554
  l("button", {
2558
- onClick: (m) => we(S, q),
2555
+ onClick: (oe) => ae(j, q),
2559
2556
  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"
2560
2557
  }, [
2561
- B(rs, {
2558
+ I(rs, {
2562
2559
  width: "24",
2563
2560
  height: "24",
2564
2561
  class: "w-3 h-3"
2565
2562
  })
2566
2563
  ], 8, js),
2567
2564
  l("button", {
2568
- onClick: (m) => Ce(q),
2565
+ onClick: (oe) => Le(q),
2569
2566
  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"
2570
2567
  }, [
2571
- B(ze, {
2568
+ I(Ee, {
2572
2569
  width: "24",
2573
2570
  height: "24",
2574
2571
  class: "w-3 h-3"
@@ -2580,27 +2577,27 @@ const rs = /* @__PURE__ */ R(os, [["render", ss]]), ns = { class: "vs-datatable
2580
2577
  ], 2)
2581
2578
  ])
2582
2579
  ]),
2583
- B(J(vt), {
2584
- visible: b.value,
2585
- title: _.value,
2580
+ I(G(vt), {
2581
+ visible: h.value,
2582
+ title: $.value,
2586
2583
  size: "lg"
2587
2584
  }, {
2588
- default: $e(() => [
2589
- B(Ie, {
2585
+ default: Me(() => [
2586
+ I(Oe, {
2590
2587
  schema: e.colModel,
2591
- values: P.value,
2592
- "onUpdate:values": $[1] || ($[1] = (S) => P.value = S),
2593
- form: M.value,
2594
- "onUpdate:form": $[2] || ($[2] = (S) => M.value = S)
2588
+ values: A.value,
2589
+ "onUpdate:values": _[1] || (_[1] = (j) => A.value = j),
2590
+ form: S.value,
2591
+ "onUpdate:form": _[2] || (_[2] = (j) => S.value = j)
2595
2592
  }, null, 8, ["schema", "values", "form"]),
2596
2593
  l("div", zs, [
2597
2594
  l("button", {
2598
2595
  type: "button",
2599
- onClick: $[3] || ($[3] = (S) => b.value = !1),
2596
+ onClick: _[3] || (_[3] = (j) => h.value = !1),
2600
2597
  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"
2601
2598
  }, " Скасувати "),
2602
2599
  l("button", {
2603
- onClick: ce,
2600
+ onClick: $e,
2604
2601
  type: "button",
2605
2602
  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"
2606
2603
  }, " Зберегти ")
@@ -2753,7 +2750,7 @@ function Us(o, e) {
2753
2750
  l("path", { d: "M17.657 16.657l-4.243 4.243a2 2 0 0 1 -2.827 0l-4.244 -4.243a8 8 0 1 1 11.314 0z" }, null, -1)
2754
2751
  ]));
2755
2752
  }
2756
- const Ts = /* @__PURE__ */ R(Fs, [["render", Us]]), Rs = {}, Ps = {
2753
+ const Ts = /* @__PURE__ */ P(Fs, [["render", Us]]), Rs = {}, Ps = {
2757
2754
  xmlns: "http://www.w3.org/2000/svg",
2758
2755
  viewBox: "0 0 24 24",
2759
2756
  fill: "none",
@@ -2775,7 +2772,7 @@ function Ns(o, e) {
2775
2772
  l("path", { d: "M7.5 16.5l9 -9" }, null, -1)
2776
2773
  ]));
2777
2774
  }
2778
- const Hs = /* @__PURE__ */ R(Rs, [["render", Ns]]), qs = {}, Gs = {
2775
+ const Hs = /* @__PURE__ */ P(Rs, [["render", Ns]]), qs = {}, Gs = {
2779
2776
  xmlns: "http://www.w3.org/2000/svg",
2780
2777
  viewBox: "0 0 24 24",
2781
2778
  fill: "none",
@@ -2790,7 +2787,7 @@ function Js(o, e) {
2790
2787
  re('<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)
2791
2788
  ]));
2792
2789
  }
2793
- const Ks = /* @__PURE__ */ R(qs, [["render", Js]]), Zs = {}, Ws = {
2790
+ const Ks = /* @__PURE__ */ P(qs, [["render", Js]]), Zs = {}, Ws = {
2794
2791
  xmlns: "http://www.w3.org/2000/svg",
2795
2792
  viewBox: "0 0 24 24",
2796
2793
  fill: "none",
@@ -2805,7 +2802,7 @@ function Qs(o, e) {
2805
2802
  re('<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)
2806
2803
  ]));
2807
2804
  }
2808
- const Xs = /* @__PURE__ */ R(Zs, [["render", Qs]]), Ys = {}, er = {
2805
+ const Xs = /* @__PURE__ */ P(Zs, [["render", Qs]]), Ys = {}, er = {
2809
2806
  version: "1.1",
2810
2807
  viewBox: "0 0 14 14",
2811
2808
  xmlns: "http://www.w3.org/2000/svg",
@@ -2843,7 +2840,7 @@ function tr(o, e) {
2843
2840
  ], -1)
2844
2841
  ]));
2845
2842
  }
2846
- const lr = /* @__PURE__ */ R(Ys, [["render", tr]]), or = { class: "form-geom__search" }, ar = { class: "map-search__input" }, sr = { class: "flex flex-nowrap relative" }, rr = { class: "form-autocomplete relative min-w-[6rem] vsTailwind map-search__select hidden" }, nr = { class: "flex items-center w-full" }, ir = { class: "max-w-[90%] truncate" }, ur = {
2843
+ const lr = /* @__PURE__ */ P(Ys, [["render", tr]]), or = { class: "form-geom__search" }, ar = { class: "map-search__input" }, sr = { class: "flex flex-nowrap relative" }, rr = { class: "form-autocomplete relative min-w-[6rem] vsTailwind map-search__select hidden" }, nr = { class: "flex items-center w-full" }, ir = { class: "max-w-[90%] truncate" }, ur = {
2847
2844
  key: 0,
2848
2845
  class: "absolute z-[3100] mt-0.5 left-0 right-0"
2849
2846
  }, dr = { class: "form-autocomplete__wrapper mt-[10px] z-50 w-full min-w-36 max-h-72 p-0 space-y-0.5 bg-white rounded-xl shadow-[0_10px_40px_10px_rgba(0,0,0,0.08)] dark:bg-neutral-900 top-full opened" }, cr = { class: "form-autocomplete__list vsTailwind px-2 pb-2 pt-0 max-h-200 relative [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-gray-100 [&::-webkit-scrollbar-thumb]:bg-gray-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 dark:bg-neutral-900" }, pr = ["onClick"], fr = { class: "flex justify-between items-center w-full" }, vr = { class: "flex items-center" }, mr = {
@@ -2866,78 +2863,78 @@ const lr = /* @__PURE__ */ R(Ys, [["render", tr]]), or = { class: "form-geom__se
2866
2863
  }, kr = {
2867
2864
  key: 2,
2868
2865
  class: "px-3 py-2 text-xs text-gray-400"
2869
- }, _r = /* @__PURE__ */ O({
2866
+ }, _r = /* @__PURE__ */ E({
2870
2867
  __name: "map-search",
2871
2868
  props: {
2872
2869
  placeholder: { default: "50, 30" }
2873
2870
  },
2874
2871
  emits: ["goToCoordinates"],
2875
2872
  setup(o, { emit: e }) {
2876
- const t = e, n = x(!1), s = x("coordinates"), a = x(""), r = x([]), d = x(!1), p = x(!1);
2873
+ const t = e, r = x(!1), s = x("coordinates"), n = x(""), a = x([]), d = x(!1), p = x(!1);
2877
2874
  let f;
2878
2875
  const c = [
2879
2876
  { value: "coordinates", label: "Пошук по кординатам" },
2880
2877
  { value: "atu", label: "АТУ" },
2881
2878
  { value: "address", label: "Адресса" },
2882
2879
  { value: "search_here", label: "Пошук HERE" }
2883
- ], g = D(() => c.find((_) => _.value === s.value)?.label ?? "АТУ");
2884
- function v(_) {
2885
- s.value = _.value, n.value = !1, a.value = "", a.value && U();
2880
+ ], b = T(() => c.find(($) => $.value === s.value)?.label ?? "АТУ");
2881
+ function v($) {
2882
+ s.value = $.value, r.value = !1, n.value = "", n.value && D();
2886
2883
  }
2887
- function C(_) {
2888
- _.target.closest(".map-search__input") || (n.value = !1);
2884
+ function C($) {
2885
+ $.target.closest(".map-search__input") || (r.value = !1);
2889
2886
  }
2890
- ue(() => document.addEventListener("click", C)), Ee(() => document.removeEventListener("click", C));
2891
- async function z(_) {
2892
- let b;
2893
- s.value === "atu" ? b = "/api/suggest/atu.nsdi.ato_level" : s.value === "address" ? b = "/api/suggest/map.address_id" : s.value === "search_here" && (b = "/api/gis-url-proxy");
2894
- const h = new URL(b || "");
2895
- return s.value === "search_here" ? h.searchParams.set("searchtext", _) : (s.value === "atu" || s.value === "address") && h.searchParams.set("key", _), h.searchParams.set("limit", "20"), h.searchParams.set("q", _), (await fetch(h.toString())).json();
2887
+ pe(() => document.addEventListener("click", C)), Ue(() => document.removeEventListener("click", C));
2888
+ async function V($) {
2889
+ let h;
2890
+ s.value === "atu" ? h = "/api/suggest/atu.nsdi.ato_level" : s.value === "address" ? h = "/api/suggest/map.address_id" : s.value === "search_here" && (h = "/api/gis-url-proxy");
2891
+ const g = new URL(h || "");
2892
+ return s.value === "search_here" ? g.searchParams.set("searchtext", $) : (s.value === "atu" || s.value === "address") && g.searchParams.set("key", $), g.searchParams.set("limit", "20"), g.searchParams.set("q", $), (await fetch(g.toString())).json();
2896
2893
  }
2897
- function U() {
2894
+ function D() {
2898
2895
  if (d.value = !0, p.value = !0, s.value === "coordinates") {
2899
- const _ = a.value.trim().split(",");
2900
- if (_.length === 2) {
2901
- const b = parseFloat(_[0]), h = parseFloat(_[1]);
2902
- !Number.isNaN(b) && !Number.isNaN(h) && t("goToCoordinates", [b, h]);
2896
+ const $ = n.value.trim().split(",");
2897
+ if ($.length === 2) {
2898
+ const h = parseFloat($[0]), g = parseFloat($[1]);
2899
+ !Number.isNaN(h) && !Number.isNaN(g) && t("goToCoordinates", [h, g]);
2903
2900
  }
2904
2901
  return;
2905
2902
  }
2906
2903
  f && window.clearTimeout(f), f = window.setTimeout(async () => {
2907
- const _ = a.value.trim();
2908
- if (!_) {
2909
- r.value = [], p.value = !1;
2904
+ const $ = n.value.trim();
2905
+ if (!$) {
2906
+ a.value = [], p.value = !1;
2910
2907
  return;
2911
2908
  }
2912
2909
  try {
2913
- const b = await z(_);
2914
- r.value = Array.isArray(b.features) ? b.features : [];
2910
+ const h = await V($);
2911
+ a.value = Array.isArray(h.features) ? h.features : [];
2915
2912
  } catch {
2916
- r.value = [];
2913
+ a.value = [];
2917
2914
  } finally {
2918
2915
  p.value = !1;
2919
2916
  }
2920
2917
  }, 300);
2921
2918
  }
2922
- function T() {
2923
- a.value = "", r.value = [], d.value = !1, p.value = !1;
2919
+ function U() {
2920
+ n.value = "", a.value = [], d.value = !1, p.value = !1;
2924
2921
  }
2925
- function N(_) {
2926
- t("goToCoordinates", _), d.value = !1, p.value = !1, r.value = [];
2922
+ function N($) {
2923
+ t("goToCoordinates", $), d.value = !1, p.value = !1, a.value = [];
2927
2924
  }
2928
- return (_, b) => (i(), u("div", or, [
2925
+ return ($, h) => (i(), u("div", or, [
2929
2926
  l("div", ar, [
2930
2927
  l("div", sr, [
2931
2928
  l("div", rr, [
2932
2929
  l("button", {
2933
2930
  type: "button",
2934
- onClick: b[0] || (b[0] = (h) => n.value = !n.value),
2931
+ onClick: h[0] || (h[0] = (g) => r.value = !r.value),
2935
2932
  class: "h-[40px] relative px-4 pe-9 flex text-nowrap w-full cursor-pointer bg-white border border-solid border-stone-200 rounded-lg text-start text-sm text-stone-800 focus:outline-none focus:ring-1 focus:ring-blue-600 dark:bg-neutral-800 dark:border-neutral-700 dark:text-neutral-200"
2936
2933
  }, [
2937
2934
  l("div", nr, [
2938
- l("span", ir, F(g.value), 1)
2935
+ l("span", ir, F(b.value), 1)
2939
2936
  ]),
2940
- b[3] || (b[3] = l("svg", {
2937
+ h[3] || (h[3] = l("svg", {
2941
2938
  class: "stroke-gray-500 absolute right-3 translate-y-1/2 bottom-1/2",
2942
2939
  width: "15",
2943
2940
  height: "15",
@@ -2952,30 +2949,30 @@ const lr = /* @__PURE__ */ R(Ys, [["render", tr]]), or = { class: "form-geom__se
2952
2949
  })
2953
2950
  ], -1))
2954
2951
  ]),
2955
- n.value ? (i(), u("div", ur, [
2952
+ r.value ? (i(), u("div", ur, [
2956
2953
  l("div", dr, [
2957
2954
  l("div", cr, [
2958
- (i(), u(ee, null, le(c, (h) => l("div", {
2959
- onClick: (Z) => v(h),
2960
- key: h.value,
2955
+ (i(), u(ee, null, le(c, (g) => l("div", {
2956
+ onClick: (K) => v(g),
2957
+ key: g.value,
2961
2958
  class: "form-autocomplete__item cursor-pointer hs-selected:bg-stone-100 dark:hs-selected:bg-neutral-800 py-2 px-4 w-full text-sm text-gray-800 hover:bg-gray-100 rounded-lg focus:outline-none focus:bg-stone-100 dark:bg-neutral-900 dark:hover:bg-neutral-800 dark:text-neutral-200 dark:focus:bg-neutral-800 cursor-default"
2962
2959
  }, [
2963
2960
  l("div", fr, [
2964
2961
  l("div", vr, [
2965
- l("div", null, F(h.label), 1)
2962
+ l("div", null, F(g.label), 1)
2966
2963
  ]),
2967
- h.value === s.value ? (i(), u("svg", mr, b[4] || (b[4] = [
2964
+ g.value === s.value ? (i(), u("svg", mr, h[4] || (h[4] = [
2968
2965
  l("polyline", { points: "20 6 9 17 4 12" }, null, -1)
2969
- ]))) : j("", !0)
2966
+ ]))) : z("", !0)
2970
2967
  ])
2971
2968
  ], 8, pr)), 64))
2972
2969
  ])
2973
2970
  ])
2974
- ])) : j("", !0)
2971
+ ])) : z("", !0)
2975
2972
  ]),
2976
2973
  l("div", hr, [
2977
2974
  l("div", gr, [
2978
- b[6] || (b[6] = l("i", { class: "absolute bottom-1/2 translate-y-1/2 left-3 text-gray-500" }, [
2975
+ h[6] || (h[6] = l("i", { class: "absolute bottom-1/2 translate-y-1/2 left-3 text-gray-500" }, [
2979
2976
  l("svg", {
2980
2977
  width: "16",
2981
2978
  height: "16",
@@ -2998,23 +2995,23 @@ const lr = /* @__PURE__ */ R(Ys, [["render", tr]]), or = { class: "form-geom__se
2998
2995
  })
2999
2996
  ])
3000
2997
  ], -1)),
3001
- K(l("input", {
2998
+ X(l("input", {
3002
2999
  type: "text",
3003
- "onUpdate:modelValue": b[1] || (b[1] = (h) => a.value = h),
3004
- onInput: U,
3005
- onFocus: b[2] || (b[2] = (h) => d.value = !0),
3000
+ "onUpdate:modelValue": h[1] || (h[1] = (g) => n.value = g),
3001
+ onInput: D,
3002
+ onFocus: h[2] || (h[2] = (g) => d.value = !0),
3006
3003
  placeholder: "lat, lng ex. 50, 30",
3007
3004
  class: "bg-white h-[38px] text-sm py-2 px-3 ps-9 pe-8 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"
3008
3005
  }, null, 544), [
3009
- [de, a.value]
3006
+ [fe, n.value]
3010
3007
  ]),
3011
- a.value ? (i(), u("button", {
3008
+ n.value ? (i(), u("button", {
3012
3009
  key: 0,
3013
- onClick: T,
3010
+ onClick: U,
3014
3011
  class: "absolute right-2 bottom-1/2 translate-y-1/2 text-gray-500 hover:text-red-500",
3015
3012
  "aria-label": "Очистити",
3016
3013
  type: "button"
3017
- }, b[5] || (b[5] = [
3014
+ }, h[5] || (h[5] = [
3018
3015
  l("svg", {
3019
3016
  width: "15",
3020
3017
  height: "15",
@@ -3029,41 +3026,40 @@ const lr = /* @__PURE__ */ R(Ys, [["render", tr]]), or = { class: "form-geom__se
3029
3026
  "stroke-linejoin": "round"
3030
3027
  })
3031
3028
  ], -1)
3032
- ]))) : j("", !0),
3029
+ ]))) : z("", !0),
3033
3030
  d.value && s.value !== "coordinates" ? (i(), u("div", br, [
3034
- r.value.length ? (i(), u("ul", yr, [
3035
- (i(!0), u(ee, null, le(r.value, (h) => (i(), u("li", {
3036
- key: h.properties.place_id,
3037
- onClick: (Z) => N(h),
3031
+ a.value.length ? (i(), u("ul", yr, [
3032
+ (i(!0), u(ee, null, le(a.value, (g) => (i(), u("li", {
3033
+ key: g.properties.place_id,
3034
+ onClick: (K) => N(g),
3038
3035
  class: "px-3 py-2 text-sm cursor-pointer hover:bg-gray-100"
3039
- }, F(h.properties.display_name), 9, xr))), 128))
3036
+ }, F(g.properties.display_name), 9, xr))), 128))
3040
3037
  ])) : p.value ? (i(), u("div", wr, "Шукаю…")) : (i(), u("div", kr, "Нічого не знайдено"))
3041
- ])) : j("", !0)
3038
+ ])) : z("", !0)
3042
3039
  ])
3043
3040
  ])
3044
3041
  ])
3045
3042
  ])
3046
3043
  ]));
3047
3044
  }
3048
- }), $r = { class: "bg-white/95 p-2 rounded-xl shadow border border-gray-200" }, Cr = { class: "flex gap-2" }, Vr = ["onClick", "title"], Mr = ["src"], Lr = /* @__PURE__ */ O({
3045
+ }), $r = { class: "bg-white/95 p-2 rounded-xl shadow border border-gray-200" }, Cr = { class: "flex gap-2" }, Vr = ["onClick", "title"], Mr = ["src"], Lr = /* @__PURE__ */ E({
3049
3046
  __name: "map-layers",
3050
3047
  props: {
3051
- basemaps: {},
3052
- defaultLayer: {}
3048
+ basemaps: {}
3053
3049
  },
3054
3050
  emits: ["onLayerChange"],
3055
3051
  setup(o, { emit: e }) {
3056
- const n = x(o.defaultLayer ?? ""), s = e;
3057
- function a(r) {
3058
- s("onLayerChange", r), n.value = r;
3052
+ const r = x(Object.keys(o.basemaps)[0]), s = e;
3053
+ function n(a) {
3054
+ s("onLayerChange", a), r.value = a;
3059
3055
  }
3060
- return (r, d) => (i(), u("div", $r, [
3056
+ return (a, d) => (i(), u("div", $r, [
3061
3057
  l("div", Cr, [
3062
- (i(!0), u(ee, null, le(r.basemaps, (p, f) => (i(), u("div", {
3058
+ (i(!0), u(ee, null, le(a.basemaps, (p, f) => (i(), u("div", {
3063
3059
  key: f,
3064
- class: V(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm", { "ring-2 ring-blue-500 border-blue-300": n.value === f }]),
3065
- onClick: (c) => a(f),
3066
- title: f,
3060
+ class: M(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm", { "ring-2 ring-blue-500 border-blue-300": r.value === f }]),
3061
+ onClick: (c) => n(f),
3062
+ title: p.name || f,
3067
3063
  role: "button",
3068
3064
  tabindex: "0"
3069
3065
  }, [
@@ -3085,7 +3081,7 @@ const lr = /* @__PURE__ */ R(Ys, [["render", tr]]), or = { class: "form-geom__se
3085
3081
  }, Gr = {
3086
3082
  key: 1,
3087
3083
  class: "text-xs"
3088
- }, Jr = /* @__PURE__ */ O({
3084
+ }, Jr = /* @__PURE__ */ E({
3089
3085
  __name: "vs-input-map",
3090
3086
  props: {
3091
3087
  tools: {},
@@ -3099,208 +3095,215 @@ const lr = /* @__PURE__ */ R(Ys, [["render", tr]]), or = { class: "form-geom__se
3099
3095
  },
3100
3096
  emits: ["update:modelValue"],
3101
3097
  setup(o, { emit: e }) {
3102
- const t = o, n = e, s = x(null);
3103
- let a, r, d;
3104
- const p = x(null), f = x(null), c = x(6), g = x(0), v = x(null), C = {
3105
- topo100: {
3106
- url: "https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",
3107
- preview: "https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"
3108
- },
3109
- orto10: {
3110
- url: "https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",
3111
- preview: "https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4790/2762.png"
3112
- },
3113
- osmb: {
3114
- url: "https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png",
3115
- preview: "https://tile.openstreetmap.org.ua/styles/osm-bright/13/4790/2762.png"
3116
- }
3117
- };
3118
- let z;
3119
- const U = x("topo100");
3120
- function T() {
3098
+ const t = pt(), r = o, s = e, n = x(null);
3099
+ let a, d, p;
3100
+ const f = x(null), c = x(null), b = x(6), v = x(0), C = x(t?.appContext.config.globalProperties.$settings?.center || [50, 30]), V = x(null), D = he();
3101
+ let U;
3102
+ const N = x("topo100");
3103
+ function $() {
3121
3104
  return new Promise((m, y) => {
3122
3105
  window.L && window.L.Draw && m(0);
3123
- const E = (oe) => {
3124
- if (Array.from(document.styleSheets).some((ye) => ye?.href?.includes(oe))) return;
3125
- const fe = document.createElement("link");
3126
- fe.rel = "stylesheet", fe.href = oe, document.head.appendChild(fe);
3127
- }, G = (oe) => new Promise((Ve, fe) => {
3128
- const ye = Array.from(document.scripts).find((ve) => ve.src === oe);
3129
- if (ye) {
3130
- ye.addEventListener("load", () => Ve()), ye.addEventListener("error", (ve) => fe(ve));
3106
+ const R = (ne) => {
3107
+ if (Array.from(document.styleSheets).some((ge) => ge?.href?.includes(ne))) return;
3108
+ const ve = document.createElement("link");
3109
+ ve.rel = "stylesheet", ve.href = ne, document.head.appendChild(ve);
3110
+ }, H = (ne) => new Promise((Se, ve) => {
3111
+ const ge = Array.from(document.scripts).find((ye) => ye.src === ne);
3112
+ if (ge) {
3113
+ ge.addEventListener("load", () => Se()), ge.addEventListener("error", (ye) => ve(ye));
3131
3114
  return;
3132
3115
  }
3133
- const xe = document.createElement("script");
3134
- xe.src = oe, xe.async = !0, xe.onload = () => Ve(), xe.onerror = (ve) => fe(ve), document.body.appendChild(xe);
3116
+ const be = document.createElement("script");
3117
+ be.src = ne, be.async = !0, be.onload = () => Se(), be.onerror = (ye) => ve(ye), document.body.appendChild(be);
3135
3118
  });
3136
- E("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), E("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"), G("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(() => G("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(() => m(0)).catch(y);
3119
+ R("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), R("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"), H("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(() => H("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(() => m(0)).catch(y);
3137
3120
  });
3138
3121
  }
3139
- function N() {
3140
- const m = r.toGeoJSON();
3122
+ function h() {
3123
+ const m = d.toGeoJSON();
3141
3124
  let y = null;
3142
- m?.features?.length && (y = m.features[0].geometry), n("update:modelValue", y), g.value = r.getLayers().length;
3125
+ m?.features?.length && (y = m.features[0].geometry), s("update:modelValue", y), v.value = d.getLayers().length;
3143
3126
  }
3144
- function _(m = 30) {
3145
- const y = r.getLayers();
3127
+ function g(m = 30) {
3128
+ const y = d.getLayers();
3146
3129
  if (!y.length) return;
3147
- const G = L.featureGroup(y).getBounds();
3148
- G && G.isValid() && a.fitBounds(G, { padding: [m, m] });
3130
+ const H = L.featureGroup(y).getBounds();
3131
+ H && H.isValid() && a.fitBounds(H, { padding: [m, m] });
3149
3132
  }
3150
- function b() {
3151
- p.value?.click();
3133
+ function K() {
3134
+ f.value?.click();
3152
3135
  }
3153
- const h = x("");
3154
- function Z(m) {
3136
+ const A = x("");
3137
+ function S(m) {
3155
3138
  return m instanceof L.Circle ? "Circle" : m instanceof L.Rectangle ? "Rectangle" : m instanceof L.Polygon && !(m instanceof L.Rectangle) ? "Polygon" : m instanceof L.Polyline && !(m instanceof L.Polygon) ? "Polyline" : m instanceof L.Marker ? "Point" : "Feature";
3156
3139
  }
3157
- function P(m) {
3140
+ function J(m) {
3158
3141
  if (m instanceof L.Circle) {
3159
3142
  const y = m.getRadius();
3160
3143
  return Math.PI * (y * y) / 1e6;
3161
3144
  }
3162
3145
  if (m instanceof L.Polygon || m instanceof L.Rectangle)
3163
3146
  try {
3164
- const y = m.getLatLngs(), E = Array.isArray(y[0]) ? y[0] : y, G = L.GeometryUtil?.geodesicArea ? L.GeometryUtil.geodesicArea(E) : 0;
3165
- return G ? G / 1e6 : 0;
3147
+ const y = m.getLatLngs(), R = Array.isArray(y[0]) ? y[0] : y, H = L.GeometryUtil?.geodesicArea ? L.GeometryUtil.geodesicArea(R) : 0;
3148
+ return H ? H / 1e6 : 0;
3166
3149
  } catch {
3167
3150
  return null;
3168
3151
  }
3169
3152
  return null;
3170
3153
  }
3171
- function M(m) {
3154
+ function Y(m) {
3172
3155
  return m instanceof L.Circle ? m.getLatLng() : m.getBounds ? m.getBounds().getCenter() : m.getLatLng ? m.getLatLng() : a.getCenter();
3173
3156
  }
3174
- function H() {
3175
- const m = r.getLayers();
3157
+ function ae() {
3158
+ const m = d.getLayers();
3176
3159
  if (!m.length) {
3177
- v.value = null, g.value = 0;
3160
+ V.value = null, v.value = 0;
3178
3161
  return;
3179
3162
  }
3180
- const y = m[m.length - 1], E = Z(y), G = M(y), oe = P(y);
3181
- v.value = {
3182
- type: E,
3183
- center: G,
3184
- areaKm2: oe,
3163
+ const y = m[m.length - 1], R = S(y), H = Y(y), ne = J(y);
3164
+ V.value = {
3165
+ type: R,
3166
+ center: H,
3167
+ areaKm2: ne,
3185
3168
  layer: y
3186
- }, g.value = m.length;
3169
+ }, v.value = m.length;
3187
3170
  }
3188
- function Y() {
3189
- const m = v.value?.layer;
3190
- m && (m instanceof L.Circle && m.getBounds ? a.fitBounds(m.getBounds(), { padding: [30, 30] }) : m.getBounds ? a.fitBounds(m.getBounds(), { padding: [30, 30] }) : m.getLatLng && a.setView(m.getLatLng(), Math.max(c.value, 14)));
3171
+ function $e() {
3172
+ const m = V.value?.layer;
3173
+ m && (m instanceof L.Circle && m.getBounds ? a.fitBounds(m.getBounds(), { padding: [30, 30] }) : m.getBounds ? a.fitBounds(m.getBounds(), { padding: [30, 30] }) : m.getLatLng && a.setView(m.getLatLng(), Math.max(b.value, 14)));
3191
3174
  }
3192
- function we() {
3193
- const m = v.value?.layer;
3194
- m && (r.removeLayer(m), N(), H());
3175
+ function Le() {
3176
+ const m = V.value?.layer;
3177
+ m && (d.removeLayer(m), h(), ae());
3195
3178
  }
3196
- ue(async () => {
3197
- await T(), L.drawLocal = Os, a = L.map(s.value, { zoomControl: !1 }).setView([50, 30], 10), L.control.zoom({ position: "bottomright" }).addTo(a), z = L.tileLayer(C.topo100.url, { maxZoom: 19, minZoom: 6 }).addTo(a), U.value = "topo100", r = new L.FeatureGroup().addTo(a), a.on(L.Draw.Event.CREATED, (E) => {
3198
- const { layer: G } = E;
3199
- r.clearLayers(), r.addLayer(G), N(), H(), _(), h.value = "";
3179
+ pe(async () => {
3180
+ await $(), L.drawLocal = Os, a = L.map(n.value, { zoomControl: !1 }).setView(C.value, 10), L.control.zoom({ position: "bottomright" }).addTo(a), N.value = Object.keys(D)[0], U = L.tileLayer(D[N.value].url, { maxZoom: 19, minZoom: 6 }).addTo(a), d = new L.FeatureGroup().addTo(a), a.on(L.Draw.Event.CREATED, (R) => {
3181
+ const { layer: H } = R;
3182
+ d.clearLayers(), d.addLayer(H), h(), ae(), g(), A.value = "";
3200
3183
  }), a.on(L.Draw.Event.EDITED, () => {
3201
- N(), H(), _();
3184
+ h(), ae(), g();
3202
3185
  }), a.on(L.Draw.Event.DELETED, () => {
3203
- N(), H(), _();
3186
+ h(), ae(), g();
3204
3187
  });
3205
3188
  let m = !1;
3206
- a.on("mousemove", (E) => {
3207
- m || (a.invalidateSize(), m = !0), f.value = E.latlng;
3189
+ a.on("mousemove", (R) => {
3190
+ m || (a.invalidateSize(), m = !0), c.value = R.latlng;
3208
3191
  }), a.on("zoomend", () => {
3209
- c.value = a.getZoom();
3192
+ b.value = a.getZoom();
3210
3193
  });
3211
- const y = Es(t.modelValue);
3194
+ const y = Es(r.modelValue);
3212
3195
  if (y) {
3213
- const E = [];
3214
- L.geoJSON(y).eachLayer((G) => E.push(G)), E.length && r.addLayer(E[0]), N(), H(), _();
3196
+ const R = [];
3197
+ L.geoJSON(y).eachLayer((H) => R.push(H)), R.length && d.addLayer(R[0]), h(), ae(), g();
3215
3198
  }
3216
3199
  });
3217
- function ce(m) {
3200
+ function B(m) {
3218
3201
  if (a) {
3219
- switch (d && d.disable(), m) {
3202
+ switch (p && p.disable(), m) {
3220
3203
  case "marker":
3221
- d = new L.Draw.Marker(a);
3204
+ p = new L.Draw.Marker(a);
3222
3205
  break;
3223
3206
  case "polyline":
3224
- d = new L.Draw.Polyline(a);
3207
+ p = new L.Draw.Polyline(a);
3225
3208
  break;
3226
3209
  case "polygon":
3227
- d = new L.Draw.Polygon(a);
3210
+ p = new L.Draw.Polygon(a);
3228
3211
  break;
3229
3212
  case "rectangle":
3230
- d = new L.Draw.Rectangle(a);
3213
+ p = new L.Draw.Rectangle(a);
3231
3214
  break;
3232
3215
  default:
3233
- d = new L.Draw.Rectangle(a);
3216
+ p = new L.Draw.Rectangle(a);
3234
3217
  break;
3235
3218
  }
3236
- d && (d.enable(), h.value = m);
3219
+ p && (p.enable(), A.value = m);
3237
3220
  }
3238
3221
  }
3239
- function Ce() {
3240
- const m = r.toGeoJSON(), y = new Blob([JSON.stringify(m, null, 2)], { type: "application/json" }), E = URL.createObjectURL(y), G = document.createElement("a");
3241
- G.href = E, G.download = "data.geojson", G.click(), URL.revokeObjectURL(E);
3222
+ function _() {
3223
+ const m = d.toGeoJSON(), y = new Blob([JSON.stringify(m, null, 2)], { type: "application/json" }), R = URL.createObjectURL(y), H = document.createElement("a");
3224
+ H.href = R, H.download = "data.geojson", H.click(), URL.revokeObjectURL(R);
3242
3225
  }
3243
- function I(m) {
3226
+ function j(m) {
3244
3227
  const y = m.target.files?.[0];
3245
3228
  if (!y) return;
3246
- const E = new FileReader();
3247
- E.onload = () => {
3248
- if (typeof E.result == "string")
3229
+ const R = new FileReader();
3230
+ R.onload = () => {
3231
+ if (typeof R.result == "string")
3249
3232
  try {
3250
- const G = JSON.parse(E.result);
3251
- r.clearLayers(), G && L.geoJSON({ type: "Feature", geometry: G }).eachLayer((oe) => {
3252
- r.addLayer(oe);
3253
- }), N(), H(), _();
3233
+ const H = JSON.parse(R.result);
3234
+ d.clearLayers(), H && L.geoJSON({ type: "Feature", geometry: H }).eachLayer((ne) => {
3235
+ d.addLayer(ne);
3236
+ }), h(), ae(), g();
3254
3237
  } finally {
3255
3238
  m.target.value = "";
3256
3239
  }
3257
- }, E.readAsText(y);
3240
+ }, R.readAsText(y);
3258
3241
  }
3259
- function $(m) {
3260
- a && (z && a.removeLayer(z), z = L.tileLayer(C[m].url, { maxZoom: 19, minZoom: 6 }).addTo(a), U.value = m);
3242
+ function q(m) {
3243
+ a && (U && a.removeLayer(U), U = L.tileLayer(D[m].url, { maxZoom: 19, minZoom: 6 }).addTo(a), N.value = m);
3261
3244
  }
3262
- function S(m) {
3245
+ function oe(m) {
3263
3246
  const y = L.latLng(m[0], m[1]);
3264
3247
  a.setView(y, 13);
3265
3248
  }
3266
- ie(
3267
- () => t.modelValue,
3249
+ ue(
3250
+ () => r.modelValue,
3268
3251
  (m) => {
3269
- r.clearLayers(), m && L.geoJSON({ type: "Feature", geometry: m }).eachLayer((y) => {
3270
- r.addLayer(y);
3271
- }), g.value = r.getLayers().length, H(), _();
3252
+ d.clearLayers(), m && L.geoJSON({ type: "Feature", geometry: m }).eachLayer((y) => {
3253
+ d.addLayer(y);
3254
+ }), v.value = d.getLayers().length, ae(), g();
3272
3255
  }
3273
3256
  );
3274
- const q = x(!1);
3275
- return (m, y) => (i(), u("div", {
3276
- class: V(["leaflet-map-wrapper relative w-full h-[400px]", { fullscreen: q.value }])
3257
+ function he() {
3258
+ return t?.appContext.config.globalProperties.$settings?.basemaps ? t?.appContext.config.globalProperties.$settings?.basemaps.map((m, y) => Object.assign(m, { key: `b${y}`, preview: m.preview || m.url.replace("{z}/{x}/{y}.png", "13/4790/2762.png") })).reduce((m, y) => ({ ...m, [y.key]: y }), {}) : {
3259
+ topo100: {
3260
+ url: "https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",
3261
+ preview: "https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"
3262
+ },
3263
+ orto10: {
3264
+ url: "https://data.gki.com.ua/api-user/rtile/orto10/ua/{z}/{x}/{y}.png",
3265
+ preview: "https://data.gki.com.ua/api-user/rtile/orto10/ua/13/4790/2762.png"
3266
+ },
3267
+ osmb: {
3268
+ url: "https://tile.openstreetmap.org.ua/styles/osm-bright/{z}/{x}/{y}.png",
3269
+ preview: "https://tile.openstreetmap.org.ua/styles/osm-bright/13/4790/2762.png"
3270
+ }
3271
+ };
3272
+ }
3273
+ const de = x(!1);
3274
+ return ue(de, () => {
3275
+ setTimeout(() => {
3276
+ a.invalidateSize();
3277
+ }, 50);
3278
+ }), (m, y) => (i(), u("div", {
3279
+ class: M(["leaflet-map-wrapper relative w-full h-[400px]", { fullscreen: de.value }])
3277
3280
  }, [
3278
3281
  l("div", {
3279
3282
  ref_key: "mapContainer",
3280
- ref: s,
3283
+ ref: n,
3281
3284
  class: "w-full h-full"
3282
3285
  }, null, 512),
3283
3286
  l("div", Sr, [
3284
- B(_r, { onGoToCoordinates: S }),
3287
+ I(_r, { onGoToCoordinates: oe }),
3285
3288
  l("div", Br, [
3286
3289
  l("div", jr, [
3287
3290
  l("button", {
3288
3291
  type: "button",
3289
3292
  class: "vs-btn-row",
3290
- onClick: b
3293
+ onClick: K
3291
3294
  }, "Import"),
3292
3295
  l("button", {
3293
3296
  type: "button",
3294
3297
  class: "vs-btn-row",
3295
- onClick: Ce,
3296
- disabled: g.value === 0
3298
+ onClick: _,
3299
+ disabled: v.value === 0
3297
3300
  }, "Export ", 8, Ir)
3298
3301
  ]),
3299
3302
  l("input", {
3300
3303
  ref_key: "importRef",
3301
- ref: p,
3304
+ ref: f,
3302
3305
  type: "file",
3303
- onChange: I,
3306
+ onChange: j,
3304
3307
  accept: ".json,.geojson",
3305
3308
  class: "hidden"
3306
3309
  }, null, 544)
@@ -3309,103 +3312,104 @@ const lr = /* @__PURE__ */ R(Ys, [["render", tr]]), or = { class: "form-geom__se
3309
3312
  l("div", zr, [
3310
3313
  l("div", Ar, [
3311
3314
  l("button", {
3312
- class: V(["vs-btn", { "vs-active": h.value === "marker" }]),
3313
- "aria-pressed": h.value === "marker",
3315
+ class: M(["vs-btn", { "vs-active": A.value === "marker" }]),
3316
+ "aria-pressed": A.value === "marker",
3314
3317
  title: "Point (P)",
3315
3318
  "aria-label": "Draw point",
3316
- onClick: y[0] || (y[0] = (E) => ce("marker"))
3319
+ onClick: y[0] || (y[0] = (R) => B("marker"))
3317
3320
  }, [
3318
- B(Ts)
3321
+ I(Ts)
3319
3322
  ], 10, Or),
3320
3323
  l("button", {
3321
- class: V(["vs-btn", { "vs-active": h.value === "polyline" }]),
3322
- "aria-pressed": h.value === "polyline",
3324
+ class: M(["vs-btn", { "vs-active": A.value === "polyline" }]),
3325
+ "aria-pressed": A.value === "polyline",
3323
3326
  title: "Line (L)",
3324
3327
  "aria-label": "Draw polyline",
3325
- onClick: y[1] || (y[1] = (E) => ce("polyline"))
3328
+ onClick: y[1] || (y[1] = (R) => B("polyline"))
3326
3329
  }, [
3327
- B(Hs)
3330
+ I(Hs)
3328
3331
  ], 10, Er),
3329
3332
  l("button", {
3330
- class: V(["vs-btn", { "vs-active": h.value === "polygon" }]),
3331
- "aria-pressed": h.value === "polygon",
3333
+ class: M(["vs-btn", { "vs-active": A.value === "polygon" }]),
3334
+ "aria-pressed": A.value === "polygon",
3332
3335
  title: "Polygon (G)",
3333
3336
  "aria-label": "Draw polygon",
3334
- onClick: y[2] || (y[2] = (E) => ce("polygon"))
3337
+ onClick: y[2] || (y[2] = (R) => B("polygon"))
3335
3338
  }, [
3336
- B(Ks)
3339
+ I(Ks)
3337
3340
  ], 10, Fr),
3338
3341
  l("button", {
3339
- class: V(["vs-btn", { "vs-active": h.value === "rectangle" }]),
3340
- "aria-pressed": h.value === "rectangle",
3342
+ class: M(["vs-btn", { "vs-active": A.value === "rectangle" }]),
3343
+ "aria-pressed": A.value === "rectangle",
3341
3344
  title: "Rectangle (R)",
3342
3345
  "aria-label": "Draw rectangle",
3343
- onClick: y[3] || (y[3] = (E) => ce("rectangle"))
3346
+ onClick: y[3] || (y[3] = (R) => B("rectangle"))
3344
3347
  }, [
3345
- B(Xs)
3348
+ I(Xs)
3346
3349
  ], 10, Dr),
3347
3350
  l("button", {
3348
3351
  class: "vs-btn mt-5",
3349
- onClick: y[4] || (y[4] = (E) => q.value = !q.value),
3352
+ onClick: y[4] || (y[4] = (R) => {
3353
+ de.value = !de.value;
3354
+ }),
3350
3355
  title: "Full Screen",
3351
3356
  "aria-label": "Full Screen"
3352
3357
  }, [
3353
- B(lr, { style: { width: "12px", height: "12px" } })
3358
+ I(lr, { style: { width: "12px", height: "12px" } })
3354
3359
  ])
3355
3360
  ])
3356
3361
  ]),
3357
3362
  l("div", {
3358
- class: V(["absolute left-4 z-[1000]", v.value ? "bottom-8" : "bottom-4"])
3363
+ class: M(["absolute left-4 z-[1000]", V.value ? "bottom-8" : "bottom-4"])
3359
3364
  }, [
3360
- B(Lr, {
3361
- basemaps: C,
3362
- "default-layer": "topo100",
3363
- onOnLayerChange: $
3364
- })
3365
+ I(Lr, {
3366
+ basemaps: G(D),
3367
+ onOnLayerChange: q
3368
+ }, null, 8, ["basemaps"])
3365
3369
  ], 2),
3366
3370
  l("div", Ur, [
3367
- v.value ? (i(), u("div", Tr, [
3371
+ V.value ? (i(), u("div", Tr, [
3368
3372
  l("div", Rr, [
3369
- y[7] || (y[7] = se(" Тип: ")),
3370
- l("span", Pr, F(v.value.type), 1)
3373
+ y[7] || (y[7] = ie(" Тип: ")),
3374
+ l("span", Pr, F(V.value.type), 1)
3371
3375
  ]),
3372
3376
  l("div", Nr, [
3373
3377
  l("div", Hr, [
3374
- y[8] || (y[8] = se(" Центр: ")),
3375
- l("b", null, F(v.value.center.lat.toFixed(5)) + ", " + F(v.value.center.lng.toFixed(5)), 1)
3378
+ y[8] || (y[8] = ie(" Центр: ")),
3379
+ l("b", null, F(V.value.center.lat.toFixed(5)) + ", " + F(V.value.center.lng.toFixed(5)), 1)
3376
3380
  ]),
3377
- v.value.areaKm2 !== null ? (i(), u("div", qr, [
3378
- y[9] || (y[9] = se(" Площа: ")),
3379
- l("b", null, F(v.value.areaKm2.toFixed(1)) + "км²", 1)
3381
+ V.value.areaKm2 !== null ? (i(), u("div", qr, [
3382
+ y[9] || (y[9] = ie(" Площа: ")),
3383
+ l("b", null, F(V.value.areaKm2.toFixed(1)) + "км²", 1)
3380
3384
  ])) : (i(), u("div", Gr, y[10] || (y[10] = [
3381
- se(" Площа: "),
3385
+ ie(" Площа: "),
3382
3386
  l("b", null, "—", -1)
3383
3387
  ]))),
3384
3388
  l("button", {
3385
3389
  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",
3386
3390
  title: "Наблизити",
3387
- onClick: y[5] || (y[5] = (E) => Y())
3391
+ onClick: y[5] || (y[5] = (R) => $e())
3388
3392
  }, y[11] || (y[11] = [
3389
- re('<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-ac23d238><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" data-v-ac23d238></path><path d="M7 10l6 0" data-v-ac23d238></path><path d="M10 7l0 6" data-v-ac23d238></path><path d="M21 21l-6 -6" data-v-ac23d238></path></svg>', 1)
3393
+ re('<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-e82d2d97><path d="M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0" data-v-e82d2d97></path><path d="M7 10l6 0" data-v-e82d2d97></path><path d="M10 7l0 6" data-v-e82d2d97></path><path d="M21 21l-6 -6" data-v-e82d2d97></path></svg>', 1)
3390
3394
  ])),
3391
3395
  l("button", {
3392
3396
  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",
3393
3397
  title: "Видалити",
3394
- onClick: y[6] || (y[6] = (E) => we())
3398
+ onClick: y[6] || (y[6] = (R) => Le())
3395
3399
  }, [
3396
- B(ze, { class: "w-3 h-3" })
3400
+ I(Ee, { class: "w-3 h-3" })
3397
3401
  ])
3398
3402
  ])
3399
- ])) : j("", !0)
3403
+ ])) : z("", !0)
3400
3404
  ])
3401
3405
  ], 2));
3402
3406
  }
3403
- }), Kr = /* @__PURE__ */ R(Jr, [["__scopeId", "data-v-ac23d238"]]), Zr = ["data-focus"], Wr = { class: "flex items-center" }, Qr = { class: "overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border" }, Xr = ["onClick", "aria-label"], Yr = {
3407
+ }), Kr = /* @__PURE__ */ P(Jr, [["__scopeId", "data-v-e82d2d97"]]), Zr = ["data-focus"], Wr = { class: "flex items-center" }, Qr = { class: "overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border" }, Xr = ["onClick", "aria-label"], Yr = {
3404
3408
  key: 0,
3405
3409
  class: "absolute text-gray-500 truncate pl-2"
3406
- }, en = { class: "flex-1 min-w-[2px]" }, tn = ["placeholder"], ln = { class: "flex items-center shrink-0" }, on = ["disabled"], an = /* @__PURE__ */ O({
3410
+ }, en = { class: "flex-1 min-w-[2px]" }, tn = ["placeholder"], ln = { class: "flex items-center shrink-0" }, on = ["disabled"], an = /* @__PURE__ */ E({
3407
3411
  __name: "vs-input-tag",
3408
- props: /* @__PURE__ */ Q({
3412
+ props: /* @__PURE__ */ W({
3409
3413
  unique: { type: Boolean, default: !0 },
3410
3414
  style: { default: () => ({}) },
3411
3415
  customClass: { default: "" },
@@ -3418,71 +3422,71 @@ const lr = /* @__PURE__ */ R(Ys, [["render", tr]]), or = { class: "form-geom__se
3418
3422
  modelValue: { default: [] },
3419
3423
  modelModifiers: {}
3420
3424
  }),
3421
- emits: /* @__PURE__ */ Q(["update:modelValue"], ["update:modelValue"]),
3425
+ emits: /* @__PURE__ */ W(["update:modelValue"], ["update:modelValue"]),
3422
3426
  setup(o, { emit: e }) {
3423
- const t = o, n = e;
3424
- be(t.style);
3425
- const s = x(null), a = x(null), r = x(null), d = x(!1), p = x(""), f = X(o, "modelValue"), c = D(() => t.placeholder || "Add tag…"), g = D(() => f.value?.length === 0 && p.value === ""), v = D(() => !t.disabled && f.value?.length > 0), C = D(() => t.disabled), z = async () => {
3426
- C.value || await Me(() => r.value?.focus());
3427
- }, U = (P) => {
3428
- const M = P.trim();
3429
- M !== "" && (!f.value || !Array.isArray(f.value) ? f.value = [M] : t.unique ? f.value.includes(M) || (f.value = [...f.value, M]) : f.value = [...f.value, M], p.value = "");
3430
- }, T = () => {
3431
- const P = p.value;
3432
- P.trim() !== "" && U(P), p.value = "";
3433
- }, N = (P) => {
3434
- const M = f.value.slice();
3435
- M.splice(P, 1), n("update:modelValue", M);
3436
- }, _ = () => {
3437
- n("update:modelValue", []);
3438
- }, b = () => {
3439
- C.value || (d.value = !0);
3427
+ const t = o, r = e;
3428
+ _e(t.style);
3429
+ const s = x(null), n = x(null), a = x(null), d = x(!1), p = x(""), f = Q(o, "modelValue"), c = T(() => t.placeholder || "Add tag…"), b = T(() => f.value?.length === 0 && p.value === ""), v = T(() => !t.disabled && f.value?.length > 0), C = T(() => t.disabled), V = async () => {
3430
+ C.value || await Be(() => a.value?.focus());
3431
+ }, D = (A) => {
3432
+ const S = A.trim();
3433
+ S !== "" && (!f.value || !Array.isArray(f.value) ? f.value = [S] : t.unique ? f.value.includes(S) || (f.value = [...f.value, S]) : f.value = [...f.value, S], p.value = "");
3434
+ }, U = () => {
3435
+ const A = p.value;
3436
+ A.trim() !== "" && D(A), p.value = "";
3437
+ }, N = (A) => {
3438
+ const S = f.value.slice();
3439
+ S.splice(A, 1), r("update:modelValue", S);
3440
+ }, $ = () => {
3441
+ r("update:modelValue", []);
3440
3442
  }, h = () => {
3443
+ C.value || (d.value = !0);
3444
+ }, g = () => {
3441
3445
  d.value = !1;
3442
- }, Z = (P) => {
3443
- const { key: M } = P;
3444
- M === "Enter" ? (P.preventDefault(), T()) : M === "Backspace" && p.value === "" && f.value.length > 0 && N(f.value.length - 1);
3446
+ }, K = (A) => {
3447
+ const { key: S } = A;
3448
+ S === "Enter" ? (A.preventDefault(), U()) : S === "Backspace" && p.value === "" && f.value.length > 0 && N(f.value.length - 1);
3445
3449
  };
3446
- return (P, M) => (i(), u("div", {
3450
+ return (A, S) => (i(), u("div", {
3447
3451
  class: "flex gap-1 w-full",
3448
3452
  ref_key: "root",
3449
3453
  ref: s,
3450
- onClick: M[1] || (M[1] = ne(() => {
3454
+ onClick: S[1] || (S[1] = ce(() => {
3451
3455
  }, ["stop"]))
3452
3456
  }, [
3453
3457
  l("div", {
3454
- class: V(["relative w-full font-sans", t.customClass]),
3458
+ class: M(["relative w-full font-sans", t.customClass]),
3455
3459
  role: "group",
3456
3460
  "aria-label": "Tag input"
3457
3461
  }, [
3458
3462
  l("div", {
3459
- class: V([
3463
+ class: M([
3460
3464
  "flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
3461
3465
  "border-gray-300 hover:border-gray-400",
3462
3466
  d.value ? "border-blue-500 ring-1 ring-blue-500" : "",
3463
3467
  C.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
3464
3468
  ]),
3465
3469
  "data-focus": d.value ? "true" : "false",
3466
- onClick: z
3470
+ onClick: V
3467
3471
  }, [
3468
3472
  l("div", {
3469
3473
  class: "flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",
3470
3474
  ref_key: "chipsRef",
3471
- ref: a
3475
+ ref: n
3472
3476
  }, [
3473
- (i(!0), u(ee, null, le(f.value, (H, Y) => (i(), u("div", {
3477
+ (i(!0), u(ee, null, le(f.value, (J, Y) => (i(), u("div", {
3474
3478
  key: Y,
3475
3479
  class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"
3476
3480
  }, [
3477
3481
  l("div", Wr, [
3478
- l("div", Qr, F(H), 1)
3482
+ l("div", Qr, F(J), 1)
3479
3483
  ]),
3480
3484
  l("div", {
3481
3485
  role: "button",
3482
3486
  class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
3483
- onClick: ne((we) => N(Y), ["stop"]),
3484
- "aria-label": `Remove ${H}`
3485
- }, M[2] || (M[2] = [
3487
+ onClick: ce((ae) => N(Y), ["stop"]),
3488
+ "aria-label": `Remove ${J}`
3489
+ }, S[2] || (S[2] = [
3486
3490
  l("svg", {
3487
3491
  height: "14",
3488
3492
  width: "14",
@@ -3495,12 +3499,12 @@ const lr = /* @__PURE__ */ R(Ys, [["render", tr]]), or = { class: "form-geom__se
3495
3499
  ], -1)
3496
3500
  ]), 8, Xr)
3497
3501
  ]))), 128)),
3498
- g.value ? (i(), u("div", Yr, F(c.value), 1)) : j("", !0),
3502
+ b.value ? (i(), u("div", Yr, F(c.value), 1)) : z("", !0),
3499
3503
  l("div", en, [
3500
- C.value ? j("", !0) : K((i(), u("input", {
3504
+ C.value ? z("", !0) : X((i(), u("input", {
3501
3505
  key: 0,
3502
3506
  ref_key: "inputRef",
3503
- ref: r,
3507
+ ref: a,
3504
3508
  class: "pl-2 w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",
3505
3509
  autocapitalize: "none",
3506
3510
  autocomplete: "off",
@@ -3509,13 +3513,13 @@ const lr = /* @__PURE__ */ R(Ys, [["render", tr]]), or = { class: "form-geom__se
3509
3513
  type: "text",
3510
3514
  tabindex: "0",
3511
3515
  "aria-label": "Add tag",
3512
- "onUpdate:modelValue": M[0] || (M[0] = (H) => p.value = H),
3513
- onFocus: b,
3514
- onBlur: h,
3515
- onKeydown: Z,
3516
+ "onUpdate:modelValue": S[0] || (S[0] = (J) => p.value = J),
3517
+ onFocus: h,
3518
+ onBlur: g,
3519
+ onKeydown: K,
3516
3520
  placeholder: f.value && f.value.length ? "" : void 0
3517
3521
  }, null, 40, tn)), [
3518
- [de, p.value]
3522
+ [fe, p.value]
3519
3523
  ])
3520
3524
  ])
3521
3525
  ], 512),
@@ -3526,8 +3530,8 @@ const lr = /* @__PURE__ */ R(Ys, [["render", tr]]), or = { class: "form-geom__se
3526
3530
  class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
3527
3531
  "aria-label": "Clear all tags",
3528
3532
  disabled: C.value,
3529
- onClick: ne(_, ["stop"])
3530
- }, M[3] || (M[3] = [
3533
+ onClick: ce($, ["stop"])
3534
+ }, S[3] || (S[3] = [
3531
3535
  l("svg", {
3532
3536
  height: "20",
3533
3537
  width: "20",
@@ -3536,34 +3540,34 @@ const lr = /* @__PURE__ */ R(Ys, [["render", tr]]), or = { class: "form-geom__se
3536
3540
  }, [
3537
3541
  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" })
3538
3542
  ], -1)
3539
- ]), 8, on)) : j("", !0)
3543
+ ]), 8, on)) : z("", !0)
3540
3544
  ])
3541
3545
  ], 10, Zr)
3542
3546
  ], 2)
3543
3547
  ], 512));
3544
3548
  }
3545
3549
  }), sn = {
3546
- VsInputText: Ge,
3547
- VsInputRadio: Ke,
3548
- "vs-input-text": Ge,
3550
+ VsInputText: qe,
3551
+ VsInputRadio: Je,
3552
+ "vs-input-text": qe,
3549
3553
  "vs-input-textarea": za,
3550
3554
  "vs-input-mask": nl,
3551
3555
  "vs-input-number": jt,
3552
- "vs-input-radio": Ke,
3556
+ "vs-input-radio": Je,
3553
3557
  "vs-input-select": ja,
3554
- "vs-input-switcher": ot,
3555
- "vs-input-static": Je,
3558
+ "vs-input-switcher": lt,
3559
+ "vs-input-static": Ge,
3556
3560
  "vs-input-container": ia,
3557
3561
  "vs-input-date": wl,
3558
3562
  "vs-input-checkbox": yl,
3559
3563
  "vs-input-file": ro,
3560
- "vs-input-html": Je,
3564
+ "vs-input-html": Ge,
3561
3565
  "vs-input-email": dl,
3562
3566
  "vs-input-datatable": As,
3563
3567
  "vs-input-map": Kr,
3564
3568
  "vs-input-file-list": Fo,
3565
3569
  "vs-input-tag": an
3566
- }, rn = /* @__PURE__ */ O({
3570
+ }, rn = /* @__PURE__ */ E({
3567
3571
  __name: "behavior",
3568
3572
  props: {
3569
3573
  api: {},
@@ -3573,31 +3577,31 @@ const lr = /* @__PURE__ */ R(Ys, [["render", tr]]), or = { class: "form-geom__se
3573
3577
  value: {}
3574
3578
  },
3575
3579
  setup(o) {
3576
- const e = o, t = Be("values");
3577
- async function n() {
3580
+ const e = o, t = ze("values");
3581
+ async function r() {
3578
3582
  try {
3579
3583
  if (!e.api) return;
3580
- const s = e.api.replace("{{value}}", e.value), a = await fetch(s);
3581
- if (!a.ok) {
3582
- pe({ type: "warning", title: "Validation", message: "При спробі завантажити дані виникла помилка." });
3584
+ const s = e.api.replace("{{value}}", e.value), n = await fetch(s);
3585
+ if (!n.ok) {
3586
+ me({ type: "warning", title: "Validation", message: "При спробі завантажити дані виникла помилка." });
3583
3587
  return;
3584
3588
  }
3585
- const r = await a.json();
3589
+ const a = await n.json();
3586
3590
  if (!e.set || !t) return;
3587
3591
  for (const [d, p] of Object.entries(e.set))
3588
- t.value[d] = r.result[p];
3592
+ t.value[d] = a.result[p];
3589
3593
  } catch (s) {
3590
3594
  console.error(e.error, s);
3591
3595
  }
3592
3596
  }
3593
- return (s, a) => (i(), u("button", {
3594
- onClick: n,
3597
+ return (s, n) => (i(), u("button", {
3598
+ onClick: r,
3595
3599
  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"
3596
3600
  }, F(s.button), 1));
3597
3601
  }
3598
- }), nn = { class: "flex w-full" }, rt = /* @__PURE__ */ O({
3602
+ }), nn = { class: "flex w-full" }, st = /* @__PURE__ */ E({
3599
3603
  __name: "vs-compact-form-layout",
3600
- props: /* @__PURE__ */ Q({
3604
+ props: /* @__PURE__ */ W({
3601
3605
  item: { default: {} },
3602
3606
  layout: { default: "default" },
3603
3607
  style: { default: {} },
@@ -3609,39 +3613,39 @@ const lr = /* @__PURE__ */ R(Ys, [["render", tr]]), or = { class: "form-geom__se
3609
3613
  }),
3610
3614
  emits: ["update:modelValue"],
3611
3615
  setup(o) {
3612
- const e = o, t = X(o, "modelValue"), n = D(() => Lt[`${e.layout}`]), s = D(() => sn?.[`vs-input-${e.item.type}`]), a = D(() => {
3613
- const d = J(s);
3616
+ const e = o, t = Q(o, "modelValue"), r = T(() => Lt[`${e.layout}`]), s = T(() => sn?.[`vs-input-${e.item.type}`]), n = T(() => {
3617
+ const d = G(s);
3614
3618
  if (!d) return /* @__PURE__ */ new Set();
3615
3619
  const p = d.props ?? d.__vccOpts?.props;
3616
3620
  if (!p) return /* @__PURE__ */ new Set();
3617
3621
  const f = Array.isArray(p) ? p : Object.keys(p);
3618
3622
  return new Set(f);
3619
- }), r = D(() => {
3620
- const d = e.item ?? {}, p = a.value;
3623
+ }), a = T(() => {
3624
+ const d = e.item ?? {}, p = n.value;
3621
3625
  return p.size ? Object.fromEntries(Object.entries(d).filter(([f]) => p.has(f))) : {};
3622
3626
  });
3623
- return (d, p) => (i(), te(_e(n.value), {
3627
+ return (d, p) => (i(), te(Ve(r.value), {
3624
3628
  ua: e.item.ua,
3625
3629
  error: e.error || "",
3626
3630
  item: d.item,
3627
3631
  label: e.item.label
3628
3632
  }, {
3629
- default: $e(() => [
3633
+ default: Me(() => [
3630
3634
  l("div", nn, [
3631
- (i(), te(_e(s.value), Le(r.value, {
3635
+ (i(), te(Ve(s.value), je(a.value, {
3632
3636
  modelValue: t.value,
3633
3637
  "onUpdate:modelValue": p[0] || (p[0] = (f) => t.value = f)
3634
3638
  }), null, 16, ["modelValue"])),
3635
- d.item.behavior ? (i(), te(rn, Le({ key: 0 }, d.item.behavior, { value: t.value }), null, 16, ["value"])) : j("", !0)
3639
+ d.item.behavior ? (i(), te(rn, je({ key: 0 }, d.item.behavior, { value: t.value }), null, 16, ["value"])) : z("", !0)
3636
3640
  ])
3637
3641
  ]),
3638
3642
  _: 1
3639
3643
  }, 8, ["ua", "error", "item", "label"]));
3640
3644
  }
3641
- }), nt = {
3645
+ }), rt = {
3642
3646
  required: "Це поле є обов’язковим",
3643
3647
  email: "Неправильний email"
3644
- }, un = (o) => o ? !1 : nt.required, dn = (o) => !o && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o) ? nt.email : !1, cn = (o, e) => {
3648
+ }, un = (o) => o ? !1 : rt.required, dn = (o) => !o && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o) ? rt.email : !1, cn = (o, e) => {
3645
3649
  const t = e.pattern ?? e.regexp;
3646
3650
  return !(typeof t == "string" ? new RegExp(t) : t).test(o) && o ? e.message : !1;
3647
3651
  }, pn = (o, e) => !1, fn = (o, e) => {
@@ -3669,63 +3673,63 @@ const lr = /* @__PURE__ */ R(Ys, [["render", tr]]), or = { class: "form-geom__se
3669
3673
  file: "file"
3670
3674
  // mask: 'text',
3671
3675
  };
3672
- function Xe(o) {
3676
+ function Qe(o) {
3673
3677
  const e = o.toLowerCase();
3674
3678
  return vn[e] || e;
3675
3679
  }
3676
3680
  function mn(o) {
3677
3681
  if (Array.isArray(o)) {
3678
3682
  const t = [];
3679
- return o.forEach((n) => {
3680
- const s = { ...n };
3681
- s.name = (n.name || n.id || n.key || "").toString(), s.type = Xe(n.type), s.label = n.label || n.ua, s.rules = n.rules || n.validators, n.data && (s.api = `/api/suggest/${n.data}`), t.push(s);
3683
+ return o.forEach((r) => {
3684
+ const s = { ...r };
3685
+ s.name = (r.name || r.id || r.key || "").toString(), s.type = Qe(r.type), s.label = r.label || r.ua, s.rules = r.rules || r.validators, r.data && (s.api = `/api/suggest/${r.data}`), t.push(s);
3682
3686
  }), t;
3683
3687
  }
3684
3688
  const e = [];
3685
3689
  return Object.entries(o).forEach((t) => {
3686
- const n = {
3690
+ const r = {
3687
3691
  name: t[0],
3688
3692
  ...t[1],
3689
- type: Xe(t[1].type),
3693
+ type: Qe(t[1].type),
3690
3694
  label: t[1].label || t[1].ua,
3691
3695
  rules: t[1].rules || t[1].validators
3692
3696
  };
3693
- t[1].type.includes("list") && (n.multiple = !0), t[1].data && (n.api = `/api/suggest/${t[1].data}`), e.push(n);
3697
+ t[1].type.includes("list") && (r.multiple = !0), t[1].data && (r.api = `/api/suggest/${t[1].data}`), e.push(r);
3694
3698
  }), e;
3695
3699
  }
3696
3700
  function hn(o, e) {
3697
- const t = mn(e), n = x({});
3701
+ const t = mn(e), r = x({});
3698
3702
  function s(p) {
3699
3703
  const f = p?.conditions;
3700
3704
  if (!f) return !0;
3701
- const c = Array.isArray(f) ? f[0] : f, g = o?.value?.[c];
3702
- return st(g, f);
3705
+ const c = Array.isArray(f) ? f[0] : f, b = o?.value?.[c];
3706
+ return at(b, f);
3703
3707
  }
3704
- const a = (p = t, f = !0) => (p.forEach((c) => {
3708
+ const n = (p = t, f = !0) => (p.forEach((c) => {
3705
3709
  if (c.rules) {
3706
3710
  if (!s(c)) {
3707
- delete n.value[c.name];
3711
+ delete r.value[c.name];
3708
3712
  return;
3709
3713
  }
3710
- c.rules.forEach((g) => {
3711
- const v = fn(o.value[c.name], g);
3712
- v ? n.value[c.name] = v : delete n.value[c.name];
3714
+ c.rules.forEach((b) => {
3715
+ const v = fn(o.value[c.name], b);
3716
+ v ? r.value[c.name] = v : delete r.value[c.name];
3713
3717
  });
3714
3718
  }
3715
- c.schema && a(c.schema, !1);
3716
- }), f && Object.values(n.value).some(Boolean) ? n.value : null), r = D(() => t?.filter((p) => s(p)));
3719
+ c.schema && n(c.schema, !1);
3720
+ }), f && Object.values(r.value).some(Boolean) ? r.value : null), a = T(() => t?.filter((p) => s(p)));
3717
3721
  return {
3718
- errors: n,
3719
- validate: a,
3722
+ errors: r,
3723
+ validate: n,
3720
3724
  reset: () => {
3721
- o.value = {}, n.value = {};
3725
+ o.value = {}, r.value = {};
3722
3726
  },
3723
- visibleSchema: r
3727
+ visibleSchema: a
3724
3728
  };
3725
3729
  }
3726
- const Ie = /* @__PURE__ */ O({
3730
+ const Oe = /* @__PURE__ */ E({
3727
3731
  __name: "vs-compact-form",
3728
- props: /* @__PURE__ */ Q({
3732
+ props: /* @__PURE__ */ W({
3729
3733
  schema: { default: () => [] },
3730
3734
  style: { default: () => ({}) },
3731
3735
  modelValue: {},
@@ -3737,57 +3741,57 @@ const Ie = /* @__PURE__ */ O({
3737
3741
  values: { default: () => ({}) },
3738
3742
  valuesModifiers: {}
3739
3743
  }),
3740
- emits: /* @__PURE__ */ Q(["handle-submit", "update:modelValue"], ["update:form", "update:values"]),
3744
+ emits: /* @__PURE__ */ W(["handle-submit", "update:modelValue"], ["update:form", "update:values"]),
3741
3745
  setup(o, { expose: e, emit: t }) {
3742
- const n = t, s = o, a = X(o, "form"), r = X(o, "values"), {
3746
+ const r = t, s = o, n = Q(o, "form"), a = Q(o, "values"), {
3743
3747
  errors: d,
3744
3748
  validate: p,
3745
3749
  reset: f,
3746
3750
  visibleSchema: c
3747
- } = hn(r, s.schema), g = () => {
3748
- n("update:modelValue", r.value), p(), n("handle-submit", r.value);
3751
+ } = hn(a, s.schema), b = () => {
3752
+ r("update:modelValue", a.value), p(), r("handle-submit", a.value);
3749
3753
  };
3750
3754
  e({
3751
3755
  validate: p,
3752
3756
  reset: f,
3753
3757
  errors: d
3754
- }), ue(() => {
3755
- s.modelValue && (r.value = s.modelValue), a.value.value = r.value, a.value.errors = d.value, a.value.reset = f, a.value.validate = p, a.value.formId = s.formId;
3758
+ }), pe(() => {
3759
+ s.modelValue && (a.value = s.modelValue), n.value.value = a.value, n.value.errors = d.value, n.value.reset = f, n.value.validate = p, n.value.formId = s.formId;
3756
3760
  });
3757
- function v(C, z) {
3758
- if (C === z) return !0;
3759
- if (typeof C != "object" || typeof z != "object" || !C || !z) return !1;
3760
- const U = Object.keys(C), T = Object.keys(z);
3761
- return U.length !== T.length ? !1 : U.every((N) => C[N] === z[N]);
3761
+ function v(C, V) {
3762
+ if (C === V) return !0;
3763
+ if (typeof C != "object" || typeof V != "object" || !C || !V) return !1;
3764
+ const D = Object.keys(C), U = Object.keys(V);
3765
+ return D.length !== U.length ? !1 : D.every((N) => C[N] === V[N]);
3762
3766
  }
3763
- return He("form", a), He("values", r), (C, z) => (i(), u("form", {
3764
- onSubmit: ne(g, ["prevent"]),
3765
- class: V(["grid grid-cols-12", C.layout === "default" ? "gap-6" : "gap-4"])
3767
+ return He("form", n), He("values", a), (C, V) => (i(), u("form", {
3768
+ onSubmit: ce(b, ["prevent"]),
3769
+ class: M(["grid grid-cols-12", C.layout === "default" ? "gap-6" : "gap-4"])
3766
3770
  }, [
3767
- (i(!0), u(ee, null, le(J(c), (U) => (i(), te(rt, {
3768
- key: U.name,
3769
- class: V(C.layout === "horizontal" ? "col-span-12" : `col-span-${U.col || 12} `),
3770
- style: he(C.style),
3771
- item: U,
3771
+ (i(!0), u(ee, null, le(G(c), (D) => (i(), te(st, {
3772
+ key: D.name,
3773
+ class: M(C.layout === "horizontal" ? "col-span-12" : `col-span-${D.col || 12} `),
3774
+ style: we(C.style),
3775
+ item: D,
3772
3776
  layout: C.layout,
3773
- "model-value": r.value[U.name],
3774
- "onUpdate:modelValue": (T) => {
3775
- const N = r.value[U.name];
3776
- v(N, T) || (r.value[U.name] = T);
3777
+ "model-value": a.value[D.name],
3778
+ "onUpdate:modelValue": (U) => {
3779
+ const N = a.value[D.name];
3780
+ v(N, U) || (a.value[D.name] = U);
3777
3781
  },
3778
- error: J(d)[U.name]
3782
+ error: G(d)[D.name]
3779
3783
  }, null, 8, ["class", "style", "item", "layout", "model-value", "onUpdate:modelValue", "error"]))), 128))
3780
3784
  ], 34));
3781
3785
  }
3782
3786
  });
3783
- Ie.install = function(e) {
3784
- e.component("VForm", Ie), Object.assign(e.config.globalProperties, {
3785
- $form: Oe
3786
- }), e.provide("form", Oe), window.v3plugin || (window.v3plugin = {});
3787
+ Oe.install = function(e) {
3788
+ e.component("VForm", Oe), Object.assign(e.config.globalProperties, {
3789
+ $form: De
3790
+ }), e.provide("form", De), window.v3plugin || (window.v3plugin = {});
3787
3791
  };
3788
3792
  export {
3789
3793
  ma as ModalEdit,
3790
- Ie as VForm,
3794
+ Oe as VForm,
3791
3795
  yl as VsInputCheckbox,
3792
3796
  ia as VsInputContainer,
3793
3797
  wl as VsInputDate,
@@ -3796,14 +3800,14 @@ export {
3796
3800
  Fo as VsInputFileList,
3797
3801
  nl as VsInputMask,
3798
3802
  jt as VsInputNumber,
3799
- Ke as VsInputRadio,
3803
+ Je as VsInputRadio,
3800
3804
  ja as VsInputSelect,
3801
- Je as VsInputStatic,
3802
- ot as VsInputSwitcher,
3805
+ Ge as VsInputStatic,
3806
+ lt as VsInputSwitcher,
3803
3807
  an as VsInputTag,
3804
- Ge as VsInputText,
3808
+ qe as VsInputText,
3805
3809
  za as VsInputTextarea,
3806
- Ie as default,
3810
+ Oe as default,
3807
3811
  sn as inputs,
3808
3812
  As as vsInputDatatable,
3809
3813
  Kr as vsInputMap