@mci-ui/mci-ui 0.0.76 → 0.0.78

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,75 +1,75 @@
1
- import { jsx as e, jsxs as c, Fragment as he } from "react/jsx-runtime";
2
- import { AltArrowRight as be, Star2 as We, AltArrowDown as Fe, EyeClosed as Qe, Eye as Oe, Calendar as et, AltArrowLeft as ke, DoubleAltArrowLeft as tt, DoubleAltArrowRight as rt, ConfoundedSquare as nt, SortVertical as lt, SortFromTopToBottom as at, SortFromBottomToTop as st, Upload as ot, File as Te, FileText as Se, MusicNote as it, VideoFramePlayHorizontal as ct, Gallery as dt, MenuDots as ut, Refresh as mt, InfoCircle as ht, DangerCircle as ft, CloseCircle as pt, CheckCircle as gt, Phone as bt, TransferVertical as xt } from "@solar-icons/react";
3
- import { clsx as wt } from "clsx";
4
- import { twMerge as vt } from "tailwind-merge";
5
- import * as re from "react";
6
- import { memo as yt, useState as _, useMemo as Z, useCallback as R, useRef as le, useEffect as J, forwardRef as fe } from "react";
7
- import { createRoot as Nt } from "react-dom/client";
1
+ import { jsx as e, jsxs as o, Fragment as me } from "react/jsx-runtime";
2
+ import { AltArrowRight as xe, Star2 as Ve, AltArrowDown as Ee, EyeClosed as rt, Eye as He, Calendar as nt, AltArrowLeft as Ce, DoubleAltArrowLeft as lt, DoubleAltArrowRight as st, ConfoundedSquare as at, SortVertical as ot, SortFromTopToBottom as it, SortFromBottomToTop as ct, Upload as dt, File as $e, FileText as Ae, MusicNote as ut, VideoFramePlayHorizontal as ht, Gallery as mt, MenuDots as ft, Refresh as pt, InfoCircle as gt, DangerCircle as bt, CloseCircle as xt, CheckCircle as wt, Phone as vt, TransferVertical as yt } from "@solar-icons/react";
3
+ import { clsx as Nt } from "clsx";
4
+ import { twMerge as kt } from "tailwind-merge";
5
+ import * as ne from "react";
6
+ import { memo as Ct, useState as H, useMemo as U, useCallback as P, useRef as de, useEffect as ee, forwardRef as fe } from "react";
7
+ import { createRoot as Mt } from "react-dom/client";
8
8
  function n(...t) {
9
- return vt(wt(t));
9
+ return kt(Nt(t));
10
10
  }
11
- function Ee(t) {
11
+ function Le(t) {
12
12
  return { handleEscape: (r) => {
13
13
  r.key === "Escape" && t();
14
14
  } };
15
15
  }
16
- function De(t, a) {
17
- return { handleClick: (l) => {
18
- t.current && !t.current.contains(l.target) && a();
16
+ function Se(t, l) {
17
+ return { handleClick: (s) => {
18
+ t.current && !t.current.contains(s.target) && l();
19
19
  } };
20
20
  }
21
- function qt({
21
+ function Qt({
22
22
  items: t,
23
- variant: a = "blue",
23
+ variant: l = "blue",
24
24
  className: r
25
25
  }) {
26
- const l = a === "blue", p = l ? "hover:text-blue-600" : "hover:text-yellow-500", i = l ? "text-blue-600" : "text-yellow-500";
27
- return /* @__PURE__ */ e("nav", { className: n("flex items-center", r), "aria-label": "Breadcrumb", children: t.map((s, d) => {
28
- const C = d === t.length - 1;
29
- return /* @__PURE__ */ c("div", { className: "flex items-center", children: [
30
- C ? /* @__PURE__ */ c("span", { className: n("flex items-center gap-x-2 font-medium", i), children: [
31
- s.icon,
32
- /* @__PURE__ */ e("span", { children: s.label })
33
- ] }) : /* @__PURE__ */ c(
26
+ const s = l === "blue", m = s ? "hover:text-blue-600" : "hover:text-yellow-500", u = s ? "text-blue-600" : "text-yellow-500";
27
+ return /* @__PURE__ */ e("nav", { className: n("flex items-center", r), "aria-label": "Breadcrumb", children: t.map((a, c) => {
28
+ const N = c === t.length - 1;
29
+ return /* @__PURE__ */ o("div", { className: "flex items-center", children: [
30
+ N ? /* @__PURE__ */ o("span", { className: n("flex items-center gap-x-2 font-medium", u), children: [
31
+ a.icon,
32
+ /* @__PURE__ */ e("span", { children: a.label })
33
+ ] }) : /* @__PURE__ */ o(
34
34
  "a",
35
35
  {
36
- href: s.href ?? "#",
37
- onClick: (k) => {
38
- s.onClick && (k.preventDefault(), s.onClick());
36
+ href: a.href ?? "#",
37
+ onClick: (y) => {
38
+ a.onClick && (y.preventDefault(), a.onClick());
39
39
  },
40
40
  className: n(
41
41
  "flex items-center gap-x-2 transition-all text-sm font-normal text-slate-500",
42
- p
42
+ m
43
43
  ),
44
44
  children: [
45
- s.icon,
46
- /* @__PURE__ */ e("span", { children: s.label })
45
+ a.icon,
46
+ /* @__PURE__ */ e("span", { children: a.label })
47
47
  ]
48
48
  }
49
49
  ),
50
- !C && /* @__PURE__ */ e("span", { className: "mx-2 flex items-center", children: /* @__PURE__ */ e(be, { weight: "Linear", size: 20, className: "text-slate-500" }) })
51
- ] }, d);
50
+ !N && /* @__PURE__ */ e("span", { className: "mx-2 flex items-center", children: /* @__PURE__ */ e(xe, { weight: "Linear", size: 20, className: "text-slate-500" }) })
51
+ ] }, c);
52
52
  }) });
53
53
  }
54
- function Kt({
54
+ function er({
55
55
  children: t,
56
- text: a,
56
+ text: l,
57
57
  icon: r,
58
- iconPosition: l = "left",
59
- size: p = "base",
60
- variant: i = "primary",
61
- color: s = "yellow",
62
- loading: d = !1,
63
- disabled: C = !1,
64
- onClick: k,
65
- className: M,
66
- type: D = "button"
58
+ iconPosition: s = "left",
59
+ size: m = "base",
60
+ variant: u = "primary",
61
+ color: a = "yellow",
62
+ loading: c = !1,
63
+ disabled: N = !1,
64
+ onClick: y,
65
+ className: C,
66
+ type: F = "button"
67
67
  }) {
68
- const A = t ?? a, E = {
68
+ const I = t ?? l, R = {
69
69
  sm: "h-9 px-2 text-sm gap-1.5 rounded-lg leading-9 min-w-9",
70
70
  md: "h-10 px-2 text-base gap-2 rounded-lg leading-10 min-w-10",
71
71
  base: "h-12 px-4 text-base gap-2 rounded-xl leading-12 min-w-12"
72
- }, m = i === "primary" || i === "secondary" || i === "outline" ? {
72
+ }, b = u === "primary" || u === "secondary" || u === "outline" ? {
73
73
  blue: {
74
74
  primary: "bg-blue-600 text-white hover:bg-blue-700 active:bg-blue-800 focus:ring-2 focus:ring-[rgba(21,93,252,0.25)]",
75
75
  secondary: "bg-blue-100 text-blue-600 hover:bg-blue-200 active:bg-blue-200 active:border active:border-blue-600 focus:ring-2 focus:ring-[rgba(21,93,252,0.25)]",
@@ -80,34 +80,34 @@ function Kt({
80
80
  secondary: "bg-yellow-50 text-yellow-500 hover:bg-yellow-100 active:bg-yellow-100 active:border active:border-yellow-500 focus:ring-2 focus:ring-yellow-200",
81
81
  outline: "border border-yellow-500 text-yellow-500 hover:border-yellow-600 hover:text-yellow-600 active:border-yellow-700 active:text-yellow-700 focus:ring-2 focus:ring-yellow-200"
82
82
  }
83
- }[s][i] : {
83
+ }[a][u] : {
84
84
  danger: "bg-red-600 text-white hover:bg-red-700 active:bg-red-800 focus:ring-2 focus:shadow-red",
85
85
  tertiary: "bg-slate-100 text-black hover:bg-slate-200 active:bg-slate-300 focus:ring-2 focus:shadow-slate"
86
- }[i], b = C || d, w = b ? i === "outline" ? "border-slate-200 bg-white text-slate-400 cursor-not-allowed hover:bg-transparent hover:border-slate-200 hover:text-slate-400 active:border-slate-200 active:text-slate-400 active:bg-transparent focus:bg-transparent focus:ring-0" : "bg-slate-200 text-slate-400 cursor-not-allowed hover:bg-slate-200 active:bg-slate-200 focus:ring-0" : "";
87
- return /* @__PURE__ */ c(
86
+ }[u], j = N || c, S = j ? u === "outline" ? "border-slate-200 bg-white text-slate-400 cursor-not-allowed hover:bg-transparent hover:border-slate-200 hover:text-slate-400 active:border-slate-200 active:text-slate-400 active:bg-transparent focus:bg-transparent focus:ring-0" : "bg-slate-200 text-slate-400 cursor-not-allowed hover:bg-slate-200 active:bg-slate-200 focus:ring-0" : "";
87
+ return /* @__PURE__ */ o(
88
88
  "button",
89
89
  {
90
- type: D,
91
- onClick: k,
92
- disabled: b,
90
+ type: F,
91
+ onClick: y,
92
+ disabled: j,
93
93
  className: n(
94
- "inline-flex items-center justify-center font-medium transition-all duration-200 cursor-pointer",
95
- E[p],
96
- m,
97
- !b && m,
98
- w,
99
- M
94
+ "inline-flex w-fit shrink-0 items-center justify-center whitespace-nowrap text-center font-medium transition-all duration-200 cursor-pointer",
95
+ R[m],
96
+ b,
97
+ !j && b,
98
+ S,
99
+ C
100
100
  ),
101
101
  children: [
102
- r && l === "left" && !d && /* @__PURE__ */ e("span", { className: "flex items-center", children: r }),
103
- A && /* @__PURE__ */ e("span", { children: A }),
104
- r && l === "right" && !d && /* @__PURE__ */ e("span", { className: "flex items-center", children: r }),
105
- d && /* @__PURE__ */ e(We, { weight: "Linear", size: 20, className: "animate-spin" })
102
+ r && s === "left" && !c && /* @__PURE__ */ e("span", { className: "flex items-center", children: r }),
103
+ I && /* @__PURE__ */ e("span", { className: "whitespace-nowrap", children: I }),
104
+ r && s === "right" && !c && /* @__PURE__ */ e("span", { className: "flex items-center", children: r }),
105
+ c && /* @__PURE__ */ e(Ve, { weight: "Linear", size: 20, className: "animate-spin" })
106
106
  ]
107
107
  }
108
108
  );
109
109
  }
110
- const kt = (t) => /* @__PURE__ */ re.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 11, height: 8, viewBox: "0 0 11 8", fill: "none", ...t }, /* @__PURE__ */ re.createElement("path", { d: "M0.625 3.76944L3.76944 6.91389L10.0694 0.625", stroke: "currentColor", strokeWidth: 1.25, strokeLinecap: "round", strokeLinejoin: "round" })), Ct = {
110
+ const Dt = (t) => /* @__PURE__ */ ne.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 11, height: 8, viewBox: "0 0 11 8", fill: "none", ...t }, /* @__PURE__ */ ne.createElement("path", { d: "M0.625 3.76944L3.76944 6.91389L10.0694 0.625", stroke: "currentColor", strokeWidth: 1.25, strokeLinecap: "round", strokeLinejoin: "round" })), St = {
111
111
  blue: {
112
112
  border: "border-blue-600",
113
113
  bg: "bg-blue-600",
@@ -120,117 +120,117 @@ const kt = (t) => /* @__PURE__ */ re.createElement("svg", { xmlns: "http://www.w
120
120
  hover: "hover:border-yellow-500 hover:bg-yello-100",
121
121
  focus: "focus:ring-2 focus:ring-yellow-300"
122
122
  }
123
- }, Me = yt(function({
124
- type: a = "checkbox",
123
+ }, De = Ct(function({
124
+ type: l = "checkbox",
125
125
  label: r,
126
- supportText: l,
127
- checked: p,
128
- onChange: i,
129
- error: s,
130
- disabled: d = !1,
131
- required: C = !1,
132
- className: k,
133
- variant: M = "yellow",
134
- name: D,
135
- value: A
126
+ supportText: s,
127
+ checked: m,
128
+ onChange: u,
129
+ error: a,
130
+ disabled: c = !1,
131
+ required: N = !1,
132
+ className: y,
133
+ variant: C = "yellow",
134
+ name: F,
135
+ value: I
136
136
  }) {
137
- const [E, v] = _(!1), u = a === "radio", m = Z(
138
- () => p ?? E,
139
- [p, E]
140
- ), b = R(
141
- (y) => {
142
- d || (p === void 0 && v(y.target.checked), i?.(y));
137
+ const [R, w] = H(!1), k = l === "radio", b = U(
138
+ () => m ?? R,
139
+ [m, R]
140
+ ), j = P(
141
+ (h) => {
142
+ c || (m === void 0 && w(h.target.checked), u?.(h));
143
143
  },
144
- [p, i, d]
145
- ), w = Z(() => {
146
- if (d) {
147
- const L = "border-slate-200 bg-slate-100";
148
- return u ? {
149
- container: L,
150
- dot: m ? "bg-slate-300" : "bg-transparent",
144
+ [m, u, c]
145
+ ), S = U(() => {
146
+ if (c) {
147
+ const M = "border-slate-200 bg-slate-100";
148
+ return k ? {
149
+ container: M,
150
+ dot: b ? "bg-slate-300" : "bg-transparent",
151
151
  check: "text-slate-400"
152
152
  } : {
153
- container: L,
153
+ container: M,
154
154
  dot: "",
155
- check: m ? "text-slate-400" : "text-transparent"
155
+ check: b ? "text-slate-400" : "text-transparent"
156
156
  };
157
157
  }
158
- const y = Ct[M];
159
- if (u) {
160
- const L = n(
158
+ const h = St[C];
159
+ if (k) {
160
+ const M = n(
161
161
  "border transition-all duration-200",
162
- m ? y.border : "border-slate-400",
163
- !m && y.hover,
164
- y.focus,
165
- m && ""
166
- ), j = n(
162
+ b ? h.border : "border-slate-400",
163
+ !b && h.hover,
164
+ h.focus,
165
+ b && ""
166
+ ), D = n(
167
167
  "transition-all duration-200 rounded-full",
168
- m ? y.bg : "bg-transparent"
168
+ b ? h.bg : "bg-transparent"
169
169
  );
170
170
  return {
171
- container: L,
172
- dot: j,
171
+ container: M,
172
+ dot: D,
173
173
  check: ""
174
174
  };
175
175
  }
176
176
  return {
177
177
  container: n(
178
178
  "border transition-all duration-200",
179
- m ? n(y.bg, y.border) : "border-slate-400",
180
- !m && y.hover,
181
- y.focus
179
+ b ? n(h.bg, h.border) : "border-slate-400",
180
+ !b && h.hover,
181
+ h.focus
182
182
  ),
183
183
  dot: "",
184
- check: m ? "text-white" : "text-transparent"
184
+ check: b ? "text-white" : "text-transparent"
185
185
  };
186
- }, [u, m, d, M]), h = Z(() => !r && !l ? null : /* @__PURE__ */ c("div", { className: "flex flex-col", children: [
187
- r && /* @__PURE__ */ c(
186
+ }, [k, b, c, C]), x = U(() => !r && !s ? null : /* @__PURE__ */ o("div", { className: "flex flex-col", children: [
187
+ r && /* @__PURE__ */ o(
188
188
  "span",
189
189
  {
190
190
  className: n(
191
191
  "text-base font-medium text-slate-700",
192
- s && "text-red-600",
193
- d && "text-slate-400"
192
+ a && "text-red-600",
193
+ c && "text-slate-400"
194
194
  ),
195
195
  children: [
196
196
  r,
197
- C && /* @__PURE__ */ e("span", { className: "text-extra-small text-red-600 ml-1", children: "*" })
197
+ N && /* @__PURE__ */ e("span", { className: "text-extra-small text-red-600 ml-1", children: "*" })
198
198
  ]
199
199
  }
200
200
  ),
201
- l && /* @__PURE__ */ e(
201
+ s && /* @__PURE__ */ e(
202
202
  "span",
203
203
  {
204
204
  className: n(
205
205
  "text-slate-500 text-base font-normal",
206
- d && "text-slate-400"
206
+ c && "text-slate-400"
207
207
  ),
208
- children: l
208
+ children: s
209
209
  }
210
210
  )
211
- ] }), [r, l, s, d, C]);
212
- return /* @__PURE__ */ c("div", { className: n("flex items-start", k), children: [
213
- /* @__PURE__ */ c(
211
+ ] }), [r, s, a, c, N]);
212
+ return /* @__PURE__ */ o("div", { className: n("flex items-start", y), children: [
213
+ /* @__PURE__ */ o(
214
214
  "label",
215
215
  {
216
216
  className: n(
217
217
  "flex items-start gap-2 select-none",
218
- d ? "cursor-not-allowed" : "cursor-pointer"
218
+ c ? "cursor-not-allowed" : "cursor-pointer"
219
219
  ),
220
220
  children: [
221
221
  /* @__PURE__ */ e(
222
222
  "input",
223
223
  {
224
- type: a,
225
- checked: m,
226
- onChange: b,
227
- disabled: d,
228
- required: C,
224
+ type: l,
225
+ checked: b,
226
+ onChange: j,
227
+ disabled: c,
228
+ required: N,
229
229
  className: "sr-only",
230
- "aria-invalid": !!s,
231
- "aria-describedby": s ? `${D}-error` : void 0,
232
- name: D,
233
- value: A
230
+ "aria-invalid": !!a,
231
+ "aria-describedby": a ? `${F}-error` : void 0,
232
+ name: F,
233
+ value: I
234
234
  }
235
235
  ),
236
236
  /* @__PURE__ */ e(
@@ -238,71 +238,71 @@ const kt = (t) => /* @__PURE__ */ re.createElement("svg", { xmlns: "http://www.w
238
238
  {
239
239
  className: n(
240
240
  "relative flex items-center justify-center",
241
- u ? "w-5 h-5 rounded-full" : "w-5 h-5 rounded",
242
- w.container
241
+ k ? "w-5 h-5 rounded-full" : "w-5 h-5 rounded",
242
+ S.container
243
243
  ),
244
- children: u ? /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e(
244
+ children: k ? /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center", children: /* @__PURE__ */ e(
245
245
  "span",
246
246
  {
247
247
  className: n(
248
248
  "w-3 h-3 rounded-full transition-all duration-200",
249
- w.dot,
250
- m ? "opacity-100 scale-100" : "opacity-0 scale-50"
249
+ S.dot,
250
+ b ? "opacity-100 scale-100" : "opacity-0 scale-50"
251
251
  )
252
252
  }
253
253
  ) }) : /* @__PURE__ */ e(
254
- kt,
254
+ Dt,
255
255
  {
256
256
  className: n(
257
257
  "w-4 h-4 stroke-[2.5px] transition-opacity duration-200",
258
- w.check,
259
- m ? "opacity-100" : "opacity-0"
258
+ S.check,
259
+ b ? "opacity-100" : "opacity-0"
260
260
  )
261
261
  }
262
262
  )
263
263
  }
264
264
  ),
265
- h
265
+ x
266
266
  ]
267
267
  }
268
268
  ),
269
- s && /* @__PURE__ */ e("p", { id: `${D}-error`, className: "mt-1 text-extra-small text-red-600", children: s })
269
+ a && /* @__PURE__ */ e("p", { id: `${F}-error`, className: "mt-1 text-extra-small text-red-600", children: a })
270
270
  ] });
271
271
  });
272
- Me.displayName = "MciCheck";
273
- function Jt({
272
+ De.displayName = "MciCheck";
273
+ function tr({
274
274
  title: t,
275
- children: a,
275
+ children: l,
276
276
  defaultOpen: r = !1,
277
- icon: l,
278
- className: p,
279
- contentClassName: i
277
+ icon: s,
278
+ className: m,
279
+ contentClassName: u
280
280
  }) {
281
- const [s, d] = _(r), [C, k] = _(0), M = le(null);
282
- return J(() => {
283
- M.current && k(s ? M.current.scrollHeight : 0);
284
- }, [s]), /* @__PURE__ */ c("div", { className: n("overflow-hidden rounded-xl border border-slate-200", p), children: [
285
- /* @__PURE__ */ c(
281
+ const [a, c] = H(r), [N, y] = H(0), C = de(null);
282
+ return ee(() => {
283
+ C.current && y(a ? C.current.scrollHeight : 0);
284
+ }, [a]), /* @__PURE__ */ o("div", { className: n("overflow-hidden rounded-xl border border-slate-200", m), children: [
285
+ /* @__PURE__ */ o(
286
286
  "button",
287
287
  {
288
- onClick: () => d(!s),
288
+ onClick: () => c(!a),
289
289
  className: n(
290
290
  "flex w-full items-center justify-between p-5 transition-all duration-300 hover:cursor-pointer",
291
- s ? "border-b border-slate-200" : "border-b border-transparent"
291
+ a ? "border-b border-slate-200" : "border-b border-transparent"
292
292
  ),
293
293
  children: [
294
- /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
295
- l && /* @__PURE__ */ e("span", { className: "shrink-0", children: l }),
294
+ /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
295
+ s && /* @__PURE__ */ e("span", { className: "shrink-0", children: s }),
296
296
  /* @__PURE__ */ e("div", { className: n("text-base font-medium text-black"), children: t })
297
297
  ] }),
298
298
  /* @__PURE__ */ e(
299
- Fe,
299
+ Ee,
300
300
  {
301
301
  weight: "Linear",
302
302
  size: 20,
303
303
  className: n(
304
304
  "shrink-0 transition-transform duration-300 text-slate-400",
305
- s && "rotate-180"
305
+ a && "rotate-180"
306
306
  )
307
307
  }
308
308
  )
@@ -316,43 +316,43 @@ function Jt({
316
316
  "overflow-hidden transition-all duration-300 ease-out"
317
317
  ),
318
318
  style: {
319
- height: `${C}px`
319
+ height: `${N}px`
320
320
  },
321
- children: /* @__PURE__ */ e("div", { ref: M, className: n("p-5", i), children: a })
321
+ children: /* @__PURE__ */ e("div", { ref: C, className: n("p-5", u), children: l })
322
322
  }
323
323
  )
324
324
  ] });
325
325
  }
326
- const pe = (t) => /* @__PURE__ */ re.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", ...t }, /* @__PURE__ */ re.createElement("path", { d: "M7.75739 7.75735L16.2427 16.2426", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ re.createElement("path", { d: "M7.75733 16.2426L16.2426 7.75735", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }));
327
- function Gt({
326
+ const pe = (t) => /* @__PURE__ */ ne.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", width: 24, height: 24, viewBox: "0 0 24 24", fill: "none", ...t }, /* @__PURE__ */ ne.createElement("path", { d: "M7.75739 7.75735L16.2427 16.2426", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }), /* @__PURE__ */ ne.createElement("path", { d: "M7.75733 16.2426L16.2426 7.75735", stroke: "currentColor", strokeWidth: 1.5, strokeLinecap: "round", strokeLinejoin: "round" }));
327
+ function rr({
328
328
  isOpen: t,
329
- onClose: a,
329
+ onClose: l,
330
330
  position: r = "right",
331
- children: l,
332
- footer: p,
333
- title: i,
334
- description: s,
335
- showCloseButton: d = !0,
336
- drawerClassName: C,
337
- contentClassName: k,
338
- closeOnOverlayClick: M = !0,
339
- closeOnEscape: D = !0,
340
- width: A = 572
331
+ children: s,
332
+ footer: m,
333
+ title: u,
334
+ description: a,
335
+ showCloseButton: c = !0,
336
+ drawerClassName: N,
337
+ contentClassName: y,
338
+ closeOnOverlayClick: C = !0,
339
+ closeOnEscape: F = !0,
340
+ width: I = 572
341
341
  }) {
342
- const E = le(null), v = le(null), u = R(() => a(), [a]);
343
- J(() => {
344
- t ? (v.current = document.activeElement, E.current?.focus()) : v.current?.focus();
345
- }, [t]), J(() => (t && (document.body.style.overflow = "hidden"), () => {
342
+ const R = de(null), w = de(null), k = P(() => l(), [l]);
343
+ ee(() => {
344
+ t ? (w.current = document.activeElement, R.current?.focus()) : w.current?.focus();
345
+ }, [t]), ee(() => (t && (document.body.style.overflow = "hidden"), () => {
346
346
  document.body.style.overflow = "unset";
347
347
  }), [t]);
348
- const m = Z(
348
+ const b = U(
349
349
  () => ({
350
- "--drawer-w": typeof A == "number" ? `${A}px` : A,
350
+ "--drawer-w": typeof I == "number" ? `${I}px` : I,
351
351
  transform: t ? "translateX(0)" : r === "right" ? "translateX(calc(100% + 48px))" : "translateX(calc(-100% - 48px))"
352
352
  }),
353
- [t, A, r]
354
- ), b = !!(i || s || d), w = r === "right" ? "top-0 bottom-0 right-0 left-3 rounded-l-3xl rounded-r-none" : "top-0 bottom-0 left-0 right-3 rounded-r-3xl rounded-l-none", h = r === "right" ? "sm:top-6 sm:bottom-6 sm:right-6 sm:left-auto" : "sm:top-6 sm:bottom-6 sm:left-6 sm:right-auto";
355
- return /* @__PURE__ */ c(he, { children: [
353
+ [t, I, r]
354
+ ), j = !!(u || a || c), S = r === "right" ? "top-0 bottom-0 right-0 left-3 rounded-l-3xl rounded-r-none" : "top-0 bottom-0 left-0 right-3 rounded-r-3xl rounded-l-none", x = r === "right" ? "sm:top-6 sm:bottom-6 sm:right-6 sm:left-auto" : "sm:top-6 sm:bottom-6 sm:left-6 sm:right-auto";
355
+ return /* @__PURE__ */ o(me, { children: [
356
356
  /* @__PURE__ */ e(
357
357
  "div",
358
358
  {
@@ -360,49 +360,50 @@ function Gt({
360
360
  "fixed inset-0 z-50 bg-black/40 transition-opacity duration-300",
361
361
  t ? "opacity-100 visible cursor-pointer" : "opacity-0 invisible pointer-events-none"
362
362
  ),
363
- onClick: M ? u : void 0,
363
+ onClick: C ? k : void 0,
364
364
  "aria-hidden": "true"
365
365
  }
366
366
  ),
367
- /* @__PURE__ */ c(
367
+ /* @__PURE__ */ o(
368
368
  "div",
369
369
  {
370
- ref: E,
370
+ ref: R,
371
371
  tabIndex: -1,
372
- style: m,
372
+ style: b,
373
373
  className: n(
374
374
  "fixed z-50 flex flex-col bg-white outline-none min-h-0",
375
- "transition-transform duration-300 ease-in-out",
376
- "shadow-2xl",
377
- w,
375
+ "transition-[transform,opacity,visibility] duration-300 ease-in-out",
376
+ t ? "opacity-100 visible pointer-events-auto shadow-2xl" : "opacity-0 invisible pointer-events-none shadow-none",
377
+ S,
378
378
  "h-[100dvh]",
379
379
  "pb-[env(safe-area-inset-bottom)]",
380
- h,
380
+ x,
381
381
  "sm:h-auto sm:rounded-2xl sm:pb-0",
382
382
  "sm:w-[var(--drawer-w)]",
383
- C
383
+ N
384
384
  ),
385
385
  role: "dialog",
386
386
  "aria-modal": "true",
387
- "aria-labelledby": i ? "drawer-title" : void 0,
387
+ "aria-hidden": !t,
388
+ "aria-labelledby": u ? "drawer-title" : void 0,
388
389
  children: [
389
- b && /* @__PURE__ */ c("div", { className: "flex items-start justify-between border-b border-slate-200 shrink-0 px-4 py-4 sm:p-6", children: [
390
- (i || s) && /* @__PURE__ */ c("div", { className: "block pr-3", children: [
391
- i && /* @__PURE__ */ e(
390
+ j && /* @__PURE__ */ o("div", { className: "flex items-start justify-between border-b border-slate-200 shrink-0 px-4 py-4 sm:p-6", children: [
391
+ (u || a) && /* @__PURE__ */ o("div", { className: "block pr-3", children: [
392
+ u && /* @__PURE__ */ e(
392
393
  "h2",
393
394
  {
394
395
  id: "drawer-title",
395
396
  className: "font-semibold text-black text-xl leading-tight sm:text-h3",
396
- children: i
397
+ children: u
397
398
  }
398
399
  ),
399
- s && /* @__PURE__ */ e("p", { className: "text-sm sm:text-base text-slate-base font-normal mt-2", children: s })
400
+ a && /* @__PURE__ */ e("p", { className: "text-sm sm:text-base text-slate-base font-normal mt-2", children: a })
400
401
  ] }),
401
- d && /* @__PURE__ */ e(
402
+ c && /* @__PURE__ */ e(
402
403
  "button",
403
404
  {
404
405
  type: "button",
405
- onClick: u,
406
+ onClick: k,
406
407
  className: "bg-slate-100 rounded-xl w-11 h-11 sm:w-12 sm:h-12 hover:cursor-pointer text-black transition flex items-center justify-center group active:scale-95",
407
408
  children: /* @__PURE__ */ e(pe, { className: "h-5 w-5 sm:h-6 sm:w-6 transition-transform duration-300 group-hover:rotate-180" })
408
409
  }
@@ -413,55 +414,55 @@ function Gt({
413
414
  {
414
415
  className: n(
415
416
  "flex-1 min-h-0 overflow-y-auto scrollbar-thin scrollbar-thumb-slate-200 px-4 py-4 sm:p-6",
416
- k
417
+ y
417
418
  ),
418
- children: l
419
+ children: s
419
420
  }
420
421
  ),
421
- p && /* @__PURE__ */ e("div", { className: "shrink-0 flex items-center justify-end border-t border-slate-200 px-4 py-4 sm:p-6 gap-3", children: p })
422
+ m && /* @__PURE__ */ e("div", { className: "shrink-0 flex items-center justify-end border-t border-slate-200 px-4 py-4 sm:p-6 gap-3 [&>*]:w-fit [&>*]:shrink-0 [&>*]:whitespace-nowrap", children: m })
422
423
  ]
423
424
  }
424
425
  )
425
426
  ] });
426
427
  }
427
- const Le = fe(
428
+ const Ie = fe(
428
429
  ({
429
430
  label: t,
430
- placeholder: a,
431
+ placeholder: l,
431
432
  type: r = "text",
432
- icon: l,
433
- rightIcon: p,
434
- iconPosition: i = "left",
435
- size: s = "base",
436
- error: d,
437
- disabled: C = !1,
438
- required: k = !1,
439
- value: M,
440
- onChange: D,
441
- onFocus: A,
442
- onBlur: E,
443
- className: v,
444
- name: u,
445
- maxLength: m = 250,
446
- onClear: b,
447
- showClearButton: w = !1,
448
- step: h,
449
- autoComplete: y = "off"
450
- }, $) => {
451
- const [L, j] = _(!1), [o, N] = _(""), [T, Y] = _(!1), q = M ?? o, B = r === "password", P = w && !!q && !C, W = l && i === "left", Q = l && i === "right" || p || B, ne = Q || P, K = () => {
452
- j(!0), A?.();
453
- }, ae = () => {
454
- j(!1), E?.();
455
- }, ce = (g) => {
456
- let I = g.target.value;
457
- r === "number" && m && I.length > m && (I = I.slice(0, m), g.target.value = I), M === void 0 && N(I), D?.(g);
458
- }, ee = () => Y((g) => !g), de = () => {
459
- M === void 0 && N(""), b?.();
460
- }, z = Z(
433
+ icon: s,
434
+ rightIcon: m,
435
+ iconPosition: u = "left",
436
+ size: a = "base",
437
+ error: c,
438
+ disabled: N = !1,
439
+ required: y = !1,
440
+ value: C,
441
+ onChange: F,
442
+ onFocus: I,
443
+ onBlur: R,
444
+ className: w,
445
+ name: k,
446
+ maxLength: b = 250,
447
+ onClear: j,
448
+ showClearButton: S = !1,
449
+ step: x,
450
+ autoComplete: h = "off"
451
+ }, A) => {
452
+ const [M, D] = H(!1), [i, d] = H(""), [v, E] = H(!1), B = C ?? i, z = r === "password", O = S && !!B && !N, W = s && u === "left", J = s && u === "right" || m || z, G = J || O, K = () => {
453
+ D(!0), I?.();
454
+ }, le = () => {
455
+ D(!1), R?.();
456
+ }, oe = (p) => {
457
+ let $ = p.target.value;
458
+ r === "number" && b && $.length > b && ($ = $.slice(0, b), p.target.value = $), C === void 0 && d($), F?.(p);
459
+ }, te = () => E((p) => !p), ie = () => {
460
+ C === void 0 && d(""), j?.();
461
+ }, Y = U(
461
462
  () => ({
462
463
  sm: {
463
464
  input: "h-9 text-sm",
464
- padding: W && Q ? "pl-7 pr-7" : W ? "pl-7 pr-2" : Q ? "pl-2 pr-7" : "px-2",
465
+ padding: W && J ? "pl-7 pr-7" : W ? "pl-7 pr-2" : J ? "pl-2 pr-7" : "px-2",
465
466
  icon: "w-4 h-4",
466
467
  leftIcon: "left-2",
467
468
  rightIcon: "right-2",
@@ -470,7 +471,7 @@ const Le = fe(
470
471
  },
471
472
  md: {
472
473
  input: "h-10 text-sm",
473
- padding: W && Q ? "pl-8 pr-8" : W ? "pl-8 pr-2" : Q ? "pl-2 pr-8" : "px-4",
474
+ padding: W && J ? "pl-8 pr-8" : W ? "pl-8 pr-2" : J ? "pl-2 pr-8" : "px-4",
474
475
  icon: "w-4 h-4",
475
476
  leftIcon: "left-2",
476
477
  rightIcon: "right-2",
@@ -479,7 +480,7 @@ const Le = fe(
479
480
  },
480
481
  base: {
481
482
  input: "h-12 text-base",
482
- padding: W && Q ? "pl-9 pr-9" : W ? "pl-9 pr-3" : Q ? "pl-3 pr-9" : "px-4",
483
+ padding: W && J ? "pl-9 pr-9" : W ? "pl-9 pr-3" : J ? "pl-3 pr-9" : "px-4",
483
484
  icon: "w-5 h-5",
484
485
  leftIcon: "left-3",
485
486
  rightIcon: "right-3",
@@ -487,50 +488,50 @@ const Le = fe(
487
488
  iconWrapper: "h-5"
488
489
  }
489
490
  }),
490
- [W, Q]
491
- ), G = Z(() => d ? "border-red-600 focus:border-red-600 shadow-red" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600", [d]), oe = Z(() => C ? "text-slate-400" : d ? "text-red-600" : L ? "text-black" : "text-slate-400", [d, L, C]);
492
- return /* @__PURE__ */ c("div", { className: n("w-full", v), children: [
493
- t && /* @__PURE__ */ c(
491
+ [W, J]
492
+ ), X = U(() => c ? "border-red-600 focus:border-red-600 shadow-red" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600", [c]), ae = U(() => N ? "text-slate-400" : c ? "text-red-600" : M ? "text-black" : "text-slate-400", [c, M, N]);
493
+ return /* @__PURE__ */ o("div", { className: n("w-full", w), children: [
494
+ t && /* @__PURE__ */ o(
494
495
  "label",
495
496
  {
496
- htmlFor: u,
497
+ htmlFor: k,
497
498
  className: n(
498
499
  "mb-2 block text-base font-medium",
499
- d ? "text-red-600" : "text-slate-700",
500
- z[s].labelFont
500
+ c ? "text-red-600" : "text-slate-700",
501
+ Y[a].labelFont
501
502
  ),
502
503
  children: [
503
504
  t,
504
- k && /* @__PURE__ */ e("span", { className: "text-extra-small text-red-600 ml-1", children: "*" })
505
+ y && /* @__PURE__ */ e("span", { className: "text-extra-small text-red-600 ml-1", children: "*" })
505
506
  ]
506
507
  }
507
508
  ),
508
- /* @__PURE__ */ c("div", { className: "relative flex items-center", children: [
509
+ /* @__PURE__ */ o("div", { className: "relative flex items-center", children: [
509
510
  /* @__PURE__ */ e(
510
511
  "input",
511
512
  {
512
- ref: $,
513
- name: u,
514
- type: B && T ? "text" : r,
515
- value: q,
516
- onChange: ce,
513
+ ref: A,
514
+ name: k,
515
+ type: z && v ? "text" : r,
516
+ value: B,
517
+ onChange: oe,
517
518
  onFocus: K,
518
- onBlur: ae,
519
- disabled: C,
520
- required: k,
521
- autoComplete: y,
522
- placeholder: a,
523
- step: h,
519
+ onBlur: le,
520
+ disabled: N,
521
+ required: y,
522
+ autoComplete: h,
523
+ placeholder: l,
524
+ step: x,
524
525
  className: n(
525
526
  "w-full border bg-white font-normal transition-all duration-300 ease-in-out outline-none",
526
- s === "base" ? "rounded-xl" : "rounded-lg",
527
+ a === "base" ? "rounded-xl" : "rounded-lg",
527
528
  "disabled:cursor-not-allowed disabled:border-slate-200 disabled:bg-slate-100 disabled:text-slate-400",
528
529
  "[appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",
529
- z[s].input,
530
- z[s].padding,
531
- G
530
+ Y[a].input,
531
+ Y[a].padding,
532
+ X
532
533
  ),
533
- maxLength: m
534
+ maxLength: b
534
535
  }
535
536
  ),
536
537
  W && /* @__PURE__ */ e(
@@ -539,75 +540,75 @@ const Le = fe(
539
540
  className: n(
540
541
  "absolute top-1/2 flex -translate-y-1/2 items-center justify-center",
541
542
  "transition-all duration-300",
542
- z[s].leftIcon,
543
- oe
543
+ Y[a].leftIcon,
544
+ ae
544
545
  ),
545
546
  children: /* @__PURE__ */ e(
546
547
  "div",
547
548
  {
548
- className: n("flex items-center justify-center", z[s].iconWrapper),
549
- children: /* @__PURE__ */ e("span", { className: n("flex items-center justify-center", z[s].icon), children: l })
549
+ className: n("flex items-center justify-center", Y[a].iconWrapper),
550
+ children: /* @__PURE__ */ e("span", { className: n("flex items-center justify-center", Y[a].icon), children: s })
550
551
  }
551
552
  )
552
553
  }
553
554
  ),
554
- ne && /* @__PURE__ */ c(
555
+ G && /* @__PURE__ */ o(
555
556
  "div",
556
557
  {
557
558
  className: n(
558
559
  "absolute top-1/2 flex -translate-y-1/2 items-center justify-center gap-2",
559
560
  "transition-all duration-300",
560
- z[s].rightIcon
561
+ Y[a].rightIcon
561
562
  ),
562
563
  children: [
563
- P && /* @__PURE__ */ e(
564
+ O && /* @__PURE__ */ e(
564
565
  "button",
565
566
  {
566
567
  type: "button",
567
- onClick: de,
568
+ onClick: ie,
568
569
  className: n(
569
570
  "flex items-center justify-center",
570
- z[s].iconWrapper,
571
+ Y[a].iconWrapper,
571
572
  "text-slate-base hover:text-black"
572
573
  ),
573
574
  style: { cursor: "pointer" },
574
- children: /* @__PURE__ */ e("span", { className: n("flex items-center justify-center", z[s].icon), children: /* @__PURE__ */ e(pe, { className: n("h-full w-full") }) })
575
+ children: /* @__PURE__ */ e("span", { className: n("flex items-center justify-center", Y[a].icon), children: /* @__PURE__ */ e(pe, { className: n("h-full w-full") }) })
575
576
  }
576
577
  ),
577
- p && !B && /* @__PURE__ */ e(
578
+ m && !z && /* @__PURE__ */ e(
578
579
  "div",
579
580
  {
580
- className: n("flex items-center justify-center", z[s].iconWrapper),
581
+ className: n("flex items-center justify-center", Y[a].iconWrapper),
581
582
  children: /* @__PURE__ */ e(
582
583
  "span",
583
584
  {
584
585
  className: n(
585
586
  "flex items-center justify-center",
586
- z[s].icon,
587
- oe
587
+ Y[a].icon,
588
+ ae
588
589
  ),
589
- children: p
590
+ children: m
590
591
  }
591
592
  )
592
593
  }
593
594
  ),
594
- B && /* @__PURE__ */ c(he, { children: [
595
- p && /* @__PURE__ */ e(
595
+ z && /* @__PURE__ */ o(me, { children: [
596
+ m && /* @__PURE__ */ e(
596
597
  "div",
597
598
  {
598
599
  className: n(
599
600
  "flex items-center justify-center",
600
- z[s].iconWrapper
601
+ Y[a].iconWrapper
601
602
  ),
602
603
  children: /* @__PURE__ */ e(
603
604
  "span",
604
605
  {
605
606
  className: n(
606
607
  "flex items-center justify-center",
607
- z[s].icon,
608
- oe
608
+ Y[a].icon,
609
+ ae
609
610
  ),
610
- children: p
611
+ children: m
611
612
  }
612
613
  )
613
614
  }
@@ -616,35 +617,35 @@ const Le = fe(
616
617
  "button",
617
618
  {
618
619
  type: "button",
619
- onClick: ee,
620
+ onClick: te,
620
621
  className: n(
621
622
  "flex items-center justify-center",
622
- z[s].iconWrapper,
623
- oe
623
+ Y[a].iconWrapper,
624
+ ae
624
625
  ),
625
626
  children: /* @__PURE__ */ e(
626
627
  "span",
627
628
  {
628
- className: n("flex items-center justify-center cursor-pointer", z[s].icon),
629
- children: T ? /* @__PURE__ */ e(Qe, { weight: "Linear", className: n("h-full w-full") }) : /* @__PURE__ */ e(Oe, { weight: "Linear", className: n("h-full w-full") })
629
+ className: n("flex items-center justify-center cursor-pointer", Y[a].icon),
630
+ children: v ? /* @__PURE__ */ e(rt, { weight: "Linear", className: n("h-full w-full") }) : /* @__PURE__ */ e(He, { weight: "Linear", className: n("h-full w-full") })
630
631
  }
631
632
  )
632
633
  }
633
634
  )
634
635
  ] }),
635
- l && i === "right" && !B && /* @__PURE__ */ e(
636
+ s && u === "right" && !z && /* @__PURE__ */ e(
636
637
  "div",
637
638
  {
638
- className: n("flex items-center justify-center", z[s].iconWrapper),
639
+ className: n("flex items-center justify-center", Y[a].iconWrapper),
639
640
  children: /* @__PURE__ */ e(
640
641
  "span",
641
642
  {
642
643
  className: n(
643
644
  "flex items-center justify-center",
644
- z[s].icon,
645
- oe
645
+ Y[a].icon,
646
+ ae
646
647
  ),
647
- children: l
648
+ children: s
648
649
  }
649
650
  )
650
651
  }
@@ -653,12 +654,12 @@ const Le = fe(
653
654
  }
654
655
  )
655
656
  ] }),
656
- d && /* @__PURE__ */ e("p", { className: "mt-2 animate-[slideDown_0.3s_ease-out] text-sm font-normal text-red-600", children: d })
657
+ c && /* @__PURE__ */ e("p", { className: "mt-2 animate-[slideDown_0.3s_ease-out] text-sm font-normal text-red-600", children: c })
657
658
  ] });
658
659
  }
659
660
  );
660
- Le.displayName = "MciInput";
661
- const Mt = {
661
+ Ie.displayName = "MciInput";
662
+ const At = {
662
663
  uz: {
663
664
  months: [
664
665
  "Yanvar",
@@ -755,231 +756,231 @@ const Mt = {
755
756
  weekdays: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
756
757
  weekdaysShort: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
757
758
  }
758
- }, Dt = fe(
759
+ }, Ft = fe(
759
760
  ({
760
761
  type: t = "date",
761
- value: a,
762
+ value: l,
762
763
  onChange: r,
763
- placeholder: l,
764
- label: p,
765
- disabled: i = !1,
766
- required: s = !1,
767
- className: d,
768
- format: C = "DD.MM.YYYY",
769
- minDate: k,
770
- maxDate: M,
771
- error: D,
772
- showClear: A = !0,
773
- allowManualInput: E = !0,
774
- locale: v = "uz",
775
- startView: u = "day",
776
- iconPosition: m = "left",
777
- align: b = "auto"
778
- }, w) => {
779
- const [h, y] = _(!1), [$, L] = _(
764
+ placeholder: s,
765
+ label: m,
766
+ disabled: u = !1,
767
+ required: a = !1,
768
+ className: c,
769
+ format: N = "DD.MM.YYYY",
770
+ minDate: y,
771
+ maxDate: C,
772
+ error: F,
773
+ showClear: I = !0,
774
+ allowManualInput: R = !0,
775
+ locale: w = "uz",
776
+ startView: k = "day",
777
+ iconPosition: b = "left",
778
+ align: j = "auto"
779
+ }, S) => {
780
+ const [x, h] = H(!1), [A, M] = H(
780
781
  t === "range" ? [null, null] : null
781
- ), [j, o] = _([null, null]), N = R((f) => {
782
+ ), [D, i] = H([null, null]), d = P((f) => {
782
783
  if (!f) return null;
783
- const x = new Date(f);
784
- return isNaN(x.getTime()) ? null : x;
785
- }, []), [T, Y] = _(/* @__PURE__ */ new Date()), [q, B] = _(u), [P, W] = _(0), [Q, ne] = _(""), [K, ae] = _(b), ce = le(null), ee = Z(() => {
786
- const f = a !== void 0 ? a : $;
787
- if (t === "date") return N(f);
788
- const x = f;
789
- return [N(x[0]), N(x[1])];
790
- }, [a, $, t, N]), de = Mt[v], z = R((f) => new Date(f.getFullYear(), f.getMonth(), f.getDate()), []), G = R(
784
+ const g = new Date(f);
785
+ return isNaN(g.getTime()) ? null : g;
786
+ }, []), [v, E] = H(/* @__PURE__ */ new Date()), [B, z] = H(k), [O, W] = H(0), [J, G] = H(""), [K, le] = H(j), oe = de(null), te = U(() => {
787
+ const f = l !== void 0 ? l : A;
788
+ if (t === "date") return d(f);
789
+ const g = f;
790
+ return [d(g[0]), d(g[1])];
791
+ }, [l, A, t, d]), ie = At[w], Y = P((f) => new Date(f.getFullYear(), f.getMonth(), f.getDate()), []), X = P(
791
792
  (f) => {
792
793
  if (!f) return "";
793
- const x = f.getDate().toString().padStart(2, "0"), S = (f.getMonth() + 1).toString().padStart(2, "0"), H = f.getFullYear();
794
- return C.replace("DD", x).replace("MM", S).replace("YYYY", H.toString());
794
+ const g = f.getDate().toString().padStart(2, "0"), L = (f.getMonth() + 1).toString().padStart(2, "0"), Z = f.getFullYear();
795
+ return N.replace("DD", g).replace("MM", L).replace("YYYY", Z.toString());
795
796
  },
796
- [C]
797
- ), oe = R((f) => {
797
+ [N]
798
+ ), ae = P((f) => {
798
799
  if (!f || f.length !== 10) return null;
799
- const x = f.replace(/\D/g, "");
800
- if (x.length !== 8) return null;
801
- const S = parseInt(x.slice(0, 2), 10), H = parseInt(x.slice(2, 4), 10), V = parseInt(x.slice(4, 8), 10);
802
- if (V < 1e3 || H < 1 || H > 12 || S < 1 || S > 31) return null;
803
- const te = new Date(V, H - 1, S);
804
- return te.getFullYear() !== V || te.getMonth() !== H - 1 || te.getDate() !== S ? null : te;
805
- }, []), g = R(
800
+ const g = f.replace(/\D/g, "");
801
+ if (g.length !== 8) return null;
802
+ const L = parseInt(g.slice(0, 2), 10), Z = parseInt(g.slice(2, 4), 10), q = parseInt(g.slice(4, 8), 10);
803
+ if (q < 1e3 || Z < 1 || Z > 12 || L < 1 || L > 31) return null;
804
+ const re = new Date(q, Z - 1, L);
805
+ return re.getFullYear() !== q || re.getMonth() !== Z - 1 || re.getDate() !== L ? null : re;
806
+ }, []), p = P(
806
807
  (f) => {
807
- const x = z(f);
808
- return !!(k && x < z(k) || M && x > z(M));
808
+ const g = Y(f);
809
+ return !!(y && g < Y(y) || C && g > Y(C));
809
810
  },
810
- [k, M, z]
811
- ), I = Z(() => {
812
- if (t === "date") return G(ee);
813
- const [f, x] = ee;
814
- return !f && !x ? "" : f && x ? `${G(f)} - ${G(x)}` : f ? `${G(f)} - ...` : "...";
815
- }, [t, ee, G]);
816
- J(() => {
817
- h ? Q === "" && I !== "" && ne(I) : ne(I);
818
- }, [I, h]), J(() => {
819
- if (h)
811
+ [y, C, Y]
812
+ ), $ = U(() => {
813
+ if (t === "date") return X(te);
814
+ const [f, g] = te;
815
+ return !f && !g ? "" : f && g ? `${X(f)} - ${X(g)}` : f ? `${X(f)} - ...` : "...";
816
+ }, [t, te, X]);
817
+ ee(() => {
818
+ x ? J === "" && $ !== "" && G($) : G($);
819
+ }, [$, x]), ee(() => {
820
+ if (x)
820
821
  if (t === "range") {
821
- const f = ee;
822
- o(f), f[0] ? Y(f[0]) : f[1] ? Y(f[1]) : Y(/* @__PURE__ */ new Date());
822
+ const f = te;
823
+ i(f), f[0] ? E(f[0]) : f[1] ? E(f[1]) : E(/* @__PURE__ */ new Date());
823
824
  } else {
824
- const f = ee;
825
- Y(f || /* @__PURE__ */ new Date());
825
+ const f = te;
826
+ E(f || /* @__PURE__ */ new Date());
826
827
  }
827
- }, [h]), J(() => {
828
- if (h && b === "auto" && ce.current) {
829
- const f = ce.current.getBoundingClientRect(), x = window.innerWidth - f.right, S = f.left;
830
- x < 300 && S > 300 ? ae("right") : ae("left");
828
+ }, [x]), ee(() => {
829
+ if (x && j === "auto" && oe.current) {
830
+ const f = oe.current.getBoundingClientRect(), g = window.innerWidth - f.right, L = f.left;
831
+ g < 300 && L > 300 ? le("right") : le("left");
831
832
  }
832
- }, [h, b]);
833
- const O = R(() => {
834
- y(!1), B(u), W(0), ne(I);
835
- }, [u, I]), U = R((f) => {
836
- i || (f.preventDefault(), f.stopPropagation(), y((x) => !x));
837
- }, [i]), { handleClick: F } = De(ce, O), { handleEscape: X } = Ee(O);
838
- J(() => {
839
- if (h)
840
- return document.addEventListener("mousedown", F), document.addEventListener("keydown", X), () => {
841
- document.removeEventListener("mousedown", F), document.removeEventListener("keydown", X);
833
+ }, [x, j]);
834
+ const V = P(() => {
835
+ h(!1), z(k), W(0), G($);
836
+ }, [k, $]), _ = P((f) => {
837
+ u || (f.preventDefault(), f.stopPropagation(), h((g) => !g));
838
+ }, [u]), { handleClick: T } = Se(oe, V), { handleEscape: Q } = Le(V);
839
+ ee(() => {
840
+ if (x)
841
+ return document.addEventListener("mousedown", T), document.addEventListener("keydown", Q), () => {
842
+ document.removeEventListener("mousedown", T), document.removeEventListener("keydown", Q);
842
843
  };
843
- }, [h, F, X]);
844
- const me = () => {
845
- i || h || (t === "range" || !E) && (y(!0), B(u));
846
- }, xe = (f) => {
844
+ }, [x, T, Q]);
845
+ const ue = () => {
846
+ u || x || (t === "range" || !R) && (h(!0), z(k));
847
+ }, we = (f) => {
847
848
  if (t !== "date") return;
848
- let S = f.target.value.replace(/\D/g, "");
849
- S.length > 8 && (S = S.slice(0, 8));
850
- let H = "";
851
- if (S.length > 4 ? H = `${S.slice(0, 2)}.${S.slice(2, 4)}.${S.slice(4)}` : S.length > 2 ? H = `${S.slice(0, 2)}.${S.slice(2)}` : H = S, ne(H), H.length === 10) {
852
- const V = oe(H);
853
- V && !g(V) && (L(V), r?.(V), Y(V));
854
- } else H === "" && (L(null), r?.(null));
855
- }, Ye = R(() => {
849
+ let L = f.target.value.replace(/\D/g, "");
850
+ L.length > 8 && (L = L.slice(0, 8));
851
+ let Z = "";
852
+ if (L.length > 4 ? Z = `${L.slice(0, 2)}.${L.slice(2, 4)}.${L.slice(4)}` : L.length > 2 ? Z = `${L.slice(0, 2)}.${L.slice(2)}` : Z = L, G(Z), Z.length === 10) {
853
+ const q = ae(Z);
854
+ q && !p(q) && (M(q), r?.(q), E(q));
855
+ } else Z === "" && (M(null), r?.(null));
856
+ }, _e = P(() => {
856
857
  const f = t === "range" ? [null, null] : null;
857
- L(f), o([null, null]), r?.(f), ne("");
858
- }, [t, r]), Ue = R(
858
+ M(f), i([null, null]), r?.(f), G("");
859
+ }, [t, r]), Ue = P(
859
860
  (f) => {
860
- if (g(f)) return;
861
- const x = z(f);
861
+ if (p(f)) return;
862
+ const g = Y(f);
862
863
  if (t === "date")
863
- L(x), r?.(x), ne(G(x)), O();
864
+ M(g), r?.(g), G(X(g)), V();
864
865
  else {
865
- const [S, H] = j;
866
- if (!S && !H || S && H)
867
- o([x, null]), ne(`${G(x)} - ...`);
868
- else if (S && !H) {
869
- const V = x < S ? [x, S] : [S, x];
870
- o(V), L(V), r?.(V);
871
- const [te, ue] = V;
872
- ne(`${G(te)} - ${G(ue)}`), O();
866
+ const [L, Z] = D;
867
+ if (!L && !Z || L && Z)
868
+ i([g, null]), G(`${X(g)} - ...`);
869
+ else if (L && !Z) {
870
+ const q = g < L ? [g, L] : [L, g];
871
+ i(q), M(q), r?.(q);
872
+ const [re, ce] = q;
873
+ G(`${X(re)} - ${X(ce)}`), V();
873
874
  }
874
875
  }
875
876
  },
876
- [t, j, g, z, r, O, G]
877
- ), _e = R((f) => {
878
- const x = new Date(T.getFullYear(), f, 1);
879
- Y(x), u === "month" && t === "date" ? (L(x), r?.(x), ne(G(x)), O()) : B("day");
880
- }, [T, u, r, O, t, G]), He = R((f) => {
881
- const x = new Date(f, T.getMonth(), 1);
882
- Y(x), u === "year" && t === "date" ? (L(x), r?.(x), ne(G(x)), O()) : B("month");
883
- }, [T, u, r, O, t, G]), je = (f) => {
884
- Y((x) => new Date(x.getFullYear(), x.getMonth() + f, 1));
885
- }, we = (f) => {
886
- Y((x) => new Date(x.getFullYear() + f, x.getMonth(), 1));
887
- }, Ve = R((f) => {
888
- const x = f.getFullYear(), S = f.getMonth(), H = new Date(x, S, 1).getDay(), V = new Date(x, S + 1, 0).getDate(), te = [];
889
- for (let se = H; se > 0; se--) te.push({ date: new Date(x, S, 1 - se), isCurrentMonth: !1 });
890
- for (let se = 1; se <= V; se++) te.push({ date: new Date(x, S, se), isCurrentMonth: !0 });
891
- const ue = 42 - te.length;
892
- for (let se = 1; se <= ue; se++) te.push({ date: new Date(x, S + 1, se), isCurrentMonth: !1 });
893
- return te;
894
- }, []), ve = R((f, x) => z(f).getTime() === z(x).getTime(), [z]), Ze = (f) => {
895
- const x = z(f);
896
- if (t === "date") return ee && ve(x, ee);
897
- const [S] = j[0] ? j : ee;
898
- return N(S) && ve(x, N(S));
899
- }, qe = (f) => {
877
+ [t, D, p, Y, r, V, X]
878
+ ), Ze = P((f) => {
879
+ const g = new Date(v.getFullYear(), f, 1);
880
+ E(g), k === "month" && t === "date" ? (M(g), r?.(g), G(X(g)), V()) : z("day");
881
+ }, [v, k, r, V, t, X]), qe = P((f) => {
882
+ const g = new Date(f, v.getMonth(), 1);
883
+ E(g), k === "year" && t === "date" ? (M(g), r?.(g), G(X(g)), V()) : z("month");
884
+ }, [v, k, r, V, t, X]), je = (f) => {
885
+ E((g) => new Date(g.getFullYear(), g.getMonth() + f, 1));
886
+ }, ve = (f) => {
887
+ E((g) => new Date(g.getFullYear() + f, g.getMonth(), 1));
888
+ }, Je = P((f) => {
889
+ const g = f.getFullYear(), L = f.getMonth(), Z = new Date(g, L, 1).getDay(), q = new Date(g, L + 1, 0).getDate(), re = [];
890
+ for (let se = Z; se > 0; se--) re.push({ date: new Date(g, L, 1 - se), isCurrentMonth: !1 });
891
+ for (let se = 1; se <= q; se++) re.push({ date: new Date(g, L, se), isCurrentMonth: !0 });
892
+ const ce = 42 - re.length;
893
+ for (let se = 1; se <= ce; se++) re.push({ date: new Date(g, L + 1, se), isCurrentMonth: !1 });
894
+ return re;
895
+ }, []), ye = P((f, g) => Y(f).getTime() === Y(g).getTime(), [Y]), Ke = (f) => {
896
+ const g = Y(f);
897
+ if (t === "date") return te && ye(g, te);
898
+ const [L] = D[0] ? D : te;
899
+ return d(L) && ye(g, d(L));
900
+ }, Ge = (f) => {
900
901
  if (t !== "range") return !1;
901
- const x = z(f), [, S] = j[1] ? j : ee;
902
- return N(S) && ve(x, N(S));
903
- }, Ke = (f) => {
902
+ const g = Y(f), [, L] = D[1] ? D : te;
903
+ return d(L) && ye(g, d(L));
904
+ }, Xe = (f) => {
904
905
  if (t !== "range") return !1;
905
- const x = z(f), [S, H] = j[0] ? j : ee, V = N(S), te = N(H);
906
- return V && !te ? !1 : V && te && x > z(V) && x < z(te);
907
- }, Ie = (f, x, S) => {
908
- const H = Ve(f);
909
- return /* @__PURE__ */ c("div", { className: "w-[300px] p-2 select-none", children: [
910
- /* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-4 py-1", children: [
911
- /* @__PURE__ */ e("div", { className: "flex gap-2 w-16", children: x && /* @__PURE__ */ c(he, { children: [
912
- /* @__PURE__ */ e("button", { onClick: () => we(-1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ e(tt, { size: 18 }) }),
913
- /* @__PURE__ */ e("button", { onClick: () => je(-1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ e(ke, { size: 18 }) })
906
+ const g = Y(f), [L, Z] = D[0] ? D : te, q = d(L), re = d(Z);
907
+ return q && !re ? !1 : q && re && g > Y(q) && g < Y(re);
908
+ }, Te = (f, g, L) => {
909
+ const Z = Je(f);
910
+ return /* @__PURE__ */ o("div", { className: "w-[300px] p-2 select-none", children: [
911
+ /* @__PURE__ */ o("div", { className: "flex items-center justify-between mb-4 py-1", children: [
912
+ /* @__PURE__ */ e("div", { className: "flex gap-2 w-16", children: g && /* @__PURE__ */ o(me, { children: [
913
+ /* @__PURE__ */ e("button", { onClick: () => ve(-1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ e(lt, { size: 18 }) }),
914
+ /* @__PURE__ */ e("button", { onClick: () => je(-1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ e(Ce, { size: 18 }) })
914
915
  ] }) }),
915
- /* @__PURE__ */ c("div", { className: "flex gap-1 font-semibold text-slate-700 text-sm whitespace-nowrap", children: [
916
- /* @__PURE__ */ e("span", { className: "cursor-pointer hover:text-blue-600 transition-colors p-1 rounded hover:bg-slate-50", onClick: () => B("month"), children: de.months[f.getMonth()] }),
917
- /* @__PURE__ */ e("span", { className: "cursor-pointer hover:text-blue-600 transition-colors p-1 rounded hover:bg-slate-50", onClick: () => B("year"), children: f.getFullYear() })
916
+ /* @__PURE__ */ o("div", { className: "flex gap-1 font-semibold text-slate-700 text-sm whitespace-nowrap", children: [
917
+ /* @__PURE__ */ e("span", { className: "cursor-pointer hover:text-blue-600 transition-colors p-1 rounded hover:bg-slate-50", onClick: () => z("month"), children: ie.months[f.getMonth()] }),
918
+ /* @__PURE__ */ e("span", { className: "cursor-pointer hover:text-blue-600 transition-colors p-1 rounded hover:bg-slate-50", onClick: () => z("year"), children: f.getFullYear() })
918
919
  ] }),
919
- /* @__PURE__ */ e("div", { className: "flex gap-2 w-16 justify-end", children: S && /* @__PURE__ */ c(he, { children: [
920
- /* @__PURE__ */ e("button", { onClick: () => je(1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ e(be, { size: 18 }) }),
921
- /* @__PURE__ */ e("button", { onClick: () => we(1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ e(rt, { size: 18 }) })
920
+ /* @__PURE__ */ e("div", { className: "flex gap-2 w-16 justify-end", children: L && /* @__PURE__ */ o(me, { children: [
921
+ /* @__PURE__ */ e("button", { onClick: () => je(1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ e(xe, { size: 18 }) }),
922
+ /* @__PURE__ */ e("button", { onClick: () => ve(1), type: "button", className: "hover:bg-slate-100 p-1 rounded transition-colors text-slate-500", children: /* @__PURE__ */ e(st, { size: 18 }) })
922
923
  ] }) })
923
924
  ] }),
924
- /* @__PURE__ */ e("div", { className: "grid grid-cols-7 mb-1 text-center text-[11px] font-bold text-blue-600 uppercase", children: de.weekdaysShort.map((V) => /* @__PURE__ */ e("div", { className: "py-1", children: V }, V)) }),
925
- /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-y-1 relative", children: H.map((V, te) => {
926
- const ue = V.date, se = g(ue), ye = Ze(ue), Ne = qe(ue), Xe = Ke(ue);
927
- return /* @__PURE__ */ e("div", { className: n("h-10 flex items-center justify-center relative", Xe && "bg-blue-50", ye && t === "range" && Ne ? "bg-blue-50 rounded-full" : ye && t === "range" ? "bg-gradient-to-r from-transparent to-blue-50 rounded-l-full" : "", Ne && t === "range" ? "bg-gradient-to-l from-transparent to-blue-50 rounded-r-full" : ""), children: /* @__PURE__ */ e("button", { type: "button", onClick: () => Ue(ue), disabled: se, className: n("w-9 h-9 cursor-pointer rounded-full flex items-center justify-center text-sm font-medium transition-all z-10", V.isCurrentMonth ? "text-slate-700" : "text-slate-300", se && "opacity-20 cursor-not-allowed", ye || Ne ? "bg-blue-600 text-white shadow-md shadow-blue-200 hover:bg-blue-700" : "hover:bg-blue-50", ve(ue, /* @__PURE__ */ new Date()) && !ye && !Ne && "text-blue-600 border border-blue-600"), children: ue.getDate() }) }, te);
925
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-7 mb-1 text-center text-[11px] font-bold text-blue-600 uppercase", children: ie.weekdaysShort.map((q) => /* @__PURE__ */ e("div", { className: "py-1", children: q }, q)) }),
926
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-y-1 relative", children: Z.map((q, re) => {
927
+ const ce = q.date, se = p(ce), Ne = Ke(ce), ke = Ge(ce), tt = Xe(ce);
928
+ return /* @__PURE__ */ e("div", { className: n("h-10 flex items-center justify-center relative", tt && "bg-blue-50", Ne && t === "range" && ke ? "bg-blue-50 rounded-full" : Ne && t === "range" ? "bg-gradient-to-r from-transparent to-blue-50 rounded-l-full" : "", ke && t === "range" ? "bg-gradient-to-l from-transparent to-blue-50 rounded-r-full" : ""), children: /* @__PURE__ */ e("button", { type: "button", onClick: () => Ue(ce), disabled: se, className: n("w-9 h-9 cursor-pointer rounded-full flex items-center justify-center text-sm font-medium transition-all z-10", q.isCurrentMonth ? "text-slate-700" : "text-slate-300", se && "opacity-20 cursor-not-allowed", Ne || ke ? "bg-blue-600 text-white shadow-md shadow-blue-200 hover:bg-blue-700" : "hover:bg-blue-50", ye(ce, /* @__PURE__ */ new Date()) && !Ne && !ke && "text-blue-600 border border-blue-600"), children: ce.getDate() }) }, re);
928
929
  }) })
929
930
  ] });
930
- }, Je = () => /* @__PURE__ */ c("div", { className: "w-[300px] p-3", children: [
931
- /* @__PURE__ */ c("div", { className: "flex justify-between items-center mb-4 px-2", children: [
932
- /* @__PURE__ */ e("button", { type: "button", onClick: () => we(-1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ e(ke, { size: 20 }) }),
933
- /* @__PURE__ */ e("span", { className: "font-bold text-slate-800", children: T.getFullYear() }),
934
- /* @__PURE__ */ e("button", { type: "button", onClick: () => we(1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ e(be, { size: 20 }) })
931
+ }, Qe = () => /* @__PURE__ */ o("div", { className: "w-[300px] p-3", children: [
932
+ /* @__PURE__ */ o("div", { className: "flex justify-between items-center mb-4 px-2", children: [
933
+ /* @__PURE__ */ e("button", { type: "button", onClick: () => ve(-1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ e(Ce, { size: 20 }) }),
934
+ /* @__PURE__ */ e("span", { className: "font-bold text-slate-800", children: v.getFullYear() }),
935
+ /* @__PURE__ */ e("button", { type: "button", onClick: () => ve(1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ e(xe, { size: 20 }) })
935
936
  ] }),
936
- /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-2", children: de.monthsShort.map((f, x) => /* @__PURE__ */ e("button", { type: "button", onClick: () => _e(x), className: n("hover:cursor-pointer py-3 rounded-lg text-sm font-semibold transition-colors", T.getMonth() === x ? "bg-blue-600 text-white" : "hover:bg-blue-50 text-slate-600"), children: f }, f)) })
937
- ] }), Ge = () => {
938
- const f = Math.floor(T.getFullYear() / 12) * 12 + P * 12, x = Array.from({ length: 12 }, (S, H) => f + H);
939
- return /* @__PURE__ */ c("div", { className: "w-[300px] p-3", children: [
940
- /* @__PURE__ */ c("div", { className: "flex justify-between items-center mb-4 px-2", children: [
941
- /* @__PURE__ */ e("button", { type: "button", onClick: () => W((S) => S - 1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ e(ke, { size: 20 }) }),
942
- /* @__PURE__ */ c("span", { className: "font-bold text-slate-800", children: [
943
- x[0],
937
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-2", children: ie.monthsShort.map((f, g) => /* @__PURE__ */ e("button", { type: "button", onClick: () => Ze(g), className: n("hover:cursor-pointer py-3 rounded-lg text-sm font-semibold transition-colors", v.getMonth() === g ? "bg-blue-600 text-white" : "hover:bg-blue-50 text-slate-600"), children: f }, f)) })
938
+ ] }), et = () => {
939
+ const f = Math.floor(v.getFullYear() / 12) * 12 + O * 12, g = Array.from({ length: 12 }, (L, Z) => f + Z);
940
+ return /* @__PURE__ */ o("div", { className: "w-[300px] p-3", children: [
941
+ /* @__PURE__ */ o("div", { className: "flex justify-between items-center mb-4 px-2", children: [
942
+ /* @__PURE__ */ e("button", { type: "button", onClick: () => W((L) => L - 1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ e(Ce, { size: 20 }) }),
943
+ /* @__PURE__ */ o("span", { className: "font-bold text-slate-800", children: [
944
+ g[0],
944
945
  " - ",
945
- x[11]
946
+ g[11]
946
947
  ] }),
947
- /* @__PURE__ */ e("button", { type: "button", onClick: () => W((S) => S + 1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ e(be, { size: 20 }) })
948
+ /* @__PURE__ */ e("button", { type: "button", onClick: () => W((L) => L + 1), className: "p-1 hover:bg-slate-100 rounded text-slate-500", children: /* @__PURE__ */ e(xe, { size: 20 }) })
948
949
  ] }),
949
- /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-2", children: x.map((S) => /* @__PURE__ */ e("button", { type: "button", onClick: () => He(S), className: n("hover:cursor-pointer py-3 rounded-lg text-sm font-semibold transition-colors", T.getFullYear() === S ? "bg-blue-600 text-white" : "hover:bg-blue-50 text-slate-600"), children: S }, S)) })
950
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-3 gap-2", children: g.map((L) => /* @__PURE__ */ e("button", { type: "button", onClick: () => qe(L), className: n("hover:cursor-pointer py-3 rounded-lg text-sm font-semibold transition-colors", v.getFullYear() === L ? "bg-blue-600 text-white" : "hover:bg-blue-50 text-slate-600"), children: L }, L)) })
950
951
  ] });
951
952
  }, Re = /* @__PURE__ */ e(
952
953
  "div",
953
954
  {
954
- onClick: U,
955
+ onClick: _,
955
956
  className: n(
956
957
  "cursor-pointer flex items-center justify-center p-1 rounded-md transition-colors",
957
- i ? "pointer-events-none opacity-50" : "hover:bg-slate-100 active:bg-slate-200"
958
+ u ? "pointer-events-none opacity-50" : "hover:bg-slate-100 active:bg-slate-200"
958
959
  ),
959
- children: /* @__PURE__ */ e(et, { weight: "Linear", size: 20, className: "text-slate-400" })
960
+ children: /* @__PURE__ */ e(nt, { weight: "Linear", size: 20, className: "text-slate-400" })
960
961
  }
961
962
  );
962
- return /* @__PURE__ */ c("div", { ref: ce, className: n("relative w-full group", d), children: [
963
- /* @__PURE__ */ e("div", { ref: w, children: /* @__PURE__ */ e(
964
- Le,
963
+ return /* @__PURE__ */ o("div", { ref: oe, className: n("relative w-full group", c), children: [
964
+ /* @__PURE__ */ e("div", { ref: S, children: /* @__PURE__ */ e(
965
+ Ie,
965
966
  {
966
- label: p,
967
- placeholder: Array.isArray(l) ? l[0] : l,
968
- value: Q,
969
- onChange: xe,
970
- icon: m === "left" ? Re : void 0,
971
- rightIcon: m === "right" ? Re : void 0,
972
- disabled: i,
973
- required: s,
974
- error: D,
967
+ label: m,
968
+ placeholder: Array.isArray(s) ? s[0] : s,
969
+ value: J,
970
+ onChange: we,
971
+ icon: b === "left" ? Re : void 0,
972
+ rightIcon: b === "right" ? Re : void 0,
973
+ disabled: u,
974
+ required: a,
975
+ error: F,
975
976
  maxLength: t === "date" ? 10 : void 0,
976
- onFocus: me,
977
- readOnly: !E || t === "range",
978
- showClearButton: A,
979
- onClear: Ye
977
+ onFocus: ue,
978
+ readOnly: !R || t === "range",
979
+ showClearButton: I,
980
+ onClear: _e
980
981
  }
981
982
  ) }),
982
- h && /* @__PURE__ */ e(
983
+ x && /* @__PURE__ */ e(
983
984
  "div",
984
985
  {
985
986
  className: n(
@@ -991,17 +992,17 @@ const Mt = {
991
992
  ),
992
993
  style: { width: "max-content" },
993
994
  onMouseDown: (f) => f.stopPropagation(),
994
- children: q === "day" ? /* @__PURE__ */ c(he, { children: [
995
- Ie(T, !0, t !== "range"),
996
- t === "range" && /* @__PURE__ */ e("div", { className: "hidden md:block border-l border-slate-100", children: Ie(new Date(T.getFullYear(), T.getMonth() + 1, 1), !1, !0) })
997
- ] }) : q === "month" ? Je() : Ge()
995
+ children: B === "day" ? /* @__PURE__ */ o(me, { children: [
996
+ Te(v, !0, t !== "range"),
997
+ t === "range" && /* @__PURE__ */ e("div", { className: "hidden md:block border-l border-slate-100", children: Te(new Date(v.getFullYear(), v.getMonth() + 1, 1), !1, !0) })
998
+ ] }) : B === "month" ? Qe() : et()
998
999
  }
999
1000
  )
1000
1001
  ] });
1001
1002
  }
1002
1003
  );
1003
- Dt.displayName = "MciPicker";
1004
- const St = {
1004
+ Ft.displayName = "MciPicker";
1005
+ const Et = {
1005
1006
  sm: {
1006
1007
  container: "h-9 text-sm",
1007
1008
  padding: "px-2",
@@ -1035,170 +1036,170 @@ const St = {
1035
1036
  label: "text-base",
1036
1037
  dropdown: "text-base"
1037
1038
  }
1038
- }, At = fe(
1039
+ }, Lt = fe(
1039
1040
  ({
1040
1041
  label: t,
1041
- placeholder: a = "Выберите...",
1042
+ placeholder: l = "Выберите...",
1042
1043
  options: r = [],
1043
- icon: l,
1044
- iconPosition: p = "left",
1045
- size: i = "base",
1046
- error: s,
1047
- disabled: d = !1,
1048
- required: C = !1,
1049
- value: k,
1050
- onChange: M,
1051
- onFocus: D,
1052
- onBlur: A,
1053
- className: E,
1054
- clearable: v = !1,
1055
- searchable: u = !1,
1056
- onSearch: m,
1057
- name: b
1058
- }, w) => {
1059
- const [h, y] = _(!1), [$, L] = _(!1), [j, o] = _(""), [N, T] = _(""), [Y, q] = _(-1), B = le(null), P = le(null), W = k !== void 0 ? k : j, Q = r.find((F) => F.value === W), ne = W !== "" && W !== void 0, K = St[i], ae = Z(() => {
1060
- if (!u || m) return r;
1061
- const F = N.toLowerCase();
1044
+ icon: s,
1045
+ iconPosition: m = "left",
1046
+ size: u = "base",
1047
+ error: a,
1048
+ disabled: c = !1,
1049
+ required: N = !1,
1050
+ value: y,
1051
+ onChange: C,
1052
+ onFocus: F,
1053
+ onBlur: I,
1054
+ className: R,
1055
+ clearable: w = !1,
1056
+ searchable: k = !1,
1057
+ onSearch: b,
1058
+ name: j
1059
+ }, S) => {
1060
+ const [x, h] = H(!1), [A, M] = H(!1), [D, i] = H(""), [d, v] = H(""), [E, B] = H(-1), z = de(null), O = de(null), W = y !== void 0 ? y : D, J = r.find((T) => T.value === W), G = W !== "" && W !== void 0, K = Et[u], le = U(() => {
1061
+ if (!k || b) return r;
1062
+ const T = d.toLowerCase();
1062
1063
  return r.filter(
1063
- (X) => X.label.toLowerCase().includes(F)
1064
+ (Q) => Q.label.toLowerCase().includes(T)
1064
1065
  );
1065
- }, [r, N, u, m]), ce = R(() => {
1066
- y(!1), L(!1), T(""), q(-1), A?.();
1067
- }, [A]), { handleClick: ee } = De(B, ce), { handleEscape: de } = Ee(ce);
1068
- J(() => {
1069
- if (h)
1070
- return document.addEventListener("mousedown", ee), document.addEventListener("keydown", de), () => {
1071
- document.removeEventListener("mousedown", ee), document.removeEventListener("keydown", de);
1066
+ }, [r, d, k, b]), oe = P(() => {
1067
+ h(!1), M(!1), v(""), B(-1), I?.();
1068
+ }, [I]), { handleClick: te } = Se(z, oe), { handleEscape: ie } = Le(oe);
1069
+ ee(() => {
1070
+ if (x)
1071
+ return document.addEventListener("mousedown", te), document.addEventListener("keydown", ie), () => {
1072
+ document.removeEventListener("mousedown", te), document.removeEventListener("keydown", ie);
1072
1073
  };
1073
- }, [h, ee, de]), J(() => {
1074
- h && u && P.current && P.current.focus();
1075
- }, [h, u]);
1076
- const z = R(
1077
- (F) => {
1078
- if (!d) {
1079
- if (!h && (F.key === "ArrowDown" || F.key === "ArrowUp" || F.key === "Enter")) {
1080
- F.preventDefault(), y(!0);
1074
+ }, [x, te, ie]), ee(() => {
1075
+ x && k && O.current && O.current.focus();
1076
+ }, [x, k]);
1077
+ const Y = P(
1078
+ (T) => {
1079
+ if (!c) {
1080
+ if (!x && (T.key === "ArrowDown" || T.key === "ArrowUp" || T.key === "Enter")) {
1081
+ T.preventDefault(), h(!0);
1081
1082
  return;
1082
1083
  }
1083
- if (h)
1084
- switch (F.key) {
1084
+ if (x)
1085
+ switch (T.key) {
1085
1086
  case "ArrowDown":
1086
- F.preventDefault(), q(
1087
- (X) => X < ae.length - 1 ? X + 1 : 0
1087
+ T.preventDefault(), B(
1088
+ (Q) => Q < le.length - 1 ? Q + 1 : 0
1088
1089
  );
1089
1090
  break;
1090
1091
  case "ArrowUp":
1091
- F.preventDefault(), q(
1092
- (X) => X > 0 ? X - 1 : ae.length - 1
1092
+ T.preventDefault(), B(
1093
+ (Q) => Q > 0 ? Q - 1 : le.length - 1
1093
1094
  );
1094
1095
  break;
1095
1096
  case "Enter":
1096
- F.preventDefault(), Y >= 0 && ae[Y] && oe(ae[Y].value);
1097
+ T.preventDefault(), E >= 0 && le[E] && ae(le[E].value);
1097
1098
  break;
1098
1099
  }
1099
1100
  }
1100
1101
  },
1101
- [h, ae, Y, d]
1102
- ), G = R(() => {
1103
- d || (y((F) => !F), h ? (T(""), q(-1)) : (L(!0), D?.()));
1104
- }, [d, h, D]), oe = R(
1105
- (F) => {
1106
- k === void 0 && o(F), M?.(F), y(!1), L(!1), T(""), q(-1), A?.();
1102
+ [x, le, E, c]
1103
+ ), X = P(() => {
1104
+ c || (h((T) => !T), x ? (v(""), B(-1)) : (M(!0), F?.()));
1105
+ }, [c, x, F]), ae = P(
1106
+ (T) => {
1107
+ y === void 0 && i(T), C?.(T), h(!1), M(!1), v(""), B(-1), I?.();
1107
1108
  },
1108
- [k, M, A]
1109
- ), g = R(
1110
- (F) => {
1111
- F.stopPropagation(), !d && (k === void 0 && o(""), M?.(""), T(""), q(-1));
1109
+ [y, C, I]
1110
+ ), p = P(
1111
+ (T) => {
1112
+ T.stopPropagation(), !c && (y === void 0 && i(""), C?.(""), v(""), B(-1));
1112
1113
  },
1113
- [k, M, d]
1114
- ), I = R(
1115
- (F) => {
1116
- T(F), m?.(F), q(0);
1114
+ [y, C, c]
1115
+ ), $ = P(
1116
+ (T) => {
1117
+ v(T), b?.(T), B(0);
1117
1118
  },
1118
- [m]
1119
- ), O = Z(() => d ? "border-slate-200 bg-slate-100 text-slate-400 cursor-not-allowed" : s ? "border-red-600 focus:border-red-600 shadow-red bg-white" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600 bg-white", [s, d]), U = Z(() => d ? "text-slate-400" : s ? "text-red-600" : h || $ ? "text-black" : "text-slate-400", [d, s, h, $]);
1120
- return /* @__PURE__ */ c("div", { className: n("w-full", E), ref: w, children: [
1121
- t && /* @__PURE__ */ c(
1119
+ [b]
1120
+ ), V = U(() => c ? "border-slate-200 bg-slate-100 text-slate-400 cursor-not-allowed" : a ? "border-red-600 focus:border-red-600 shadow-red bg-white" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600 bg-white", [a, c]), _ = U(() => c ? "text-slate-400" : a ? "text-red-600" : x || A ? "text-black" : "text-slate-400", [c, a, x, A]);
1121
+ return /* @__PURE__ */ o("div", { className: n("w-full", R), ref: S, children: [
1122
+ t && /* @__PURE__ */ o(
1122
1123
  "label",
1123
1124
  {
1124
- htmlFor: b,
1125
+ htmlFor: j,
1125
1126
  className: n(
1126
1127
  "mb-2 block text-base font-medium",
1127
- s ? "text-red-600" : "text-slate-700",
1128
+ a ? "text-red-600" : "text-slate-700",
1128
1129
  K.label
1129
1130
  ),
1130
1131
  children: [
1131
1132
  t,
1132
- C && /* @__PURE__ */ e("span", { className: "ml-1 text-red-600", children: "*" })
1133
+ N && /* @__PURE__ */ e("span", { className: "ml-1 text-red-600", children: "*" })
1133
1134
  ]
1134
1135
  }
1135
1136
  ),
1136
- /* @__PURE__ */ c(
1137
+ /* @__PURE__ */ o(
1137
1138
  "div",
1138
1139
  {
1139
- ref: B,
1140
+ ref: z,
1140
1141
  className: "relative",
1141
- onKeyDown: z,
1142
+ onKeyDown: Y,
1142
1143
  children: [
1143
- /* @__PURE__ */ c(
1144
+ /* @__PURE__ */ o(
1144
1145
  "div",
1145
1146
  {
1146
1147
  role: "combobox",
1147
- "aria-expanded": h,
1148
+ "aria-expanded": x,
1148
1149
  "aria-haspopup": "listbox",
1149
- "aria-controls": `${b}-listbox`,
1150
- "aria-disabled": d,
1151
- tabIndex: d ? -1 : 0,
1152
- onClick: G,
1150
+ "aria-controls": `${j}-listbox`,
1151
+ "aria-disabled": c,
1152
+ tabIndex: c ? -1 : 0,
1153
+ onClick: X,
1153
1154
  className: n(
1154
1155
  "flex w-full items-center border font-normal transition-all duration-300 ease-in-out",
1155
- i === "base" ? "rounded-xl" : "rounded-lg",
1156
+ u === "base" ? "rounded-xl" : "rounded-lg",
1156
1157
  K.container,
1157
- l ? p === "left" ? K.iconPaddingLeft : K.iconPaddingRight : K.padding,
1158
- O,
1159
- !d && $ && "shadow-blue border-blue-600"
1158
+ s ? m === "left" ? K.iconPaddingLeft : K.iconPaddingRight : K.padding,
1159
+ V,
1160
+ !c && A && "shadow-blue border-blue-600"
1160
1161
  ),
1161
1162
  children: [
1162
- l && /* @__PURE__ */ e(
1163
+ s && /* @__PURE__ */ e(
1163
1164
  "div",
1164
1165
  {
1165
1166
  className: n(
1166
1167
  "absolute top-1/2 -translate-y-1/2 pointer-events-none transition-colors duration-300",
1167
- p === "left" ? K.iconWrapper : K.rightIconWrapper,
1168
- U
1168
+ m === "left" ? K.iconWrapper : K.rightIconWrapper,
1169
+ _
1169
1170
  ),
1170
- children: l
1171
+ children: s
1171
1172
  }
1172
1173
  ),
1173
- u && h ? /* @__PURE__ */ e(
1174
+ k && x ? /* @__PURE__ */ e(
1174
1175
  "input",
1175
1176
  {
1176
- ref: P,
1177
+ ref: O,
1177
1178
  type: "text",
1178
- value: N,
1179
- onChange: (F) => I(F.target.value),
1180
- placeholder: a,
1179
+ value: d,
1180
+ onChange: (T) => $(T.target.value),
1181
+ placeholder: l,
1181
1182
  className: "w-full bg-transparent outline-none",
1182
- onClick: (F) => F.stopPropagation()
1183
+ onClick: (T) => T.stopPropagation()
1183
1184
  }
1184
1185
  ) : /* @__PURE__ */ e(
1185
1186
  "span",
1186
1187
  {
1187
1188
  className: n(
1188
1189
  "block truncate select-none",
1189
- !ne && !d && "text-slate-400"
1190
+ !G && !c && "text-slate-400"
1190
1191
  ),
1191
- children: Q?.label || a
1192
+ children: J?.label || l
1192
1193
  }
1193
1194
  ),
1194
- v && ne && !d && /* @__PURE__ */ e(
1195
+ w && G && !c && /* @__PURE__ */ e(
1195
1196
  "button",
1196
1197
  {
1197
1198
  type: "button",
1198
- onClick: g,
1199
+ onClick: p,
1199
1200
  className: n(
1200
1201
  "absolute top-1/2 -translate-y-1/2 text-slate-400 hover:text-black transition-colors cursor-pointer",
1201
- l && p === "left" ? "right-8" : "right-10"
1202
+ s && m === "left" ? "right-8" : "right-10"
1202
1203
  ),
1203
1204
  "aria-label": "Очистить",
1204
1205
  children: /* @__PURE__ */ e(pe, { className: K.iconSize })
@@ -1209,106 +1210,106 @@ const St = {
1209
1210
  {
1210
1211
  className: n(
1211
1212
  "absolute top-1/2 right-3 -translate-y-1/2 pointer-events-none transition-all duration-300",
1212
- h && "rotate-180",
1213
- U
1213
+ x && "rotate-180",
1214
+ _
1214
1215
  ),
1215
- children: /* @__PURE__ */ e(Fe, { className: K.iconSize })
1216
+ children: /* @__PURE__ */ e(Ee, { className: K.iconSize })
1216
1217
  }
1217
1218
  )
1218
1219
  ]
1219
1220
  }
1220
1221
  ),
1221
- h && !d && /* @__PURE__ */ e(
1222
+ x && !c && /* @__PURE__ */ e(
1222
1223
  "div",
1223
1224
  {
1224
- id: `${b}-listbox`,
1225
+ id: `${j}-listbox`,
1225
1226
  role: "listbox",
1226
1227
  className: n(
1227
1228
  "absolute z-50 mt-1 max-h-60 w-full overflow-y-auto rounded-lg border border-slate-200 bg-white shadow-md p-1 text-black",
1228
1229
  K.dropdown
1229
1230
  ),
1230
- children: ae.length === 0 ? /* @__PURE__ */ e("div", { className: "px-3 py-2 text-center text-base font-normal text-slate-500", children: "Ничего не найдено" }) : ae.map((F) => /* @__PURE__ */ e(
1231
+ children: le.length === 0 ? /* @__PURE__ */ e("div", { className: "px-3 py-2 text-center text-base font-normal text-slate-500", children: "Ничего не найдено" }) : le.map((T) => /* @__PURE__ */ e(
1231
1232
  "div",
1232
1233
  {
1233
1234
  role: "option",
1234
- "aria-selected": W === F.value,
1235
- onClick: () => oe(F.value),
1235
+ "aria-selected": W === T.value,
1236
+ onClick: () => ae(T.value),
1236
1237
  className: n(
1237
1238
  "cursor-pointer px-3 py-2 font-normal transition-colors hover:bg-slate-100 rounded-sm",
1238
- W === F.value ? "bg-slate-100" : ""
1239
+ W === T.value ? "bg-slate-100" : ""
1239
1240
  ),
1240
- children: F.label
1241
+ children: T.label
1241
1242
  },
1242
- F.value
1243
+ T.value
1243
1244
  ))
1244
1245
  }
1245
1246
  )
1246
1247
  ]
1247
1248
  }
1248
1249
  ),
1249
- s && /* @__PURE__ */ e("p", { className: "mt-2 animate-[slideDown_0.3s_ease-out] text-sm font-normal text-red-600", children: s })
1250
+ a && /* @__PURE__ */ e("p", { className: "mt-2 animate-[slideDown_0.3s_ease-out] text-sm font-normal text-red-600", children: a })
1250
1251
  ] });
1251
1252
  }
1252
1253
  );
1253
- At.displayName = "MciSelect";
1254
- function Ft(t) {
1254
+ Lt.displayName = "MciSelect";
1255
+ function It(t) {
1255
1256
  if (t != null)
1256
1257
  return typeof t == "number" ? `${t}px` : t;
1257
1258
  }
1258
- function Et({ children: t, title: a }) {
1259
- return /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("div", { className: "clamp-2 break-words", title: a ?? (typeof t == "string" ? t : void 0), children: t }) });
1259
+ function jt({ children: t, title: l }) {
1260
+ return /* @__PURE__ */ e("div", { className: "min-w-0", children: /* @__PURE__ */ e("div", { className: "clamp-2 break-words", title: l ?? (typeof t == "string" ? t : void 0), children: t }) });
1260
1261
  }
1261
- function Xt({
1262
+ function nr({
1262
1263
  columns: t,
1263
- data: a = [],
1264
+ data: l = [],
1264
1265
  loading: r = !1,
1265
- skeletonRows: l = 5,
1266
- noDataText: p = "",
1267
- sort: i,
1268
- onSortChange: s,
1269
- className: d,
1270
- headerClassName: C,
1271
- bodyClassName: k,
1272
- rowKey: M = "id",
1273
- rowSelection: D
1266
+ skeletonRows: s = 5,
1267
+ noDataText: m = "",
1268
+ sort: u,
1269
+ onSortChange: a,
1270
+ className: c,
1271
+ headerClassName: N,
1272
+ bodyClassName: y,
1273
+ rowKey: C = "id",
1274
+ rowSelection: F
1274
1275
  }) {
1275
- const [A, E] = _(
1276
+ const [I, R] = H(
1276
1277
  null
1277
- ), v = i ?? A, u = Z(() => Array.isArray(a) ? a : [], [a]), m = Z(() => !v || i ? u : [...u].sort((o, N) => {
1278
- const T = o[v.key], Y = N[v.key];
1279
- return T == null ? 1 : Y == null ? -1 : T < Y ? v.direction === "asc" ? -1 : 1 : T > Y ? v.direction === "asc" ? 1 : -1 : 0;
1280
- }), [u, v, i]);
1281
- J(() => {
1282
- i !== void 0 && E(null);
1283
- }, [i]);
1284
- const b = r ? [] : i ? u : m, w = R(
1285
- (o) => {
1286
- if (!o.sortable) return;
1287
- let N = null;
1288
- v?.key !== o.key ? N = { key: o.key, direction: "asc" } : v.direction === "asc" && (N = { key: o.key, direction: "desc" }), i !== void 0 ? s?.(N) : E(N);
1278
+ ), w = u ?? I, k = U(() => Array.isArray(l) ? l : [], [l]), b = U(() => !w || u ? k : [...k].sort((i, d) => {
1279
+ const v = i[w.key], E = d[w.key];
1280
+ return v == null ? 1 : E == null ? -1 : v < E ? w.direction === "asc" ? -1 : 1 : v > E ? w.direction === "asc" ? 1 : -1 : 0;
1281
+ }), [k, w, u]);
1282
+ ee(() => {
1283
+ u !== void 0 && R(null);
1284
+ }, [u]);
1285
+ const j = r ? [] : u ? k : b, S = P(
1286
+ (i) => {
1287
+ if (!i.sortable) return;
1288
+ let d = null;
1289
+ w?.key !== i.key ? d = { key: i.key, direction: "asc" } : w.direction === "asc" && (d = { key: i.key, direction: "desc" }), u !== void 0 ? a?.(d) : R(d);
1289
1290
  },
1290
- [v, i, s]
1291
- ), h = (o) => {
1292
- if (!D) return;
1293
- const { onChange: N, getCheckboxProps: T } = D;
1294
- if (o.target.checked) {
1295
- const B = b.filter((P) => !T?.(P)?.disabled).map((P) => P[M]);
1296
- N(B);
1291
+ [w, u, a]
1292
+ ), x = (i) => {
1293
+ if (!F) return;
1294
+ const { onChange: d, getCheckboxProps: v } = F;
1295
+ if (i.target.checked) {
1296
+ const z = j.filter((O) => !v?.(O)?.disabled).map((O) => O[C]);
1297
+ d(z);
1297
1298
  } else
1298
- N([]);
1299
- }, y = (o, N) => {
1300
- if (!D) return;
1301
- const { selectedRowKeys: T, onChange: Y } = D, q = o[M], B = N ? [...T, q] : T.filter((P) => P !== q);
1302
- Y(B);
1303
- }, $ = Z(() => {
1304
- if (!D || b.length === 0) return !1;
1305
- const o = b.filter((N) => !D.getCheckboxProps?.(N)?.disabled);
1306
- return o.length === 0 ? !1 : o.every(
1307
- (N) => D.selectedRowKeys.includes(N[M])
1299
+ d([]);
1300
+ }, h = (i, d) => {
1301
+ if (!F) return;
1302
+ const { selectedRowKeys: v, onChange: E } = F, B = i[C], z = d ? [...v, B] : v.filter((O) => O !== B);
1303
+ E(z);
1304
+ }, A = U(() => {
1305
+ if (!F || j.length === 0) return !1;
1306
+ const i = j.filter((d) => !F.getCheckboxProps?.(d)?.disabled);
1307
+ return i.length === 0 ? !1 : i.every(
1308
+ (d) => F.selectedRowKeys.includes(d[C])
1308
1309
  );
1309
- }, [D, b, M]), L = (o) => o.sortable ? !v || v.key !== o.key ? /* @__PURE__ */ e(lt, { weight: "Linear", size: 20, className: "text-slate-base shrink-0" }) : v.direction === "asc" ? /* @__PURE__ */ e(at, { weight: "Linear", size: 20, className: "text-slate-base shrink-0" }) : /* @__PURE__ */ e(st, { weight: "Linear", size: 20, className: "text-slate-base shrink-0" }) : null, j = () => /* @__PURE__ */ c("colgroup", { children: [
1310
- D && /* @__PURE__ */ e("col", { style: { width: 48 } }),
1311
- t.map((o) => /* @__PURE__ */ e("col", { style: { width: Ft(o.width) ?? "auto" } }, o.key))
1310
+ }, [F, j, C]), M = (i) => i.sortable ? !w || w.key !== i.key ? /* @__PURE__ */ e(ot, { weight: "Linear", size: 20, className: "text-slate-base shrink-0" }) : w.direction === "asc" ? /* @__PURE__ */ e(it, { weight: "Linear", size: 20, className: "text-slate-base shrink-0" }) : /* @__PURE__ */ e(ct, { weight: "Linear", size: 20, className: "text-slate-base shrink-0" }) : null, D = () => /* @__PURE__ */ o("colgroup", { children: [
1311
+ F && /* @__PURE__ */ e("col", { style: { width: 48 } }),
1312
+ t.map((i) => /* @__PURE__ */ e("col", { style: { width: It(i.width) ?? "auto" } }, i.key))
1312
1313
  ] });
1313
1314
  return /* @__PURE__ */ e(
1314
1315
  "div",
@@ -1320,94 +1321,94 @@ function Xt({
1320
1321
  "[&::-webkit-scrollbar-thumb]:bg-slate-200",
1321
1322
  "[&::-webkit-scrollbar-thumb]:rounded-full",
1322
1323
  "hover:[&::-webkit-scrollbar-thumb]:bg-slate-300",
1323
- d
1324
+ c
1324
1325
  ),
1325
- children: /* @__PURE__ */ c("div", { className: "inline-block min-w-full align-middle", children: [
1326
- /* @__PURE__ */ e("div", { className: "overflow-hidden rounded-xl border border-slate-200 bg-slate-100", children: /* @__PURE__ */ c("table", { className: "w-full table-fixed", children: [
1327
- j(),
1328
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ c("tr", { children: [
1329
- D && /* @__PURE__ */ e("th", { className: n("w-12 px-4 py-3", C), children: /* @__PURE__ */ e("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ e(
1330
- Me,
1326
+ children: /* @__PURE__ */ o("div", { className: "inline-block min-w-full align-middle", children: [
1327
+ /* @__PURE__ */ e("div", { className: "overflow-hidden rounded-xl border border-slate-200 bg-slate-100", children: /* @__PURE__ */ o("table", { className: "w-full table-fixed", children: [
1328
+ D(),
1329
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ o("tr", { children: [
1330
+ F && /* @__PURE__ */ e("th", { className: n("w-12 px-4 py-3", N), children: /* @__PURE__ */ e("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ e(
1331
+ De,
1331
1332
  {
1332
- checked: $,
1333
- onChange: h,
1333
+ checked: A,
1334
+ onChange: x,
1334
1335
  variant: "yellow",
1335
- disabled: r || b.length === 0
1336
+ disabled: r || j.length === 0
1336
1337
  }
1337
1338
  ) }) }),
1338
- t.map((o) => /* @__PURE__ */ e(
1339
+ t.map((i) => /* @__PURE__ */ e(
1339
1340
  "th",
1340
1341
  {
1341
- onClick: () => w(o),
1342
+ onClick: () => S(i),
1342
1343
  className: n(
1343
1344
  "px-4 py-3 text-left text-sm font-medium text-slate-700 transition-colors",
1344
1345
  "whitespace-nowrap overflow-hidden text-ellipsis",
1345
- o.align === "center" && "text-center",
1346
- o.align === "right" && "text-right",
1347
- o.sortable && "cursor-pointer hover:bg-slate-200",
1348
- C
1346
+ i.align === "center" && "text-center",
1347
+ i.align === "right" && "text-right",
1348
+ i.sortable && "cursor-pointer hover:bg-slate-200",
1349
+ N
1349
1350
  ),
1350
- children: /* @__PURE__ */ c("div", { className: n("flex items-center gap-2 min-w-0", o.align === "right" && "justify-end"), children: [
1351
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", title: o.title, children: o.title }),
1352
- L(o)
1351
+ children: /* @__PURE__ */ o("div", { className: n("flex items-center gap-2 min-w-0", i.align === "right" && "justify-end"), children: [
1352
+ /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", title: i.title, children: i.title }),
1353
+ M(i)
1353
1354
  ] })
1354
1355
  },
1355
- o.key
1356
+ i.key
1356
1357
  ))
1357
1358
  ] }) })
1358
1359
  ] }) }),
1359
- /* @__PURE__ */ e("div", { className: "rounded-xl border border-t-0 border-slate-200 bg-white overflow-hidden", children: /* @__PURE__ */ c("table", { className: "w-full table-fixed", children: [
1360
- j(),
1361
- /* @__PURE__ */ e("tbody", { className: "divide-y divide-slate-200", children: r ? Array.from({ length: l }).map((o, N) => /* @__PURE__ */ c("tr", { children: [
1362
- D && /* @__PURE__ */ e("td", { className: "w-12 px-4 py-3", children: /* @__PURE__ */ e($e, { height: 20, width: 20, variant: "rounded" }) }),
1363
- t.map((T) => /* @__PURE__ */ e("td", { className: "px-4 py-3", children: /* @__PURE__ */ e($e, { height: 30, variant: "rounded" }) }, T.key))
1364
- ] }, N)) : b.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: t.length + (D ? 1 : 0), className: "py-20", children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center", children: [
1365
- /* @__PURE__ */ e("div", { className: "relative mb-4", children: /* @__PURE__ */ e(nt, { weight: "Bold", size: 64, className: "animate-float text-slate-400" }) }),
1366
- /* @__PURE__ */ e("p", { className: "text-sm font-medium text-slate-400", children: p })
1367
- ] }) }) }) : b.map((o, N) => {
1368
- const T = o[M], Y = D?.selectedRowKeys.includes(T), q = D?.getCheckboxProps?.(o)?.disabled;
1369
- return /* @__PURE__ */ c("tr", { className: "group transition-colors hover:bg-slate-50", children: [
1370
- D && /* @__PURE__ */ e("td", { className: n("w-12 px-4 py-3 align-top", k), children: /* @__PURE__ */ e("div", { className: "flex items-center justify-center pt-1", children: /* @__PURE__ */ e(
1371
- Me,
1360
+ /* @__PURE__ */ e("div", { className: "rounded-xl border border-t-0 border-slate-200 bg-white overflow-hidden", children: /* @__PURE__ */ o("table", { className: "w-full table-fixed", children: [
1361
+ D(),
1362
+ /* @__PURE__ */ e("tbody", { className: "divide-y divide-slate-200", children: r ? Array.from({ length: s }).map((i, d) => /* @__PURE__ */ o("tr", { children: [
1363
+ F && /* @__PURE__ */ e("td", { className: "w-12 px-4 py-3", children: /* @__PURE__ */ e(Pe, { height: 20, width: 20, variant: "rounded" }) }),
1364
+ t.map((v) => /* @__PURE__ */ e("td", { className: "px-4 py-3", children: /* @__PURE__ */ e(Pe, { height: 30, variant: "rounded" }) }, v.key))
1365
+ ] }, d)) : j.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: t.length + (F ? 1 : 0), className: "py-20", children: /* @__PURE__ */ o("div", { className: "flex flex-col items-center justify-center", children: [
1366
+ /* @__PURE__ */ e("div", { className: "relative mb-4", children: /* @__PURE__ */ e(at, { weight: "Bold", size: 64, className: "animate-float text-slate-400" }) }),
1367
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium text-slate-400", children: m })
1368
+ ] }) }) }) : j.map((i, d) => {
1369
+ const v = i[C], E = F?.selectedRowKeys.includes(v), B = F?.getCheckboxProps?.(i)?.disabled;
1370
+ return /* @__PURE__ */ o("tr", { className: "group transition-colors hover:bg-slate-50", children: [
1371
+ F && /* @__PURE__ */ e("td", { className: n("w-12 px-4 py-3 align-top", y), children: /* @__PURE__ */ e("div", { className: "flex items-center justify-center pt-1", children: /* @__PURE__ */ e(
1372
+ De,
1372
1373
  {
1373
- checked: Y,
1374
- disabled: q,
1374
+ checked: E,
1375
+ disabled: B,
1375
1376
  variant: "yellow",
1376
- onChange: (B) => y(o, B.target.checked)
1377
+ onChange: (z) => h(i, z.target.checked)
1377
1378
  }
1378
1379
  ) }) }),
1379
- t.map((B) => {
1380
- const P = o[B.key], W = B.render ? B.render(P, o) : String(P ?? "-");
1380
+ t.map((z) => {
1381
+ const O = i[z.key], W = z.render ? z.render(O, i) : String(O ?? "-");
1381
1382
  return /* @__PURE__ */ e(
1382
1383
  "td",
1383
1384
  {
1384
1385
  className: n(
1385
1386
  "align-top px-4 py-3 text-sm font-normal text-black",
1386
1387
  "min-w-0 whitespace-normal",
1387
- B.align === "center" && "text-center",
1388
- B.align === "right" && "text-right",
1389
- k,
1390
- B.className
1388
+ z.align === "center" && "text-center",
1389
+ z.align === "right" && "text-right",
1390
+ y,
1391
+ z.className
1391
1392
  ),
1392
- children: /* @__PURE__ */ e(Et, { title: typeof W == "string" ? W : void 0, children: W })
1393
+ children: /* @__PURE__ */ e(jt, { title: typeof W == "string" ? W : void 0, children: W })
1393
1394
  },
1394
- B.key
1395
+ z.key
1395
1396
  );
1396
1397
  })
1397
- ] }, N);
1398
+ ] }, d);
1398
1399
  }) })
1399
1400
  ] }) })
1400
1401
  ] })
1401
1402
  }
1402
1403
  );
1403
1404
  }
1404
- const Lt = {
1405
+ const Tt = {
1405
1406
  uz: {
1406
1407
  dragAndDrop: "Faylni bu yerga torting",
1407
1408
  clickToUpload: "yoki bosib tanlang",
1408
1409
  or: "yoki",
1409
1410
  dropHereTitle: "Faylni shu yerga yuklang",
1410
- fileRequirements: (t, a, r, l) => `${t ? `Maksimum ${a} ta fayl` : "1 ta fayl"} • ${r}MB gacha • ${l !== "*/*" ? `Format: ${l}` : "Barcha formatlar"}`,
1411
+ fileRequirements: (t, l, r, s) => `${t ? `Maksimum ${l} ta fayl` : "1 ta fayl"} • ${r}MB gacha • ${s !== "*/*" ? `Format: ${s}` : "Barcha formatlar"}`,
1411
1412
  selectedFiles: "Tanlangan fayllar",
1412
1413
  clearAll: "Barchasini o‘chirish",
1413
1414
  uploading: "Yuklanmoqda...",
@@ -1417,7 +1418,7 @@ const Lt = {
1417
1418
  download: "Yuklab olish",
1418
1419
  remove: "O‘chirish",
1419
1420
  maxFilesError: (t) => `Maksimum ${t} ta fayl yuklash mumkin`,
1420
- fileSizeError: (t, a) => `"${t}" fayl hajmi ${a}MB dan kichik bo‘lishi kerak`,
1421
+ fileSizeError: (t, l) => `"${t}" fayl hajmi ${l}MB dan kichik bo‘lishi kerak`,
1421
1422
  fileTypeError: (t) => `"${t}" fayl turi qabul qilinmaydi`,
1422
1423
  uploadFailed: "Yuklash muvaffaqiyatsiz tugadi",
1423
1424
  file: "Fayl",
@@ -1431,7 +1432,7 @@ const Lt = {
1431
1432
  clickToUpload: "или выберите нажатием",
1432
1433
  or: "или",
1433
1434
  dropHereTitle: "Загрузите свой файл сюда",
1434
- fileRequirements: (t, a, r, l) => `${t ? `Максимум ${a} файлов` : "1 файл"} • До ${r}MB • ${l !== "*/*" ? `Формат: ${l}` : "Все форматы"}`,
1435
+ fileRequirements: (t, l, r, s) => `${t ? `Максимум ${l} файлов` : "1 файл"} • До ${r}MB • ${s !== "*/*" ? `Формат: ${s}` : "Все форматы"}`,
1435
1436
  selectedFiles: "Выбранные файлы",
1436
1437
  clearAll: "Очистить все",
1437
1438
  uploading: "Загружается...",
@@ -1441,7 +1442,7 @@ const Lt = {
1441
1442
  download: "Скачать",
1442
1443
  remove: "Удалить",
1443
1444
  maxFilesError: (t) => `Можно загрузить максимум ${t} файлов`,
1444
- fileSizeError: (t, a) => `Размер файла "${t}" должен быть меньше ${a}MB`,
1445
+ fileSizeError: (t, l) => `Размер файла "${t}" должен быть меньше ${l}MB`,
1445
1446
  fileTypeError: (t) => `Тип файла "${t}" не поддерживается`,
1446
1447
  uploadFailed: "Не удалось загрузить файл",
1447
1448
  file: "Файл",
@@ -1455,7 +1456,7 @@ const Lt = {
1455
1456
  clickToUpload: "or click to select",
1456
1457
  or: "or",
1457
1458
  dropHereTitle: "Upload your file here",
1458
- fileRequirements: (t, a, r, l) => `${t ? `Up to ${a} files` : "1 file"} • Up to ${r}MB • ${l !== "*/*" ? `Format: ${l}` : "All formats"}`,
1459
+ fileRequirements: (t, l, r, s) => `${t ? `Up to ${l} files` : "1 file"} • Up to ${r}MB • ${s !== "*/*" ? `Format: ${s}` : "All formats"}`,
1459
1460
  selectedFiles: "Selected files",
1460
1461
  clearAll: "Clear all",
1461
1462
  uploading: "Uploading...",
@@ -1465,7 +1466,7 @@ const Lt = {
1465
1466
  download: "Download",
1466
1467
  remove: "Remove",
1467
1468
  maxFilesError: (t) => `You can upload up to ${t} files`,
1468
- fileSizeError: (t, a) => `File "${t}" must be smaller than ${a}MB`,
1469
+ fileSizeError: (t, l) => `File "${t}" must be smaller than ${l}MB`,
1469
1470
  fileTypeError: (t) => `File type "${t}" is not supported`,
1470
1471
  uploadFailed: "Upload failed",
1471
1472
  file: "File",
@@ -1474,25 +1475,25 @@ const Lt = {
1474
1475
  audio: "Audio",
1475
1476
  document: "Document"
1476
1477
  }
1477
- }, Qt = ({
1478
+ }, lr = ({
1478
1479
  multiple: t = !1,
1479
- accept: a = "*/*",
1480
+ accept: l = "*/*",
1480
1481
  maxSize: r = 10,
1481
- maxFiles: l = 5,
1482
- disabled: p = !1,
1483
- label: i,
1484
- required: s = !1,
1485
- error: d,
1486
- className: C,
1487
- onFilesChange: k,
1488
- onUpload: M,
1489
- showPreview: D = !0,
1490
- locale: A = "uz",
1491
- showFileTypeIcon: E = !0,
1492
- variant: v = "yellow",
1493
- customValidator: u
1482
+ maxFiles: s = 5,
1483
+ disabled: m = !1,
1484
+ label: u,
1485
+ required: a = !1,
1486
+ error: c,
1487
+ className: N,
1488
+ onFilesChange: y,
1489
+ onUpload: C,
1490
+ showPreview: F = !0,
1491
+ locale: I = "uz",
1492
+ showFileTypeIcon: R = !0,
1493
+ variant: w = "yellow",
1494
+ customValidator: k
1494
1495
  }) => {
1495
- const [m, b] = _([]), [w, h] = _(!1), [y, $] = _(!1), L = le(null), j = Lt[A], o = v === "blue" ? {
1496
+ const [b, j] = H([]), [S, x] = H(!1), [h, A] = H(!1), M = de(null), D = Tt[I], i = w === "blue" ? {
1496
1497
  dropBorder: "border-blue-200 hover:border-blue-300",
1497
1498
  dropBg: "bg-blue-50/40 hover:bg-blue-50/60",
1498
1499
  dropActive: "border-blue-600 bg-blue-50",
@@ -1512,343 +1513,343 @@ const Lt = {
1512
1513
  progressFill: "bg-yellow-600",
1513
1514
  fileIconImg: "bg-blue-50 text-blue-600",
1514
1515
  fileIconDoc: "bg-green-50 text-green-600"
1515
- }, N = (g) => {
1516
- switch (g.type.split("/")[0]) {
1516
+ }, d = (p) => {
1517
+ switch (p.type.split("/")[0]) {
1517
1518
  case "image":
1518
- return /* @__PURE__ */ e(dt, { className: "h-5 w-5 text-blue-500" });
1519
+ return /* @__PURE__ */ e(mt, { className: "h-5 w-5 text-blue-500" });
1519
1520
  case "video":
1520
- return /* @__PURE__ */ e(ct, { className: "h-5 w-5 text-purple-500" });
1521
+ return /* @__PURE__ */ e(ht, { className: "h-5 w-5 text-purple-500" });
1521
1522
  case "audio":
1522
- return /* @__PURE__ */ e(it, { className: "h-5 w-5 text-green-500" });
1523
+ return /* @__PURE__ */ e(ut, { className: "h-5 w-5 text-green-500" });
1523
1524
  default:
1524
- return g.type.includes("pdf") ? /* @__PURE__ */ e(Se, { className: "h-5 w-5 text-red-500" }) : g.type.includes("word") || g.type.includes("document") ? /* @__PURE__ */ e(Se, { className: "h-5 w-5 text-blue-600" }) : g.type.includes("excel") || g.type.includes("spreadsheet") ? /* @__PURE__ */ e(Se, { className: "h-5 w-5 text-green-600" }) : /* @__PURE__ */ e(Te, { className: "h-5 w-5 text-gray-500" });
1525
+ return p.type.includes("pdf") ? /* @__PURE__ */ e(Ae, { className: "h-5 w-5 text-red-500" }) : p.type.includes("word") || p.type.includes("document") ? /* @__PURE__ */ e(Ae, { className: "h-5 w-5 text-blue-600" }) : p.type.includes("excel") || p.type.includes("spreadsheet") ? /* @__PURE__ */ e(Ae, { className: "h-5 w-5 text-green-600" }) : /* @__PURE__ */ e($e, { className: "h-5 w-5 text-gray-500" });
1525
1526
  }
1526
- }, T = (g) => {
1527
- if (g === 0) return "0 Bytes";
1528
- const I = 1024, O = ["Bytes", "KB", "MB", "GB"], U = Math.floor(Math.log(g) / Math.log(I));
1529
- return parseFloat((g / Math.pow(I, U)).toFixed(2)) + " " + O[U];
1530
- }, Y = (g) => {
1531
- const I = r * 1024 * 1024;
1532
- return g.size <= I;
1533
- }, q = (g) => a === "*/*" ? !0 : a.split(",").map((O) => O.trim()).some((O) => {
1534
- if (O.endsWith("/*")) {
1535
- const U = O.replace("/*", "");
1536
- return g.type.startsWith(U);
1527
+ }, v = (p) => {
1528
+ if (p === 0) return "0 Bytes";
1529
+ const $ = 1024, V = ["Bytes", "KB", "MB", "GB"], _ = Math.floor(Math.log(p) / Math.log($));
1530
+ return parseFloat((p / Math.pow($, _)).toFixed(2)) + " " + V[_];
1531
+ }, E = (p) => {
1532
+ const $ = r * 1024 * 1024;
1533
+ return p.size <= $;
1534
+ }, B = (p) => l === "*/*" ? !0 : l.split(",").map((V) => V.trim()).some((V) => {
1535
+ if (V.endsWith("/*")) {
1536
+ const _ = V.replace("/*", "");
1537
+ return p.type.startsWith(_);
1537
1538
  }
1538
- return g.type === O || g.name.toLowerCase().endsWith(O.replace("*.", "."));
1539
- }), B = (g) => new Promise((I) => {
1540
- if (g.type.startsWith("image/")) {
1541
- const O = new FileReader();
1542
- O.onload = (U) => I(U.target?.result), O.readAsDataURL(g);
1539
+ return p.type === V || p.name.toLowerCase().endsWith(V.replace("*.", "."));
1540
+ }), z = (p) => new Promise(($) => {
1541
+ if (p.type.startsWith("image/")) {
1542
+ const V = new FileReader();
1543
+ V.onload = (_) => $(_.target?.result), V.readAsDataURL(p);
1543
1544
  } else
1544
- I("");
1545
- }), P = le(/* @__PURE__ */ new Map()), W = R((g) => {
1546
- const I = P.current.get(g);
1547
- I && (URL.revokeObjectURL(I), P.current.delete(g));
1548
- }, []), Q = R(() => {
1549
- for (const g of P.current.values())
1550
- URL.revokeObjectURL(g);
1551
- P.current.clear();
1545
+ $("");
1546
+ }), O = de(/* @__PURE__ */ new Map()), W = P((p) => {
1547
+ const $ = O.current.get(p);
1548
+ $ && (URL.revokeObjectURL($), O.current.delete(p));
1549
+ }, []), J = P(() => {
1550
+ for (const p of O.current.values())
1551
+ URL.revokeObjectURL(p);
1552
+ O.current.clear();
1552
1553
  }, []);
1553
- J(() => () => {
1554
- Q();
1555
- }, [Q]);
1556
- const ne = R((g) => {
1557
- let I = P.current.get(g.id);
1558
- I || (I = URL.createObjectURL(g.file), P.current.set(g.id, I), setTimeout(() => W(g.id), 5 * 6e4)), window.open(I, "_blank", "noopener,noreferrer");
1559
- }, [W]), K = R(
1560
- async (g) => {
1561
- const I = Array.from(g), O = [];
1562
- for (const U of I) {
1563
- if (m.length + O.length >= l) {
1564
- alert(j.maxFilesError(l));
1554
+ ee(() => () => {
1555
+ J();
1556
+ }, [J]);
1557
+ const G = P((p) => {
1558
+ let $ = O.current.get(p.id);
1559
+ $ || ($ = URL.createObjectURL(p.file), O.current.set(p.id, $), setTimeout(() => W(p.id), 5 * 6e4)), window.open($, "_blank", "noopener,noreferrer");
1560
+ }, [W]), K = P(
1561
+ async (p) => {
1562
+ const $ = Array.from(p), V = [];
1563
+ for (const _ of $) {
1564
+ if (b.length + V.length >= s) {
1565
+ alert(D.maxFilesError(s));
1565
1566
  break;
1566
1567
  }
1567
- if (!Y(U)) {
1568
- alert(j.fileSizeError(U.name, r));
1568
+ if (!E(_)) {
1569
+ alert(D.fileSizeError(_.name, r));
1569
1570
  continue;
1570
1571
  }
1571
- if (!q(U)) {
1572
- alert(j.fileTypeError(U.name));
1572
+ if (!B(_)) {
1573
+ alert(D.fileTypeError(_.name));
1573
1574
  continue;
1574
1575
  }
1575
- if (u) {
1576
- const xe = u(U);
1577
- if (xe) {
1578
- alert(xe);
1576
+ if (k) {
1577
+ const we = k(_);
1578
+ if (we) {
1579
+ alert(we);
1579
1580
  continue;
1580
1581
  }
1581
1582
  }
1582
- const F = await B(U), X = M ? "uploading" : "success", me = M ? 0 : 100;
1583
- O.push({
1583
+ const T = await z(_), Q = C ? "uploading" : "success", ue = C ? 0 : 100;
1584
+ V.push({
1584
1585
  id: Math.random().toString(36).substr(2, 9),
1585
- file: U,
1586
- preview: F,
1587
- progress: me,
1588
- status: X
1586
+ file: _,
1587
+ preview: T,
1588
+ progress: ue,
1589
+ status: Q
1589
1590
  });
1590
1591
  }
1591
- if (O.length > 0) {
1592
- const U = t ? [...m, ...O] : O;
1593
- if (b(U), k?.(U.map((F) => F.file)), M) {
1594
- $(!0);
1592
+ if (V.length > 0) {
1593
+ const _ = t ? [...b, ...V] : V;
1594
+ if (j(_), y?.(_.map((T) => T.file)), C) {
1595
+ A(!0);
1595
1596
  try {
1596
- const F = U.map((X, me) => ({
1597
- ...X,
1598
- progress: Math.min(100, (me + 1) / U.length * 100)
1597
+ const T = _.map((Q, ue) => ({
1598
+ ...Q,
1599
+ progress: Math.min(100, (ue + 1) / _.length * 100)
1599
1600
  }));
1600
- b(F), await M(F), b(
1601
- (X) => X.map((me) => ({
1602
- ...me,
1601
+ j(T), await C(T), j(
1602
+ (Q) => Q.map((ue) => ({
1603
+ ...ue,
1603
1604
  status: "success",
1604
1605
  progress: 100
1605
1606
  }))
1606
1607
  );
1607
- } catch (F) {
1608
- b(
1609
- (X) => X.map((me) => ({
1610
- ...me,
1608
+ } catch (T) {
1609
+ j(
1610
+ (Q) => Q.map((ue) => ({
1611
+ ...ue,
1611
1612
  status: "error",
1612
- error: F instanceof Error ? F.message : j.uploadFailed
1613
+ error: T instanceof Error ? T.message : D.uploadFailed
1613
1614
  }))
1614
1615
  );
1615
1616
  } finally {
1616
- $(!1);
1617
+ A(!1);
1617
1618
  }
1618
1619
  }
1619
1620
  }
1620
1621
  },
1621
1622
  [
1622
- m,
1623
- l,
1624
- Y,
1625
- q,
1626
- u,
1627
- j,
1623
+ b,
1624
+ s,
1625
+ E,
1626
+ B,
1627
+ k,
1628
+ D,
1628
1629
  r,
1629
1630
  t,
1630
- k,
1631
- M
1631
+ y,
1632
+ C
1632
1633
  ]
1633
- ), ae = R(
1634
- (g) => {
1635
- g.preventDefault(), p || h(!0);
1634
+ ), le = P(
1635
+ (p) => {
1636
+ p.preventDefault(), m || x(!0);
1636
1637
  },
1637
- [p]
1638
- ), ce = R((g) => {
1639
- g.preventDefault(), h(!1);
1640
- }, []), ee = R(
1641
- (g) => {
1642
- if (g.preventDefault(), h(!1), p) return;
1643
- const I = g.dataTransfer.files;
1644
- I.length > 0 && K(I);
1638
+ [m]
1639
+ ), oe = P((p) => {
1640
+ p.preventDefault(), x(!1);
1641
+ }, []), te = P(
1642
+ (p) => {
1643
+ if (p.preventDefault(), x(!1), m) return;
1644
+ const $ = p.dataTransfer.files;
1645
+ $.length > 0 && K($);
1645
1646
  },
1646
- [p, K]
1647
- ), de = R(
1648
- (g) => {
1649
- const I = g.target.files;
1650
- I && I.length > 0 && (K(I), L.current && (L.current.value = ""));
1647
+ [m, K]
1648
+ ), ie = P(
1649
+ (p) => {
1650
+ const $ = p.target.files;
1651
+ $ && $.length > 0 && (K($), M.current && (M.current.value = ""));
1651
1652
  },
1652
1653
  [K]
1653
- ), z = R(
1654
- (g) => {
1655
- W(g), b((I) => {
1656
- const O = I.filter((U) => U.id !== g);
1657
- return k?.(O.map((U) => U.file)), O;
1654
+ ), Y = P(
1655
+ (p) => {
1656
+ W(p), j(($) => {
1657
+ const V = $.filter((_) => _.id !== p);
1658
+ return y?.(V.map((_) => _.file)), V;
1658
1659
  });
1659
1660
  },
1660
- [k, W]
1661
- ), G = R(() => {
1662
- Q(), b([]), k?.([]);
1663
- }, [k, Q]), oe = R(() => {
1664
- L.current?.click();
1661
+ [y, W]
1662
+ ), X = P(() => {
1663
+ J(), j([]), y?.([]);
1664
+ }, [y, J]), ae = P(() => {
1665
+ M.current?.click();
1665
1666
  }, []);
1666
- return /* @__PURE__ */ c("div", { className: n("w-full", C), children: [
1667
- i && /* @__PURE__ */ c(
1667
+ return /* @__PURE__ */ o("div", { className: n("w-full", N), children: [
1668
+ u && /* @__PURE__ */ o(
1668
1669
  "label",
1669
1670
  {
1670
1671
  className: n(
1671
1672
  "mb-2 block text-base font-medium",
1672
- d ? "text-red-600" : "text-slate-700"
1673
+ c ? "text-red-600" : "text-slate-700"
1673
1674
  ),
1674
1675
  children: [
1675
- i,
1676
- s && /* @__PURE__ */ e("span", { className: "ml-1 text-extra-small text-red-600", children: "*" })
1676
+ u,
1677
+ a && /* @__PURE__ */ e("span", { className: "ml-1 text-extra-small text-red-600", children: "*" })
1677
1678
  ]
1678
1679
  }
1679
1680
  ),
1680
- /* @__PURE__ */ c(
1681
+ /* @__PURE__ */ o(
1681
1682
  "div",
1682
1683
  {
1683
1684
  className: n(
1684
1685
  "group relative flex min-h-[180px] w-full cursor-pointer items-center justify-center rounded-2xl border border-dashed p-6 text-center transition-all duration-300",
1685
- o.dropBorder,
1686
- o.dropBg,
1687
- w && o.dropActive,
1688
- p && "cursor-not-allowed opacity-60",
1689
- d && "border-red-600 bg-red-50/30"
1686
+ i.dropBorder,
1687
+ i.dropBg,
1688
+ S && i.dropActive,
1689
+ m && "cursor-not-allowed opacity-60",
1690
+ c && "border-red-600 bg-red-50/30"
1690
1691
  ),
1691
- onDragOver: ae,
1692
- onDragLeave: ce,
1693
- onDrop: ee,
1694
- onClick: oe,
1692
+ onDragOver: le,
1693
+ onDragLeave: oe,
1694
+ onDrop: te,
1695
+ onClick: ae,
1695
1696
  children: [
1696
1697
  /* @__PURE__ */ e(
1697
1698
  "input",
1698
1699
  {
1699
- ref: L,
1700
+ ref: M,
1700
1701
  type: "file",
1701
1702
  multiple: t,
1702
- accept: a,
1703
- onChange: de,
1704
- disabled: p,
1703
+ accept: l,
1704
+ onChange: ie,
1705
+ disabled: m,
1705
1706
  className: "hidden"
1706
1707
  }
1707
1708
  ),
1708
- /* @__PURE__ */ c("div", { className: "flex flex-col items-center gap-3", children: [
1709
- /* @__PURE__ */ e("div", { className: n("flex h-12 w-12 items-center justify-center rounded-xl", o.iconWrap), children: /* @__PURE__ */ e(ot, { size: 20 }) }),
1710
- /* @__PURE__ */ e("p", { className: n("text-base font-medium", o.title), children: j.dropHereTitle }),
1711
- /* @__PURE__ */ e("p", { className: n("text-sm font-normal", o.hint), children: j.fileRequirements(t, l, r, a) })
1709
+ /* @__PURE__ */ o("div", { className: "flex flex-col items-center gap-3", children: [
1710
+ /* @__PURE__ */ e("div", { className: n("flex h-12 w-12 items-center justify-center rounded-xl", i.iconWrap), children: /* @__PURE__ */ e(dt, { size: 20 }) }),
1711
+ /* @__PURE__ */ e("p", { className: n("text-base font-medium", i.title), children: D.dropHereTitle }),
1712
+ /* @__PURE__ */ e("p", { className: n("text-sm font-normal", i.hint), children: D.fileRequirements(t, s, r, l) })
1712
1713
  ] })
1713
1714
  ]
1714
1715
  }
1715
1716
  ),
1716
- m.length > 0 && /* @__PURE__ */ c("div", { className: "mt-4 space-y-3", children: [
1717
- /* @__PURE__ */ c("div", { className: "flex items-center justify-between", children: [
1718
- /* @__PURE__ */ c("span", { className: "text-sm font-medium text-slate-700", children: [
1719
- j.selectedFiles,
1717
+ b.length > 0 && /* @__PURE__ */ o("div", { className: "mt-4 space-y-3", children: [
1718
+ /* @__PURE__ */ o("div", { className: "flex items-center justify-between", children: [
1719
+ /* @__PURE__ */ o("span", { className: "text-sm font-medium text-slate-700", children: [
1720
+ D.selectedFiles,
1720
1721
  " (",
1721
- m.length,
1722
+ b.length,
1722
1723
  ")"
1723
1724
  ] }),
1724
- m.length > 1 && /* @__PURE__ */ e(
1725
+ b.length > 1 && /* @__PURE__ */ e(
1725
1726
  "button",
1726
1727
  {
1727
1728
  type: "button",
1728
- onClick: G,
1729
- disabled: p || y,
1729
+ onClick: X,
1730
+ disabled: m || h,
1730
1731
  className: "text-sm font-medium text-red-600 disabled:opacity-50",
1731
- children: j.clearAll
1732
+ children: D.clearAll
1732
1733
  }
1733
1734
  )
1734
1735
  ] }),
1735
- /* @__PURE__ */ e("div", { className: "space-y-3", children: m.map((g) => {
1736
- const O = !!g.preview ? o.fileIconImg : o.fileIconDoc, U = p || y || g.status === "uploading";
1737
- return /* @__PURE__ */ c(
1736
+ /* @__PURE__ */ e("div", { className: "space-y-3", children: b.map((p) => {
1737
+ const V = !!p.preview ? i.fileIconImg : i.fileIconDoc, _ = m || h || p.status === "uploading";
1738
+ return /* @__PURE__ */ o(
1738
1739
  "div",
1739
1740
  {
1740
1741
  className: n(
1741
1742
  "flex items-center justify-between rounded-2xl border border-slate-200 p-4",
1742
- g.status === "error" && "border-red-600"
1743
+ p.status === "error" && "border-red-600"
1743
1744
  ),
1744
1745
  children: [
1745
- /* @__PURE__ */ c("div", { className: "flex min-w-0 items-center gap-4", children: [
1746
+ /* @__PURE__ */ o("div", { className: "flex min-w-0 items-center gap-4", children: [
1746
1747
  /* @__PURE__ */ e(
1747
1748
  "div",
1748
1749
  {
1749
1750
  className: n(
1750
1751
  "flex h-14 w-14 items-center justify-center rounded-2xl",
1751
- O
1752
+ V
1752
1753
  ),
1753
- children: D && g.preview ? /* @__PURE__ */ e(
1754
+ children: F && p.preview ? /* @__PURE__ */ e(
1754
1755
  "img",
1755
1756
  {
1756
- src: g.preview,
1757
- alt: g.file.name,
1757
+ src: p.preview,
1758
+ alt: p.file.name,
1758
1759
  className: "h-10 w-10 rounded-xl object-cover"
1759
1760
  }
1760
- ) : E ? N(g.file) : /* @__PURE__ */ e(Te, { className: "h-6 w-6 text-slate-500" })
1761
+ ) : R ? d(p.file) : /* @__PURE__ */ e($e, { className: "h-6 w-6 text-slate-500" })
1761
1762
  }
1762
1763
  ),
1763
- /* @__PURE__ */ c("div", { className: "min-w-0", children: [
1764
- /* @__PURE__ */ e("p", { className: "truncate text-lg font-semibold text-primary", children: g.file.name }),
1765
- /* @__PURE__ */ c("div", { className: "mt-1 flex flex-wrap items-center gap-2 text-sm text-slate-500", children: [
1766
- /* @__PURE__ */ e("span", { children: T(g.file.size) }),
1767
- g.status === "uploading" && /* @__PURE__ */ c(he, { children: [
1764
+ /* @__PURE__ */ o("div", { className: "min-w-0", children: [
1765
+ /* @__PURE__ */ e("p", { className: "truncate text-lg font-semibold text-primary", children: p.file.name }),
1766
+ /* @__PURE__ */ o("div", { className: "mt-1 flex flex-wrap items-center gap-2 text-sm text-slate-500", children: [
1767
+ /* @__PURE__ */ e("span", { children: v(p.file.size) }),
1768
+ p.status === "uploading" && /* @__PURE__ */ o(me, { children: [
1768
1769
  /* @__PURE__ */ e("span", { children: "•" }),
1769
- /* @__PURE__ */ c("span", { className: "inline-flex items-center", children: [
1770
- /* @__PURE__ */ e(We, { className: "mr-1 h-5 w-5 animate-spin" }),
1771
- j.uploading
1770
+ /* @__PURE__ */ o("span", { className: "inline-flex items-center", children: [
1771
+ /* @__PURE__ */ e(Ve, { className: "mr-1 h-5 w-5 animate-spin" }),
1772
+ D.uploading
1772
1773
  ] })
1773
1774
  ] }),
1774
- g.status === "success" && /* @__PURE__ */ c(he, { children: [
1775
+ p.status === "success" && /* @__PURE__ */ o(me, { children: [
1775
1776
  /* @__PURE__ */ e("span", { children: "•" }),
1776
- /* @__PURE__ */ e("span", { className: "font-normal text-green-600", children: j.success })
1777
+ /* @__PURE__ */ e("span", { className: "font-normal text-green-600", children: D.success })
1777
1778
  ] })
1778
1779
  ] }),
1779
- g.status === "uploading" && /* @__PURE__ */ e("div", { className: n("mt-2 h-1.5 w-full rounded-full bg-slate-200"), children: /* @__PURE__ */ e(
1780
+ p.status === "uploading" && /* @__PURE__ */ e("div", { className: n("mt-2 h-1.5 w-full rounded-full bg-slate-200"), children: /* @__PURE__ */ e(
1780
1781
  "div",
1781
1782
  {
1782
1783
  className: n(
1783
1784
  "h-1.5 rounded-full transition-all duration-300",
1784
- o.progressFill
1785
+ i.progressFill
1785
1786
  ),
1786
- style: { width: `${g.progress}%` }
1787
+ style: { width: `${p.progress}%` }
1787
1788
  }
1788
1789
  ) }),
1789
- g.status === "error" && g.error && /* @__PURE__ */ e("p", { className: "mt-2 text-sm font-normal text-red-600", children: g.error })
1790
+ p.status === "error" && p.error && /* @__PURE__ */ e("p", { className: "mt-2 text-sm font-normal text-red-600", children: p.error })
1790
1791
  ] })
1791
1792
  ] }),
1792
- /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
1793
+ /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
1793
1794
  /* @__PURE__ */ e(
1794
1795
  "button",
1795
1796
  {
1796
1797
  type: "button",
1797
- onClick: (F) => {
1798
- F.stopPropagation(), U || ne(g);
1798
+ onClick: (T) => {
1799
+ T.stopPropagation(), _ || G(p);
1799
1800
  },
1800
- disabled: U,
1801
+ disabled: _,
1801
1802
  className: "rounded-xl p-2 hover:bg-slate-100 hover:cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",
1802
- title: j.preview,
1803
- children: /* @__PURE__ */ e(Oe, { size: 20, className: "text-slate-400" })
1803
+ title: D.preview,
1804
+ children: /* @__PURE__ */ e(He, { size: 20, className: "text-slate-400" })
1804
1805
  }
1805
1806
  ),
1806
1807
  /* @__PURE__ */ e(
1807
1808
  "button",
1808
1809
  {
1809
1810
  type: "button",
1810
- onClick: (F) => {
1811
- F.stopPropagation(), z(g.id);
1811
+ onClick: (T) => {
1812
+ T.stopPropagation(), Y(p.id);
1812
1813
  },
1813
- disabled: p || y,
1814
+ disabled: m || h,
1814
1815
  className: "rounded-xl p-2 text-slate-base hover:bg-slate-100 disabled:opacity-50 hover:cursor-pointer",
1815
- title: j.remove,
1816
+ title: D.remove,
1816
1817
  children: /* @__PURE__ */ e(pe, { className: "h-6 w-6" })
1817
1818
  }
1818
1819
  )
1819
1820
  ] })
1820
1821
  ]
1821
1822
  },
1822
- g.id
1823
+ p.id
1823
1824
  );
1824
1825
  }) })
1825
1826
  ] }),
1826
- d && /* @__PURE__ */ e("p", { className: "mt-2 text-sm font-normal text-red-600", children: d })
1827
+ c && /* @__PURE__ */ e("p", { className: "mt-2 text-sm font-normal text-red-600", children: c })
1827
1828
  ] });
1828
1829
  };
1829
- function er({
1830
+ function sr({
1830
1831
  show: t,
1831
- setShow: a,
1832
+ setShow: l,
1832
1833
  title: r,
1833
- description: l,
1834
- Header: p,
1835
- Body: i,
1836
- footer: s,
1837
- handleClickOutside: d = !1,
1838
- showCloseIcon: C = !0,
1839
- showHeader: k = !0,
1840
- overlayClassName: M,
1841
- containerClassName: D,
1842
- bodyClassName: A,
1843
- footerClassName: E
1834
+ description: s,
1835
+ Header: m,
1836
+ Body: u,
1837
+ footer: a,
1838
+ handleClickOutside: c = !1,
1839
+ showCloseIcon: N = !0,
1840
+ showHeader: y = !0,
1841
+ overlayClassName: C,
1842
+ containerClassName: F,
1843
+ bodyClassName: I,
1844
+ footerClassName: R
1844
1845
  }) {
1845
- const v = le(null), { handleEscape: u } = Ee(() => a(!1));
1846
- J(() => (t ? (document.addEventListener("keydown", u), document.body.style.overflow = "hidden") : document.body.style.overflow = "unset", () => document.removeEventListener("keydown", u)), [t, u]);
1847
- const { handleClick: m } = De(v, () => {
1848
- d && a(!1);
1846
+ const w = de(null), { handleEscape: k } = Le(() => l(!1));
1847
+ ee(() => (t ? (document.addEventListener("keydown", k), document.body.style.overflow = "hidden") : document.body.style.overflow = "unset", () => document.removeEventListener("keydown", k)), [t, k]);
1848
+ const { handleClick: b } = Se(w, () => {
1849
+ c && l(!1);
1849
1850
  });
1850
- J(() => (t && d && document.addEventListener("mousedown", m), () => document.removeEventListener("mousedown", m)), [t, m, d]);
1851
- const w = k && !!(p || r || l);
1851
+ ee(() => (t && c && document.addEventListener("mousedown", b), () => document.removeEventListener("mousedown", b)), [t, b, c]);
1852
+ const S = y && !!(m || r || s);
1852
1853
  return /* @__PURE__ */ e(
1853
1854
  "div",
1854
1855
  {
@@ -1856,30 +1857,30 @@ function er({
1856
1857
  "bg-black/40 fixed inset-0 z-50 flex justify-center transition-all duration-500 ease-in-out",
1857
1858
  "items-end sm:items-center",
1858
1859
  t ? "opacity-100" : "pointer-events-none opacity-0",
1859
- M
1860
+ C
1860
1861
  ),
1861
- children: /* @__PURE__ */ c(
1862
+ children: /* @__PURE__ */ o(
1862
1863
  "div",
1863
1864
  {
1864
- ref: v,
1865
+ ref: w,
1865
1866
  className: n(
1866
1867
  "relative bg-white w-full",
1867
1868
  "sm:max-w-[720px]",
1868
1869
  "rounded-t-2xl sm:rounded-2xl",
1869
1870
  "transition-all duration-500 ease-out",
1870
1871
  t ? "scale-100 opacity-100" : "scale-95 opacity-0",
1871
- D
1872
+ F
1872
1873
  ),
1873
1874
  children: [
1874
- w && /* @__PURE__ */ c("div", { className: "border-b border-slate-200 flex items-start justify-between p-4 sm:p-6 mb-4", children: [
1875
- p || /* @__PURE__ */ c("div", { className: "block", children: [
1875
+ S && /* @__PURE__ */ o("div", { className: "border-b border-slate-200 flex items-start justify-between p-4 sm:p-6 mb-4", children: [
1876
+ m || /* @__PURE__ */ o("div", { className: "block", children: [
1876
1877
  /* @__PURE__ */ e("h2", { className: "text-h3 font-semibold text-black", children: r }),
1877
- l && /* @__PURE__ */ e("p", { className: "text-base text-slate-base font-normal mt-2", children: l })
1878
+ s && /* @__PURE__ */ e("p", { className: "text-base text-slate-base font-normal mt-2", children: s })
1878
1879
  ] }),
1879
- C && /* @__PURE__ */ e(
1880
+ N && /* @__PURE__ */ e(
1880
1881
  "button",
1881
1882
  {
1882
- onClick: () => a(!1),
1883
+ onClick: () => l(!1),
1883
1884
  className: "bg-slate-100 rounded-xl w-12 h-12 hover:cursor-pointer text-black transition flex items-center justify-center group",
1884
1885
  "aria-label": "Close modal",
1885
1886
  type: "button",
@@ -1887,27 +1888,27 @@ function er({
1887
1888
  }
1888
1889
  )
1889
1890
  ] }),
1890
- i && /* @__PURE__ */ e(
1891
+ u && /* @__PURE__ */ e(
1891
1892
  "div",
1892
1893
  {
1893
1894
  className: n(
1894
1895
  "scrollbar-thin scrollbar-thumb-slate-200 overflow-y-auto",
1895
1896
  "max-h-[70dvh] sm:max-h-96",
1896
1897
  "px-4 sm:px-6 mb-2",
1897
- A
1898
+ I
1898
1899
  ),
1899
- children: i
1900
+ children: u
1900
1901
  }
1901
1902
  ),
1902
- s && /* @__PURE__ */ e(
1903
+ a && /* @__PURE__ */ e(
1903
1904
  "div",
1904
1905
  {
1905
1906
  className: n(
1906
1907
  "flex items-center justify-end gap-3 border-t border-slate-200",
1907
1908
  "p-4 sm:p-6",
1908
- E
1909
+ R
1909
1910
  ),
1910
- children: s
1911
+ children: a
1911
1912
  }
1912
1913
  )
1913
1914
  ]
@@ -1916,33 +1917,33 @@ function er({
1916
1917
  }
1917
1918
  );
1918
1919
  }
1919
- function tr({
1920
+ function ar({
1920
1921
  totalItems: t,
1921
- currentPage: a,
1922
+ currentPage: l,
1922
1923
  perPage: r,
1923
- onPageChange: l,
1924
- onPerPageChange: p,
1925
- siblingCount: i = 1,
1926
- perPageOptions: s = [10, 30, 50, 100],
1927
- showPerPage: d = !0,
1928
- variant: C = "yellow",
1929
- size: k = "large",
1930
- paginationClassName: M
1924
+ onPageChange: s,
1925
+ onPerPageChange: m,
1926
+ siblingCount: u = 1,
1927
+ perPageOptions: a = [10, 30, 50, 100],
1928
+ showPerPage: c = !0,
1929
+ variant: N = "yellow",
1930
+ size: y = "large",
1931
+ paginationClassName: C
1931
1932
  }) {
1932
- const D = Number.isFinite(t) && t > 0 ? t : 0, A = Number.isFinite(r) && r > 0 ? r : 10, E = Math.max(1, Number.isFinite(a) ? a : 1), v = Math.ceil(D / A);
1933
- if (v <= 1 || D === 0) return null;
1934
- const m = (() => {
1935
- const h = [], y = i * 2 + 5;
1936
- if (v <= y)
1937
- return Array.from({ length: v }, (j, o) => o + 1);
1938
- const $ = Math.max(E - i, 2), L = Math.min(E + i, v - 1);
1939
- h.push(1), $ > 2 && h.push("...");
1940
- for (let j = $; j <= L; j++) h.push(j);
1941
- return L < v - 1 && h.push("..."), v > 1 && h.push(v), h;
1942
- })(), b = {
1933
+ const F = Number.isFinite(t) && t > 0 ? t : 0, I = Number.isFinite(r) && r > 0 ? r : 10, R = Math.max(1, Number.isFinite(l) ? l : 1), w = Math.ceil(F / I);
1934
+ if (w <= 1 || F === 0) return null;
1935
+ const b = (() => {
1936
+ const x = [], h = u * 2 + 5;
1937
+ if (w <= h)
1938
+ return Array.from({ length: w }, (D, i) => i + 1);
1939
+ const A = Math.max(R - u, 2), M = Math.min(R + u, w - 1);
1940
+ x.push(1), A > 2 && x.push("...");
1941
+ for (let D = A; D <= M; D++) x.push(D);
1942
+ return M < w - 1 && x.push("..."), w > 1 && x.push(w), x;
1943
+ })(), j = {
1943
1944
  medium: "h-9 text-sm",
1944
1945
  large: "h-10 text-base"
1945
- }[k], w = {
1946
+ }[y], S = {
1946
1947
  yellow: {
1947
1948
  active: "bg-yellow-500 text-white border-yellow-500",
1948
1949
  inactive: "bg-slate-100 border-slate-200 text-black hover:bg-slate-200",
@@ -1955,12 +1956,12 @@ function tr({
1955
1956
  disabled: "text-slate-400 border-slate-300",
1956
1957
  arrow: "text-black"
1957
1958
  }
1958
- }[C ?? "yellow"];
1959
- return /* @__PURE__ */ c("div", { className: n(
1959
+ }[N ?? "yellow"];
1960
+ return /* @__PURE__ */ o("div", { className: n(
1960
1961
  "flex items-center justify-between gap-4 w-full",
1961
- M
1962
+ C
1962
1963
  ), children: [
1963
- d && p && /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
1964
+ c && m && /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
1964
1965
  /* @__PURE__ */ e(
1965
1966
  "span",
1966
1967
  {
@@ -1968,22 +1969,22 @@ function tr({
1968
1969
  children: "Строк на странице:"
1969
1970
  }
1970
1971
  ),
1971
- /* @__PURE__ */ c("div", { className: "relative", children: [
1972
+ /* @__PURE__ */ o("div", { className: "relative", children: [
1972
1973
  /* @__PURE__ */ e(
1973
1974
  "select",
1974
1975
  {
1975
- value: A,
1976
- onChange: (h) => p(Number(h.target.value)),
1976
+ value: I,
1977
+ onChange: (x) => m(Number(x.target.value)),
1977
1978
  className: n(
1978
1979
  "appearance-none bg-white border border-slate-200 rounded-lg pl-3 pr-8 text-base text-black font-medium focus:outline-none cursor-pointer",
1979
- k === "large" ? "h-10" : "h-9"
1980
+ y === "large" ? "h-10" : "h-9"
1980
1981
  ),
1981
1982
  "aria-label": "Количество строк на странице",
1982
- children: s.map((h) => /* @__PURE__ */ e("option", { value: h, children: h }, h))
1983
+ children: a.map((x) => /* @__PURE__ */ e("option", { value: x, children: x }, x))
1983
1984
  }
1984
1985
  ),
1985
1986
  /* @__PURE__ */ e(
1986
- Fe,
1987
+ Ee,
1987
1988
  {
1988
1989
  className: "absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-slate-400",
1989
1990
  weight: "Linear",
@@ -1992,71 +1993,71 @@ function tr({
1992
1993
  )
1993
1994
  ] })
1994
1995
  ] }),
1995
- /* @__PURE__ */ c("nav", { "aria-label": "Пагинация", className: "flex items-center gap-1 shrink-0 whitespace-nowrap", children: [
1996
+ /* @__PURE__ */ o("nav", { "aria-label": "Пагинация", className: "flex items-center gap-1 shrink-0 whitespace-nowrap", children: [
1996
1997
  /* @__PURE__ */ e(
1997
1998
  "button",
1998
1999
  {
1999
- onClick: () => l(E - 1),
2000
- disabled: E === 1,
2000
+ onClick: () => s(R - 1),
2001
+ disabled: R === 1,
2001
2002
  "aria-label": "Предыдущая страница",
2002
2003
  className: n(
2003
2004
  "flex items-center justify-center rounded-lg border transition-all bg-slate-100 min-w-10",
2004
- b,
2005
- E === 1 ? n("cursor-not-allowed opacity-50", w.disabled) : n("hover:cursor-pointer", w.arrow, "border-slate-200")
2005
+ j,
2006
+ R === 1 ? n("cursor-not-allowed opacity-50", S.disabled) : n("hover:cursor-pointer", S.arrow, "border-slate-200")
2006
2007
  ),
2007
- children: /* @__PURE__ */ e(ke, { weight: "Linear", size: 20 })
2008
+ children: /* @__PURE__ */ e(Ce, { weight: "Linear", size: 20 })
2008
2009
  }
2009
2010
  ),
2010
- /* @__PURE__ */ e("div", { className: "flex items-center gap-1", children: m.map((h, y) => {
2011
- if (h === "...")
2011
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-1", children: b.map((x, h) => {
2012
+ if (x === "...")
2012
2013
  return /* @__PURE__ */ e(
2013
2014
  "span",
2014
2015
  {
2015
- className: n("flex items-center justify-center text-black font-medium min-w-10", b),
2016
+ className: n("flex items-center justify-center text-black font-medium min-w-10", j),
2016
2017
  "aria-hidden": "true",
2017
- children: /* @__PURE__ */ e(ut, { weight: "Bold", size: 20 })
2018
+ children: /* @__PURE__ */ e(ft, { weight: "Bold", size: 20 })
2018
2019
  },
2019
- y
2020
+ h
2020
2021
  );
2021
- const $ = h === E;
2022
+ const A = x === R;
2022
2023
  return /* @__PURE__ */ e(
2023
2024
  "button",
2024
2025
  {
2025
- onClick: () => l(h),
2026
- "aria-label": `Страница ${h}${$ ? ", текущая" : ""}`,
2027
- "aria-current": $ ? "page" : void 0,
2026
+ onClick: () => s(x),
2027
+ "aria-label": `Страница ${x}${A ? ", текущая" : ""}`,
2028
+ "aria-current": A ? "page" : void 0,
2028
2029
  className: n(
2029
2030
  "flex items-center justify-center rounded-lg border font-medium transition-all hover:cursor-pointer min-w-10 px-2",
2030
- b,
2031
- $ ? w.active : w.inactive
2031
+ j,
2032
+ A ? S.active : S.inactive
2032
2033
  ),
2033
- children: h
2034
+ children: x
2034
2035
  },
2035
- y
2036
+ h
2036
2037
  );
2037
2038
  }) }),
2038
2039
  /* @__PURE__ */ e(
2039
2040
  "button",
2040
2041
  {
2041
- onClick: () => l(E + 1),
2042
- disabled: E === v,
2042
+ onClick: () => s(R + 1),
2043
+ disabled: R === w,
2043
2044
  "aria-label": "Следующая страница",
2044
2045
  className: n(
2045
2046
  "flex items-center justify-center rounded-lg border transition-all bg-slate-100 min-w-10",
2046
- b,
2047
- E === v ? n("cursor-not-allowed opacity-50", w.disabled) : n("hover:cursor-pointer", w.arrow, "border-slate-200")
2047
+ j,
2048
+ R === w ? n("cursor-not-allowed opacity-50", S.disabled) : n("hover:cursor-pointer", S.arrow, "border-slate-200")
2048
2049
  ),
2049
- children: /* @__PURE__ */ e(be, { size: 20, weight: "Linear" })
2050
+ children: /* @__PURE__ */ e(xe, { size: 20, weight: "Linear" })
2050
2051
  }
2051
2052
  )
2052
2053
  ] })
2053
2054
  ] });
2054
2055
  }
2055
- function $e({
2056
+ function Pe({
2056
2057
  className: t,
2057
- variant: a = "default",
2058
+ variant: l = "default",
2058
2059
  width: r = "100%",
2059
- height: l = "1rem"
2060
+ height: s = "1rem"
2060
2061
  }) {
2061
2062
  return /* @__PURE__ */ e(
2062
2063
  "div",
@@ -2064,69 +2065,69 @@ function $e({
2064
2065
  className: n(
2065
2066
  "relative overflow-hidden bg-slate-200",
2066
2067
  "rounded-lg",
2067
- a === "circle" && "rounded-full",
2068
- a === "rounded" && "rounded-md",
2068
+ l === "circle" && "rounded-full",
2069
+ l === "rounded" && "rounded-md",
2069
2070
  t
2070
2071
  ),
2071
2072
  style: {
2072
2073
  width: typeof r == "number" ? `${r}px` : r,
2073
- height: typeof l == "number" ? `${l}px` : l
2074
+ height: typeof s == "number" ? `${s}px` : s
2074
2075
  },
2075
2076
  children: /* @__PURE__ */ e("div", { className: "shimmer-mask absolute inset-0" })
2076
2077
  }
2077
2078
  );
2078
2079
  }
2079
- function rr({
2080
+ function or({
2080
2081
  tabs: t,
2081
- defaultTab: a,
2082
+ defaultTab: l,
2082
2083
  position: r = "top",
2083
- className: l,
2084
- tabListClassName: p,
2085
- contentClassName: i,
2086
- extra: s,
2087
- onChange: d
2084
+ className: s,
2085
+ tabListClassName: m,
2086
+ contentClassName: u,
2087
+ extra: a,
2088
+ onChange: c
2088
2089
  }) {
2089
- const [C, k] = _(a || t[0]?.id), [M, D] = _({}), A = le([]), E = () => {
2090
+ const [N, y] = H(l || t[0]?.id), [C, F] = H({}), I = de([]), R = () => {
2090
2091
  requestAnimationFrame(() => {
2091
- const w = t.findIndex((y) => y?.id === C), h = A.current[w];
2092
- if (h) {
2093
- const { offsetLeft: y, offsetTop: $, offsetWidth: L, offsetHeight: j } = h;
2094
- D({
2095
- left: `${y}px`,
2096
- top: `${$}px`,
2097
- width: `${L}px`,
2098
- height: `${j}px`,
2092
+ const S = t.findIndex((h) => h?.id === N), x = I.current[S];
2093
+ if (x) {
2094
+ const { offsetLeft: h, offsetTop: A, offsetWidth: M, offsetHeight: D } = x;
2095
+ F({
2096
+ left: `${h}px`,
2097
+ top: `${A}px`,
2098
+ width: `${M}px`,
2099
+ height: `${D}px`,
2099
2100
  transition: "all 0.35s cubic-bezier(0.25, 1, 0.5, 1)"
2100
2101
  });
2101
2102
  }
2102
2103
  });
2103
2104
  };
2104
- J(() => (E(), window.addEventListener("resize", E), "fonts" in document && document.fonts.ready.then(E), () => window.removeEventListener("resize", E)), [C, r, t]), J(() => {
2105
- A.current = A.current.slice(0, t.length);
2105
+ ee(() => (R(), window.addEventListener("resize", R), "fonts" in document && document.fonts.ready.then(R), () => window.removeEventListener("resize", R)), [N, r, t]), ee(() => {
2106
+ I.current = I.current.slice(0, t.length);
2106
2107
  }, [t]);
2107
- const v = r === "left" || r === "right", u = {
2108
+ const w = r === "left" || r === "right", k = {
2108
2109
  top: "flex-col",
2109
2110
  bottom: "flex-col-reverse",
2110
2111
  left: "flex-row",
2111
2112
  right: "flex-row-reverse"
2112
- }, m = {
2113
+ }, b = {
2113
2114
  top: "flex-row",
2114
2115
  bottom: "flex-row",
2115
2116
  left: "flex-col",
2116
2117
  right: "flex-col"
2117
- }, b = {
2118
+ }, j = {
2118
2119
  top: "mt-4",
2119
2120
  bottom: "mb-4",
2120
2121
  left: "ml-4",
2121
2122
  right: "mr-4"
2122
2123
  };
2123
- return /* @__PURE__ */ c("div", { className: n("flex w-full", u[r], l), children: [
2124
- /* @__PURE__ */ c(
2124
+ return /* @__PURE__ */ o("div", { className: n("flex w-full", k[r], s), children: [
2125
+ /* @__PURE__ */ o(
2125
2126
  "div",
2126
2127
  {
2127
2128
  className: n(
2128
2129
  "flex w-full gap-4",
2129
- v ? "flex-col items-start" : "flex-row flex-wrap items-center"
2130
+ w ? "flex-col items-start" : "flex-row flex-wrap items-center"
2130
2131
  ),
2131
2132
  children: [
2132
2133
  /* @__PURE__ */ e(
@@ -2134,49 +2135,49 @@ function rr({
2134
2135
  {
2135
2136
  className: n(
2136
2137
  "flex-1",
2137
- v ? "w-full" : "min-w-[520px]"
2138
+ w ? "w-full" : "min-w-[520px]"
2138
2139
  ),
2139
- children: /* @__PURE__ */ c(
2140
+ children: /* @__PURE__ */ o(
2140
2141
  "div",
2141
2142
  {
2142
2143
  className: n(
2143
2144
  "relative flex rounded-xl bg-slate-100 p-1",
2144
- m[r],
2145
- !v && "w-full overflow-hidden",
2146
- v ? "min-w-48" : "",
2147
- p
2145
+ b[r],
2146
+ !w && "w-full overflow-hidden",
2147
+ w ? "min-w-48" : "",
2148
+ m
2148
2149
  ),
2149
2150
  children: [
2150
2151
  /* @__PURE__ */ e(
2151
2152
  "div",
2152
2153
  {
2153
- className: n("absolute rounded-lg bg-white", v ? "w-full" : "h-full"),
2154
- style: M
2154
+ className: n("absolute rounded-lg bg-white", w ? "w-full" : "h-full"),
2155
+ style: C
2155
2156
  }
2156
2157
  ),
2157
- t?.map((w, h) => {
2158
- const y = C === w.id;
2159
- return /* @__PURE__ */ c(
2158
+ t?.map((S, x) => {
2159
+ const h = N === S.id;
2160
+ return /* @__PURE__ */ o(
2160
2161
  "button",
2161
2162
  {
2162
- ref: ($) => {
2163
- A.current[h] = $;
2163
+ ref: (A) => {
2164
+ I.current[x] = A;
2164
2165
  },
2165
2166
  onClick: () => {
2166
- w?.disabled || (k(w?.id), d?.(w?.id));
2167
+ S?.disabled || (y(S?.id), c?.(S?.id));
2167
2168
  },
2168
- disabled: w?.disabled,
2169
+ disabled: S?.disabled,
2169
2170
  className: n(
2170
2171
  "relative z-10 flex items-center justify-center whitespace-nowrap px-3 py-2 text-base font-normal text-black transition-colors duration-300 hover:cursor-pointer",
2171
- w?.disabled && "cursor-not-allowed opacity-50",
2172
- v ? "w-full justify-start" : "flex-1 min-w-0"
2172
+ S?.disabled && "cursor-not-allowed opacity-50",
2173
+ w ? "w-full justify-start" : "flex-1 min-w-0"
2173
2174
  ),
2174
2175
  children: [
2175
- w?.icon && /* @__PURE__ */ e("span", { className: n("shrink-0 transition-transform duration-200", y && "scale-110"), children: w?.icon }),
2176
- /* @__PURE__ */ e("span", { className: "relative z-10 truncate", title: w?.label, children: w?.label })
2176
+ S?.icon && /* @__PURE__ */ e("span", { className: n("shrink-0 transition-transform duration-200", h && "scale-110"), children: S?.icon }),
2177
+ /* @__PURE__ */ e("span", { className: "relative z-10 truncate", title: S?.label, children: S?.label })
2177
2178
  ]
2178
2179
  },
2179
- w?.id
2180
+ S?.id
2180
2181
  );
2181
2182
  })
2182
2183
  ]
@@ -2184,152 +2185,152 @@ function rr({
2184
2185
  )
2185
2186
  }
2186
2187
  ),
2187
- s && /* @__PURE__ */ e(
2188
+ a && /* @__PURE__ */ e(
2188
2189
  "div",
2189
2190
  {
2190
2191
  className: n(
2191
2192
  "shrink-0 ml-auto",
2192
- v ? "w-full" : "max-w-full"
2193
+ w ? "w-full" : "max-w-full"
2193
2194
  ),
2194
- children: /* @__PURE__ */ e("div", { className: "flex flex-wrap items-center justify-end gap-2", children: s })
2195
+ children: /* @__PURE__ */ e("div", { className: "flex flex-wrap items-center justify-end gap-2", children: a })
2195
2196
  }
2196
2197
  )
2197
2198
  ]
2198
2199
  }
2199
2200
  ),
2200
- /* @__PURE__ */ e("div", { className: n("w-full flex-1 overflow-hidden", b[r], i), children: /* @__PURE__ */ e("div", { className: "animate-fade-in w-full", style: { animationDuration: "0.35s" }, children: t?.find((w) => w.id === C)?.content }, C) })
2201
+ /* @__PURE__ */ e("div", { className: n("w-full flex-1 overflow-hidden", j[r], u), children: /* @__PURE__ */ e("div", { className: "animate-fade-in w-full", style: { animationDuration: "0.35s" }, children: t?.find((S) => S.id === N)?.content }, N) })
2201
2202
  ] });
2202
2203
  }
2203
- const jt = {
2204
+ const Rt = {
2204
2205
  sm: "px-2 py-0.5",
2205
2206
  md: "px-2 py-1",
2206
2207
  lg: "px-3 py-2"
2207
- }, Be = {
2208
+ }, ze = {
2208
2209
  sm: "w-3 h-3",
2209
2210
  md: "w-3 h-3",
2210
2211
  lg: "w-3 h-3"
2211
- }, It = {
2212
+ }, $t = {
2212
2213
  success: "bg-green-50 text-green-600",
2213
2214
  warning: "bg-orange-50 text-orange-600",
2214
2215
  error: "bg-red-50 text-red-600",
2215
2216
  gray: "bg-slate-200 text-slate-700",
2216
2217
  blue: "bg-blue-50 text-blue-600"
2217
2218
  };
2218
- function nr({
2219
+ function ir({
2219
2220
  children: t,
2220
- variant: a = "success",
2221
+ variant: l = "success",
2221
2222
  size: r = "lg",
2222
- icon: l,
2223
- iconPosition: p = "left",
2224
- className: i
2223
+ icon: s,
2224
+ iconPosition: m = "left",
2225
+ className: u
2225
2226
  }) {
2226
- return /* @__PURE__ */ c(
2227
+ return /* @__PURE__ */ o(
2227
2228
  "span",
2228
2229
  {
2229
2230
  className: n(
2230
2231
  "inline-flex animate-[fadeIn_0.3s_ease-out] items-center rounded-lg text-extra-small font-medium",
2231
- jt[r],
2232
- It[a],
2233
- l && "gap-[2px]",
2234
- i
2232
+ Rt[r],
2233
+ $t[l],
2234
+ s && "gap-[2px]",
2235
+ u
2235
2236
  ),
2236
2237
  children: [
2237
- l && p === "left" && /* @__PURE__ */ e("span", { className: `flex items-center ${n(Be[r])}`, children: l }),
2238
+ s && m === "left" && /* @__PURE__ */ e("span", { className: `flex items-center ${n(ze[r])}`, children: s }),
2238
2239
  /* @__PURE__ */ e("span", { children: t }),
2239
- l && p === "right" && /* @__PURE__ */ e("span", { className: `flex items-center ${n(Be[r])}`, children: l })
2240
+ s && m === "right" && /* @__PURE__ */ e("span", { className: `flex items-center ${n(ze[r])}`, children: s })
2240
2241
  ]
2241
2242
  }
2242
2243
  );
2243
2244
  }
2244
- const Rt = fe(
2245
+ const Pt = fe(
2245
2246
  ({
2246
2247
  label: t,
2247
- placeholder: a,
2248
+ placeholder: l,
2248
2249
  value: r = "",
2249
- onChange: l,
2250
- required: p = !1,
2251
- disabled: i = !1,
2252
- error: s,
2253
- className: d,
2254
- rows: C = 4,
2255
- name: k
2256
- }, M) => {
2257
- const D = Z(() => s ? "border-red-600 focus:border-red-600 shadow-red" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600", [s]);
2258
- return /* @__PURE__ */ c("div", { className: n("relative w-full", d), children: [
2259
- t && /* @__PURE__ */ c(
2250
+ onChange: s,
2251
+ required: m = !1,
2252
+ disabled: u = !1,
2253
+ error: a,
2254
+ className: c,
2255
+ rows: N = 4,
2256
+ name: y
2257
+ }, C) => {
2258
+ const F = U(() => a ? "border-red-600 focus:border-red-600 shadow-red" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600", [a]);
2259
+ return /* @__PURE__ */ o("div", { className: n("relative w-full", c), children: [
2260
+ t && /* @__PURE__ */ o(
2260
2261
  "label",
2261
2262
  {
2262
2263
  className: n(
2263
2264
  "mb-2 block text-base font-medium",
2264
- s ? "text-red-600" : "text-slate-700"
2265
+ a ? "text-red-600" : "text-slate-700"
2265
2266
  ),
2266
2267
  children: [
2267
2268
  t,
2268
- p && /* @__PURE__ */ e("span", { className: "ml-1 text-red-600", children: "*" })
2269
+ m && /* @__PURE__ */ e("span", { className: "ml-1 text-red-600", children: "*" })
2269
2270
  ]
2270
2271
  }
2271
2272
  ),
2272
2273
  /* @__PURE__ */ e(
2273
2274
  "textarea",
2274
2275
  {
2275
- ref: M,
2276
- name: k,
2277
- rows: C,
2276
+ ref: C,
2277
+ name: y,
2278
+ rows: N,
2278
2279
  value: r,
2279
- onChange: (A) => l?.(A.target.value),
2280
- disabled: i,
2281
- placeholder: a,
2280
+ onChange: (I) => s?.(I.target.value),
2281
+ disabled: u,
2282
+ placeholder: l,
2282
2283
  className: n(
2283
2284
  "w-full resize-none rounded-xl border bg-white text-base font-normal transition-all duration-300 ease-in-out outline-none",
2284
2285
  "p-3 disabled:cursor-not-allowed disabled:border-slate-200 disabled:bg-slate-100 disabled:text-slate-400",
2285
- D
2286
+ F
2286
2287
  )
2287
2288
  }
2288
2289
  ),
2289
- s && /* @__PURE__ */ e("p", { className: "mt-2 animate-[slideDown_0.3s_ease-out] text-sm font-normal text-red-600", children: s })
2290
+ a && /* @__PURE__ */ e("p", { className: "mt-2 animate-[slideDown_0.3s_ease-out] text-sm font-normal text-red-600", children: a })
2290
2291
  ] });
2291
2292
  }
2292
2293
  );
2293
- Rt.displayName = "MciTextarea";
2294
- const Tt = (() => {
2294
+ Pt.displayName = "MciTextarea";
2295
+ const zt = (() => {
2295
2296
  let t = document.getElementById("mci-toast-container");
2296
2297
  return t || (t = document.createElement("div"), t.id = "mci-toast-container", t.className = "fixed top-4 right-4 z-[9999] flex flex-col gap-3 pointer-events-none", document.body.appendChild(t)), t;
2297
2298
  })();
2298
- let Ae = null, $t = 0;
2299
- const Ce = [], ze = () => {
2300
- Ae || (Ae = Nt(Tt)), Ae.render(
2301
- /* @__PURE__ */ e("div", { className: "flex flex-col gap-3", children: Ce.map(({ id: t, element: a }) => /* @__PURE__ */ e("div", { className: "pointer-events-auto", children: a }, t)) })
2299
+ let Fe = null, Bt = 0;
2300
+ const Me = [], Be = () => {
2301
+ Fe || (Fe = Mt(zt)), Fe.render(
2302
+ /* @__PURE__ */ e("div", { className: "flex flex-col gap-3", children: Me.map(({ id: t, element: l }) => /* @__PURE__ */ e("div", { className: "pointer-events-auto", children: l }, t)) })
2302
2303
  );
2303
2304
  };
2304
- function Bt({
2305
+ function Wt({
2305
2306
  title: t,
2306
- description: a,
2307
+ description: l,
2307
2308
  type: r = "info",
2308
- duration: l = 3e3,
2309
- action: p,
2310
- onClose: i
2309
+ duration: s = 3e3,
2310
+ action: m,
2311
+ onClose: u
2311
2312
  }) {
2312
- const [s, d] = _(100);
2313
- J(() => {
2314
- if (l === 1 / 0) {
2315
- d(100);
2313
+ const [a, c] = H(100);
2314
+ ee(() => {
2315
+ if (s === 1 / 0) {
2316
+ c(100);
2316
2317
  return;
2317
2318
  }
2318
- let M = null;
2319
- const D = (E) => {
2320
- M || (M = E);
2321
- const v = E - M, u = Math.max(0, (l - v) / l * 100);
2322
- d(u), u > 0 ? requestAnimationFrame(D) : i?.();
2323
- }, A = requestAnimationFrame(D);
2324
- return () => cancelAnimationFrame(A);
2325
- }, [l, i]);
2326
- const C = {
2327
- success: /* @__PURE__ */ e(gt, { weight: "Bold", className: "w-5 h-5" }),
2328
- error: /* @__PURE__ */ e(pt, { weight: "Bold", className: "w-5 h-5" }),
2329
- warning: /* @__PURE__ */ e(ft, { weight: "Bold", className: "w-5 h-5" }),
2330
- info: /* @__PURE__ */ e(ht, { weight: "Bold", className: "w-5 h-5" }),
2331
- loading: /* @__PURE__ */ e(mt, { weight: "Bold", className: "w-5 h-5 animate-spin" })
2332
- }, k = {
2319
+ let C = null;
2320
+ const F = (R) => {
2321
+ C || (C = R);
2322
+ const w = R - C, k = Math.max(0, (s - w) / s * 100);
2323
+ c(k), k > 0 ? requestAnimationFrame(F) : u?.();
2324
+ }, I = requestAnimationFrame(F);
2325
+ return () => cancelAnimationFrame(I);
2326
+ }, [s, u]);
2327
+ const N = {
2328
+ success: /* @__PURE__ */ e(wt, { weight: "Bold", className: "w-5 h-5" }),
2329
+ error: /* @__PURE__ */ e(xt, { weight: "Bold", className: "w-5 h-5" }),
2330
+ warning: /* @__PURE__ */ e(bt, { weight: "Bold", className: "w-5 h-5" }),
2331
+ info: /* @__PURE__ */ e(gt, { weight: "Bold", className: "w-5 h-5" }),
2332
+ loading: /* @__PURE__ */ e(pt, { weight: "Bold", className: "w-5 h-5 animate-spin" })
2333
+ }, y = {
2333
2334
  bg: {
2334
2335
  success: "bg-green-50",
2335
2336
  error: "bg-red-50",
@@ -2359,36 +2360,36 @@ function Bt({
2359
2360
  loading: "text-slate-600"
2360
2361
  }
2361
2362
  };
2362
- return /* @__PURE__ */ c(
2363
+ return /* @__PURE__ */ o(
2363
2364
  "div",
2364
2365
  {
2365
2366
  className: n(
2366
2367
  "relative w-[300px] max-w-full overflow-hidden shadow-md rounded-lg",
2367
2368
  "animate-in fade-in slide-in-from-top-2 duration-300",
2368
- k.bg[r]
2369
+ y.bg[r]
2369
2370
  ),
2370
2371
  children: [
2371
2372
  /* @__PURE__ */ e(
2372
2373
  "div",
2373
2374
  {
2374
- className: n("absolute bottom-0 left-0 h-1", k.line[r]),
2375
+ className: n("absolute bottom-0 left-0 h-1", y.line[r]),
2375
2376
  style: {
2376
- width: `${s}%`,
2377
+ width: `${a}%`,
2377
2378
  transition: "none"
2378
2379
  }
2379
2380
  }
2380
2381
  ),
2381
- /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ c("div", { className: "flex items-start gap-2", children: [
2382
- /* @__PURE__ */ e("div", { className: n("flex-shrink-0", k.text[r]), children: C[r] }),
2383
- /* @__PURE__ */ c("div", { className: "flex-1 min-w-0", children: [
2382
+ /* @__PURE__ */ e("div", { className: "p-4", children: /* @__PURE__ */ o("div", { className: "flex items-start gap-2", children: [
2383
+ /* @__PURE__ */ e("div", { className: n("flex-shrink-0", y.text[r]), children: N[r] }),
2384
+ /* @__PURE__ */ o("div", { className: "flex-1 min-w-0", children: [
2384
2385
  /* @__PURE__ */ e("h4", { className: "text-base font-medium mb-1", children: t }),
2385
- a && /* @__PURE__ */ e("p", { className: "text-sm text-[#82828C]", children: a }),
2386
- p && /* @__PURE__ */ e("div", { className: "mt-3", children: /* @__PURE__ */ e("div", { className: n("underline font-medium text-sm", k.action[r]), children: p }) })
2386
+ l && /* @__PURE__ */ e("p", { className: "text-sm text-[#82828C]", children: l }),
2387
+ m && /* @__PURE__ */ e("div", { className: "mt-3", children: /* @__PURE__ */ e("div", { className: n("underline font-medium text-sm", y.action[r]), children: m }) })
2387
2388
  ] }),
2388
2389
  /* @__PURE__ */ e(
2389
2390
  "button",
2390
2391
  {
2391
- onClick: i,
2392
+ onClick: u,
2392
2393
  className: "flex-shrink-0 rounded-full transition cursor-pointer active:animate-spin",
2393
2394
  children: /* @__PURE__ */ e(pe, { className: "w-6 h-6 text-slate-base" })
2394
2395
  }
@@ -2399,66 +2400,66 @@ function Bt({
2399
2400
  );
2400
2401
  }
2401
2402
  const ge = (t) => {
2402
- const a = $t++, r = () => {
2403
- const p = Ce.findIndex((i) => i?.id === a);
2404
- p !== -1 && (Ce.splice(p, 1), ze());
2405
- }, l = /* @__PURE__ */ e(Bt, { ...t, onClose: r });
2406
- return Ce.push({ id: a, element: l }), ze(), t.duration !== 1 / 0 && setTimeout(r, (t.duration || 3e3) + 300), { close: r };
2407
- }, lr = {
2408
- success: (t, a, r) => ge(typeof t == "string" ? { title: t, description: a, type: "success", action: r } : {
2403
+ const l = Bt++, r = () => {
2404
+ const m = Me.findIndex((u) => u?.id === l);
2405
+ m !== -1 && (Me.splice(m, 1), Be());
2406
+ }, s = /* @__PURE__ */ e(Wt, { ...t, onClose: r });
2407
+ return Me.push({ id: l, element: s }), Be(), t.duration !== 1 / 0 && setTimeout(r, (t.duration || 3e3) + 300), { close: r };
2408
+ }, cr = {
2409
+ success: (t, l, r) => ge(typeof t == "string" ? { title: t, description: l, type: "success", action: r } : {
2409
2410
  ...t,
2410
2411
  type: "success"
2411
2412
  }),
2412
- error: (t, a, r) => ge(typeof t == "string" ? { title: t, description: a, type: "error", action: r } : {
2413
+ error: (t, l, r) => ge(typeof t == "string" ? { title: t, description: l, type: "error", action: r } : {
2413
2414
  ...t,
2414
2415
  type: "error"
2415
2416
  }),
2416
- warning: (t, a, r) => ge(typeof t == "string" ? { title: t, description: a, type: "warning", action: r } : {
2417
+ warning: (t, l, r) => ge(typeof t == "string" ? { title: t, description: l, type: "warning", action: r } : {
2417
2418
  ...t,
2418
2419
  type: "warning"
2419
2420
  }),
2420
- info: (t, a, r) => ge(typeof t == "string" ? { title: t, description: a, type: "info", action: r } : {
2421
+ info: (t, l, r) => ge(typeof t == "string" ? { title: t, description: l, type: "info", action: r } : {
2421
2422
  ...t,
2422
2423
  type: "info"
2423
2424
  }),
2424
- loading: (t, a) => ge(typeof t == "string" ? {
2425
+ loading: (t, l) => ge(typeof t == "string" ? {
2425
2426
  title: t,
2426
- description: a,
2427
+ description: l,
2427
2428
  type: "loading",
2428
2429
  duration: 1 / 0
2429
2430
  } : { ...t, type: "loading", duration: 1 / 0 })
2430
2431
  };
2431
- function ar({
2432
+ function dr({
2432
2433
  content: t,
2433
- children: a,
2434
+ children: l,
2434
2435
  position: r = "top",
2435
- delay: l = 200,
2436
- className: p
2436
+ delay: s = 200,
2437
+ className: m
2437
2438
  }) {
2438
- const i = {
2439
+ const u = {
2439
2440
  top: "bottom-full left-1/2 -translate-x-1/2 mb-2",
2440
2441
  bottom: "top-full left-1/2 -translate-x-1/2 mt-2",
2441
2442
  left: "right-full top-1/2 -translate-y-1/2 mr-2",
2442
2443
  right: "left-full top-1/2 -translate-y-1/2 ml-2"
2443
- }, s = {
2444
+ }, a = {
2444
2445
  top: "left-1/2 -translate-x-1/2 top-full",
2445
2446
  bottom: "left-1/2 -translate-x-1/2 bottom-full",
2446
2447
  left: "top-1/2 -translate-y-1/2 left-full",
2447
2448
  right: "top-1/2 -translate-y-1/2 right-full"
2448
2449
  };
2449
- return /* @__PURE__ */ c("div", { className: "group relative inline-block", children: [
2450
- a,
2451
- /* @__PURE__ */ c(
2450
+ return /* @__PURE__ */ o("div", { className: "group relative inline-block", children: [
2451
+ l,
2452
+ /* @__PURE__ */ o(
2452
2453
  "div",
2453
2454
  {
2454
2455
  className: n(
2455
2456
  "absolute z-50 rounded-md bg-slate-400 px-2 py-1 text-xs whitespace-nowrap text-white shadow-md",
2456
2457
  "scale-95 opacity-0 transition-all group-hover:scale-100 group-hover:opacity-100",
2457
2458
  "duration-200 ease-out group-hover:delay-200",
2458
- i[r],
2459
- p
2459
+ u[r],
2460
+ m
2460
2461
  ),
2461
- style: { transitionDelay: `${l}ms` },
2462
+ style: { transitionDelay: `${s}ms` },
2462
2463
  children: [
2463
2464
  t,
2464
2465
  /* @__PURE__ */ e(
@@ -2466,7 +2467,7 @@ function ar({
2466
2467
  {
2467
2468
  className: n(
2468
2469
  "absolute h-2 w-2 rotate-45 bg-slate-400",
2469
- s[r]
2470
+ a[r]
2470
2471
  )
2471
2472
  }
2472
2473
  )
@@ -2475,18 +2476,18 @@ function ar({
2475
2476
  )
2476
2477
  ] });
2477
2478
  }
2478
- function sr({
2479
+ function ur({
2479
2480
  checked: t = !1,
2480
- onChange: a,
2481
+ onChange: l,
2481
2482
  disabled: r = !1,
2482
- variant: l = "yellow",
2483
- label: p,
2484
- supportText: i,
2485
- className: s
2483
+ variant: s = "yellow",
2484
+ label: m,
2485
+ supportText: u,
2486
+ className: a
2486
2487
  }) {
2487
- const d = () => {
2488
- r || a?.(!t);
2489
- }, C = {
2488
+ const c = () => {
2489
+ r || l?.(!t);
2490
+ }, N = {
2490
2491
  blue: {
2491
2492
  active: "bg-blue-600",
2492
2493
  hover: "hover:bg-blue-600",
@@ -2498,12 +2499,12 @@ function sr({
2498
2499
  focus: "focus:ring-2 focus:ring-yellow-200"
2499
2500
  }
2500
2501
  };
2501
- return /* @__PURE__ */ c(
2502
+ return /* @__PURE__ */ o(
2502
2503
  "div",
2503
2504
  {
2504
2505
  className: n(
2505
2506
  "flex items-start gap-3 select-none",
2506
- s
2507
+ a
2507
2508
  ),
2508
2509
  children: [
2509
2510
  /* @__PURE__ */ e(
@@ -2513,12 +2514,12 @@ function sr({
2513
2514
  disabled: r,
2514
2515
  className: n(
2515
2516
  "relative h-6 w-11 rounded-xl transition-all duration-300 outline-none cursor-pointer",
2516
- t ? C[l].active : "bg-slate-200",
2517
- !r && C[l].hover,
2518
- !r && C[l].focus,
2517
+ t ? N[s].active : "bg-slate-200",
2518
+ !r && N[s].hover,
2519
+ !r && N[s].focus,
2519
2520
  r && "bg-slate-100 cursor-not-allowed"
2520
2521
  ),
2521
- onClick: d,
2522
+ onClick: c,
2522
2523
  children: /* @__PURE__ */ e(
2523
2524
  "span",
2524
2525
  {
@@ -2530,47 +2531,47 @@ function sr({
2530
2531
  )
2531
2532
  }
2532
2533
  ),
2533
- (p || i) && /* @__PURE__ */ c("div", { className: "flex flex-col leading-tight", children: [
2534
- p && /* @__PURE__ */ e(
2534
+ (m || u) && /* @__PURE__ */ o("div", { className: "flex flex-col leading-tight", children: [
2535
+ m && /* @__PURE__ */ e(
2535
2536
  "span",
2536
2537
  {
2537
2538
  className: n(
2538
2539
  "text-base font-medium text-black"
2539
2540
  ),
2540
- children: p
2541
+ children: m
2541
2542
  }
2542
2543
  ),
2543
- i && /* @__PURE__ */ e("span", { className: "text-sm font-normal text-slate-500", children: i })
2544
+ u && /* @__PURE__ */ e("span", { className: "text-sm font-normal text-slate-500", children: u })
2544
2545
  ] })
2545
2546
  ]
2546
2547
  }
2547
2548
  );
2548
2549
  }
2549
- const zt = (t) => /* @__PURE__ */ re.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 177 177", fill: "none", ...t }, /* @__PURE__ */ re.createElement("path", { opacity: 0.083334, d: "M94.5 48.5C94.5 41.8726 91.8137 36.5 88.5 36.5C85.1863 36.5 82.5 41.8726 82.5 48.5C82.5 55.1274 85.1863 60.5 88.5 60.5C91.8137 60.5 94.5 55.1274 94.5 48.5Z", fill: "currentColor" }), /* @__PURE__ */ re.createElement("path", { opacity: 0.166667, d: "M113.697 56.8591C117.011 51.1196 117.371 45.1237 114.501 43.4668C111.631 41.8099 106.618 45.1196 103.305 50.8591C99.991 56.5986 99.6311 62.5946 102.501 64.2514C105.371 65.9083 110.383 62.5986 113.697 56.8591Z", fill: "currentColor" }), /* @__PURE__ */ re.createElement("path", { opacity: 0.25, d: "M126.141 73.696C131.88 70.3823 135.19 65.3696 133.533 62.4999C131.876 59.6301 125.88 59.99 120.141 63.3037C114.401 66.6174 111.092 71.6301 112.749 74.4999C114.405 77.3696 120.401 77.0097 126.141 73.696Z", fill: "currentColor" }), /* @__PURE__ */ re.createElement("path", { opacity: 0.333334, d: "M128.5 94.5C135.127 94.5 140.5 91.8137 140.5 88.5C140.5 85.1863 135.127 82.5 128.5 82.5C121.873 82.5 116.5 85.1863 116.5 88.5C116.5 91.8137 121.873 94.5 128.5 94.5Z", fill: "currentColor" }), /* @__PURE__ */ re.createElement("path", { opacity: 0.416667, d: "M120.141 113.696C125.88 117.01 131.876 117.37 133.533 114.5C135.19 111.63 131.88 106.617 126.141 103.304C120.401 99.99 114.405 99.6301 112.749 102.5C111.092 105.37 114.401 110.382 120.141 113.696Z", fill: "currentColor" }), /* @__PURE__ */ re.createElement("path", { opacity: 0.5, d: "M103.303 126.141C106.617 131.88 111.629 135.19 114.499 133.533C117.369 131.876 117.009 125.88 113.695 120.141C110.382 114.401 105.369 111.092 102.499 112.749C99.6294 114.405 99.9893 120.401 103.303 126.141Z", fill: "currentColor" }), /* @__PURE__ */ re.createElement("path", { opacity: 0.583334, d: "M82.5 128.5C82.5 135.127 85.1863 140.5 88.5 140.5C91.8137 140.5 94.5 135.127 94.5 128.5C94.5 121.873 91.8137 116.5 88.5 116.5C85.1863 116.5 82.5 121.873 82.5 128.5Z", fill: "currentColor" }), /* @__PURE__ */ re.createElement("path", { opacity: 0.666667, d: "M63.303 120.141C59.9893 125.88 59.6294 131.876 62.4992 133.533C65.3689 135.19 70.3816 131.88 73.6953 126.141C77.009 120.401 77.3689 114.405 74.4992 112.749C71.6294 111.092 66.6167 114.401 63.303 120.141Z", fill: "currentColor" }), /* @__PURE__ */ re.createElement("path", { opacity: 0.75, d: "M50.8591 103.304C45.1196 106.618 41.8099 111.63 43.4668 114.5C45.1237 117.37 51.1196 117.01 56.8591 113.696C62.5986 110.383 65.9083 105.37 64.2514 102.5C62.5946 99.6304 56.5986 99.9903 50.8591 103.304Z", fill: "currentColor" }), /* @__PURE__ */ re.createElement("path", { opacity: 0.833334, d: "M48.5 82.5C41.8726 82.5 36.5 85.1863 36.5 88.5C36.5 91.8137 41.8726 94.5 48.5 94.5C55.1274 94.5 60.5 91.8137 60.5 88.5C60.5 85.1863 55.1274 82.5 48.5 82.5Z", fill: "currentColor" }), /* @__PURE__ */ re.createElement("path", { opacity: 0.916667, d: "M56.8591 63.304C51.1196 59.9903 45.1237 59.6304 43.4668 62.5001C41.8099 65.3699 45.1196 70.3826 50.8591 73.6963C56.5986 77.01 62.5946 77.3699 64.2514 74.5001C65.9083 71.6304 62.5986 66.6177 56.8591 63.304Z", fill: "currentColor" }), /* @__PURE__ */ re.createElement("path", { d: "M73.697 50.8591C70.3833 45.1196 65.3706 41.8099 62.5008 43.4668C59.6311 45.1237 59.991 51.1196 63.3047 56.8591C66.6184 62.5986 71.6311 65.9083 74.5008 64.2514C77.3706 62.5946 77.0107 56.5986 73.697 50.8591Z", fill: "currentColor" }));
2550
- function or({
2550
+ const Yt = (t) => /* @__PURE__ */ ne.createElement("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 177 177", fill: "none", ...t }, /* @__PURE__ */ ne.createElement("path", { opacity: 0.083334, d: "M94.5 48.5C94.5 41.8726 91.8137 36.5 88.5 36.5C85.1863 36.5 82.5 41.8726 82.5 48.5C82.5 55.1274 85.1863 60.5 88.5 60.5C91.8137 60.5 94.5 55.1274 94.5 48.5Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { opacity: 0.166667, d: "M113.697 56.8591C117.011 51.1196 117.371 45.1237 114.501 43.4668C111.631 41.8099 106.618 45.1196 103.305 50.8591C99.991 56.5986 99.6311 62.5946 102.501 64.2514C105.371 65.9083 110.383 62.5986 113.697 56.8591Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { opacity: 0.25, d: "M126.141 73.696C131.88 70.3823 135.19 65.3696 133.533 62.4999C131.876 59.6301 125.88 59.99 120.141 63.3037C114.401 66.6174 111.092 71.6301 112.749 74.4999C114.405 77.3696 120.401 77.0097 126.141 73.696Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { opacity: 0.333334, d: "M128.5 94.5C135.127 94.5 140.5 91.8137 140.5 88.5C140.5 85.1863 135.127 82.5 128.5 82.5C121.873 82.5 116.5 85.1863 116.5 88.5C116.5 91.8137 121.873 94.5 128.5 94.5Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { opacity: 0.416667, d: "M120.141 113.696C125.88 117.01 131.876 117.37 133.533 114.5C135.19 111.63 131.88 106.617 126.141 103.304C120.401 99.99 114.405 99.6301 112.749 102.5C111.092 105.37 114.401 110.382 120.141 113.696Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { opacity: 0.5, d: "M103.303 126.141C106.617 131.88 111.629 135.19 114.499 133.533C117.369 131.876 117.009 125.88 113.695 120.141C110.382 114.401 105.369 111.092 102.499 112.749C99.6294 114.405 99.9893 120.401 103.303 126.141Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { opacity: 0.583334, d: "M82.5 128.5C82.5 135.127 85.1863 140.5 88.5 140.5C91.8137 140.5 94.5 135.127 94.5 128.5C94.5 121.873 91.8137 116.5 88.5 116.5C85.1863 116.5 82.5 121.873 82.5 128.5Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { opacity: 0.666667, d: "M63.303 120.141C59.9893 125.88 59.6294 131.876 62.4992 133.533C65.3689 135.19 70.3816 131.88 73.6953 126.141C77.009 120.401 77.3689 114.405 74.4992 112.749C71.6294 111.092 66.6167 114.401 63.303 120.141Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { opacity: 0.75, d: "M50.8591 103.304C45.1196 106.618 41.8099 111.63 43.4668 114.5C45.1237 117.37 51.1196 117.01 56.8591 113.696C62.5986 110.383 65.9083 105.37 64.2514 102.5C62.5946 99.6304 56.5986 99.9903 50.8591 103.304Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { opacity: 0.833334, d: "M48.5 82.5C41.8726 82.5 36.5 85.1863 36.5 88.5C36.5 91.8137 41.8726 94.5 48.5 94.5C55.1274 94.5 60.5 91.8137 60.5 88.5C60.5 85.1863 55.1274 82.5 48.5 82.5Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { opacity: 0.916667, d: "M56.8591 63.304C51.1196 59.9903 45.1237 59.6304 43.4668 62.5001C41.8099 65.3699 45.1196 70.3826 50.8591 73.6963C56.5986 77.01 62.5946 77.3699 64.2514 74.5001C65.9083 71.6304 62.5986 66.6177 56.8591 63.304Z", fill: "currentColor" }), /* @__PURE__ */ ne.createElement("path", { d: "M73.697 50.8591C70.3833 45.1196 65.3706 41.8099 62.5008 43.4668C59.6311 45.1237 59.991 51.1196 63.3047 56.8591C66.6184 62.5986 71.6311 65.9083 74.5008 64.2514C77.3706 62.5946 77.0107 56.5986 73.697 50.8591Z", fill: "currentColor" }));
2551
+ function hr({
2551
2552
  className: t,
2552
- size: a = 150,
2553
+ size: l = 150,
2553
2554
  iconClassName: r,
2554
- isLoading: l = !1,
2555
- isFullPage: p = !0,
2556
- variant: i = "yellow"
2555
+ isLoading: s = !1,
2556
+ isFullPage: m = !0,
2557
+ variant: u = "yellow"
2557
2558
  }) {
2558
- return l ? /* @__PURE__ */ e(
2559
+ return s ? /* @__PURE__ */ e(
2559
2560
  "div",
2560
2561
  {
2561
2562
  className: n(
2562
2563
  "z-[99px] flex flex-col items-center justify-center transition-all duration-300",
2563
- p ? "fixed inset-0 backdrop-blur-[2px]" : "absolute inset-0 w-full h-full rounded-[inherit]",
2564
+ m ? "fixed inset-0 backdrop-blur-[2px]" : "absolute inset-0 w-full h-full rounded-[inherit]",
2564
2565
  t
2565
2566
  ),
2566
2567
  children: /* @__PURE__ */ e(
2567
- zt,
2568
+ Yt,
2568
2569
  {
2569
- width: a,
2570
- height: a,
2570
+ width: l,
2571
+ height: l,
2571
2572
  className: n(
2572
2573
  "animate-spin",
2573
- !r && (i === "blue" ? "text-blue-600" : "text-yellow-500"),
2574
+ !r && (u === "blue" ? "text-blue-600" : "text-yellow-500"),
2574
2575
  r
2575
2576
  ),
2576
2577
  style: { fill: "currentColor", stroke: "currentColor" }
@@ -2579,43 +2580,43 @@ function or({
2579
2580
  }
2580
2581
  ) : null;
2581
2582
  }
2582
- const Pt = fe(
2583
+ const Ot = fe(
2583
2584
  ({
2584
2585
  label: t,
2585
- placeholder: a = "+998 (__) ___ __ __",
2586
+ placeholder: l = "+998 (__) ___ __ __",
2586
2587
  size: r = "base",
2587
- error: l,
2588
- disabled: p = !1,
2589
- required: i = !1,
2590
- value: s = "",
2591
- onChange: d,
2592
- onFocus: C,
2593
- onBlur: k,
2594
- className: M,
2595
- name: D,
2596
- showIcon: A = !1
2597
- }, E) => {
2598
- const [v, u] = _(!1), m = R((j) => {
2599
- let o = j.replace(/\D/g, "");
2600
- o.startsWith("998") || (o = "998" + o), o = o.substring(0, 12);
2601
- let N = "+998";
2602
- return o.length > 3 && (N += " (" + o.substring(3, 5)), o.length > 5 && (N += ") " + o.substring(5, 8)), o.length > 8 && (N += " " + o.substring(8, 10)), o.length > 10 && (N += " " + o.substring(10, 12)), N;
2603
- }, []), b = (j) => {
2604
- const o = j.target.value;
2605
- if (o.length < 5) {
2606
- d?.("+998");
2588
+ error: s,
2589
+ disabled: m = !1,
2590
+ required: u = !1,
2591
+ value: a = "",
2592
+ onChange: c,
2593
+ onFocus: N,
2594
+ onBlur: y,
2595
+ className: C,
2596
+ name: F,
2597
+ showIcon: I = !1
2598
+ }, R) => {
2599
+ const [w, k] = H(!1), b = P((D) => {
2600
+ let i = D.replace(/\D/g, "");
2601
+ i.startsWith("998") || (i = "998" + i), i = i.substring(0, 12);
2602
+ let d = "+998";
2603
+ return i.length > 3 && (d += " (" + i.substring(3, 5)), i.length > 5 && (d += ") " + i.substring(5, 8)), i.length > 8 && (d += " " + i.substring(8, 10)), i.length > 10 && (d += " " + i.substring(10, 12)), d;
2604
+ }, []), j = (D) => {
2605
+ const i = D.target.value;
2606
+ if (i.length < 5) {
2607
+ c?.("+998");
2607
2608
  return;
2608
2609
  }
2609
- const N = m(o);
2610
- d?.(N);
2611
- }, w = () => {
2612
- u(!0), (!s || s === "") && d?.("+998"), C?.();
2613
- }, h = () => {
2614
- u(!1), k?.();
2615
- }, y = Z(() => ({
2610
+ const d = b(i);
2611
+ c?.(d);
2612
+ }, S = () => {
2613
+ k(!0), (!a || a === "") && c?.("+998"), N?.();
2614
+ }, x = () => {
2615
+ k(!1), y?.();
2616
+ }, h = U(() => ({
2616
2617
  sm: {
2617
2618
  input: "h-9 text-sm",
2618
- padding: A ? "pl-8 pr-2" : "px-2",
2619
+ padding: I ? "pl-8 pr-2" : "px-2",
2619
2620
  iconSize: "w-4 h-4",
2620
2621
  iconLeft: "left-2",
2621
2622
  labelFont: "text-sm",
@@ -2623,7 +2624,7 @@ const Pt = fe(
2623
2624
  },
2624
2625
  md: {
2625
2626
  input: "h-10 text-sm",
2626
- padding: A ? "pl-10 pr-4" : "px-4",
2627
+ padding: I ? "pl-10 pr-4" : "px-4",
2627
2628
  iconSize: "w-4 h-4",
2628
2629
  iconLeft: "left-3",
2629
2630
  labelFont: "text-base",
@@ -2631,75 +2632,75 @@ const Pt = fe(
2631
2632
  },
2632
2633
  base: {
2633
2634
  input: "h-12 text-base",
2634
- padding: A ? "pl-11 pr-4" : "px-4",
2635
+ padding: I ? "pl-11 pr-4" : "px-4",
2635
2636
  iconSize: "w-5 h-5",
2636
2637
  iconLeft: "left-3",
2637
2638
  labelFont: "text-base",
2638
2639
  iconWrapper: "h-5"
2639
2640
  }
2640
- }), [A]), $ = Z(() => l ? "border-red-600 focus:border-red-600 shadow-red" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600", [l]), L = Z(() => p ? "text-slate-400" : l ? "text-red-600" : v ? "text-black" : "text-slate-400", [l, v, p]);
2641
- return /* @__PURE__ */ c("div", { className: n("w-full", M), children: [
2642
- t && /* @__PURE__ */ c("label", { className: n(
2641
+ }), [I]), A = U(() => s ? "border-red-600 focus:border-red-600 shadow-red" : "border-slate-200 hover:border-slate-400 focus:shadow-blue focus:border-blue-600", [s]), M = U(() => m ? "text-slate-400" : s ? "text-red-600" : w ? "text-black" : "text-slate-400", [s, w, m]);
2642
+ return /* @__PURE__ */ o("div", { className: n("w-full", C), children: [
2643
+ t && /* @__PURE__ */ o("label", { className: n(
2643
2644
  "mb-2 block font-medium transition-colors duration-200",
2644
- l ? "text-red-600" : v ? "text-blue-600" : "text-slate-700",
2645
- y[r].labelFont
2645
+ s ? "text-red-600" : w ? "text-blue-600" : "text-slate-700",
2646
+ h[r].labelFont
2646
2647
  ), children: [
2647
2648
  t,
2648
- i && /* @__PURE__ */ e("span", { className: "text-red-600 ml-1", children: "*" })
2649
+ u && /* @__PURE__ */ e("span", { className: "text-red-600 ml-1", children: "*" })
2649
2650
  ] }),
2650
- /* @__PURE__ */ c("div", { className: "relative flex items-center", children: [
2651
- A && /* @__PURE__ */ e("div", { className: n(
2651
+ /* @__PURE__ */ o("div", { className: "relative flex items-center", children: [
2652
+ I && /* @__PURE__ */ e("div", { className: n(
2652
2653
  "absolute top-1/2 flex -translate-y-1/2 items-center justify-center transition-all duration-300",
2653
- y[r].iconLeft,
2654
- L
2655
- ), children: /* @__PURE__ */ e("div", { className: n("flex items-center justify-center", y[r].iconWrapper), children: /* @__PURE__ */ e(bt, { className: n(y[r].iconSize), weight: "Linear" }) }) }),
2654
+ h[r].iconLeft,
2655
+ M
2656
+ ), children: /* @__PURE__ */ e("div", { className: n("flex items-center justify-center", h[r].iconWrapper), children: /* @__PURE__ */ e(vt, { className: n(h[r].iconSize), weight: "Linear" }) }) }),
2656
2657
  /* @__PURE__ */ e(
2657
2658
  "input",
2658
2659
  {
2659
- ref: E,
2660
- name: D,
2660
+ ref: R,
2661
+ name: F,
2661
2662
  type: "tel",
2662
- value: s,
2663
- onChange: b,
2664
- onFocus: w,
2665
- onBlur: h,
2666
- disabled: p,
2667
- placeholder: a,
2663
+ value: a,
2664
+ onChange: j,
2665
+ onFocus: S,
2666
+ onBlur: x,
2667
+ disabled: m,
2668
+ placeholder: l,
2668
2669
  className: n(
2669
2670
  "w-full border bg-white font-normal transition-all duration-300 outline-none",
2670
2671
  r === "base" ? "rounded-xl" : "rounded-lg",
2671
2672
  "disabled:bg-slate-100 disabled:text-slate-400 disabled:cursor-not-allowed",
2672
- y[r].input,
2673
- y[r].padding,
2674
- $
2673
+ h[r].input,
2674
+ h[r].padding,
2675
+ A
2675
2676
  )
2676
2677
  }
2677
2678
  )
2678
2679
  ] }),
2679
- l && /* @__PURE__ */ e("p", { className: "mt-2 animate-slide-up text-sm font-normal text-red-600", children: l })
2680
+ s && /* @__PURE__ */ e("p", { className: "mt-2 animate-slide-up text-sm font-normal text-red-600", children: s })
2680
2681
  ] });
2681
2682
  }
2682
2683
  );
2683
- Pt.displayName = "MciPhone";
2684
- const Wt = fe(
2685
- ({ mode: t, onChange: a, value: r, ...l }, p) => {
2686
- const [i, s] = _(""), d = r !== void 0 ? r : i, C = (v) => {
2687
- const u = v.replace(/\s/g, "").toUpperCase();
2688
- let m = "";
2689
- for (let b = 0; b < u.length; b++) {
2690
- const w = u[b];
2691
- if (m.length < 2 ? /[A-Z]/.test(w) && (m += w) : /[0-9]/.test(w) && (m += w), m.length >= 9) break;
2684
+ Ot.displayName = "MciPhone";
2685
+ const Vt = fe(
2686
+ ({ mode: t, onChange: l, value: r, ...s }, m) => {
2687
+ const [u, a] = H(""), c = r !== void 0 ? r : u, N = (w) => {
2688
+ const k = w.replace(/\s/g, "").toUpperCase();
2689
+ let b = "";
2690
+ for (let j = 0; j < k.length; j++) {
2691
+ const S = k[j];
2692
+ if (b.length < 2 ? /[A-Z]/.test(S) && (b += S) : /[0-9]/.test(S) && (b += S), b.length >= 9) break;
2692
2693
  }
2693
- return m.length > 2 ? m.slice(0, 2) + " " + m.slice(2) : m;
2694
- }, k = (v) => v.replace(/\D/g, "").slice(0, 14), M = (v) => v.toUpperCase().replace(/[^A-Z0-9\-\s]/g, "").replace(/\s+/g, " ").slice(0, 15), D = R(
2695
- (v) => {
2696
- const u = v.target.value;
2697
- let m = "";
2698
- t === "passport" ? m = C(u) : t === "pinfl" ? m = k(u) : t === "metirka" && (m = M(u)), r === void 0 && s(m), v.target.value = m, a?.(m, v);
2694
+ return b.length > 2 ? b.slice(0, 2) + " " + b.slice(2) : b;
2695
+ }, y = (w) => w.replace(/\D/g, "").slice(0, 14), C = (w) => w.toUpperCase().replace(/[^A-Z0-9\-\s]/g, "").replace(/\s+/g, " ").slice(0, 15), F = P(
2696
+ (w) => {
2697
+ const k = w.target.value;
2698
+ let b = "";
2699
+ t === "passport" ? b = N(k) : t === "pinfl" ? b = y(k) : t === "metirka" && (b = C(k)), r === void 0 && a(b), w.target.value = b, l?.(b, w);
2699
2700
  },
2700
- [t, a, r]
2701
- ), A = () => {
2702
- if (l.placeholder) return l.placeholder;
2701
+ [t, l, r]
2702
+ ), I = () => {
2703
+ if (s.placeholder) return s.placeholder;
2703
2704
  switch (t) {
2704
2705
  case "passport":
2705
2706
  return "AA 1234567";
@@ -2712,14 +2713,14 @@ const Wt = fe(
2712
2713
  }
2713
2714
  };
2714
2715
  return /* @__PURE__ */ e(
2715
- Le,
2716
+ Ie,
2716
2717
  {
2717
- ref: p,
2718
- ...l,
2719
- value: d,
2720
- onChange: D,
2718
+ ref: m,
2719
+ ...s,
2720
+ value: c,
2721
+ onChange: F,
2721
2722
  maxLength: (() => {
2722
- if (l.maxLength) return l.maxLength;
2723
+ if (s.maxLength) return s.maxLength;
2723
2724
  switch (t) {
2724
2725
  case "passport":
2725
2726
  return 10;
@@ -2731,75 +2732,86 @@ const Wt = fe(
2731
2732
  return 255;
2732
2733
  }
2733
2734
  })(),
2734
- placeholder: A()
2735
+ placeholder: I()
2735
2736
  }
2736
2737
  );
2737
2738
  }
2738
2739
  );
2739
- Wt.displayName = "MciIdentityInput";
2740
- function ir({
2740
+ Vt.displayName = "MciIdentityInput";
2741
+ function mr({
2741
2742
  open: t,
2742
- onClose: a,
2743
+ onClose: l,
2743
2744
  columns: r,
2744
- hidden: l,
2745
- onToggle: p,
2746
- onMove: i,
2747
- minVisible: s = 5
2745
+ hidden: s,
2746
+ onToggle: m,
2747
+ onMove: u,
2748
+ onMoveByKey: a,
2749
+ minVisible: c = 5
2748
2750
  }) {
2749
- const d = le(null), { handleClick: C } = De(d, a);
2750
- J(() => {
2751
+ const N = de(null), { handleClick: y } = Se(N, l);
2752
+ ee(() => {
2751
2753
  if (t)
2752
- return document.addEventListener("mousedown", C), () => document.removeEventListener("mousedown", C);
2753
- }, [t, C]);
2754
- const k = Z(() => new Set(l), [l]), M = Z(() => {
2755
- let o = 0;
2756
- for (const N of r) k.has(N.key) || o++;
2757
- return o;
2758
- }, [r, k]), D = le(null), A = le(null), E = le(!1), [v, u] = _(null), [m, b] = _(null), w = le(null), h = R((o) => {
2759
- A.current = o, w.current == null && (w.current = requestAnimationFrame(() => {
2760
- w.current = null, u(A.current);
2761
- }));
2762
- }, []);
2763
- J(() => () => {
2764
- w.current != null && cancelAnimationFrame(w.current);
2765
- }, []);
2766
- const y = R(
2767
- (o) => {
2768
- E.current = !0, D.current = o, b(r[o]?.key ?? null);
2754
+ return document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
2755
+ }, [t, y]);
2756
+ const C = U(() => new Set(s), [s]), F = U(() => {
2757
+ let d = 0;
2758
+ for (const v of r) C.has(v.key) || d++;
2759
+ return d;
2760
+ }, [r, C]), [I, R] = H(null), [w, k] = H(null), [b, j] = H(null), [S, x] = H("before"), h = P(
2761
+ (d, v, E) => {
2762
+ let B = E === "after" ? v + 1 : v;
2763
+ return d < B && (B -= 1), B;
2769
2764
  },
2770
- [r]
2771
- ), $ = R(() => {
2772
- E.current = !1;
2773
- }, []);
2774
- J(() => {
2775
- if (t)
2776
- return document.addEventListener("mouseup", $), () => document.removeEventListener("mouseup", $);
2777
- }, [t, $]);
2778
- const L = R(() => {
2779
- D.current = null, E.current = !1, b(null), h(null);
2780
- }, [h]), j = R(
2781
- (o, N) => {
2782
- N || p(o);
2765
+ []
2766
+ ), A = P(() => {
2767
+ R(null), j(null), k(null), x("before");
2768
+ }, []), M = P(
2769
+ (d, v, E) => {
2770
+ R(v), j(String(E)), k(null), x("before"), d.dataTransfer.effectAllowed = "move", d.dataTransfer.setData("text/plain", String(v));
2771
+ const B = new Image();
2772
+ B.src = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=", d.dataTransfer.setDragImage(B, 0, 0);
2773
+ },
2774
+ []
2775
+ ), D = P(
2776
+ (d, v) => {
2777
+ d.preventDefault();
2778
+ const E = I ?? Number.parseInt(d.dataTransfer.getData("text/plain") || "-1", 10);
2779
+ if (!Number.isFinite(E) || E < 0) {
2780
+ A();
2781
+ return;
2782
+ }
2783
+ const B = r[E], z = r[v];
2784
+ if (!B || !z) {
2785
+ A();
2786
+ return;
2787
+ }
2788
+ const O = h(E, v, S);
2789
+ O !== E && (a ? a(B.key, z.key, S) : u(E, O)), A();
2790
+ },
2791
+ [r, h, I, S, u, a, A]
2792
+ ), i = P(
2793
+ (d, v) => {
2794
+ v || m(d);
2783
2795
  },
2784
- [p]
2796
+ [m]
2785
2797
  );
2786
- return t ? /* @__PURE__ */ c(
2798
+ return t ? /* @__PURE__ */ o(
2787
2799
  "div",
2788
2800
  {
2789
- ref: d,
2801
+ ref: N,
2790
2802
  className: n(
2791
2803
  "absolute right-0 top-full z-50 mt-2 w-[320px]",
2792
2804
  "rounded-2xl p-4 bg-white",
2793
2805
  "border border-slate-200"
2794
2806
  ),
2795
2807
  children: [
2796
- /* @__PURE__ */ c("div", { className: "flex items-center justify-between gap-4", children: [
2808
+ /* @__PURE__ */ o("div", { className: "flex items-center justify-between gap-4", children: [
2797
2809
  /* @__PURE__ */ e("h4", { className: "text-slate-600 text-large font-normal", children: "Settings" }),
2798
2810
  /* @__PURE__ */ e(
2799
2811
  "button",
2800
2812
  {
2801
2813
  type: "button",
2802
- onClick: a,
2814
+ onClick: l,
2803
2815
  className: "rounded-lg px-2 py-1 text-slate-500 hover:bg-slate-100",
2804
2816
  "aria-label": "Close",
2805
2817
  children: "✕"
@@ -2807,6 +2819,12 @@ function ir({
2807
2819
  )
2808
2820
  ] }),
2809
2821
  /* @__PURE__ */ e("div", { className: "my-4 h-px bg-slate-100" }),
2822
+ /* @__PURE__ */ o("p", { className: "mb-3 text-xs text-slate-500", children: [
2823
+ "Active columns: ",
2824
+ F,
2825
+ "/",
2826
+ r.length
2827
+ ] }),
2810
2828
  /* @__PURE__ */ e(
2811
2829
  "div",
2812
2830
  {
@@ -2818,80 +2836,76 @@ function ir({
2818
2836
  "[&::-webkit-scrollbar-thumb]:rounded-full",
2819
2837
  "hover:[&::-webkit-scrollbar-thumb]:bg-slate-300"
2820
2838
  ),
2821
- children: r.map((o, N) => {
2822
- const T = !k.has(o.key), Y = T && M <= s, q = v === N, B = m === o.key;
2823
- return /* @__PURE__ */ c("div", { children: [
2824
- /* @__PURE__ */ c(
2839
+ children: r.map((d, v) => {
2840
+ const E = !C.has(d.key), B = E && F <= c, z = w === v, O = b === d.key;
2841
+ return /* @__PURE__ */ o("div", { className: "relative", children: [
2842
+ z && !O && /* @__PURE__ */ e(
2843
+ "div",
2844
+ {
2845
+ className: n(
2846
+ "pointer-events-none absolute left-2 right-2 z-10 h-0.5 rounded-full bg-blue-300",
2847
+ S === "before" ? "top-0" : "bottom-0"
2848
+ )
2849
+ }
2850
+ ),
2851
+ /* @__PURE__ */ o(
2825
2852
  "div",
2826
2853
  {
2827
2854
  draggable: !0,
2828
- onDragStart: (P) => {
2829
- if (!E.current) {
2830
- P.preventDefault();
2831
- return;
2832
- }
2833
- P.dataTransfer.setData("text/plain", String(N)), P.dataTransfer.effectAllowed = "move", b(o.key), h(null);
2834
- const W = new Image();
2835
- W.src = "data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=", P.dataTransfer.setDragImage(W, 0, 0);
2836
- },
2837
- onDragOver: (P) => {
2838
- D.current != null && (P.preventDefault(), P.dataTransfer.dropEffect = "move", h(N));
2839
- },
2840
- onDragLeave: () => {
2841
- A.current === N && h(null);
2855
+ onDragStart: (W) => M(W, v, d.key),
2856
+ onDragOver: (W) => {
2857
+ if (I == null) return;
2858
+ W.preventDefault(), W.dataTransfer.dropEffect = "move";
2859
+ const J = W.currentTarget.getBoundingClientRect(), G = W.clientY - J.top > J.height / 2 ? "after" : "before";
2860
+ w !== v && k(v), S !== G && x(G);
2842
2861
  },
2843
- onDrop: (P) => {
2844
- P.preventDefault();
2845
- const W = D.current ?? Number(P.dataTransfer.getData("text/plain"));
2846
- Number.isFinite(W) && W !== N && i(W, N), L();
2847
- },
2848
- onDragEnd: L,
2862
+ onDrop: (W) => D(W, v),
2863
+ onDragEnd: A,
2849
2864
  className: n(
2850
2865
  "group flex items-center py-2 px-1 gap-4",
2851
2866
  "rounded-md box-border overflow-visible",
2852
2867
  "transition-[background,transform] duration-150",
2853
- !B && !q && "hover:bg-slate-50",
2854
- q && !B && "bg-slate-50",
2855
- B && "bg-slate-50 opacity-100 scale-[0.99] cursor-grabbing"
2868
+ !O && !z && "hover:bg-slate-50",
2869
+ z && !O && "bg-slate-50",
2870
+ O && "bg-slate-50 opacity-100 scale-[0.99] cursor-grabbing"
2856
2871
  ),
2857
2872
  children: [
2858
2873
  /* @__PURE__ */ e(
2859
2874
  "button",
2860
2875
  {
2861
2876
  type: "button",
2862
- onMouseDown: () => y(N),
2863
2877
  className: n(
2864
2878
  "shrink-0 text-slate-400",
2865
2879
  "cursor-grab active:cursor-grabbing",
2866
2880
  "rounded-lg p-1 hover:bg-slate-100",
2867
- B && "cursor-grabbing"
2881
+ O && "cursor-grabbing"
2868
2882
  ),
2869
2883
  "aria-label": "Drag",
2870
- children: /* @__PURE__ */ e(xt, { weight: "Linear", size: 20 })
2884
+ children: /* @__PURE__ */ e(yt, { weight: "Linear", size: 20 })
2871
2885
  }
2872
2886
  ),
2873
2887
  /* @__PURE__ */ e("div", { className: "shrink-0", children: /* @__PURE__ */ e(
2874
- Me,
2888
+ De,
2875
2889
  {
2876
- checked: T,
2877
- disabled: Y,
2878
- onChange: () => j(o.key, Y),
2890
+ checked: E,
2891
+ disabled: B,
2892
+ onChange: () => i(d.key, B),
2879
2893
  variant: "blue"
2880
2894
  }
2881
2895
  ) }),
2882
- /* @__PURE__ */ c("div", { className: "min-w-0 flex-1", children: [
2883
- /* @__PURE__ */ e("h4", { className: "truncate text-slate-700 text-base font-medium", title: o.title, children: o.title }),
2884
- Y && /* @__PURE__ */ c("p", { className: "text-xs text-slate-400 mt-0.5", children: [
2896
+ /* @__PURE__ */ o("div", { className: "min-w-0 flex-1", children: [
2897
+ /* @__PURE__ */ e("h4", { className: "truncate text-slate-700 text-base font-medium", title: d.title, children: d.title }),
2898
+ B && /* @__PURE__ */ o("p", { className: "text-xs text-slate-400 mt-0.5", children: [
2885
2899
  "Минимум ",
2886
- s,
2900
+ c,
2887
2901
  " колонок"
2888
2902
  ] })
2889
2903
  ] })
2890
2904
  ]
2891
2905
  }
2892
2906
  ),
2893
- N !== r.length - 1 && /* @__PURE__ */ e("div", { className: "mx-2 h-px bg-slate-100" })
2894
- ] }, o.key);
2907
+ v !== r.length - 1 && /* @__PURE__ */ e("div", { className: "mx-2 h-px bg-slate-100" })
2908
+ ] }, d.key);
2895
2909
  })
2896
2910
  }
2897
2911
  )
@@ -2899,109 +2913,157 @@ function ir({
2899
2913
  }
2900
2914
  ) : null;
2901
2915
  }
2902
- const Pe = (t) => Array.isArray(t) && t.every((a) => typeof a == "string"), Ot = (t) => {
2916
+ const We = (t) => Array.isArray(t) && t.every((l) => typeof l == "string"), Ht = (t) => {
2903
2917
  if (!t) return null;
2904
2918
  try {
2905
- const a = JSON.parse(t);
2906
- if (typeof a != "object" || a === null) return null;
2907
- const r = a;
2908
- return !Pe(r.order) || !Pe(r.hidden) ? null : { order: r.order, hidden: r.hidden };
2919
+ const l = JSON.parse(t);
2920
+ if (typeof l != "object" || l === null) return null;
2921
+ const r = l;
2922
+ return !We(r.order) || !We(r.hidden) ? null : { order: r.order, hidden: r.hidden };
2909
2923
  } catch {
2910
2924
  return null;
2911
2925
  }
2912
- }, ie = (t) => {
2913
- const a = /* @__PURE__ */ new Set(), r = [];
2914
- for (const l of t)
2915
- a.has(l) || (a.add(l), r.push(l));
2926
+ }, he = (t) => {
2927
+ const l = /* @__PURE__ */ new Set(), r = [];
2928
+ for (const s of t)
2929
+ l.has(s) || (l.add(s), r.push(s));
2916
2930
  return r;
2931
+ }, _t = (t) => new Set((t ?? []).map(String)), Ye = (t, l) => {
2932
+ const r = l ? he(l.filter((s) => t.includes(s))) : [];
2933
+ return he([...r, ...t]);
2934
+ }, Oe = (t, l) => {
2935
+ if (!l?.length) return [];
2936
+ const r = _t(l);
2937
+ return t.filter((s) => !r.has(s));
2938
+ }, Ut = (t, l) => Math.max(0, Math.min(t, l)), be = (t, l, r) => {
2939
+ const s = new Set(l), m = he(t.filter((a) => s.has(a))), u = Math.max(0, l.length - r);
2940
+ return m.slice(0, u);
2917
2941
  };
2918
- function cr(t) {
2919
- const { storageKey: a, columns: r, defaultVisibleKeys: l, defaultOrder: p } = t, i = Z(() => r.map((u) => String(u.key)), [r]), s = Z(() => new Set(i), [i]), [d, C] = _(() => {
2920
- if (typeof window > "u") {
2921
- const L = p?.map(String) ?? i, j = l && l.length ? i.filter((o) => !new Set(l.map(String)).has(o)) : [];
2922
- return { order: ie(L), hidden: ie(j) };
2923
- }
2924
- const u = Ot(window.localStorage.getItem(a)), m = p?.map(String) ?? i, b = ie(m), w = ie((u?.order ?? []).filter((L) => s.has(L))), h = ie([
2925
- ...w,
2926
- ...b.filter((L) => !w.includes(L)),
2927
- ...i.filter((L) => !w.includes(L) && !b.includes(L))
2928
- ]), y = ie((u?.hidden ?? []).filter((L) => s.has(L))), $ = y.length === 0 && l && l.length ? i.filter((L) => !new Set(l.map(String)).has(L)) : y;
2929
- return { order: h, hidden: ie($) };
2942
+ function fr(t) {
2943
+ const { storageKey: l, columns: r, defaultVisibleKeys: s, defaultOrder: m, minVisible: u = 5 } = t, a = U(() => r.map((h) => String(h.key)), [r]), c = U(() => new Set(a), [a]), N = U(
2944
+ () => Ut(u, a.length),
2945
+ [a.length, u]
2946
+ ), [y, C] = H(() => {
2947
+ const h = Ye(
2948
+ a,
2949
+ m?.map(String) ?? []
2950
+ ), A = Oe(
2951
+ a,
2952
+ s?.map(String) ?? []
2953
+ );
2954
+ if (typeof window > "u")
2955
+ return {
2956
+ order: h,
2957
+ hidden: be(A, a, N)
2958
+ };
2959
+ const M = Ht(window.localStorage.getItem(l)), D = he((M?.order ?? []).filter((E) => c.has(E))), i = he([...D, ...h, ...a]), d = he((M?.hidden ?? []).filter((E) => c.has(E)));
2960
+ return {
2961
+ order: i,
2962
+ hidden: be(M ? d : A, a, N)
2963
+ };
2930
2964
  });
2931
- J(() => {
2965
+ ee(() => {
2932
2966
  if (!(typeof window > "u"))
2933
2967
  try {
2934
- window.localStorage.setItem(a, JSON.stringify(d));
2968
+ window.localStorage.setItem(l, JSON.stringify(y));
2935
2969
  } catch {
2936
2970
  }
2937
- }, [a, d]), J(() => {
2938
- C((u) => {
2939
- const m = ie([
2940
- ...u.order.filter((y) => s.has(y)),
2941
- ...i.filter((y) => !u.order.includes(y))
2942
- ]), b = ie(u.hidden.filter((y) => s.has(y))), w = m.length === u.order.length && m.every((y, $) => y === u.order[$]), h = b.length === u.hidden.length && b.every((y, $) => y === u.hidden[$]);
2943
- return w && h ? u : { order: m, hidden: b };
2971
+ }, [y, l]), ee(() => {
2972
+ C((h) => {
2973
+ const A = he([
2974
+ ...h.order.filter((d) => c.has(d)),
2975
+ ...a.filter((d) => !h.order.includes(d))
2976
+ ]), M = be(h.hidden, a, N), D = A.length === h.order.length && A.every((d, v) => d === h.order[v]), i = M.length === h.hidden.length && M.every((d, v) => d === h.hidden[v]);
2977
+ return D && i ? h : { order: A, hidden: M };
2944
2978
  });
2945
- }, [i, s]);
2946
- const k = Z(() => new Set(d.hidden), [d.hidden]), M = Z(() => {
2947
- const u = /* @__PURE__ */ new Map();
2948
- return d.order.forEach((b, w) => u.set(b, w)), [...r.filter((b) => !k.has(String(b.key)))].sort((b, w) => {
2949
- const h = u.get(String(b.key)) ?? Number.MAX_SAFE_INTEGER, y = u.get(String(w.key)) ?? Number.MAX_SAFE_INTEGER;
2950
- return h - y;
2979
+ }, [a, c, N]);
2980
+ const F = U(() => new Set(y.hidden), [y.hidden]), I = U(() => {
2981
+ const h = /* @__PURE__ */ new Map();
2982
+ return y.order.forEach((A, M) => h.set(A, M)), [...r].sort((A, M) => {
2983
+ const D = h.get(String(A.key)) ?? Number.MAX_SAFE_INTEGER, i = h.get(String(M.key)) ?? Number.MAX_SAFE_INTEGER;
2984
+ return D - i;
2951
2985
  });
2952
- }, [r, k, d.order]), D = Z(
2953
- () => d.hidden.filter((u) => s.has(u)),
2954
- [d.hidden, s]
2955
- ), A = R((u) => {
2956
- const m = String(u);
2957
- C((b) => {
2958
- const h = b.hidden.includes(m) ? b.hidden.filter((y) => y !== m) : [...b.hidden, m];
2959
- return { ...b, hidden: ie(h) };
2986
+ }, [r, y.order]), R = U(
2987
+ () => I.filter((h) => !F.has(String(h.key))),
2988
+ [I, F]
2989
+ ), w = U(
2990
+ () => y.hidden.filter((h) => c.has(h)),
2991
+ [y.hidden, c]
2992
+ ), k = a.length - w.length, b = P((h) => {
2993
+ const A = String(h);
2994
+ C((M) => {
2995
+ if (M.hidden.includes(A))
2996
+ return { ...M, hidden: M.hidden.filter((v) => v !== A) };
2997
+ if (a.length - M.hidden.length <= N) return M;
2998
+ const d = be([...M.hidden, A], a, N);
2999
+ return { ...M, hidden: d };
2960
3000
  });
2961
- }, []), E = R((u, m) => {
2962
- C((b) => {
2963
- const w = b.order.slice();
2964
- if (u < 0 || m < 0 || u >= w.length || m >= w.length) return b;
2965
- const [h] = w.splice(u, 1);
2966
- return w.splice(m, 0, h), { ...b, order: w };
3001
+ }, [a, N]), j = P((h, A) => {
3002
+ C((M) => {
3003
+ const D = M.order.slice();
3004
+ if (h < 0 || A < 0 || h >= D.length || A >= D.length) return M;
3005
+ const [i] = D.splice(h, 1);
3006
+ return D.splice(A, 0, i), { ...M, order: D };
2967
3007
  });
2968
- }, []), v = R(() => {
3008
+ }, []), S = P((h, A, M = "before") => {
3009
+ const D = String(h), i = String(A);
3010
+ D !== i && C((d) => {
3011
+ const v = d.order.slice(), E = v.indexOf(D), B = v.indexOf(i);
3012
+ if (E < 0 || B < 0 || E === B) return d;
3013
+ let z = M === "after" ? B + 1 : B;
3014
+ if (E < z && (z -= 1), z === E) return d;
3015
+ const [O] = v.splice(E, 1);
3016
+ return v.splice(z, 0, O), { ...d, order: v };
3017
+ });
3018
+ }, []), x = P(() => {
2969
3019
  C(() => {
2970
- const u = ie(p?.map(String) ?? i), m = l && l.length ? ie(i.filter((b) => !new Set(l.map(String)).has(b))) : [];
2971
- return { order: u, hidden: m };
3020
+ const h = Ye(
3021
+ a,
3022
+ m?.map(String) ?? []
3023
+ ), A = Oe(
3024
+ a,
3025
+ s?.map(String) ?? []
3026
+ );
3027
+ return {
3028
+ order: h,
3029
+ hidden: be(A, a, N)
3030
+ };
2972
3031
  });
2973
- }, [p, l, i]);
3032
+ }, [a, m, s, N]);
2974
3033
  return {
2975
- orderedColumns: M,
2976
- hiddenKeys: D,
2977
- toggleColumn: A,
2978
- moveColumn: E,
2979
- reset: v
3034
+ orderedAllColumns: I,
3035
+ orderedColumns: R,
3036
+ hiddenKeys: w,
3037
+ visibleCount: k,
3038
+ toggleColumn: b,
3039
+ moveColumn: j,
3040
+ moveColumnByKey: S,
3041
+ reset: x
2980
3042
  };
2981
3043
  }
2982
3044
  export {
2983
- qt as MciBreadcrumb,
2984
- Kt as MciButton,
2985
- Me as MciCheck,
2986
- Jt as MciCollapse,
2987
- Gt as MciDrawer,
2988
- Wt as MciIdentityInput,
2989
- Le as MciInput,
2990
- or as MciLoader,
2991
- er as MciModal,
2992
- tr as MciPagination,
2993
- Pt as MciPhone,
2994
- Dt as MciPicker,
2995
- At as MciSelect,
2996
- $e as MciSkeleton,
2997
- Xt as MciTable,
2998
- ir as MciTableColumnsPanel,
2999
- rr as MciTabs,
3000
- nr as MciTag,
3001
- Rt as MciTextarea,
3002
- lr as MciToast,
3003
- sr as MciToggle,
3004
- ar as MciTooltip,
3005
- Qt as MciUpload,
3006
- cr as useTableColumnSettings
3045
+ Qt as MciBreadcrumb,
3046
+ er as MciButton,
3047
+ De as MciCheck,
3048
+ tr as MciCollapse,
3049
+ rr as MciDrawer,
3050
+ Vt as MciIdentityInput,
3051
+ Ie as MciInput,
3052
+ hr as MciLoader,
3053
+ sr as MciModal,
3054
+ ar as MciPagination,
3055
+ Ot as MciPhone,
3056
+ Ft as MciPicker,
3057
+ Lt as MciSelect,
3058
+ Pe as MciSkeleton,
3059
+ nr as MciTable,
3060
+ mr as MciTableColumnsPanel,
3061
+ or as MciTabs,
3062
+ ir as MciTag,
3063
+ Pt as MciTextarea,
3064
+ cr as MciToast,
3065
+ ur as MciToggle,
3066
+ dr as MciTooltip,
3067
+ lr as MciUpload,
3068
+ fr as useTableColumnSettings
3007
3069
  };