@matthiaskrijgsman/mat-ui 0.0.37 → 0.0.39

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,46 +1,46 @@
1
1
  "use client";
2
- import { jsx as e, jsxs as d, Fragment as te } from "react/jsx-runtime";
3
- import * as C from "react";
4
- import { createContext as Qe, useContext as Ze, useEffect as _, useState as W, useRef as Ce, useCallback as Le, useLayoutEffect as Rt, useMemo as ie } from "react";
5
- import { AnimatePresence as De, motion as J, animate as Xt } from "motion/react";
6
- import { IconExclamationCircleFilled as et, IconEyeOff as Vt, IconEye as Kt, IconPaperclip as Gt, IconCircleCheckFilled as tt, IconX as de, IconCloudUpload as Jt, IconCheck as St, IconChevronDown as ve, IconBold as Yt, IconItalic as qt, IconUnderline as Qt, IconList as Ye, IconListNumbers as Zt, IconLink as en, IconArrowBackUp as tn, IconArrowForwardUp as nn, IconDots as rn, IconSearch as Me, IconSearchOff as nt, IconInfoCircleFilled as ln, IconAlertTriangleFilled as on, IconChevronRight as sn, IconChevronUp as an, IconSettings as ft, IconPlus as ht, IconTrash as cn, IconMailFilled as dn } from "@tabler/icons-react";
7
- import { FloatingPortal as Fe, FloatingOverlay as rt, flip as lt, shift as ot, size as st, useFloating as at, autoUpdate as it, offset as un, useListNavigation as mn, useInteractions as fn } from "@floating-ui/react";
8
- import { mergeRefs as hn } from "react-merge-refs";
9
- import { useDropzone as Dt } from "react-dropzone";
10
- import { LexicalComposer as pn } from "@lexical/react/LexicalComposer";
11
- import { RichTextPlugin as gn } from "@lexical/react/LexicalRichTextPlugin";
12
- import { ContentEditable as bn } from "@lexical/react/LexicalContentEditable";
13
- import { HistoryPlugin as vn } from "@lexical/react/LexicalHistoryPlugin";
14
- import { ListPlugin as xn } from "@lexical/react/LexicalListPlugin";
15
- import { LinkPlugin as wn } from "@lexical/react/LexicalLinkPlugin";
16
- import { OnChangePlugin as Nn } from "@lexical/react/LexicalOnChangePlugin";
2
+ import { jsx as e, jsxs as d, Fragment as ce } from "react/jsx-runtime";
3
+ import * as R from "react";
4
+ import { createContext as Qe, useContext as Ze, useEffect as _, useState as W, useRef as Ce, useCallback as Pe, useLayoutEffect as It, useMemo as se } from "react";
5
+ import { AnimatePresence as De, motion as J, animate as Kt } from "motion/react";
6
+ import { IconExclamationCircleFilled as et, IconEyeOff as Gt, IconEye as Jt, IconPaperclip as Yt, IconCircleCheckFilled as tt, IconX as de, IconCloudUpload as qt, IconCheck as Rt, IconChevronDown as be, IconBold as Qt, IconItalic as Zt, IconUnderline as en, IconList as Ye, IconListNumbers as tn, IconLink as nn, IconArrowBackUp as rn, IconArrowForwardUp as ln, IconDots as on, IconSearch as Fe, IconSearchOff as nt, IconInfoCircleFilled as sn, IconAlertTriangleFilled as an, IconChevronRight as cn, IconChevronUp as dn, IconSettings as mt, IconPlus as ft, IconTrash as un, IconMailFilled as mn } from "@tabler/icons-react";
7
+ import { FloatingPortal as Me, flip as rt, shift as lt, size as ot, useFloating as st, autoUpdate as at, useDismiss as St, useInteractions as Dt, offset as fn, useListNavigation as hn, FloatingOverlay as Ot } from "@floating-ui/react";
8
+ import { mergeRefs as pn } from "react-merge-refs";
9
+ import { useDropzone as zt } from "react-dropzone";
10
+ import { LexicalComposer as gn } from "@lexical/react/LexicalComposer";
11
+ import { RichTextPlugin as bn } from "@lexical/react/LexicalRichTextPlugin";
12
+ import { ContentEditable as vn } from "@lexical/react/LexicalContentEditable";
13
+ import { HistoryPlugin as xn } from "@lexical/react/LexicalHistoryPlugin";
14
+ import { ListPlugin as wn } from "@lexical/react/LexicalListPlugin";
15
+ import { LinkPlugin as Nn } from "@lexical/react/LexicalLinkPlugin";
16
+ import { OnChangePlugin as yn } from "@lexical/react/LexicalOnChangePlugin";
17
17
  import { AutoFocusPlugin as kn } from "@lexical/react/LexicalAutoFocusPlugin";
18
- import { LexicalErrorBoundary as yn } from "@lexical/react/LexicalErrorBoundary";
19
- import { HeadingNode as Cn, QuoteNode as In, $isHeadingNode as Rn, $createHeadingNode as Sn } from "@lexical/rich-text";
20
- import { ListNode as Ot, ListItemNode as Dn, $isListNode as On, REMOVE_LIST_COMMAND as pt, INSERT_UNORDERED_LIST_COMMAND as zn, INSERT_ORDERED_LIST_COMMAND as Tn } from "@lexical/list";
21
- import { LinkNode as Ln, $isLinkNode as gt, TOGGLE_LINK_COMMAND as bt } from "@lexical/link";
18
+ import { LexicalErrorBoundary as Cn } from "@lexical/react/LexicalErrorBoundary";
19
+ import { HeadingNode as In, QuoteNode as Rn, $isHeadingNode as Sn, $createHeadingNode as Dn } from "@lexical/rich-text";
20
+ import { ListNode as Tt, ListItemNode as On, $isListNode as zn, REMOVE_LIST_COMMAND as ht, INSERT_UNORDERED_LIST_COMMAND as Tn, INSERT_ORDERED_LIST_COMMAND as Pn } from "@lexical/list";
21
+ import { LinkNode as Ln, $isLinkNode as pt, TOGGLE_LINK_COMMAND as gt } from "@lexical/link";
22
22
  import { useLexicalComposerContext as ue } from "@lexical/react/LexicalComposerContext";
23
- import { CAN_UNDO_COMMAND as Pn, COMMAND_PRIORITY_LOW as Pe, CAN_REDO_COMMAND as En, $getSelection as zt, $isRangeSelection as Tt, $createParagraphNode as Mn, FORMAT_TEXT_COMMAND as je, UNDO_COMMAND as Fn, REDO_COMMAND as Bn, FOCUS_COMMAND as An, BLUR_COMMAND as Un } from "lexical";
24
- import { mergeRegister as Lt, $getNearestNodeOfType as Wn } from "@lexical/utils";
25
- import { $setBlocksType as vt } from "@lexical/selection";
26
- const f = (...t) => t.filter(Boolean).join(" "), Hn = [
23
+ import { CAN_UNDO_COMMAND as En, COMMAND_PRIORITY_LOW as Le, CAN_REDO_COMMAND as Fn, $getSelection as Pt, $isRangeSelection as Lt, $createParagraphNode as Mn, FORMAT_TEXT_COMMAND as je, UNDO_COMMAND as Bn, REDO_COMMAND as An, FOCUS_COMMAND as Un, BLUR_COMMAND as Wn } from "lexical";
24
+ import { mergeRegister as Et, $getNearestNodeOfType as Hn } from "@lexical/utils";
25
+ import { $setBlocksType as bt } from "@lexical/selection";
26
+ const m = (...n) => n.filter(Boolean).join(" "), $n = [
27
27
  "polygon(50% 50%,0 0,0 0,0 0,0 0,0 0)",
28
28
  "polygon(50% 50%,0 0,100% 0,100% 0,100% 0,100% 0)",
29
29
  "polygon(50% 50%,0 0,100% 0,100% 100%,100% 100%,100% 100%)",
30
30
  "polygon(50% 50%,0 0,100% 0,100% 100%,0 100%,0 100%)",
31
31
  "polygon(50% 50%,0 0,100% 0,100% 100%,0 100%,0 0)"
32
- ], Se = (t) => {
32
+ ], Se = (n) => {
33
33
  const {
34
- speed: n = 1,
35
- className: o
36
- } = t, s = 1 / n, r = 2 / n;
34
+ speed: t = 1,
35
+ className: s
36
+ } = n, l = 1 / t, r = 2 / t;
37
37
  return /* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(
38
38
  J.div,
39
39
  {
40
40
  role: "status",
41
- className: f("relative rounded-full", o),
41
+ className: m("relative rounded-full", s),
42
42
  animate: { rotate: 360 },
43
- transition: { repeat: 1 / 0, ease: "linear", duration: s },
43
+ transition: { repeat: 1 / 0, ease: "linear", duration: l },
44
44
  children: /* @__PURE__ */ e(
45
45
  J.div,
46
46
  {
@@ -50,7 +50,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
50
50
  borderStyle: "solid",
51
51
  borderWidth: 2
52
52
  },
53
- animate: { clipPath: Hn },
53
+ animate: { clipPath: $n },
54
54
  transition: {
55
55
  repeat: 1 / 0,
56
56
  ease: "linear",
@@ -61,11 +61,11 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
61
61
  )
62
62
  }
63
63
  ) });
64
- }, ne = {
64
+ }, te = {
65
65
  sm: "h-[var(--control-size-sm-height)]",
66
66
  md: "h-[var(--control-size-md-height)]",
67
67
  lg: "h-[var(--control-size-lg-height)]"
68
- }, Pt = {
68
+ }, Ft = {
69
69
  sm: "min-h-[var(--control-size-sm-height)]",
70
70
  md: "min-h-[var(--control-size-md-height)]",
71
71
  lg: "min-h-[var(--control-size-lg-height)]"
@@ -73,11 +73,11 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
73
73
  sm: "text-[length:var(--control-size-sm-font-size)]",
74
74
  md: "text-[length:var(--control-size-md-font-size)]",
75
75
  lg: "text-[length:var(--control-size-lg-font-size)]"
76
- }, $n = {
76
+ }, _n = {
77
77
  sm: "gap-[var(--control-size-sm-gap)]",
78
78
  md: "gap-[var(--control-size-md-gap)]",
79
79
  lg: "gap-[var(--control-size-lg-gap)]"
80
- }, _n = {
80
+ }, jn = {
81
81
  sm: "px-[var(--control-size-sm-px)]",
82
82
  md: "px-[var(--control-size-md-px)]",
83
83
  lg: "px-[var(--control-size-lg-px)]"
@@ -85,7 +85,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
85
85
  sm: "pl-[var(--control-size-sm-px)]",
86
86
  md: "pl-[var(--control-size-md-px)]",
87
87
  lg: "pl-[var(--control-size-lg-px)]"
88
- }, ct = {
88
+ }, it = {
89
89
  sm: "pr-[var(--control-size-sm-px)]",
90
90
  md: "pr-[var(--control-size-md-px)]",
91
91
  lg: "pr-[var(--control-size-lg-px)]"
@@ -97,300 +97,302 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
97
97
  sm: "pr-[calc(var(--control-size-sm-px)+3.75rem)]",
98
98
  md: "pr-[calc(var(--control-size-md-px)+3.75rem)]",
99
99
  lg: "pr-[calc(var(--control-size-lg-px)+3.75rem)]"
100
- }, Et = {
100
+ }, Mt = {
101
101
  sm: "pl-[calc(var(--control-size-sm-icon-offset)+var(--control-size-sm-icon)+0.75rem)]",
102
102
  md: "pl-[calc(var(--control-size-md-icon-offset)+var(--control-size-md-icon)+0.75rem)]",
103
103
  lg: "pl-[calc(var(--control-size-lg-icon-offset)+var(--control-size-lg-icon)+0.75rem)]"
104
- }, Mt = {
104
+ }, Bt = {
105
105
  sm: "left-[var(--control-size-sm-icon-offset)]",
106
106
  md: "left-[var(--control-size-md-icon-offset)]",
107
107
  lg: "left-[var(--control-size-lg-icon-offset)]"
108
- }, jn = {
108
+ }, Xn = {
109
109
  sm: "right-[var(--control-size-sm-px)]",
110
110
  md: "right-[var(--control-size-md-px)]",
111
111
  lg: "right-[var(--control-size-lg-px)]"
112
- }, be = {
112
+ }, ae = {
113
113
  sm: "h-[var(--control-size-sm-icon)] w-[var(--control-size-sm-icon)]",
114
114
  md: "h-[var(--control-size-md-icon)] w-[var(--control-size-md-icon)]",
115
115
  lg: "h-[var(--control-size-lg-icon)] w-[var(--control-size-lg-icon)]"
116
- }, Ft = {
116
+ }, At = {
117
117
  sm: "h-[var(--control-size-sm-height)] w-[var(--control-size-sm-height)]",
118
118
  md: "h-[var(--control-size-md-height)] w-[var(--control-size-md-height)]",
119
119
  lg: "h-[var(--control-size-lg-height)] w-[var(--control-size-lg-height)]"
120
- }, Xn = `
120
+ }, Vn = `
121
121
  inline-flex flex-row items-center justify-center
122
122
  button-ring font-semibold ring-0 disabled:hover:ring-0 hover:ring-4 active:ring-1
123
123
  rounded-[var(--border-radius-input)]
124
124
  cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-4
125
125
  disabled:cursor-default
126
- `, Vn = {
126
+ `, Kn = {
127
127
  primary: "border button-primary shadow-sm",
128
128
  secondary: "border button-secondary shadow-sm",
129
129
  tertiary: "border button-tertiary",
130
130
  white: "border button-white shadow-sm",
131
131
  black: "border button-black shadow-sm",
132
132
  transparent: "border button-transparent"
133
- }, Kn = C.forwardRef((t, n) => {
133
+ }, Gn = R.forwardRef((n, t) => {
134
134
  const {
135
- variant: o = "white",
136
- size: s = "md",
135
+ variant: s = "white",
136
+ size: l = "md",
137
137
  className: r,
138
- children: l,
138
+ children: o,
139
139
  loading: a = !1,
140
140
  Icon: i,
141
- ...c
142
- } = t;
141
+ IconRight: c,
142
+ ...f
143
+ } = n;
143
144
  return /* @__PURE__ */ d(
144
145
  "button",
145
146
  {
146
- ref: n,
147
- className: f(
148
- Xn,
149
- Vn[o],
150
- ne[s],
151
- _n[s],
152
- Y[s],
153
- $n[s],
147
+ ref: t,
148
+ className: m(
149
+ Vn,
150
+ Kn[s],
151
+ te[l],
152
+ jn[l],
153
+ Y[l],
154
+ _n[l],
154
155
  r
155
156
  ),
156
- ...c,
157
+ ...f,
157
158
  children: [
158
- a && /* @__PURE__ */ e(Se, { className: f(be[s]) }),
159
- !a && /* @__PURE__ */ d(te, { children: [
160
- i && /* @__PURE__ */ e(i, { className: f(be[s], "-ml-1") }),
161
- l
159
+ a && /* @__PURE__ */ e(Se, { className: m(ae[l]) }),
160
+ !a && /* @__PURE__ */ d(ce, { children: [
161
+ i && /* @__PURE__ */ e(i, { className: m(ae[l], "-ml-1") }),
162
+ o,
163
+ c && /* @__PURE__ */ e(c, { className: m(ae[l], "-mr-1") })
162
164
  ] })
163
165
  ]
164
166
  }
165
167
  );
166
- }), Gn = `
168
+ }), Jn = `
167
169
  inline-flex flex-row items-center justify-center
168
170
  button-ring font-semibold ring-0 disabled:hover:ring-0 hover:ring-4 active:ring-1
169
171
  rounded-[var(--border-radius-input)]
170
172
  cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-4
171
173
  disabled:cursor-default
172
- `, Jn = {
174
+ `, Yn = {
173
175
  primary: "border button-primary shadow-sm",
174
176
  secondary: "border button-secondary shadow-sm",
175
177
  tertiary: "border button-tertiary",
176
178
  white: "border button-white shadow-sm",
177
179
  black: "border button-black shadow-sm",
178
180
  transparent: "border button-transparent"
179
- }, qe = C.forwardRef((t, n) => {
181
+ }, qe = R.forwardRef((n, t) => {
180
182
  const {
181
- variant: o = "white",
182
- size: s = "md",
183
+ variant: s = "white",
184
+ size: l = "md",
183
185
  className: r,
184
- Icon: l,
186
+ Icon: o,
185
187
  ...a
186
- } = t;
188
+ } = n;
187
189
  return /* @__PURE__ */ e(
188
190
  "button",
189
191
  {
190
- ref: n,
191
- className: f(
192
- Gn,
193
- Jn[o],
194
- Ft[s],
192
+ ref: t,
193
+ className: m(
194
+ Jn,
195
+ Yn[s],
196
+ At[l],
195
197
  r
196
198
  ),
197
199
  ...a,
198
- children: /* @__PURE__ */ e(l, { className: be[s] })
200
+ children: /* @__PURE__ */ e(o, { className: ae[l] })
199
201
  }
200
202
  );
201
- }), Yn = `
203
+ }), qn = `
202
204
  inline-flex flex-row items-center justify-center
203
205
  button-ring font-semibold ring-0 disabled:hover:ring-0 hover:ring-4 active:ring-1 rounded-full cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-4
204
206
  disabled:cursor-default
205
- `, qn = {
207
+ `, Qn = {
206
208
  primary: "border button-primary shadow-sm",
207
209
  secondary: "border button-secondary shadow-sm",
208
210
  tertiary: "border button-tertiary",
209
211
  white: "border button-white shadow-sm",
210
212
  black: "border button-black shadow-sm",
211
213
  transparent: "border button-transparent"
212
- }, Bt = C.forwardRef((t, n) => {
214
+ }, Ut = R.forwardRef((n, t) => {
213
215
  const {
214
- variant: o = "white",
215
- size: s = "md",
216
+ variant: s = "white",
217
+ size: l = "md",
216
218
  className: r,
217
- Icon: l,
219
+ Icon: o,
218
220
  ...a
219
- } = t;
221
+ } = n;
220
222
  return /* @__PURE__ */ e(
221
223
  "button",
222
224
  {
223
- ref: n,
224
- className: f(
225
- Yn,
226
- qn[o],
227
- Ft[s],
225
+ ref: t,
226
+ className: m(
227
+ qn,
228
+ Qn[s],
229
+ At[l],
228
230
  r
229
231
  ),
230
232
  ...a,
231
- children: /* @__PURE__ */ e(l, { className: be[s] })
233
+ children: /* @__PURE__ */ e(o, { className: ae[l] })
232
234
  }
233
235
  );
234
- }), q = (t) => {
236
+ }), q = (n) => {
235
237
  const {
236
- children: n
237
- } = t;
238
- return n ? /* @__PURE__ */ e("label", { className: "input-label font-medium mb-1", children: n }) : null;
239
- }, re = () => /* @__PURE__ */ e("div", { className: "h-5 w-5", children: /* @__PURE__ */ e(et, { className: "h-5 w-5 input-error-icon" }) }), Q = Qe("md"), Qn = () => Ze(Q), he = C.forwardRef((t, n) => {
238
+ children: t
239
+ } = n;
240
+ return t ? /* @__PURE__ */ e("label", { className: "input-label font-medium mb-1", children: t }) : null;
241
+ }, ne = () => /* @__PURE__ */ e("div", { className: "h-5 w-5", children: /* @__PURE__ */ e(et, { className: "h-5 w-5 input-error-icon" }) }), Q = Qe("md"), Zn = () => Ze(Q), he = R.forwardRef((n, t) => {
240
242
  const {
241
- children: o,
242
- className: s
243
- } = t, r = Qn();
243
+ children: s,
244
+ className: l
245
+ } = n, r = Zn();
244
246
  return /* @__PURE__ */ e(
245
247
  "div",
246
248
  {
247
- ref: n,
248
- className: f(
249
+ ref: t,
250
+ className: m(
249
251
  "absolute top-1/2 -translate-y-1/2 flex flex-row items-center gap-1 pointer-events-none",
250
- jn[r],
251
- s
252
+ Xn[r],
253
+ l
252
254
  ),
253
- children: o
255
+ children: s
254
256
  }
255
257
  );
256
- }), V = (t) => {
258
+ }), V = (n) => {
257
259
  const {
258
- children: n
259
- } = t;
260
- return n ? /* @__PURE__ */ e("div", { className: "input-description text-sm font-medium mt-2", children: n }) : null;
261
- }, K = (t) => {
260
+ children: t
261
+ } = n;
262
+ return t ? /* @__PURE__ */ e("div", { className: "input-description text-sm font-medium mt-2", children: t }) : null;
263
+ }, K = (n) => {
262
264
  const {
263
- children: n
264
- } = t;
265
- return n ? /* @__PURE__ */ e("div", { className: "input-error-text text-sm font-medium mt-2", children: n }) : null;
266
- }, At = (t) => {
265
+ children: t
266
+ } = n;
267
+ return t ? /* @__PURE__ */ e("div", { className: "input-error-text text-sm font-medium mt-2", children: t }) : null;
268
+ }, Wt = (n) => {
267
269
  const {
268
- className: n,
269
- label: o,
270
- description: s,
270
+ className: t,
271
+ label: s,
272
+ description: l,
271
273
  Icon: r,
272
- error: l,
274
+ error: o,
273
275
  buttonTray: a,
274
276
  size: i = "md",
275
277
  ...c
276
- } = t, g = !!l || !!a;
278
+ } = n, f = !!o || !!a;
277
279
  return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d(
278
280
  "div",
279
281
  {
280
- className: f(
282
+ className: m(
281
283
  "flex flex-col",
282
- n
284
+ t
283
285
  ),
284
286
  children: [
285
- /* @__PURE__ */ e(q, { children: o }),
287
+ /* @__PURE__ */ e(q, { children: s }),
286
288
  /* @__PURE__ */ d("div", { className: "flex flex-col relative", children: [
287
- r && /* @__PURE__ */ e(r, { className: f(
289
+ r && /* @__PURE__ */ e(r, { className: m(
288
290
  "input-icon absolute top-1/2 -translate-y-1/2",
289
- be[i],
290
- Mt[i]
291
+ ae[i],
292
+ Bt[i]
291
293
  ) }),
292
294
  /* @__PURE__ */ e(
293
295
  "input",
294
296
  {
295
- className: f(
297
+ className: m(
296
298
  "border input-base transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none",
297
- ne[i],
299
+ te[i],
298
300
  Y[i],
299
- r ? Et[i] : me[i],
300
- g ? fe[i] : ct[i],
301
- l && "input-error"
301
+ r ? Mt[i] : me[i],
302
+ f ? fe[i] : it[i],
303
+ o && "input-error"
302
304
  ),
303
305
  ...c
304
306
  }
305
307
  ),
306
308
  /* @__PURE__ */ d(he, { children: [
307
- l && /* @__PURE__ */ e(re, {}),
309
+ o && /* @__PURE__ */ e(ne, {}),
308
310
  a
309
311
  ] })
310
312
  ] }),
311
- /* @__PURE__ */ e(V, { children: s }),
312
- /* @__PURE__ */ e(K, { children: l })
313
+ /* @__PURE__ */ e(V, { children: l }),
314
+ /* @__PURE__ */ e(K, { children: o })
313
315
  ]
314
316
  }
315
317
  ) });
316
- }, Zn = (t) => {
317
- const n = t.match(/^#?([0-9a-fA-F]{6})$/);
318
- if (!n) return null;
319
- const o = parseInt(n[1], 16);
320
- return [(o >> 16 & 255) / 255, (o >> 8 & 255) / 255, (o & 255) / 255];
321
- }, er = (t, n, o) => {
322
- const s = (r) => Math.round(r * 255).toString(16).padStart(2, "0").toUpperCase();
323
- return "#" + s(t) + s(n) + s(o);
324
- }, tr = (t, n, o) => {
325
- const s = Math.max(t, n, o), r = Math.min(t, n, o), l = s - r;
318
+ }, er = (n) => {
319
+ const t = n.match(/^#?([0-9a-fA-F]{6})$/);
320
+ if (!t) return null;
321
+ const s = parseInt(t[1], 16);
322
+ return [(s >> 16 & 255) / 255, (s >> 8 & 255) / 255, (s & 255) / 255];
323
+ }, tr = (n, t, s) => {
324
+ const l = (r) => Math.round(r * 255).toString(16).padStart(2, "0").toUpperCase();
325
+ return "#" + l(n) + l(t) + l(s);
326
+ }, nr = (n, t, s) => {
327
+ const l = Math.max(n, t, s), r = Math.min(n, t, s), o = l - r;
326
328
  let a = 0;
327
- return l !== 0 && (s === t ? a = ((n - o) / l + 6) % 6 : s === n ? a = (o - t) / l + 2 : a = (t - n) / l + 4, a *= 60), [a, s === 0 ? 0 : l / s, s];
328
- }, nr = (t, n, o) => {
329
- const s = o * n, r = t / 60, l = s * (1 - Math.abs(r % 2 - 1));
329
+ return o !== 0 && (l === n ? a = ((t - s) / o + 6) % 6 : l === t ? a = (s - n) / o + 2 : a = (n - t) / o + 4, a *= 60), [a, l === 0 ? 0 : o / l, l];
330
+ }, rr = (n, t, s) => {
331
+ const l = s * t, r = n / 60, o = l * (1 - Math.abs(r % 2 - 1));
330
332
  let a = 0, i = 0, c = 0;
331
- r < 1 ? (a = s, i = l) : r < 2 ? (a = l, i = s) : r < 3 ? (i = s, c = l) : r < 4 ? (i = l, c = s) : r < 5 ? (a = l, c = s) : (a = s, c = l);
332
- const g = o - s;
333
- return [a + g, i + g, c + g];
334
- }, Re = (t, n, o) => {
335
- const [s, r, l] = nr(t, n, o);
336
- return er(s, r, l);
337
- }, xt = (t) => {
338
- const n = Zn(t);
339
- return n ? tr(n[0], n[1], n[2]) : null;
340
- }, rr = (t) => {
341
- const n = t.trim();
342
- if (!n) return null;
343
- const o = n.match(/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);
344
- if (o) {
345
- let a = o[1];
333
+ r < 1 ? (a = l, i = o) : r < 2 ? (a = o, i = l) : r < 3 ? (i = l, c = o) : r < 4 ? (i = o, c = l) : r < 5 ? (a = o, c = l) : (a = l, c = o);
334
+ const f = s - l;
335
+ return [a + f, i + f, c + f];
336
+ }, Re = (n, t, s) => {
337
+ const [l, r, o] = rr(n, t, s);
338
+ return tr(l, r, o);
339
+ }, vt = (n) => {
340
+ const t = er(n);
341
+ return t ? nr(t[0], t[1], t[2]) : null;
342
+ }, lr = (n) => {
343
+ const t = n.trim();
344
+ if (!t) return null;
345
+ const s = t.match(/^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/);
346
+ if (s) {
347
+ let a = s[1];
346
348
  return a.length === 3 && (a = a.split("").map((i) => i + i).join("")), "#" + a.toUpperCase();
347
349
  }
348
350
  if (typeof document > "u") return null;
349
- const s = document.createElement("div");
350
- if (s.style.color = n, !s.style.color) return null;
351
- document.body.appendChild(s);
352
- const r = getComputedStyle(s).color;
353
- document.body.removeChild(s);
354
- const l = r.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
355
- return l ? "#" + [l[1], l[2], l[3]].map((a) => parseInt(a, 10).toString(16).padStart(2, "0")).join("").toUpperCase() : null;
356
- }, Xe = (t) => {
357
- const n = C.useRef(null), [o, s] = C.useState(!1), r = (l) => {
358
- n.current = null, s(!1), l.currentTarget.releasePointerCapture?.(l.pointerId);
351
+ const l = document.createElement("div");
352
+ if (l.style.color = t, !l.style.color) return null;
353
+ document.body.appendChild(l);
354
+ const r = getComputedStyle(l).color;
355
+ document.body.removeChild(l);
356
+ const o = r.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);
357
+ return o ? "#" + [o[1], o[2], o[3]].map((a) => parseInt(a, 10).toString(16).padStart(2, "0")).join("").toUpperCase() : null;
358
+ }, Xe = (n) => {
359
+ const t = R.useRef(null), [s, l] = R.useState(!1), r = (o) => {
360
+ t.current = null, l(!1), o.currentTarget.releasePointerCapture?.(o.pointerId);
359
361
  };
360
362
  return {
361
- isDragging: o,
363
+ isDragging: s,
362
364
  bind: {
363
- onPointerDown: (l) => {
364
- const a = l.currentTarget;
365
- n.current = a.getBoundingClientRect(), a.setPointerCapture?.(l.pointerId), s(!0), t(l.clientX, l.clientY, n.current);
365
+ onPointerDown: (o) => {
366
+ const a = o.currentTarget;
367
+ t.current = a.getBoundingClientRect(), a.setPointerCapture?.(o.pointerId), l(!0), n(o.clientX, o.clientY, t.current);
366
368
  },
367
- onPointerMove: (l) => {
368
- n.current && t(l.clientX, l.clientY, n.current);
369
+ onPointerMove: (o) => {
370
+ t.current && n(o.clientX, o.clientY, t.current);
369
371
  },
370
372
  onPointerUp: r,
371
373
  onPointerCancel: r
372
374
  }
373
375
  };
374
- }, lr = "flex flex-col dropdown-panel border mt-1 rounded-xl shadow-lg overflow-y-auto relative space-y-1", or = {
376
+ }, or = "flex flex-col dropdown-panel border mt-1 rounded-xl shadow-lg overflow-y-auto relative space-y-1", sr = {
375
377
  sm: "p-2",
376
378
  md: "p-3",
377
379
  lg: "p-4"
378
- }, xe = (t) => {
380
+ }, ve = (n) => {
379
381
  const {
380
- className: n,
381
- children: o,
382
- padding: s = "md",
382
+ className: t,
383
+ children: s,
384
+ padding: l = "md",
383
385
  ...r
384
- } = t;
386
+ } = n;
385
387
  return /* @__PURE__ */ e(
386
388
  "div",
387
389
  {
388
- className: f(lr, or[s], n),
390
+ className: m(or, sr[l], t),
389
391
  ...r,
390
- children: o
392
+ children: s
391
393
  }
392
394
  );
393
- }, sr = {
395
+ }, ar = {
394
396
  top: "bottom center",
395
397
  "top-start": "bottom left",
396
398
  "top-end": "bottom right",
@@ -403,114 +405,117 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
403
405
  left: "right center",
404
406
  "left-start": "top right",
405
407
  "left-end": "bottom right"
406
- }, Ut = C.memo(
407
- ({ open: t, children: n, className: o, onOutsideClick: s, floatingStyles: r, setFloating: l, placement: a, floatingProps: i }) => /* @__PURE__ */ e(Fe, { children: /* @__PURE__ */ e(De, { children: t && /* @__PURE__ */ d(te, { children: [
408
- s && /* @__PURE__ */ e(rt, { onClick: s }),
409
- /* @__PURE__ */ e("div", { ref: l, style: r, className: "z-50", ...i, children: /* @__PURE__ */ e(
410
- J.div,
411
- {
412
- className: o,
413
- style: { transformOrigin: sr[a] },
414
- initial: { opacity: 0, scale: 0.95 },
415
- animate: { opacity: 1, scale: 1 },
416
- exit: { opacity: 0, scale: 0.95 },
417
- transition: { duration: 0.1, ease: "easeInOut" },
418
- children: n
419
- }
420
- ) })
421
- ] }) }) })
422
- ), dt = (t) => {
423
- const { placement: n = "bottom", onOutsideClick: o, fullWidth: s, minWidth: r, maxWidth: l } = t, a = C.useMemo(() => [
408
+ }, Ht = R.memo(
409
+ ({ open: n, children: t, className: s, floatingStyles: l, setFloating: r, placement: o, floatingProps: a }) => /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ e(De, { children: n && /* @__PURE__ */ e("div", { ref: r, style: l, className: "z-50", ...a, children: /* @__PURE__ */ e(
410
+ J.div,
411
+ {
412
+ className: s,
413
+ style: { transformOrigin: ar[o] },
414
+ initial: { opacity: 0, scale: 0.95 },
415
+ animate: { opacity: 1, scale: 1 },
416
+ exit: { opacity: 0, scale: 0.95 },
417
+ transition: { duration: 0.1, ease: "easeInOut" },
418
+ children: t
419
+ }
420
+ ) }) }) })
421
+ ), ct = (n) => {
422
+ const { placement: t = "bottom", open: s, onOpenChange: l, fullWidth: r, minWidth: o, maxWidth: a } = n, i = R.useMemo(() => [
423
+ rt({ padding: 8 }),
424
424
  lt({ padding: 8 }),
425
- ot({ padding: 8 }),
426
- st({
427
- apply({ rects: h, elements: b }) {
428
- s && (b.floating.style.width = `${h.reference.width}px`), r && (b.floating.style.minWidth = `${r}px`), l && (b.floating.style.maxWidth = `${l}px`);
425
+ ot({
426
+ apply({ rects: b, elements: C }) {
427
+ r && (C.floating.style.width = `${b.reference.width}px`), o && (C.floating.style.minWidth = `${o}px`), a && (C.floating.style.maxWidth = `${a}px`);
429
428
  }
430
429
  })
431
- ], [s, l, r]), { refs: i, floatingStyles: c, placement: g } = at({
432
- placement: n,
433
- middleware: a,
434
- whileElementsMounted: it
435
- }), x = C.useRef({
436
- onOutsideClick: o,
437
- floatingStyles: c,
438
- setFloating: i.setFloating,
439
- placement: n
430
+ ], [r, a, o]), { refs: c, floatingStyles: f, context: w, placement: x } = st({
431
+ placement: t,
432
+ open: s,
433
+ onOpenChange: l,
434
+ middleware: i,
435
+ whileElementsMounted: at
436
+ }), h = St(w, {
437
+ enabled: !!l,
438
+ outsidePress: !0,
439
+ escapeKey: !1
440
+ }), { getFloatingProps: g } = Dt([h]), p = R.useRef({
441
+ floatingStyles: f,
442
+ setFloating: c.setFloating,
443
+ placement: t,
444
+ getFloatingProps: g
440
445
  });
441
- x.current = {
442
- onOutsideClick: o,
443
- floatingStyles: c,
444
- setFloating: i.setFloating,
445
- placement: g
446
+ p.current = {
447
+ floatingStyles: f,
448
+ setFloating: c.setFloating,
449
+ placement: x,
450
+ getFloatingProps: g
446
451
  };
447
- const w = C.useMemo(() => {
448
- const h = (b) => {
449
- const { floatingStyles: p, setFloating: m, onOutsideClick: v, placement: u } = x.current, { className: I, open: R, children: y } = b;
452
+ const u = R.useMemo(() => {
453
+ const b = (C) => {
454
+ const { floatingStyles: v, setFloating: k, placement: I, getFloatingProps: D } = p.current, { className: O, open: P, children: L } = C;
450
455
  return /* @__PURE__ */ e(
451
- Ut,
456
+ Ht,
452
457
  {
453
- open: R,
454
- className: I,
455
- onOutsideClick: v,
456
- floatingStyles: p,
457
- setFloating: m,
458
- placement: u,
459
- children: y
458
+ open: P,
459
+ className: O,
460
+ floatingStyles: v,
461
+ setFloating: k,
462
+ placement: I,
463
+ floatingProps: D(),
464
+ children: L
460
465
  }
461
466
  );
462
467
  };
463
- return C.memo(h);
468
+ return R.memo(b);
464
469
  }, []);
465
470
  return {
466
- anchorRef: i.setReference,
467
- Popover: w
471
+ anchorRef: c.setReference,
472
+ Popover: u
468
473
  };
469
- }, we = (t, n) => {
474
+ }, xe = (n, t) => {
470
475
  _(() => {
471
- if (!t) return;
472
- const o = (s) => {
473
- s.key === "Escape" && n();
476
+ if (!n) return;
477
+ const s = (l) => {
478
+ l.key === "Escape" && t();
474
479
  };
475
- return document.addEventListener("keydown", o), () => {
476
- document.removeEventListener("keydown", o);
480
+ return document.addEventListener("keydown", s), () => {
481
+ document.removeEventListener("keydown", s);
477
482
  };
478
- }, [t, n]);
479
- }, ar = "linear-gradient(to right, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%)", ir = "linear-gradient(to right, #fff, rgba(255,255,255,0))", cr = "linear-gradient(to top, #000, rgba(0,0,0,0))", Ve = "0 0 0 1px rgba(0,0,0,0.15)", dr = 14, ur = 28, mr = 6, fr = 8, Ke = { type: "spring", stiffness: 500, damping: 18, mass: 0.6 }, ke = (t) => {
480
- const n = t ? ur : dr, o = n / 2;
483
+ }, [n, t]);
484
+ }, ir = "linear-gradient(to right, #f00 0%, #ff0 16.66%, #0f0 33.33%, #0ff 50%, #00f 66.66%, #f0f 83.33%, #f00 100%)", cr = "linear-gradient(to right, #fff, rgba(255,255,255,0))", dr = "linear-gradient(to top, #000, rgba(0,0,0,0))", Ve = "0 0 0 1px rgba(0,0,0,0.15)", ur = 14, mr = 28, fr = 6, hr = 8, Ke = { type: "spring", stiffness: 500, damping: 18, mass: 0.6 }, ye = (n) => {
485
+ const t = n ? mr : ur, s = t / 2;
481
486
  return {
482
- width: n,
483
- height: n,
484
- marginLeft: -o,
485
- marginTop: -o,
486
- borderRadius: t ? fr : mr
487
+ width: t,
488
+ height: t,
489
+ marginLeft: -s,
490
+ marginTop: -s,
491
+ borderRadius: n ? hr : fr
487
492
  };
488
- }, Te = (t) => Math.max(0, Math.min(1, t)), wt = (t, n) => {
489
- Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(t, n), t.dispatchEvent(new Event("input", { bubbles: !0 }));
490
- }, hr = ({ value: t, onChange: n }) => {
491
- const [o, s] = W(() => xt(t) ?? [0, 0, 1]), r = Ce(Re(o[0], o[1], o[2]));
493
+ }, Te = (n) => Math.max(0, Math.min(1, n)), xt = (n, t) => {
494
+ Object.getOwnPropertyDescriptor(HTMLInputElement.prototype, "value")?.set?.call(n, t), n.dispatchEvent(new Event("input", { bubbles: !0 }));
495
+ }, pr = ({ value: n, onChange: t }) => {
496
+ const [s, l] = W(() => vt(n) ?? [0, 0, 1]), r = Ce(Re(s[0], s[1], s[2]));
492
497
  _(() => {
493
- if ((t || "").toUpperCase() === r.current) return;
494
- const m = xt(t);
495
- m && s(m);
496
- }, [t]);
497
- const l = (m) => {
498
- s(m);
499
- const v = Re(m[0], m[1], m[2]);
500
- r.current = v, n(v);
501
- }, [a, i, c] = o, g = Re(a, 1, 1), x = Re(a, i, 1), w = Re(a, i, c), h = Xe((m, v, u) => {
502
- l([a, Te((m - u.left) / u.width), 1 - Te((v - u.top) / u.height)]);
503
- }), b = Xe((m, v, u) => {
504
- l([Te((m - u.left) / u.width) * 360, i, c]);
505
- }), p = Xe((m, v, u) => {
506
- l([a, i, Te((m - u.left) / u.width)]);
498
+ if ((n || "").toUpperCase() === r.current) return;
499
+ const u = vt(n);
500
+ u && l(u);
501
+ }, [n]);
502
+ const o = (u) => {
503
+ l(u);
504
+ const b = Re(u[0], u[1], u[2]);
505
+ r.current = b, t(b);
506
+ }, [a, i, c] = s, f = Re(a, 1, 1), w = Re(a, i, 1), x = Re(a, i, c), h = Xe((u, b, C) => {
507
+ o([a, Te((u - C.left) / C.width), 1 - Te((b - C.top) / C.height)]);
508
+ }), g = Xe((u, b, C) => {
509
+ o([Te((u - C.left) / C.width) * 360, i, c]);
510
+ }), p = Xe((u, b, C) => {
511
+ o([a, i, Te((u - C.left) / C.width)]);
507
512
  });
508
513
  return /* @__PURE__ */ d(
509
514
  "div",
510
515
  {
511
516
  className: "flex flex-col gap-3",
512
517
  style: { width: 220, userSelect: "none" },
513
- onMouseDown: (m) => m.preventDefault(),
518
+ onMouseDown: (u) => u.preventDefault(),
514
519
  children: [
515
520
  /* @__PURE__ */ d(
516
521
  "div",
@@ -527,20 +532,20 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
527
532
  "div",
528
533
  {
529
534
  className: "absolute inset-0 rounded-md overflow-hidden border color-picker-surface",
530
- style: { backgroundColor: g },
535
+ style: { backgroundColor: f },
531
536
  children: [
532
537
  /* @__PURE__ */ e(
533
538
  "div",
534
539
  {
535
540
  className: "absolute inset-0 pointer-events-none",
536
- style: { background: ir }
541
+ style: { background: cr }
537
542
  }
538
543
  ),
539
544
  /* @__PURE__ */ e(
540
545
  "div",
541
546
  {
542
547
  className: "absolute inset-0 pointer-events-none",
543
- style: { background: cr }
548
+ style: { background: dr }
544
549
  }
545
550
  )
546
551
  ]
@@ -554,10 +559,10 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
554
559
  left: `${i * 100}%`,
555
560
  top: `${(1 - c) * 100}%`,
556
561
  boxShadow: Ve,
557
- backgroundColor: w
562
+ backgroundColor: x
558
563
  },
559
- initial: ke(!1),
560
- animate: ke(h.isDragging),
564
+ initial: ye(!1),
565
+ animate: ye(h.isDragging),
561
566
  transition: Ke
562
567
  }
563
568
  )
@@ -570,11 +575,11 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
570
575
  className: "relative w-full rounded-md",
571
576
  style: {
572
577
  height: 12,
573
- background: ar,
578
+ background: ir,
574
579
  touchAction: "none",
575
580
  cursor: "ew-resize"
576
581
  },
577
- ...b.bind,
582
+ ...g.bind,
578
583
  children: /* @__PURE__ */ e(
579
584
  J.div,
580
585
  {
@@ -582,11 +587,11 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
582
587
  style: {
583
588
  top: "50%",
584
589
  left: `${a / 360 * 100}%`,
585
- backgroundColor: g,
590
+ backgroundColor: f,
586
591
  boxShadow: Ve
587
592
  },
588
- initial: ke(!1),
589
- animate: ke(b.isDragging),
593
+ initial: ye(!1),
594
+ animate: ye(g.isDragging),
590
595
  transition: Ke
591
596
  }
592
597
  )
@@ -598,7 +603,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
598
603
  className: "relative w-full rounded-md",
599
604
  style: {
600
605
  height: 12,
601
- background: `linear-gradient(to right, #000, ${x})`,
606
+ background: `linear-gradient(to right, #000, ${w})`,
602
607
  touchAction: "none",
603
608
  cursor: "ew-resize"
604
609
  },
@@ -610,11 +615,11 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
610
615
  style: {
611
616
  top: "50%",
612
617
  left: `${c * 100}%`,
613
- backgroundColor: w,
618
+ backgroundColor: x,
614
619
  boxShadow: Ve
615
620
  },
616
- initial: ke(!1),
617
- animate: ke(p.isDragging),
621
+ initial: ye(!1),
622
+ animate: ye(p.isDragging),
618
623
  transition: Ke
619
624
  }
620
625
  )
@@ -623,202 +628,203 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
623
628
  ]
624
629
  }
625
630
  );
626
- }, vl = (t) => {
631
+ }, xl = (n) => {
627
632
  const {
628
- className: n,
629
- label: o,
630
- description: s,
633
+ className: t,
634
+ label: s,
635
+ description: l,
631
636
  error: r,
632
- buttonTray: l,
637
+ buttonTray: o,
633
638
  size: a = "md",
634
639
  value: i,
635
640
  defaultValue: c,
636
- onChange: g,
637
- onBlur: x,
638
- onFocus: w,
641
+ onChange: f,
642
+ onBlur: w,
643
+ onFocus: x,
639
644
  ...h
640
- } = t, [b, p] = W(
645
+ } = n, [g, p] = W(
641
646
  i != null ? String(i) : c != null ? String(c) : ""
642
- ), [m, v] = W(!1), u = Ce(null), I = i != null ? String(i) : b, R = I || "white";
643
- we(m, () => v(!1));
644
- const { anchorRef: y, Popover: D } = dt({
647
+ ), [u, b] = W(!1), C = Ce(null), v = i != null ? String(i) : g, k = v || "white";
648
+ xe(u, () => b(!1));
649
+ const { anchorRef: I, Popover: D } = ct({
645
650
  placement: "bottom-start",
646
- onOutsideClick: () => v(!1)
647
- }), T = (k) => {
648
- p(k.target.value), g?.(k);
649
- }, B = (k) => {
650
- v(!0), w?.(k);
651
- }, P = (k) => {
652
- const A = k.target.value, O = rr(A);
653
- O && O !== A && u.current && wt(u.current, O), v(!1), x?.(k);
654
- }, z = (k) => {
655
- u.current && wt(u.current, k);
656
- }, N = !!r || !!l;
651
+ open: u,
652
+ onOpenChange: b
653
+ }), O = (y) => {
654
+ p(y.target.value), f?.(y);
655
+ }, P = (y) => {
656
+ b(!0), x?.(y);
657
+ }, L = (y) => {
658
+ const A = y.target.value, z = lr(A);
659
+ z && z !== A && C.current && xt(C.current, z), b(!1), w?.(y);
660
+ }, T = (y) => {
661
+ C.current && xt(C.current, y);
662
+ }, N = !!r || !!o;
657
663
  return /* @__PURE__ */ e(Q.Provider, { value: a, children: /* @__PURE__ */ d(
658
664
  "div",
659
665
  {
660
- className: f(
666
+ className: m(
661
667
  "flex flex-col",
662
- n
668
+ t
663
669
  ),
664
670
  children: [
665
- /* @__PURE__ */ e(q, { children: o }),
666
- /* @__PURE__ */ d("div", { className: "flex flex-col relative", ref: y, children: [
671
+ /* @__PURE__ */ e(q, { children: s }),
672
+ /* @__PURE__ */ d("div", { className: "flex flex-col relative", ref: I, children: [
667
673
  /* @__PURE__ */ e(
668
674
  "div",
669
675
  {
670
- className: f(
676
+ className: m(
671
677
  "absolute top-1/2 -translate-y-1/2 rounded-md border color-swatch",
672
- be[a],
673
- Mt[a]
678
+ ae[a],
679
+ Bt[a]
674
680
  ),
675
- style: { backgroundColor: R }
681
+ style: { backgroundColor: k }
676
682
  }
677
683
  ),
678
684
  /* @__PURE__ */ e(
679
685
  "input",
680
686
  {
681
- ref: u,
682
- className: f(
687
+ ref: C,
688
+ className: m(
683
689
  "border input-base transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none",
684
- ne[a],
690
+ te[a],
685
691
  Y[a],
686
- Et[a],
687
- N ? fe[a] : ct[a],
692
+ Mt[a],
693
+ N ? fe[a] : it[a],
688
694
  r && "input-error"
689
695
  ),
690
- value: i ?? b,
691
- onChange: T,
692
- onFocus: B,
693
- onBlur: P,
694
- onClick: () => v(!0),
696
+ value: i ?? g,
697
+ onChange: O,
698
+ onFocus: P,
699
+ onBlur: L,
700
+ onClick: () => b(!0),
695
701
  ...h
696
702
  }
697
703
  ),
698
704
  /* @__PURE__ */ d(he, { children: [
699
- r && /* @__PURE__ */ e(re, {}),
700
- l
705
+ r && /* @__PURE__ */ e(ne, {}),
706
+ o
701
707
  ] }),
702
- /* @__PURE__ */ e(D, { open: m, children: /* @__PURE__ */ e(xe, { padding: "md", children: /* @__PURE__ */ e(hr, { value: I, onChange: z }) }) })
708
+ /* @__PURE__ */ e(D, { open: u, children: /* @__PURE__ */ e(ve, { padding: "md", children: /* @__PURE__ */ e(pr, { value: v, onChange: T }) }) })
703
709
  ] }),
704
- /* @__PURE__ */ e(V, { children: s }),
710
+ /* @__PURE__ */ e(V, { children: l }),
705
711
  /* @__PURE__ */ e(K, { children: r })
706
712
  ]
707
713
  }
708
714
  ) });
709
- }, Z = (t) => {
715
+ }, Z = (n) => {
710
716
  const {
711
- onClick: n,
712
- Icon: o
713
- } = t;
717
+ onClick: t,
718
+ Icon: s
719
+ } = n;
714
720
  return /* @__PURE__ */ e(
715
721
  "div",
716
722
  {
717
- onClick: n,
718
- className: f(
723
+ onClick: t,
724
+ className: m(
719
725
  "h-6 w-6 select-none rounded-full p-0.5",
720
- n && "ring-0 transition-all duration-150 input-icon-button-interactive active:ring-2 cursor-pointer hover:ring-4 group pointer-events-auto"
726
+ t && "ring-0 transition-all duration-150 input-icon-button-interactive active:ring-2 cursor-pointer hover:ring-4 group pointer-events-auto"
721
727
  ),
722
- children: /* @__PURE__ */ e(o, { className: f("h-5 w-5 input-icon-button-icon", n && "group-active:scale-[0.8] transition-transform origin-center") })
728
+ children: /* @__PURE__ */ e(s, { className: m("h-5 w-5 input-icon-button-icon", t && "group-active:scale-[0.8] transition-transform origin-center") })
723
729
  }
724
730
  );
725
- }, xl = (t) => {
731
+ }, wl = (n) => {
726
732
  const {
727
- type: n = "password",
728
- enableShowPasswordToggle: o = !0,
729
- ...s
730
- } = t, [r, l] = W(!1);
733
+ type: t = "password",
734
+ enableShowPasswordToggle: s = !0,
735
+ ...l
736
+ } = n, [r, o] = W(!1);
731
737
  return /* @__PURE__ */ e(
732
- At,
738
+ Wt,
733
739
  {
734
- type: r ? "text" : n,
735
- buttonTray: o ? /* @__PURE__ */ e(Z, { Icon: r ? Vt : Kt, onClick: () => {
736
- l(!r);
740
+ type: r ? "text" : t,
741
+ buttonTray: s ? /* @__PURE__ */ e(Z, { Icon: r ? Gt : Jt, onClick: () => {
742
+ o(!r);
737
743
  } }) : void 0,
738
- ...s
744
+ ...l
739
745
  }
740
746
  );
741
- }, wl = (t) => {
747
+ }, Nl = (n) => {
742
748
  const {
743
- className: n,
744
- label: o,
745
- description: s,
749
+ className: t,
750
+ label: s,
751
+ description: l,
746
752
  error: r,
747
- size: l = "md",
753
+ size: o = "md",
748
754
  autogrow: a = !1,
749
755
  maxRows: i,
750
756
  ref: c,
751
- onChange: g,
752
- ...x
753
- } = t, w = C.useRef(null), h = C.useCallback(() => {
754
- const p = w.current;
757
+ onChange: f,
758
+ ...w
759
+ } = n, x = R.useRef(null), h = R.useCallback(() => {
760
+ const p = x.current;
755
761
  if (!p) return;
756
762
  p.style.height = "auto";
757
- let m = p.scrollHeight;
763
+ let u = p.scrollHeight;
758
764
  if (i) {
759
- const v = window.getComputedStyle(p), u = parseFloat(v.lineHeight), I = parseFloat(v.paddingTop), R = parseFloat(v.paddingBottom), y = parseFloat(v.borderTopWidth), D = parseFloat(v.borderBottomWidth), T = u * i + I + R + y + D;
760
- m = Math.min(p.scrollHeight, T);
765
+ const b = window.getComputedStyle(p), C = parseFloat(b.lineHeight), v = parseFloat(b.paddingTop), k = parseFloat(b.paddingBottom), I = parseFloat(b.borderTopWidth), D = parseFloat(b.borderBottomWidth), O = C * i + v + k + I + D;
766
+ u = Math.min(p.scrollHeight, O);
761
767
  }
762
- p.style.height = `${m}px`;
768
+ p.style.height = `${u}px`;
763
769
  }, [i]);
764
- C.useLayoutEffect(() => {
770
+ R.useLayoutEffect(() => {
765
771
  if (!a) {
766
- w.current && (w.current.style.height = "");
772
+ x.current && (x.current.style.height = "");
767
773
  return;
768
774
  }
769
775
  h();
770
- }, [a, h, t.value, t.defaultValue, l]);
771
- const b = (p) => {
772
- g?.(p), a && h();
776
+ }, [a, h, n.value, n.defaultValue, o]);
777
+ const g = (p) => {
778
+ f?.(p), a && h();
773
779
  };
774
- return /* @__PURE__ */ e(Q.Provider, { value: l, children: /* @__PURE__ */ d(
780
+ return /* @__PURE__ */ e(Q.Provider, { value: o, children: /* @__PURE__ */ d(
775
781
  "div",
776
782
  {
777
- className: f(
783
+ className: m(
778
784
  "flex flex-col",
779
- n
785
+ t
780
786
  ),
781
787
  children: [
782
- /* @__PURE__ */ e(q, { children: o }),
788
+ /* @__PURE__ */ e(q, { children: s }),
783
789
  /* @__PURE__ */ d("div", { className: "flex flex-col relative", children: [
784
790
  /* @__PURE__ */ e(
785
791
  "textarea",
786
792
  {
787
- ref: c ? hn([c, w]) : w,
788
- onChange: b,
789
- className: f(
793
+ ref: c ? pn([c, x]) : x,
794
+ onChange: g,
795
+ className: m(
790
796
  "py-2.5 border input-base transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none",
791
- Pt[l],
792
- Y[l],
793
- me[l],
794
- r ? fe[l] : ct[l],
797
+ Ft[o],
798
+ Y[o],
799
+ me[o],
800
+ r ? fe[o] : it[o],
795
801
  r && "input-error",
796
802
  a && (i ? "resize-none overflow-y-auto [scrollbar-width:none] [&::-webkit-scrollbar]:hidden" : "resize-none overflow-hidden")
797
803
  ),
798
- ...x
804
+ ...w
799
805
  }
800
806
  ),
801
- /* @__PURE__ */ e(he, { className: "top-3.5 translate-y-0", children: r && /* @__PURE__ */ e(re, {}) })
807
+ /* @__PURE__ */ e(he, { className: "top-3.5 translate-y-0", children: r && /* @__PURE__ */ e(ne, {}) })
802
808
  ] }),
803
- /* @__PURE__ */ e(V, { children: s }),
809
+ /* @__PURE__ */ e(V, { children: l }),
804
810
  /* @__PURE__ */ e(K, { children: r })
805
811
  ]
806
812
  }
807
813
  ) });
808
- }, Nl = (t) => {
814
+ }, yl = (n) => {
809
815
  const {
810
- className: n,
811
- label: o,
812
- description: s,
816
+ className: t,
817
+ label: s,
818
+ description: l,
813
819
  error: r,
814
- ...l
815
- } = t;
820
+ ...o
821
+ } = n;
816
822
  return /* @__PURE__ */ d(
817
823
  "div",
818
824
  {
819
- className: f(
825
+ className: m(
820
826
  "flex flex-col",
821
- n
827
+ t
822
828
  ),
823
829
  children: [
824
830
  /* @__PURE__ */ d("div", { className: "flex flex-row gap-3", children: [
@@ -827,33 +833,33 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
827
833
  {
828
834
  type: "radio",
829
835
  className: "h-6 w-6 shrink-0 rounded-full border check-base shadow-sm ring-0 hover:ring-4 focus:ring-4 ring-offset-0 focus:outline-0 transition-all duration-150",
830
- ...l
836
+ ...o
831
837
  }
832
838
  ),
833
- o && /* @__PURE__ */ e("label", { htmlFor: t.id, className: f(
839
+ s && /* @__PURE__ */ e("label", { htmlFor: n.id, className: m(
834
840
  "input-label font-medium mb-1",
835
- t.id && "cursor-pointer"
836
- ), children: o })
841
+ n.id && "cursor-pointer"
842
+ ), children: s })
837
843
  ] }),
838
- /* @__PURE__ */ e(V, { children: s }),
844
+ /* @__PURE__ */ e(V, { children: l }),
839
845
  /* @__PURE__ */ e(K, { children: r })
840
846
  ]
841
847
  }
842
848
  );
843
- }, kl = (t) => {
849
+ }, kl = (n) => {
844
850
  const {
845
- className: n,
846
- label: o,
847
- description: s,
851
+ className: t,
852
+ label: s,
853
+ description: l,
848
854
  error: r,
849
- ...l
850
- } = t;
855
+ ...o
856
+ } = n;
851
857
  return /* @__PURE__ */ d(
852
858
  "div",
853
859
  {
854
- className: f(
860
+ className: m(
855
861
  "flex flex-col",
856
- n
862
+ t
857
863
  ),
858
864
  children: [
859
865
  /* @__PURE__ */ d("div", { className: "flex flex-row gap-3", children: [
@@ -863,41 +869,41 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
863
869
  {
864
870
  type: "checkbox",
865
871
  className: "appearance-none absolute inset-0 h-6 w-10 rounded-full checked:bg-transparent border-0 toggle-input ring-0 hover:ring-4 focus:ring-4 ring-offset-0 focus:outline-0 transition-all duration-150",
866
- ...l
872
+ ...o
867
873
  }
868
874
  ),
869
- /* @__PURE__ */ e("div", { className: f(
875
+ /* @__PURE__ */ e("div", { className: m(
870
876
  "rounded-full absolute border inset-0 pointer-events-none transition-colors duration-150 ",
871
- t.checked ? "toggle-track-on" : "toggle-track-off"
872
- ), children: /* @__PURE__ */ e("div", { className: f(
877
+ n.checked ? "toggle-track-on" : "toggle-track-off"
878
+ ), children: /* @__PURE__ */ e("div", { className: m(
873
879
  "absolute top-1/2 -translate-y-1/2 left-1 h-4 w-4 rounded-full toggle-thumb shadow-md transition-all duration-150",
874
- t.checked && "translate-x-3.5 "
880
+ n.checked && "translate-x-3.5 "
875
881
  ) }) })
876
882
  ] }),
877
- o && /* @__PURE__ */ e("label", { htmlFor: t.id, className: f(
883
+ s && /* @__PURE__ */ e("label", { htmlFor: n.id, className: m(
878
884
  "input-label font-medium mb-1",
879
- t.id && "cursor-pointer"
880
- ), children: o })
885
+ n.id && "cursor-pointer"
886
+ ), children: s })
881
887
  ] }),
882
- /* @__PURE__ */ e(V, { children: s }),
888
+ /* @__PURE__ */ e(V, { children: l }),
883
889
  /* @__PURE__ */ e(K, { children: r })
884
890
  ]
885
891
  }
886
892
  );
887
- }, yl = (t) => {
893
+ }, Cl = (n) => {
888
894
  const {
889
- className: n,
890
- label: o,
891
- description: s,
895
+ className: t,
896
+ label: s,
897
+ description: l,
892
898
  error: r,
893
- ...l
894
- } = t;
899
+ ...o
900
+ } = n;
895
901
  return /* @__PURE__ */ d(
896
902
  "div",
897
903
  {
898
- className: f(
904
+ className: m(
899
905
  "flex flex-col",
900
- n
906
+ t
901
907
  ),
902
908
  children: [
903
909
  /* @__PURE__ */ d("div", { className: "flex flex-row gap-3", children: [
@@ -906,144 +912,144 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
906
912
  {
907
913
  type: "checkbox",
908
914
  className: "h-6 w-6 shrink-0 rounded-lg border check-base shadow-sm ring-0 hover:ring-4 focus:ring-4 ring-offset-0 focus:outline-0 transition-all duration-150",
909
- ...l
915
+ ...o
910
916
  }
911
917
  ),
912
- o && /* @__PURE__ */ e("label", { htmlFor: t.id, className: f(
918
+ s && /* @__PURE__ */ e("label", { htmlFor: n.id, className: m(
913
919
  "input-label font-medium mb-1",
914
- t.id && "cursor-pointer"
915
- ), children: o })
920
+ n.id && "cursor-pointer"
921
+ ), children: s })
916
922
  ] }),
917
- /* @__PURE__ */ e(V, { children: s }),
923
+ /* @__PURE__ */ e(V, { children: l }),
918
924
  /* @__PURE__ */ e(K, { children: r })
919
925
  ]
920
926
  }
921
927
  );
922
- }, pr = {
928
+ }, gr = {
923
929
  sm: "h-7",
924
930
  md: "h-8",
925
931
  lg: "h-10"
926
- }, gr = {
932
+ }, br = {
927
933
  sm: "px-2.5",
928
934
  md: "px-3",
929
935
  lg: "px-4"
930
- }, br = {
936
+ }, vr = {
931
937
  sm: "text-xs",
932
938
  md: "text-sm",
933
939
  lg: "text-sm"
934
- }, Cl = (t) => {
940
+ }, Il = (n) => {
935
941
  const {
936
- label: n,
937
- description: o,
938
- error: s,
942
+ label: t,
943
+ description: s,
944
+ error: l,
939
945
  placeholder: r = "No file chosen",
940
- buttonText: l = "Choose",
941
- Icon: a = Gt,
946
+ buttonText: o = "Choose",
947
+ Icon: a = Yt,
942
948
  size: i = "md",
943
949
  value: c,
944
- isUploaded: g = !1,
945
- isUploading: x = !1,
946
- onChange: w,
950
+ isUploaded: f = !1,
951
+ isUploading: w = !1,
952
+ onChange: x,
947
953
  onDropRejected: h,
948
- accept: b,
954
+ accept: g,
949
955
  maxSize: p,
950
- minSize: m,
951
- disabled: v = !1,
952
- className: u
953
- } = t, I = async (z) => {
954
- const [N] = z;
955
- N && await w?.(N);
956
+ minSize: u,
957
+ disabled: b = !1,
958
+ className: C
959
+ } = n, v = async (T) => {
960
+ const [N] = T;
961
+ N && await x?.(N);
956
962
  }, {
957
- getRootProps: R,
958
- getInputProps: y,
963
+ getRootProps: k,
964
+ getInputProps: I,
959
965
  open: D,
960
- isDragActive: T,
961
- isFocused: B
962
- } = Dt({
966
+ isDragActive: O,
967
+ isFocused: P
968
+ } = zt({
963
969
  multiple: !1,
964
- accept: b,
970
+ accept: g,
965
971
  maxSize: p,
966
- minSize: m,
967
- disabled: v,
968
- onDrop: I,
972
+ minSize: u,
973
+ disabled: b,
974
+ onDrop: v,
969
975
  onDropRejected: h
970
- }), P = c?.name;
971
- return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className: f("flex flex-col", u), children: [
972
- /* @__PURE__ */ e(q, { children: n }),
976
+ }), L = c?.name;
977
+ return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className: m("flex flex-col", C), children: [
978
+ /* @__PURE__ */ e(q, { children: t }),
973
979
  /* @__PURE__ */ d(
974
980
  "div",
975
981
  {
976
- ...R({
977
- className: f(
982
+ ...k({
983
+ className: m(
978
984
  "flex flex-row items-center",
979
985
  "border input-base rounded-xl shadow-sm transition-all duration-150",
980
986
  "ring-0 focus:outline-none",
981
- (B || T) && "ring-4",
982
- s && "input-error",
983
- v && "opacity-60 cursor-not-allowed",
984
- ne[i],
987
+ (P || O) && "ring-4",
988
+ l && "input-error",
989
+ b && "opacity-60 cursor-not-allowed",
990
+ te[i],
985
991
  me[i],
986
992
  "gap-3"
987
993
  )
988
994
  }),
989
995
  children: [
990
- /* @__PURE__ */ e("input", { ...y() }),
991
- /* @__PURE__ */ e(a, { className: f("input-icon shrink-0", be[i]) }),
996
+ /* @__PURE__ */ e("input", { ...I() }),
997
+ /* @__PURE__ */ e(a, { className: m("input-icon shrink-0", ae[i]) }),
992
998
  /* @__PURE__ */ e(
993
999
  "span",
994
1000
  {
995
- className: f(
1001
+ className: m(
996
1002
  "flex-1 truncate",
997
1003
  Y[i],
998
- !P && "text-[var(--color-input-placeholder)]"
1004
+ !L && "text-[var(--color-input-placeholder)]"
999
1005
  ),
1000
- children: P ?? r
1006
+ children: L ?? r
1001
1007
  }
1002
1008
  ),
1003
- s && /* @__PURE__ */ e(re, {}),
1004
- x && !s && /* @__PURE__ */ e("div", { className: "h-5 w-5 flex items-center justify-center", children: /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-icon)]" }) }),
1005
- g && !x && !s && /* @__PURE__ */ e("div", { className: "h-5 w-5", children: /* @__PURE__ */ e(tt, { className: "h-5 w-5 text-[var(--color-status-success)]" }) }),
1009
+ l && /* @__PURE__ */ e(ne, {}),
1010
+ w && !l && /* @__PURE__ */ e("div", { className: "h-5 w-5 flex items-center justify-center", children: /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-icon)]" }) }),
1011
+ f && !w && !l && /* @__PURE__ */ e("div", { className: "h-5 w-5", children: /* @__PURE__ */ e(tt, { className: "h-5 w-5 text-[var(--color-status-success)]" }) }),
1006
1012
  /* @__PURE__ */ e(
1007
1013
  "button",
1008
1014
  {
1009
1015
  type: "button",
1010
- disabled: v,
1011
- onClick: (z) => {
1012
- z.stopPropagation(), D();
1016
+ disabled: b,
1017
+ onClick: (T) => {
1018
+ T.stopPropagation(), D();
1013
1019
  },
1014
- className: f(
1020
+ className: m(
1015
1021
  "inline-flex flex-row items-center justify-center shrink-0",
1016
1022
  "border button-white shadow-sm rounded-[calc(var(--border-radius-input)-0.25rem)]",
1017
1023
  "font-semibold cursor-pointer select-none transition-all duration-150",
1018
1024
  "button-ring ring-0 hover:ring-4 active:ring-1 focus:outline-none focus:ring-4",
1019
1025
  "disabled:cursor-default",
1020
1026
  "mr-1.5",
1021
- pr[i],
1022
1027
  gr[i],
1023
- br[i]
1028
+ br[i],
1029
+ vr[i]
1024
1030
  ),
1025
- children: l
1031
+ children: o
1026
1032
  }
1027
1033
  )
1028
1034
  ]
1029
1035
  }
1030
1036
  ),
1031
- /* @__PURE__ */ e(V, { children: o }),
1032
- /* @__PURE__ */ e(K, { children: s })
1037
+ /* @__PURE__ */ e(V, { children: s }),
1038
+ /* @__PURE__ */ e(K, { children: l })
1033
1039
  ] }) });
1034
- }, vr = (t) => t < 1024 ? `${t} B` : t < 1024 * 1024 ? `${(t / 1024).toFixed(1)} KB` : t < 1024 * 1024 * 1024 ? `${(t / (1024 * 1024)).toFixed(1)} MB` : `${(t / (1024 * 1024 * 1024)).toFixed(1)} GB`, xr = (t) => {
1040
+ }, xr = (n) => n < 1024 ? `${n} B` : n < 1024 * 1024 ? `${(n / 1024).toFixed(1)} KB` : n < 1024 * 1024 * 1024 ? `${(n / (1024 * 1024)).toFixed(1)} MB` : `${(n / (1024 * 1024 * 1024)).toFixed(1)} GB`, wr = (n) => {
1035
1041
  const {
1036
- file: n,
1037
- isUploaded: o = !1,
1038
- isUploading: s = !1,
1042
+ file: t,
1043
+ isUploaded: s = !1,
1044
+ isUploading: l = !1,
1039
1045
  error: r,
1040
- onRemove: l,
1046
+ onRemove: o,
1041
1047
  className: a
1042
- } = t, i = s || o || !!r;
1048
+ } = n, i = l || s || !!r;
1043
1049
  return /* @__PURE__ */ d(
1044
1050
  "div",
1045
1051
  {
1046
- className: f(
1052
+ className: m(
1047
1053
  "flex flex-row items-center gap-3",
1048
1054
  "border input-base rounded-xl shadow-sm",
1049
1055
  "pl-4 pr-1 py-1",
@@ -1051,16 +1057,16 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1051
1057
  a
1052
1058
  ),
1053
1059
  children: [
1054
- i && /* @__PURE__ */ e("div", { className: "shrink-0 h-5 w-5 flex items-center justify-center", children: r ? /* @__PURE__ */ e(et, { className: "h-5 w-5 input-error-icon" }) : s ? /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-icon)]" }) : /* @__PURE__ */ e(tt, { className: "h-5 w-5 text-[var(--color-status-success)]" }) }),
1055
- /* @__PURE__ */ e("div", { className: "flex-1 min-w-0 font-medium truncate", children: n.name }),
1056
- /* @__PURE__ */ e("div", { className: "shrink-0 text-sm text-[var(--color-input-description-text)]", children: vr(n.size) }),
1057
- l && /* @__PURE__ */ e(
1060
+ i && /* @__PURE__ */ e("div", { className: "shrink-0 h-5 w-5 flex items-center justify-center", children: r ? /* @__PURE__ */ e(et, { className: "h-5 w-5 input-error-icon" }) : l ? /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-icon)]" }) : /* @__PURE__ */ e(tt, { className: "h-5 w-5 text-[var(--color-status-success)]" }) }),
1061
+ /* @__PURE__ */ e("div", { className: "flex-1 min-w-0 font-medium truncate", children: t.name }),
1062
+ /* @__PURE__ */ e("div", { className: "shrink-0 text-sm text-[var(--color-input-description-text)]", children: xr(t.size) }),
1063
+ o && /* @__PURE__ */ e(
1058
1064
  qe,
1059
1065
  {
1060
1066
  variant: "transparent",
1061
1067
  size: "sm",
1062
1068
  Icon: de,
1063
- onClick: l,
1069
+ onClick: o,
1064
1070
  "aria-label": "Remove file",
1065
1071
  className: "shrink-0"
1066
1072
  }
@@ -1068,103 +1074,103 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1068
1074
  ]
1069
1075
  }
1070
1076
  );
1071
- }, Il = (t) => {
1077
+ }, Rl = (n) => {
1072
1078
  const {
1073
- label: n,
1074
- description: o,
1075
- error: s,
1079
+ label: t,
1080
+ description: s,
1081
+ error: l,
1076
1082
  title: r = "Drop files here",
1077
- hint: l,
1078
- Icon: a = Jt,
1083
+ hint: o,
1084
+ Icon: a = qt,
1079
1085
  onUpload: i,
1080
1086
  onFileRemoved: c,
1081
- onDropRejected: g,
1082
- renderFileTile: x,
1083
- accept: w,
1087
+ onDropRejected: f,
1088
+ renderFileTile: w,
1089
+ accept: x,
1084
1090
  maxSize: h,
1085
- minSize: b,
1091
+ minSize: g,
1086
1092
  maxFiles: p,
1087
- disabled: m = !1,
1088
- className: v
1089
- } = t, [u, I] = W([]), R = Ce(0), y = (k, A) => {
1090
- I((O) => O.map(($) => $.id === k ? { ...$, ...A } : $));
1091
- }, D = (k) => {
1092
- if (k.length === 0) return;
1093
- const A = k.map((O) => ({
1094
- id: String(++R.current),
1095
- file: O,
1093
+ disabled: u = !1,
1094
+ className: b
1095
+ } = n, [C, v] = W([]), k = Ce(0), I = (y, A) => {
1096
+ v((z) => z.map(($) => $.id === y ? { ...$, ...A } : $));
1097
+ }, D = (y) => {
1098
+ if (y.length === 0) return;
1099
+ const A = y.map((z) => ({
1100
+ id: String(++k.current),
1101
+ file: z,
1096
1102
  status: i ? "uploading" : "idle"
1097
1103
  }));
1098
- if (I((O) => [...O, ...A]), !!i)
1099
- for (const O of A)
1100
- Promise.resolve().then(() => i(O.file)).then(() => y(O.id, { status: "uploaded" })).catch(($) => {
1101
- y(O.id, {
1104
+ if (v((z) => [...z, ...A]), !!i)
1105
+ for (const z of A)
1106
+ Promise.resolve().then(() => i(z.file)).then(() => I(z.id, { status: "uploaded" })).catch(($) => {
1107
+ I(z.id, {
1102
1108
  status: "error",
1103
1109
  error: $ instanceof Error ? $ : new Error(String($))
1104
1110
  });
1105
1111
  });
1106
- }, T = (k) => {
1107
- const A = u.find((O) => O.id === k);
1108
- I((O) => O.filter(($) => $.id !== k)), A && c?.(A.file);
1112
+ }, O = (y) => {
1113
+ const A = C.find((z) => z.id === y);
1114
+ v((z) => z.filter(($) => $.id !== y)), A && c?.(A.file);
1109
1115
  }, {
1110
- getRootProps: B,
1111
- getInputProps: P,
1112
- isDragActive: z,
1116
+ getRootProps: P,
1117
+ getInputProps: L,
1118
+ isDragActive: T,
1113
1119
  isFocused: N
1114
- } = Dt({
1120
+ } = zt({
1115
1121
  multiple: !0,
1116
- accept: w,
1122
+ accept: x,
1117
1123
  maxSize: h,
1118
- minSize: b,
1124
+ minSize: g,
1119
1125
  maxFiles: p,
1120
- disabled: m,
1126
+ disabled: u,
1121
1127
  onDrop: D,
1122
- onDropRejected: g
1128
+ onDropRejected: f
1123
1129
  });
1124
- return /* @__PURE__ */ d("div", { className: f("flex flex-col", v), children: [
1125
- /* @__PURE__ */ e(q, { children: n }),
1130
+ return /* @__PURE__ */ d("div", { className: m("flex flex-col", b), children: [
1131
+ /* @__PURE__ */ e(q, { children: t }),
1126
1132
  /* @__PURE__ */ d(
1127
1133
  "div",
1128
1134
  {
1129
- ...B({
1130
- className: f(
1135
+ ...P({
1136
+ className: m(
1131
1137
  "flex flex-col items-center justify-center gap-1",
1132
1138
  "border-2 border-dashed input-base rounded-xl bg-transparent!",
1133
1139
  "py-10 px-6 cursor-pointer transition-all duration-150",
1134
1140
  "ring-0 focus:outline-none",
1135
- (N || z) && "ring-4",
1136
- s && "input-error",
1137
- m && "opacity-60 cursor-not-allowed"
1141
+ (N || T) && "ring-4",
1142
+ l && "input-error",
1143
+ u && "opacity-60 cursor-not-allowed"
1138
1144
  )
1139
1145
  }),
1140
1146
  children: [
1141
- /* @__PURE__ */ e("input", { ...P() }),
1147
+ /* @__PURE__ */ e("input", { ...L() }),
1142
1148
  /* @__PURE__ */ e("div", { className: "h-14 w-14 rounded-xl flex items-center justify-center bg-[var(--color-input-file-icon-bg)] mb-2", children: /* @__PURE__ */ e(a, { className: "h-7 w-7 input-icon" }) }),
1143
1149
  /* @__PURE__ */ e("div", { className: "text-base font-semibold", children: r }),
1144
- l && /* @__PURE__ */ e("div", { className: "text-sm text-[var(--color-input-description-text)] ", children: l })
1150
+ o && /* @__PURE__ */ e("div", { className: "text-sm text-[var(--color-input-description-text)] ", children: o })
1145
1151
  ]
1146
1152
  }
1147
1153
  ),
1148
- u.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-col gap-2 mt-3", children: u.map((k) => {
1154
+ C.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-col gap-2 mt-3", children: C.map((y) => {
1149
1155
  const A = {
1150
- file: k.file,
1151
- isUploading: k.status === "uploading",
1152
- isUploaded: k.status === "uploaded",
1153
- error: k.status === "error" ? k.error?.message : void 0,
1154
- onRemove: () => T(k.id)
1156
+ file: y.file,
1157
+ isUploading: y.status === "uploading",
1158
+ isUploaded: y.status === "uploaded",
1159
+ error: y.status === "error" ? y.error?.message : void 0,
1160
+ onRemove: () => O(y.id)
1155
1161
  };
1156
- return /* @__PURE__ */ e(C.Fragment, { children: x ? x(k.file, A) : /* @__PURE__ */ e(xr, { ...A }) }, k.id);
1162
+ return /* @__PURE__ */ e(R.Fragment, { children: w ? w(y.file, A) : /* @__PURE__ */ e(wr, { ...A }) }, y.id);
1157
1163
  }) }),
1158
- /* @__PURE__ */ e(V, { children: o }),
1159
- /* @__PURE__ */ e(K, { children: s })
1164
+ /* @__PURE__ */ e(V, { children: s }),
1165
+ /* @__PURE__ */ e(K, { children: l })
1160
1166
  ] });
1161
- }, wr = [
1162
- Cn,
1167
+ }, Nr = [
1163
1168
  In,
1164
- Ot,
1165
- Dn,
1169
+ Rn,
1170
+ Tt,
1171
+ On,
1166
1172
  Ln
1167
- ], Nt = {
1173
+ ], wt = {
1168
1174
  paragraph: "lexical-paragraph",
1169
1175
  heading: {
1170
1176
  h1: "lexical-h1",
@@ -1187,7 +1193,7 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1187
1193
  italic: "lexical-italic",
1188
1194
  underline: "lexical-underline"
1189
1195
  }
1190
- }, Wt = {
1196
+ }, $t = {
1191
1197
  isBold: !1,
1192
1198
  isItalic: !1,
1193
1199
  isUnderline: !1,
@@ -1198,29 +1204,29 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1198
1204
  canUndo: !1,
1199
1205
  canRedo: !1
1200
1206
  }, Ae = Qe({
1201
- state: Wt,
1207
+ state: $t,
1202
1208
  tone: "light",
1203
1209
  orientation: "horizontal"
1204
- }), Ne = () => Ze(Ae), Ht = () => {
1205
- const [t] = ue(), [n, o] = W(Wt);
1210
+ }), we = () => Ze(Ae), _t = () => {
1211
+ const [n] = ue(), [t, s] = W($t);
1206
1212
  return _(() => {
1207
- const s = () => {
1208
- t.getEditorState().read(() => {
1209
- const r = zt();
1210
- if (!Tt(r))
1213
+ const l = () => {
1214
+ n.getEditorState().read(() => {
1215
+ const r = Pt();
1216
+ if (!Lt(r))
1211
1217
  return;
1212
- const l = r.anchor.getNode(), a = Wn(l, Ot), i = a && On(a) ? a.getListType() : null;
1218
+ const o = r.anchor.getNode(), a = Hn(o, Tt), i = a && zn(a) ? a.getListType() : null;
1213
1219
  let c = "paragraph";
1214
1220
  if (!i) {
1215
- const b = l.getKey() === "root" ? l : l.getTopLevelElementOrThrow();
1216
- Rn(b) && (c = b.getTag());
1221
+ const g = o.getKey() === "root" ? o : o.getTopLevelElementOrThrow();
1222
+ Sn(g) && (c = g.getTag());
1217
1223
  }
1218
- const g = r.hasFormat("bold"), x = r.hasFormat("italic"), w = r.hasFormat("underline"), h = gt(l.getParent()) || gt(l);
1219
- o((b) => ({
1220
- ...b,
1221
- isBold: g,
1222
- isItalic: x,
1223
- isUnderline: w,
1224
+ const f = r.hasFormat("bold"), w = r.hasFormat("italic"), x = r.hasFormat("underline"), h = pt(o.getParent()) || pt(o);
1225
+ s((g) => ({
1226
+ ...g,
1227
+ isBold: f,
1228
+ isItalic: w,
1229
+ isUnderline: x,
1224
1230
  isLink: h,
1225
1231
  isUnorderedList: i === "bullet",
1226
1232
  isOrderedList: i === "number",
@@ -1228,57 +1234,58 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1228
1234
  }));
1229
1235
  });
1230
1236
  };
1231
- return Lt(
1232
- t.registerUpdateListener(() => s()),
1233
- t.registerCommand(
1234
- Pn,
1235
- (r) => (o((l) => ({ ...l, canUndo: r })), !1),
1236
- Pe
1237
- ),
1238
- t.registerCommand(
1237
+ return Et(
1238
+ n.registerUpdateListener(() => l()),
1239
+ n.registerCommand(
1239
1240
  En,
1240
- (r) => (o((l) => ({ ...l, canRedo: r })), !1),
1241
- Pe
1241
+ (r) => (s((o) => ({ ...o, canUndo: r })), !1),
1242
+ Le
1243
+ ),
1244
+ n.registerCommand(
1245
+ Fn,
1246
+ (r) => (s((o) => ({ ...o, canRedo: r })), !1),
1247
+ Le
1242
1248
  )
1243
1249
  );
1244
- }, [t]), n;
1245
- }, $t = Qe(void 0), Nr = () => ({
1246
- dismiss: Ze($t) || (() => {
1250
+ }, [n]), t;
1251
+ }, jt = Qe(void 0), yr = () => ({
1252
+ dismiss: Ze(jt) || (() => {
1247
1253
  })
1248
- }), Ue = (t) => {
1249
- const { trigger: n, children: o, placement: s = "bottom-end", minWidth: r = 200, className: l } = t, [a, i] = W(!1), { Popover: c, anchorRef: g } = dt({
1250
- placement: s,
1251
- onOutsideClick: () => i(!1),
1254
+ }), Ue = (n) => {
1255
+ const { trigger: t, children: s, placement: l = "bottom-end", minWidth: r = 200, className: o } = n, [a, i] = W(!1), { Popover: c, anchorRef: f } = ct({
1256
+ placement: l,
1257
+ open: a,
1258
+ onOpenChange: i,
1252
1259
  minWidth: r
1253
1260
  });
1254
- return /* @__PURE__ */ d(te, { children: [
1255
- /* @__PURE__ */ e("div", { ref: g, className: l, onClick: () => i(!a), children: n }),
1256
- /* @__PURE__ */ e(c, { open: a, children: /* @__PURE__ */ e(xe, { padding: "sm", children: /* @__PURE__ */ e($t.Provider, { value: () => i(!1), children: o }) }) })
1261
+ return /* @__PURE__ */ d(ce, { children: [
1262
+ /* @__PURE__ */ e("div", { ref: f, className: o, onClick: () => i(!a), children: t }),
1263
+ /* @__PURE__ */ e(c, { open: a, children: /* @__PURE__ */ e(ve, { padding: "sm", children: /* @__PURE__ */ e(jt.Provider, { value: () => i(!1), children: s }) }) })
1257
1264
  ] });
1258
- }, kr = "inline-flex flex-row items-center gap-3 h-10 px-3 font-semibold ring-0 dropdown-item rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent", X = C.forwardRef((t, n) => {
1265
+ }, kr = "inline-flex flex-row items-center gap-3 h-10 px-3 font-semibold ring-0 dropdown-item rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent", X = R.forwardRef((n, t) => {
1259
1266
  const {
1260
- className: o,
1261
- children: s,
1267
+ className: s,
1268
+ children: l,
1262
1269
  Icon: r,
1263
- onClick: l,
1270
+ onClick: o,
1264
1271
  dismissOnClick: a = !0,
1265
1272
  ...i
1266
- } = t, { dismiss: c } = Nr(), g = (x) => {
1267
- l && l(x), a && c();
1273
+ } = n, { dismiss: c } = yr(), f = (w) => {
1274
+ o && o(w), a && c();
1268
1275
  };
1269
1276
  return /* @__PURE__ */ d(
1270
1277
  "button",
1271
1278
  {
1272
- ref: n,
1273
- className: f(
1279
+ ref: t,
1280
+ className: m(
1274
1281
  kr,
1275
- o
1282
+ s
1276
1283
  ),
1277
- onClick: g,
1284
+ onClick: f,
1278
1285
  ...i,
1279
1286
  children: [
1280
1287
  r && /* @__PURE__ */ e(r, { className: "h-5 w-5" }),
1281
- s
1288
+ l
1282
1289
  ]
1283
1290
  }
1284
1291
  );
@@ -1288,13 +1295,13 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1288
1295
  { value: "h2", label: "Heading 2" },
1289
1296
  { value: "h3", label: "Heading 3" },
1290
1297
  { value: "h4", label: "Heading 4" }
1291
- ], yr = () => {
1292
- const [t] = ue(), { state: n, tone: o } = Ne(), s = (l) => {
1293
- t.update(() => {
1294
- const a = zt();
1295
- Tt(a) && (l === "paragraph" ? vt(a, () => Mn()) : vt(a, () => Sn(l)));
1298
+ ], Cr = () => {
1299
+ const [n] = ue(), { state: t, tone: s } = we(), l = (o) => {
1300
+ n.update(() => {
1301
+ const a = Pt();
1302
+ Lt(a) && (o === "paragraph" ? bt(a, () => Mn()) : bt(a, () => Dn(o)));
1296
1303
  });
1297
- }, r = Ge.find((l) => l.value === n.blockType) ?? Ge[0];
1304
+ }, r = Ge.find((o) => o.value === t.blockType) ?? Ge[0];
1298
1305
  return /* @__PURE__ */ e(
1299
1306
  Ue,
1300
1307
  {
@@ -1304,216 +1311,216 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1304
1311
  "button",
1305
1312
  {
1306
1313
  type: "button",
1307
- onMouseDown: (l) => l.preventDefault(),
1308
- className: f(
1314
+ onMouseDown: (o) => o.preventDefault(),
1315
+ className: m(
1309
1316
  "lexical-tb-btn h-8 px-2 gap-1 text-sm font-medium",
1310
- o === "dark" ? "lexical-tb-btn-dark" : "lexical-tb-btn-light"
1317
+ s === "dark" ? "lexical-tb-btn-dark" : "lexical-tb-btn-light"
1311
1318
  ),
1312
1319
  children: [
1313
1320
  r.label,
1314
- /* @__PURE__ */ e(ve, { className: "h-4 w-4" })
1321
+ /* @__PURE__ */ e(be, { className: "h-4 w-4" })
1315
1322
  ]
1316
1323
  }
1317
1324
  ),
1318
- children: Ge.map((l) => /* @__PURE__ */ e(
1325
+ children: Ge.map((o) => /* @__PURE__ */ e(
1319
1326
  X,
1320
1327
  {
1321
- Icon: l.value === n.blockType ? St : void 0,
1322
- onClick: () => s(l.value),
1323
- className: l.value === n.blockType ? void 0 : "pl-11",
1324
- children: l.label
1328
+ Icon: o.value === t.blockType ? Rt : void 0,
1329
+ onClick: () => l(o.value),
1330
+ className: o.value === t.blockType ? void 0 : "pl-11",
1331
+ children: o.label
1325
1332
  },
1326
- l.value
1333
+ o.value
1327
1334
  ))
1328
1335
  }
1329
1336
  );
1330
- }, Cr = {
1337
+ }, Ir = {
1331
1338
  light: "lexical-tb-btn-light",
1332
1339
  dark: "lexical-tb-btn-dark"
1333
- }, ce = C.forwardRef(
1334
- (t, n) => {
1335
- const { Icon: o, active: s = !1, tone: r = "light", className: l, onMouseDown: a, ...i } = t;
1340
+ }, ie = R.forwardRef(
1341
+ (n, t) => {
1342
+ const { Icon: s, active: l = !1, tone: r = "light", className: o, onMouseDown: a, ...i } = n;
1336
1343
  return /* @__PURE__ */ e(
1337
1344
  "button",
1338
1345
  {
1339
- ref: n,
1346
+ ref: t,
1340
1347
  type: "button",
1341
- onMouseDown: (g) => {
1342
- g.preventDefault(), a?.(g);
1348
+ onMouseDown: (f) => {
1349
+ f.preventDefault(), a?.(f);
1343
1350
  },
1344
- className: f(
1351
+ className: m(
1345
1352
  "lexical-tb-btn h-8 w-8",
1346
- Cr[r],
1347
- s && "lexical-tb-btn-active",
1348
- l
1353
+ Ir[r],
1354
+ l && "lexical-tb-btn-active",
1355
+ o
1349
1356
  ),
1350
1357
  ...i,
1351
- children: /* @__PURE__ */ e(o, { className: "h-[18px] w-[18px]" })
1358
+ children: /* @__PURE__ */ e(s, { className: "h-[18px] w-[18px]" })
1352
1359
  }
1353
1360
  );
1354
1361
  }
1355
- ), Ir = () => {
1356
- const [t] = ue(), { state: n, tone: o } = Ne();
1357
- return /* @__PURE__ */ d(te, { children: [
1362
+ ), Rr = () => {
1363
+ const [n] = ue(), { state: t, tone: s } = we();
1364
+ return /* @__PURE__ */ d(ce, { children: [
1358
1365
  /* @__PURE__ */ e(
1359
- ce,
1366
+ ie,
1360
1367
  {
1361
- Icon: Yt,
1362
- tone: o,
1363
- active: n.isBold,
1368
+ Icon: Qt,
1369
+ tone: s,
1370
+ active: t.isBold,
1364
1371
  "aria-label": "Bold",
1365
- onClick: () => t.dispatchCommand(je, "bold")
1372
+ onClick: () => n.dispatchCommand(je, "bold")
1366
1373
  }
1367
1374
  ),
1368
1375
  /* @__PURE__ */ e(
1369
- ce,
1376
+ ie,
1370
1377
  {
1371
- Icon: qt,
1372
- tone: o,
1373
- active: n.isItalic,
1378
+ Icon: Zt,
1379
+ tone: s,
1380
+ active: t.isItalic,
1374
1381
  "aria-label": "Italic",
1375
- onClick: () => t.dispatchCommand(je, "italic")
1382
+ onClick: () => n.dispatchCommand(je, "italic")
1376
1383
  }
1377
1384
  ),
1378
1385
  /* @__PURE__ */ e(
1379
- ce,
1386
+ ie,
1380
1387
  {
1381
- Icon: Qt,
1382
- tone: o,
1383
- active: n.isUnderline,
1388
+ Icon: en,
1389
+ tone: s,
1390
+ active: t.isUnderline,
1384
1391
  "aria-label": "Underline",
1385
- onClick: () => t.dispatchCommand(je, "underline")
1392
+ onClick: () => n.dispatchCommand(je, "underline")
1386
1393
  }
1387
1394
  )
1388
1395
  ] });
1389
- }, Rr = () => {
1390
- const [t] = ue(), { state: n, tone: o } = Ne(), s = () => {
1391
- t.dispatchCommand(
1392
- n.isUnorderedList ? pt : zn,
1396
+ }, Sr = () => {
1397
+ const [n] = ue(), { state: t, tone: s } = we(), l = () => {
1398
+ n.dispatchCommand(
1399
+ t.isUnorderedList ? ht : Tn,
1393
1400
  void 0
1394
1401
  );
1395
1402
  }, r = () => {
1396
- t.dispatchCommand(
1397
- n.isOrderedList ? pt : Tn,
1403
+ n.dispatchCommand(
1404
+ t.isOrderedList ? ht : Pn,
1398
1405
  void 0
1399
1406
  );
1400
1407
  };
1401
- return /* @__PURE__ */ d(te, { children: [
1408
+ return /* @__PURE__ */ d(ce, { children: [
1402
1409
  /* @__PURE__ */ e(
1403
- ce,
1410
+ ie,
1404
1411
  {
1405
1412
  Icon: Ye,
1406
- tone: o,
1407
- active: n.isUnorderedList,
1413
+ tone: s,
1414
+ active: t.isUnorderedList,
1408
1415
  "aria-label": "Bullet list",
1409
- onClick: s
1416
+ onClick: l
1410
1417
  }
1411
1418
  ),
1412
1419
  /* @__PURE__ */ e(
1413
- ce,
1420
+ ie,
1414
1421
  {
1415
- Icon: Zt,
1416
- tone: o,
1417
- active: n.isOrderedList,
1422
+ Icon: tn,
1423
+ tone: s,
1424
+ active: t.isOrderedList,
1418
1425
  "aria-label": "Numbered list",
1419
1426
  onClick: r
1420
1427
  }
1421
1428
  )
1422
1429
  ] });
1423
- }, Sr = () => {
1424
- const [t] = ue(), { state: n, tone: o } = Ne(), s = () => {
1425
- if (n.isLink) {
1426
- t.dispatchCommand(bt, null);
1430
+ }, Dr = () => {
1431
+ const [n] = ue(), { state: t, tone: s } = we(), l = () => {
1432
+ if (t.isLink) {
1433
+ n.dispatchCommand(gt, null);
1427
1434
  return;
1428
1435
  }
1429
1436
  const r = window.prompt("Enter URL");
1430
- r && t.dispatchCommand(bt, r);
1437
+ r && n.dispatchCommand(gt, r);
1431
1438
  };
1432
1439
  return /* @__PURE__ */ e(
1433
- ce,
1440
+ ie,
1434
1441
  {
1435
- Icon: en,
1436
- tone: o,
1437
- active: n.isLink,
1442
+ Icon: nn,
1443
+ tone: s,
1444
+ active: t.isLink,
1438
1445
  "aria-label": "Link",
1439
- onClick: s
1446
+ onClick: l
1440
1447
  }
1441
1448
  );
1442
- }, Dr = () => {
1443
- const [t] = ue(), { state: n, tone: o } = Ne();
1444
- return /* @__PURE__ */ d(te, { children: [
1449
+ }, Or = () => {
1450
+ const [n] = ue(), { state: t, tone: s } = we();
1451
+ return /* @__PURE__ */ d(ce, { children: [
1445
1452
  /* @__PURE__ */ e(
1446
- ce,
1453
+ ie,
1447
1454
  {
1448
- Icon: tn,
1449
- tone: o,
1450
- disabled: !n.canUndo,
1455
+ Icon: rn,
1456
+ tone: s,
1457
+ disabled: !t.canUndo,
1451
1458
  "aria-label": "Undo",
1452
- onClick: () => t.dispatchCommand(Fn, void 0)
1459
+ onClick: () => n.dispatchCommand(Bn, void 0)
1453
1460
  }
1454
1461
  ),
1455
1462
  /* @__PURE__ */ e(
1456
- ce,
1463
+ ie,
1457
1464
  {
1458
- Icon: nn,
1459
- tone: o,
1460
- disabled: !n.canRedo,
1465
+ Icon: ln,
1466
+ tone: s,
1467
+ disabled: !t.canRedo,
1461
1468
  "aria-label": "Redo",
1462
- onClick: () => t.dispatchCommand(Bn, void 0)
1469
+ onClick: () => n.dispatchCommand(An, void 0)
1463
1470
  }
1464
1471
  )
1465
1472
  ] });
1466
- }, Or = {
1473
+ }, zr = {
1467
1474
  light: "lexical-tb-divider-light",
1468
1475
  dark: "lexical-tb-divider-dark"
1469
- }, Je = (t) => {
1470
- const { tone: n, className: o } = t, { tone: s, orientation: r } = Ne();
1476
+ }, Je = (n) => {
1477
+ const { tone: t, className: s } = n, { tone: l, orientation: r } = we();
1471
1478
  return /* @__PURE__ */ e(
1472
1479
  "div",
1473
1480
  {
1474
- className: f(
1481
+ className: m(
1475
1482
  r === "vertical" ? "h-px w-full my-1" : "w-px h-5 my-auto mx-1",
1476
1483
  "shrink-0",
1477
- Or[n ?? s],
1478
- o
1484
+ zr[t ?? l],
1485
+ s
1479
1486
  )
1480
1487
  }
1481
1488
  );
1482
- }, kt = 4, zr = 36, _t = (t) => {
1483
- const n = [];
1484
- return C.Children.forEach(t, (o) => {
1485
- C.isValidElement(o) && o.type === C.Fragment ? n.push(..._t(o.props.children)) : n.push(o);
1486
- }), n;
1487
- }, jt = (t) => {
1488
- const { children: n } = t, { state: o, tone: s } = Ne(), r = _t(n), l = Ce(null), a = Ce(null), [i, c] = W(r.length), g = Le(() => {
1489
- const h = l.current, b = a.current;
1490
- if (!h || !b) return;
1491
- const p = h.clientWidth, m = Array.from(b.children).map((R) => R.offsetWidth);
1492
- if (m.reduce((R, y, D) => R + y + (D > 0 ? kt : 0), 0) <= p) {
1493
- c(m.length);
1489
+ }, Nt = 4, Tr = 36, Xt = (n) => {
1490
+ const t = [];
1491
+ return R.Children.forEach(n, (s) => {
1492
+ R.isValidElement(s) && s.type === R.Fragment ? t.push(...Xt(s.props.children)) : t.push(s);
1493
+ }), t;
1494
+ }, Vt = (n) => {
1495
+ const { children: t } = n, { state: s, tone: l } = we(), r = Xt(t), o = Ce(null), a = Ce(null), [i, c] = W(r.length), f = Pe(() => {
1496
+ const h = o.current, g = a.current;
1497
+ if (!h || !g) return;
1498
+ const p = h.clientWidth, u = Array.from(g.children).map((k) => k.offsetWidth);
1499
+ if (u.reduce((k, I, D) => k + I + (D > 0 ? Nt : 0), 0) <= p) {
1500
+ c(u.length);
1494
1501
  return;
1495
1502
  }
1496
- let u = 0, I = 0;
1497
- for (let R = 0; R < m.length; R++) {
1498
- const y = m[R] + (R > 0 ? kt : 0);
1499
- if (u + y + zr > p) break;
1500
- u += y, I++;
1503
+ let C = 0, v = 0;
1504
+ for (let k = 0; k < u.length; k++) {
1505
+ const I = u[k] + (k > 0 ? Nt : 0);
1506
+ if (C + I + Tr > p) break;
1507
+ C += I, v++;
1501
1508
  }
1502
- c(I);
1509
+ c(v);
1503
1510
  }, []);
1504
- Rt(() => {
1505
- g();
1511
+ It(() => {
1512
+ f();
1506
1513
  }), _(() => {
1507
- const h = l.current, b = a.current;
1514
+ const h = o.current, g = a.current;
1508
1515
  if (!h) return;
1509
- const p = new ResizeObserver(() => g());
1510
- return p.observe(h), b && p.observe(b), () => p.disconnect();
1511
- }, [g]);
1512
- const x = r.slice(0, i), w = r.slice(i);
1516
+ const p = new ResizeObserver(() => f());
1517
+ return p.observe(h), g && p.observe(g), () => p.disconnect();
1518
+ }, [f]);
1519
+ const w = r.slice(0, i), x = r.slice(i);
1513
1520
  return /* @__PURE__ */ d(
1514
1521
  "div",
1515
1522
  {
1516
- ref: l,
1523
+ ref: o,
1517
1524
  className: "relative flex flex-row items-center gap-1 min-w-0 flex-1",
1518
1525
  children: [
1519
1526
  /* @__PURE__ */ e(
@@ -1522,11 +1529,11 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1522
1529
  ref: a,
1523
1530
  "aria-hidden": !0,
1524
1531
  className: "pointer-events-none invisible absolute left-0 top-0 flex flex-row items-center gap-1 w-max",
1525
- children: r.map((h, b) => /* @__PURE__ */ e("div", { className: "flex flex-row items-center", children: h }, b))
1532
+ children: r.map((h, g) => /* @__PURE__ */ e("div", { className: "flex flex-row items-center", children: h }, g))
1526
1533
  }
1527
1534
  ),
1528
- x.map((h, b) => /* @__PURE__ */ e(C.Fragment, { children: h }, b)),
1529
- w.length > 0 && /* @__PURE__ */ e(
1535
+ w.map((h, g) => /* @__PURE__ */ e(R.Fragment, { children: h }, g)),
1536
+ x.length > 0 && /* @__PURE__ */ e(
1530
1537
  Ue,
1531
1538
  {
1532
1539
  placement: "bottom-end",
@@ -1537,19 +1544,19 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1537
1544
  type: "button",
1538
1545
  "aria-label": "More",
1539
1546
  onMouseDown: (h) => h.preventDefault(),
1540
- className: f(
1547
+ className: m(
1541
1548
  "lexical-tb-btn h-8 w-8 shrink-0",
1542
- s === "dark" ? "lexical-tb-btn-dark" : "lexical-tb-btn-light"
1549
+ l === "dark" ? "lexical-tb-btn-dark" : "lexical-tb-btn-light"
1543
1550
  ),
1544
- children: /* @__PURE__ */ e(rn, { className: "h-[18px] w-[18px]" })
1551
+ children: /* @__PURE__ */ e(on, { className: "h-[18px] w-[18px]" })
1545
1552
  }
1546
1553
  ),
1547
- children: /* @__PURE__ */ e(Ae.Provider, { value: { state: o, tone: "light", orientation: "vertical" }, children: /* @__PURE__ */ e(
1554
+ children: /* @__PURE__ */ e(Ae.Provider, { value: { state: s, tone: "light", orientation: "vertical" }, children: /* @__PURE__ */ e(
1548
1555
  "div",
1549
1556
  {
1550
1557
  className: "flex flex-col items-stretch gap-1",
1551
1558
  onMouseDown: (h) => h.preventDefault(),
1552
- children: w.map((h, b) => /* @__PURE__ */ e(C.Fragment, { children: h }, b))
1559
+ children: x.map((h, g) => /* @__PURE__ */ e(R.Fragment, { children: h }, g))
1553
1560
  }
1554
1561
  ) })
1555
1562
  }
@@ -1557,55 +1564,55 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1557
1564
  ]
1558
1565
  }
1559
1566
  );
1560
- }, ut = () => /* @__PURE__ */ d(te, { children: [
1561
- /* @__PURE__ */ e(yr, {}),
1562
- /* @__PURE__ */ e(Je, {}),
1563
- /* @__PURE__ */ e(Ir, {}),
1567
+ }, dt = () => /* @__PURE__ */ d(ce, { children: [
1568
+ /* @__PURE__ */ e(Cr, {}),
1564
1569
  /* @__PURE__ */ e(Je, {}),
1565
1570
  /* @__PURE__ */ e(Rr, {}),
1571
+ /* @__PURE__ */ e(Je, {}),
1566
1572
  /* @__PURE__ */ e(Sr, {}),
1573
+ /* @__PURE__ */ e(Dr, {}),
1567
1574
  /* @__PURE__ */ e(Je, {}),
1568
- /* @__PURE__ */ e(Dr, {})
1569
- ] }), Rl = () => ut(), Tr = (t) => {
1570
- const { render: n, className: o } = t, [s] = ue(), r = Ht();
1575
+ /* @__PURE__ */ e(Or, {})
1576
+ ] }), Sl = () => dt(), Pr = (n) => {
1577
+ const { render: t, className: s } = n, [l] = ue(), r = _t();
1571
1578
  return /* @__PURE__ */ e(Ae.Provider, { value: { state: r, tone: "light" }, children: /* @__PURE__ */ e(
1572
1579
  "div",
1573
1580
  {
1574
- className: f(
1581
+ className: m(
1575
1582
  "lexical-toolbar flex flex-row items-center p-1.5",
1576
- o
1583
+ s
1577
1584
  ),
1578
- children: /* @__PURE__ */ e(jt, { children: n ? n({ editor: s, state: r, tone: "light" }) : ut() })
1585
+ children: /* @__PURE__ */ e(Vt, { children: t ? t({ editor: l, state: r, tone: "light" }) : dt() })
1579
1586
  }
1580
1587
  ) });
1581
- }, Lr = (t) => {
1582
- const { render: n } = t, [o] = ue(), s = Ht(), [r, l] = W(!1), { refs: a, floatingStyles: i } = at({
1588
+ }, Lr = (n) => {
1589
+ const { render: t } = n, [s] = ue(), l = _t(), [r, o] = W(!1), { refs: a, floatingStyles: i } = st({
1583
1590
  placement: "top-start",
1584
1591
  strategy: "fixed",
1585
1592
  middleware: [
1586
- un(8),
1587
- lt(),
1588
- ot({ padding: 8 }),
1589
- st({
1590
- apply({ rects: c, elements: g }) {
1591
- g.floating.style.width = `${c.reference.width}px`;
1593
+ fn(8),
1594
+ rt(),
1595
+ lt({ padding: 8 }),
1596
+ ot({
1597
+ apply({ rects: c, elements: f }) {
1598
+ f.floating.style.width = `${c.reference.width}px`;
1592
1599
  }
1593
1600
  })
1594
1601
  ],
1595
- whileElementsMounted: it
1602
+ whileElementsMounted: at
1596
1603
  });
1597
- return _(() => o.registerRootListener((c) => a.setReference(c ?? null)), [o, a]), _(() => Lt(
1598
- o.registerCommand(
1599
- An,
1600
- () => (l(!0), !1),
1601
- Pe
1602
- ),
1603
- o.registerCommand(
1604
+ return _(() => s.registerRootListener((c) => a.setReference(c ?? null)), [s, a]), _(() => Et(
1605
+ s.registerCommand(
1604
1606
  Un,
1605
- () => (l(!1), !1),
1606
- Pe
1607
+ () => (o(!0), !1),
1608
+ Le
1609
+ ),
1610
+ s.registerCommand(
1611
+ Wn,
1612
+ () => (o(!1), !1),
1613
+ Le
1607
1614
  )
1608
- ), [o]), /* @__PURE__ */ e(Ae.Provider, { value: { state: s, tone: "dark" }, children: /* @__PURE__ */ e(Fe, { children: /* @__PURE__ */ e(De, { children: r && /* @__PURE__ */ e("div", { ref: a.setFloating, style: i, className: "z-50", children: /* @__PURE__ */ e(
1615
+ ), [s]), /* @__PURE__ */ e(Ae.Provider, { value: { state: l, tone: "dark" }, children: /* @__PURE__ */ e(Me, { children: /* @__PURE__ */ e(De, { children: r && /* @__PURE__ */ e("div", { ref: a.setFloating, style: i, className: "z-50", children: /* @__PURE__ */ e(
1609
1616
  J.div,
1610
1617
  {
1611
1618
  className: "lexical-floating-toolbar flex w-full flex-row items-center p-1 rounded-xl",
@@ -1613,75 +1620,75 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1613
1620
  animate: { opacity: 1, y: 0 },
1614
1621
  exit: { opacity: 0, y: 4 },
1615
1622
  transition: { duration: 0.1, ease: "easeInOut" },
1616
- children: /* @__PURE__ */ e(jt, { children: n ? n({ editor: o, state: s, tone: "dark" }) : ut() })
1623
+ children: /* @__PURE__ */ e(Vt, { children: t ? t({ editor: s, state: l, tone: "dark" }) : dt() })
1617
1624
  }
1618
1625
  ) }) }) }) });
1619
- }, Sl = (t) => {
1626
+ }, Dl = (n) => {
1620
1627
  const {
1621
- label: n,
1622
- description: o,
1623
- error: s,
1628
+ label: t,
1629
+ description: s,
1630
+ error: l,
1624
1631
  placeholder: r,
1625
- value: l,
1632
+ value: o,
1626
1633
  onChange: a,
1627
1634
  size: i = "md",
1628
1635
  toolbar: c = "static",
1629
- renderToolbar: g,
1630
- minRows: x = 4,
1631
- maxRows: w,
1636
+ renderToolbar: f,
1637
+ minRows: w = 4,
1638
+ maxRows: x,
1632
1639
  autogrow: h = !1,
1633
- namespace: b = "InputLexical",
1640
+ namespace: g = "InputLexical",
1634
1641
  nodes: p,
1635
- theme: m,
1636
- autoFocus: v = !1,
1637
- children: u,
1638
- className: I
1639
- } = t, R = ie(
1642
+ theme: u,
1643
+ autoFocus: b = !1,
1644
+ children: C,
1645
+ className: v
1646
+ } = n, k = se(
1640
1647
  () => ({
1641
- namespace: b,
1642
- theme: m ? { ...Nt, ...m } : Nt,
1643
- nodes: [...wr, ...p ?? []],
1644
- editorState: l ?? null,
1645
- onError: (z) => {
1646
- throw z;
1648
+ namespace: g,
1649
+ theme: u ? { ...wt, ...u } : wt,
1650
+ nodes: [...Nr, ...p ?? []],
1651
+ editorState: o ?? null,
1652
+ onError: (T) => {
1653
+ throw T;
1647
1654
  }
1648
1655
  }),
1649
1656
  // Lexical reads initialConfig once on mount; later prop changes are ignored by design.
1650
1657
  // eslint-disable-next-line react-hooks/exhaustive-deps
1651
1658
  []
1652
- ), y = Le(
1653
- (z) => {
1654
- a?.(JSON.stringify(z.toJSON()));
1659
+ ), I = Pe(
1660
+ (T) => {
1661
+ a?.(JSON.stringify(T.toJSON()));
1655
1662
  },
1656
1663
  [a]
1657
- ), D = Y[i], T = !!s, B = (z) => `calc(${z} * 1lh + 1.5rem)`, P = h ? { minHeight: B(x), maxHeight: w ? B(w) : void 0 } : { height: B(x) };
1658
- return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className: f("flex flex-col", I), children: [
1659
- /* @__PURE__ */ e(q, { children: n }),
1660
- /* @__PURE__ */ e(pn, { initialConfig: R, children: /* @__PURE__ */ d(
1664
+ ), D = Y[i], O = !!l, P = (T) => `calc(${T} * 1lh + 1.5rem)`, L = h ? { minHeight: P(w), maxHeight: x ? P(x) : void 0 } : { height: P(w) };
1665
+ return /* @__PURE__ */ e(Q.Provider, { value: i, children: /* @__PURE__ */ d("div", { className: m("flex flex-col", v), children: [
1666
+ /* @__PURE__ */ e(q, { children: t }),
1667
+ /* @__PURE__ */ e(gn, { initialConfig: k, children: /* @__PURE__ */ d(
1661
1668
  "div",
1662
1669
  {
1663
- className: f(
1670
+ className: m(
1664
1671
  "relative flex flex-col border input-base rounded-xl shadow-sm overflow-hidden transition-all duration-150 ring-0 focus-within:ring-4 focus-within:outline-none",
1665
- T && "input-error"
1672
+ O && "input-error"
1666
1673
  ),
1667
1674
  children: [
1668
- c === "static" && /* @__PURE__ */ e(Tr, { render: g }),
1675
+ c === "static" && /* @__PURE__ */ e(Pr, { render: f }),
1669
1676
  /* @__PURE__ */ e("div", { className: "relative flex-1 min-h-0", children: /* @__PURE__ */ e(
1670
- gn,
1677
+ bn,
1671
1678
  {
1672
1679
  contentEditable: /* @__PURE__ */ e(
1673
- bn,
1680
+ vn,
1674
1681
  {
1675
- className: f(
1682
+ className: m(
1676
1683
  "lexical-content w-full outline-none px-3 py-3 leading-[1.55] overflow-y-auto mat-ui-hide-scrollbars",
1677
1684
  D
1678
1685
  ),
1679
- style: P,
1686
+ style: L,
1680
1687
  "aria-placeholder": r ?? "",
1681
1688
  placeholder: /* @__PURE__ */ e(
1682
1689
  "div",
1683
1690
  {
1684
- className: f(
1691
+ className: m(
1685
1692
  "lexical-placeholder pointer-events-none absolute left-3 top-3",
1686
1693
  D
1687
1694
  ),
@@ -1690,492 +1697,489 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
1690
1697
  )
1691
1698
  }
1692
1699
  ),
1693
- ErrorBoundary: yn
1700
+ ErrorBoundary: Cn
1694
1701
  }
1695
1702
  ) }),
1696
- /* @__PURE__ */ e(vn, {}),
1697
1703
  /* @__PURE__ */ e(xn, {}),
1698
1704
  /* @__PURE__ */ e(wn, {}),
1699
- v && /* @__PURE__ */ e(kn, {}),
1700
- a && /* @__PURE__ */ e(Nn, { onChange: y }),
1701
- u,
1702
- c === "floating" && /* @__PURE__ */ e(Lr, { render: g })
1705
+ /* @__PURE__ */ e(Nn, {}),
1706
+ b && /* @__PURE__ */ e(kn, {}),
1707
+ a && /* @__PURE__ */ e(yn, { onChange: I }),
1708
+ C,
1709
+ c === "floating" && /* @__PURE__ */ e(Lr, { render: f })
1703
1710
  ]
1704
1711
  }
1705
1712
  ) }),
1706
- /* @__PURE__ */ e(V, { children: o }),
1707
- /* @__PURE__ */ e(K, { children: s })
1713
+ /* @__PURE__ */ e(V, { children: s }),
1714
+ /* @__PURE__ */ e(K, { children: l })
1708
1715
  ] }) });
1709
- }, Dl = (t) => {
1716
+ }, Ol = (n) => {
1710
1717
  const {
1711
- className: n,
1712
- label: o,
1713
- description: s,
1718
+ className: t,
1719
+ label: s,
1720
+ description: l,
1714
1721
  options: r,
1715
- error: l,
1722
+ error: o,
1716
1723
  size: a = "md",
1717
1724
  ...i
1718
- } = t;
1725
+ } = n;
1719
1726
  return /* @__PURE__ */ e(Q.Provider, { value: a, children: /* @__PURE__ */ d(
1720
1727
  "div",
1721
1728
  {
1722
- className: f(
1729
+ className: m(
1723
1730
  "flex flex-col",
1724
- n
1731
+ t
1725
1732
  ),
1726
1733
  children: [
1727
- /* @__PURE__ */ e(q, { children: o }),
1734
+ /* @__PURE__ */ e(q, { children: s }),
1728
1735
  /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", children: [
1729
1736
  /* @__PURE__ */ e(
1730
1737
  "select",
1731
1738
  {
1732
- className: f(
1739
+ className: m(
1733
1740
  "appearance-none border input-base bg-none transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none",
1734
- ne[a],
1741
+ te[a],
1735
1742
  Y[a],
1736
1743
  me[a],
1737
1744
  fe[a]
1738
1745
  ),
1739
1746
  ...i,
1740
- children: r && r.map((c, g) => /* @__PURE__ */ e(
1747
+ children: r && r.map((c, f) => /* @__PURE__ */ e(
1741
1748
  "option",
1742
1749
  {
1743
1750
  value: c.value,
1744
1751
  disabled: c.disabled,
1745
1752
  children: c.label
1746
1753
  },
1747
- g
1754
+ f
1748
1755
  ))
1749
1756
  }
1750
1757
  ),
1751
1758
  /* @__PURE__ */ d(he, { children: [
1752
- l && /* @__PURE__ */ e(re, {}),
1753
- /* @__PURE__ */ e(Z, { Icon: ve })
1759
+ o && /* @__PURE__ */ e(ne, {}),
1760
+ /* @__PURE__ */ e(Z, { Icon: be })
1754
1761
  ] })
1755
1762
  ] }),
1756
- /* @__PURE__ */ e(V, { children: s }),
1757
- /* @__PURE__ */ e(K, { children: l })
1763
+ /* @__PURE__ */ e(V, { children: l }),
1764
+ /* @__PURE__ */ e(K, { children: o })
1758
1765
  ]
1759
1766
  }
1760
1767
  ) });
1761
- }, We = C.forwardRef((t, n) => {
1768
+ }, We = R.forwardRef((n, t) => {
1762
1769
  const {
1763
- children: o,
1764
- onClick: s,
1770
+ children: s,
1771
+ onClick: l,
1765
1772
  selected: r,
1766
- disabled: l = !1,
1773
+ disabled: o = !1,
1767
1774
  active: a = !1,
1768
1775
  className: i,
1769
1776
  ...c
1770
- } = t;
1777
+ } = n;
1771
1778
  return /* @__PURE__ */ d(
1772
1779
  "div",
1773
1780
  {
1774
- ref: n,
1781
+ ref: t,
1775
1782
  ...c,
1776
- onClick: () => !l && s && s(),
1777
- className: f(
1783
+ onClick: () => !o && l && l(),
1784
+ className: m(
1778
1785
  "option-base px-4 py-2 rounded-xl cursor-pointer transition-all duration-150 select-none flex flex-row gap-3 items-center",
1779
- r && !l && "option-selected",
1780
- a && !l && "option-active",
1781
- l && "option-disabled cursor-not-allowed hover:bg-transparent active:bg-transparent",
1786
+ r && !o && "option-selected",
1787
+ a && !o && "option-active",
1788
+ o && "option-disabled cursor-not-allowed hover:bg-transparent active:bg-transparent",
1782
1789
  i
1783
1790
  ),
1784
1791
  children: [
1785
- /* @__PURE__ */ e("div", { className: "flex-1 min-w-0 break-all line-clamp-1", children: o }),
1786
- r && !l && /* @__PURE__ */ e("div", { className: "shrink-0", children: /* @__PURE__ */ e(St, { className: "h-5 w-5" }) })
1792
+ /* @__PURE__ */ e("div", { className: "flex-1 min-w-0 break-all line-clamp-1", children: s }),
1793
+ r && !o && /* @__PURE__ */ e("div", { className: "shrink-0", children: /* @__PURE__ */ e(Rt, { className: "h-5 w-5" }) })
1787
1794
  ]
1788
1795
  }
1789
1796
  );
1790
- }), He = C.forwardRef((t, n) => {
1791
- const { children: o, className: s, ...r } = t;
1797
+ }), He = R.forwardRef((n, t) => {
1798
+ const { children: s, className: l, ...r } = n;
1792
1799
  return /* @__PURE__ */ e(
1793
1800
  "div",
1794
1801
  {
1795
- ref: n,
1802
+ ref: t,
1796
1803
  ...r,
1797
- className: f(
1804
+ className: m(
1798
1805
  "option-group-header px-4 pt-3 pb-1 text-xs font-semibold uppercase tracking-wide select-none",
1799
- s
1806
+ l
1800
1807
  ),
1801
- children: o
1808
+ children: s
1802
1809
  }
1803
1810
  );
1804
- }), $e = C.forwardRef((t, n) => {
1805
- const { className: o, ...s } = t;
1811
+ }), $e = R.forwardRef((n, t) => {
1812
+ const { className: s, ...l } = n;
1806
1813
  return /* @__PURE__ */ e(
1807
1814
  "div",
1808
1815
  {
1809
- ref: n,
1810
- ...s,
1811
- className: f(
1816
+ ref: t,
1817
+ ...l,
1818
+ className: m(
1812
1819
  "option-divider my-1 h-px",
1813
- o
1820
+ s
1814
1821
  )
1815
1822
  }
1816
1823
  );
1817
- }), H = (t) => !("kind" in t), G = (t, n) => t === n ? !0 : t == null || n == null || typeof t != "object" || typeof n != "object" ? !1 : JSON.stringify(t) === JSON.stringify(n), _e = (t) => {
1824
+ }), H = (n) => !("kind" in n), G = (n, t) => n === t ? !0 : n == null || t == null || typeof n != "object" || typeof t != "object" ? !1 : JSON.stringify(n) === JSON.stringify(t), _e = (n) => {
1818
1825
  const {
1819
- placement: n = "bottom",
1820
- onOutsideClick: o,
1826
+ placement: t = "bottom",
1821
1827
  fullWidth: s,
1822
- minWidth: r,
1823
- maxWidth: l,
1824
- open: a,
1825
- onOpenChange: i,
1826
- listRef: c,
1827
- activeIndex: g,
1828
- onNavigate: x,
1828
+ minWidth: l,
1829
+ maxWidth: r,
1830
+ open: o,
1831
+ onOpenChange: a,
1832
+ listRef: i,
1833
+ activeIndex: c,
1834
+ onNavigate: f,
1829
1835
  loop: w = !0,
1830
- disabledIndices: h
1831
- } = t, b = C.useMemo(() => [
1836
+ disabledIndices: x
1837
+ } = n, h = R.useMemo(() => [
1838
+ rt({ padding: 8 }),
1832
1839
  lt({ padding: 8 }),
1833
- ot({ padding: 8 }),
1834
- st({
1835
- apply({ rects: P, elements: z }) {
1836
- s && (z.floating.style.width = `${P.reference.width}px`), r && (z.floating.style.minWidth = `${r}px`), l && (z.floating.style.maxWidth = `${l}px`);
1840
+ ot({
1841
+ apply({ rects: L, elements: T }) {
1842
+ s && (T.floating.style.width = `${L.reference.width}px`), l && (T.floating.style.minWidth = `${l}px`), r && (T.floating.style.maxWidth = `${r}px`);
1837
1843
  }
1838
1844
  })
1839
- ], [s, l, r]), { refs: p, floatingStyles: m, context: v, placement: u } = at({
1840
- placement: n,
1841
- open: a,
1842
- onOpenChange: i,
1843
- middleware: b,
1844
- whileElementsMounted: it
1845
- }), I = mn(v, {
1846
- listRef: c,
1847
- activeIndex: g,
1848
- onNavigate: x,
1845
+ ], [s, r, l]), { refs: g, floatingStyles: p, context: u, placement: b } = st({
1846
+ placement: t,
1847
+ open: o,
1848
+ onOpenChange: a,
1849
+ middleware: h,
1850
+ whileElementsMounted: at
1851
+ }), C = hn(u, {
1852
+ listRef: i,
1853
+ activeIndex: c,
1854
+ onNavigate: f,
1849
1855
  loop: w,
1850
1856
  virtual: !0,
1851
1857
  focusItemOnOpen: !1,
1852
- disabledIndices: h
1853
- }), { getReferenceProps: R, getFloatingProps: y, getItemProps: D } = fn([I]), T = C.useRef({
1854
- onOutsideClick: o,
1855
- floatingStyles: m,
1856
- setFloating: p.setFloating,
1857
- placement: n,
1858
- getFloatingProps: y
1858
+ disabledIndices: x
1859
+ }), v = St(u, {
1860
+ outsidePress: !0,
1861
+ escapeKey: !1
1862
+ }), { getReferenceProps: k, getFloatingProps: I, getItemProps: D } = Dt([C, v]), O = R.useRef({
1863
+ floatingStyles: p,
1864
+ setFloating: g.setFloating,
1865
+ placement: t,
1866
+ getFloatingProps: I
1859
1867
  });
1860
- T.current = {
1861
- onOutsideClick: o,
1862
- floatingStyles: m,
1863
- setFloating: p.setFloating,
1864
- placement: u,
1865
- getFloatingProps: y
1868
+ O.current = {
1869
+ floatingStyles: p,
1870
+ setFloating: g.setFloating,
1871
+ placement: b,
1872
+ getFloatingProps: I
1866
1873
  };
1867
- const B = C.useMemo(() => {
1868
- const P = (z) => {
1869
- const { floatingStyles: N, setFloating: k, onOutsideClick: A, placement: O, getFloatingProps: $ } = T.current, { className: j, open: le, children: oe } = z;
1874
+ const P = R.useMemo(() => {
1875
+ const L = (T) => {
1876
+ const { floatingStyles: N, setFloating: y, placement: A, getFloatingProps: z } = O.current, { className: $, open: j, children: re } = T;
1870
1877
  return /* @__PURE__ */ e(
1871
- Ut,
1878
+ Ht,
1872
1879
  {
1873
- open: le,
1874
- className: j,
1875
- onOutsideClick: A,
1880
+ open: j,
1881
+ className: $,
1876
1882
  floatingStyles: N,
1877
- setFloating: k,
1878
- placement: O,
1879
- floatingProps: $(),
1880
- children: oe
1883
+ setFloating: y,
1884
+ placement: A,
1885
+ floatingProps: z(),
1886
+ children: re
1881
1887
  }
1882
1888
  );
1883
1889
  };
1884
- return C.memo(P);
1890
+ return R.memo(L);
1885
1891
  }, []);
1886
1892
  return {
1887
- anchorRef: p.setReference,
1888
- Popover: B,
1889
- getReferenceProps: R,
1893
+ anchorRef: g.setReference,
1894
+ Popover: P,
1895
+ getReferenceProps: k,
1890
1896
  getItemProps: D
1891
1897
  };
1892
- }, Pr = (t) => {
1898
+ }, Er = (n) => {
1893
1899
  const {
1894
- className: n,
1895
- label: o,
1896
- description: s,
1900
+ className: t,
1901
+ label: s,
1902
+ description: l,
1897
1903
  options: r,
1898
- onChange: l,
1904
+ onChange: o,
1899
1905
  value: a,
1900
1906
  placeholder: i,
1901
1907
  maxHeight: c = 300,
1902
- error: g,
1903
- size: x = "md",
1904
- disabled: w = !1,
1908
+ error: f,
1909
+ size: w = "md",
1910
+ disabled: x = !1,
1905
1911
  clearable: h = !0
1906
- } = t, [b, p] = W(!1), [m, v] = W(null), u = C.useRef(null), I = C.useRef([]), R = r?.find((N) => H(N) && G(N.value, a)), y = ie(
1907
- () => r.map((N, k) => !H(N) || N.disabled ? k : -1).filter((N) => N !== -1),
1912
+ } = n, [g, p] = W(!1), [u, b] = W(null), C = R.useRef(null), v = R.useRef([]), k = r?.find((N) => H(N) && G(N.value, a)), I = se(
1913
+ () => r.map((N, y) => !H(N) || N.disabled ? y : -1).filter((N) => N !== -1),
1908
1914
  [r]
1909
1915
  );
1910
- we(b, () => p(!1)), _(() => {
1911
- if (b) {
1912
- u.current?.focus({ preventScroll: !0 });
1913
- const N = r.findIndex((k) => H(k) && G(k.value, a));
1916
+ xe(g, () => p(!1)), _(() => {
1917
+ if (g) {
1918
+ C.current?.focus({ preventScroll: !0 });
1919
+ const N = r.findIndex((y) => H(y) && G(y.value, a));
1914
1920
  if (N >= 0)
1915
- v(N);
1921
+ b(N);
1916
1922
  else {
1917
- const k = r.findIndex((A) => H(A) && !A.disabled);
1918
- v(k >= 0 ? k : null);
1923
+ const y = r.findIndex((A) => H(A) && !A.disabled);
1924
+ b(y >= 0 ? y : null);
1919
1925
  }
1920
1926
  } else
1921
- v(null);
1922
- }, [b]);
1923
- const { anchorRef: D, Popover: T, getReferenceProps: B, getItemProps: P } = _e({
1927
+ b(null);
1928
+ }, [g]);
1929
+ const { anchorRef: D, Popover: O, getReferenceProps: P, getItemProps: L } = _e({
1924
1930
  placement: "bottom",
1925
1931
  fullWidth: !0,
1926
1932
  minWidth: 200,
1927
- onOutsideClick: () => p(!1),
1928
- open: b,
1933
+ open: g,
1929
1934
  onOpenChange: p,
1930
- listRef: I,
1931
- activeIndex: m,
1932
- onNavigate: v,
1933
- disabledIndices: y
1934
- }), z = (N) => {
1935
- const k = r[N];
1936
- k && H(k) && !k.disabled && (l(k.value), p(!1));
1935
+ listRef: v,
1936
+ activeIndex: u,
1937
+ onNavigate: b,
1938
+ disabledIndices: I
1939
+ }), T = (N) => {
1940
+ const y = r[N];
1941
+ y && H(y) && !y.disabled && (o(y.value), p(!1));
1937
1942
  };
1938
- return /* @__PURE__ */ e(Q.Provider, { value: x, children: /* @__PURE__ */ d(
1943
+ return /* @__PURE__ */ e(Q.Provider, { value: w, children: /* @__PURE__ */ d(
1939
1944
  "div",
1940
1945
  {
1941
- className: f(
1946
+ className: m(
1942
1947
  "flex flex-col",
1943
- n
1948
+ t
1944
1949
  ),
1945
1950
  children: [
1946
- /* @__PURE__ */ e(q, { children: o }),
1951
+ /* @__PURE__ */ e(q, { children: s }),
1947
1952
  /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: D, children: [
1948
1953
  /* @__PURE__ */ d(
1949
1954
  "div",
1950
1955
  {
1951
- ...B({
1952
- ref: u,
1956
+ ...P({
1957
+ ref: C,
1953
1958
  role: "button",
1954
- tabIndex: w ? -1 : 0,
1955
- "aria-disabled": w,
1959
+ tabIndex: x ? -1 : 0,
1960
+ "aria-disabled": x,
1956
1961
  onClick: () => {
1957
- w || p(!b);
1962
+ x || p(!g);
1958
1963
  },
1959
1964
  onKeyDown: (N) => {
1960
- w || (N.key === " " ? (N.preventDefault(), p((k) => !k)) : N.key === "Enter" && (N.preventDefault(), b && m != null ? z(m) : p(!0)));
1965
+ x || (N.key === " " ? (N.preventDefault(), p((y) => !y)) : N.key === "Enter" && (N.preventDefault(), g && u != null ? T(u) : p(!0)));
1961
1966
  }
1962
1967
  }),
1963
- className: f(
1968
+ className: m(
1964
1969
  "flex flex-row items-center border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",
1965
- ne[x],
1966
- Y[x],
1967
- me[x],
1968
- h && a ? Be[x] : fe[x],
1969
- w ? "select-trigger-disabled" : g && "select-trigger-error",
1970
- !w && b && "ring-4"
1970
+ te[w],
1971
+ Y[w],
1972
+ me[w],
1973
+ h && a ? Be[w] : fe[w],
1974
+ x ? "select-trigger-disabled" : f && "select-trigger-error",
1975
+ !x && g && "ring-4"
1971
1976
  ),
1972
1977
  children: [
1973
- R && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: R.label }),
1974
- !R && i && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: i })
1978
+ k && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: k.label }),
1979
+ !k && i && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: i })
1975
1980
  ]
1976
1981
  }
1977
1982
  ),
1978
1983
  /* @__PURE__ */ d(he, { children: [
1979
- !w && g && /* @__PURE__ */ e(re, {}),
1980
- h && !!a && !w && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => l(null) }),
1981
- /* @__PURE__ */ e(Z, { Icon: ve })
1984
+ !x && f && /* @__PURE__ */ e(ne, {}),
1985
+ h && !!a && !x && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => o(null) }),
1986
+ /* @__PURE__ */ e(Z, { Icon: be })
1982
1987
  ] }),
1983
- /* @__PURE__ */ e(T, { open: b, children: /* @__PURE__ */ e(xe, { className: "!p-0", style: { maxHeight: c }, children: /* @__PURE__ */ e("div", { className: "flex flex-col p-2 gap-1", children: r.map((N, k) => {
1988
+ /* @__PURE__ */ e(O, { open: g, children: /* @__PURE__ */ e(ve, { className: "!p-0", style: { maxHeight: c }, children: /* @__PURE__ */ e("div", { className: "flex flex-col p-2 gap-1", children: r.map((N, y) => {
1984
1989
  if (!H(N))
1985
1990
  return N.kind === "header" ? /* @__PURE__ */ e(
1986
1991
  He,
1987
1992
  {
1988
- ref: (O) => {
1989
- I.current[k] = O;
1993
+ ref: (z) => {
1994
+ v.current[y] = z;
1990
1995
  },
1991
1996
  children: N.label
1992
1997
  },
1993
- `header-${k}`
1998
+ `header-${y}`
1994
1999
  ) : /* @__PURE__ */ e(
1995
2000
  $e,
1996
2001
  {
1997
- ref: (O) => {
1998
- I.current[k] = O;
2002
+ ref: (z) => {
2003
+ v.current[y] = z;
1999
2004
  }
2000
2005
  },
2001
- `divider-${k}`
2006
+ `divider-${y}`
2002
2007
  );
2003
2008
  const A = G(N.value, a);
2004
2009
  return /* @__PURE__ */ e(
2005
2010
  We,
2006
2011
  {
2007
- ...P({
2008
- ref(O) {
2009
- I.current[k] = O;
2012
+ ...L({
2013
+ ref(z) {
2014
+ v.current[y] = z;
2010
2015
  }
2011
2016
  }),
2012
- onClick: () => z(k),
2017
+ onClick: () => T(y),
2013
2018
  selected: A,
2014
- active: m === k,
2019
+ active: u === y,
2015
2020
  disabled: N.disabled,
2016
2021
  children: N.label
2017
2022
  },
2018
- `option-${k}`
2023
+ `option-${y}`
2019
2024
  );
2020
2025
  }) }) }) })
2021
2026
  ] }),
2022
- /* @__PURE__ */ e(V, { children: s }),
2023
- /* @__PURE__ */ e(K, { children: g })
2027
+ /* @__PURE__ */ e(V, { children: l }),
2028
+ /* @__PURE__ */ e(K, { children: f })
2024
2029
  ]
2025
2030
  }
2026
2031
  ) });
2027
- }, Ol = (t) => {
2032
+ }, zl = (n) => {
2028
2033
  const {
2029
- className: n,
2030
- label: o,
2031
- description: s,
2034
+ className: t,
2035
+ label: s,
2036
+ description: l,
2032
2037
  options: r,
2033
- onChange: l,
2038
+ onChange: o,
2034
2039
  onSearch: a,
2035
2040
  value: i,
2036
2041
  placeholder: c,
2037
- maxHeight: g = 300,
2038
- error: x,
2039
- size: w = "md",
2042
+ maxHeight: f = 300,
2043
+ error: w,
2044
+ size: x = "md",
2040
2045
  disabled: h = !1,
2041
- clearable: b = !0
2042
- } = t, [p, m] = W(!1), [v, u] = W(r), [I, R] = W(""), [y, D] = W(null), T = C.useRef(null), B = C.useRef(null), P = C.useRef([]), z = r?.find((L) => H(L) && G(L.value, i)), N = ie(() => I !== "" ? v : r, [I, v, r]), k = ie(
2043
- () => N.map((L, U) => !H(L) || L.disabled ? U : -1).filter((L) => L !== -1),
2046
+ clearable: g = !0
2047
+ } = n, [p, u] = W(!1), [b, C] = W(r), [v, k] = W(""), [I, D] = W(null), O = R.useRef(null), P = R.useRef(null), L = R.useRef([]), T = r?.find((E) => H(E) && G(E.value, i)), N = se(() => v !== "" ? b : r, [v, b, r]), y = se(
2048
+ () => N.map((E, U) => !H(E) || E.disabled ? U : -1).filter((E) => E !== -1),
2044
2049
  [N]
2045
2050
  );
2046
- we(p, () => m(!1)), _(() => {
2047
- u(a(I));
2048
- }, [I, r, a]), _(() => {
2051
+ xe(p, () => u(!1)), _(() => {
2052
+ C(a(v));
2053
+ }, [v, r, a]), _(() => {
2049
2054
  if (p) {
2050
- setTimeout(() => B.current?.focus(), 100);
2051
- const L = r.findIndex((U) => H(U) && G(U.value, i));
2052
- if (L >= 0)
2053
- D(L);
2055
+ setTimeout(() => P.current?.focus(), 100);
2056
+ const E = r.findIndex((U) => H(U) && G(U.value, i));
2057
+ if (E >= 0)
2058
+ D(E);
2054
2059
  else {
2055
- const U = r.findIndex((se) => H(se) && !se.disabled);
2060
+ const U = r.findIndex((le) => H(le) && !le.disabled);
2056
2061
  D(U >= 0 ? U : null);
2057
2062
  }
2058
2063
  } else
2059
- D(null), R("");
2064
+ D(null), k("");
2060
2065
  }, [p]), _(() => {
2061
2066
  if (!p) return;
2062
- const L = N.findIndex((U) => H(U) && !U.disabled);
2063
- D(L >= 0 ? L : null);
2064
- }, [I, p, N]);
2065
- const { anchorRef: A, Popover: O, getReferenceProps: $, getItemProps: j } = _e({
2067
+ const E = N.findIndex((U) => H(U) && !U.disabled);
2068
+ D(E >= 0 ? E : null);
2069
+ }, [v, p, N]);
2070
+ const { anchorRef: A, Popover: z, getReferenceProps: $, getItemProps: j } = _e({
2066
2071
  placement: "bottom",
2067
2072
  fullWidth: !0,
2068
2073
  minWidth: 200,
2069
- onOutsideClick: () => m(!1),
2070
2074
  open: p,
2071
- onOpenChange: m,
2072
- listRef: P,
2073
- activeIndex: y,
2075
+ onOpenChange: u,
2076
+ listRef: L,
2077
+ activeIndex: I,
2074
2078
  onNavigate: D,
2075
- disabledIndices: k
2076
- }), le = (L) => {
2077
- const U = N[L];
2078
- U && H(U) && !U.disabled && (l(U.value), m(!1));
2079
- }, oe = N.some((L) => H(L));
2080
- return /* @__PURE__ */ e(Q.Provider, { value: w, children: /* @__PURE__ */ d(
2079
+ disabledIndices: y
2080
+ }), re = (E) => {
2081
+ const U = N[E];
2082
+ U && H(U) && !U.disabled && (o(U.value), u(!1));
2083
+ }, Ne = N.some((E) => H(E));
2084
+ return /* @__PURE__ */ e(Q.Provider, { value: x, children: /* @__PURE__ */ d(
2081
2085
  "div",
2082
2086
  {
2083
- className: f(
2087
+ className: m(
2084
2088
  "flex flex-col",
2085
- n
2089
+ t
2086
2090
  ),
2087
2091
  children: [
2088
- /* @__PURE__ */ e(q, { children: o }),
2092
+ /* @__PURE__ */ e(q, { children: s }),
2089
2093
  /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: A, children: [
2090
2094
  /* @__PURE__ */ d(
2091
2095
  "div",
2092
2096
  {
2093
2097
  ...$({
2094
- ref: T,
2098
+ ref: O,
2095
2099
  role: "button",
2096
2100
  tabIndex: h ? -1 : 0,
2097
2101
  "aria-disabled": h,
2098
2102
  onClick: () => {
2099
- h || m(!p);
2103
+ h || u(!p);
2100
2104
  },
2101
- onKeyDown: (L) => {
2102
- h || (L.key === " " ? (L.preventDefault(), m((U) => !U)) : L.key === "Enter" && !p && (L.preventDefault(), m(!0)));
2105
+ onKeyDown: (E) => {
2106
+ h || (E.key === " " ? (E.preventDefault(), u((U) => !U)) : E.key === "Enter" && !p && (E.preventDefault(), u(!0)));
2103
2107
  }
2104
2108
  }),
2105
- className: f(
2109
+ className: m(
2106
2110
  "flex flex-row items-center border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",
2107
- ne[w],
2108
- Y[w],
2109
- me[w],
2110
- b && i ? Be[w] : fe[w],
2111
- h ? "select-trigger-disabled" : x && "select-trigger-error",
2111
+ te[x],
2112
+ Y[x],
2113
+ me[x],
2114
+ g && i ? Be[x] : fe[x],
2115
+ h ? "select-trigger-disabled" : w && "select-trigger-error",
2112
2116
  !h && p && "ring-4"
2113
2117
  ),
2114
2118
  children: [
2115
- z && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: z.label }),
2116
- !z && c && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: c })
2119
+ T && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: T.label }),
2120
+ !T && c && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: c })
2117
2121
  ]
2118
2122
  }
2119
2123
  ),
2120
2124
  /* @__PURE__ */ d(he, { children: [
2121
- !h && x && /* @__PURE__ */ e(re, {}),
2122
- b && !!i && !h && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => l(null) }),
2123
- /* @__PURE__ */ e(Z, { Icon: ve })
2125
+ !h && w && /* @__PURE__ */ e(ne, {}),
2126
+ g && !!i && !h && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => o(null) }),
2127
+ /* @__PURE__ */ e(Z, { Icon: be })
2124
2128
  ] }),
2125
- /* @__PURE__ */ e(O, { open: p, children: /* @__PURE__ */ d(xe, { className: "gap-0 !p-0", style: { maxHeight: g }, children: [
2129
+ /* @__PURE__ */ e(z, { open: p, children: /* @__PURE__ */ d(ve, { className: "gap-0 !p-0", style: { maxHeight: f }, children: [
2126
2130
  /* @__PURE__ */ d("div", { className: "sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm", children: [
2127
2131
  /* @__PURE__ */ e(
2128
2132
  "input",
2129
2133
  {
2130
- ref: B,
2134
+ ref: P,
2131
2135
  type: "text",
2132
2136
  placeholder: "Search",
2133
- value: I,
2137
+ value: v,
2134
2138
  className: "appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",
2135
- onChange: (L) => R(L.target.value),
2136
- onKeyDown: (L) => {
2137
- L.key === "Enter" && y != null && (L.preventDefault(), le(y));
2139
+ onChange: (E) => k(E.target.value),
2140
+ onKeyDown: (E) => {
2141
+ E.key === "Enter" && I != null && (E.preventDefault(), re(I));
2138
2142
  }
2139
2143
  }
2140
2144
  ),
2141
- /* @__PURE__ */ e(Me, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
2145
+ /* @__PURE__ */ e(Fe, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
2142
2146
  ] }),
2143
2147
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1 p-2", children: [
2144
- I !== "" && !oe && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2145
- N.map((L, U) => {
2146
- if (!H(L))
2147
- return L.kind === "header" ? /* @__PURE__ */ e(
2148
+ v !== "" && !Ne && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2149
+ N.map((E, U) => {
2150
+ if (!H(E))
2151
+ return E.kind === "header" ? /* @__PURE__ */ e(
2148
2152
  He,
2149
2153
  {
2150
2154
  ref: (ee) => {
2151
- P.current[U] = ee;
2155
+ L.current[U] = ee;
2152
2156
  },
2153
- children: L.label
2157
+ children: E.label
2154
2158
  },
2155
2159
  `header-${U}`
2156
2160
  ) : /* @__PURE__ */ e(
2157
2161
  $e,
2158
2162
  {
2159
2163
  ref: (ee) => {
2160
- P.current[U] = ee;
2164
+ L.current[U] = ee;
2161
2165
  }
2162
2166
  },
2163
2167
  `divider-${U}`
2164
2168
  );
2165
- const se = G(L.value, i);
2169
+ const le = G(E.value, i);
2166
2170
  return /* @__PURE__ */ e(
2167
2171
  We,
2168
2172
  {
2169
2173
  ...j({
2170
2174
  ref(ee) {
2171
- P.current[U] = ee;
2175
+ L.current[U] = ee;
2172
2176
  }
2173
2177
  }),
2174
- onClick: () => le(U),
2175
- selected: se,
2176
- active: y === U,
2177
- disabled: L.disabled,
2178
- children: L.label
2178
+ onClick: () => re(U),
2179
+ selected: le,
2180
+ active: I === U,
2181
+ disabled: E.disabled,
2182
+ children: E.label
2179
2183
  },
2180
2184
  `option-${U}`
2181
2185
  );
@@ -2183,192 +2187,191 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
2183
2187
  ] })
2184
2188
  ] }) })
2185
2189
  ] }),
2186
- /* @__PURE__ */ e(V, { children: s }),
2187
- /* @__PURE__ */ e(K, { children: x })
2190
+ /* @__PURE__ */ e(V, { children: l }),
2191
+ /* @__PURE__ */ e(K, { children: w })
2188
2192
  ]
2189
2193
  }
2190
2194
  ) });
2191
- }, Er = (t, n) => {
2192
- const [o, s] = W(t);
2195
+ }, Fr = (n, t) => {
2196
+ const [s, l] = W(n);
2193
2197
  return _(() => {
2194
2198
  const r = setTimeout(() => {
2195
- s(t);
2196
- }, n);
2199
+ l(n);
2200
+ }, t);
2197
2201
  return () => {
2198
2202
  clearTimeout(r);
2199
2203
  };
2200
- }, [t, n]), o;
2201
- }, zl = (t) => {
2204
+ }, [n, t]), s;
2205
+ }, Tl = (n) => {
2202
2206
  const {
2203
- className: n,
2204
- label: o,
2205
- description: s,
2207
+ className: t,
2208
+ label: s,
2209
+ description: l,
2206
2210
  onChange: r,
2207
- fetchOptionsByQuery: l,
2211
+ fetchOptionsByQuery: o,
2208
2212
  fetchOptionByValue: a,
2209
2213
  onSearchDebounceMs: i = 300,
2210
2214
  value: c,
2211
- placeholder: g,
2212
- maxHeight: x = 300,
2213
- error: w,
2215
+ placeholder: f,
2216
+ maxHeight: w = 300,
2217
+ error: x,
2214
2218
  size: h = "md",
2215
- disabled: b = !1,
2219
+ disabled: g = !1,
2216
2220
  clearable: p = !0
2217
- } = t, [m, v] = W(!1), u = C.useRef(null), [I, R] = W(""), [y, D] = W([]), [T, B] = W(null), P = C.useRef(null), [z, N] = W(!1), [k, A] = W(!1), [O, $] = W(null), j = C.useRef([]), le = ie(
2218
- () => y.map((M, F) => !H(M) || M.disabled ? F : -1).filter((M) => M !== -1),
2219
- [y]
2221
+ } = n, [u, b] = W(!1), C = R.useRef(null), [v, k] = W(""), [I, D] = W([]), [O, P] = W(null), L = R.useRef(null), [T, N] = W(!1), [y, A] = W(!1), [z, $] = W(null), j = R.useRef([]), re = se(
2222
+ () => I.map((M, B) => !H(M) || M.disabled ? B : -1).filter((M) => M !== -1),
2223
+ [I]
2220
2224
  );
2221
- we(m, () => v(!1));
2222
- const oe = Er(I, i);
2225
+ xe(u, () => b(!1));
2226
+ const Ne = Fr(v, i);
2223
2227
  _(() => {
2224
2228
  (async () => {
2225
2229
  N(!0);
2226
- const F = await l(oe);
2227
- D(F), N(!1);
2230
+ const B = await o(Ne);
2231
+ D(B), N(!1);
2228
2232
  })();
2229
- }, [oe, l]), _(() => {
2233
+ }, [Ne, o]), _(() => {
2230
2234
  if (c == null) {
2231
- B(null);
2235
+ P(null);
2232
2236
  return;
2233
2237
  }
2234
- const M = y?.find((F) => H(F) && G(F.value, c));
2235
- M ? B(M) : (async () => {
2238
+ const M = I?.find((B) => H(B) && G(B.value, c));
2239
+ M ? P(M) : (async () => {
2236
2240
  A(!0);
2237
- const ae = await a(c);
2238
- B(ae), A(!1);
2241
+ const oe = await a(c);
2242
+ P(oe), A(!1);
2239
2243
  })();
2240
- }, [a, y, c]), _(() => {
2241
- m ? setTimeout(() => P.current?.focus(), 100) : ($(null), R(""));
2242
- }, [m]), _(() => {
2243
- if (!m) return;
2244
- const M = y.findIndex((F) => H(F) && !F.disabled);
2244
+ }, [a, I, c]), _(() => {
2245
+ u ? setTimeout(() => L.current?.focus(), 100) : ($(null), k(""));
2246
+ }, [u]), _(() => {
2247
+ if (!u) return;
2248
+ const M = I.findIndex((B) => H(B) && !B.disabled);
2245
2249
  $(M >= 0 ? M : null);
2246
- }, [y, m]);
2247
- const { anchorRef: L, Popover: U, getReferenceProps: se, getItemProps: ee } = _e({
2250
+ }, [I, u]);
2251
+ const { anchorRef: E, Popover: U, getReferenceProps: le, getItemProps: ee } = _e({
2248
2252
  placement: "bottom",
2249
2253
  fullWidth: !0,
2250
2254
  minWidth: 200,
2251
- onOutsideClick: () => v(!1),
2252
- open: m,
2253
- onOpenChange: v,
2255
+ open: u,
2256
+ onOpenChange: b,
2254
2257
  listRef: j,
2255
- activeIndex: O,
2258
+ activeIndex: z,
2256
2259
  onNavigate: $,
2257
- disabledIndices: le
2260
+ disabledIndices: re
2258
2261
  }), Oe = (M) => {
2259
- const F = y[M];
2260
- F && H(F) && !F.disabled && (r(F.value), v(!1));
2261
- }, ze = y.some((M) => H(M));
2262
+ const B = I[M];
2263
+ B && H(B) && !B.disabled && (r(B.value), b(!1));
2264
+ }, ze = I.some((M) => H(M));
2262
2265
  return /* @__PURE__ */ e(Q.Provider, { value: h, children: /* @__PURE__ */ d(
2263
2266
  "div",
2264
2267
  {
2265
- className: f(
2268
+ className: m(
2266
2269
  "flex flex-col",
2267
- n
2270
+ t
2268
2271
  ),
2269
2272
  children: [
2270
- /* @__PURE__ */ e(q, { children: o }),
2271
- /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: L, children: [
2273
+ /* @__PURE__ */ e(q, { children: s }),
2274
+ /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: E, children: [
2272
2275
  /* @__PURE__ */ d(
2273
2276
  "div",
2274
2277
  {
2275
- ...se({
2276
- ref: u,
2278
+ ...le({
2279
+ ref: C,
2277
2280
  role: "button",
2278
- tabIndex: b ? -1 : 0,
2279
- "aria-disabled": b,
2281
+ tabIndex: g ? -1 : 0,
2282
+ "aria-disabled": g,
2280
2283
  onClick: () => {
2281
- b || v(!m);
2284
+ g || b(!u);
2282
2285
  },
2283
2286
  onKeyDown: (M) => {
2284
- b || (M.key === " " ? (M.preventDefault(), v((F) => !F)) : M.key === "Enter" && !m && (M.preventDefault(), v(!0)));
2287
+ g || (M.key === " " ? (M.preventDefault(), b((B) => !B)) : M.key === "Enter" && !u && (M.preventDefault(), b(!0)));
2285
2288
  }
2286
2289
  }),
2287
- className: f(
2290
+ className: m(
2288
2291
  "flex flex-row items-center border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",
2289
- ne[h],
2292
+ te[h],
2290
2293
  Y[h],
2291
2294
  me[h],
2292
2295
  p && c ? Be[h] : fe[h],
2293
- b ? "select-trigger-disabled" : w && "select-trigger-error",
2294
- !b && m && "ring-4"
2296
+ g ? "select-trigger-disabled" : x && "select-trigger-error",
2297
+ !g && u && "ring-4"
2295
2298
  ),
2296
2299
  children: [
2297
- !k && T && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: T.label }),
2298
- !k && !T && g && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: g }),
2299
- k && /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-text)]" })
2300
+ !y && O && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left", children: O.label }),
2301
+ !y && !O && f && /* @__PURE__ */ e("span", { className: "flex-1 min-w-0 break-all line-clamp-1 text-left select-placeholder", children: f }),
2302
+ y && /* @__PURE__ */ e(Se, { className: "h-4 w-4 text-[var(--color-input-text)]" })
2300
2303
  ]
2301
2304
  }
2302
2305
  ),
2303
2306
  /* @__PURE__ */ d(he, { children: [
2304
- !b && w && /* @__PURE__ */ e(re, {}),
2305
- p && !!c && !b && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => r(null) }),
2306
- /* @__PURE__ */ e(Z, { Icon: ve })
2307
+ !g && x && /* @__PURE__ */ e(ne, {}),
2308
+ p && !!c && !g && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => r(null) }),
2309
+ /* @__PURE__ */ e(Z, { Icon: be })
2307
2310
  ] }),
2308
- /* @__PURE__ */ e(U, { open: m, children: /* @__PURE__ */ d(xe, { className: "gap-0 !p-0", style: { maxHeight: x }, children: [
2311
+ /* @__PURE__ */ e(U, { open: u, children: /* @__PURE__ */ d(ve, { className: "gap-0 !p-0", style: { maxHeight: w }, children: [
2309
2312
  /* @__PURE__ */ d("div", { className: "sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm", children: [
2310
2313
  /* @__PURE__ */ e(
2311
2314
  "input",
2312
2315
  {
2313
- ref: P,
2316
+ ref: L,
2314
2317
  type: "text",
2315
2318
  placeholder: "Search",
2316
- value: I,
2319
+ value: v,
2317
2320
  className: "appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",
2318
- onChange: (M) => R(M.target.value),
2321
+ onChange: (M) => k(M.target.value),
2319
2322
  onKeyDown: (M) => {
2320
- M.key === "Enter" && O != null && (M.preventDefault(), Oe(O));
2323
+ M.key === "Enter" && z != null && (M.preventDefault(), Oe(z));
2321
2324
  }
2322
2325
  }
2323
2326
  ),
2324
- /* @__PURE__ */ e(Me, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
2327
+ /* @__PURE__ */ e(Fe, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
2325
2328
  ] }),
2326
2329
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1 p-2", children: [
2327
- !z && !ze && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2328
- z && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(Se, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2329
- !z && y.map((M, F) => {
2330
+ !T && !ze && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2331
+ T && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(Se, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2332
+ !T && I.map((M, B) => {
2330
2333
  if (!H(M))
2331
2334
  return M.kind === "header" ? /* @__PURE__ */ e(
2332
2335
  He,
2333
2336
  {
2334
2337
  ref: (pe) => {
2335
- j.current[F] = pe;
2338
+ j.current[B] = pe;
2336
2339
  },
2337
2340
  children: M.label
2338
2341
  },
2339
- `header-${F}`
2342
+ `header-${B}`
2340
2343
  ) : /* @__PURE__ */ e(
2341
2344
  $e,
2342
2345
  {
2343
2346
  ref: (pe) => {
2344
- j.current[F] = pe;
2347
+ j.current[B] = pe;
2345
2348
  }
2346
2349
  },
2347
- `divider-${F}`
2350
+ `divider-${B}`
2348
2351
  );
2349
- const ae = G(M.value, c);
2352
+ const oe = G(M.value, c);
2350
2353
  return /* @__PURE__ */ e(
2351
2354
  We,
2352
2355
  {
2353
2356
  ...ee({
2354
2357
  ref(pe) {
2355
- j.current[F] = pe;
2358
+ j.current[B] = pe;
2356
2359
  }
2357
2360
  }),
2358
- onClick: () => Oe(F),
2359
- selected: ae,
2360
- active: O === F,
2361
+ onClick: () => Oe(B),
2362
+ selected: oe,
2363
+ active: z === B,
2361
2364
  disabled: M.disabled,
2362
2365
  children: M.label
2363
2366
  },
2364
- `option-${F}`
2367
+ `option-${B}`
2365
2368
  );
2366
2369
  })
2367
2370
  ] })
2368
2371
  ] }) })
2369
2372
  ] }),
2370
- /* @__PURE__ */ e(V, { children: s }),
2371
- /* @__PURE__ */ e(K, { children: w })
2373
+ /* @__PURE__ */ e(V, { children: l }),
2374
+ /* @__PURE__ */ e(K, { children: x })
2372
2375
  ]
2373
2376
  }
2374
2377
  ) });
@@ -2397,28 +2400,28 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
2397
2400
  stone: "bg-stone-100 text-stone-700 ring-stone-200 dark:bg-stone-950 dark:text-stone-300 dark:ring-stone-800",
2398
2401
  white: "bg-[var(--color-badge-white-bg)] text-[var(--color-badge-white-text)] ring-[var(--color-badge-white-ring)]",
2399
2402
  black: "bg-[var(--color-badge-black-bg)] text-[var(--color-badge-black-text)] ring-[var(--color-badge-black-ring)]"
2400
- }, Ee = C.forwardRef((t, n) => {
2403
+ }, Ee = R.forwardRef((n, t) => {
2401
2404
  const {
2402
- className: o,
2403
- children: s,
2405
+ className: s,
2406
+ children: l,
2404
2407
  onClick: r,
2405
- showCloseIcon: l,
2408
+ showCloseIcon: o,
2406
2409
  Icon: a,
2407
2410
  color: i = "gray"
2408
- } = t, c = f(
2411
+ } = n, c = m(
2409
2412
  "inline-flex align-top items-center gap-2 px-3 h-7 rounded-lg font-semibold",
2410
2413
  Mr[i],
2411
- o
2414
+ s
2412
2415
  );
2413
- return r ? /* @__PURE__ */ e("div", { ref: n, children: /* @__PURE__ */ d(
2416
+ return r ? /* @__PURE__ */ e("div", { ref: t, children: /* @__PURE__ */ d(
2414
2417
  "button",
2415
2418
  {
2416
- className: f("cursor-pointer ring-0 hover:ring-4 active:ring-1 transition-all duration-100 select-none focus:outline-none focus:ring-4", c),
2419
+ className: m("cursor-pointer ring-0 hover:ring-4 active:ring-1 transition-all duration-100 select-none focus:outline-none focus:ring-4", c),
2417
2420
  onClick: r,
2418
2421
  children: [
2419
2422
  a && /* @__PURE__ */ e(a, { className: "h-4 w-4 shrink-0" }),
2420
- /* @__PURE__ */ e("div", { className: "break-all line-clamp-1 text-left", children: s }),
2421
- l && /* @__PURE__ */ e(
2423
+ /* @__PURE__ */ e("div", { className: "break-all line-clamp-1 text-left", children: l }),
2424
+ o && /* @__PURE__ */ e(
2422
2425
  de,
2423
2426
  {
2424
2427
  className: "h-4 w-4 shrink-0"
@@ -2426,248 +2429,247 @@ const f = (...t) => t.filter(Boolean).join(" "), Hn = [
2426
2429
  )
2427
2430
  ]
2428
2431
  }
2429
- ) }) : /* @__PURE__ */ d("div", { className: c, ref: n, children: [
2432
+ ) }) : /* @__PURE__ */ d("div", { className: c, ref: t, children: [
2430
2433
  a && /* @__PURE__ */ e(a, { className: "h-4 w-4 shrink-0" }),
2431
- /* @__PURE__ */ e("div", { className: "break-all line-clamp-1 text-left", children: s })
2434
+ /* @__PURE__ */ e("div", { className: "break-all line-clamp-1 text-left", children: l })
2432
2435
  ] });
2433
2436
  });
2434
- function Fr(t) {
2437
+ function Br(n) {
2435
2438
  const {
2436
- enabled: n,
2437
- triggerRef: o,
2438
- measureRef: s,
2439
+ enabled: t,
2440
+ triggerRef: s,
2441
+ measureRef: l,
2439
2442
  trayRef: r,
2440
- itemCount: l,
2443
+ itemCount: o,
2441
2444
  deps: a = [],
2442
2445
  gap: i = 4
2443
- } = t, [c, g] = W(0);
2444
- return Rt(() => {
2445
- if (!n) return;
2446
- const x = o.current, w = s.current;
2447
- if (!x || !w) return;
2446
+ } = n, [c, f] = W(0);
2447
+ return It(() => {
2448
+ if (!t) return;
2449
+ const w = s.current, x = l.current;
2450
+ if (!w || !x) return;
2448
2451
  const h = () => {
2449
- if (l === 0) {
2450
- g(0);
2452
+ if (o === 0) {
2453
+ f(0);
2451
2454
  return;
2452
2455
  }
2453
- if (l === 1) {
2454
- g(1);
2456
+ if (o === 1) {
2457
+ f(1);
2455
2458
  return;
2456
2459
  }
2457
- const p = window.getComputedStyle(x), m = parseFloat(p.paddingLeft || "0"), v = x.getBoundingClientRect(), u = v.left + m;
2458
- let I = v.right - parseFloat(p.paddingRight || "0");
2459
- const R = r?.current;
2460
- if (R) {
2461
- const N = R.getBoundingClientRect();
2462
- N.width > 0 && (I = Math.min(I, N.left - i));
2460
+ const p = window.getComputedStyle(w), u = parseFloat(p.paddingLeft || "0"), b = w.getBoundingClientRect(), C = b.left + u;
2461
+ let v = b.right - parseFloat(p.paddingRight || "0");
2462
+ const k = r?.current;
2463
+ if (k) {
2464
+ const N = k.getBoundingClientRect();
2465
+ N.width > 0 && (v = Math.min(v, N.left - i));
2463
2466
  }
2464
- const y = Math.max(0, I - u), D = Array.from(w.children);
2465
- if (D.length < l + 1) return;
2466
- let T = 0;
2467
- for (let N = 0; N < l; N++)
2468
- T += D[N].offsetWidth + (N > 0 ? i : 0);
2469
- if (T <= y) {
2470
- g(l);
2467
+ const I = Math.max(0, v - C), D = Array.from(x.children);
2468
+ if (D.length < o + 1) return;
2469
+ let O = 0;
2470
+ for (let N = 0; N < o; N++)
2471
+ O += D[N].offsetWidth + (N > 0 ? i : 0);
2472
+ if (O <= I) {
2473
+ f(o);
2471
2474
  return;
2472
2475
  }
2473
- const B = D[l].offsetWidth;
2474
- let P = 0, z = 0;
2475
- for (let N = 0; N < l; N++) {
2476
- const k = D[N].offsetWidth, A = P + k + (N > 0 ? i : 0);
2477
- if (A + B + i > y) break;
2478
- P = A, z++;
2476
+ const P = D[o].offsetWidth;
2477
+ let L = 0, T = 0;
2478
+ for (let N = 0; N < o; N++) {
2479
+ const y = D[N].offsetWidth, A = L + y + (N > 0 ? i : 0);
2480
+ if (A + P + i > I) break;
2481
+ L = A, T++;
2479
2482
  }
2480
- g(Math.max(1, z));
2481
- }, b = new ResizeObserver(h);
2482
- return b.observe(x), r?.current && b.observe(r.current), h(), () => b.disconnect();
2483
- }, [n, l, ...a]), c;
2483
+ f(Math.max(1, T));
2484
+ }, g = new ResizeObserver(h);
2485
+ return g.observe(w), r?.current && g.observe(r.current), h(), () => g.disconnect();
2486
+ }, [t, o, ...a]), c;
2484
2487
  }
2485
- const Tl = (t) => {
2488
+ const Pl = (n) => {
2486
2489
  const {
2487
- className: n,
2488
- label: o,
2489
- description: s,
2490
+ className: t,
2491
+ label: s,
2492
+ description: l,
2490
2493
  options: r,
2491
- onChange: l,
2494
+ onChange: o,
2492
2495
  onSearch: a,
2493
2496
  value: i,
2494
2497
  placeholder: c,
2495
- maxHeight: g = 300,
2496
- error: x,
2497
- size: w = "md",
2498
+ maxHeight: f = 300,
2499
+ error: w,
2500
+ size: x = "md",
2498
2501
  singleLine: h = !1,
2499
- color: b = "blue",
2502
+ color: g = "blue",
2500
2503
  disabled: p = !1,
2501
- clearable: m = !0
2502
- } = t, [v, u] = W(!1), [I, R] = W(r), [y, D] = W(""), [T, B] = W(null), P = C.useRef(null), z = C.useRef(null), N = C.useRef([]), k = C.useRef(null), A = C.useRef(null), O = ie(
2503
- () => i.map((S) => r.find((E) => H(E) && G(E.value, S))).filter((S) => S !== void 0),
2504
+ clearable: u = !0
2505
+ } = n, [b, C] = W(!1), [v, k] = W(r), [I, D] = W(""), [O, P] = W(null), L = R.useRef(null), T = R.useRef(null), N = R.useRef([]), y = R.useRef(null), A = R.useRef(null), z = se(
2506
+ () => i.map((S) => r.find((F) => H(F) && G(F.value, S))).filter((S) => S !== void 0),
2504
2507
  [i, r]
2505
2508
  ), $ = (S) => {
2506
2509
  if (S === "") return r;
2507
- const E = S.toLowerCase();
2508
- return r.filter((Ie) => H(Ie) && typeof Ie.label == "string" ? Ie.label.toLowerCase().includes(E) : !0);
2509
- }, j = ie(
2510
- () => y !== "" ? I : r,
2511
- [y, I, r]
2512
- ), le = ie(
2513
- () => j.map((S, E) => !H(S) || S.disabled ? E : -1).filter((S) => S !== -1),
2510
+ const F = S.toLowerCase();
2511
+ return r.filter((Ie) => H(Ie) && typeof Ie.label == "string" ? Ie.label.toLowerCase().includes(F) : !0);
2512
+ }, j = se(
2513
+ () => I !== "" ? v : r,
2514
+ [I, v, r]
2515
+ ), re = se(
2516
+ () => j.map((S, F) => !H(S) || S.disabled ? F : -1).filter((S) => S !== -1),
2514
2517
  [j]
2515
2518
  );
2516
- we(v, () => u(!1)), _(() => {
2517
- R((a ?? $)(y));
2518
- }, [y, r, a]), _(() => {
2519
- if (v) {
2520
- setTimeout(() => z.current?.focus(), 100);
2521
- const S = r.findIndex((E) => H(E) && !E.disabled);
2522
- B(S >= 0 ? S : null);
2519
+ xe(b, () => C(!1)), _(() => {
2520
+ k((a ?? $)(I));
2521
+ }, [I, r, a]), _(() => {
2522
+ if (b) {
2523
+ setTimeout(() => T.current?.focus(), 100);
2524
+ const S = r.findIndex((F) => H(F) && !F.disabled);
2525
+ P(S >= 0 ? S : null);
2523
2526
  } else
2524
- B(null), D("");
2525
- }, [v]), _(() => {
2526
- if (!v) return;
2527
- const S = j.findIndex((E) => H(E) && !E.disabled);
2528
- B(S >= 0 ? S : null);
2529
- }, [y, v, j]);
2530
- const oe = Fr({
2527
+ P(null), D("");
2528
+ }, [b]), _(() => {
2529
+ if (!b) return;
2530
+ const S = j.findIndex((F) => H(F) && !F.disabled);
2531
+ P(S >= 0 ? S : null);
2532
+ }, [I, b, j]);
2533
+ const Ne = Br({
2531
2534
  enabled: h,
2532
- triggerRef: P,
2533
- measureRef: k,
2535
+ triggerRef: L,
2536
+ measureRef: y,
2534
2537
  trayRef: A,
2535
- itemCount: O.length,
2536
- deps: [O, x]
2537
- }), { anchorRef: L, Popover: U, getReferenceProps: se, getItemProps: ee } = _e({
2538
+ itemCount: z.length,
2539
+ deps: [z, w]
2540
+ }), { anchorRef: E, Popover: U, getReferenceProps: le, getItemProps: ee } = _e({
2538
2541
  placement: "bottom",
2539
2542
  fullWidth: !0,
2540
2543
  minWidth: 200,
2541
- onOutsideClick: () => u(!1),
2542
- open: v,
2543
- onOpenChange: u,
2544
+ open: b,
2545
+ onOpenChange: C,
2544
2546
  listRef: N,
2545
- activeIndex: T,
2546
- onNavigate: B,
2547
- disabledIndices: le
2547
+ activeIndex: O,
2548
+ onNavigate: P,
2549
+ disabledIndices: re
2548
2550
  }), Oe = (S) => {
2549
- i.some((E) => G(E, S)) ? l(i.filter((E) => !G(E, S))) : l([...i, S]);
2551
+ i.some((F) => G(F, S)) ? o(i.filter((F) => !G(F, S))) : o([...i, S]);
2550
2552
  }, ze = (S) => {
2551
- const E = j[S];
2552
- E && H(E) && !E.disabled && Oe(E.value);
2553
- }, M = j.some((S) => H(S)), F = i.length > 0, ae = h ? oe : O.length, pe = O.slice(0, ae), mt = O.length - ae;
2554
- return /* @__PURE__ */ e(Q.Provider, { value: w, children: /* @__PURE__ */ d(
2553
+ const F = j[S];
2554
+ F && H(F) && !F.disabled && Oe(F.value);
2555
+ }, M = j.some((S) => H(S)), B = i.length > 0, oe = h ? Ne : z.length, pe = z.slice(0, oe), ut = z.length - oe;
2556
+ return /* @__PURE__ */ e(Q.Provider, { value: x, children: /* @__PURE__ */ d(
2555
2557
  "div",
2556
2558
  {
2557
- className: f(
2559
+ className: m(
2558
2560
  "flex flex-col",
2559
- n
2561
+ t
2560
2562
  ),
2561
2563
  children: [
2562
- /* @__PURE__ */ e(q, { children: o }),
2563
- /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: L, children: [
2564
+ /* @__PURE__ */ e(q, { children: s }),
2565
+ /* @__PURE__ */ d("div", { className: "relative flex w-full flex-col", ref: E, children: [
2564
2566
  /* @__PURE__ */ d(
2565
2567
  "div",
2566
2568
  {
2567
- ...se({
2568
- ref: P,
2569
+ ...le({
2570
+ ref: L,
2569
2571
  role: "button",
2570
2572
  tabIndex: p ? -1 : 0,
2571
2573
  "aria-disabled": p,
2572
2574
  onClick: () => {
2573
- p || u(!v);
2575
+ p || C(!b);
2574
2576
  },
2575
2577
  onKeyDown: (S) => {
2576
- p || (S.key === " " ? (S.preventDefault(), u((E) => !E)) : S.key === "Enter" && !v ? (S.preventDefault(), u(!0)) : S.key === "Backspace" && !v && F && (S.preventDefault(), l(i.slice(0, -1))));
2578
+ p || (S.key === " " ? (S.preventDefault(), C((F) => !F)) : S.key === "Enter" && !b ? (S.preventDefault(), C(!0)) : S.key === "Backspace" && !b && B && (S.preventDefault(), o(i.slice(0, -1))));
2577
2579
  }
2578
2580
  }),
2579
- className: f(
2581
+ className: m(
2580
2582
  "flex flex-row items-center gap-1 border select-trigger transition-all duration-150 rounded-xl shadow-sm ring-0 focus:ring-4 focus:outline-none select-none",
2581
- h && f("flex-nowrap overflow-hidden", ne[w]),
2582
- !h && f("flex-wrap py-1.5", Pt[w]),
2583
- Y[w],
2584
- me[w],
2585
- m && F ? Be[w] : fe[w],
2586
- p ? "select-trigger-disabled" : x && "select-trigger-error",
2587
- !p && v && "ring-4"
2583
+ h && m("flex-nowrap overflow-hidden", te[x]),
2584
+ !h && m("flex-wrap py-1.5", Ft[x]),
2585
+ Y[x],
2586
+ me[x],
2587
+ u && B ? Be[x] : fe[x],
2588
+ p ? "select-trigger-disabled" : w && "select-trigger-error",
2589
+ !p && b && "ring-4"
2588
2590
  ),
2589
2591
  children: [
2590
- F && pe.map((S, E) => /* @__PURE__ */ e(
2592
+ B && pe.map((S, F) => /* @__PURE__ */ e(
2591
2593
  Ee,
2592
2594
  {
2593
- color: b,
2594
- className: f(
2595
- h && ae > 1 && "shrink-0",
2596
- (!h || ae === 1) && "max-w-full min-w-0"
2595
+ color: g,
2596
+ className: m(
2597
+ h && oe > 1 && "shrink-0",
2598
+ (!h || oe === 1) && "max-w-full min-w-0"
2597
2599
  ),
2598
2600
  children: S.label
2599
2601
  },
2600
- `badge-${E}`
2602
+ `badge-${F}`
2601
2603
  )),
2602
- F && mt > 0 && /* @__PURE__ */ d("span", { className: "shrink-0 text-sm font-medium select-placeholder px-1", children: [
2604
+ B && ut > 0 && /* @__PURE__ */ d("span", { className: "shrink-0 text-sm font-medium select-placeholder px-1", children: [
2603
2605
  "+",
2604
- mt,
2606
+ ut,
2605
2607
  " more"
2606
2608
  ] }),
2607
- !F && c && /* @__PURE__ */ e("span", { className: "select-placeholder", children: c })
2609
+ !B && c && /* @__PURE__ */ e("span", { className: "select-placeholder", children: c })
2608
2610
  ]
2609
2611
  }
2610
2612
  ),
2611
2613
  h && /* @__PURE__ */ d(
2612
2614
  "div",
2613
2615
  {
2614
- ref: k,
2616
+ ref: y,
2615
2617
  "aria-hidden": !0,
2616
2618
  className: "absolute top-0 left-0 invisible pointer-events-none flex flex-row flex-nowrap items-center gap-1 w-max",
2617
2619
  children: [
2618
- O.map((S, E) => /* @__PURE__ */ e(Ee, { color: b, children: S.label }, `measure-${E}`)),
2619
- O.length > 0 && /* @__PURE__ */ d("span", { className: "text-sm font-medium px-1", children: [
2620
+ z.map((S, F) => /* @__PURE__ */ e(Ee, { color: g, children: S.label }, `measure-${F}`)),
2621
+ z.length > 0 && /* @__PURE__ */ d("span", { className: "text-sm font-medium px-1", children: [
2620
2622
  "+",
2621
- O.length,
2623
+ z.length,
2622
2624
  " more"
2623
2625
  ] })
2624
2626
  ]
2625
2627
  }
2626
2628
  ),
2627
2629
  /* @__PURE__ */ d(he, { ref: A, children: [
2628
- !p && x && /* @__PURE__ */ e(re, {}),
2629
- m && F && !p && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => l([]) }),
2630
- /* @__PURE__ */ e(Z, { Icon: ve })
2630
+ !p && w && /* @__PURE__ */ e(ne, {}),
2631
+ u && B && !p && /* @__PURE__ */ e(Z, { Icon: de, onClick: () => o([]) }),
2632
+ /* @__PURE__ */ e(Z, { Icon: be })
2631
2633
  ] }),
2632
- /* @__PURE__ */ e(U, { open: v, children: /* @__PURE__ */ d(xe, { className: "gap-0 !p-0", style: { maxHeight: g }, children: [
2634
+ /* @__PURE__ */ e(U, { open: b, children: /* @__PURE__ */ d(ve, { className: "gap-0 !p-0", style: { maxHeight: f }, children: [
2633
2635
  /* @__PURE__ */ d("div", { className: "sticky top-0 border-b select-search-bar py-1 backdrop-blur-sm", children: [
2634
2636
  /* @__PURE__ */ e(
2635
2637
  "input",
2636
2638
  {
2637
- ref: z,
2639
+ ref: T,
2638
2640
  type: "text",
2639
2641
  placeholder: "Search",
2640
- value: y,
2642
+ value: I,
2641
2643
  className: "appearance-none border-none w-full bg-transparent rounded- pl-10 transition-all duration-150 focus:outline-none ring-0 placeholder:text-[var(--color-input-placeholder)]",
2642
2644
  onChange: (S) => D(S.target.value),
2643
2645
  onKeyDown: (S) => {
2644
- S.key === "Enter" && T != null ? (S.preventDefault(), ze(T)) : S.key === "Backspace" && y === "" && F && (S.preventDefault(), l(i.slice(0, -1)));
2646
+ S.key === "Enter" && O != null ? (S.preventDefault(), ze(O)) : S.key === "Backspace" && I === "" && B && (S.preventDefault(), o(i.slice(0, -1)));
2645
2647
  }
2646
2648
  }
2647
2649
  ),
2648
- /* @__PURE__ */ e(Me, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
2650
+ /* @__PURE__ */ e(Fe, { className: "absolute select-search-icon left-4 top-4 h-4 w-4" })
2649
2651
  ] }),
2650
2652
  /* @__PURE__ */ d("div", { className: "flex flex-col gap-1 p-2", children: [
2651
- y !== "" && !M && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2652
- j.map((S, E) => {
2653
+ I !== "" && !M && /* @__PURE__ */ e("div", { className: "flex flex-col items-center justify-center py-6", children: /* @__PURE__ */ e(nt, { className: "h-6 w-6 text-[var(--color-input-text)]" }) }),
2654
+ j.map((S, F) => {
2653
2655
  if (!H(S))
2654
2656
  return S.kind === "header" ? /* @__PURE__ */ e(
2655
2657
  He,
2656
2658
  {
2657
2659
  ref: (ge) => {
2658
- N.current[E] = ge;
2660
+ N.current[F] = ge;
2659
2661
  },
2660
2662
  children: S.label
2661
2663
  },
2662
- `header-${E}`
2664
+ `header-${F}`
2663
2665
  ) : /* @__PURE__ */ e(
2664
2666
  $e,
2665
2667
  {
2666
2668
  ref: (ge) => {
2667
- N.current[E] = ge;
2669
+ N.current[F] = ge;
2668
2670
  }
2669
2671
  },
2670
- `divider-${E}`
2672
+ `divider-${F}`
2671
2673
  );
2672
2674
  const Ie = i.some((ge) => G(ge, S.value));
2673
2675
  return /* @__PURE__ */ e(
@@ -2675,132 +2677,132 @@ const Tl = (t) => {
2675
2677
  {
2676
2678
  ...ee({
2677
2679
  ref(ge) {
2678
- N.current[E] = ge;
2680
+ N.current[F] = ge;
2679
2681
  }
2680
2682
  }),
2681
- onClick: () => ze(E),
2683
+ onClick: () => ze(F),
2682
2684
  selected: Ie,
2683
- active: T === E,
2685
+ active: O === F,
2684
2686
  disabled: S.disabled,
2685
2687
  children: S.label
2686
2688
  },
2687
- `option-${E}`
2689
+ `option-${F}`
2688
2690
  );
2689
2691
  })
2690
2692
  ] })
2691
2693
  ] }) })
2692
2694
  ] }),
2693
- /* @__PURE__ */ e(V, { children: s }),
2694
- /* @__PURE__ */ e(K, { children: x })
2695
+ /* @__PURE__ */ e(V, { children: l }),
2696
+ /* @__PURE__ */ e(K, { children: w })
2695
2697
  ]
2696
2698
  }
2697
2699
  ) });
2698
- }, Ll = C.forwardRef((t, n) => {
2700
+ }, Ll = R.forwardRef((n, t) => {
2699
2701
  const {
2700
- className: o,
2701
- children: s,
2702
+ className: s,
2703
+ children: l,
2702
2704
  ...r
2703
- } = t;
2705
+ } = n;
2704
2706
  return /* @__PURE__ */ e(
2705
2707
  "div",
2706
2708
  {
2707
- ref: n,
2708
- className: f(
2709
+ ref: t,
2710
+ className: m(
2709
2711
  "flex flex-col gap-6 border panel-base rounded-2xl shadow-sm px-6 py-6",
2710
- o
2712
+ s
2711
2713
  ),
2712
2714
  ...r,
2713
- children: s
2715
+ children: l
2714
2716
  }
2715
2717
  );
2716
- }), Pl = C.forwardRef((t, n) => {
2718
+ }), El = R.forwardRef((n, t) => {
2717
2719
  const {
2718
- className: o,
2719
- children: s,
2720
+ className: s,
2721
+ children: l,
2720
2722
  ...r
2721
- } = t;
2723
+ } = n;
2722
2724
  return /* @__PURE__ */ e(
2723
2725
  "div",
2724
2726
  {
2725
- ref: n,
2726
- className: f(
2727
+ ref: t,
2728
+ className: m(
2727
2729
  "flex flex-col gap-1 border panel-base rounded-2xl shadow-sm p-2",
2728
- o
2730
+ s
2729
2731
  ),
2730
2732
  ...r,
2731
- children: s
2733
+ children: l
2732
2734
  }
2733
2735
  );
2734
- }), yt = "input-description text-sm font-medium", El = (t) => {
2736
+ }), yt = "input-description text-sm font-medium", Fl = (n) => {
2735
2737
  const {
2736
- className: n,
2737
- label: o,
2738
- children: s,
2738
+ className: t,
2739
+ label: s,
2740
+ children: l,
2739
2741
  orientation: r = "vertical",
2740
- ...l
2741
- } = t;
2742
+ ...o
2743
+ } = n;
2742
2744
  return r === "horizontal" ? /* @__PURE__ */ d(
2743
2745
  "div",
2744
2746
  {
2745
- className: f(
2747
+ className: m(
2746
2748
  "flex flex-row items-center gap-3 px-3 py-2",
2747
- n
2749
+ t
2748
2750
  ),
2749
- ...l,
2751
+ ...o,
2750
2752
  children: [
2751
- /* @__PURE__ */ e("div", { className: f(yt, "w-1/2 line-clamp-1 break-all"), children: o }),
2752
- /* @__PURE__ */ e("div", { className: "w-1/2 line-clamp-1 break-all", children: s })
2753
+ /* @__PURE__ */ e("div", { className: m(yt, "w-1/2 line-clamp-1 break-all"), children: s }),
2754
+ /* @__PURE__ */ e("div", { className: "w-1/2 line-clamp-1 break-all", children: l })
2753
2755
  ]
2754
2756
  }
2755
2757
  ) : /* @__PURE__ */ d(
2756
2758
  "div",
2757
2759
  {
2758
- className: f(
2760
+ className: m(
2759
2761
  "flex flex-col gap-1 px-3 py-2",
2760
- n
2762
+ t
2761
2763
  ),
2762
- ...l,
2764
+ ...o,
2763
2765
  children: [
2764
- o && /* @__PURE__ */ e("div", { className: yt, children: o }),
2765
- /* @__PURE__ */ e("div", { children: s })
2766
+ s && /* @__PURE__ */ e("div", { className: yt, children: s }),
2767
+ /* @__PURE__ */ e("div", { children: l })
2766
2768
  ]
2767
2769
  }
2768
2770
  );
2769
- }, Br = {
2771
+ }, Ar = {
2770
2772
  error: et,
2771
- warning: on,
2773
+ warning: an,
2772
2774
  success: tt,
2773
- info: ln
2774
- }, Ar = {
2775
+ info: sn
2776
+ }, Ur = {
2775
2777
  error: "text-[var(--color-status-error)]",
2776
2778
  warning: "text-[var(--color-status-warning)]",
2777
2779
  success: "text-[var(--color-status-success)]",
2778
2780
  info: "text-[var(--color-status-info)]"
2779
- }, Ct = "inline-flex flex-row gap-3 items-center justify-between h-10 px-3 font-semibold ring-0 dropdown-item rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent", Ml = (t) => {
2781
+ }, kt = "inline-flex flex-row gap-3 items-center justify-between h-10 px-3 font-semibold ring-0 dropdown-item rounded-lg cursor-pointer transition-all duration-150 select-none focus:outline-none focus:ring-0 border border-transparent bg-transparent", Ml = (n) => {
2780
2782
  const {
2781
- className: n,
2782
- children: o,
2783
- Icon: s,
2783
+ className: t,
2784
+ children: s,
2785
+ Icon: l,
2784
2786
  status: r,
2785
- ...l
2786
- } = t, a = r ? Br[r] : null, i = /* @__PURE__ */ d(te, { children: [
2787
+ ...o
2788
+ } = n, a = r ? Ar[r] : null, i = /* @__PURE__ */ d(ce, { children: [
2787
2789
  /* @__PURE__ */ d("span", { className: "inline-flex flex-row items-center gap-3 min-w-0", children: [
2788
- s && /* @__PURE__ */ e(s, { className: "h-5 w-5 shrink-0" }),
2789
- /* @__PURE__ */ e("span", { className: "truncate", children: o })
2790
+ l && /* @__PURE__ */ e(l, { className: "h-5 w-5 shrink-0" }),
2791
+ /* @__PURE__ */ e("span", { className: "truncate", children: s })
2790
2792
  ] }),
2791
2793
  /* @__PURE__ */ d("span", { className: "inline-flex flex-row items-center gap-2 shrink-0", children: [
2792
- a && r && /* @__PURE__ */ e(a, { className: f("h-5 w-5", Ar[r]) }),
2793
- /* @__PURE__ */ e(sn, { className: "h-5 w-5 text-[var(--color-input-icon-button-icon)]" })
2794
+ a && r && /* @__PURE__ */ e(a, { className: m("h-5 w-5", Ur[r]) }),
2795
+ /* @__PURE__ */ e(cn, { className: "h-5 w-5 text-[var(--color-input-icon-button-icon)]" })
2794
2796
  ] })
2795
2797
  ] });
2796
- if (l.href !== void 0) {
2797
- const { href: c, ...g } = l;
2798
+ if (o.href !== void 0) {
2799
+ const { href: c, ...f } = o;
2798
2800
  return /* @__PURE__ */ e(
2799
2801
  "a",
2800
2802
  {
2801
2803
  href: c,
2802
- className: f(Ct, n),
2803
- ...g,
2804
+ className: m(kt, t),
2805
+ ...f,
2804
2806
  children: i
2805
2807
  }
2806
2808
  );
@@ -2808,66 +2810,66 @@ const Tl = (t) => {
2808
2810
  return /* @__PURE__ */ e(
2809
2811
  "button",
2810
2812
  {
2811
- className: f(Ct, n),
2812
- ...l,
2813
+ className: m(kt, t),
2814
+ ...o,
2813
2815
  children: i
2814
2816
  }
2815
2817
  );
2816
- }, Fl = (t) => {
2818
+ }, Bl = (n) => {
2817
2819
  const {
2818
- className: n,
2819
- vertical: o = !1,
2820
- ...s
2821
- } = t;
2820
+ className: t,
2821
+ vertical: s = !1,
2822
+ ...l
2823
+ } = n;
2822
2824
  return /* @__PURE__ */ e(
2823
2825
  "div",
2824
2826
  {
2825
- className: f(
2826
- o ? "w-px h-full bg-[var(--color-divider)]" : "w-full h-px bg-[var(--color-divider)]",
2827
- n
2827
+ className: m(
2828
+ s ? "w-px h-full bg-[var(--color-divider)]" : "w-full h-px bg-[var(--color-divider)]",
2829
+ t
2828
2830
  ),
2829
- ...s
2831
+ ...l
2830
2832
  }
2831
2833
  );
2832
- }, Bl = (t) => {
2834
+ }, Al = (n) => {
2833
2835
  const {
2834
- children: n,
2835
- content: o,
2836
- className: s,
2836
+ children: t,
2837
+ content: s,
2838
+ className: l,
2837
2839
  placement: r = "top",
2838
- minWidth: l = 100,
2840
+ minWidth: o = 100,
2839
2841
  maxWidth: a = 200
2840
- } = t, [i, c] = W(!1), { anchorRef: g, Popover: x } = dt({
2842
+ } = n, [i, c] = W(!1), { anchorRef: f, Popover: w } = ct({
2841
2843
  placement: r,
2842
- minWidth: l,
2844
+ minWidth: o,
2843
2845
  maxWidth: a
2844
2846
  });
2845
2847
  return /* @__PURE__ */ d(
2846
2848
  "span",
2847
2849
  {
2848
- ref: g,
2849
- className: s,
2850
+ ref: f,
2851
+ className: l,
2850
2852
  onMouseEnter: () => c(!0),
2851
2853
  onMouseLeave: () => c(!1),
2852
2854
  children: [
2853
- n,
2854
- /* @__PURE__ */ e(x, { open: i, children: /* @__PURE__ */ e(xe, { children: o }) })
2855
+ t,
2856
+ /* @__PURE__ */ e(w, { open: i, children: /* @__PURE__ */ e(ve, { children: s }) })
2855
2857
  ]
2856
2858
  }
2857
2859
  );
2858
- }, Al = (t) => {
2860
+ }, Ul = (n) => {
2859
2861
  const {
2860
- open: n,
2861
- onDismiss: o,
2862
- enableDismissOnOutsideClick: s,
2862
+ open: t,
2863
+ onDismiss: s,
2864
+ enableDismissOnOutsideClick: l,
2863
2865
  enableDismissOnEscKey: r,
2864
- enableDismissButton: l,
2866
+ enableDismissButton: o,
2865
2867
  className: a,
2866
2868
  children: i,
2867
2869
  maxWidth: c = 600
2868
- } = t;
2869
- return we(!!r && n, o || (() => {
2870
- })), /* @__PURE__ */ e(De, { children: n && /* @__PURE__ */ d(Fe, { children: [
2870
+ } = n;
2871
+ return xe(!!r && t, s || (() => {
2872
+ })), /* @__PURE__ */ e(De, { children: t && /* @__PURE__ */ d(Me, { children: [
2871
2873
  /* @__PURE__ */ e(
2872
2874
  J.div,
2873
2875
  {
@@ -2878,10 +2880,10 @@ const Tl = (t) => {
2878
2880
  exit: { opacity: 0 },
2879
2881
  transition: { duration: 0.15, ease: "easeInOut" },
2880
2882
  children: /* @__PURE__ */ e(
2881
- rt,
2883
+ Ot,
2882
2884
  {
2883
2885
  className: "modal-overlay backdrop-blur-[1px]",
2884
- onClick: s ? o : void 0,
2886
+ onClick: l ? s : void 0,
2885
2887
  lockScroll: !0
2886
2888
  }
2887
2889
  )
@@ -2890,7 +2892,7 @@ const Tl = (t) => {
2890
2892
  /* @__PURE__ */ e("div", { className: "fixed inset-0 flex flex-col items-center pointer-events-none p-4 lg:p-12 overflow-y-auto z-50", children: /* @__PURE__ */ d(
2891
2893
  J.div,
2892
2894
  {
2893
- className: f(
2895
+ className: m(
2894
2896
  "flex flex-col modal-content rounded-2xl shadow-xl p-6 lg:p-12 pointer-events-auto w-full relative",
2895
2897
  a
2896
2898
  ),
@@ -2900,14 +2902,14 @@ const Tl = (t) => {
2900
2902
  exit: { opacity: 0, scale: 0.98, translateY: 10 },
2901
2903
  transition: { duration: 0.15, ease: "easeInOut" },
2902
2904
  children: [
2903
- l && /* @__PURE__ */ e(
2904
- Bt,
2905
+ o && /* @__PURE__ */ e(
2906
+ Ut,
2905
2907
  {
2906
2908
  Icon: de,
2907
2909
  className: "absolute top-4 right-4",
2908
2910
  variant: "transparent",
2909
2911
  size: "sm",
2910
- onClick: o
2912
+ onClick: s
2911
2913
  }
2912
2914
  ),
2913
2915
  i
@@ -2915,19 +2917,19 @@ const Tl = (t) => {
2915
2917
  }
2916
2918
  ) })
2917
2919
  ] }) });
2918
- }, Ul = (t) => {
2920
+ }, Wl = (n) => {
2919
2921
  const {
2920
- open: n,
2921
- onDismiss: o,
2922
- enableDismissOnOutsideClick: s,
2922
+ open: t,
2923
+ onDismiss: s,
2924
+ enableDismissOnOutsideClick: l,
2923
2925
  enableDismissOnEscKey: r,
2924
- enableDismissButton: l,
2926
+ enableDismissButton: o,
2925
2927
  className: a,
2926
2928
  children: i,
2927
2929
  maxWidth: c = 480
2928
- } = t;
2929
- return we(!!r && n, o || (() => {
2930
- })), /* @__PURE__ */ e(De, { children: n && /* @__PURE__ */ d(Fe, { children: [
2930
+ } = n;
2931
+ return xe(!!r && t, s || (() => {
2932
+ })), /* @__PURE__ */ e(De, { children: t && /* @__PURE__ */ d(Me, { children: [
2931
2933
  /* @__PURE__ */ e(
2932
2934
  J.div,
2933
2935
  {
@@ -2938,10 +2940,10 @@ const Tl = (t) => {
2938
2940
  exit: { opacity: 0 },
2939
2941
  transition: { duration: 0.15, ease: "easeInOut" },
2940
2942
  children: /* @__PURE__ */ e(
2941
- rt,
2943
+ Ot,
2942
2944
  {
2943
2945
  className: "modal-overlay backdrop-blur-[1px]",
2944
- onClick: s ? o : void 0,
2946
+ onClick: l ? s : void 0,
2945
2947
  lockScroll: !0
2946
2948
  }
2947
2949
  )
@@ -2950,7 +2952,7 @@ const Tl = (t) => {
2950
2952
  /* @__PURE__ */ e("div", { className: "fixed inset-0 flex flex-row justify-end pointer-events-none z-50", children: /* @__PURE__ */ d(
2951
2953
  J.div,
2952
2954
  {
2953
- className: f(
2955
+ className: m(
2954
2956
  "flex flex-col modal-content shadow-xl p-6 lg:p-12 pointer-events-auto h-full w-full overflow-y-auto relative",
2955
2957
  a
2956
2958
  ),
@@ -2960,14 +2962,14 @@ const Tl = (t) => {
2960
2962
  exit: { translateX: "100%" },
2961
2963
  transition: { duration: 0.25, ease: [0.32, 0.72, 0, 1] },
2962
2964
  children: [
2963
- l && /* @__PURE__ */ e(
2964
- Bt,
2965
+ o && /* @__PURE__ */ e(
2966
+ Ut,
2965
2967
  {
2966
2968
  Icon: de,
2967
2969
  className: "absolute top-4 right-4",
2968
2970
  variant: "transparent",
2969
2971
  size: "sm",
2970
- onClick: o
2972
+ onClick: s
2971
2973
  }
2972
2974
  ),
2973
2975
  i
@@ -2975,186 +2977,186 @@ const Tl = (t) => {
2975
2977
  }
2976
2978
  ) })
2977
2979
  ] }) });
2978
- }, Ur = (t) => {
2980
+ }, Wr = (n) => {
2979
2981
  const {
2980
- className: n,
2981
- tabs: o
2982
- } = t;
2983
- return /* @__PURE__ */ e("div", { className: f(
2982
+ className: t,
2983
+ tabs: s
2984
+ } = n;
2985
+ return /* @__PURE__ */ e("div", { className: m(
2984
2986
  "h-12 tab-container p-1 rounded-xl inline-flex flex-row space-x-1 overflow-x-auto mat-ui-hide-scrollbars",
2985
- n
2986
- ), children: o.map((s, r) => {
2987
- const l = f(
2987
+ t
2988
+ ), children: s.map((l, r) => {
2989
+ const o = m(
2988
2990
  "shrink-0 px-4 h-full inline-flex flex-row items-center font-semibold rounded-xl cursor-pointer border border-transparent ing-0 tab-button transition-all duration-150 select-none focus:outline-none focus:ring-0",
2989
- s.active && "tab-button-active shadow-sm"
2991
+ l.active && "tab-button-active shadow-sm"
2990
2992
  );
2991
- return s.href ? /* @__PURE__ */ d(
2993
+ return l.href ? /* @__PURE__ */ d(
2992
2994
  "a",
2993
2995
  {
2994
- href: s.href,
2995
- className: l,
2996
+ href: l.href,
2997
+ className: o,
2996
2998
  children: [
2997
- s.Icon && /* @__PURE__ */ e(s.Icon, { className: "h-5 w-5 shrink-0 mr-2 -ml-1" }),
2998
- s.label
2999
+ l.Icon && /* @__PURE__ */ e(l.Icon, { className: "h-5 w-5 shrink-0 mr-2 -ml-1" }),
3000
+ l.label
2999
3001
  ]
3000
3002
  },
3001
3003
  r
3002
3004
  ) : /* @__PURE__ */ d(
3003
3005
  "button",
3004
3006
  {
3005
- className: l,
3006
- onClick: s.onClick,
3007
+ className: o,
3008
+ onClick: l.onClick,
3007
3009
  children: [
3008
- s.Icon && /* @__PURE__ */ e(s.Icon, { className: "h-5 w-5 shrink-0 mr-2 -ml-1" }),
3009
- s.label
3010
+ l.Icon && /* @__PURE__ */ e(l.Icon, { className: "h-5 w-5 shrink-0 mr-2 -ml-1" }),
3011
+ l.label
3010
3012
  ]
3011
3013
  },
3012
3014
  r
3013
3015
  );
3014
3016
  }) });
3015
- }, Wl = (t) => {
3017
+ }, Hl = (n) => {
3016
3018
  const {
3017
- duration: n = 0.3,
3018
- ease: o = "easeInOut",
3019
- horizontal: s = !1,
3019
+ duration: t = 0.3,
3020
+ ease: s = "easeInOut",
3021
+ horizontal: l = !1,
3020
3022
  children: r,
3021
- className: l,
3023
+ className: o,
3022
3024
  ...a
3023
- } = t, i = C.useRef(null), c = C.useRef(null), g = C.useRef(null);
3024
- return C.useEffect(() => {
3025
- const x = i.current, w = c.current;
3026
- if (!x || !w) return;
3025
+ } = n, i = R.useRef(null), c = R.useRef(null), f = R.useRef(null);
3026
+ return R.useEffect(() => {
3027
+ const w = i.current, x = c.current;
3028
+ if (!w || !x) return;
3027
3029
  let h = !0;
3028
- const b = () => {
3029
- const m = s ? x.scrollWidth - x.clientWidth : x.scrollHeight - x.clientHeight, v = s ? x.scrollLeft : x.scrollTop;
3030
- if (!(m <= 0 || Math.abs(m - v) < 1)) {
3030
+ const g = () => {
3031
+ const u = l ? w.scrollWidth - w.clientWidth : w.scrollHeight - w.clientHeight, b = l ? w.scrollLeft : w.scrollTop;
3032
+ if (!(u <= 0 || Math.abs(u - b) < 1)) {
3031
3033
  if (h) {
3032
- h = !1, s ? x.scrollLeft = m : x.scrollTop = m;
3034
+ h = !1, l ? w.scrollLeft = u : w.scrollTop = u;
3033
3035
  return;
3034
3036
  }
3035
- g.current?.stop(), g.current = Xt(v, m, {
3036
- duration: n,
3037
- ease: o,
3038
- onUpdate: (u) => {
3039
- s ? x.scrollLeft = u : x.scrollTop = u;
3037
+ f.current?.stop(), f.current = Kt(b, u, {
3038
+ duration: t,
3039
+ ease: s,
3040
+ onUpdate: (C) => {
3041
+ l ? w.scrollLeft = C : w.scrollTop = C;
3040
3042
  }
3041
3043
  });
3042
3044
  }
3043
- }, p = new ResizeObserver(b);
3044
- return p.observe(w), () => {
3045
- p.disconnect(), g.current?.stop();
3045
+ }, p = new ResizeObserver(g);
3046
+ return p.observe(x), () => {
3047
+ p.disconnect(), f.current?.stop();
3046
3048
  };
3047
- }, [n, o, s]), /* @__PURE__ */ e(
3049
+ }, [t, s, l]), /* @__PURE__ */ e(
3048
3050
  "div",
3049
3051
  {
3050
3052
  ref: i,
3051
- className: f(
3053
+ className: m(
3052
3054
  "min-h-0 min-w-0",
3053
- s ? "overflow-x-auto" : "overflow-y-auto",
3054
- l
3055
+ l ? "overflow-x-auto" : "overflow-y-auto",
3056
+ o
3055
3057
  ),
3056
3058
  ...a,
3057
3059
  children: /* @__PURE__ */ e("div", { ref: c, children: r })
3058
3060
  }
3059
3061
  );
3060
3062
  };
3061
- function Wr(t) {
3063
+ function Hr(n) {
3062
3064
  const {
3063
- onDelta: n,
3064
- onDragStart: o,
3065
- onDragEnd: s,
3065
+ onDelta: t,
3066
+ onDragStart: s,
3067
+ onDragEnd: l,
3066
3068
  disabled: r = !1,
3067
- primaryButtonOnly: l = !0,
3069
+ primaryButtonOnly: o = !0,
3068
3070
  preventScrollOnMove: a = !0
3069
- } = t, [i, c] = C.useState(!1), g = C.useRef(!1), x = C.useRef(0), w = C.useRef(0), h = C.useRef(0), b = C.useRef(null), p = C.useRef(null), m = C.useRef({ onDelta: n, onDragStart: o, onDragEnd: s, preventScrollOnMove: a });
3070
- C.useEffect(() => {
3071
- m.current = { onDelta: n, onDragStart: o, onDragEnd: s, preventScrollOnMove: a };
3071
+ } = n, [i, c] = R.useState(!1), f = R.useRef(!1), w = R.useRef(0), x = R.useRef(0), h = R.useRef(0), g = R.useRef(null), p = R.useRef(null), u = R.useRef({ onDelta: t, onDragStart: s, onDragEnd: l, preventScrollOnMove: a });
3072
+ R.useEffect(() => {
3073
+ u.current = { onDelta: t, onDragStart: s, onDragEnd: l, preventScrollOnMove: a };
3072
3074
  });
3073
- const v = C.useRef({}), u = C.useCallback((R) => {
3074
- if (!g.current) return;
3075
- const y = {
3076
- clientX: R ?? w.current,
3077
- startX: x.current,
3075
+ const b = R.useRef({}), C = R.useCallback((k) => {
3076
+ if (!f.current) return;
3077
+ const I = {
3078
+ clientX: k ?? x.current,
3079
+ startX: w.current,
3078
3080
  totalDeltaX: h.current,
3079
- target: b.current
3081
+ target: g.current
3080
3082
  };
3081
- g.current = !1, c(!1);
3082
- const { move: D, up: T, keydown: B } = v.current;
3083
- D && window.removeEventListener("pointermove", D, !0), T && (window.removeEventListener("pointerup", T, !0), window.removeEventListener("pointercancel", T, !0)), B && window.removeEventListener("keydown", B, !0), v.current = {}, p.current != null && (cancelAnimationFrame(p.current), p.current = null), m.current.onDragEnd?.(y), b.current = null, h.current = 0;
3084
- }, []), I = C.useCallback((R) => {
3085
- if (r || l && R.button !== 0) return;
3086
- R.target.setPointerCapture?.(R.pointerId), x.current = R.clientX, w.current = R.clientX, h.current = 0, b.current = R.target, g.current = !0, c(!0);
3087
- const y = {
3088
- clientX: R.clientX,
3089
- startX: R.clientX,
3083
+ f.current = !1, c(!1);
3084
+ const { move: D, up: O, keydown: P } = b.current;
3085
+ D && window.removeEventListener("pointermove", D, !0), O && (window.removeEventListener("pointerup", O, !0), window.removeEventListener("pointercancel", O, !0)), P && window.removeEventListener("keydown", P, !0), b.current = {}, p.current != null && (cancelAnimationFrame(p.current), p.current = null), u.current.onDragEnd?.(I), g.current = null, h.current = 0;
3086
+ }, []), v = R.useCallback((k) => {
3087
+ if (r || o && k.button !== 0) return;
3088
+ k.target.setPointerCapture?.(k.pointerId), w.current = k.clientX, x.current = k.clientX, h.current = 0, g.current = k.target, f.current = !0, c(!0);
3089
+ const I = {
3090
+ clientX: k.clientX,
3091
+ startX: k.clientX,
3090
3092
  totalDeltaX: 0,
3091
- target: R.target
3093
+ target: k.target
3092
3094
  };
3093
- m.current.onDragStart?.(y);
3094
- const D = (P) => {
3095
- g.current && p.current == null && (p.current = requestAnimationFrame(() => {
3095
+ u.current.onDragStart?.(I);
3096
+ const D = (L) => {
3097
+ f.current && p.current == null && (p.current = requestAnimationFrame(() => {
3096
3098
  p.current = null;
3097
- const z = P.clientX, N = z - w.current;
3099
+ const T = L.clientX, N = T - x.current;
3098
3100
  if (N === 0) return;
3099
- w.current = z, h.current += N;
3100
- const k = {
3101
- clientX: z,
3102
- startX: x.current,
3101
+ x.current = T, h.current += N;
3102
+ const y = {
3103
+ clientX: T,
3104
+ startX: w.current,
3103
3105
  totalDeltaX: h.current,
3104
- target: b.current
3106
+ target: g.current
3105
3107
  };
3106
- m.current.preventScrollOnMove && P.preventDefault(), m.current.onDelta(N, k);
3108
+ u.current.preventScrollOnMove && L.preventDefault(), u.current.onDelta(N, y);
3107
3109
  }));
3108
- }, T = (P) => {
3109
- u(P.clientX);
3110
- }, B = (P) => {
3111
- P.key === "Escape" && (P.preventDefault(), u());
3110
+ }, O = (L) => {
3111
+ C(L.clientX);
3112
+ }, P = (L) => {
3113
+ L.key === "Escape" && (L.preventDefault(), C());
3112
3114
  };
3113
- v.current = { move: D, up: T, keydown: B }, window.addEventListener("pointermove", D, {
3115
+ b.current = { move: D, up: O, keydown: P }, window.addEventListener("pointermove", D, {
3114
3116
  passive: !a,
3115
3117
  capture: !0
3116
- }), window.addEventListener("pointerup", T, { capture: !0 }), window.addEventListener("pointercancel", T, { capture: !0 }), window.addEventListener("keydown", B, !0);
3117
- }, [u, r, a, l]);
3118
- return C.useEffect(() => () => {
3119
- g.current && u();
3120
- }, [u]), {
3118
+ }), window.addEventListener("pointerup", O, { capture: !0 }), window.addEventListener("pointercancel", O, { capture: !0 }), window.addEventListener("keydown", P, !0);
3119
+ }, [C, r, a, o]);
3120
+ return R.useEffect(() => () => {
3121
+ f.current && C();
3122
+ }, [C]), {
3121
3123
  isDragging: i,
3122
3124
  bind: {
3123
- onPointerDown: I,
3125
+ onPointerDown: v,
3124
3126
  role: "separator",
3125
3127
  style: { touchAction: "none", cursor: "col-resize", userSelect: "none" }
3126
3128
  }
3127
3129
  };
3128
3130
  }
3129
- const Hr = (t) => {
3131
+ const $r = (n) => {
3130
3132
  const {
3131
- column: n,
3132
- width: o,
3133
- height: s,
3133
+ column: t,
3134
+ width: s,
3135
+ height: l,
3134
3136
  onResize: r,
3135
- sortDirection: l,
3137
+ sortDirection: o,
3136
3138
  onSortClick: a
3137
- } = t, i = !!n.sortable, { bind: c } = Wr({
3138
- onDelta: (g) => r(g)
3139
+ } = n, i = !!t.sortable, { bind: c } = Hr({
3140
+ onDelta: (f) => r(f)
3139
3141
  });
3140
3142
  return /* @__PURE__ */ d(
3141
3143
  "div",
3142
3144
  {
3143
- style: { width: o, height: s },
3145
+ style: { width: s, height: l },
3144
3146
  className: "flex flex-row items-stretch select-none shrink-0",
3145
3147
  children: [
3146
3148
  /* @__PURE__ */ d(
3147
3149
  "div",
3148
3150
  {
3149
- className: f(
3151
+ className: m(
3150
3152
  "flex-1 min-w-0 px-4 table-header-cell transition-colors duration-100 flex flex-row items-center gap-2",
3151
3153
  i && "cursor-pointer"
3152
3154
  ),
3153
3155
  onClick: i ? a : void 0,
3154
3156
  children: [
3155
- /* @__PURE__ */ e("span", { className: "truncate", children: n.header }),
3156
- i && l === "asc" && /* @__PURE__ */ e(an, { className: "h-4 w-4 shrink-0" }),
3157
- i && l === "desc" && /* @__PURE__ */ e(ve, { className: "h-4 w-4 shrink-0" })
3157
+ /* @__PURE__ */ e("span", { className: "truncate", children: t.header }),
3158
+ i && o === "asc" && /* @__PURE__ */ e(dn, { className: "h-4 w-4 shrink-0" }),
3159
+ i && o === "desc" && /* @__PURE__ */ e(be, { className: "h-4 w-4 shrink-0" })
3158
3160
  ]
3159
3161
  }
3160
3162
  ),
@@ -3174,78 +3176,79 @@ const Hr = (t) => {
3174
3176
  ]
3175
3177
  }
3176
3178
  );
3177
- }, ye = 200, $r = 60, _r = (t) => {
3178
- const n = {};
3179
- for (const o of t)
3180
- n[o.id] = o.defaultWidth ?? ye;
3181
- return n;
3182
- }, jr = (t) => {
3179
+ }, ke = 200, _r = 60, jr = (n) => {
3180
+ const t = {};
3181
+ for (const s of n)
3182
+ t[s.id] = s.defaultWidth ?? ke;
3183
+ return t;
3184
+ }, Xr = (n) => {
3183
3185
  const {
3184
- columns: n,
3185
- rows: o,
3186
- getRowId: s,
3186
+ columns: t,
3187
+ rows: s,
3188
+ getRowId: l,
3187
3189
  onRowClick: r,
3188
- sort: l,
3190
+ sort: o,
3189
3191
  onSortChange: a,
3190
3192
  className: i,
3191
3193
  rowHeight: c = 44,
3192
- headerHeight: g = 44
3193
- } = t, [x, w] = W(() => _r(n));
3194
+ headerHeight: f = 44,
3195
+ emptyState: w
3196
+ } = n, [x, h] = W(() => jr(t));
3194
3197
  _(() => {
3195
- w((u) => {
3196
- const I = {};
3197
- let R = Object.keys(u).length !== n.length;
3198
- for (const y of n)
3199
- y.id in u ? I[y.id] = u[y.id] : (I[y.id] = y.defaultWidth ?? ye, R = !0);
3200
- return R ? I : u;
3198
+ h((v) => {
3199
+ const k = {};
3200
+ let I = Object.keys(v).length !== t.length;
3201
+ for (const D of t)
3202
+ D.id in v ? k[D.id] = v[D.id] : (k[D.id] = D.defaultWidth ?? ke, I = !0);
3203
+ return I ? k : v;
3201
3204
  });
3202
- }, [n]);
3203
- const h = Le((u, I, R) => {
3204
- w((y) => {
3205
- const D = y[u] ?? ye, T = Math.max(R, D + I);
3206
- return T === D ? y : { ...y, [u]: T };
3205
+ }, [t]);
3206
+ const g = Pe((v, k, I) => {
3207
+ h((D) => {
3208
+ const O = D[v] ?? ke, P = Math.max(I, O + k);
3209
+ return P === O ? D : { ...D, [v]: P };
3207
3210
  });
3208
- }, []), b = Le((u) => {
3211
+ }, []), p = Pe((v) => {
3209
3212
  if (a) {
3210
- if (!l || l.columnId !== u) {
3211
- a({ columnId: u, direction: "asc" });
3213
+ if (!o || o.columnId !== v) {
3214
+ a({ columnId: v, direction: "asc" });
3212
3215
  return;
3213
3216
  }
3214
- if (l.direction === "asc") {
3215
- a({ columnId: u, direction: "desc" });
3217
+ if (o.direction === "asc") {
3218
+ a({ columnId: v, direction: "desc" });
3216
3219
  return;
3217
3220
  }
3218
3221
  a(null);
3219
3222
  }
3220
- }, [l, a]), p = n.reduce(
3221
- (u, I) => u + (x[I.id] ?? I.defaultWidth ?? ye),
3223
+ }, [o, a]), u = t.reduce(
3224
+ (v, k) => v + (x[k.id] ?? k.defaultWidth ?? ke),
3222
3225
  0
3223
- ), m = Ce(null), v = (u) => {
3224
- m.current && (m.current.scrollLeft = u.currentTarget.scrollLeft);
3226
+ ), b = Ce(null), C = (v) => {
3227
+ b.current && (b.current.scrollLeft = v.currentTarget.scrollLeft);
3225
3228
  };
3226
- return /* @__PURE__ */ d("div", { className: f("flex flex-col h-full w-full", i), children: [
3229
+ return /* @__PURE__ */ d("div", { className: m("flex flex-col h-full w-full", i), children: [
3227
3230
  /* @__PURE__ */ e(
3228
3231
  "div",
3229
3232
  {
3230
- ref: m,
3233
+ ref: b,
3231
3234
  className: "overflow-hidden shrink-0 table-header-strip",
3232
- style: { height: g },
3235
+ style: { height: f },
3233
3236
  children: /* @__PURE__ */ e(
3234
3237
  "div",
3235
3238
  {
3236
3239
  className: "flex flex-row table-header font-medium",
3237
- style: { width: p, minWidth: "100%" },
3238
- children: n.map((u) => /* @__PURE__ */ e(
3239
- Hr,
3240
+ style: { width: u, minWidth: "100%" },
3241
+ children: t.map((v) => /* @__PURE__ */ e(
3242
+ $r,
3240
3243
  {
3241
- column: u,
3242
- width: x[u.id] ?? u.defaultWidth ?? ye,
3243
- height: g,
3244
- onResize: (I) => h(u.id, I, u.minWidth ?? $r),
3245
- sortDirection: l?.columnId === u.id ? l.direction : null,
3246
- onSortClick: () => b(u.id)
3244
+ column: v,
3245
+ width: x[v.id] ?? v.defaultWidth ?? ke,
3246
+ height: f,
3247
+ onResize: (k) => g(v.id, k, v.minWidth ?? _r),
3248
+ sortDirection: o?.columnId === v.id ? o.direction : null,
3249
+ onSortClick: () => p(v.id)
3247
3250
  },
3248
- u.id
3251
+ v.id
3249
3252
  ))
3250
3253
  }
3251
3254
  )
@@ -3255,47 +3258,57 @@ const Hr = (t) => {
3255
3258
  "div",
3256
3259
  {
3257
3260
  className: "flex-1 overflow-auto",
3258
- onScroll: v,
3259
- children: /* @__PURE__ */ e(
3261
+ onScroll: C,
3262
+ children: s.length === 0 && w ? /* @__PURE__ */ e("div", { className: "flex h-full min-w-full items-center justify-center p-8", children: w }) : /* @__PURE__ */ e(
3260
3263
  "div",
3261
3264
  {
3262
3265
  className: "flex flex-col",
3263
- style: { width: p, minWidth: "100%" },
3264
- children: o.map((u, I) => /* @__PURE__ */ e(
3266
+ style: { width: u, minWidth: "100%" },
3267
+ children: s.map((v, k) => /* @__PURE__ */ e(
3265
3268
  "div",
3266
3269
  {
3267
- className: f(
3270
+ className: m(
3268
3271
  "flex flex-row table-body-row transition-colors duration-100",
3269
3272
  r && "cursor-pointer"
3270
3273
  ),
3271
- onClick: r ? () => r(u, I) : void 0,
3272
- children: n.map((R) => /* @__PURE__ */ e(
3274
+ onClick: r ? () => r(v, k) : void 0,
3275
+ children: t.map((I) => /* @__PURE__ */ e(
3273
3276
  "div",
3274
3277
  {
3275
3278
  className: "shrink-0 content-center px-4 relative",
3276
3279
  style: {
3277
- width: x[R.id] ?? R.defaultWidth ?? ye,
3280
+ width: x[I.id] ?? I.defaultWidth ?? ke,
3278
3281
  height: c
3279
3282
  },
3280
- children: /* @__PURE__ */ e("div", { className: "break-all line-clamp-1", children: R.renderCell(u, I) })
3283
+ children: /* @__PURE__ */ e("div", { className: "break-all line-clamp-1", children: I.renderCell(v, k) })
3281
3284
  },
3282
- R.id
3285
+ I.id
3283
3286
  ))
3284
3287
  },
3285
- s(u, I)
3288
+ l(v, k)
3286
3289
  ))
3287
3290
  }
3288
3291
  )
3289
3292
  }
3290
3293
  )
3291
3294
  ] });
3292
- }, It = (t) => {
3293
- const { label: n, children: o, className: s } = t;
3294
- return /* @__PURE__ */ d("div", { className: f("flex flex-col dropdown-button-group", s), children: [
3295
- n && /* @__PURE__ */ e("div", { className: "mb-2 text-sm dropdown-group-label font-semibold px-3", children: n }),
3296
- o
3295
+ }, $l = (n) => {
3296
+ const { Icon: t, title: s, description: l, children: r, className: o } = n;
3297
+ return /* @__PURE__ */ d("div", { className: m("flex flex-col items-center gap-3 text-center", o), children: [
3298
+ t && /* @__PURE__ */ e("div", { className: "flex h-14 w-14 items-center justify-center rounded-2xl bg-[var(--color-table-header-bg)]", children: /* @__PURE__ */ e(t, { className: "h-6 w-6 text-[var(--color-input-icon)]" }) }),
3299
+ (s || l) && /* @__PURE__ */ d("div", { className: "flex flex-col gap-1", children: [
3300
+ s && /* @__PURE__ */ e("div", { className: "font-medium text-[var(--color-input-text)]", children: s }),
3301
+ l && /* @__PURE__ */ e("div", { className: "text-sm text-[var(--color-input-description-text)]", children: l })
3302
+ ] }),
3303
+ r
3304
+ ] });
3305
+ }, Ct = (n) => {
3306
+ const { label: t, children: s, className: l } = n;
3307
+ return /* @__PURE__ */ d("div", { className: m("flex flex-col dropdown-button-group", l), children: [
3308
+ t && /* @__PURE__ */ e("div", { className: "mb-2 text-sm dropdown-group-label font-semibold px-3", children: t }),
3309
+ s
3297
3310
  ] });
3298
- }, Xr = () => /* @__PURE__ */ e("div", {}), Vr = [
3311
+ }, Vr = () => /* @__PURE__ */ e("div", {}), Kr = [
3299
3312
  { id: 1, email: "sarah.jennings@example.com", firstname: "Sarah", lastname: "Jennings", status: "active" },
3300
3313
  { id: 2, email: "liam.patel@outlook.com", firstname: "Liam", lastname: "Patel", status: "inactive" },
3301
3314
  { id: 3, email: "emily.wong@gmail.com", firstname: "Emily", lastname: "Wong", status: "active" },
@@ -3308,40 +3321,40 @@ const Hr = (t) => {
3308
3321
  { id: 10, email: "jackson.rivera@outlook.com", firstname: "Jackson", lastname: "Rivera", status: "active" },
3309
3322
  { id: 11, email: "ava.sanders@example.com", firstname: "Ava", lastname: "Sanders", status: "active" },
3310
3323
  { id: 12, email: "logan.bennett@company.io", firstname: "Logan", lastname: "Bennett", status: "inactive" }
3311
- ], Kr = [
3312
- { id: "id", header: "ID", renderCell: (t) => t.id },
3324
+ ], Gr = [
3325
+ { id: "id", header: "ID", renderCell: (n) => n.id },
3313
3326
  {
3314
3327
  id: "email",
3315
3328
  header: "Email",
3316
- renderCell: (t) => /* @__PURE__ */ e(Ee, { Icon: dn, onClick: () => {
3317
- }, children: t.email })
3329
+ renderCell: (n) => /* @__PURE__ */ e(Ee, { Icon: mn, onClick: () => {
3330
+ }, children: n.email })
3318
3331
  },
3319
- { id: "firstname", header: "First Name", renderCell: (t) => t.firstname },
3320
- { id: "lastname", header: "Last Name", renderCell: (t) => t.lastname },
3332
+ { id: "firstname", header: "First Name", renderCell: (n) => n.firstname },
3333
+ { id: "lastname", header: "Last Name", renderCell: (n) => n.lastname },
3321
3334
  {
3322
3335
  id: "status",
3323
3336
  header: "Status",
3324
- renderCell: () => /* @__PURE__ */ e(Gr, {})
3337
+ renderCell: () => /* @__PURE__ */ e(Jr, {})
3325
3338
  }
3326
- ], Hl = () => /* @__PURE__ */ d("div", { className: "flex flex-col gap-6", children: [
3339
+ ], _l = () => /* @__PURE__ */ d("div", { className: "flex flex-col gap-6", children: [
3327
3340
  /* @__PURE__ */ d("div", { className: "flex flex-row items-center justify-start gap-3", children: [
3328
- /* @__PURE__ */ e(At, { Icon: Me, placeholder: "Search..." }),
3329
- /* @__PURE__ */ e(qe, { Icon: ft }),
3330
- /* @__PURE__ */ e(Kn, { Icon: ht, children: "New" }),
3341
+ /* @__PURE__ */ e(Wt, { Icon: Fe, placeholder: "Search..." }),
3342
+ /* @__PURE__ */ e(qe, { Icon: mt }),
3343
+ /* @__PURE__ */ e(Gn, { Icon: ft, children: "New" }),
3331
3344
  /* @__PURE__ */ d(
3332
3345
  Ue,
3333
3346
  {
3334
- trigger: /* @__PURE__ */ e(qe, { Icon: ft }),
3347
+ trigger: /* @__PURE__ */ e(qe, { Icon: mt }),
3335
3348
  children: [
3336
- /* @__PURE__ */ e(X, { dismissOnClick: !1, Icon: ht, children: "Add new" }),
3337
- /* @__PURE__ */ e(X, { Icon: cn, children: "Remove" }),
3338
- /* @__PURE__ */ d(It, { label: "Test", className: "mt-2", children: [
3349
+ /* @__PURE__ */ e(X, { dismissOnClick: !1, Icon: ft, children: "Add new" }),
3350
+ /* @__PURE__ */ e(X, { Icon: un, children: "Remove" }),
3351
+ /* @__PURE__ */ d(Ct, { label: "Test", className: "mt-2", children: [
3339
3352
  /* @__PURE__ */ e(X, { children: "Item 1" }),
3340
3353
  /* @__PURE__ */ e(X, { children: "Item 2" }),
3341
3354
  /* @__PURE__ */ e(X, { children: "Item 3" }),
3342
3355
  /* @__PURE__ */ e(X, { children: "Item 4" })
3343
3356
  ] }),
3344
- /* @__PURE__ */ d(It, { label: "Test", className: "mt-2", children: [
3357
+ /* @__PURE__ */ d(Ct, { label: "Test", className: "mt-2", children: [
3345
3358
  /* @__PURE__ */ e(X, { children: "Item 1" }),
3346
3359
  /* @__PURE__ */ e(X, { children: "Item 2" }),
3347
3360
  /* @__PURE__ */ e(X, { children: "Item 3" }),
@@ -3350,7 +3363,7 @@ const Hr = (t) => {
3350
3363
  ]
3351
3364
  }
3352
3365
  ),
3353
- /* @__PURE__ */ e(Ur, { tabs: [
3366
+ /* @__PURE__ */ e(Wr, { tabs: [
3354
3367
  {
3355
3368
  label: "Tab 1",
3356
3369
  Icon: Ye,
@@ -3373,23 +3386,23 @@ const Hr = (t) => {
3373
3386
  }
3374
3387
  ] })
3375
3388
  ] }),
3376
- /* @__PURE__ */ e(Pr, { options: [
3389
+ /* @__PURE__ */ e(Er, { options: [
3377
3390
  { label: "Option 1", value: 1 },
3378
3391
  { label: "Option 2", value: 2 },
3379
3392
  { label: "Option 3", value: 3 }
3380
3393
  ], value: null, onChange: () => {
3381
3394
  } }),
3382
3395
  /* @__PURE__ */ e(
3383
- jr,
3396
+ Xr,
3384
3397
  {
3385
3398
  className: "h-[300px] w-[300px]",
3386
- columns: Kr,
3387
- rows: Vr,
3388
- getRowId: (t) => t.id
3399
+ columns: Gr,
3400
+ rows: Kr,
3401
+ getRowId: (n) => n.id
3389
3402
  }
3390
3403
  ),
3391
- /* @__PURE__ */ e(Xr, {})
3392
- ] }), Gr = () => /* @__PURE__ */ e(te, { children: /* @__PURE__ */ d(
3404
+ /* @__PURE__ */ e(Vr, {})
3405
+ ] }), Jr = () => /* @__PURE__ */ e(ce, { children: /* @__PURE__ */ d(
3393
3406
  Ue,
3394
3407
  {
3395
3408
  placement: "bottom-end",
@@ -3404,72 +3417,73 @@ const Hr = (t) => {
3404
3417
  }
3405
3418
  ) });
3406
3419
  export {
3407
- Wl as AutoScroll,
3420
+ Hl as AutoScroll,
3408
3421
  Ee as Badge,
3409
3422
  Mr as BadgeColor,
3410
- Kn as Button,
3411
- Bt as ButtonIconRound,
3423
+ Gn as Button,
3424
+ Ut as ButtonIconRound,
3412
3425
  qe as ButtonIconSquare,
3413
- Fl as Divider,
3426
+ Bl as Divider,
3414
3427
  X as DropdownButton,
3415
- It as DropdownButtonGroup,
3428
+ Ct as DropdownButtonGroup,
3416
3429
  Ue as DropdownMenu,
3417
- xe as DropdownPanel,
3418
- At as Input,
3419
- yl as InputCheck,
3420
- vl as InputColor,
3430
+ ve as DropdownPanel,
3431
+ Wt as Input,
3432
+ Cl as InputCheck,
3433
+ xl as InputColor,
3421
3434
  V as InputDescription,
3422
3435
  K as InputError,
3423
- re as InputErrorIcon,
3424
- Il as InputFileMultiple,
3425
- Cl as InputFileSingle,
3436
+ ne as InputErrorIcon,
3437
+ Rl as InputFileMultiple,
3438
+ Il as InputFileSingle,
3426
3439
  Z as InputIconButton,
3427
3440
  he as InputIconButtonTray,
3428
3441
  q as InputLabel,
3429
- Sl as InputLexical,
3430
- xl as InputPassword,
3431
- Nl as InputRadio,
3432
- Pr as InputSelect,
3442
+ Dl as InputLexical,
3443
+ wl as InputPassword,
3444
+ yl as InputRadio,
3445
+ Er as InputSelect,
3433
3446
  $e as InputSelectDivider,
3434
3447
  He as InputSelectGroupHeader,
3435
- Tl as InputSelectMultiple,
3436
- Dl as InputSelectNative,
3448
+ Pl as InputSelectMultiple,
3449
+ Ol as InputSelectNative,
3437
3450
  We as InputSelectOption,
3438
- Ol as InputSelectSearchable,
3439
- zl as InputSelectSearchableAsync,
3440
- wl as InputTextArea,
3451
+ zl as InputSelectSearchable,
3452
+ Tl as InputSelectSearchableAsync,
3453
+ Nl as InputTextArea,
3441
3454
  kl as InputToggle,
3442
- wr as LEXICAL_NODES,
3443
- yr as LexicalBlockTypeSelect,
3444
- Rl as LexicalDefaultToolbarContent,
3455
+ Nr as LEXICAL_NODES,
3456
+ Cr as LexicalBlockTypeSelect,
3457
+ Sl as LexicalDefaultToolbarContent,
3445
3458
  Lr as LexicalFloatingToolbar,
3446
- Ir as LexicalFormatButtons,
3447
- Dr as LexicalHistoryButtons,
3448
- Sr as LexicalLinkButton,
3449
- Rr as LexicalListButtons,
3450
- Tr as LexicalToolbar,
3451
- ce as LexicalToolbarButton,
3459
+ Rr as LexicalFormatButtons,
3460
+ Or as LexicalHistoryButtons,
3461
+ Dr as LexicalLinkButton,
3462
+ Sr as LexicalListButtons,
3463
+ Pr as LexicalToolbar,
3464
+ ie as LexicalToolbarButton,
3452
3465
  Je as LexicalToolbarDivider,
3453
- jt as LexicalToolbarItems,
3454
- Al as Modal,
3466
+ Vt as LexicalToolbarItems,
3467
+ Ul as Modal,
3455
3468
  Ll as Panel,
3456
- El as PanelField,
3469
+ Fl as PanelField,
3457
3470
  Ml as PanelLink,
3458
- Pl as PanelStack,
3459
- Ut as PopoverBase,
3460
- Ul as SidebarModal,
3471
+ El as PanelStack,
3472
+ Ht as PopoverBase,
3473
+ Wl as SidebarModal,
3461
3474
  Se as Spinner,
3462
- Ur as TabButtons,
3463
- jr as Table,
3464
- Hr as TableColumnHead,
3465
- Hl as Test,
3466
- Bl as Tooltip,
3467
- xr as UploadFileTile,
3475
+ Wr as TabButtons,
3476
+ Xr as Table,
3477
+ $r as TableColumnHead,
3478
+ $l as TableEmpty,
3479
+ _l as Test,
3480
+ Al as Tooltip,
3481
+ wr as UploadFileTile,
3468
3482
  H as isSelectOption,
3469
- Nt as lexicalTheme,
3470
- Ne as useLexicalToolbar,
3471
- Ht as useLexicalToolbarState,
3472
- dt as usePopover,
3483
+ wt as lexicalTheme,
3484
+ we as useLexicalToolbar,
3485
+ _t as useLexicalToolbarState,
3486
+ ct as usePopover,
3473
3487
  _e as useSelectPopover
3474
3488
  };
3475
3489
  //# sourceMappingURL=index.js.map