@opencxh/ui-kit 3.5.0 → 3.13.0

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,37 +1,37 @@
1
- import { clsx as De } from "clsx";
2
- import { jsxs as c, jsx as e, Fragment as Le } from "react/jsx-runtime";
3
- import se, { forwardRef as ce, useState as O, useRef as ee, useEffect as J, useMemo as ie, useCallback as ne, createContext as Ae, Component as Te } from "react";
4
- import { FileText as xe, HardDrive as Ne, X as Ie, ArrowLeft as Me, Search as je, FolderPlus as Be, Upload as Pe, Folder as we, ChevronDownIcon as Ve, ChevronRight as Fe } from "lucide-react";
5
- function b(...r) {
6
- return De(r);
1
+ import { clsx as Te } from "clsx";
2
+ import { jsxs as c, jsx as e, Fragment as Ee } from "react/jsx-runtime";
3
+ import se, { forwardRef as ce, useState as V, useRef as Q, useCallback as ae, useEffect as G, useMemo as ie, createContext as Ae, Component as Ie } from "react";
4
+ import { ChevronDown as je, FileText as pe, HardDrive as Ne, X as Be, ArrowLeft as Me, Search as Pe, FolderPlus as _e, Upload as Oe, Folder as we, ChevronDownIcon as Ve, ChevronRight as Fe } from "lucide-react";
5
+ function x(...r) {
6
+ return Te(r);
7
7
  }
8
- function Fr(r) {
8
+ function Rr(r) {
9
9
  return (l, t) => r[l]?.[t] || "";
10
10
  }
11
- function Or(r) {
11
+ function qr(r) {
12
12
  return (l) => r[l] || "";
13
13
  }
14
- const Oe = {
14
+ const We = {
15
15
  primary: "btn o__primary",
16
16
  secondary: "btn o__secondary",
17
17
  outline: "btn o__secondary",
18
18
  ghost: "btn text-gray-700",
19
19
  destructive: "btn o__destructive"
20
- }, _e = {
20
+ }, Re = {
21
21
  xs: "px-2 py-1 text-xs",
22
22
  sm: "px-3 py-1.5 text-sm",
23
23
  md: "px-4 py-2 text-sm",
24
24
  lg: "px-6 py-3 text-base",
25
25
  xl: "px-8 py-4 text-lg",
26
26
  full: "px-4 py-3 text-base"
27
- }, We = {
27
+ }, qe = {
28
28
  xs: "p-1",
29
29
  sm: "p-1.5",
30
30
  md: "p-2",
31
31
  lg: "p-3",
32
32
  xl: "p-4",
33
33
  full: "p-4"
34
- }, Q = ce(
34
+ }, ee = ce(
35
35
  ({
36
36
  variant: r = "primary",
37
37
  size: l = "md",
@@ -39,32 +39,32 @@ const Oe = {
39
39
  loading: a = !1,
40
40
  leftIcon: o,
41
41
  rightIcon: i,
42
- iconOnly: f = !1,
43
- className: p,
44
- children: x,
45
- disabled: v,
42
+ iconOnly: h = !1,
43
+ className: g,
44
+ children: f,
45
+ disabled: b,
46
46
  ...m
47
- }, s) => {
48
- const d = v || a;
47
+ }, n) => {
48
+ const d = b || a;
49
49
  return /* @__PURE__ */ c(
50
50
  "button",
51
51
  {
52
- ref: s,
52
+ ref: n,
53
53
  type: "button",
54
- className: b(
54
+ className: x(
55
55
  // Base styles
56
56
  "inline-flex items-center justify-center font-medium rounded-lg transition-colors duration-200",
57
57
  "focus:outline-none focus:ring-1 focus:ring-offset-1",
58
58
  "disabled:opacity-50 disabled:cursor-not-allowed",
59
59
  // Variant styles
60
- Oe[r],
60
+ We[r],
61
61
  // Size styles
62
- f ? We[l] : _e[l],
62
+ h ? qe[l] : Re[l],
63
63
  // Full width
64
64
  t && "w-full",
65
65
  // Loading state
66
66
  a && "cursor-wait",
67
- p
67
+ g
68
68
  ),
69
69
  disabled: d,
70
70
  ...m,
@@ -72,9 +72,9 @@ const Oe = {
72
72
  a && /* @__PURE__ */ c(
73
73
  "svg",
74
74
  {
75
- className: b(
75
+ className: x(
76
76
  "animate-spin",
77
- f ? "h-4 w-4" : "h-4 w-4 mr-2"
77
+ h ? "h-4 w-4" : "h-4 w-4 mr-2"
78
78
  ),
79
79
  fill: "none",
80
80
  viewBox: "0 0 24 24",
@@ -101,24 +101,24 @@ const Oe = {
101
101
  ]
102
102
  }
103
103
  ),
104
- !a && o && /* @__PURE__ */ e("span", { className: b("flex-shrink-0", !f && "mr-2"), children: o }),
105
- !f && x,
106
- !a && i && /* @__PURE__ */ e("span", { className: b("flex-shrink-0", !f && "ml-2"), children: i }),
107
- f && !a && !o && !i && x
104
+ !a && o && /* @__PURE__ */ e("span", { className: x("flex-shrink-0", !h && "mr-2"), children: o }),
105
+ !h && f,
106
+ !a && i && /* @__PURE__ */ e("span", { className: x("flex-shrink-0", !h && "ml-2"), children: i }),
107
+ h && !a && !o && !i && f
108
108
  ]
109
109
  }
110
110
  );
111
111
  }
112
112
  );
113
- Q.displayName = "Button";
114
- const _r = ({
113
+ ee.displayName = "Button";
114
+ const Hr = ({
115
115
  children: r,
116
116
  size: l = "md",
117
117
  orientation: t = "horizontal",
118
118
  attached: a = !0,
119
119
  className: o
120
120
  }) => {
121
- const i = b(
121
+ const i = x(
122
122
  "inline-flex",
123
123
  {
124
124
  // Orientation
@@ -141,20 +141,20 @@ const _r = ({
141
141
  o
142
142
  );
143
143
  return /* @__PURE__ */ e("div", { className: i, role: "group", children: r });
144
- }, Wr = ({
144
+ }, Ur = ({
145
145
  variant: r = "default",
146
146
  size: l = "md",
147
147
  color: t = "primary",
148
148
  disabled: a = !1,
149
149
  external: o = !1,
150
150
  className: i,
151
- children: f,
152
- href: p,
153
- target: x,
154
- rel: v,
151
+ children: h,
152
+ href: g,
153
+ target: f,
154
+ rel: b,
155
155
  ...m
156
156
  }) => {
157
- const s = o || p && (p.startsWith("http") || p.startsWith("mailto:")), d = b(
157
+ const n = o || g && (g.startsWith("http") || g.startsWith("mailto:")), d = x(
158
158
  // Base styles
159
159
  "inline-flex items-center gap-1 transition-colors duration-200 focus:outline-none focus:ring-2 focus:ring-offset-2",
160
160
  // Size variants
@@ -208,15 +208,15 @@ const _r = ({
208
208
  "opacity-50 cursor-not-allowed pointer-events-none": a
209
209
  },
210
210
  i
211
- ), h = {
211
+ ), p = {
212
212
  ...m,
213
- href: a ? void 0 : p,
214
- target: s ? "_blank" : x,
215
- rel: s ? "noopener noreferrer" : v
213
+ href: a ? void 0 : g,
214
+ target: n ? "_blank" : f,
215
+ rel: n ? "noopener noreferrer" : b
216
216
  };
217
- return /* @__PURE__ */ c("a", { className: d, ...h, children: [
218
- f,
219
- s && /* @__PURE__ */ e(
217
+ return /* @__PURE__ */ c("a", { className: d, ...p, children: [
218
+ h,
219
+ n && /* @__PURE__ */ e(
220
220
  "svg",
221
221
  {
222
222
  className: "w-3 h-3 ml-1",
@@ -236,12 +236,93 @@ const _r = ({
236
236
  }
237
237
  )
238
238
  ] });
239
- }, Re = {
239
+ }, Ce = {
240
+ primary: "btn o__primary",
241
+ secondary: "btn o__secondary",
242
+ outline: "btn o__secondary"
243
+ }, He = {
244
+ sm: "px-3 py-1.5 text-sm",
245
+ md: "px-4 py-2 text-sm"
246
+ };
247
+ function Ue({
248
+ label: r,
249
+ onClick: l,
250
+ variant: t = "primary",
251
+ size: a = "md",
252
+ icon: o,
253
+ options: i,
254
+ disabled: h = !1
255
+ }) {
256
+ const [g, f] = V(!1), b = Q(null), m = ae(() => {
257
+ f((n) => !n);
258
+ }, []);
259
+ return G(() => {
260
+ const n = (d) => {
261
+ b.current && !b.current.contains(d.target) && f(!1);
262
+ };
263
+ return document.addEventListener("mousedown", n), () => document.removeEventListener("mousedown", n);
264
+ }, []), /* @__PURE__ */ c("div", { ref: b, className: "relative inline-flex", children: [
265
+ /* @__PURE__ */ c(
266
+ "button",
267
+ {
268
+ type: "button",
269
+ onClick: l,
270
+ disabled: h,
271
+ className: x(
272
+ "inline-flex items-center justify-center font-medium rounded-l-lg transition-colors duration-200",
273
+ "focus:outline-none focus:ring-1 focus:ring-offset-1",
274
+ "disabled:opacity-50 disabled:cursor-not-allowed",
275
+ Ce[t],
276
+ He[a],
277
+ "rounded-r-none border-r-0"
278
+ ),
279
+ children: [
280
+ o && /* @__PURE__ */ e("span", { className: "mr-2 flex-shrink-0", children: o }),
281
+ r
282
+ ]
283
+ }
284
+ ),
285
+ /* @__PURE__ */ e(
286
+ "button",
287
+ {
288
+ type: "button",
289
+ onClick: m,
290
+ disabled: h,
291
+ className: x(
292
+ "inline-flex items-center justify-center font-medium rounded-r-lg transition-colors duration-200",
293
+ "focus:outline-none focus:ring-1 focus:ring-offset-1",
294
+ "disabled:opacity-50 disabled:cursor-not-allowed",
295
+ "border-l border-l-white/20",
296
+ Ce[t],
297
+ a === "sm" ? "px-1.5 py-1.5" : "px-2 py-2",
298
+ "rounded-l-none"
299
+ ),
300
+ children: /* @__PURE__ */ e(je, { className: "h-4 w-4" })
301
+ }
302
+ ),
303
+ g && i.length > 0 && /* @__PURE__ */ e("div", { className: "absolute right-0 top-full mt-1 z-50 min-w-[160px] rounded-lg border border-gray-200 bg-white shadow-lg py-1", children: i.map((n) => /* @__PURE__ */ e(
304
+ "button",
305
+ {
306
+ type: "button",
307
+ onClick: () => {
308
+ n.onClick(), f(!1);
309
+ },
310
+ className: x(
311
+ "w-full text-left px-3 py-2 text-sm hover:bg-gray-50 transition-colors",
312
+ n.variant === "destructive" ? "text-red-600 hover:bg-red-50" : "text-gray-700"
313
+ ),
314
+ children: n.label
315
+ },
316
+ n.id
317
+ )) })
318
+ ] });
319
+ }
320
+ const Ke = {
240
321
  sm: "h-4 w-4",
241
322
  md: "h-5 w-5",
242
323
  lg: "h-6 w-6",
243
324
  full: "h-6 w-6"
244
- }, qe = {
325
+ }, Ge = {
245
326
  sm: "text-sm",
246
327
  md: "text-sm",
247
328
  lg: "text-base",
@@ -254,46 +335,46 @@ const _r = ({
254
335
  size: a = "md",
255
336
  indeterminate: o = !1,
256
337
  containerClassName: i,
257
- labelClassName: f,
258
- className: p,
259
- id: x,
260
- ...v
338
+ labelClassName: h,
339
+ className: g,
340
+ id: f,
341
+ ...b
261
342
  }, m) => {
262
- const s = x || `checkbox-${Math.random().toString(36).substr(2, 9)}`, d = !!t;
343
+ const n = f || `checkbox-${Math.random().toString(36).substr(2, 9)}`, d = !!t;
263
344
  return se.useEffect(() => {
264
345
  m && typeof m == "object" && m.current && (m.current.indeterminate = o);
265
- }, [o, m]), /* @__PURE__ */ c("div", { className: b("flex flex-col", i), children: [
346
+ }, [o, m]), /* @__PURE__ */ c("div", { className: x("flex flex-col", i), children: [
266
347
  /* @__PURE__ */ c("div", { className: "flex items-start", children: [
267
348
  /* @__PURE__ */ e("div", { className: "flex items-center h-5", children: /* @__PURE__ */ e(
268
349
  "input",
269
350
  {
270
351
  ref: m,
271
- id: s,
352
+ id: n,
272
353
  type: "checkbox",
273
- className: b(
354
+ className: x(
274
355
  // Base styles
275
356
  "rounded border transition-colors duration-200",
276
357
  "focus:ring-2 focus:ring-offset-2 focus:outline-none",
277
358
  "disabled:opacity-50 disabled:cursor-not-allowed",
278
359
  // Size styles
279
- Re[a],
360
+ Ke[a],
280
361
  // State styles
281
362
  d ? "border-error text-error focus:border-error focus:ring-error" : "border-gray-100 text-primary focus:border-primary focus:ring-primary dark:border-gray-600 dark:bg-secondary-800",
282
- p
363
+ g
283
364
  ),
284
- ...v
365
+ ...b
285
366
  }
286
367
  ) }),
287
368
  r && /* @__PURE__ */ c("div", { className: "ml-3 flex-1", children: [
288
369
  /* @__PURE__ */ e(
289
370
  "label",
290
371
  {
291
- htmlFor: s,
292
- className: b(
372
+ htmlFor: n,
373
+ className: x(
293
374
  "font-medium cursor-pointer",
294
375
  d ? "text-error" : "text-secondary-900 dark:text-secondary-100",
295
- qe[a],
296
- f
376
+ Ge[a],
377
+ h
297
378
  ),
298
379
  children: r
299
380
  }
@@ -306,55 +387,55 @@ const _r = ({
306
387
  }
307
388
  );
308
389
  be.displayName = "Checkbox";
309
- const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), Ue = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m15 18-6-6 6-6" }) }), Ke = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m9 18 6-6-6-6" }) }), ye = ce(({
390
+ const Je = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z" }) }), Ye = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m15 18-6-6 6-6" }) }), Ze = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "m9 18 6-6-6-6" }) }), ye = ce(({
310
391
  value: r,
311
392
  onChange: l,
312
393
  placeholder: t = "Select date",
313
394
  disabled: a = !1,
314
395
  required: o = !1,
315
396
  size: i = "md",
316
- className: f,
317
- minDate: p,
318
- maxDate: x,
319
- format: v = "MM/dd/yyyy"
397
+ className: h,
398
+ minDate: g,
399
+ maxDate: f,
400
+ format: b = "MM/dd/yyyy"
320
401
  }, m) => {
321
- const [s, d] = O(!1), [h, N] = O(() => r || /* @__PURE__ */ new Date()), y = ee(null);
322
- J(() => {
323
- const z = (g) => {
324
- y.current && !y.current.contains(g.target) && d(!1);
402
+ const [n, d] = V(!1), [p, N] = V(() => r || /* @__PURE__ */ new Date()), v = Q(null);
403
+ G(() => {
404
+ const z = (y) => {
405
+ v.current && !v.current.contains(y.target) && d(!1);
325
406
  };
326
- return s && document.addEventListener("mousedown", z), () => {
407
+ return n && document.addEventListener("mousedown", z), () => {
327
408
  document.removeEventListener("mousedown", z);
328
409
  };
329
- }, [s]);
410
+ }, [n]);
330
411
  const S = (z) => {
331
412
  if (!z) return "";
332
- const g = z.getDate().toString().padStart(2, "0"), A = (z.getMonth() + 1).toString().padStart(2, "0"), u = z.getFullYear();
333
- switch (v) {
413
+ const y = z.getDate().toString().padStart(2, "0"), T = (z.getMonth() + 1).toString().padStart(2, "0"), u = z.getFullYear();
414
+ switch (b) {
334
415
  case "dd/MM/yyyy":
335
- return `${g}/${A}/${u}`;
416
+ return `${y}/${T}/${u}`;
336
417
  case "yyyy-MM-dd":
337
- return `${u}-${A}-${g}`;
418
+ return `${u}-${T}-${y}`;
338
419
  case "MM/dd/yyyy":
339
420
  default:
340
- return `${A}/${g}/${u}`;
421
+ return `${T}/${y}/${u}`;
341
422
  }
342
423
  }, B = () => {
343
- const z = h.getFullYear(), g = h.getMonth(), A = new Date(z, g, 1), u = new Date(A);
344
- u.setDate(u.getDate() - A.getDay());
424
+ const z = p.getFullYear(), y = p.getMonth(), T = new Date(z, y, 1), u = new Date(T);
425
+ u.setDate(u.getDate() - T.getDay());
345
426
  const $ = [], L = new Date(u);
346
427
  for (let D = 0; D < 42; D++)
347
428
  $.push(new Date(L)), L.setDate(L.getDate() + 1);
348
429
  return $;
349
430
  }, k = (z) => {
350
- z.getMonth() === h.getMonth() && (p && z < p || x && z > x || (l?.(z), d(!1)));
431
+ z.getMonth() === p.getMonth() && (g && z < g || f && z > f || (l?.(z), d(!1)));
351
432
  }, q = () => {
352
- N(new Date(h.getFullYear(), h.getMonth() - 1, 1));
433
+ N(new Date(p.getFullYear(), p.getMonth() - 1, 1));
353
434
  }, K = () => {
354
- N(new Date(h.getFullYear(), h.getMonth() + 1, 1));
435
+ N(new Date(p.getFullYear(), p.getMonth() + 1, 1));
355
436
  }, H = () => {
356
437
  l?.(null), d(!1);
357
- }, _ = b(
438
+ }, F = x(
358
439
  "w-full border border-neutral-100 dark:border-neutral-600 rounded-md transition-colors duration-200",
359
440
  "bg-white dark:bg-neutral-800 text-gray-700 dark:text-gray-300",
360
441
  "placeholder:text-gray-800 dark:placeholder:text-gray-500",
@@ -366,8 +447,8 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
366
447
  "px-4 py-3 text-lg": i === "lg",
367
448
  "px-4 py-3 text-base": i === "full"
368
449
  },
369
- f
370
- ), E = B(), G = [
450
+ h
451
+ ), M = B(), J = [
371
452
  "January",
372
453
  "February",
373
454
  "March",
@@ -381,7 +462,7 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
381
462
  "November",
382
463
  "December"
383
464
  ];
384
- return /* @__PURE__ */ c("div", { ref: y, className: "relative", children: [
465
+ return /* @__PURE__ */ c("div", { ref: v, className: "relative", children: [
385
466
  /* @__PURE__ */ c("div", { className: "relative", children: [
386
467
  /* @__PURE__ */ e(
387
468
  "input",
@@ -393,57 +474,57 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
393
474
  disabled: a,
394
475
  required: o,
395
476
  readOnly: !0,
396
- onClick: () => !a && d(!s),
397
- className: b(_, "pr-10 cursor-pointer")
477
+ onClick: () => !a && d(!n),
478
+ className: x(F, "pr-10 cursor-pointer")
398
479
  }
399
480
  ),
400
481
  /* @__PURE__ */ e(
401
482
  "button",
402
483
  {
403
484
  type: "button",
404
- onClick: () => !a && d(!s),
485
+ onClick: () => !a && d(!n),
405
486
  disabled: a,
406
487
  className: "absolute inset-y-0 right-0 flex items-center pr-3 text-neutral-400 hover:text-neutral-600 dark:hover:text-neutral-300",
407
- children: /* @__PURE__ */ e(He, {})
488
+ children: /* @__PURE__ */ e(Je, {})
408
489
  }
409
490
  )
410
491
  ] }),
411
- s && /* @__PURE__ */ c("div", { className: "absolute z-50 mt-1 bg-white dark:bg-neutral-800 border border-neutral-100 dark:border-neutral-600 rounded-md shadow-lg p-4 min-w-[280px]", children: [
492
+ n && /* @__PURE__ */ c("div", { className: "absolute z-50 mt-1 bg-white dark:bg-neutral-800 border border-neutral-100 dark:border-neutral-600 rounded-md shadow-lg p-4 min-w-[280px]", children: [
412
493
  /* @__PURE__ */ c("div", { className: "flex items-center justify-between mb-4", children: [
413
494
  /* @__PURE__ */ e(
414
495
  "button",
415
496
  {
416
497
  onClick: q,
417
498
  className: "p-1 hover:bg-neutral-100 dark:hover:bg-neutral-700 rounded",
418
- children: /* @__PURE__ */ e(Ue, {})
499
+ children: /* @__PURE__ */ e(Ye, {})
419
500
  }
420
501
  ),
421
502
  /* @__PURE__ */ c("h3", { className: "text-sm font-medium text-neutral-900 dark:text-neutral-100", children: [
422
- G[h.getMonth()],
503
+ J[p.getMonth()],
423
504
  " ",
424
- h.getFullYear()
505
+ p.getFullYear()
425
506
  ] }),
426
507
  /* @__PURE__ */ e(
427
508
  "button",
428
509
  {
429
510
  onClick: K,
430
511
  className: "p-1 hover:bg-neutral-100 dark:hover:bg-neutral-700 rounded",
431
- children: /* @__PURE__ */ e(Ke, {})
512
+ children: /* @__PURE__ */ e(Ze, {})
432
513
  }
433
514
  )
434
515
  ] }),
435
516
  /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1 mb-2", children: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"].map((z) => /* @__PURE__ */ e("div", { className: "text-xs font-medium text-neutral-500 dark:text-neutral-400 text-center py-1", children: z }, z)) }),
436
- /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: E.map((z, g) => {
437
- const A = z.getMonth() === h.getMonth(), u = r && z.toDateString() === r.toDateString(), $ = z.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), L = !A || p && z < p || x && z > x;
517
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-7 gap-1", children: M.map((z, y) => {
518
+ const T = z.getMonth() === p.getMonth(), u = r && z.toDateString() === r.toDateString(), $ = z.toDateString() === (/* @__PURE__ */ new Date()).toDateString(), L = !T || g && z < g || f && z > f;
438
519
  return /* @__PURE__ */ e(
439
520
  "button",
440
521
  {
441
522
  onClick: () => !L && k(z),
442
523
  disabled: L,
443
- className: b(
524
+ className: x(
444
525
  "w-8 h-8 text-sm rounded transition-colors duration-200",
445
526
  {
446
- "text-neutral-900 dark:text-neutral-100 hover:bg-neutral-100 dark:hover:bg-neutral-700": A && !u && !L,
527
+ "text-neutral-900 dark:text-neutral-100 hover:bg-neutral-100 dark:hover:bg-neutral-700": T && !u && !L,
447
528
  "bg-primary text-white": u,
448
529
  "bg-neutral-100 dark:bg-neutral-700 text-neutral-900 dark:text-neutral-100": $ && !u,
449
530
  "text-neutral-300 dark:text-neutral-600 cursor-not-allowed": L
@@ -451,7 +532,7 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
451
532
  ),
452
533
  children: z.getDate()
453
534
  },
454
- g
535
+ y
455
536
  );
456
537
  }) }),
457
538
  /* @__PURE__ */ c("div", { className: "flex justify-between items-center mt-4 pt-3 border-t border-neutral-200 dark:border-neutral-700", children: [
@@ -474,7 +555,7 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
474
555
  ] })
475
556
  ] })
476
557
  ] });
477
- }), de = (...r) => r.filter(Boolean).join(" "), Ge = (r) => /* @__PURE__ */ e(
558
+ }), de = (...r) => r.filter(Boolean).join(" "), Xe = (r) => /* @__PURE__ */ e(
478
559
  "svg",
479
560
  {
480
561
  ...r,
@@ -492,7 +573,7 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
492
573
  }
493
574
  )
494
575
  }
495
- ), Je = (r) => /* @__PURE__ */ e(
576
+ ), Qe = (r) => /* @__PURE__ */ e(
496
577
  "svg",
497
578
  {
498
579
  ...r,
@@ -510,57 +591,57 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
510
591
  }
511
592
  )
512
593
  }
513
- ), Ye = {
594
+ ), er = {
514
595
  sm: "px-3 py-1.5 text-sm",
515
596
  md: "px-3 py-2 text-sm",
516
597
  lg: "px-3 py-2 text-sm",
517
598
  full: "px-3 py-2 text-sm"
518
- }, pe = {
599
+ }, xe = {
519
600
  sm: "h-4 w-4",
520
601
  md: "h-5 w-5",
521
602
  lg: "h-6 w-6",
522
603
  full: "h-6 w-6"
523
- }, Ze = ce(
604
+ }, rr = ce(
524
605
  ({
525
606
  label: r,
526
607
  helperText: l,
527
608
  error: t,
528
609
  size: a = "md",
529
610
  fullWidth: o = !1,
530
- startIcon: i = /* @__PURE__ */ e(Ge, {}),
531
- loading: f = !1,
532
- containerClassName: p,
533
- labelClassName: x,
534
- className: v,
611
+ startIcon: i = /* @__PURE__ */ e(Xe, {}),
612
+ loading: h = !1,
613
+ containerClassName: g,
614
+ labelClassName: f,
615
+ className: b,
535
616
  id: m,
536
- options: s,
617
+ options: n,
537
618
  onRemoteSearch: d,
538
- onSelect: h,
619
+ onSelect: p,
539
620
  debounceTime: N = 500,
540
- value: y,
621
+ value: v,
541
622
  onChange: S,
542
623
  ...B
543
624
  }, k) => {
544
- const q = m || `searchfield-${Math.random().toString(36).substr(2, 9)}`, K = !!t, H = ee(null), _ = ee(null), [E, G] = O(y || ""), [z, g] = O(!1), [A, u] = O(!1);
545
- J(() => {
546
- y !== void 0 && G(y);
547
- }, [y]);
625
+ const q = m || `searchfield-${Math.random().toString(36).substr(2, 9)}`, K = !!t, H = Q(null), F = Q(null), [M, J] = V(v || ""), [z, y] = V(!1), [T, u] = V(!1);
626
+ G(() => {
627
+ v !== void 0 && J(v);
628
+ }, [v]);
548
629
  const $ = ie(() => {
549
- if (!E) return s;
550
- const W = String(E).toLowerCase();
551
- return s.filter(
630
+ if (!M) return n;
631
+ const W = String(M).toLowerCase();
632
+ return n.filter(
552
633
  (C) => String(C.label).toLowerCase().includes(W)
553
634
  );
554
- }, [E, s]);
555
- J(() => {
556
- if (!d || !E) {
635
+ }, [M, n]);
636
+ G(() => {
637
+ if (!d || !M) {
557
638
  u(!1);
558
639
  return;
559
640
  }
560
641
  const W = setTimeout(async () => {
561
642
  u(!0);
562
643
  try {
563
- await d(String(E));
644
+ await d(String(M));
564
645
  } catch (C) {
565
646
  console.error("Remote search failed:", C);
566
647
  } finally {
@@ -570,27 +651,27 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
570
651
  return () => {
571
652
  clearTimeout(W), u(!1);
572
653
  };
573
- }, [E, N, d]), J(() => {
654
+ }, [M, N, d]), G(() => {
574
655
  const W = (C) => {
575
- H.current && !H.current.contains(C.target) && g(!1);
656
+ H.current && !H.current.contains(C.target) && y(!1);
576
657
  };
577
658
  return document.addEventListener("mousedown", W), () => document.removeEventListener("mousedown", W);
578
659
  }, []);
579
660
  const L = (W) => {
580
661
  const C = W.target.value;
581
- G(C), g(!0), S && S(W);
662
+ J(C), y(!0), S && S(W);
582
663
  }, D = (W) => {
583
- G(W.label), g(!1), h && h(W.value);
664
+ J(W.label), y(!1), p && p(W.value);
584
665
  }, P = () => {
585
- (s.length > 0 || d) && g(!0);
586
- }, M = f || A, re = z && ($.length > 0 || M), ae = ie(() => k || _, [k]);
666
+ (n.length > 0 || d) && y(!0);
667
+ }, E = h || T, re = z && ($.length > 0 || E), ne = ie(() => k || F, [k]);
587
668
  return /* @__PURE__ */ c(
588
669
  "div",
589
670
  {
590
671
  className: de(
591
672
  "flex flex-col",
592
673
  o ? "w-full" : "",
593
- p || "",
674
+ g || "",
594
675
  "relative"
595
676
  ),
596
677
  ref: H,
@@ -602,19 +683,19 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
602
683
  className: de(
603
684
  "block text-sm font-medium mb-1",
604
685
  K ? "text-red-500" : "text-gray-700 dark:text-gray-300",
605
- x || ""
686
+ f || ""
606
687
  ),
607
688
  children: r
608
689
  }
609
690
  ),
610
691
  /* @__PURE__ */ c("div", { className: "relative", children: [
611
- i && /* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: de("text-gray-400", pe[a]), children: i }) }),
692
+ i && /* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: de("text-gray-400", xe[a]), children: i }) }),
612
693
  /* @__PURE__ */ e(
613
694
  "input",
614
695
  {
615
- ref: ae,
696
+ ref: ne,
616
697
  id: q,
617
- value: E,
698
+ value: M,
618
699
  onChange: L,
619
700
  onFocus: P,
620
701
  className: de(
@@ -623,24 +704,24 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
623
704
  "placeholder-gray-500 dark:placeholder-gray-500 focus:outline-none",
624
705
  "disabled:opacity-50 disabled:cursor-not-allowed",
625
706
  // Size styles
626
- Ye[a],
707
+ er[a],
627
708
  // Icon padding
628
709
  i ? "pl-10" : "",
629
710
  "pr-10",
630
711
  // Altijd padding rechts voor de dropdown/loading icon
631
712
  // State styles
632
713
  K ? "border-red-500 text-red-500 focus:border-red-500 focus:ring-red-500" : "border-gray-300 text-gray-900 dark:border-gray-700 dark:bg-gray-800 dark:text-gray-100",
633
- v || ""
714
+ b || ""
634
715
  ),
635
716
  ...B
636
717
  }
637
718
  ),
638
- /* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: M || f ? (
719
+ /* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: E || h ? (
639
720
  // Loading Spinner
640
721
  /* @__PURE__ */ c(
641
722
  "svg",
642
723
  {
643
- className: de("animate-spin text-blue-500", pe[a]),
724
+ className: de("animate-spin text-blue-500", xe[a]),
644
725
  xmlns: "http://www.w3.org/2000/svg",
645
726
  fill: "none",
646
727
  viewBox: "0 0 24 24",
@@ -670,14 +751,14 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
670
751
  ) : (
671
752
  // Dropdown Chevron
672
753
  /* @__PURE__ */ e(
673
- Je,
754
+ Qe,
674
755
  {
675
756
  className: de(
676
757
  "text-gray-400 cursor-pointer transition-transform",
677
- pe[a],
758
+ xe[a],
678
759
  z ? "rotate-180" : "rotate-0"
679
760
  ),
680
- onClick: () => g((W) => !W)
761
+ onClick: () => y((W) => !W)
681
762
  }
682
763
  )
683
764
  ) })
@@ -693,11 +774,11 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
693
774
  className: "px-4 py-2 cursor-pointer text-gray-900 dark:text-gray-100 hover:bg-blue-500 hover:text-white transition-colors",
694
775
  onClick: () => D(W),
695
776
  role: "option",
696
- "aria-selected": E === W.label,
777
+ "aria-selected": M === W.label,
697
778
  children: W.label
698
779
  },
699
780
  W.value
700
- )) : /* @__PURE__ */ e("li", { className: "px-4 py-2 text-gray-500 dark:text-gray-400", children: M || f ? "Zoeken op afstand..." : "Geen resultaten gevonden." })
781
+ )) : /* @__PURE__ */ e("li", { className: "px-4 py-2 text-gray-500 dark:text-gray-400", children: E || h ? "Zoeken op afstand..." : "Geen resultaten gevonden." })
701
782
  }
702
783
  ),
703
784
  (t || l) && /* @__PURE__ */ e(
@@ -712,15 +793,15 @@ const He = () => /* @__PURE__ */ e("svg", { className: "h-4 w-4", fill: "none",
712
793
  ),
713
794
  d && /* @__PURE__ */ c("p", { className: "mt-2 text-xs text-green-600 dark:text-green-400", children: [
714
795
  "Huidige zoekterm (niet-gedebounced): ",
715
- String(E)
796
+ String(M)
716
797
  ] })
717
798
  ]
718
799
  }
719
800
  );
720
801
  }
721
802
  );
722
- Ze.displayName = "SearchableTextField";
723
- const Xe = {
803
+ rr.displayName = "SearchableTextField";
804
+ const tr = {
724
805
  sm: "px-3 py-1.5 text-sm",
725
806
  md: "px-3 py-2 text-sm",
726
807
  lg: "px-3 py-2 text-sm",
@@ -733,80 +814,80 @@ const Xe = {
733
814
  size: a = "md",
734
815
  fullWidth: o = !1,
735
816
  options: i,
736
- placeholder: f,
737
- containerClassName: p,
738
- labelClassName: x,
739
- className: v,
817
+ placeholder: h,
818
+ containerClassName: g,
819
+ labelClassName: f,
820
+ className: b,
740
821
  id: m,
741
- searchable: s,
822
+ searchable: n,
742
823
  multiple: d,
743
- value: h,
824
+ value: p,
744
825
  onChange: N,
745
- allowCreate: y,
826
+ allowCreate: v,
746
827
  onCreateOption: S,
747
828
  ...B
748
829
  }, k) => {
749
- const q = m || `select-${Math.random().toString(36).substr(2, 9)}`, K = !!t, [H, _] = se.useState(!1), [E, G] = se.useState(""), z = se.useRef(null), [g, A] = se.useState(i);
830
+ const q = m || `select-${Math.random().toString(36).substr(2, 9)}`, K = !!t, [H, F] = se.useState(!1), [M, J] = se.useState(""), z = se.useRef(null), [y, T] = se.useState(i);
750
831
  se.useImperativeHandle(k, () => z.current), se.useEffect(() => {
751
832
  const C = (I) => {
752
- z.current && !z.current.contains(I.target) && _(!1);
833
+ z.current && !z.current.contains(I.target) && F(!1);
753
834
  };
754
835
  return document.addEventListener("mousedown", C), () => document.removeEventListener("mousedown", C);
755
836
  }, []);
756
837
  const u = se.useCallback(
757
838
  (C, I) => C.some(
758
- (F) => me(F.value) === me(I) || me(F.label) === me(I)
839
+ (O) => me(O.value) === me(I) || me(O.label) === me(I)
759
840
  ),
760
841
  []
761
842
  ), $ = se.useCallback(
762
843
  (C, I) => {
763
- const F = [...C], T = (X) => {
844
+ const O = [...C], A = (X) => {
764
845
  const te = (X ?? "").trim();
765
- te && (u(F, te) || F.push({ value: te, label: te }));
846
+ te && (u(O, te) || O.push({ value: te, label: te }));
766
847
  };
767
- return Array.isArray(I) ? I.forEach(T) : T(I), F;
848
+ return Array.isArray(I) ? I.forEach(A) : A(I), O;
768
849
  },
769
850
  [u]
770
851
  );
771
852
  se.useEffect(() => {
772
- A((C) => {
853
+ T((C) => {
773
854
  const I = [...i];
774
- return C.forEach((F) => {
775
- !u(I, F.value) && !u(I, F.label) && I.push(F);
776
- }), $(I, h);
855
+ return C.forEach((O) => {
856
+ !u(I, O.value) && !u(I, O.label) && I.push(O);
857
+ }), $(I, p);
777
858
  });
778
- }, [i, h, $, u]);
859
+ }, [i, p, $, u]);
779
860
  const L = (C) => {
780
861
  if (d) {
781
- const I = Array.isArray(h) ? h : [], F = I.includes(C) ? I.filter((T) => T !== C) : [...I, C];
782
- N?.(F);
862
+ const I = Array.isArray(p) ? p : [], O = I.includes(C) ? I.filter((A) => A !== C) : [...I, C];
863
+ N?.(O);
783
864
  } else
784
- N?.(C), _(!1), G("");
785
- }, D = d ? null : g.find((C) => C.value === h), P = d ? g.filter(
786
- (C) => Array.isArray(h) && h.includes(C.value)
787
- ) : [], M = s && E ? g.filter(
788
- (C) => C.label.toLowerCase().includes(E.toLowerCase())
789
- ) : g, re = !!y && !!s && !!E.trim() && !u(g, E), ae = (C) => {
865
+ N?.(C), F(!1), J("");
866
+ }, D = d ? null : y.find((C) => C.value === p), P = d ? y.filter(
867
+ (C) => Array.isArray(p) && p.includes(C.value)
868
+ ) : [], E = n && M ? y.filter(
869
+ (C) => C.label.toLowerCase().includes(M.toLowerCase())
870
+ ) : y, re = !!v && !!n && !!M.trim() && !u(y, M), ne = (C) => {
790
871
  const I = C.trim();
791
872
  if (!I) return;
792
- const F = S?.(I) ?? {
873
+ const O = S?.(I) ?? {
793
874
  value: I,
794
875
  label: I
795
876
  };
796
- if (u(g, F.value) || u(g, F.label)) {
797
- L(F.value), G(""), d || _(!1);
877
+ if (u(y, O.value) || u(y, O.label)) {
878
+ L(O.value), J(""), d || F(!1);
798
879
  return;
799
880
  }
800
- A((T) => [...T, F]), L(F.value), G(""), d || _(!1);
801
- }, W = () => d ? P.length > 0 ? P.map((C) => C.label).join(", ") : f || "Select options" : D?.label || f || "Select an option";
881
+ T((A) => [...A, O]), L(O.value), J(""), d || F(!1);
882
+ }, W = () => d ? P.length > 0 ? P.map((C) => C.label).join(", ") : h || "Select options" : D?.label || h || "Select an option";
802
883
  return /* @__PURE__ */ c(
803
884
  "div",
804
885
  {
805
886
  ref: z,
806
- className: b(
887
+ className: x(
807
888
  "relative flex flex-col",
808
889
  o && "w-full",
809
- p
890
+ g
810
891
  ),
811
892
  ...B,
812
893
  children: [
@@ -814,11 +895,11 @@ const Xe = {
814
895
  "label",
815
896
  {
816
897
  htmlFor: q,
817
- onClick: () => _(!H),
818
- className: b(
898
+ onClick: () => F(!H),
899
+ className: x(
819
900
  "block text-sm font-medium mb-1",
820
901
  K ? "text-error" : "text-secondary-700 dark:text-secondary-300",
821
- x
902
+ f
822
903
  ),
823
904
  children: r
824
905
  }
@@ -829,31 +910,31 @@ const Xe = {
829
910
  {
830
911
  type: "button",
831
912
  id: q,
832
- onClick: () => _(!H),
833
- className: b(
913
+ onClick: () => F(!H),
914
+ className: x(
834
915
  "block w-full rounded-lg border transition-colors duration-200 text-left",
835
916
  "focus:outline-none focus:ring-0 focus:ring-offset-0",
836
917
  "disabled:opacity-50 disabled:cursor-not-allowed",
837
918
  "bg-white dark:bg-secondary-800",
838
- Xe[a],
919
+ tr[a],
839
920
  K ? "border-error text-error focus:border-error focus:ring-error" : "border-neutral text-secondary-900 dark:border-neutral-700 dark:bg-secondary-800 dark:text-secondary-100",
840
- v
921
+ b
841
922
  ),
842
923
  children: /* @__PURE__ */ e("span", { className: "block truncate", children: W() })
843
924
  }
844
925
  ),
845
926
  H && /* @__PURE__ */ c("div", { className: "absolute z-10 mt-1 w-full rounded-md bg-white dark:bg-secondary-800 shadow-lg border border-neutral dark:border-neutral-700", children: [
846
- s && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
927
+ n && /* @__PURE__ */ e("div", { className: "p-2", children: /* @__PURE__ */ e(
847
928
  "input",
848
929
  {
849
930
  type: "text",
850
931
  placeholder: "Search...",
851
- value: E,
852
- onChange: (C) => G(C.target.value),
932
+ value: M,
933
+ onChange: (C) => J(C.target.value),
853
934
  onKeyDown: (C) => {
854
- C.key === "Enter" && re && (C.preventDefault(), ae(E));
935
+ C.key === "Enter" && re && (C.preventDefault(), ne(M));
855
936
  },
856
- className: b(
937
+ className: x(
857
938
  "w-full px-3 py-2 text-sm rounded-md border",
858
939
  "text-secondary-900 border-gray-100 dark:border-gray-600 focus:outline-none focus:ring-0"
859
940
  )
@@ -862,36 +943,36 @@ const Xe = {
862
943
  re && /* @__PURE__ */ c(
863
944
  "div",
864
945
  {
865
- className: b(
946
+ className: x(
866
947
  "px-4 py-2 text-sm cursor-pointer",
867
948
  "text-primary hover:bg-gray-100 dark:hover:bg-secondary-700"
868
949
  ),
869
- onClick: () => ae(E),
950
+ onClick: () => ne(M),
870
951
  children: [
871
952
  "+: “",
872
- E.trim(),
953
+ M.trim(),
873
954
  "”"
874
955
  ]
875
956
  }
876
957
  ),
877
958
  /* @__PURE__ */ c("ul", { className: "max-h-60 overflow-auto py-1", children: [
878
- f && !d && /* @__PURE__ */ e(
959
+ h && !d && /* @__PURE__ */ e(
879
960
  "li",
880
961
  {
881
962
  className: "px-4 py-2 text-sm text-secondary-500 cursor-pointer hover:bg-gray-100 dark:hover:bg-secondary-700",
882
963
  onClick: () => {
883
- N?.(""), _(!1);
964
+ N?.(""), F(!1);
884
965
  },
885
- children: f
966
+ children: h
886
967
  }
887
968
  ),
888
- M.map((C) => {
889
- const I = d ? Array.isArray(h) && h.includes(C.value) : h === C.value;
969
+ E.map((C) => {
970
+ const I = d ? Array.isArray(p) && p.includes(C.value) : p === C.value;
890
971
  return /* @__PURE__ */ e(
891
972
  "li",
892
973
  {
893
974
  onClick: () => !C.disabled && L(C.value),
894
- className: b(
975
+ className: x(
895
976
  "px-4 py-2 text-sm cursor-pointer",
896
977
  "text-secondary-900 dark:text-secondary-100",
897
978
  C.disabled ? "opacity-50 cursor-not-allowed" : "hover:bg-gray-100 dark:hover:bg-secondary-700",
@@ -919,7 +1000,7 @@ const Xe = {
919
1000
  (t || l) && /* @__PURE__ */ e(
920
1001
  "p",
921
1002
  {
922
- className: b(
1003
+ className: x(
923
1004
  "mt-1 text-xs",
924
1005
  K ? "text-error" : "text-secondary-500"
925
1006
  ),
@@ -932,7 +1013,7 @@ const Xe = {
932
1013
  }
933
1014
  );
934
1015
  ve.displayName = "Select";
935
- const Qe = {
1016
+ const ar = {
936
1017
  sm: "px-3 py-1.5 text-sm",
937
1018
  md: "px-3 py-2 text-sm",
938
1019
  lg: "px-4 py-3 text-base",
@@ -945,23 +1026,23 @@ const Qe = {
945
1026
  size: a = "md",
946
1027
  fullWidth: o = !1,
947
1028
  loading: i = !1,
948
- containerClassName: f,
949
- labelClassName: p,
950
- className: x,
951
- id: v,
1029
+ containerClassName: h,
1030
+ labelClassName: g,
1031
+ className: f,
1032
+ id: b,
952
1033
  rows: m = 4,
953
- ...s
1034
+ ...n
954
1035
  }, d) => {
955
- const h = v || `textarea-${Math.random().toString(36).substr(2, 9)}`, N = !!t;
956
- return /* @__PURE__ */ c("div", { className: b("flex flex-col", o && "w-full", f), children: [
1036
+ const p = b || `textarea-${Math.random().toString(36).substr(2, 9)}`, N = !!t;
1037
+ return /* @__PURE__ */ c("div", { className: x("flex flex-col", o && "w-full", h), children: [
957
1038
  r && /* @__PURE__ */ e(
958
1039
  "label",
959
1040
  {
960
- htmlFor: h,
961
- className: b(
1041
+ htmlFor: p,
1042
+ className: x(
962
1043
  "block text-sm font-medium mb-1",
963
1044
  N ? "text-error" : "text-secondary-700 dark:text-secondary-300",
964
- p
1045
+ g
965
1046
  ),
966
1047
  children: r
967
1048
  }
@@ -971,20 +1052,20 @@ const Qe = {
971
1052
  "textarea",
972
1053
  {
973
1054
  ref: d,
974
- id: h,
1055
+ id: p,
975
1056
  rows: m,
976
- className: b(
1057
+ className: x(
977
1058
  // Base styles
978
1059
  "block w-full rounded-lg border transition-colors duration-200 resize-vertical",
979
1060
  "placeholder-secondary-400 focus:outline-none focus:ring-0",
980
1061
  "disabled:opacity-50 disabled:cursor-not-allowed",
981
1062
  // Size styles
982
- Qe[a],
1063
+ ar[a],
983
1064
  // State styles
984
1065
  N ? "border-error text-error focus:border-error focus:ring-error" : "border-gray-100 text-secondary-900 dark:border-gray-600 dark:bg-secondary-800 dark:text-secondary-100",
985
- x
1066
+ f
986
1067
  ),
987
- ...s
1068
+ ...n
988
1069
  }
989
1070
  ),
990
1071
  i && /* @__PURE__ */ e("div", { className: "absolute top-3 right-3", children: /* @__PURE__ */ c(
@@ -1020,7 +1101,7 @@ const Qe = {
1020
1101
  (t || l) && /* @__PURE__ */ e(
1021
1102
  "p",
1022
1103
  {
1023
- className: b(
1104
+ className: x(
1024
1105
  "mt-1 text-xs",
1025
1106
  N ? "text-error" : "text-secondary-500"
1026
1107
  ),
@@ -1031,7 +1112,7 @@ const Qe = {
1031
1112
  }
1032
1113
  );
1033
1114
  ke.displayName = "TextArea";
1034
- const er = {
1115
+ const nr = {
1035
1116
  sm: "px-3 py-1.5 text-sm",
1036
1117
  md: "px-3 py-2 text-sm",
1037
1118
  lg: "px-3 py-2 text-sm",
@@ -1049,57 +1130,57 @@ const er = {
1049
1130
  size: a = "md",
1050
1131
  fullWidth: o = !1,
1051
1132
  startIcon: i,
1052
- endIcon: f,
1053
- loading: p = !1,
1054
- containerClassName: x,
1055
- labelClassName: v,
1133
+ endIcon: h,
1134
+ loading: g = !1,
1135
+ containerClassName: f,
1136
+ labelClassName: b,
1056
1137
  className: m,
1057
- id: s,
1138
+ id: n,
1058
1139
  ...d
1059
- }, h) => {
1060
- const N = s || `textfield-${Math.random().toString(36).substr(2, 9)}`, y = !!t;
1061
- return /* @__PURE__ */ c("div", { className: b("flex flex-col", o && "w-full", x), children: [
1140
+ }, p) => {
1141
+ const N = n || `textfield-${Math.random().toString(36).substr(2, 9)}`, v = !!t;
1142
+ return /* @__PURE__ */ c("div", { className: x("flex flex-col", o && "w-full", f), children: [
1062
1143
  r && /* @__PURE__ */ e(
1063
1144
  "label",
1064
1145
  {
1065
1146
  htmlFor: N,
1066
- className: b(
1147
+ className: x(
1067
1148
  "block text-sm font-medium mb-1",
1068
- y ? "text-error" : "text-secondary-700 dark:text-secondary-300",
1069
- v
1149
+ v ? "text-error" : "text-secondary-700 dark:text-secondary-300",
1150
+ b
1070
1151
  ),
1071
1152
  children: r
1072
1153
  }
1073
1154
  ),
1074
1155
  /* @__PURE__ */ c("div", { className: "relative", children: [
1075
1156
  i && // Todo fix inset not showing correctly on different sizes
1076
- /* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: b("text-secondary-400", ge[a]), children: i }) }),
1157
+ /* @__PURE__ */ e("div", { className: "absolute left-0 pl-3 flex items-center pointer-events-none h-full", children: /* @__PURE__ */ e("span", { className: x("text-secondary-400", ge[a]), children: i }) }),
1077
1158
  /* @__PURE__ */ e(
1078
1159
  "input",
1079
1160
  {
1080
- ref: h,
1161
+ ref: p,
1081
1162
  id: N,
1082
- className: b(
1163
+ className: x(
1083
1164
  // Base styles
1084
1165
  "block w-full rounded-lg border dark:border-gray-600 transition-colors duration-200",
1085
1166
  "placeholder-gray-500 dark:placeholder-gray-500 focus:outline-none focus:ring-1 focus:ring-offset-0",
1086
1167
  "disabled:opacity-50 disabled:cursor-not-allowed",
1087
1168
  // Size styles
1088
- er[a],
1169
+ nr[a],
1089
1170
  // Icon padding
1090
1171
  i && "pl-10",
1091
- f && "pr-10",
1172
+ h && "pr-10",
1092
1173
  // State styles
1093
- y ? "border-error text-error focus:border-error focus:ring-error" : "border-gray-100 text-secondary-900 focus:border-primary focus:ring-primary dark:border-gray-600 dark:bg-secondary-800 dark:text-secondary-100",
1174
+ v ? "border-error text-error focus:border-error focus:ring-error" : "border-gray-100 text-secondary-900 focus:border-primary focus:ring-primary dark:border-gray-600 dark:bg-secondary-800 dark:text-secondary-100",
1094
1175
  m
1095
1176
  ),
1096
1177
  ...d
1097
1178
  }
1098
1179
  ),
1099
- (f || p) && /* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: p ? /* @__PURE__ */ c(
1180
+ (h || g) && /* @__PURE__ */ e("div", { className: "absolute inset-y-0 right-0 pr-3 flex items-center", children: g ? /* @__PURE__ */ c(
1100
1181
  "svg",
1101
1182
  {
1102
- className: b("animate-spin text-secondary-400", ge[a]),
1183
+ className: x("animate-spin text-secondary-400", ge[a]),
1103
1184
  fill: "none",
1104
1185
  viewBox: "0 0 24 24",
1105
1186
  children: [
@@ -1124,14 +1205,14 @@ const er = {
1124
1205
  )
1125
1206
  ]
1126
1207
  }
1127
- ) : f && /* @__PURE__ */ e("span", { className: b("text-secondary-400", ge[a]), children: f }) })
1208
+ ) : h && /* @__PURE__ */ e("span", { className: x("text-secondary-400", ge[a]), children: h }) })
1128
1209
  ] }),
1129
1210
  (t || l) && /* @__PURE__ */ e(
1130
1211
  "p",
1131
1212
  {
1132
- className: b(
1213
+ className: x(
1133
1214
  "mt-1 text-xs",
1134
- y ? "text-error" : "text-secondary-500"
1215
+ v ? "text-error" : "text-secondary-500"
1135
1216
  ),
1136
1217
  children: t || l
1137
1218
  }
@@ -1147,10 +1228,10 @@ const oe = ({
1147
1228
  clickable: a = !1,
1148
1229
  onClick: o,
1149
1230
  className: i,
1150
- "aria-label": f,
1151
- ...p
1231
+ "aria-label": h,
1232
+ ...g
1152
1233
  }) => {
1153
- const x = typeof l == "number" ? l : rr(l), v = b(
1234
+ const f = typeof l == "number" ? l : lr(l), b = x(
1154
1235
  "inline-block",
1155
1236
  // Color variants
1156
1237
  {
@@ -1171,20 +1252,20 @@ const oe = ({
1171
1252
  },
1172
1253
  i
1173
1254
  ), m = {
1174
- size: x,
1175
- className: v,
1255
+ size: f,
1256
+ className: b,
1176
1257
  onClick: a ? o : void 0,
1177
- "aria-label": f,
1258
+ "aria-label": h,
1178
1259
  role: a ? "button" : void 0,
1179
1260
  tabIndex: a ? 0 : void 0,
1180
- onKeyDown: a ? (s) => {
1181
- (s.key === "Enter" || s.key === " ") && (s.preventDefault(), o?.());
1261
+ onKeyDown: a ? (n) => {
1262
+ (n.key === "Enter" || n.key === " ") && (n.preventDefault(), o?.());
1182
1263
  } : void 0,
1183
- ...p
1264
+ ...g
1184
1265
  };
1185
1266
  return /* @__PURE__ */ e(r, { ...m });
1186
1267
  };
1187
- function rr(r) {
1268
+ function lr(r) {
1188
1269
  return {
1189
1270
  xs: 12,
1190
1271
  sm: 16,
@@ -1193,14 +1274,14 @@ function rr(r) {
1193
1274
  xl: 32
1194
1275
  }[r];
1195
1276
  }
1196
- function tr({
1277
+ function sr({
1197
1278
  children: r,
1198
1279
  showTableSkeleton: l = !1,
1199
1280
  tableColumns: t = 6,
1200
1281
  tableRows: a = 8
1201
1282
  }) {
1202
1283
  return r ? /* @__PURE__ */ e("main", { className: "flex-1 bg-gray-50 dark:bg-gray-950 p-6", children: /* @__PURE__ */ e("div", { className: "w-full max-w-6xl mx-auto animate-pulse", children: r }) }) : /* @__PURE__ */ e("main", { className: "flex-1 bg-gray-50 dark:bg-gray-950 p-6", children: /* @__PURE__ */ c("div", { className: "w-full mx-auto space-y-6 animate-pulse", children: [
1203
- !l && /* @__PURE__ */ c(Le, { children: [
1284
+ !l && /* @__PURE__ */ c(Ee, { children: [
1204
1285
  /* @__PURE__ */ e("div", { className: "h-6 bg-gray-200 dark:bg-gray-700 rounded w-1/4" }),
1205
1286
  /* @__PURE__ */ c("div", { className: "space-y-2", children: [
1206
1287
  /* @__PURE__ */ e("div", { className: "h-4 bg-gray-200 dark:bg-gray-700 rounded w-3/4" }),
@@ -1219,12 +1300,12 @@ function tr({
1219
1300
  "div",
1220
1301
  {
1221
1302
  className: `grid grid-cols-${t} gap-2 p-3 border-t border-gray-100 dark:border-gray-800`,
1222
- children: Array.from({ length: t }).map((f, p) => /* @__PURE__ */ e(
1303
+ children: Array.from({ length: t }).map((h, g) => /* @__PURE__ */ e(
1223
1304
  "div",
1224
1305
  {
1225
1306
  className: "h-4 bg-gray-200 dark:bg-gray-700 rounded w-full"
1226
1307
  },
1227
- `cell-${i}-${p}`
1308
+ `cell-${i}-${g}`
1228
1309
  ))
1229
1310
  },
1230
1311
  `row-${i}`
@@ -1232,61 +1313,61 @@ function tr({
1232
1313
  ] })
1233
1314
  ] }) });
1234
1315
  }
1235
- const ar = ({
1316
+ const or = ({
1236
1317
  trigger: r,
1237
1318
  options: l,
1238
1319
  value: t,
1239
1320
  onSelect: a,
1240
1321
  placement: o = "bottom-start",
1241
1322
  disabled: i = !1,
1242
- className: f,
1243
- showCheck: p = !0,
1244
- header: x
1323
+ className: h,
1324
+ showCheck: g = !0,
1325
+ header: f
1245
1326
  }) => {
1246
- const [v, m] = O(!1), [s, d] = O(null), [h, N] = O({ top: 0, left: 0 }), y = ee(null), S = ee(null), B = ee(null), k = ee(null);
1247
- J(() => {
1248
- const g = (A) => {
1249
- y.current && (!y.current.contains(A.target) || B.current && !B.current.contains(A.target)) && (m(!1), d(null), k.current && (clearTimeout(k.current), k.current = null));
1327
+ const [b, m] = V(!1), [n, d] = V(null), [p, N] = V({ top: 0, left: 0 }), v = Q(null), S = Q(null), B = Q(null), k = Q(null);
1328
+ G(() => {
1329
+ const y = (T) => {
1330
+ v.current && (!v.current.contains(T.target) || B.current && !B.current.contains(T.target)) && (m(!1), d(null), k.current && (clearTimeout(k.current), k.current = null));
1250
1331
  };
1251
- return v && document.addEventListener("mousedown", g), () => {
1252
- document.removeEventListener("mousedown", g);
1332
+ return b && document.addEventListener("mousedown", y), () => {
1333
+ document.removeEventListener("mousedown", y);
1253
1334
  };
1254
- }, [v]), J(() => {
1255
- const g = (A) => {
1256
- A.key === "Escape" && (m(!1), d(null), k.current && (clearTimeout(k.current), k.current = null));
1335
+ }, [b]), G(() => {
1336
+ const y = (T) => {
1337
+ T.key === "Escape" && (m(!1), d(null), k.current && (clearTimeout(k.current), k.current = null));
1257
1338
  };
1258
- return v && document.addEventListener("keydown", g), () => {
1259
- document.removeEventListener("keydown", g);
1339
+ return b && document.addEventListener("keydown", y), () => {
1340
+ document.removeEventListener("keydown", y);
1260
1341
  };
1261
- }, [v]), J(() => {
1262
- if (s && y.current) {
1263
- const g = y.current.querySelector(
1264
- `[data-option-value="${s}"]`
1342
+ }, [b]), G(() => {
1343
+ if (n && v.current) {
1344
+ const y = v.current.querySelector(
1345
+ `[data-option-value="${n}"]`
1265
1346
  );
1266
- if (g) {
1267
- const A = g.getBoundingClientRect();
1347
+ if (y) {
1348
+ const T = y.getBoundingClientRect();
1268
1349
  N({
1269
- top: A.top,
1270
- left: A.right + 8
1350
+ top: T.top,
1351
+ left: T.right + 8
1271
1352
  });
1272
1353
  }
1273
1354
  }
1274
- }, [s]), J(() => () => {
1355
+ }, [n]), G(() => () => {
1275
1356
  k.current && clearTimeout(k.current);
1276
1357
  }, []);
1277
- const q = (g) => {
1278
- g.stopPropagation(), i || (m(!v), d(null), k.current && (clearTimeout(k.current), k.current = null));
1279
- }, K = (g, A, u) => {
1280
- g.stopPropagation(), !A.disabled && !A.divider && (!A.children || A.children.length === 0) && (a?.(A.value, u), m(!1), d(null));
1281
- }, H = (g) => {
1282
- k.current && (clearTimeout(k.current), k.current = null), g.children && g.children.length > 0 ? d(g.value) : d(null);
1283
- }, _ = (g) => {
1284
- g.children && g.children.length > 0 ? k.current = setTimeout(() => {
1358
+ const q = (y) => {
1359
+ y.stopPropagation(), i || (m(!b), d(null), k.current && (clearTimeout(k.current), k.current = null));
1360
+ }, K = (y, T, u) => {
1361
+ y.stopPropagation(), !T.disabled && !T.divider && (!T.children || T.children.length === 0) && (a?.(T.value, u), m(!1), d(null));
1362
+ }, H = (y) => {
1363
+ k.current && (clearTimeout(k.current), k.current = null), y.children && y.children.length > 0 ? d(y.value) : d(null);
1364
+ }, F = (y) => {
1365
+ y.children && y.children.length > 0 ? k.current = setTimeout(() => {
1285
1366
  d(null);
1286
1367
  }, 150) : d(null);
1287
- }, E = (g, A, u) => {
1288
- g.stopPropagation(), !A.disabled && !A.divider && (a?.(A.value, u), m(!1), d(null));
1289
- }, G = b(
1368
+ }, M = (y, T, u) => {
1369
+ y.stopPropagation(), !T.disabled && !T.divider && (a?.(T.value, u), m(!1), d(null));
1370
+ }, J = x(
1290
1371
  "absolute z-50 min-w-[200px] bg-white dark:bg-gray-800 rounded-md shadow-xs border border-gray-100 dark:border-gray-600",
1291
1372
  "max-h-60 overflow-auto",
1292
1373
  {
@@ -1295,17 +1376,17 @@ const ar = ({
1295
1376
  "bottom-full left-0 mb-2": o === "top-start",
1296
1377
  "bottom-full right-0 mb-2": o === "top-end"
1297
1378
  }
1298
- ), z = b(
1379
+ ), z = x(
1299
1380
  "fixed z-[60] min-w-[200px] bg-white dark:bg-gray-800 rounded-md shadow-lg border border-gray-100 dark:border-gray-600",
1300
1381
  "max-h-60 overflow-auto"
1301
1382
  );
1302
1383
  return /* @__PURE__ */ c(
1303
1384
  "div",
1304
1385
  {
1305
- ref: y,
1306
- className: b(
1386
+ ref: v,
1387
+ className: x(
1307
1388
  "relative flex flex-row items-center justify-center rounded-lg hover:bg-gray-100 dark:hover:bg-gray-700",
1308
- f
1389
+ h
1309
1390
  ),
1310
1391
  children: [
1311
1392
  /* @__PURE__ */ e(
@@ -1314,50 +1395,50 @@ const ar = ({
1314
1395
  ref: S,
1315
1396
  onClick: q,
1316
1397
  disabled: i,
1317
- className: b("inline-flex items-center justify-center", {
1398
+ className: x("inline-flex items-center justify-center", {
1318
1399
  "opacity-50 cursor-not-allowed": i
1319
1400
  }),
1320
1401
  children: r
1321
1402
  }
1322
1403
  ),
1323
- v && /* @__PURE__ */ e("div", { className: G, children: /* @__PURE__ */ c("div", { className: "p-2", children: [
1324
- x && (typeof x == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider px-3 py-2", children: x }) : x),
1325
- l.map((g, A) => {
1326
- if (g.divider)
1404
+ b && /* @__PURE__ */ e("div", { className: J, children: /* @__PURE__ */ c("div", { className: "p-2", children: [
1405
+ f && (typeof f == "string" ? /* @__PURE__ */ e("div", { className: "text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider px-3 py-2", children: f }) : f),
1406
+ l.map((y, T) => {
1407
+ if (y.divider)
1327
1408
  return /* @__PURE__ */ e(
1328
1409
  "div",
1329
1410
  {
1330
1411
  className: "border-t border-gray-200 dark:border-gray-700 my-2"
1331
1412
  },
1332
- `divider-${A}`
1413
+ `divider-${T}`
1333
1414
  );
1334
- const u = g.children && g.children.length > 0, $ = s === g.value;
1415
+ const u = y.children && y.children.length > 0, $ = n === y.value;
1335
1416
  return /* @__PURE__ */ c("div", { className: "relative group", children: [
1336
1417
  /* @__PURE__ */ c(
1337
1418
  "button",
1338
1419
  {
1339
- "data-option-value": g.value,
1340
- onClick: (L) => K(L, g),
1341
- onMouseEnter: () => H(g),
1342
- onMouseLeave: () => _(g),
1343
- disabled: g.disabled,
1344
- className: b(
1420
+ "data-option-value": y.value,
1421
+ onClick: (L) => K(L, y),
1422
+ onMouseEnter: () => H(y),
1423
+ onMouseLeave: () => F(y),
1424
+ disabled: y.disabled,
1425
+ className: x(
1345
1426
  "w-full flex items-center justify-between px-3 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md transition-colors",
1346
1427
  {
1347
- "opacity-50 cursor-not-allowed": g.disabled,
1428
+ "opacity-50 cursor-not-allowed": y.disabled,
1348
1429
  "bg-gray-100 dark:bg-gray-700": $ && u
1349
1430
  }
1350
1431
  ),
1351
1432
  children: [
1352
1433
  /* @__PURE__ */ c("div", { className: "flex items-center space-x-2 min-w-0", children: [
1353
- g.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: g.icon }),
1434
+ y.icon && /* @__PURE__ */ e("span", { className: "flex-shrink-0", children: y.icon }),
1354
1435
  /* @__PURE__ */ c("div", { className: "flex flex-col items-start min-w-0", children: [
1355
- /* @__PURE__ */ e("span", { className: "font-base truncate", children: g.label }),
1356
- g.description && /* @__PURE__ */ e("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: g.description })
1436
+ /* @__PURE__ */ e("span", { className: "font-base truncate", children: y.label }),
1437
+ y.description && /* @__PURE__ */ e("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: y.description })
1357
1438
  ] })
1358
1439
  ] }),
1359
1440
  /* @__PURE__ */ c("div", { className: "flex items-center space-x-2", children: [
1360
- p && t === g.value && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-green-600 flex-shrink-0 text-sm font-bold", children: "✓" }),
1441
+ g && t === y.value && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-green-600 flex-shrink-0 text-sm font-bold", children: "✓" }),
1361
1442
  u && /* @__PURE__ */ e("span", { className: "text-gray-400 dark:text-gray-500 text-xs", children: "▶" })
1362
1443
  ] })
1363
1444
  ]
@@ -1369,18 +1450,18 @@ const ar = ({
1369
1450
  ref: B,
1370
1451
  className: z,
1371
1452
  style: {
1372
- top: `${h.top}px`,
1373
- left: `${h.left}px`
1453
+ top: `${p.top}px`,
1454
+ left: `${p.left}px`
1374
1455
  },
1375
1456
  onMouseEnter: () => {
1376
- k.current && (clearTimeout(k.current), k.current = null), d(g.value);
1457
+ k.current && (clearTimeout(k.current), k.current = null), d(y.value);
1377
1458
  },
1378
1459
  onMouseLeave: () => {
1379
1460
  k.current = setTimeout(() => {
1380
1461
  d(null);
1381
1462
  }, 150);
1382
1463
  },
1383
- children: /* @__PURE__ */ e("div", { className: "p-2", children: g.children.map((L, D) => {
1464
+ children: /* @__PURE__ */ e("div", { className: "p-2", children: y.children.map((L, D) => {
1384
1465
  if (L.divider)
1385
1466
  return /* @__PURE__ */ e(
1386
1467
  "div",
@@ -1389,19 +1470,19 @@ const ar = ({
1389
1470
  },
1390
1471
  `divider-${D}`
1391
1472
  );
1392
- const P = typeof t == "object" && t[g.value] && t[g.value].includes(
1473
+ const P = typeof t == "object" && t[y.value] && t[y.value].includes(
1393
1474
  L.value
1394
1475
  ) || t === L.value;
1395
1476
  return /* @__PURE__ */ c(
1396
1477
  "button",
1397
1478
  {
1398
- onClick: (M) => E(
1399
- M,
1479
+ onClick: (E) => M(
1480
+ E,
1400
1481
  L,
1401
- g.value
1482
+ y.value
1402
1483
  ),
1403
1484
  disabled: L.disabled,
1404
- className: b(
1485
+ className: x(
1405
1486
  "w-full flex items-center justify-between px-3 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-gray-700 rounded-md transition-colors",
1406
1487
  {
1407
1488
  "opacity-50 cursor-not-allowed": L.disabled
@@ -1415,7 +1496,7 @@ const ar = ({
1415
1496
  L.description && /* @__PURE__ */ e("span", { className: "text-xs text-gray-500 dark:text-gray-400", children: L.description })
1416
1497
  ] })
1417
1498
  ] }),
1418
- p && P && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-green-600 flex-shrink-0 text-sm font-bold", children: "✓" })
1499
+ g && P && /* @__PURE__ */ e("span", { className: "h-4 w-4 text-green-600 flex-shrink-0 text-sm font-bold", children: "✓" })
1419
1500
  ]
1420
1501
  },
1421
1502
  L.value
@@ -1423,16 +1504,16 @@ const ar = ({
1423
1504
  }) })
1424
1505
  }
1425
1506
  )
1426
- ] }, g.value);
1507
+ ] }, y.value);
1427
1508
  }),
1428
1509
  (() => {
1429
- const g = l.reduce((A, u) => {
1430
- if (u.divider) return A;
1510
+ const y = l.reduce((T, u) => {
1511
+ if (u.divider) return T;
1431
1512
  const $ = u.children ? u.children.filter((L) => !L.divider).length : 0;
1432
- return A + 1 + $;
1513
+ return T + 1 + $;
1433
1514
  }, 0);
1434
- return g > 1 && /* @__PURE__ */ e("div", { className: "border-t border-gray-200 dark:border-gray-600 mt-2 pt-2", children: /* @__PURE__ */ c("div", { className: "text-xs text-gray-500 dark:text-gray-400 px-3 py-1", children: [
1435
- g,
1515
+ return y > 1 && /* @__PURE__ */ e("div", { className: "border-t border-gray-200 dark:border-gray-600 mt-2 pt-2", children: /* @__PURE__ */ c("div", { className: "text-xs text-gray-500 dark:text-gray-400 px-3 py-1", children: [
1516
+ y,
1436
1517
  " options available"
1437
1518
  ] }) });
1438
1519
  })()
@@ -1440,7 +1521,7 @@ const ar = ({
1440
1521
  ]
1441
1522
  }
1442
1523
  );
1443
- }, nr = () => /* @__PURE__ */ e(
1524
+ }, cr = () => /* @__PURE__ */ e(
1444
1525
  "svg",
1445
1526
  {
1446
1527
  className: "h-4 w-4",
@@ -1457,10 +1538,10 @@ const ar = ({
1457
1538
  }
1458
1539
  )
1459
1540
  }
1460
- ), lr = ({ active: r }) => /* @__PURE__ */ e(
1541
+ ), dr = ({ active: r }) => /* @__PURE__ */ e(
1461
1542
  "svg",
1462
1543
  {
1463
- className: b(
1544
+ className: x(
1464
1545
  "h-3 w-3",
1465
1546
  r ? "text-neutral-900 dark:text-neutral-100" : "text-neutral-400"
1466
1547
  ),
@@ -1477,10 +1558,10 @@ const ar = ({
1477
1558
  }
1478
1559
  )
1479
1560
  }
1480
- ), sr = ({ active: r }) => /* @__PURE__ */ e(
1561
+ ), ir = ({ active: r }) => /* @__PURE__ */ e(
1481
1562
  "svg",
1482
1563
  {
1483
- className: b(
1564
+ className: x(
1484
1565
  "h-3 w-3",
1485
1566
  r ? "text-neutral-900 dark:text-neutral-100" : "text-neutral-400"
1486
1567
  ),
@@ -1497,7 +1578,7 @@ const ar = ({
1497
1578
  }
1498
1579
  )
1499
1580
  }
1500
- ), or = () => /* @__PURE__ */ e(
1581
+ ), ur = () => /* @__PURE__ */ e(
1501
1582
  "svg",
1502
1583
  {
1503
1584
  className: "h-4 w-4",
@@ -1514,7 +1595,7 @@ const ar = ({
1514
1595
  }
1515
1596
  )
1516
1597
  }
1517
- ), cr = () => /* @__PURE__ */ e(
1598
+ ), mr = () => /* @__PURE__ */ e(
1518
1599
  "svg",
1519
1600
  {
1520
1601
  className: "h-4 w-4",
@@ -1531,7 +1612,7 @@ const ar = ({
1531
1612
  }
1532
1613
  )
1533
1614
  }
1534
- ), dr = () => /* @__PURE__ */ e(
1615
+ ), hr = () => /* @__PURE__ */ e(
1535
1616
  "svg",
1536
1617
  {
1537
1618
  className: "h-4 w-4",
@@ -1548,7 +1629,7 @@ const ar = ({
1548
1629
  }
1549
1630
  )
1550
1631
  }
1551
- ), ir = () => /* @__PURE__ */ e(
1632
+ ), fr = () => /* @__PURE__ */ e(
1552
1633
  "svg",
1553
1634
  {
1554
1635
  className: "h-4 w-4",
@@ -1565,7 +1646,7 @@ const ar = ({
1565
1646
  }
1566
1647
  )
1567
1648
  }
1568
- ), Ee = () => /* @__PURE__ */ e(
1649
+ ), $e = () => /* @__PURE__ */ e(
1569
1650
  "svg",
1570
1651
  {
1571
1652
  className: "h-4 w-4",
@@ -1582,7 +1663,7 @@ const ar = ({
1582
1663
  }
1583
1664
  )
1584
1665
  }
1585
- ), ur = (r) => {
1666
+ ), pr = (r) => {
1586
1667
  const l = (a) => r.multiSelect && Array.isArray(r.value) ? r.value?.includes(a) : r.value === a, t = (a) => {
1587
1668
  r.multiSelect && Array.isArray(r.value) ? r.onChange(r.value.filter((o) => o !== a)) : r.onChange(a);
1588
1669
  };
@@ -1601,7 +1682,7 @@ const ar = ({
1601
1682
  /* @__PURE__ */ e("span", { className: "text-gray-800", children: r.multiSelect && Array.isArray(r.value) ? r.value?.map(
1602
1683
  (a) => r.options?.find((o) => o.value === a)?.label
1603
1684
  ).join(", ") : r.options?.find((a) => a.value === r.value)?.label }),
1604
- /* @__PURE__ */ e("span", { className: "text-gray-500 text-sm group-open:rotate-180 transition-transform", children: /* @__PURE__ */ e(Ee, {}) })
1685
+ /* @__PURE__ */ e("span", { className: "text-gray-500 text-sm group-open:rotate-180 transition-transform", children: /* @__PURE__ */ e($e, {}) })
1605
1686
  ] }),
1606
1687
  /* @__PURE__ */ c("div", { className: "absolute z-10 left-0 mt-1 bg-white border border-gray-100 rounded-lg shadow-sm p-2 w-48", children: [
1607
1688
  r.options?.map((a) => /* @__PURE__ */ e(
@@ -1612,7 +1693,7 @@ const ar = ({
1612
1693
  children: /* @__PURE__ */ e(
1613
1694
  "span",
1614
1695
  {
1615
- className: b(l(a.value) && "text-primary-500"),
1696
+ className: x(l(a.value) && "text-primary-500"),
1616
1697
  children: a.label
1617
1698
  }
1618
1699
  )
@@ -1629,189 +1710,189 @@ const ar = ({
1629
1710
  )
1630
1711
  ] })
1631
1712
  ] }) }) });
1632
- }, Ce = ({
1713
+ }, Se = ({
1633
1714
  data: r,
1634
1715
  columns: l,
1635
1716
  loading: t = !1,
1636
1717
  searchable: a = !1,
1637
1718
  searchPlaceholder: o = "Search...",
1638
1719
  filters: i = [],
1639
- paginated: f = !1,
1640
- pageSizeOptions: p = [10, 25, 50, 100],
1641
- defaultPageSize: x = 10,
1642
- actions: v = [],
1720
+ paginated: h = !1,
1721
+ pageSizeOptions: g = [10, 25, 50, 100],
1722
+ defaultPageSize: f = 10,
1723
+ actions: b = [],
1643
1724
  onRowClick: m,
1644
- selectable: s = !1,
1725
+ selectable: n = !1,
1645
1726
  selectedRows: d = [],
1646
- onSelectionChange: h,
1647
- getRowKey: N = (H, _) => _,
1648
- emptyContent: y,
1727
+ onSelectionChange: p,
1728
+ getRowKey: N = (H, F) => F,
1729
+ emptyContent: v,
1649
1730
  hoverable: S = !0,
1650
1731
  bordered: B = !1,
1651
1732
  striped: k = !1,
1652
1733
  className: q,
1653
1734
  rowClassName: K
1654
1735
  }) => {
1655
- const [H, _] = O(""), [E, G] = O({
1736
+ const [H, F] = V(""), [M, J] = V({
1656
1737
  column: null,
1657
1738
  direction: null
1658
- }), [z, g] = O({
1739
+ }), [z, y] = V({
1659
1740
  page: 0,
1660
- pageSize: x
1661
- }), A = ee(null), u = ie(() => {
1662
- let n = r;
1741
+ pageSize: f
1742
+ }), T = Q(null), u = ie(() => {
1743
+ let s = r;
1663
1744
  if (a && H.trim()) {
1664
1745
  const w = l.filter(
1665
1746
  (R) => R.searchable !== !1
1666
- ), V = H.toLowerCase();
1667
- n = n.filter((R) => w.some((j) => {
1747
+ ), _ = H.toLowerCase();
1748
+ s = s.filter((R) => w.some((j) => {
1668
1749
  const Y = typeof j.accessor == "function" ? j.accessor(R) : R[j.accessor];
1669
- return String(Y || "").toLowerCase().includes(V);
1750
+ return String(Y || "").toLowerCase().includes(_);
1670
1751
  }));
1671
1752
  }
1672
1753
  return i.forEach((w) => {
1673
- w.value && w.value !== "all" && (n = n.filter((V) => {
1754
+ w.value && w.value !== "all" && (s = s.filter((_) => {
1674
1755
  const R = l.find((Y) => Y.id === w.id);
1675
1756
  if (!R) return !0;
1676
- const j = typeof R.accessor == "function" ? R.accessor(V) : V[R.accessor];
1757
+ const j = typeof R.accessor == "function" ? R.accessor(_) : _[R.accessor];
1677
1758
  return String(j || "") === w.value;
1678
1759
  }));
1679
- }), n;
1760
+ }), s;
1680
1761
  }, [r, H, l, a, i]), $ = ie(() => {
1681
- if (!E.column || !E.direction) return u;
1682
- const n = l.find((w) => w.id === E.column);
1683
- return n ? [...u].sort((w, V) => {
1684
- const R = typeof n.accessor == "function" ? n.accessor(w) : w[n.accessor], j = typeof n.accessor == "function" ? n.accessor(V) : V[n.accessor];
1762
+ if (!M.column || !M.direction) return u;
1763
+ const s = l.find((w) => w.id === M.column);
1764
+ return s ? [...u].sort((w, _) => {
1765
+ const R = typeof s.accessor == "function" ? s.accessor(w) : w[s.accessor], j = typeof s.accessor == "function" ? s.accessor(_) : _[s.accessor];
1685
1766
  let Y = 0;
1686
- return R < j ? Y = -1 : R > j && (Y = 1), E.direction === "desc" ? -Y : Y;
1767
+ return R < j ? Y = -1 : R > j && (Y = 1), M.direction === "desc" ? -Y : Y;
1687
1768
  }) : u;
1688
- }, [u, E, l]), L = ie(() => {
1689
- if (!f) return $;
1690
- const n = z.page * z.pageSize, w = n + z.pageSize;
1691
- return $.slice(n, w);
1692
- }, [$, z, f]), D = ne(
1693
- (n) => {
1694
- l.find((V) => V.id === n)?.sortable && G((V) => V.column !== n ? { column: n, direction: "asc" } : V.direction === "asc" ? { column: n, direction: "desc" } : { column: null, direction: null });
1769
+ }, [u, M, l]), L = ie(() => {
1770
+ if (!h) return $;
1771
+ const s = z.page * z.pageSize, w = s + z.pageSize;
1772
+ return $.slice(s, w);
1773
+ }, [$, z, h]), D = ae(
1774
+ (s) => {
1775
+ l.find((_) => _.id === s)?.sortable && J((_) => _.column !== s ? { column: s, direction: "asc" } : _.direction === "asc" ? { column: s, direction: "desc" } : { column: null, direction: null });
1695
1776
  },
1696
1777
  [l]
1697
- ), P = ne((n) => {
1698
- g((w) => ({ ...w, page: n }));
1699
- }, []), M = ne((n) => {
1700
- g({ page: 0, pageSize: n });
1701
- }, []), re = ne(
1702
- (n, w) => {
1703
- if (!h) return;
1704
- const V = N(n, 0);
1705
- d.map((R, j) => N(R, j)), h(w ? [...d, n] : d.filter(
1706
- (R, j) => N(d[j], j) !== V
1778
+ ), P = ae((s) => {
1779
+ y((w) => ({ ...w, page: s }));
1780
+ }, []), E = ae((s) => {
1781
+ y({ page: 0, pageSize: s });
1782
+ }, []), re = ae(
1783
+ (s, w) => {
1784
+ if (!p) return;
1785
+ const _ = N(s, 0);
1786
+ d.map((R, j) => N(R, j)), p(w ? [...d, s] : d.filter(
1787
+ (R, j) => N(d[j], j) !== _
1707
1788
  ));
1708
1789
  },
1709
- [d, h, N]
1710
- ), ae = ne(
1711
- (n) => {
1712
- h && h(n ? [...L] : []);
1790
+ [d, p, N]
1791
+ ), ne = ae(
1792
+ (s) => {
1793
+ p && p(s ? [...L] : []);
1713
1794
  },
1714
- [L, h]
1795
+ [L, p]
1715
1796
  );
1716
- J(() => {
1717
- g((n) => ({ ...n, page: 0 }));
1718
- }, [H, E]), J(() => {
1719
- g((n) => ({ ...n, page: 0 }));
1720
- }, [i.map((n) => n.value).join(",")]);
1721
- const W = $.length, C = Math.ceil(W / z.pageSize), I = z.page * z.pageSize + 1, F = Math.min(I + z.pageSize - 1, W), T = L.length > 0 && L.every((n) => {
1722
- const w = N(n, 0);
1797
+ G(() => {
1798
+ y((s) => ({ ...s, page: 0 }));
1799
+ }, [H, M]), G(() => {
1800
+ y((s) => ({ ...s, page: 0 }));
1801
+ }, [i.map((s) => s.value).join(",")]);
1802
+ const W = $.length, C = Math.ceil(W / z.pageSize), I = z.page * z.pageSize + 1, O = Math.min(I + z.pageSize - 1, W), A = L.length > 0 && L.every((s) => {
1803
+ const w = N(s, 0);
1723
1804
  return d.some(
1724
- (V, R) => N(V, R) === w
1805
+ (_, R) => N(_, R) === w
1725
1806
  );
1726
- }), X = L.some((n) => {
1727
- const w = N(n, 0);
1807
+ }), X = L.some((s) => {
1808
+ const w = N(s, 0);
1728
1809
  return d.some(
1729
- (V, R) => N(V, R) === w
1810
+ (_, R) => N(_, R) === w
1730
1811
  );
1731
- }), te = b(
1812
+ }), te = x(
1732
1813
  "w-full text-sm leading-5 text-[var(--text-default)] border-collapse",
1733
1814
  q
1734
- ), U = b("bg-[var(--base-module)]"), le = b(
1815
+ ), U = x("bg-[var(--base-module)]"), le = x(
1735
1816
  "text-[var(--text-default)] dark:text-[var(--text-on-neutral)] p-3 border-b border-[var(--neutral-border)]"
1736
- ), he = b("h-12", {
1817
+ ), he = x("h-12", {
1737
1818
  "hover:bg-[var(--neutral-container)] dark:hover:bg-[var(--neutral-container-emphasis)]": S,
1738
1819
  "cursor-pointer": m
1739
1820
  });
1740
1821
  return /* @__PURE__ */ c("div", { className: "space-y-4", children: [
1741
1822
  (a || i.length > 0) && /* @__PURE__ */ e("div", { className: "pt-4 pb-2", children: /* @__PURE__ */ c("div", { className: "flex flex-wrap gap-4 items-start", children: [
1742
- i.map((n) => /* @__PURE__ */ e(ur, { ...n }, n.id)),
1823
+ i.map((s) => /* @__PURE__ */ e(pr, { ...s }, s.id)),
1743
1824
  /* @__PURE__ */ e("div", { className: "w-full sm:w-auto sm:ml-auto min-w-[200px]", children: /* @__PURE__ */ e(
1744
1825
  ue,
1745
1826
  {
1746
1827
  placeholder: o,
1747
1828
  value: H,
1748
- onChange: (n) => _(n.target.value),
1749
- startIcon: /* @__PURE__ */ e(nr, {}),
1829
+ onChange: (s) => F(s.target.value),
1830
+ startIcon: /* @__PURE__ */ e(cr, {}),
1750
1831
  className: "max-w-sm"
1751
1832
  }
1752
1833
  ) })
1753
1834
  ] }) }),
1754
1835
  /* @__PURE__ */ c("div", { className: "relative w-full overflow-x-auto min-h-[400px]", children: [
1755
1836
  t && /* @__PURE__ */ e("div", { className: "flex items-center justify-center z-10", children: /* @__PURE__ */ e(
1756
- tr,
1837
+ sr,
1757
1838
  {
1758
1839
  showTableSkeleton: !0,
1759
1840
  tableRows: 10,
1760
1841
  tableColumns: l.length
1761
1842
  }
1762
1843
  ) }),
1763
- /* @__PURE__ */ c("table", { ref: A, className: b(te, "min-w-full"), children: [
1844
+ /* @__PURE__ */ c("table", { ref: T, className: x(te, "min-w-full"), children: [
1764
1845
  /* @__PURE__ */ e("thead", { className: U, children: /* @__PURE__ */ c("tr", { children: [
1765
- s && /* @__PURE__ */ e("th", { className: b(le, "w-12"), children: /* @__PURE__ */ e(
1846
+ n && /* @__PURE__ */ e("th", { className: x(le, "w-12"), children: /* @__PURE__ */ e(
1766
1847
  "input",
1767
1848
  {
1768
1849
  type: "checkbox",
1769
- checked: T,
1770
- ref: (n) => {
1771
- n && (n.indeterminate = X && !T);
1850
+ checked: A,
1851
+ ref: (s) => {
1852
+ s && (s.indeterminate = X && !A);
1772
1853
  },
1773
- onChange: (n) => ae(n.target.checked),
1854
+ onChange: (s) => ne(s.target.checked),
1774
1855
  className: "rounded border-neutral-300 dark:border-neutral-600"
1775
1856
  }
1776
1857
  ) }),
1777
- !t && l.map((n) => /* @__PURE__ */ e(
1858
+ !t && l.map((s) => /* @__PURE__ */ e(
1778
1859
  "th",
1779
1860
  {
1780
- className: b(
1861
+ className: x(
1781
1862
  le,
1782
1863
  "font-semibold text-xs text-[var(--text-muted)] dark:text-[var(--text-muted)] uppercase tracking-wider",
1783
1864
  "group",
1784
1865
  {
1785
- "text-left": n.align === "left" || !n.align,
1786
- "text-center": n.align === "center",
1787
- "text-right": n.align === "right",
1788
- "cursor-pointer select-none": n.sortable,
1789
- "sticky left-0 bg-white dark:bg-neutral-900": n.sticky === "left",
1790
- "sticky right-0 bg-white dark:bg-neutral-900": n.sticky === "right"
1866
+ "text-left": s.align === "left" || !s.align,
1867
+ "text-center": s.align === "center",
1868
+ "text-right": s.align === "right",
1869
+ "cursor-pointer select-none": s.sortable,
1870
+ "sticky left-0 bg-white dark:bg-neutral-900": s.sticky === "left",
1871
+ "sticky right-0 bg-white dark:bg-neutral-900": s.sticky === "right"
1791
1872
  }
1792
1873
  ),
1793
- style: { width: n.width },
1794
- onClick: () => n.sortable && D(n.id),
1874
+ style: { width: s.width },
1875
+ onClick: () => s.sortable && D(s.id),
1795
1876
  children: /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
1796
- n.headerCell ? n.headerCell() : n.header,
1797
- n.sortable && /* @__PURE__ */ c(
1877
+ s.headerCell ? s.headerCell() : s.header,
1878
+ s.sortable && /* @__PURE__ */ c(
1798
1879
  "div",
1799
1880
  {
1800
- className: b(
1881
+ className: x(
1801
1882
  "flex flex-col opacity-0 group-hover:opacity-100 transition-opacity",
1802
- E.column === n.id && "opacity-100"
1883
+ M.column === s.id && "opacity-100"
1803
1884
  ),
1804
1885
  children: [
1805
1886
  /* @__PURE__ */ e(
1806
- lr,
1887
+ dr,
1807
1888
  {
1808
- active: E.column === n.id && E.direction === "asc"
1889
+ active: M.column === s.id && M.direction === "asc"
1809
1890
  }
1810
1891
  ),
1811
1892
  /* @__PURE__ */ e(
1812
- sr,
1893
+ ir,
1813
1894
  {
1814
- active: E.column === n.id && E.direction === "desc"
1895
+ active: M.column === s.id && M.direction === "desc"
1815
1896
  }
1816
1897
  )
1817
1898
  ]
@@ -1819,100 +1900,100 @@ const ar = ({
1819
1900
  )
1820
1901
  ] })
1821
1902
  },
1822
- n.id
1903
+ s.id
1823
1904
  )),
1824
- v.length > 0 && /* @__PURE__ */ e("th", { className: b(le, "w-20"), children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Actions" }) })
1905
+ b.length > 0 && /* @__PURE__ */ e("th", { className: x(le, "w-20"), children: /* @__PURE__ */ e("span", { className: "sr-only", children: "Actions" }) })
1825
1906
  ] }) }),
1826
1907
  /* @__PURE__ */ e("tbody", { children: L.length === 0 || t ? !t && /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
1827
1908
  "td",
1828
1909
  {
1829
- colSpan: l.length + (s ? 1 : 0) + (v.length > 0 ? 1 : 0),
1830
- className: b(
1910
+ colSpan: l.length + (n ? 1 : 0) + (b.length > 0 ? 1 : 0),
1911
+ className: x(
1831
1912
  le,
1832
1913
  "text-center py-8 text-neutral-500 dark:text-neutral-400"
1833
1914
  ),
1834
- children: y || "No data available"
1915
+ children: v || "No data available"
1835
1916
  }
1836
- ) }) : L.map((n, w) => {
1837
- const V = N(n, w), R = d.some(
1838
- (j, Y) => N(j, Y) === V
1917
+ ) }) : L.map((s, w) => {
1918
+ const _ = N(s, w), R = d.some(
1919
+ (j, Y) => N(j, Y) === _
1839
1920
  );
1840
1921
  return /* @__PURE__ */ c(
1841
1922
  "tr",
1842
1923
  {
1843
- className: b(
1924
+ className: x(
1844
1925
  he,
1845
1926
  { "bg-blue-50 dark:bg-blue-900/20": R },
1846
- K?.(n, w)
1927
+ K?.(s, w)
1847
1928
  ),
1848
1929
  onClick: (j) => {
1849
- j.stopPropagation(), m?.(n, w);
1930
+ j.stopPropagation(), m?.(s, w);
1850
1931
  },
1851
1932
  children: [
1852
- s && /* @__PURE__ */ e("td", { className: le, children: /* @__PURE__ */ e(
1933
+ n && /* @__PURE__ */ e("td", { className: le, children: /* @__PURE__ */ e(
1853
1934
  "input",
1854
1935
  {
1855
1936
  type: "checkbox",
1856
1937
  checked: R,
1857
1938
  onChange: (j) => {
1858
- j.stopPropagation(), re(n, j.target.checked);
1939
+ j.stopPropagation(), re(s, j.target.checked);
1859
1940
  },
1860
1941
  className: "rounded border-neutral-300 dark:border-neutral-600"
1861
1942
  }
1862
1943
  ) }),
1863
1944
  l.map((j) => {
1864
- const Y = typeof j.accessor == "function" ? j.accessor(n) : n[j.accessor];
1945
+ const Y = typeof j.accessor == "function" ? j.accessor(s) : s[j.accessor];
1865
1946
  return /* @__PURE__ */ e(
1866
1947
  "td",
1867
1948
  {
1868
- className: b(le, {
1949
+ className: x(le, {
1869
1950
  "text-left": j.align === "left" || !j.align,
1870
1951
  "text-center": j.align === "center",
1871
1952
  "text-right": j.align === "right",
1872
1953
  "sticky left-0 bg-white dark:bg-neutral-900": j.sticky === "left",
1873
1954
  "sticky right-0 bg-white dark:bg-neutral-900": j.sticky === "right"
1874
1955
  }),
1875
- children: j.cell ? j.cell(Y, n, w) : String(Y || "")
1956
+ children: j.cell ? j.cell(Y, s, w) : String(Y || "")
1876
1957
  },
1877
1958
  j.id
1878
1959
  );
1879
1960
  }),
1880
- v.length > 0 && /* @__PURE__ */ e("td", { className: le, children: /* @__PURE__ */ e(
1881
- ar,
1961
+ b.length > 0 && /* @__PURE__ */ e("td", { className: le, children: /* @__PURE__ */ e(
1962
+ or,
1882
1963
  {
1883
1964
  trigger: /* @__PURE__ */ c("div", { className: "inline-flex items-center gap-1 px-2 py-1 text-sm text-neutral-600 dark:text-neutral-400 hover:text-neutral-900 dark:hover:text-neutral-100", children: [
1884
1965
  /* @__PURE__ */ e("span", { children: "Options" }),
1885
- /* @__PURE__ */ e(Ee, {})
1966
+ /* @__PURE__ */ e($e, {})
1886
1967
  ] }),
1887
- options: v.map((j) => ({
1968
+ options: b.map((j) => ({
1888
1969
  value: j.id,
1889
1970
  label: j.label,
1890
1971
  icon: j.icon,
1891
- disabled: j.disabled?.(n)
1972
+ disabled: j.disabled?.(s)
1892
1973
  })),
1893
1974
  onSelect: (j) => {
1894
- const Y = v.find(
1975
+ const Y = b.find(
1895
1976
  (fe) => fe.id === j
1896
1977
  );
1897
- Y && Y.onClick(n, w);
1978
+ Y && Y.onClick(s, w);
1898
1979
  },
1899
1980
  placement: "bottom-end"
1900
1981
  }
1901
1982
  ) })
1902
1983
  ]
1903
1984
  },
1904
- V
1985
+ _
1905
1986
  );
1906
1987
  }) })
1907
1988
  ] })
1908
1989
  ] }),
1909
- f && W > 0 && /* @__PURE__ */ c("div", { className: "flex items-center justify-between px-6", children: [
1990
+ h && W > 0 && /* @__PURE__ */ c("div", { className: "flex items-center justify-between px-6", children: [
1910
1991
  /* @__PURE__ */ c("div", { className: "flex items-center gap-4", children: [
1911
1992
  /* @__PURE__ */ c("span", { className: "text-sm text-neutral-600 dark:text-neutral-400", children: [
1912
1993
  "Showing ",
1913
1994
  I,
1914
1995
  " to ",
1915
- F,
1996
+ O,
1916
1997
  " of ",
1917
1998
  W,
1918
1999
  " results"
@@ -1923,34 +2004,34 @@ const ar = ({
1923
2004
  "select",
1924
2005
  {
1925
2006
  value: z.pageSize,
1926
- onChange: (n) => M(Number(n.target.value)),
2007
+ onChange: (s) => E(Number(s.target.value)),
1927
2008
  className: "border border-[var(--neutral-border)] text-[var(--text-default)] dark:text-[var(--text-on-neutral)] rounded-md px-2 py-1 text-sm bg-[var(--base-input)] dark:bg-[var(--base-input)] w-16",
1928
- children: p.map((n) => /* @__PURE__ */ e("option", { value: n, children: n }, n))
2009
+ children: g.map((s) => /* @__PURE__ */ e("option", { value: s, children: s }, s))
1929
2010
  }
1930
2011
  )
1931
2012
  ] })
1932
2013
  ] }),
1933
2014
  /* @__PURE__ */ c("div", { className: "flex items-center gap-1", children: [
1934
2015
  /* @__PURE__ */ e(
1935
- Q,
2016
+ ee,
1936
2017
  {
1937
2018
  size: "sm",
1938
2019
  variant: "ghost",
1939
2020
  onClick: () => P(0),
1940
2021
  disabled: z.page === 0,
1941
2022
  iconOnly: !0,
1942
- children: /* @__PURE__ */ e(dr, {})
2023
+ children: /* @__PURE__ */ e(hr, {})
1943
2024
  }
1944
2025
  ),
1945
2026
  /* @__PURE__ */ e(
1946
- Q,
2027
+ ee,
1947
2028
  {
1948
2029
  size: "sm",
1949
2030
  variant: "ghost",
1950
2031
  onClick: () => P(z.page - 1),
1951
2032
  disabled: z.page === 0,
1952
2033
  iconOnly: !0,
1953
- children: /* @__PURE__ */ e(or, {})
2034
+ children: /* @__PURE__ */ e(ur, {})
1954
2035
  }
1955
2036
  ),
1956
2037
  /* @__PURE__ */ c("span", { className: "px-3 py-1 text-sm text-gray-500 dark:text-gray-400", children: [
@@ -1960,79 +2041,79 @@ const ar = ({
1960
2041
  C
1961
2042
  ] }),
1962
2043
  /* @__PURE__ */ e(
1963
- Q,
2044
+ ee,
1964
2045
  {
1965
2046
  size: "sm",
1966
2047
  variant: "ghost",
1967
2048
  onClick: () => P(z.page + 1),
1968
2049
  disabled: z.page >= C - 1,
1969
2050
  iconOnly: !0,
1970
- children: /* @__PURE__ */ e(cr, {})
2051
+ children: /* @__PURE__ */ e(mr, {})
1971
2052
  }
1972
2053
  ),
1973
2054
  /* @__PURE__ */ e(
1974
- Q,
2055
+ ee,
1975
2056
  {
1976
2057
  size: "sm",
1977
2058
  variant: "ghost",
1978
2059
  onClick: () => P(C - 1),
1979
2060
  disabled: z.page >= C - 1,
1980
2061
  iconOnly: !0,
1981
- children: /* @__PURE__ */ e(ir, {})
2062
+ children: /* @__PURE__ */ e(fr, {})
1982
2063
  }
1983
2064
  )
1984
2065
  ] })
1985
2066
  ] })
1986
2067
  ] });
1987
- }, mr = Ae(null), Rr = ({
2068
+ }, xr = Ae(null), Kr = ({
1988
2069
  items: r,
1989
2070
  activeTab: l,
1990
2071
  onTabChange: t,
1991
2072
  className: a
1992
2073
  }) => {
1993
- const [o, i] = O(r[0]?.id || ""), f = l || o, p = (x) => {
1994
- t ? t(x) : i(x);
2074
+ const [o, i] = V(r[0]?.id || ""), h = l || o, g = (f) => {
2075
+ t ? t(f) : i(f);
1995
2076
  };
1996
- return /* @__PURE__ */ e("div", { className: b("border-b border-neutral-200 dark:border-neutral-700", a), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: r.map((x) => /* @__PURE__ */ e(
2077
+ return /* @__PURE__ */ e("div", { className: x("border-b border-neutral-200 dark:border-neutral-700", a), children: /* @__PURE__ */ e("nav", { className: "-mb-px flex space-x-8", children: r.map((f) => /* @__PURE__ */ e(
1997
2078
  "button",
1998
2079
  {
1999
- onClick: () => !x.disabled && p(x.id),
2000
- disabled: x.disabled,
2001
- className: b(
2080
+ onClick: () => !f.disabled && g(f.id),
2081
+ disabled: f.disabled,
2082
+ className: x(
2002
2083
  "border-b-2 py-2 px-1 text-sm font-medium transition-colors duration-200",
2003
2084
  {
2004
- "border-primary text-primary": f === x.id,
2005
- "border-transparent text-neutral-500 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-300": f !== x.id && !x.disabled,
2006
- "border-transparent text-neutral-300 cursor-not-allowed dark:text-neutral-600": x.disabled
2085
+ "border-primary text-primary": h === f.id,
2086
+ "border-transparent text-neutral-500 hover:text-neutral-700 dark:text-neutral-400 dark:hover:text-neutral-300": h !== f.id && !f.disabled,
2087
+ "border-transparent text-neutral-300 cursor-not-allowed dark:text-neutral-600": f.disabled
2007
2088
  }
2008
2089
  ),
2009
2090
  children: /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
2010
- x.label,
2011
- x.badge && /* @__PURE__ */ e("span", { className: b(
2091
+ f.label,
2092
+ f.badge && /* @__PURE__ */ e("span", { className: x(
2012
2093
  "inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium",
2013
- f === x.id ? "bg-primary/10 text-primary" : "bg-neutral-100 text-neutral-600 dark:bg-neutral-800 dark:text-neutral-400"
2014
- ), children: x.badge })
2094
+ h === f.id ? "bg-primary/10 text-primary" : "bg-neutral-100 text-neutral-600 dark:bg-neutral-800 dark:text-neutral-400"
2095
+ ), children: f.badge })
2015
2096
  ] })
2016
2097
  },
2017
- x.id
2098
+ f.id
2018
2099
  )) }) });
2019
- }, hr = ({
2100
+ }, gr = ({
2020
2101
  items: r,
2021
2102
  defaultTab: l,
2022
2103
  activeTab: t,
2023
2104
  onTabChange: a,
2024
2105
  variant: o = "default",
2025
2106
  size: i = "md",
2026
- className: f
2107
+ className: h
2027
2108
  }) => {
2028
- const [p, x] = O(
2109
+ const [g, f] = V(
2029
2110
  l || t || r[0]?.id || ""
2030
- ), v = t || p, m = (y) => {
2031
- a ? a(y) : x(y);
2032
- }, s = {
2033
- activeTab: v,
2111
+ ), b = t || g, m = (v) => {
2112
+ a ? a(v) : f(v);
2113
+ }, n = {
2114
+ activeTab: b,
2034
2115
  setActiveTab: m
2035
- }, d = r.find((y) => y.id === v), h = b(
2116
+ }, d = r.find((v) => v.id === b), p = x(
2036
2117
  "flex",
2037
2118
  {
2038
2119
  "border-b border-neutral-200 dark:border-neutral-700 px-2": o === "default" || o === "underline",
@@ -2040,8 +2121,8 @@ const ar = ({
2040
2121
  "space-x-1": o === "pills",
2041
2122
  "space-x-8": o === "default" || o === "underline"
2042
2123
  },
2043
- f
2044
- ), N = (y, S) => {
2124
+ h
2125
+ ), N = (v, S) => {
2045
2126
  const B = "transition-colors duration-200 font-medium", k = {
2046
2127
  "text-xs px-2 py-1": i === "sm",
2047
2128
  "text-sm px-3 py-2": i === "md",
@@ -2054,100 +2135,100 @@ const ar = ({
2054
2135
  // Underline variant
2055
2136
  "border-b-2 pb-2": o === "underline"
2056
2137
  }, K = {
2057
- "opacity-50 cursor-not-allowed": y.disabled,
2058
- "cursor-pointer": !y.disabled
2138
+ "opacity-50 cursor-not-allowed": v.disabled,
2139
+ "cursor-pointer": !v.disabled
2059
2140
  }, H = S ? {
2060
2141
  "border-primary text-primary": o === "default" || o === "underline",
2061
2142
  "bg-white dark:bg-neutral-700 text-neutral-900 dark:text-neutral-100 shadow-sm": o === "pills"
2062
- } : {}, _ = !S && !y.disabled ? {
2143
+ } : {}, F = !S && !v.disabled ? {
2063
2144
  "border-transparent text-neutral-600 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100": o === "default",
2064
2145
  "text-neutral-600 hover:text-neutral-900 dark:text-neutral-400 dark:hover:text-neutral-100": o === "pills",
2065
2146
  "border-transparent text-neutral-600 hover:text-neutral-900 hover:border-neutral-300 dark:text-neutral-400 dark:hover:text-neutral-100": o === "underline"
2066
2147
  } : {};
2067
- return b(B, k, q, K, H, _);
2148
+ return x(B, k, q, K, H, F);
2068
2149
  };
2069
- return /* @__PURE__ */ e(mr.Provider, { value: s, children: /* @__PURE__ */ c("div", { children: [
2070
- /* @__PURE__ */ e("div", { className: h, role: "tablist", children: r.map((y) => /* @__PURE__ */ e(
2150
+ return /* @__PURE__ */ e(xr.Provider, { value: n, children: /* @__PURE__ */ c("div", { children: [
2151
+ /* @__PURE__ */ e("div", { className: p, role: "tablist", children: r.map((v) => /* @__PURE__ */ e(
2071
2152
  "button",
2072
2153
  {
2073
2154
  type: "button",
2074
2155
  role: "tab",
2075
- "aria-selected": v === y.id,
2076
- "aria-controls": `tabpanel-${y.id}`,
2077
- disabled: y.disabled,
2078
- onClick: () => !y.disabled && m(y.id),
2079
- className: N(y, v === y.id),
2156
+ "aria-selected": b === v.id,
2157
+ "aria-controls": `tabpanel-${v.id}`,
2158
+ disabled: v.disabled,
2159
+ onClick: () => !v.disabled && m(v.id),
2160
+ className: N(v, b === v.id),
2080
2161
  children: /* @__PURE__ */ c("span", { className: "flex items-center gap-2", children: [
2081
- y.label,
2082
- y.badge && /* @__PURE__ */ e("span", { className: "inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-neutral-200 text-neutral-700 dark:bg-neutral-700 dark:text-neutral-300", children: y.badge })
2162
+ v.label,
2163
+ v.badge && /* @__PURE__ */ e("span", { className: "inline-flex items-center px-2 py-0.5 rounded-full text-xs font-medium bg-neutral-200 text-neutral-700 dark:bg-neutral-700 dark:text-neutral-300", children: v.badge })
2083
2164
  ] })
2084
2165
  },
2085
- y.id
2166
+ v.id
2086
2167
  )) }),
2087
2168
  d?.content && /* @__PURE__ */ e(
2088
2169
  "div",
2089
2170
  {
2090
2171
  role: "tabpanel",
2091
- id: `tabpanel-${v}`,
2092
- "aria-labelledby": `tab-${v}`,
2172
+ id: `tabpanel-${b}`,
2173
+ "aria-labelledby": `tab-${b}`,
2093
2174
  className: "mt-4",
2094
2175
  children: d.content
2095
2176
  }
2096
2177
  )
2097
2178
  ] }) });
2098
- }, fr = {
2179
+ }, br = {
2099
2180
  sm: "max-w-md",
2100
2181
  md: "max-w-lg",
2101
2182
  lg: "max-w-2xl",
2102
2183
  xl: "max-w-4xl",
2103
2184
  full: "max-w-full mx-4"
2104
2185
  };
2105
- function xr({
2186
+ function yr({
2106
2187
  open: r,
2107
2188
  onClose: l,
2108
2189
  title: t,
2109
2190
  size: a = "md",
2110
2191
  closeOnBackdropClick: o = !0,
2111
2192
  closeOnEscape: i = !0,
2112
- className: f,
2113
- backdropClassName: p,
2114
- children: x,
2115
- footer: v,
2193
+ className: h,
2194
+ backdropClassName: g,
2195
+ children: f,
2196
+ footer: b,
2116
2197
  showCloseButton: m = !0
2117
2198
  }) {
2118
- const s = ee(null), d = ee(null);
2119
- J(() => {
2199
+ const n = Q(null), d = Q(null);
2200
+ G(() => {
2120
2201
  if (!r || !i) return;
2121
- const N = (y) => {
2122
- y.key === "Escape" && l();
2202
+ const N = (v) => {
2203
+ v.key === "Escape" && l();
2123
2204
  };
2124
2205
  return document.addEventListener("keydown", N), () => document.removeEventListener("keydown", N);
2125
- }, [r, i, l]), J(() => (r ? (d.current = document.activeElement, s.current && s.current.focus(), document.body.style.overflow = "hidden") : (d.current && d.current.focus(), document.body.style.overflow = ""), () => {
2206
+ }, [r, i, l]), G(() => (r ? (d.current = document.activeElement, n.current && n.current.focus(), document.body.style.overflow = "hidden") : (d.current && d.current.focus(), document.body.style.overflow = ""), () => {
2126
2207
  document.body.style.overflow = "";
2127
2208
  }), [r]);
2128
- const h = (N) => {
2209
+ const p = (N) => {
2129
2210
  o && N.target === N.currentTarget && l();
2130
2211
  };
2131
2212
  return r ? /* @__PURE__ */ e(
2132
2213
  "div",
2133
2214
  {
2134
- className: b(
2215
+ className: x(
2135
2216
  "fixed inset-0 z-50 flex items-center justify-center p-4",
2136
2217
  "bg-black/20",
2137
2218
  // 'animate-fade-in',
2138
- p
2219
+ g
2139
2220
  ),
2140
- onClick: h,
2221
+ onClick: p,
2141
2222
  children: /* @__PURE__ */ c(
2142
2223
  "div",
2143
2224
  {
2144
- ref: s,
2145
- className: b(
2225
+ ref: n,
2226
+ className: x(
2146
2227
  "relative w-full bg-white dark:bg-secondary-800 rounded-modal shadow-modal rounded-md",
2147
2228
  // 'animate-scale-in',
2148
2229
  "focus:outline-none",
2149
- fr[a],
2150
- f
2230
+ br[a],
2231
+ h
2151
2232
  ),
2152
2233
  role: "dialog",
2153
2234
  "aria-modal": "true",
@@ -2173,8 +2254,8 @@ function xr({
2173
2254
  }
2174
2255
  )
2175
2256
  ] }),
2176
- /* @__PURE__ */ e("div", { className: "p-6", children: x }),
2177
- v && /* @__PURE__ */ e("div", { className: "px-6 py-4", children: v })
2257
+ /* @__PURE__ */ e("div", { className: "p-6", children: f }),
2258
+ b && /* @__PURE__ */ e("div", { className: "px-6 py-4", children: b })
2178
2259
  ]
2179
2260
  }
2180
2261
  )
@@ -2188,15 +2269,15 @@ const Z = ({
2188
2269
  color: a = "current",
2189
2270
  align: o = "left",
2190
2271
  truncate: i = !1,
2191
- italic: f = !1,
2192
- underline: p = !1,
2193
- lineHeight: x = "normal",
2194
- as: v,
2272
+ italic: h = !1,
2273
+ underline: g = !1,
2274
+ lineHeight: f = "normal",
2275
+ as: b,
2195
2276
  className: m,
2196
- children: s,
2277
+ children: n,
2197
2278
  ...d
2198
2279
  }) => {
2199
- const h = v || pr(r), N = b(
2280
+ const p = b || vr(r), N = x(
2200
2281
  // Base styles
2201
2282
  "font-primary",
2202
2283
  // Variant styles
@@ -2244,21 +2325,21 @@ const Z = ({
2244
2325
  },
2245
2326
  // Line height (override variant line heights)
2246
2327
  r === "body" && {
2247
- "leading-tight": x === "tight",
2248
- "leading-normal": x === "normal",
2249
- "leading-relaxed": x === "relaxed"
2328
+ "leading-tight": f === "tight",
2329
+ "leading-normal": f === "normal",
2330
+ "leading-relaxed": f === "relaxed"
2250
2331
  },
2251
2332
  // Text decorations
2252
2333
  {
2253
- italic: f,
2254
- underline: p,
2334
+ italic: h,
2335
+ underline: g,
2255
2336
  truncate: i
2256
2337
  },
2257
2338
  m
2258
2339
  );
2259
- return /* @__PURE__ */ e(h, { className: N, ...d, children: s });
2340
+ return /* @__PURE__ */ e(p, { className: N, ...d, children: n });
2260
2341
  };
2261
- function pr(r) {
2342
+ function vr(r) {
2262
2343
  return {
2263
2344
  body: "p",
2264
2345
  caption: "span",
@@ -2266,56 +2347,56 @@ function pr(r) {
2266
2347
  code: "code"
2267
2348
  }[r] || "p";
2268
2349
  }
2269
- const gr = ({
2350
+ const kr = ({
2270
2351
  value: r,
2271
2352
  onChange: l,
2272
2353
  label: t,
2273
2354
  placeholder: a = "Select or upload a file",
2274
2355
  error: o,
2275
2356
  disabled: i,
2276
- accept: f,
2277
- onListFiles: p,
2278
- onListMounts: x,
2279
- onUploadFile: v,
2357
+ accept: h,
2358
+ onListFiles: g,
2359
+ onListMounts: f,
2360
+ onUploadFile: b,
2280
2361
  onDownloadFile: m,
2281
- onRegisterFile: s
2362
+ onRegisterFile: n
2282
2363
  }) => {
2283
- const [d, h] = O(!1), [N, y] = O([]), [S, B] = O(null), [k, q] = O("/"), [K, H] = O([]), [_, E] = O(!1), [G, z] = O(""), [g, A] = O(
2364
+ const [d, p] = V(!1), [N, v] = V([]), [S, B] = V(null), [k, q] = V("/"), [K, H] = V([]), [F, M] = V(!1), [J, z] = V(""), [y, T] = V(
2284
2365
  typeof r == "object" ? r : null
2285
- ), [u, $] = O(!1), [L, D] = O(""), P = ee(null);
2286
- J(() => {
2287
- d && M();
2288
- }, [d]), J(() => {
2366
+ ), [u, $] = V(!1), [L, D] = V(""), P = Q(null);
2367
+ G(() => {
2368
+ d && E();
2369
+ }, [d]), G(() => {
2289
2370
  d && S && re();
2290
- }, [d, S, k, G]);
2291
- const M = async () => {
2292
- E(!0);
2371
+ }, [d, S, k, J]);
2372
+ const E = async () => {
2373
+ M(!0);
2293
2374
  try {
2294
- const n = await x?.();
2295
- n?.data && y(n.data);
2296
- } catch (n) {
2297
- console.error("Failed to load mounts", n);
2375
+ const s = await f?.();
2376
+ s?.data && v(s.data);
2377
+ } catch (s) {
2378
+ console.error("Failed to load mounts", s);
2298
2379
  } finally {
2299
- E(!1);
2380
+ M(!1);
2300
2381
  }
2301
2382
  }, re = async () => {
2302
2383
  if (S) {
2303
- E(!0);
2384
+ M(!0);
2304
2385
  try {
2305
- const n = await p?.({ mountId: S.id, name: G, path: k });
2306
- n?.data && H(n.data);
2307
- } catch (n) {
2308
- console.error("Failed to load files", n);
2386
+ const s = await g?.({ mountId: S.id, name: J, path: k });
2387
+ s?.data && H(s.data);
2388
+ } catch (s) {
2389
+ console.error("Failed to load files", s);
2309
2390
  } finally {
2310
- E(!1);
2391
+ M(!1);
2311
2392
  }
2312
2393
  }
2313
- }, ae = async (n) => {
2314
- const w = n.target.files?.[0];
2394
+ }, ne = async (s) => {
2395
+ const w = s.target.files?.[0];
2315
2396
  if (w) {
2316
- E(!0);
2397
+ M(!0);
2317
2398
  try {
2318
- const V = await w.arrayBuffer(), R = new Uint8Array(V), j = {
2399
+ const _ = await w.arrayBuffer(), R = new Uint8Array(_), j = {
2319
2400
  id: `local-${Date.now()}`,
2320
2401
  name: w.name,
2321
2402
  type: "file",
@@ -2326,20 +2407,20 @@ const gr = ({
2326
2407
  providerKey: w.name,
2327
2408
  ownerId: "me"
2328
2409
  };
2329
- A(j), l(j, R), h(!1);
2330
- } catch (V) {
2331
- console.error("Local file selection failed", V);
2410
+ T(j), l(j, R), p(!1);
2411
+ } catch (_) {
2412
+ console.error("Local file selection failed", _);
2332
2413
  } finally {
2333
- E(!1);
2414
+ M(!1);
2334
2415
  }
2335
2416
  }
2336
- }, W = async (n) => {
2337
- const w = n.target.files?.[0];
2417
+ }, W = async (s) => {
2418
+ const w = s.target.files?.[0];
2338
2419
  if (!(!w || !S)) {
2339
- E(!0);
2420
+ M(!0);
2340
2421
  try {
2341
- const V = await w.arrayBuffer(), R = await v?.({
2342
- file: new Uint8Array(V),
2422
+ const _ = await w.arrayBuffer(), R = await b?.({
2423
+ file: new Uint8Array(_),
2343
2424
  filename: w.name,
2344
2425
  mimeType: w.type || "application/octet-stream",
2345
2426
  mountId: S.id,
@@ -2347,118 +2428,118 @@ const gr = ({
2347
2428
  });
2348
2429
  if (R?.data) {
2349
2430
  const j = R.data;
2350
- A(j), l(j, new Uint8Array(V)), h(!1);
2431
+ T(j), l(j, new Uint8Array(_)), p(!1);
2351
2432
  }
2352
- } catch (V) {
2353
- console.error("Upload failed", V);
2433
+ } catch (_) {
2434
+ console.error("Upload failed", _);
2354
2435
  } finally {
2355
- E(!1);
2436
+ M(!1);
2356
2437
  }
2357
2438
  }
2358
2439
  }, C = async () => {
2359
2440
  if (!(!L || !S)) {
2360
- E(!0);
2441
+ M(!0);
2361
2442
  try {
2362
- const n = `${k}${L}/`;
2363
- s && (await s({
2443
+ const s = `${k}${L}/`;
2444
+ n && (await n({
2364
2445
  name: L,
2365
2446
  type: "folder",
2366
2447
  path: k,
2367
2448
  mimeType: "application/x-directory",
2368
2449
  size: 0,
2369
2450
  mountId: S.id,
2370
- providerKey: n,
2451
+ providerKey: s,
2371
2452
  ownerId: "me"
2372
2453
  }), await re()), $(!1), D("");
2373
- } catch (n) {
2374
- console.error("Failed to create folder", n);
2454
+ } catch (s) {
2455
+ console.error("Failed to create folder", s);
2375
2456
  } finally {
2376
- E(!1);
2457
+ M(!1);
2377
2458
  }
2378
2459
  }
2379
- }, I = async (n) => {
2380
- E(!0);
2460
+ }, I = async (s) => {
2461
+ M(!0);
2381
2462
  try {
2382
- const w = await m?.(n.id);
2383
- A(n), l(n, w), h(!1);
2463
+ const w = await m?.(s.id);
2464
+ T(s), l(s, w), p(!1);
2384
2465
  } catch (w) {
2385
2466
  console.error("Failed to download file", w);
2386
2467
  } finally {
2387
- E(!1);
2468
+ M(!1);
2388
2469
  }
2389
- }, F = (n) => {
2390
- n.stopPropagation(), A(null), l(null);
2391
- }, T = ie(() => {
2392
- const n = /* @__PURE__ */ new Set(), w = [];
2393
- return K.forEach((V) => {
2394
- if (V.type === "folder") {
2395
- V.path === k && n.add(V.name);
2470
+ }, O = (s) => {
2471
+ s.stopPropagation(), T(null), l(null);
2472
+ }, A = ie(() => {
2473
+ const s = /* @__PURE__ */ new Set(), w = [];
2474
+ return K.forEach((_) => {
2475
+ if (_.type === "folder") {
2476
+ _.path === k && s.add(_.name);
2396
2477
  return;
2397
2478
  }
2398
- const R = V.providerKey || V.name, Y = (k ? R.substring(k.length) : R).split("/").filter((fe) => fe !== "");
2399
- Y.length > 1 ? n.add(Y[0]) : Y.length === 1 && w.push(V);
2479
+ const R = _.providerKey || _.name, Y = (k ? R.substring(k.length) : R).split("/").filter((fe) => fe !== "");
2480
+ Y.length > 1 ? s.add(Y[0]) : Y.length === 1 && w.push(_);
2400
2481
  }), {
2401
- folders: Array.from(n).sort(),
2402
- files: w.sort((V, R) => V.name.localeCompare(R.name))
2482
+ folders: Array.from(s).sort(),
2483
+ files: w.sort((_, R) => _.name.localeCompare(R.name))
2403
2484
  };
2404
- }, [K, k]), X = (n) => {
2405
- q((w) => `${w}${n}/`);
2485
+ }, [K, k]), X = (s) => {
2486
+ q((w) => `${w}${s}/`);
2406
2487
  }, te = () => {
2407
- const n = k.split("/").filter((w) => w !== "");
2408
- n.pop(), n.length === 0 ? q("/") : q(`${n.join("/")}/`);
2488
+ const s = k.split("/").filter((w) => w !== "");
2489
+ s.pop(), s.length === 0 ? q("/") : q(`${s.join("/")}/`);
2409
2490
  }, U = ie(() => {
2410
- const n = T.folders.map((w) => ({
2491
+ const s = A.folders.map((w) => ({
2411
2492
  id: `folder-${w}`,
2412
2493
  name: w,
2413
2494
  type: "folder"
2414
2495
  }));
2415
- return T.files.forEach((w) => {
2416
- n.push({
2496
+ return A.files.forEach((w) => {
2497
+ s.push({
2417
2498
  ...w,
2418
2499
  type: "file"
2419
2500
  });
2420
- }), n;
2421
- }, [T]), le = [
2501
+ }), s;
2502
+ }, [A]), le = [
2422
2503
  {
2423
2504
  id: "name",
2424
2505
  header: "Name",
2425
2506
  accessor: "name",
2426
- cell: (n, w) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
2507
+ cell: (s, w) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2", children: [
2427
2508
  /* @__PURE__ */ e(
2428
2509
  oe,
2429
2510
  {
2430
- icon: w.type === "folder" ? we : xe,
2511
+ icon: w.type === "folder" ? we : pe,
2431
2512
  size: "sm",
2432
2513
  color: w.type === "folder" ? "warning" : "secondary"
2433
2514
  }
2434
2515
  ),
2435
- /* @__PURE__ */ e("span", { className: b(w.type === "folder" && "font-medium"), children: n })
2516
+ /* @__PURE__ */ e("span", { className: x(w.type === "folder" && "font-medium"), children: s })
2436
2517
  ] })
2437
2518
  },
2438
2519
  {
2439
2520
  id: "type",
2440
2521
  header: "Type",
2441
- accessor: (n) => n.type === "folder" ? "Folder" : n.mimeType
2522
+ accessor: (s) => s.type === "folder" ? "Folder" : s.mimeType
2442
2523
  },
2443
2524
  {
2444
2525
  id: "size",
2445
2526
  header: "Size",
2446
- accessor: (n) => n.type === "file" ? `${(n.size / 1024).toFixed(1)} KB` : "-"
2527
+ accessor: (s) => s.type === "file" ? `${(s.size / 1024).toFixed(1)} KB` : "-"
2447
2528
  },
2448
2529
  {
2449
2530
  id: "actions",
2450
2531
  header: "",
2451
2532
  accessor: "id",
2452
2533
  align: "right",
2453
- cell: (n, w) => /* @__PURE__ */ e(
2454
- Q,
2534
+ cell: (s, w) => /* @__PURE__ */ e(
2535
+ ee,
2455
2536
  {
2456
2537
  size: "sm",
2457
2538
  variant: "outline",
2458
- onClick: (V) => {
2459
- V.stopPropagation(), w.type === "folder" ? X(w.name) : I(w);
2539
+ onClick: (_) => {
2540
+ _.stopPropagation(), w.type === "folder" ? X(w.name) : I(w);
2460
2541
  },
2461
- loading: _ && w.type === "file" && g?.id === w.id,
2542
+ loading: F && w.type === "file" && y?.id === w.id,
2462
2543
  children: w.type === "folder" ? "Open" : "Select"
2463
2544
  }
2464
2545
  )
@@ -2468,9 +2549,9 @@ const gr = ({
2468
2549
  id: "name",
2469
2550
  header: "Mount Name",
2470
2551
  accessor: "name",
2471
- cell: (n) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2 font-medium", children: [
2552
+ cell: (s) => /* @__PURE__ */ c("div", { className: "flex items-center gap-2 font-medium", children: [
2472
2553
  /* @__PURE__ */ e(oe, { icon: Ne, size: "sm", color: "primary" }),
2473
- /* @__PURE__ */ e("span", { children: n })
2554
+ /* @__PURE__ */ e("span", { children: s })
2474
2555
  ] })
2475
2556
  },
2476
2557
  {
@@ -2478,7 +2559,7 @@ const gr = ({
2478
2559
  header: "",
2479
2560
  accessor: "id",
2480
2561
  align: "right",
2481
- cell: (n, w) => /* @__PURE__ */ e(Q, { size: "sm", variant: "outline", onClick: () => B(w), children: "Open" })
2562
+ cell: (s, w) => /* @__PURE__ */ e(ee, { size: "sm", variant: "outline", onClick: () => B(w), children: "Open" })
2482
2563
  }
2483
2564
  ];
2484
2565
  return /* @__PURE__ */ c("div", { className: "space-y-1", children: [
@@ -2486,22 +2567,22 @@ const gr = ({
2486
2567
  /* @__PURE__ */ c(
2487
2568
  "div",
2488
2569
  {
2489
- onClick: () => !i && h(!0),
2490
- className: b(
2570
+ onClick: () => !i && p(!0),
2571
+ className: x(
2491
2572
  "flex items-center gap-3 px-3 py-2 border rounded-lg cursor-pointer transition-colors",
2492
2573
  "hover:border-primary-400 bg-white dark:bg-secondary-800",
2493
2574
  o ? "border-error" : "border-neutral-200 dark:border-neutral-700",
2494
2575
  i && "opacity-50 cursor-not-allowed bg-neutral-50"
2495
2576
  ),
2496
2577
  children: [
2497
- /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(oe, { icon: g ? xe : Ne, color: g ? "primary" : "secondary" }) }),
2498
- /* @__PURE__ */ e("div", { className: "flex-grow truncate", children: g ? /* @__PURE__ */ e("span", { className: "text-sm text-neutral-900 dark:text-neutral-100 font-medium", children: g.name }) : /* @__PURE__ */ e("span", { className: "text-sm text-neutral-500", children: a }) }),
2499
- g && !i && /* @__PURE__ */ e(
2578
+ /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: /* @__PURE__ */ e(oe, { icon: y ? pe : Ne, color: y ? "primary" : "secondary" }) }),
2579
+ /* @__PURE__ */ e("div", { className: "flex-grow truncate", children: y ? /* @__PURE__ */ e("span", { className: "text-sm text-neutral-900 dark:text-neutral-100 font-medium", children: y.name }) : /* @__PURE__ */ e("span", { className: "text-sm text-neutral-500", children: a }) }),
2580
+ y && !i && /* @__PURE__ */ e(
2500
2581
  "button",
2501
2582
  {
2502
- onClick: F,
2583
+ onClick: O,
2503
2584
  className: "p-1 hover:bg-neutral-100 dark:hover:bg-neutral-700 rounded",
2504
- children: /* @__PURE__ */ e(oe, { icon: Ie, size: "xs" })
2585
+ children: /* @__PURE__ */ e(oe, { icon: Be, size: "xs" })
2505
2586
  }
2506
2587
  )
2507
2588
  ]
@@ -2509,26 +2590,26 @@ const gr = ({
2509
2590
  ),
2510
2591
  o && /* @__PURE__ */ e(Z, { variant: "body", size: "xs", className: "text-error", children: o }),
2511
2592
  /* @__PURE__ */ e(
2512
- xr,
2593
+ yr,
2513
2594
  {
2514
2595
  open: d,
2515
2596
  onClose: () => {
2516
- h(!1), B(null), q("/"), $(!1);
2597
+ p(!1), B(null), q("/"), $(!1);
2517
2598
  },
2518
2599
  title: S ? `Explorer: ${S.name}` : "Select Storage Mount",
2519
2600
  size: "lg",
2520
2601
  children: /* @__PURE__ */ e(
2521
- hr,
2602
+ gr,
2522
2603
  {
2523
2604
  variant: "pills",
2524
2605
  items: [
2525
2606
  {
2526
2607
  id: "remote",
2527
2608
  label: "Platform Storage",
2528
- content: /* @__PURE__ */ e("div", { className: "space-y-4", children: S ? /* @__PURE__ */ c(Le, { children: [
2609
+ content: /* @__PURE__ */ e("div", { className: "space-y-4", children: S ? /* @__PURE__ */ c(Ee, { children: [
2529
2610
  /* @__PURE__ */ c("div", { className: "flex flex-wrap items-center gap-2", children: [
2530
2611
  /* @__PURE__ */ e(
2531
- Q,
2612
+ ee,
2532
2613
  {
2533
2614
  variant: "ghost",
2534
2615
  size: "sm",
@@ -2544,32 +2625,32 @@ const gr = ({
2544
2625
  ue,
2545
2626
  {
2546
2627
  placeholder: "Search...",
2547
- value: G,
2548
- onChange: (n) => z(n.target.value),
2549
- startIcon: /* @__PURE__ */ e(je, { size: 14 }),
2628
+ value: J,
2629
+ onChange: (s) => z(s.target.value),
2630
+ startIcon: /* @__PURE__ */ e(Pe, { size: 14 }),
2550
2631
  fullWidth: !0,
2551
2632
  size: "sm"
2552
2633
  }
2553
2634
  ) }),
2554
2635
  /* @__PURE__ */ c("div", { className: "flex items-center gap-1", children: [
2555
2636
  /* @__PURE__ */ e(
2556
- Q,
2637
+ ee,
2557
2638
  {
2558
2639
  variant: "outline",
2559
2640
  size: "sm",
2560
2641
  onClick: () => $(!0),
2561
- leftIcon: /* @__PURE__ */ e(oe, { icon: Be, size: "xs" }),
2642
+ leftIcon: /* @__PURE__ */ e(oe, { icon: _e, size: "xs" }),
2562
2643
  children: "New Folder"
2563
2644
  }
2564
2645
  ),
2565
2646
  /* @__PURE__ */ e(
2566
- Q,
2647
+ ee,
2567
2648
  {
2568
2649
  variant: "primary",
2569
2650
  size: "sm",
2570
2651
  onClick: () => P.current?.click(),
2571
- leftIcon: /* @__PURE__ */ e(oe, { icon: Pe, size: "xs" }),
2572
- loading: _,
2652
+ leftIcon: /* @__PURE__ */ e(oe, { icon: Oe, size: "xs" }),
2653
+ loading: F,
2573
2654
  children: "Upload"
2574
2655
  }
2575
2656
  ),
@@ -2580,7 +2661,7 @@ const gr = ({
2580
2661
  className: "hidden",
2581
2662
  ref: P,
2582
2663
  onChange: W,
2583
- accept: f
2664
+ accept: h
2584
2665
  }
2585
2666
  )
2586
2667
  ] })
@@ -2593,31 +2674,31 @@ const gr = ({
2593
2674
  size: "sm",
2594
2675
  placeholder: "Folder name",
2595
2676
  value: L,
2596
- onChange: (n) => D(n.target.value),
2677
+ onChange: (s) => D(s.target.value),
2597
2678
  autoFocus: !0
2598
2679
  }
2599
2680
  ),
2600
- /* @__PURE__ */ e(Q, { size: "sm", onClick: C, loading: _, children: "Create" }),
2601
- /* @__PURE__ */ e(Q, { size: "sm", variant: "ghost", onClick: () => $(!1), children: "Cancel" })
2681
+ /* @__PURE__ */ e(ee, { size: "sm", onClick: C, loading: F, children: "Create" }),
2682
+ /* @__PURE__ */ e(ee, { size: "sm", variant: "ghost", onClick: () => $(!1), children: "Cancel" })
2602
2683
  ] }),
2603
2684
  /* @__PURE__ */ e("div", { className: "max-h-[400px] overflow-auto rounded-lg border border-neutral-200 dark:border-neutral-700", children: /* @__PURE__ */ e(
2604
- Ce,
2685
+ Se,
2605
2686
  {
2606
2687
  data: U,
2607
2688
  columns: le,
2608
- loading: _,
2689
+ loading: F,
2609
2690
  emptyContent: "This folder is empty",
2610
- onRowClick: (n) => n.type === "folder" ? X(n.name) : I(n)
2691
+ onRowClick: (s) => s.type === "folder" ? X(s.name) : I(s)
2611
2692
  }
2612
2693
  ) })
2613
2694
  ] }) : /* @__PURE__ */ e("div", { className: "max-h-[400px] overflow-auto rounded-lg border border-neutral-200 dark:border-neutral-700", children: /* @__PURE__ */ e(
2614
- Ce,
2695
+ Se,
2615
2696
  {
2616
2697
  data: N,
2617
2698
  columns: he,
2618
- loading: _,
2699
+ loading: F,
2619
2700
  emptyContent: "No storage mounts configured",
2620
- onRowClick: (n) => B(n)
2701
+ onRowClick: (s) => B(s)
2621
2702
  }
2622
2703
  ) }) })
2623
2704
  },
@@ -2625,7 +2706,7 @@ const gr = ({
2625
2706
  id: "local",
2626
2707
  label: "Local File",
2627
2708
  content: /* @__PURE__ */ e("div", { className: "space-y-6", children: /* @__PURE__ */ c("div", { className: "flex flex-col items-center justify-center py-12 border-2 border-dashed border-neutral-200 dark:border-neutral-700 rounded-xl bg-neutral-50 dark:bg-secondary-900/50", children: [
2628
- /* @__PURE__ */ e("div", { className: "p-4 bg-primary/10 rounded-full mb-4", children: /* @__PURE__ */ e(oe, { icon: xe, size: "xl", color: "primary" }) }),
2709
+ /* @__PURE__ */ e("div", { className: "p-4 bg-primary/10 rounded-full mb-4", children: /* @__PURE__ */ e(oe, { icon: pe, size: "xl", color: "primary" }) }),
2629
2710
  /* @__PURE__ */ e(Z, { variant: "label", size: "lg", weight: "semibold", children: "Select a file from your computer" }),
2630
2711
  /* @__PURE__ */ c(Z, { variant: "body", size: "sm", className: "text-neutral-500 mt-1 mb-6 text-center max-w-xs", children: [
2631
2712
  "This file will be used directly in the form and will ",
@@ -2633,11 +2714,11 @@ const gr = ({
2633
2714
  " be uploaded to platform storage."
2634
2715
  ] }),
2635
2716
  /* @__PURE__ */ c("label", { className: "cursor-pointer", children: [
2636
- /* @__PURE__ */ c("div", { className: b(
2717
+ /* @__PURE__ */ c("div", { className: x(
2637
2718
  "inline-flex items-center justify-center font-medium rounded-lg transition-colors duration-200 px-6 py-3 text-base bg-primary text-white hover:bg-primary-600",
2638
- _ && "opacity-50 cursor-wait"
2719
+ F && "opacity-50 cursor-wait"
2639
2720
  ), children: [
2640
- _ && /* @__PURE__ */ c("svg", { className: "animate-spin h-4 w-4 mr-2", fill: "none", viewBox: "0 0 24 24", children: [
2721
+ F && /* @__PURE__ */ c("svg", { className: "animate-spin h-4 w-4 mr-2", fill: "none", viewBox: "0 0 24 24", children: [
2641
2722
  /* @__PURE__ */ e("circle", { className: "opacity-25", cx: "12", cy: "12", r: "10", stroke: "currentColor", strokeWidth: "4" }),
2642
2723
  /* @__PURE__ */ e("path", { className: "opacity-75", fill: "currentColor", d: "M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z" })
2643
2724
  ] }),
@@ -2648,9 +2729,9 @@ const gr = ({
2648
2729
  {
2649
2730
  type: "file",
2650
2731
  className: "hidden",
2651
- onChange: ae,
2652
- accept: f,
2653
- disabled: _
2732
+ onChange: ne,
2733
+ accept: h,
2734
+ disabled: F
2654
2735
  }
2655
2736
  )
2656
2737
  ] })
@@ -2663,54 +2744,54 @@ const gr = ({
2663
2744
  )
2664
2745
  ] });
2665
2746
  };
2666
- function Se(r, l) {
2747
+ function Le(r, l) {
2667
2748
  return l.split(".").reduce(
2668
2749
  (t, a) => t && typeof t == "object" && a in t ? t[a] : void 0,
2669
2750
  r
2670
2751
  );
2671
2752
  }
2672
- function br(r, l, t) {
2753
+ function Nr(r, l, t) {
2673
2754
  const a = l.split("."), o = Array.isArray(r) ? [...r] : { ...r };
2674
2755
  let i = o;
2675
- for (let f = 0; f < a.length - 1; f++) {
2676
- const p = a[f], x = i[p];
2677
- i[p] = x && typeof x == "object" ? Array.isArray(x) ? [...x] : { ...x } : {}, i = i[p];
2756
+ for (let h = 0; h < a.length - 1; h++) {
2757
+ const g = a[h], f = i[g];
2758
+ i[g] = f && typeof f == "object" ? Array.isArray(f) ? [...f] : { ...f } : {}, i = i[g];
2678
2759
  }
2679
2760
  return i[a[a.length - 1]] = t, o;
2680
2761
  }
2681
- function yr(r, l) {
2762
+ function wr(r, l) {
2682
2763
  const t = l.split("."), a = Array.isArray(r) ? [...r] : { ...r };
2683
2764
  let o = a;
2684
2765
  for (let i = 0; i < t.length - 1; i++) {
2685
- const f = t[i];
2686
- if (!o[f] || typeof o[f] != "object") return a;
2687
- o[f] = Array.isArray(o[f]) ? [...o[f]] : { ...o[f] }, o = o[f];
2766
+ const h = t[i];
2767
+ if (!o[h] || typeof o[h] != "object") return a;
2768
+ o[h] = Array.isArray(o[h]) ? [...o[h]] : { ...o[h] }, o = o[h];
2688
2769
  }
2689
2770
  return delete o[t[t.length - 1]], a;
2690
2771
  }
2691
- const qr = ({
2772
+ const Gr = ({
2692
2773
  groups: r,
2693
2774
  data: l,
2694
2775
  onSubmit: t,
2695
2776
  onCancel: a,
2696
2777
  onChange: o,
2697
2778
  transform: i,
2698
- validate: f,
2699
- submitButton: p = { label: "Submit", variant: "primary" },
2700
- cancelButton: x = { label: "Cancel", variant: "outline" },
2701
- showButtons: v = !0,
2779
+ validate: h,
2780
+ submitButton: g = { label: "Submit", variant: "primary" },
2781
+ cancelButton: f = { label: "Cancel", variant: "outline" },
2782
+ showButtons: b = !0,
2702
2783
  layout: m = "vertical",
2703
- size: s = "md",
2784
+ size: n = "md",
2704
2785
  loading: d = !1,
2705
- className: h,
2786
+ className: p,
2706
2787
  ref: N,
2707
- sdk: y
2788
+ sdk: v
2708
2789
  }) => {
2709
- const [S, B] = O(l || {}), [k, q] = O({}), [K, H] = O({});
2710
- J(() => {
2790
+ const [S, B] = V(l || {}), [k, q] = V({}), [K, H] = V({});
2791
+ G(() => {
2711
2792
  l && B({ ...l });
2712
2793
  }, [l]);
2713
- const _ = ne(
2794
+ const F = ae(
2714
2795
  (u, $, L) => {
2715
2796
  const D = r.flatMap((P) => P.items).find((P) => P.name === u);
2716
2797
  if (!D) return null;
@@ -2723,57 +2804,57 @@ const qr = ({
2723
2804
  return `${D.label} must be an array.`;
2724
2805
  if (Array.isArray($) && D.arrayFields) {
2725
2806
  const P = [];
2726
- let M = !1;
2727
- if ($.forEach((re, ae) => {
2807
+ let E = !1;
2808
+ if ($.forEach((re, ne) => {
2728
2809
  const W = {};
2729
2810
  for (const C of D.arrayFields) {
2730
2811
  const I = re?.[C.name];
2731
2812
  if (C.required && (I == null || I === ""))
2732
- W[C.name] = `${C.label} is required`, M = !0;
2813
+ W[C.name] = `${C.label} is required`, E = !0;
2733
2814
  else if (C.validator) {
2734
- const F = C.validator(I, re);
2735
- F && (W[C.name] = F, M = !0);
2815
+ const O = C.validator(I, re);
2816
+ O && (W[C.name] = O, E = !0);
2736
2817
  }
2737
2818
  }
2738
- P[ae] = W;
2739
- }), M)
2819
+ P[ne] = W;
2820
+ }), E)
2740
2821
  return JSON.stringify(P);
2741
2822
  }
2742
2823
  }
2743
2824
  return D.validator ? D.validator($, L) : null;
2744
2825
  },
2745
2826
  [r]
2746
- ), E = ne(
2827
+ ), M = ae(
2747
2828
  (u, $) => {
2748
- let L = br(
2829
+ let L = Nr(
2749
2830
  S,
2750
2831
  u,
2751
2832
  $
2752
2833
  );
2753
- r.flatMap((M) => M.items).find((M) => M.name === u)?.removeIfEmpty && ($ == null || $ === "") && (L = yr(L, u)), B(L), H((M) => ({ ...M, [u]: !0 }));
2754
- const P = _(u, $, L);
2755
- q((M) => ({
2756
- ...M,
2834
+ r.flatMap((E) => E.items).find((E) => E.name === u)?.removeIfEmpty && ($ == null || $ === "") && (L = wr(L, u)), B(L), H((E) => ({ ...E, [u]: !0 }));
2835
+ const P = F(u, $, L);
2836
+ q((E) => ({
2837
+ ...E,
2757
2838
  [u]: P || ""
2758
2839
  })), o?.(L, u);
2759
2840
  },
2760
- [S, r, _, o]
2761
- ), G = ne(
2841
+ [S, r, F, o]
2842
+ ), J = ae(
2762
2843
  async (u) => {
2763
2844
  if (console.log("handleSubmit"), u.preventDefault(), d) return;
2764
2845
  const $ = {}, L = r.flatMap((P) => P.items);
2765
2846
  for (const P of L) {
2766
2847
  if (P.hidden || P.conditional && !P.conditional(S))
2767
2848
  continue;
2768
- const M = _(
2849
+ const E = F(
2769
2850
  P.name,
2770
- Se(S, P.name),
2851
+ Le(S, P.name),
2771
2852
  S
2772
2853
  );
2773
- M && ($[P.name] = M);
2854
+ E && ($[P.name] = E);
2774
2855
  }
2775
- if (f) {
2776
- const P = f(S);
2856
+ if (h) {
2857
+ const P = h(S);
2777
2858
  P && Object.assign($, P);
2778
2859
  }
2779
2860
  if (q($), console.log("newErrors", $), Object.keys($).some((P) => $[P]))
@@ -2781,10 +2862,10 @@ const qr = ({
2781
2862
  const D = i ? i(S) : S;
2782
2863
  await t?.(S, D);
2783
2864
  },
2784
- [S, r, _, f, i, t, d]
2785
- ), z = ne(
2865
+ [S, r, F, h, i, t, d]
2866
+ ), z = ae(
2786
2867
  (u) => {
2787
- const $ = Se(S, u.name), L = K[u.name] ? k[u.name] : void 0, D = u.disabled || d, P = {
2868
+ const $ = Le(S, u.name), L = K[u.name] ? k[u.name] : void 0, D = u.disabled || d, P = {
2788
2869
  value: $ || "",
2789
2870
  disabled: D,
2790
2871
  required: u.required,
@@ -2802,11 +2883,11 @@ const qr = ({
2802
2883
  ue,
2803
2884
  {
2804
2885
  ...P,
2805
- onChange: (M) => E(u.name, M.target.value),
2886
+ onChange: (E) => M(u.name, E.target.value),
2806
2887
  type: u.textType || u.type,
2807
2888
  autoComplete: u.autocomplete,
2808
2889
  error: L,
2809
- size: s
2890
+ size: n
2810
2891
  }
2811
2892
  );
2812
2893
  case "textarea":
@@ -2814,10 +2895,10 @@ const qr = ({
2814
2895
  ke,
2815
2896
  {
2816
2897
  ...P,
2817
- onChange: (M) => E(u.name, M.target.value),
2898
+ onChange: (E) => M(u.name, E.target.value),
2818
2899
  rows: 4,
2819
2900
  error: L,
2820
- size: s
2901
+ size: n
2821
2902
  }
2822
2903
  );
2823
2904
  case "select":
@@ -2825,16 +2906,16 @@ const qr = ({
2825
2906
  ve,
2826
2907
  {
2827
2908
  ...P,
2828
- onChange: (M) => E(u.name, M),
2829
- options: (u.options || []).map((M) => ({
2830
- ...M,
2831
- value: String(M.value)
2909
+ onChange: (E) => M(u.name, E),
2910
+ options: (u.options || []).map((E) => ({
2911
+ ...E,
2912
+ value: String(E.value)
2832
2913
  })),
2833
2914
  searchable: u.searchable,
2834
2915
  multiple: u.multiple,
2835
2916
  allowCreate: u.allowCreate,
2836
2917
  error: L,
2837
- size: s
2918
+ size: n
2838
2919
  }
2839
2920
  );
2840
2921
  case "checkbox":
@@ -2843,117 +2924,117 @@ const qr = ({
2843
2924
  {
2844
2925
  ...P,
2845
2926
  checked: !!$,
2846
- onChange: (M) => E(u.name, M.target.checked),
2847
- size: s
2927
+ onChange: (E) => M(u.name, E.target.checked),
2928
+ size: n
2848
2929
  }
2849
2930
  );
2850
2931
  case "radio":
2851
- return /* @__PURE__ */ e("div", { className: "space-y-1", children: u.options?.map((M) => /* @__PURE__ */ c("label", { className: "flex items-center gap-2", children: [
2932
+ return /* @__PURE__ */ e("div", { className: "space-y-1", children: u.options?.map((E) => /* @__PURE__ */ c("label", { className: "flex items-center gap-2", children: [
2852
2933
  /* @__PURE__ */ e(
2853
2934
  "input",
2854
2935
  {
2855
2936
  type: "radio",
2856
2937
  name: u.name,
2857
- value: M.value,
2858
- checked: $ === M.value,
2859
- onChange: () => E(u.name, M.value),
2860
- disabled: D || M.disabled,
2938
+ value: E.value,
2939
+ checked: $ === E.value,
2940
+ onChange: () => M(u.name, E.value),
2941
+ disabled: D || E.disabled,
2861
2942
  className: "rounded-full border-neutral-100 dark:border-neutral-600"
2862
2943
  }
2863
2944
  ),
2864
- /* @__PURE__ */ e(Z, { variant: "label", size: "sm", children: M.label })
2865
- ] }, M.value)) });
2945
+ /* @__PURE__ */ e(Z, { variant: "label", size: "sm", children: E.label })
2946
+ ] }, E.value)) });
2866
2947
  case "date":
2867
2948
  return /* @__PURE__ */ e(
2868
2949
  ye,
2869
2950
  {
2870
2951
  ...P,
2871
2952
  value: $ ? new Date($) : null,
2872
- onChange: (M) => E(u.name, M),
2873
- size: s
2953
+ onChange: (E) => M(u.name, E),
2954
+ size: n
2874
2955
  }
2875
2956
  );
2876
2957
  case "file":
2877
2958
  return /* @__PURE__ */ e(
2878
- gr,
2959
+ kr,
2879
2960
  {
2880
2961
  ...P,
2881
2962
  value: $,
2882
- onChange: (M) => E(u.name, M),
2963
+ onChange: (E) => M(u.name, E),
2883
2964
  error: L,
2884
- onListFiles: (M) => y?.http.invoke({
2965
+ onListFiles: (E) => v?.http.invoke({
2885
2966
  method: "POST",
2886
2967
  action: "storage.file.list",
2887
- body: M
2968
+ body: E
2888
2969
  }),
2889
- onListMounts: () => y?.http.invoke({
2970
+ onListMounts: () => v?.http.invoke({
2890
2971
  method: "GET",
2891
2972
  action: "storage.mount"
2892
2973
  }),
2893
- onUploadFile: (M) => y?.http.invoke({
2974
+ onUploadFile: (E) => v?.http.invoke({
2894
2975
  method: "POST",
2895
2976
  action: "storage.file.upload",
2896
- body: M
2977
+ body: E
2897
2978
  }),
2898
- onDownloadFile: (M) => y?.http.invoke({
2979
+ onDownloadFile: (E) => v?.http.invoke({
2899
2980
  method: "GET",
2900
- action: `storage.file.${M}.download`
2981
+ action: `storage.file.${E}.download`
2901
2982
  }),
2902
- onRegisterFile: (M) => y?.http.invoke({
2983
+ onRegisterFile: (E) => v?.http.invoke({
2903
2984
  method: "POST",
2904
2985
  action: "storage.file.folder",
2905
- body: M
2986
+ body: E
2906
2987
  })
2907
2988
  }
2908
2989
  );
2909
2990
  case "custom":
2910
2991
  return u.customComponent?.({
2911
2992
  value: $,
2912
- onChange: (M) => E(u.name, M),
2993
+ onChange: (E) => M(u.name, E),
2913
2994
  error: L,
2914
2995
  disabled: D
2915
2996
  });
2916
2997
  case "array": {
2917
- const M = $ || [];
2998
+ const E = $ || [];
2918
2999
  let re = [];
2919
3000
  if (typeof L == "string" && L.startsWith("["))
2920
3001
  try {
2921
3002
  re = JSON.parse(L);
2922
3003
  } catch {
2923
3004
  }
2924
- const ae = () => {
2925
- E(u.name, [...M, {}]);
3005
+ const ne = () => {
3006
+ M(u.name, [...E, {}]);
2926
3007
  }, W = (I) => {
2927
- E(
3008
+ M(
2928
3009
  u.name,
2929
- M.filter((F, T) => T !== I)
3010
+ E.filter((O, A) => A !== I)
2930
3011
  );
2931
- }, C = (I, F, T) => {
2932
- const X = [...M];
3012
+ }, C = (I, O, A) => {
3013
+ const X = [...E];
2933
3014
  X[I] = {
2934
3015
  ...X[I],
2935
- [F]: T
2936
- }, E(u.name, X);
3016
+ [O]: A
3017
+ }, M(u.name, X);
2937
3018
  };
2938
3019
  return /* @__PURE__ */ c("div", { className: "space-y-2", children: [
2939
- M.map((I, F) => /* @__PURE__ */ c(
3020
+ E.map((I, O) => /* @__PURE__ */ c(
2940
3021
  "div",
2941
3022
  {
2942
3023
  className: "p-4 border rounded-md dark:border-neutral-700 space-y-2 relative",
2943
3024
  children: [
2944
3025
  /* @__PURE__ */ e("div", { className: "absolute top-2 right-2", children: /* @__PURE__ */ e(
2945
- Q,
3026
+ ee,
2946
3027
  {
2947
3028
  type: "button",
2948
3029
  variant: "ghost",
2949
3030
  size: "sm",
2950
- onClick: () => W(F),
3031
+ onClick: () => W(O),
2951
3032
  disabled: D,
2952
3033
  children: "Remove"
2953
3034
  }
2954
3035
  ) }),
2955
- /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: u.arrayFields?.map((T) => {
2956
- const X = re?.[F]?.[T.name];
3036
+ /* @__PURE__ */ e("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: u.arrayFields?.map((A) => {
3037
+ const X = re?.[O]?.[A.name];
2957
3038
  return /* @__PURE__ */ c(
2958
3039
  "div",
2959
3040
  {
@@ -2966,20 +3047,20 @@ const qr = ({
2966
3047
  size: "sm",
2967
3048
  className: "font-semibold text-neutral-700 dark:text-neutral-300",
2968
3049
  children: [
2969
- T.label,
2970
- T.required && /* @__PURE__ */ e("span", { className: "text-red-500 ml-1", children: "*" })
3050
+ A.label,
3051
+ A.required && /* @__PURE__ */ e("span", { className: "text-red-500 ml-1", children: "*" })
2971
3052
  ]
2972
3053
  }
2973
3054
  ) }),
2974
3055
  (() => {
2975
3056
  const te = {
2976
- value: I?.[T.name] || "",
3057
+ value: I?.[A.name] || "",
2977
3058
  disabled: D,
2978
- required: T.required,
2979
- placeholder: T.placeholder,
2980
- ...T.fieldProps
3059
+ required: A.required,
3060
+ placeholder: A.placeholder,
3061
+ ...A.fieldProps
2981
3062
  };
2982
- switch (T.type) {
3063
+ switch (A.type) {
2983
3064
  case "text":
2984
3065
  case "email":
2985
3066
  case "password":
@@ -2991,14 +3072,14 @@ const qr = ({
2991
3072
  {
2992
3073
  ...te,
2993
3074
  onChange: (U) => C(
2994
- F,
2995
- T.name,
3075
+ O,
3076
+ A.name,
2996
3077
  U.target.value
2997
3078
  ),
2998
- type: T.textType || T.type,
2999
- autoComplete: T.autocomplete,
3079
+ type: A.textType || A.type,
3080
+ autoComplete: A.autocomplete,
3000
3081
  error: X,
3001
- size: s
3082
+ size: n
3002
3083
  }
3003
3084
  );
3004
3085
  case "textarea":
@@ -3007,13 +3088,13 @@ const qr = ({
3007
3088
  {
3008
3089
  ...te,
3009
3090
  onChange: (U) => C(
3010
- F,
3011
- T.name,
3091
+ O,
3092
+ A.name,
3012
3093
  U.target.value
3013
3094
  ),
3014
3095
  rows: 4,
3015
3096
  error: X,
3016
- size: s
3097
+ size: n
3017
3098
  }
3018
3099
  );
3019
3100
  case "select":
@@ -3022,21 +3103,21 @@ const qr = ({
3022
3103
  {
3023
3104
  ...te,
3024
3105
  onChange: (U) => C(
3025
- F,
3026
- T.name,
3106
+ O,
3107
+ A.name,
3027
3108
  U
3028
3109
  ),
3029
- options: (T.options || []).map(
3110
+ options: (A.options || []).map(
3030
3111
  (U) => ({
3031
3112
  ...U,
3032
3113
  value: String(U.value)
3033
3114
  })
3034
3115
  ),
3035
- searchable: T.searchable,
3036
- multiple: T.multiple,
3037
- allowCreate: T.allowCreate,
3116
+ searchable: A.searchable,
3117
+ multiple: A.multiple,
3118
+ allowCreate: A.allowCreate,
3038
3119
  error: X,
3039
- size: s
3120
+ size: n
3040
3121
  }
3041
3122
  );
3042
3123
  case "checkbox":
@@ -3044,17 +3125,17 @@ const qr = ({
3044
3125
  be,
3045
3126
  {
3046
3127
  ...te,
3047
- checked: !!I?.[T.name],
3128
+ checked: !!I?.[A.name],
3048
3129
  onChange: (U) => C(
3049
- F,
3050
- T.name,
3130
+ O,
3131
+ A.name,
3051
3132
  U.target.checked
3052
3133
  ),
3053
- size: s
3134
+ size: n
3054
3135
  }
3055
3136
  );
3056
3137
  case "radio":
3057
- return /* @__PURE__ */ e("div", { className: "space-y-1", children: T.options?.map((U) => /* @__PURE__ */ c(
3138
+ return /* @__PURE__ */ e("div", { className: "space-y-1", children: A.options?.map((U) => /* @__PURE__ */ c(
3058
3139
  "label",
3059
3140
  {
3060
3141
  className: "flex items-center gap-2",
@@ -3063,12 +3144,12 @@ const qr = ({
3063
3144
  "input",
3064
3145
  {
3065
3146
  type: "radio",
3066
- name: `${u.name}.${F}.${T.name}`,
3147
+ name: `${u.name}.${O}.${A.name}`,
3067
3148
  value: U.value,
3068
- checked: I?.[T.name] === U.value,
3149
+ checked: I?.[A.name] === U.value,
3069
3150
  onChange: () => C(
3070
- F,
3071
- T.name,
3151
+ O,
3152
+ A.name,
3072
3153
  U.value
3073
3154
  ),
3074
3155
  disabled: D || U.disabled,
@@ -3081,27 +3162,27 @@ const qr = ({
3081
3162
  U.value
3082
3163
  )) });
3083
3164
  case "date": {
3084
- const U = I?.[T.name];
3165
+ const U = I?.[A.name];
3085
3166
  return /* @__PURE__ */ e(
3086
3167
  ye,
3087
3168
  {
3088
3169
  ...te,
3089
3170
  value: U ? new Date(U) : null,
3090
3171
  onChange: (le) => C(
3091
- F,
3092
- T.name,
3172
+ O,
3173
+ A.name,
3093
3174
  le
3094
3175
  ),
3095
- size: s
3176
+ size: n
3096
3177
  }
3097
3178
  );
3098
3179
  }
3099
3180
  case "custom":
3100
- return T.customComponent?.({
3101
- value: I?.[T.name],
3181
+ return A.customComponent?.({
3182
+ value: I?.[A.name],
3102
3183
  onChange: (U) => C(
3103
- F,
3104
- T.name,
3184
+ O,
3185
+ A.name,
3105
3186
  U
3106
3187
  ),
3107
3188
  error: X,
@@ -3112,7 +3193,7 @@ const qr = ({
3112
3193
  return /* @__PURE__ */ c("p", { children: [
3113
3194
  "Unsupported field type in array:",
3114
3195
  " ",
3115
- T.type
3196
+ A.type
3116
3197
  ] });
3117
3198
  }
3118
3199
  })(),
@@ -3127,20 +3208,20 @@ const qr = ({
3127
3208
  )
3128
3209
  ]
3129
3210
  },
3130
- T.name
3211
+ A.name
3131
3212
  );
3132
3213
  }) })
3133
3214
  ]
3134
3215
  },
3135
- F
3216
+ O
3136
3217
  )),
3137
3218
  /* @__PURE__ */ c(
3138
- Q,
3219
+ ee,
3139
3220
  {
3140
3221
  type: "button",
3141
3222
  variant: "outline",
3142
3223
  size: "sm",
3143
- onClick: ae,
3224
+ onClick: ne,
3144
3225
  disabled: D,
3145
3226
  children: [
3146
3227
  "Add ",
@@ -3154,14 +3235,14 @@ const qr = ({
3154
3235
  return null;
3155
3236
  }
3156
3237
  },
3157
- [S, K, k, d, s, E]
3158
- ), g = ne(
3238
+ [S, K, k, d, n, M]
3239
+ ), y = ae(
3159
3240
  (u) => {
3160
3241
  if (u.conditional && !u.conditional(S))
3161
3242
  return null;
3162
3243
  const $ = u.items.filter((D) => !(D.hidden || D.conditional && !D.conditional(S)));
3163
3244
  if ($.length === 0) return null;
3164
- const L = b(
3245
+ const L = x(
3165
3246
  "space-y-2",
3166
3247
  {
3167
3248
  "grid gap-2": u.layout === "grid",
@@ -3204,7 +3285,7 @@ const qr = ({
3204
3285
  /* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: L, children: $.map((D) => (K[D.name] && k[D.name], /* @__PURE__ */ c(
3205
3286
  "div",
3206
3287
  {
3207
- className: b(
3288
+ className: x(
3208
3289
  "space-y-1",
3209
3290
  D.width && typeof D.width == "string" && `w-[${D.width}]`,
3210
3291
  D.width && typeof D.width == "number" && `col-span-${D.width}`
@@ -3233,46 +3314,46 @@ const qr = ({
3233
3314
  );
3234
3315
  },
3235
3316
  [S, K, k, z]
3236
- ), A = b(
3317
+ ), T = x(
3237
3318
  "space-y-6",
3238
3319
  {
3239
- "max-w-md": s === "sm",
3240
- "max-w-2xl": s === "md",
3241
- "max-w-4xl": s === "lg",
3242
- "max-w-full": s === "full"
3320
+ "max-w-md": n === "sm",
3321
+ "max-w-2xl": n === "md",
3322
+ "max-w-4xl": n === "lg",
3323
+ "max-w-full": n === "full"
3243
3324
  },
3244
- h
3325
+ p
3245
3326
  );
3246
- return /* @__PURE__ */ c("form", { ref: N, onSubmit: G, className: A, children: [
3247
- /* @__PURE__ */ e("div", { className: "space-y-8", children: r.map(g) }),
3248
- v && /* @__PURE__ */ c("div", { className: b("flex gap-3 justify-end pt-8"), children: [
3327
+ return /* @__PURE__ */ c("form", { ref: N, onSubmit: J, className: T, children: [
3328
+ /* @__PURE__ */ e("div", { className: "space-y-8", children: r.map(y) }),
3329
+ b && /* @__PURE__ */ c("div", { className: x("flex gap-3 justify-end pt-8"), children: [
3249
3330
  a && /* @__PURE__ */ e(
3250
- Q,
3331
+ ee,
3251
3332
  {
3252
3333
  type: "button",
3253
- variant: x.variant,
3254
- size: x.size || s,
3255
- disabled: x.disabled || d,
3334
+ variant: f.variant,
3335
+ size: f.size || n,
3336
+ disabled: f.disabled || d,
3256
3337
  onClick: a,
3257
- className: x.className,
3258
- children: x.label
3338
+ className: f.className,
3339
+ children: f.label
3259
3340
  }
3260
3341
  ),
3261
3342
  /* @__PURE__ */ e(
3262
- Q,
3343
+ ee,
3263
3344
  {
3264
3345
  type: "submit",
3265
- variant: p.variant,
3266
- size: p.size || s,
3267
- disabled: p.disabled || d,
3346
+ variant: g.variant,
3347
+ size: g.size || n,
3348
+ disabled: g.disabled || d,
3268
3349
  loading: d,
3269
- className: p.className,
3270
- children: p.label
3350
+ className: g.className,
3351
+ children: g.label
3271
3352
  }
3272
3353
  )
3273
3354
  ] })
3274
3355
  ] });
3275
- }, vr = {
3356
+ }, Cr = {
3276
3357
  default: "bg-secondary-100 text-secondary-800 dark:bg-secondary-800 dark:text-secondary-200",
3277
3358
  primary: "bg-primary-100 text-primary-800 dark:bg-primary-900 dark:text-primary-200",
3278
3359
  secondary: "bg-secondary-100 text-secondary-800 dark:bg-secondary-800 dark:text-secondary-200",
@@ -3280,11 +3361,11 @@ const qr = ({
3280
3361
  warning: "bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",
3281
3362
  error: "bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-200",
3282
3363
  info: "bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200"
3283
- }, kr = {
3364
+ }, Sr = {
3284
3365
  sm: "px-2 py-0.5 text-xs",
3285
3366
  md: "px-2.5 py-1 text-sm",
3286
3367
  lg: "px-3 py-1.5 text-base"
3287
- }, Nr = {
3368
+ }, Lr = {
3288
3369
  default: "bg-secondary-400",
3289
3370
  primary: "bg-primary-500",
3290
3371
  secondary: "bg-secondary-400",
@@ -3293,42 +3374,42 @@ const qr = ({
3293
3374
  error: "bg-red-500",
3294
3375
  info: "bg-blue-500"
3295
3376
  };
3296
- function Hr({
3377
+ function Jr({
3297
3378
  variant: r = "default",
3298
3379
  size: l = "md",
3299
3380
  dot: t = !1,
3300
3381
  icon: a,
3301
3382
  dismissible: o = !1,
3302
3383
  onDismiss: i,
3303
- className: f,
3304
- children: p,
3305
- ...x
3384
+ className: h,
3385
+ children: g,
3386
+ ...f
3306
3387
  }) {
3307
3388
  return /* @__PURE__ */ c(
3308
3389
  "span",
3309
3390
  {
3310
- className: b(
3391
+ className: x(
3311
3392
  // Base styles
3312
3393
  "inline-flex items-center font-medium rounded-full",
3313
3394
  // Variant styles
3314
- vr[r],
3395
+ Cr[r],
3315
3396
  // Size styles
3316
- kr[l],
3317
- f
3397
+ Sr[l],
3398
+ h
3318
3399
  ),
3319
- ...x,
3400
+ ...f,
3320
3401
  children: [
3321
3402
  t && /* @__PURE__ */ e(
3322
3403
  "span",
3323
3404
  {
3324
- className: b(
3405
+ className: x(
3325
3406
  "w-2 h-2 rounded-full mr-1.5",
3326
- Nr[r]
3407
+ Lr[r]
3327
3408
  )
3328
3409
  }
3329
3410
  ),
3330
- a && /* @__PURE__ */ e("span", { className: b("flex-shrink-0", p && "mr-1"), children: a }),
3331
- p,
3411
+ a && /* @__PURE__ */ e("span", { className: x("flex-shrink-0", g && "mr-1"), children: a }),
3412
+ g,
3332
3413
  o && i && /* @__PURE__ */ e(
3333
3414
  "button",
3334
3415
  {
@@ -3349,25 +3430,25 @@ function Hr({
3349
3430
  }
3350
3431
  );
3351
3432
  }
3352
- const wr = {
3433
+ const Er = {
3353
3434
  xs: "h-3 w-3",
3354
3435
  sm: "h-4 w-4",
3355
3436
  md: "h-6 w-6",
3356
3437
  lg: "h-8 w-8",
3357
3438
  xl: "h-12 w-12"
3358
- }, Cr = {
3439
+ }, Mr = {
3359
3440
  primary: "text-primary",
3360
3441
  secondary: "text-secondary-600",
3361
3442
  white: "text-white",
3362
3443
  current: "text-current"
3363
- }, Sr = {
3444
+ }, $r = {
3364
3445
  xs: "text-xs",
3365
3446
  sm: "text-sm",
3366
3447
  md: "text-sm",
3367
3448
  lg: "text-base",
3368
3449
  xl: "text-lg"
3369
3450
  };
3370
- function Ur({
3451
+ function Yr({
3371
3452
  size: r = "md",
3372
3453
  variant: l = "primary",
3373
3454
  label: t = "Loading...",
@@ -3378,7 +3459,7 @@ function Ur({
3378
3459
  return /* @__PURE__ */ c(
3379
3460
  "div",
3380
3461
  {
3381
- className: b(
3462
+ className: x(
3382
3463
  "inline-flex items-center",
3383
3464
  a ? "flex-col space-y-2" : "",
3384
3465
  o
@@ -3388,10 +3469,10 @@ function Ur({
3388
3469
  /* @__PURE__ */ c(
3389
3470
  "svg",
3390
3471
  {
3391
- className: b(
3472
+ className: x(
3392
3473
  "animate-spin",
3393
- wr[r],
3394
- Cr[l]
3474
+ Er[r],
3475
+ Mr[l]
3395
3476
  ),
3396
3477
  fill: "none",
3397
3478
  viewBox: "0 0 24 24",
@@ -3423,9 +3504,9 @@ function Ur({
3423
3504
  a && /* @__PURE__ */ e(
3424
3505
  "span",
3425
3506
  {
3426
- className: b(
3507
+ className: x(
3427
3508
  "text-secondary-600 dark:text-secondary-400",
3428
- Sr[r]
3509
+ $r[r]
3429
3510
  ),
3430
3511
  children: t
3431
3512
  }
@@ -3435,31 +3516,31 @@ function Ur({
3435
3516
  }
3436
3517
  );
3437
3518
  }
3438
- const Kr = ({
3519
+ const Zr = ({
3439
3520
  src: r,
3440
3521
  alt: l,
3441
3522
  size: t = "md",
3442
3523
  aspectRatio: a = "auto",
3443
3524
  radius: o = "md",
3444
3525
  showLoading: i = !0,
3445
- showError: f = !0,
3446
- fallback: p,
3447
- loadingContent: x,
3448
- errorContent: v,
3526
+ showError: h = !0,
3527
+ fallback: g,
3528
+ loadingContent: f,
3529
+ errorContent: b,
3449
3530
  className: m,
3450
- onLoad: s,
3531
+ onLoad: n,
3451
3532
  onError: d,
3452
- ...h
3533
+ ...p
3453
3534
  }) => {
3454
- const [N, y] = O(!0), [S, B] = O(!1), [k, q] = O(r), K = (A) => {
3455
- y(!1), B(!1), s?.(A);
3456
- }, H = (A) => {
3457
- if (y(!1), B(!0), p && k !== p) {
3458
- q(p), B(!1), y(!0);
3535
+ const [N, v] = V(!0), [S, B] = V(!1), [k, q] = V(r), K = (T) => {
3536
+ v(!1), B(!1), n?.(T);
3537
+ }, H = (T) => {
3538
+ if (v(!1), B(!0), g && k !== g) {
3539
+ q(g), B(!1), v(!0);
3459
3540
  return;
3460
3541
  }
3461
- d?.(A);
3462
- }, _ = b(
3542
+ d?.(T);
3543
+ }, F = x(
3463
3544
  "relative overflow-hidden bg-neutral-100 dark:bg-neutral-800",
3464
3545
  // Size variants
3465
3546
  {
@@ -3487,16 +3568,16 @@ const Kr = ({
3487
3568
  "rounded-full": o === "full"
3488
3569
  },
3489
3570
  m
3490
- ), E = b(
3571
+ ), M = x(
3491
3572
  "w-full h-full object-cover transition-opacity duration-200",
3492
3573
  {
3493
3574
  "opacity-0": N || S,
3494
3575
  "opacity-100": !N && !S
3495
3576
  }
3496
- ), G = b(
3577
+ ), J = x(
3497
3578
  "absolute inset-0 flex items-center justify-center",
3498
3579
  "text-neutral-400 dark:text-neutral-500"
3499
- ), z = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-neutral-300 dark:bg-neutral-600 rounded" }) }), g = /* @__PURE__ */ c("div", { className: "text-center", children: [
3580
+ ), z = /* @__PURE__ */ e("div", { className: "animate-pulse", children: /* @__PURE__ */ e("div", { className: "w-6 h-6 bg-neutral-300 dark:bg-neutral-600 rounded" }) }), y = /* @__PURE__ */ c("div", { className: "text-center", children: [
3500
3581
  /* @__PURE__ */ e(
3501
3582
  "svg",
3502
3583
  {
@@ -3517,64 +3598,64 @@ const Kr = ({
3517
3598
  ),
3518
3599
  /* @__PURE__ */ e("span", { className: "text-xs", children: "Failed to load" })
3519
3600
  ] });
3520
- return /* @__PURE__ */ c("div", { className: _, children: [
3601
+ return /* @__PURE__ */ c("div", { className: F, children: [
3521
3602
  /* @__PURE__ */ e(
3522
3603
  "img",
3523
3604
  {
3524
- ...h,
3605
+ ...p,
3525
3606
  src: k,
3526
3607
  alt: l,
3527
- className: E,
3608
+ className: M,
3528
3609
  onLoad: K,
3529
3610
  onError: H
3530
3611
  }
3531
3612
  ),
3532
- N && i && /* @__PURE__ */ e("div", { className: G, children: x || z }),
3533
- S && f && /* @__PURE__ */ e("div", { className: G, children: v || g })
3613
+ N && i && /* @__PURE__ */ e("div", { className: J, children: f || z }),
3614
+ S && h && /* @__PURE__ */ e("div", { className: J, children: b || y })
3534
3615
  ] });
3535
- }, Gr = ({
3616
+ }, Xr = ({
3536
3617
  title: r,
3537
3618
  subtitle: l,
3538
3619
  actions: t = [],
3539
3620
  children: a,
3540
3621
  className: o,
3541
3622
  backLabel: i = "Back",
3542
- backClassName: f,
3543
- onBack: p,
3544
- editable: x = !1,
3545
- onTitleChange: v
3623
+ backClassName: h,
3624
+ onBack: g,
3625
+ editable: f = !1,
3626
+ onTitleChange: b
3546
3627
  }) => {
3547
- const [m, s] = O(!1), [d, h] = O(r), N = ee(null);
3548
- J(() => {
3549
- h(r);
3550
- }, [r]), J(() => {
3628
+ const [m, n] = V(!1), [d, p] = V(r), N = Q(null);
3629
+ G(() => {
3630
+ p(r);
3631
+ }, [r]), G(() => {
3551
3632
  m && N.current && (N.current.focus(), N.current.select());
3552
3633
  }, [m]);
3553
- const y = () => {
3554
- x && s(!0);
3634
+ const v = () => {
3635
+ f && n(!0);
3555
3636
  }, S = () => {
3556
- s(!1), d.trim() !== "" && d !== r && v ? v(d.trim()) : h(r);
3637
+ n(!1), d.trim() !== "" && d !== r && b ? b(d.trim()) : p(r);
3557
3638
  }, B = (k) => {
3558
- k.key === "Enter" ? N.current?.blur() : k.key === "Escape" && (h(r), s(!1));
3639
+ k.key === "Enter" ? N.current?.blur() : k.key === "Escape" && (p(r), n(!1));
3559
3640
  };
3560
3641
  return /* @__PURE__ */ c(
3561
3642
  "div",
3562
3643
  {
3563
- className: b(
3644
+ className: x(
3564
3645
  "p-5 pb-3 border-b border-gray-100 dark:border-gray-700",
3565
3646
  o
3566
3647
  ),
3567
3648
  children: [
3568
3649
  /* @__PURE__ */ c("div", { className: "flex flex-col sm:flex-row sm:items-start sm:justify-between items-center gap-4", children: [
3569
3650
  /* @__PURE__ */ e("div", { className: "min-w-0 flex-1", children: /* @__PURE__ */ c("div", { className: "flex items-center gap-2 text-neutral-900 dark:text-neutral-100", children: [
3570
- p && /* @__PURE__ */ e(
3651
+ g && /* @__PURE__ */ e(
3571
3652
  "button",
3572
3653
  {
3573
3654
  type: "button",
3574
- onClick: p,
3575
- className: b(
3655
+ onClick: g,
3656
+ className: x(
3576
3657
  "flex items-center text-sm dark:hover:text-neutral-300 cursor-pointer transition",
3577
- f
3658
+ h
3578
3659
  ),
3579
3660
  children: /* @__PURE__ */ e(Me, { size: 16, color: "currentColor" })
3580
3661
  }
@@ -3585,7 +3666,7 @@ const Kr = ({
3585
3666
  ref: N,
3586
3667
  type: "text",
3587
3668
  value: d,
3588
- onChange: (k) => h(k.target.value),
3669
+ onChange: (k) => p(k.target.value),
3589
3670
  onBlur: S,
3590
3671
  onKeyDown: B,
3591
3672
  className: "text-1xl font-semibold bg-transparent border-b-1 border-gray-200 dark:border-gray-700 rounded-lg outline-none focus:border-none px-1 -mx-1 min-w-0 flex-1"
@@ -3593,50 +3674,63 @@ const Kr = ({
3593
3674
  ) : /* @__PURE__ */ e(
3594
3675
  "h2",
3595
3676
  {
3596
- onClick: y,
3597
- className: b(
3677
+ onClick: v,
3678
+ className: x(
3598
3679
  "text-2xl font-semibold truncate",
3599
- x && "cursor-pointer hover:text-blue-600 dark:hover:text-blue-400 transition-colors"
3680
+ f && "cursor-pointer hover:text-blue-600 dark:hover:text-blue-400 transition-colors"
3600
3681
  ),
3601
- title: x ? "Klik om te bewerken" : void 0,
3682
+ title: f ? "Klik om te bewerken" : void 0,
3602
3683
  children: r
3603
3684
  }
3604
3685
  )
3605
3686
  ] }) }),
3606
- t.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap sm:flex-nowrap gap-2 sm:gap-3", children: t.map((k) => /* @__PURE__ */ c(
3607
- "button",
3608
- {
3609
- type: "button",
3610
- onClick: (q) => {
3611
- q.stopPropagation(), q.target.blur(), k.onClick();
3687
+ t.length > 0 && /* @__PURE__ */ e("div", { className: "flex flex-wrap sm:flex-nowrap gap-2 sm:gap-3", children: t.map(
3688
+ (k) => k.splitOptions && k.splitOptions.length > 0 ? /* @__PURE__ */ e(
3689
+ Ue,
3690
+ {
3691
+ label: k.label,
3692
+ onClick: k.onClick,
3693
+ icon: k.icon,
3694
+ variant: k.variant === "primary" ? "primary" : "secondary",
3695
+ options: k.splitOptions,
3696
+ disabled: k.disabled
3612
3697
  },
3613
- disabled: k.disabled,
3614
- className: b("btn", {
3615
- o__primary: k.variant === "primary",
3616
- o__secondary: k.variant === "secondary" || k.variant === "outline",
3617
- o__ghost: k.variant === "ghost",
3618
- o__destructive: k.variant === "destructive"
3619
- }),
3620
- children: [
3621
- k.icon && /* @__PURE__ */ e("span", { className: "mr-2", children: k.icon }),
3622
- k.label
3623
- ]
3624
- },
3625
- k.id
3626
- )) })
3698
+ k.id
3699
+ ) : /* @__PURE__ */ c(
3700
+ "button",
3701
+ {
3702
+ type: "button",
3703
+ onClick: (q) => {
3704
+ q.stopPropagation(), q.target.blur(), k.onClick();
3705
+ },
3706
+ disabled: k.disabled,
3707
+ className: x("btn", {
3708
+ o__primary: k.variant === "primary",
3709
+ o__secondary: k.variant === "secondary" || k.variant === "outline",
3710
+ o__ghost: k.variant === "ghost",
3711
+ o__destructive: k.variant === "destructive"
3712
+ }),
3713
+ children: [
3714
+ k.icon && /* @__PURE__ */ e("span", { className: "mr-2", children: k.icon }),
3715
+ k.label
3716
+ ]
3717
+ },
3718
+ k.id
3719
+ )
3720
+ ) })
3627
3721
  ] }),
3628
3722
  a && /* @__PURE__ */ e("div", { className: "mt-4", children: a })
3629
3723
  ]
3630
3724
  }
3631
3725
  );
3632
3726
  };
3633
- function Lr(r, l) {
3727
+ function zr(r, l) {
3634
3728
  return l.split(".").reduce(
3635
3729
  (t, a) => t && typeof t == "object" && a in t ? t[a] : void 0,
3636
3730
  r
3637
3731
  );
3638
3732
  }
3639
- const Jr = ({
3733
+ const Qr = ({
3640
3734
  groups: r,
3641
3735
  data: l,
3642
3736
  size: t = "md",
@@ -3653,16 +3747,16 @@ const Jr = ({
3653
3747
  } catch {
3654
3748
  return String(m);
3655
3749
  }
3656
- }, i = (m) => m ? "Ja" : "Nee", f = (m, s) => {
3657
- if (!s) return String(m || "-");
3658
- const d = s.find((h) => h.value === m);
3750
+ }, i = (m) => m ? "Ja" : "Nee", h = (m, n) => {
3751
+ if (!n) return String(m || "-");
3752
+ const d = n.find((p) => p.value === m);
3659
3753
  return d ? d.label : String(m || "-");
3660
- }, p = ne(
3754
+ }, g = ae(
3661
3755
  (m) => {
3662
- const s = Lr(l, m.name);
3756
+ const n = zr(l, m.name);
3663
3757
  if (m.type === "array") {
3664
- const h = s;
3665
- return !h || h.length === 0 ? /* @__PURE__ */ e(
3758
+ const p = n;
3759
+ return !p || p.length === 0 ? /* @__PURE__ */ e(
3666
3760
  Z,
3667
3761
  {
3668
3762
  variant: "body",
@@ -3670,7 +3764,7 @@ const Jr = ({
3670
3764
  className: "text-neutral-500 dark:text-neutral-400",
3671
3765
  children: "Geen items"
3672
3766
  }
3673
- ) : /* @__PURE__ */ e("div", { className: "space-y-3", children: h.map((N, y) => /* @__PURE__ */ c(
3767
+ ) : /* @__PURE__ */ e("div", { className: "space-y-3", children: p.map((N, v) => /* @__PURE__ */ c(
3674
3768
  "div",
3675
3769
  {
3676
3770
  className: "p-4 border border-neutral-200 dark:border-neutral-700 rounded-lg space-y-3",
@@ -3685,7 +3779,7 @@ const Jr = ({
3685
3779
  children: [
3686
3780
  m.label,
3687
3781
  " ",
3688
- y + 1
3782
+ v + 1
3689
3783
  ]
3690
3784
  }
3691
3785
  ) }),
@@ -3703,7 +3797,7 @@ const Jr = ({
3703
3797
  break;
3704
3798
  case "select":
3705
3799
  case "radio":
3706
- k = f(
3800
+ k = h(
3707
3801
  B,
3708
3802
  S.options
3709
3803
  );
@@ -3745,20 +3839,20 @@ const Jr = ({
3745
3839
  }) })
3746
3840
  ]
3747
3841
  },
3748
- y
3842
+ v
3749
3843
  )) });
3750
3844
  }
3751
3845
  if (m.type === "custom" && m.customComponent)
3752
- return m.customComponent({ value: s });
3846
+ return m.customComponent({ value: n });
3753
3847
  if (m.format) {
3754
- const h = m.format(s, l);
3848
+ const p = m.format(n, l);
3755
3849
  return /* @__PURE__ */ e(
3756
3850
  Z,
3757
3851
  {
3758
3852
  variant: "body",
3759
3853
  size: "sm",
3760
3854
  className: "text-neutral-900 dark:text-neutral-100",
3761
- children: h
3855
+ children: p
3762
3856
  }
3763
3857
  );
3764
3858
  }
@@ -3770,23 +3864,23 @@ const Jr = ({
3770
3864
  case "number":
3771
3865
  case "tel":
3772
3866
  case "url":
3773
- d = s ? String(s) : "-";
3867
+ d = n ? String(n) : "-";
3774
3868
  break;
3775
3869
  case "textarea":
3776
- d = s ? /* @__PURE__ */ e("div", { className: "whitespace-pre-wrap", children: String(s || "-") }) : "-";
3870
+ d = n ? /* @__PURE__ */ e("div", { className: "whitespace-pre-wrap", children: String(n || "-") }) : "-";
3777
3871
  break;
3778
3872
  case "select":
3779
3873
  case "radio":
3780
- d = f(s, m.options);
3874
+ d = h(n, m.options);
3781
3875
  break;
3782
3876
  case "checkbox":
3783
- d = i(s);
3877
+ d = i(n);
3784
3878
  break;
3785
3879
  case "date":
3786
- d = o(s);
3880
+ d = o(n);
3787
3881
  break;
3788
3882
  default:
3789
- d = s ? String(s) : "-";
3883
+ d = n ? String(n) : "-";
3790
3884
  }
3791
3885
  return /* @__PURE__ */ e(
3792
3886
  Z,
@@ -3799,13 +3893,13 @@ const Jr = ({
3799
3893
  );
3800
3894
  },
3801
3895
  [l]
3802
- ), x = ne(
3896
+ ), f = ae(
3803
3897
  (m) => {
3804
3898
  if (m.conditional && !m.conditional(l))
3805
3899
  return null;
3806
- const s = m.items.filter((h) => !(h.hidden || h.conditional && !h.conditional(l)));
3807
- if (s.length === 0) return null;
3808
- const d = b(
3900
+ const n = m.items.filter((p) => !(p.hidden || p.conditional && !p.conditional(l)));
3901
+ if (n.length === 0) return null;
3902
+ const d = x(
3809
3903
  "space-y-4",
3810
3904
  {
3811
3905
  "grid gap-4": m.layout === "grid",
@@ -3845,36 +3939,36 @@ const Jr = ({
3845
3939
  }
3846
3940
  )
3847
3941
  ] }),
3848
- /* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: d, children: s.map((h) => /* @__PURE__ */ c(
3942
+ /* @__PURE__ */ e("div", { className: "md:col-span-2", children: /* @__PURE__ */ e("div", { className: d, children: n.map((p) => /* @__PURE__ */ c(
3849
3943
  "div",
3850
3944
  {
3851
- className: b(
3945
+ className: x(
3852
3946
  "space-y-1",
3853
- h.width && typeof h.width == "string" && `w-[${h.width}]`,
3854
- h.width && typeof h.width == "number" && `col-span-${h.width}`
3947
+ p.width && typeof p.width == "string" && `w-[${p.width}]`,
3948
+ p.width && typeof p.width == "number" && `col-span-${p.width}`
3855
3949
  ),
3856
3950
  children: [
3857
- h.type !== "custom" && /* @__PURE__ */ e(
3951
+ p.type !== "custom" && /* @__PURE__ */ e(
3858
3952
  Z,
3859
3953
  {
3860
3954
  variant: "label",
3861
3955
  size: "sm",
3862
3956
  className: "font-medium text-neutral-700 dark:text-neutral-300",
3863
- children: h.label
3957
+ children: p.label
3864
3958
  }
3865
3959
  ),
3866
- p(h)
3960
+ g(p)
3867
3961
  ]
3868
3962
  },
3869
- h.name
3963
+ p.name
3870
3964
  )) }) })
3871
3965
  ]
3872
3966
  },
3873
3967
  m.id
3874
3968
  );
3875
3969
  },
3876
- [l, p]
3877
- ), v = b(
3970
+ [l, g]
3971
+ ), b = x(
3878
3972
  "space-y-6",
3879
3973
  {
3880
3974
  "max-w-md": t === "sm",
@@ -3884,25 +3978,25 @@ const Jr = ({
3884
3978
  },
3885
3979
  a
3886
3980
  );
3887
- return /* @__PURE__ */ e("div", { className: v, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: r.map(x) }) });
3888
- }, $e = ({ item: r, isSelectedHandler: l, onClick: t }) => {
3889
- const [a, o] = O(!1), i = r.children && r.children.length > 0, f = () => {
3981
+ return /* @__PURE__ */ e("div", { className: b, children: /* @__PURE__ */ e("div", { className: "space-y-8", children: r.map(f) }) });
3982
+ }, ze = ({ item: r, isSelectedHandler: l, onClick: t }) => {
3983
+ const [a, o] = V(!1), i = r.children && r.children.length > 0, h = () => {
3890
3984
  i && o(!a);
3891
- }, p = l ? l(r.path) : !1;
3985
+ }, g = l ? l(r.path) : !1;
3892
3986
  return /* @__PURE__ */ c("li", { children: [
3893
3987
  /* @__PURE__ */ c(
3894
3988
  "div",
3895
3989
  {
3896
- className: b(
3990
+ className: x(
3897
3991
  "flex flex-row w-full py-1 rounded-lg items-center h-8 transition-colors cursor-pointer px-3 pr-1 no-underline text-sm",
3898
3992
  {
3899
- "active-nav-item": p && !i,
3900
- "shadow-lvl-0": p && !i,
3901
- "font-semibold": p || i || r.children !== void 0
3993
+ "active-nav-item": g && !i,
3994
+ "shadow-lvl-0": g && !i,
3995
+ "font-semibold": g || i || r.children !== void 0
3902
3996
  }
3903
3997
  ),
3904
3998
  onClick: () => {
3905
- i ? f() : r.path && t?.(r.path);
3999
+ i ? h() : r.path && t?.(r.path);
3906
4000
  },
3907
4001
  children: [
3908
4002
  r.icon && /* @__PURE__ */ e("span", { className: "mr-2", children: r.icon }),
@@ -3912,17 +4006,17 @@ const Jr = ({
3912
4006
  ]
3913
4007
  }
3914
4008
  ),
3915
- i && !a && /* @__PURE__ */ e("ul", { className: "sidebar-menu-nested-items mb-1", children: r.children?.map((x, v) => /* @__PURE__ */ e(
3916
- $e,
4009
+ i && !a && /* @__PURE__ */ e("ul", { className: "sidebar-menu-nested-items mb-1", children: r.children?.map((f, b) => /* @__PURE__ */ e(
4010
+ ze,
3917
4011
  {
3918
- item: x,
4012
+ item: f,
3919
4013
  isSelectedHandler: l,
3920
4014
  onClick: t
3921
4015
  },
3922
- v
4016
+ b
3923
4017
  )) })
3924
4018
  ] });
3925
- }, Yr = ({
4019
+ }, et = ({
3926
4020
  title: r,
3927
4021
  actionIcons: l,
3928
4022
  items: t,
@@ -3932,43 +4026,43 @@ const Jr = ({
3932
4026
  }) => /* @__PURE__ */ c("div", { className: "flex flex-col h-screen mb-6", children: [
3933
4027
  /* @__PURE__ */ c("div", { className: "sidebar-menu-header", children: [
3934
4028
  /* @__PURE__ */ e("span", { className: "text-xl font-semibold text-gray-800 mb-2", children: r }),
3935
- /* @__PURE__ */ e("div", { className: "sidebar-menu-actions", children: l?.map((f, p) => /* @__PURE__ */ e("span", { className: "sidebar-menu-action-icon", children: f }, p)) })
4029
+ /* @__PURE__ */ e("div", { className: "sidebar-menu-actions", children: l?.map((h, g) => /* @__PURE__ */ e("span", { className: "sidebar-menu-action-icon", children: h }, g)) })
3936
4030
  ] }),
3937
4031
  i && /* @__PURE__ */ e("div", { className: "sidebar-menu-pre-items mb-4", children: i }),
3938
4032
  /* @__PURE__ */ e("ul", { children: t.map(
3939
- (f, p) => !f.path && !f.label && !f.children ? /* @__PURE__ */ e("span", { className: "flex w-full h-4" }, p) : /* @__PURE__ */ e(
3940
- $e,
4033
+ (h, g) => !h.path && !h.label && !h.children ? /* @__PURE__ */ e("span", { className: "flex w-full h-4" }, g) : /* @__PURE__ */ e(
4034
+ ze,
3941
4035
  {
3942
- item: f,
4036
+ item: h,
3943
4037
  isSelectedHandler: a,
3944
4038
  onClick: o
3945
4039
  },
3946
- p
4040
+ g
3947
4041
  )
3948
4042
  ) })
3949
- ] }), Zr = ({
4043
+ ] }), rt = ({
3950
4044
  level: r = 1,
3951
4045
  size: l,
3952
4046
  weight: t = "bold",
3953
4047
  color: a = "current",
3954
4048
  align: o = "left",
3955
4049
  truncate: i = !1,
3956
- className: f,
3957
- children: p,
3958
- ...x
4050
+ className: h,
4051
+ children: g,
4052
+ ...f
3959
4053
  }) => {
3960
- const v = l || Mr(r), m = b(
4054
+ const b = l || Dr(r), m = x(
3961
4055
  "font-primary",
3962
4056
  // Size variants
3963
4057
  {
3964
- "text-xs": v === "xs",
3965
- "text-sm": v === "sm",
3966
- "text-base": v === "md",
3967
- "text-lg": v === "lg",
3968
- "text-xl": v === "xl",
3969
- "text-2xl": v === "2xl",
3970
- "text-3xl": v === "3xl",
3971
- "text-4xl": v === "4xl"
4058
+ "text-xs": b === "xs",
4059
+ "text-sm": b === "sm",
4060
+ "text-base": b === "md",
4061
+ "text-lg": b === "lg",
4062
+ "text-xl": b === "xl",
4063
+ "text-2xl": b === "2xl",
4064
+ "text-3xl": b === "3xl",
4065
+ "text-4xl": b === "4xl"
3972
4066
  },
3973
4067
  // Weight variants
3974
4068
  {
@@ -4000,11 +4094,11 @@ const Jr = ({
4000
4094
  {
4001
4095
  truncate: i
4002
4096
  },
4003
- f
4004
- ), s = `h${r}`;
4005
- return /* @__PURE__ */ e(s, { className: m, ...x, children: p });
4097
+ h
4098
+ ), n = `h${r}`;
4099
+ return /* @__PURE__ */ e(n, { className: m, ...f, children: g });
4006
4100
  };
4007
- function Mr(r) {
4101
+ function Dr(r) {
4008
4102
  return {
4009
4103
  1: "4xl",
4010
4104
  2: "3xl",
@@ -4014,16 +4108,16 @@ function Mr(r) {
4014
4108
  6: "md"
4015
4109
  }[r] || "md";
4016
4110
  }
4017
- const Xr = ({
4111
+ const tt = ({
4018
4112
  items: r,
4019
4113
  type: l = "unordered",
4020
4114
  variant: t = "default",
4021
4115
  size: a = "md",
4022
4116
  interactive: o = !1,
4023
4117
  className: i,
4024
- itemClassName: f
4118
+ itemClassName: h
4025
4119
  }) => {
4026
- const p = b(
4120
+ const g = x(
4027
4121
  // Base styles
4028
4122
  "space-y-1",
4029
4123
  // Variant styles
@@ -4044,7 +4138,7 @@ const Xr = ({
4044
4138
  "text-lg": a === "lg"
4045
4139
  },
4046
4140
  i
4047
- ), x = (s, d) => b(
4141
+ ), f = (n, d) => x(
4048
4142
  // Base item styles
4049
4143
  "transition-colors duration-200",
4050
4144
  // Size-based padding
@@ -4054,55 +4148,55 @@ const Xr = ({
4054
4148
  "py-3 px-4": a === "lg" && (t === "bordered" || t === "divided")
4055
4149
  },
4056
4150
  // Interactive styles
4057
- o && !s.disabled && {
4151
+ o && !n.disabled && {
4058
4152
  "cursor-pointer hover:bg-neutral-50 dark:hover:bg-neutral-800": !0,
4059
4153
  "focus:outline-none focus:bg-neutral-100 dark:focus:bg-neutral-700": !0
4060
4154
  },
4061
4155
  // Disabled styles
4062
- s.disabled && {
4156
+ n.disabled && {
4063
4157
  "opacity-50 cursor-not-allowed": !0
4064
4158
  },
4065
- f
4066
- ), v = (s) => {
4067
- o && !s.disabled && s.onClick && s.onClick();
4068
- }, m = (s, d) => {
4069
- o && !d.disabled && (s.key === "Enter" || s.key === " ") && (s.preventDefault(), d.onClick?.());
4159
+ h
4160
+ ), b = (n) => {
4161
+ o && !n.disabled && n.onClick && n.onClick();
4162
+ }, m = (n, d) => {
4163
+ o && !d.disabled && (n.key === "Enter" || n.key === " ") && (n.preventDefault(), d.onClick?.());
4070
4164
  };
4071
- return l === "ordered" ? /* @__PURE__ */ e("ol", { className: p, children: r.map((s, d) => /* @__PURE__ */ e(
4165
+ return l === "ordered" ? /* @__PURE__ */ e("ol", { className: g, children: r.map((n, d) => /* @__PURE__ */ e(
4072
4166
  "li",
4073
4167
  {
4074
- className: x(s),
4075
- onClick: () => v(s),
4076
- onKeyDown: (h) => m(h, s),
4077
- tabIndex: o && !s.disabled ? 0 : void 0,
4168
+ className: f(n),
4169
+ onClick: () => b(n),
4170
+ onKeyDown: (p) => m(p, n),
4171
+ tabIndex: o && !n.disabled ? 0 : void 0,
4078
4172
  role: o ? "button" : void 0,
4079
- children: s.content
4173
+ children: n.content
4080
4174
  },
4081
- s.id || d
4082
- )) }) : l === "description" ? /* @__PURE__ */ e("dl", { className: p, children: r.map((s, d) => /* @__PURE__ */ e(
4175
+ n.id || d
4176
+ )) }) : l === "description" ? /* @__PURE__ */ e("dl", { className: g, children: r.map((n, d) => /* @__PURE__ */ e(
4083
4177
  "div",
4084
4178
  {
4085
- className: x(s),
4086
- onClick: () => v(s),
4087
- onKeyDown: (h) => m(h, s),
4088
- tabIndex: o && !s.disabled ? 0 : void 0,
4179
+ className: f(n),
4180
+ onClick: () => b(n),
4181
+ onKeyDown: (p) => m(p, n),
4182
+ tabIndex: o && !n.disabled ? 0 : void 0,
4089
4183
  role: o ? "button" : void 0,
4090
- children: s.content
4184
+ children: n.content
4091
4185
  },
4092
- s.id || d
4093
- )) }) : /* @__PURE__ */ e("ul", { className: p, children: r.map((s, d) => /* @__PURE__ */ e(
4186
+ n.id || d
4187
+ )) }) : /* @__PURE__ */ e("ul", { className: g, children: r.map((n, d) => /* @__PURE__ */ e(
4094
4188
  "li",
4095
4189
  {
4096
- className: x(s),
4097
- onClick: () => v(s),
4098
- onKeyDown: (h) => m(h, s),
4099
- tabIndex: o && !s.disabled ? 0 : void 0,
4190
+ className: f(n),
4191
+ onClick: () => b(n),
4192
+ onKeyDown: (p) => m(p, n),
4193
+ tabIndex: o && !n.disabled ? 0 : void 0,
4100
4194
  role: o ? "button" : void 0,
4101
- children: s.content
4195
+ children: n.content
4102
4196
  },
4103
- s.id || d
4197
+ n.id || d
4104
4198
  )) });
4105
- }, Qr = ({
4199
+ }, at = ({
4106
4200
  commands: r,
4107
4201
  isOpen: l,
4108
4202
  onClose: t,
@@ -4110,36 +4204,36 @@ const Xr = ({
4110
4204
  initialCommandPath: o,
4111
4205
  initialActiveIndex: i
4112
4206
  }) => {
4113
- const [f, p] = O(""), [x, v] = O(o || []), [m, s] = O(i || 0), d = ee(null), N = (x.length ? r.find((y) => y.id === x[0])?.subCommands || [] : r).filter(
4114
- (y) => y.label.toLowerCase().includes(f.toLowerCase())
4207
+ const [h, g] = V(""), [f, b] = V(o || []), [m, n] = V(i || 0), d = Q(null), N = (f.length ? r.find((v) => v.id === f[0])?.subCommands || [] : r).filter(
4208
+ (v) => v.label.toLowerCase().includes(h.toLowerCase())
4115
4209
  );
4116
- return J(() => {
4117
- l || (p(""), v(o || []), s(i || 0));
4118
- }, [l]), J(() => {
4119
- const y = (S) => {
4210
+ return G(() => {
4211
+ l || (g(""), b(o || []), n(i || 0));
4212
+ }, [l]), G(() => {
4213
+ const v = (S) => {
4120
4214
  if (l) {
4121
4215
  if (S.key === "Escape")
4122
4216
  t();
4123
4217
  else if (S.key === "ArrowUp")
4124
- s(
4218
+ n(
4125
4219
  (B) => B > 0 ? B - 1 : N.length - 1
4126
4220
  );
4127
4221
  else if (S.key === "ArrowDown")
4128
- s(
4222
+ n(
4129
4223
  (B) => B < N.length - 1 ? B + 1 : 0
4130
4224
  );
4131
4225
  else if (S.key === "Enter") {
4132
4226
  const B = N[m];
4133
- B && (B.subCommands ? (v([...x, B.id]), s(0)) : B.action && (B.action(), t()));
4227
+ B && (B.subCommands ? (b([...f, B.id]), n(0)) : B.action && (B.action(), t()));
4134
4228
  }
4135
4229
  }
4136
4230
  };
4137
- return document.addEventListener("keydown", y), () => document.removeEventListener("keydown", y);
4138
- }, [l, t, N, m, x]), J(() => {
4139
- const y = (S) => {
4231
+ return document.addEventListener("keydown", v), () => document.removeEventListener("keydown", v);
4232
+ }, [l, t, N, m, f]), G(() => {
4233
+ const v = (S) => {
4140
4234
  d.current && !d.current.contains(S.target) && t();
4141
4235
  };
4142
- return l && document.addEventListener("mousedown", y), () => document.removeEventListener("mousedown", y);
4236
+ return l && document.addEventListener("mousedown", v), () => document.removeEventListener("mousedown", v);
4143
4237
  }, [l, t]), l ? /* @__PURE__ */ e("div", { className: "fixed inset-0 z-50 flex items-center justify-center shadow-lvl-0", children: /* @__PURE__ */ c(
4144
4238
  "div",
4145
4239
  {
@@ -4151,28 +4245,28 @@ const Xr = ({
4151
4245
  {
4152
4246
  type: "text",
4153
4247
  placeholder: a?.searchPlaceholder || "Search commands...",
4154
- value: f,
4155
- onChange: (y) => p(y.target.value),
4248
+ value: h,
4249
+ onChange: (v) => g(v.target.value),
4156
4250
  className: "w-full px-4 py-2 text-gray-800 border-none border-b border-gray-200 focus:outline-none focus:ring-0 rounded-lg bg-transparent"
4157
4251
  }
4158
4252
  ),
4159
4253
  /* @__PURE__ */ c("div", { className: "mt-2 pt-2 text-sm border-t border-gray-200", children: [
4160
4254
  N.length === 0 && /* @__PURE__ */ e("div", { className: "text-gray-500 text-center text-sm", children: a?.noCommandsFound || "No commands found" }),
4161
- N.map((y, S) => /* @__PURE__ */ c(
4255
+ N.map((v, S) => /* @__PURE__ */ c(
4162
4256
  "div",
4163
4257
  {
4164
4258
  className: `flex items-center p-2 cursor-pointer rounded-md text-secondary-800 ${S === m ? "bg-gray-100" : ""}`,
4165
4259
  onClick: () => {
4166
- y.subCommands ? (v([...x, y.id]), s(0)) : y.action && (y.action(), t());
4260
+ v.subCommands ? (b([...f, v.id]), n(0)) : v.action && (v.action(), t());
4167
4261
  },
4168
- onMouseEnter: () => s(S),
4262
+ onMouseEnter: () => n(S),
4169
4263
  children: [
4170
- y.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: y.icon }),
4171
- /* @__PURE__ */ e("span", { className: "flex-grow", children: y.label }),
4172
- y.subCommands && /* @__PURE__ */ e("span", { className: "text-gray-400", children: /* @__PURE__ */ e(Fe, { className: "w-4 h-4" }) })
4264
+ v.icon && /* @__PURE__ */ e("span", { className: "mr-3", children: v.icon }),
4265
+ /* @__PURE__ */ e("span", { className: "flex-grow", children: v.label }),
4266
+ v.subCommands && /* @__PURE__ */ e("span", { className: "text-gray-400", children: /* @__PURE__ */ e(Fe, { className: "w-4 h-4" }) })
4173
4267
  ]
4174
4268
  },
4175
- y.id
4269
+ v.id
4176
4270
  ))
4177
4271
  ] }),
4178
4272
  /* @__PURE__ */ c("div", { className: "flex items-center justify-between pt-2 mt-2 text-xs text-gray-500 border-t border-gray-200", children: [
@@ -4195,7 +4289,7 @@ const Xr = ({
4195
4289
  ]
4196
4290
  }
4197
4291
  ) }) : null;
4198
- }, Er = {
4292
+ }, Tr = {
4199
4293
  none: "p-0",
4200
4294
  xs: "p-1",
4201
4295
  sm: "p-2",
@@ -4203,7 +4297,7 @@ const Xr = ({
4203
4297
  lg: "p-6",
4204
4298
  xl: "p-8",
4205
4299
  "2xl": "p-12"
4206
- }, $r = {
4300
+ }, Ar = {
4207
4301
  none: "m-0",
4208
4302
  xs: "m-1",
4209
4303
  sm: "m-2",
@@ -4211,7 +4305,7 @@ const Xr = ({
4211
4305
  lg: "m-6",
4212
4306
  xl: "m-8",
4213
4307
  "2xl": "m-12"
4214
- }, zr = {
4308
+ }, Ir = {
4215
4309
  none: "",
4216
4310
  primary: "bg-primary",
4217
4311
  secondary: "bg-secondary",
@@ -4223,26 +4317,26 @@ const Xr = ({
4223
4317
  neutral: "bg-neutral",
4224
4318
  white: "bg-white",
4225
4319
  module: "bg-module"
4226
- }, Dr = {
4320
+ }, jr = {
4227
4321
  none: "rounded-none",
4228
4322
  sm: "rounded-sm",
4229
4323
  md: "rounded-md",
4230
4324
  lg: "rounded-lg",
4231
4325
  xl: "rounded-xl",
4232
4326
  full: "rounded-full"
4233
- }, Ar = {
4327
+ }, Br = {
4234
4328
  none: "shadow-none",
4235
4329
  sm: "shadow-sm shadow-lvl-0",
4236
4330
  md: "shadow-md shadow-lvl-0",
4237
4331
  lg: "shadow-lg shadow-lvl-0",
4238
4332
  xl: "shadow-xl shadow-lvl-0",
4239
4333
  "2xl": "shadow-2xl shadow-lvl-0"
4240
- }, Tr = {
4334
+ }, Pr = {
4241
4335
  none: "border-0",
4242
4336
  sm: "border",
4243
4337
  md: "border-2",
4244
4338
  lg: "border-4"
4245
- }, Ir = {
4339
+ }, _r = {
4246
4340
  primary: "border-primary",
4247
4341
  secondary: "border-secondary",
4248
4342
  accent: "border-accent",
@@ -4252,7 +4346,7 @@ const Xr = ({
4252
4346
  info: "border-info",
4253
4347
  neutral: "border-neutral",
4254
4348
  white: "border-white"
4255
- }, ze = ce(
4349
+ }, De = ce(
4256
4350
  ({
4257
4351
  padding: r,
4258
4352
  margin: l,
@@ -4260,35 +4354,35 @@ const Xr = ({
4260
4354
  radius: a,
4261
4355
  shadow: o,
4262
4356
  border: i,
4263
- borderColor: f,
4264
- className: p,
4265
- children: x,
4266
- ...v
4357
+ borderColor: h,
4358
+ className: g,
4359
+ children: f,
4360
+ ...b
4267
4361
  }, m) => /* @__PURE__ */ e(
4268
4362
  "div",
4269
4363
  {
4270
4364
  ref: m,
4271
- className: b(
4272
- r && Er[r],
4273
- l && $r[l],
4274
- t && zr[t],
4275
- a && Dr[a],
4276
- o && Ar[o],
4277
- i && Tr[i],
4278
- f && Ir[f],
4279
- p
4365
+ className: x(
4366
+ r && Tr[r],
4367
+ l && Ar[l],
4368
+ t && Ir[t],
4369
+ a && jr[a],
4370
+ o && Br[o],
4371
+ i && Pr[i],
4372
+ h && _r[h],
4373
+ g
4280
4374
  ),
4281
- ...v,
4282
- children: x
4375
+ ...b,
4376
+ children: f
4283
4377
  }
4284
4378
  )
4285
4379
  );
4286
- ze.displayName = "Box";
4287
- const et = ({ children: r, title: l, ...t }) => /* @__PURE__ */ c(ze, { background: "module", radius: "xl", shadow: "sm", ...t, children: [
4380
+ De.displayName = "Box";
4381
+ const nt = ({ children: r, title: l, ...t }) => /* @__PURE__ */ c(De, { background: "module", radius: "xl", shadow: "sm", ...t, children: [
4288
4382
  l && /* @__PURE__ */ e("span", { className: "text-base font-medium text-gray-800 mb-2", children: l }),
4289
4383
  r
4290
4384
  ] });
4291
- function rt({
4385
+ function lt({
4292
4386
  identifier: r,
4293
4387
  resourceLoader: l,
4294
4388
  framework: t = "react",
@@ -4296,47 +4390,47 @@ function rt({
4296
4390
  componentProps: o,
4297
4391
  className: i
4298
4392
  }) {
4299
- const f = ee(null), [p, x] = O(!0), [v, m] = O(null), s = ee(null);
4300
- return ee(null), J(() => {
4393
+ const h = Q(null), [g, f] = V(!0), [b, m] = V(null), n = Q(null);
4394
+ return Q(null), G(() => {
4301
4395
  let d = !0;
4302
4396
  return (async () => {
4303
- x(!0);
4397
+ f(!0);
4304
4398
  try {
4305
4399
  const N = await l();
4306
4400
  if (!d) return;
4307
- const y = N.component || N.default || N;
4308
- m(t === "react" ? () => y : () => N);
4401
+ const v = N.component || N.default || N;
4402
+ m(t === "react" ? () => v : () => N);
4309
4403
  } catch (N) {
4310
4404
  console.error(`[FederatedResource] Load failed: ${r}`, N);
4311
4405
  } finally {
4312
- d && x(!1);
4406
+ d && f(!1);
4313
4407
  }
4314
4408
  })(), () => {
4315
4409
  d = !1;
4316
4410
  };
4317
- }, [r, l]), J(() => {
4318
- if (p || !v || t === "react") return;
4319
- const d = f.current;
4411
+ }, [r, l]), G(() => {
4412
+ if (g || !b || t === "react") return;
4413
+ const d = h.current;
4320
4414
  if (d) {
4321
4415
  if (t === "svelte") {
4322
- const h = v.default || v, N = new h({ target: d, props: o || {} });
4323
- return s.current = N, () => N.$destroy();
4416
+ const p = b.default || b, N = new p({ target: d, props: o || {} });
4417
+ return n.current = N, () => N.$destroy();
4324
4418
  }
4325
- if (v.mount) {
4326
- const h = v.mount({ container: d, props: o || {} });
4419
+ if (b.mount) {
4420
+ const p = b.mount({ container: d, props: o || {} });
4327
4421
  return () => {
4328
- typeof h == "function" ? h() : v.unmount?.(d);
4422
+ typeof p == "function" ? p() : b.unmount?.(d);
4329
4423
  };
4330
4424
  }
4331
4425
  }
4332
- }, [v, t, p]), J(() => {
4333
- t === "svelte" && s.current && s.current.$set?.(o);
4334
- }, [o, t]), /* @__PURE__ */ c("div", { ref: f, className: i, style: { display: "contents" }, children: [
4335
- p && a,
4336
- t === "react" && v && /* @__PURE__ */ e(v, { ...o })
4426
+ }, [b, t, g]), G(() => {
4427
+ t === "svelte" && n.current && n.current.$set?.(o);
4428
+ }, [o, t]), /* @__PURE__ */ c("div", { ref: h, className: i, style: { display: "contents" }, children: [
4429
+ g && a,
4430
+ t === "react" && b && /* @__PURE__ */ e(b, { ...o })
4337
4431
  ] });
4338
4432
  }
4339
- class tt extends Te {
4433
+ class st extends Ie {
4340
4434
  constructor() {
4341
4435
  super(...arguments), this.state = {
4342
4436
  hasError: !1,
@@ -4365,40 +4459,41 @@ class tt extends Te {
4365
4459
  }
4366
4460
  }
4367
4461
  export {
4368
- Hr as Badge,
4369
- ze as Box,
4370
- Q as Button,
4371
- _r as ButtonGroup,
4372
- et as Card,
4462
+ Jr as Badge,
4463
+ De as Box,
4464
+ ee as Button,
4465
+ Hr as ButtonGroup,
4466
+ nt as Card,
4373
4467
  be as Checkbox,
4374
- Qr as CommandPalette,
4375
- tr as ContentLoading,
4468
+ at as CommandPalette,
4469
+ sr as ContentLoading,
4376
4470
  ye as DatePicker,
4377
- ar as Dropdown,
4378
- tt as ErrorBoundary,
4379
- rt as FederatedResource,
4380
- qr as Form,
4381
- Zr as Heading,
4471
+ or as Dropdown,
4472
+ st as ErrorBoundary,
4473
+ lt as FederatedResource,
4474
+ Gr as Form,
4475
+ rt as Heading,
4382
4476
  oe as Icon,
4383
- Kr as Image,
4384
- Wr as Link,
4385
- Xr as List,
4386
- xr as Modal,
4387
- Gr as PageHeader,
4388
- Ze as SearchableTextField,
4477
+ Zr as Image,
4478
+ Ur as Link,
4479
+ tt as List,
4480
+ yr as Modal,
4481
+ Xr as PageHeader,
4482
+ rr as SearchableTextField,
4389
4483
  ve as Select,
4390
- Yr as SidebarMenu,
4391
- Ur as Spinner,
4392
- gr as StorageInput,
4393
- Rr as TabBar,
4394
- Ce as Table,
4395
- hr as Tabs,
4484
+ et as SidebarMenu,
4485
+ Yr as Spinner,
4486
+ Ue as SplitButton,
4487
+ kr as StorageInput,
4488
+ Kr as TabBar,
4489
+ Se as Table,
4490
+ gr as Tabs,
4396
4491
  Z as Text,
4397
4492
  ke as TextArea,
4398
4493
  ue as TextField,
4399
- Jr as View,
4400
- b as cn,
4401
- Or as createSizes,
4402
- Fr as createVariants
4494
+ Qr as View,
4495
+ x as cn,
4496
+ qr as createSizes,
4497
+ Rr as createVariants
4403
4498
  };
4404
4499
  //# sourceMappingURL=index.js.map