@opengis/filter 0.0.9 → 0.0.11

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/filter.js CHANGED
@@ -1,10 +1,10 @@
1
- import { defineComponent as O, ref as _, createElementBlock as w, openBlock as c, createElementVNode as u, withModifiers as Ve, normalizeClass as D, createCommentVNode as V, toDisplayString as j, computed as I, watch as M, createStaticVNode as Fe, Fragment as R, renderList as W, unref as e, createBlock as S, createVNode as N, createTextVNode as z, withDirectives as T, vShow as X, onBeforeUnmount as ce, vModelText as G, onMounted as ae, Teleport as _e, normalizeStyle as $e, renderSlot as ue, nextTick as fe, isRef as Le, withCtx as le, resolveDynamicComponent as ee, mergeProps as P, toRaw as Z, cloneVNode as Ee, useSlots as pe } from "vue";
2
- const Ie = { class: "flex items-center justify-between w-full text-sm" }, Te = { class: "flex items-center cursor-pointer w-full" }, Oe = {
1
+ import { defineComponent as O, ref as _, createElementBlock as w, openBlock as f, createElementVNode as u, withModifiers as _e, normalizeClass as D, createCommentVNode as V, toDisplayString as F, computed as I, watch as M, createStaticVNode as Le, Fragment as R, renderList as W, unref as e, createBlock as S, createVNode as N, createTextVNode as z, withDirectives as T, vShow as X, vModelText as G, onMounted as ne, onBeforeUnmount as ce, Teleport as $e, normalizeStyle as Ae, renderSlot as ue, nextTick as fe, isRef as Ee, withCtx as le, resolveDynamicComponent as ee, mergeProps as P, toRaw as Z, cloneVNode as Ie, useSlots as pe } from "vue";
2
+ const Te = { class: "flex items-center justify-between w-full text-sm" }, Oe = { class: "flex items-center cursor-pointer w-full" }, Ue = {
3
3
  key: 0,
4
4
  width: "16",
5
5
  height: "auto",
6
6
  src: "data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTYgMTYnIGZpbGw9J3doaXRlJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnPjxwYXRoIGQ9J00xMi4yMDcgNC43OTNhMSAxIDAgMDEwIDEuNDE0bC01IDVhMSAxIDAgMDEtMS40MTQgMGwtMi0yYTEgMSAwIDAxMS40MTQtMS40MTRMNi41IDkuMDg2bDQuMjkzLTQuMjkzYTEgMSAwIDAxMS40MTQgMHonLz48L3N2Zz4="
7
- }, Ue = ["value"], ze = { class: "w-[calc(100%-18px)] flex flex-row items-center justify-between pl-[10px]" }, Ne = { class: "flex flex-row items-center font-normal text-gray-800 gap-x-1" }, He = {
7
+ }, ze = ["value"], Ne = { class: "w-[calc(100%-18px)] flex flex-row items-center justify-between pl-[10px]" }, He = { class: "flex flex-row items-center font-normal text-gray-800 gap-x-1" }, Ye = {
8
8
  key: 0,
9
9
  class: "text-xs text-gray-500 dark:text-neutral-500 pr-1"
10
10
  }, me = /* @__PURE__ */ O({
@@ -20,44 +20,44 @@ const Ie = { class: "flex items-center justify-between w-full text-sm" }, Te = {
20
20
  highlighted: { type: Boolean }
21
21
  },
22
22
  emits: ["itemClick"],
23
- setup(p, { expose: a, emit: v }) {
24
- const t = p, s = v;
23
+ setup(i, { expose: n, emit: v }) {
24
+ const t = i, s = v;
25
25
  function r() {
26
26
  s("itemClick", t.value);
27
27
  }
28
- const i = _(null);
29
- return a({ el: i }), (m, d) => (c(), w("div", {
28
+ const d = _(null);
29
+ return n({ el: d }), (m, c) => (f(), w("div", {
30
30
  class: "flex items-center w-full rounded-lg group hover:bg-gray-100",
31
31
  ref_key: "el",
32
- ref: i
32
+ ref: d
33
33
  }, [
34
- u("div", Ie, [
35
- u("div", Te, [
34
+ u("div", Te, [
35
+ u("div", Oe, [
36
36
  u("label", {
37
37
  for: "radio-9740",
38
38
  class: D([
39
39
  ["inline", "popover"].includes(m.layout) ? "text-sm text-gray-500 px-2 w-full py-2 cursor-pointer !flex flex-row items-center" : "flex flex-row items-center w-full px-2 py-2 text-sm text-gray-500 cursor-pointer",
40
40
  { "bg-blue-100": m.highlighted }
41
41
  ]),
42
- onClick: Ve(r, ["stop", "prevent"])
42
+ onClick: _e(r, ["stop", "prevent"])
43
43
  }, [
44
44
  u("div", {
45
- class: D(["w-[18px] h-[18px] border rounded-[4px] flex items-center justify-center", [
46
- m.type === "checkbox" ? "rounded-[4px]" : "rounded-full",
45
+ class: D(["w-[18px] h-[18px] border flex items-center justify-center", [
46
+ m.type == "checkbox" ? "rounded-[4px]" : "rounded-full",
47
47
  m.color ? `bg-[${m.color}] border-[#ffffff]` : m.isSelected ? "bg-[#2563eb] border-[#ffffff]" : "bg-[#ffffff] border-[#d9d9d9]"
48
48
  ]])
49
49
  }, [
50
- m.isSelected ? (c(), w("img", Oe)) : V("", !0)
50
+ m.isSelected ? (f(), w("img", Ue)) : V("", !0)
51
51
  ], 2),
52
52
  u("input", {
53
53
  type: "checkbox",
54
54
  class: "hidden",
55
55
  id: "radio-9740",
56
56
  value: m.value
57
- }, null, 8, Ue),
58
- u("div", ze, [
59
- u("span", Ne, j(m.label ?? "Відсутні данні"), 1),
60
- m.count ? (c(), w("div", He, " (" + j(m.count) + ") ", 1)) : V("", !0)
57
+ }, null, 8, ze),
58
+ u("div", Ne, [
59
+ u("span", He, F(m.label ?? "Відсутні данні"), 1),
60
+ m.count ? (f(), w("div", Ye, " (" + F(m.count) + ") ", 1)) : V("", !0)
61
61
  ])
62
62
  ], 2)
63
63
  ])
@@ -65,75 +65,75 @@ const Ie = { class: "flex items-center justify-between w-full text-sm" }, Te = {
65
65
  ], 512));
66
66
  }
67
67
  });
68
- function Ae(p, a) {
68
+ function Be(i, n) {
69
69
  const {
70
70
  options: v = [],
71
71
  limit: t = 20
72
- } = p;
73
- function s(o) {
74
- return o !== void 0 ? o : "";
72
+ } = i;
73
+ function s(l) {
74
+ return Array.isArray(l) ? l[0] : l;
75
75
  }
76
- const r = _(s(p.modelValue)), i = _(""), m = _(!1), d = _([]), h = _("id"), f = _("text"), n = _(!1), l = _(p.layout !== "popover" && v.length > t);
77
- function b(o) {
78
- const x = o.find(Boolean) ?? {}, K = ["id", "value", "code", "key"].find((Y) => Y in x) ?? "id", A = ["text", "label", "name", "title"].find((Y) => Y in x) ?? "text";
76
+ const r = _(s(i.modelValue)), d = _(""), m = _(!1), c = _([]), x = _("id"), p = _("text"), a = _(!1), o = _(i.layout !== "popover" && v.length > t);
77
+ function h(l) {
78
+ const b = l.find(Boolean) ?? {}, K = ["id", "value", "code", "key"].find((Y) => Y in b) ?? "id", A = ["text", "label", "name", "title"].find((Y) => Y in b) ?? "text";
79
79
  return { autoValueKey: K, autoLabelKey: A };
80
80
  }
81
81
  if (v.length > 0) {
82
- const o = b(v);
83
- h.value = o.autoValueKey, f.value = o.autoLabelKey;
82
+ const l = h(v);
83
+ x.value = l.autoValueKey, p.value = l.autoLabelKey;
84
84
  }
85
- const y = I(() => {
86
- const o = d.value;
87
- return p.layout === "popover" || n.value ? o : o.slice(0, t);
85
+ const g = I(() => {
86
+ const l = c.value;
87
+ return i.layout === "popover" || a.value ? l : l.slice(0, t);
88
88
  });
89
- M(() => p.modelValue, (o) => {
90
- r.value = s(o);
91
- }, { immediate: !0 }), d.value = [...v].sort((o, x) => p.sort === "count" ? x.count && o.count ? x.count - o.count : 0 : p.sort === "name" ? String(o[f.value] ?? "").localeCompare(String(x[f.value] ?? "")) : 0);
92
- function k(o) {
93
- return r.value === o[h.value];
89
+ M(() => i.modelValue, (l) => {
90
+ r.value = s(l);
91
+ }, { immediate: !0 }), c.value = [...v].sort((l, b) => i.sort === "count" ? b.count && l.count ? b.count - l.count : 0 : i.sort === "name" ? String(l[p.value] ?? "").localeCompare(String(b[p.value] ?? "")) : 0);
92
+ function k(l) {
93
+ return r.value === l[x.value];
94
94
  }
95
- function g(o) {
96
- r.value = o[h.value], a("update:modelValue", r.value), a("change", { name: p.name, value: r.value });
95
+ function y(l) {
96
+ r.value = l[x.value], n("update:modelValue", r.value), n("change", { name: i.name, value: r.value });
97
97
  }
98
98
  function $() {
99
- r.value = void 0, a("update:modelValue", r.value), a("clear", p.name);
99
+ r.value = void 0, n("update:modelValue", r.value), n("clear", i.name);
100
100
  }
101
101
  function C() {
102
- n.value = !n.value;
102
+ a.value = !a.value;
103
103
  }
104
104
  return {
105
105
  innerValue: r,
106
- searchTerm: i,
107
- filteredOptions: y,
106
+ searchTerm: d,
107
+ filteredOptions: g,
108
108
  isSelected: k,
109
- selectItem: g,
109
+ selectItem: y,
110
110
  clear: $,
111
111
  toggleShowAll: C,
112
112
  isReqProc: m,
113
- showAll: n,
114
- isEnableShowAll: l,
115
- labelKey: f,
116
- valueKey: h,
117
- allOptions: d
113
+ showAll: a,
114
+ isEnableShowAll: o,
115
+ labelKey: p,
116
+ valueKey: x,
117
+ allOptions: c
118
118
  };
119
119
  }
120
- const J = (p, a) => {
121
- const v = p.__vccOpts || p;
122
- for (const [t, s] of a)
120
+ const J = (i, n) => {
121
+ const v = i.__vccOpts || i;
122
+ for (const [t, s] of n)
123
123
  v[t] = s;
124
124
  return v;
125
- }, Ye = {}, Pe = {
125
+ }, Pe = {}, We = {
126
126
  class: "w-48 mx-auto",
127
127
  viewBox: "0 0 178 90",
128
128
  fill: "none",
129
129
  xmlns: "http://www.w3.org/2000/svg"
130
130
  };
131
- function We(p, a) {
132
- return c(), w("svg", Pe, a[0] || (a[0] = [
133
- Fe('<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)
131
+ function qe(i, n) {
132
+ return f(), w("svg", We, n[0] || (n[0] = [
133
+ Le('<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)
134
134
  ]));
135
135
  }
136
- const ve = /* @__PURE__ */ J(Ye, [["render", We]]), qe = {}, Qe = {
136
+ const ve = /* @__PURE__ */ J(Pe, [["render", qe]]), Qe = {}, Ge = {
137
137
  xmlns: "http://www.w3.org/2000/svg",
138
138
  width: "24",
139
139
  height: "24",
@@ -145,8 +145,8 @@ const ve = /* @__PURE__ */ J(Ye, [["render", We]]), qe = {}, Qe = {
145
145
  "stroke-linejoin": "round",
146
146
  class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate"
147
147
  };
148
- function Ge(p, a) {
149
- return c(), w("svg", Qe, a[0] || (a[0] = [
148
+ function Xe(i, n) {
149
+ return f(), w("svg", Ge, n[0] || (n[0] = [
150
150
  u("path", {
151
151
  stroke: "none",
152
152
  d: "M0 0h24v24H0z",
@@ -155,7 +155,7 @@ function Ge(p, a) {
155
155
  u("path", { d: "M6 9l6 6l6 -6" }, null, -1)
156
156
  ]));
157
157
  }
158
- const ie = /* @__PURE__ */ J(qe, [["render", Ge]]), Xe = {}, Je = {
158
+ const ie = /* @__PURE__ */ J(Qe, [["render", Xe]]), Je = {}, Ze = {
159
159
  xmlns: "http://www.w3.org/2000/svg",
160
160
  width: "24",
161
161
  height: "24",
@@ -167,8 +167,8 @@ const ie = /* @__PURE__ */ J(qe, [["render", Ge]]), Xe = {}, Je = {
167
167
  "stroke-linejoin": "round",
168
168
  class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down w-[14px] rotate-[180deg]"
169
169
  };
170
- function Ze(p, a) {
171
- return c(), w("svg", Je, a[0] || (a[0] = [
170
+ function et(i, n) {
171
+ return f(), w("svg", Ze, n[0] || (n[0] = [
172
172
  u("path", {
173
173
  stroke: "none",
174
174
  d: "M0 0h24v24H0z",
@@ -177,13 +177,13 @@ function Ze(p, a) {
177
177
  u("path", { d: "M6 9l6 6l6 -6" }, null, -1)
178
178
  ]));
179
179
  }
180
- const ge = /* @__PURE__ */ J(Xe, [["render", Ze]]), et = {
180
+ const ye = /* @__PURE__ */ J(Je, [["render", et]]), tt = {
181
181
  key: 0,
182
182
  class: "w-full"
183
- }, tt = { class: "flex flex-col items-center justify-center p-5 text-center" }, lt = {
183
+ }, lt = { class: "flex flex-col items-center justify-center p-5 text-center" }, ot = {
184
184
  key: 0,
185
185
  class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
186
- }, ot = {
186
+ }, at = {
187
187
  key: 1,
188
188
  class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
189
189
  }, nt = /* @__PURE__ */ O({
@@ -212,33 +212,33 @@ const ge = /* @__PURE__ */ J(Xe, [["render", Ze]]), et = {
212
212
  sort: {}
213
213
  },
214
214
  emits: ["update:modelValue", "change", "clear"],
215
- setup(p, { expose: a, emit: v }) {
216
- const t = p, s = _(null), r = v, {
217
- innerValue: i,
215
+ setup(i, { expose: n, emit: v }) {
216
+ const t = i, s = _(null), r = v, {
217
+ innerValue: d,
218
218
  filteredOptions: m,
219
- isSelected: d,
220
- selectItem: h,
221
- clear: f,
222
- toggleShowAll: n,
223
- isReqProc: l,
224
- showAll: b,
225
- isEnableShowAll: y,
219
+ isSelected: c,
220
+ selectItem: x,
221
+ clear: p,
222
+ toggleShowAll: a,
223
+ isReqProc: o,
224
+ showAll: h,
225
+ isEnableShowAll: g,
226
226
  labelKey: k,
227
- valueKey: g,
227
+ valueKey: y,
228
228
  allOptions: $
229
- } = Ae({
229
+ } = Be({
230
230
  ...t,
231
231
  modelValue: t.modelValue ?? t.default ?? ""
232
232
  }, r);
233
- return a({
234
- clear: f,
233
+ return n({
234
+ clear: p,
235
235
  inputTextRef: s
236
236
  }), M(
237
237
  () => t.modelValue,
238
238
  (C) => {
239
- C === void 0 && (i.value = void 0);
239
+ C === void 0 && (d.value = void 0);
240
240
  }
241
- ), (C, o) => (c(), w("div", {
241
+ ), (C, l) => (f(), w("div", {
242
242
  class: D([C.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox"])
243
243
  }, [
244
244
  u("div", {
@@ -247,196 +247,132 @@ const ge = /* @__PURE__ */ J(Xe, [["render", Ze]]), et = {
247
247
  C.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
248
248
  ])
249
249
  }, [
250
- (c(!0), w(R, null, W(e(m), (x) => (c(), S(me, {
250
+ (f(!0), w(R, null, W(e(m), (b) => (f(), S(me, {
251
251
  layout: C.layout,
252
- key: x[e(g)],
253
- count: x.count,
254
- label: x[e(k)],
255
- color: x.color,
252
+ key: b[e(y)],
253
+ count: b.count,
254
+ label: b[e(k)],
255
+ color: b.color,
256
256
  type: "radio",
257
- value: x[e(g)],
258
- "is-selected": e(d)(x),
259
- onItemClick: (K) => e(h)(x)
257
+ value: b[e(y)],
258
+ "is-selected": e(c)(b),
259
+ onItemClick: (K) => e(x)(b)
260
260
  }, null, 8, ["layout", "count", "label", "color", "value", "is-selected", "onItemClick"]))), 128))
261
261
  ], 2),
262
- C.type === "select" && e(m).length === 0 && !e(l) ? (c(), w("div", et, [
263
- u("div", tt, [
262
+ C.type === "select" && e(m).length === 0 && !e(o) ? (f(), w("div", tt, [
263
+ u("div", lt, [
264
264
  N(ve),
265
- o[4] || (o[4] = u("div", { class: "max-w-sm mx-auto mt-6" }, [
265
+ l[4] || (l[4] = u("div", { class: "max-w-sm mx-auto mt-6" }, [
266
266
  u("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
267
267
  u("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
268
268
  ], -1))
269
269
  ])
270
270
  ])) : V("", !0),
271
- C.layout !== "popover" && C.type !== "select" ? (c(), w(R, { key: 1 }, [
272
- !e(b) && e(y) ? (c(), w("div", {
271
+ C.layout !== "popover" && C.type !== "select" ? (f(), w(R, { key: 1 }, [
272
+ !e(h) && e(g) ? (f(), w("div", {
273
273
  key: 0,
274
- onClick: o[0] || (o[0] = //@ts-ignore
275
- (...x) => e(n) && e(n)(...x)),
274
+ onClick: l[0] || (l[0] = //@ts-ignore
275
+ (...b) => e(a) && e(a)(...b)),
276
276
  class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
277
277
  }, [
278
- o[5] || (o[5] = z(" Показати більше ", -1)),
278
+ l[5] || (l[5] = z(" Показати більше ")),
279
279
  N(ie)
280
280
  ])) : V("", !0),
281
- e(b) ? (c(), w("div", {
281
+ e(h) ? (f(), w("div", {
282
282
  key: 1,
283
- onClick: o[1] || (o[1] = //@ts-ignore
284
- (...x) => e(n) && e(n)(...x)),
283
+ onClick: l[1] || (l[1] = //@ts-ignore
284
+ (...b) => e(a) && e(a)(...b)),
285
285
  class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
286
286
  }, [
287
- o[6] || (o[6] = z(" Показати менше ", -1)),
288
- N(ge)
287
+ l[6] || (l[6] = z(" Показати менше ")),
288
+ N(ye)
289
289
  ])) : V("", !0)
290
290
  ], 64)) : V("", !0),
291
- C.cleanable ? (c(), w(R, { key: 2 }, [
292
- C.layout === "inline" ? (c(), w("div", lt, [
293
- z(j(e(i) || e(i) === null ? 1 : 0) + " з " + j(e($).length) + " обрано ", 1),
291
+ C.cleanable ? (f(), w(R, { key: 2 }, [
292
+ C.layout === "inline" ? (f(), w("div", ot, [
293
+ z(F(e(d) || e(d) === null ? 1 : 0) + " з " + F(e($).length) + " обрано ", 1),
294
294
  T(u("button", {
295
295
  class: "text-gray-600 hover:text-gray-800",
296
- onClick: o[2] || (o[2] = //@ts-ignore
297
- (...x) => e(f) && e(f)(...x))
296
+ onClick: l[2] || (l[2] = //@ts-ignore
297
+ (...b) => e(p) && e(p)(...b))
298
298
  }, " Очистити ", 512), [
299
- [X, e(i) !== "" && e(i) !== void 0]
299
+ [X, e(d) !== "" && e(d) !== void 0]
300
300
  ])
301
301
  ])) : V("", !0),
302
- C.layout === "popover" ? (c(), w("div", ot, [
303
- u("span", null, j(e(i) || e(i) === null ? 1 : 0) + " з " + j(e($).length) + " обрано", 1),
302
+ C.layout === "popover" ? (f(), w("div", at, [
303
+ u("span", null, F(e(d) || e(d) === null ? 1 : 0) + " з " + F(e($).length) + " обрано", 1),
304
304
  T(u("button", {
305
305
  class: "text-gray-600 hover:text-gray-800",
306
- onClick: o[3] || (o[3] = //@ts-ignore
307
- (...x) => e(f) && e(f)(...x))
306
+ onClick: l[3] || (l[3] = //@ts-ignore
307
+ (...b) => e(p) && e(p)(...b))
308
308
  }, " Очистити ", 512), [
309
- [X, e(i) !== "" && e(i) !== void 0]
309
+ [X, e(d) !== "" && e(d) !== void 0]
310
310
  ])
311
311
  ])) : V("", !0)
312
312
  ], 64)) : V("", !0)
313
313
  ], 2));
314
314
  }
315
315
  });
316
- function Be(p, a) {
316
+ function Se(i, n) {
317
317
  const {
318
- api: v,
319
- options: t = [],
320
- limit: s = 20,
321
- dataKey: r = "data"
322
- } = p, i = p.multi;
323
- function m(B) {
324
- return i ? Array.isArray(B) ? B : B ? [B] : [] : B !== void 0 ? B : "";
325
- }
326
- const d = _(m(p.modelValue)), h = _(""), f = _(!1), n = _([]), l = _("id"), b = _("text"), y = _(!1), k = _(p.layout !== "popover" && t.length > s), g = _([]), $ = _(0);
327
- function C(B) {
328
- const U = B.find(Boolean) ?? {}, q = ["id", "value", "code", "key"].find((oe) => oe in U) ?? "id", se = ["text", "label", "name", "title"].find((oe) => oe in U) ?? "text";
329
- return { autoValueKey: q, autoLabelKey: se };
330
- }
331
- if (t.length > 0) {
332
- const B = C(t);
333
- l.value = B.autoValueKey, b.value = B.autoLabelKey;
334
- }
335
- const o = I(() => {
336
- if (v) return n.value;
337
- const B = n.value;
338
- if (p.layout === "popover") return B;
339
- if (!h.value)
340
- return y.value ? B : B.slice(0, s);
341
- const U = h.value.toLowerCase();
342
- return B.filter((q) => q[b.value].toLowerCase().includes(U));
343
- });
344
- let x = null;
345
- async function K(B) {
346
- if (v) {
347
- f.value = !0;
348
- try {
349
- const U = new URL(v, window.location.origin);
350
- U.searchParams.set("json", "1"), U.searchParams.set("key", B), U.searchParams.set("limit", s.toString());
351
- const q = await fetch(U.toString());
352
- if (!q.ok)
353
- throw new Error(`HTTP error! status: ${q.status}`);
354
- const se = await q.json();
355
- if (n.value = se[r], n.value.length > 0) {
356
- const oe = C(n.value);
357
- l.value = oe.autoValueKey, b.value = oe.autoLabelKey;
358
- }
359
- $.value = se.total;
360
- } catch (U) {
361
- console.error("Failed to fetch remote options:", U);
362
- } finally {
363
- f.value = !1;
364
- }
365
- }
318
+ options: v = [],
319
+ limit: t = 20
320
+ } = i;
321
+ function s(l) {
322
+ return Array.isArray(l) ? l : l ? [l] : [];
366
323
  }
367
- M(h, (B) => {
368
- v && (x && clearTimeout(x), x = setTimeout(() => {
369
- K(B);
370
- }, 200));
371
- }), M(() => p.modelValue, (B) => {
372
- d.value = m(B);
373
- }, { immediate: !0 }), v ? K("") : n.value = t;
374
- function A(B) {
375
- return i && Array.isArray(d.value) ? d.value.includes(B[l.value]) : d.value === B[l.value];
324
+ const r = _(s(i.modelValue)), d = _(""), m = _(!1), c = _([]), x = _("id"), p = _("text"), a = _(!1), o = _(i.layout !== "popover" && v.length > t);
325
+ function h(l) {
326
+ const b = l.find(Boolean) ?? {}, K = ["id", "value", "code", "key"].find((Y) => Y in b) ?? "id", A = ["text", "label", "name", "title"].find((Y) => Y in b) ?? "text";
327
+ return { autoValueKey: K, autoLabelKey: A };
376
328
  }
377
- function Y(B) {
378
- if (i && !Array.isArray(d.value) && (d.value = []), i && Array.isArray(d.value)) {
379
- const U = d.value.includes(B[l.value]);
380
- d.value = U ? d.value.filter((q) => q !== B[l.value]) : [...d.value, B[l.value]], g.value = U ? g.value.filter((q) => q !== B[b.value]) : [...g.value, B[b.value]];
381
- } else
382
- d.value = B[l.value], g.value = B[b.value];
383
- a("update:modelValue", d.value), a("change", { name: p.name, value: d.value });
329
+ if (v.length > 0) {
330
+ const l = h(v);
331
+ x.value = l.autoValueKey, p.value = l.autoLabelKey;
384
332
  }
385
- function L() {
386
- i ? (d.value = [], g.value = []) : (d.value = void 0, g.value = []), a("update:modelValue", d.value), a("clear", p.name);
333
+ const g = I(() => {
334
+ const l = c.value;
335
+ return i.layout === "popover" || a.value ? l : l.slice(0, t);
336
+ });
337
+ M(() => i.modelValue, (l) => {
338
+ r.value = s(l);
339
+ }, { immediate: !0 }), c.value = [...v].sort((l, b) => i.sort === "count" ? b.count && l.count ? b.count - l.count : 0 : i.sort === "name" ? String(l[p.value]).localeCompare(String(b[p.value])) : 0);
340
+ function k(l) {
341
+ return r.value && r.value.includes(l[x.value]);
387
342
  }
388
- function F() {
389
- x && clearTimeout(x), h.value = "", y.value = !1;
343
+ function y(l) {
344
+ const b = r.value.includes(l[x.value]);
345
+ r.value = b ? r.value.filter((K) => K !== l[x.value]) : [...r.value, l[x.value]], n("update:modelValue", r.value), n("change", { name: i.name, value: r.value });
390
346
  }
391
- function E() {
392
- y.value = !y.value;
347
+ function $() {
348
+ r.value = [], n("update:modelValue", r.value), n("clear", i.name);
393
349
  }
394
- ce(() => {
395
- x && clearTimeout(x);
396
- });
397
- const Q = _(-1);
398
- M(o, () => {
399
- Q.value = o.value.length > 0 ? 0 : -1;
400
- });
401
- function re(B) {
402
- const U = o.value.length;
403
- if (B.key === "ArrowDown")
404
- B.preventDefault(), Q.value = (Q.value + 1) % U;
405
- else if (B.key === "ArrowUp")
406
- B.preventDefault(), Q.value = (Q.value - 1 + U) % U;
407
- else if (B.key === "Enter" && (B.preventDefault(), Q.value >= 0 && Q.value < o.value.length)) {
408
- const q = o.value[Q.value];
409
- Y(q);
410
- }
350
+ function C() {
351
+ a.value = !a.value;
411
352
  }
412
353
  return {
413
- innerValue: d,
414
- searchTerm: h,
415
- filteredOptions: o,
416
- isSelected: A,
417
- selectItem: Y,
418
- clear: L,
419
- resetSearch: F,
420
- toggleShowAll: E,
421
- isReqProc: f,
422
- showAll: y,
423
- isEnableShowAll: k,
424
- labelKey: b,
425
- valueKey: l,
426
- allOptions: n,
427
- highlightedIndex: Q,
428
- onKeyDown: re,
429
- selectedLabels: g,
430
- totalCount: $
354
+ innerValue: r,
355
+ searchTerm: d,
356
+ filteredOptions: g,
357
+ isSelected: k,
358
+ selectItem: y,
359
+ clear: $,
360
+ toggleShowAll: C,
361
+ isReqProc: m,
362
+ showAll: a,
363
+ isEnableShowAll: o,
364
+ labelKey: p,
365
+ valueKey: x,
366
+ allOptions: c
431
367
  };
432
368
  }
433
- const at = {
369
+ const rt = {
434
370
  key: 0,
435
371
  class: "w-full"
436
- }, rt = { class: "flex flex-col items-center justify-center p-5 text-center" }, st = {
372
+ }, st = { class: "flex flex-col items-center justify-center p-5 text-center" }, ut = {
437
373
  key: 0,
438
374
  class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
439
- }, ut = {
375
+ }, it = {
440
376
  key: 1,
441
377
  class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
442
378
  }, xe = /* @__PURE__ */ O({
@@ -465,21 +401,21 @@ const at = {
465
401
  sort: {}
466
402
  },
467
403
  emits: ["update:modelValue", "change", "clear"],
468
- setup(p, { expose: a, emit: v }) {
469
- const t = p, s = v, {
404
+ setup(i, { expose: n, emit: v }) {
405
+ const t = i, s = v, {
470
406
  innerValue: r,
471
- filteredOptions: i,
407
+ filteredOptions: d,
472
408
  isSelected: m,
473
- selectItem: d,
474
- clear: h,
475
- toggleShowAll: f,
476
- isReqProc: n,
477
- showAll: l,
478
- isEnableShowAll: b,
479
- labelKey: y,
409
+ selectItem: c,
410
+ clear: x,
411
+ toggleShowAll: p,
412
+ isReqProc: a,
413
+ showAll: o,
414
+ isEnableShowAll: h,
415
+ labelKey: g,
480
416
  valueKey: k,
481
- allOptions: g
482
- } = Be({
417
+ allOptions: y
418
+ } = Se({
483
419
  ...t,
484
420
  modelValue: t.modelValue
485
421
  }, s);
@@ -488,9 +424,9 @@ const at = {
488
424
  ($) => {
489
425
  $ === void 0 && (r.value = []);
490
426
  }
491
- ), a({
492
- clear: h
493
- }), ($, C) => (c(), w("div", {
427
+ ), n({
428
+ clear: x
429
+ }), ($, C) => (f(), w("div", {
494
430
  class: D([$.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox space-y-0.5"])
495
431
  }, [
496
432
  u("div", {
@@ -499,19 +435,19 @@ const at = {
499
435
  $.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
500
436
  ])
501
437
  }, [
502
- (c(!0), w(R, null, W(e(i), (o) => (c(), S(me, {
438
+ (f(!0), w(R, null, W(e(d), (l) => (f(), S(me, {
503
439
  layout: $.layout,
504
- count: o.count,
505
- label: o[e(y)],
506
- color: o.color,
440
+ count: l.count,
441
+ label: l[e(g)],
442
+ color: l.color,
507
443
  type: "checkbox",
508
- value: o[e(k)],
509
- "is-selected": e(m)(o),
510
- onItemClick: (x) => e(d)(o)
444
+ value: l[e(k)],
445
+ "is-selected": e(m)(l),
446
+ onItemClick: (b) => e(c)(l)
511
447
  }, null, 8, ["layout", "count", "label", "color", "value", "is-selected", "onItemClick"]))), 256))
512
448
  ], 2),
513
- $.type === "select" && e(i).length === 0 && !e(n) ? (c(), w("div", at, [
514
- u("div", rt, [
449
+ $.type === "select" && e(d).length === 0 && !e(a) ? (f(), w("div", rt, [
450
+ u("div", st, [
515
451
  N(ve),
516
452
  C[4] || (C[4] = u("div", { class: "max-w-sm mx-auto mt-6" }, [
517
453
  u("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
@@ -519,43 +455,43 @@ const at = {
519
455
  ], -1))
520
456
  ])
521
457
  ])) : V("", !0),
522
- $.layout !== "popover" && $.type !== "select" ? (c(), w(R, { key: 1 }, [
523
- !e(l) && e(b) ? (c(), w("div", {
458
+ $.layout !== "popover" && $.type !== "select" ? (f(), w(R, { key: 1 }, [
459
+ !e(o) && e(h) ? (f(), w("div", {
524
460
  key: 0,
525
461
  onClick: C[0] || (C[0] = //@ts-ignore
526
- (...o) => e(f) && e(f)(...o)),
462
+ (...l) => e(p) && e(p)(...l)),
527
463
  class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
528
464
  }, [
529
- C[5] || (C[5] = z(" Показати більше ", -1)),
465
+ C[5] || (C[5] = z(" Показати більше ")),
530
466
  N(ie)
531
467
  ])) : V("", !0),
532
- e(l) ? (c(), w("div", {
468
+ e(o) ? (f(), w("div", {
533
469
  key: 1,
534
470
  onClick: C[1] || (C[1] = //@ts-ignore
535
- (...o) => e(f) && e(f)(...o)),
471
+ (...l) => e(p) && e(p)(...l)),
536
472
  class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
537
473
  }, [
538
- C[6] || (C[6] = z(" Показати менше ", -1)),
539
- N(ge)
474
+ C[6] || (C[6] = z(" Показати менше ")),
475
+ N(ye)
540
476
  ])) : V("", !0)
541
477
  ], 64)) : V("", !0),
542
- $.cleanable ? (c(), w(R, { key: 2 }, [
543
- $.layout === "inline" ? (c(), w("div", st, [
544
- z(j(e(r).length) + " з " + j(e(g).length) + " обрано ", 1),
478
+ $.cleanable ? (f(), w(R, { key: 2 }, [
479
+ $.layout === "inline" ? (f(), w("div", ut, [
480
+ z(F(e(r).length) + " з " + F(e(y).length) + " обрано ", 1),
545
481
  T(u("button", {
546
482
  class: "text-gray-600 hover:text-gray-800",
547
483
  onClick: C[2] || (C[2] = //@ts-ignore
548
- (...o) => e(h) && e(h)(...o))
484
+ (...l) => e(x) && e(x)(...l))
549
485
  }, " Очистити ", 512), [
550
486
  [X, e(r).length !== 0]
551
487
  ])
552
488
  ])) : V("", !0),
553
- $.layout === "popover" ? (c(), w("div", ut, [
554
- u("span", null, j(e(r).length) + " з " + j(e(g).length) + " обрано", 1),
489
+ $.layout === "popover" ? (f(), w("div", it, [
490
+ u("span", null, F(e(r).length) + " з " + F(e(y).length) + " обрано", 1),
555
491
  T(u("button", {
556
492
  class: "text-gray-600 hover:text-gray-800",
557
493
  onClick: C[3] || (C[3] = //@ts-ignore
558
- (...o) => e(h) && e(h)(...o))
494
+ (...l) => e(x) && e(x)(...l))
559
495
  }, " Очистити ", 512), [
560
496
  [X, e(r).length !== 0]
561
497
  ])
@@ -563,7 +499,7 @@ const at = {
563
499
  ], 64)) : V("", !0)
564
500
  ], 2));
565
501
  }
566
- }), it = {}, dt = {
502
+ }), dt = {}, ct = {
567
503
  xmlns: "http://www.w3.org/2000/svg",
568
504
  width: "15px",
569
505
  height: "15px",
@@ -575,8 +511,8 @@ const at = {
575
511
  "stroke-linejoin": "round",
576
512
  class: "icon icon-tabler icons-tabler-outline icon-tabler-search stroke-gray-500 transition-all"
577
513
  };
578
- function ct(p, a) {
579
- return c(), w("svg", dt, a[0] || (a[0] = [
514
+ function ft(i, n) {
515
+ return f(), w("svg", ct, n[0] || (n[0] = [
580
516
  u("path", {
581
517
  stroke: "none",
582
518
  d: "M0 0h24v24H0z",
@@ -586,7 +522,7 @@ function ct(p, a) {
586
522
  u("path", { d: "M21 21l-6 -6" }, null, -1)
587
523
  ]));
588
524
  }
589
- const Se = /* @__PURE__ */ J(it, [["render", ct]]), ft = {}, pt = {
525
+ const De = /* @__PURE__ */ J(dt, [["render", ft]]), pt = {}, mt = {
590
526
  xmlns: "http://www.w3.org/2000/svg",
591
527
  viewBox: "0 0 24 24",
592
528
  fill: "none",
@@ -598,8 +534,8 @@ const Se = /* @__PURE__ */ J(it, [["render", ct]]), ft = {}, pt = {
598
534
  width: "15px",
599
535
  height: "15px"
600
536
  };
601
- function mt(p, a) {
602
- return c(), w("svg", pt, a[0] || (a[0] = [
537
+ function vt(i, n) {
538
+ return f(), w("svg", mt, n[0] || (n[0] = [
603
539
  u("path", {
604
540
  stroke: "none",
605
541
  d: "M0 0h24v24H0z",
@@ -609,13 +545,13 @@ function mt(p, a) {
609
545
  u("path", { d: "M6 6l12 12" }, null, -1)
610
546
  ]));
611
547
  }
612
- const De = /* @__PURE__ */ J(ft, [["render", mt]]);
548
+ const Re = /* @__PURE__ */ J(pt, [["render", vt]]);
613
549
  class de {
614
- static getWidthClass(a) {
615
- return typeof a == "number" ? `max-w-[${a}px]` : typeof a == "string" ? a.endsWith("%") || a.endsWith("px") ? `max-w-[${a}]` : `max-w-${a}` : "w-full";
550
+ static getWidthClass(n) {
551
+ return typeof n == "number" ? `max-w-[${n}px]` : typeof n == "string" ? n.endsWith("%") || n.endsWith("px") ? `max-w-[${n}]` : `max-w-${n}` : "w-full";
616
552
  }
617
553
  }
618
- const vt = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3" }, gt = ["placeholder"], yt = /* @__PURE__ */ O({
554
+ const yt = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3" }, gt = ["placeholder"], bt = /* @__PURE__ */ O({
619
555
  __name: "text-input",
620
556
  props: {
621
557
  id: {},
@@ -641,40 +577,40 @@ const vt = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3"
641
577
  sort: {}
642
578
  },
643
579
  emits: ["update:modelValue", "change", "clear"],
644
- setup(p, { emit: a }) {
645
- const v = p, t = _((v.placeHolder || v.label || v.name).toString()), s = a, r = _(v.modelValue ?? "");
580
+ setup(i, { emit: n }) {
581
+ const v = i, t = _((v.placeHolder || v.label || v.name).toString()), s = n, r = _(v.modelValue ?? "");
646
582
  M(
647
583
  () => v.modelValue,
648
- (d) => {
649
- d !== r.value && (r.value = d ?? "");
584
+ (c) => {
585
+ c !== r.value && (r.value = c ?? "");
650
586
  }
651
587
  );
652
- function i() {
588
+ function d() {
653
589
  s("update:modelValue", r.value), s("change", { name: v.name, value: r.value });
654
590
  }
655
591
  function m() {
656
592
  r.value = "", s("update:modelValue", ""), s("clear", v.name);
657
593
  }
658
- return (d, h) => (c(), w("div", {
594
+ return (c, x) => (f(), w("div", {
659
595
  class: D([
660
596
  "vs-form-text relative bg-white rounded-lg [&>input]:py-[7px] [&>input]:max-h-[38px] [&>input]:ps-10 [&>input]:pe-8 [&>input]:block [&>input]:w-full [&>input]:bg-gray-100 [&>input]:border-transparent [&>input]:rounded-lg [&>input]:text-sm [&>input]:focus:bg-white [&>input]:focus:border-blue-500 [&>input]:focus:ring-blue-500 [&>input]:disabled:opacity-50 [&>input]:disabled:pointer-events-none [&>input]:dark:bg-neutral-700 [&>input]:dark:border-transparent [&>input]:dark:text-neutral-400 [&>input]:dark:placeholder:text-neutral-400 dark:focus:bg-neutral-800 dark:focus:ring-neutral-600",
661
- d.layout === "inline" ? e(de).getWidthClass(d.width) : "w-full mb-2"
597
+ c.layout === "inline" ? e(de).getWidthClass(c.width) : "w-full mb-2"
662
598
  ])
663
599
  }, [
664
- u("div", vt, [
665
- N(Se)
600
+ u("div", yt, [
601
+ N(De)
666
602
  ]),
667
- r.value !== "" ? (c(), w("div", {
603
+ r.value !== "" ? (f(), w("div", {
668
604
  key: 0,
669
605
  onClick: m,
670
606
  class: "absolute bottom-2/4 translate-y-2/4 right-3 cursor-pointer"
671
607
  }, [
672
- N(De)
608
+ N(Re)
673
609
  ])) : V("", !0),
674
610
  T(u("input", {
675
611
  type: "text",
676
- "onUpdate:modelValue": h[0] || (h[0] = (f) => r.value = f),
677
- onInput: i,
612
+ "onUpdate:modelValue": x[0] || (x[0] = (p) => r.value = p),
613
+ onInput: d,
678
614
  placeholder: t.value,
679
615
  class: "!pr-7 !pl-8 bg-white h-[38px] text-sm py-2 px-3 block w-full border border-solid placeholder:text-nowrap border-stone-200 rounded-lg text-sm text-stone-800 placeholder:text-stone-400 focus:border-2 focus:z-10 focus:border-blue-500 focus:ring-blue-500 focus:outline-blue-500"
680
616
  }, null, 40, gt), [
@@ -683,32 +619,32 @@ const vt = { class: "absolute bottom-2/4 translate-y-2/4 cursor-pointer left-3"
683
619
  ], 2));
684
620
  }
685
621
  });
686
- function Re(p = { color: "blue" }) {
622
+ function Me(i = { color: "blue" }) {
687
623
  return I(() => {
688
- const v = `w-full px-3 py-2 border-solid border border-gray-300 text-sm rounded focus:outline-none focus:ring-2 focus:ring-${p.color}-500 focus:border-transparent`;
689
- return p?.size === "sm" ? `${v}h-[32px]` : `${v}h-[38px]`;
624
+ const v = `w-full px-3 py-2 border-solid border border-gray-300 text-sm rounded focus:outline-none focus:ring-2 focus:ring-${i.color}-500 focus:border-transparent`;
625
+ return i?.size === "sm" ? `${v}h-[32px]` : `${v}h-[38px]`;
690
626
  });
691
627
  }
692
- function bt() {
628
+ function ht() {
693
629
  return "rounded-md font-medium border-gray-200 border-solid disabled:pointer-events-none disabled:opacity-50 px-4 py-2 w-full bg-transparent border text-black text-sm h-[38px]";
694
630
  }
695
- function ht() {
631
+ function xt() {
696
632
  return "font-medium border-gray-200 border-solid disabled:pointer-events-none disabled:opacity-50 border h-7 rounded-md text-xs px-2 py-1 hover:bg-gray-100";
697
633
  }
698
- function Me(p) {
699
- return p === "ghost" ? "inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent text-gray-600 hover:bg-blue-100 hover:text-gray-800 focus:outline-hidden focus:bg-gray-100 focus:text-gray-800 disabled:opacity-50 disabled:pointer-events-none dark:text-gray-500 dark:hover:bg-blue-800/30 dark:hover:text-blue-400 dark:focus:bg-blue-800/30 dark:focus:text-blue-400" : p === "soft" ? "inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 hover:bg-gray-200 focus:outline-hidden focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:text-blue-400 dark:hover:bg-blue-900 dark:focus:bg-blue-900" : "relative border-solid border-gray-200 focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border-input hover:bg-gray-100 border px-4 py-2 gap-2 bg-transparent h-[38px]";
634
+ function Ke(i) {
635
+ return i === "ghost" ? "inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent text-gray-600 hover:bg-blue-100 hover:text-gray-800 focus:outline-hidden focus:bg-gray-100 focus:text-gray-800 disabled:opacity-50 disabled:pointer-events-none dark:text-gray-500 dark:hover:bg-blue-800/30 dark:hover:text-blue-400 dark:focus:bg-blue-800/30 dark:focus:text-blue-400" : i === "soft" ? "inline-flex relative py-2 px-4 items-center gap-x-2 text-sm font-medium rounded-lg border border-transparent bg-gray-100 text-gray-800 hover:bg-gray-200 hover:bg-gray-200 focus:outline-hidden focus:bg-gray-200 disabled:opacity-50 disabled:pointer-events-none dark:text-blue-400 dark:hover:bg-blue-900 dark:focus:bg-blue-900" : "relative border-solid border-gray-200 focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 border-input hover:bg-gray-100 border px-4 py-2 gap-2 bg-transparent h-[38px]";
700
636
  }
701
- const xt = {
637
+ const kt = {
702
638
  key: 0,
703
639
  class: "block text-xs font-medium text-gray-600 mb-1"
704
- }, kt = ["placeholder", "disabled"], wt = {
640
+ }, wt = ["placeholder", "disabled"], Ct = {
705
641
  key: 0,
706
642
  class: "block text-xs font-medium text-gray-600 mb-1"
707
- }, Ct = {
643
+ }, Vt = {
708
644
  key: 0,
709
645
  class: "block text-xs font-medium text-gray-600 mb-1"
710
- }, Vt = ["placeholder", "disabled"], _t = ["disabled"];
711
- const $t = /* @__PURE__ */ O({
646
+ }, _t = ["placeholder", "disabled"], $t = ["disabled"];
647
+ const At = /* @__PURE__ */ O({
712
648
  __name: "range-input",
713
649
  props: {
714
650
  id: {},
@@ -734,82 +670,82 @@ const $t = /* @__PURE__ */ O({
734
670
  sort: {}
735
671
  },
736
672
  emits: ["update:modelValue", "change", "clear"],
737
- setup(p, { expose: a, emit: v }) {
738
- const t = Re(), s = bt(), r = p, i = _(
673
+ setup(i, { expose: n, emit: v }) {
674
+ const t = Me(), s = ht(), r = i, d = _(
739
675
  r.modelValue ?? r.default ?? []
740
- ), m = v, d = I({
741
- get: () => r.modelValue ?? i.value,
742
- set: (n) => {
743
- r.modelValue !== void 0 ? m("update:modelValue", n) : i.value = n;
676
+ ), m = v, c = I({
677
+ get: () => r.modelValue ?? d.value,
678
+ set: (a) => {
679
+ r.modelValue !== void 0 ? m("update:modelValue", a) : d.value = a;
744
680
  }
745
681
  });
746
- function h() {
747
- m("change", { name: r.name, value: d.value || i.value });
682
+ function x() {
683
+ m("change", { name: r.name, value: c.value || d.value });
748
684
  }
749
- function f() {
750
- i.value = [], d.value = i.value, m("clear", r.name);
685
+ function p() {
686
+ d.value = [], c.value = d.value, m("clear", r.name);
751
687
  }
752
- return M(() => r.modelValue, (n) => {
753
- n !== void 0 && r.layout !== "popover" ? (i.value = n, m("update:modelValue", n)) : i.value = [];
754
- }), a({
755
- clear: f,
756
- currentValue: d
757
- }), (n, l) => (c(), w(R, null, [
688
+ return M(() => r.modelValue, (a) => {
689
+ a !== void 0 && r.layout !== "popover" ? (d.value = a, m("update:modelValue", a)) : d.value = [];
690
+ }), n({
691
+ clear: p,
692
+ currentValue: c
693
+ }), (a, o) => (f(), w(R, null, [
758
694
  u("div", null, [
759
695
  u("div", {
760
- class: D(n.layout === "vertical" ? "inline-flex items-center gap-2" : "space-y-3 p-2")
696
+ class: D(a.layout === "vertical" ? "inline-flex items-center gap-2" : "space-y-3 p-2")
761
697
  }, [
762
698
  u("div", null, [
763
- n.layout !== "vertical" ? (c(), w("label", xt, "Від")) : V("", !0),
699
+ a.layout !== "vertical" ? (f(), w("label", kt, "Від")) : V("", !0),
764
700
  T(u("input", {
765
701
  type: "number",
766
702
  class: D(e(t)),
767
- placeholder: n.placeHolder?.[0] ?? "min",
703
+ placeholder: a.placeHolder?.[0] ?? "min",
768
704
  step: "1",
769
705
  style: { outline: "none" },
770
- "onUpdate:modelValue": l[0] || (l[0] = (b) => d.value[0] = b),
771
- disabled: n.disabled
772
- }, null, 10, kt), [
773
- [G, d.value[0]]
706
+ "onUpdate:modelValue": o[0] || (o[0] = (h) => c.value[0] = h),
707
+ disabled: a.disabled
708
+ }, null, 10, wt), [
709
+ [G, c.value[0]]
774
710
  ])
775
711
  ]),
776
- n.layout === "vertical" ? (c(), w("label", wt, " - ")) : V("", !0),
712
+ a.layout === "vertical" ? (f(), w("label", Ct, " - ")) : V("", !0),
777
713
  u("div", null, [
778
- n.layout !== "vertical" ? (c(), w("label", Ct, "До")) : V("", !0),
714
+ a.layout !== "vertical" ? (f(), w("label", Vt, "До")) : V("", !0),
779
715
  T(u("input", {
780
716
  type: "number",
781
717
  class: D(e(t)),
782
- placeholder: n.placeHolder?.[1] ?? "max",
718
+ placeholder: a.placeHolder?.[1] ?? "max",
783
719
  min: "0",
784
720
  max: "1000000000000000",
785
721
  step: "1",
786
722
  style: { outline: "none" },
787
- "onUpdate:modelValue": l[1] || (l[1] = (b) => d.value[1] = b),
788
- disabled: n.disabled
789
- }, null, 10, Vt), [
790
- [G, d.value[1]]
723
+ "onUpdate:modelValue": o[1] || (o[1] = (h) => c.value[1] = h),
724
+ disabled: a.disabled
725
+ }, null, 10, _t), [
726
+ [G, c.value[1]]
791
727
  ])
792
728
  ]),
793
- ["popover", "inline", "vertical"].includes(n.layout) ? (c(), w("button", {
729
+ ["popover", "inline", "vertical"].includes(a.layout) ? (f(), w("button", {
794
730
  key: 1,
795
- onClick: h,
796
- class: D(e(s) + (n.layout === "vertical" ? " w-[50px]" : " bg-blue-100 hover:bg-blue-200"))
797
- }, j(n.layout === "vertical" ? "Ok" : "Застосувати"), 3)) : V("", !0),
798
- ["popover", "inline"].includes(n.layout) ? (c(), w("button", {
731
+ onClick: x,
732
+ class: D(e(s) + (a.layout === "vertical" ? " w-[50px]" : " bg-blue-100 hover:bg-blue-200"))
733
+ }, F(a.layout === "vertical" ? "Ok" : "Застосувати"), 3)) : V("", !0),
734
+ ["popover", "inline"].includes(a.layout) ? (f(), w("button", {
799
735
  key: 2,
800
- disabled: !(d.value[0] || d.value[1]),
801
- onClick: f,
736
+ disabled: !(c.value[0] || c.value[1]),
737
+ onClick: p,
802
738
  class: D(e(s) + " hover:bg-gray-100")
803
- }, "Очистити", 10, _t)) : V("", !0)
739
+ }, "Очистити", 10, $t)) : V("", !0)
804
740
  ], 2)
805
741
  ]),
806
- (n.cleanable && i.value.length, V("", !0))
742
+ (a.cleanable && d.value.length, V("", !0))
807
743
  ], 64));
808
744
  }
809
- }), At = ["disabled", "title"], Bt = {
745
+ }), Bt = ["disabled", "title"], St = {
810
746
  key: 0,
811
747
  class: "absolute top-0 end-0 inline-flex min-h-[10px] min-w-[10px] z-10 items-center py-0.5 rounded-full text-xs font-medium transform -translate-y-1/2 translate-x-1/2 bg-blue-600 text-white px-1"
812
- }, St = { class: "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 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" }, Dt = { class: "w-[360px] max-h-[500px] overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 before:w-full p-2" }, ye = /* @__PURE__ */ O({
748
+ }, Dt = { class: "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 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" }, Rt = { class: "w-[360px] max-h-[500px] overflow-auto [&::-webkit-scrollbar]:h-2 [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-track]:bg-stone-100 [&::-webkit-scrollbar-thumb]:bg-stone-300 dark:[&::-webkit-scrollbar-track]:bg-neutral-700 dark:[&::-webkit-scrollbar-thumb]:bg-neutral-500 before:w-full p-2" }, ge = /* @__PURE__ */ O({
813
749
  __name: "popover-field",
814
750
  props: {
815
751
  disabled: { type: Boolean, default: !1 },
@@ -820,71 +756,71 @@ const $t = /* @__PURE__ */ O({
820
756
  mode: {},
821
757
  layout: {}
822
758
  },
823
- setup(p, { expose: a }) {
824
- const v = p, t = I(() => Me(v.mode)), s = _(!1), r = _({ top: 0, left: 0 }), i = _(null), m = _(null), d = _(null);
825
- function h() {
826
- const g = m.value, $ = d.value;
827
- if (!g || !$) return;
828
- const C = g.getBoundingClientRect(), o = $.offsetWidth, x = window.innerWidth, K = C.bottom + 8;
759
+ setup(i, { expose: n }) {
760
+ const v = i, t = I(() => Ke(v.mode)), s = _(!1), r = _({ top: 0, left: 0 }), d = _(null), m = _(null), c = _(null);
761
+ function x() {
762
+ const y = m.value, $ = c.value;
763
+ if (!y || !$) return;
764
+ const C = y.getBoundingClientRect(), l = $.offsetWidth, b = window.innerWidth, K = C.bottom + 8;
829
765
  let { left: A } = C;
830
- A + o > x && (A = Math.max(x - o - 10, 10)), r.value = { top: K, left: A };
766
+ A + l > b && (A = Math.max(b - l - 10, 10)), r.value = { top: K, left: A };
831
767
  }
832
- function f() {
768
+ function p() {
833
769
  s.value = !s.value, s.value && fe(() => {
834
- h(), v.fieldRef?.inputTextRef && v.fieldRef?.inputTextRef.focus();
770
+ x(), v.fieldRef?.inputTextRef && v.fieldRef?.inputTextRef.focus();
835
771
  });
836
772
  }
837
- function n(g) {
838
- !i.value?.contains(g.target) && !d.value?.contains(g.target) && (s.value = !1);
773
+ function a(y) {
774
+ !d.value?.contains(y.target) && !c.value?.contains(y.target) && (s.value = !1);
839
775
  }
840
- function l(g) {
841
- g.key === "Escape" && (s.value = !1);
776
+ function o(y) {
777
+ y.key === "Escape" && (s.value = !1);
842
778
  }
843
- const b = _(!1);
844
- ae(() => {
845
- b.value = !0;
846
- }), ae(() => {
847
- document.addEventListener("click", n, !0), document.addEventListener("keydown", l), window.addEventListener("scroll", h, !0);
779
+ const h = _(!1);
780
+ ne(() => {
781
+ h.value = !0;
782
+ }), ne(() => {
783
+ document.addEventListener("click", a, !0), document.addEventListener("keydown", o), window.addEventListener("scroll", x, !0);
848
784
  }), ce(() => {
849
- document.removeEventListener("click", n, !0), document.removeEventListener("keydown", l), window.removeEventListener("scroll", h, !0);
785
+ document.removeEventListener("click", a, !0), document.removeEventListener("keydown", o), window.removeEventListener("scroll", x, !0);
850
786
  });
851
- function y() {
787
+ function g() {
852
788
  s.value = !1;
853
789
  }
854
- a({ close: y });
790
+ n({ close: g });
855
791
  const k = I(() => {
856
- const g = v.fieldRef?.selectedLabels;
857
- return g ? Array.isArray(g) ? g.length > 0 ? g.join(", ") : v.label ?? "" : String(g) : v.label ?? "";
792
+ const y = v.fieldRef?.selectedLabels;
793
+ return y ? Array.isArray(y) ? y.length > 0 ? y.join(", ") : v.label ?? "" : String(y) : v.label ?? "";
858
794
  });
859
- return (g, $) => (c(), w("div", null, [
795
+ return (y, $) => (f(), w("div", null, [
860
796
  u("button", {
861
- onClick: f,
862
- disabled: g.disabled,
797
+ onClick: p,
798
+ disabled: y.disabled,
863
799
  ref_key: "triggerRef",
864
800
  ref: m,
865
- title: g.label,
866
- class: D(t.value + " " + (g.width ? e(de).getWidthClass(g.width) : "w-full"))
801
+ title: y.label,
802
+ class: D(t.value + " " + (y.width ? e(de).getWidthClass(y.width) : "w-full"))
867
803
  }, [
868
804
  u("span", {
869
- class: D(["truncate text-ellipsis block", g.width ? e(de).getWidthClass(g.width - 50) : "w-full"])
870
- }, j(k.value), 3),
805
+ class: D(["truncate text-ellipsis block", y.width ? e(de).getWidthClass(y.width - 50) : "w-full"])
806
+ }, F(k.value), 3),
871
807
  N(ie, { class: "h-4 w-4" }),
872
- (Array.isArray(g.currentValue) ? g.currentValue === null || g.currentValue.length > 0 : g.currentValue === null || g.currentValue) && g.layout === "inline" ? (c(), w("span", Bt)) : V("", !0)
873
- ], 10, At),
874
- b.value ? (c(), S(_e, {
808
+ (Array.isArray(y.currentValue) ? y.currentValue === null || y.currentValue.length > 0 : y.currentValue === null || y.currentValue) && y.layout === "inline" ? (f(), w("span", St)) : V("", !0)
809
+ ], 10, Bt),
810
+ h.value ? (f(), S($e, {
875
811
  key: 0,
876
812
  to: "body"
877
813
  }, [
878
814
  T(u("div", {
879
815
  ref_key: "popperRef",
880
- ref: d,
816
+ ref: c,
881
817
  class: "vsTailwind vs-popover__content bottom-right w-fit fixed z-[1000]",
882
- style: $e({ top: `${r.value.top}px`, left: `${r.value.left}px` }),
818
+ style: Ae({ top: `${r.value.top}px`, left: `${r.value.left}px` }),
883
819
  "data-inside-popover": ""
884
820
  }, [
885
- u("div", St, [
886
- u("div", Dt, [
887
- ue(g.$slots, "default")
821
+ u("div", Dt, [
822
+ u("div", Rt, [
823
+ ue(y.$slots, "default")
888
824
  ])
889
825
  ])
890
826
  ], 4), [
@@ -894,96 +830,96 @@ const $t = /* @__PURE__ */ O({
894
830
  ]));
895
831
  }
896
832
  });
897
- function Rt(p) {
898
- return String(p).charAt(0).toUpperCase() + String(p).slice(1);
833
+ function Mt(i) {
834
+ return String(i).charAt(0).toUpperCase() + String(i).slice(1);
899
835
  }
900
836
  class H {
901
- static format(a) {
902
- const v = a.getFullYear(), t = (a.getMonth() + 1).toString().padStart(2, "0"), s = a.getDate().toString().padStart(2, "0");
837
+ static format(n) {
838
+ const v = n.getFullYear(), t = (n.getMonth() + 1).toString().padStart(2, "0"), s = n.getDate().toString().padStart(2, "0");
903
839
  return `${v}-${t}-${s}`;
904
840
  }
905
- static getShiftedDay(a, v = 0) {
906
- const t = a ? new Date(a) : /* @__PURE__ */ new Date();
841
+ static getShiftedDay(n, v = 0) {
842
+ const t = n ? new Date(n) : /* @__PURE__ */ new Date();
907
843
  return t.setDate(t.getDate() + v), this.format(t);
908
844
  }
909
- static getLastWeekRange(a, v, t = 0) {
910
- if (a && v) {
911
- const h = new Date(a), f = new Date(v);
912
- return h.setDate(h.getDate() + t * 7), f.setDate(f.getDate() + t * 7), [this.format(h), this.format(f)];
845
+ static getLastWeekRange(n, v, t = 0) {
846
+ if (n && v) {
847
+ const x = new Date(n), p = new Date(v);
848
+ return x.setDate(x.getDate() + t * 7), p.setDate(p.getDate() + t * 7), [this.format(x), this.format(p)];
913
849
  }
914
- const s = /* @__PURE__ */ new Date(), r = s.getDay(), i = r === 0 ? 13 : r - 1 + 7, m = new Date(s);
915
- m.setDate(s.getDate() - i + t * 7);
916
- const d = new Date(m);
917
- return d.setDate(m.getDate() + 6), [this.format(m), this.format(d)];
850
+ const s = /* @__PURE__ */ new Date(), r = s.getDay(), d = r === 0 ? 13 : r - 1 + 7, m = new Date(s);
851
+ m.setDate(s.getDate() - d + t * 7);
852
+ const c = new Date(m);
853
+ return c.setDate(m.getDate() + 6), [this.format(m), this.format(c)];
918
854
  }
919
- static getMonthRange(a, v, t = 0) {
855
+ static getMonthRange(n, v, t = 0) {
920
856
  let s;
921
- a ? s = new Date(a) : s = /* @__PURE__ */ new Date(), s = new Date(s.getFullYear(), s.getMonth() + t, 1);
922
- const r = s, i = new Date(s.getFullYear(), s.getMonth() + 1, 0);
923
- return [this.format(r), this.format(i)];
924
- }
925
- static getQuarterRange(a, v, t = 0) {
926
- const s = a || v, r = s ? new Date(s) : /* @__PURE__ */ new Date();
927
- let i = Math.floor(r.getMonth() / 3);
928
- i += t;
929
- const m = (i % 4 + 4) % 4 * 3, d = r.getFullYear() + Math.floor(i / 4), h = new Date(d, m, 1), f = new Date(d, m + 3, 0);
930
- return [this.format(h), this.format(f)];
931
- }
932
- static getYear(a, v = 0) {
857
+ n ? s = new Date(n) : s = /* @__PURE__ */ new Date(), s = new Date(s.getFullYear(), s.getMonth() + t, 1);
858
+ const r = s, d = new Date(s.getFullYear(), s.getMonth() + 1, 0);
859
+ return [this.format(r), this.format(d)];
860
+ }
861
+ static getQuarterRange(n, v, t = 0) {
862
+ const s = n || v, r = s ? new Date(s) : /* @__PURE__ */ new Date();
863
+ let d = Math.floor(r.getMonth() / 3);
864
+ d += t;
865
+ const m = (d % 4 + 4) % 4 * 3, c = r.getFullYear() + Math.floor(d / 4), x = new Date(c, m, 1), p = new Date(c, m + 3, 0);
866
+ return [this.format(x), this.format(p)];
867
+ }
868
+ static getYear(n, v = 0) {
933
869
  let t;
934
- return a && /^\d{4}$/.test(a) ? t = parseInt(a, 10) : a ? t = new Date(a).getFullYear() : t = (/* @__PURE__ */ new Date()).getFullYear(), String(t + v);
870
+ return n && /^\d{4}$/.test(n) ? t = parseInt(n, 10) : n ? t = new Date(n).getFullYear() : t = (/* @__PURE__ */ new Date()).getFullYear(), String(t + v);
935
871
  }
936
- static getYearRange(a, v = 0) {
872
+ static getYearRange(n, v = 0) {
937
873
  let t;
938
- return a && /^\d{4}$/.test(a) ? t = parseInt(a, 10) : a ? t = new Date(a).getFullYear() : t = (/* @__PURE__ */ new Date()).getFullYear(), [
874
+ return n && /^\d{4}$/.test(n) ? t = parseInt(n, 10) : n ? t = new Date(n).getFullYear() : t = (/* @__PURE__ */ new Date()).getFullYear(), [
939
875
  this.format(new Date(t + v, 0, 1)),
940
876
  this.format(new Date(t + v + 1, 0, 0))
941
877
  ];
942
878
  }
943
- static getRangeFromDaysBefore(a) {
879
+ static getRangeFromDaysBefore(n) {
944
880
  const v = /* @__PURE__ */ new Date(), t = new Date(v.getTime());
945
- return t.setDate(v.getDate() - a), [this.format(t), this.format(v)];
881
+ return t.setDate(v.getDate() - n), [this.format(t), this.format(v)];
946
882
  }
947
883
  }
948
- function Ke(p, a) {
884
+ function Fe(i, n) {
949
885
  const {
950
886
  popoverRef: v
951
- } = p, t = _(""), s = _(
952
- p.modelValue ?? p.default ?? []
887
+ } = i, t = _(""), s = _(
888
+ i.modelValue ?? i.default ?? []
953
889
  ), r = _(0);
954
- function i() {
890
+ function d() {
955
891
  const k = H.getRangeFromDaysBefore(r.value);
956
- return s.value = [...k], a("change", { name: p.name, value: s }), a("update:modelValue", s.value), k;
892
+ return s.value = [...k], n("change", { name: i.name, value: s.value }), n("update:modelValue", s.value), k;
957
893
  }
958
894
  function m(k) {
959
895
  t.value = k, v.value?.close();
960
- const g = [];
896
+ const y = [];
961
897
  switch (t.value) {
962
898
  case "today":
963
- g.push(H.getShiftedDay()), g.push(H.getShiftedDay());
899
+ y.push(H.getShiftedDay()), y.push(H.getShiftedDay());
964
900
  break;
965
901
  case "week":
966
- g.push(...H.getLastWeekRange());
902
+ y.push(...H.getLastWeekRange());
967
903
  break;
968
904
  case "month":
969
- g.push(...H.getMonthRange());
905
+ y.push(...H.getMonthRange());
970
906
  break;
971
907
  case "quarter":
972
- g.push(...H.getQuarterRange());
908
+ y.push(...H.getQuarterRange());
973
909
  break;
974
910
  case "year":
975
- g.push(...H.getYearRange());
911
+ y.push(...H.getYearRange());
976
912
  break;
977
913
  case "last_7_days":
978
- r.value = 7, i();
914
+ r.value = 7, d();
979
915
  break;
980
916
  case "range":
981
- r.value = 7, g.push(...i());
917
+ r.value = 7, y.push(...d());
982
918
  break;
983
919
  }
984
- s.value = [...g], a("change", { name: p.name, value: s }), a("update:modelValue", s.value);
920
+ s.value = [...y], n("change", { name: i.name, value: s.value }), n("update:modelValue", s.value);
985
921
  }
986
- function d() {
922
+ function c() {
987
923
  const k = [];
988
924
  switch (t.value) {
989
925
  case "today":
@@ -1002,9 +938,9 @@ function Ke(p, a) {
1002
938
  k.push(...H.getYearRange(s.value[0], 1));
1003
939
  break;
1004
940
  }
1005
- s.value = [...k], a("change", { name: p.name, value: s }), a("update:modelValue", s.value);
941
+ s.value = [...k], n("change", { name: i.name, value: s.value }), n("update:modelValue", s.value);
1006
942
  }
1007
- function h() {
943
+ function x() {
1008
944
  const k = [];
1009
945
  switch (t.value) {
1010
946
  case "today":
@@ -1023,9 +959,9 @@ function Ke(p, a) {
1023
959
  k.push(...H.getYearRange(s.value[0], -1));
1024
960
  break;
1025
961
  }
1026
- s.value = [...k], a("change", { name: p.name, value: s }), a("update:modelValue", s.value);
962
+ s.value = [...k], n("change", { name: i.name, value: s.value }), n("update:modelValue", s.value);
1027
963
  }
1028
- const f = [
964
+ const p = [
1029
965
  "Січень",
1030
966
  "Лютий",
1031
967
  "Березень",
@@ -1039,75 +975,75 @@ function Ke(p, a) {
1039
975
  "Листопад",
1040
976
  "Грудень"
1041
977
  ];
1042
- function n(k) {
1043
- const [g, $, C] = k.split("-");
1044
- return `${C}.${$}.${g}`;
978
+ function a(k) {
979
+ const [y, $, C] = k.split("-");
980
+ return `${C}.${$}.${y}`;
1045
981
  }
1046
- function l(k) {
1047
- const { value: g } = s;
982
+ function o(k) {
983
+ const { value: y } = s;
1048
984
  switch (k) {
1049
985
  case "today":
1050
- return n(g[0]);
986
+ return a(y[0]);
1051
987
  case "range":
1052
988
  return "Період";
1053
989
  case "week":
1054
- return g[0] && g[1] ? `${n(g[0])} – ${n(g[1])}` : "";
990
+ return y[0] && y[1] ? `${a(y[0])} – ${a(y[1])}` : "";
1055
991
  case "quarter":
1056
- if (g[0]) {
1057
- const $ = new Date(g[0]), C = $.getFullYear(), o = $.getMonth();
1058
- return `${Math.floor(o / 3) + 1} квартал ${C}`;
992
+ if (y[0]) {
993
+ const $ = new Date(y[0]), C = $.getFullYear(), l = $.getMonth();
994
+ return `${Math.floor(l / 3) + 1} квартал ${C}`;
1059
995
  }
1060
996
  return "";
1061
997
  case "month":
1062
- if (g[0]) {
1063
- const [$, C] = g[0].split("-");
1064
- return `${f[parseInt(C, 10) - 1]} ${$}`;
998
+ if (y[0]) {
999
+ const [$, C] = y[0].split("-");
1000
+ return `${p[parseInt(C, 10) - 1]} ${$}`;
1065
1001
  }
1066
1002
  return "";
1067
1003
  case "year":
1068
- return g[0] || "";
1004
+ return y[0] || "";
1069
1005
  case "last_7_days":
1070
1006
  return "За останні дні";
1071
1007
  default:
1072
- return p.label ?? "";
1008
+ return i.label ?? "";
1073
1009
  }
1074
1010
  }
1075
- const b = I(() => t.value ? l(t.value) : p.label ?? "");
1076
- function y() {
1077
- t.value = "", s.value = [], a("update:modelValue", []), a("clear", p.name);
1011
+ const h = I(() => t.value ? o(t.value) : i.label ?? "");
1012
+ function g() {
1013
+ t.value = "", s.value = [], n("update:modelValue", []), n("clear", i.name);
1078
1014
  }
1079
1015
  return {
1080
1016
  activeMode: t,
1081
1017
  innerValue: s,
1082
1018
  daysBefore: r,
1083
- onDaysBeforeChange: i,
1019
+ onDaysBeforeChange: d,
1084
1020
  onSelectChange: m,
1085
- nextClick: d,
1086
- prevClick: h,
1087
- ukMonths: f,
1088
- formatDisplayDate: n,
1089
- getModeLabel: l,
1090
- currentLabel: b,
1091
- clear: y
1021
+ nextClick: c,
1022
+ prevClick: x,
1023
+ ukMonths: p,
1024
+ formatDisplayDate: a,
1025
+ getModeLabel: o,
1026
+ currentLabel: h,
1027
+ clear: g
1092
1028
  };
1093
1029
  }
1094
- const Mt = {
1030
+ const Kt = {
1095
1031
  key: 0,
1096
1032
  class: "relative flex w-full h-auto gap-2 filter-date m-2 flex-wrap"
1097
- }, Kt = {
1033
+ }, Ft = {
1098
1034
  key: 0,
1099
1035
  class: "flex gap-1 !w-[75%] rounded-lg"
1100
- }, jt = ["max", "disabled"], Ft = ["min", "disabled"], Lt = {
1036
+ }, jt = ["max", "disabled"], Lt = ["min", "disabled"], Et = {
1101
1037
  key: 0,
1102
1038
  class: "block text-xs font-medium text-gray-600 mb-1"
1103
- }, Et = ["max", "disabled"], It = {
1039
+ }, It = ["max", "disabled"], Tt = {
1104
1040
  key: 0,
1105
1041
  class: "block text-xs font-medium text-gray-600 mb-1"
1106
- }, Tt = {
1042
+ }, Ot = {
1107
1043
  key: 0,
1108
1044
  class: "block text-xs font-medium text-gray-600 mb-1"
1109
- }, Ot = ["min", "disabled"], Ut = { class: "flex gap-1 pt-2" }, zt = ["onClick"];
1110
- const Nt = /* @__PURE__ */ O({
1045
+ }, Ut = ["min", "disabled"], zt = { class: "flex gap-1 pt-2" }, Nt = ["onClick"];
1046
+ const Ht = /* @__PURE__ */ O({
1111
1047
  __name: "date-input",
1112
1048
  props: {
1113
1049
  id: {},
@@ -1133,116 +1069,231 @@ const Nt = /* @__PURE__ */ O({
1133
1069
  sort: {}
1134
1070
  },
1135
1071
  emits: ["update:modelValue", "change", "clear"],
1136
- setup(p, { expose: a, emit: v }) {
1137
- const t = p, s = Re(), r = ht(), i = v, m = _(null), {
1138
- activeMode: d,
1139
- innerValue: h,
1140
- onSelectChange: f,
1141
- nextClick: n,
1142
- prevClick: l,
1143
- clear: b
1144
- } = Ke(
1145
- {
1146
- ...t,
1147
- popoverRef: m
1148
- },
1149
- i
1150
- );
1151
- return M(() => t.modelValue, (y) => {
1152
- y !== void 0 ? (h.value = y, i("update:modelValue", y)) : (d.value = "", h.value = []);
1153
- }), a({
1154
- clear: b,
1072
+ setup(i, { expose: n, emit: v }) {
1073
+ const t = i, s = Me(), r = xt(), d = v, m = _(null), {
1074
+ activeMode: c,
1075
+ innerValue: x,
1076
+ onSelectChange: p,
1077
+ nextClick: a,
1078
+ prevClick: o,
1079
+ clear: h
1080
+ } = Fe({
1081
+ ...t,
1082
+ popoverRef: m
1083
+ }, d);
1084
+ return M(() => t.modelValue, (g) => {
1085
+ g !== void 0 ? (x.value = g, d("update:modelValue", g)) : (c.value = "", x.value = []);
1086
+ }), n({
1087
+ clear: h,
1155
1088
  popoverRef: m
1156
- }), (y, k) => (c(), w(R, null, [
1157
- y.layout === "inline" ? (c(), w("div", Mt, [
1158
- e(d) !== "" && e(d) === "range" ? (c(), w("div", Kt, [
1089
+ }), (g, k) => (f(), w(R, null, [
1090
+ g.layout === "inline" ? (f(), w("div", Kt, [
1091
+ e(c) !== "" && e(c) === "range" ? (f(), w("div", Ft, [
1159
1092
  T(u("input", {
1160
1093
  type: "date",
1161
- max: e(h)[1],
1094
+ max: e(x)[1],
1162
1095
  locale: "uk-UA",
1163
- "onUpdate:modelValue": k[0] || (k[0] = (g) => e(h)[0] = g),
1096
+ "onUpdate:modelValue": k[0] || (k[0] = (y) => e(x)[0] = y),
1164
1097
  class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600",
1165
- disabled: y.disabled
1098
+ disabled: g.disabled
1166
1099
  }, null, 8, jt), [
1167
- [G, e(h)[0]]
1100
+ [G, e(x)[0]]
1168
1101
  ]),
1169
1102
  T(u("input", {
1170
1103
  type: "date",
1171
- min: e(h)[0],
1104
+ min: e(x)[0],
1172
1105
  locale: "uk-UA",
1173
- "onUpdate:modelValue": k[1] || (k[1] = (g) => e(h)[1] = g),
1106
+ "onUpdate:modelValue": k[1] || (k[1] = (y) => e(x)[1] = y),
1174
1107
  class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600 appearance-auto",
1175
- disabled: y.disabled
1176
- }, null, 8, Ft), [
1177
- [G, e(h)[1]]
1108
+ disabled: g.disabled
1109
+ }, null, 8, Lt), [
1110
+ [G, e(x)[1]]
1178
1111
  ])
1179
1112
  ])) : V("", !0)
1180
1113
  ])) : V("", !0),
1181
1114
  u("div", {
1182
- class: D(y.layout === "popover" ? "space-y-3 p-2" : "flex items-center gap-2")
1115
+ class: D(g.layout === "popover" ? "space-y-3 p-2" : "flex items-center gap-2")
1183
1116
  }, [
1184
1117
  u("div", {
1185
- class: D(y.layout !== "popover" ? "w-[48%]" : "")
1118
+ class: D(g.layout !== "popover" ? "w-[48%]" : "")
1186
1119
  }, [
1187
- y.layout === "popover" ? (c(), w("label", Lt, "Від")) : V("", !0),
1120
+ g.layout === "popover" ? (f(), w("label", Et, "Від")) : V("", !0),
1188
1121
  T(u("input", {
1189
1122
  type: "date",
1190
- max: e(h)[1],
1123
+ max: e(x)[1],
1191
1124
  locale: "uk-UA",
1192
- "onUpdate:modelValue": k[2] || (k[2] = (g) => e(h)[0] = g),
1125
+ "onUpdate:modelValue": k[2] || (k[2] = (y) => e(x)[0] = y),
1193
1126
  class: D(e(s)),
1194
- disabled: y.disabled
1195
- }, null, 10, Et), [
1196
- [G, e(h)[0]]
1127
+ disabled: g.disabled
1128
+ }, null, 10, It), [
1129
+ [G, e(x)[0]]
1197
1130
  ])
1198
1131
  ], 2),
1199
- y.layout !== "popover" ? (c(), w("label", It, " - ")) : V("", !0),
1132
+ g.layout !== "popover" ? (f(), w("label", Tt, " - ")) : V("", !0),
1200
1133
  u("div", {
1201
- class: D(y.layout !== "popover" ? "w-[48%]" : "")
1134
+ class: D(g.layout !== "popover" ? "w-[48%]" : "")
1202
1135
  }, [
1203
- y.layout === "popover" ? (c(), w("label", Tt, "До")) : V("", !0),
1136
+ g.layout === "popover" ? (f(), w("label", Ot, "До")) : V("", !0),
1204
1137
  T(u("input", {
1205
1138
  type: "date",
1206
- min: e(h)[0],
1139
+ min: e(x)[0],
1207
1140
  locale: "uk-UA",
1208
- "onUpdate:modelValue": k[3] || (k[3] = (g) => e(h)[1] = g),
1141
+ "onUpdate:modelValue": k[3] || (k[3] = (y) => e(x)[1] = y),
1209
1142
  class: D(e(s)),
1210
- disabled: y.disabled
1211
- }, null, 10, Ot), [
1212
- [G, e(h)[1]]
1143
+ disabled: g.disabled
1144
+ }, null, 10, Ut), [
1145
+ [G, e(x)[1]]
1213
1146
  ])
1214
1147
  ], 2)
1215
1148
  ], 2),
1216
- u("div", Ut, [
1217
- (c(), w(R, null, W(["today", "week", "month", "quarter", "year"], (g) => u("button", {
1218
- key: g,
1219
- class: D(e(r) + (e(d) === g ? " bg-blue-100" : "")),
1220
- onClick: ($) => e(f)(g)
1221
- }, j(e(Rt)(g)), 11, zt)), 64)),
1149
+ u("div", zt, [
1150
+ (f(), w(R, null, W(["today", "week", "month", "quarter", "year"], (y) => u("button", {
1151
+ key: y,
1152
+ class: D(e(r) + (e(c) === y ? " bg-blue-100" : "")),
1153
+ onClick: ($) => e(p)(y)
1154
+ }, F(e(Mt)(y)), 11, Nt)), 64)),
1222
1155
  u("button", {
1223
1156
  class: D(e(r)),
1224
1157
  onClick: k[4] || (k[4] = //@ts-ignore
1225
- (...g) => e(l) && e(l)(...g))
1158
+ (...y) => e(o) && e(o)(...y))
1226
1159
  }, " <", 2),
1227
1160
  u("button", {
1228
1161
  class: D(e(r)),
1229
1162
  onClick: k[5] || (k[5] = //@ts-ignore
1230
- (...g) => e(n) && e(n)(...g))
1163
+ (...y) => e(a) && e(a)(...y))
1231
1164
  }, " >", 2)
1232
1165
  ]),
1233
- (y.cleanable, V("", !0))
1166
+ (g.cleanable, V("", !0))
1234
1167
  ], 64));
1235
1168
  }
1236
- }), Ht = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relative justify-center" }, Yt = {
1169
+ });
1170
+ function Yt(i, n) {
1171
+ const {
1172
+ api: v,
1173
+ options: t = [],
1174
+ limit: s = 20,
1175
+ dataKey: r = "data"
1176
+ } = i, d = i.multi;
1177
+ function m(B) {
1178
+ return d ? Array.isArray(B) ? B : B ? [B] : [] : Array.isArray(B) ? B[0] : B;
1179
+ }
1180
+ const c = _(m(i.modelValue)), x = _(""), p = _(!1), a = _([]), o = _("id"), h = _("text"), g = _(!1), k = _(i.layout !== "popover" && t.length > s), y = _([]), $ = _(0);
1181
+ function C(B) {
1182
+ const U = B.find(Boolean) ?? {}, q = ["id", "value", "code", "key"].find((oe) => oe in U) ?? "id", se = ["text", "label", "name", "title"].find((oe) => oe in U) ?? "text";
1183
+ return { autoValueKey: q, autoLabelKey: se };
1184
+ }
1185
+ if (t.length > 0) {
1186
+ const B = C(t);
1187
+ o.value = B.autoValueKey, h.value = B.autoLabelKey;
1188
+ }
1189
+ const l = I(() => {
1190
+ if (v) return a.value;
1191
+ const B = a.value;
1192
+ if (i.layout === "popover") return B;
1193
+ if (!x.value)
1194
+ return g.value ? B : B.slice(0, s);
1195
+ const U = x.value.toLowerCase();
1196
+ return B.filter((q) => q[h.value].toLowerCase().includes(U));
1197
+ });
1198
+ let b = null;
1199
+ async function K(B) {
1200
+ if (v) {
1201
+ p.value = !0;
1202
+ try {
1203
+ const U = new URL(v, window.location.origin);
1204
+ U.searchParams.set("json", "1"), U.searchParams.set("key", B), U.searchParams.set("limit", s.toString());
1205
+ const q = await fetch(U.toString());
1206
+ if (!q.ok)
1207
+ throw new Error(`HTTP error! status: ${q.status}`);
1208
+ const se = await q.json();
1209
+ if (a.value = se[r], a.value.length > 0) {
1210
+ const oe = C(a.value);
1211
+ o.value = oe.autoValueKey, h.value = oe.autoLabelKey;
1212
+ }
1213
+ $.value = se.total;
1214
+ } catch (U) {
1215
+ console.error("Failed to fetch remote options:", U);
1216
+ } finally {
1217
+ p.value = !1;
1218
+ }
1219
+ }
1220
+ }
1221
+ M(x, (B) => {
1222
+ v && (b && clearTimeout(b), b = setTimeout(() => {
1223
+ K(B);
1224
+ }, 200));
1225
+ }), M(() => i.modelValue, (B) => {
1226
+ c.value = m(B);
1227
+ }, { immediate: !0 }), v ? K("") : a.value = t;
1228
+ function A(B) {
1229
+ return d && Array.isArray(c.value) ? c.value.includes(B[o.value]) : c.value && c.value === B[o.value];
1230
+ }
1231
+ function Y(B) {
1232
+ if (d && !Array.isArray(c.value) && (c.value = []), d && Array.isArray(c.value)) {
1233
+ const U = c.value.includes(B[o.value]);
1234
+ c.value = U ? c.value.filter((q) => q !== B[o.value]) : [...c.value, B[o.value]], y.value = U ? y.value.filter((q) => q !== B[h.value]) : [...y.value, B[h.value]];
1235
+ } else
1236
+ c.value = B[o.value], y.value = B[h.value];
1237
+ n("update:modelValue", c.value), n("change", { name: i.name, value: c.value });
1238
+ }
1239
+ function L() {
1240
+ d ? (c.value = [], y.value = []) : (c.value = void 0, y.value = []), n("update:modelValue", c.value), n("clear", i.name);
1241
+ }
1242
+ function j() {
1243
+ b && clearTimeout(b), x.value = "", g.value = !1;
1244
+ }
1245
+ function E() {
1246
+ g.value = !g.value;
1247
+ }
1248
+ ce(() => {
1249
+ b && clearTimeout(b);
1250
+ });
1251
+ const Q = _(-1);
1252
+ M(l, () => {
1253
+ Q.value = l.value.length > 0 ? 0 : -1;
1254
+ });
1255
+ function re(B) {
1256
+ const U = l.value.length;
1257
+ if (B.key === "ArrowDown")
1258
+ B.preventDefault(), Q.value = (Q.value + 1) % U;
1259
+ else if (B.key === "ArrowUp")
1260
+ B.preventDefault(), Q.value = (Q.value - 1 + U) % U;
1261
+ else if (B.key === "Enter" && (B.preventDefault(), Q.value >= 0 && Q.value < l.value.length)) {
1262
+ const q = l.value[Q.value];
1263
+ Y(q);
1264
+ }
1265
+ }
1266
+ return {
1267
+ innerValue: c,
1268
+ searchTerm: x,
1269
+ filteredOptions: l,
1270
+ isSelected: A,
1271
+ selectItem: Y,
1272
+ clear: L,
1273
+ resetSearch: j,
1274
+ toggleShowAll: E,
1275
+ isReqProc: p,
1276
+ showAll: g,
1277
+ isEnableShowAll: k,
1278
+ labelKey: h,
1279
+ valueKey: o,
1280
+ allOptions: a,
1281
+ highlightedIndex: Q,
1282
+ onKeyDown: re,
1283
+ selectedLabels: y,
1284
+ totalCount: $
1285
+ };
1286
+ }
1287
+ const Pt = { class: "h-[45px] shrink-0 px-[6px] py-[4px] flex items-center relative justify-center" }, Wt = {
1237
1288
  key: 0,
1238
1289
  class: "w-full"
1239
- }, Pt = { class: "flex flex-col items-center justify-center p-5 text-center" }, Wt = {
1290
+ }, qt = { class: "flex flex-col items-center justify-center p-5 text-center" }, Qt = {
1240
1291
  key: 0,
1241
1292
  class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
1242
- }, qt = {
1293
+ }, Gt = {
1243
1294
  key: 1,
1244
1295
  class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
1245
- }, Qt = /* @__PURE__ */ O({
1296
+ }, Xt = /* @__PURE__ */ O({
1246
1297
  __name: "select",
1247
1298
  props: {
1248
1299
  id: {},
@@ -1268,68 +1319,68 @@ const Nt = /* @__PURE__ */ O({
1268
1319
  sort: {}
1269
1320
  },
1270
1321
  emits: ["update:modelValue", "change", "clear"],
1271
- setup(p, { expose: a, emit: v }) {
1272
- const t = p, s = v, r = _(null), {
1273
- innerValue: i,
1322
+ setup(i, { expose: n, emit: v }) {
1323
+ const t = i, s = v, r = _(null), {
1324
+ innerValue: d,
1274
1325
  filteredOptions: m,
1275
- isSelected: d,
1276
- selectItem: h,
1277
- clear: f,
1278
- resetSearch: n,
1279
- toggleShowAll: l,
1280
- isReqProc: b,
1281
- showAll: y,
1326
+ isSelected: c,
1327
+ selectItem: x,
1328
+ clear: p,
1329
+ resetSearch: a,
1330
+ toggleShowAll: o,
1331
+ isReqProc: h,
1332
+ showAll: g,
1282
1333
  isEnableShowAll: k,
1283
- searchTerm: g,
1334
+ searchTerm: y,
1284
1335
  labelKey: $,
1285
1336
  valueKey: C,
1286
- highlightedIndex: o,
1287
- onKeyDown: x,
1337
+ highlightedIndex: l,
1338
+ onKeyDown: b,
1288
1339
  selectedLabels: K,
1289
1340
  totalCount: A
1290
- } = Be({
1341
+ } = Yt({
1291
1342
  ...t,
1292
1343
  modelValue: t.modelValue
1293
1344
  }, s);
1294
- ae(() => {
1295
- n();
1345
+ ne(() => {
1346
+ a();
1296
1347
  }), M(
1297
1348
  () => t.modelValue,
1298
1349
  (L) => {
1299
- L === void 0 && (t.multi ? i.value = [] : i.value = void 0);
1350
+ L === void 0 && (t.multi ? d.value = [] : d.value = void 0);
1300
1351
  }
1301
1352
  );
1302
1353
  const Y = _([]);
1303
- return M(o, (L) => {
1354
+ return M(l, (L) => {
1304
1355
  L >= 0 && Y.value[L] && Y.value[L]?.scrollIntoView({
1305
1356
  block: "nearest",
1306
1357
  behavior: "smooth"
1307
1358
  });
1308
1359
  }), M(m, () => {
1309
1360
  Y.value = [];
1310
- }), a({
1311
- clear: f,
1361
+ }), n({
1362
+ clear: p,
1312
1363
  inputTextRef: r,
1313
1364
  selectedLabels: K
1314
- }), (L, F) => (c(), w("div", {
1365
+ }), (L, j) => (f(), w("div", {
1315
1366
  class: D([L.layout === "popover" ? "flex flex-col h-full" : "flex flex-col vs-filter-checkbox space-y-0.5"])
1316
1367
  }, [
1317
- u("div", Ht, [
1368
+ u("div", Pt, [
1318
1369
  T(u("input", {
1319
- "onUpdate:modelValue": F[0] || (F[0] = (E) => Le(g) ? g.value = E : null),
1320
- onKeydown: F[1] || (F[1] = //@ts-ignore
1321
- (...E) => e(x) && e(x)(...E)),
1370
+ "onUpdate:modelValue": j[0] || (j[0] = (E) => Ee(y) ? y.value = E : null),
1371
+ onKeydown: j[1] || (j[1] = //@ts-ignore
1372
+ (...E) => e(b) && e(b)(...E)),
1322
1373
  class: "w-full h-full text-[13px] px-4 border rounded-sm pl-9 focus:outline-none focus:ring-ring focus:ring-1 focus:ring-blue-500",
1323
1374
  placeholder: "Пошук",
1324
1375
  type: "text",
1325
1376
  ref_key: "inputTextRef",
1326
1377
  ref: r
1327
1378
  }, null, 544), [
1328
- [G, e(g)]
1379
+ [G, e(y)]
1329
1380
  ]),
1330
- N(Se, { class: "absolute text-gray-400 -translate-y-1/2 left-4 top-1/2" }),
1331
- N(De, {
1332
- onClick: F[2] || (F[2] = (E) => g.value = ""),
1381
+ N(De, { class: "absolute text-gray-400 -translate-y-1/2 left-4 top-1/2" }),
1382
+ N(Re, {
1383
+ onClick: j[2] || (j[2] = (E) => y.value = ""),
1333
1384
  class: "absolute text-gray-400 -translate-y-1/2 cursor-pointer hover:text-red-500 right-4 top-1/2"
1334
1385
  })
1335
1386
  ]),
@@ -1339,134 +1390,80 @@ const Nt = /* @__PURE__ */ O({
1339
1390
  L.layout === "inline" ? "flex-1 overflow-y-auto max-h-80" : ""
1340
1391
  ])
1341
1392
  }, [
1342
- (c(!0), w(R, null, W(e(m), (E, Q) => (c(), S(me, {
1393
+ (f(!0), w(R, null, W(e(m), (E, Q) => (f(), S(me, {
1343
1394
  layout: L.layout,
1344
1395
  count: E.count,
1345
1396
  label: E[e($)],
1346
1397
  color: E.color,
1347
1398
  type: L.multi ? "checkbox" : "radio",
1348
1399
  value: E[e(C)],
1349
- "is-selected": e(d)(E),
1350
- highlighted: Q === e(o),
1351
- onItemClick: (re) => e(h)(E),
1400
+ "is-selected": e(c)(E),
1401
+ highlighted: Q === e(l),
1402
+ onItemClick: (re) => e(x)(E),
1352
1403
  ref_for: !0,
1353
1404
  ref: (re) => Y.value[Q] = re?.el
1354
1405
  }, null, 8, ["layout", "count", "label", "color", "type", "value", "is-selected", "highlighted", "onItemClick"]))), 256))
1355
1406
  ], 2),
1356
- L.type === "select" && e(m).length === 0 && !e(b) ? (c(), w("div", Yt, [
1357
- u("div", Pt, [
1407
+ L.type === "select" && e(m).length === 0 && !e(h) ? (f(), w("div", Wt, [
1408
+ u("div", qt, [
1358
1409
  N(ve),
1359
- F[7] || (F[7] = u("div", { class: "max-w-sm mx-auto mt-6" }, [
1410
+ j[7] || (j[7] = u("div", { class: "max-w-sm mx-auto mt-6" }, [
1360
1411
  u("p", { class: "font-medium text-gray-800 dark:text-neutral-200" }, "За вашим запитом нічого не знайдено"),
1361
1412
  u("p", { class: "mt-2 text-sm text-gray-500 dark:text-neutral-500" })
1362
1413
  ], -1))
1363
1414
  ])
1364
1415
  ])) : V("", !0),
1365
- L.layout !== "popover" && L.type !== "select" ? (c(), w(R, { key: 1 }, [
1366
- !e(y) && e(k) ? (c(), w("div", {
1416
+ L.layout !== "popover" && L.type !== "select" ? (f(), w(R, { key: 1 }, [
1417
+ !e(g) && e(k) ? (f(), w("div", {
1367
1418
  key: 0,
1368
- onClick: F[3] || (F[3] = //@ts-ignore
1369
- (...E) => e(l) && e(l)(...E)),
1419
+ onClick: j[3] || (j[3] = //@ts-ignore
1420
+ (...E) => e(o) && e(o)(...E)),
1370
1421
  class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
1371
1422
  }, [
1372
- F[8] || (F[8] = z(" Показати більше ", -1)),
1423
+ j[8] || (j[8] = z(" Показати більше ")),
1373
1424
  N(ie)
1374
1425
  ])) : V("", !0),
1375
- e(y) ? (c(), w("div", {
1426
+ e(g) ? (f(), w("div", {
1376
1427
  key: 1,
1377
- onClick: F[4] || (F[4] = //@ts-ignore
1378
- (...E) => e(l) && e(l)(...E)),
1428
+ onClick: j[4] || (j[4] = //@ts-ignore
1429
+ (...E) => e(o) && e(o)(...E)),
1379
1430
  class: "inline-flex cursor-pointer items-center gap-x-1.5 text-[13px] text-gray-800 underline underline-offset-4 hover:text-blue-600 focus:outline-none focus:text-blue-600 mt-1 px-2"
1380
1431
  }, [
1381
- F[9] || (F[9] = z(" Показати менше ", -1)),
1382
- N(ge)
1432
+ j[9] || (j[9] = z(" Показати менше ")),
1433
+ N(ye)
1383
1434
  ])) : V("", !0)
1384
1435
  ], 64)) : V("", !0),
1385
- L.cleanable ? (c(), w(R, { key: 2 }, [
1386
- L.layout === "inline" ? (c(), w("div", Wt, [
1387
- z(j(L.multi && Array.isArray(e(i)) ? e(i)?.length : e(i) !== void 0 && (e(i) || e(i) === null) ? 1 : 0) + " з " + j(e(A)) + " обрано ", 1),
1436
+ L.cleanable ? (f(), w(R, { key: 2 }, [
1437
+ L.layout === "inline" ? (f(), w("div", Qt, [
1438
+ z(F(L.multi && Array.isArray(e(d)) ? e(d)?.length : e(d) !== void 0 && (e(d) || e(d) === null) ? 1 : 0) + " з " + F(e(A)) + " обрано ", 1),
1388
1439
  T(u("button", {
1389
1440
  class: "text-gray-600 hover:text-gray-800",
1390
- onClick: F[5] || (F[5] = //@ts-ignore
1391
- (...E) => e(f) && e(f)(...E))
1441
+ onClick: j[5] || (j[5] = //@ts-ignore
1442
+ (...E) => e(p) && e(p)(...E))
1392
1443
  }, " Очистити ", 512), [
1393
- [X, e(i) !== "" && e(i) !== void 0 || e(i)]
1444
+ [X, e(d) !== "" && e(d) !== void 0 || e(d)]
1394
1445
  ])
1395
1446
  ])) : V("", !0),
1396
- L.layout === "popover" ? (c(), w("div", qt, [
1397
- u("span", null, j(L.multi && Array.isArray(e(i)) ? e(i)?.length : e(i) !== void 0 && (e(i) || e(i) === null) ? 1 : 0) + " з " + j(e(A)) + " обрано", 1),
1447
+ L.layout === "popover" ? (f(), w("div", Gt, [
1448
+ u("span", null, F(L.multi && Array.isArray(e(d)) ? e(d)?.length : e(d) !== void 0 && (e(d) || e(d) === null) ? 1 : 0) + " з " + F(e(A)) + " обрано", 1),
1398
1449
  T(u("button", {
1399
1450
  class: "text-gray-600 hover:text-gray-800",
1400
- onClick: F[6] || (F[6] = //@ts-ignore
1401
- (...E) => e(f) && e(f)(...E))
1451
+ onClick: j[6] || (j[6] = //@ts-ignore
1452
+ (...E) => e(p) && e(p)(...E))
1402
1453
  }, " Очистити ", 512), [
1403
- [X, e(i) !== "" && e(i) !== void 0 || e(i)]
1454
+ [X, e(d) !== "" && e(d) !== void 0 || e(d)]
1404
1455
  ])
1405
1456
  ])) : V("", !0)
1406
1457
  ], 64)) : V("", !0)
1407
1458
  ], 2));
1408
1459
  }
1409
- });
1410
- function Gt(p, a) {
1411
- const {
1412
- options: v = [],
1413
- limit: t = 20
1414
- } = p;
1415
- function s(o) {
1416
- return Array.isArray(o) ? o : o ? [o] : [];
1417
- }
1418
- const r = _(s(p.modelValue)), i = _(""), m = _(!1), d = _([]), h = _("id"), f = _("text"), n = _(!1), l = _(p.layout !== "popover" && v.length > t);
1419
- function b(o) {
1420
- const x = o.find(Boolean) ?? {}, K = ["id", "value", "code", "key"].find((Y) => Y in x) ?? "id", A = ["text", "label", "name", "title"].find((Y) => Y in x) ?? "text";
1421
- return { autoValueKey: K, autoLabelKey: A };
1422
- }
1423
- if (v.length > 0) {
1424
- const o = b(v);
1425
- h.value = o.autoValueKey, f.value = o.autoLabelKey;
1426
- }
1427
- const y = I(() => {
1428
- const o = d.value;
1429
- return p.layout === "popover" || n.value ? o : o.slice(0, t);
1430
- });
1431
- M(() => p.modelValue, (o) => {
1432
- r.value = s(o);
1433
- }, { immediate: !0 }), d.value = [...v].sort((o, x) => p.sort === "count" ? x.count && o.count ? x.count - o.count : 0 : p.sort === "name" ? String(o[f.value]).localeCompare(String(x[f.value])) : 0);
1434
- function k(o) {
1435
- return r.value && r.value.includes(o[h.value]);
1436
- }
1437
- function g(o) {
1438
- const x = r.value.includes(o[h.value]);
1439
- r.value = x ? r.value.filter((K) => K !== o[h.value]) : [...r.value, o[h.value]], a("update:modelValue", r.value), a("change", { name: p.name, value: r.value });
1440
- }
1441
- function $() {
1442
- r.value = [], a("update:modelValue", r.value), a("clear", p.name);
1443
- }
1444
- function C() {
1445
- n.value = !n.value;
1446
- }
1447
- return {
1448
- innerValue: r,
1449
- searchTerm: i,
1450
- filteredOptions: y,
1451
- isSelected: k,
1452
- selectItem: g,
1453
- clear: $,
1454
- toggleShowAll: C,
1455
- isReqProc: m,
1456
- showAll: n,
1457
- isEnableShowAll: l,
1458
- labelKey: f,
1459
- valueKey: h,
1460
- allOptions: d
1461
- };
1462
- }
1463
- const Xt = ["for", "onClick"], Jt = ["id", "name", "value"], Zt = { class: "block" }, el = {
1460
+ }), Jt = ["for", "onClick"], Zt = ["id", "name", "value"], el = { class: "block" }, tl = {
1464
1461
  key: 0,
1465
1462
  class: "flex justify-between p-2 border-t bg-gray-50 text-xs text-gray-500"
1466
- }, tl = {
1463
+ }, ll = {
1467
1464
  key: 1,
1468
1465
  class: "flex justify-between items-center text-xs text-gray-500 p-1 border-t"
1469
- }, ll = /* @__PURE__ */ O({
1466
+ }, ol = /* @__PURE__ */ O({
1470
1467
  __name: "tag-field",
1471
1468
  props: {
1472
1469
  id: {},
@@ -1492,66 +1489,66 @@ const Xt = ["for", "onClick"], Jt = ["id", "name", "value"], Zt = { class: "bloc
1492
1489
  sort: {}
1493
1490
  },
1494
1491
  emits: ["update:modelValue", "change", "clear"],
1495
- setup(p, { expose: a, emit: v }) {
1496
- const t = p, s = v, {
1492
+ setup(i, { expose: n, emit: v }) {
1493
+ const t = i, s = v, {
1497
1494
  innerValue: r,
1498
- isSelected: i,
1495
+ isSelected: d,
1499
1496
  selectItem: m,
1500
- clear: d,
1501
- labelKey: h,
1502
- valueKey: f,
1503
- allOptions: n
1504
- } = t.multi ? Gt({
1497
+ clear: c,
1498
+ labelKey: x,
1499
+ valueKey: p,
1500
+ allOptions: a
1501
+ } = t.multi ? Se({
1505
1502
  ...t,
1506
1503
  modelValue: t.modelValue ?? t.default ?? []
1507
- }, s) : Ae({
1504
+ }, s) : Be({
1508
1505
  ...t,
1509
1506
  modelValue: t.modelValue !== void 0 ? t.modelValue : t.default ?? ""
1510
1507
  }, s);
1511
- return a({
1512
- clear: d
1508
+ return n({
1509
+ clear: c
1513
1510
  }), M(
1514
1511
  () => t.modelValue,
1515
- (l) => {
1516
- l === void 0 && (t.multi ? r.value = [] : r.value = void 0);
1512
+ (o) => {
1513
+ o === void 0 && (t.multi ? r.value = [] : r.value = void 0);
1517
1514
  }
1518
- ), (l, b) => (c(), w(R, null, [
1515
+ ), (o, h) => (f(), w(R, null, [
1519
1516
  u("div", {
1520
- class: D(["grid grid-cols-3 gap-2 mx-[1px]", l.layout === "popover" ? "m-1" : "mb-1"])
1517
+ class: D(["grid grid-cols-3 gap-2 mx-[1px]", o.layout === "popover" ? "m-1" : "mb-1"])
1521
1518
  }, [
1522
- (c(!0), w(R, null, W(e(n), (y) => (c(), w("label", {
1523
- key: `item-${y[e(f)]}`,
1524
- for: `item-${y[e(f)]}`,
1525
- onClick: Ve((k) => e(m)(y), ["stop", "prevent"]),
1526
- class: D([e(i)(y) ? "ring-2 ring-indigo-600" : "", "p-2.5 group relative flex justify-center items-center gap-x-12 text-center text-xs bg-white text-gray-800 border border-gray-200 cursor-pointer rounded-lg dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-200 peer-checked:text-indigo-600 dark:has-checked:text-indigo-500 peer-checked:border-indigo-600 dark:has-checked:border-indigo-500 peer-checked:ring peer-checked:shadow focus:ring dark:has-checked:ring-indigo-500 has-disabled:pointer-events-none has-disabled:text-gray-200 dark:has-disabled:text-neutral-700 has-disabled:after:absolute has-disabled:after:inset-0 has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-gray-200)_calc(50%-1px),var(--color-gray-200)_50%,transparent_50%)] dark:has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-neutral-700)_calc(50%-1px),var(--color-neutral-700)_50%,transparent_50%)]"])
1519
+ (f(!0), w(R, null, W(e(a), (g) => (f(), w("label", {
1520
+ key: `item-${g[e(p)]}`,
1521
+ for: `item-${g[e(p)]}`,
1522
+ onClick: _e((k) => e(m)(g), ["stop", "prevent"]),
1523
+ class: D([e(d)(g) ? "ring-2 ring-indigo-600" : "", "p-2.5 group relative flex justify-center items-center gap-x-12 text-center text-xs bg-white text-gray-800 border border-gray-200 cursor-pointer rounded-lg dark:bg-neutral-900 dark:border-neutral-700 dark:text-neutral-200 peer-checked:text-indigo-600 dark:has-checked:text-indigo-500 peer-checked:border-indigo-600 dark:has-checked:border-indigo-500 peer-checked:ring peer-checked:shadow focus:ring dark:has-checked:ring-indigo-500 has-disabled:pointer-events-none has-disabled:text-gray-200 dark:has-disabled:text-neutral-700 has-disabled:after:absolute has-disabled:after:inset-0 has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-gray-200)_calc(50%-1px),var(--color-gray-200)_50%,transparent_50%)] dark:has-disabled:after:bg-[linear-gradient(to_right_bottom,transparent_calc(50%-1px),var(--color-neutral-700)_calc(50%-1px),var(--color-neutral-700)_50%,transparent_50%)]"])
1527
1524
  }, [
1528
1525
  u("input", {
1529
1526
  type: "checkbox",
1530
- id: `item-${y[e(f)]}`,
1527
+ id: `item-${g[e(p)]}`,
1531
1528
  class: "hidden w4poy border-gray-200 g41z1 g22e3 axcnw dark:text-indigo-500 dark:border-neutral-700 dark:focus:ring-neutral-900",
1532
- name: `item-${y[e(f)]}`,
1533
- value: y[e(f)]
1534
- }, null, 8, Jt),
1535
- u("span", Zt, j(y[e(h)]), 1)
1536
- ], 10, Xt))), 128))
1529
+ name: `item-${g[e(p)]}`,
1530
+ value: g[e(p)]
1531
+ }, null, 8, Zt),
1532
+ u("span", el, F(g[e(x)]), 1)
1533
+ ], 10, Jt))), 128))
1537
1534
  ], 2),
1538
- l.cleanable ? (c(), w(R, { key: 0 }, [
1539
- l.layout === "inline" ? (c(), w("div", el, [
1540
- z(j(l.multi && Array.isArray(e(r)) ? e(r)?.length : e(r) !== void 0 && (e(r) || e(r) === null) ? 1 : 0) + " з " + j(e(n).length) + " обрано ", 1),
1535
+ o.cleanable ? (f(), w(R, { key: 0 }, [
1536
+ o.layout === "inline" ? (f(), w("div", tl, [
1537
+ z(F(o.multi && Array.isArray(e(r)) ? e(r)?.length : e(r) !== void 0 && (e(r) || e(r) === null) ? 1 : 0) + " з " + F(e(a).length) + " обрано ", 1),
1541
1538
  T(u("button", {
1542
1539
  class: "text-gray-600 hover:text-gray-800",
1543
- onClick: b[0] || (b[0] = //@ts-ignore
1544
- (...y) => e(d) && e(d)(...y))
1540
+ onClick: h[0] || (h[0] = //@ts-ignore
1541
+ (...g) => e(c) && e(c)(...g))
1545
1542
  }, " Очистити ", 512), [
1546
1543
  [X, e(r) !== "" && e(r) !== void 0 || e(r)]
1547
1544
  ])
1548
1545
  ])) : V("", !0),
1549
- l.layout === "popover" ? (c(), w("div", tl, [
1550
- u("span", null, j(l.multi && Array.isArray(e(r)) ? e(r)?.length : e(r) !== void 0 && (e(r) || e(r) === null) ? 1 : 0) + " з " + j(e(n).length) + " обрано", 1),
1546
+ o.layout === "popover" ? (f(), w("div", ll, [
1547
+ u("span", null, F(o.multi && Array.isArray(e(r)) ? e(r)?.length : e(r) !== void 0 && (e(r) || e(r) === null) ? 1 : 0) + " з " + F(e(a).length) + " обрано", 1),
1551
1548
  T(u("button", {
1552
1549
  class: "text-gray-600 hover:text-gray-800",
1553
- onClick: b[1] || (b[1] = //@ts-ignore
1554
- (...y) => e(d) && e(d)(...y))
1550
+ onClick: h[1] || (h[1] = //@ts-ignore
1551
+ (...g) => e(c) && e(c)(...g))
1555
1552
  }, " Очистити ", 512), [
1556
1553
  [X, e(r) !== void 0 && e(r) !== "" || e(r)]
1557
1554
  ])
@@ -1559,7 +1556,7 @@ const Xt = ["for", "onClick"], Jt = ["id", "name", "value"], Zt = { class: "bloc
1559
1556
  ], 64)) : V("", !0)
1560
1557
  ], 64));
1561
1558
  }
1562
- }), ol = {}, nl = {
1559
+ }), al = {}, nl = {
1563
1560
  xmlns: "http://www.w3.org/2000/svg",
1564
1561
  width: "24",
1565
1562
  height: "24",
@@ -1571,12 +1568,12 @@ const Xt = ["for", "onClick"], Jt = ["id", "name", "value"], Zt = { class: "bloc
1571
1568
  "stroke-linejoin": "round",
1572
1569
  class: "text-blue-600 w-[16px] h-[16px]"
1573
1570
  };
1574
- function al(p, a) {
1575
- return c(), w("svg", nl, a[0] || (a[0] = [
1571
+ function rl(i, n) {
1572
+ return f(), w("svg", nl, n[0] || (n[0] = [
1576
1573
  u("path", { d: "M20 6 9 17l-5-5" }, null, -1)
1577
1574
  ]));
1578
1575
  }
1579
- const te = /* @__PURE__ */ J(ol, [["render", al]]), rl = {}, sl = {
1576
+ const te = /* @__PURE__ */ J(al, [["render", rl]]), sl = {}, ul = {
1580
1577
  xmlns: "http://www.w3.org/2000/svg",
1581
1578
  width: "15px",
1582
1579
  height: "24",
@@ -1588,8 +1585,8 @@ const te = /* @__PURE__ */ J(ol, [["render", al]]), rl = {}, sl = {
1588
1585
  "stroke-linejoin": "round",
1589
1586
  class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[90deg]"
1590
1587
  };
1591
- function ul(p, a) {
1592
- return c(), w("svg", sl, a[0] || (a[0] = [
1588
+ function il(i, n) {
1589
+ return f(), w("svg", ul, n[0] || (n[0] = [
1593
1590
  u("path", {
1594
1591
  stroke: "none",
1595
1592
  d: "M0 0h24v24H0z",
@@ -1598,7 +1595,7 @@ function ul(p, a) {
1598
1595
  u("path", { d: "M6 9l6 6l6 -6" }, null, -1)
1599
1596
  ]));
1600
1597
  }
1601
- const il = /* @__PURE__ */ J(rl, [["render", ul]]), dl = {}, cl = {
1598
+ const dl = /* @__PURE__ */ J(sl, [["render", il]]), cl = {}, fl = {
1602
1599
  xmlns: "http://www.w3.org/2000/svg",
1603
1600
  width: "15px",
1604
1601
  height: "24",
@@ -1610,8 +1607,8 @@ const il = /* @__PURE__ */ J(rl, [["render", ul]]), dl = {}, cl = {
1610
1607
  "stroke-linejoin": "round",
1611
1608
  class: "icon icon-tabler icons-tabler-outline icon-tabler-chevron-down text-gray-800 rotate-[270deg]"
1612
1609
  };
1613
- function fl(p, a) {
1614
- return c(), w("svg", cl, a[0] || (a[0] = [
1610
+ function pl(i, n) {
1611
+ return f(), w("svg", fl, n[0] || (n[0] = [
1615
1612
  u("path", {
1616
1613
  stroke: "none",
1617
1614
  d: "M0 0h24v24H0z",
@@ -1620,11 +1617,11 @@ function fl(p, a) {
1620
1617
  u("path", { d: "M6 9l6 6l6 -6" }, null, -1)
1621
1618
  ]));
1622
1619
  }
1623
- const pl = /* @__PURE__ */ J(dl, [["render", fl]]), ml = { class: "flex" }, vl = { class: "mb-1" }, gl = { class: "mb-1" }, yl = { class: "inline-flex rounded-lg shrink-0 pl-1" }, bl = { class: "inline-flex rounded-lg shrink-0 pl-1" }, hl = {
1620
+ const ml = /* @__PURE__ */ J(cl, [["render", pl]]), vl = { class: "flex" }, yl = { class: "mb-1" }, gl = { class: "mb-1" }, bl = { class: "inline-flex rounded-lg shrink-0 pl-1" }, hl = { class: "inline-flex rounded-lg shrink-0 pl-1" }, xl = {
1624
1621
  key: 1,
1625
1622
  class: "flex gap-1 !w-[75%] rounded-lg"
1626
- }, xl = ["max", "disabled"], kl = ["min", "disabled"];
1627
- const wl = /* @__PURE__ */ O({
1623
+ }, kl = ["max", "disabled"], wl = ["min", "disabled"];
1624
+ const Cl = /* @__PURE__ */ O({
1628
1625
  __name: "date-input-inline",
1629
1626
  props: {
1630
1627
  id: {},
@@ -1650,177 +1647,177 @@ const wl = /* @__PURE__ */ O({
1650
1647
  sort: {}
1651
1648
  },
1652
1649
  emits: ["update:modelValue", "change", "clear"],
1653
- setup(p, { expose: a, emit: v }) {
1654
- const t = p, s = v, r = _(null), {
1655
- activeMode: i,
1650
+ setup(i, { expose: n, emit: v }) {
1651
+ const t = i, s = v, r = _(null), {
1652
+ activeMode: d,
1656
1653
  innerValue: m,
1657
- onSelectChange: d,
1658
- nextClick: h,
1659
- prevClick: f,
1660
- currentLabel: n,
1661
- clear: l
1662
- } = Ke({
1654
+ onSelectChange: c,
1655
+ nextClick: x,
1656
+ prevClick: p,
1657
+ currentLabel: a,
1658
+ clear: o
1659
+ } = Fe({
1663
1660
  ...t,
1664
1661
  popoverRef: r
1665
1662
  }, s);
1666
- return M(() => t.modelValue, (b) => {
1667
- b !== void 0 ? (m.value = b, s("update:modelValue", b)) : (i.value = "", m.value = []);
1668
- }), a({
1669
- clear: l,
1663
+ return M(() => t.modelValue, (h) => {
1664
+ h !== void 0 ? (m.value = h, s("update:modelValue", h)) : (d.value = "", m.value = []);
1665
+ }), n({
1666
+ clear: o,
1670
1667
  popoverRef: r
1671
- }), (b, y) => (c(), w(R, null, [
1672
- u("div", ml, [
1673
- N(ye, {
1668
+ }), (h, g) => (f(), w(R, null, [
1669
+ u("div", vl, [
1670
+ N(ge, {
1674
1671
  ref_key: "popoverRef",
1675
1672
  ref: r,
1676
- label: e(n),
1673
+ label: e(a),
1677
1674
  "current-value": e(m),
1678
- mode: b.mode,
1679
- onClear: e(l),
1680
- layout: b.layout
1675
+ mode: h.mode,
1676
+ onClear: e(o),
1677
+ layout: h.layout
1681
1678
  }, {
1682
1679
  default: le(() => [
1683
1680
  u("div", null, [
1684
1681
  u("button", {
1685
1682
  type: "button",
1686
- onClick: y[0] || (y[0] = (k) => e(d)("range")),
1683
+ onClick: g[0] || (g[0] = (k) => e(c)("range")),
1687
1684
  class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1688
1685
  }, [
1689
- y[12] || (y[12] = z(" Період ", -1)),
1690
- e(i) === "range" ? (c(), S(te, { key: 0 })) : V("", !0)
1686
+ g[12] || (g[12] = z(" Період ")),
1687
+ e(d) === "range" ? (f(), S(te, { key: 0 })) : V("", !0)
1691
1688
  ])
1692
1689
  ]),
1693
- y[19] || (y[19] = u("div", null, [
1690
+ g[19] || (g[19] = u("div", null, [
1694
1691
  u("div", { class: "pt-1 mt-1 border-t" })
1695
1692
  ], -1)),
1696
1693
  u("div", null, [
1697
1694
  u("button", {
1698
1695
  type: "button",
1699
- onClick: y[1] || (y[1] = (k) => e(d)("today")),
1696
+ onClick: g[1] || (g[1] = (k) => e(c)("today")),
1700
1697
  class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1701
1698
  }, [
1702
- y[13] || (y[13] = z(" Сьогодні ", -1)),
1703
- e(i) === "today" ? (c(), S(te, { key: 0 })) : V("", !0)
1699
+ g[13] || (g[13] = z(" Сьогодні ")),
1700
+ e(d) === "today" ? (f(), S(te, { key: 0 })) : V("", !0)
1704
1701
  ])
1705
1702
  ]),
1706
1703
  u("div", null, [
1707
1704
  u("button", {
1708
1705
  type: "button",
1709
- onClick: y[2] || (y[2] = (k) => e(d)("week")),
1706
+ onClick: g[2] || (g[2] = (k) => e(c)("week")),
1710
1707
  class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1711
1708
  }, [
1712
- y[14] || (y[14] = z(" Тиждень ", -1)),
1713
- e(i) === "week" ? (c(), S(te, { key: 0 })) : V("", !0)
1709
+ g[14] || (g[14] = z(" Тиждень ")),
1710
+ e(d) === "week" ? (f(), S(te, { key: 0 })) : V("", !0)
1714
1711
  ])
1715
1712
  ]),
1716
1713
  u("div", null, [
1717
1714
  u("button", {
1718
1715
  type: "button",
1719
- onClick: y[3] || (y[3] = (k) => e(d)("month")),
1716
+ onClick: g[3] || (g[3] = (k) => e(c)("month")),
1720
1717
  class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1721
1718
  }, [
1722
- y[15] || (y[15] = z(" Місяць ", -1)),
1723
- e(i) === "month" ? (c(), S(te, { key: 0 })) : V("", !0)
1719
+ g[15] || (g[15] = z(" Місяць ")),
1720
+ e(d) === "month" ? (f(), S(te, { key: 0 })) : V("", !0)
1724
1721
  ])
1725
1722
  ]),
1726
1723
  u("div", null, [
1727
1724
  u("button", {
1728
1725
  type: "button",
1729
- onClick: y[4] || (y[4] = (k) => e(d)("quarter")),
1726
+ onClick: g[4] || (g[4] = (k) => e(c)("quarter")),
1730
1727
  class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1731
1728
  }, [
1732
- y[16] || (y[16] = z(" Квартал ", -1)),
1733
- e(i) === "quarter" ? (c(), S(te, { key: 0 })) : V("", !0)
1729
+ g[16] || (g[16] = z(" Квартал ")),
1730
+ e(d) === "quarter" ? (f(), S(te, { key: 0 })) : V("", !0)
1734
1731
  ])
1735
1732
  ]),
1736
- u("div", vl, [
1733
+ u("div", yl, [
1737
1734
  u("button", {
1738
1735
  type: "button",
1739
- onClick: y[5] || (y[5] = (k) => e(d)("year")),
1736
+ onClick: g[5] || (g[5] = (k) => e(c)("year")),
1740
1737
  class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1741
1738
  }, [
1742
- y[17] || (y[17] = z(" Рік ", -1)),
1743
- e(i) === "year" ? (c(), S(te, { key: 0 })) : V("", !0)
1739
+ g[17] || (g[17] = z(" Рік ")),
1740
+ e(d) === "year" ? (f(), S(te, { key: 0 })) : V("", !0)
1744
1741
  ])
1745
1742
  ]),
1746
1743
  u("div", gl, [
1747
1744
  u("button", {
1748
1745
  type: "button",
1749
- onClick: y[6] || (y[6] = (k) => e(l)()),
1746
+ onClick: g[6] || (g[6] = (k) => e(o)()),
1750
1747
  class: "flex items-center justify-between w-full px-4 py-2 text-sm text-left rounded-lg cursor-pointer filter-date__item hs-selected:bg-stone-100 text-stone-800 hover:bg-stone-100 focus:outline-none focus:bg-stone-100"
1751
1748
  }, [
1752
- y[18] || (y[18] = z(" Весь час ", -1)),
1753
- e(m)[0] ? V("", !0) : (c(), S(te, { key: 0 }))
1749
+ g[18] || (g[18] = z(" Весь час ")),
1750
+ e(m)[0] ? V("", !0) : (f(), S(te, { key: 0 }))
1754
1751
  ])
1755
1752
  ])
1756
1753
  ]),
1757
1754
  _: 1,
1758
1755
  __: [19]
1759
1756
  }, 8, ["label", "current-value", "mode", "onClear", "layout"]),
1760
- e(i) !== "" && e(i) !== "range" && e(i) !== "last_7_days" ? (c(), w(R, { key: 0 }, [
1761
- u("div", yl, [
1757
+ e(d) !== "" && e(d) !== "range" && e(d) !== "last_7_days" ? (f(), w(R, { key: 0 }, [
1758
+ u("div", bl, [
1762
1759
  u("button", {
1763
1760
  type: "button",
1764
1761
  title: "Попередній період",
1765
1762
  class: "inline-flex h-[38px] items-center px-2 text-sm text-gray-800 bg-gray-100 gap-x-2 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg focus:z-10 hover:bg-gray-200 focus:bg-gray-200 duration-300",
1766
- onClick: y[7] || (y[7] = //@ts-ignore
1767
- (...k) => e(f) && e(f)(...k))
1763
+ onClick: g[7] || (g[7] = //@ts-ignore
1764
+ (...k) => e(p) && e(p)(...k))
1768
1765
  }, [
1769
- N(il)
1766
+ N(dl)
1770
1767
  ])
1771
1768
  ]),
1772
- u("div", bl, [
1769
+ u("div", hl, [
1773
1770
  u("button", {
1774
1771
  type: "button",
1775
1772
  title: "Наступний період",
1776
1773
  class: "inline-flex h-[38px] items-center px-2 text-sm text-gray-800 gap-x-2 bg-gray-100 -ms-px first:rounded-s-lg first:ms-0 last:rounded-e-lg focus:z-10 hover:bg-gray-200 focus:bg-gray-200 duration-300",
1777
- onClick: y[8] || (y[8] = //@ts-ignore
1778
- (...k) => e(h) && e(h)(...k))
1774
+ onClick: g[8] || (g[8] = //@ts-ignore
1775
+ (...k) => e(x) && e(x)(...k))
1779
1776
  }, [
1780
- N(pl)
1777
+ N(ml)
1781
1778
  ])
1782
1779
  ])
1783
1780
  ], 64)) : V("", !0),
1784
- e(i) !== "" && e(i) === "range" ? (c(), w("div", hl, [
1781
+ e(d) !== "" && e(d) === "range" ? (f(), w("div", xl, [
1785
1782
  T(u("input", {
1786
1783
  type: "date",
1787
1784
  max: e(m)[1],
1788
1785
  locale: "uk-UA",
1789
- "onUpdate:modelValue": y[9] || (y[9] = (k) => e(m)[0] = k),
1786
+ "onUpdate:modelValue": g[9] || (g[9] = (k) => e(m)[0] = k),
1790
1787
  class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600",
1791
- disabled: b.disabled
1792
- }, null, 8, xl), [
1788
+ disabled: h.disabled
1789
+ }, null, 8, kl), [
1793
1790
  [G, e(m)[0]]
1794
1791
  ]),
1795
1792
  T(u("input", {
1796
1793
  type: "date",
1797
1794
  min: e(m)[0],
1798
1795
  locale: "uk-UA",
1799
- "onUpdate:modelValue": y[10] || (y[10] = (k) => e(m)[1] = k),
1796
+ "onUpdate:modelValue": g[10] || (g[10] = (k) => e(m)[1] = k),
1800
1797
  class: "px-2 p-0 border text-[12px] max-w-[calc(50%-5px)] h-[38px] rounded-lg focus:outline-blue-600 appearance-auto",
1801
- disabled: b.disabled
1802
- }, null, 8, kl), [
1798
+ disabled: h.disabled
1799
+ }, null, 8, wl), [
1803
1800
  [G, e(m)[1]]
1804
1801
  ])
1805
1802
  ])) : V("", !0)
1806
1803
  ]),
1807
- (b.cleanable, V("", !0))
1804
+ (h.cleanable, V("", !0))
1808
1805
  ], 64));
1809
1806
  }
1810
1807
  }), ke = {
1811
1808
  radio: nt,
1812
1809
  checkbox: xe,
1813
1810
  check: xe,
1814
- text: yt,
1815
- range: $t,
1816
- date: Nt,
1817
- select: Qt,
1818
- tag: ll,
1819
- "date:inline": wl
1811
+ text: bt,
1812
+ range: At,
1813
+ date: Ht,
1814
+ select: Xt,
1815
+ tag: ol,
1816
+ "date:inline": Cl
1820
1817
  };
1821
- function be(p, a) {
1818
+ function be(i, n) {
1822
1819
  let v;
1823
- switch (p.toLowerCase()) {
1820
+ switch (i.toLowerCase()) {
1824
1821
  case "autocomplete":
1825
1822
  v = "select";
1826
1823
  break;
@@ -1828,14 +1825,14 @@ function be(p, a) {
1828
1825
  v = "checkbox";
1829
1826
  break;
1830
1827
  default:
1831
- v = p?.toString().toLowerCase();
1828
+ v = i?.toString().toLowerCase();
1832
1829
  }
1833
- return v === "date" && a && a === "inline" && (v = "date:inline"), {
1830
+ return v === "date" && n && n === "inline" && (v = "date:inline"), {
1834
1831
  component: ke[v] || ke.text,
1835
1832
  type: v
1836
1833
  };
1837
1834
  }
1838
- const Cl = {}, Vl = {
1835
+ const Vl = {}, _l = {
1839
1836
  xmlns: "http://www.w3.org/2000/svg",
1840
1837
  width: "15px",
1841
1838
  height: "24",
@@ -1847,8 +1844,8 @@ const Cl = {}, Vl = {
1847
1844
  "stroke-linejoin": "round",
1848
1845
  class: "icon icon-tabler icons-tabler-outline icon-tabler-reload absolute inline mr-1 text-gray-800 transition-all cursor-pointer active:rotate-90 right-1 top-1 hover:text-blue-500"
1849
1846
  };
1850
- function _l(p, a) {
1851
- return c(), w("svg", Vl, a[0] || (a[0] = [
1847
+ function $l(i, n) {
1848
+ return f(), w("svg", _l, n[0] || (n[0] = [
1852
1849
  u("path", {
1853
1850
  stroke: "none",
1854
1851
  d: "M0 0h24v24H0z",
@@ -1858,7 +1855,7 @@ function _l(p, a) {
1858
1855
  u("path", { d: "M20 4v5h-5" }, null, -1)
1859
1856
  ]));
1860
1857
  }
1861
- const $l = /* @__PURE__ */ J(Cl, [["render", _l]]), Al = { style: { display: "inline-flex", margin: "0px", width: "100%" } }, Bl = { class: "relative w-full mb-2 p-4 bg-white rounded-lg shadow-sm" }, Sl = { class: "block mb-3 text-sm font-medium text-gray-800 dark:text-neutral-200" }, Dl = { class: "flex items-center" }, Rl = { class: "text-sm font-medium max-w-[80%] text-gray-800 flex items-center gap-x-1" }, Ml = { class: "filter-layout__body" }, Kl = /* @__PURE__ */ O({
1858
+ const Al = /* @__PURE__ */ J(Vl, [["render", $l]]), Bl = { style: { display: "inline-flex", margin: "0px", width: "100%" } }, Sl = { class: "relative w-full mb-2 p-4 bg-white rounded-lg shadow-sm" }, Dl = { class: "block mb-3 text-sm font-medium text-gray-800 dark:text-neutral-200" }, Rl = { class: "flex items-center" }, Ml = { class: "text-sm font-medium max-w-[80%] text-gray-800 flex items-center gap-x-1" }, Kl = { class: "filter-layout__body" }, Fl = /* @__PURE__ */ O({
1862
1859
  __name: "vertical-layout",
1863
1860
  props: {
1864
1861
  id: {},
@@ -1884,69 +1881,69 @@ const $l = /* @__PURE__ */ J(Cl, [["render", _l]]), Al = { style: { display: "in
1884
1881
  sort: {}
1885
1882
  },
1886
1883
  emits: ["update:modelValue", "change", "clear"],
1887
- setup(p, { expose: a, emit: v }) {
1888
- const t = p, s = v, r = _(), i = be(t.type, t.layout), m = I({
1884
+ setup(i, { expose: n, emit: v }) {
1885
+ const t = i, s = v, r = _(), d = be(t.type, t.layout), m = I({
1889
1886
  get: () => t.modelValue,
1890
- set: (n) => s("update:modelValue", n)
1887
+ set: (a) => s("update:modelValue", a)
1891
1888
  });
1892
- function d(n) {
1893
- s("clear", n);
1889
+ function c(a) {
1890
+ s("clear", a);
1894
1891
  }
1895
- function h(n, l) {
1896
- s("change", { name: n, value: l }), t.modelValue !== void 0 && s("update:modelValue", l);
1892
+ function x(a, o) {
1893
+ s("change", { name: a, value: o }), t.modelValue !== void 0 && s("update:modelValue", o);
1897
1894
  }
1898
- function f() {
1895
+ function p() {
1899
1896
  r.value && r.value.clear(), s("clear", t.name);
1900
1897
  }
1901
1898
  return M(
1902
1899
  () => t.default,
1903
- (n) => {
1904
- m.value = n;
1900
+ (a) => {
1901
+ m.value = a;
1905
1902
  }
1906
1903
  ), M(
1907
1904
  () => t.modelValue,
1908
- (n) => {
1909
- m.value = n;
1905
+ (a) => {
1906
+ m.value = a;
1910
1907
  }
1911
- ), a({
1908
+ ), n({
1912
1909
  filterRef: r
1913
- }), (n, l) => (c(), w("div", Al, [
1914
- u("div", Bl, [
1915
- u("div", Sl, [
1916
- u("div", Dl, [
1917
- u("span", Rl, j(n.label), 1)
1910
+ }), (a, o) => (f(), w("div", Bl, [
1911
+ u("div", Sl, [
1912
+ u("div", Dl, [
1913
+ u("div", Rl, [
1914
+ u("span", Ml, F(a.label), 1)
1918
1915
  ]),
1919
- typeof m.value == "string" && m.value.trim() !== "" || Array.isArray(m.value) && m.value.length > 0 && m.value.some((b) => b !== void 0) || m.value === null ? (c(), S($l, {
1916
+ typeof m.value == "string" && m.value.trim() !== "" || Array.isArray(m.value) && m.value.length > 0 && m.value.some((h) => h !== void 0) || m.value === null ? (f(), S(Al, {
1920
1917
  key: 0,
1921
- onClick: f
1918
+ onClick: p
1922
1919
  })) : V("", !0)
1923
1920
  ]),
1924
- u("div", Ml, [
1925
- e(i)?.type !== "select" ? (c(), S(ee(e(i)?.component), P({ key: 0 }, t, {
1926
- type: e(i)?.type,
1927
- onChange: l[0] || (l[0] = (b) => h(b.name, b.value)),
1928
- onClear: l[1] || (l[1] = (b) => d(b)),
1921
+ u("div", Kl, [
1922
+ e(d)?.type !== "select" ? (f(), S(ee(e(d)?.component), P({ key: 0 }, t, {
1923
+ type: e(d)?.type,
1924
+ onChange: o[0] || (o[0] = (h) => x(h.name, h.value)),
1925
+ onClear: o[1] || (o[1] = (h) => c(h)),
1929
1926
  ref_key: "filterRef",
1930
1927
  ref: r
1931
- }), null, 16, ["type"])) : (c(), S(ye, {
1928
+ }), null, 16, ["type"])) : (f(), S(ge, {
1932
1929
  key: 1,
1933
1930
  "current-value": m.value,
1934
- label: n.label,
1935
- mode: n.mode,
1936
- onClear: f,
1931
+ label: a.label,
1932
+ mode: a.mode,
1933
+ onClear: p,
1937
1934
  fieldRef: r.value,
1938
1935
  width: void 0,
1939
- disabled: n.disabled,
1936
+ disabled: a.disabled,
1940
1937
  layout: "vertical"
1941
1938
  }, {
1942
1939
  default: le(() => [
1943
- (c(), S(ee(e(i)?.component), P({
1940
+ (f(), S(ee(e(d)?.component), P({
1944
1941
  ref_key: "filterRef",
1945
1942
  ref: r
1946
1943
  }, t, {
1947
- type: e(i)?.type,
1948
- onChange: l[2] || (l[2] = (b) => h(b.name, b.value)),
1949
- onClear: l[3] || (l[3] = (b) => d(b))
1944
+ type: e(d)?.type,
1945
+ onChange: o[2] || (o[2] = (h) => x(h.name, h.value)),
1946
+ onClear: o[3] || (o[3] = (h) => c(h))
1950
1947
  }), null, 16, ["type"]))
1951
1948
  ]),
1952
1949
  _: 1
@@ -1981,60 +1978,60 @@ const $l = /* @__PURE__ */ J(Cl, [["render", _l]]), Al = { style: { display: "in
1981
1978
  sort: {}
1982
1979
  },
1983
1980
  emits: ["update:modelValue", "change", "clear"],
1984
- setup(p, { expose: a, emit: v }) {
1985
- const t = p, s = v, r = _(), i = be(t.type, t.layout), m = I({
1981
+ setup(i, { expose: n, emit: v }) {
1982
+ const t = i, s = v, r = _(), d = be(t.type, t.layout), m = I({
1986
1983
  get: () => t.modelValue,
1987
- set: (n) => s("update:modelValue", n)
1984
+ set: (a) => s("update:modelValue", a)
1988
1985
  });
1989
- function d(n) {
1990
- s("clear", n);
1986
+ function c(a) {
1987
+ s("clear", a);
1991
1988
  }
1992
- function h(n, l) {
1993
- s("change", { name: n, value: l }), t.modelValue !== void 0 && s("update:modelValue", l);
1989
+ function x(a, o) {
1990
+ s("change", { name: a, value: o }), t.modelValue !== void 0 && s("update:modelValue", o);
1994
1991
  }
1995
- function f() {
1992
+ function p() {
1996
1993
  r.value && r.value.clear(), s("clear", t.name);
1997
1994
  }
1998
1995
  return M(
1999
1996
  () => t.default,
2000
- (n) => {
2001
- m.value = n;
1997
+ (a) => {
1998
+ m.value = a;
2002
1999
  }
2003
2000
  ), M(
2004
2001
  () => t.modelValue,
2005
- (n) => {
2006
- m.value = n;
2002
+ (a) => {
2003
+ m.value = a;
2007
2004
  }
2008
- ), a({
2005
+ ), n({
2009
2006
  filterRef: r
2010
- }), (n, l) => ["text", "date"].includes(n.type.toLocaleLowerCase()) ? (c(), S(ee(e(i)?.component), P({ key: 0 }, t, {
2011
- type: e(i)?.type,
2012
- onChange: l[0] || (l[0] = (b) => h(b.name, b.value)),
2013
- onClear: l[1] || (l[1] = (b) => d(b)),
2014
- disabled: n.disabled,
2007
+ }), (a, o) => ["text", "date"].includes(a.type.toLocaleLowerCase()) ? (f(), S(ee(e(d)?.component), P({ key: 0 }, t, {
2008
+ type: e(d)?.type,
2009
+ onChange: o[0] || (o[0] = (h) => x(h.name, h.value)),
2010
+ onClear: o[1] || (o[1] = (h) => c(h)),
2011
+ disabled: a.disabled,
2015
2012
  modelValue: m.value,
2016
- "onUpdate:modelValue": l[2] || (l[2] = (b) => m.value = b)
2017
- }), null, 16, ["type", "disabled", "modelValue"])) : (c(), S(ye, {
2013
+ "onUpdate:modelValue": o[2] || (o[2] = (h) => m.value = h)
2014
+ }), null, 16, ["type", "disabled", "modelValue"])) : (f(), S(ge, {
2018
2015
  key: 1,
2019
2016
  "current-value": m.value,
2020
- label: n.label,
2021
- mode: n.mode,
2022
- onClear: f,
2017
+ label: a.label,
2018
+ mode: a.mode,
2019
+ onClear: p,
2023
2020
  fieldRef: r.value,
2024
2021
  width: t.width,
2025
- disabled: n.disabled,
2022
+ disabled: a.disabled,
2026
2023
  layout: "inline"
2027
2024
  }, {
2028
2025
  default: le(() => [
2029
- (c(), S(ee(e(i)?.component), P({
2026
+ (f(), S(ee(e(d)?.component), P({
2030
2027
  ref_key: "filterRef",
2031
2028
  ref: r
2032
2029
  }, t, {
2033
2030
  modelValue: m.value,
2034
- "onUpdate:modelValue": l[3] || (l[3] = (b) => m.value = b),
2035
- type: e(i)?.type,
2036
- onChange: l[4] || (l[4] = (b) => h(b.name, b.value)),
2037
- onClear: l[5] || (l[5] = (b) => d(b))
2031
+ "onUpdate:modelValue": o[3] || (o[3] = (h) => m.value = h),
2032
+ type: e(d)?.type,
2033
+ onChange: o[4] || (o[4] = (h) => x(h.name, h.value)),
2034
+ onClear: o[5] || (o[5] = (h) => c(h))
2038
2035
  }), null, 16, ["modelValue", "type"]))
2039
2036
  ]),
2040
2037
  _: 1
@@ -2066,45 +2063,45 @@ const $l = /* @__PURE__ */ J(Cl, [["render", _l]]), Al = { style: { display: "in
2066
2063
  sort: {}
2067
2064
  },
2068
2065
  emits: ["update:modelValue", "change", "clear"],
2069
- setup(p, { expose: a, emit: v }) {
2070
- const t = p, s = v, r = _(), i = _(be(t.type, t.layout)), m = I({
2066
+ setup(i, { expose: n, emit: v }) {
2067
+ const t = i, s = v, r = _(), d = _(be(t.type, t.layout)), m = I({
2071
2068
  get: () => t.modelValue,
2072
- set: (f) => s("update:modelValue", f)
2069
+ set: (p) => s("update:modelValue", p)
2073
2070
  });
2074
- function d(f) {
2075
- s("clear", f);
2071
+ function c(p) {
2072
+ s("clear", p);
2076
2073
  }
2077
- function h(f, n) {
2078
- s("change", { name: f, value: n }), t.modelValue !== void 0 && s("update:modelValue", n);
2074
+ function x(p, a) {
2075
+ s("change", { name: p, value: a }), t.modelValue !== void 0 && s("update:modelValue", a);
2079
2076
  }
2080
2077
  return M(
2081
2078
  () => t.default,
2082
- (f) => {
2083
- m.value = f;
2079
+ (p) => {
2080
+ m.value = p;
2084
2081
  }
2085
2082
  ), M(
2086
2083
  () => t.modelValue,
2087
- (f) => {
2088
- m.value = f;
2084
+ (p) => {
2085
+ m.value = p;
2089
2086
  }
2090
2087
  ), M(
2091
2088
  () => t,
2092
- (f) => {
2093
- m.value = f;
2089
+ (p) => {
2090
+ m.value = p;
2094
2091
  }
2095
- ), a({
2092
+ ), n({
2096
2093
  filterRef: r
2097
- }), (f, n) => (c(), S(ee(i.value?.component), P(t, {
2098
- type: i.value?.type,
2094
+ }), (p, a) => (f(), S(ee(d.value?.component), P(t, {
2095
+ type: d.value?.type,
2099
2096
  modelValue: m.value,
2100
- "onUpdate:modelValue": n[0] || (n[0] = (l) => m.value = l),
2101
- onChange: n[1] || (n[1] = (l) => h(l.name, l.value)),
2102
- onClear: n[2] || (n[2] = (l) => d(l)),
2097
+ "onUpdate:modelValue": a[0] || (a[0] = (o) => m.value = o),
2098
+ onChange: a[1] || (a[1] = (o) => x(o.name, o.value)),
2099
+ onClear: a[2] || (a[2] = (o) => c(o)),
2103
2100
  ref_key: "filterRef",
2104
2101
  ref: r
2105
2102
  }), null, 16, ["type", "modelValue"]));
2106
2103
  }
2107
- }), ne = /* @__PURE__ */ O({
2104
+ }), ae = /* @__PURE__ */ O({
2108
2105
  __name: "filter-field",
2109
2106
  props: {
2110
2107
  id: {},
@@ -2127,181 +2124,179 @@ const $l = /* @__PURE__ */ J(Cl, [["render", _l]]), Al = { style: { display: "in
2127
2124
  valueKey: {},
2128
2125
  mode: {},
2129
2126
  labelKey: {},
2130
- sort: { default: "count" }
2127
+ sort: { default: "name" }
2131
2128
  },
2132
2129
  emits: ["update:modelValue", "change", "clear"],
2133
- setup(p, { expose: a, emit: v }) {
2134
- const t = p, s = v, r = _(), i = I({
2130
+ setup(i, { expose: n, emit: v }) {
2131
+ const t = i, s = v, r = _(), d = I({
2135
2132
  get: () => t.modelValue,
2136
- set: (f) => s("update:modelValue", f)
2133
+ set: (p) => s("update:modelValue", p)
2137
2134
  });
2138
- function m(f) {
2139
- s("clear", f);
2135
+ function m(p) {
2136
+ s("clear", p);
2140
2137
  }
2141
- function d(f, n) {
2142
- s("change", { name: f, value: n }), t.modelValue !== void 0 && s("update:modelValue", n);
2138
+ function c(p, a) {
2139
+ s("change", { name: p, value: a }), t.modelValue !== void 0 && s("update:modelValue", a);
2143
2140
  }
2144
2141
  M(
2145
2142
  () => t.default,
2146
- (f) => {
2147
- i.value = f;
2143
+ (p) => {
2144
+ d.value = p;
2148
2145
  }
2149
2146
  ), M(
2150
2147
  () => t.modelValue,
2151
- (f) => {
2152
- i.value = f;
2148
+ (p) => {
2149
+ d.value = p;
2153
2150
  }
2154
- ), a({
2151
+ ), n({
2155
2152
  filterRef: r
2156
2153
  });
2157
- function h() {
2154
+ function x() {
2158
2155
  switch (t.layout) {
2159
2156
  case "inline":
2160
2157
  return we;
2161
2158
  case "vertical":
2162
- return Kl;
2159
+ return Fl;
2163
2160
  case "popover":
2164
2161
  return jl;
2165
2162
  default:
2166
2163
  return we;
2167
2164
  }
2168
2165
  }
2169
- return (f, n) => (c(), S(ee(h()), P(t, {
2170
- onChange: n[0] || (n[0] = (l) => d(l.name, l.value)),
2171
- onClear: n[1] || (n[1] = (l) => m(l)),
2172
- modelValue: i.value,
2173
- "onUpdate:modelValue": n[2] || (n[2] = (l) => i.value = l)
2166
+ return (p, a) => (f(), S(ee(x()), P(t, {
2167
+ onChange: a[0] || (a[0] = (o) => c(o.name, o.value)),
2168
+ onClear: a[1] || (a[1] = (o) => m(o)),
2169
+ modelValue: d.value,
2170
+ "onUpdate:modelValue": a[2] || (a[2] = (o) => d.value = o)
2174
2171
  }), null, 16, ["modelValue"]));
2175
2172
  }
2176
2173
  });
2177
- function he(p, a) {
2174
+ function he(i, n) {
2178
2175
  const {
2179
2176
  slots: v
2180
- } = p, t = _(p.value ?? {}), s = I(() => (Z(v?.default?.()) ?? []).flatMap((o) => Array.isArray(o.children) ? o.children : [o]));
2177
+ } = i, t = _(i.value ?? {}), s = I(() => (Z(v?.default?.()) ?? []).flatMap((l) => Array.isArray(l.children) ? l.children : [l]));
2181
2178
  function r(C) {
2182
- delete t.value[C], a("clear", {
2179
+ delete t.value[C], n("clear", {
2183
2180
  data: Z(t.value),
2184
2181
  name: C
2185
2182
  });
2186
2183
  }
2187
- function i(C, o) {
2188
- o === void 0 ? (r(C), a("change", {
2184
+ function d(C, l) {
2185
+ l === void 0 ? (r(C), n("change", {
2189
2186
  data: Z(t.value),
2190
2187
  name: C,
2191
2188
  undefined: void 0
2192
2189
  })) : t.value = {
2193
2190
  ...t.value,
2194
- [C]: o
2195
- }, a("change", {
2191
+ [C]: l
2192
+ }, n("change", {
2196
2193
  data: Z(t.value),
2197
2194
  name: C,
2198
- value: o
2195
+ value: l
2199
2196
  });
2200
2197
  }
2201
2198
  const m = I(() => s.value.map((C) => {
2202
- const o = C.props?.name;
2203
- return Ee(C, {
2199
+ const l = C.props?.name;
2200
+ return Ie(C, {
2204
2201
  ...C.props,
2205
- layout: p.view,
2202
+ layout: i.view,
2206
2203
  showClean: !0,
2207
- modelValue: t[o],
2208
- "onUpdate:modelValue": (x) => {
2209
- i(o, x);
2204
+ modelValue: t[l],
2205
+ "onUpdate:modelValue": (b) => {
2206
+ d(l, b);
2210
2207
  },
2211
- onClear: () => r(o)
2208
+ onClear: () => r(l)
2212
2209
  });
2213
- })), d = I(
2210
+ })), c = I(
2214
2211
  () => new Map(
2215
2212
  m.value.map((C) => {
2216
- const o = C.props?.name;
2217
- return o ? [o, C] : null;
2213
+ const l = C.props?.name;
2214
+ return l ? [l, C] : null;
2218
2215
  }).filter((C) => C !== null)
2219
2216
  )
2220
2217
  );
2221
- function h() {
2222
- t.value = {}, a("clearAll", {
2218
+ function x() {
2219
+ t.value = {}, n("clearAll", {
2223
2220
  data: Z(t.value),
2224
2221
  name: "ALL"
2225
2222
  });
2226
2223
  }
2227
- const f = _(""), n = I(
2228
- () => Object.values(t.value).filter((C) => Array.isArray(C) ? C.some((o) => o !== "" && o !== void 0) : C !== "" && C !== void 0).length
2229
- ), l = _();
2230
- M(f, async () => {
2231
- await fe(), l?.value?.filterRef?.inputTextRef && l.value.filterRef.inputTextRef.focus();
2224
+ const p = _(""), a = I(() => i.schema?.value ? Object.entries(t.value).filter(([C, l]) => i.schema && !(C in i.schema.value) ? !1 : Array.isArray(l) ? l.some((b) => b !== "" && b !== void 0) : l !== "" && l !== void 0).length : 0), o = _();
2225
+ M(p, async () => {
2226
+ await fe(), o?.value?.filterRef?.inputTextRef && o.value.filterRef.inputTextRef.focus();
2232
2227
  });
2233
- const b = I(() => p.schema?.value ? Object.fromEntries(Object.entries(p.schema?.value).slice(0, p.limit)) : {}), y = I(() => p.schema?.value ? p.view !== "inline" ? p.schema?.value : Object.fromEntries(Object.entries(p.schema?.value).slice(p.limit)) : {}), k = I(() => {
2228
+ const h = I(() => i.schema?.value ? Object.fromEntries(Object.entries(i.schema?.value).slice(0, i.limit)) : {}), g = I(() => i.schema?.value ? i.view !== "inline" ? i.schema?.value : Object.fromEntries(Object.entries(i.schema?.value).slice(i.limit)) : {}), k = I(() => {
2234
2229
  if (m.value.length === 0) return [];
2235
2230
  let C = 0;
2236
- if (p.schema?.value) {
2237
- const o = Object.entries(p.schema.value).length;
2238
- o < p.limit ? C = p.limit - o : C = 0;
2231
+ if (i.schema?.value) {
2232
+ const l = Object.entries(i.schema.value).length;
2233
+ l < i.limit ? C = i.limit - l : C = 0;
2239
2234
  }
2240
2235
  return m.value.slice(0, C);
2241
- }), g = I(() => m.value.length === 0 ? [] : p.view !== "inline" ? m.value : m.value.slice(k.value.length));
2236
+ }), y = I(() => m.value.length === 0 ? [] : i.view !== "inline" ? m.value : m.value.slice(k.value.length));
2242
2237
  function $() {
2243
- if (y.value) {
2244
- const [C] = Object.keys(y.value);
2245
- f.value = C;
2246
- } else g.value.length > 0 ? f.value = g.value[0].props.name : f.value = "";
2238
+ if (g.value) {
2239
+ const [C] = Object.keys(g.value);
2240
+ p.value = C;
2241
+ } else y.value.length > 0 ? p.value = y.value[0].props.name : p.value = "";
2247
2242
  }
2248
2243
  return {
2249
2244
  activeFilter: t,
2250
- activeFilterCount: n,
2251
- onFilterChange: i,
2245
+ activeFilterCount: a,
2246
+ onFilterChange: d,
2252
2247
  clearFilter: r,
2253
- clearAllFilters: h,
2254
- limitedSchema: b,
2255
- popoverSchema: y,
2248
+ clearAllFilters: x,
2249
+ limitedSchema: h,
2250
+ popoverSchema: g,
2256
2251
  filtersSlot: m,
2257
2252
  limitedFiltersSlot: k,
2258
- popoverFiltersSlot: g,
2259
- vnodeMap: d,
2253
+ popoverFiltersSlot: y,
2254
+ vnodeMap: c,
2260
2255
  onPopoverOpen: $,
2261
- selectedFilter: f,
2262
- filterRef: l
2256
+ selectedFilter: p,
2257
+ filterRef: o
2263
2258
  };
2264
2259
  }
2265
- const Fl = /* @__PURE__ */ O({
2260
+ const Ll = /* @__PURE__ */ O({
2266
2261
  __name: "popover",
2267
2262
  emits: ["open", "close"],
2268
- setup(p, { emit: a }) {
2269
- const v = _(!1), t = _(null), s = _(null), r = _(null), i = _({ top: "0px", left: "0px", position: "absolute" });
2263
+ setup(i, { emit: n }) {
2264
+ const v = _(!1), t = _(null), s = _(null), r = _(null), d = _({ top: "0px", left: "0px", position: "absolute" });
2270
2265
  function m() {
2271
2266
  v.value = !v.value;
2272
2267
  }
2273
- function d() {
2274
- const l = r.value, b = t.value;
2275
- if (!l || !b) return;
2276
- const y = l.getBoundingClientRect(), k = b.offsetWidth, g = window.innerWidth - y.left;
2277
- let $ = y.left + window.scrollX;
2278
- k > g && ($ = window.innerWidth - k - 8, $ < 8 && ($ = 8)), i.value = {
2268
+ function c() {
2269
+ const o = r.value, h = t.value;
2270
+ if (!o || !h) return;
2271
+ const g = o.getBoundingClientRect(), k = h.offsetWidth, y = window.innerWidth - g.left;
2272
+ let $ = g.left + window.scrollX;
2273
+ k > y && ($ = window.innerWidth - k - 8, $ < 8 && ($ = 8)), d.value = {
2279
2274
  position: "absolute",
2280
- top: `${y.bottom + window.scrollY + 8}px`,
2275
+ top: `${g.bottom + window.scrollY + 8}px`,
2281
2276
  left: `${$}px`
2282
2277
  };
2283
2278
  }
2284
- function h(l) {
2285
- const b = l.target;
2286
- !r.value?.contains(l.target) && !t.value?.contains(l.target) && !b.closest("[data-inside-popover]") && (v.value = !1);
2279
+ function x(o) {
2280
+ const h = o.target;
2281
+ !r.value?.contains(o.target) && !t.value?.contains(o.target) && !h.closest("[data-inside-popover]") && (v.value = !1);
2287
2282
  }
2288
- const f = _(!1);
2289
- ae(() => {
2290
- f.value = !0;
2291
- }), ae(() => {
2292
- r.value = s.value?.querySelector("[data-popover-trigger]") || null, r.value?.addEventListener("click", m), document.addEventListener("click", h), window.addEventListener("resize", d), window.addEventListener("scroll", d, !0);
2283
+ const p = _(!1);
2284
+ ne(() => {
2285
+ p.value = !0;
2286
+ }), ne(() => {
2287
+ r.value = s.value?.querySelector("[data-popover-trigger]") || null, r.value?.addEventListener("click", m), document.addEventListener("click", x), window.addEventListener("resize", c), window.addEventListener("scroll", c, !0);
2293
2288
  }), ce(() => {
2294
- r.value?.removeEventListener("click", m), document.removeEventListener("click", h), window.removeEventListener("resize", d), window.removeEventListener("scroll", d, !0);
2289
+ r.value?.removeEventListener("click", m), document.removeEventListener("click", x), window.removeEventListener("resize", c), window.removeEventListener("scroll", c, !0);
2295
2290
  });
2296
- const n = a;
2297
- return M(v, async (l) => {
2298
- l ? (n("open"), await fe(), d()) : n("close");
2299
- }), (l, b) => (c(), w("div", {
2291
+ const a = n;
2292
+ return M(v, async (o) => {
2293
+ o ? (a("open"), await fe(), c()) : a("close");
2294
+ }), (o, h) => (f(), w("div", {
2300
2295
  ref_key: "wrapperRef",
2301
2296
  ref: s
2302
2297
  }, [
2303
- ue(l.$slots, "trigger"),
2304
- f.value ? (c(), S(_e, {
2298
+ ue(o.$slots, "trigger"),
2299
+ p.value ? (f(), S($e, {
2305
2300
  key: 0,
2306
2301
  to: "body"
2307
2302
  }, [
@@ -2309,16 +2304,16 @@ const Fl = /* @__PURE__ */ O({
2309
2304
  ref_key: "popoverRef",
2310
2305
  ref: t,
2311
2306
  class: "absolute z-[50] w-[600px] rounded-md border bg-white shadow-md",
2312
- style: $e(i.value)
2307
+ style: Ae(d.value)
2313
2308
  }, [
2314
- ue(l.$slots, "default")
2309
+ ue(o.$slots, "default")
2315
2310
  ], 4), [
2316
2311
  [X, v.value]
2317
2312
  ])
2318
2313
  ])) : V("", !0)
2319
2314
  ], 512));
2320
2315
  }
2321
- }), Ll = {}, El = {
2316
+ }), El = {}, Il = {
2322
2317
  xmlns: "http://www.w3.org/2000/svg",
2323
2318
  width: "24",
2324
2319
  height: "24",
@@ -2330,24 +2325,24 @@ const Fl = /* @__PURE__ */ O({
2330
2325
  "stroke-linejoin": "round",
2331
2326
  class: "lucide lucide-filter h-4 w-4"
2332
2327
  };
2333
- function Il(p, a) {
2334
- return c(), w("svg", El, a[0] || (a[0] = [
2328
+ function Tl(i, n) {
2329
+ return f(), w("svg", Il, n[0] || (n[0] = [
2335
2330
  u("polygon", { points: "22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3" }, null, -1)
2336
2331
  ]));
2337
2332
  }
2338
- const Tl = /* @__PURE__ */ J(Ll, [["render", Il]]), Ol = {
2333
+ const Ol = /* @__PURE__ */ J(El, [["render", Tl]]), Ul = {
2339
2334
  key: 0,
2340
- class: "inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-500 text-white text-xs px-1.5 py-0.5"
2341
- }, Ul = { class: "flex" }, zl = { class: "w-64 border-r border-gray-200" }, Nl = { class: "p-2" }, Hl = ["onClick"], Yl = { class: "flex items-center gap-2" }, Pl = { class: "text-sm font-medium" }, Wl = {
2335
+ class: "inline-flex rounded-sm items-center border font-semibold border-transparent hover:bg-secondary/80 bg-blue-500 text-white text-xs px-1.5"
2336
+ }, zl = { class: "flex" }, Nl = { class: "w-64 border-r border-gray-200" }, Hl = { class: "p-2" }, Yl = ["onClick"], Pl = { class: "flex items-center gap-2" }, Wl = { class: "text-sm font-medium" }, ql = {
2342
2337
  key: 0,
2343
2338
  class: "inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-100 text-blue-700 text-xs p-2"
2344
- }, ql = ["onClick"], Ql = { class: "flex items-center gap-2" }, Gl = { class: "text-sm font-medium" }, Xl = {
2339
+ }, Ql = ["onClick"], Gl = { class: "flex items-center gap-2" }, Xl = { class: "text-sm font-medium" }, Jl = {
2345
2340
  key: 0,
2346
2341
  class: "inline-flex items-center rounded-full border font-semibold transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 border-transparent hover:bg-secondary/80 bg-blue-100 text-blue-700 text-xs p-2"
2347
- }, Jl = {
2342
+ }, Zl = {
2348
2343
  key: 0,
2349
2344
  class: "p-2 border-t"
2350
- }, Zl = { class: "flex-1 min-h-[300px] overflow-y-auto" }, eo = {
2345
+ }, eo = { class: "flex-1 min-h-[300px] overflow-y-auto" }, to = {
2351
2346
  key: 0,
2352
2347
  class: "flex items-center justify-center h-full text-gray-500"
2353
2348
  }, je = /* @__PURE__ */ O({
@@ -2361,35 +2356,35 @@ const Tl = /* @__PURE__ */ J(Ll, [["render", Il]]), Ol = {
2361
2356
  limit: { default: 3 }
2362
2357
  },
2363
2358
  emits: ["change", "clear", "clearAll"],
2364
- setup(p, { expose: a, emit: v }) {
2365
- const t = p, s = Me(t.mode), r = pe(), i = v, m = _({}), {
2366
- activeFilter: d,
2367
- activeFilterCount: h,
2368
- onFilterChange: f,
2369
- clearFilter: n,
2370
- clearAllFilters: l,
2371
- popoverSchema: b,
2372
- popoverFiltersSlot: y,
2359
+ setup(i, { expose: n, emit: v }) {
2360
+ const t = i, s = Ke(t.mode), r = pe(), d = v, m = _({}), {
2361
+ activeFilter: c,
2362
+ activeFilterCount: x,
2363
+ onFilterChange: p,
2364
+ clearFilter: a,
2365
+ clearAllFilters: o,
2366
+ popoverSchema: h,
2367
+ popoverFiltersSlot: g,
2373
2368
  onPopoverOpen: k,
2374
- selectedFilter: g,
2369
+ selectedFilter: y,
2375
2370
  filterRef: $
2376
2371
  } = he({
2377
2372
  ...t,
2378
2373
  schema: m,
2379
2374
  slots: r
2380
- }, i);
2375
+ }, d);
2381
2376
  return M(
2382
2377
  () => t.schema,
2383
2378
  (C) => {
2384
2379
  m.value = C;
2385
2380
  },
2386
2381
  { deep: !0, immediate: !0 }
2387
- ), a({
2388
- clearFilter: n,
2389
- clearAllFilters: l
2390
- }), (C, o) => (c(), S(Fl, {
2382
+ ), n({
2383
+ clearFilter: a,
2384
+ clearAllFilters: o
2385
+ }), (C, l) => (f(), S(Ll, {
2391
2386
  onOpen: e(k),
2392
- onClose: o[5] || (o[5] = (x) => g.value = "")
2387
+ onClose: l[5] || (l[5] = (b) => y.value = "")
2393
2388
  }, {
2394
2389
  trigger: le(() => [
2395
2390
  u("button", {
@@ -2397,99 +2392,99 @@ const Tl = /* @__PURE__ */ J(Ll, [["render", Il]]), Ol = {
2397
2392
  "aria-haspopup": "dialog",
2398
2393
  "aria-expanded": "false",
2399
2394
  class: D(
2400
- e(s) + (e(h) > 0 ? "bg-blue-50 border-blue-200 text-blue-700 hover:bg-blue-100" : "text-gray-800 hover:bg-gray-200 focus:bg-gray-200")
2395
+ e(s) + (e(x) > 0 ? "bg-blue-50 border-blue-200 text-blue-700 hover:bg-blue-100" : "text-gray-800 hover:bg-gray-200 focus:bg-gray-200")
2401
2396
  ),
2402
2397
  type: "button"
2403
2398
  }, [
2404
- N(Tl),
2405
- o[6] || (o[6] = z(" Фільтр ", -1)),
2406
- e(h) > 0 ? (c(), w("div", Ol, j(e(h)), 1)) : V("", !0)
2399
+ N(Ol),
2400
+ l[6] || (l[6] = z(" Фільтр ")),
2401
+ e(x) > 0 ? (f(), w("div", Ul, F(e(x)), 1)) : V("", !0)
2407
2402
  ], 2)
2408
2403
  ]),
2409
2404
  default: le(() => [
2410
- u("div", Ul, [
2411
- u("div", zl, [
2412
- o[7] || (o[7] = u("div", { class: "p-4 border-b" }, [
2405
+ u("div", zl, [
2406
+ u("div", Nl, [
2407
+ l[7] || (l[7] = u("div", { class: "p-4 border-b" }, [
2413
2408
  u("p", { class: "text-sm text-gray-600" }, "Select a field to start creating a filter.")
2414
2409
  ], -1)),
2415
- u("div", Nl, [
2416
- C.schema ? (c(!0), w(R, { key: 0 }, W(Object.entries(e(b)), ([x, K]) => (c(), w("button", {
2417
- key: x,
2410
+ u("div", Hl, [
2411
+ C.schema ? (f(!0), w(R, { key: 0 }, W(Object.entries(e(h)), ([b, K]) => (f(), w("button", {
2412
+ key: b,
2418
2413
  onClick: () => {
2419
- g.value = x;
2414
+ y.value = b;
2420
2415
  },
2421
2416
  class: D([
2422
2417
  "w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",
2423
- e(g) === x ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : ""
2418
+ e(y) === b ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : ""
2424
2419
  ])
2425
2420
  }, [
2426
- u("div", Yl, [
2427
- u("span", Pl, j(K.label), 1)
2421
+ u("div", Pl, [
2422
+ u("span", Wl, F(K.label), 1)
2428
2423
  ]),
2429
- (Array.isArray(e(d)[x]) ? e(d)[x]?.length > 0 : e(d)[x] || e(d)[x] === null) ? (c(), w("div", Wl)) : V("", !0)
2430
- ], 10, Hl))), 128)) : V("", !0),
2431
- (c(!0), w(R, null, W(e(y), (x, K) => (c(), w("button", {
2424
+ (Array.isArray(e(c)[b]) ? e(c)[b]?.length > 0 : e(c)[b] || e(c)[b] === null) ? (f(), w("div", ql)) : V("", !0)
2425
+ ], 10, Yl))), 128)) : V("", !0),
2426
+ (f(!0), w(R, null, W(e(g), (b, K) => (f(), w("button", {
2432
2427
  key: "slot-" + K,
2433
- onClick: (A) => g.value = x.props.name,
2428
+ onClick: (A) => y.value = b.props.name,
2434
2429
  class: D([
2435
2430
  "w-full flex items-center justify-between px-3 py-2 text-left hover:bg-gray-50 transition-colors",
2436
- e(g) === x.props.name ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : ""
2431
+ e(y) === b.props.name ? "bg-blue-50 text-blue-700 border-l-2 border-blue-500" : ""
2437
2432
  ])
2438
2433
  }, [
2439
- u("div", Ql, [
2440
- u("span", Gl, j(x.props.label), 1)
2434
+ u("div", Gl, [
2435
+ u("span", Xl, F(b.props.label), 1)
2441
2436
  ]),
2442
- e(d)[x.props.name]?.length > 0 ? (c(), w("div", Xl)) : V("", !0)
2443
- ], 10, ql))), 128))
2437
+ e(c)[b.props.name]?.length > 0 ? (f(), w("div", Jl)) : V("", !0)
2438
+ ], 10, Ql))), 128))
2444
2439
  ]),
2445
- e(h) > 0 ? (c(), w("div", Jl, [
2440
+ e(x) > 0 ? (f(), w("div", Zl, [
2446
2441
  u("button", {
2447
2442
  class: "w-full px-3 py-2 text-left text-sm text-gray-600 hover:bg-gray-50 transition-colors",
2448
- onClick: o[0] || (o[0] = //@ts-ignore
2449
- (...x) => e(l) && e(l)(...x)),
2443
+ onClick: l[0] || (l[0] = //@ts-ignore
2444
+ (...b) => e(o) && e(o)(...b)),
2450
2445
  "data-inside-popover": ""
2451
2446
  }, " Очистити всі ")
2452
2447
  ])) : V("", !0)
2453
2448
  ]),
2454
- u("div", Zl, [
2455
- e(g) === "" ? (c(), w("div", eo, o[8] || (o[8] = [
2449
+ u("div", eo, [
2450
+ e(y) === "" ? (f(), w("div", to, l[8] || (l[8] = [
2456
2451
  u("p", { class: "text-sm" }, "Select a field to start creating a filter.", -1)
2457
2452
  ]))) : V("", !0),
2458
- e(g) ? (c(), w(R, { key: 1 }, [
2459
- e(b) ? (c(!0), w(R, { key: 0 }, W(Object.entries(e(b)), ([x, K]) => (c(), w(R, null, [
2460
- e(g) === x ? (c(), S(ne, P({
2461
- name: x,
2462
- key: x,
2453
+ e(y) ? (f(), w(R, { key: 1 }, [
2454
+ e(h) ? (f(!0), w(R, { key: 0 }, W(Object.entries(e(h)), ([b, K]) => (f(), w(R, null, [
2455
+ e(y) === b ? (f(), S(ae, P({
2456
+ name: b,
2457
+ key: b,
2463
2458
  layout: "popover",
2464
2459
  ref_for: !0,
2465
2460
  ref_key: "filterRef",
2466
2461
  ref: $
2467
2462
  }, { ref_for: !0 }, K, {
2468
- onChange: o[1] || (o[1] = (A) => e(f)(A.name, A.value)),
2469
- onClear: o[2] || (o[2] = (A) => {
2470
- e(n)(A), e(f)(A, void 0);
2463
+ onChange: l[1] || (l[1] = (A) => e(p)(A.name, A.value)),
2464
+ onClear: l[2] || (l[2] = (A) => {
2465
+ e(a)(A), e(p)(A, void 0);
2471
2466
  }),
2472
- modelValue: e(d)[x],
2473
- "onUpdate:modelValue": (A) => e(d)[x] = A,
2467
+ modelValue: e(c)[b],
2468
+ "onUpdate:modelValue": (A) => e(c)[b] = A,
2474
2469
  cleanable: !0
2475
2470
  }), null, 16, ["name", "modelValue", "onUpdate:modelValue"])) : V("", !0)
2476
2471
  ], 64))), 256)) : V("", !0),
2477
- (c(!0), w(R, null, W(e(y), (x, K) => (c(), w(R, {
2472
+ (f(!0), w(R, null, W(e(g), (b, K) => (f(), w(R, {
2478
2473
  key: "slot-" + K
2479
2474
  }, [
2480
- e(g) === x.props.name ? (c(), S(ne, P({
2475
+ e(y) === b.props.name ? (f(), S(ae, P({
2481
2476
  key: 0,
2482
2477
  layout: "popover"
2483
- }, { ref_for: !0 }, x.props, {
2478
+ }, { ref_for: !0 }, b.props, {
2484
2479
  ref_for: !0,
2485
2480
  ref_key: "filterRef",
2486
2481
  ref: $,
2487
- onChange: o[3] || (o[3] = (A) => e(f)(A.name, A.value)),
2488
- onClear: o[4] || (o[4] = (A) => {
2489
- e(n)(A), e(f)(A, void 0);
2482
+ onChange: l[3] || (l[3] = (A) => e(p)(A.name, A.value)),
2483
+ onClear: l[4] || (l[4] = (A) => {
2484
+ e(a)(A), e(p)(A, void 0);
2490
2485
  }),
2491
- modelValue: e(d)[x.props.name],
2492
- "onUpdate:modelValue": (A) => e(d)[x.props.name] = A,
2486
+ modelValue: e(c)[b.props.name],
2487
+ "onUpdate:modelValue": (A) => e(c)[b.props.name] = A,
2493
2488
  cleanable: !0
2494
2489
  }), null, 16, ["modelValue", "onUpdate:modelValue"])) : V("", !0)
2495
2490
  ], 64))), 128))
@@ -2500,7 +2495,7 @@ const Tl = /* @__PURE__ */ J(Ll, [["render", Il]]), Ol = {
2500
2495
  _: 1
2501
2496
  }, 8, ["onOpen"]));
2502
2497
  }
2503
- }), to = { class: "flex gap-1 items-center flex-wrap" }, Ce = /* @__PURE__ */ O({
2498
+ }), lo = { class: "flex gap-1 items-center flex-wrap" }, Ce = /* @__PURE__ */ O({
2504
2499
  __name: "inline-filter-layout",
2505
2500
  props: {
2506
2501
  schema: {},
@@ -2511,17 +2506,17 @@ const Tl = /* @__PURE__ */ J(Ll, [["render", Il]]), Ol = {
2511
2506
  limit: { default: 3 }
2512
2507
  },
2513
2508
  emits: ["change", "clear", "clearAll"],
2514
- setup(p, { emit: a }) {
2515
- const v = p, t = a, s = pe(), r = _({}), {
2516
- activeFilter: i,
2509
+ setup(i, { emit: n }) {
2510
+ const v = i, t = n, s = pe(), r = _({}), {
2511
+ activeFilter: d,
2517
2512
  activeFilterCount: m,
2518
- onFilterChange: d,
2519
- clearFilter: h,
2520
- clearAllFilters: f,
2521
- limitedSchema: n,
2522
- popoverSchema: l,
2523
- filtersSlot: b,
2524
- limitedFiltersSlot: y,
2513
+ onFilterChange: c,
2514
+ clearFilter: x,
2515
+ clearAllFilters: p,
2516
+ limitedSchema: a,
2517
+ popoverSchema: o,
2518
+ filtersSlot: h,
2519
+ limitedFiltersSlot: g,
2525
2520
  popoverFiltersSlot: k
2526
2521
  } = he(
2527
2522
  {
@@ -2530,9 +2525,9 @@ const Tl = /* @__PURE__ */ J(Ll, [["render", Il]]), Ol = {
2530
2525
  slots: s
2531
2526
  },
2532
2527
  t
2533
- ), g = _();
2528
+ ), y = _();
2534
2529
  function $() {
2535
- g.value && g.value.clearAllFilters(), f();
2530
+ y.value && y.value.clearAllFilters(), p();
2536
2531
  }
2537
2532
  return M(
2538
2533
  () => v.schema,
@@ -2540,61 +2535,63 @@ const Tl = /* @__PURE__ */ J(Ll, [["render", Il]]), Ol = {
2540
2535
  r.value = C;
2541
2536
  },
2542
2537
  { deep: !0, immediate: !0 }
2543
- ), (C, o) => (c(), w("div", to, [
2544
- C.schema ? (c(!0), w(R, { key: 0 }, W(Object.entries(e(n)), ([x, K]) => (c(), S(ne, P({
2545
- key: x,
2546
- name: x,
2538
+ ), (C, l) => (f(), w("div", lo, [
2539
+ C.schema ? (f(!0), w(R, { key: 0 }, W(Object.entries(e(a)), ([b, K]) => (f(), S(ae, P({
2540
+ key: b,
2541
+ name: b,
2547
2542
  mode: C.mode
2548
2543
  }, { ref_for: !0 }, K, {
2549
- onChange: o[0] || (o[0] = (A) => e(d)(A.name, A.value)),
2550
- onClear: o[1] || (o[1] = (A) => {
2551
- e(h)(A), e(d)(A, void 0);
2544
+ onChange: l[0] || (l[0] = (A) => e(c)(A.name, A.value)),
2545
+ onClear: l[1] || (l[1] = (A) => {
2546
+ e(x)(A), e(c)(A, void 0);
2552
2547
  }),
2553
2548
  layout: "inline",
2554
2549
  cleanable: !0,
2555
- modelValue: e(i)[x],
2556
- "onUpdate:modelValue": (A) => e(i)[x] = A
2550
+ modelValue: e(d)[b],
2551
+ "onUpdate:modelValue": (A) => e(d)[b] = A
2557
2552
  }), null, 16, ["name", "mode", "modelValue", "onUpdate:modelValue"]))), 128)) : V("", !0),
2558
- (c(!0), w(R, null, W(e(y), (x, K) => (c(), S(ne, P({
2553
+ (f(!0), w(R, null, W(e(g), (b, K) => (f(), S(ae, P({
2559
2554
  key: "slot-" + K,
2560
- layout: "vertical"
2561
- }, { ref_for: !0 }, x.props, {
2562
- onChange: o[2] || (o[2] = (A) => e(d)(A.name, A.value)),
2563
- onClear: o[3] || (o[3] = (A) => {
2564
- e(h)(A), e(d)(A, void 0);
2555
+ layout: "inline"
2556
+ }, { ref_for: !0 }, b.props, {
2557
+ onChange: l[2] || (l[2] = (A) => e(c)(A.name, A.value)),
2558
+ onClear: l[3] || (l[3] = (A) => {
2559
+ e(x)(A), e(c)(A, void 0);
2565
2560
  }),
2566
2561
  cleanable: !0,
2567
- modelValue: e(i)[x.props.name],
2568
- "onUpdate:modelValue": (A) => e(i)[x.props.name] = A
2562
+ modelValue: e(d)[b.props.name],
2563
+ "onUpdate:modelValue": (A) => e(d)[b.props.name] = A
2569
2564
  }), null, 16, ["modelValue", "onUpdate:modelValue"]))), 128)),
2570
- Object.entries(e(l)).length > 0 || e(k).length > 0 ? (c(), S(je, P({ key: 1 }, v, {
2571
- onChange: o[4] || (o[4] = (x) => e(d)(x.name, x.value)),
2572
- onClearAll: e(f),
2573
- onClear: o[5] || (o[5] = (x) => e(h)(x.name)),
2565
+ Object.entries(e(o)).length > 0 || e(k).length > 0 ? (f(), S(je, P({ key: 1 }, v, {
2566
+ schema: e(o),
2567
+ limit: 0,
2568
+ onChange: l[4] || (l[4] = (b) => e(c)(b.name, b.value)),
2569
+ onClearAll: e(p),
2570
+ onClear: l[5] || (l[5] = (b) => e(x)(b.name)),
2574
2571
  mode: C.mode,
2575
2572
  ref_key: "popoverRef",
2576
- ref: g,
2573
+ ref: y,
2577
2574
  cleanable: !0
2578
2575
  }), {
2579
2576
  default: le(() => [
2580
- (c(!0), w(R, null, W(e(b), (x, K) => (c(), S(ee(x), P({
2577
+ (f(!0), w(R, null, W(e(h), (b, K) => (f(), S(ee(b), P({
2581
2578
  key: "slot-" + K,
2582
- layout: "inline"
2583
- }, { ref_for: !0 }, x.props, { cleanable: !0 }), null, 16))), 128))
2579
+ layout: "popover"
2580
+ }, { ref_for: !0 }, b.props, { cleanable: !0 }), null, 16))), 128))
2584
2581
  ]),
2585
2582
  _: 1
2586
- }, 16, ["onClearAll", "mode"])) : V("", !0),
2587
- e(m) > 0 ? (c(), w("button", {
2583
+ }, 16, ["schema", "onClearAll", "mode"])) : V("", !0),
2584
+ e(m) > 0 ? (f(), w("button", {
2588
2585
  key: 2,
2589
2586
  onClick: $,
2590
2587
  class: "relative py-2 px-3 inline-flex justify-center items-center gap-x-2 text-sm font-medium rounded-lg bg-gray-100 border border-transparent text-gray-800 hover:bg-gray-200 focus:bg-gray-200"
2591
2588
  }, " Очистити ")) : V("", !0)
2592
2589
  ]));
2593
2590
  }
2594
- }), lo = {
2591
+ }), oo = {
2595
2592
  key: 0,
2596
2593
  class: "p-2 overflow-y-auto overflow-hidden [&::-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-800 max-h-[calc(100%-142px)] h-full bg-gray-100"
2597
- }, oo = { class: "flex items-center vst-filters vsTailwind flex-col w-full" }, no = /* @__PURE__ */ O({
2594
+ }, ao = { class: "flex items-center vst-filters vsTailwind flex-col w-full" }, no = /* @__PURE__ */ O({
2598
2595
  __name: "vertical-filter-layout",
2599
2596
  props: {
2600
2597
  schema: {},
@@ -2605,58 +2602,58 @@ const Tl = /* @__PURE__ */ J(Ll, [["render", Il]]), Ol = {
2605
2602
  limit: { default: 3 }
2606
2603
  },
2607
2604
  emits: ["change", "clear", "clearAll"],
2608
- setup(p, { emit: a }) {
2609
- const v = p, t = a, s = pe(), {
2605
+ setup(i, { emit: n }) {
2606
+ const v = i, t = n, s = pe(), {
2610
2607
  activeFilter: r,
2611
- activeFilterCount: i,
2608
+ activeFilterCount: d,
2612
2609
  onFilterChange: m,
2613
- clearFilter: d,
2614
- clearAllFilters: h,
2615
- filtersSlot: f
2610
+ clearFilter: c,
2611
+ clearAllFilters: x,
2612
+ filtersSlot: p
2616
2613
  } = he({
2617
2614
  ...v,
2618
2615
  slots: s
2619
2616
  }, t);
2620
- return (n, l) => n.view === "vertical" ? (c(), w("div", lo, [
2621
- u("div", oo, [
2622
- e(i) > 0 ? (c(), w("button", {
2617
+ return (a, o) => a.view === "vertical" ? (f(), w("div", oo, [
2618
+ u("div", ao, [
2619
+ e(d) > 0 ? (f(), w("button", {
2623
2620
  key: 0,
2624
- onClick: l[0] || (l[0] = //@ts-ignore
2625
- (...b) => e(h) && e(h)(...b)),
2621
+ onClick: o[0] || (o[0] = //@ts-ignore
2622
+ (...h) => e(x) && e(x)(...h)),
2626
2623
  "data-popover-trigger": "",
2627
2624
  "aria-haspopup": "dialog",
2628
2625
  "aria-expanded": "false",
2629
2626
  class: "w-full ring-offset-background focus-visible:outline-hidden focus-visible:ring-ring inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:ring-2 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:text-accent-foreground border h-10 px-4 py-2 gap-2 m-2 bg-white text-gray-800 hover:bg-gray-200 focus:bg-gray-200",
2630
2627
  type: "button"
2631
2628
  }, " Очистити ")) : V("", !0),
2632
- n.schema ? (c(!0), w(R, { key: 1 }, W(Object.entries(n.schema), ([b, y]) => (c(), S(ne, P({
2633
- name: b,
2629
+ a.schema ? (f(!0), w(R, { key: 1 }, W(Object.entries(a.schema), ([h, g]) => (f(), S(ae, P({
2630
+ name: h,
2634
2631
  layout: "vertical"
2635
- }, { ref_for: !0 }, y, {
2636
- onChange: l[1] || (l[1] = (k) => e(m)(k.name, k.value)),
2637
- onClear: l[2] || (l[2] = (k) => {
2638
- e(d)(k), e(m)(k, void 0);
2632
+ }, { ref_for: !0 }, g, {
2633
+ onChange: o[1] || (o[1] = (k) => e(m)(k.name, k.value)),
2634
+ onClear: o[2] || (o[2] = (k) => {
2635
+ e(c)(k), e(m)(k, void 0);
2639
2636
  }),
2640
- modelValue: e(r)[b],
2641
- "onUpdate:modelValue": (k) => e(r)[b] = k,
2637
+ modelValue: e(r)[h],
2638
+ "onUpdate:modelValue": (k) => e(r)[h] = k,
2642
2639
  showClean: !0
2643
2640
  }), null, 16, ["name", "modelValue", "onUpdate:modelValue"]))), 256)) : V("", !0),
2644
- (c(!0), w(R, null, W(e(f), (b, y) => (c(), S(ne, P({
2645
- key: "slot-" + y,
2641
+ (f(!0), w(R, null, W(e(p), (h, g) => (f(), S(ae, P({
2642
+ key: "slot-" + g,
2646
2643
  layout: "vertical"
2647
- }, { ref_for: !0 }, b.props, {
2648
- onChange: l[3] || (l[3] = (k) => e(m)(k.name, k.value)),
2649
- onClear: l[4] || (l[4] = (k) => {
2650
- e(d)(k), e(m)(k, void 0);
2644
+ }, { ref_for: !0 }, h.props, {
2645
+ onChange: o[3] || (o[3] = (k) => e(m)(k.name, k.value)),
2646
+ onClear: o[4] || (o[4] = (k) => {
2647
+ e(c)(k), e(m)(k, void 0);
2651
2648
  }),
2652
- modelValue: e(r)[b.props.name],
2653
- "onUpdate:modelValue": (k) => e(r)[b.props.name] = k,
2649
+ modelValue: e(r)[h.props.name],
2650
+ "onUpdate:modelValue": (k) => e(r)[h.props.name] = k,
2654
2651
  showClean: !0
2655
2652
  }), null, 16, ["modelValue", "onUpdate:modelValue"]))), 128))
2656
2653
  ])
2657
2654
  ])) : V("", !0);
2658
2655
  }
2659
- }), ro = /* @__PURE__ */ O({
2656
+ }), Ve = /* @__PURE__ */ O({
2660
2657
  __name: "filter",
2661
2658
  props: {
2662
2659
  schema: {},
@@ -2667,22 +2664,22 @@ const Tl = /* @__PURE__ */ J(Ll, [["render", Il]]), Ol = {
2667
2664
  limit: { default: 3 }
2668
2665
  },
2669
2666
  emits: ["change", "clear", "clearAll"],
2670
- setup(p, { emit: a }) {
2671
- const v = p, t = _(v.value ?? {}), s = a;
2672
- function r(f, n) {
2667
+ setup(i, { emit: n }) {
2668
+ const v = i, t = _(v.value ?? {}), s = n;
2669
+ function r(p, a) {
2673
2670
  t.value = {
2674
2671
  ...t.value,
2675
- [f]: n
2672
+ [p]: a
2676
2673
  }, s("change", {
2677
2674
  data: Z(t.value),
2678
- name: f,
2679
- value: n
2675
+ name: p,
2676
+ value: a
2680
2677
  });
2681
2678
  }
2682
- function i(f) {
2683
- delete t.value[f], s("clear", {
2679
+ function d(p) {
2680
+ delete t.value[p], s("clear", {
2684
2681
  data: Z(t.value),
2685
- name: f
2682
+ name: p
2686
2683
  });
2687
2684
  }
2688
2685
  function m() {
@@ -2695,8 +2692,8 @@ const Tl = /* @__PURE__ */ J(Ll, [["render", Il]]), Ol = {
2695
2692
  value: null
2696
2693
  });
2697
2694
  }
2698
- const d = _({});
2699
- function h() {
2695
+ const c = _({});
2696
+ function x() {
2700
2697
  switch (v.view) {
2701
2698
  case "inline":
2702
2699
  return Ce;
@@ -2710,35 +2707,38 @@ const Tl = /* @__PURE__ */ J(Ll, [["render", Il]]), Ol = {
2710
2707
  }
2711
2708
  return M(
2712
2709
  () => v.schema,
2713
- (f) => {
2714
- if (!f) {
2715
- d.value = {};
2710
+ (p) => {
2711
+ if (!p) {
2712
+ c.value = {};
2716
2713
  return;
2717
2714
  }
2718
- if (Array.isArray(f) && !f.length) {
2719
- d.value = {};
2715
+ if (Array.isArray(p) && !p.length) {
2716
+ c.value = {};
2720
2717
  return;
2721
2718
  }
2722
- Array.isArray(f) ? d.value = f.filter((n) => n.type).reduce((n, l) => (Object.assign(l, { name: l.id || l.name, type: l.type.toLowerCase() }), n[l.name] = l, l.data && !l.api && !l.options && Object.assign(l, { api: `/api/suggest/${l.data}` }), n), {}) : (Object.entries(f).forEach(([n, l]) => {
2723
- Object.assign(l, { name: n || l.name || l.id, type: l.type.toLowerCase() });
2724
- }), d.value = { ...f });
2719
+ Array.isArray(p) ? c.value = p.filter((a) => a.type).reduce((a, o) => (Object.assign(o, { name: o.id || o.name, type: o.type.toLowerCase() }), a[o.name] = o, o.data && !o.api && !o.options && Object.assign(o, { api: `/api/suggest/${o.data}` }), a), {}) : (Object.entries(p).forEach(([a, o]) => {
2720
+ Object.assign(o, { name: a || o.name || o.id, type: o.type.toLowerCase() });
2721
+ }), c.value = { ...p });
2725
2722
  },
2726
2723
  { immediate: !0, deep: !0 }
2727
- ), (f, n) => (c(), S(ee(h()), P(v, {
2728
- schema: d.value,
2729
- onChange: n[0] || (n[0] = (l) => r(l.name, l.value)),
2730
- onClear: n[1] || (n[1] = (l) => i(l.name)),
2724
+ ), (p, a) => (f(), S(ee(x()), P(v, {
2725
+ schema: c.value,
2726
+ onChange: a[0] || (a[0] = (o) => r(o.name, o.value)),
2727
+ onClear: a[1] || (a[1] = (o) => d(o.name)),
2731
2728
  onClearAll: m
2732
2729
  }), {
2733
2730
  default: le(() => [
2734
- ue(f.$slots, "default")
2731
+ ue(p.$slots, "default")
2735
2732
  ]),
2736
2733
  _: 3
2737
2734
  }, 16, ["schema"]));
2738
2735
  }
2739
2736
  });
2737
+ Ve.install = function(n) {
2738
+ n.component("VsFilter", Ve);
2739
+ };
2740
2740
  export {
2741
- ro as Filter,
2742
- ne as FilterField,
2743
- ro as default
2741
+ Ve as Filter,
2742
+ ae as FilterField,
2743
+ Ve as default
2744
2744
  };