@kareemelbalshe/any-table 1.0.0 → 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,135 +1,135 @@
1
- import { jsx as s, jsxs as b, Fragment as Se } from "react/jsx-runtime";
2
- import Nt, { useMemo as O, useState as v, useEffect as ye, useCallback as w, useRef as wt, useImperativeHandle as vt, createContext as At, useContext as Ct } from "react";
3
- function S(e, t, n = void 0) {
4
- if (e == null) return n;
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
+ function P(e, t, s = void 0) {
4
+ if (e == null) return s;
5
5
  if (!t || typeof t != "string") return e;
6
6
  if (t in e && e[t] !== void 0)
7
7
  return e[t];
8
8
  const l = t.replace(/\[(\w+)\]/g, ".$1").split(".");
9
- let a = e;
9
+ let r = e;
10
10
  for (let i = 0; i < l.length; i++) {
11
11
  const g = l[i];
12
- if (a == null)
13
- return n;
14
- a = a[g];
12
+ if (r == null)
13
+ return s;
14
+ r = r[g];
15
15
  }
16
- return a !== void 0 ? a : n;
16
+ return r !== void 0 ? r : s;
17
17
  }
18
- function St(e) {
18
+ function _t(e) {
19
19
  return e !== null && typeof e == "object" && !Array.isArray(e);
20
20
  }
21
- function fe(e) {
21
+ function ue(e) {
22
22
  if (!e || typeof e != "string") return "";
23
23
  let t = e.replace(/[._\-]+/g, " ");
24
- return t = t.replace(/([a-z])([A-Z])/g, "$1 $2"), t.split(" ").filter(Boolean).map((n) => {
25
- const o = n.toLowerCase();
26
- return n.length <= 3 && n === n.toUpperCase() ? n : o.charAt(0).toUpperCase() + o.slice(1);
24
+ return t = t.replace(/([a-z])([A-Z])/g, "$1 $2"), t.split(" ").filter(Boolean).map((s) => {
25
+ const o = s.toLowerCase();
26
+ return s.length <= 3 && s === s.toUpperCase() ? s : o.charAt(0).toUpperCase() + o.slice(1);
27
27
  }).join(" ");
28
28
  }
29
- const Tt = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".svg", ".bmp", ".avif"], Pt = ["image", "avatar", "photo", "logo", "picture", "thumbnail", "banner", "img", "icon"], Et = ["price", "spend", "cost", "amount", "total", "fee", "rate", "salary", "balance", "deposit", "commission", "charge"], $t = ["status", "state", "phase", "condition"];
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
30
  function be(e, t) {
31
- const n = e.toLowerCase();
32
- if (Pt.some((a) => n.includes(a)))
31
+ const s = e.toLowerCase();
32
+ if (Ft.some((r) => s.includes(r)))
33
33
  return "image";
34
- if (Et.some((a) => n.includes(a)))
34
+ if (Wt.some((r) => s.includes(r)))
35
35
  return "currency";
36
- if ($t.some((a) => n.includes(a)))
36
+ if (Rt.some((r) => s.includes(r)))
37
37
  return "status";
38
- const o = t.filter((a) => a != null && a !== "");
38
+ const o = t.filter((r) => r != null && r !== "");
39
39
  if (o.length === 0)
40
40
  return "string";
41
41
  const l = o[0];
42
- if (typeof l == "boolean" || n.startsWith("is") || n.startsWith("has"))
42
+ if (typeof l == "boolean" || s.startsWith("is") || s.startsWith("has"))
43
43
  return "boolean";
44
44
  if (Array.isArray(l))
45
45
  return "array";
46
46
  if (typeof l == "object")
47
- return l.url && typeof l.url == "string" && Re(l.url) ? "image" : "object";
47
+ return l.url && typeof l.url == "string" && Ie(l.url) ? "image" : "object";
48
48
  if (typeof l == "number")
49
49
  return "number";
50
50
  if (typeof l == "string") {
51
- const a = l.trim();
52
- if (Re(a))
51
+ const r = l.trim();
52
+ if (Ie(r))
53
53
  return "image";
54
- if ((Dt(a) || n.includes("date") || n.includes("at") || n.includes("time")) && !isNaN(Date.parse(a)))
55
- return a.includes("T") || a.includes(":") ? "datetime" : "date";
56
- if (a.includes("@") && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(a))
54
+ if ((zt(r) || s.includes("date") || s.includes("at") || s.includes("time")) && !isNaN(Date.parse(r)))
55
+ return r.includes("T") || r.includes(":") ? "datetime" : "date";
56
+ if (r.includes("@") && /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(r))
57
57
  return "email";
58
- if (a.startsWith("http://") || a.startsWith("https://"))
58
+ if (r.startsWith("http://") || r.startsWith("https://"))
59
59
  return "url";
60
- if (n.includes("phone") || n.includes("mobile") || n.includes("tel"))
60
+ if (s.includes("phone") || s.includes("mobile") || s.includes("tel"))
61
61
  return "phone";
62
62
  }
63
63
  return "string";
64
64
  }
65
- function Re(e) {
65
+ 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 Tt.some((n) => t.endsWith(n));
69
+ return jt.some((s) => t.endsWith(s));
70
70
  }
71
- function Dt(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 Mt = ["__v", "password", "token", "refreshToken", "secret", "hash", "salt"];
75
- function _t(e, t = Mt, n = 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);
79
- for (const a of l)
80
- !a || typeof a != "object" || Ve(a, "", o, l, t, 0, n);
79
+ for (const r of l)
80
+ !r || typeof r != "object" || et(r, "", o, l, t, 0, s);
81
81
  return Array.from(o.values());
82
82
  }
83
- function Ve(e, t, n, o, l, a, i) {
84
- if (!(!e || typeof e != "object" || a > i))
83
+ function et(e, t, s, o, l, r, i) {
84
+ if (!(!e || typeof e != "object" || 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 (St(d) && !Bt(d) && a < i) {
89
- Ve(d, c, n, o, l, a + 1, i);
88
+ if (_t(d) && !Ht(d) && r < i) {
89
+ et(d, c, s, o, l, r + 1, i);
90
90
  continue;
91
91
  }
92
- if (!n.has(c)) {
93
- const r = o.map((u) => S(u, c)), m = be(c, r);
94
- n.set(c, {
92
+ if (!s.has(c)) {
93
+ const n = o.map((m) => P(m, c)), u = be(c, n);
94
+ s.set(c, {
95
95
  key: c,
96
- title: fe(c),
97
- type: m,
96
+ title: ue(c),
97
+ type: u,
98
98
  sortable: !0,
99
99
  searchable: !0,
100
- align: m === "number" || m === "currency" ? "right" : "left"
100
+ align: u === "number" || u === "currency" ? "right" : "left"
101
101
  });
102
102
  }
103
103
  }
104
104
  }
105
- function Bt(e, t) {
105
+ function Ht(e, t) {
106
106
  return "en" in e && "ar" in e && Object.keys(e).length <= 3 ? !1 : "url" in e && typeof e.url == "string" || "coordinates" in e || "lat" in e && "lng" in e;
107
107
  }
108
- function jt(e) {
109
- const { data: t = [], columns: n, autoColumns: o = !0, thead: l, headerData: a } = e;
110
- return a && Array.isArray(a) && a.length > 0 ? a.map((i, g) => {
111
- const c = l && l[g] ? l[g] : fe(i), d = t.map((m) => m?.[i]), r = be(i, d);
108
+ function Ut(e) {
109
+ const { data: t = [], columns: s, autoColumns: o = !0, thead: l, headerData: r } = e;
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]), n = be(i, d);
112
112
  return {
113
113
  key: i,
114
114
  title: c,
115
- type: r,
115
+ type: n,
116
116
  sortable: !0,
117
117
  searchable: !0,
118
- align: r === "number" || r === "currency" ? "right" : "left"
118
+ align: n === "number" || n === "currency" ? "right" : "left"
119
119
  };
120
- }) : n && Array.isArray(n) && n.length > 0 ? n.map((i) => {
120
+ }) : s && Array.isArray(s) && s.length > 0 ? s.map((i) => {
121
121
  if (typeof i == "string") {
122
- const r = t.map((u) => u?.[i]), m = be(i, r);
122
+ const n = t.map((m) => m?.[i]), u = be(i, n);
123
123
  return {
124
124
  key: i,
125
- title: fe(i),
126
- type: m,
125
+ title: ue(i),
126
+ type: u,
127
127
  sortable: !0,
128
128
  searchable: !0,
129
- align: m === "number" || m === "currency" ? "right" : "left"
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 : fe(g), d = i.type || be(g, t.map((r) => r?.[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,
@@ -138,140 +138,140 @@ function jt(e) {
138
138
  searchable: i.searchable !== void 0 ? i.searchable : !0,
139
139
  align: i.align || (d === "number" || d === "currency" ? "right" : "left")
140
140
  };
141
- }) : o && t && t.length > 0 ? _t(t) : [];
141
+ }) : o && t && t.length > 0 ? Ot(t) : [];
142
142
  }
143
- function zt({
143
+ function Kt({
144
144
  config: e,
145
145
  onSearchChange: t
146
146
  }) {
147
- const n = O(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), o = n.enabled !== !1 && !!e, l = n.debounce ?? 350, [a, i] = v(""), [g, c] = v(""), [d, r] = v(!1);
148
- ye(() => {
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
- if (a === "") {
151
- c(""), r(!1), t?.("");
150
+ if (r === "") {
151
+ c(""), n(!1), t?.("");
152
152
  return;
153
153
  }
154
- r(!0);
155
- const f = setTimeout(() => {
156
- c(a), r(!1), t?.(a);
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
- }, [a, l, o, t]);
162
- const m = w((f) => {
163
- i(f);
164
- }, []), u = w(() => {
165
- i(""), c(""), r(!1), t?.("");
161
+ }, [r, l, o, t]);
162
+ const u = A((b) => {
163
+ i(b);
164
+ }, []), m = A(() => {
165
+ i(""), c(""), n(!1), t?.("");
166
166
  }, [t]);
167
167
  return {
168
168
  enabled: o,
169
- search: a,
169
+ search: r,
170
170
  debouncedSearch: g,
171
171
  isDebouncing: d,
172
- setSearch: m,
173
- clearSearch: u,
174
- searchConfig: n
172
+ setSearch: u,
173
+ clearSearch: m,
174
+ searchConfig: s
175
175
  };
176
176
  }
177
- function Lt({
177
+ function It({
178
178
  config: e,
179
179
  onSortChange: t
180
180
  }) {
181
- const n = O(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), o = n.enabled !== !1 && !!e, l = n.allowUnsort ?? !0, [a, i] = v(
182
- n.defaultSortBy || null
183
- ), [g, c] = v(
184
- n.defaultSortOrder || null
185
- ), d = w(
186
- (u) => {
181
+ const s = W(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), o = s.enabled !== !1 && !!e, l = s.allowUnsort ?? !0, [r, i] = S(
182
+ s.defaultSortBy || null
183
+ ), [g, c] = S(
184
+ s.defaultSortOrder || null
185
+ ), d = A(
186
+ (m) => {
187
187
  if (o) {
188
- if (a !== u) {
189
- i(u), c("asc"), t?.(u, "asc");
188
+ if (r !== m) {
189
+ i(m), c("asc"), t?.(m, "asc");
190
190
  return;
191
191
  }
192
- g === "asc" ? (c("desc"), t?.(u, "desc")) : g === "desc" && l ? (i(null), c(null), t?.(null, null)) : (c("asc"), t?.(u, "asc"));
192
+ g === "asc" ? (c("desc"), t?.(m, "desc")) : g === "desc" && l ? (i(null), c(null), t?.(null, null)) : (c("asc"), t?.(m, "asc"));
193
193
  }
194
194
  },
195
- [o, a, g, l, t]
196
- ), r = w(
197
- (u, f) => {
198
- i(u), c(f), t?.(u, f);
195
+ [o, r, g, l, t]
196
+ ), n = A(
197
+ (m, b) => {
198
+ i(m), c(b), t?.(m, b);
199
199
  },
200
200
  [t]
201
- ), m = w(() => {
201
+ ), u = A(() => {
202
202
  i(null), c(null), t?.(null, null);
203
203
  }, [t]);
204
204
  return {
205
205
  enabled: o,
206
- sortBy: a,
206
+ sortBy: r,
207
207
  sortOrder: g,
208
208
  toggleSort: d,
209
- setSorting: r,
210
- resetSorting: m,
211
- sortingConfig: n
209
+ setSorting: n,
210
+ resetSorting: u,
211
+ sortingConfig: s
212
212
  };
213
213
  }
214
- function Ot({
214
+ function Gt({
215
215
  config: e,
216
216
  totalRecords: t,
217
- onPageChange: n
217
+ onPageChange: s
218
218
  }) {
219
- const o = O(() => typeof e == "object" && e !== null ? e : { enabled: !!e }, [e]), l = o.enabled !== !1 && !!e, a = o.defaultPage || 1, i = o.defaultPageSize || 10, g = o.pageSizeOptions || [5, 10, 20, 50, 100], [c, d] = v(a), [r, m] = v(i), u = Math.max(1, Math.ceil(t / Math.max(1, r))), f = w(
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
220
  (N) => {
221
- const A = Math.max(1, Math.min(N, u));
222
- d(A), n?.(A, r);
221
+ const w = Math.max(1, Math.min(N, m));
222
+ d(w), s?.(w, n);
223
223
  },
224
- [u, r, n]
225
- ), p = w(
224
+ [m, n, s]
225
+ ), f = A(
226
226
  (N) => {
227
- m(N), d(1), n?.(1, N);
227
+ u(N), d(1), s?.(1, N);
228
228
  },
229
- [n]
230
- ), k = w(() => {
231
- c < u && f(c + 1);
232
- }, [c, u, f]), E = w(() => {
233
- c > 1 && f(c - 1);
234
- }, [c, f]), h = w(() => {
235
- d(1), m(i), n?.(1, i);
236
- }, [i, n]), D = w(
229
+ [s]
230
+ ), k = 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
+ d(1), u(i), s?.(1, i);
236
+ }, [i, s]), _ = A(
237
237
  (N = 5) => {
238
- const A = Math.max(
238
+ const w = Math.max(
239
239
  1,
240
- Math.min(c - Math.floor(N / 2), u - N + 1)
241
- ), j = Math.min(u, A + N - 1), H = [];
242
- for (let W = A; W <= j; W++)
243
- H.push(W);
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
- [c, u]
247
- ), M = w(
246
+ [c, m]
247
+ ), x = A(
248
248
  (N) => {
249
249
  if (!l) return N;
250
- const A = (c - 1) * r;
251
- return N.slice(A, A + r);
250
+ const w = (c - 1) * n;
251
+ return N.slice(w, w + n);
252
252
  },
253
- [l, c, r]
253
+ [l, c, n]
254
254
  );
255
255
  return {
256
256
  enabled: l,
257
257
  page: c,
258
- pageSize: r,
258
+ pageSize: n,
259
259
  totalRecords: t,
260
- totalPages: u,
260
+ totalPages: m,
261
261
  pageSizeOptions: g,
262
- hasNextPage: c < u,
262
+ hasNextPage: c < m,
263
263
  hasPrevPage: c > 1,
264
- setPage: f,
265
- setPageSize: p,
264
+ setPage: b,
265
+ setPageSize: f,
266
266
  nextPage: k,
267
- prevPage: E,
268
- resetPagination: h,
269
- getPageWindow: D,
270
- sliceData: M,
267
+ prevPage: C,
268
+ resetPagination: D,
269
+ getPageWindow: _,
270
+ sliceData: x,
271
271
  paginationConfig: o
272
272
  };
273
273
  }
274
- const Wt = [
274
+ const Vt = [
275
275
  "total",
276
276
  "totalCount",
277
277
  "count",
@@ -287,7 +287,7 @@ const Wt = [
287
287
  "pageInfo.total",
288
288
  "pageInfo.totalCount",
289
289
  "paging.total"
290
- ], It = [
290
+ ], Yt = [
291
291
  "page",
292
292
  "currentPage",
293
293
  "pageNumber",
@@ -297,7 +297,7 @@ const Wt = [
297
297
  "pagination.page",
298
298
  "pagination.currentPage",
299
299
  "pageInfo.page"
300
- ], Ft = [
300
+ ], Zt = [
301
301
  "pageSize",
302
302
  "limit",
303
303
  "perPage",
@@ -308,7 +308,7 @@ const Wt = [
308
308
  "pagination.pageSize",
309
309
  "pagination.limit",
310
310
  "pagination.perPage"
311
- ], Ht = [
311
+ ], Jt = [
312
312
  "totalPages",
313
313
  "pageCount",
314
314
  "lastPage",
@@ -319,11 +319,11 @@ const Wt = [
319
319
  "pagination.totalPages",
320
320
  "pagination.lastPage"
321
321
  ];
322
- function X(e, t, n = 1, o = 10, l) {
322
+ function Q(e, t, s = 1, o = 10, l) {
323
323
  if (!e || typeof e != "object") {
324
324
  const d = l !== void 0 ? l : 0;
325
325
  return {
326
- page: n,
326
+ page: s,
327
327
  pageSize: o,
328
328
  total: d,
329
329
  totalPages: Math.max(1, Math.ceil(d / Math.max(1, o))),
@@ -331,75 +331,75 @@ function X(e, t, n = 1, o = 10, l) {
331
331
  hasPrevPage: !1
332
332
  };
333
333
  }
334
- let a;
334
+ let r;
335
335
  if (t?.totalPath) {
336
- const d = S(e, t.totalPath);
337
- typeof d == "number" ? a = d : typeof d == "string" && !isNaN(Number(d)) && (a = Number(d));
336
+ const d = P(e, t.totalPath);
337
+ typeof d == "number" ? r = d : typeof d == "string" && !isNaN(Number(d)) && (r = Number(d));
338
338
  }
339
- if (a === void 0)
340
- for (const d of Wt) {
341
- const r = S(e, d);
342
- if (typeof r == "number" && !isNaN(r)) {
343
- a = r;
339
+ if (r === void 0)
340
+ for (const d of Vt) {
341
+ const n = P(e, d);
342
+ if (typeof n == "number" && !isNaN(n)) {
343
+ r = n;
344
344
  break;
345
345
  }
346
- if (typeof r == "string" && r.trim() !== "" && !isNaN(Number(r))) {
347
- a = Number(r);
346
+ if (typeof n == "string" && n.trim() !== "" && !isNaN(Number(n))) {
347
+ r = Number(n);
348
348
  break;
349
349
  }
350
350
  }
351
- a === void 0 && (a = l !== void 0 ? l : 0);
351
+ r === void 0 && (r = l !== void 0 ? l : 0);
352
352
  let i;
353
353
  if (t?.pagePath) {
354
- const d = S(e, t.pagePath);
354
+ const d = P(e, t.pagePath);
355
355
  typeof d == "number" ? i = d : typeof d == "string" && !isNaN(Number(d)) && (i = Number(d));
356
356
  }
357
357
  if (i === void 0)
358
- for (const d of It) {
359
- const r = S(e, d);
360
- if (typeof r == "number" && !isNaN(r)) {
361
- i = r;
358
+ for (const d of Yt) {
359
+ const n = P(e, d);
360
+ if (typeof n == "number" && !isNaN(n)) {
361
+ i = n;
362
362
  break;
363
363
  }
364
- if (typeof r == "string" && r.trim() !== "" && !isNaN(Number(r))) {
365
- i = Number(r);
364
+ if (typeof n == "string" && n.trim() !== "" && !isNaN(Number(n))) {
365
+ i = Number(n);
366
366
  break;
367
367
  }
368
368
  }
369
- i === void 0 && (i = n);
369
+ i === void 0 && (i = s);
370
370
  let g;
371
371
  if (t?.pageSizePath) {
372
- const d = S(e, t.pageSizePath);
372
+ const d = P(e, t.pageSizePath);
373
373
  typeof d == "number" ? g = d : typeof d == "string" && !isNaN(Number(d)) && (g = Number(d));
374
374
  }
375
375
  if (g === void 0)
376
- for (const d of Ft) {
377
- const r = S(e, d);
378
- if (typeof r == "number" && !isNaN(r)) {
379
- g = r;
376
+ for (const d of Zt) {
377
+ const n = P(e, d);
378
+ if (typeof n == "number" && !isNaN(n)) {
379
+ g = n;
380
380
  break;
381
381
  }
382
- if (typeof r == "string" && r.trim() !== "" && !isNaN(Number(r))) {
383
- g = Number(r);
382
+ if (typeof n == "string" && n.trim() !== "" && !isNaN(Number(n))) {
383
+ g = Number(n);
384
384
  break;
385
385
  }
386
386
  }
387
387
  g === void 0 && (g = o);
388
388
  let c;
389
389
  if (t?.totalPagesPath) {
390
- const d = S(e, t.totalPagesPath);
390
+ const d = P(e, t.totalPagesPath);
391
391
  typeof d == "number" ? c = d : typeof d == "string" && !isNaN(Number(d)) && (c = Number(d));
392
392
  }
393
393
  if (c === void 0)
394
- for (const d of Ht) {
395
- const r = S(e, d);
396
- if (typeof r == "number" && !isNaN(r)) {
397
- c = r;
394
+ for (const d of Jt) {
395
+ const n = P(e, d);
396
+ if (typeof n == "number" && !isNaN(n)) {
397
+ c = n;
398
398
  break;
399
399
  }
400
400
  }
401
- return (c === void 0 || c <= 0) && (c = Math.max(1, Math.ceil(a / Math.max(1, g)))), {
402
- total: a,
401
+ return (c === void 0 || c <= 0) && (c = Math.max(1, Math.ceil(r / Math.max(1, g)))), {
402
+ total: r,
403
403
  page: i,
404
404
  pageSize: g,
405
405
  totalPages: c,
@@ -407,7 +407,7 @@ function X(e, t, n = 1, o = 10, l) {
407
407
  hasPrevPage: i > 1
408
408
  };
409
409
  }
410
- const Rt = [
410
+ const qt = [
411
411
  "data",
412
412
  "items",
413
413
  "results",
@@ -428,23 +428,23 @@ const Rt = [
428
428
  "subscriptions",
429
429
  "deadLetters.items"
430
430
  ];
431
- function Ut(e, t, n) {
432
- const o = n?.page || 1, l = n?.pageSize || 10;
431
+ function Xt(e, t, s) {
432
+ const o = s?.page || 1, l = s?.pageSize || 10;
433
433
  if (t?.transformResponse && typeof t.transformResponse == "function") {
434
- const a = t.transformResponse(e);
435
- if (Array.isArray(a))
434
+ const r = t.transformResponse(e);
435
+ if (Array.isArray(r))
436
436
  return {
437
- data: a,
438
- meta: X(e, t.response, o, l, a.length),
437
+ data: r,
438
+ meta: Q(e, t.response, o, l, r.length),
439
439
  raw: e
440
440
  };
441
- if (a && typeof a == "object") {
442
- const i = Array.isArray(a.data) ? a.data : [], g = a.meta ? {
443
- total: a.meta.total !== void 0 ? a.meta.total : i.length,
444
- page: a.meta.page !== void 0 ? a.meta.page : o,
445
- pageSize: a.meta.pageSize !== void 0 ? a.meta.pageSize : l,
446
- totalPages: a.meta.totalPages !== void 0 ? a.meta.totalPages : Math.max(1, Math.ceil((a.meta.total || i.length) / (a.meta.pageSize || l)))
447
- } : X(e, t.response, o, l, i.length);
441
+ if (r && typeof r == "object") {
442
+ const i = Array.isArray(r.data) ? r.data : [], g = r.meta ? {
443
+ total: r.meta.total !== void 0 ? r.meta.total : i.length,
444
+ page: r.meta.page !== void 0 ? r.meta.page : o,
445
+ pageSize: r.meta.pageSize !== void 0 ? r.meta.pageSize : l,
446
+ totalPages: r.meta.totalPages !== void 0 ? r.meta.totalPages : Math.max(1, Math.ceil((r.meta.total || i.length) / (r.meta.pageSize || l)))
447
+ } : Q(e, t.response, o, l, i.length);
448
448
  return { data: i, meta: g, raw: e };
449
449
  }
450
450
  }
@@ -462,14 +462,14 @@ function Ut(e, t, n) {
462
462
  raw: e
463
463
  };
464
464
  if (t?.response?.dataPath) {
465
- const a = S(e, t.response.dataPath), i = Array.isArray(a) ? a : [], g = X(e, t.response, o, l, i.length);
465
+ const r = P(e, t.response.dataPath), i = Array.isArray(r) ? r : [], g = Q(e, t.response, o, l, i.length);
466
466
  return { data: i, meta: g, raw: e };
467
467
  }
468
468
  if (e && typeof e == "object") {
469
- for (const a of Rt) {
470
- const i = S(e, a);
469
+ for (const r of qt) {
470
+ const i = P(e, r);
471
471
  if (Array.isArray(i)) {
472
- const g = X(e, t?.response, o, l, i.length);
472
+ const g = Q(e, t?.response, o, l, i.length);
473
473
  return {
474
474
  data: i,
475
475
  meta: g,
@@ -477,20 +477,20 @@ function Ut(e, t, n) {
477
477
  };
478
478
  }
479
479
  }
480
- for (const a in e)
481
- if (Array.isArray(e[a])) {
482
- const i = X(e, t?.response, o, l, e[a].length);
480
+ for (const r in e)
481
+ if (Array.isArray(e[r])) {
482
+ const i = Q(e, t?.response, o, l, e[r].length);
483
483
  return {
484
- data: e[a],
484
+ data: e[r],
485
485
  meta: i,
486
486
  raw: e
487
487
  };
488
488
  }
489
489
  if (Object.keys(e).length > 0 && !Array.isArray(e)) {
490
- const a = e.user || e.order || e.item || e.data || e;
491
- if (a && typeof a == "object" && !Array.isArray(a))
490
+ const r = e.user || e.order || e.item || e.data || e;
491
+ if (r && typeof r == "object" && !Array.isArray(r))
492
492
  return {
493
- data: [a],
493
+ data: [r],
494
494
  meta: {
495
495
  total: 1,
496
496
  page: 1,
@@ -516,54 +516,54 @@ function Ut(e, t, n) {
516
516
  raw: e
517
517
  };
518
518
  }
519
- function Kt(e, t, n, o) {
519
+ function Qt(e, t, s, o) {
520
520
  if (!e || !e.length) return [];
521
521
  if (!t || typeof t != "string" || !t.trim()) return e;
522
522
  const l = t.trim().toLowerCase();
523
523
  if (o && typeof o == "function")
524
524
  return e.filter((i) => o(i, l));
525
- const a = l.split(/\s+/).filter(Boolean);
525
+ const r = l.split(/\s+/).filter(Boolean);
526
526
  return e.filter((i) => {
527
527
  if (!i || typeof i != "object") return !1;
528
528
  const g = [];
529
- if (n && n.length > 0)
530
- for (const d of n) {
531
- const r = S(i, d);
532
- r != null && (typeof r == "object" ? g.push(JSON.stringify(r).toLowerCase()) : g.push(String(r).toLowerCase()));
529
+ if (s && s.length > 0)
530
+ for (const d of s) {
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
- Te(i, g);
535
+ Se(i, g);
536
536
  const c = g.join(" ");
537
- return a.every((d) => c.includes(d));
537
+ return r.every((d) => c.includes(d));
538
538
  });
539
539
  }
540
- function Te(e, t, n = 0) {
541
- if (!(n > 4 || e === null || e === void 0)) {
540
+ function Se(e, t, s = 0) {
541
+ if (!(s > 4 || e === null || e === void 0)) {
542
542
  if (typeof e != "object") {
543
543
  t.push(String(e).toLowerCase());
544
544
  return;
545
545
  }
546
546
  if (Array.isArray(e)) {
547
547
  for (const o of e)
548
- Te(o, t, n + 1);
548
+ Se(o, t, s + 1);
549
549
  return;
550
550
  }
551
551
  for (const o in e)
552
552
  if (Object.prototype.hasOwnProperty.call(e, o)) {
553
553
  if (o.startsWith("__") || o.toLowerCase().includes("password")) continue;
554
- Te(e[o], t, n + 1);
554
+ Se(e[o], t, s + 1);
555
555
  }
556
556
  }
557
557
  }
558
- function Gt(e, t, n, o) {
559
- if (!e || !e.length || !t || !n)
558
+ function er(e, t, s, o) {
559
+ if (!e || !e.length || !t || !s)
560
560
  return e;
561
561
  const l = [...e];
562
- return o && typeof o == "function" ? (l.sort((a, i) => {
563
- const g = o(a, i);
564
- return n === "desc" ? -g : g;
565
- }), l) : (l.sort((a, i) => {
566
- const g = S(a, t), c = S(i, t);
562
+ return o && typeof o == "function" ? (l.sort((r, i) => {
563
+ const g = o(r, i);
564
+ return s === "desc" ? -g : g;
565
+ }), l) : (l.sort((r, i) => {
566
+ const g = P(r, t), c = P(i, t);
567
567
  if (g == null)
568
568
  return c == null ? 0 : 1;
569
569
  if (c == null)
@@ -575,153 +575,153 @@ function Gt(e, t, n, o) {
575
575
  d = g === c ? 0 : g ? -1 : 1;
576
576
  else if (g instanceof Date && c instanceof Date)
577
577
  d = g.getTime() - c.getTime();
578
- else if (typeof g == "string" && typeof c == "string" && Ue(g) && Ue(c))
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 r = String(g), m = String(c);
582
- d = r.localeCompare(m, 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
  });
586
586
  }
587
- return n === "desc" ? -d : d;
587
+ return s === "desc" ? -d : d;
588
588
  }), l);
589
589
  }
590
- function Ue(e) {
590
+ function Ge(e) {
591
591
  return 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);
592
592
  }
593
- function Yt({
593
+ function tr({
594
594
  data: e,
595
595
  api: t,
596
- columns: n,
596
+ columns: s,
597
597
  searchQuery: o,
598
598
  sortBy: l,
599
- sortOrder: a,
599
+ sortOrder: r,
600
600
  page: i,
601
601
  pageSize: g,
602
602
  manualLoading: c
603
603
  }) {
604
- const d = !!(t && typeof t.fetcher == "function"), r = d && t?.mode !== "client", [m, u] = v([]), [f, p] = v(0), [k, E] = v(!1), [h, D] = v(null), [M, N] = v(0), A = wt(null), j = w(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
- A.current && A.current.abort();
607
- const B = new AbortController();
608
- A.current = B, E(!0), D(null);
609
- const z = t.paramNames || {}, R = z.pageParam || "page", re = z.pageSizeParam || "limit", G = z.searchParam || "q", Y = z.sortByParam || "sortBy", I = z.sortOrderParam || "sortOrder", U = {
610
- [R]: i,
611
- [re]: g,
606
+ w.current && w.current.abort();
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
+ [U]: i,
611
+ [te]: g,
612
612
  page: i,
613
613
  pageSize: g,
614
- ...o ? { [G]: o, search: o, q: o } : {},
614
+ ...o ? { [V]: o, search: o, q: o } : {},
615
615
  ...l ? { [Y]: l, sortBy: l } : {},
616
- ...a ? { [I]: a, sortOrder: a } : {},
616
+ ...r ? { [K]: r, sortOrder: r } : {},
617
617
  ...t.params || {}
618
618
  };
619
619
  try {
620
- const T = await t.fetcher(U, B.signal);
621
- if (B.signal.aborted) return;
622
- const V = Ut(
623
- T,
620
+ const B = await t.fetcher(Z, j.signal);
621
+ if (j.signal.aborted) return;
622
+ const I = Xt(
623
+ B,
624
624
  t,
625
- U
625
+ Z
626
626
  );
627
- u(V.data), p(V.meta.total), t.onSuccess?.(V);
628
- } catch (T) {
629
- if (T?.name === "AbortError" || T?.name === "CanceledError")
627
+ m(I.data), f(I.meta.total), t.onSuccess?.(I);
628
+ } catch (B) {
629
+ if (B?.name === "AbortError" || B?.name === "CanceledError")
630
630
  return;
631
- D(T), t.onError?.(T);
631
+ _(B), t.onError?.(B);
632
632
  } finally {
633
- B.signal.aborted || E(!1);
633
+ j.signal.aborted || C(!1);
634
634
  }
635
- }, [d, t, i, g, o, l, a]);
636
- ye(() => {
637
- d && j();
638
- }, [j, M]), ye(() => () => {
639
- A.current && A.current.abort();
635
+ }, [d, t, i, g, o, l, r]);
636
+ fe(() => {
637
+ d && R();
638
+ }, [R, x]), fe(() => () => {
639
+ w.current && w.current.abort();
640
640
  }, []);
641
- const H = w(async () => {
642
- d && N((B) => B + 1);
643
- }, [d]), { displayRows: W, finalTotal: te } = O(() => {
644
- if (r)
641
+ const H = A(async () => {
642
+ d && N((j) => j + 1);
643
+ }, [d]), { displayRows: L, finalTotal: ye } = W(() => {
644
+ if (n)
645
645
  return {
646
- displayRows: m,
647
- finalTotal: f
646
+ displayRows: u,
647
+ finalTotal: b
648
648
  };
649
- const B = d ? m : e || [], z = n.filter((T) => T.searchable !== !1).map((T) => T.key), R = Kt(B, o, z), G = n.find((T) => T.key === l)?.comparator, Y = Gt(R, l, a, G), I = (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
- displayRows: Y.slice(I, I + g),
652
- finalTotal: R.length
651
+ displayRows: Y.slice(K, K + g),
652
+ finalTotal: U.length
653
653
  };
654
654
  }, [
655
- r,
655
+ n,
656
656
  d,
657
- m,
657
+ u,
658
658
  e,
659
- f,
660
- n,
659
+ b,
660
+ s,
661
661
  o,
662
662
  l,
663
- a,
663
+ r,
664
664
  i,
665
665
  g
666
666
  ]);
667
667
  return {
668
- rows: W,
669
- totalRecords: te,
668
+ rows: L,
669
+ totalRecords: ye,
670
670
  loading: c !== void 0 ? c : k,
671
- error: h,
671
+ error: D,
672
672
  refresh: H,
673
- isServerMode: r,
674
- rawRemoteData: m
673
+ isServerMode: n,
674
+ rawRemoteData: u
675
675
  };
676
676
  }
677
- function Vt({
677
+ function rr({
678
678
  tableRef: e,
679
679
  refresh: t,
680
- resetPagination: n,
680
+ resetPagination: s,
681
681
  resetSearch: o,
682
682
  resetSorting: l,
683
- setPage: a,
683
+ setPage: r,
684
684
  setPageSize: i,
685
685
  setSearch: g,
686
686
  setSorting: c,
687
687
  selectedRows: d,
688
- clearSelection: r,
689
- getState: m
688
+ clearSelection: n,
689
+ getState: u
690
690
  }) {
691
- vt(
691
+ Dt(
692
692
  e,
693
693
  () => ({
694
694
  refresh: t,
695
695
  reset: () => {
696
- n(), o(), l(), r();
696
+ s(), o(), l(), n();
697
697
  },
698
698
  resetSearch: o,
699
699
  resetSorting: l,
700
- resetPagination: n,
701
- setPage: a,
700
+ resetPagination: s,
701
+ setPage: r,
702
702
  setPageSize: i,
703
703
  setSearch: g,
704
704
  setSorting: c,
705
705
  getSelectedRows: () => d,
706
- clearSelection: r,
707
- getState: m
706
+ clearSelection: n,
707
+ getState: u
708
708
  }),
709
709
  [
710
710
  t,
711
- n,
711
+ s,
712
712
  o,
713
713
  l,
714
- a,
714
+ r,
715
715
  i,
716
716
  g,
717
717
  c,
718
718
  d,
719
- r,
720
- m
719
+ n,
720
+ u
721
721
  ]
722
722
  );
723
723
  }
724
- const Jt = {
724
+ const tt = {
725
725
  primary: "#2667EC",
726
726
  primaryHover: "#1E54C6",
727
727
  primaryLight: "#397FF6",
@@ -740,9 +740,9 @@ const Jt = {
740
740
  inputBg: "#1E293B",
741
741
  rowHover: "rgba(38, 103, 236, 0.04)",
742
742
  rowSelected: "rgba(38, 103, 236, 0.08)"
743
- }, Q = {
743
+ }, rt = {
744
744
  mode: "auto",
745
- colors: Jt,
745
+ colors: tt,
746
746
  borderRadius: "1rem",
747
747
  fontFamily: "'Alexandria', system-ui, -apple-system, sans-serif",
748
748
  density: "normal",
@@ -762,37 +762,169 @@ const Jt = {
762
762
  paginationButtonActive: "bg-primary text-white hover:bg-primary-soft shadow-md shadow-primary/30",
763
763
  paginationSelect: "h-9 px-3 rounded-xl border border-gray-200 dark:border-gray-700 bg-white dark:bg-slate-800 text-sm font-medium text-gray-700 dark:text-gray-300 focus:outline-none focus:border-primary cursor-pointer"
764
764
  }
765
- }, Je = At(Q), Zt = ({
766
- theme: e,
767
- children: t
768
- }) => {
769
- const n = O(() => e ? {
770
- ...Q,
771
- ...e,
765
+ }, Ve = {
766
+ default: {
767
+ colors: tt,
768
+ borderRadius: "1rem",
769
+ density: "normal"
770
+ },
771
+ midnight: {
772
+ colors: {
773
+ primary: "#6366F1",
774
+ primaryHover: "#4F46E5",
775
+ primaryLight: "#818CF8",
776
+ rowHover: "rgba(99, 102, 241, 0.08)",
777
+ rowSelected: "rgba(99, 102, 241, 0.16)",
778
+ theadBg: "#0F172A",
779
+ theadText: "#C7D2FE"
780
+ },
781
+ borderRadius: "1.25rem",
782
+ classes: {
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",
786
+ paginationButtonActive: "bg-indigo-600 text-white shadow-lg shadow-indigo-600/30"
787
+ }
788
+ },
789
+ emerald: {
790
+ colors: {
791
+ primary: "#10B981",
792
+ primaryHover: "#059669",
793
+ primaryLight: "#34D399",
794
+ border: "#10B98125",
795
+ rowHover: "rgba(16, 185, 129, 0.06)",
796
+ rowSelected: "rgba(16, 185, 129, 0.12)",
797
+ theadBg: "rgba(16, 185, 129, 0.08)",
798
+ theadText: "#065F46"
799
+ },
800
+ borderRadius: "1rem",
801
+ classes: {
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",
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",
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",
805
+ paginationButtonActive: "bg-emerald-600 text-white shadow-md shadow-emerald-600/30"
806
+ }
807
+ },
808
+ ocean: {
809
+ colors: {
810
+ primary: "#0EA5E9",
811
+ primaryHover: "#0284C7",
812
+ primaryLight: "#38BDF8",
813
+ secondary: "#06B6D4",
814
+ rowHover: "rgba(14, 165, 233, 0.06)",
815
+ rowSelected: "rgba(14, 165, 233, 0.12)",
816
+ theadBg: "rgba(14, 165, 233, 0.08)",
817
+ theadText: "#0369A1"
818
+ },
819
+ borderRadius: "1rem",
820
+ classes: {
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",
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",
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",
824
+ paginationButtonActive: "bg-sky-500 text-white shadow-md shadow-sky-500/30"
825
+ }
826
+ },
827
+ luxury: {
828
+ colors: {
829
+ primary: "#D97706",
830
+ primaryHover: "#B45309",
831
+ primaryLight: "#F59E0B",
832
+ rowHover: "rgba(245, 158, 11, 0.06)",
833
+ rowSelected: "rgba(245, 158, 11, 0.14)",
834
+ theadBg: "rgba(245, 158, 11, 0.08)",
835
+ theadText: "#78350F"
836
+ },
837
+ borderRadius: "1.25rem",
838
+ classes: {
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",
842
+ paginationButtonActive: "bg-gradient-to-r from-amber-500 to-yellow-500 text-white shadow-md shadow-amber-500/30 font-black"
843
+ }
844
+ },
845
+ crimson: {
846
+ colors: {
847
+ primary: "#F43F5E",
848
+ primaryHover: "#E11D48",
849
+ primaryLight: "#FB7185",
850
+ rowHover: "rgba(244, 63, 94, 0.06)",
851
+ rowSelected: "rgba(244, 63, 94, 0.12)",
852
+ theadBg: "rgba(244, 63, 94, 0.08)",
853
+ theadText: "#881337"
854
+ },
855
+ borderRadius: "1rem",
856
+ classes: {
857
+ tableWrapper: "w-full overflow-x-auto rounded-2xl border border-rose-500/20 bg-white dark:bg-slate-900 shadow-lg shadow-rose-500/5",
858
+ thead: "bg-rose-500/10 dark:bg-rose-950/30 border-b border-rose-500/20 text-rose-800 dark:text-rose-300 font-bold uppercase text-xs",
859
+ searchInput: "w-full pl-10 pr-10 py-2.5 rounded-xl border border-rose-500/30 bg-white dark:bg-slate-800 text-gray-900 dark:text-white focus:ring-rose-500/40 focus:border-rose-500",
860
+ paginationButtonActive: "bg-rose-500 text-white shadow-md shadow-rose-500/30"
861
+ }
862
+ },
863
+ minimal: {
864
+ borderRadius: "0.5rem",
865
+ density: "spacious",
866
+ classes: {
867
+ tableWrapper: "w-full overflow-x-auto rounded-lg border-0 bg-transparent shadow-none",
868
+ thead: "bg-transparent border-b border-gray-200 dark:border-gray-800 text-gray-500 dark:text-gray-400 font-semibold text-xs tracking-wider",
869
+ tbody: "divide-y divide-gray-100 dark:divide-gray-800/40 bg-transparent",
870
+ tr: "hover:bg-gray-500/5 transition-colors",
871
+ searchInput: "w-full pl-10 pr-10 py-2 rounded-lg border border-gray-200 dark:border-gray-800 bg-transparent text-sm focus:border-gray-400",
872
+ paginationButtonActive: "bg-gray-900 dark:bg-white text-white dark:text-gray-900 font-bold"
873
+ }
874
+ },
875
+ corporate: {
772
876
  colors: {
773
- ...Q.colors,
774
- ...e.colors || {}
877
+ primary: "#1E40AF",
878
+ primaryHover: "#1E3A8A",
879
+ primaryLight: "#3B82F6"
775
880
  },
881
+ borderRadius: "0.375rem",
882
+ density: "compact",
776
883
  classes: {
777
- ...Q.classes,
778
- ...e.classes || {}
884
+ tableWrapper: "w-full overflow-x-auto rounded-md border border-gray-300 dark:border-gray-700 bg-white dark:bg-slate-900 shadow-sm",
885
+ thead: "bg-gray-100 dark:bg-slate-800 border-b border-gray-300 dark:border-gray-700 text-gray-700 dark:text-gray-300 font-bold uppercase text-xs",
886
+ searchInput: "w-full pl-9 pr-8 py-1.5 rounded border border-gray-300 dark:border-gray-600 bg-white dark:bg-slate-800 text-xs",
887
+ paginationButtonActive: "bg-blue-800 text-white"
779
888
  }
780
- } : Q, [e]);
781
- return /* @__PURE__ */ s(Je.Provider, { value: n, children: t });
889
+ }
890
+ }, Te = Mt(rt), ar = ({
891
+ theme: e,
892
+ preset: t,
893
+ children: s
894
+ }) => {
895
+ const o = Qe(Te), l = W(() => {
896
+ const r = o || rt, i = t && Ve[t] ? Ve[t] : {};
897
+ return {
898
+ ...r,
899
+ ...i,
900
+ ...e || {},
901
+ colors: {
902
+ ...r.colors,
903
+ ...i.colors || {},
904
+ ...e?.colors || {}
905
+ },
906
+ classes: {
907
+ ...r.classes,
908
+ ...i.classes || {},
909
+ ...e?.classes || {}
910
+ }
911
+ };
912
+ }, [o, t, e]);
913
+ return /* @__PURE__ */ a(Te.Provider, { value: l, children: s });
782
914
  };
783
915
  function ee() {
784
- return Ct(Je);
916
+ return Qe(Te);
785
917
  }
786
- const qt = ({
918
+ const nr = ({
787
919
  value: e,
788
920
  onChange: t,
789
- onClear: n,
921
+ onClear: s,
790
922
  isDebouncing: o = !1,
791
923
  placeholder: l = "Search records..."
792
924
  }) => {
793
- const a = ee();
794
- return /* @__PURE__ */ b("div", { className: a.classes?.searchContainer || "w-full sm:max-w-md relative flex items-center", children: [
795
- /* @__PURE__ */ s("span", { className: "absolute left-3.5 text-gray-400 dark:text-gray-500 pointer-events-none flex items-center", children: /* @__PURE__ */ s(
925
+ const r = ee();
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(
796
928
  "svg",
797
929
  {
798
930
  className: "w-4 h-4",
@@ -800,7 +932,7 @@ const qt = ({
800
932
  stroke: "currentColor",
801
933
  viewBox: "0 0 24 24",
802
934
  xmlns: "http://www.w3.org/2000/svg",
803
- children: /* @__PURE__ */ s(
935
+ children: /* @__PURE__ */ a(
804
936
  "path",
805
937
  {
806
938
  strokeLinecap: "round",
@@ -811,26 +943,26 @@ const qt = ({
811
943
  )
812
944
  }
813
945
  ) }),
814
- /* @__PURE__ */ s(
946
+ /* @__PURE__ */ a(
815
947
  "input",
816
948
  {
817
949
  type: "text",
818
950
  value: e,
819
951
  onChange: (i) => t(i.target.value),
820
952
  placeholder: l,
821
- className: a.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"
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"
822
954
  }
823
955
  ),
824
- /* @__PURE__ */ b("div", { className: "absolute right-3 flex items-center gap-1.5", children: [
825
- o && /* @__PURE__ */ s("span", { className: "w-3.5 h-3.5 border-2 border-primary border-t-transparent rounded-full animate-spin" }),
826
- e && /* @__PURE__ */ s(
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(
827
959
  "button",
828
960
  {
829
961
  type: "button",
830
- onClick: n,
962
+ onClick: s,
831
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",
832
964
  title: "Clear search",
833
- children: /* @__PURE__ */ s(
965
+ children: /* @__PURE__ */ a(
834
966
  "svg",
835
967
  {
836
968
  className: "w-3.5 h-3.5",
@@ -838,139 +970,147 @@ const qt = ({
838
970
  stroke: "currentColor",
839
971
  viewBox: "0 0 24 24",
840
972
  xmlns: "http://www.w3.org/2000/svg",
841
- children: /* @__PURE__ */ s("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" })
842
974
  }
843
975
  )
844
976
  }
845
977
  )
846
978
  ] })
847
979
  ] });
848
- }, Xt = ({
980
+ }, sr = ({
849
981
  columns: e,
850
982
  hasActions: t,
851
- actionsTitle: n = "Actions",
983
+ actionsTitle: s = "Actions",
852
984
  actionsWidth: o,
853
985
  sortBy: l,
854
- sortOrder: a,
986
+ sortOrder: r,
855
987
  onSort: i,
856
988
  selectable: g,
857
989
  allSelected: c,
858
990
  isIndeterminate: d,
859
- onToggleSelectAll: r
991
+ onToggleSelectAll: n,
992
+ headerClassName: u = ""
860
993
  }) => {
861
- const m = ee();
862
- return /* @__PURE__ */ s("thead", { className: m.classes?.thead || "bg-gray-50/80 dark:bg-slate-800/80 border-b border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ b("tr", { children: [
863
- g && /* @__PURE__ */ s("th", { className: "w-10 px-4 py-3 text-center align-middle", children: /* @__PURE__ */ s(
864
- "input",
865
- {
866
- type: "checkbox",
867
- checked: c,
868
- ref: (u) => {
869
- u && (u.indeterminate = !!d);
870
- },
871
- onChange: r,
872
- className: "w-4 h-4 rounded border-gray-300 dark:border-gray-600 text-primary focus:ring-primary/30 cursor-pointer"
873
- }
874
- ) }),
875
- e.map((u) => {
876
- const f = l === u.key, p = u.sortable !== !1 && !!i, k = u.align === "center" ? "text-center" : u.align === "right" ? "text-right" : "text-left";
877
- return /* @__PURE__ */ s(
878
- "th",
879
- {
880
- style: {
881
- width: u.width,
882
- minWidth: u.minWidth,
883
- maxWidth: u.maxWidth
884
- },
885
- onClick: () => p && i?.(String(u.key)),
886
- className: `${m.classes?.th || "py-3.5 px-4 font-bold select-none whitespace-nowrap text-xs uppercase tracking-wider"} ${k} ${u.headerClassName || ""} ${p ? "cursor-pointer hover:text-primary transition-colors group" : ""}`,
887
- children: /* @__PURE__ */ b(
888
- "div",
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(
996
+ "thead",
997
+ {
998
+ style: b,
999
+ className: `${m.classes?.thead || "bg-gray-50/80 dark:bg-slate-800/80 border-b border-gray-200 dark:border-gray-800"} ${u}`,
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(
1002
+ "input",
1003
+ {
1004
+ type: "checkbox",
1005
+ checked: c,
1006
+ ref: (f) => {
1007
+ f && (f.indeterminate = !!d);
1008
+ },
1009
+ onChange: n,
1010
+ className: "w-4 h-4 rounded border-gray-300 dark:border-gray-600 text-primary focus:ring-primary/30 cursor-pointer"
1011
+ }
1012
+ ) }),
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(
1016
+ "th",
889
1017
  {
890
- className: `inline-flex items-center gap-1.5 ${u.align === "center" ? "justify-center" : u.align === "right" ? "justify-end" : "justify-start"}`,
891
- children: [
892
- /* @__PURE__ */ s("span", { children: u.title }),
893
- p && /* @__PURE__ */ s(
894
- "span",
895
- {
896
- className: `inline-flex flex-col text-[10px] transition-transform ${f ? "text-primary scale-110" : "text-gray-400 opacity-40 group-hover:opacity-100"}`,
897
- children: f ? a === "asc" ? "▲" : "▼" : /* @__PURE__ */ s("span", { className: "text-[9px] leading-none opacity-50", children: "▲▼" })
898
- }
899
- )
900
- ]
901
- }
902
- )
903
- },
904
- String(u.key)
905
- );
906
- }),
907
- t && /* @__PURE__ */ s(
908
- "th",
909
- {
910
- style: { width: o || "auto" },
911
- className: `${m.classes?.th || "py-3.5 px-4 font-bold select-none whitespace-nowrap text-xs uppercase tracking-wider"} text-right pr-6`,
912
- children: n
913
- }
914
- )
915
- ] }) });
916
- }, _ = () => /* @__PURE__ */ s("span", { className: "text-gray-400 dark:text-gray-500 font-mono text-sm", children: "—" }), Ze = ({ value: e }) => {
1018
+ style: {
1019
+ width: f.width,
1020
+ minWidth: f.minWidth,
1021
+ maxWidth: f.maxWidth
1022
+ },
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(
1026
+ "div",
1027
+ {
1028
+ className: `inline-flex items-center gap-1.5 ${f.align === "center" ? "justify-center" : f.align === "right" ? "justify-end" : "justify-start"}`,
1029
+ children: [
1030
+ /* @__PURE__ */ a("span", { children: f.title }),
1031
+ C && /* @__PURE__ */ a(
1032
+ "span",
1033
+ {
1034
+ className: `inline-flex flex-col text-[10px] transition-transform ${k ? "text-primary scale-110" : "text-gray-400 opacity-40 group-hover:opacity-100"}`,
1035
+ children: k ? r === "asc" ? "▲" : "▼" : /* @__PURE__ */ a("span", { className: "text-[9px] leading-none opacity-50", children: "▲▼" })
1036
+ }
1037
+ )
1038
+ ]
1039
+ }
1040
+ )
1041
+ },
1042
+ String(f.key)
1043
+ );
1044
+ }),
1045
+ t && /* @__PURE__ */ a(
1046
+ "th",
1047
+ {
1048
+ style: { width: o || "auto" },
1049
+ className: `${m.classes?.th || "py-3.5 px-4 font-bold select-none whitespace-nowrap text-xs uppercase tracking-wider"} text-right pr-6`,
1050
+ children: s
1051
+ }
1052
+ )
1053
+ ] })
1054
+ }
1055
+ );
1056
+ }, $ = () => /* @__PURE__ */ a("span", { className: "text-gray-400 dark:text-gray-500 font-mono text-sm", children: "—" }), at = ({ value: e }) => {
917
1057
  if (e == null || e === "")
918
- return /* @__PURE__ */ s(_, {});
1058
+ return /* @__PURE__ */ a($, {});
919
1059
  const t = String(e);
920
- return /* @__PURE__ */ s("span", { className: "truncate block max-w-xs font-normal text-sm", title: t, children: t });
921
- }, Qt = ({ value: e }) => {
1060
+ return /* @__PURE__ */ a("span", { className: "truncate block max-w-xs font-normal text-sm", title: t, children: t });
1061
+ }, or = ({ value: e }) => {
922
1062
  if (e == null || isNaN(Number(e)))
923
- return /* @__PURE__ */ s(_, {});
1063
+ return /* @__PURE__ */ a($, {});
924
1064
  const t = Number(e);
925
- return /* @__PURE__ */ s("span", { className: "font-mono text-sm font-medium", children: t.toLocaleString() });
926
- }, er = ({ value: e }) => {
1065
+ return /* @__PURE__ */ a("span", { className: "font-mono text-sm font-medium", children: t.toLocaleString() });
1066
+ }, ir = ({ value: e }) => {
927
1067
  if (e == null)
928
- return /* @__PURE__ */ s(_, {});
1068
+ return /* @__PURE__ */ a($, {});
929
1069
  const t = !!e;
930
- return /* @__PURE__ */ b(
1070
+ return /* @__PURE__ */ y(
931
1071
  "span",
932
1072
  {
933
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"}`,
934
1074
  children: [
935
- /* @__PURE__ */ s("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"}` }),
936
1076
  t ? "Yes" : "No"
937
1077
  ]
938
1078
  }
939
1079
  );
940
- }, Ke = ({
1080
+ }, Ye = ({
941
1081
  value: e,
942
1082
  isDateTime: t = !1
943
1083
  }) => {
944
- if (!e) return /* @__PURE__ */ s(_, {});
945
- const n = e instanceof Date ? e : new Date(e);
946
- return isNaN(n.getTime()) ? /* @__PURE__ */ s(Ze, { value: e, column: { key: "" } }) : /* @__PURE__ */ b("span", { className: "whitespace-nowrap text-xs sm:text-sm font-medium text-gray-700 dark:text-gray-300", children: [
947
- n.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" }),
948
- t && /* @__PURE__ */ s("span", { className: "text-xs text-gray-400 dark:text-gray-500 ml-1.5", children: n.toLocaleTimeString(void 0, { hour: "2-digit", minute: "2-digit" }) })
1084
+ if (!e) return /* @__PURE__ */ a($, {});
1085
+ const s = e instanceof Date ? e : new Date(e);
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: [
1087
+ s.toLocaleDateString(void 0, { year: "numeric", month: "short", day: "numeric" }),
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" }) })
949
1089
  ] });
950
- }, tr = ({ value: e, column: t }) => {
1090
+ }, lr = ({ value: e, column: t }) => {
951
1091
  if (e == null || isNaN(Number(e)))
952
- return /* @__PURE__ */ s(_, {});
953
- const n = Number(e), o = t.currency || "EGP";
954
- return /* @__PURE__ */ b("span", { className: "font-mono text-sm font-bold text-gray-900 dark:text-white", children: [
955
- n.toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 }),
1092
+ return /* @__PURE__ */ a($, {});
1093
+ const s = Number(e), o = t.currency || "EGP";
1094
+ return /* @__PURE__ */ y("span", { className: "font-mono text-sm font-bold text-gray-900 dark:text-white", children: [
1095
+ s.toLocaleString(void 0, { minimumFractionDigits: 2, maximumFractionDigits: 2 }),
956
1096
  " ",
957
- /* @__PURE__ */ s("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 })
958
1098
  ] });
959
- }, Ge = "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", rr = ({ value: e }) => {
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 }) => {
960
1100
  let t = "";
961
- 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 = Ge), /* @__PURE__ */ s("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ s(
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(
962
1102
  "img",
963
1103
  {
964
1104
  src: t,
965
1105
  alt: "Thumbnail",
966
1106
  className: "w-10 h-10 rounded-full object-cover border border-gray-200 dark:border-gray-700 bg-gray-100 dark:bg-gray-800 shadow-sm",
967
1107
  loading: "lazy",
968
- onError: (n) => {
969
- n.target.src = Ge;
1108
+ onError: (s) => {
1109
+ s.target.src = Ze;
970
1110
  }
971
1111
  }
972
1112
  ) });
973
- }, ar = {
1113
+ }, cr = {
974
1114
  active: { bg: "bg-emerald-500/10 border-emerald-500/20", text: "text-emerald-600 dark:text-emerald-400", dot: "bg-emerald-500" },
975
1115
  delivered: { bg: "bg-emerald-500/10 border-emerald-500/20", text: "text-emerald-600 dark:text-emerald-400", dot: "bg-emerald-500" },
976
1116
  completed: { bg: "bg-emerald-500/10 border-emerald-500/20", text: "text-emerald-600 dark:text-emerald-400", dot: "bg-emerald-500" },
@@ -986,56 +1126,56 @@ const qt = ({
986
1126
  cancelled: { bg: "bg-rose-500/10 border-rose-500/20", text: "text-rose-600 dark:text-rose-400", dot: "bg-rose-500" },
987
1127
  offline: { bg: "bg-gray-500/10 border-gray-500/20", text: "text-gray-600 dark:text-gray-400", dot: "bg-gray-500" },
988
1128
  closed: { bg: "bg-gray-500/10 border-gray-500/20", text: "text-gray-600 dark:text-gray-400", dot: "bg-gray-500" }
989
- }, nr = ({ value: e, column: t }) => {
1129
+ }, gr = ({ value: e, column: t }) => {
990
1130
  if (e == null || e === "")
991
- return /* @__PURE__ */ s(_, {});
992
- const n = String(e), o = n.toLowerCase();
993
- if (t.statusMap && t.statusMap[n]) {
994
- const a = t.statusMap[n];
995
- return /* @__PURE__ */ b(
1131
+ return /* @__PURE__ */ a($, {});
1132
+ const s = String(e), o = s.toLowerCase();
1133
+ if (t.statusMap && t.statusMap[s]) {
1134
+ const r = t.statusMap[s];
1135
+ return /* @__PURE__ */ y(
996
1136
  "span",
997
1137
  {
998
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",
999
- style: { color: a.color, backgroundColor: a.bg },
1139
+ style: { color: r.color, backgroundColor: r.bg },
1000
1140
  children: [
1001
- /* @__PURE__ */ s("span", { className: "w-1.5 h-1.5 rounded-full", style: { backgroundColor: a.color } }),
1002
- a.label || n
1141
+ /* @__PURE__ */ a("span", { className: "w-1.5 h-1.5 rounded-full", style: { backgroundColor: r.color } }),
1142
+ r.label || s
1003
1143
  ]
1004
1144
  }
1005
1145
  );
1006
1146
  }
1007
- const l = ar[o] || {
1147
+ const l = cr[o] || {
1008
1148
  bg: "bg-gray-500/10 border-gray-500/20",
1009
1149
  text: "text-gray-700 dark:text-gray-300",
1010
1150
  dot: "bg-gray-400"
1011
1151
  };
1012
- return /* @__PURE__ */ b(
1152
+ return /* @__PURE__ */ y(
1013
1153
  "span",
1014
1154
  {
1015
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}`,
1016
1156
  children: [
1017
- /* @__PURE__ */ s("span", { className: `w-1.5 h-1.5 rounded-full ${l.dot}` }),
1018
- n
1157
+ /* @__PURE__ */ a("span", { className: `w-1.5 h-1.5 rounded-full ${l.dot}` }),
1158
+ s
1019
1159
  ]
1020
1160
  }
1021
1161
  );
1022
- }, sr = ({ value: e }) => !Array.isArray(e) || e.length === 0 ? /* @__PURE__ */ s(_, {}) : /* @__PURE__ */ b("div", { className: "flex flex-wrap gap-1 items-center", children: [
1023
- e.slice(0, 3).map((t, n) => /* @__PURE__ */ s(
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(
1024
1164
  "span",
1025
1165
  {
1026
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",
1027
1167
  children: typeof t == "object" ? JSON.stringify(t) : String(t)
1028
1168
  },
1029
- n
1169
+ s
1030
1170
  )),
1031
- e.length > 3 && /* @__PURE__ */ b("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: [
1032
1172
  "+",
1033
1173
  e.length - 3
1034
1174
  ] })
1035
- ] }), or = ({ value: e }) => !e || typeof e != "object" ? /* @__PURE__ */ s(_, {}) : "en" in e || "ar" in e ? /* @__PURE__ */ s("span", { className: "font-medium text-sm", children: e.en || e.ar || "" }) : /* @__PURE__ */ s("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) }), ir = ({ value: e }) => {
1036
- if (!e) return /* @__PURE__ */ s(_, {});
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($, {});
1037
1177
  const t = String(e);
1038
- return /* @__PURE__ */ b(
1178
+ return /* @__PURE__ */ y(
1039
1179
  "a",
1040
1180
  {
1041
1181
  href: t,
@@ -1043,15 +1183,15 @@ const qt = ({
1043
1183
  rel: "noopener noreferrer",
1044
1184
  className: "text-primary hover:underline text-sm font-medium inline-flex items-center gap-1",
1045
1185
  children: [
1046
- /* @__PURE__ */ s("span", { className: "truncate max-w-[150px]", children: t }),
1047
- /* @__PURE__ */ s("span", { className: "text-xs", children: "↗" })
1186
+ /* @__PURE__ */ a("span", { className: "truncate max-w-[150px]", children: t }),
1187
+ /* @__PURE__ */ a("span", { className: "text-xs", children: "↗" })
1048
1188
  ]
1049
1189
  }
1050
1190
  );
1051
- }, lr = ({ value: e }) => {
1052
- if (!e) return /* @__PURE__ */ s(_, {});
1191
+ }, fr = ({ value: e }) => {
1192
+ if (!e) return /* @__PURE__ */ a($, {});
1053
1193
  const t = String(e);
1054
- return /* @__PURE__ */ s(
1194
+ return /* @__PURE__ */ a(
1055
1195
  "a",
1056
1196
  {
1057
1197
  href: `mailto:${t}`,
@@ -1059,10 +1199,10 @@ const qt = ({
1059
1199
  children: t
1060
1200
  }
1061
1201
  );
1062
- }, dr = ({ value: e }) => {
1063
- if (!e) return /* @__PURE__ */ s(_, {});
1202
+ }, yr = ({ value: e }) => {
1203
+ if (!e) return /* @__PURE__ */ a($, {});
1064
1204
  const t = String(e);
1065
- return /* @__PURE__ */ s(
1205
+ return /* @__PURE__ */ a(
1066
1206
  "a",
1067
1207
  {
1068
1208
  href: `tel:${t}`,
@@ -1070,78 +1210,115 @@ const qt = ({
1070
1210
  children: t
1071
1211
  }
1072
1212
  );
1073
- }, cr = ({ row: e, column: t, rowIndex: n }) => {
1074
- const o = S(e, t.key);
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 }) => {
1245
+ const o = P(e, t.key);
1075
1246
  if (t.render && typeof t.render == "function")
1076
- return /* @__PURE__ */ s(Se, { children: t.render(o, e, n) });
1247
+ return /* @__PURE__ */ a(Ce, { children: t.render(o, e, s) });
1077
1248
  if (t.formatter && typeof t.formatter == "function")
1078
- return /* @__PURE__ */ s(Se, { children: t.formatter(o, e, n) });
1249
+ return /* @__PURE__ */ a(Ce, { children: t.formatter(o, e, s) });
1079
1250
  switch (t.type) {
1080
1251
  case "boolean":
1081
- return /* @__PURE__ */ s(er, { value: o, column: t });
1252
+ return /* @__PURE__ */ a(ir, { value: o, column: t });
1082
1253
  case "number":
1083
- return /* @__PURE__ */ s(Qt, { value: o, column: t });
1254
+ return /* @__PURE__ */ a(or, { value: o, column: t });
1084
1255
  case "currency":
1085
- return /* @__PURE__ */ s(tr, { value: o, column: t });
1256
+ return /* @__PURE__ */ a(lr, { value: o, column: t });
1086
1257
  case "date":
1087
- return /* @__PURE__ */ s(Ke, { value: o, column: t, isDateTime: !1 });
1258
+ return /* @__PURE__ */ a(Ye, { value: o, column: t, isDateTime: !1 });
1088
1259
  case "datetime":
1089
- return /* @__PURE__ */ s(Ke, { value: o, column: t, isDateTime: !0 });
1260
+ return /* @__PURE__ */ a(Ye, { value: o, column: t, isDateTime: !0 });
1090
1261
  case "image":
1091
- return /* @__PURE__ */ s(rr, { value: o, column: t });
1262
+ return /* @__PURE__ */ a(dr, { value: o, column: t });
1092
1263
  case "status":
1093
- return /* @__PURE__ */ s(nr, { 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 });
1094
1271
  case "array":
1095
- return /* @__PURE__ */ s(sr, { value: o, column: t });
1272
+ return /* @__PURE__ */ a(mr, { value: o, column: t });
1096
1273
  case "object":
1097
- return /* @__PURE__ */ s(or, { value: o, column: t });
1274
+ return /* @__PURE__ */ a(ur, { value: o, column: t });
1098
1275
  case "url":
1099
- return /* @__PURE__ */ s(ir, { value: o, column: t });
1276
+ return /* @__PURE__ */ a(br, { value: o, column: t });
1100
1277
  case "email":
1101
- return /* @__PURE__ */ s(lr, { value: o, column: t });
1278
+ return /* @__PURE__ */ a(fr, { value: o, column: t });
1102
1279
  case "phone":
1103
- return /* @__PURE__ */ s(dr, { value: o, column: t });
1280
+ return /* @__PURE__ */ a(yr, { value: o, column: t });
1104
1281
  default:
1105
- return /* @__PURE__ */ s(Ze, { value: o, column: t });
1282
+ return /* @__PURE__ */ a(at, { value: o, column: t });
1106
1283
  }
1107
- }, gr = ({
1284
+ }, wr = ({
1108
1285
  isOpen: e,
1109
1286
  title: t,
1110
- message: n,
1287
+ message: s,
1111
1288
  confirmText: o = "Confirm",
1112
1289
  cancelText: l = "Cancel",
1113
- type: a = "danger",
1290
+ type: r = "danger",
1114
1291
  onClose: i,
1115
1292
  onConfirm: g,
1116
1293
  isLoading: c = !1
1117
- }) => (ye(() => {
1118
- const d = (r) => {
1119
- r.key === "Escape" && i();
1294
+ }) => (fe(() => {
1295
+ const d = (n) => {
1296
+ n.key === "Escape" && i();
1120
1297
  };
1121
1298
  return e && window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
1122
- }, [e, i]), e ? /* @__PURE__ */ s(
1299
+ }, [e, i]), e ? /* @__PURE__ */ a(
1123
1300
  "div",
1124
1301
  {
1125
1302
  className: "fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm any-table-fade-in",
1126
1303
  onClick: i,
1127
- children: /* @__PURE__ */ b(
1304
+ children: /* @__PURE__ */ y(
1128
1305
  "div",
1129
1306
  {
1130
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",
1131
1308
  onClick: (d) => d.stopPropagation(),
1132
1309
  role: "dialog",
1133
1310
  children: [
1134
- /* @__PURE__ */ s(
1311
+ /* @__PURE__ */ a(
1135
1312
  "div",
1136
1313
  {
1137
- className: `mx-auto mb-4 w-14 h-14 rounded-full flex items-center justify-center text-2xl ${a === "danger" ? "bg-rose-500/10 text-rose-500" : a === "warning" ? "bg-amber-500/10 text-amber-500" : "bg-blue-500/10 text-blue-500"}`,
1138
- children: a === "danger" ? "⚠️" : a === "warning" ? "⚡" : "ℹ️"
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"}`,
1315
+ children: r === "danger" ? "⚠️" : r === "warning" ? "⚡" : "ℹ️"
1139
1316
  }
1140
1317
  ),
1141
- /* @__PURE__ */ s("h3", { className: "text-xl font-black text-gray-900 dark:text-white mb-2", children: t }),
1142
- /* @__PURE__ */ s("p", { className: "text-sm text-gray-600 dark:text-gray-400 mb-6 leading-relaxed", children: n }),
1143
- /* @__PURE__ */ b("div", { className: "flex items-center justify-center gap-3", children: [
1144
- /* @__PURE__ */ s(
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(
1145
1322
  "button",
1146
1323
  {
1147
1324
  type: "button",
@@ -1151,13 +1328,13 @@ const qt = ({
1151
1328
  children: l
1152
1329
  }
1153
1330
  ),
1154
- /* @__PURE__ */ s(
1331
+ /* @__PURE__ */ a(
1155
1332
  "button",
1156
1333
  {
1157
1334
  type: "button",
1158
1335
  disabled: c,
1159
1336
  onClick: g,
1160
- className: `w-full py-2.5 px-4 rounded-xl font-bold text-sm text-white transition-all shadow-md active:scale-95 disabled:opacity-50 ${a === "danger" ? "bg-rose-600 hover:bg-rose-700 shadow-rose-600/30" : "bg-primary hover:bg-primary-soft shadow-primary/30"}`,
1337
+ className: `w-full py-2.5 px-4 rounded-xl font-bold text-sm text-white transition-all shadow-md active:scale-95 disabled:opacity-50 ${r === "danger" ? "bg-rose-600 hover:bg-rose-700 shadow-rose-600/30" : "bg-primary hover:bg-primary-soft shadow-primary/30"}`,
1161
1338
  children: c ? "Processing..." : o
1162
1339
  }
1163
1340
  )
@@ -1166,7 +1343,34 @@ const qt = ({
1166
1343
  }
1167
1344
  )
1168
1345
  }
1169
- ) : null), Ye = {
1346
+ ) : null);
1347
+ function nt(e, t) {
1348
+ if (!e) return null;
1349
+ if (Xe.isValidElement(e))
1350
+ return e;
1351
+ if (typeof e == "function") {
1352
+ if (e.prototype && e.prototype.isReactComponent)
1353
+ return /* @__PURE__ */ a(e, { className: "w-4 h-4 shrink-0" });
1354
+ const s = e.displayName || e.name || "";
1355
+ if (/^[A-Z]/.test(s))
1356
+ return /* @__PURE__ */ a(e, { className: "w-4 h-4 shrink-0" });
1357
+ try {
1358
+ const l = e(t);
1359
+ return nt(l, t);
1360
+ } catch {
1361
+ return /* @__PURE__ */ a(e, { className: "w-4 h-4 shrink-0" });
1362
+ }
1363
+ }
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(
1365
+ "img",
1366
+ {
1367
+ src: e,
1368
+ alt: "action-icon",
1369
+ className: "w-4 h-4 object-contain shrink-0 inline-block"
1370
+ }
1371
+ ) : /* @__PURE__ */ a("span", { className: "inline-flex items-center justify-center leading-none text-base", children: e }) : e;
1372
+ }
1373
+ const Je = {
1170
1374
  primary: "bg-primary text-white hover:bg-primary-soft shadow-sm shadow-primary/20",
1171
1375
  secondary: "bg-emerald-600 text-white hover:bg-emerald-700 shadow-sm shadow-emerald-600/20",
1172
1376
  success: "bg-emerald-500 text-white hover:bg-emerald-600 shadow-sm shadow-emerald-500/20",
@@ -1175,107 +1379,107 @@ const qt = ({
1175
1379
  info: "bg-sky-500 text-white hover:bg-sky-600 shadow-sm shadow-sky-500/20",
1176
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",
1177
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"
1178
- }, ur = ({ row: e, actions: t, context: n }) => {
1179
- const [o, l] = v(null), [a, i] = v({});
1382
+ }, Nr = ({ row: e, actions: t, context: s }) => {
1383
+ const [o, l] = S(null), [r, i] = S({});
1180
1384
  if (!t || !t.length)
1181
1385
  return null;
1182
- const g = async (r) => {
1183
- if (r.confirmation) {
1184
- const m = typeof r.confirmation.title == "function" ? r.confirmation.title(e) : r.confirmation.title || "Confirm Action", u = typeof r.confirmation.message == "function" ? r.confirmation.message(e) : r.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?";
1185
1389
  l({
1186
1390
  isOpen: !0,
1187
- title: m,
1188
- message: u,
1189
- confirmText: r.confirmation.confirmText || "Confirm",
1190
- cancelText: r.confirmation.cancelText || "Cancel",
1191
- type: r.confirmation.type || "danger",
1391
+ title: u,
1392
+ message: m,
1393
+ confirmText: n.confirmation.confirmText || "Confirm",
1394
+ cancelText: n.confirmation.cancelText || "Cancel",
1395
+ type: n.confirmation.type || "danger",
1192
1396
  onConfirm: async () => {
1193
- l(null), await c(r);
1397
+ l(null), await c(n);
1194
1398
  }
1195
1399
  });
1196
1400
  return;
1197
1401
  }
1198
- await c(r);
1199
- }, c = async (r) => {
1200
- if (r.type === "button" || !r.type) {
1201
- i((m) => ({ ...m, [r.id]: !0 }));
1402
+ await c(n);
1403
+ }, c = async (n) => {
1404
+ if (n.type === "button" || !n.type) {
1405
+ i((u) => ({ ...u, [n.id]: !0 }));
1202
1406
  try {
1203
- await r.onClick(e, n);
1407
+ await n.onClick(e, s);
1204
1408
  } finally {
1205
- i((m) => ({ ...m, [r.id]: !1 }));
1409
+ i((u) => ({ ...u, [n.id]: !1 }));
1206
1410
  }
1207
1411
  }
1208
- }, d = async (r, m) => {
1209
- const u = !m;
1210
- i((f) => ({ ...f, [r.id]: !0 }));
1412
+ }, d = async (n, u) => {
1413
+ const m = !u;
1414
+ i((b) => ({ ...b, [n.id]: !0 }));
1211
1415
  try {
1212
- await r.onChange(e, u, n);
1416
+ await n.onChange(e, m, s);
1213
1417
  } finally {
1214
- i((f) => ({ ...f, [r.id]: !1 }));
1418
+ i((b) => ({ ...b, [n.id]: !1 }));
1215
1419
  }
1216
1420
  };
1217
- return /* @__PURE__ */ b(Se, { children: [
1218
- /* @__PURE__ */ s("div", { className: "flex items-center justify-end gap-2 pr-2", children: t.map((r) => {
1219
- if (typeof r.hide == "function" && r.hide(e) || typeof r.show == "function" && !r.show(e)) return null;
1220
- const m = typeof r.disabled == "function" ? r.disabled(e) : !!r.disabled, u = a[r.id] || (typeof r.loading == "function" ? r.loading(e) : !!r.loading), f = typeof r.label == "function" ? r.label(e) : r.label, p = typeof r.icon == "function" ? r.icon(e) : r.icon, k = typeof r.tooltip == "function" ? r.tooltip(e) : r.tooltip, E = typeof r.className == "function" ? r.className(e) : r.className || "";
1221
- if (r.type === "custom" && r.render)
1222
- return /* @__PURE__ */ s(Nt.Fragment, { children: r.render(e, n) }, r.id);
1223
- if (r.type === "switch") {
1224
- const M = r, N = M.checked(e);
1225
- return /* @__PURE__ */ b(
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(
1226
1430
  "div",
1227
1431
  {
1228
1432
  className: "flex items-center gap-2",
1229
- title: k || f,
1433
+ title: k || b,
1230
1434
  children: [
1231
- f && /* @__PURE__ */ b("span", { className: "text-xs font-semibold text-gray-500", children: [
1232
- f,
1435
+ b && /* @__PURE__ */ y("span", { className: "text-xs font-semibold text-gray-500", children: [
1436
+ b,
1233
1437
  ":"
1234
1438
  ] }),
1235
- /* @__PURE__ */ s(
1439
+ /* @__PURE__ */ a(
1236
1440
  "button",
1237
1441
  {
1238
1442
  type: "button",
1239
1443
  role: "switch",
1240
- "aria-checked": N,
1241
- disabled: m || u,
1242
- onClick: () => d(M, N),
1243
- 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 ${N ? "bg-emerald-500" : "bg-gray-300 dark:bg-gray-700"} ${E}`,
1244
- children: /* @__PURE__ */ s(
1444
+ "aria-checked": w,
1445
+ disabled: u || m,
1446
+ onClick: () => d(N, w),
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}`,
1448
+ children: /* @__PURE__ */ a(
1245
1449
  "span",
1246
1450
  {
1247
1451
  "aria-hidden": "true",
1248
- 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 ${N ? "translate-x-5" : "translate-x-0"}`,
1249
- children: u && /* @__PURE__ */ s("span", { className: "w-2.5 h-2.5 border-2 border-primary border-t-transparent rounded-full animate-spin" })
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"}`,
1453
+ children: m && /* @__PURE__ */ a("span", { className: "w-2.5 h-2.5 border-2 border-primary border-t-transparent rounded-full animate-spin" })
1250
1454
  }
1251
1455
  )
1252
1456
  }
1253
1457
  )
1254
1458
  ]
1255
1459
  },
1256
- r.id
1460
+ n.id
1257
1461
  );
1258
1462
  }
1259
- const h = typeof r.variant == "function" ? r.variant(e) : r.variant || "neutral", D = Ye[h] || Ye.neutral;
1260
- return /* @__PURE__ */ b(
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(
1261
1465
  "button",
1262
1466
  {
1263
1467
  type: "button",
1264
- disabled: m || u,
1265
- onClick: () => g(r),
1468
+ disabled: u || m,
1469
+ onClick: () => g(n),
1266
1470
  title: k,
1267
- style: r.color ? { backgroundColor: r.color, color: "#ffffff" } : void 0,
1268
- className: `inline-flex items-center justify-center gap-1.5 px-3 py-1.5 rounded-xl text-xs font-bold transition-all duration-200 active:scale-95 disabled:cursor-not-allowed disabled:opacity-50 disabled:active:scale-100 ${D} ${E}`,
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}`,
1269
1473
  children: [
1270
- u ? /* @__PURE__ */ s("span", { className: "w-3.5 h-3.5 border-2 border-current border-t-transparent rounded-full animate-spin" }) : p && /* @__PURE__ */ s("span", { className: "text-sm", children: p }),
1271
- f && /* @__PURE__ */ s("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 })
1272
1476
  ]
1273
1477
  },
1274
- r.id
1478
+ n.id
1275
1479
  );
1276
1480
  }) }),
1277
- o && /* @__PURE__ */ s(
1278
- gr,
1481
+ o && /* @__PURE__ */ a(
1482
+ wr,
1279
1483
  {
1280
1484
  isOpen: o.isOpen,
1281
1485
  title: o.title,
@@ -1288,70 +1492,71 @@ const qt = ({
1288
1492
  }
1289
1493
  )
1290
1494
  ] });
1291
- }, mr = ({
1495
+ }, vr = ({
1292
1496
  rows: e,
1293
1497
  columns: t,
1294
- actions: n,
1498
+ actions: s,
1295
1499
  actionContext: o,
1296
1500
  rowKeyResolver: l,
1297
- selectable: a,
1501
+ selectable: r,
1298
1502
  selectedKeys: i,
1299
1503
  onToggleSelectRow: g,
1300
1504
  onRowClick: c,
1301
1505
  striped: d = !1,
1302
- hoverable: r = !0
1506
+ hoverable: n = !0,
1507
+ rowClassName: u
1303
1508
  }) => {
1304
- const m = ee(), u = !!(n && n.length > 0);
1305
- return /* @__PURE__ */ s("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, p) => {
1306
- const k = l(f, p), E = i?.has(k);
1307
- return /* @__PURE__ */ b(
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(
1308
1513
  "tr",
1309
1514
  {
1310
- onClick: (h) => c?.(f, p, h),
1311
- className: `${m.classes?.tr || "transition-colors duration-150"} ${d && p % 2 === 1 ? "bg-gray-50/40 dark:bg-slate-800/20" : ""} ${r ? "hover:bg-gray-50/70 dark:hover:bg-slate-800/50" : ""} ${E ? "bg-primary/5 dark:bg-primary/10" : ""} ${c ? "cursor-pointer" : ""}`,
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" : ""} ${_}`,
1312
1517
  children: [
1313
- a && /* @__PURE__ */ s(
1518
+ r && /* @__PURE__ */ a(
1314
1519
  "td",
1315
1520
  {
1316
1521
  className: "w-10 px-4 py-3 text-center align-middle",
1317
- onClick: (h) => h.stopPropagation(),
1318
- children: /* @__PURE__ */ s(
1522
+ onClick: (x) => x.stopPropagation(),
1523
+ children: /* @__PURE__ */ a(
1319
1524
  "input",
1320
1525
  {
1321
1526
  type: "checkbox",
1322
- checked: E,
1323
- onChange: () => g?.(k, f),
1527
+ checked: D,
1528
+ onChange: () => g?.(C, f),
1324
1529
  className: "w-4 h-4 rounded border-gray-300 dark:border-gray-600 text-primary focus:ring-primary/30 cursor-pointer"
1325
1530
  }
1326
1531
  )
1327
1532
  }
1328
1533
  ),
1329
- t.map((h) => {
1330
- const D = h.align === "center" ? "text-center" : h.align === "right" ? "text-right" : "text-left", M = typeof h.className == "function" ? h.className(f?.[h.key], f, p) : h.className || "";
1331
- return /* @__PURE__ */ s(
1534
+ t.map((x) => {
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(
1332
1537
  "td",
1333
1538
  {
1334
1539
  style: {
1335
- width: h.width,
1336
- minWidth: h.minWidth,
1337
- maxWidth: h.maxWidth
1540
+ width: x.width,
1541
+ minWidth: x.minWidth,
1542
+ maxWidth: x.maxWidth
1338
1543
  },
1339
- className: `${m.classes?.td || "py-3 px-4 text-sm align-middle"} ${D} ${M}`,
1340
- children: /* @__PURE__ */ s(cr, { row: f, column: h, rowIndex: p })
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 })
1341
1546
  },
1342
- String(h.key)
1547
+ String(x.key)
1343
1548
  );
1344
1549
  }),
1345
- u && /* @__PURE__ */ s(
1550
+ b && /* @__PURE__ */ a(
1346
1551
  "td",
1347
1552
  {
1348
1553
  className: `${m.classes?.td || "py-3 px-4 text-sm align-middle"} text-right`,
1349
- onClick: (h) => h.stopPropagation(),
1350
- children: /* @__PURE__ */ s(
1351
- ur,
1554
+ onClick: (x) => x.stopPropagation(),
1555
+ children: /* @__PURE__ */ a(
1556
+ Nr,
1352
1557
  {
1353
1558
  row: f,
1354
- actions: n || [],
1559
+ actions: s || [],
1355
1560
  context: o
1356
1561
  }
1357
1562
  )
@@ -1359,93 +1564,93 @@ const qt = ({
1359
1564
  )
1360
1565
  ]
1361
1566
  },
1362
- String(k)
1567
+ String(C)
1363
1568
  );
1364
1569
  }) });
1365
- }, fr = ({
1570
+ }, Ar = ({
1366
1571
  page: e,
1367
1572
  pageSize: t,
1368
- totalRecords: n,
1573
+ totalRecords: s,
1369
1574
  totalPages: o,
1370
1575
  pageSizeOptions: l = [5, 10, 20, 50, 100],
1371
- onPageChange: a,
1576
+ onPageChange: r,
1372
1577
  onPageSizeChange: i,
1373
1578
  showPageSizeSelector: g = !0,
1374
1579
  showTotalCount: c = !0,
1375
1580
  pageWindow: d
1376
1581
  }) => {
1377
- const r = ee(), m = Math.min((e - 1) * t + 1, n), u = Math.min(e * t, n);
1378
- return /* @__PURE__ */ b(
1582
+ const n = ee(), u = Math.min((e - 1) * t + 1, s), m = Math.min(e * t, s);
1583
+ return /* @__PURE__ */ y(
1379
1584
  "div",
1380
1585
  {
1381
- className: r.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",
1382
1587
  children: [
1383
- /* @__PURE__ */ b("div", { className: "flex items-center gap-3", children: [
1384
- c && n > 0 ? /* @__PURE__ */ b("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: [
1385
1590
  "Showing ",
1386
- /* @__PURE__ */ s("strong", { className: "text-gray-900 dark:text-white font-bold", children: m }),
1591
+ /* @__PURE__ */ a("strong", { className: "text-gray-900 dark:text-white font-bold", children: u }),
1387
1592
  " to",
1388
1593
  " ",
1389
- /* @__PURE__ */ s("strong", { className: "text-gray-900 dark:text-white font-bold", children: u }),
1594
+ /* @__PURE__ */ a("strong", { className: "text-gray-900 dark:text-white font-bold", children: m }),
1390
1595
  " of",
1391
1596
  " ",
1392
- /* @__PURE__ */ s("strong", { className: "text-gray-900 dark:text-white font-bold", children: n.toLocaleString() }),
1597
+ /* @__PURE__ */ a("strong", { className: "text-gray-900 dark:text-white font-bold", children: s.toLocaleString() }),
1393
1598
  " results"
1394
- ] }) : /* @__PURE__ */ b("span", { className: "text-xs sm:text-sm font-medium", children: [
1599
+ ] }) : /* @__PURE__ */ y("span", { className: "text-xs sm:text-sm font-medium", children: [
1395
1600
  "Page ",
1396
1601
  e,
1397
1602
  " of ",
1398
1603
  o
1399
1604
  ] }),
1400
- g && /* @__PURE__ */ b("div", { className: "flex items-center gap-2 ml-2", children: [
1401
- /* @__PURE__ */ s("span", { className: "text-xs text-gray-500 hidden sm:inline", children: "Rows:" }),
1402
- /* @__PURE__ */ s(
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(
1403
1608
  "select",
1404
1609
  {
1405
1610
  value: t,
1406
- onChange: (f) => i(Number(f.target.value)),
1407
- className: r.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",
1408
- children: l.map((f) => /* @__PURE__ */ b("option", { value: f, className: "bg-white dark:bg-slate-800 text-gray-900 dark:text-white", children: [
1409
- 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,
1410
1615
  " / page"
1411
- ] }, f))
1616
+ ] }, b))
1412
1617
  }
1413
1618
  )
1414
1619
  ] })
1415
1620
  ] }),
1416
- /* @__PURE__ */ b("div", { className: "flex items-center gap-1.5 ml-auto", children: [
1417
- /* @__PURE__ */ s(
1621
+ /* @__PURE__ */ y("div", { className: "flex items-center gap-1.5 ml-auto", children: [
1622
+ /* @__PURE__ */ a(
1418
1623
  "button",
1419
1624
  {
1420
1625
  type: "button",
1421
1626
  disabled: e <= 1,
1422
- onClick: () => a(e - 1),
1627
+ onClick: () => r(e - 1),
1423
1628
  "aria-label": "Previous Page",
1424
- className: `${r.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"}`,
1425
1630
  children: "‹"
1426
1631
  }
1427
1632
  ),
1428
- d.map((f) => {
1429
- const p = f === e;
1430
- return /* @__PURE__ */ s(
1633
+ d.map((b) => {
1634
+ const f = b === e;
1635
+ return /* @__PURE__ */ a(
1431
1636
  "button",
1432
1637
  {
1433
1638
  type: "button",
1434
- onClick: () => a(f),
1435
- className: `${r.classes?.paginationButton || "h-8 min-w-[32px] px-2.5 flex items-center justify-center rounded-xl font-bold text-xs"} ${p ? r.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"}`,
1436
- 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
1437
1642
  },
1438
- f
1643
+ b
1439
1644
  );
1440
1645
  }),
1441
- /* @__PURE__ */ s(
1646
+ /* @__PURE__ */ a(
1442
1647
  "button",
1443
1648
  {
1444
1649
  type: "button",
1445
1650
  disabled: e >= o,
1446
- onClick: () => a(e + 1),
1651
+ onClick: () => r(e + 1),
1447
1652
  "aria-label": "Next Page",
1448
- className: `${r.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"}`,
1449
1654
  children: "›"
1450
1655
  }
1451
1656
  )
@@ -1453,12 +1658,12 @@ const qt = ({
1453
1658
  ]
1454
1659
  }
1455
1660
  );
1456
- }, br = ({
1661
+ }, Cr = ({
1457
1662
  columnsCount: e = 5,
1458
1663
  rowsCount: t = 5,
1459
- hasActions: n = !0
1460
- }) => /* @__PURE__ */ s("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__ */ b("tr", { className: "any-table-pulse", children: [
1461
- Array.from({ length: e }).map((a, i) => /* @__PURE__ */ s("td", { className: "py-4 px-4 align-middle", children: /* @__PURE__ */ s(
1664
+ hasActions: s = !0
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(
1462
1667
  "div",
1463
1668
  {
1464
1669
  className: "h-4 bg-gray-200 dark:bg-slate-700/60 rounded-md",
@@ -1467,20 +1672,20 @@ const qt = ({
1467
1672
  }
1468
1673
  }
1469
1674
  ) }, i)),
1470
- n && /* @__PURE__ */ s("td", { className: "py-4 px-4 text-right align-middle pr-6", children: /* @__PURE__ */ b("div", { className: "inline-flex gap-2 justify-end", children: [
1471
- /* @__PURE__ */ s("div", { className: "w-14 h-7 bg-gray-200 dark:bg-slate-700/60 rounded-xl" }),
1472
- /* @__PURE__ */ s("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" })
1473
1678
  ] }) })
1474
- ] }, l)) }), yr = ({
1679
+ ] }, l)) }), Sr = ({
1475
1680
  title: e,
1476
1681
  description: t,
1477
- isSearchActive: n = !1,
1682
+ isSearchActive: s = !1,
1478
1683
  onClearSearch: o
1479
- }) => /* @__PURE__ */ b("div", { className: "w-full py-16 px-6 flex flex-col items-center justify-center text-center any-table-fade-in", children: [
1480
- /* @__PURE__ */ s("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: n ? "🔍" : "📂" }),
1481
- /* @__PURE__ */ s("h3", { className: "text-lg font-bold text-gray-800 dark:text-gray-200 mb-1", children: e || (n ? "No matching records found" : "No data available") }),
1482
- /* @__PURE__ */ s("p", { className: "text-sm text-gray-500 dark:text-gray-400 max-w-sm mb-5 leading-relaxed", children: t || (n ? "Try adjusting your search criteria or clear the search filter." : "There are currently no records to display.") }),
1483
- n && o && /* @__PURE__ */ s(
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(
1484
1689
  "button",
1485
1690
  {
1486
1691
  type: "button",
@@ -1489,145 +1694,148 @@ const qt = ({
1489
1694
  children: "Clear Search Filter"
1490
1695
  }
1491
1696
  )
1492
- ] }), hr = ({ error: e, onRetry: t }) => {
1493
- const n = typeof e == "string" ? e : e?.message || e?.response?.data?.message || "Failed to load table data.";
1494
- return /* @__PURE__ */ b("div", { className: "w-full py-14 px-6 flex flex-col items-center justify-center text-center any-table-fade-in", children: [
1495
- /* @__PURE__ */ s("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: "⚠️" }),
1496
- /* @__PURE__ */ s("h3", { className: "text-lg font-bold text-gray-800 dark:text-gray-200 mb-1", children: "Unable to load data" }),
1497
- /* @__PURE__ */ s("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: n }),
1498
- t && /* @__PURE__ */ b(
1697
+ ] }), Tr = ({ error: e, onRetry: t }) => {
1698
+ const s = typeof e == "string" ? e : e?.message || e?.response?.data?.message || "Failed to load table data.";
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(
1499
1704
  "button",
1500
1705
  {
1501
1706
  type: "button",
1502
1707
  onClick: t,
1503
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",
1504
1709
  children: [
1505
- /* @__PURE__ */ s("span", { children: "🔄" }),
1506
- /* @__PURE__ */ s("span", { children: "Retry Request" })
1710
+ /* @__PURE__ */ a("span", { children: "🔄" }),
1711
+ /* @__PURE__ */ a("span", { children: "Retry Request" })
1507
1712
  ]
1508
1713
  }
1509
1714
  )
1510
1715
  ] });
1511
1716
  };
1512
- function pr(e) {
1717
+ function qe(e) {
1513
1718
  const {
1514
1719
  data: t,
1515
- api: n,
1720
+ api: s,
1516
1721
  columns: o,
1517
1722
  autoColumns: l = !0,
1518
- rowKey: a,
1723
+ rowKey: r,
1519
1724
  title: i,
1520
1725
  subtitle: g,
1521
1726
  actions: c,
1522
1727
  actionsTitle: d = "Actions",
1523
- actionsWidth: r,
1524
- search: m = !0,
1525
- sorting: u = !0,
1526
- pagination: f = !0,
1527
- selectable: p = !1,
1728
+ actionsWidth: n,
1729
+ search: u = !0,
1730
+ sorting: m = !0,
1731
+ pagination: b = !0,
1732
+ selectable: f = !1,
1528
1733
  onSelectionChange: k,
1529
- onRowClick: E,
1530
- loading: h,
1531
- loadingComponent: D,
1532
- emptyComponent: M,
1734
+ onRowClick: C,
1735
+ loading: D,
1736
+ loadingComponent: _,
1737
+ emptyComponent: x,
1533
1738
  emptyTitle: N,
1534
- emptyDescription: A,
1535
- errorComponent: j,
1739
+ emptyDescription: w,
1740
+ errorComponent: R,
1536
1741
  className: H = "",
1537
- tableClassName: W = "",
1538
- headerActions: te,
1539
- showHeader: B = !0,
1540
- bordered: z = !0,
1541
- striped: R = !1,
1542
- hoverable: re = !0,
1543
- stickyHeader: G = !1,
1544
- tableRef: Y,
1742
+ tableClassName: L = "",
1743
+ headerClassName: ye = "",
1744
+ rowClassName: j,
1745
+ headerActions: F,
1746
+ showHeader: U = !0,
1747
+ bordered: te = !0,
1748
+ striped: V = !1,
1749
+ hoverable: Y = !0,
1750
+ compact: K = !1,
1751
+ stickyHeader: Z = !1,
1752
+ tableRef: B,
1545
1753
  // Legacy Wasel Props
1546
1754
  thead: I,
1547
- headerData: U,
1548
- tbodys: T,
1549
- titleHeader: V,
1550
- add: Pe,
1551
- linkAdd: Ee,
1552
- addHandler: $e,
1553
- view: De,
1554
- linkView: ae,
1555
- viewHandler: ne,
1556
- edit: Me,
1557
- linkEdit: se,
1558
- editHandler: oe,
1559
- del: _e,
1755
+ headerData: Pe,
1756
+ tbodys: Ee,
1757
+ titleHeader: st,
1758
+ add: Be,
1759
+ linkAdd: $e,
1760
+ addHandler: De,
1761
+ view: Me,
1762
+ linkView: re,
1763
+ viewHandler: ae,
1764
+ edit: _e,
1765
+ linkEdit: ne,
1766
+ editHandler: se,
1767
+ del: je,
1560
1768
  handleDelete: he,
1561
- block: Be,
1769
+ block: Fe,
1562
1770
  handleBlock: pe,
1563
- buttons: ie
1564
- } = e, xe = ee(), le = O(() => t || T || void 0, [t, T]), K = O(() => jt({
1565
- data: le,
1771
+ buttons: oe
1772
+ } = e, v = ee(), ie = W(() => t || Ee || void 0, [t, Ee]), G = W(() => Ut({
1773
+ data: ie,
1566
1774
  columns: o,
1567
1775
  autoColumns: l,
1568
1776
  thead: I,
1569
- headerData: U
1570
- }).filter((y) => typeof y.hidden == "function" ? !y.hidden({ data: le || [] }) : !y.hidden), [le, o, l, I, U]), F = w(
1571
- (x, y) => {
1572
- if (typeof a == "function")
1573
- return a(x, y);
1574
- if (typeof a == "string") {
1575
- const $ = S(x, a);
1576
- if ($ != null) return $;
1777
+ headerData: Pe
1778
+ }).filter((h) => typeof h.hidden == "function" ? !h.hidden({ data: ie || [] }) : !h.hidden), [ie, o, l, I, Pe]), O = A(
1779
+ (p, h) => {
1780
+ if (typeof r == "function")
1781
+ return r(p, h);
1782
+ if (typeof r == "string") {
1783
+ const M = P(p, r);
1784
+ if (M != null) return M;
1577
1785
  }
1578
- const P = x?._id ?? x?.id ?? x?.key;
1579
- return P ?? y;
1786
+ const E = p?._id ?? p?.id ?? p?.key;
1787
+ return E ?? h;
1580
1788
  },
1581
- [a]
1789
+ [r]
1582
1790
  ), {
1583
- enabled: je,
1584
- search: ze,
1585
- debouncedSearch: Le,
1586
- isDebouncing: qe,
1587
- setSearch: Oe,
1588
- clearSearch: ke,
1589
- searchConfig: Xe
1590
- } = zt({ config: m }), {
1591
- enabled: Qe,
1592
- sortBy: Ne,
1791
+ enabled: We,
1792
+ search: Re,
1793
+ debouncedSearch: ze,
1794
+ isDebouncing: ot,
1795
+ setSearch: Le,
1796
+ clearSearch: xe,
1797
+ searchConfig: it
1798
+ } = Kt({ config: u }), {
1799
+ enabled: lt,
1800
+ sortBy: ke,
1593
1801
  sortOrder: we,
1594
- toggleSort: et,
1595
- setSorting: tt,
1596
- resetSorting: rt
1597
- } = Lt({ config: u }), We = O(() => {
1598
- const x = [...c || []];
1599
- return ie && Array.isArray(ie) && ie.forEach((y, P) => {
1600
- x.push({
1601
- id: `legacy-btn-${P}`,
1602
- label: y.label,
1603
- icon: y.icon,
1604
- className: y.className,
1605
- show: y.show,
1606
- hide: y.hide,
1607
- onClick: ($) => y.onClick($)
1802
+ toggleSort: dt,
1803
+ setSorting: ct,
1804
+ resetSorting: gt
1805
+ } = It({ config: m }), Oe = W(() => {
1806
+ const p = [...c || []];
1807
+ return oe && Array.isArray(oe) && oe.forEach((h, E) => {
1808
+ p.push({
1809
+ id: `legacy-btn-${E}`,
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)
1608
1816
  });
1609
- }), Be && pe && x.push({
1817
+ }), Fe && pe && p.push({
1610
1818
  id: "legacy-block",
1611
- label: (y) => y.isBanned || !y.isActive ? "Unblock" : "Block",
1612
- variant: (y) => y.isBanned || !y.isActive ? "success" : "danger",
1613
- onClick: (y) => pe(y?._id || y?.id)
1614
- }), De && (ne || ae) && x.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({
1615
1823
  id: "legacy-view",
1616
1824
  label: "View",
1617
1825
  variant: "primary",
1618
- onClick: (y) => {
1619
- const P = y?._id || y?.id;
1620
- ne ? ne(P) : ae && typeof window < "u" && (window.location.href = `${ae}/${P}`);
1826
+ onClick: (h) => {
1827
+ const E = h?._id || h?.id;
1828
+ ae ? ae(E) : re && typeof window < "u" && (window.location.href = `${re}/${E}`);
1621
1829
  }
1622
- }), Me && (oe || se) && x.push({
1830
+ }), _e && (se || ne) && p.push({
1623
1831
  id: "legacy-edit",
1624
1832
  label: "Edit",
1625
1833
  variant: "info",
1626
- onClick: (y) => {
1627
- const P = y?._id || y?.id;
1628
- oe ? oe(P) : se && typeof window < "u" && (window.location.href = `${se}/${P}`);
1834
+ onClick: (h) => {
1835
+ const E = h?._id || h?.id;
1836
+ se ? se(E) : ne && typeof window < "u" && (window.location.href = `${ne}/${E}`);
1629
1837
  }
1630
- }), _e && he && x.push({
1838
+ }), je && he && p.push({
1631
1839
  id: "legacy-del",
1632
1840
  label: "Delete",
1633
1841
  variant: "danger",
@@ -1635,296 +1843,311 @@ function pr(e) {
1635
1843
  title: "Delete Item",
1636
1844
  message: "Are you sure you want to delete this record?"
1637
1845
  },
1638
- onClick: (y) => he(y?._id || y?.id)
1639
- }), x;
1846
+ onClick: (h) => he(h?._id || h?.id)
1847
+ }), p;
1640
1848
  }, [
1641
1849
  c,
1642
- ie,
1643
- Be,
1850
+ oe,
1851
+ Fe,
1644
1852
  pe,
1645
- De,
1853
+ Me,
1854
+ re,
1646
1855
  ae,
1856
+ _e,
1647
1857
  ne,
1648
- Me,
1649
1858
  se,
1650
- oe,
1651
- _e,
1859
+ je,
1652
1860
  he
1653
- ]), [at, nt] = v(1), [st, ot] = v(10), {
1654
- rows: C,
1655
- totalRecords: ve,
1656
- loading: de,
1861
+ ]), [mt, ut] = S(1), [bt, ft] = S(10), {
1862
+ rows: T,
1863
+ totalRecords: Ne,
1864
+ loading: le,
1657
1865
  error: J,
1658
- refresh: Z,
1659
- isServerMode: it
1660
- } = Yt({
1661
- data: le,
1662
- api: n,
1663
- columns: K,
1664
- searchQuery: Le,
1665
- sortBy: Ne,
1866
+ refresh: q,
1867
+ isServerMode: yt
1868
+ } = tr({
1869
+ data: ie,
1870
+ api: s,
1871
+ columns: G,
1872
+ searchQuery: ze,
1873
+ sortBy: ke,
1666
1874
  sortOrder: we,
1667
- page: at,
1668
- pageSize: st,
1669
- manualLoading: h
1875
+ page: mt,
1876
+ pageSize: bt,
1877
+ manualLoading: D
1670
1878
  }), {
1671
- enabled: lt,
1672
- page: ce,
1673
- pageSize: Ae,
1674
- totalPages: Ie,
1675
- pageSizeOptions: dt,
1676
- setPage: ge,
1677
- setPageSize: Fe,
1678
- resetPagination: ct,
1679
- getPageWindow: gt,
1680
- paginationConfig: He
1681
- } = Ot({
1682
- config: f,
1683
- totalRecords: ve,
1684
- onPageChange: (x, y) => {
1685
- nt(x), ot(y);
1879
+ enabled: ht,
1880
+ page: de,
1881
+ pageSize: ve,
1882
+ totalPages: He,
1883
+ pageSizeOptions: pt,
1884
+ setPage: ce,
1885
+ setPageSize: Ue,
1886
+ resetPagination: xt,
1887
+ getPageWindow: kt,
1888
+ paginationConfig: Ke
1889
+ } = Gt({
1890
+ config: b,
1891
+ totalRecords: Ne,
1892
+ onPageChange: (p, h) => {
1893
+ ut(p), ft(h);
1686
1894
  }
1687
- }), [L, ue] = v(/* @__PURE__ */ new Set()), ut = w(
1688
- (x, y) => {
1689
- ue((P) => {
1690
- const $ = new Set(P);
1691
- if ($.has(x) ? $.delete(x) : $.add(x), k) {
1692
- const pt = C.filter((xt, kt) => $.has(F(xt, kt)));
1693
- k(pt, Array.from($));
1895
+ }), [z, ge] = S(/* @__PURE__ */ new Set()), wt = A(
1896
+ (p, h) => {
1897
+ ge((E) => {
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));
1694
1902
  }
1695
- return $;
1903
+ return M;
1696
1904
  });
1697
1905
  },
1698
- [C, F, k]
1699
- ), mt = w(() => {
1700
- if (L.size === C.length && C.length > 0)
1701
- ue(/* @__PURE__ */ new Set()), k?.([], []);
1906
+ [T, O, k]
1907
+ ), Nt = A(() => {
1908
+ if (z.size === T.length && T.length > 0)
1909
+ ge(/* @__PURE__ */ new Set()), k?.([], []);
1702
1910
  else {
1703
- const x = new Set(C.map((y, P) => F(y, P)));
1704
- ue(x), k?.(C, Array.from(x));
1911
+ const p = new Set(T.map((h, E) => O(h, E)));
1912
+ ge(p), k?.(T, Array.from(p));
1705
1913
  }
1706
- }, [C, L.size, F, k]), ft = w(() => {
1707
- ue(/* @__PURE__ */ new Set()), k?.([], []);
1708
- }, [k]), bt = C.length > 0 && L.size === C.length, yt = L.size > 0 && L.size < C.length, Ce = O(
1914
+ }, [T, z.size, O, k]), vt = A(() => {
1915
+ ge(/* @__PURE__ */ new Set()), k?.([], []);
1916
+ }, [k]), At = T.length > 0 && z.size === T.length, Ct = z.size > 0 && z.size < T.length, Ae = W(
1709
1917
  () => ({
1710
- refresh: Z,
1711
- loading: de,
1712
- page: ce,
1713
- selectedRows: C.filter((x, y) => L.has(F(x, y))),
1714
- setPage: ge
1918
+ refresh: q,
1919
+ loading: le,
1920
+ page: de,
1921
+ selectedRows: T.filter((p, h) => z.has(O(p, h))),
1922
+ setPage: ce
1715
1923
  }),
1716
- [Z, de, ce, C, L, F, ge]
1924
+ [q, le, de, T, z, O, ce]
1717
1925
  );
1718
- Vt({
1719
- tableRef: Y,
1720
- refresh: Z,
1721
- resetPagination: ct,
1722
- resetSearch: ke,
1723
- resetSorting: rt,
1724
- setPage: ge,
1725
- setPageSize: Fe,
1726
- setSearch: Oe,
1727
- setSorting: tt,
1728
- selectedRows: Ce.selectedRows,
1729
- clearSelection: ft,
1926
+ rr({
1927
+ tableRef: B,
1928
+ refresh: q,
1929
+ resetPagination: xt,
1930
+ resetSearch: xe,
1931
+ resetSorting: gt,
1932
+ setPage: ce,
1933
+ setPageSize: Ue,
1934
+ setSearch: Le,
1935
+ setSorting: ct,
1936
+ selectedRows: Ae.selectedRows,
1937
+ clearSelection: vt,
1730
1938
  getState: () => ({
1731
- data: C,
1732
- loading: de,
1939
+ data: T,
1940
+ loading: le,
1733
1941
  error: J,
1734
- page: ce,
1735
- pageSize: Ae,
1736
- total: ve,
1737
- totalPages: Ie,
1738
- search: ze,
1739
- sortBy: Ne,
1942
+ page: de,
1943
+ pageSize: ve,
1944
+ total: Ne,
1945
+ totalPages: He,
1946
+ search: Re,
1947
+ sortBy: ke,
1740
1948
  sortOrder: we,
1741
- selectedRowKeys: Array.from(L),
1742
- selectedRows: Ce.selectedRows,
1743
- isServerMode: it
1949
+ selectedRowKeys: Array.from(z),
1950
+ selectedRows: Ae.selectedRows,
1951
+ isServerMode: yt
1744
1952
  })
1745
1953
  });
1746
- const q = i || V, me = We.length > 0, ht = !!(q || g || je || te || Pe);
1747
- return /* @__PURE__ */ b("div", { className: `any-table-wrapper ${xe.classes?.container || "w-full flex flex-col gap-4 font-sans"} ${H}`, children: [
1748
- ht && /* @__PURE__ */ b("div", { className: "w-full flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4 mb-1", children: [
1749
- (q || g) && /* @__PURE__ */ b("div", { className: "flex flex-col", children: [
1750
- q && /* @__PURE__ */ b("h2", { className: "text-xl sm:text-2xl font-black text-gray-900 dark:text-white tracking-tight flex items-center gap-2.5", children: [
1751
- /* @__PURE__ */ s("span", { className: "w-1.5 h-6 bg-primary rounded-full inline-block" }),
1752
- q
1954
+ const X = i || st, me = Oe.length > 0, St = !!(X || g || We || F || Be), Tt = W(() => {
1955
+ const p = {};
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(
1959
+ "div",
1960
+ {
1961
+ style: Tt,
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}`,
1963
+ children: [
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 })
1968
+ ] }),
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(
1971
+ nr,
1972
+ {
1973
+ value: Re,
1974
+ onChange: Le,
1975
+ onClear: xe,
1976
+ isDebouncing: ot,
1977
+ placeholder: it.placeholder
1978
+ }
1979
+ ),
1980
+ F,
1981
+ Be && /* @__PURE__ */ y(
1982
+ "button",
1983
+ {
1984
+ type: "button",
1985
+ onClick: () => {
1986
+ De ? De() : $e && typeof window < "u" && (window.location.href = $e);
1987
+ },
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",
1989
+ children: [
1990
+ /* @__PURE__ */ a("span", { children: "+" }),
1991
+ /* @__PURE__ */ y("span", { children: [
1992
+ "Add ",
1993
+ X || "Record"
1994
+ ] })
1995
+ ]
1996
+ }
1997
+ )
1998
+ ] })
1753
1999
  ] }),
1754
- g && /* @__PURE__ */ s("p", { className: "text-xs sm:text-sm text-gray-500 dark:text-gray-400 font-medium mt-0.5 pl-4", children: g })
1755
- ] }),
1756
- /* @__PURE__ */ b("div", { className: "flex flex-wrap items-center gap-3 w-full sm:w-auto justify-start sm:justify-end ml-auto", children: [
1757
- je && /* @__PURE__ */ s(
1758
- qt,
1759
- {
1760
- value: ze,
1761
- onChange: Oe,
1762
- onClear: ke,
1763
- isDebouncing: qe,
1764
- placeholder: Xe.placeholder
1765
- }
1766
- ),
1767
- te,
1768
- Pe && /* @__PURE__ */ b(
1769
- "button",
1770
- {
1771
- type: "button",
1772
- onClick: () => {
1773
- $e ? $e() : Ee && typeof window < "u" && (window.location.href = Ee);
1774
- },
1775
- 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",
1776
- children: [
1777
- /* @__PURE__ */ s("span", { children: "+" }),
1778
- /* @__PURE__ */ b("span", { children: [
1779
- "Add ",
1780
- q || "Record"
1781
- ] })
1782
- ]
1783
- }
1784
- )
1785
- ] })
1786
- ] }),
1787
- /* @__PURE__ */ s(
1788
- "div",
1789
- {
1790
- className: `${xe.classes?.tableWrapper || "w-full overflow-x-auto rounded-2xl border bg-white dark:bg-slate-900"} ${z ? "border border-gray-200 dark:border-gray-800" : ""}`,
1791
- children: J ? typeof j == "function" ? j(J, Z) : j || /* @__PURE__ */ s(hr, { error: J, onRetry: Z }) : /* @__PURE__ */ b(
1792
- "table",
2000
+ /* @__PURE__ */ a(
2001
+ "div",
1793
2002
  {
1794
- className: `${xe.classes?.table || "w-full border-collapse text-left text-sm"} ${G ? "relative" : ""} ${W}`,
1795
- children: [
1796
- B && /* @__PURE__ */ s(
1797
- Xt,
1798
- {
1799
- columns: K,
1800
- hasActions: me,
1801
- actionsTitle: d,
1802
- actionsWidth: r,
1803
- sortBy: Ne,
1804
- sortOrder: we,
1805
- onSort: Qe ? et : void 0,
1806
- selectable: p,
1807
- allSelected: bt,
1808
- isIndeterminate: yt,
1809
- onToggleSelectAll: mt
1810
- }
1811
- ),
1812
- de && C.length === 0 ? D ? /* @__PURE__ */ s("tbody", { children: /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s("td", { colSpan: K.length + (p ? 1 : 0) + (me ? 1 : 0), children: D }) }) }) : /* @__PURE__ */ s(
1813
- br,
1814
- {
1815
- columnsCount: K.length + (p ? 1 : 0),
1816
- rowsCount: Ae || 5,
1817
- hasActions: me
1818
- }
1819
- ) : C.length === 0 ? (
1820
- /* Empty State */
1821
- /* @__PURE__ */ s("tbody", { children: /* @__PURE__ */ s("tr", { children: /* @__PURE__ */ s(
1822
- "td",
1823
- {
1824
- colSpan: K.length + (p ? 1 : 0) + (me ? 1 : 0),
1825
- className: "p-0",
1826
- children: M || /* @__PURE__ */ s(
1827
- yr,
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(
2006
+ "table",
2007
+ {
2008
+ className: `${v.classes?.table || "w-full border-collapse text-left text-sm"} ${K || v.density === "compact" ? "text-xs" : ""} ${Z ? "relative" : ""} ${L}`,
2009
+ children: [
2010
+ U && /* @__PURE__ */ a(
2011
+ sr,
2012
+ {
2013
+ columns: G,
2014
+ hasActions: me,
2015
+ actionsTitle: d,
2016
+ actionsWidth: n,
2017
+ sortBy: ke,
2018
+ sortOrder: we,
2019
+ onSort: lt ? dt : void 0,
2020
+ selectable: f,
2021
+ allSelected: At,
2022
+ isIndeterminate: Ct,
2023
+ onToggleSelectAll: Nt,
2024
+ headerClassName: ye
2025
+ }
2026
+ ),
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,
2029
+ {
2030
+ columnsCount: G.length + (f ? 1 : 0),
2031
+ rowsCount: ve || 5,
2032
+ hasActions: me
2033
+ }
2034
+ ) : T.length === 0 ? (
2035
+ /* Empty State */
2036
+ /* @__PURE__ */ a("tbody", { children: /* @__PURE__ */ a("tr", { children: /* @__PURE__ */ a(
2037
+ "td",
1828
2038
  {
1829
- title: N,
1830
- description: A,
1831
- isSearchActive: !!Le,
1832
- onClearSearch: ke
2039
+ colSpan: G.length + (f ? 1 : 0) + (me ? 1 : 0),
2040
+ className: "p-0",
2041
+ children: x || /* @__PURE__ */ a(
2042
+ Sr,
2043
+ {
2044
+ title: N,
2045
+ description: w,
2046
+ isSearchActive: !!ze,
2047
+ onClearSearch: xe
2048
+ }
2049
+ )
2050
+ }
2051
+ ) }) })
2052
+ ) : (
2053
+ /* Body Rows */
2054
+ /* @__PURE__ */ a(
2055
+ vr,
2056
+ {
2057
+ rows: T,
2058
+ columns: G,
2059
+ actions: Oe,
2060
+ actionContext: Ae,
2061
+ rowKeyResolver: O,
2062
+ selectable: f,
2063
+ selectedKeys: z,
2064
+ onToggleSelectRow: wt,
2065
+ onRowClick: C,
2066
+ striped: V,
2067
+ hoverable: Y,
2068
+ rowClassName: j
1833
2069
  }
1834
2070
  )
1835
- }
1836
- ) }) })
1837
- ) : (
1838
- /* Body Rows */
1839
- /* @__PURE__ */ s(
1840
- mr,
1841
- {
1842
- rows: C,
1843
- columns: K,
1844
- actions: We,
1845
- actionContext: Ce,
1846
- rowKeyResolver: F,
1847
- selectable: p,
1848
- selectedKeys: L,
1849
- onToggleSelectRow: ut,
1850
- onRowClick: E,
1851
- striped: R,
1852
- hoverable: re
1853
- }
1854
- )
1855
- )
1856
- ]
2071
+ )
2072
+ ]
2073
+ }
2074
+ )
2075
+ }
2076
+ ),
2077
+ ht && !J && /* @__PURE__ */ a(
2078
+ Ar,
2079
+ {
2080
+ page: de,
2081
+ pageSize: ve,
2082
+ totalRecords: Ne,
2083
+ totalPages: He,
2084
+ pageSizeOptions: pt,
2085
+ onPageChange: ce,
2086
+ onPageSizeChange: Ue,
2087
+ showPageSizeSelector: Ke.showPageSizeSelector,
2088
+ showTotalCount: Ke.showTotalCount,
2089
+ pageWindow: kt(5)
1857
2090
  }
1858
2091
  )
1859
- }
1860
- ),
1861
- lt && !J && /* @__PURE__ */ s(
1862
- fr,
1863
- {
1864
- page: ce,
1865
- pageSize: Ae,
1866
- totalRecords: ve,
1867
- totalPages: Ie,
1868
- pageSizeOptions: dt,
1869
- onPageChange: ge,
1870
- onPageSizeChange: Fe,
1871
- showPageSizeSelector: He.showPageSizeSelector,
1872
- showTotalCount: He.showTotalCount,
1873
- pageWindow: gt(5)
1874
- }
1875
- )
1876
- ] });
2092
+ ]
2093
+ }
2094
+ );
1877
2095
  }
1878
- function Nr(e) {
1879
- return /* @__PURE__ */ s(Zt, { theme: e.theme, children: /* @__PURE__ */ s(pr, { ...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 }) });
1880
2098
  }
1881
2099
  export {
1882
- ur as ActionRenderer,
1883
- Nr as AnyTable,
1884
- pr as AnyTableInner,
1885
- Zt as AnyTableThemeProvider,
1886
- sr as ArrayRenderer,
1887
- er as BooleanRenderer,
1888
- cr as CellRenderer,
1889
- gr as ConfirmModal,
1890
- tr as CurrencyRenderer,
1891
- Jt as DEFAULT_THEME_COLORS,
1892
- Ke as DateRenderer,
1893
- lr as EmailRenderer,
1894
- _ as FallbackPlaceholder,
1895
- rr as ImageRenderer,
1896
- Qt as NumberRenderer,
1897
- or as ObjectRenderer,
1898
- dr as PhoneRenderer,
1899
- nr as StatusRenderer,
1900
- Ze as StringRenderer,
1901
- mr as TableBody,
1902
- yr as TableEmptyState,
1903
- hr as TableErrorState,
1904
- Xt as TableHeader,
1905
- fr as TablePagination,
1906
- qt as TableSearch,
1907
- br as TableSkeleton,
1908
- ir as UrlRenderer,
1909
- Nr as default,
1910
- Q as defaultAnyTableTheme,
1911
- X as extractPaginationMeta,
1912
- Kt as filterRowsBySearch,
1913
- _t as generateAutoColumns,
1914
- S as getNestedValue,
2100
+ Nr as ActionRenderer,
2101
+ Br as AnyTable,
2102
+ qe as AnyTableInner,
2103
+ ar as AnyTableThemeProvider,
2104
+ mr as ArrayRenderer,
2105
+ xr as BadgeRenderer,
2106
+ ir as BooleanRenderer,
2107
+ kr as CellRenderer,
2108
+ wr as ConfirmModal,
2109
+ lr as CurrencyRenderer,
2110
+ tt as DEFAULT_THEME_COLORS,
2111
+ Ye as DateRenderer,
2112
+ fr as EmailRenderer,
2113
+ $ as FallbackPlaceholder,
2114
+ dr as ImageRenderer,
2115
+ or as NumberRenderer,
2116
+ ur as ObjectRenderer,
2117
+ yr as PhoneRenderer,
2118
+ hr as ProgressRenderer,
2119
+ pr as RatingRenderer,
2120
+ gr as StatusRenderer,
2121
+ at as StringRenderer,
2122
+ Ve as TABLE_PRESETS,
2123
+ vr as TableBody,
2124
+ Sr as TableEmptyState,
2125
+ Tr as TableErrorState,
2126
+ sr as TableHeader,
2127
+ Ar as TablePagination,
2128
+ nr as TableSearch,
2129
+ Cr as TableSkeleton,
2130
+ br as UrlRenderer,
2131
+ Br as default,
2132
+ rt as defaultAnyTableTheme,
2133
+ Q as extractPaginationMeta,
2134
+ Qt as filterRowsBySearch,
2135
+ Ot as generateAutoColumns,
2136
+ P as getNestedValue,
1915
2137
  be as inferColumnType,
1916
- Re as isImageUrl,
1917
- Dt as isIsoDate,
1918
- St as isPlainObject,
1919
- Ut as normalizeApiResponse,
1920
- jt as resolveColumns,
1921
- Gt as sortRows,
1922
- fe as toTitleCase,
1923
- Vt as useAnyTableController,
1924
- Yt as useAnyTableData,
1925
- Ot as useAnyTablePagination,
1926
- zt as useAnyTableSearch,
1927
- Lt as useAnyTableSorting,
2138
+ Ie as isImageUrl,
2139
+ zt as isIsoDate,
2140
+ _t as isPlainObject,
2141
+ Xt as normalizeApiResponse,
2142
+ nt as renderActionIcon,
2143
+ Ut as resolveColumns,
2144
+ er as sortRows,
2145
+ ue as toTitleCase,
2146
+ rr as useAnyTableController,
2147
+ tr as useAnyTableData,
2148
+ Gt as useAnyTablePagination,
2149
+ Kt as useAnyTableSearch,
2150
+ It as useAnyTableSorting,
1928
2151
  ee as useAnyTableTheme
1929
2152
  };
1930
2153
  //# sourceMappingURL=index.js.map