@opengis/form 0.0.24 → 0.0.25

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,15 +1,15 @@
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
- const mt = {
1
+ import { defineComponent as E, ref as w, onMounted as pe, onUnmounted as Re, createElementBlock as u, openBlock as i, normalizeClass as j, createCommentVNode as A, renderSlot as _e, createElementVNode as l, toDisplayString as R, normalizeProps as Pe, guardReactiveProps as Ne, createTextVNode as ie, computed as T, mergeModels as X, useModel as Y, withDirectives as W, unref as G, vModelText as ce, vModelCheckbox as tt, createVNode as B, createBlock as oe, resolveDynamicComponent as Le, normalizeStyle as ke, withCtx as Se, withModifiers as de, onBeforeUnmount as ft, watch as te, createStaticVNode as re, vModelRadio as lt, Fragment as Q, renderList as le, mergeProps as Ie, reactive as vt, vShow as He, inject as Ve, resolveComponent as Je, Transition as ot, nextTick as je, Teleport as mt, getCurrentInstance as ht, provide as Ke } from "vue";
2
+ import { notify as ge, modal as gt, VsModal as bt } from "@opengis/core";
3
+ const yt = {
4
4
  key: 0,
5
5
  class: "text-[14px] font-medium text-gray-900 mb-2"
6
- }, ht = { class: "opacity-100" }, gt = {
6
+ }, xt = { class: "opacity-100" }, wt = {
7
7
  key: 0,
8
8
  class: "text-red-500 text-[14px]"
9
- }, bt = {
9
+ }, kt = {
10
10
  key: 1,
11
11
  class: "text-red-500 text-[10px] absolute bottom-[-14px]"
12
- }, yt = /* @__PURE__ */ E({
12
+ }, _t = /* @__PURE__ */ E({
13
13
  __name: "vs-layout-default",
14
14
  props: {
15
15
  ua: { default: "" },
@@ -23,34 +23,34 @@ const mt = {
23
23
  label: { default: "" }
24
24
  },
25
25
  setup(o) {
26
- const e = x("uk"), t = (r) => {
26
+ const e = w("uk"), t = (r) => {
27
27
  r.detail.key === "locale" && (e.value = r.detail.newValue);
28
28
  };
29
29
  return pe(() => {
30
30
  e.value = localStorage.locale, window.addEventListener("storage", t);
31
- }), Ue(() => {
31
+ }), Re(() => {
32
32
  window.removeEventListener("resize", t);
33
33
  }), (r, s) => (i(), u("div", {
34
- class: M(["w-full relative", { "opacity-60": r.item.disabled }])
34
+ class: j(["w-full relative", { "opacity-60": r.item.disabled }])
35
35
  }, [
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)
36
+ r.ua || r.label ? (i(), u("div", yt, [
37
+ l("span", xt, R(r.item[e.value] || r.ua || r.label), 1),
38
+ r.item?.rules?.includes("required") ? (i(), u("span", wt, "*")) : A("", !0)
39
+ ])) : A("", !0),
40
+ _e(r.$slots, "default", Pe(Ne(r.$attrs))),
41
+ r.error ? (i(), u("span", kt, R(r.error), 1)) : A("", !0)
42
42
  ], 2));
43
43
  }
44
- }), xt = { class: "w-full relative flex flex-row items-center gap-2" }, wt = {
44
+ }), $t = { class: "w-full relative flex flex-row items-center gap-2" }, Ct = {
45
45
  key: 0,
46
46
  class: "text-sm text-gray-900 font-medium flex shrink-0 w-3/12 max-w-[250px]"
47
- }, kt = {
47
+ }, Vt = {
48
48
  key: 0,
49
49
  class: "text-red-500 text-[14px]"
50
- }, _t = {
50
+ }, Mt = {
51
51
  key: 1,
52
52
  class: "text-red-500 text-[10px] absolute bottom-[-14px]"
53
- }, $t = /* @__PURE__ */ E({
53
+ }, Lt = /* @__PURE__ */ E({
54
54
  __name: "vs-layout-horizontal",
55
55
  props: {
56
56
  ua: { default: "" },
@@ -64,19 +64,19 @@ const mt = {
64
64
  label: { default: "" }
65
65
  },
66
66
  setup(o) {
67
- return (e, t) => (i(), u("div", xt, [
68
- e.item?.type !== "html" ? (i(), u("span", wt, [
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)
67
+ return (e, t) => (i(), u("div", $t, [
68
+ e.item?.type !== "html" ? (i(), u("span", Ct, [
69
+ ie(R(e.ua || e.label) + " ", 1),
70
+ e.item?.rules?.includes("required") && (e.ua || e.label) ? (i(), u("span", Vt, "*")) : A("", !0)
71
+ ])) : A("", !0),
72
+ _e(e.$slots, "default", Pe(Ne(e.$attrs))),
73
+ e.error ? (i(), u("span", Mt, R(e.error), 1)) : A("", !0)
74
74
  ]));
75
75
  }
76
- }), Ct = { class: "w-full relative" }, Vt = {
76
+ }), St = { class: "w-full relative" }, Bt = {
77
77
  key: 0,
78
78
  class: "text-red-500 text-[10px] absolute bottom-[-14px]"
79
- }, Mt = /* @__PURE__ */ E({
79
+ }, jt = /* @__PURE__ */ E({
80
80
  __name: "vs-layout-inline",
81
81
  props: {
82
82
  ua: { default: "" },
@@ -90,17 +90,17 @@ const mt = {
90
90
  label: { default: "" }
91
91
  },
92
92
  setup(o) {
93
- return (e, t) => (i(), u("div", Ct, [
94
- ke(e.$slots, "default", Te(Re(e.$attrs))),
95
- e.error ? (i(), u("span", Vt, F(e.error), 1)) : z("", !0)
93
+ return (e, t) => (i(), u("div", St, [
94
+ _e(e.$slots, "default", Pe(Ne(e.$attrs))),
95
+ e.error ? (i(), u("span", Bt, R(e.error), 1)) : A("", !0)
96
96
  ]));
97
97
  }
98
- }), Lt = {
99
- default: yt,
100
- horizontal: $t,
101
- inline: Mt
98
+ }), It = {
99
+ default: _t,
100
+ horizontal: Lt,
101
+ inline: jt
102
102
  };
103
- function _e(o) {
103
+ function $e(o) {
104
104
  return {
105
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 `;
@@ -108,9 +108,9 @@ function _e(o) {
108
108
  })
109
109
  };
110
110
  }
111
- const St = ["placeholder", "disabled"], qe = /* @__PURE__ */ E({
111
+ const zt = ["placeholder", "disabled"], Ae = /* @__PURE__ */ E({
112
112
  __name: "vs-input-text",
113
- props: /* @__PURE__ */ W({
113
+ props: /* @__PURE__ */ X({
114
114
  style: { default: () => ({}) },
115
115
  customClass: { default: "" },
116
116
  disabled: { type: Boolean, default: !1 },
@@ -124,23 +124,23 @@ const St = ["placeholder", "disabled"], qe = /* @__PURE__ */ E({
124
124
  }),
125
125
  emits: ["update:modelValue"],
126
126
  setup(o) {
127
- const e = o, { inputClass: t } = _e(e.style), r = Q(o, "modelValue");
128
- return (s, n) => X((i(), u("input", {
127
+ const e = o, { inputClass: t } = $e(e.style), r = Y(o, "modelValue");
128
+ return (s, n) => W((i(), u("input", {
129
129
  type: "text",
130
130
  "onUpdate:modelValue": n[0] || (n[0] = (a) => r.value = a),
131
131
  placeholder: s.placeholder,
132
132
  disabled: s.disabled,
133
- class: M(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [G(t), { "!border-red-600": s.error }]]),
133
+ class: j(["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
- }, null, 10, St)), [
138
- [fe, r.value]
137
+ }, null, 10, zt)), [
138
+ [ce, r.value]
139
139
  ]);
140
140
  }
141
- }), Bt = ["placeholder"], jt = /* @__PURE__ */ E({
141
+ }), Ft = ["placeholder"], Ot = /* @__PURE__ */ E({
142
142
  __name: "vs-input-number",
143
- props: /* @__PURE__ */ W({
143
+ props: /* @__PURE__ */ X({
144
144
  style: { default: () => ({}) },
145
145
  customClass: {},
146
146
  disabled: { type: Boolean },
@@ -154,26 +154,26 @@ const St = ["placeholder", "disabled"], qe = /* @__PURE__ */ E({
154
154
  }),
155
155
  emits: ["update:modelValue"],
156
156
  setup(o) {
157
- const e = o, { inputClass: t } = _e(e.style), r = Q(o, "modelValue");
158
- return (s, n) => X((i(), u("input", {
157
+ const e = o, { inputClass: t } = $e(e.style), r = Y(o, "modelValue");
158
+ return (s, n) => W((i(), u("input", {
159
159
  type: "number",
160
160
  step: "any",
161
161
  "onUpdate:modelValue": n[0] || (n[0] = (a) => r.value = a),
162
162
  placeholder: s.placeholder,
163
- class: M(["py-1.5 px-3 block w-full bg-white", [G(t)]]),
163
+ class: j(["py-1.5 px-3 block w-full bg-white", [G(t)]]),
164
164
  style: {
165
165
  border: "1px solid #CFD9E0"
166
166
  }
167
- }, null, 10, Bt)), [
168
- [fe, r.value]
167
+ }, null, 10, Ft)), [
168
+ [ce, r.value]
169
169
  ]);
170
170
  }
171
- }), P = (o, e) => {
171
+ }), N = (o, e) => {
172
172
  const t = o.__vccOpts || o;
173
173
  for (const [r, s] of e)
174
174
  t[r] = s;
175
175
  return t;
176
- }, It = {}, zt = {
176
+ }, At = {}, Et = {
177
177
  xmlns: "http://www.w3.org/2000/svg",
178
178
  viewBox: "0 0 24 24",
179
179
  fill: "none",
@@ -183,8 +183,8 @@ const St = ["placeholder", "disabled"], qe = /* @__PURE__ */ E({
183
183
  "stroke-linejoin": "round",
184
184
  class: "icon icon-tabler icons-tabler-outline icon-tabler-check"
185
185
  };
186
- function At(o, e) {
187
- return i(), u("svg", zt, e[0] || (e[0] = [
186
+ function Dt(o, e) {
187
+ return i(), u("svg", Et, e[0] || (e[0] = [
188
188
  l("path", {
189
189
  stroke: "none",
190
190
  d: "M0 0h24v24H0z",
@@ -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__ */ 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({
196
+ const Ut = /* @__PURE__ */ N(At, [["render", Dt]]), Tt = { class: "flex items-center gap-[4px]" }, Rt = ["value", "id", "disabled"], Pt = ["for"], Nt = { class: "text-[14px] text-gray-700 flex items-center gap-x-1 ml-1 dark:text-neutral-400" }, Ht = /* @__PURE__ */ E({
197
197
  __name: "vs-checkbox-default",
198
198
  props: {
199
199
  value: { default: "" },
@@ -210,41 +210,41 @@ const Ot = /* @__PURE__ */ P(It, [["render", At]]), Et = { class: "flex items-ce
210
210
  get: () => r.modelValue,
211
211
  set: (n) => t("update:modelValue", n)
212
212
  });
213
- return (n, a) => (i(), u("div", Et, [
214
- X(l("input", {
213
+ return (n, a) => (i(), u("div", Tt, [
214
+ W(l("input", {
215
215
  type: "checkbox",
216
216
  value: n.value,
217
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 }]),
218
+ class: j(["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
219
  id: n.id,
220
220
  disabled: n.disabled
221
- }, null, 10, Ft), [
222
- [Xe, s.value]
221
+ }, null, 10, Rt), [
222
+ [tt, s.value]
223
223
  ]),
224
224
  l("label", {
225
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 }])
226
+ class: j(["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: 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" : ""]])
229
+ class: j(["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
- I(Ot, {
231
+ B(Ut, {
232
232
  height: "12",
233
233
  width: "12"
234
234
  })
235
235
  ], 2),
236
- l("span", Ut, [
237
- ke(n.$slots, "default", {}, () => [
238
- ie(F(n.label), 1)
236
+ l("span", Nt, [
237
+ _e(n.$slots, "default", {}, () => [
238
+ ie(R(n.label), 1)
239
239
  ])
240
240
  ])
241
- ], 10, Dt)
241
+ ], 10, Pt)
242
242
  ]));
243
243
  }
244
- }), Rt = ["name", "value", "disabled"], Pt = { class: "flex items-center gap-[6px] text-[14px]" }, Nt = {
244
+ }), qt = ["name", "value", "disabled"], Gt = { class: "flex items-center gap-[6px] text-[14px]" }, Jt = {
245
245
  key: 0,
246
246
  class: "text-[16px]"
247
- }, Ht = ["src"], qt = /* @__PURE__ */ E({
247
+ }, Kt = ["src"], Zt = /* @__PURE__ */ E({
248
248
  __name: "vs-checkbox-buttons",
249
249
  props: {
250
250
  value: { type: [String, Number, Boolean], default: "" },
@@ -265,39 +265,39 @@ const Ot = /* @__PURE__ */ P(It, [["render", At]]), Et = { class: "flex items-ce
265
265
  }
266
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: 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"]])
268
+ class: j(["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
- X(l("input", {
270
+ W(l("input", {
271
271
  type: "checkbox",
272
272
  class: "hidden",
273
273
  name: d.id,
274
274
  value: d.value,
275
275
  "onUpdate:modelValue": p[0] || (p[0] = (f) => s.value = f),
276
276
  disabled: d.disabled
277
- }, null, 8, Rt), [
278
- [Xe, s.value]
277
+ }, null, 8, qt), [
278
+ [tt, s.value]
279
279
  ]),
280
- l("span", Pt, [
281
- d.icon || d.imgUrl ? (i(), u("span", Nt, [
280
+ l("span", Gt, [
281
+ d.icon || d.imgUrl ? (i(), u("span", Jt, [
282
282
  d.icon ? (i(), u("i", {
283
283
  key: 0,
284
- class: M(d.icon)
285
- }, null, 2)) : z("", !0),
284
+ class: j(d.icon)
285
+ }, null, 2)) : A("", !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)) : z("", !0)
293
- ])) : z("", !0),
294
- ke(d.$slots, "default", {}, () => [
295
- ie(F(d.label), 1)
292
+ }, null, 8, Kt)) : A("", !0)
293
+ ])) : A("", !0),
294
+ _e(d.$slots, "default", {}, () => [
295
+ ie(R(d.label), 1)
296
296
  ])
297
297
  ])
298
298
  ], 2));
299
299
  }
300
- }), Gt = { class: "flex items-center" }, tt = /* @__PURE__ */ E({
300
+ }), Wt = { class: "flex items-center" }, at = /* @__PURE__ */ E({
301
301
  __name: "vs-input-checkbox-item",
302
302
  props: {
303
303
  value: { default: "" },
@@ -323,9 +323,9 @@ const Ot = /* @__PURE__ */ P(It, [["render", At]]), Et = { class: "flex items-ce
323
323
  } else
324
324
  r("update:modelValue", d);
325
325
  }
326
- }), a = x(`vs-checkbox-${t.view || "default"}`);
327
- return (d, p) => (i(), u("div", Gt, [
328
- (i(), te(Ve(a.value === "vs-checkbox-buttons" ? G(qt) : G(Tt)), {
326
+ }), a = w(`vs-checkbox-${t.view || "default"}`);
327
+ return (d, p) => (i(), u("div", Wt, [
328
+ (i(), oe(Le(a.value === "vs-checkbox-buttons" ? G(Zt) : G(Ht)), {
329
329
  value: d.value,
330
330
  label: d.label,
331
331
  info: d.option?.info,
@@ -335,17 +335,17 @@ const Ot = /* @__PURE__ */ P(It, [["render", At]]), Et = { class: "flex items-ce
335
335
  id: s,
336
336
  icon: d.icon,
337
337
  imgUrl: d.imgUrl,
338
- style: we(d.style),
338
+ style: ke(d.style),
339
339
  error: d.error
340
340
  }, {
341
- default: Me(() => [
342
- ie(F(d.label), 1)
341
+ default: Se(() => [
342
+ ie(R(d.label), 1)
343
343
  ]),
344
344
  _: 1
345
345
  }, 8, ["value", "label", "info", "disabled", "modelValue", "icon", "imgUrl", "style", "error"]))
346
346
  ]));
347
347
  }
348
- }), Jt = {}, Kt = {
348
+ }), Qt = {}, Xt = {
349
349
  xmlns: "http://www.w3.org/2000/svg",
350
350
  viewBox: "0 0 24 24",
351
351
  fill: "none",
@@ -355,8 +355,8 @@ const Ot = /* @__PURE__ */ P(It, [["render", At]]), Et = { class: "flex items-ce
355
355
  "stroke-linejoin": "round",
356
356
  class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down"
357
357
  };
358
- function Zt(o, e) {
359
- return i(), u("svg", Kt, e[0] || (e[0] = [
358
+ function Yt(o, e) {
359
+ return i(), u("svg", Xt, e[0] || (e[0] = [
360
360
  l("path", {
361
361
  stroke: "none",
362
362
  d: "M0 0h24v24H0z",
@@ -365,7 +365,28 @@ function Zt(o, e) {
365
365
  l("path", { d: "M6 9l6 6l6 -6" }, null, -1)
366
366
  ]));
367
367
  }
368
- const Wt = /* @__PURE__ */ P(Jt, [["render", Zt]]), Qt = {}, Xt = {
368
+ const el = /* @__PURE__ */ N(Qt, [["render", Yt]]), tl = {}, ll = {
369
+ xmlns: "http://www.w3.org/2000/svg",
370
+ viewBox: "0 0 24 24",
371
+ fill: "none",
372
+ stroke: "currentColor",
373
+ "stroke-width": "2",
374
+ "stroke-linecap": "round",
375
+ "stroke-linejoin": "round",
376
+ class: "icon icon-tabler icons-tabler-outline icon-tabler-x"
377
+ };
378
+ function ol(o, e) {
379
+ return i(), u("svg", ll, e[0] || (e[0] = [
380
+ l("path", {
381
+ stroke: "none",
382
+ d: "M0 0h24v24H0z",
383
+ fill: "none"
384
+ }, null, -1),
385
+ l("path", { d: "M18 6l-12 12" }, null, -1),
386
+ l("path", { d: "M6 6l12 12" }, null, -1)
387
+ ]));
388
+ }
389
+ const al = /* @__PURE__ */ N(tl, [["render", ol]]), sl = {}, rl = {
369
390
  xmlns: "http://www.w3.org/2000/svg",
370
391
  width: "24",
371
392
  height: "24",
@@ -376,8 +397,8 @@ const Wt = /* @__PURE__ */ P(Jt, [["render", Zt]]), Qt = {}, Xt = {
376
397
  "stroke-linecap": "round",
377
398
  "stroke-linejoin": "round"
378
399
  };
379
- function Yt(o, e) {
380
- return i(), u("svg", Xt, e[0] || (e[0] = [
400
+ function nl(o, e) {
401
+ return i(), u("svg", rl, e[0] || (e[0] = [
381
402
  l("path", {
382
403
  stroke: "none",
383
404
  d: "M0 0h24v24H0z",
@@ -388,15 +409,15 @@ function Yt(o, e) {
388
409
  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
410
  ]));
390
411
  }
391
- const el = /* @__PURE__ */ P(Qt, [["render", Yt]]), tl = {
412
+ const il = /* @__PURE__ */ N(sl, [["render", nl]]), ul = {
392
413
  key: 0,
393
414
  class: "flex items-start gap-x-1"
394
- }, ll = {
415
+ }, dl = {
395
416
  key: 0,
396
417
  class: "text-red-500 text-[14px]"
397
- }, ol = ["title"], al = ["disabled"], lt = /* @__PURE__ */ E({
418
+ }, cl = ["title"], pl = ["disabled"], st = /* @__PURE__ */ E({
398
419
  __name: "vs-input-switcher",
399
- props: /* @__PURE__ */ W({
420
+ props: /* @__PURE__ */ X({
400
421
  rules: { default: () => [] },
401
422
  view: { default: "checkbox" },
402
423
  label: { default: "" },
@@ -415,38 +436,38 @@ const el = /* @__PURE__ */ P(Qt, [["render", Yt]]), tl = {
415
436
  }),
416
437
  emits: ["update:modelValue"],
417
438
  setup(o) {
418
- const e = o, t = Q(o, "modelValue");
419
- return (r, s) => e.view === "checkbox" ? (i(), u("div", tl, [
420
- I(tt, {
439
+ const e = o, t = Y(o, "modelValue");
440
+ return (r, s) => e.view === "checkbox" ? (i(), u("div", ul, [
441
+ B(at, {
421
442
  modelValue: t.value,
422
443
  "onUpdate:modelValue": s[0] || (s[0] = (n) => t.value = n),
423
444
  label: r.text,
424
445
  error: r.error || ""
425
446
  }, null, 8, ["modelValue", "label", "error"]),
426
- r.rules?.includes("required") ? (i(), u("span", ll, "*")) : z("", !0),
447
+ r.rules?.includes("required") ? (i(), u("span", dl, "*")) : A("", !0),
427
448
  r.i ? (i(), u("button", {
428
449
  key: 1,
429
450
  class: "cursor-pointer",
430
451
  title: r.i,
431
- onClick: s[1] || (s[1] = ce(() => {
452
+ onClick: s[1] || (s[1] = de(() => {
432
453
  }, ["prevent"]))
433
454
  }, [
434
- I(G(el), { class: "text-gray-500 w-[14px] h-[14px]" })
435
- ], 8, ol)) : z("", !0)
455
+ B(G(il), { class: "text-gray-500 w-[14px] h-[14px]" })
456
+ ], 8, cl)) : A("", !0)
436
457
  ])) : (i(), u("button", {
437
458
  key: 1,
438
459
  type: "button",
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]]),
460
+ class: j(["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
461
  disabled: r.disabled,
441
462
  onClick: s[2] || (s[2] = (n) => t.value = !t.value)
442
463
  }, [
443
464
  l("span", {
444
465
  "data-state": "checked",
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"]])
466
+ class: j(["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
467
  }, null, 2)
447
- ], 10, al));
468
+ ], 10, pl));
448
469
  }
449
- }), sl = ["innerHTML"], Ge = /* @__PURE__ */ E({
470
+ }), fl = ["innerHTML"], Ze = /* @__PURE__ */ E({
450
471
  __name: "vs-input-static",
451
472
  props: {
452
473
  text: { default: "" },
@@ -461,13 +482,13 @@ const el = /* @__PURE__ */ P(Qt, [["render", Yt]]), tl = {
461
482
  },
462
483
  setup(o) {
463
484
  return (e, t) => (i(), u("div", {
464
- class: M(e.customClass),
485
+ class: j(e.customClass),
465
486
  innerHTML: e.html ? e.html : e.text
466
- }, null, 10, sl));
487
+ }, null, 10, fl));
467
488
  }
468
- }), rl = ["placeholder", "disabled", "name"], nl = /* @__PURE__ */ E({
489
+ }), vl = ["placeholder", "disabled", "name"], ml = /* @__PURE__ */ E({
469
490
  __name: "vs-input-mask",
470
- props: /* @__PURE__ */ W({
491
+ props: /* @__PURE__ */ X({
471
492
  name: {},
472
493
  mask: { default: "" },
473
494
  unmask: { type: Boolean, default: !1 },
@@ -483,7 +504,7 @@ const el = /* @__PURE__ */ P(Qt, [["render", Yt]]), tl = {
483
504
  }),
484
505
  emits: ["update:modelValue"],
485
506
  setup(o) {
486
- const e = o, { inputClass: t } = _e(e.style), r = Q(o, "modelValue"), s = x(null);
507
+ const e = o, { inputClass: t } = $e(e.style), r = Y(o, "modelValue"), s = w(null);
487
508
  let n = null;
488
509
  return pe(async () => {
489
510
  if (s.value) {
@@ -502,9 +523,9 @@ const el = /* @__PURE__ */ P(Qt, [["render", Yt]]), tl = {
502
523
  r.value = e.unmask ? n.unmaskedValue : n.value;
503
524
  }), n.value = r.value ?? "";
504
525
  }
505
- }), ut(() => {
526
+ }), ft(() => {
506
527
  n?.destroy();
507
- }), ue(() => e.mask, (a) => {
528
+ }), te(() => e.mask, (a) => {
508
529
  n && n.updateOptions({
509
530
  mask: a,
510
531
  definitions: {
@@ -513,7 +534,7 @@ const el = /* @__PURE__ */ P(Qt, [["render", Yt]]), tl = {
513
534
  "*": /[a-zA-Z0-9]/
514
535
  }
515
536
  });
516
- }), ue(r, (a) => {
537
+ }), te(r, (a) => {
517
538
  n && n.unmaskedValue !== a && (n.value = a || "");
518
539
  }), (a, d) => (i(), u("input", {
519
540
  type: "text",
@@ -522,15 +543,15 @@ const el = /* @__PURE__ */ P(Qt, [["render", Yt]]), tl = {
522
543
  placeholder: a.placeholder,
523
544
  disabled: a.disabled,
524
545
  name: a.name,
525
- class: M(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [G(t)]]),
546
+ class: j(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [G(t)]]),
526
547
  style: {
527
548
  border: "1px solid #CFD9E0"
528
549
  }
529
- }, null, 10, rl));
550
+ }, null, 10, vl));
530
551
  }
531
- }), il = { class: "relative w-full bg-white rounded-lg" }, ul = ["placeholder", "disabled"], dl = /* @__PURE__ */ E({
552
+ }), hl = { class: "relative w-full bg-white rounded-lg" }, gl = ["placeholder", "disabled"], bl = /* @__PURE__ */ E({
532
553
  __name: "vs-input-email",
533
- props: /* @__PURE__ */ W({
554
+ props: /* @__PURE__ */ X({
534
555
  style: { default: () => ({}) },
535
556
  customClass: { default: "" },
536
557
  disabled: { type: Boolean, default: !1 },
@@ -544,26 +565,26 @@ const el = /* @__PURE__ */ P(Qt, [["render", Yt]]), tl = {
544
565
  }),
545
566
  emits: ["update:modelValue"],
546
567
  setup(o) {
547
- const e = o, { inputClass: t } = _e(e.style), r = Q(o, "modelValue");
548
- return (s, n) => (i(), u("div", il, [
568
+ const e = o, { inputClass: t } = $e(e.style), r = Y(o, "modelValue");
569
+ return (s, n) => (i(), u("div", hl, [
549
570
  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", {
571
+ W(l("input", {
551
572
  type: "email",
552
573
  "onUpdate:modelValue": n[0] || (n[0] = (a) => r.value = a),
553
574
  placeholder: s.placeholder,
554
575
  disabled: s.disabled,
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 }]]),
576
+ class: j(["!pl-8 py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [G(t), { "!border-red-600": s.error }]]),
556
577
  style: {
557
578
  border: "1px solid #CFD9E0"
558
579
  }
559
- }, null, 10, ul), [
560
- [fe, r.value]
580
+ }, null, 10, gl), [
581
+ [ce, r.value]
561
582
  ])
562
583
  ]));
563
584
  }
564
- }), cl = ["value", "disabled"], pl = { class: "text-[13px] text-gray-700" }, fl = /* @__PURE__ */ E({
585
+ }), yl = ["value", "disabled"], xl = { class: "text-[13px] text-gray-700" }, wl = /* @__PURE__ */ E({
565
586
  __name: "vs-input-radio-default",
566
- props: /* @__PURE__ */ W({
587
+ props: /* @__PURE__ */ X({
567
588
  style: {},
568
589
  customClass: { default: "" },
569
590
  disabled: { type: Boolean, default: !1 },
@@ -579,36 +600,36 @@ const el = /* @__PURE__ */ P(Qt, [["render", Yt]]), tl = {
579
600
  }),
580
601
  emits: ["update:modelValue"],
581
602
  setup(o) {
582
- const e = Q(o, "modelValue");
603
+ const e = Y(o, "modelValue");
583
604
  return (t, r) => (i(), u("label", {
584
- class: M(["flex items-center gap-0", [t.customClass]])
605
+ class: j(["flex items-center gap-0", [t.customClass]])
585
606
  }, [
586
- X(l("input", {
607
+ W(l("input", {
587
608
  "onUpdate:modelValue": r[0] || (r[0] = (s) => e.value = s),
588
609
  type: "radio",
589
610
  value: t.value,
590
611
  disabled: t.disabled,
591
612
  class: "hidden"
592
- }, null, 8, cl), [
593
- [Ye, e.value]
613
+ }, null, 8, yl), [
614
+ [lt, e.value]
594
615
  ]),
595
616
  l("span", {
596
- class: M(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]", [
617
+ class: j(["w-[16px] shrink-0 h-[16px] border rounded-full flex items-center justify-center mr-[10px]", [
597
618
  `border-${t.style?.primaryColor || "blue"}-500`,
598
619
  t.disabled ? "opacity-50 cursor-not-allowed" : ""
599
620
  ]])
600
621
  }, [
601
622
  e.value == t.value ? (i(), u("span", {
602
623
  key: 0,
603
- class: M(["w-[12px] h-[12px] shrink-0 rounded-full", [`bg-${t.style?.primaryColor || "blue"}-500`]])
604
- }, null, 2)) : z("", !0)
624
+ class: j(["w-[12px] h-[12px] shrink-0 rounded-full", [`bg-${t.style?.primaryColor || "blue"}-500`]])
625
+ }, null, 2)) : A("", !0)
605
626
  ], 2),
606
- l("span", pl, F(t.text), 1)
627
+ l("span", xl, R(t.text), 1)
607
628
  ], 2));
608
629
  }
609
- }), vl = ["value", "disabled"], ml = { class: "text-[13px] text-gray-700" }, hl = /* @__PURE__ */ E({
630
+ }), kl = ["value", "disabled"], _l = { class: "text-[13px] text-gray-700" }, $l = /* @__PURE__ */ E({
610
631
  __name: "vs-input-radio-buttons",
611
- props: /* @__PURE__ */ W({
632
+ props: /* @__PURE__ */ X({
612
633
  style: {},
613
634
  customClass: { default: "" },
614
635
  disabled: { type: Boolean, default: !1 },
@@ -624,31 +645,31 @@ const el = /* @__PURE__ */ P(Qt, [["render", Yt]]), tl = {
624
645
  }),
625
646
  emits: ["update:modelValue"],
626
647
  setup(o) {
627
- const e = Q(o, "modelValue");
648
+ const e = Y(o, "modelValue");
628
649
  return (t, r) => (i(), u("label", {
629
- class: M(["flex items-center border rounded-lg px-2 py-1", [
650
+ class: j(["flex items-center border rounded-lg px-2 py-1", [
630
651
  e.value == t.value ? `ring-2 ring-ring ring-${t.style?.primaryColor || "blue"}-500` : "",
631
652
  t.customClass
632
653
  ]])
633
654
  }, [
634
- X(l("input", {
655
+ W(l("input", {
635
656
  "onUpdate:modelValue": r[0] || (r[0] = (s) => e.value = s),
636
657
  type: "radio",
637
658
  value: t.value,
638
659
  disabled: t.disabled,
639
660
  class: "hidden"
640
- }, null, 8, vl), [
641
- [Ye, e.value]
661
+ }, null, 8, kl), [
662
+ [lt, e.value]
642
663
  ]),
643
- l("span", ml, F(t.text), 1)
664
+ l("span", _l, R(t.text), 1)
644
665
  ], 2));
645
666
  }
646
- }), gl = {
647
- "vs-input-radio-default": fl,
648
- "vs-input-radio-buttons": hl
649
- }, Je = /* @__PURE__ */ E({
667
+ }), Cl = {
668
+ "vs-input-radio-default": wl,
669
+ "vs-input-radio-buttons": $l
670
+ }, We = /* @__PURE__ */ E({
650
671
  __name: "vs-input-radio",
651
- props: /* @__PURE__ */ W({
672
+ props: /* @__PURE__ */ X({
652
673
  options: {},
653
674
  position: { default: "vertical" },
654
675
  view: { default: "default" },
@@ -665,11 +686,11 @@ const el = /* @__PURE__ */ P(Qt, [["render", Yt]]), tl = {
665
686
  }),
666
687
  emits: ["update:modelValue"],
667
688
  setup(o) {
668
- const e = o, t = Q(o, "modelValue"), r = T(() => gl[`vs-input-radio-${e.view}`]);
689
+ const e = o, t = Y(o, "modelValue"), r = T(() => Cl[`vs-input-radio-${e.view}`]);
669
690
  return (s, n) => (i(), u("div", {
670
- class: M([s.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
691
+ class: j([s.position === "horizontal" ? "flex items-center flex-wrap gap-2" : ""])
671
692
  }, [
672
- (i(!0), u(ee, null, le(s.options, (a) => (i(), te(Ve(r.value), je({
693
+ (i(!0), u(Q, null, le(s.options, (a) => (i(), oe(Le(r.value), Ie({
673
694
  key: a?.id,
674
695
  text: a.text,
675
696
  value: a.id.toString(),
@@ -679,7 +700,7 @@ const el = /* @__PURE__ */ P(Qt, [["render", Yt]]), tl = {
679
700
  }, { ref_for: !0 }, s.$attrs), null, 16, ["text", "value", "checked", "modelValue"]))), 128))
680
701
  ], 2));
681
702
  }
682
- }), bl = /* @__PURE__ */ E({
703
+ }), Vl = /* @__PURE__ */ E({
683
704
  __name: "vs-input-checkbox",
684
705
  props: {
685
706
  options: { default: () => [] },
@@ -698,39 +719,39 @@ const el = /* @__PURE__ */ P(Qt, [["render", Yt]]), tl = {
698
719
  },
699
720
  emits: ["update:modelValue"],
700
721
  setup(o, { emit: e }) {
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 () => {
722
+ const t = o, r = e, s = w([]), n = vt({}), 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
723
  try {
703
- const c = await fetch(`/api/suggest/${t.data}`).then((b) => b.json());
724
+ const c = await fetch(`/api/suggest/${t.data}`).then((m) => m.json());
704
725
  s.value = c?.data || c;
705
726
  } catch (c) {
706
727
  console.error(c);
707
728
  }
708
729
  };
709
- return ue(
730
+ return te(
710
731
  () => t.modelValue,
711
732
  (c) => {
712
733
  if (typeof c == "boolean" && s.value.length === 1) {
713
- const b = a(s.value[0]);
714
- n[b] = c;
734
+ const m = a(s.value[0]);
735
+ n[m] = c;
715
736
  } else if (Array.isArray(c)) {
716
- const b = new Set(c);
737
+ const m = new Set(c);
717
738
  s.value.forEach((v) => {
718
739
  if (!v.disabled) {
719
740
  const C = a(v);
720
- n[C] = b.has(C);
741
+ n[C] = m.has(C);
721
742
  }
722
743
  });
723
744
  }
724
745
  },
725
746
  { immediate: !0 }
726
- ), ue(
747
+ ), te(
727
748
  n,
728
749
  () => {
729
750
  if (!s.value.length) {
730
751
  r("update:modelValue", null);
731
752
  return;
732
753
  }
733
- const c = Object.entries(n).filter(([, b]) => b).map(([b]) => b);
754
+ const c = Object.entries(n).filter(([, m]) => m).map(([m]) => m);
734
755
  r("update:modelValue", c.length === 0 ? [] : c);
735
756
  },
736
757
  { deep: !0 }
@@ -742,9 +763,9 @@ const el = /* @__PURE__ */ P(Qt, [["render", Yt]]), tl = {
742
763
  n[c] = t.modelValue;
743
764
  } else if (Array.isArray(t.modelValue)) {
744
765
  const c = new Set(t.modelValue);
745
- s.value.forEach((b) => {
746
- if (!b.disabled) {
747
- const v = a(b);
766
+ s.value.forEach((m) => {
767
+ if (!m.disabled) {
768
+ const v = a(m);
748
769
  n[v] = c.has(v);
749
770
  }
750
771
  });
@@ -755,21 +776,21 @@ const el = /* @__PURE__ */ P(Qt, [["render", Yt]]), tl = {
755
776
  n[c] = t.modelValue;
756
777
  } else if (Array.isArray(t.modelValue)) {
757
778
  const c = new Set(t.modelValue);
758
- s.value.forEach((b) => {
759
- if (!b.disabled) {
760
- const v = a(b);
779
+ s.value.forEach((m) => {
780
+ if (!m.disabled) {
781
+ const v = a(m);
761
782
  n[v] = c.has(v);
762
783
  }
763
784
  });
764
785
  }
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"]])
786
+ }), (c, m) => (i(), u("div", {
787
+ class: j(["p-0 w-full gap-[6px]", [c.position === "vertical" ? "flex-col" : "", c.colSpan ? "grid" : "flex justify-start"]])
767
788
  }, [
768
- (i(!0), u(ee, null, le(s.value, (v) => (i(), te(tt, {
789
+ (i(!0), u(Q, null, le(s.value, (v) => (i(), oe(at, {
769
790
  modelValue: n[a(v)],
770
791
  "onUpdate:modelValue": (C) => n[a(v)] = C,
771
792
  value: a(v),
772
- class: M(p(c.colSpan)),
793
+ class: j(p(c.colSpan)),
773
794
  disabled: v.disabled,
774
795
  label: d(v),
775
796
  key: a(v),
@@ -780,7 +801,7 @@ const el = /* @__PURE__ */ P(Qt, [["render", Yt]]), tl = {
780
801
  }, null, 8, ["modelValue", "onUpdate:modelValue", "value", "class", "disabled", "label", "icon", "imgUrl", "option", "view"]))), 128))
781
802
  ], 2));
782
803
  }
783
- }), yl = /* @__PURE__ */ P(bl, [["__scopeId", "data-v-91f3584a"]]), xl = ["placeholder", "disabled"], wl = /* @__PURE__ */ E({
804
+ }), Ml = /* @__PURE__ */ N(Vl, [["__scopeId", "data-v-91f3584a"]]), Ll = ["placeholder", "disabled"], Sl = /* @__PURE__ */ E({
784
805
  __name: "vs-input-date1",
785
806
  props: {
786
807
  style: { default: () => ({}) },
@@ -793,25 +814,25 @@ const el = /* @__PURE__ */ P(Qt, [["render", Yt]]), tl = {
793
814
  },
794
815
  emits: ["update:modelValue"],
795
816
  setup(o, { emit: e }) {
796
- const t = o, { inputClass: r } = _e(t.style), s = e, n = T({
817
+ const t = o, { inputClass: r } = $e(t.style), s = e, n = T({
797
818
  get: () => t.modelValue?.split(" ")[0],
798
819
  set: (a) => s("update:modelValue", a)
799
820
  });
800
- return (a, d) => X((i(), u("input", {
821
+ return (a, d) => W((i(), u("input", {
801
822
  type: "date",
802
823
  "onUpdate:modelValue": d[0] || (d[0] = (p) => n.value = p),
803
824
  placeholder: a.placeholder,
804
825
  disabled: a.disabled,
805
826
  ref: "date",
806
- class: M(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [a.modelValue ? "" : "text-opacity-50", G(r)].join(" ")]),
827
+ class: j(["py-1.5 px-3 block w-full placeholder:text[#767f8f] bg-white", [a.modelValue ? "" : "text-opacity-50", G(r)].join(" ")]),
807
828
  style: {
808
829
  border: "1px solid #CFD9E0"
809
830
  }
810
- }, null, 10, xl)), [
811
- [fe, n.value]
831
+ }, null, 10, Ll)), [
832
+ [ce, n.value]
812
833
  ]);
813
834
  }
814
- }), kl = async (o, e, t, r) => {
835
+ }), Bl = async (o, e, t, r) => {
815
836
  try {
816
837
  const s = new FormData();
817
838
  return s.append("unique", "true"), s.append("file", o), (await fetch(
@@ -822,27 +843,27 @@ const el = /* @__PURE__ */ P(Qt, [["render", Yt]]), tl = {
822
843
  }
823
844
  ).then((a) => a.json()))?.result;
824
845
  } catch (s) {
825
- return me({
846
+ return ge({
826
847
  type: "error",
827
848
  title: "Помилка!",
828
849
  message: "Сталась помилка під час завантаження файлу",
829
850
  position: "right-bottom"
830
851
  }), console.error("Сталась помилка завантаження файлу", s), null;
831
852
  }
832
- }, _l = async (o) => {
853
+ }, jl = async (o) => {
833
854
  try {
834
855
  return await fetch(`file/delete${o}`), !0;
835
856
  } catch (e) {
836
857
  return console.error(e), !1;
837
858
  }
838
- }, Ke = async (o) => {
859
+ }, Qe = async (o) => {
839
860
  try {
840
861
  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
862
  a.setAttribute("download", o), a.href = window.URL.createObjectURL(n), a.click();
842
863
  } catch (e) {
843
864
  console.error(e.message);
844
865
  }
845
- }, $l = {}, Cl = {
866
+ }, Il = {}, zl = {
846
867
  xmlns: "http://www.w3.org/2000/svg",
847
868
  width: "24",
848
869
  height: "24",
@@ -853,13 +874,13 @@ const el = /* @__PURE__ */ P(Qt, [["render", Yt]]), tl = {
853
874
  "stroke-linecap": "round",
854
875
  "stroke-linejoin": "round"
855
876
  };
856
- function Vl(o, e) {
857
- return i(), u("svg", Cl, e[0] || (e[0] = [
877
+ function Fl(o, e) {
878
+ return i(), u("svg", zl, e[0] || (e[0] = [
858
879
  l("path", { d: "M5 12h14" }, null, -1),
859
880
  l("path", { d: "M12 5v14" }, null, -1)
860
881
  ]));
861
882
  }
862
- const Ae = /* @__PURE__ */ P($l, [["render", Vl]]), Ml = {}, Ll = {
883
+ const ze = /* @__PURE__ */ N(Il, [["render", Fl]]), Ol = {}, Al = {
863
884
  xmlns: "http://www.w3.org/2000/svg",
864
885
  class: "icon icon-tabler icon-tabler-file-text",
865
886
  width: "44",
@@ -871,12 +892,12 @@ const Ae = /* @__PURE__ */ P($l, [["render", Vl]]), Ml = {}, Ll = {
871
892
  "stroke-linecap": "round",
872
893
  "stroke-linejoin": "round"
873
894
  };
874
- function Sl(o, e, t, r, s, n) {
875
- return i(), u("svg", Ll, e[0] || (e[0] = [
895
+ function El(o, e, t, r, s, n) {
896
+ return i(), u("svg", Al, e[0] || (e[0] = [
876
897
  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
898
  ]));
878
899
  }
879
- const Bl = /* @__PURE__ */ P(Ml, [["render", Sl]]), jl = {}, Il = {
900
+ const Dl = /* @__PURE__ */ N(Ol, [["render", El]]), Ul = {}, Tl = {
880
901
  xmlns: "http://www.w3.org/2000/svg",
881
902
  class: "icon icon-tabler icon-tabler-table",
882
903
  width: "44",
@@ -888,8 +909,8 @@ const Bl = /* @__PURE__ */ P(Ml, [["render", Sl]]), jl = {}, Il = {
888
909
  "stroke-linecap": "round",
889
910
  "stroke-linejoin": "round"
890
911
  };
891
- function zl(o, e, t, r, s, n) {
892
- return i(), u("svg", Il, e[0] || (e[0] = [
912
+ function Rl(o, e, t, r, s, n) {
913
+ return i(), u("svg", Tl, e[0] || (e[0] = [
893
914
  l("path", {
894
915
  stroke: "none",
895
916
  d: "M0 0h24v24H0z",
@@ -916,7 +937,7 @@ function zl(o, e, t, r, s, n) {
916
937
  }, null, -1)
917
938
  ]));
918
939
  }
919
- const Al = /* @__PURE__ */ P(jl, [["render", zl]]), Ol = {}, El = {
940
+ const Pl = /* @__PURE__ */ N(Ul, [["render", Rl]]), Nl = {}, Hl = {
920
941
  xmlns: "http://www.w3.org/2000/svg",
921
942
  width: "24",
922
943
  height: "24",
@@ -928,12 +949,12 @@ const Al = /* @__PURE__ */ P(jl, [["render", zl]]), Ol = {}, El = {
928
949
  "stroke-linejoin": "round",
929
950
  class: "icon icon-tabler icons-tabler-outline icon-tabler-file-unknown"
930
951
  };
931
- function Fl(o, e, t, r, s, n) {
932
- return i(), u("svg", El, e[0] || (e[0] = [
952
+ function ql(o, e, t, r, s, n) {
953
+ return i(), u("svg", Hl, e[0] || (e[0] = [
933
954
  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
955
  ]));
935
956
  }
936
- const Dl = /* @__PURE__ */ P(Ol, [["render", Fl]]), Ul = {}, Tl = {
957
+ const Gl = /* @__PURE__ */ N(Nl, [["render", ql]]), Jl = {}, Kl = {
937
958
  xmlns: "http://www.w3.org/2000/svg",
938
959
  class: "icon icon-tabler icon-tabler-file-zip",
939
960
  width: "44",
@@ -945,12 +966,12 @@ const Dl = /* @__PURE__ */ P(Ol, [["render", Fl]]), Ul = {}, Tl = {
945
966
  "stroke-linecap": "round",
946
967
  "stroke-linejoin": "round"
947
968
  };
948
- function Rl(o, e, t, r, s, n) {
949
- return i(), u("svg", Tl, e[0] || (e[0] = [
969
+ function Zl(o, e, t, r, s, n) {
970
+ return i(), u("svg", Kl, e[0] || (e[0] = [
950
971
  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
972
  ]));
952
973
  }
953
- const Pl = /* @__PURE__ */ P(Ul, [["render", Rl]]), Nl = {}, Hl = {
974
+ const Wl = /* @__PURE__ */ N(Jl, [["render", Zl]]), Ql = {}, Xl = {
954
975
  xmlns: "http://www.w3.org/2000/svg",
955
976
  class: "icon icon-tabler icon-tabler-file-code",
956
977
  width: "44",
@@ -962,25 +983,25 @@ const Pl = /* @__PURE__ */ P(Ul, [["render", Rl]]), Nl = {}, Hl = {
962
983
  "stroke-linecap": "round",
963
984
  "stroke-linejoin": "round"
964
985
  };
965
- function ql(o, e, t, r, s, n) {
966
- return i(), u("svg", Hl, e[0] || (e[0] = [
986
+ function Yl(o, e, t, r, s, n) {
987
+ return i(), u("svg", Xl, e[0] || (e[0] = [
967
988
  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
989
  ]));
969
990
  }
970
- const Gl = /* @__PURE__ */ P(Nl, [["render", ql]]), Jl = (o) => {
991
+ const eo = /* @__PURE__ */ N(Ql, [["render", Yl]]), to = (o) => {
971
992
  if (!o) return "";
972
993
  const e = o?.split(".");
973
994
  return e[e.length - 1];
974
- }, Kl = (o) => {
975
- const e = Jl(o), t = {
995
+ }, lo = (o) => {
996
+ const e = to(o), t = {
976
997
  imageFormat: ["tiff", "jpg", "jpeg", "png", "svg", "ico", "webp"],
977
998
  sheetsFormat: ["xls", "csv", "xlsx"],
978
999
  archivesFormat: ["zip", "rar"],
979
1000
  textsFormat: ["json", "geojson", "txt", "yml", "yaml", "shp"],
980
1001
  documentsFormat: ["pdf"]
981
1002
  };
982
- return t.imageFormat.includes(e) ? "img" : t.sheetsFormat.includes(e) ? Al : t.textsFormat.includes(e) ? Gl : t.documentsFormat.includes(e) ? Bl : t.archivesFormat.includes(e) ? Pl : Dl;
983
- }, Zl = {}, Wl = {
1003
+ return t.imageFormat.includes(e) ? "img" : t.sheetsFormat.includes(e) ? Pl : t.textsFormat.includes(e) ? eo : t.documentsFormat.includes(e) ? Dl : t.archivesFormat.includes(e) ? Wl : Gl;
1004
+ }, oo = {}, ao = {
984
1005
  xmlns: "http://www.w3.org/2000/svg",
985
1006
  width: "24",
986
1007
  height: "24",
@@ -992,12 +1013,12 @@ const Gl = /* @__PURE__ */ P(Nl, [["render", ql]]), Jl = (o) => {
992
1013
  "stroke-linejoin": "round",
993
1014
  class: "icon icon-tabler icons-tabler-outline icon-tabler-trash"
994
1015
  };
995
- function Ql(o, e) {
996
- return i(), u("svg", Wl, e[0] || (e[0] = [
1016
+ function so(o, e) {
1017
+ return i(), u("svg", ao, e[0] || (e[0] = [
997
1018
  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
1019
  ]));
999
1020
  }
1000
- const Ee = /* @__PURE__ */ P(Zl, [["render", Ql]]), Xl = {}, Yl = {
1021
+ const De = /* @__PURE__ */ N(oo, [["render", so]]), ro = {}, no = {
1001
1022
  xmlns: "http://www.w3.org/2000/svg",
1002
1023
  width: "24",
1003
1024
  height: "24",
@@ -1009,8 +1030,8 @@ const Ee = /* @__PURE__ */ P(Zl, [["render", Ql]]), Xl = {}, Yl = {
1009
1030
  "stroke-linejoin": "round",
1010
1031
  class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
1011
1032
  };
1012
- function eo(o, e) {
1013
- return i(), u("svg", Yl, e[0] || (e[0] = [
1033
+ function io(o, e) {
1034
+ return i(), u("svg", no, e[0] || (e[0] = [
1014
1035
  l("path", {
1015
1036
  stroke: "none",
1016
1037
  d: "M0 0h24v24H0z",
@@ -1021,9 +1042,9 @@ function eo(o, e) {
1021
1042
  l("path", { d: "M12 4l0 12" }, null, -1)
1022
1043
  ]));
1023
1044
  }
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({
1045
+ const rt = /* @__PURE__ */ N(ro, [["render", io]]), uo = { class: "h-[120px] w-[120px] border text-gray-300 border-dashed border-[#CFD9E0] rounded-lg overflow-hidden relative item-file" }, co = { class: "absolute hidden top-0 right-0 flex items-center gap-x-2 w-full h-full justify-center" }, po = /* @__PURE__ */ E({
1025
1046
  __name: "vs-input-file-list-item",
1026
- props: /* @__PURE__ */ W({
1047
+ props: /* @__PURE__ */ X({
1027
1048
  format: {},
1028
1049
  multiple: { type: Boolean },
1029
1050
  style: {},
@@ -1041,40 +1062,40 @@ const ot = /* @__PURE__ */ P(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
1041
1062
  }),
1042
1063
  emits: ["update:value", "update:item"],
1043
1064
  setup(o) {
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)), {
1065
+ const e = Y(o, "value"), t = Y(o, "item"), r = o;
1066
+ return (s, n) => (i(), u("div", uo, [
1067
+ (i(), oe(Le(G(lo)(t.value)), {
1047
1068
  src: t.value,
1048
1069
  alt: "file",
1049
1070
  class: "w-full h-full object-cover cursor-pointer",
1050
- onClick: n[0] || (n[0] = (a) => G(Ke)(t.value))
1071
+ onClick: n[0] || (n[0] = (a) => G(Qe)(t.value))
1051
1072
  }, null, 8, ["src"])),
1052
- l("div", lo, [
1073
+ l("div", co, [
1053
1074
  l("button", {
1054
1075
  type: "button",
1055
1076
  onClick: n[1] || (n[1] = (a) => {
1056
- G(_l)(t.value), e.value = r.multiple ? e.value?.filter((d) => d !== t.value) : "";
1077
+ G(jl)(t.value), e.value = r.multiple ? e.value?.filter((d) => d !== t.value) : "";
1057
1078
  }),
1058
1079
  class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-red-500"
1059
1080
  }, [
1060
- I(Ee, { class: "w-4 h-4" })
1081
+ B(De, { class: "w-4 h-4" })
1061
1082
  ]),
1062
1083
  l("button", {
1063
1084
  type: "button",
1064
- onClick: n[2] || (n[2] = (a) => G(Ke)(t.value)),
1085
+ onClick: n[2] || (n[2] = (a) => G(Qe)(t.value)),
1065
1086
  class: "w-6 h-6 flex items-center justify-center text-gray-500 bg-gray-200 rounded-lg hover:text-blue-500"
1066
1087
  }, [
1067
- I(ot, { class: "w-4 h-4" })
1088
+ B(rt, { class: "w-4 h-4" })
1068
1089
  ])
1069
1090
  ])
1070
1091
  ]));
1071
1092
  }
1072
- }), Ze = /* @__PURE__ */ P(oo, [["__scopeId", "data-v-0ca886b3"]]), ao = { class: "flex items-center gap-x-2" }, so = {
1093
+ }), Xe = /* @__PURE__ */ N(po, [["__scopeId", "data-v-0ca886b3"]]), fo = { class: "flex items-center gap-x-2" }, vo = {
1073
1094
  key: 1,
1074
1095
  class: "flex items-center flex-wrap gap-2"
1075
- }, ro = /* @__PURE__ */ E({
1096
+ }, mo = /* @__PURE__ */ E({
1076
1097
  __name: "vs-input-file",
1077
- props: /* @__PURE__ */ W({
1098
+ props: /* @__PURE__ */ X({
1078
1099
  format: {},
1079
1100
  multiple: { type: Boolean },
1080
1101
  style: {},
@@ -1090,7 +1111,7 @@ const ot = /* @__PURE__ */ P(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
1090
1111
  }),
1091
1112
  emits: ["update:modelValue"],
1092
1113
  setup(o) {
1093
- const e = o, t = Q(o, "modelValue"), r = x(null), s = (a) => Array.isArray(t.value) && t.value[a] || "", n = async (a) => {
1114
+ const e = o, t = Y(o, "modelValue"), r = w(null), s = (a) => Array.isArray(t.value) && t.value[a] || "", n = async (a) => {
1094
1115
  if (e.format) {
1095
1116
  const f = a.target.files?.[0];
1096
1117
  if (!f || !f.name.endsWith(e.format))
@@ -1098,10 +1119,10 @@ const ot = /* @__PURE__ */ P(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
1098
1119
  }
1099
1120
  const d = a.target.files?.[0];
1100
1121
  if (!d) return;
1101
- const p = await kl(d, "1", "form", "table");
1122
+ const p = await Bl(d, "1", "form", "table");
1102
1123
  t.value = e.multiple ? [...t.value || [], p?.file_path] : p?.file_path;
1103
1124
  };
1104
- return (a, d) => (i(), u("div", ao, [
1125
+ return (a, d) => (i(), u("div", fo, [
1105
1126
  l("input", {
1106
1127
  class: "hidden",
1107
1128
  ref_key: "fileInput",
@@ -1109,14 +1130,14 @@ const ot = /* @__PURE__ */ P(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
1109
1130
  type: "file",
1110
1131
  onChange: n
1111
1132
  }, null, 544),
1112
- !a.multiple && t.value ? (i(), te(Ze, {
1133
+ !a.multiple && t.value ? (i(), oe(Xe, {
1113
1134
  key: 0,
1114
1135
  item: t.value,
1115
1136
  "onUpdate:item": d[0] || (d[0] = (p) => t.value = p),
1116
1137
  value: t.value,
1117
1138
  "onUpdate:value": d[1] || (d[1] = (p) => t.value = p)
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, {
1139
+ }, null, 8, ["item", "value"])) : a.multiple ? (i(), u("div", vo, [
1140
+ (i(!0), u(Q, null, le(t.value, (p, f) => (i(), oe(Xe, {
1120
1141
  multiple: a.multiple,
1121
1142
  key: f,
1122
1143
  value: t.value,
@@ -1125,24 +1146,24 @@ const ot = /* @__PURE__ */ P(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
1125
1146
  }, null, 8, ["multiple", "value", "item"]))), 128)),
1126
1147
  l("div", {
1127
1148
  onClick: d[3] || (d[3] = (p) => !a.disabled && r.value?.click()),
1128
- class: M([
1149
+ class: j([
1129
1150
  "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
1151
  a.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:border-blue-500 hover:bg-blue-50"
1131
1152
  ])
1132
1153
  }, [
1133
- I(Ae, { class: "w-6 h-6" })
1154
+ B(ze, { class: "w-6 h-6" })
1134
1155
  ], 2)
1135
- ])) : z("", !0),
1136
- a.multiple ? z("", !0) : (i(), u("div", {
1156
+ ])) : A("", !0),
1157
+ a.multiple ? A("", !0) : (i(), u("div", {
1137
1158
  key: 2,
1138
1159
  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"])
1160
+ class: j([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
1161
  }, [
1141
- I(Ae, { class: "w-6 h-6" })
1162
+ B(ze, { class: "w-6 h-6" })
1142
1163
  ], 2))
1143
1164
  ]));
1144
1165
  }
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({
1166
+ }), ho = { class: "max-w-[55vw]" }, go = { class: "text-sm font-semibold text-gray-800 truncate dark:text-neutral-200" }, bo = { class: "flex items-center text-xs text-gray-500 truncate dark:text-neutral-500" }, yo = { class: "px-[5px]" }, xo = { class: "" }, Oe = /* @__PURE__ */ E({
1146
1167
  __name: "vs-widget-file-info",
1147
1168
  props: {
1148
1169
  item: { default: null }
@@ -1165,35 +1186,35 @@ const ot = /* @__PURE__ */ P(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
1165
1186
  const n = s / 1024;
1166
1187
  return n < 1024 ? `${n.toFixed(2)} KB` : `${(n / 1024).toFixed(2)} MB`;
1167
1188
  }
1168
- return (s, n) => (i(), u(ee, null, [
1189
+ return (s, n) => (i(), u(Q, null, [
1169
1190
  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
- l("div", no, [
1171
- l("p", io, F(s.item?.uploaded_name), 1),
1172
- l("p", uo, [
1173
- l("span", null, F(s.item?.username), 1),
1174
- X(l("span", co, "|", 512), [
1175
- [Pe, s.item?.username]
1191
+ l("div", ho, [
1192
+ l("p", go, R(s.item?.uploaded_name), 1),
1193
+ l("p", bo, [
1194
+ l("span", null, R(s.item?.username), 1),
1195
+ W(l("span", yo, "|", 512), [
1196
+ [He, s.item?.username]
1176
1197
  ]),
1177
- l("span", null, F(t.value), 1),
1198
+ l("span", null, R(t.value), 1),
1178
1199
  n[0] || (n[0] = l("span", { class: "px-[5px]" }, "|", -1)),
1179
- l("span", po, F(r(s.item?.size)), 1)
1200
+ l("span", xo, R(r(s.item?.size)), 1)
1180
1201
  ])
1181
1202
  ])
1182
1203
  ], 64));
1183
1204
  }
1184
- }), fo = { class: "p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full" }, vo = {
1205
+ }), wo = { class: "p-3 relative group flex items-center gap-x-3 border border-gray-200 bg-white rounded-md w-full" }, ko = {
1185
1206
  key: 0,
1186
1207
  class: "flex w-full gap-x-3 items-center"
1187
- }, mo = {
1208
+ }, _o = {
1188
1209
  key: 1,
1189
1210
  class: "flex gap-x-3 w-full items-center"
1190
- }, ho = {
1211
+ }, $o = {
1191
1212
  key: 2,
1192
1213
  class: "flex gap-x-3 w-full items-center"
1193
- }, go = ["href"], bo = {
1214
+ }, Co = ["href"], Vo = {
1194
1215
  key: 3,
1195
1216
  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__ */ E({
1217
+ }, Mo = { class: "lg:absolute lg:top-3 lg:end-1 opacity-100" }, Lo = { 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" }, So = { class: "inline-block" }, Bo = { class: "inline-block" }, jo = /* @__PURE__ */ E({
1197
1218
  __name: "vs-widget-file-item",
1198
1219
  props: {
1199
1220
  item: { default: null },
@@ -1210,8 +1231,8 @@ const ot = /* @__PURE__ */ P(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
1210
1231
  return ["ppt", "pptx", "doc", "docx", "xls", "xlsx"].includes(c.ext);
1211
1232
  }
1212
1233
  function a(c) {
1213
- const b = document.createElement("a");
1214
- b.setAttribute("download", c?.uploaded_name), b.href = c?.file_path, b.click();
1234
+ const m = document.createElement("a");
1235
+ m.setAttribute("download", c?.uploaded_name), m.href = c?.file_path, m.click();
1215
1236
  }
1216
1237
  async function d() {
1217
1238
  try {
@@ -1235,48 +1256,48 @@ const ot = /* @__PURE__ */ P(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
1235
1256
  function f(c) {
1236
1257
  (t.item.ext === "jpg" || t.item.ext === "png") && r("openLightbox", { item: t.item, index: c });
1237
1258
  }
1238
- return (c, b) => (i(), u("div", fo, [
1239
- c.item.ext === "jpg" || c.item.ext === "png" ? (i(), u("div", vo, [
1259
+ return (c, m) => (i(), u("div", wo, [
1260
+ c.item.ext === "jpg" || c.item.ext === "png" ? (i(), u("div", ko, [
1240
1261
  l("div", {
1241
1262
  class: "max-w-[55vw] cursor-pointer flex gap-x-3 w-full items-center",
1242
- onClick: b[0] || (b[0] = (v) => f(c.index))
1263
+ onClick: m[0] || (m[0] = (v) => f(c.index))
1243
1264
  }, [
1244
- I(Ie, { item: c.item }, null, 8, ["item"])
1265
+ B(Oe, { item: c.item }, null, 8, ["item"])
1245
1266
  ])
1246
- ])) : s(c.item) ? (i(), u("div", mo, [
1247
- I(Ie, { item: c.item }, null, 8, ["item"])
1248
- ])) : n(c.item) ? (i(), u("div", ho, [
1267
+ ])) : s(c.item) ? (i(), u("div", _o, [
1268
+ B(Oe, { item: c.item }, null, 8, ["item"])
1269
+ ])) : n(c.item) ? (i(), u("div", $o, [
1249
1270
  l("a", {
1250
1271
  href: `/api/file-preview?id=${c.item.file_id}`,
1251
1272
  target: "_blank",
1252
1273
  class: "flex gap-x-3 w-full items-center"
1253
1274
  }, [
1254
- I(Ie, { item: c.item }, null, 8, ["item"])
1255
- ], 8, go)
1256
- ])) : (i(), u("div", bo, [
1257
- I(Ie, { item: c.item }, null, 8, ["item"])
1275
+ B(Oe, { item: c.item }, null, 8, ["item"])
1276
+ ], 8, Co)
1277
+ ])) : (i(), u("div", Vo, [
1278
+ B(Oe, { item: c.item }, null, 8, ["item"])
1258
1279
  ])),
1259
- l("div", yo, [
1260
- l("div", xo, [
1261
- l("div", wo, [
1280
+ l("div", Mo, [
1281
+ l("div", Lo, [
1282
+ l("div", So, [
1262
1283
  l("button", {
1263
1284
  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: b[1] || (b[1] = (v) => a(c.item))
1285
+ onClick: m[1] || (m[1] = (v) => a(c.item))
1265
1286
  }, [
1266
- I(ot, {
1287
+ B(rt, {
1267
1288
  height: "14",
1268
1289
  width: "14"
1269
1290
  })
1270
1291
  ])
1271
1292
  ]),
1272
- b[3] || (b[3] = l("div", { class: "w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700" }, null, -1)),
1273
- l("div", ko, [
1293
+ m[3] || (m[3] = l("div", { class: "w-px h-5 mx-1 bg-gray-200 dark:bg-neutral-700" }, null, -1)),
1294
+ l("div", Bo, [
1274
1295
  l("button", {
1275
1296
  type: "button",
1276
1297
  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: b[2] || (b[2] = (v) => p())
1298
+ onClick: m[2] || (m[2] = (v) => p())
1278
1299
  }, [
1279
- I(Ee, {
1300
+ B(De, {
1280
1301
  height: "14",
1281
1302
  width: "14"
1282
1303
  })
@@ -1286,7 +1307,7 @@ const ot = /* @__PURE__ */ P(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
1286
1307
  ])
1287
1308
  ]));
1288
1309
  }
1289
- }), $o = {}, Co = {
1310
+ }), Io = {}, zo = {
1290
1311
  xmlns: "http://www.w3.org/2000/svg",
1291
1312
  width: "24",
1292
1313
  height: "24",
@@ -1298,8 +1319,8 @@ const ot = /* @__PURE__ */ P(Xl, [["render", eo]]), to = { class: "h-[120px] w-[
1298
1319
  "stroke-linejoin": "round",
1299
1320
  class: "icon icon-tabler icons-tabler-outline icon-tabler-download"
1300
1321
  };
1301
- function Vo(o, e) {
1302
- return i(), u("svg", Co, e[0] || (e[0] = [
1322
+ function Fo(o, e) {
1323
+ return i(), u("svg", zo, e[0] || (e[0] = [
1303
1324
  l("path", {
1304
1325
  stroke: "none",
1305
1326
  d: "M0 0h24v24H0z",
@@ -1310,13 +1331,13 @@ function Vo(o, e) {
1310
1331
  l("path", { d: "M12 4l0 12" }, null, -1)
1311
1332
  ]));
1312
1333
  }
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 = {
1334
+ const Oo = /* @__PURE__ */ N(Io, [["render", Fo]]), Ao = { class: "flex flex-col widget-file xl:bg-white xl:rounded-xl dark:xl:bg-neutral-800 dark:xl:border-neutral-700 w-full" }, Eo = { class: "flex w-full mb-[12px] items-center gap-x-2" }, Do = { class: "font-semibold text-gray-800 dark:text-neutral-200 text-[14px]" }, Uo = { class1: "ml-auto" }, To = { 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" }, Ro = {
1314
1335
  key: 0,
1315
1336
  class: "py-4 mb-4 space-y-4 border-gray-200 border-y dark:border-neutral-700"
1316
- }, Ao = { class: "relative" }, Oo = {
1337
+ }, Po = { class: "relative" }, No = {
1317
1338
  key: 1,
1318
1339
  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__ */ E({
1340
+ }, Ho = { key: 0 }, qo = /* @__PURE__ */ E({
1320
1341
  __name: "vs-input-file-list",
1321
1342
  props: {
1322
1343
  id: { default: "" },
@@ -1331,57 +1352,57 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
1331
1352
  },
1332
1353
  emits: ["update"],
1333
1354
  setup(o, { emit: e }) {
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 () => {
1355
+ const t = o, r = Ve("form"), s = T(() => r.value.formId), n = w(!1), a = w(0), d = e, p = w(!1), f = w({}), c = w([]), m = w(""), v = T(() => Array.isArray(c.value) ? c.value.filter((b) => b.ext === "jpg" || b.ext === "png").map((b) => b?.file_path) : []), C = T(() => m.value === "" ? c.value : c.value.filter((b) => b?.uploaded_name?.includes(m.value))), k = (b) => {
1356
+ const y = v.value.findIndex((Z) => Z === b.item.file_path);
1357
+ y !== -1 && (n.value = !0, a.value = y);
1358
+ }, M = async () => {
1338
1359
  try {
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);
1360
+ const b = await fetch(`${t.prefix}/widget/file/${s.value}`).then((y) => y.json());
1361
+ c.value = b?.rows;
1362
+ } catch (b) {
1363
+ console.error(b);
1343
1364
  }
1344
- }, U = async (h) => {
1365
+ }, S = async (b) => {
1345
1366
  await Promise.all(
1346
- Array.from(h.target.files).map(async (g) => {
1347
- const K = new FormData();
1348
- K.append("file", g);
1367
+ Array.from(b.target.files).map(async (y) => {
1368
+ const Z = new FormData();
1369
+ Z.append("file", y);
1349
1370
  try {
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;
1371
+ const U = `${t.prefix}/widget/file/${s.value}`;
1372
+ return await fetch(U, { method: "POST", body: Z }), d("update", "file-list"), y;
1373
+ } catch (U) {
1374
+ return console.error(U), null;
1354
1375
  }
1355
1376
  })
1356
- ), await D();
1357
- }, N = (h) => {
1358
- const g = { ...h };
1359
- return h.cancel || (g.cancel = () => {
1377
+ ), await M();
1378
+ }, D = (b) => {
1379
+ const y = { ...b };
1380
+ return b.cancel || (y.cancel = () => {
1360
1381
  p.value = !1;
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;
1382
+ }), b.updateListOnConfirm && (y.confirm = async () => {
1383
+ await b.confirm(), p.value = !1, M();
1384
+ }), y;
1385
+ }, $ = (b) => {
1386
+ f.value = D(b), p.value = !0;
1366
1387
  };
1367
- return ue(s, (h) => {
1368
- h && D();
1388
+ return te(s, (b) => {
1389
+ b && M();
1369
1390
  }), pe(() => {
1370
- s.value && D();
1371
- }), (h, g) => {
1372
- const K = Ne("Lightbox"), A = Ne("MessageBox");
1373
- return i(), u("div", Lo, [
1374
- l("div", So, [
1375
- l("h2", Bo, " Файлів: " + F(c.value?.length), 1),
1376
- l("div", jo, [
1391
+ s.value && M();
1392
+ }), (b, y) => {
1393
+ const Z = Je("Lightbox"), U = Je("MessageBox");
1394
+ return i(), u("div", Ao, [
1395
+ l("div", Eo, [
1396
+ l("h2", Do, " Файлів: " + R(c.value?.length), 1),
1397
+ l("div", Uo, [
1377
1398
  l("label", null, [
1378
1399
  l("input", {
1379
1400
  type: "file",
1380
1401
  class: "hidden",
1381
- onChange: g[0] || (g[0] = (S) => U(S))
1402
+ onChange: y[0] || (y[0] = (I) => S(I))
1382
1403
  }, null, 32),
1383
- l("div", Io, [
1384
- I(Mo, {
1404
+ l("div", To, [
1405
+ B(Oo, {
1385
1406
  height: "16",
1386
1407
  width: "16"
1387
1408
  })
@@ -1389,10 +1410,10 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
1389
1410
  ])
1390
1411
  ])
1391
1412
  ]),
1392
- c.value?.length > 4 ? (i(), u("div", zo, [
1413
+ c.value?.length > 4 ? (i(), u("div", Ro, [
1393
1414
  l("div", null, [
1394
- l("div", Ao, [
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" }, [
1415
+ l("div", Po, [
1416
+ y[8] || (y[8] = l("div", { class: "absolute inset-y-0 start-0 flex items-center pointer-events-none z-[1] ps-3.5" }, [
1396
1417
  l("svg", {
1397
1418
  class: "flex-shrink-0 text-gray-500 size-4 dark:text-neutral-400",
1398
1419
  xmlns: "http://www.w3.org/2000/svg",
@@ -1413,52 +1434,52 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
1413
1434
  l("path", { d: "m21 21-4.3-4.3" })
1414
1435
  ])
1415
1436
  ], -1)),
1416
- X(l("input", {
1437
+ W(l("input", {
1417
1438
  type: "text",
1418
- "onUpdate:modelValue": g[1] || (g[1] = (S) => b.value = S),
1439
+ "onUpdate:modelValue": y[1] || (y[1] = (I) => m.value = I),
1419
1440
  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
1441
  placeholder: "Введіть назву файлу"
1421
1442
  }, null, 512), [
1422
1443
  [
1423
- fe,
1424
- b.value,
1444
+ ce,
1445
+ m.value,
1425
1446
  void 0,
1426
1447
  { trim: !0 }
1427
1448
  ]
1428
1449
  ])
1429
1450
  ])
1430
1451
  ])
1431
- ])) : z("", !0),
1432
- c.value?.length ? (i(), u("div", Oo, [
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))
1452
+ ])) : A("", !0),
1453
+ c.value?.length ? (i(), u("div", No, [
1454
+ (i(!0), u(Q, null, le(C.value, (I, K) => (i(), oe(jo, {
1455
+ key: K,
1456
+ prefix: b.prefix,
1457
+ item: I,
1458
+ index: K,
1459
+ onUpdate: y[2] || (y[2] = (ae) => b.$emit("update", "file-list")),
1460
+ onOpenModal: y[3] || (y[3] = (ae) => $(ae)),
1461
+ onOpenLightbox: y[4] || (y[4] = (ae) => k(ae))
1441
1462
  }, null, 8, ["prefix", "item", "index"]))), 128)),
1442
- C.value.length ? z("", !0) : (i(), u("div", Eo, g[9] || (g[9] = [
1463
+ C.value.length ? A("", !0) : (i(), u("div", Ho, y[9] || (y[9] = [
1443
1464
  l("p", { class: "text-sm text-gray-600 font-sm" }, " Файлів з такою назвою не існує, введіть інше пошукове слово ", -1)
1444
1465
  ])))
1445
- ])) : z("", !0),
1446
- I(K, {
1466
+ ])) : A("", !0),
1467
+ B(Z, {
1447
1468
  modelValue: n.value,
1448
- "onUpdate:modelValue": g[5] || (g[5] = (S) => n.value = S),
1469
+ "onUpdate:modelValue": y[5] || (y[5] = (I) => n.value = I),
1449
1470
  startIndex: a.value,
1450
- "onUpdate:index": g[6] || (g[6] = (S) => a.value = S),
1471
+ "onUpdate:index": y[6] || (y[6] = (I) => a.value = I),
1451
1472
  images: v.value
1452
1473
  }, null, 8, ["modelValue", "startIndex", "images"]),
1453
- I(A, je({
1474
+ B(U, Ie({
1454
1475
  modelValue: p.value,
1455
- "onUpdate:modelValue": g[7] || (g[7] = (S) => p.value = S),
1476
+ "onUpdate:modelValue": y[7] || (y[7] = (I) => p.value = I),
1456
1477
  onConfirm: f.value.confirm
1457
1478
  }, f.value), null, 16, ["modelValue", "onConfirm"])
1458
1479
  ]);
1459
1480
  };
1460
1481
  }
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({
1482
+ }), Go = { class: "flex items-center justify-between" }, Jo = { class: "text-[16px] text-gray-900 font-medium" }, Ko = { class: "grid gap-3" }, Zo = /* @__PURE__ */ E({
1462
1483
  __name: "vs-container-switcher",
1463
1484
  props: {
1464
1485
  title: {
@@ -1475,34 +1496,34 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
1475
1496
  }
1476
1497
  },
1477
1498
  setup(o) {
1478
- const e = o, t = x(e.isOpen);
1479
- return ue(
1499
+ const e = o, t = w(e.isOpen);
1500
+ return te(
1480
1501
  () => e.isOpen,
1481
1502
  (r) => {
1482
1503
  t.value = r;
1483
1504
  }
1484
1505
  ), (r, s) => (i(), u("div", null, [
1485
- l("div", Do, [
1486
- l("p", Uo, F(o.title), 1),
1487
- I(lt, {
1506
+ l("div", Go, [
1507
+ l("p", Jo, R(o.title), 1),
1508
+ B(st, {
1488
1509
  modelValue: t.value,
1489
1510
  "onUpdate:modelValue": s[0] || (s[0] = (n) => t.value = n),
1490
- style: we(o.style)
1511
+ style: ke(o.style)
1491
1512
  }, null, 8, ["modelValue", "style"])
1492
1513
  ]),
1493
- I(et, { name: "slide-fade" }, {
1494
- default: Me(() => [
1495
- X(l("div", To, [
1496
- ke(r.$slots, "default", {}, void 0, !0)
1514
+ B(ot, { name: "slide-fade" }, {
1515
+ default: Se(() => [
1516
+ W(l("div", Ko, [
1517
+ _e(r.$slots, "default", {}, void 0, !0)
1497
1518
  ], 512), [
1498
- [Pe, t.value]
1519
+ [He, t.value]
1499
1520
  ])
1500
1521
  ]),
1501
1522
  _: 3
1502
1523
  })
1503
1524
  ]));
1504
1525
  }
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({
1526
+ }), Wo = /* @__PURE__ */ N(Zo, [["__scopeId", "data-v-90320b87"]]), Qo = { class: "text-[16px] text-gray-900 font-medium" }, Xo = { class: "grid gap-3" }, Yo = /* @__PURE__ */ E({
1506
1527
  __name: "vs-container-accordion",
1507
1528
  props: {
1508
1529
  title: {
@@ -1519,8 +1540,8 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
1519
1540
  }
1520
1541
  },
1521
1542
  setup(o) {
1522
- const e = o, t = x(e.isOpen);
1523
- return ue(
1543
+ const e = o, t = w(e.isOpen);
1544
+ return te(
1524
1545
  () => e.isOpen,
1525
1546
  (r) => {
1526
1547
  t.value = r;
@@ -1531,24 +1552,24 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
1531
1552
  onClick: s[0] || (s[0] = (n) => t.value = !t.value),
1532
1553
  class: "flex items-center gap-2"
1533
1554
  }, [
1534
- I(G(Wt), {
1535
- class: M(["h-4 w-4 duration-300", [t.value ? "-rotate-180" : ""]])
1555
+ B(G(el), {
1556
+ class: j(["h-4 w-4 duration-300", [t.value ? "-rotate-180" : ""]])
1536
1557
  }, null, 8, ["class"]),
1537
- l("span", No, F(o.title), 1)
1558
+ l("span", Qo, R(o.title), 1)
1538
1559
  ]),
1539
- I(et, { name: "slide-fade" }, {
1540
- default: Me(() => [
1541
- X(l("div", Ho, [
1542
- ke(r.$slots, "default", {}, void 0, !0)
1560
+ B(ot, { name: "slide-fade" }, {
1561
+ default: Se(() => [
1562
+ W(l("div", Xo, [
1563
+ _e(r.$slots, "default", {}, void 0, !0)
1543
1564
  ], 512), [
1544
- [Pe, t.value]
1565
+ [He, t.value]
1545
1566
  ])
1546
1567
  ]),
1547
1568
  _: 3
1548
1569
  })
1549
1570
  ]));
1550
1571
  }
1551
- }), Go = /* @__PURE__ */ P(qo, [["__scopeId", "data-v-590eff11"]]), Jo = { class: "flex items-center justify-between" }, Ko = /* @__PURE__ */ E({
1572
+ }), ea = /* @__PURE__ */ N(Yo, [["__scopeId", "data-v-590eff11"]]), ta = { class: "flex items-center justify-between" }, la = /* @__PURE__ */ E({
1552
1573
  __name: "vs-container-default",
1553
1574
  props: {
1554
1575
  title: {
@@ -1562,17 +1583,17 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
1562
1583
  },
1563
1584
  setup(o) {
1564
1585
  return (e, t) => (i(), u("div", null, [
1565
- l("div", Jo, [
1566
- l("p", null, F(o.title), 1)
1586
+ l("div", ta, [
1587
+ l("p", null, R(o.title), 1)
1567
1588
  ]),
1568
- ke(e.$slots, "default")
1589
+ _e(e.$slots, "default")
1569
1590
  ]));
1570
1591
  }
1571
- }), Zo = {
1572
- switcher: Po,
1573
- accordion: Go,
1574
- default: Ko
1575
- }, se = {
1592
+ }), oa = {
1593
+ switcher: Wo,
1594
+ accordion: ea,
1595
+ default: la
1596
+ }, ne = {
1576
1597
  Equal: "==",
1577
1598
  Inequal: "!=",
1578
1599
  Higer: ">",
@@ -1585,37 +1606,37 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
1585
1606
  Contain: "*",
1586
1607
  In: "in",
1587
1608
  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, at = (o, e) => {
1609
+ }, aa = (o, e) => String(o) === String(e), sa = (o, e) => String(o) !== String(e), ra = (o, e) => o > e, na = (o, e) => o >= e, ia = (o, e) => o < e, ua = (o, e) => o <= e, da = (o, e) => Array.isArray(e) && e.length === 2 ? o >= e[0] && o <= e[1] : !1, ca = (o, e) => String(o).startsWith(String(e)), pa = (o, e) => String(o).endsWith(String(e)), fa = (o, e) => String(o).includes(String(e)), va = (o, e) => Array.isArray(e) ? e.includes(o) : !1, ma = (o, e) => Array.isArray(e) ? !e.includes(o) : !0, nt = (o, e) => {
1589
1610
  if (!e) return !0;
1590
1611
  switch (e?.[1]) {
1591
- case se.Equal:
1592
- return Wo(o, e?.[2]);
1593
- case se.Inequal:
1594
- return Qo(o, e?.[2]);
1595
- case se.Higer:
1596
- return Xo(o, e?.[2]);
1597
- case se.HigerOrEqual:
1598
- return Yo(o, e?.[2]);
1599
- case se.Lower:
1600
- return ea(o, e?.[2]);
1601
- case se.LowerOrEqual:
1602
- return ta(o, e?.[2]);
1603
- case se.Between:
1604
- return la(o, e?.[2]);
1605
- case se.StartWith:
1606
- return oa(o, e?.[2]);
1607
- case se.EndWith:
1612
+ case ne.Equal:
1608
1613
  return aa(o, e?.[2]);
1609
- case se.Contain:
1614
+ case ne.Inequal:
1610
1615
  return sa(o, e?.[2]);
1611
- case se.In:
1616
+ case ne.Higer:
1612
1617
  return ra(o, e?.[2]);
1613
- case se.NotIn:
1618
+ case ne.HigerOrEqual:
1614
1619
  return na(o, e?.[2]);
1620
+ case ne.Lower:
1621
+ return ia(o, e?.[2]);
1622
+ case ne.LowerOrEqual:
1623
+ return ua(o, e?.[2]);
1624
+ case ne.Between:
1625
+ return da(o, e?.[2]);
1626
+ case ne.StartWith:
1627
+ return ca(o, e?.[2]);
1628
+ case ne.EndWith:
1629
+ return pa(o, e?.[2]);
1630
+ case ne.Contain:
1631
+ return fa(o, e?.[2]);
1632
+ case ne.In:
1633
+ return va(o, e?.[2]);
1634
+ case ne.NotIn:
1635
+ return ma(o, e?.[2]);
1615
1636
  default:
1616
1637
  return !0;
1617
1638
  }
1618
- }, ia = /* @__PURE__ */ E({
1639
+ }, ha = /* @__PURE__ */ E({
1619
1640
  __name: "vs-input-container",
1620
1641
  props: {
1621
1642
  style: {
@@ -1636,19 +1657,19 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
1636
1657
  }
1637
1658
  },
1638
1659
  setup(o) {
1639
- const e = o, t = ze("formValues", { default: {} }), r = ze("form"), s = T(() => e.schema?.filter((a) => {
1660
+ const e = o, t = Ve("formValues", { default: {} }), r = Ve("form"), s = T(() => e.schema?.filter((a) => {
1640
1661
  const d = a?.conditions;
1641
1662
  if (!d) return !0;
1642
1663
  const p = Array.isArray(d) ? d[0] : d, f = t?.value?.[p];
1643
- return at(f, d);
1644
- })), n = T(() => Zo[e.view]);
1645
- return (a, d) => o.schema?.length ? (i(), te(Ve(n.value), {
1664
+ return nt(f, d);
1665
+ })), n = T(() => oa[e.view]);
1666
+ return (a, d) => o.schema?.length ? (i(), oe(Le(n.value), {
1646
1667
  key: 0,
1647
1668
  title: o.title,
1648
- style: we(o.style)
1669
+ style: ke(o.style)
1649
1670
  }, {
1650
- default: Me(() => [
1651
- (i(!0), u(ee, null, le(s.value, (p) => (i(), te(st, je({
1671
+ default: Se(() => [
1672
+ (i(!0), u(Q, null, le(s.value, (p) => (i(), oe(it, Ie({
1652
1673
  key: p.name
1653
1674
  }, { ref_for: !0 }, p, {
1654
1675
  item: p,
@@ -1659,9 +1680,9 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
1659
1680
  }), null, 16, ["item", "modelValue", "onUpdate:modelValue", "style", "error"]))), 128))
1660
1681
  ]),
1661
1682
  _: 1
1662
- }, 8, ["title", "style"])) : z("", !0);
1683
+ }, 8, ["title", "style"])) : A("", !0);
1663
1684
  }
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({
1685
+ }), ga = { class: "relative" }, ba = { class: "w-full h-full fixed top-0 start-0 z-[1000] bg-black bg-opacity-50" }, ya = { 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" }, xa = { class: "py-2.5 px-4 flex justify-between items-center border-0 border-b border-solid border-gray-200 dark:border-b-[#454545]" }, wa = { class: "font-medium text-gray-800 dark:text-[#ffffff]" }, ka = { class: "p-4 mim-h-0 h-full overflow-auto" }, _a = /* @__PURE__ */ E({
1665
1686
  __name: "modal-edit",
1666
1687
  props: {
1667
1688
  schema: {},
@@ -1672,11 +1693,11 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
1672
1693
  },
1673
1694
  emits: ["close", "save", "edit"],
1674
1695
  setup(o, { emit: e }) {
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);
1696
+ const t = o, r = e, s = w(t.schema), n = w(t.defaultValue ? JSON.parse(JSON.stringify(t.defaultValue)) : {}), a = w({}), d = w(), p = w(t.mode);
1676
1697
  async function f() {
1677
- const b = a.value.validate();
1678
- if (b) {
1679
- me({ type: "warning", title: "Помилка валідації", message: Object.entries(b).map(([v, C]) => `${v}: ${C}`).join(`
1698
+ const m = a.value.validate();
1699
+ if (m) {
1700
+ ge({ type: "warning", title: "Помилка валідації", message: Object.entries(m).map(([v, C]) => `${v}: ${C}`).join(`
1680
1701
  `) });
1681
1702
  return;
1682
1703
  }
@@ -1690,29 +1711,29 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
1690
1711
  body: JSON.stringify(n.value)
1691
1712
  });
1692
1713
  if (v.ok)
1693
- await v.json(), me({
1714
+ await v.json(), ge({
1694
1715
  type: "success",
1695
1716
  title: "Успішно",
1696
1717
  message: `Дані успішно ${p.value === "add" ? "збережено" : "оновлено"}`
1697
1718
  }), r("save", n.value);
1698
1719
  else if (v.status === 400) {
1699
1720
  const C = await v.json().catch(() => ({}));
1700
- me({
1721
+ ge({
1701
1722
  type: "warning",
1702
1723
  title: "Помилка валідації",
1703
1724
  message: C.message || "Некоректні дані (400)"
1704
1725
  });
1705
- } else v.status === 500 ? me({
1726
+ } else v.status === 500 ? ge({
1706
1727
  type: "error",
1707
1728
  title: "Серверна помилка",
1708
1729
  message: "Виникла помилка на сервері (500)"
1709
- }) : me({
1730
+ }) : ge({
1710
1731
  type: "error",
1711
1732
  title: "Помилка",
1712
1733
  message: `Статус: ${v.status}`
1713
1734
  });
1714
1735
  } catch (v) {
1715
- me({
1736
+ ge({
1716
1737
  type: "error",
1717
1738
  title: "Помилка з’єднання",
1718
1739
  message: v.message || "Не вдалося виконати запит"
@@ -1724,18 +1745,18 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
1724
1745
  }
1725
1746
  return pe(async () => {
1726
1747
  if (t.form) {
1727
- const b = await fetch(`/api/template/form/${t.form}`).then((v) => v.json());
1728
- s.value = b.schema, d.value = b.token;
1748
+ const m = await fetch(`/api/template/form/${t.form}`).then((v) => v.json());
1749
+ s.value = m.schema, d.value = m.token;
1729
1750
  } else if (t.token) {
1730
1751
  d.value = t.token;
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";
1752
+ const m = await fetch(`/api/form/${d.value}`).then((v) => v.json());
1753
+ s.value = m.schema, m.data ? n.value = m.data : p.value = "add";
1733
1754
  }
1734
- }), (b, v) => (i(), u("div", ua, [
1735
- l("div", da, [
1736
- l("div", ca, [
1737
- l("div", pa, [
1738
- l("h3", fa, F(p.value === "add" ? "Додати" : "Змінити"), 1),
1755
+ }), (m, v) => (i(), u("div", ga, [
1756
+ l("div", ba, [
1757
+ l("div", ya, [
1758
+ l("div", xa, [
1759
+ l("h3", wa, R(p.value === "add" ? "Додати" : "Змінити"), 1),
1739
1760
  l("button", {
1740
1761
  onClick: c,
1741
1762
  type: "button",
@@ -1759,15 +1780,15 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
1759
1780
  ], -1)
1760
1781
  ]))
1761
1782
  ]),
1762
- l("div", va, [
1763
- s.value ? (i(), te(Oe, {
1783
+ l("div", ka, [
1784
+ s.value ? (i(), oe(Ee, {
1764
1785
  key: 0,
1765
1786
  schema: s.value,
1766
1787
  values: n.value,
1767
1788
  "onUpdate:values": v[0] || (v[0] = (C) => n.value = C),
1768
1789
  form: a.value,
1769
1790
  "onUpdate:form": v[1] || (v[1] = (C) => a.value = C)
1770
- }, null, 8, ["schema", "values", "form"])) : z("", !0)
1791
+ }, null, 8, ["schema", "values", "form"])) : A("", !0)
1771
1792
  ]),
1772
1793
  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
1794
  l("button", {
@@ -1785,14 +1806,14 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
1785
1806
  ])
1786
1807
  ]));
1787
1808
  }
1788
- }), De = (o = { mode: "edit", schema: null }) => new Promise((e) => {
1789
- const { close: t } = ft({
1809
+ }), Te = (o = { mode: "edit", schema: null }) => new Promise((e) => {
1810
+ const { close: t } = gt({
1790
1811
  title: o.mode === "add" ? "Додати" : "Редагувати",
1791
1812
  template: "",
1792
1813
  visible: !0,
1793
1814
  size: "medium",
1794
1815
  closeClickBack: !0,
1795
- content: ma,
1816
+ content: _a,
1796
1817
  contentProps: {
1797
1818
  ...o,
1798
1819
  onClose: () => {
@@ -1803,17 +1824,17 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
1803
1824
  }
1804
1825
  }
1805
1826
  });
1806
- }), ha = ["aria-expanded", "data-focus"], ga = { class: "flex items-center" }, ba = ["title"], ya = ["onClick"], xa = ["title"], wa = {
1827
+ }), $a = ["aria-expanded", "data-focus"], Ca = { class: "flex items-center" }, Va = ["title"], Ma = ["onClick"], La = ["title"], Sa = {
1807
1828
  key: 2,
1808
1829
  class: "text-gray-500 truncate"
1809
- }, ka = { class: "flex-1 min-w-[2px]" }, _a = ["placeholder"], $a = { class: "flex items-center shrink-0" }, Ca = ["disabled"], Va = ["disabled"], Ma = {
1830
+ }, Ba = { class: "flex-1 min-w-[2px]" }, ja = ["placeholder"], Ia = { class: "flex items-center shrink-0" }, za = ["disabled"], Fa = ["disabled"], Oa = {
1810
1831
  key: 0,
1811
1832
  class: "absolute z-10 w-full mt-2 rounded bg-white shadow-[0_0_0_1px_rgba(0,0,0,0.1),0_4px_11px_rgba(0,0,0,0.1)]",
1812
1833
  role: "listbox"
1813
- }, La = ["aria-disabled", "onClick"], Sa = {
1834
+ }, Aa = ["aria-disabled", "onClick"], Ea = {
1814
1835
  key: 1,
1815
1836
  class: "px-3 py-2 text-center text-gray-500"
1816
- }, Ba = ["disabled"], ja = /* @__PURE__ */ E({
1837
+ }, Da = ["disabled"], Ua = /* @__PURE__ */ E({
1817
1838
  __name: "vs-input-select",
1818
1839
  props: {
1819
1840
  multiple: { type: Boolean, default: !1 },
@@ -1828,6 +1849,7 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
1828
1849
  options: { default: () => [] },
1829
1850
  api: {},
1830
1851
  maxHeight: { default: 400 },
1852
+ parent: {},
1831
1853
  add: {},
1832
1854
  style: { default: () => ({}) },
1833
1855
  customClass: { default: "" },
@@ -1838,146 +1860,170 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
1838
1860
  emits: ["change", "update:modelValue"],
1839
1861
  setup(o, { emit: e }) {
1840
1862
  const t = o, r = e, s = T(() => t.multiple), n = T(() => t.disabled);
1841
- _e(t.style);
1863
+ $e(t.style);
1842
1864
  const a = T({
1843
1865
  get: () => t.modelValue,
1844
- set: (w) => r("update:modelValue", w)
1866
+ set: (g) => r("update:modelValue", g)
1845
1867
  });
1846
1868
  !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(() => {
1869
+ const d = w(null), p = w(null), f = w(null), c = w(!1), m = w(!1), v = w(null), C = w([]), k = w(-1), M = w([]), S = w(""), D = w(null), $ = w([]), b = T(() => {
1848
1870
  if (!$.value.length) return [];
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
- }), 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
- let w = C.value ?? [];
1853
- if (U.value.trim() !== "") {
1854
- const k = U.value.toLowerCase();
1855
- w = w.filter((O) => O.text?.toLowerCase?.().includes(k));
1871
+ const g = new Map(C.value.map((x) => [x.id?.toString(), x]));
1872
+ return $.value.map((x) => g.get(x?.toString())).filter((x) => !!x);
1873
+ }), y = T(() => t.placeholder || "Select..."), Z = T(() => s.value ? !$.value.length && S.value === "" : !v.value?.text && S.value === ""), U = T(() => n.value ? !1 : s.value ? $.value.length > 0 : !!a.value), I = (g) => s.value ? $.value.some((x) => x?.toString() === g?.toString()) : a.value?.toString() === g?.toString(), K = T(() => {
1874
+ let g = C.value ?? [];
1875
+ if (!t.data && S.value.trim() !== "") {
1876
+ const x = S.value.toLowerCase();
1877
+ g = g.filter((F) => F.text?.toLowerCase?.().includes(x));
1856
1878
  }
1857
1879
  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()));
1880
+ const x = new Set($.value.map((F) => F?.toString()));
1881
+ g = g.filter((F) => !x.has(F.id?.toString()));
1882
+ }
1883
+ return g;
1884
+ }), ae = Ve("values"), ee = T(() => t.parent ? ae?.value?.[t.parent] ?? null : null), fe = async (g) => {
1885
+ if (!t.data) {
1886
+ let x = t.options ?? [];
1887
+ if (g?.trim()) {
1888
+ const F = g.toLowerCase();
1889
+ x = x.filter((J) => J.text?.toLowerCase?.().includes(F));
1890
+ }
1891
+ return x;
1860
1892
  }
1861
- return w;
1862
- }), Y = async (w) => {
1863
- if (!t.data) return [];
1864
1893
  try {
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 ?? [];
1894
+ const x = t.host ?? "", F = t.prefix ?? "api", J = t.api ?? `/${F}/suggest/${t.data}`, me = `${x}${J}`, he = new URLSearchParams();
1895
+ return he.set("json", "1"), g && he.set("key", g), ee.value !== void 0 && ee.value !== null && ee.value !== "" && he.set("parent", String(ee.value)), (await fetch(`${me}?${he.toString()}`).then((Ue) => Ue.json()))?.data ?? [];
1867
1896
  } catch {
1868
1897
  return [];
1869
1898
  }
1870
- }, ae = async () => {
1871
- t.options?.length ? C.value = [...t.options] : t.data && (C.value = await Y(U.value));
1872
- }, $e = async (w) => {
1873
- if (w == null) return null;
1874
- const k = C.value?.find((Z) => Z?.id?.toString() === String(w));
1875
- return k || ((await Y(String(w)))?.[0] ?? null);
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);
1899
+ }, Me = async () => {
1900
+ t.data ? C.value = await fe(S.value) : C.value = t.options ? [...t.options] : [];
1901
+ }, O = async (g) => {
1902
+ if (g == null) return null;
1903
+ const x = C.value?.find((J) => J?.id?.toString() === String(g));
1904
+ return x || ((await fe(String(g)))?.[0] ?? null);
1905
+ }, V = async (g) => {
1906
+ const x = new Set(C.value.map((J) => J.id?.toString())), F = g.filter((J) => !x.has(J?.toString()));
1907
+ F.length && await F.reduce(async (J, me) => {
1908
+ await J;
1909
+ const he = await O(me);
1910
+ he && C.value.push(he);
1882
1911
  }, Promise.resolve());
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;
1912
+ }, z = async () => {
1913
+ n.value || (c.value = !0, await Me(), await je(() => {
1914
+ D.value?.focus(), K.value.length ? k.value = 0 : k.value = -1;
1886
1915
  }));
1887
- }, _ = () => {
1888
- c.value = !1, V.value = -1;
1889
- }, j = async (w) => {
1916
+ }, H = () => {
1917
+ c.value = !1, k.value = -1;
1918
+ }, se = async (g) => {
1890
1919
  if (n.value) return;
1891
- !c.value ? await B() : _();
1892
- }, q = async () => {
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
- if (!w || !k) return;
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) => {
1920
+ !c.value ? await z() : H();
1921
+ }, be = async () => {
1922
+ c.value ? D.value?.focus() : await z();
1923
+ }, ve = () => {
1924
+ s.value ? ($.value = [], a.value = [], r("change", [])) : (v.value = null, a.value = null, r("change", null)), S.value = "", je(() => D.value?.focus());
1925
+ }, h = (g) => {
1926
+ s.value && ($.value = $.value.filter((x) => x?.toString() !== g?.toString()), a.value = [...$.value], r("change", a.value), je(() => D.value?.focus()));
1927
+ }, _ = (g) => {
1928
+ s.value ? (I(g.id) || ($.value = [...$.value, g.id], a.value = [...$.value], r("change", a.value)), S.value = "", je(() => {
1929
+ D.value?.focus(), k.value = Math.min(k.value, K.value.length - 1);
1930
+ })) : (v.value = g, a.value = g.id, r("change", a.value), S.value = "", H());
1931
+ }, P = (g) => {
1932
+ I(g.id) || _(g);
1933
+ }, q = (g, x) => {
1934
+ if (!g || !x) return;
1935
+ const F = g.offsetTop, J = F + g.offsetHeight, me = x.scrollTop, he = me + x.clientHeight;
1936
+ let Fe = x.scrollTop;
1937
+ F < me ? Fe = F - 80 : J > he && (Fe = J - x.clientHeight + 4);
1938
+ const Ue = x;
1939
+ Ue.scrollTop = Fe;
1940
+ }, ue = async (g) => {
1941
+ n.value || !c.value && (g.key === "ArrowDown" || g.key === "ArrowUp") && (g.preventDefault(), await z());
1942
+ }, Be = (g) => {
1914
1943
  if (!c.value) return;
1915
- const { key: k } = w;
1916
- if (k === "ArrowDown")
1917
- w.preventDefault(), V.value + 1 < J.value.length && (V.value += 1, y(D.value[V.value], f.value));
1918
- else if (k === "ArrowUp")
1919
- w.preventDefault(), V.value > 0 && (V.value -= 1, y(D.value[V.value], f.value));
1920
- else if (k === "Enter") {
1921
- w.preventDefault();
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
- }, ve = (w) => {
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) && _();
1944
+ const { key: x } = g;
1945
+ if (x === "ArrowDown")
1946
+ g.preventDefault(), k.value + 1 < K.value.length && (k.value += 1, q(M.value[k.value], f.value));
1947
+ else if (x === "ArrowUp")
1948
+ g.preventDefault(), k.value > 0 && (k.value -= 1, q(M.value[k.value], f.value));
1949
+ else if (x === "Enter") {
1950
+ g.preventDefault();
1951
+ const F = K.value[k.value];
1952
+ F && _(F), D.value?.blur();
1953
+ } else x === "Escape" ? (g.preventDefault(), H()) : x === "Backspace" ? s.value && S.value === "" && $.value.length && ($.value = $.value.slice(0, -1), a.value = [...$.value], r("change", a.value)) : x === "Home" ? (k.value = 0, q(M.value[0], f.value)) : x === "End" ? (k.value = K.value.length - 1, q(M.value[k.value], f.value)) : x === "Tab" && H();
1954
+ }, ye = () => {
1955
+ n.value || (m.value = !0);
1956
+ }, Ce = () => {
1957
+ m.value = !1, S.value = "";
1958
+ }, xe = (g) => {
1959
+ g.key === "Escape" && c.value && H();
1960
+ }, we = (g) => {
1961
+ d.value && (d.value.contains(g.target) || H());
1962
+ }, qe = (g) => {
1963
+ c.value && f.value && !f.value.contains(g.target) && H();
1935
1964
  };
1936
- ue(() => t.options, (w) => {
1937
- w?.length && (C.value = [...w]);
1965
+ te(() => t.options, (g) => {
1966
+ g?.length && (C.value = [...g]);
1938
1967
  }, { immediate: !0 });
1939
- const ye = async () => {
1968
+ const Ge = async () => {
1940
1969
  if (s.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);
1970
+ Array.isArray(a.value) ? $.value = [...a.value] : ($.value = a.value == null ? [] : [a.value], a.value = [...$.value]), !t.options?.length && t.data && await V($.value);
1942
1971
  else {
1943
1972
  if (Array.isArray(a.value)) {
1944
- const w = a.value[0] ?? null;
1945
- a.value = w ?? null;
1973
+ const g = a.value[0] ?? null;
1974
+ a.value = g ?? null;
1946
1975
  }
1947
- v.value = await $e(a.value);
1976
+ v.value = await O(a.value);
1948
1977
  }
1949
1978
  };
1950
- ue(a, () => {
1951
- ye();
1979
+ te(a, () => {
1980
+ Ge();
1952
1981
  }), 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);
1982
+ addEventListener("keydown", xe), addEventListener("scroll", qe, !0), document.addEventListener("click", we, !0), t.options?.length ? C.value = [...t.options] : t.data && (C.value = await fe("")), await Ge();
1983
+ }), Re(() => {
1984
+ removeEventListener("keydown", xe), removeEventListener("scroll", qe, !0), document.removeEventListener("click", we, !0);
1956
1985
  });
1957
- async function nt() {
1986
+ async function dt() {
1958
1987
  if (!t.add) return;
1959
- const w = await De({ form: t.add.form, mode: "add" });
1960
- w && (await fetch(`/api/table/${t.add.token}`, {
1988
+ const g = await Te({ form: t.add.form, mode: "add" });
1989
+ g && (await fetch(`/api/table/${t.add.token}`, {
1961
1990
  method: "POST",
1962
1991
  headers: { "Content-Type": "application/json" },
1963
- body: JSON.stringify(w)
1964
- }).then((k) => k.json()), !t.options?.length && t.data && (C.value = await Y(U.value)));
1992
+ body: JSON.stringify(g)
1993
+ }).then((x) => x.json()), !t.options?.length && t.data && (C.value = await fe(S.value)));
1965
1994
  }
1966
- return (w, k) => (i(), u("div", {
1995
+ function ct(g, x = 200) {
1996
+ let F;
1997
+ return (...J) => {
1998
+ F && clearTimeout(F), F = window.setTimeout(() => g(...J), x);
1999
+ };
2000
+ }
2001
+ const pt = ct(async (g) => {
2002
+ C.value = await fe(g);
2003
+ }, 200);
2004
+ return te(S, (g) => {
2005
+ t.data && pt(g.trim());
2006
+ }), te(() => t.options, (g) => {
2007
+ !t.data && g?.length && (C.value = [...g]);
2008
+ }, { immediate: !0 }), te(() => t.parent ?? t.parentValue, () => {
2009
+ t.data && Me();
2010
+ }), te(ee, async () => {
2011
+ t.data && (s.value ? ($.value = [], a.value = [], r("change", [])) : (v.value = null, a.value = null, r("change", null)));
2012
+ }), (g, x) => (i(), u("div", {
1967
2013
  class: "flex gap-1 w-full",
1968
2014
  ref_key: "selectRoot",
1969
2015
  ref: d,
1970
- onClick: k[2] || (k[2] = ce(() => {
2016
+ onClick: x[2] || (x[2] = de(() => {
1971
2017
  }, ["stop"]))
1972
2018
  }, [
1973
2019
  l("div", {
1974
- class: M(["relative w-full font-sans", t.customClass])
2020
+ class: j(["relative w-full font-sans", t.customClass])
1975
2021
  }, [
1976
- k[7] || (k[7] = l("span", {
2022
+ x[7] || (x[7] = l("span", {
1977
2023
  id: "react-select-live-region",
1978
2024
  class: "sr-only"
1979
2025
  }, null, -1)),
1980
- k[8] || (k[8] = l("span", {
2026
+ x[8] || (x[8] = l("span", {
1981
2027
  "aria-live": "polite",
1982
2028
  "aria-atomic": "false",
1983
2029
  "aria-relevant": "additions text",
@@ -1985,44 +2031,44 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
1985
2031
  class: "sr-only"
1986
2032
  }, null, -1)),
1987
2033
  l("div", {
1988
- class: M([
2034
+ class: j([
1989
2035
  "flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
1990
2036
  "border-gray-300 hover:border-gray-400",
1991
- c.value || b.value ? "border-blue-500 ring-1 ring-blue-500" : "",
2037
+ c.value || m.value ? "border-blue-500 ring-1 ring-blue-500" : "",
1992
2038
  n.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
1993
2039
  ]),
1994
2040
  role: "combobox",
1995
2041
  "aria-expanded": c.value,
1996
2042
  "aria-haspopup": "listbox",
1997
- onKeydown: R,
1998
- onClick: q,
1999
- "data-focus": c.value || b.value ? "true" : "false"
2043
+ onKeydown: ue,
2044
+ onClick: be,
2045
+ "data-focus": c.value || m.value ? "true" : "false"
2000
2046
  }, [
2001
2047
  l("div", {
2002
2048
  class: "flex flex-1 items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",
2003
2049
  ref_key: "triggerRef",
2004
2050
  ref: p
2005
2051
  }, [
2006
- s.value && $.value.length ? (i(!0), u(ee, { key: 0 }, le(h.value, (O) => (i(), u("div", {
2052
+ s.value && $.value.length ? (i(!0), u(Q, { key: 0 }, le(b.value, (F) => (i(), u("div", {
2007
2053
  class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border",
2008
- key: O.id
2054
+ key: F.id
2009
2055
  }, [
2010
- l("div", ga, [
2011
- O?.color ? (i(), u("span", {
2056
+ l("div", Ca, [
2057
+ F?.color ? (i(), u("span", {
2012
2058
  key: 0,
2013
2059
  class: "w-[16px] h-[16px] rounded-md block ml-1.5",
2014
- style: we({ backgroundColor: O?.color })
2015
- }, null, 4)) : z("", !0),
2060
+ style: ke({ backgroundColor: F?.color })
2061
+ }, null, 4)) : A("", !0),
2016
2062
  l("div", {
2017
2063
  class: "truncate text-gray-900 overflow-hidden",
2018
- title: O.text
2019
- }, F(O.text), 9, ba)
2064
+ title: F.text
2065
+ }, R(F.text), 9, Va)
2020
2066
  ]),
2021
2067
  l("div", {
2022
2068
  role: "button",
2023
2069
  class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
2024
- onClick: ce((Z) => he(O.id), ["stop"])
2025
- }, k[3] || (k[3] = [
2070
+ onClick: de((J) => h(F.id), ["stop"])
2071
+ }, x[3] || (x[3] = [
2026
2072
  l("svg", {
2027
2073
  height: "14",
2028
2074
  width: "14",
@@ -2033,27 +2079,27 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
2033
2079
  }, [
2034
2080
  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" })
2035
2081
  ], -1)
2036
- ]), 8, ya)
2037
- ]))), 128)) : !s.value && !b.value && v.value?.text && U.value === "" ? (i(), u("div", {
2082
+ ]), 8, Ma)
2083
+ ]))), 128)) : !s.value && !m.value && v.value?.text && S.value === "" ? (i(), u("div", {
2038
2084
  key: 1,
2039
- class: M(["truncate text-gray-900"]),
2085
+ class: j(["truncate text-gray-900"]),
2040
2086
  title: v.value.text
2041
2087
  }, [
2042
2088
  v.value?.color ? (i(), u("span", {
2043
2089
  key: 0,
2044
2090
  class: "w-[14px] h-[14px] rounded-md block mr-1 mt-1 absolute",
2045
- style: we({ backgroundColor: v.value?.color })
2046
- }, null, 4)) : z("", !0),
2091
+ style: ke({ backgroundColor: v.value?.color })
2092
+ }, null, 4)) : A("", !0),
2047
2093
  l("span", {
2048
- class: M({ "pl-5": v.value?.color })
2049
- }, F(v.value.text), 3)
2050
- ], 8, xa)) : z("", !0),
2051
- K.value ? (i(), u("div", wa, F(g.value), 1)) : z("", !0),
2052
- l("div", ka, [
2053
- !n.value && w.search ? X((i(), u("input", {
2094
+ class: j({ "pl-5": v.value?.color })
2095
+ }, R(v.value.text), 3)
2096
+ ], 8, La)) : A("", !0),
2097
+ Z.value ? (i(), u("div", Sa, R(y.value), 1)) : A("", !0),
2098
+ l("div", Ba, [
2099
+ !n.value && g.search ? W((i(), u("input", {
2054
2100
  key: 0,
2055
2101
  ref_key: "inputRef",
2056
- ref: N,
2102
+ ref: D,
2057
2103
  class: "w-full bg-transparent outline-none border-0 m-0 p-0 text-gray-900",
2058
2104
  autocapitalize: "none",
2059
2105
  autocomplete: "off",
@@ -2062,25 +2108,25 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
2062
2108
  type: "text",
2063
2109
  tabindex: "0",
2064
2110
  "aria-autocomplete": "list",
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
2070
- }, null, 40, _a)), [
2071
- [fe, U.value]
2072
- ]) : z("", !0)
2111
+ placeholder: (s.value && $.value.length ? " " : null) || (m.value && !S.value?.length ? v.value?.text : " "),
2112
+ "onUpdate:modelValue": x[0] || (x[0] = (F) => S.value = F),
2113
+ onFocus: ye,
2114
+ onBlur: Ce,
2115
+ onKeydown: Be
2116
+ }, null, 40, ja)), [
2117
+ [ce, S.value]
2118
+ ]) : A("", !0)
2073
2119
  ])
2074
2120
  ], 512),
2075
- l("div", $a, [
2076
- A.value ? (i(), u("button", {
2121
+ l("div", Ia, [
2122
+ U.value ? (i(), u("button", {
2077
2123
  key: 0,
2078
2124
  type: "button",
2079
2125
  class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
2080
2126
  "aria-hidden": "true",
2081
2127
  disabled: n.value,
2082
- onClick: ce(oe, ["stop"])
2083
- }, k[4] || (k[4] = [
2128
+ onClick: de(ve, ["stop"])
2129
+ }, x[4] || (x[4] = [
2084
2130
  l("svg", {
2085
2131
  height: "20",
2086
2132
  width: "20",
@@ -2089,15 +2135,15 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
2089
2135
  }, [
2090
2136
  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" })
2091
2137
  ], -1)
2092
- ]), 8, Ca)) : z("", !0),
2093
- k[6] || (k[6] = l("div", { class: "self-stretch w-px bg-[#ccc] my-[1px]" }, null, -1)),
2138
+ ]), 8, za)) : A("", !0),
2139
+ x[6] || (x[6] = l("div", { class: "self-stretch w-px bg-[#ccc] my-[1px]" }, null, -1)),
2094
2140
  l("button", {
2095
2141
  type: "button",
2096
2142
  class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
2097
2143
  "aria-hidden": "true",
2098
2144
  disabled: n.value,
2099
- onClick: k[1] || (k[1] = ce((O) => j(), ["stop"]))
2100
- }, k[5] || (k[5] = [
2145
+ onClick: x[1] || (x[1] = de((F) => se(), ["stop"]))
2146
+ }, x[5] || (x[5] = [
2101
2147
  l("svg", {
2102
2148
  height: "20",
2103
2149
  width: "20",
@@ -2106,64 +2152,64 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
2106
2152
  }, [
2107
2153
  l("path", { d: "M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z" })
2108
2154
  ], -1)
2109
- ]), 8, Va)
2155
+ ]), 8, Fa)
2110
2156
  ])
2111
- ], 42, ha),
2112
- c.value ? (i(), u("div", Ma, [
2157
+ ], 42, $a),
2158
+ c.value ? (i(), u("div", Oa, [
2113
2159
  l("div", {
2114
2160
  class: "max-h-[300px] overflow-y-auto py-1",
2115
2161
  ref_key: "listRef",
2116
2162
  ref: f
2117
2163
  }, [
2118
- J.value.length ? (i(!0), u(ee, { key: 0 }, le(J.value, (O, Z) => (i(), u("div", {
2119
- key: O.id,
2164
+ K.value.length ? (i(!0), u(Q, { key: 0 }, le(K.value, (F, J) => (i(), u("div", {
2165
+ key: F.id,
2120
2166
  ref_for: !0,
2121
- ref: (xe) => D.value[Z] = xe,
2122
- class: M([
2167
+ ref: (me) => M.value[J] = me,
2168
+ class: j([
2123
2169
  "flex px-3 py-2 cursor-default select-none hover:bg-blue-300",
2124
- V.value === Z ? "bg-blue-300" : "",
2125
- S(O.id) ? "text-white bg-blue-500" : "text-gray-900 bg-white"
2170
+ k.value === J ? "bg-blue-300" : "",
2171
+ I(F.id) ? "text-white bg-blue-500" : "text-gray-900 bg-white"
2126
2172
  ]),
2127
- "aria-disabled": S(O.id) ? "true" : "false",
2173
+ "aria-disabled": I(F.id) ? "true" : "false",
2128
2174
  role: "option",
2129
2175
  tabindex: "-1",
2130
- onClick: (xe) => m(O)
2176
+ onClick: (me) => P(F)
2131
2177
  }, [
2132
- O?.color ? (i(), u("span", {
2178
+ F?.color ? (i(), u("span", {
2133
2179
  key: 0,
2134
2180
  class: "w-[11px] h-[11px] rounded-full block mr-1 mt-1.5",
2135
- style: we({ backgroundColor: O?.color })
2136
- }, null, 4)) : z("", !0),
2181
+ style: ke({ backgroundColor: F?.color })
2182
+ }, null, 4)) : A("", !0),
2137
2183
  l("div", {
2138
- class: M([
2184
+ class: j([
2139
2185
  "leading-[19px]",
2140
- V.value === O.id ? "text-white" : "",
2186
+ k.value === F.id ? "text-white" : "",
2141
2187
  // active style like react-select
2142
- (V.value === Z, "")
2188
+ (k.value === J, "")
2143
2189
  ])
2144
- }, F(O.text), 3)
2145
- ], 10, La))), 128)) : (i(), u("div", Sa, " No options "))
2190
+ }, R(F.text), 3)
2191
+ ], 10, Aa))), 128)) : (i(), u("div", Ea, " No options "))
2146
2192
  ], 512)
2147
- ])) : z("", !0)
2193
+ ])) : A("", !0)
2148
2194
  ], 2),
2149
2195
  t.add ? (i(), u("button", {
2150
2196
  key: 0,
2151
- onClick: nt,
2197
+ onClick: dt,
2152
2198
  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",
2153
2199
  disabled: n.value,
2154
2200
  type: "button"
2155
2201
  }, [
2156
- I(Ae, {
2202
+ B(ze, {
2157
2203
  width: "16",
2158
2204
  height: "16"
2159
2205
  }),
2160
- k[9] || (k[9] = l("span", null, "Додати", -1))
2161
- ], 8, Ba)) : z("", !0)
2206
+ x[9] || (x[9] = l("span", null, "Додати", -1))
2207
+ ], 8, Da)) : A("", !0)
2162
2208
  ], 512));
2163
2209
  }
2164
- }), Ia = ["placeholder", "disabled"], za = /* @__PURE__ */ E({
2210
+ }), Ta = ["placeholder", "disabled"], Ra = /* @__PURE__ */ E({
2165
2211
  __name: "vs-input-textarea",
2166
- props: /* @__PURE__ */ W({
2212
+ props: /* @__PURE__ */ X({
2167
2213
  style: { default: () => ({}) },
2168
2214
  customClass: { default: "" },
2169
2215
  disabled: { type: Boolean, default: !1 },
@@ -2177,21 +2223,21 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
2177
2223
  }),
2178
2224
  emits: ["update:modelValue"],
2179
2225
  setup(o) {
2180
- const e = o, { inputClass: t } = _e(e.style), r = Q(o, "modelValue");
2181
- return (s, n) => X((i(), u("textarea", {
2226
+ const e = o, { inputClass: t } = $e(e.style), r = Y(o, "modelValue");
2227
+ return (s, n) => W((i(), u("textarea", {
2182
2228
  "onUpdate:modelValue": n[0] || (n[0] = (a) => r.value = a),
2183
2229
  placeholder: s.placeholder,
2184
2230
  disabled: s.disabled,
2185
2231
  row: "2",
2186
- class: M(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto bg-white", [G(t)]]),
2232
+ class: j(["py-1.5 px-3 block w-full placeholder:text[#767f8f] h-auto bg-white", [G(t)]]),
2187
2233
  style: {
2188
2234
  border: "1px solid #CFD9E0"
2189
2235
  }
2190
- }, null, 10, Ia)), [
2191
- [fe, r.value]
2236
+ }, null, 10, Ta)), [
2237
+ [ce, r.value]
2192
2238
  ]);
2193
2239
  }
2194
- }), Aa = {}, Oa = {
2240
+ }), Pa = {}, Na = {
2195
2241
  xmlns: "http://www.w3.org/2000/svg",
2196
2242
  viewBox: "0 0 24 24",
2197
2243
  fill: "none",
@@ -2201,8 +2247,8 @@ const Mo = /* @__PURE__ */ P($o, [["render", Vo]]), Lo = { class: "flex flex-col
2201
2247
  "stroke-linejoin": "round",
2202
2248
  class: "icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"
2203
2249
  };
2204
- function Ea(o, e) {
2205
- return i(), u("svg", Oa, e[0] || (e[0] = [
2250
+ function Ha(o, e) {
2251
+ return i(), u("svg", Na, e[0] || (e[0] = [
2206
2252
  l("path", {
2207
2253
  stroke: "none",
2208
2254
  d: "M0 0h24v24H0z",
@@ -2212,7 +2258,7 @@ function Ea(o, e) {
2212
2258
  l("path", { d: "M21 21l-6 -6" }, null, -1)
2213
2259
  ]));
2214
2260
  }
2215
- const Fa = /* @__PURE__ */ P(Aa, [["render", Ea]]), Da = {}, Ua = {
2261
+ const qa = /* @__PURE__ */ N(Pa, [["render", Ha]]), Ga = {}, Ja = {
2216
2262
  class: "flex-shrink-0 mt-0.5 size-3.5",
2217
2263
  xmlns: "http://www.w3.org/2000/svg",
2218
2264
  viewBox: "0 0 24 24",
@@ -2222,15 +2268,15 @@ const Fa = /* @__PURE__ */ P(Aa, [["render", Ea]]), Da = {}, Ua = {
2222
2268
  "stroke-linecap": "round",
2223
2269
  "stroke-linejoin": "round"
2224
2270
  };
2225
- function Ta(o, e) {
2226
- return i(), u("svg", Ua, e[0] || (e[0] = [
2271
+ function Ka(o, e) {
2272
+ return i(), u("svg", Ja, e[0] || (e[0] = [
2227
2273
  l("path", { d: "m3 16 4 4 4-4" }, null, -1),
2228
2274
  l("path", { d: "M7 20V4" }, null, -1),
2229
2275
  l("path", { d: "m21 8-4-4-4 4" }, null, -1),
2230
2276
  l("path", { d: "M17 4v16" }, null, -1)
2231
2277
  ]));
2232
2278
  }
2233
- const Ra = /* @__PURE__ */ P(Da, [["render", Ta]]), Pa = {}, Na = {
2279
+ const Za = /* @__PURE__ */ N(Ga, [["render", Ka]]), Wa = {}, Qa = {
2234
2280
  xmlns: "http://www.w3.org/2000/svg",
2235
2281
  width: "14",
2236
2282
  height: "14",
@@ -2241,8 +2287,8 @@ const Ra = /* @__PURE__ */ P(Da, [["render", Ta]]), Pa = {}, Na = {
2241
2287
  "stroke-linecap": "round",
2242
2288
  "stroke-linejoin": "round"
2243
2289
  };
2244
- function Ha(o, e) {
2245
- return i(), u("svg", Na, e[0] || (e[0] = [
2290
+ function Xa(o, e) {
2291
+ return i(), u("svg", Qa, e[0] || (e[0] = [
2246
2292
  l("path", {
2247
2293
  stroke: "none",
2248
2294
  d: "M0 0h24v24H0z",
@@ -2253,7 +2299,7 @@ function Ha(o, e) {
2253
2299
  l("path", { d: "M12 4l0 12" }, null, -1)
2254
2300
  ]));
2255
2301
  }
2256
- const qa = /* @__PURE__ */ P(Pa, [["render", Ha]]), Ga = {}, Ja = {
2302
+ const Ya = /* @__PURE__ */ N(Wa, [["render", Xa]]), es = {}, ts = {
2257
2303
  xmlns: "http://www.w3.org/2000/svg",
2258
2304
  viewBox: "0 0 24 24",
2259
2305
  fill: "none",
@@ -2262,8 +2308,8 @@ const qa = /* @__PURE__ */ P(Pa, [["render", Ha]]), Ga = {}, Ja = {
2262
2308
  "stroke-linecap": "round",
2263
2309
  "stroke-linejoin": "round"
2264
2310
  };
2265
- function Ka(o, e) {
2266
- return i(), u("svg", Ja, e[0] || (e[0] = [
2311
+ function ls(o, e) {
2312
+ return i(), u("svg", ts, e[0] || (e[0] = [
2267
2313
  l("path", {
2268
2314
  stroke: "none",
2269
2315
  d: "M0 0h24v24H0z",
@@ -2274,7 +2320,7 @@ function Ka(o, e) {
2274
2320
  l("path", { d: "M12 4l0 12" }, null, -1)
2275
2321
  ]));
2276
2322
  }
2277
- const Za = /* @__PURE__ */ P(Ga, [["render", Ka]]), Wa = {}, Qa = {
2323
+ const os = /* @__PURE__ */ N(es, [["render", ls]]), as = {}, ss = {
2278
2324
  xmlns: "http://www.w3.org/2000/svg",
2279
2325
  viewBox: "0 0 24 24",
2280
2326
  fill: "none",
@@ -2283,22 +2329,22 @@ const Za = /* @__PURE__ */ P(Ga, [["render", Ka]]), Wa = {}, Qa = {
2283
2329
  "stroke-linecap": "round",
2284
2330
  "stroke-linejoin": "round"
2285
2331
  };
2286
- function Xa(o, e) {
2287
- return i(), u("svg", Qa, e[0] || (e[0] = [
2332
+ function rs(o, e) {
2333
+ return i(), u("svg", ss, e[0] || (e[0] = [
2288
2334
  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)
2289
2335
  ]));
2290
2336
  }
2291
- const We = /* @__PURE__ */ P(Wa, [["render", Xa]]), Ya = {}, es = {
2337
+ const Ye = /* @__PURE__ */ N(as, [["render", rs]]), ns = {}, is = {
2292
2338
  viewBox: "0 0 178 90",
2293
2339
  fill: "none",
2294
2340
  xmlns: "http://www.w3.org/2000/svg"
2295
2341
  };
2296
- function ts(o, e) {
2297
- return i(), u("svg", es, e[0] || (e[0] = [
2342
+ function us(o, e) {
2343
+ return i(), u("svg", is, e[0] || (e[0] = [
2298
2344
  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)
2299
2345
  ]));
2300
2346
  }
2301
- const ls = /* @__PURE__ */ P(Ya, [["render", ts]]), os = {}, as = {
2347
+ const ds = /* @__PURE__ */ N(ns, [["render", us]]), cs = {}, ps = {
2302
2348
  xmlns: "http://www.w3.org/2000/svg",
2303
2349
  viewBox: "0 0 24 24",
2304
2350
  fill: "none",
@@ -2307,18 +2353,18 @@ const ls = /* @__PURE__ */ P(Ya, [["render", ts]]), os = {}, as = {
2307
2353
  "stroke-linecap": "round",
2308
2354
  "stroke-linejoin": "round"
2309
2355
  };
2310
- function ss(o, e) {
2311
- return i(), u("svg", as, e[0] || (e[0] = [
2356
+ function fs(o, e) {
2357
+ return i(), u("svg", ps, e[0] || (e[0] = [
2312
2358
  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)
2313
2359
  ]));
2314
2360
  }
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 = {
2361
+ const vs = /* @__PURE__ */ N(cs, [["render", fs]]), ms = { class: "vs-datatable border rounded-xl w-full flex-grow" }, hs = { class: "flex items-center npm gap-[16px] justify-between p-[20px] pb-[16px]" }, gs = { class: "relative w-full" }, bs = { class: "table-wrapper flex gap-2" }, ys = { class: "vs-popover inline-block text-slate-700" }, xs = { class: "text-center" }, ws = { class: "" }, ks = { 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" }, _s = { class: "flex flex-col p-[1px] gap-[2px] w-[140px]" }, $s = { class: "text-sm items-center text-gray-800 flex gap-1" }, Cs = { class: "w-full overflow-x-auto" }, Vs = { class: "w-full table-auto caption-bottom text-sm" }, Ms = { class: "[&_tr]:border-b" }, Ls = { 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" }, Ss = { 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" }, Bs = {
2316
2362
  key: 0,
2317
2363
  colspan: "100%",
2318
2364
  class: "text-center"
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({
2365
+ }, js = { class: "w-full" }, Is = { class: "p-5 min-h-[200px] flex flex-col justify-center items-center text-center" }, zs = ["onDragstart", "onDragover", "onDrop"], Fs = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] text-center" }, Os = { class: "flex items-center justify-center" }, As = { 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" }, Es = { class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]" }, Ds = { class: "flex items-center justify-center gap-2" }, Us = ["onClick"], Ts = ["onClick"], Rs = { class: "vs-form__head mr-5 mt-3 flex items-center justify-end sticky top-0 left-0 z-[60] bg-white" }, Ps = /* @__PURE__ */ E({
2320
2366
  __name: "vs-input-datatable",
2321
- props: /* @__PURE__ */ W({
2367
+ props: /* @__PURE__ */ X({
2322
2368
  colModel: {},
2323
2369
  style: {},
2324
2370
  customClass: {},
@@ -2333,112 +2379,112 @@ const rs = /* @__PURE__ */ P(os, [["render", ss]]), ns = { class: "vs-datatable
2333
2379
  }),
2334
2380
  emits: ["update:modelValue"],
2335
2381
  setup(o) {
2336
- const e = o, t = Q(o, "modelValue"), r = x({}), s = x(""), n = T(() => {
2382
+ const e = o, t = Y(o, "modelValue"), r = w({}), s = w(""), n = T(() => {
2337
2383
  if (!s.value) return t.value ?? [];
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;
2384
+ const O = s.value.toLowerCase();
2385
+ return t.value.filter((V) => e.colModel?.some((z) => {
2386
+ const H = V[z.key];
2387
+ return H ? Array.isArray(H) ? H.join(", ").toLowerCase().includes(O) : String(H).toLowerCase().includes(O) : !1;
2342
2388
  }));
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) {
2389
+ }), a = w(null), d = w(null), p = w(!1), f = w(null), c = w({ top: 0, left: 0 }), m = (O) => {
2390
+ a.value = O;
2391
+ }, v = (O) => {
2392
+ d.value = O;
2393
+ }, C = (O) => {
2394
+ if (a.value === null || a.value === O) {
2349
2395
  a.value = null, d.value = null;
2350
2396
  return;
2351
2397
  }
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 = () => {
2398
+ const V = [...t.value], [z] = V.splice(a.value, 1);
2399
+ V.splice(O, 0, z), t.value = V, a.value = null, d.value = null;
2400
+ }, k = (O) => {
2401
+ const z = O.currentTarget.getBoundingClientRect();
2402
+ c.value = { top: z.bottom + window.scrollY, left: z.left + window.scrollX }, p.value = !p.value;
2403
+ }, M = () => {
2358
2404
  f.value && f.value.click();
2359
- }, U = (B) => {
2360
- const j = B.target.files?.[0];
2361
- if (!j) return;
2362
- const q = new FileReader();
2363
- q.onload = (oe) => {
2405
+ }, S = (O) => {
2406
+ const z = O.target.files?.[0];
2407
+ if (!z) return;
2408
+ const H = new FileReader();
2409
+ H.onload = (se) => {
2364
2410
  try {
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);
2411
+ const be = se.target?.result;
2412
+ if (typeof be == "string") {
2413
+ const ve = JSON.parse(be);
2414
+ Array.isArray(ve) && t.value.push(...ve);
2369
2415
  }
2370
- } catch (he) {
2371
- console.error("Error parsing file:", he);
2416
+ } catch (be) {
2417
+ console.error("Error parsing file:", be);
2372
2418
  }
2373
- }, q.readAsText(j);
2374
- }, N = () => {
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);
2419
+ }, H.readAsText(z);
2420
+ }, D = () => {
2421
+ const O = JSON.stringify(t.value, null, 2), V = new Blob([O], { type: "application/json" }), z = URL.createObjectURL(V), H = document.createElement("a");
2422
+ H.href = z, H.download = "data.json", H.click(), URL.revokeObjectURL(z);
2377
2423
  };
2378
2424
  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());
2425
+ const O = e.colModel?.filter((V) => V.data);
2426
+ O?.length && Promise.all(O.map(async (V) => {
2427
+ r.value[V.key] = await fetch(`/api/suggest/${V.data}`).then((z) => z.json());
2382
2428
  }));
2383
2429
  });
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 = {};
2430
+ const $ = w(""), b = w(!1);
2431
+ let y = "edit", Z = 0;
2432
+ const U = w({}), I = w({});
2433
+ async function K() {
2434
+ $.value = "Додати", b.value = !0, y = "add", U.value = {};
2389
2435
  }
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] || "-";
2436
+ function ae(O, V) {
2437
+ return r.value[V.key] && O[V.key] ? r.value[V.key].find((z) => z.id.toString() === O[V.key].toString())?.text ?? O[V.key] : O[V.key] || "-";
2392
2438
  }
2393
- async function ae(B, _) {
2394
- $.value = "Редагувати", h.value = !0, g = "edit", K = _, A.value = { ...B };
2439
+ async function ee(O, V) {
2440
+ $.value = "Редагувати", b.value = !0, y = "edit", Z = V, U.value = { ...O };
2395
2441
  }
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(`
2442
+ function fe() {
2443
+ const O = I.value.validate();
2444
+ if (O) {
2445
+ ge({ type: "warning", title: "Помилка валідації", message: Object.entries(O).map(([V, z]) => `${V}: ${z}`).join(`
2400
2446
  `) });
2401
2447
  return;
2402
2448
  }
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;
2449
+ y === "add" ? Array.isArray(t.value) ? t.value = [...t.value, U.value] : t.value = [U.value] : t.value = t.value.map((V, z) => z === Z ? U.value : V), b.value = !1;
2404
2450
  }
2405
- function Le(B) {
2406
- t.value = t.value.filter((_, j) => j !== B);
2451
+ function Me(O) {
2452
+ t.value = t.value.filter((V, z) => z !== O);
2407
2453
  }
2408
- return (B, _) => (i(), u("div", ns, [
2409
- l("div", is, [
2410
- l("div", us, [
2411
- I(Fa, {
2454
+ return (O, V) => (i(), u("div", ms, [
2455
+ l("div", hs, [
2456
+ l("div", gs, [
2457
+ B(qa, {
2412
2458
  width: "14",
2413
2459
  height: "14",
2414
2460
  class: "absolute left-3 top-1/2 transform -translate-y-1/2 text-stone-500"
2415
2461
  }),
2416
- X(l("input", {
2462
+ W(l("input", {
2417
2463
  type: "text",
2418
- "onUpdate:modelValue": _[0] || (_[0] = (j) => s.value = j),
2464
+ "onUpdate:modelValue": V[0] || (V[0] = (z) => s.value = z),
2419
2465
  placeholder: "Пошук",
2420
2466
  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"
2421
2467
  }, null, 512), [
2422
- [fe, s.value]
2468
+ [ce, s.value]
2423
2469
  ])
2424
2470
  ]),
2425
- l("div", ds, [
2471
+ l("div", bs, [
2426
2472
  l("input", {
2427
2473
  ref_key: "fileInput",
2428
2474
  ref: f,
2429
- onChange: U,
2475
+ onChange: S,
2430
2476
  class: "hidden",
2431
2477
  accept: ".json",
2432
2478
  type: "file"
2433
2479
  }, null, 544),
2434
- l("div", cs, [
2435
- l("div", ps, [
2436
- l("div", fs, [
2480
+ l("div", ys, [
2481
+ l("div", xs, [
2482
+ l("div", ws, [
2437
2483
  l("button", {
2438
- onClick: V,
2484
+ onClick: k,
2439
2485
  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"
2440
2486
  }, [
2441
- I(Ra, {
2487
+ B(Za, {
2442
2488
  height: "16",
2443
2489
  width: "16"
2444
2490
  })
@@ -2447,157 +2493,157 @@ const rs = /* @__PURE__ */ P(os, [["render", ss]]), ns = { class: "vs-datatable
2447
2493
  ])
2448
2494
  ])
2449
2495
  ]),
2450
- (i(), te(ct, { to: "body" }, [
2496
+ (i(), oe(mt, { to: "body" }, [
2451
2497
  p.value ? (i(), u("div", {
2452
2498
  key: 0,
2453
2499
  class: "text-slate-700 vsTailwind vs-popover__content bottom",
2454
- style: we([{ width: "fit-content", "z-index": "10002", position: "fixed" }, { position: "absolute", top: c.value.top + "px", left: c.value.left + "px" }])
2500
+ style: ke([{ width: "fit-content", "z-index": "10002", position: "fixed" }, { position: "absolute", top: c.value.top + "px", left: c.value.left + "px" }])
2455
2501
  }, [
2456
- l("div", vs, [
2457
- l("div", ms, [
2502
+ l("div", ks, [
2503
+ l("div", _s, [
2458
2504
  l("button", {
2459
- onClick: D,
2505
+ onClick: M,
2460
2506
  class: "text-slate-700 flex items-center gap-1 px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"
2461
2507
  }, [
2462
- I(qa, {
2508
+ B(Ya, {
2463
2509
  class: "text-black",
2464
2510
  width: "14",
2465
2511
  height: "14"
2466
2512
  }),
2467
- _[4] || (_[4] = ie(" Імпортувати "))
2513
+ V[4] || (V[4] = ie(" Імпортувати ", -1))
2468
2514
  ]),
2469
2515
  l("button", {
2470
- onClick: N,
2516
+ onClick: D,
2471
2517
  class: "text-slate-700 flex items-center px-3 py-2 rounded-md cursor-pointer group hover:bg-gray-100"
2472
2518
  }, [
2473
- l("span", hs, [
2474
- I(Za, {
2519
+ l("span", $s, [
2520
+ B(os, {
2475
2521
  class: "text-black",
2476
2522
  width: "14",
2477
2523
  height: "14"
2478
2524
  }),
2479
- _[5] || (_[5] = ie(" Експортувати "))
2525
+ V[5] || (V[5] = ie(" Експортувати ", -1))
2480
2526
  ])
2481
2527
  ])
2482
2528
  ])
2483
2529
  ])
2484
- ], 4)) : z("", !0)
2530
+ ], 4)) : A("", !0)
2485
2531
  ])),
2486
2532
  l("button", {
2487
- onClick: J,
2533
+ onClick: K,
2488
2534
  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"
2489
2535
  }, [
2490
- I(Ae),
2491
- _[6] || (_[6] = ie(" Додати "))
2536
+ B(ze),
2537
+ V[6] || (V[6] = ie(" Додати ", -1))
2492
2538
  ])
2493
2539
  ]),
2494
- l("div", gs, [
2495
- l("table", bs, [
2496
- l("thead", ys, [
2497
- l("tr", xs, [
2498
- l("th", ws, [
2499
- I(We, {
2540
+ l("div", Cs, [
2541
+ l("table", Vs, [
2542
+ l("thead", Ms, [
2543
+ l("tr", Ls, [
2544
+ l("th", Ss, [
2545
+ B(Ye, {
2500
2546
  width: "24",
2501
2547
  height: "24",
2502
2548
  class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
2503
2549
  })
2504
2550
  ]),
2505
- (i(!0), u(ee, null, le(B.colModel, (j) => (i(), u("th", {
2506
- key: j.key,
2551
+ (i(!0), u(Q, null, le(O.colModel, (z) => (i(), u("th", {
2552
+ key: z.key,
2507
2553
  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]"
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))
2554
+ }, R(z.ua || z.label), 1))), 128)),
2555
+ V[7] || (V[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))
2510
2556
  ])
2511
2557
  ]),
2512
2558
  l("tbody", {
2513
- class: M({ "[&_tr:last-child]:border-0": !d.value })
2559
+ class: j({ "[&_tr:last-child]:border-0": !d.value })
2514
2560
  }, [
2515
- n.value.length === 0 ? (i(), u("td", ks, [
2516
- l("div", _s, [
2517
- l("div", $s, [
2518
- I(ls, { class: "w-48 mx-auto" }),
2519
- _[8] || (_[8] = l("div", { class: "max-w-sm mx-auto mt-6" }, [
2561
+ n.value.length === 0 ? (i(), u("td", Bs, [
2562
+ l("div", js, [
2563
+ l("div", Is, [
2564
+ B(ds, { class: "w-48 mx-auto" }),
2565
+ V[8] || (V[8] = l("div", { class: "max-w-sm mx-auto mt-6" }, [
2520
2566
  l("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "Нічого не знайдено"),
2521
2567
  l("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
2522
2568
  ], -1))
2523
2569
  ])
2524
2570
  ])
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,
2530
- "border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20": d.value === q
2571
+ ])) : A("", !0),
2572
+ (i(!0), u(Q, null, le(n.value, (z, H) => (i(), u("tr", {
2573
+ key: z.id,
2574
+ class: j(["border-b data-[state=selected]:bg-muted transition-all duration-200 hover:bg-slate-50/60 dark:hover:bg-slate-700/60 cursor-move", {
2575
+ "opacity-50": a.value === H,
2576
+ "border-t-2 border-b-2 border-blue-500 bg-blue-50 dark:bg-blue-900/20": d.value === H
2531
2577
  }]),
2532
2578
  draggable: "true",
2533
- onDragstart: (oe) => b(q),
2534
- onDragover: ce((oe) => v(q), ["prevent"]),
2535
- onDrop: (oe) => C(q)
2579
+ onDragstart: (se) => m(H),
2580
+ onDragover: de((se) => v(H), ["prevent"]),
2581
+ onDrop: (se) => C(H)
2536
2582
  }, [
2537
- l("td", Vs, [
2538
- l("div", Ms, [
2539
- I(We, {
2583
+ l("td", Fs, [
2584
+ l("div", Os, [
2585
+ B(Ye, {
2540
2586
  width: "24",
2541
2587
  height: "24",
2542
2588
  class: "w-4 h-4 mx-auto text-slate-400 dark:text-slate-500"
2543
2589
  })
2544
2590
  ])
2545
2591
  ]),
2546
- (i(!0), u(ee, null, le(B.colModel, (oe) => (i(), u("td", {
2547
- key: oe.key,
2592
+ (i(!0), u(Q, null, le(O.colModel, (se) => (i(), u("td", {
2593
+ key: se.key,
2548
2594
  class: "p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]"
2549
2595
  }, [
2550
- l("div", Ls, F(Y(j, oe)), 1)
2596
+ l("div", As, R(ae(z, se)), 1)
2551
2597
  ]))), 128)),
2552
- l("td", Ss, [
2553
- l("div", Bs, [
2598
+ l("td", Es, [
2599
+ l("div", Ds, [
2554
2600
  l("button", {
2555
- onClick: (oe) => ae(j, q),
2601
+ onClick: (se) => ee(z, H),
2556
2602
  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"
2557
2603
  }, [
2558
- I(rs, {
2604
+ B(vs, {
2559
2605
  width: "24",
2560
2606
  height: "24",
2561
2607
  class: "w-3 h-3"
2562
2608
  })
2563
- ], 8, js),
2609
+ ], 8, Us),
2564
2610
  l("button", {
2565
- onClick: (oe) => Le(q),
2611
+ onClick: (se) => Me(H),
2566
2612
  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"
2567
2613
  }, [
2568
- I(Ee, {
2614
+ B(De, {
2569
2615
  width: "24",
2570
2616
  height: "24",
2571
2617
  class: "w-3 h-3"
2572
2618
  })
2573
- ], 8, Is)
2619
+ ], 8, Ts)
2574
2620
  ])
2575
2621
  ])
2576
- ], 42, Cs))), 128))
2622
+ ], 42, zs))), 128))
2577
2623
  ], 2)
2578
2624
  ])
2579
2625
  ]),
2580
- I(G(vt), {
2581
- visible: h.value,
2626
+ B(G(bt), {
2627
+ visible: b.value,
2582
2628
  title: $.value,
2583
2629
  size: "lg"
2584
2630
  }, {
2585
- default: Me(() => [
2586
- I(Oe, {
2631
+ default: Se(() => [
2632
+ B(Ee, {
2587
2633
  schema: e.colModel,
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)
2634
+ values: U.value,
2635
+ "onUpdate:values": V[1] || (V[1] = (z) => U.value = z),
2636
+ form: I.value,
2637
+ "onUpdate:form": V[2] || (V[2] = (z) => I.value = z)
2592
2638
  }, null, 8, ["schema", "values", "form"]),
2593
- l("div", zs, [
2639
+ l("div", Rs, [
2594
2640
  l("button", {
2595
2641
  type: "button",
2596
- onClick: _[3] || (_[3] = (j) => h.value = !1),
2642
+ onClick: V[3] || (V[3] = (z) => b.value = !1),
2597
2643
  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"
2598
2644
  }, " Скасувати "),
2599
2645
  l("button", {
2600
- onClick: $e,
2646
+ onClick: fe,
2601
2647
  type: "button",
2602
2648
  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"
2603
2649
  }, " Зберегти ")
@@ -2607,7 +2653,7 @@ const rs = /* @__PURE__ */ P(os, [["render", ss]]), ns = { class: "vs-datatable
2607
2653
  }, 8, ["visible", "title"])
2608
2654
  ]));
2609
2655
  }
2610
- }), Os = {
2656
+ }), Ns = {
2611
2657
  draw: {
2612
2658
  toolbar: {
2613
2659
  actions: {
@@ -2715,7 +2761,7 @@ const rs = /* @__PURE__ */ P(os, [["render", ss]]), ns = { class: "vs-datatable
2715
2761
  }
2716
2762
  }
2717
2763
  };
2718
- function Es(o) {
2764
+ function Hs(o) {
2719
2765
  return o ? o.type === "FeatureCollection" || o.type === "Feature" ? o : o.geom ? {
2720
2766
  type: "Feature",
2721
2767
  geometry: {
@@ -2729,7 +2775,7 @@ function Es(o) {
2729
2775
  properties: {}
2730
2776
  } : null : null;
2731
2777
  }
2732
- const Fs = {}, Ds = {
2778
+ const qs = {}, Gs = {
2733
2779
  xmlns: "http://www.w3.org/2000/svg",
2734
2780
  viewBox: "0 0 24 24",
2735
2781
  stroke: "currentColor",
@@ -2739,8 +2785,8 @@ const Fs = {}, Ds = {
2739
2785
  "stroke-linejoin": "round",
2740
2786
  class: "icon icon-tabler icons-tabler-outline icon-tabler-map-pin"
2741
2787
  };
2742
- function Us(o, e) {
2743
- return i(), u("svg", Ds, e[0] || (e[0] = [
2788
+ function Js(o, e) {
2789
+ return i(), u("svg", Gs, e[0] || (e[0] = [
2744
2790
  l("path", {
2745
2791
  stroke: "none",
2746
2792
  d: "M0 0h24v24H0z",
@@ -2750,7 +2796,7 @@ function Us(o, e) {
2750
2796
  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)
2751
2797
  ]));
2752
2798
  }
2753
- const Ts = /* @__PURE__ */ P(Fs, [["render", Us]]), Rs = {}, Ps = {
2799
+ const Ks = /* @__PURE__ */ N(qs, [["render", Js]]), Zs = {}, Ws = {
2754
2800
  xmlns: "http://www.w3.org/2000/svg",
2755
2801
  viewBox: "0 0 24 24",
2756
2802
  fill: "none",
@@ -2760,8 +2806,8 @@ const Ts = /* @__PURE__ */ P(Fs, [["render", Us]]), Rs = {}, Ps = {
2760
2806
  "stroke-linejoin": "round",
2761
2807
  class: "icon icon-tabler icons-tabler-outline icon-tabler-line"
2762
2808
  };
2763
- function Ns(o, e) {
2764
- return i(), u("svg", Ps, e[0] || (e[0] = [
2809
+ function Qs(o, e) {
2810
+ return i(), u("svg", Ws, e[0] || (e[0] = [
2765
2811
  l("path", {
2766
2812
  stroke: "none",
2767
2813
  d: "M0 0h24v24H0z",
@@ -2772,7 +2818,7 @@ function Ns(o, e) {
2772
2818
  l("path", { d: "M7.5 16.5l9 -9" }, null, -1)
2773
2819
  ]));
2774
2820
  }
2775
- const Hs = /* @__PURE__ */ P(Rs, [["render", Ns]]), qs = {}, Gs = {
2821
+ const Xs = /* @__PURE__ */ N(Zs, [["render", Qs]]), Ys = {}, er = {
2776
2822
  xmlns: "http://www.w3.org/2000/svg",
2777
2823
  viewBox: "0 0 24 24",
2778
2824
  fill: "none",
@@ -2782,12 +2828,12 @@ const Hs = /* @__PURE__ */ P(Rs, [["render", Ns]]), qs = {}, Gs = {
2782
2828
  "stroke-linejoin": "round",
2783
2829
  class: "icon icon-tabler icons-tabler-outline icon-tabler-polygon"
2784
2830
  };
2785
- function Js(o, e) {
2786
- return i(), u("svg", Gs, e[0] || (e[0] = [
2831
+ function tr(o, e) {
2832
+ return i(), u("svg", er, e[0] || (e[0] = [
2787
2833
  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)
2788
2834
  ]));
2789
2835
  }
2790
- const Ks = /* @__PURE__ */ P(qs, [["render", Js]]), Zs = {}, Ws = {
2836
+ const lr = /* @__PURE__ */ N(Ys, [["render", tr]]), or = {}, ar = {
2791
2837
  xmlns: "http://www.w3.org/2000/svg",
2792
2838
  viewBox: "0 0 24 24",
2793
2839
  fill: "none",
@@ -2797,12 +2843,12 @@ const Ks = /* @__PURE__ */ P(qs, [["render", Js]]), Zs = {}, Ws = {
2797
2843
  "stroke-linejoin": "round",
2798
2844
  class: "icon icon-tabler icons-tabler-outline icon-tabler-topology-ring-3"
2799
2845
  };
2800
- function Qs(o, e) {
2801
- return i(), u("svg", Ws, e[0] || (e[0] = [
2846
+ function sr(o, e) {
2847
+ return i(), u("svg", ar, e[0] || (e[0] = [
2802
2848
  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)
2803
2849
  ]));
2804
2850
  }
2805
- const Xs = /* @__PURE__ */ P(Zs, [["render", Qs]]), Ys = {}, er = {
2851
+ const rr = /* @__PURE__ */ N(or, [["render", sr]]), nr = {}, ir = {
2806
2852
  version: "1.1",
2807
2853
  viewBox: "0 0 14 14",
2808
2854
  xmlns: "http://www.w3.org/2000/svg",
@@ -2810,8 +2856,8 @@ const Xs = /* @__PURE__ */ P(Zs, [["render", Qs]]), Ys = {}, er = {
2810
2856
  "xmlns:xlink": "http://www.w3.org/1999/xlink",
2811
2857
  class: "fullscreen-icon"
2812
2858
  };
2813
- function tr(o, e) {
2814
- return i(), u("svg", er, e[0] || (e[0] = [
2859
+ function ur(o, e) {
2860
+ return i(), u("svg", ir, e[0] || (e[0] = [
2815
2861
  l("title", null, null, -1),
2816
2862
  l("desc", null, null, -1),
2817
2863
  l("defs", null, null, -1),
@@ -2840,10 +2886,10 @@ function tr(o, e) {
2840
2886
  ], -1)
2841
2887
  ]));
2842
2888
  }
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 = {
2889
+ const dr = /* @__PURE__ */ N(nr, [["render", ur]]), cr = { class: "form-geom__search" }, pr = { class: "map-search__input" }, fr = { class: "flex flex-nowrap relative" }, vr = { class: "form-autocomplete relative min-w-[6rem] vsTailwind map-search__select hidden" }, mr = { class: "flex items-center w-full" }, hr = { class: "max-w-[90%] truncate" }, gr = {
2844
2890
  key: 0,
2845
2891
  class: "absolute z-[3100] mt-0.5 left-0 right-0"
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 = {
2892
+ }, br = { 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" }, yr = { 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" }, xr = ["onClick"], wr = { class: "flex justify-between items-center w-full" }, kr = { class: "flex items-center" }, _r = {
2847
2893
  key: 0,
2848
2894
  class: "flex-shrink-0 w-3.5 h-3.5 text-blue-600",
2849
2895
  width: "24",
@@ -2854,49 +2900,49 @@ const lr = /* @__PURE__ */ P(Ys, [["render", tr]]), or = { class: "form-geom__se
2854
2900
  "stroke-width": "2",
2855
2901
  "stroke-linecap": "round",
2856
2902
  "stroke-linejoin": "round"
2857
- }, hr = { class: "relative w-full" }, gr = { class: "vs-form-text relative bg-white rounded-lg" }, br = {
2903
+ }, $r = { class: "relative w-full" }, Cr = { class: "vs-form-text relative bg-white rounded-lg" }, Vr = {
2858
2904
  key: 1,
2859
2905
  class: "absolute left-0 right-0 top-full z-[3200] bg-white border border-gray-200 rounded-b-lg shadow-lg max-h-72 overflow-auto"
2860
- }, yr = { key: 0 }, xr = ["onClick"], wr = {
2906
+ }, Mr = { key: 0 }, Lr = ["onClick"], Sr = {
2861
2907
  key: 1,
2862
2908
  class: "px-3 py-2 text-xs text-gray-500"
2863
- }, kr = {
2909
+ }, Br = {
2864
2910
  key: 2,
2865
2911
  class: "px-3 py-2 text-xs text-gray-400"
2866
- }, _r = /* @__PURE__ */ E({
2912
+ }, jr = /* @__PURE__ */ E({
2867
2913
  __name: "map-search",
2868
2914
  props: {
2869
2915
  placeholder: { default: "50, 30" }
2870
2916
  },
2871
2917
  emits: ["goToCoordinates"],
2872
2918
  setup(o, { emit: e }) {
2873
- const t = e, r = x(!1), s = x("coordinates"), n = x(""), a = x([]), d = x(!1), p = x(!1);
2919
+ const t = e, r = w(!1), s = w("coordinates"), n = w(""), a = w([]), d = w(!1), p = w(!1);
2874
2920
  let f;
2875
2921
  const c = [
2876
2922
  { value: "coordinates", label: "Пошук по кординатам" },
2877
2923
  { value: "atu", label: "АТУ" },
2878
2924
  { value: "address", label: "Адресса" },
2879
2925
  { value: "search_here", label: "Пошук HERE" }
2880
- ], b = T(() => c.find(($) => $.value === s.value)?.label ?? "АТУ");
2926
+ ], m = T(() => c.find(($) => $.value === s.value)?.label ?? "АТУ");
2881
2927
  function v($) {
2882
- s.value = $.value, r.value = !1, n.value = "", n.value && D();
2928
+ s.value = $.value, r.value = !1, n.value = "", n.value && M();
2883
2929
  }
2884
2930
  function C($) {
2885
2931
  $.target.closest(".map-search__input") || (r.value = !1);
2886
2932
  }
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();
2933
+ pe(() => document.addEventListener("click", C)), Re(() => document.removeEventListener("click", C));
2934
+ async function k($) {
2935
+ let b;
2936
+ 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");
2937
+ const y = new URL(b || "");
2938
+ return s.value === "search_here" ? y.searchParams.set("searchtext", $) : (s.value === "atu" || s.value === "address") && y.searchParams.set("key", $), y.searchParams.set("limit", "20"), y.searchParams.set("q", $), (await fetch(y.toString())).json();
2893
2939
  }
2894
- function D() {
2940
+ function M() {
2895
2941
  if (d.value = !0, p.value = !0, s.value === "coordinates") {
2896
2942
  const $ = n.value.trim().split(",");
2897
2943
  if ($.length === 2) {
2898
- const h = parseFloat($[0]), g = parseFloat($[1]);
2899
- !Number.isNaN(h) && !Number.isNaN(g) && t("goToCoordinates", [h, g]);
2944
+ const b = parseFloat($[0]), y = parseFloat($[1]);
2945
+ !Number.isNaN(b) && !Number.isNaN(y) && t("goToCoordinates", [b, y]);
2900
2946
  }
2901
2947
  return;
2902
2948
  }
@@ -2907,8 +2953,8 @@ const lr = /* @__PURE__ */ P(Ys, [["render", tr]]), or = { class: "form-geom__se
2907
2953
  return;
2908
2954
  }
2909
2955
  try {
2910
- const h = await V($);
2911
- a.value = Array.isArray(h.features) ? h.features : [];
2956
+ const b = await k($);
2957
+ a.value = Array.isArray(b.features) ? b.features : [];
2912
2958
  } catch {
2913
2959
  a.value = [];
2914
2960
  } finally {
@@ -2916,25 +2962,25 @@ const lr = /* @__PURE__ */ P(Ys, [["render", tr]]), or = { class: "form-geom__se
2916
2962
  }
2917
2963
  }, 300);
2918
2964
  }
2919
- function U() {
2965
+ function S() {
2920
2966
  n.value = "", a.value = [], d.value = !1, p.value = !1;
2921
2967
  }
2922
- function N($) {
2968
+ function D($) {
2923
2969
  t("goToCoordinates", $), d.value = !1, p.value = !1, a.value = [];
2924
2970
  }
2925
- return ($, h) => (i(), u("div", or, [
2926
- l("div", ar, [
2927
- l("div", sr, [
2928
- l("div", rr, [
2971
+ return ($, b) => (i(), u("div", cr, [
2972
+ l("div", pr, [
2973
+ l("div", fr, [
2974
+ l("div", vr, [
2929
2975
  l("button", {
2930
2976
  type: "button",
2931
- onClick: h[0] || (h[0] = (g) => r.value = !r.value),
2977
+ onClick: b[0] || (b[0] = (y) => r.value = !r.value),
2932
2978
  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"
2933
2979
  }, [
2934
- l("div", nr, [
2935
- l("span", ir, F(b.value), 1)
2980
+ l("div", mr, [
2981
+ l("span", hr, R(m.value), 1)
2936
2982
  ]),
2937
- h[3] || (h[3] = l("svg", {
2983
+ b[3] || (b[3] = l("svg", {
2938
2984
  class: "stroke-gray-500 absolute right-3 translate-y-1/2 bottom-1/2",
2939
2985
  width: "15",
2940
2986
  height: "15",
@@ -2949,30 +2995,30 @@ const lr = /* @__PURE__ */ P(Ys, [["render", tr]]), or = { class: "form-geom__se
2949
2995
  })
2950
2996
  ], -1))
2951
2997
  ]),
2952
- r.value ? (i(), u("div", ur, [
2953
- l("div", dr, [
2954
- l("div", cr, [
2955
- (i(), u(ee, null, le(c, (g) => l("div", {
2956
- onClick: (K) => v(g),
2957
- key: g.value,
2998
+ r.value ? (i(), u("div", gr, [
2999
+ l("div", br, [
3000
+ l("div", yr, [
3001
+ (i(), u(Q, null, le(c, (y) => l("div", {
3002
+ onClick: (Z) => v(y),
3003
+ key: y.value,
2958
3004
  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"
2959
3005
  }, [
2960
- l("div", fr, [
2961
- l("div", vr, [
2962
- l("div", null, F(g.label), 1)
3006
+ l("div", wr, [
3007
+ l("div", kr, [
3008
+ l("div", null, R(y.label), 1)
2963
3009
  ]),
2964
- g.value === s.value ? (i(), u("svg", mr, h[4] || (h[4] = [
3010
+ y.value === s.value ? (i(), u("svg", _r, b[4] || (b[4] = [
2965
3011
  l("polyline", { points: "20 6 9 17 4 12" }, null, -1)
2966
- ]))) : z("", !0)
3012
+ ]))) : A("", !0)
2967
3013
  ])
2968
- ], 8, pr)), 64))
3014
+ ], 8, xr)), 64))
2969
3015
  ])
2970
3016
  ])
2971
- ])) : z("", !0)
3017
+ ])) : A("", !0)
2972
3018
  ]),
2973
- l("div", hr, [
2974
- l("div", gr, [
2975
- h[6] || (h[6] = l("i", { class: "absolute bottom-1/2 translate-y-1/2 left-3 text-gray-500" }, [
3019
+ l("div", $r, [
3020
+ l("div", Cr, [
3021
+ b[6] || (b[6] = l("i", { class: "absolute bottom-1/2 translate-y-1/2 left-3 text-gray-500" }, [
2976
3022
  l("svg", {
2977
3023
  width: "16",
2978
3024
  height: "16",
@@ -2995,23 +3041,23 @@ const lr = /* @__PURE__ */ P(Ys, [["render", tr]]), or = { class: "form-geom__se
2995
3041
  })
2996
3042
  ])
2997
3043
  ], -1)),
2998
- X(l("input", {
3044
+ W(l("input", {
2999
3045
  type: "text",
3000
- "onUpdate:modelValue": h[1] || (h[1] = (g) => n.value = g),
3001
- onInput: D,
3002
- onFocus: h[2] || (h[2] = (g) => d.value = !0),
3046
+ "onUpdate:modelValue": b[1] || (b[1] = (y) => n.value = y),
3047
+ onInput: M,
3048
+ onFocus: b[2] || (b[2] = (y) => d.value = !0),
3003
3049
  placeholder: "lat, lng ex. 50, 30",
3004
3050
  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"
3005
3051
  }, null, 544), [
3006
- [fe, n.value]
3052
+ [ce, n.value]
3007
3053
  ]),
3008
3054
  n.value ? (i(), u("button", {
3009
3055
  key: 0,
3010
- onClick: U,
3056
+ onClick: S,
3011
3057
  class: "absolute right-2 bottom-1/2 translate-y-1/2 text-gray-500 hover:text-red-500",
3012
3058
  "aria-label": "Очистити",
3013
3059
  type: "button"
3014
- }, h[5] || (h[5] = [
3060
+ }, b[5] || (b[5] = [
3015
3061
  l("svg", {
3016
3062
  width: "15",
3017
3063
  height: "15",
@@ -3026,38 +3072,38 @@ const lr = /* @__PURE__ */ P(Ys, [["render", tr]]), or = { class: "form-geom__se
3026
3072
  "stroke-linejoin": "round"
3027
3073
  })
3028
3074
  ], -1)
3029
- ]))) : z("", !0),
3030
- d.value && s.value !== "coordinates" ? (i(), u("div", br, [
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),
3075
+ ]))) : A("", !0),
3076
+ d.value && s.value !== "coordinates" ? (i(), u("div", Vr, [
3077
+ a.value.length ? (i(), u("ul", Mr, [
3078
+ (i(!0), u(Q, null, le(a.value, (y) => (i(), u("li", {
3079
+ key: y.properties.place_id,
3080
+ onClick: (Z) => D(y),
3035
3081
  class: "px-3 py-2 text-sm cursor-pointer hover:bg-gray-100"
3036
- }, F(g.properties.display_name), 9, xr))), 128))
3037
- ])) : p.value ? (i(), u("div", wr, "Шукаю…")) : (i(), u("div", kr, "Нічого не знайдено"))
3038
- ])) : z("", !0)
3082
+ }, R(y.properties.display_name), 9, Lr))), 128))
3083
+ ])) : p.value ? (i(), u("div", Sr, "Шукаю…")) : (i(), u("div", Br, "Нічого не знайдено"))
3084
+ ])) : A("", !0)
3039
3085
  ])
3040
3086
  ])
3041
3087
  ])
3042
3088
  ])
3043
3089
  ]));
3044
3090
  }
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({
3091
+ }), Ir = { class: "bg-white/95 p-2 rounded-xl shadow border border-gray-200" }, zr = { class: "flex gap-2" }, Fr = ["onClick", "title"], Or = ["src"], Ar = /* @__PURE__ */ E({
3046
3092
  __name: "map-layers",
3047
3093
  props: {
3048
3094
  basemaps: {}
3049
3095
  },
3050
3096
  emits: ["onLayerChange"],
3051
3097
  setup(o, { emit: e }) {
3052
- const r = x(Object.keys(o.basemaps)[0]), s = e;
3098
+ const r = w(Object.keys(o.basemaps)[0]), s = e;
3053
3099
  function n(a) {
3054
3100
  s("onLayerChange", a), r.value = a;
3055
3101
  }
3056
- return (a, d) => (i(), u("div", $r, [
3057
- l("div", Cr, [
3058
- (i(!0), u(ee, null, le(a.basemaps, (p, f) => (i(), u("div", {
3102
+ return (a, d) => (i(), u("div", Ir, [
3103
+ l("div", zr, [
3104
+ (i(!0), u(Q, null, le(a.basemaps, (p, f) => (i(), u("div", {
3059
3105
  key: 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 }]),
3106
+ class: j(["cursor-pointer border rounded-lg overflow-hidden hover:shadow-sm", { "ring-2 ring-blue-500 border-blue-300": r.value === f }]),
3061
3107
  onClick: (c) => n(f),
3062
3108
  title: p.name || f,
3063
3109
  role: "button",
@@ -3067,21 +3113,21 @@ const lr = /* @__PURE__ */ P(Ys, [["render", tr]]), or = { class: "form-geom__se
3067
3113
  src: p.preview,
3068
3114
  alt: "",
3069
3115
  class: "w-14 h-14 object-cover"
3070
- }, null, 8, Mr)
3071
- ], 10, Vr))), 128))
3116
+ }, null, 8, Or)
3117
+ ], 10, Fr))), 128))
3072
3118
  ])
3073
3119
  ]));
3074
3120
  }
3075
- }), Sr = { class: "absolute top-4 left-4 z-[1000] w-[calc(100%-20px)] sm:w-[350px]" }, Br = { class: "form-geom__panel flex gap-1 items-start mt-2" }, jr = { class: "flex items-center gap-1" }, Ir = ["disabled"], zr = { class: "absolute top-4 right-4 z-[1000]" }, Ar = { class: "flex flex-col gap-[2px]" }, Or = ["aria-pressed"], Er = ["aria-pressed"], Fr = ["aria-pressed"], Dr = ["aria-pressed"], Ur = { class: "absolute bottom-0 left-0 right-0 z-[1000] bg-white/95 border-t border-gray-200 text-xs text-gray-700 flex items-center gap-4 pt-1" }, Tr = {
3121
+ }), Er = { class: "absolute top-4 left-4 z-[1000] w-[calc(100%-20px)] sm:w-[350px]" }, Dr = { class: "form-geom__panel flex gap-1 items-start mt-2" }, Ur = { class: "flex items-center gap-1" }, Tr = ["disabled"], Rr = { class: "absolute top-4 right-4 z-[1000]" }, Pr = { class: "flex flex-col gap-[2px]" }, Nr = ["aria-pressed"], Hr = ["aria-pressed"], qr = ["aria-pressed"], Gr = ["aria-pressed"], Jr = { class: "absolute bottom-0 left-0 right-0 z-[1000] bg-white/95 border-t border-gray-200 text-xs text-gray-700 flex items-center gap-4 pt-1" }, Kr = {
3076
3122
  key: 0,
3077
3123
  class: "form-geom__feature flex items-center text-xs transition-all gap-2 w-full"
3078
- }, Rr = { class: "mr-auto" }, Pr = { class: "font-bold" }, Nr = { class: "flex items-center" }, Hr = { class: "text-xs mr-2" }, qr = {
3124
+ }, Zr = { class: "mr-auto" }, Wr = { class: "font-bold" }, Qr = { class: "flex items-center" }, Xr = { class: "text-xs mr-2" }, Yr = {
3079
3125
  key: 0,
3080
3126
  class: "text-xs"
3081
- }, Gr = {
3127
+ }, en = {
3082
3128
  key: 1,
3083
3129
  class: "text-xs"
3084
- }, Jr = /* @__PURE__ */ E({
3130
+ }, tn = /* @__PURE__ */ E({
3085
3131
  __name: "vs-input-map",
3086
3132
  props: {
3087
3133
  tools: {},
@@ -3095,111 +3141,111 @@ const lr = /* @__PURE__ */ P(Ys, [["render", tr]]), or = { class: "form-geom__se
3095
3141
  },
3096
3142
  emits: ["update:modelValue"],
3097
3143
  setup(o, { emit: e }) {
3098
- const t = pt(), r = o, s = e, n = x(null);
3144
+ const t = ht(), r = o, s = e, n = w(null);
3099
3145
  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");
3146
+ const f = w(null), c = w(null), m = w(6), v = w(0), C = w(t?.appContext.config.globalProperties.$settings?.center || [50, 30]), k = w(null), M = be();
3147
+ let S;
3148
+ const D = w("topo100");
3103
3149
  function $() {
3104
- return new Promise((m, y) => {
3105
- window.L && window.L.Draw && m(0);
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));
3150
+ return new Promise((h, _) => {
3151
+ window.L && window.L.Draw && h(0);
3152
+ const P = (ue) => {
3153
+ if (Array.from(document.styleSheets).some((Ce) => Ce?.href?.includes(ue))) return;
3154
+ const ye = document.createElement("link");
3155
+ ye.rel = "stylesheet", ye.href = ue, document.head.appendChild(ye);
3156
+ }, q = (ue) => new Promise((Be, ye) => {
3157
+ const Ce = Array.from(document.scripts).find((we) => we.src === ue);
3158
+ if (Ce) {
3159
+ Ce.addEventListener("load", () => Be()), Ce.addEventListener("error", (we) => ye(we));
3114
3160
  return;
3115
3161
  }
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);
3162
+ const xe = document.createElement("script");
3163
+ xe.src = ue, xe.async = !0, xe.onload = () => Be(), xe.onerror = (we) => ye(we), document.body.appendChild(xe);
3118
3164
  });
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);
3165
+ P("https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"), P("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.css"), q("https://unpkg.com/leaflet@1.9.4/dist/leaflet.js").then(() => q("https://unpkg.com/leaflet-draw@1.0.4/dist/leaflet.draw.js")).then(() => h(0)).catch(_);
3120
3166
  });
3121
3167
  }
3122
- function h() {
3123
- const m = d.toGeoJSON();
3124
- let y = null;
3125
- m?.features?.length && (y = m.features[0].geometry), s("update:modelValue", y), v.value = d.getLayers().length;
3168
+ function b() {
3169
+ const h = d.toGeoJSON();
3170
+ let _ = null;
3171
+ h?.features?.length && (_ = h.features[0].geometry), s("update:modelValue", _), v.value = d.getLayers().length;
3126
3172
  }
3127
- function g(m = 30) {
3128
- const y = d.getLayers();
3129
- if (!y.length) return;
3130
- const H = L.featureGroup(y).getBounds();
3131
- H && H.isValid() && a.fitBounds(H, { padding: [m, m] });
3173
+ function y(h = 30) {
3174
+ const _ = d.getLayers();
3175
+ if (!_.length) return;
3176
+ const q = L.featureGroup(_).getBounds();
3177
+ q && q.isValid() && a.fitBounds(q, { padding: [h, h] });
3132
3178
  }
3133
- function K() {
3179
+ function Z() {
3134
3180
  f.value?.click();
3135
3181
  }
3136
- const A = x("");
3137
- function S(m) {
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";
3182
+ const U = w("");
3183
+ function I(h) {
3184
+ return h instanceof L.Circle ? "Circle" : h instanceof L.Rectangle ? "Rectangle" : h instanceof L.Polygon && !(h instanceof L.Rectangle) ? "Polygon" : h instanceof L.Polyline && !(h instanceof L.Polygon) ? "Polyline" : h instanceof L.Marker ? "Point" : "Feature";
3139
3185
  }
3140
- function J(m) {
3141
- if (m instanceof L.Circle) {
3142
- const y = m.getRadius();
3143
- return Math.PI * (y * y) / 1e6;
3186
+ function K(h) {
3187
+ if (h instanceof L.Circle) {
3188
+ const _ = h.getRadius();
3189
+ return Math.PI * (_ * _) / 1e6;
3144
3190
  }
3145
- if (m instanceof L.Polygon || m instanceof L.Rectangle)
3191
+ if (h instanceof L.Polygon || h instanceof L.Rectangle)
3146
3192
  try {
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;
3193
+ const _ = h.getLatLngs(), P = Array.isArray(_[0]) ? _[0] : _, q = L.GeometryUtil?.geodesicArea ? L.GeometryUtil.geodesicArea(P) : 0;
3194
+ return q ? q / 1e6 : 0;
3149
3195
  } catch {
3150
3196
  return null;
3151
3197
  }
3152
3198
  return null;
3153
3199
  }
3154
- function Y(m) {
3155
- return m instanceof L.Circle ? m.getLatLng() : m.getBounds ? m.getBounds().getCenter() : m.getLatLng ? m.getLatLng() : a.getCenter();
3200
+ function ae(h) {
3201
+ return h instanceof L.Circle ? h.getLatLng() : h.getBounds ? h.getBounds().getCenter() : h.getLatLng ? h.getLatLng() : a.getCenter();
3156
3202
  }
3157
- function ae() {
3158
- const m = d.getLayers();
3159
- if (!m.length) {
3160
- V.value = null, v.value = 0;
3203
+ function ee() {
3204
+ const h = d.getLayers();
3205
+ if (!h.length) {
3206
+ k.value = null, v.value = 0;
3161
3207
  return;
3162
3208
  }
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,
3168
- layer: y
3169
- }, v.value = m.length;
3209
+ const _ = h[h.length - 1], P = I(_), q = ae(_), ue = K(_);
3210
+ k.value = {
3211
+ type: P,
3212
+ center: q,
3213
+ areaKm2: ue,
3214
+ layer: _
3215
+ }, v.value = h.length;
3170
3216
  }
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)));
3217
+ function fe() {
3218
+ const h = k.value?.layer;
3219
+ h && (h instanceof L.Circle && h.getBounds ? a.fitBounds(h.getBounds(), { padding: [30, 30] }) : h.getBounds ? a.fitBounds(h.getBounds(), { padding: [30, 30] }) : h.getLatLng && a.setView(h.getLatLng(), Math.max(m.value, 14)));
3174
3220
  }
3175
- function Le() {
3176
- const m = V.value?.layer;
3177
- m && (d.removeLayer(m), h(), ae());
3221
+ function Me() {
3222
+ const h = k.value?.layer;
3223
+ h && (d.removeLayer(h), b(), ee());
3178
3224
  }
3179
3225
  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 = "";
3226
+ await $(), L.drawLocal = Ns, a = L.map(n.value, { zoomControl: !1 }).setView(C.value, 10), L.control.zoom({ position: "bottomright" }).addTo(a), D.value = Object.keys(M)[0], S = L.tileLayer(M[D.value].url, { maxZoom: 19, minZoom: 6 }).addTo(a), d = new L.FeatureGroup().addTo(a), a.on(L.Draw.Event.CREATED, (P) => {
3227
+ const { layer: q } = P;
3228
+ d.clearLayers(), d.addLayer(q), b(), ee(), y(), U.value = "";
3183
3229
  }), a.on(L.Draw.Event.EDITED, () => {
3184
- h(), ae(), g();
3230
+ b(), ee(), y();
3185
3231
  }), a.on(L.Draw.Event.DELETED, () => {
3186
- h(), ae(), g();
3232
+ b(), ee(), y();
3187
3233
  });
3188
- let m = !1;
3189
- a.on("mousemove", (R) => {
3190
- m || (a.invalidateSize(), m = !0), c.value = R.latlng;
3234
+ let h = !1;
3235
+ a.on("mousemove", (P) => {
3236
+ h || (a.invalidateSize(), h = !0), c.value = P.latlng;
3191
3237
  }), a.on("zoomend", () => {
3192
- b.value = a.getZoom();
3238
+ m.value = a.getZoom();
3193
3239
  });
3194
- const y = Es(r.modelValue);
3195
- if (y) {
3196
- const R = [];
3197
- L.geoJSON(y).eachLayer((H) => R.push(H)), R.length && d.addLayer(R[0]), h(), ae(), g();
3240
+ const _ = Hs(r.modelValue);
3241
+ if (_) {
3242
+ const P = [];
3243
+ L.geoJSON(_).eachLayer((q) => P.push(q)), P.length && d.addLayer(P[0]), b(), ee(), y();
3198
3244
  }
3199
3245
  });
3200
- function B(m) {
3246
+ function O(h) {
3201
3247
  if (a) {
3202
- switch (p && p.disable(), m) {
3248
+ switch (p && p.disable(), h) {
3203
3249
  case "marker":
3204
3250
  p = new L.Draw.Marker(a);
3205
3251
  break;
@@ -3216,46 +3262,46 @@ const lr = /* @__PURE__ */ P(Ys, [["render", tr]]), or = { class: "form-geom__se
3216
3262
  p = new L.Draw.Rectangle(a);
3217
3263
  break;
3218
3264
  }
3219
- p && (p.enable(), A.value = m);
3265
+ p && (p.enable(), U.value = h);
3220
3266
  }
3221
3267
  }
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);
3268
+ function V() {
3269
+ const h = d.toGeoJSON(), _ = new Blob([JSON.stringify(h, null, 2)], { type: "application/json" }), P = URL.createObjectURL(_), q = document.createElement("a");
3270
+ q.href = P, q.download = "data.geojson", q.click(), URL.revokeObjectURL(P);
3225
3271
  }
3226
- function j(m) {
3227
- const y = m.target.files?.[0];
3228
- if (!y) return;
3229
- const R = new FileReader();
3230
- R.onload = () => {
3231
- if (typeof R.result == "string")
3272
+ function z(h) {
3273
+ const _ = h.target.files?.[0];
3274
+ if (!_) return;
3275
+ const P = new FileReader();
3276
+ P.onload = () => {
3277
+ if (typeof P.result == "string")
3232
3278
  try {
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();
3279
+ const q = JSON.parse(P.result);
3280
+ d.clearLayers(), q && L.geoJSON({ type: "Feature", geometry: q }).eachLayer((ue) => {
3281
+ d.addLayer(ue);
3282
+ }), b(), ee(), y();
3237
3283
  } finally {
3238
- m.target.value = "";
3284
+ h.target.value = "";
3239
3285
  }
3240
- }, R.readAsText(y);
3286
+ }, P.readAsText(_);
3241
3287
  }
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);
3288
+ function H(h) {
3289
+ a && (S && a.removeLayer(S), S = L.tileLayer(M[h].url, { maxZoom: 19, minZoom: 6 }).addTo(a), D.value = h);
3244
3290
  }
3245
- function oe(m) {
3246
- const y = L.latLng(m[0], m[1]);
3247
- a.setView(y, 13);
3291
+ function se(h) {
3292
+ const _ = L.latLng(h[0], h[1]);
3293
+ a.setView(_, 13);
3248
3294
  }
3249
- ue(
3295
+ te(
3250
3296
  () => r.modelValue,
3251
- (m) => {
3252
- d.clearLayers(), m && L.geoJSON({ type: "Feature", geometry: m }).eachLayer((y) => {
3253
- d.addLayer(y);
3254
- }), v.value = d.getLayers().length, ae(), g();
3297
+ (h) => {
3298
+ d.clearLayers(), h && L.geoJSON({ type: "Feature", geometry: h }).eachLayer((_) => {
3299
+ d.addLayer(_);
3300
+ }), v.value = d.getLayers().length, ee(), y();
3255
3301
  }
3256
3302
  );
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 }), {}) : {
3303
+ function be() {
3304
+ return t?.appContext.config.globalProperties.$settings?.basemaps ? t?.appContext.config.globalProperties.$settings?.basemaps.map((h, _) => Object.assign(h, { key: `b${_}`, preview: h.preview || h.url.replace("{z}/{x}/{y}.png", "13/4790/2762.png") })).reduce((h, _) => ({ ...h, [_.key]: _ }), {}) : {
3259
3305
  topo100: {
3260
3306
  url: "https://data.gki.com.ua/api-user/rtile/voyager/ua/{z}/{x}/{y}.png",
3261
3307
  preview: "https://data.gki.com.ua/api-user/rtile/voyager/ua/13/4790/2762.png"
@@ -3270,146 +3316,146 @@ const lr = /* @__PURE__ */ P(Ys, [["render", tr]]), or = { class: "form-geom__se
3270
3316
  }
3271
3317
  };
3272
3318
  }
3273
- const de = x(!1);
3274
- return ue(de, () => {
3319
+ const ve = w(!1);
3320
+ return te(ve, () => {
3275
3321
  setTimeout(() => {
3276
3322
  a.invalidateSize();
3277
3323
  }, 50);
3278
- }), (m, y) => (i(), u("div", {
3279
- class: M(["leaflet-map-wrapper relative w-full h-[400px]", { fullscreen: de.value }])
3324
+ }), (h, _) => (i(), u("div", {
3325
+ class: j(["leaflet-map-wrapper relative w-full h-[400px]", { fullscreen: ve.value }])
3280
3326
  }, [
3281
3327
  l("div", {
3282
3328
  ref_key: "mapContainer",
3283
3329
  ref: n,
3284
3330
  class: "w-full h-full"
3285
3331
  }, null, 512),
3286
- l("div", Sr, [
3287
- I(_r, { onGoToCoordinates: oe }),
3288
- l("div", Br, [
3289
- l("div", jr, [
3332
+ l("div", Er, [
3333
+ B(jr, { onGoToCoordinates: se }),
3334
+ l("div", Dr, [
3335
+ l("div", Ur, [
3290
3336
  l("button", {
3291
3337
  type: "button",
3292
3338
  class: "vs-btn-row",
3293
- onClick: K
3339
+ onClick: Z
3294
3340
  }, "Import"),
3295
3341
  l("button", {
3296
3342
  type: "button",
3297
3343
  class: "vs-btn-row",
3298
- onClick: _,
3344
+ onClick: V,
3299
3345
  disabled: v.value === 0
3300
- }, "Export ", 8, Ir)
3346
+ }, "Export ", 8, Tr)
3301
3347
  ]),
3302
3348
  l("input", {
3303
3349
  ref_key: "importRef",
3304
3350
  ref: f,
3305
3351
  type: "file",
3306
- onChange: j,
3352
+ onChange: z,
3307
3353
  accept: ".json,.geojson",
3308
3354
  class: "hidden"
3309
3355
  }, null, 544)
3310
3356
  ])
3311
3357
  ]),
3312
- l("div", zr, [
3313
- l("div", Ar, [
3358
+ l("div", Rr, [
3359
+ l("div", Pr, [
3314
3360
  l("button", {
3315
- class: M(["vs-btn", { "vs-active": A.value === "marker" }]),
3316
- "aria-pressed": A.value === "marker",
3361
+ class: j(["vs-btn", { "vs-active": U.value === "marker" }]),
3362
+ "aria-pressed": U.value === "marker",
3317
3363
  title: "Point (P)",
3318
3364
  "aria-label": "Draw point",
3319
- onClick: y[0] || (y[0] = (R) => B("marker"))
3365
+ onClick: _[0] || (_[0] = (P) => O("marker"))
3320
3366
  }, [
3321
- I(Ts)
3322
- ], 10, Or),
3367
+ B(Ks)
3368
+ ], 10, Nr),
3323
3369
  l("button", {
3324
- class: M(["vs-btn", { "vs-active": A.value === "polyline" }]),
3325
- "aria-pressed": A.value === "polyline",
3370
+ class: j(["vs-btn", { "vs-active": U.value === "polyline" }]),
3371
+ "aria-pressed": U.value === "polyline",
3326
3372
  title: "Line (L)",
3327
3373
  "aria-label": "Draw polyline",
3328
- onClick: y[1] || (y[1] = (R) => B("polyline"))
3374
+ onClick: _[1] || (_[1] = (P) => O("polyline"))
3329
3375
  }, [
3330
- I(Hs)
3331
- ], 10, Er),
3376
+ B(Xs)
3377
+ ], 10, Hr),
3332
3378
  l("button", {
3333
- class: M(["vs-btn", { "vs-active": A.value === "polygon" }]),
3334
- "aria-pressed": A.value === "polygon",
3379
+ class: j(["vs-btn", { "vs-active": U.value === "polygon" }]),
3380
+ "aria-pressed": U.value === "polygon",
3335
3381
  title: "Polygon (G)",
3336
3382
  "aria-label": "Draw polygon",
3337
- onClick: y[2] || (y[2] = (R) => B("polygon"))
3383
+ onClick: _[2] || (_[2] = (P) => O("polygon"))
3338
3384
  }, [
3339
- I(Ks)
3340
- ], 10, Fr),
3385
+ B(lr)
3386
+ ], 10, qr),
3341
3387
  l("button", {
3342
- class: M(["vs-btn", { "vs-active": A.value === "rectangle" }]),
3343
- "aria-pressed": A.value === "rectangle",
3388
+ class: j(["vs-btn", { "vs-active": U.value === "rectangle" }]),
3389
+ "aria-pressed": U.value === "rectangle",
3344
3390
  title: "Rectangle (R)",
3345
3391
  "aria-label": "Draw rectangle",
3346
- onClick: y[3] || (y[3] = (R) => B("rectangle"))
3392
+ onClick: _[3] || (_[3] = (P) => O("rectangle"))
3347
3393
  }, [
3348
- I(Xs)
3349
- ], 10, Dr),
3394
+ B(rr)
3395
+ ], 10, Gr),
3350
3396
  l("button", {
3351
3397
  class: "vs-btn mt-5",
3352
- onClick: y[4] || (y[4] = (R) => {
3353
- de.value = !de.value;
3398
+ onClick: _[4] || (_[4] = (P) => {
3399
+ ve.value = !ve.value;
3354
3400
  }),
3355
3401
  title: "Full Screen",
3356
3402
  "aria-label": "Full Screen"
3357
3403
  }, [
3358
- I(lr, { style: { width: "12px", height: "12px" } })
3404
+ B(dr, { style: { width: "12px", height: "12px" } })
3359
3405
  ])
3360
3406
  ])
3361
3407
  ]),
3362
3408
  l("div", {
3363
- class: M(["absolute left-4 z-[1000]", V.value ? "bottom-8" : "bottom-4"])
3409
+ class: j(["absolute left-4 z-[1000]", k.value ? "bottom-8" : "bottom-4"])
3364
3410
  }, [
3365
- I(Lr, {
3366
- basemaps: G(D),
3367
- onOnLayerChange: q
3411
+ B(Ar, {
3412
+ basemaps: G(M),
3413
+ onOnLayerChange: H
3368
3414
  }, null, 8, ["basemaps"])
3369
3415
  ], 2),
3370
- l("div", Ur, [
3371
- V.value ? (i(), u("div", Tr, [
3372
- l("div", Rr, [
3373
- y[7] || (y[7] = ie(" Тип: ")),
3374
- l("span", Pr, F(V.value.type), 1)
3416
+ l("div", Jr, [
3417
+ k.value ? (i(), u("div", Kr, [
3418
+ l("div", Zr, [
3419
+ _[7] || (_[7] = ie(" Тип: ", -1)),
3420
+ l("span", Wr, R(k.value.type), 1)
3375
3421
  ]),
3376
- l("div", Nr, [
3377
- l("div", Hr, [
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)
3422
+ l("div", Qr, [
3423
+ l("div", Xr, [
3424
+ _[8] || (_[8] = ie(" Центр: ", -1)),
3425
+ l("b", null, R(k.value.center.lat.toFixed(5)) + ", " + R(k.value.center.lng.toFixed(5)), 1)
3380
3426
  ]),
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)
3384
- ])) : (i(), u("div", Gr, y[10] || (y[10] = [
3385
- ie(" Площа: "),
3427
+ k.value.areaKm2 !== null ? (i(), u("div", Yr, [
3428
+ _[9] || (_[9] = ie(" Площа: ", -1)),
3429
+ l("b", null, R(k.value.areaKm2.toFixed(1)) + "км²", 1)
3430
+ ])) : (i(), u("div", en, _[10] || (_[10] = [
3431
+ ie(" Площа: ", -1),
3386
3432
  l("b", null, "—", -1)
3387
3433
  ]))),
3388
3434
  l("button", {
3389
3435
  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",
3390
3436
  title: "Наблизити",
3391
- onClick: y[5] || (y[5] = (R) => $e())
3392
- }, y[11] || (y[11] = [
3437
+ onClick: _[5] || (_[5] = (P) => fe())
3438
+ }, _[11] || (_[11] = [
3393
3439
  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)
3394
3440
  ])),
3395
3441
  l("button", {
3396
3442
  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",
3397
3443
  title: "Видалити",
3398
- onClick: y[6] || (y[6] = (R) => Le())
3444
+ onClick: _[6] || (_[6] = (P) => Me())
3399
3445
  }, [
3400
- I(Ee, { class: "w-3 h-3" })
3446
+ B(De, { class: "w-3 h-3" })
3401
3447
  ])
3402
3448
  ])
3403
- ])) : z("", !0)
3449
+ ])) : A("", !0)
3404
3450
  ])
3405
3451
  ], 2));
3406
3452
  }
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 = {
3453
+ }), ln = /* @__PURE__ */ N(tn, [["__scopeId", "data-v-e82d2d97"]]), on = ["data-focus"], an = { class: "flex items-center" }, sn = { class: "overflow-hidden text-ellipsis whitespace-nowrap rounded-sm text-[#333] text-[85%] px-0.5 py-[3px] pl-1.5 box-border" }, rn = ["onClick", "aria-label"], nn = {
3408
3454
  key: 0,
3409
3455
  class: "absolute text-gray-500 truncate pl-2"
3410
- }, en = { class: "flex-1 min-w-[2px]" }, tn = ["placeholder"], ln = { class: "flex items-center shrink-0" }, on = ["disabled"], an = /* @__PURE__ */ E({
3456
+ }, un = { class: "flex-1 min-w-[2px]" }, dn = ["placeholder"], cn = { class: "flex items-center shrink-0" }, pn = ["disabled"], fn = /* @__PURE__ */ E({
3411
3457
  __name: "vs-input-tag",
3412
- props: /* @__PURE__ */ W({
3458
+ props: /* @__PURE__ */ X({
3413
3459
  unique: { type: Boolean, default: !0 },
3414
3460
  style: { default: () => ({}) },
3415
3461
  customClass: { default: "" },
@@ -3422,71 +3468,71 @@ const lr = /* @__PURE__ */ P(Ys, [["render", tr]]), or = { class: "form-geom__se
3422
3468
  modelValue: { default: [] },
3423
3469
  modelModifiers: {}
3424
3470
  }),
3425
- emits: /* @__PURE__ */ W(["update:modelValue"], ["update:modelValue"]),
3471
+ emits: /* @__PURE__ */ X(["update:modelValue"], ["update:modelValue"]),
3426
3472
  setup(o, { emit: e }) {
3427
3473
  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);
3474
+ $e(t.style);
3475
+ const s = w(null), n = w(null), a = w(null), d = w(!1), p = w(""), f = Y(o, "modelValue"), c = T(() => t.placeholder || "Add tag…"), m = T(() => f.value?.length === 0 && p.value === ""), v = T(() => !t.disabled && f.value?.length > 0), C = T(() => t.disabled), k = async () => {
3476
+ C.value || await je(() => a.value?.focus());
3477
+ }, M = (U) => {
3478
+ const I = U.trim();
3479
+ I !== "" && (!f.value || !Array.isArray(f.value) ? f.value = [I] : t.unique ? f.value.includes(I) || (f.value = [...f.value, I]) : f.value = [...f.value, I], p.value = "");
3480
+ }, S = () => {
3481
+ const U = p.value;
3482
+ U.trim() !== "" && M(U), p.value = "";
3483
+ }, D = (U) => {
3484
+ const I = f.value.slice();
3485
+ I.splice(U, 1), r("update:modelValue", I);
3440
3486
  }, $ = () => {
3441
3487
  r("update:modelValue", []);
3442
- }, h = () => {
3488
+ }, b = () => {
3443
3489
  C.value || (d.value = !0);
3444
- }, g = () => {
3490
+ }, y = () => {
3445
3491
  d.value = !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);
3492
+ }, Z = (U) => {
3493
+ const { key: I } = U;
3494
+ I === "Enter" ? (U.preventDefault(), S()) : I === "Backspace" && p.value === "" && f.value.length > 0 && D(f.value.length - 1);
3449
3495
  };
3450
- return (A, S) => (i(), u("div", {
3496
+ return (U, I) => (i(), u("div", {
3451
3497
  class: "flex gap-1 w-full",
3452
3498
  ref_key: "root",
3453
3499
  ref: s,
3454
- onClick: S[1] || (S[1] = ce(() => {
3500
+ onClick: I[1] || (I[1] = de(() => {
3455
3501
  }, ["stop"]))
3456
3502
  }, [
3457
3503
  l("div", {
3458
- class: M(["relative w-full font-sans", t.customClass]),
3504
+ class: j(["relative w-full font-sans", t.customClass]),
3459
3505
  role: "group",
3460
3506
  "aria-label": "Tag input"
3461
3507
  }, [
3462
3508
  l("div", {
3463
- class: M([
3509
+ class: j([
3464
3510
  "flex min-h-[38px] items-center justify-between rounded border transition-colors bg-white",
3465
3511
  "border-gray-300 hover:border-gray-400",
3466
3512
  d.value ? "border-blue-500 ring-1 ring-blue-500" : "",
3467
3513
  C.value ? "bg-gray-100 text-gray-400 cursor-not-allowed hover:border-gray-300" : ""
3468
3514
  ]),
3469
3515
  "data-focus": d.value ? "true" : "false",
3470
- onClick: V
3516
+ onClick: k
3471
3517
  }, [
3472
3518
  l("div", {
3473
3519
  class: "flex flex-1 flex-wrap items-center gap-1 py-0.5 pl-2 pr-0 overflow-hidden",
3474
3520
  ref_key: "chipsRef",
3475
3521
  ref: n
3476
3522
  }, [
3477
- (i(!0), u(ee, null, le(f.value, (J, Y) => (i(), u("div", {
3478
- key: Y,
3523
+ (i(!0), u(Q, null, le(f.value, (K, ae) => (i(), u("div", {
3524
+ key: ae,
3479
3525
  class: "flex min-w-0 bg-[#e6e6e6] rounded-sm m-0.5 box-border"
3480
3526
  }, [
3481
- l("div", Wr, [
3482
- l("div", Qr, F(J), 1)
3527
+ l("div", an, [
3528
+ l("div", sn, R(K), 1)
3483
3529
  ]),
3484
3530
  l("div", {
3485
3531
  role: "button",
3486
3532
  class: "flex items-center rounded-sm px-1 box-border hover:bg-[#ffbdad] hover:text-[#de350b]",
3487
- onClick: ce((ae) => N(Y), ["stop"]),
3488
- "aria-label": `Remove ${J}`
3489
- }, S[2] || (S[2] = [
3533
+ onClick: de((ee) => D(ae), ["stop"]),
3534
+ "aria-label": `Remove ${K}`
3535
+ }, I[2] || (I[2] = [
3490
3536
  l("svg", {
3491
3537
  height: "14",
3492
3538
  width: "14",
@@ -3497,11 +3543,11 @@ const lr = /* @__PURE__ */ P(Ys, [["render", tr]]), or = { class: "form-geom__se
3497
3543
  }, [
3498
3544
  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" })
3499
3545
  ], -1)
3500
- ]), 8, Xr)
3546
+ ]), 8, rn)
3501
3547
  ]))), 128)),
3502
- b.value ? (i(), u("div", Yr, F(c.value), 1)) : z("", !0),
3503
- l("div", en, [
3504
- C.value ? z("", !0) : X((i(), u("input", {
3548
+ m.value ? (i(), u("div", nn, R(c.value), 1)) : A("", !0),
3549
+ l("div", un, [
3550
+ C.value ? A("", !0) : W((i(), u("input", {
3505
3551
  key: 0,
3506
3552
  ref_key: "inputRef",
3507
3553
  ref: a,
@@ -3513,25 +3559,25 @@ const lr = /* @__PURE__ */ P(Ys, [["render", tr]]), or = { class: "form-geom__se
3513
3559
  type: "text",
3514
3560
  tabindex: "0",
3515
3561
  "aria-label": "Add tag",
3516
- "onUpdate:modelValue": S[0] || (S[0] = (J) => p.value = J),
3517
- onFocus: h,
3518
- onBlur: g,
3519
- onKeydown: K,
3562
+ "onUpdate:modelValue": I[0] || (I[0] = (K) => p.value = K),
3563
+ onFocus: b,
3564
+ onBlur: y,
3565
+ onKeydown: Z,
3520
3566
  placeholder: f.value && f.value.length ? "" : void 0
3521
- }, null, 40, tn)), [
3522
- [fe, p.value]
3567
+ }, null, 40, dn)), [
3568
+ [ce, p.value]
3523
3569
  ])
3524
3570
  ])
3525
3571
  ], 512),
3526
- l("div", ln, [
3572
+ l("div", cn, [
3527
3573
  v.value ? (i(), u("button", {
3528
3574
  key: 0,
3529
3575
  type: "button",
3530
3576
  class: "px-2 text-gray-400 hover:text-gray-500 transition-colors disabled:opacity-50",
3531
3577
  "aria-label": "Clear all tags",
3532
3578
  disabled: C.value,
3533
- onClick: ce($, ["stop"])
3534
- }, S[3] || (S[3] = [
3579
+ onClick: de($, ["stop"])
3580
+ }, I[3] || (I[3] = [
3535
3581
  l("svg", {
3536
3582
  height: "20",
3537
3583
  width: "20",
@@ -3540,34 +3586,223 @@ const lr = /* @__PURE__ */ P(Ys, [["render", tr]]), or = { class: "form-geom__se
3540
3586
  }, [
3541
3587
  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" })
3542
3588
  ], -1)
3543
- ]), 8, on)) : z("", !0)
3589
+ ]), 8, pn)) : A("", !0)
3544
3590
  ])
3545
- ], 10, Zr)
3591
+ ], 10, on)
3546
3592
  ], 2)
3547
3593
  ], 512));
3548
3594
  }
3549
- }), sn = {
3550
- VsInputText: qe,
3551
- VsInputRadio: Je,
3552
- "vs-input-text": qe,
3553
- "vs-input-textarea": za,
3554
- "vs-input-mask": nl,
3555
- "vs-input-number": jt,
3556
- "vs-input-radio": Je,
3557
- "vs-input-select": ja,
3558
- "vs-input-switcher": lt,
3559
- "vs-input-static": Ge,
3560
- "vs-input-container": ia,
3561
- "vs-input-date": wl,
3562
- "vs-input-checkbox": yl,
3563
- "vs-input-file": ro,
3564
- "vs-input-html": Ge,
3565
- "vs-input-email": dl,
3566
- "vs-input-datatable": As,
3567
- "vs-input-map": Kr,
3568
- "vs-input-file-list": Fo,
3569
- "vs-input-tag": an
3570
- }, rn = /* @__PURE__ */ E({
3595
+ }), vn = { class: "relative flex gap-1 bg-white rounded-lg vs-form-text" }, mn = ["disabled", "placeholder"], hn = /* @__PURE__ */ E({
3596
+ __name: "vs-input-slug",
3597
+ props: {
3598
+ disabled: { type: Boolean },
3599
+ modelValue: {},
3600
+ placeholder: {},
3601
+ parent: {}
3602
+ },
3603
+ emits: ["update:modelValue"],
3604
+ setup(o, { emit: e }) {
3605
+ const t = Ve("values"), r = o, s = T(() => t?.value?.[r.parent || ""] || ""), n = e, a = T({
3606
+ get() {
3607
+ return r.modelValue;
3608
+ },
3609
+ set(f) {
3610
+ n("update:modelValue", f.trim());
3611
+ }
3612
+ });
3613
+ function d(f) {
3614
+ const c = {
3615
+ а: "a",
3616
+ б: "b",
3617
+ в: "v",
3618
+ г: "g",
3619
+ д: "d",
3620
+ е: "e",
3621
+ ё: "e",
3622
+ ж: "zh",
3623
+ з: "z",
3624
+ и: "i",
3625
+ й: "y",
3626
+ к: "k",
3627
+ л: "l",
3628
+ м: "m",
3629
+ н: "n",
3630
+ о: "o",
3631
+ п: "p",
3632
+ р: "r",
3633
+ с: "s",
3634
+ т: "t",
3635
+ у: "u",
3636
+ ф: "f",
3637
+ х: "kh",
3638
+ ц: "ts",
3639
+ ч: "ch",
3640
+ ш: "sh",
3641
+ щ: "shch",
3642
+ ы: "y",
3643
+ э: "e",
3644
+ ю: "yu",
3645
+ я: "ya",
3646
+ ь: "",
3647
+ ъ: "",
3648
+ є: "ye",
3649
+ і: "i",
3650
+ ї: "yi",
3651
+ ґ: "g"
3652
+ };
3653
+ return f.toLowerCase().split("").map((m) => c[m] || m).join("").replace(/[^a-z0-9\s-]/g, "").replace(/\s+/g, "-").replace(/-+/g, "-").replace(/^-+|-+$/g, "");
3654
+ }
3655
+ const p = () => {
3656
+ a.value = s.value ? d(s.value) : d(a.value);
3657
+ };
3658
+ return (f, c) => (i(), u("div", vn, [
3659
+ W(l("input", {
3660
+ ref: "vsText",
3661
+ disabled: f.disabled,
3662
+ placeholder: f.placeholder,
3663
+ "onUpdate:modelValue": c[0] || (c[0] = (m) => a.value = m),
3664
+ class: "block w-full px-3 py-2 text-sm border border-solid rounded-lg placeholder:text-nowrap border-stone-200 text-stone-800 placeholder:text-stone-400 focus:outline focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"
3665
+ }, null, 8, mn), [
3666
+ [ce, a.value]
3667
+ ]),
3668
+ l("button", {
3669
+ class: "px-2 bg-gray-100 border rounded-lg hover:bg-gray-200",
3670
+ onClick: p
3671
+ }, " Gen ")
3672
+ ]));
3673
+ }
3674
+ }), gn = /* @__PURE__ */ N(hn, [["__scopeId", "data-v-f76159c3"]]), bn = { class: "w-full" }, yn = {
3675
+ ref: "sortableContainer",
3676
+ class: "flex flex-col gap-1"
3677
+ }, xn = ["onDragstart", "onDrop"], wn = { class: "w-1/3" }, kn = { class: "w-2/3" }, _n = ["onClick"], $n = {
3678
+ key: 0,
3679
+ class: "text-[14px] text-gray-700"
3680
+ }, Cn = { class: "mt-2 w-full flex items-center" }, Vn = ["disabled"], Mn = /* @__PURE__ */ E({
3681
+ __name: "vs-input-key-value",
3682
+ props: {
3683
+ parent: {},
3684
+ ignore: {},
3685
+ addButtonText: {}
3686
+ },
3687
+ setup(o) {
3688
+ const e = (k) => `${k}-${Math.random().toString(36).substring(2, 15)}`, t = Ve("values"), r = o, s = r.addButtonText ?? "Додати", n = r.ignore ?? [], a = w([]), d = w(null);
3689
+ (() => {
3690
+ const k = t?.value?.[r.parent] || {};
3691
+ a.value = Object.entries(k).filter(([M]) => !n.includes(M)).map(([M, S]) => ({
3692
+ id: e("key-value-"),
3693
+ key: M,
3694
+ value: S
3695
+ }));
3696
+ })();
3697
+ function f(k) {
3698
+ d.value = k;
3699
+ }
3700
+ function c(k) {
3701
+ if (d.value === null || d.value === k) return;
3702
+ const M = a.value.splice(d.value, 1)[0];
3703
+ a.value.splice(k, 0, M), d.value = null;
3704
+ }
3705
+ const m = T(
3706
+ () => a.value.some((k) => k.key && !k.value || !k.key && k.value)
3707
+ ), v = () => {
3708
+ a.value.push({ id: e("key-value-"), key: "", value: "" });
3709
+ }, C = (k) => {
3710
+ a.value = a.value.filter((M) => M.id !== k);
3711
+ };
3712
+ return te(
3713
+ a,
3714
+ (k) => {
3715
+ const M = {};
3716
+ k.forEach((D) => {
3717
+ D.key && D.value !== void 0 && (M[D.key] = D.value);
3718
+ });
3719
+ const S = {};
3720
+ n.length && n.forEach((D) => {
3721
+ S[D] = t?.value?.[r.parent]?.[D];
3722
+ }), t?.value && (t.value[r.parent] = {
3723
+ ...S,
3724
+ ...M
3725
+ });
3726
+ },
3727
+ { deep: !0 }
3728
+ ), (k, M) => (i(), u("div", bn, [
3729
+ l("div", yn, [
3730
+ (i(!0), u(Q, null, le(a.value, (S, D) => (i(), u("div", {
3731
+ key: S.id,
3732
+ class: j(["flex items-center gap-2 w-full", { "opacity-50": d.value === D }]),
3733
+ draggable: "true",
3734
+ onDragstart: ($) => f(D),
3735
+ onDragover: M[0] || (M[0] = de(() => {
3736
+ }, ["prevent"])),
3737
+ onDrop: ($) => c(D)
3738
+ }, [
3739
+ M[1] || (M[1] = re('<button class="cursor-move" data-v-fe75c0b1><svg fill="#000000" width="20" height="20" viewBox="0 0 36 36" data-v-fe75c0b1><circle cx="15" cy="12" r="1.5" data-v-fe75c0b1></circle><circle cx="15" cy="24" r="1.5" data-v-fe75c0b1></circle><circle cx="21" cy="12" r="1.5" data-v-fe75c0b1></circle><circle cx="21" cy="24" r="1.5" data-v-fe75c0b1></circle><circle cx="21" cy="18" r="1.5" data-v-fe75c0b1></circle><circle cx="15" cy="18" r="1.5" data-v-fe75c0b1></circle></svg></button>', 1)),
3740
+ l("div", wn, [
3741
+ B(Ae, {
3742
+ modelValue: S.key,
3743
+ "onUpdate:modelValue": ($) => S.key = $,
3744
+ placeholder: "Ключ"
3745
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
3746
+ ]),
3747
+ l("div", kn, [
3748
+ B(Ae, {
3749
+ modelValue: S.value,
3750
+ "onUpdate:modelValue": ($) => S.value = $,
3751
+ placeholder: "Значення"
3752
+ }, null, 8, ["modelValue", "onUpdate:modelValue"])
3753
+ ]),
3754
+ l("button", {
3755
+ onClick: ($) => C(S.id),
3756
+ class: "shrink-0 w-[30px] text-gray-600 h-[30px] rounded-full flex items-center justify-center bg-gray-100 hover:bg-gray-200"
3757
+ }, [
3758
+ B(G(al), {
3759
+ height: "16",
3760
+ width: "16"
3761
+ })
3762
+ ], 8, _n)
3763
+ ], 42, xn))), 128))
3764
+ ], 512),
3765
+ a.value.length ? A("", !0) : (i(), u("span", $n, " Дані для відображення відсутні ")),
3766
+ l("div", Cn, [
3767
+ l("button", {
3768
+ type: "button",
3769
+ onClick: v,
3770
+ disabled: m.value,
3771
+ class: "py-1.5 px-2 flex items-center gap-x-1 text-xs font-medium rounded-full border border-dashed border-gray-200 bg-white text-gray-800 hover:bg-gray-50 disabled:opacity-50 disabled:cursor-not-allowed"
3772
+ }, [
3773
+ B(ze, {
3774
+ height: "14",
3775
+ width: "14"
3776
+ }),
3777
+ ie(" " + R(G(s)), 1)
3778
+ ], 8, Vn)
3779
+ ])
3780
+ ]));
3781
+ }
3782
+ }), Ln = /* @__PURE__ */ N(Mn, [["__scopeId", "data-v-fe75c0b1"]]), Sn = {
3783
+ VsInputText: Ae,
3784
+ VsInputRadio: We,
3785
+ "vs-input-text": Ae,
3786
+ "vs-input-textarea": Ra,
3787
+ "vs-input-mask": ml,
3788
+ "vs-input-number": Ot,
3789
+ "vs-input-radio": We,
3790
+ "vs-input-select": Ua,
3791
+ "vs-input-switcher": st,
3792
+ "vs-input-static": Ze,
3793
+ "vs-input-container": ha,
3794
+ "vs-input-date": Sl,
3795
+ "vs-input-checkbox": Ml,
3796
+ "vs-input-file": mo,
3797
+ "vs-input-html": Ze,
3798
+ "vs-input-email": bl,
3799
+ "vs-input-datatable": Ps,
3800
+ "vs-input-map": ln,
3801
+ "vs-input-file-list": qo,
3802
+ "vs-input-tag": fn,
3803
+ "vs-input-slug": gn,
3804
+ "vs-input-key-value": Ln
3805
+ }, Bn = /* @__PURE__ */ E({
3571
3806
  __name: "behavior",
3572
3807
  props: {
3573
3808
  api: {},
@@ -3577,13 +3812,13 @@ const lr = /* @__PURE__ */ P(Ys, [["render", tr]]), or = { class: "form-geom__se
3577
3812
  value: {}
3578
3813
  },
3579
3814
  setup(o) {
3580
- const e = o, t = ze("values");
3815
+ const e = o, t = Ve("values");
3581
3816
  async function r() {
3582
3817
  try {
3583
3818
  if (!e.api) return;
3584
3819
  const s = e.api.replace("{{value}}", e.value), n = await fetch(s);
3585
3820
  if (!n.ok) {
3586
- me({ type: "warning", title: "Validation", message: "При спробі завантажити дані виникла помилка." });
3821
+ ge({ type: "warning", title: "Validation", message: "При спробі завантажити дані виникла помилка." });
3587
3822
  return;
3588
3823
  }
3589
3824
  const a = await n.json();
@@ -3597,11 +3832,11 @@ const lr = /* @__PURE__ */ P(Ys, [["render", tr]]), or = { class: "form-geom__se
3597
3832
  return (s, n) => (i(), u("button", {
3598
3833
  onClick: r,
3599
3834
  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"
3600
- }, F(s.button), 1));
3835
+ }, R(s.button), 1));
3601
3836
  }
3602
- }), nn = { class: "flex w-full" }, st = /* @__PURE__ */ E({
3837
+ }), jn = { class: "flex w-full" }, it = /* @__PURE__ */ E({
3603
3838
  __name: "vs-compact-form-layout",
3604
- props: /* @__PURE__ */ W({
3839
+ props: /* @__PURE__ */ X({
3605
3840
  item: { default: {} },
3606
3841
  layout: { default: "default" },
3607
3842
  style: { default: {} },
@@ -3613,7 +3848,9 @@ const lr = /* @__PURE__ */ P(Ys, [["render", tr]]), or = { class: "form-geom__se
3613
3848
  }),
3614
3849
  emits: ["update:modelValue"],
3615
3850
  setup(o) {
3616
- const e = o, t = Q(o, "modelValue"), r = T(() => Lt[`${e.layout}`]), s = T(() => sn?.[`vs-input-${e.item.type}`]), n = T(() => {
3851
+ const e = o, t = Y(o, "modelValue");
3852
+ console.log(e.item.type);
3853
+ const r = T(() => It[`${e.layout}`]), s = T(() => Sn?.[`vs-input-${e.item.type}`]), n = T(() => {
3617
3854
  const d = G(s);
3618
3855
  if (!d) return /* @__PURE__ */ new Set();
3619
3856
  const p = d.props ?? d.__vccOpts?.props;
@@ -3624,44 +3861,44 @@ const lr = /* @__PURE__ */ P(Ys, [["render", tr]]), or = { class: "form-geom__se
3624
3861
  const d = e.item ?? {}, p = n.value;
3625
3862
  return p.size ? Object.fromEntries(Object.entries(d).filter(([f]) => p.has(f))) : {};
3626
3863
  });
3627
- return (d, p) => (i(), te(Ve(r.value), {
3864
+ return (d, p) => (i(), oe(Le(r.value), {
3628
3865
  ua: e.item.ua,
3629
3866
  error: e.error || "",
3630
3867
  item: d.item,
3631
3868
  label: e.item.label
3632
3869
  }, {
3633
- default: Me(() => [
3634
- l("div", nn, [
3635
- (i(), te(Ve(s.value), je(a.value, {
3870
+ default: Se(() => [
3871
+ l("div", jn, [
3872
+ (i(), oe(Le(s.value), Ie(a.value, {
3636
3873
  modelValue: t.value,
3637
3874
  "onUpdate:modelValue": p[0] || (p[0] = (f) => t.value = f)
3638
3875
  }), null, 16, ["modelValue"])),
3639
- d.item.behavior ? (i(), te(rn, je({ key: 0 }, d.item.behavior, { value: t.value }), null, 16, ["value"])) : z("", !0)
3876
+ d.item.behavior?.api && d.item.behavior?.button ? (i(), oe(Bn, Ie({ key: 0 }, d.item.behavior, { value: t.value }), null, 16, ["value"])) : A("", !0)
3640
3877
  ])
3641
3878
  ]),
3642
3879
  _: 1
3643
3880
  }, 8, ["ua", "error", "item", "label"]));
3644
3881
  }
3645
- }), rt = {
3882
+ }), ut = {
3646
3883
  required: "Це поле є обов’язковим",
3647
3884
  email: "Неправильний email"
3648
- }, un = (o) => o ? !1 : rt.required, dn = (o) => !o && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o) ? rt.email : !1, cn = (o, e) => {
3885
+ }, In = (o) => o ? !1 : ut.required, zn = (o) => !o && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(o) ? ut.email : !1, Fn = (o, e) => {
3649
3886
  const t = e.pattern ?? e.regexp;
3650
3887
  return !(typeof t == "string" ? new RegExp(t) : t).test(o) && o ? e.message : !1;
3651
- }, pn = (o, e) => !1, fn = (o, e) => {
3888
+ }, On = (o, e) => !1, An = (o, e) => {
3652
3889
  switch (typeof e == "string" ? e : e.type) {
3653
3890
  case "required":
3654
- return un(o);
3891
+ return In(o);
3655
3892
  case "email":
3656
- return dn(o);
3893
+ return zn(o);
3657
3894
  case "regexp":
3658
- return cn(o, e);
3895
+ return Fn(o, e);
3659
3896
  case "custom":
3660
- return pn();
3897
+ return On();
3661
3898
  default:
3662
3899
  return !1;
3663
3900
  }
3664
- }, vn = {
3901
+ }, En = {
3665
3902
  autocomplete: "select",
3666
3903
  combobox: "select",
3667
3904
  datepicker: "date",
@@ -3673,16 +3910,16 @@ const lr = /* @__PURE__ */ P(Ys, [["render", tr]]), or = { class: "form-geom__se
3673
3910
  file: "file"
3674
3911
  // mask: 'text',
3675
3912
  };
3676
- function Qe(o) {
3913
+ function et(o) {
3677
3914
  const e = o.toLowerCase();
3678
- return vn[e] || e;
3915
+ return En[e] || e;
3679
3916
  }
3680
- function mn(o) {
3917
+ function Dn(o) {
3681
3918
  if (Array.isArray(o)) {
3682
3919
  const t = [];
3683
3920
  return o.forEach((r) => {
3684
3921
  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);
3922
+ s.name = (r.name || r.id || r.key || "").toString(), s.type = et(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);
3686
3923
  }), t;
3687
3924
  }
3688
3925
  const e = [];
@@ -3690,20 +3927,20 @@ function mn(o) {
3690
3927
  const r = {
3691
3928
  name: t[0],
3692
3929
  ...t[1],
3693
- type: Qe(t[1].type),
3930
+ type: et(t[1].type),
3694
3931
  label: t[1].label || t[1].ua,
3695
3932
  rules: t[1].rules || t[1].validators
3696
3933
  };
3697
3934
  t[1].type.includes("list") && (r.multiple = !0), t[1].data && (r.api = `/api/suggest/${t[1].data}`), e.push(r);
3698
3935
  }), e;
3699
3936
  }
3700
- function hn(o, e) {
3701
- const t = mn(e), r = x({});
3937
+ function Un(o, e) {
3938
+ const t = Dn(e), r = w({});
3702
3939
  function s(p) {
3703
3940
  const f = p?.conditions;
3704
3941
  if (!f) return !0;
3705
- const c = Array.isArray(f) ? f[0] : f, b = o?.value?.[c];
3706
- return at(b, f);
3942
+ const c = Array.isArray(f) ? f[0] : f, m = o?.value?.[c];
3943
+ return nt(m, f);
3707
3944
  }
3708
3945
  const n = (p = t, f = !0) => (p.forEach((c) => {
3709
3946
  if (c.rules) {
@@ -3711,8 +3948,8 @@ function hn(o, e) {
3711
3948
  delete r.value[c.name];
3712
3949
  return;
3713
3950
  }
3714
- c.rules.forEach((b) => {
3715
- const v = fn(o.value[c.name], b);
3951
+ c.rules.forEach((m) => {
3952
+ const v = An(o.value[c.name], m);
3716
3953
  v ? r.value[c.name] = v : delete r.value[c.name];
3717
3954
  });
3718
3955
  }
@@ -3727,9 +3964,9 @@ function hn(o, e) {
3727
3964
  visibleSchema: a
3728
3965
  };
3729
3966
  }
3730
- const Oe = /* @__PURE__ */ E({
3967
+ const Ee = /* @__PURE__ */ E({
3731
3968
  __name: "vs-compact-form",
3732
- props: /* @__PURE__ */ W({
3969
+ props: /* @__PURE__ */ X({
3733
3970
  schema: { default: () => [] },
3734
3971
  style: { default: () => ({}) },
3735
3972
  modelValue: {},
@@ -3741,14 +3978,14 @@ const Oe = /* @__PURE__ */ E({
3741
3978
  values: { default: () => ({}) },
3742
3979
  valuesModifiers: {}
3743
3980
  }),
3744
- emits: /* @__PURE__ */ W(["handle-submit", "update:modelValue"], ["update:form", "update:values"]),
3981
+ emits: /* @__PURE__ */ X(["handle-submit", "update:modelValue"], ["update:form", "update:values"]),
3745
3982
  setup(o, { expose: e, emit: t }) {
3746
- const r = t, s = o, n = Q(o, "form"), a = Q(o, "values"), {
3983
+ const r = t, s = o, n = Y(o, "form"), a = Y(o, "values"), {
3747
3984
  errors: d,
3748
3985
  validate: p,
3749
3986
  reset: f,
3750
3987
  visibleSchema: c
3751
- } = hn(a, s.schema), b = () => {
3988
+ } = Un(a, s.schema), m = () => {
3752
3989
  r("update:modelValue", a.value), p(), r("handle-submit", a.value);
3753
3990
  };
3754
3991
  e({
@@ -3758,57 +3995,59 @@ const Oe = /* @__PURE__ */ E({
3758
3995
  }), pe(() => {
3759
3996
  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;
3760
3997
  });
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]);
3998
+ function v(C, k) {
3999
+ if (C === k) return !0;
4000
+ if (typeof C != "object" || typeof k != "object" || !C || !k) return !1;
4001
+ const M = Object.keys(C), S = Object.keys(k);
4002
+ return M.length !== S.length ? !1 : M.every((D) => C[D] === k[D]);
3766
4003
  }
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"])
4004
+ return Ke("form", n), Ke("values", a), (C, k) => (i(), u("form", {
4005
+ onSubmit: de(m, ["prevent"]),
4006
+ class: j(["grid grid-cols-12", C.layout === "default" ? "gap-6" : "gap-4"])
3770
4007
  }, [
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,
4008
+ (i(!0), u(Q, null, le(G(c), (M) => (i(), oe(it, {
4009
+ key: M.name,
4010
+ class: j(C.layout === "horizontal" ? "col-span-12" : `col-span-${M.col || 12} `),
4011
+ style: ke(C.style),
4012
+ item: M,
3776
4013
  layout: C.layout,
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);
4014
+ "model-value": a.value[M.name],
4015
+ "onUpdate:modelValue": (S) => {
4016
+ const D = a.value[M.name];
4017
+ v(D, S) || (a.value[M.name] = S);
3781
4018
  },
3782
- error: G(d)[D.name]
4019
+ error: G(d)[M.name]
3783
4020
  }, null, 8, ["class", "style", "item", "layout", "model-value", "onUpdate:modelValue", "error"]))), 128))
3784
4021
  ], 34));
3785
4022
  }
3786
4023
  });
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 = {});
4024
+ Ee.install = function(e) {
4025
+ e.component("VForm", Ee), Object.assign(e.config.globalProperties, {
4026
+ $form: Te
4027
+ }), e.provide("form", Te), window.v3plugin || (window.v3plugin = {});
3791
4028
  };
3792
4029
  export {
3793
- ma as ModalEdit,
3794
- Oe as VForm,
3795
- yl as VsInputCheckbox,
3796
- ia as VsInputContainer,
3797
- wl as VsInputDate,
3798
- dl as VsInputEmail,
3799
- ro as VsInputFile,
3800
- Fo as VsInputFileList,
3801
- nl as VsInputMask,
3802
- jt as VsInputNumber,
3803
- Je as VsInputRadio,
3804
- ja as VsInputSelect,
3805
- Ge as VsInputStatic,
3806
- lt as VsInputSwitcher,
3807
- an as VsInputTag,
3808
- qe as VsInputText,
3809
- za as VsInputTextarea,
3810
- Oe as default,
3811
- sn as inputs,
3812
- As as vsInputDatatable,
3813
- Kr as vsInputMap
4030
+ _a as ModalEdit,
4031
+ Ee as VForm,
4032
+ Ml as VsInputCheckbox,
4033
+ ha as VsInputContainer,
4034
+ Sl as VsInputDate,
4035
+ bl as VsInputEmail,
4036
+ mo as VsInputFile,
4037
+ qo as VsInputFileList,
4038
+ Ln as VsInputKeyValue,
4039
+ ml as VsInputMask,
4040
+ Ot as VsInputNumber,
4041
+ We as VsInputRadio,
4042
+ Ua as VsInputSelect,
4043
+ gn as VsInputSlug,
4044
+ Ze as VsInputStatic,
4045
+ st as VsInputSwitcher,
4046
+ fn as VsInputTag,
4047
+ Ae as VsInputText,
4048
+ Ra as VsInputTextarea,
4049
+ Ee as default,
4050
+ Sn as inputs,
4051
+ Ps as vsInputDatatable,
4052
+ ln as vsInputMap
3814
4053
  };