@kareemelbalshe/any-table 1.0.1 → 1.0.2

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,5 +1,5 @@
1
- import { jsx as n, jsxs as h, Fragment as Ce } from "react/jsx-runtime";
2
- import Xe, { useMemo as W, useState as S, useEffect as be, useCallback as A, useRef as $t, useImperativeHandle as Dt, createContext as Ft, useContext as Qe } from "react";
1
+ import { jsx as a, jsxs as y, Fragment as Ce } from "react/jsx-runtime";
2
+ import Xe, { useMemo as W, useState as S, useEffect as fe, useCallback as A, useRef as $t, useImperativeHandle as Dt, createContext as Mt, useContext as Qe } from "react";
3
3
  function P(e, t, s = void 0) {
4
4
  if (e == null) return s;
5
5
  if (!t || typeof t != "string") return e;
@@ -15,7 +15,7 @@ function P(e, t, s = void 0) {
15
15
  }
16
16
  return r !== void 0 ? r : s;
17
17
  }
18
- function Mt(e) {
18
+ function _t(e) {
19
19
  return e !== null && typeof e == "object" && !Array.isArray(e);
20
20
  }
21
21
  function ue(e) {
@@ -26,14 +26,14 @@ function ue(e) {
26
26
  return s.length <= 3 && s === s.toUpperCase() ? s : o.charAt(0).toUpperCase() + o.slice(1);
27
27
  }).join(" ");
28
28
  }
29
- const _t = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg", ".bmp", ".avif"], jt = ["image", "avatar", "photo", "logo", "picture", "thumbnail", "banner", "img", "icon"], Wt = ["price", "spend", "cost", "amount", "total", "fee", "rate", "salary", "balance", "deposit", "commission", "charge"], zt = ["status", "state", "phase", "condition"];
30
- function fe(e, t) {
29
+ const jt = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg", ".bmp", ".avif"], Ft = ["image", "avatar", "photo", "logo", "picture", "thumbnail", "banner", "img", "icon"], Wt = ["price", "spend", "cost", "amount", "total", "fee", "rate", "salary", "balance", "deposit", "commission", "charge"], Rt = ["status", "state", "phase", "condition"];
30
+ function be(e, t) {
31
31
  const s = e.toLowerCase();
32
- if (jt.some((r) => s.includes(r)))
32
+ if (Ft.some((r) => s.includes(r)))
33
33
  return "image";
34
34
  if (Wt.some((r) => s.includes(r)))
35
35
  return "currency";
36
- if (zt.some((r) => s.includes(r)))
36
+ if (Rt.some((r) => s.includes(r)))
37
37
  return "status";
38
38
  const o = t.filter((r) => r != null && r !== "");
39
39
  if (o.length === 0)
@@ -51,7 +51,7 @@ function fe(e, t) {
51
51
  const r = l.trim();
52
52
  if (Ie(r))
53
53
  return "image";
54
- if ((Lt(r) || s.includes("date") || s.includes("at") || s.includes("time")) && !isNaN(Date.parse(r)))
54
+ if ((zt(r) || s.includes("date") || s.includes("at") || s.includes("time")) && !isNaN(Date.parse(r)))
55
55
  return r.includes("T") || r.includes(":") ? "datetime" : "date";
56
56
  if (r.includes("@") && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r))
57
57
  return "email";
@@ -66,13 +66,13 @@ function Ie(e) {
66
66
  if (!e || typeof e != "string") return !1;
67
67
  if (e.startsWith("data:image/")) return !0;
68
68
  const t = e.toLowerCase().split("?")[0];
69
- return _t.some((s) => t.endsWith(s));
69
+ return jt.some((s) => t.endsWith(s));
70
70
  }
71
- function Lt(e) {
71
+ function zt(e) {
72
72
  return !e || typeof e != "string" || e.length < 10 ? !1 : /^\d{4}-\d{2}-\d{2}(T\d{2}:\d{2}:\d{2}(\.\d+)?(Z|[+-]\d{2}:\d{2})?)?$/.test(e);
73
73
  }
74
- const Rt = ["__v", "password", "token", "refreshToken", "secret", "hash", "salt"];
75
- function Ot(e, t = Rt, s = 2) {
74
+ const Lt = ["__v", "password", "token", "refreshToken", "secret", "hash", "salt"];
75
+ function Ot(e, t = Lt, s = 2) {
76
76
  if (!e || !e.length)
77
77
  return [];
78
78
  const o = /* @__PURE__ */ new Map(), l = e.slice(0, 10);
@@ -85,12 +85,12 @@ function et(e, t, s, o, l, r, i) {
85
85
  for (const g of Object.keys(e)) {
86
86
  if (l.includes(g)) continue;
87
87
  const c = t ? `${t}.${g}` : g, d = e[g];
88
- if (Mt(d) && !Ht(d) && r < i) {
88
+ if (_t(d) && !Ht(d) && r < i) {
89
89
  et(d, c, s, o, l, r + 1, i);
90
90
  continue;
91
91
  }
92
92
  if (!s.has(c)) {
93
- const a = o.map((m) => P(m, c)), u = fe(c, a);
93
+ const n = o.map((m) => P(m, c)), u = be(c, n);
94
94
  s.set(c, {
95
95
  key: c,
96
96
  title: ue(c),
@@ -108,18 +108,18 @@ function Ht(e, t) {
108
108
  function Ut(e) {
109
109
  const { data: t = [], columns: s, autoColumns: o = !0, thead: l, headerData: r } = e;
110
110
  return r && Array.isArray(r) && r.length > 0 ? r.map((i, g) => {
111
- const c = l && l[g] ? l[g] : ue(i), d = t.map((u) => u?.[i]), a = fe(i, d);
111
+ const c = l && l[g] ? l[g] : ue(i), d = t.map((u) => u?.[i]), n = be(i, d);
112
112
  return {
113
113
  key: i,
114
114
  title: c,
115
- type: a,
115
+ type: n,
116
116
  sortable: !0,
117
117
  searchable: !0,
118
- align: a === "number" || a === "currency" ? "right" : "left"
118
+ align: n === "number" || n === "currency" ? "right" : "left"
119
119
  };
120
120
  }) : s && Array.isArray(s) && s.length > 0 ? s.map((i) => {
121
121
  if (typeof i == "string") {
122
- const a = t.map((m) => m?.[i]), u = fe(i, a);
122
+ const n = t.map((m) => m?.[i]), u = be(i, n);
123
123
  return {
124
124
  key: i,
125
125
  title: ue(i),
@@ -129,7 +129,7 @@ function Ut(e) {
129
129
  align: u === "number" || u === "currency" ? "right" : "left"
130
130
  };
131
131
  }
132
- const g = String(i.key), c = i.title !== void 0 ? i.title : ue(g), d = i.type || fe(g, t.map((a) => a?.[g]));
132
+ const g = String(i.key), c = i.title !== void 0 ? i.title : ue(g), d = i.type || be(g, t.map((n) => n?.[g]));
133
133
  return {
134
134
  ...i,
135
135
  title: c,
@@ -144,25 +144,25 @@ function Kt({
144
144
  config: e,
145
145
  onSearchChange: t
146
146
  }) {
147
- const s = W(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), o = s.enabled !== !1 && !!e, l = s.debounce ?? 350, [r, i] = S(""), [g, c] = S(""), [d, a] = S(!1);
148
- be(() => {
147
+ const s = W(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), o = s.enabled !== !1 && !!e, l = s.debounce ?? 350, [r, i] = S(""), [g, c] = S(""), [d, n] = S(!1);
148
+ fe(() => {
149
149
  if (!o) return;
150
150
  if (r === "") {
151
- c(""), a(!1), t?.("");
151
+ c(""), n(!1), t?.("");
152
152
  return;
153
153
  }
154
- a(!0);
155
- const f = setTimeout(() => {
156
- c(r), a(!1), t?.(r);
154
+ n(!0);
155
+ const b = setTimeout(() => {
156
+ c(r), n(!1), t?.(r);
157
157
  }, l);
158
158
  return () => {
159
- clearTimeout(f);
159
+ clearTimeout(b);
160
160
  };
161
161
  }, [r, l, o, t]);
162
- const u = A((f) => {
163
- i(f);
162
+ const u = A((b) => {
163
+ i(b);
164
164
  }, []), m = A(() => {
165
- i(""), c(""), a(!1), t?.("");
165
+ i(""), c(""), n(!1), t?.("");
166
166
  }, [t]);
167
167
  return {
168
168
  enabled: o,
@@ -193,9 +193,9 @@ function It({
193
193
  }
194
194
  },
195
195
  [o, r, g, l, t]
196
- ), a = A(
197
- (m, f) => {
198
- i(m), c(f), t?.(m, f);
196
+ ), n = A(
197
+ (m, b) => {
198
+ i(m), c(b), t?.(m, b);
199
199
  },
200
200
  [t]
201
201
  ), u = A(() => {
@@ -206,7 +206,7 @@ function It({
206
206
  sortBy: r,
207
207
  sortOrder: g,
208
208
  toggleSort: d,
209
- setSorting: a,
209
+ setSorting: n,
210
210
  resetSorting: u,
211
211
  sortingConfig: s
212
212
  };
@@ -216,57 +216,57 @@ function Gt({
216
216
  totalRecords: t,
217
217
  onPageChange: s
218
218
  }) {
219
- const o = W(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), l = o.enabled !== !1 && !!e, r = o.defaultPage || 1, i = o.defaultPageSize || 10, g = o.pageSizeOptions || [5, 10, 20, 50, 100], [c, d] = S(r), [a, u] = S(i), m = Math.max(1, Math.ceil(t / Math.max(1, a))), f = A(
220
- (v) => {
221
- const w = Math.max(1, Math.min(v, m));
222
- d(w), s?.(w, a);
219
+ const o = W(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), l = o.enabled !== !1 && !!e, r = o.defaultPage || 1, i = o.defaultPageSize || 10, g = o.pageSizeOptions || [5, 10, 20, 50, 100], [c, d] = S(r), [n, u] = S(i), m = Math.max(1, Math.ceil(t / Math.max(1, n))), b = A(
220
+ (N) => {
221
+ const w = Math.max(1, Math.min(N, m));
222
+ d(w), s?.(w, n);
223
223
  },
224
- [m, a, s]
225
- ), b = A(
226
- (v) => {
227
- u(v), d(1), s?.(1, v);
224
+ [m, n, s]
225
+ ), f = A(
226
+ (N) => {
227
+ u(N), d(1), s?.(1, N);
228
228
  },
229
229
  [s]
230
230
  ), k = A(() => {
231
- c < m && f(c + 1);
232
- }, [c, m, f]), C = A(() => {
233
- c > 1 && f(c - 1);
234
- }, [c, f]), $ = A(() => {
231
+ c < m && b(c + 1);
232
+ }, [c, m, b]), C = A(() => {
233
+ c > 1 && b(c - 1);
234
+ }, [c, b]), D = A(() => {
235
235
  d(1), u(i), s?.(1, i);
236
- }, [i, s]), F = A(
237
- (v = 5) => {
236
+ }, [i, s]), _ = A(
237
+ (N = 5) => {
238
238
  const w = Math.max(
239
239
  1,
240
- Math.min(c - Math.floor(v / 2), m - v + 1)
241
- ), z = Math.min(m, w + v - 1), H = [];
242
- for (let R = w; R <= z; R++)
243
- H.push(R);
240
+ Math.min(c - Math.floor(N / 2), m - N + 1)
241
+ ), R = Math.min(m, w + N - 1), H = [];
242
+ for (let L = w; L <= R; L++)
243
+ H.push(L);
244
244
  return H;
245
245
  },
246
246
  [c, m]
247
247
  ), x = A(
248
- (v) => {
249
- if (!l) return v;
250
- const w = (c - 1) * a;
251
- return v.slice(w, w + a);
248
+ (N) => {
249
+ if (!l) return N;
250
+ const w = (c - 1) * n;
251
+ return N.slice(w, w + n);
252
252
  },
253
- [l, c, a]
253
+ [l, c, n]
254
254
  );
255
255
  return {
256
256
  enabled: l,
257
257
  page: c,
258
- pageSize: a,
258
+ pageSize: n,
259
259
  totalRecords: t,
260
260
  totalPages: m,
261
261
  pageSizeOptions: g,
262
262
  hasNextPage: c < m,
263
263
  hasPrevPage: c > 1,
264
- setPage: f,
265
- setPageSize: b,
264
+ setPage: b,
265
+ setPageSize: f,
266
266
  nextPage: k,
267
267
  prevPage: C,
268
- resetPagination: $,
269
- getPageWindow: F,
268
+ resetPagination: D,
269
+ getPageWindow: _,
270
270
  sliceData: x,
271
271
  paginationConfig: o
272
272
  };
@@ -338,13 +338,13 @@ function Q(e, t, s = 1, o = 10, l) {
338
338
  }
339
339
  if (r === void 0)
340
340
  for (const d of Vt) {
341
- const a = P(e, d);
342
- if (typeof a == "number" && !isNaN(a)) {
343
- r = a;
341
+ const n = P(e, d);
342
+ if (typeof n == "number" && !isNaN(n)) {
343
+ r = n;
344
344
  break;
345
345
  }
346
- if (typeof a == "string" && a.trim() !== "" && !isNaN(Number(a))) {
347
- r = Number(a);
346
+ if (typeof n == "string" && n.trim() !== "" && !isNaN(Number(n))) {
347
+ r = Number(n);
348
348
  break;
349
349
  }
350
350
  }
@@ -356,13 +356,13 @@ function Q(e, t, s = 1, o = 10, l) {
356
356
  }
357
357
  if (i === void 0)
358
358
  for (const d of Yt) {
359
- const a = P(e, d);
360
- if (typeof a == "number" && !isNaN(a)) {
361
- i = a;
359
+ const n = P(e, d);
360
+ if (typeof n == "number" && !isNaN(n)) {
361
+ i = n;
362
362
  break;
363
363
  }
364
- if (typeof a == "string" && a.trim() !== "" && !isNaN(Number(a))) {
365
- i = Number(a);
364
+ if (typeof n == "string" && n.trim() !== "" && !isNaN(Number(n))) {
365
+ i = Number(n);
366
366
  break;
367
367
  }
368
368
  }
@@ -374,13 +374,13 @@ function Q(e, t, s = 1, o = 10, l) {
374
374
  }
375
375
  if (g === void 0)
376
376
  for (const d of Zt) {
377
- const a = P(e, d);
378
- if (typeof a == "number" && !isNaN(a)) {
379
- g = a;
377
+ const n = P(e, d);
378
+ if (typeof n == "number" && !isNaN(n)) {
379
+ g = n;
380
380
  break;
381
381
  }
382
- if (typeof a == "string" && a.trim() !== "" && !isNaN(Number(a))) {
383
- g = Number(a);
382
+ if (typeof n == "string" && n.trim() !== "" && !isNaN(Number(n))) {
383
+ g = Number(n);
384
384
  break;
385
385
  }
386
386
  }
@@ -392,9 +392,9 @@ function Q(e, t, s = 1, o = 10, l) {
392
392
  }
393
393
  if (c === void 0)
394
394
  for (const d of Jt) {
395
- const a = P(e, d);
396
- if (typeof a == "number" && !isNaN(a)) {
397
- c = a;
395
+ const n = P(e, d);
396
+ if (typeof n == "number" && !isNaN(n)) {
397
+ c = n;
398
398
  break;
399
399
  }
400
400
  }
@@ -528,8 +528,8 @@ function Qt(e, t, s, o) {
528
528
  const g = [];
529
529
  if (s && s.length > 0)
530
530
  for (const d of s) {
531
- const a = P(i, d);
532
- a != null && (typeof a == "object" ? g.push(JSON.stringify(a).toLowerCase()) : g.push(String(a).toLowerCase()));
531
+ const n = P(i, d);
532
+ n != null && (typeof n == "object" ? g.push(JSON.stringify(n).toLowerCase()) : g.push(String(n).toLowerCase()));
533
533
  }
534
534
  else
535
535
  Se(i, g);
@@ -578,8 +578,8 @@ function er(e, t, s, o) {
578
578
  else if (typeof g == "string" && typeof c == "string" && Ge(g) && Ge(c))
579
579
  d = new Date(g).getTime() - new Date(c).getTime();
580
580
  else {
581
- const a = String(g), u = String(c);
582
- d = a.localeCompare(u, void 0, {
581
+ const n = String(g), u = String(c);
582
+ d = n.localeCompare(u, void 0, {
583
583
  numeric: !0,
584
584
  sensitivity: "base"
585
585
  });
@@ -601,12 +601,12 @@ function tr({
601
601
  pageSize: g,
602
602
  manualLoading: c
603
603
  }) {
604
- const d = !!(t && typeof t.fetcher == "function"), a = d && t?.mode !== "client", [u, m] = S([]), [f, b] = S(0), [k, C] = S(!1), [$, F] = S(null), [x, v] = S(0), w = $t(null), z = A(async () => {
604
+ const d = !!(t && typeof t.fetcher == "function"), n = d && t?.mode !== "client", [u, m] = S([]), [b, f] = S(0), [k, C] = S(!1), [D, _] = S(null), [x, N] = S(0), w = $t(null), R = A(async () => {
605
605
  if (!d || !t?.fetcher) return;
606
606
  w.current && w.current.abort();
607
- const _ = new AbortController();
608
- w.current = _, C(!0), F(null);
609
- const j = t.paramNames || {}, U = j.pageParam || "page", te = j.pageSizeParam || "limit", V = j.searchParam || "q", Y = j.sortByParam || "sortBy", K = j.sortOrderParam || "sortOrder", Z = {
607
+ const j = new AbortController();
608
+ w.current = j, C(!0), _(null);
609
+ const F = t.paramNames || {}, U = F.pageParam || "page", te = F.pageSizeParam || "limit", V = F.searchParam || "q", Y = F.sortByParam || "sortBy", K = F.sortOrderParam || "sortOrder", Z = {
610
610
  [U]: i,
611
611
  [te]: g,
612
612
  page: i,
@@ -617,46 +617,46 @@ function tr({
617
617
  ...t.params || {}
618
618
  };
619
619
  try {
620
- const B = await t.fetcher(Z, _.signal);
621
- if (_.signal.aborted) return;
620
+ const B = await t.fetcher(Z, j.signal);
621
+ if (j.signal.aborted) return;
622
622
  const I = Xt(
623
623
  B,
624
624
  t,
625
625
  Z
626
626
  );
627
- m(I.data), b(I.meta.total), t.onSuccess?.(I);
627
+ m(I.data), f(I.meta.total), t.onSuccess?.(I);
628
628
  } catch (B) {
629
629
  if (B?.name === "AbortError" || B?.name === "CanceledError")
630
630
  return;
631
- F(B), t.onError?.(B);
631
+ _(B), t.onError?.(B);
632
632
  } finally {
633
- _.signal.aborted || C(!1);
633
+ j.signal.aborted || C(!1);
634
634
  }
635
635
  }, [d, t, i, g, o, l, r]);
636
- be(() => {
637
- d && z();
638
- }, [z, x]), be(() => () => {
636
+ fe(() => {
637
+ d && R();
638
+ }, [R, x]), fe(() => () => {
639
639
  w.current && w.current.abort();
640
640
  }, []);
641
641
  const H = A(async () => {
642
- d && v((_) => _ + 1);
643
- }, [d]), { displayRows: R, finalTotal: ye } = W(() => {
644
- if (a)
642
+ d && N((j) => j + 1);
643
+ }, [d]), { displayRows: L, finalTotal: ye } = W(() => {
644
+ if (n)
645
645
  return {
646
646
  displayRows: u,
647
- finalTotal: f
647
+ finalTotal: b
648
648
  };
649
- const _ = d ? u : e || [], j = s.filter((B) => B.searchable !== !1).map((B) => B.key), U = Qt(_, o, j), V = s.find((B) => B.key === l)?.comparator, Y = er(U, l, r, V), K = (i - 1) * g;
649
+ const j = d ? u : e || [], F = s.filter((B) => B.searchable !== !1).map((B) => B.key), U = Qt(j, o, F), V = s.find((B) => B.key === l)?.comparator, Y = er(U, l, r, V), K = (i - 1) * g;
650
650
  return {
651
651
  displayRows: Y.slice(K, K + g),
652
652
  finalTotal: U.length
653
653
  };
654
654
  }, [
655
- a,
655
+ n,
656
656
  d,
657
657
  u,
658
658
  e,
659
- f,
659
+ b,
660
660
  s,
661
661
  o,
662
662
  l,
@@ -665,12 +665,12 @@ function tr({
665
665
  g
666
666
  ]);
667
667
  return {
668
- rows: R,
668
+ rows: L,
669
669
  totalRecords: ye,
670
670
  loading: c !== void 0 ? c : k,
671
- error: $,
671
+ error: D,
672
672
  refresh: H,
673
- isServerMode: a,
673
+ isServerMode: n,
674
674
  rawRemoteData: u
675
675
  };
676
676
  }
@@ -685,7 +685,7 @@ function rr({
685
685
  setSearch: g,
686
686
  setSorting: c,
687
687
  selectedRows: d,
688
- clearSelection: a,
688
+ clearSelection: n,
689
689
  getState: u
690
690
  }) {
691
691
  Dt(
@@ -693,7 +693,7 @@ function rr({
693
693
  () => ({
694
694
  refresh: t,
695
695
  reset: () => {
696
- s(), o(), l(), a();
696
+ s(), o(), l(), n();
697
697
  },
698
698
  resetSearch: o,
699
699
  resetSorting: l,
@@ -703,7 +703,7 @@ function rr({
703
703
  setSearch: g,
704
704
  setSorting: c,
705
705
  getSelectedRows: () => d,
706
- clearSelection: a,
706
+ clearSelection: n,
707
707
  getState: u
708
708
  }),
709
709
  [
@@ -716,7 +716,7 @@ function rr({
716
716
  g,
717
717
  c,
718
718
  d,
719
- a,
719
+ n,
720
720
  u
721
721
  ]
722
722
  );
@@ -769,16 +769,10 @@ const tt = {
769
769
  density: "normal"
770
770
  },
771
771
  midnight: {
772
- mode: "dark",
773
772
  colors: {
774
773
  primary: "#6366F1",
775
774
  primaryHover: "#4F46E5",
776
775
  primaryLight: "#818CF8",
777
- card: "#090D16",
778
- cardSecondary: "#111827",
779
- border: "#1E293B",
780
- textPrimary: "#F8FAFC",
781
- textSecondary: "#94A3B8",
782
776
  rowHover: "rgba(99, 102, 241, 0.08)",
783
777
  rowSelected: "rgba(99, 102, 241, 0.16)",
784
778
  theadBg: "#0F172A",
@@ -786,9 +780,9 @@ const tt = {
786
780
  },
787
781
  borderRadius: "1.25rem",
788
782
  classes: {
789
- tableWrapper: "w-full overflow-x-auto rounded-2xl border border-indigo-950/70 bg-[#090D16] shadow-2xl shadow-indigo-950/30",
790
- thead: "bg-[#0F172A]/90 backdrop-blur-md border-b border-indigo-950/80 text-indigo-200 font-bold uppercase text-xs tracking-wider",
791
- searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-indigo-900/50 bg-[#111827] text-white placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/40 focus:border-indigo-500",
783
+ tableWrapper: "w-full overflow-x-auto rounded-2xl border border-indigo-200 dark:border-indigo-950/70 bg-indigo-50/30 dark:bg-[#090D16] shadow-xl shadow-indigo-500/5 dark:shadow-indigo-950/30 transition-colors",
784
+ thead: "bg-indigo-100/60 dark:bg-[#0F172A]/90 backdrop-blur-md border-b border-indigo-200 dark:border-indigo-950/80 text-indigo-900 dark:text-indigo-200 font-bold uppercase text-xs tracking-wider",
785
+ searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-indigo-200 dark:border-indigo-900/50 bg-white dark:bg-[#111827] text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-indigo-500/40 focus:border-indigo-500",
792
786
  paginationButtonActive: "bg-indigo-600 text-white shadow-lg shadow-indigo-600/30"
793
787
  }
794
788
  },
@@ -805,7 +799,7 @@ const tt = {
805
799
  },
806
800
  borderRadius: "1rem",
807
801
  classes: {
808
- tableWrapper: "w-full overflow-x-auto rounded-2xl border border-emerald-500/20 bg-white dark:bg-slate-900 shadow-lg shadow-emerald-500/5",
802
+ tableWrapper: "w-full overflow-x-auto rounded-2xl border border-emerald-500/20 bg-white dark:bg-slate-900 shadow-lg shadow-emerald-500/5 transition-colors",
809
803
  thead: "bg-emerald-500/10 dark:bg-emerald-950/30 border-b border-emerald-500/20 text-emerald-800 dark:text-emerald-300 font-bold uppercase text-xs",
810
804
  searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-emerald-500/30 bg-white dark:bg-slate-800 text-gray-900 dark:text-white focus:ring-emerald-500/40 focus:border-emerald-500",
811
805
  paginationButtonActive: "bg-emerald-600 text-white shadow-md shadow-emerald-600/30"
@@ -824,7 +818,7 @@ const tt = {
824
818
  },
825
819
  borderRadius: "1rem",
826
820
  classes: {
827
- tableWrapper: "w-full overflow-x-auto rounded-2xl border border-sky-500/20 bg-white dark:bg-slate-900 shadow-lg shadow-sky-500/5",
821
+ tableWrapper: "w-full overflow-x-auto rounded-2xl border border-sky-500/20 bg-white dark:bg-slate-900 shadow-lg shadow-sky-500/5 transition-colors",
828
822
  thead: "bg-sky-500/10 dark:bg-sky-950/30 border-b border-sky-500/20 text-sky-800 dark:text-sky-300 font-bold uppercase text-xs",
829
823
  searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-sky-500/30 bg-white dark:bg-slate-800 text-gray-900 dark:text-white focus:ring-sky-500/40 focus:border-sky-500",
830
824
  paginationButtonActive: "bg-sky-500 text-white shadow-md shadow-sky-500/30"
@@ -842,9 +836,9 @@ const tt = {
842
836
  },
843
837
  borderRadius: "1.25rem",
844
838
  classes: {
845
- tableWrapper: "w-full overflow-x-auto rounded-3xl border border-amber-500/30 bg-white dark:bg-[#120F0B] shadow-2xl shadow-amber-500/10",
846
- thead: "bg-amber-500/10 dark:bg-amber-950/30 border-b border-amber-500/20 text-amber-800 dark:text-amber-300 font-bold uppercase text-xs tracking-wider",
847
- searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-amber-500/30 bg-white dark:bg-[#1A1612] text-gray-900 dark:text-amber-100 focus:ring-amber-500/40 focus:border-amber-500",
839
+ tableWrapper: "w-full overflow-x-auto rounded-3xl border border-amber-300/60 dark:border-amber-500/30 bg-amber-50/30 dark:bg-[#120F0B] shadow-xl shadow-amber-500/10 transition-colors",
840
+ thead: "bg-amber-100/70 dark:bg-amber-950/30 border-b border-amber-300/60 dark:border-amber-500/20 text-amber-900 dark:text-amber-300 font-bold uppercase text-xs tracking-wider",
841
+ searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-amber-300/60 dark:border-amber-500/30 bg-white dark:bg-[#1A1612] text-gray-900 dark:text-amber-100 focus:ring-amber-500/40 focus:border-amber-500",
848
842
  paginationButtonActive: "bg-gradient-to-r from-amber-500 to-yellow-500 text-white shadow-md shadow-amber-500/30 font-black"
849
843
  }
850
844
  },
@@ -893,7 +887,7 @@ const tt = {
893
887
  paginationButtonActive: "bg-blue-800 text-white"
894
888
  }
895
889
  }
896
- }, Te = Ft(rt), ar = ({
890
+ }, Te = Mt(rt), ar = ({
897
891
  theme: e,
898
892
  preset: t,
899
893
  children: s
@@ -916,7 +910,7 @@ const tt = {
916
910
  }
917
911
  };
918
912
  }, [o, t, e]);
919
- return /* @__PURE__ */ n(Te.Provider, { value: l, children: s });
913
+ return /* @__PURE__ */ a(Te.Provider, { value: l, children: s });
920
914
  };
921
915
  function ee() {
922
916
  return Qe(Te);
@@ -929,8 +923,8 @@ const nr = ({
929
923
  placeholder: l = "Search records..."
930
924
  }) => {
931
925
  const r = ee();
932
- return /* @__PURE__ */ h("div", { className: r.classes?.searchContainer || "w-full sm:max-w-md relative flex items-center", children: [
933
- /* @__PURE__ */ n("span", { className: "absolute left-3.5 text-gray-400 dark:text-gray-500 pointer-events-none flex items-center", children: /* @__PURE__ */ n(
926
+ return /* @__PURE__ */ y("div", { className: r.classes?.searchContainer || "w-full sm:max-w-md relative flex items-center", children: [
927
+ /* @__PURE__ */ a("span", { className: "absolute left-3.5 text-gray-400 dark:text-gray-500 pointer-events-none flex items-center", children: /* @__PURE__ */ a(
934
928
  "svg",
935
929
  {
936
930
  className: "w-4 h-4",
@@ -938,7 +932,7 @@ const nr = ({
938
932
  stroke: "currentColor",
939
933
  viewBox: "0 0 24 24",
940
934
  xmlns: "http://www.w3.org/2000/svg",
941
- children: /* @__PURE__ */ n(
935
+ children: /* @__PURE__ */ a(
942
936
  "path",
943
937
  {
944
938
  strokeLinecap: "round",
@@ -949,7 +943,7 @@ const nr = ({
949
943
  )
950
944
  }
951
945
  ) }),
952
- /* @__PURE__ */ n(
946
+ /* @__PURE__ */ a(
953
947
  "input",
954
948
  {
955
949
  type: "text",
@@ -959,16 +953,16 @@ const nr = ({
959
953
  className: r.classes?.searchInput || "w-full pl-10 pr-10 py-2.5 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-sm font-medium text-gray-900 dark:text-white placeholder:text-gray-400 dark:placeholder:text-gray-500 focus:outline-none focus:ring-2 focus:ring-primary/40 focus:border-primary transition-all"
960
954
  }
961
955
  ),
962
- /* @__PURE__ */ h("div", { className: "absolute right-3 flex items-center gap-1.5", children: [
963
- o && /* @__PURE__ */ n("span", { className: "w-3.5 h-3.5 border-2 border-primary border-t-transparent rounded-full animate-spin" }),
964
- e && /* @__PURE__ */ n(
956
+ /* @__PURE__ */ y("div", { className: "absolute right-3 flex items-center gap-1.5", children: [
957
+ o && /* @__PURE__ */ a("span", { className: "w-3.5 h-3.5 border-2 border-primary border-t-transparent rounded-full animate-spin" }),
958
+ e && /* @__PURE__ */ a(
965
959
  "button",
966
960
  {
967
961
  type: "button",
968
962
  onClick: s,
969
963
  className: "p-1 text-gray-400 hover:text-gray-600 dark:hover:text-gray-200 rounded-full hover:bg-gray-100 dark:hover:bg-slate-700 transition-colors",
970
964
  title: "Clear search",
971
- children: /* @__PURE__ */ n(
965
+ children: /* @__PURE__ */ a(
972
966
  "svg",
973
967
  {
974
968
  className: "w-3.5 h-3.5",
@@ -976,7 +970,7 @@ const nr = ({
976
970
  stroke: "currentColor",
977
971
  viewBox: "0 0 24 24",
978
972
  xmlns: "http://www.w3.org/2000/svg",
979
- children: /* @__PURE__ */ n("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" })
973
+ children: /* @__PURE__ */ a("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" })
980
974
  }
981
975
  )
982
976
  }
@@ -994,61 +988,61 @@ const nr = ({
994
988
  selectable: g,
995
989
  allSelected: c,
996
990
  isIndeterminate: d,
997
- onToggleSelectAll: a,
991
+ onToggleSelectAll: n,
998
992
  headerClassName: u = ""
999
993
  }) => {
1000
- const m = ee(), f = {};
1001
- return m.colors?.theadBg && (f.backgroundColor = m.colors.theadBg), m.colors?.theadText && (f.color = m.colors.theadText), /* @__PURE__ */ n(
994
+ const m = ee(), b = {};
995
+ return m.colors?.theadBg && (b.backgroundColor = m.colors.theadBg), m.colors?.theadText && (b.color = m.colors.theadText), /* @__PURE__ */ a(
1002
996
  "thead",
1003
997
  {
1004
- style: f,
998
+ style: b,
1005
999
  className: `${m.classes?.thead || "bg-gray-50/80 dark:bg-slate-800/80 border-b border-gray-200 dark:border-gray-800"} ${u}`,
1006
- children: /* @__PURE__ */ h("tr", { children: [
1007
- g && /* @__PURE__ */ n("th", { className: "w-10 px-4 py-3 text-center align-middle", children: /* @__PURE__ */ n(
1000
+ children: /* @__PURE__ */ y("tr", { children: [
1001
+ g && /* @__PURE__ */ a("th", { className: "w-10 px-4 py-3 text-center align-middle", children: /* @__PURE__ */ a(
1008
1002
  "input",
1009
1003
  {
1010
1004
  type: "checkbox",
1011
1005
  checked: c,
1012
- ref: (b) => {
1013
- b && (b.indeterminate = !!d);
1006
+ ref: (f) => {
1007
+ f && (f.indeterminate = !!d);
1014
1008
  },
1015
- onChange: a,
1009
+ onChange: n,
1016
1010
  className: "w-4 h-4 rounded border-gray-300 dark:border-gray-600 text-primary focus:ring-primary/30 cursor-pointer"
1017
1011
  }
1018
1012
  ) }),
1019
- e.map((b) => {
1020
- const k = l === b.key, C = b.sortable !== !1 && !!i, $ = b.align === "center" ? "text-center" : b.align === "right" ? "text-right" : "text-left";
1021
- return /* @__PURE__ */ n(
1013
+ e.map((f) => {
1014
+ const k = l === f.key, C = f.sortable !== !1 && !!i, D = f.align === "center" ? "text-center" : f.align === "right" ? "text-right" : "text-left";
1015
+ return /* @__PURE__ */ a(
1022
1016
  "th",
1023
1017
  {
1024
1018
  style: {
1025
- width: b.width,
1026
- minWidth: b.minWidth,
1027
- maxWidth: b.maxWidth
1019
+ width: f.width,
1020
+ minWidth: f.minWidth,
1021
+ maxWidth: f.maxWidth
1028
1022
  },
1029
- onClick: () => C && i?.(String(b.key)),
1030
- className: `${m.classes?.th || "py-3.5 px-4 font-bold select-none whitespace-nowrap text-xs uppercase tracking-wider"} ${$} ${b.headerClassName || ""} ${C ? "cursor-pointer hover:text-primary transition-colors group" : ""}`,
1031
- children: /* @__PURE__ */ h(
1023
+ onClick: () => C && i?.(String(f.key)),
1024
+ className: `${m.classes?.th || "py-3.5 px-4 font-bold select-none whitespace-nowrap text-xs uppercase tracking-wider"} ${D} ${f.headerClassName || ""} ${C ? "cursor-pointer hover:text-primary transition-colors group" : ""}`,
1025
+ children: /* @__PURE__ */ y(
1032
1026
  "div",
1033
1027
  {
1034
- className: `inline-flex items-center gap-1.5 ${b.align === "center" ? "justify-center" : b.align === "right" ? "justify-end" : "justify-start"}`,
1028
+ className: `inline-flex items-center gap-1.5 ${f.align === "center" ? "justify-center" : f.align === "right" ? "justify-end" : "justify-start"}`,
1035
1029
  children: [
1036
- /* @__PURE__ */ n("span", { children: b.title }),
1037
- C && /* @__PURE__ */ n(
1030
+ /* @__PURE__ */ a("span", { children: f.title }),
1031
+ C && /* @__PURE__ */ a(
1038
1032
  "span",
1039
1033
  {
1040
1034
  className: `inline-flex flex-col text-[10px] transition-transform ${k ? "text-primary scale-110" : "text-gray-400 opacity-40 group-hover:opacity-100"}`,
1041
- children: k ? r === "asc" ? "▲" : "▼" : /* @__PURE__ */ n("span", { className: "text-[9px] leading-none opacity-50", children: "▲▼" })
1035
+ children: k ? r === "asc" ? "▲" : "▼" : /* @__PURE__ */ a("span", { className: "text-[9px] leading-none opacity-50", children: "▲▼" })
1042
1036
  }
1043
1037
  )
1044
1038
  ]
1045
1039
  }
1046
1040
  )
1047
1041
  },
1048
- String(b.key)
1042
+ String(f.key)
1049
1043
  );
1050
1044
  }),
1051
- t && /* @__PURE__ */ n(
1045
+ t && /* @__PURE__ */ a(
1052
1046
  "th",
1053
1047
  {
1054
1048
  style: { width: o || "auto" },
@@ -1059,26 +1053,26 @@ const nr = ({
1059
1053
  ] })
1060
1054
  }
1061
1055
  );
1062
- }, M = () => /* @__PURE__ */ n("span", { className: "text-gray-400 dark:text-gray-500 font-mono text-sm", children: "—" }), at = ({ value: e }) => {
1056
+ }, $ = () => /* @__PURE__ */ a("span", { className: "text-gray-400 dark:text-gray-500 font-mono text-sm", children: "—" }), at = ({ value: e }) => {
1063
1057
  if (e == null || e === "")
1064
- return /* @__PURE__ */ n(M, {});
1058
+ return /* @__PURE__ */ a($, {});
1065
1059
  const t = String(e);
1066
- return /* @__PURE__ */ n("span", { className: "truncate block max-w-xs font-normal text-sm", title: t, children: t });
1060
+ return /* @__PURE__ */ a("span", { className: "truncate block max-w-xs font-normal text-sm", title: t, children: t });
1067
1061
  }, or = ({ value: e }) => {
1068
1062
  if (e == null || isNaN(Number(e)))
1069
- return /* @__PURE__ */ n(M, {});
1063
+ return /* @__PURE__ */ a($, {});
1070
1064
  const t = Number(e);
1071
- return /* @__PURE__ */ n("span", { className: "font-mono text-sm font-medium", children: t.toLocaleString() });
1065
+ return /* @__PURE__ */ a("span", { className: "font-mono text-sm font-medium", children: t.toLocaleString() });
1072
1066
  }, ir = ({ value: e }) => {
1073
1067
  if (e == null)
1074
- return /* @__PURE__ */ n(M, {});
1068
+ return /* @__PURE__ */ a($, {});
1075
1069
  const t = !!e;
1076
- return /* @__PURE__ */ h(
1070
+ return /* @__PURE__ */ y(
1077
1071
  "span",
1078
1072
  {
1079
1073
  className: `inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-semibold tracking-wide ${t ? "bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20" : "bg-rose-500/10 text-rose-600 dark:text-rose-400 border border-rose-500/20"}`,
1080
1074
  children: [
1081
- /* @__PURE__ */ n("span", { className: `w-1.5 h-1.5 rounded-full ${t ? "bg-emerald-500" : "bg-rose-500"}` }),
1075
+ /* @__PURE__ */ a("span", { className: `w-1.5 h-1.5 rounded-full ${t ? "bg-emerald-500" : "bg-rose-500"}` }),
1082
1076
  t ? "Yes" : "No"
1083
1077
  ]
1084
1078
  }
@@ -1087,24 +1081,24 @@ const nr = ({
1087
1081
  value: e,
1088
1082
  isDateTime: t = !1
1089
1083
  }) => {
1090
- if (!e) return /* @__PURE__ */ n(M, {});
1084
+ if (!e) return /* @__PURE__ */ a($, {});
1091
1085
  const s = e instanceof Date ? e : new Date(e);
1092
- return isNaN(s.getTime()) ? /* @__PURE__ */ n(at, { value: e, column: { key: "" } }) : /* @__PURE__ */ h("span", { className: "whitespace-nowrap text-xs sm:text-sm font-medium text-gray-700 dark:text-gray-300", children: [
1086
+ return isNaN(s.getTime()) ? /* @__PURE__ */ a(at, { value: e, column: { key: "" } }) : /* @__PURE__ */ y("span", { className: "whitespace-nowrap text-xs sm:text-sm font-medium text-gray-700 dark:text-gray-300", children: [
1093
1087
  s.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" }),
1094
- t && /* @__PURE__ */ n("span", { className: "text-xs text-gray-400 dark:text-gray-500 ml-1.5", children: s.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit" }) })
1088
+ t && /* @__PURE__ */ a("span", { className: "text-xs text-gray-400 dark:text-gray-500 ml-1.5", children: s.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit" }) })
1095
1089
  ] });
1096
1090
  }, lr = ({ value: e, column: t }) => {
1097
1091
  if (e == null || isNaN(Number(e)))
1098
- return /* @__PURE__ */ n(M, {});
1092
+ return /* @__PURE__ */ a($, {});
1099
1093
  const s = Number(e), o = t.currency || "EGP";
1100
- return /* @__PURE__ */ h("span", { className: "font-mono text-sm font-bold text-gray-900 dark:text-white", children: [
1094
+ return /* @__PURE__ */ y("span", { className: "font-mono text-sm font-bold text-gray-900 dark:text-white", children: [
1101
1095
  s.toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 }),
1102
1096
  " ",
1103
- /* @__PURE__ */ n("span", { className: "text-xs font-normal text-gray-500 dark:text-gray-400", children: o })
1097
+ /* @__PURE__ */ a("span", { className: "text-xs font-normal text-gray-500 dark:text-gray-400", children: o })
1104
1098
  ] });
1105
1099
  }, Ze = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z'/%3E%3C/svg%3E", dr = ({ value: e }) => {
1106
1100
  let t = "";
1107
- return typeof e == "string" ? t = e : Array.isArray(e) && e.length > 0 ? t = typeof e[0] == "string" ? e[0] : e[0]?.url || "" : e && typeof e == "object" && (t = e.url || ""), t || (t = Ze), /* @__PURE__ */ n("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ n(
1101
+ return typeof e == "string" ? t = e : Array.isArray(e) && e.length > 0 ? t = typeof e[0] == "string" ? e[0] : e[0]?.url || "" : e && typeof e == "object" && (t = e.url || ""), t || (t = Ze), /* @__PURE__ */ a("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ a(
1108
1102
  "img",
1109
1103
  {
1110
1104
  src: t,
@@ -1134,17 +1128,17 @@ const nr = ({
1134
1128
  closed: { bg: "bg-gray-500/10 border-gray-500/20", text: "text-gray-600 dark:text-gray-400", dot: "bg-gray-500" }
1135
1129
  }, gr = ({ value: e, column: t }) => {
1136
1130
  if (e == null || e === "")
1137
- return /* @__PURE__ */ n(M, {});
1131
+ return /* @__PURE__ */ a($, {});
1138
1132
  const s = String(e), o = s.toLowerCase();
1139
1133
  if (t.statusMap && t.statusMap[s]) {
1140
1134
  const r = t.statusMap[s];
1141
- return /* @__PURE__ */ h(
1135
+ return /* @__PURE__ */ y(
1142
1136
  "span",
1143
1137
  {
1144
1138
  className: "inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-bold uppercase tracking-wider border",
1145
1139
  style: { color: r.color, backgroundColor: r.bg },
1146
1140
  children: [
1147
- /* @__PURE__ */ n("span", { className: "w-1.5 h-1.5 rounded-full", style: { backgroundColor: r.color } }),
1141
+ /* @__PURE__ */ a("span", { className: "w-1.5 h-1.5 rounded-full", style: { backgroundColor: r.color } }),
1148
1142
  r.label || s
1149
1143
  ]
1150
1144
  }
@@ -1155,18 +1149,18 @@ const nr = ({
1155
1149
  text: "text-gray-700 dark:text-gray-300",
1156
1150
  dot: "bg-gray-400"
1157
1151
  };
1158
- return /* @__PURE__ */ h(
1152
+ return /* @__PURE__ */ y(
1159
1153
  "span",
1160
1154
  {
1161
1155
  className: `inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-bold uppercase tracking-wider border ${l.bg} ${l.text}`,
1162
1156
  children: [
1163
- /* @__PURE__ */ n("span", { className: `w-1.5 h-1.5 rounded-full ${l.dot}` }),
1157
+ /* @__PURE__ */ a("span", { className: `w-1.5 h-1.5 rounded-full ${l.dot}` }),
1164
1158
  s
1165
1159
  ]
1166
1160
  }
1167
1161
  );
1168
- }, mr = ({ value: e }) => !Array.isArray(e) || e.length === 0 ? /* @__PURE__ */ n(M, {}) : /* @__PURE__ */ h("div", { className: "flex flex-wrap gap-1 items-center", children: [
1169
- e.slice(0, 3).map((t, s) => /* @__PURE__ */ n(
1162
+ }, mr = ({ value: e }) => !Array.isArray(e) || e.length === 0 ? /* @__PURE__ */ a($, {}) : /* @__PURE__ */ y("div", { className: "flex flex-wrap gap-1 items-center", children: [
1163
+ e.slice(0, 3).map((t, s) => /* @__PURE__ */ a(
1170
1164
  "span",
1171
1165
  {
1172
1166
  className: "inline-block px-2 py-0.5 text-xs rounded bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-300 border border-gray-200 dark:border-gray-700",
@@ -1174,14 +1168,14 @@ const nr = ({
1174
1168
  },
1175
1169
  s
1176
1170
  )),
1177
- e.length > 3 && /* @__PURE__ */ h("span", { className: "text-xs text-gray-400 font-medium", children: [
1171
+ e.length > 3 && /* @__PURE__ */ y("span", { className: "text-xs text-gray-400 font-medium", children: [
1178
1172
  "+",
1179
1173
  e.length - 3
1180
1174
  ] })
1181
- ] }), ur = ({ value: e }) => !e || typeof e != "object" ? /* @__PURE__ */ n(M, {}) : "en" in e || "ar" in e ? /* @__PURE__ */ n("span", { className: "font-medium text-sm", children: e.en || e.ar || "" }) : /* @__PURE__ */ n("span", { className: "font-mono text-xs text-gray-500 dark:text-gray-400 truncate block max-w-xs", title: JSON.stringify(e), children: JSON.stringify(e) }), fr = ({ value: e }) => {
1182
- if (!e) return /* @__PURE__ */ n(M, {});
1175
+ ] }), ur = ({ value: e }) => !e || typeof e != "object" ? /* @__PURE__ */ a($, {}) : "en" in e || "ar" in e ? /* @__PURE__ */ a("span", { className: "font-medium text-sm", children: e.en || e.ar || "" }) : /* @__PURE__ */ a("span", { className: "font-mono text-xs text-gray-500 dark:text-gray-400 truncate block max-w-xs", title: JSON.stringify(e), children: JSON.stringify(e) }), br = ({ value: e }) => {
1176
+ if (!e) return /* @__PURE__ */ a($, {});
1183
1177
  const t = String(e);
1184
- return /* @__PURE__ */ h(
1178
+ return /* @__PURE__ */ y(
1185
1179
  "a",
1186
1180
  {
1187
1181
  href: t,
@@ -1189,15 +1183,15 @@ const nr = ({
1189
1183
  rel: "noopener noreferrer",
1190
1184
  className: "text-primary hover:underline text-sm font-medium inline-flex items-center gap-1",
1191
1185
  children: [
1192
- /* @__PURE__ */ n("span", { className: "truncate max-w-[150px]", children: t }),
1193
- /* @__PURE__ */ n("span", { className: "text-xs", children: "↗" })
1186
+ /* @__PURE__ */ a("span", { className: "truncate max-w-[150px]", children: t }),
1187
+ /* @__PURE__ */ a("span", { className: "text-xs", children: "↗" })
1194
1188
  ]
1195
1189
  }
1196
1190
  );
1197
- }, br = ({ value: e }) => {
1198
- if (!e) return /* @__PURE__ */ n(M, {});
1191
+ }, fr = ({ value: e }) => {
1192
+ if (!e) return /* @__PURE__ */ a($, {});
1199
1193
  const t = String(e);
1200
- return /* @__PURE__ */ n(
1194
+ return /* @__PURE__ */ a(
1201
1195
  "a",
1202
1196
  {
1203
1197
  href: `mailto:${t}`,
@@ -1206,9 +1200,9 @@ const nr = ({
1206
1200
  }
1207
1201
  );
1208
1202
  }, yr = ({ value: e }) => {
1209
- if (!e) return /* @__PURE__ */ n(M, {});
1203
+ if (!e) return /* @__PURE__ */ a($, {});
1210
1204
  const t = String(e);
1211
- return /* @__PURE__ */ n(
1205
+ return /* @__PURE__ */ a(
1212
1206
  "a",
1213
1207
  {
1214
1208
  href: `tel:${t}`,
@@ -1216,41 +1210,78 @@ const nr = ({
1216
1210
  children: t
1217
1211
  }
1218
1212
  );
1219
- }, hr = ({ row: e, column: t, rowIndex: s }) => {
1213
+ }, hr = ({ value: e }) => {
1214
+ if (e == null || isNaN(Number(e)))
1215
+ return /* @__PURE__ */ a($, {});
1216
+ const t = Math.min(100, Math.max(0, Math.round(Number(e)))), s = t >= 80 ? "bg-emerald-500" : t >= 50 ? "bg-blue-500" : t >= 30 ? "bg-amber-500" : "bg-rose-500";
1217
+ return /* @__PURE__ */ y("div", { className: "flex items-center gap-2.5 min-w-[120px]", children: [
1218
+ /* @__PURE__ */ a("div", { className: "flex-1 h-2 rounded-full bg-gray-200 dark:bg-slate-700 overflow-hidden", children: /* @__PURE__ */ a(
1219
+ "div",
1220
+ {
1221
+ className: `h-full rounded-full ${s} transition-all duration-500`,
1222
+ style: { width: `${t}%` }
1223
+ }
1224
+ ) }),
1225
+ /* @__PURE__ */ y("span", { className: "font-mono text-xs font-bold text-gray-700 dark:text-gray-300 w-9 text-right", children: [
1226
+ t,
1227
+ "%"
1228
+ ] })
1229
+ ] });
1230
+ }, pr = ({ value: e }) => {
1231
+ if (e == null || isNaN(Number(e)))
1232
+ return /* @__PURE__ */ a($, {});
1233
+ const t = Number(e);
1234
+ return /* @__PURE__ */ y("div", { className: "inline-flex items-center gap-1.5 font-medium text-xs text-amber-500", children: [
1235
+ /* @__PURE__ */ a("span", { className: "text-sm", children: "★" }),
1236
+ /* @__PURE__ */ a("span", { className: "font-bold text-gray-900 dark:text-gray-100", children: t.toFixed(1) }),
1237
+ /* @__PURE__ */ a("span", { className: "text-gray-400 dark:text-gray-500 text-[10px]", children: "/ 5" })
1238
+ ] });
1239
+ }, xr = ({ value: e }) => {
1240
+ if (e == null || e === "")
1241
+ return /* @__PURE__ */ a($, {});
1242
+ const t = String(e);
1243
+ return /* @__PURE__ */ a("span", { className: "inline-flex items-center px-2.5 py-0.5 rounded-lg text-xs font-bold bg-primary/10 text-primary border border-primary/20", children: t });
1244
+ }, kr = ({ row: e, column: t, rowIndex: s }) => {
1220
1245
  const o = P(e, t.key);
1221
1246
  if (t.render && typeof t.render == "function")
1222
- return /* @__PURE__ */ n(Ce, { children: t.render(o, e, s) });
1247
+ return /* @__PURE__ */ a(Ce, { children: t.render(o, e, s) });
1223
1248
  if (t.formatter && typeof t.formatter == "function")
1224
- return /* @__PURE__ */ n(Ce, { children: t.formatter(o, e, s) });
1249
+ return /* @__PURE__ */ a(Ce, { children: t.formatter(o, e, s) });
1225
1250
  switch (t.type) {
1226
1251
  case "boolean":
1227
- return /* @__PURE__ */ n(ir, { value: o, column: t });
1252
+ return /* @__PURE__ */ a(ir, { value: o, column: t });
1228
1253
  case "number":
1229
- return /* @__PURE__ */ n(or, { value: o, column: t });
1254
+ return /* @__PURE__ */ a(or, { value: o, column: t });
1230
1255
  case "currency":
1231
- return /* @__PURE__ */ n(lr, { value: o, column: t });
1256
+ return /* @__PURE__ */ a(lr, { value: o, column: t });
1232
1257
  case "date":
1233
- return /* @__PURE__ */ n(Ye, { value: o, column: t, isDateTime: !1 });
1258
+ return /* @__PURE__ */ a(Ye, { value: o, column: t, isDateTime: !1 });
1234
1259
  case "datetime":
1235
- return /* @__PURE__ */ n(Ye, { value: o, column: t, isDateTime: !0 });
1260
+ return /* @__PURE__ */ a(Ye, { value: o, column: t, isDateTime: !0 });
1236
1261
  case "image":
1237
- return /* @__PURE__ */ n(dr, { value: o, column: t });
1262
+ return /* @__PURE__ */ a(dr, { value: o, column: t });
1238
1263
  case "status":
1239
- return /* @__PURE__ */ n(gr, { value: o, column: t });
1264
+ return /* @__PURE__ */ a(gr, { value: o, column: t });
1265
+ case "progress":
1266
+ return /* @__PURE__ */ a(hr, { value: o, column: t });
1267
+ case "rating":
1268
+ return /* @__PURE__ */ a(pr, { value: o, column: t });
1269
+ case "badge":
1270
+ return /* @__PURE__ */ a(xr, { value: o, column: t });
1240
1271
  case "array":
1241
- return /* @__PURE__ */ n(mr, { value: o, column: t });
1272
+ return /* @__PURE__ */ a(mr, { value: o, column: t });
1242
1273
  case "object":
1243
- return /* @__PURE__ */ n(ur, { value: o, column: t });
1274
+ return /* @__PURE__ */ a(ur, { value: o, column: t });
1244
1275
  case "url":
1245
- return /* @__PURE__ */ n(fr, { value: o, column: t });
1276
+ return /* @__PURE__ */ a(br, { value: o, column: t });
1246
1277
  case "email":
1247
- return /* @__PURE__ */ n(br, { value: o, column: t });
1278
+ return /* @__PURE__ */ a(fr, { value: o, column: t });
1248
1279
  case "phone":
1249
- return /* @__PURE__ */ n(yr, { value: o, column: t });
1280
+ return /* @__PURE__ */ a(yr, { value: o, column: t });
1250
1281
  default:
1251
- return /* @__PURE__ */ n(at, { value: o, column: t });
1282
+ return /* @__PURE__ */ a(at, { value: o, column: t });
1252
1283
  }
1253
- }, pr = ({
1284
+ }, wr = ({
1254
1285
  isOpen: e,
1255
1286
  title: t,
1256
1287
  message: s,
@@ -1260,34 +1291,34 @@ const nr = ({
1260
1291
  onClose: i,
1261
1292
  onConfirm: g,
1262
1293
  isLoading: c = !1
1263
- }) => (be(() => {
1264
- const d = (a) => {
1265
- a.key === "Escape" && i();
1294
+ }) => (fe(() => {
1295
+ const d = (n) => {
1296
+ n.key === "Escape" && i();
1266
1297
  };
1267
1298
  return e && window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
1268
- }, [e, i]), e ? /* @__PURE__ */ n(
1299
+ }, [e, i]), e ? /* @__PURE__ */ a(
1269
1300
  "div",
1270
1301
  {
1271
1302
  className: "fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm any-table-fade-in",
1272
1303
  onClick: i,
1273
- children: /* @__PURE__ */ h(
1304
+ children: /* @__PURE__ */ y(
1274
1305
  "div",
1275
1306
  {
1276
1307
  className: "bg-white dark:bg-slate-900 border border-gray-200 dark:border-gray-800 w-full max-w-md rounded-2xl p-6 shadow-2xl transform transition-all text-center",
1277
1308
  onClick: (d) => d.stopPropagation(),
1278
1309
  role: "dialog",
1279
1310
  children: [
1280
- /* @__PURE__ */ n(
1311
+ /* @__PURE__ */ a(
1281
1312
  "div",
1282
1313
  {
1283
1314
  className: `mx-auto mb-4 w-14 h-14 rounded-full flex items-center justify-center text-2xl ${r === "danger" ? "bg-rose-500/10 text-rose-500" : r === "warning" ? "bg-amber-500/10 text-amber-500" : "bg-blue-500/10 text-blue-500"}`,
1284
1315
  children: r === "danger" ? "⚠️" : r === "warning" ? "⚡" : "ℹ️"
1285
1316
  }
1286
1317
  ),
1287
- /* @__PURE__ */ n("h3", { className: "text-xl font-black text-gray-900 dark:text-white mb-2", children: t }),
1288
- /* @__PURE__ */ n("p", { className: "text-sm text-gray-600 dark:text-gray-400 mb-6 leading-relaxed", children: s }),
1289
- /* @__PURE__ */ h("div", { className: "flex items-center justify-center gap-3", children: [
1290
- /* @__PURE__ */ n(
1318
+ /* @__PURE__ */ a("h3", { className: "text-xl font-black text-gray-900 dark:text-white mb-2", children: t }),
1319
+ /* @__PURE__ */ a("p", { className: "text-sm text-gray-600 dark:text-gray-400 mb-6 leading-relaxed", children: s }),
1320
+ /* @__PURE__ */ y("div", { className: "flex items-center justify-center gap-3", children: [
1321
+ /* @__PURE__ */ a(
1291
1322
  "button",
1292
1323
  {
1293
1324
  type: "button",
@@ -1297,7 +1328,7 @@ const nr = ({
1297
1328
  children: l
1298
1329
  }
1299
1330
  ),
1300
- /* @__PURE__ */ n(
1331
+ /* @__PURE__ */ a(
1301
1332
  "button",
1302
1333
  {
1303
1334
  type: "button",
@@ -1319,25 +1350,25 @@ function nt(e, t) {
1319
1350
  return e;
1320
1351
  if (typeof e == "function") {
1321
1352
  if (e.prototype && e.prototype.isReactComponent)
1322
- return /* @__PURE__ */ n(e, { className: "w-4 h-4 shrink-0" });
1353
+ return /* @__PURE__ */ a(e, { className: "w-4 h-4 shrink-0" });
1323
1354
  const s = e.displayName || e.name || "";
1324
1355
  if (/^[A-Z]/.test(s))
1325
- return /* @__PURE__ */ n(e, { className: "w-4 h-4 shrink-0" });
1356
+ return /* @__PURE__ */ a(e, { className: "w-4 h-4 shrink-0" });
1326
1357
  try {
1327
1358
  const l = e(t);
1328
1359
  return nt(l, t);
1329
1360
  } catch {
1330
- return /* @__PURE__ */ n(e, { className: "w-4 h-4 shrink-0" });
1361
+ return /* @__PURE__ */ a(e, { className: "w-4 h-4 shrink-0" });
1331
1362
  }
1332
1363
  }
1333
- return typeof e == "object" && e !== null && (e.$$typeof || e.render) ? /* @__PURE__ */ n(e, { className: "w-4 h-4 shrink-0" }) : typeof e == "string" ? e.startsWith("http://") || e.startsWith("https://") || e.startsWith("/") || e.startsWith("./") || e.startsWith("data:image/") || /\.(png|jpe?g|svg|webp|gif|ico)$/i.test(e) ? /* @__PURE__ */ n(
1364
+ return typeof e == "object" && e !== null && (e.$$typeof || e.render) ? /* @__PURE__ */ a(e, { className: "w-4 h-4 shrink-0" }) : typeof e == "string" ? e.startsWith("http://") || e.startsWith("https://") || e.startsWith("/") || e.startsWith("./") || e.startsWith("data:image/") || /\.(png|jpe?g|svg|webp|gif|ico)$/i.test(e) ? /* @__PURE__ */ a(
1334
1365
  "img",
1335
1366
  {
1336
1367
  src: e,
1337
1368
  alt: "action-icon",
1338
1369
  className: "w-4 h-4 object-contain shrink-0 inline-block"
1339
1370
  }
1340
- ) : /* @__PURE__ */ n("span", { className: "inline-flex items-center justify-center leading-none text-base", children: e }) : e;
1371
+ ) : /* @__PURE__ */ a("span", { className: "inline-flex items-center justify-center leading-none text-base", children: e }) : e;
1341
1372
  }
1342
1373
  const Je = {
1343
1374
  primary: "bg-primary text-white hover:bg-primary-soft shadow-sm shadow-primary/20",
@@ -1348,107 +1379,107 @@ const Je = {
1348
1379
  info: "bg-sky-500 text-white hover:bg-sky-600 shadow-sm shadow-sky-500/20",
1349
1380
  neutral: "bg-gray-100 dark:bg-gray-800 text-gray-700 dark:text-gray-200 hover:bg-gray-200 dark:hover:bg-gray-700 border border-gray-200 dark:border-gray-700",
1350
1381
  ghost: "bg-transparent text-gray-600 dark:text-gray-400 hover:bg-gray-100 dark:hover:bg-gray-800 hover:text-gray-900 dark:hover:text-white"
1351
- }, xr = ({ row: e, actions: t, context: s }) => {
1382
+ }, Nr = ({ row: e, actions: t, context: s }) => {
1352
1383
  const [o, l] = S(null), [r, i] = S({});
1353
1384
  if (!t || !t.length)
1354
1385
  return null;
1355
- const g = async (a) => {
1356
- if (a.confirmation) {
1357
- const u = typeof a.confirmation.title == "function" ? a.confirmation.title(e) : a.confirmation.title || "Confirm Action", m = typeof a.confirmation.message == "function" ? a.confirmation.message(e) : a.confirmation.message || "Are you sure you want to perform this action?";
1386
+ const g = async (n) => {
1387
+ if (n.confirmation) {
1388
+ const u = typeof n.confirmation.title == "function" ? n.confirmation.title(e) : n.confirmation.title || "Confirm Action", m = typeof n.confirmation.message == "function" ? n.confirmation.message(e) : n.confirmation.message || "Are you sure you want to perform this action?";
1358
1389
  l({
1359
1390
  isOpen: !0,
1360
1391
  title: u,
1361
1392
  message: m,
1362
- confirmText: a.confirmation.confirmText || "Confirm",
1363
- cancelText: a.confirmation.cancelText || "Cancel",
1364
- type: a.confirmation.type || "danger",
1393
+ confirmText: n.confirmation.confirmText || "Confirm",
1394
+ cancelText: n.confirmation.cancelText || "Cancel",
1395
+ type: n.confirmation.type || "danger",
1365
1396
  onConfirm: async () => {
1366
- l(null), await c(a);
1397
+ l(null), await c(n);
1367
1398
  }
1368
1399
  });
1369
1400
  return;
1370
1401
  }
1371
- await c(a);
1372
- }, c = async (a) => {
1373
- if (a.type === "button" || !a.type) {
1374
- i((u) => ({ ...u, [a.id]: !0 }));
1402
+ await c(n);
1403
+ }, c = async (n) => {
1404
+ if (n.type === "button" || !n.type) {
1405
+ i((u) => ({ ...u, [n.id]: !0 }));
1375
1406
  try {
1376
- await a.onClick(e, s);
1407
+ await n.onClick(e, s);
1377
1408
  } finally {
1378
- i((u) => ({ ...u, [a.id]: !1 }));
1409
+ i((u) => ({ ...u, [n.id]: !1 }));
1379
1410
  }
1380
1411
  }
1381
- }, d = async (a, u) => {
1412
+ }, d = async (n, u) => {
1382
1413
  const m = !u;
1383
- i((f) => ({ ...f, [a.id]: !0 }));
1414
+ i((b) => ({ ...b, [n.id]: !0 }));
1384
1415
  try {
1385
- await a.onChange(e, m, s);
1416
+ await n.onChange(e, m, s);
1386
1417
  } finally {
1387
- i((f) => ({ ...f, [a.id]: !1 }));
1418
+ i((b) => ({ ...b, [n.id]: !1 }));
1388
1419
  }
1389
1420
  };
1390
- return /* @__PURE__ */ h(Ce, { children: [
1391
- /* @__PURE__ */ n("div", { className: "flex items-center justify-end gap-2 pr-2", children: t.map((a) => {
1392
- if (typeof a.hide == "function" && a.hide(e) || typeof a.show == "function" && !a.show(e)) return null;
1393
- const u = typeof a.disabled == "function" ? a.disabled(e) : !!a.disabled, m = r[a.id] || (typeof a.loading == "function" ? a.loading(e) : !!a.loading), f = typeof a.label == "function" ? a.label(e) : a.label, b = nt(a.icon, e), k = typeof a.tooltip == "function" ? a.tooltip(e) : a.tooltip, C = typeof a.className == "function" ? a.className(e) : a.className || "";
1394
- if (a.type === "custom" && a.render)
1395
- return /* @__PURE__ */ n(Xe.Fragment, { children: a.render(e, s) }, a.id);
1396
- if (a.type === "switch") {
1397
- const v = a, w = v.checked(e);
1398
- return /* @__PURE__ */ h(
1421
+ return /* @__PURE__ */ y(Ce, { children: [
1422
+ /* @__PURE__ */ a("div", { className: "flex items-center justify-end gap-2 pr-2", children: t.map((n) => {
1423
+ if (typeof n.hide == "function" && n.hide(e) || typeof n.show == "function" && !n.show(e)) return null;
1424
+ const u = typeof n.disabled == "function" ? n.disabled(e) : !!n.disabled, m = r[n.id] || (typeof n.loading == "function" ? n.loading(e) : !!n.loading), b = typeof n.label == "function" ? n.label(e) : n.label, f = nt(n.icon, e), k = typeof n.tooltip == "function" ? n.tooltip(e) : n.tooltip, C = typeof n.className == "function" ? n.className(e) : n.className || "";
1425
+ if (n.type === "custom" && n.render)
1426
+ return /* @__PURE__ */ a(Xe.Fragment, { children: n.render(e, s) }, n.id);
1427
+ if (n.type === "switch") {
1428
+ const N = n, w = N.checked(e);
1429
+ return /* @__PURE__ */ y(
1399
1430
  "div",
1400
1431
  {
1401
1432
  className: "flex items-center gap-2",
1402
- title: k || f,
1433
+ title: k || b,
1403
1434
  children: [
1404
- f && /* @__PURE__ */ h("span", { className: "text-xs font-semibold text-gray-500", children: [
1405
- f,
1435
+ b && /* @__PURE__ */ y("span", { className: "text-xs font-semibold text-gray-500", children: [
1436
+ b,
1406
1437
  ":"
1407
1438
  ] }),
1408
- /* @__PURE__ */ n(
1439
+ /* @__PURE__ */ a(
1409
1440
  "button",
1410
1441
  {
1411
1442
  type: "button",
1412
1443
  role: "switch",
1413
1444
  "aria-checked": w,
1414
1445
  disabled: u || m,
1415
- onClick: () => d(v, w),
1446
+ onClick: () => d(N, w),
1416
1447
  className: `relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 ${w ? "bg-emerald-500" : "bg-gray-300 dark:bg-gray-700"} ${C}`,
1417
- children: /* @__PURE__ */ n(
1448
+ children: /* @__PURE__ */ a(
1418
1449
  "span",
1419
1450
  {
1420
1451
  "aria-hidden": "true",
1421
1452
  className: `pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out flex items-center justify-center ${w ? "translate-x-5" : "translate-x-0"}`,
1422
- children: m && /* @__PURE__ */ n("span", { className: "w-2.5 h-2.5 border-2 border-primary border-t-transparent rounded-full animate-spin" })
1453
+ children: m && /* @__PURE__ */ a("span", { className: "w-2.5 h-2.5 border-2 border-primary border-t-transparent rounded-full animate-spin" })
1423
1454
  }
1424
1455
  )
1425
1456
  }
1426
1457
  )
1427
1458
  ]
1428
1459
  },
1429
- a.id
1460
+ n.id
1430
1461
  );
1431
1462
  }
1432
- const $ = typeof a.variant == "function" ? a.variant(e) : a.variant || "neutral", F = Je[$] || Je.neutral, x = !f && b ? "p-2 min-w-[2rem]" : "px-3 py-1.5";
1433
- return /* @__PURE__ */ h(
1463
+ const D = typeof n.variant == "function" ? n.variant(e) : n.variant || "neutral", _ = Je[D] || Je.neutral, x = !b && f ? "p-2 min-w-[2rem]" : "px-3 py-1.5";
1464
+ return /* @__PURE__ */ y(
1434
1465
  "button",
1435
1466
  {
1436
1467
  type: "button",
1437
1468
  disabled: u || m,
1438
- onClick: () => g(a),
1469
+ onClick: () => g(n),
1439
1470
  title: k,
1440
- style: a.color ? { backgroundColor: a.color, color: "#ffffff" } : void 0,
1441
- className: `inline-flex items-center justify-center gap-1.5 ${x} rounded-xl text-xs font-bold transition-all duration-200 active:scale-95 disabled:cursor-not-allowed disabled:opacity-50 disabled:active:scale-100 ${F} ${C}`,
1471
+ style: n.color ? { backgroundColor: n.color, color: "#ffffff" } : void 0,
1472
+ className: `inline-flex items-center justify-center gap-1.5 ${x} rounded-xl text-xs font-bold transition-all duration-200 active:scale-95 disabled:cursor-not-allowed disabled:opacity-50 disabled:active:scale-100 ${_} ${C}`,
1442
1473
  children: [
1443
- m ? /* @__PURE__ */ n("span", { className: "w-3.5 h-3.5 border-2 border-current border-t-transparent rounded-full animate-spin" }) : b && /* @__PURE__ */ n("span", { className: "text-sm flex items-center justify-center shrink-0", children: b }),
1444
- f && /* @__PURE__ */ n("span", { children: f })
1474
+ m ? /* @__PURE__ */ a("span", { className: "w-3.5 h-3.5 border-2 border-current border-t-transparent rounded-full animate-spin" }) : f && /* @__PURE__ */ a("span", { className: "text-sm flex items-center justify-center shrink-0", children: f }),
1475
+ b && /* @__PURE__ */ a("span", { children: b })
1445
1476
  ]
1446
1477
  },
1447
- a.id
1478
+ n.id
1448
1479
  );
1449
1480
  }) }),
1450
- o && /* @__PURE__ */ n(
1451
- pr,
1481
+ o && /* @__PURE__ */ a(
1482
+ wr,
1452
1483
  {
1453
1484
  isOpen: o.isOpen,
1454
1485
  title: o.title,
@@ -1461,7 +1492,7 @@ const Je = {
1461
1492
  }
1462
1493
  )
1463
1494
  ] });
1464
- }, kr = ({
1495
+ }, vr = ({
1465
1496
  rows: e,
1466
1497
  columns: t,
1467
1498
  actions: s,
@@ -1472,37 +1503,37 @@ const Je = {
1472
1503
  onToggleSelectRow: g,
1473
1504
  onRowClick: c,
1474
1505
  striped: d = !1,
1475
- hoverable: a = !0,
1506
+ hoverable: n = !0,
1476
1507
  rowClassName: u
1477
1508
  }) => {
1478
- const m = ee(), f = !!(s && s.length > 0);
1479
- return /* @__PURE__ */ n("tbody", { className: m.classes?.tbody || "divide-y divide-gray-100 dark:divide-gray-800/60 bg-white dark:bg-slate-900", children: e.map((b, k) => {
1480
- const C = l(b, k), $ = i?.has(C), F = typeof u == "function" ? u(b, k) : u || "";
1481
- return /* @__PURE__ */ h(
1509
+ const m = ee(), b = !!(s && s.length > 0);
1510
+ return /* @__PURE__ */ a("tbody", { className: m.classes?.tbody || "divide-y divide-gray-100 dark:divide-gray-800/60 bg-white dark:bg-slate-900", children: e.map((f, k) => {
1511
+ const C = l(f, k), D = i?.has(C), _ = typeof u == "function" ? u(f, k) : u || "";
1512
+ return /* @__PURE__ */ y(
1482
1513
  "tr",
1483
1514
  {
1484
- onClick: (x) => c?.(b, k, x),
1485
- className: `${m.classes?.tr || "transition-colors duration-150"} ${d && k % 2 === 1 ? "bg-gray-50/40 dark:bg-slate-800/20" : ""} ${a ? "hover:bg-gray-50/70 dark:hover:bg-slate-800/50" : ""} ${$ ? "bg-primary/5 dark:bg-primary/10" : ""} ${c ? "cursor-pointer" : ""} ${F}`,
1515
+ onClick: (x) => c?.(f, k, x),
1516
+ className: `${m.classes?.tr || "transition-colors duration-150"} ${d && k % 2 === 1 ? "bg-gray-50/40 dark:bg-slate-800/20" : ""} ${n ? "hover:bg-gray-50/70 dark:hover:bg-slate-800/50" : ""} ${D ? "bg-primary/5 dark:bg-primary/10" : ""} ${c ? "cursor-pointer" : ""} ${_}`,
1486
1517
  children: [
1487
- r && /* @__PURE__ */ n(
1518
+ r && /* @__PURE__ */ a(
1488
1519
  "td",
1489
1520
  {
1490
1521
  className: "w-10 px-4 py-3 text-center align-middle",
1491
1522
  onClick: (x) => x.stopPropagation(),
1492
- children: /* @__PURE__ */ n(
1523
+ children: /* @__PURE__ */ a(
1493
1524
  "input",
1494
1525
  {
1495
1526
  type: "checkbox",
1496
- checked: $,
1497
- onChange: () => g?.(C, b),
1527
+ checked: D,
1528
+ onChange: () => g?.(C, f),
1498
1529
  className: "w-4 h-4 rounded border-gray-300 dark:border-gray-600 text-primary focus:ring-primary/30 cursor-pointer"
1499
1530
  }
1500
1531
  )
1501
1532
  }
1502
1533
  ),
1503
1534
  t.map((x) => {
1504
- const v = x.align === "center" ? "text-center" : x.align === "right" ? "text-right" : "text-left", w = typeof x.className == "function" ? x.className(b?.[x.key], b, k) : x.className || "";
1505
- return /* @__PURE__ */ n(
1535
+ const N = x.align === "center" ? "text-center" : x.align === "right" ? "text-right" : "text-left", w = typeof x.className == "function" ? x.className(f?.[x.key], f, k) : x.className || "";
1536
+ return /* @__PURE__ */ a(
1506
1537
  "td",
1507
1538
  {
1508
1539
  style: {
@@ -1510,21 +1541,21 @@ const Je = {
1510
1541
  minWidth: x.minWidth,
1511
1542
  maxWidth: x.maxWidth
1512
1543
  },
1513
- className: `${m.classes?.td || "py-3 px-4 text-sm align-middle"} ${v} ${w}`,
1514
- children: /* @__PURE__ */ n(hr, { row: b, column: x, rowIndex: k })
1544
+ className: `${m.classes?.td || "py-3 px-4 text-sm align-middle"} ${N} ${w}`,
1545
+ children: /* @__PURE__ */ a(kr, { row: f, column: x, rowIndex: k })
1515
1546
  },
1516
1547
  String(x.key)
1517
1548
  );
1518
1549
  }),
1519
- f && /* @__PURE__ */ n(
1550
+ b && /* @__PURE__ */ a(
1520
1551
  "td",
1521
1552
  {
1522
1553
  className: `${m.classes?.td || "py-3 px-4 text-sm align-middle"} text-right`,
1523
1554
  onClick: (x) => x.stopPropagation(),
1524
- children: /* @__PURE__ */ n(
1525
- xr,
1555
+ children: /* @__PURE__ */ a(
1556
+ Nr,
1526
1557
  {
1527
- row: b,
1558
+ row: f,
1528
1559
  actions: s || [],
1529
1560
  context: o
1530
1561
  }
@@ -1536,7 +1567,7 @@ const Je = {
1536
1567
  String(C)
1537
1568
  );
1538
1569
  }) });
1539
- }, wr = ({
1570
+ }, Ar = ({
1540
1571
  page: e,
1541
1572
  pageSize: t,
1542
1573
  totalRecords: s,
@@ -1548,78 +1579,78 @@ const Je = {
1548
1579
  showTotalCount: c = !0,
1549
1580
  pageWindow: d
1550
1581
  }) => {
1551
- const a = ee(), u = Math.min((e - 1) * t + 1, s), m = Math.min(e * t, s);
1552
- return /* @__PURE__ */ h(
1582
+ const n = ee(), u = Math.min((e - 1) * t + 1, s), m = Math.min(e * t, s);
1583
+ return /* @__PURE__ */ y(
1553
1584
  "div",
1554
1585
  {
1555
- className: a.classes?.paginationContainer || "w-full flex flex-wrap items-center justify-between gap-4 pt-4 text-sm text-gray-600 dark:text-gray-400",
1586
+ className: n.classes?.paginationContainer || "w-full flex flex-wrap items-center justify-between gap-4 pt-4 text-sm text-gray-600 dark:text-gray-400",
1556
1587
  children: [
1557
- /* @__PURE__ */ h("div", { className: "flex items-center gap-3", children: [
1558
- c && s > 0 ? /* @__PURE__ */ h("span", { className: "text-xs sm:text-sm font-medium", children: [
1588
+ /* @__PURE__ */ y("div", { className: "flex items-center gap-3", children: [
1589
+ c && s > 0 ? /* @__PURE__ */ y("span", { className: "text-xs sm:text-sm font-medium", children: [
1559
1590
  "Showing ",
1560
- /* @__PURE__ */ n("strong", { className: "text-gray-900 dark:text-white font-bold", children: u }),
1591
+ /* @__PURE__ */ a("strong", { className: "text-gray-900 dark:text-white font-bold", children: u }),
1561
1592
  " to",
1562
1593
  " ",
1563
- /* @__PURE__ */ n("strong", { className: "text-gray-900 dark:text-white font-bold", children: m }),
1594
+ /* @__PURE__ */ a("strong", { className: "text-gray-900 dark:text-white font-bold", children: m }),
1564
1595
  " of",
1565
1596
  " ",
1566
- /* @__PURE__ */ n("strong", { className: "text-gray-900 dark:text-white font-bold", children: s.toLocaleString() }),
1597
+ /* @__PURE__ */ a("strong", { className: "text-gray-900 dark:text-white font-bold", children: s.toLocaleString() }),
1567
1598
  " results"
1568
- ] }) : /* @__PURE__ */ h("span", { className: "text-xs sm:text-sm font-medium", children: [
1599
+ ] }) : /* @__PURE__ */ y("span", { className: "text-xs sm:text-sm font-medium", children: [
1569
1600
  "Page ",
1570
1601
  e,
1571
1602
  " of ",
1572
1603
  o
1573
1604
  ] }),
1574
- g && /* @__PURE__ */ h("div", { className: "flex items-center gap-2 ml-2", children: [
1575
- /* @__PURE__ */ n("span", { className: "text-xs text-gray-500 hidden sm:inline", children: "Rows:" }),
1576
- /* @__PURE__ */ n(
1605
+ g && /* @__PURE__ */ y("div", { className: "flex items-center gap-2 ml-2", children: [
1606
+ /* @__PURE__ */ a("span", { className: "text-xs text-gray-500 hidden sm:inline", children: "Rows:" }),
1607
+ /* @__PURE__ */ a(
1577
1608
  "select",
1578
1609
  {
1579
1610
  value: t,
1580
- onChange: (f) => i(Number(f.target.value)),
1581
- className: a.classes?.paginationSelect || "h-8 px-2.5 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-xs font-semibold text-gray-800 dark:text-gray-200 focus:outline-none focus:border-primary cursor-pointer",
1582
- children: l.map((f) => /* @__PURE__ */ h("option", { value: f, className: "bg-white dark:bg-slate-800 text-gray-900 dark:text-white", children: [
1583
- f,
1611
+ onChange: (b) => i(Number(b.target.value)),
1612
+ className: n.classes?.paginationSelect || "h-8 px-2.5 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-xs font-semibold text-gray-800 dark:text-gray-200 focus:outline-none focus:border-primary cursor-pointer",
1613
+ children: l.map((b) => /* @__PURE__ */ y("option", { value: b, className: "bg-white dark:bg-slate-800 text-gray-900 dark:text-white", children: [
1614
+ b,
1584
1615
  " / page"
1585
- ] }, f))
1616
+ ] }, b))
1586
1617
  }
1587
1618
  )
1588
1619
  ] })
1589
1620
  ] }),
1590
- /* @__PURE__ */ h("div", { className: "flex items-center gap-1.5 ml-auto", children: [
1591
- /* @__PURE__ */ n(
1621
+ /* @__PURE__ */ y("div", { className: "flex items-center gap-1.5 ml-auto", children: [
1622
+ /* @__PURE__ */ a(
1592
1623
  "button",
1593
1624
  {
1594
1625
  type: "button",
1595
1626
  disabled: e <= 1,
1596
1627
  onClick: () => r(e - 1),
1597
1628
  "aria-label": "Previous Page",
1598
- className: `${a.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700 disabled:opacity-40"}`,
1629
+ className: `${n.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700 disabled:opacity-40"}`,
1599
1630
  children: "‹"
1600
1631
  }
1601
1632
  ),
1602
- d.map((f) => {
1603
- const b = f === e;
1604
- return /* @__PURE__ */ n(
1633
+ d.map((b) => {
1634
+ const f = b === e;
1635
+ return /* @__PURE__ */ a(
1605
1636
  "button",
1606
1637
  {
1607
1638
  type: "button",
1608
- onClick: () => r(f),
1609
- className: `${a.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs"} ${b ? a.classes?.paginationButtonActive || "bg-primary text-white shadow-sm shadow-primary/30" : "bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700"}`,
1610
- children: f
1639
+ onClick: () => r(b),
1640
+ className: `${n.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs"} ${f ? n.classes?.paginationButtonActive || "bg-primary text-white shadow-sm shadow-primary/30" : "bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700"}`,
1641
+ children: b
1611
1642
  },
1612
- f
1643
+ b
1613
1644
  );
1614
1645
  }),
1615
- /* @__PURE__ */ n(
1646
+ /* @__PURE__ */ a(
1616
1647
  "button",
1617
1648
  {
1618
1649
  type: "button",
1619
1650
  disabled: e >= o,
1620
1651
  onClick: () => r(e + 1),
1621
1652
  "aria-label": "Next Page",
1622
- className: `${a.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700 disabled:opacity-40"}`,
1653
+ className: `${n.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs bg-gray-100 dark:bg-slate-800 text-gray-700 dark:text-gray-300 hover:bg-gray-200 dark:hover:bg-slate-700 disabled:opacity-40"}`,
1623
1654
  children: "›"
1624
1655
  }
1625
1656
  )
@@ -1627,12 +1658,12 @@ const Je = {
1627
1658
  ]
1628
1659
  }
1629
1660
  );
1630
- }, vr = ({
1661
+ }, Cr = ({
1631
1662
  columnsCount: e = 5,
1632
1663
  rowsCount: t = 5,
1633
1664
  hasActions: s = !0
1634
- }) => /* @__PURE__ */ n("tbody", { className: "divide-y divide-gray-100 dark:divide-gray-800/60 bg-white dark:bg-slate-900", children: Array.from({ length: t }).map((o, l) => /* @__PURE__ */ h("tr", { className: "any-table-pulse", children: [
1635
- Array.from({ length: e }).map((r, i) => /* @__PURE__ */ n("td", { className: "py-4 px-4 align-middle", children: /* @__PURE__ */ n(
1665
+ }) => /* @__PURE__ */ a("tbody", { className: "divide-y divide-gray-100 dark:divide-gray-800/60 bg-white dark:bg-slate-900", children: Array.from({ length: t }).map((o, l) => /* @__PURE__ */ y("tr", { className: "any-table-pulse", children: [
1666
+ Array.from({ length: e }).map((r, i) => /* @__PURE__ */ a("td", { className: "py-4 px-4 align-middle", children: /* @__PURE__ */ a(
1636
1667
  "div",
1637
1668
  {
1638
1669
  className: "h-4 bg-gray-200 dark:bg-slate-700/60 rounded-md",
@@ -1641,20 +1672,20 @@ const Je = {
1641
1672
  }
1642
1673
  }
1643
1674
  ) }, i)),
1644
- s && /* @__PURE__ */ n("td", { className: "py-4 px-4 text-right align-middle pr-6", children: /* @__PURE__ */ h("div", { className: "inline-flex gap-2 justify-end", children: [
1645
- /* @__PURE__ */ n("div", { className: "w-14 h-7 bg-gray-200 dark:bg-slate-700/60 rounded-xl" }),
1646
- /* @__PURE__ */ n("div", { className: "w-14 h-7 bg-gray-200 dark:bg-slate-700/60 rounded-xl" })
1675
+ s && /* @__PURE__ */ a("td", { className: "py-4 px-4 text-right align-middle pr-6", children: /* @__PURE__ */ y("div", { className: "inline-flex gap-2 justify-end", children: [
1676
+ /* @__PURE__ */ a("div", { className: "w-14 h-7 bg-gray-200 dark:bg-slate-700/60 rounded-xl" }),
1677
+ /* @__PURE__ */ a("div", { className: "w-14 h-7 bg-gray-200 dark:bg-slate-700/60 rounded-xl" })
1647
1678
  ] }) })
1648
- ] }, l)) }), Nr = ({
1679
+ ] }, l)) }), Sr = ({
1649
1680
  title: e,
1650
1681
  description: t,
1651
1682
  isSearchActive: s = !1,
1652
1683
  onClearSearch: o
1653
- }) => /* @__PURE__ */ h("div", { className: "w-full py-16 px-6 flex flex-col items-center justify-center text-center any-table-fade-in", children: [
1654
- /* @__PURE__ */ n("div", { className: "w-16 h-16 mb-4 rounded-2xl bg-gray-100 dark:bg-slate-800 text-gray-400 dark:text-gray-500 flex items-center justify-center text-3xl shadow-inner", children: s ? "🔍" : "📂" }),
1655
- /* @__PURE__ */ n("h3", { className: "text-lg font-bold text-gray-800 dark:text-gray-200 mb-1", children: e || (s ? "No matching records found" : "No data available") }),
1656
- /* @__PURE__ */ n("p", { className: "text-sm text-gray-500 dark:text-gray-400 max-w-sm mb-5 leading-relaxed", children: t || (s ? "Try adjusting your search criteria or clear the search filter." : "There are currently no records to display.") }),
1657
- s && o && /* @__PURE__ */ n(
1684
+ }) => /* @__PURE__ */ y("div", { className: "w-full py-16 px-6 flex flex-col items-center justify-center text-center any-table-fade-in", children: [
1685
+ /* @__PURE__ */ a("div", { className: "w-16 h-16 mb-4 rounded-2xl bg-gray-100 dark:bg-slate-800 text-gray-400 dark:text-gray-500 flex items-center justify-center text-3xl shadow-inner", children: s ? "🔍" : "📂" }),
1686
+ /* @__PURE__ */ a("h3", { className: "text-lg font-bold text-gray-800 dark:text-gray-200 mb-1", children: e || (s ? "No matching records found" : "No data available") }),
1687
+ /* @__PURE__ */ a("p", { className: "text-sm text-gray-500 dark:text-gray-400 max-w-sm mb-5 leading-relaxed", children: t || (s ? "Try adjusting your search criteria or clear the search filter." : "There are currently no records to display.") }),
1688
+ s && o && /* @__PURE__ */ a(
1658
1689
  "button",
1659
1690
  {
1660
1691
  type: "button",
@@ -1663,21 +1694,21 @@ const Je = {
1663
1694
  children: "Clear Search Filter"
1664
1695
  }
1665
1696
  )
1666
- ] }), Ar = ({ error: e, onRetry: t }) => {
1697
+ ] }), Tr = ({ error: e, onRetry: t }) => {
1667
1698
  const s = typeof e == "string" ? e : e?.message || e?.response?.data?.message || "Failed to load table data.";
1668
- return /* @__PURE__ */ h("div", { className: "w-full py-14 px-6 flex flex-col items-center justify-center text-center any-table-fade-in", children: [
1669
- /* @__PURE__ */ n("div", { className: "w-14 h-14 mb-4 rounded-2xl bg-rose-500/10 text-rose-500 flex items-center justify-center text-2xl border border-rose-500/20", children: "⚠️" }),
1670
- /* @__PURE__ */ n("h3", { className: "text-lg font-bold text-gray-800 dark:text-gray-200 mb-1", children: "Unable to load data" }),
1671
- /* @__PURE__ */ n("p", { className: "text-xs sm:text-sm text-rose-600 dark:text-rose-400 font-medium max-w-md mb-5 leading-relaxed bg-rose-500/5 px-3 py-1.5 rounded-lg border border-rose-500/10", children: s }),
1672
- t && /* @__PURE__ */ h(
1699
+ return /* @__PURE__ */ y("div", { className: "w-full py-14 px-6 flex flex-col items-center justify-center text-center any-table-fade-in", children: [
1700
+ /* @__PURE__ */ a("div", { className: "w-14 h-14 mb-4 rounded-2xl bg-rose-500/10 text-rose-500 flex items-center justify-center text-2xl border border-rose-500/20", children: "⚠️" }),
1701
+ /* @__PURE__ */ a("h3", { className: "text-lg font-bold text-gray-800 dark:text-gray-200 mb-1", children: "Unable to load data" }),
1702
+ /* @__PURE__ */ a("p", { className: "text-xs sm:text-sm text-rose-600 dark:text-rose-400 font-medium max-w-md mb-5 leading-relaxed bg-rose-500/5 px-3 py-1.5 rounded-lg border border-rose-500/10", children: s }),
1703
+ t && /* @__PURE__ */ y(
1673
1704
  "button",
1674
1705
  {
1675
1706
  type: "button",
1676
1707
  onClick: t,
1677
1708
  className: "inline-flex items-center gap-2 px-4 py-2 rounded-xl bg-gray-900 dark:bg-white text-white dark:text-gray-900 text-xs font-bold hover:bg-gray-800 dark:hover:bg-gray-100 transition-all shadow-md active:scale-95",
1678
1709
  children: [
1679
- /* @__PURE__ */ n("span", { children: "🔄" }),
1680
- /* @__PURE__ */ n("span", { children: "Retry Request" })
1710
+ /* @__PURE__ */ a("span", { children: "🔄" }),
1711
+ /* @__PURE__ */ a("span", { children: "Retry Request" })
1681
1712
  ]
1682
1713
  }
1683
1714
  )
@@ -1694,24 +1725,24 @@ function qe(e) {
1694
1725
  subtitle: g,
1695
1726
  actions: c,
1696
1727
  actionsTitle: d = "Actions",
1697
- actionsWidth: a,
1728
+ actionsWidth: n,
1698
1729
  search: u = !0,
1699
1730
  sorting: m = !0,
1700
- pagination: f = !0,
1701
- selectable: b = !1,
1731
+ pagination: b = !0,
1732
+ selectable: f = !1,
1702
1733
  onSelectionChange: k,
1703
1734
  onRowClick: C,
1704
- loading: $,
1705
- loadingComponent: F,
1735
+ loading: D,
1736
+ loadingComponent: _,
1706
1737
  emptyComponent: x,
1707
- emptyTitle: v,
1738
+ emptyTitle: N,
1708
1739
  emptyDescription: w,
1709
- errorComponent: z,
1740
+ errorComponent: R,
1710
1741
  className: H = "",
1711
- tableClassName: R = "",
1742
+ tableClassName: L = "",
1712
1743
  headerClassName: ye = "",
1713
- rowClassName: _,
1714
- headerActions: j,
1744
+ rowClassName: j,
1745
+ headerActions: F,
1715
1746
  showHeader: U = !0,
1716
1747
  bordered: te = !0,
1717
1748
  striped: V = !1,
@@ -1727,41 +1758,41 @@ function qe(e) {
1727
1758
  add: Be,
1728
1759
  linkAdd: $e,
1729
1760
  addHandler: De,
1730
- view: Fe,
1761
+ view: Me,
1731
1762
  linkView: re,
1732
1763
  viewHandler: ae,
1733
- edit: Me,
1764
+ edit: _e,
1734
1765
  linkEdit: ne,
1735
1766
  editHandler: se,
1736
- del: _e,
1767
+ del: je,
1737
1768
  handleDelete: he,
1738
- block: je,
1769
+ block: Fe,
1739
1770
  handleBlock: pe,
1740
1771
  buttons: oe
1741
- } = e, N = ee(), ie = W(() => t || Ee || void 0, [t, Ee]), G = W(() => Ut({
1772
+ } = e, v = ee(), ie = W(() => t || Ee || void 0, [t, Ee]), G = W(() => Ut({
1742
1773
  data: ie,
1743
1774
  columns: o,
1744
1775
  autoColumns: l,
1745
1776
  thead: I,
1746
1777
  headerData: Pe
1747
- }).filter((y) => typeof y.hidden == "function" ? !y.hidden({ data: ie || [] }) : !y.hidden), [ie, o, l, I, Pe]), O = A(
1748
- (p, y) => {
1778
+ }).filter((h) => typeof h.hidden == "function" ? !h.hidden({ data: ie || [] }) : !h.hidden), [ie, o, l, I, Pe]), O = A(
1779
+ (p, h) => {
1749
1780
  if (typeof r == "function")
1750
- return r(p, y);
1781
+ return r(p, h);
1751
1782
  if (typeof r == "string") {
1752
- const D = P(p, r);
1753
- if (D != null) return D;
1783
+ const M = P(p, r);
1784
+ if (M != null) return M;
1754
1785
  }
1755
1786
  const E = p?._id ?? p?.id ?? p?.key;
1756
- return E ?? y;
1787
+ return E ?? h;
1757
1788
  },
1758
1789
  [r]
1759
1790
  ), {
1760
1791
  enabled: We,
1761
- search: ze,
1762
- debouncedSearch: Le,
1792
+ search: Re,
1793
+ debouncedSearch: ze,
1763
1794
  isDebouncing: ot,
1764
- setSearch: Re,
1795
+ setSearch: Le,
1765
1796
  clearSearch: xe,
1766
1797
  searchConfig: it
1767
1798
  } = Kt({ config: u }), {
@@ -1773,38 +1804,38 @@ function qe(e) {
1773
1804
  resetSorting: gt
1774
1805
  } = It({ config: m }), Oe = W(() => {
1775
1806
  const p = [...c || []];
1776
- return oe && Array.isArray(oe) && oe.forEach((y, E) => {
1807
+ return oe && Array.isArray(oe) && oe.forEach((h, E) => {
1777
1808
  p.push({
1778
1809
  id: `legacy-btn-${E}`,
1779
- label: y.label,
1780
- icon: y.icon,
1781
- className: y.className,
1782
- show: y.show,
1783
- hide: y.hide,
1784
- onClick: (D) => y.onClick(D)
1810
+ label: h.label,
1811
+ icon: h.icon,
1812
+ className: h.className,
1813
+ show: h.show,
1814
+ hide: h.hide,
1815
+ onClick: (M) => h.onClick(M)
1785
1816
  });
1786
- }), je && pe && p.push({
1817
+ }), Fe && pe && p.push({
1787
1818
  id: "legacy-block",
1788
- label: (y) => y.isBanned || !y.isActive ? "Unblock" : "Block",
1789
- variant: (y) => y.isBanned || !y.isActive ? "success" : "danger",
1790
- onClick: (y) => pe(y?._id || y?.id)
1791
- }), Fe && (ae || re) && p.push({
1819
+ label: (h) => h.isBanned || !h.isActive ? "Unblock" : "Block",
1820
+ variant: (h) => h.isBanned || !h.isActive ? "success" : "danger",
1821
+ onClick: (h) => pe(h?._id || h?.id)
1822
+ }), Me && (ae || re) && p.push({
1792
1823
  id: "legacy-view",
1793
1824
  label: "View",
1794
1825
  variant: "primary",
1795
- onClick: (y) => {
1796
- const E = y?._id || y?.id;
1826
+ onClick: (h) => {
1827
+ const E = h?._id || h?.id;
1797
1828
  ae ? ae(E) : re && typeof window < "u" && (window.location.href = `${re}/${E}`);
1798
1829
  }
1799
- }), Me && (se || ne) && p.push({
1830
+ }), _e && (se || ne) && p.push({
1800
1831
  id: "legacy-edit",
1801
1832
  label: "Edit",
1802
1833
  variant: "info",
1803
- onClick: (y) => {
1804
- const E = y?._id || y?.id;
1834
+ onClick: (h) => {
1835
+ const E = h?._id || h?.id;
1805
1836
  se ? se(E) : ne && typeof window < "u" && (window.location.href = `${ne}/${E}`);
1806
1837
  }
1807
- }), _e && he && p.push({
1838
+ }), je && he && p.push({
1808
1839
  id: "legacy-del",
1809
1840
  label: "Delete",
1810
1841
  variant: "danger",
@@ -1812,24 +1843,24 @@ function qe(e) {
1812
1843
  title: "Delete Item",
1813
1844
  message: "Are you sure you want to delete this record?"
1814
1845
  },
1815
- onClick: (y) => he(y?._id || y?.id)
1846
+ onClick: (h) => he(h?._id || h?.id)
1816
1847
  }), p;
1817
1848
  }, [
1818
1849
  c,
1819
1850
  oe,
1820
- je,
1821
- pe,
1822
1851
  Fe,
1852
+ pe,
1853
+ Me,
1823
1854
  re,
1824
1855
  ae,
1825
- Me,
1856
+ _e,
1826
1857
  ne,
1827
1858
  se,
1828
- _e,
1859
+ je,
1829
1860
  he
1830
- ]), [mt, ut] = S(1), [ft, bt] = S(10), {
1861
+ ]), [mt, ut] = S(1), [bt, ft] = S(10), {
1831
1862
  rows: T,
1832
- totalRecords: ve,
1863
+ totalRecords: Ne,
1833
1864
  loading: le,
1834
1865
  error: J,
1835
1866
  refresh: q,
@@ -1838,16 +1869,16 @@ function qe(e) {
1838
1869
  data: ie,
1839
1870
  api: s,
1840
1871
  columns: G,
1841
- searchQuery: Le,
1872
+ searchQuery: ze,
1842
1873
  sortBy: ke,
1843
1874
  sortOrder: we,
1844
1875
  page: mt,
1845
- pageSize: ft,
1846
- manualLoading: $
1876
+ pageSize: bt,
1877
+ manualLoading: D
1847
1878
  }), {
1848
1879
  enabled: ht,
1849
1880
  page: de,
1850
- pageSize: Ne,
1881
+ pageSize: ve,
1851
1882
  totalPages: He,
1852
1883
  pageSizeOptions: pt,
1853
1884
  setPage: ce,
@@ -1856,41 +1887,41 @@ function qe(e) {
1856
1887
  getPageWindow: kt,
1857
1888
  paginationConfig: Ke
1858
1889
  } = Gt({
1859
- config: f,
1860
- totalRecords: ve,
1861
- onPageChange: (p, y) => {
1862
- ut(p), bt(y);
1890
+ config: b,
1891
+ totalRecords: Ne,
1892
+ onPageChange: (p, h) => {
1893
+ ut(p), ft(h);
1863
1894
  }
1864
- }), [L, ge] = S(/* @__PURE__ */ new Set()), wt = A(
1865
- (p, y) => {
1895
+ }), [z, ge] = S(/* @__PURE__ */ new Set()), wt = A(
1896
+ (p, h) => {
1866
1897
  ge((E) => {
1867
- const D = new Set(E);
1868
- if (D.has(p) ? D.delete(p) : D.add(p), k) {
1869
- const Pt = T.filter((Et, Bt) => D.has(O(Et, Bt)));
1870
- k(Pt, Array.from(D));
1898
+ const M = new Set(E);
1899
+ if (M.has(p) ? M.delete(p) : M.add(p), k) {
1900
+ const Pt = T.filter((Et, Bt) => M.has(O(Et, Bt)));
1901
+ k(Pt, Array.from(M));
1871
1902
  }
1872
- return D;
1903
+ return M;
1873
1904
  });
1874
1905
  },
1875
1906
  [T, O, k]
1876
- ), vt = A(() => {
1877
- if (L.size === T.length && T.length > 0)
1907
+ ), Nt = A(() => {
1908
+ if (z.size === T.length && T.length > 0)
1878
1909
  ge(/* @__PURE__ */ new Set()), k?.([], []);
1879
1910
  else {
1880
- const p = new Set(T.map((y, E) => O(y, E)));
1911
+ const p = new Set(T.map((h, E) => O(h, E)));
1881
1912
  ge(p), k?.(T, Array.from(p));
1882
1913
  }
1883
- }, [T, L.size, O, k]), Nt = A(() => {
1914
+ }, [T, z.size, O, k]), vt = A(() => {
1884
1915
  ge(/* @__PURE__ */ new Set()), k?.([], []);
1885
- }, [k]), At = T.length > 0 && L.size === T.length, Ct = L.size > 0 && L.size < T.length, Ae = W(
1916
+ }, [k]), At = T.length > 0 && z.size === T.length, Ct = z.size > 0 && z.size < T.length, Ae = W(
1886
1917
  () => ({
1887
1918
  refresh: q,
1888
1919
  loading: le,
1889
1920
  page: de,
1890
- selectedRows: T.filter((p, y) => L.has(O(p, y))),
1921
+ selectedRows: T.filter((p, h) => z.has(O(p, h))),
1891
1922
  setPage: ce
1892
1923
  }),
1893
- [q, le, de, T, L, O, ce]
1924
+ [q, le, de, T, z, O, ce]
1894
1925
  );
1895
1926
  rr({
1896
1927
  tableRef: B,
@@ -1900,54 +1931,54 @@ function qe(e) {
1900
1931
  resetSorting: gt,
1901
1932
  setPage: ce,
1902
1933
  setPageSize: Ue,
1903
- setSearch: Re,
1934
+ setSearch: Le,
1904
1935
  setSorting: ct,
1905
1936
  selectedRows: Ae.selectedRows,
1906
- clearSelection: Nt,
1937
+ clearSelection: vt,
1907
1938
  getState: () => ({
1908
1939
  data: T,
1909
1940
  loading: le,
1910
1941
  error: J,
1911
1942
  page: de,
1912
- pageSize: Ne,
1913
- total: ve,
1943
+ pageSize: ve,
1944
+ total: Ne,
1914
1945
  totalPages: He,
1915
- search: ze,
1946
+ search: Re,
1916
1947
  sortBy: ke,
1917
1948
  sortOrder: we,
1918
- selectedRowKeys: Array.from(L),
1949
+ selectedRowKeys: Array.from(z),
1919
1950
  selectedRows: Ae.selectedRows,
1920
1951
  isServerMode: yt
1921
1952
  })
1922
1953
  });
1923
- const X = i || st, me = Oe.length > 0, St = !!(X || g || We || j || Be), Tt = W(() => {
1954
+ const X = i || st, me = Oe.length > 0, St = !!(X || g || We || F || Be), Tt = W(() => {
1924
1955
  const p = {};
1925
- return N.borderRadius && (p["--any-table-radius"] = N.borderRadius), N.fontFamily && (p["--any-table-font"] = N.fontFamily, p.fontFamily = N.fontFamily), N.colors?.primary && (p["--any-table-primary"] = N.colors.primary), N.colors?.primaryHover && (p["--any-table-primary-hover"] = N.colors.primaryHover), N.colors?.border && (p["--any-table-border"] = N.colors.border), p;
1926
- }, [N]);
1927
- return /* @__PURE__ */ h(
1956
+ return v.borderRadius && (p["--any-table-radius"] = v.borderRadius), v.fontFamily && (p["--any-table-font"] = v.fontFamily, p.fontFamily = v.fontFamily), v.colors?.primary && (p["--any-table-primary"] = v.colors.primary), v.colors?.primaryHover && (p["--any-table-primary-hover"] = v.colors.primaryHover), v.colors?.border && (p["--any-table-border"] = v.colors.border), p;
1957
+ }, [v]);
1958
+ return /* @__PURE__ */ y(
1928
1959
  "div",
1929
1960
  {
1930
1961
  style: Tt,
1931
- className: `any-table-wrapper ${N.classes?.container || "w-full flex flex-col gap-4 font-sans text-gray-900 dark:text-gray-100"} ${H}`,
1962
+ className: `any-table-wrapper ${v.classes?.container || "w-full flex flex-col gap-4 font-sans text-gray-900 dark:text-gray-100"} ${H}`,
1932
1963
  children: [
1933
- St && /* @__PURE__ */ h("div", { className: "w-full flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-1", children: [
1934
- (X || g) && /* @__PURE__ */ h("div", { className: "flex flex-col", children: [
1935
- X && /* @__PURE__ */ n("h3", { className: "text-lg font-bold tracking-tight text-gray-900 dark:text-white flex items-center gap-2", children: X }),
1936
- g && /* @__PURE__ */ n("p", { className: "text-xs text-gray-500 dark:text-gray-400 mt-0.5", children: g })
1964
+ St && /* @__PURE__ */ y("div", { className: "w-full flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-1", children: [
1965
+ (X || g) && /* @__PURE__ */ y("div", { className: "flex flex-col", children: [
1966
+ X && /* @__PURE__ */ a("h3", { className: "text-lg font-bold tracking-tight text-gray-900 dark:text-white flex items-center gap-2", children: X }),
1967
+ g && /* @__PURE__ */ a("p", { className: "text-xs text-gray-500 dark:text-gray-400 mt-0.5", children: g })
1937
1968
  ] }),
1938
- /* @__PURE__ */ h("div", { className: "flex flex-wrap items-center gap-3 w-full sm:w-auto justify-start sm:justify-end ml-auto", children: [
1939
- We && /* @__PURE__ */ n(
1969
+ /* @__PURE__ */ y("div", { className: "flex flex-wrap items-center gap-3 w-full sm:w-auto justify-start sm:justify-end ml-auto", children: [
1970
+ We && /* @__PURE__ */ a(
1940
1971
  nr,
1941
1972
  {
1942
- value: ze,
1943
- onChange: Re,
1973
+ value: Re,
1974
+ onChange: Le,
1944
1975
  onClear: xe,
1945
1976
  isDebouncing: ot,
1946
1977
  placeholder: it.placeholder
1947
1978
  }
1948
1979
  ),
1949
- j,
1950
- Be && /* @__PURE__ */ h(
1980
+ F,
1981
+ Be && /* @__PURE__ */ y(
1951
1982
  "button",
1952
1983
  {
1953
1984
  type: "button",
@@ -1956,8 +1987,8 @@ function qe(e) {
1956
1987
  },
1957
1988
  className: "inline-flex items-center gap-2 px-4 py-2.5 rounded-xl bg-primary text-white text-xs sm:text-sm font-bold hover:bg-primary-soft transition-all shadow-sm shadow-primary/20 active:scale-95 whitespace-nowrap",
1958
1989
  children: [
1959
- /* @__PURE__ */ n("span", { children: "+" }),
1960
- /* @__PURE__ */ h("span", { children: [
1990
+ /* @__PURE__ */ a("span", { children: "+" }),
1991
+ /* @__PURE__ */ y("span", { children: [
1961
1992
  "Add ",
1962
1993
  X || "Record"
1963
1994
  ] })
@@ -1966,53 +1997,53 @@ function qe(e) {
1966
1997
  )
1967
1998
  ] })
1968
1999
  ] }),
1969
- /* @__PURE__ */ n(
2000
+ /* @__PURE__ */ a(
1970
2001
  "div",
1971
2002
  {
1972
- style: N.borderRadius ? { borderRadius: N.borderRadius } : void 0,
1973
- className: `${N.classes?.tableWrapper || "w-full overflow-x-auto rounded-2xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-slate-900 shadow-sm transition-colors"} ${te ? "border border-gray-200 dark:border-gray-800" : "border-0 shadow-none"}`,
1974
- children: J ? typeof z == "function" ? z(J, q) : z || /* @__PURE__ */ n(Ar, { error: J, onRetry: q }) : /* @__PURE__ */ h(
2003
+ style: v.borderRadius ? { borderRadius: v.borderRadius } : void 0,
2004
+ className: `${v.classes?.tableWrapper || "w-full overflow-x-auto rounded-2xl border border-gray-200 dark:border-gray-800 bg-white dark:bg-slate-900 shadow-sm transition-colors"} ${te ? "border border-gray-200 dark:border-gray-800" : "border-0 shadow-none"}`,
2005
+ children: J ? typeof R == "function" ? R(J, q) : R || /* @__PURE__ */ a(Tr, { error: J, onRetry: q }) : /* @__PURE__ */ y(
1975
2006
  "table",
1976
2007
  {
1977
- className: `${N.classes?.table || "w-full border-collapse text-left text-sm"} ${K || N.density === "compact" ? "text-xs" : ""} ${Z ? "relative" : ""} ${R}`,
2008
+ className: `${v.classes?.table || "w-full border-collapse text-left text-sm"} ${K || v.density === "compact" ? "text-xs" : ""} ${Z ? "relative" : ""} ${L}`,
1978
2009
  children: [
1979
- U && /* @__PURE__ */ n(
2010
+ U && /* @__PURE__ */ a(
1980
2011
  sr,
1981
2012
  {
1982
2013
  columns: G,
1983
2014
  hasActions: me,
1984
2015
  actionsTitle: d,
1985
- actionsWidth: a,
2016
+ actionsWidth: n,
1986
2017
  sortBy: ke,
1987
2018
  sortOrder: we,
1988
2019
  onSort: lt ? dt : void 0,
1989
- selectable: b,
2020
+ selectable: f,
1990
2021
  allSelected: At,
1991
2022
  isIndeterminate: Ct,
1992
- onToggleSelectAll: vt,
2023
+ onToggleSelectAll: Nt,
1993
2024
  headerClassName: ye
1994
2025
  }
1995
2026
  ),
1996
- le && T.length === 0 ? F ? /* @__PURE__ */ n("tbody", { children: /* @__PURE__ */ n("tr", { children: /* @__PURE__ */ n("td", { colSpan: G.length + (b ? 1 : 0) + (me ? 1 : 0), children: F }) }) }) : /* @__PURE__ */ n(
1997
- vr,
2027
+ le && T.length === 0 ? _ ? /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a("td", { colSpan: G.length + (f ? 1 : 0) + (me ? 1 : 0), children: _ }) }) }) : /* @__PURE__ */ a(
2028
+ Cr,
1998
2029
  {
1999
- columnsCount: G.length + (b ? 1 : 0),
2000
- rowsCount: Ne || 5,
2030
+ columnsCount: G.length + (f ? 1 : 0),
2031
+ rowsCount: ve || 5,
2001
2032
  hasActions: me
2002
2033
  }
2003
2034
  ) : T.length === 0 ? (
2004
2035
  /* Empty State */
2005
- /* @__PURE__ */ n("tbody", { children: /* @__PURE__ */ n("tr", { children: /* @__PURE__ */ n(
2036
+ /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a(
2006
2037
  "td",
2007
2038
  {
2008
- colSpan: G.length + (b ? 1 : 0) + (me ? 1 : 0),
2039
+ colSpan: G.length + (f ? 1 : 0) + (me ? 1 : 0),
2009
2040
  className: "p-0",
2010
- children: x || /* @__PURE__ */ n(
2011
- Nr,
2041
+ children: x || /* @__PURE__ */ a(
2042
+ Sr,
2012
2043
  {
2013
- title: v,
2044
+ title: N,
2014
2045
  description: w,
2015
- isSearchActive: !!Le,
2046
+ isSearchActive: !!ze,
2016
2047
  onClearSearch: xe
2017
2048
  }
2018
2049
  )
@@ -2020,21 +2051,21 @@ function qe(e) {
2020
2051
  ) }) })
2021
2052
  ) : (
2022
2053
  /* Body Rows */
2023
- /* @__PURE__ */ n(
2024
- kr,
2054
+ /* @__PURE__ */ a(
2055
+ vr,
2025
2056
  {
2026
2057
  rows: T,
2027
2058
  columns: G,
2028
2059
  actions: Oe,
2029
2060
  actionContext: Ae,
2030
2061
  rowKeyResolver: O,
2031
- selectable: b,
2032
- selectedKeys: L,
2062
+ selectable: f,
2063
+ selectedKeys: z,
2033
2064
  onToggleSelectRow: wt,
2034
2065
  onRowClick: C,
2035
2066
  striped: V,
2036
2067
  hoverable: Y,
2037
- rowClassName: _
2068
+ rowClassName: j
2038
2069
  }
2039
2070
  )
2040
2071
  )
@@ -2043,12 +2074,12 @@ function qe(e) {
2043
2074
  )
2044
2075
  }
2045
2076
  ),
2046
- ht && !J && /* @__PURE__ */ n(
2047
- wr,
2077
+ ht && !J && /* @__PURE__ */ a(
2078
+ Ar,
2048
2079
  {
2049
2080
  page: de,
2050
- pageSize: Ne,
2051
- totalRecords: ve,
2081
+ pageSize: ve,
2082
+ totalRecords: Ne,
2052
2083
  totalPages: He,
2053
2084
  pageSizeOptions: pt,
2054
2085
  onPageChange: ce,
@@ -2062,48 +2093,51 @@ function qe(e) {
2062
2093
  }
2063
2094
  );
2064
2095
  }
2065
- function Tr(e) {
2066
- return !e.theme && !e.preset ? /* @__PURE__ */ n(qe, { ...e }) : /* @__PURE__ */ n(ar, { theme: e.theme, preset: e.preset, children: /* @__PURE__ */ n(qe, { ...e }) });
2096
+ function Br(e) {
2097
+ return !e.theme && !e.preset ? /* @__PURE__ */ a(qe, { ...e }) : /* @__PURE__ */ a(ar, { theme: e.theme, preset: e.preset, children: /* @__PURE__ */ a(qe, { ...e }) });
2067
2098
  }
2068
2099
  export {
2069
- xr as ActionRenderer,
2070
- Tr as AnyTable,
2100
+ Nr as ActionRenderer,
2101
+ Br as AnyTable,
2071
2102
  qe as AnyTableInner,
2072
2103
  ar as AnyTableThemeProvider,
2073
2104
  mr as ArrayRenderer,
2105
+ xr as BadgeRenderer,
2074
2106
  ir as BooleanRenderer,
2075
- hr as CellRenderer,
2076
- pr as ConfirmModal,
2107
+ kr as CellRenderer,
2108
+ wr as ConfirmModal,
2077
2109
  lr as CurrencyRenderer,
2078
2110
  tt as DEFAULT_THEME_COLORS,
2079
2111
  Ye as DateRenderer,
2080
- br as EmailRenderer,
2081
- M as FallbackPlaceholder,
2112
+ fr as EmailRenderer,
2113
+ $ as FallbackPlaceholder,
2082
2114
  dr as ImageRenderer,
2083
2115
  or as NumberRenderer,
2084
2116
  ur as ObjectRenderer,
2085
2117
  yr as PhoneRenderer,
2118
+ hr as ProgressRenderer,
2119
+ pr as RatingRenderer,
2086
2120
  gr as StatusRenderer,
2087
2121
  at as StringRenderer,
2088
2122
  Ve as TABLE_PRESETS,
2089
- kr as TableBody,
2090
- Nr as TableEmptyState,
2091
- Ar as TableErrorState,
2123
+ vr as TableBody,
2124
+ Sr as TableEmptyState,
2125
+ Tr as TableErrorState,
2092
2126
  sr as TableHeader,
2093
- wr as TablePagination,
2127
+ Ar as TablePagination,
2094
2128
  nr as TableSearch,
2095
- vr as TableSkeleton,
2096
- fr as UrlRenderer,
2097
- Tr as default,
2129
+ Cr as TableSkeleton,
2130
+ br as UrlRenderer,
2131
+ Br as default,
2098
2132
  rt as defaultAnyTableTheme,
2099
2133
  Q as extractPaginationMeta,
2100
2134
  Qt as filterRowsBySearch,
2101
2135
  Ot as generateAutoColumns,
2102
2136
  P as getNestedValue,
2103
- fe as inferColumnType,
2137
+ be as inferColumnType,
2104
2138
  Ie as isImageUrl,
2105
- Lt as isIsoDate,
2106
- Mt as isPlainObject,
2139
+ zt as isIsoDate,
2140
+ _t as isPlainObject,
2107
2141
  Xt as normalizeApiResponse,
2108
2142
  nt as renderActionIcon,
2109
2143
  Ut as resolveColumns,