react-admin-crud-manager 1.0.20 → 1.0.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.es.js CHANGED
@@ -1,59 +1,59 @@
1
- import { jsx as e, Fragment as E, jsxs as d } from "react/jsx-runtime";
2
- import Ce, { useState as S, useRef as ae, useEffect as H, useMemo as Me } from "react";
3
- import { ChevronDown as Te, Search as Re, Check as Ke, X as we, Plus as ze, Filter as He, ChevronLeft as Ye, ChevronRight as Ve, EllipsisVertical as We, User as Fe, Music as qe } from "lucide-react";
4
- import { createPortal as Ze } from "react-dom";
1
+ import { jsx as e, Fragment as j, jsxs as h } from "react/jsx-runtime";
2
+ import Le, { useState as R, useRef as ee, useEffect as K, useMemo as Re } from "react";
3
+ import { ChevronDown as Ie, Search as Oe, Check as Ye, X as Ne, Plus as Ve, Filter as We, ChevronLeft as qe, ChevronRight as Ze, EllipsisVertical as Je, User as Be, Music as Qe } from "lucide-react";
4
+ import { createPortal as Xe } from "react-dom";
5
5
  import { Icon as te } from "@iconify/react";
6
- import { Editor as Je } from "@tinymce/tinymce-react";
7
- import { SnackbarProvider as Qe, enqueueSnackbar as ke } from "notistack";
8
- import a from "prop-types";
9
- const Pe = (h, n = "DD MMM YYYY") => {
10
- if (!h) return "N/A";
11
- const i = new Date(h);
12
- if (isNaN(i)) return "Invalid Date";
13
- const o = (t) => String(t).padStart(2, "0"), s = {
14
- YYYY: i.getFullYear(),
15
- YY: String(i.getFullYear()).slice(-2),
16
- MMMM: i.toLocaleString("en-US", { month: "long" }),
17
- MMM: i.toLocaleString("en-US", { month: "short" }),
18
- MM: o(i.getMonth() + 1),
19
- M: i.getMonth() + 1,
20
- DD: o(i.getDate()),
21
- D: i.getDate(),
22
- dddd: i.toLocaleString("en-US", { weekday: "long" }),
23
- ddd: i.toLocaleString("en-US", { weekday: "short" }),
24
- HH: o(i.getHours()),
25
- hh: o(i.getHours() % 12 || 12),
26
- mm: o(i.getMinutes()),
27
- ss: o(i.getSeconds()),
28
- A: i.getHours() >= 12 ? "PM" : "AM"
6
+ import { Editor as ea } from "@tinymce/tinymce-react";
7
+ import { SnackbarProvider as aa, enqueueSnackbar as Se } from "notistack";
8
+ import t from "prop-types";
9
+ const Ue = (b, o = "DD MMM YYYY") => {
10
+ if (!b) return "N/A";
11
+ const s = new Date(b);
12
+ if (isNaN(s)) return "Invalid Date";
13
+ const i = (r) => String(r).padStart(2, "0"), d = {
14
+ YYYY: s.getFullYear(),
15
+ YY: String(s.getFullYear()).slice(-2),
16
+ MMMM: s.toLocaleString("en-US", { month: "long" }),
17
+ MMM: s.toLocaleString("en-US", { month: "short" }),
18
+ MM: i(s.getMonth() + 1),
19
+ M: s.getMonth() + 1,
20
+ DD: i(s.getDate()),
21
+ D: s.getDate(),
22
+ dddd: s.toLocaleString("en-US", { weekday: "long" }),
23
+ ddd: s.toLocaleString("en-US", { weekday: "short" }),
24
+ HH: i(s.getHours()),
25
+ hh: i(s.getHours() % 12 || 12),
26
+ mm: i(s.getMinutes()),
27
+ ss: i(s.getSeconds()),
28
+ A: s.getHours() >= 12 ? "PM" : "AM"
29
29
  };
30
- return n.replace(
30
+ return o.replace(
31
31
  /YYYY|YY|MMMM|MMM|MM|M|DD|D|dddd|ddd|HH|hh|mm|ss|A/g,
32
- (t) => s[t]
32
+ (r) => d[r]
33
33
  );
34
- }, Xe = (h, n, i = []) => {
35
- if (!(n != null && n.trim())) return h;
36
- const o = n.toLowerCase(), s = (t) => t == null ? [] : typeof t == "object" ? Object.values(t).flatMap(s) : [String(t)];
37
- return h.filter((t) => {
38
- let p = [];
39
- return i.length > 0 ? i.forEach((k) => {
40
- t[k] !== void 0 && p.push(...s(t[k]));
41
- }) : p = s(t), p.some(
42
- (k) => k.toLowerCase().includes(o)
34
+ }, ta = (b, o, s = []) => {
35
+ if (!(o != null && o.trim())) return b;
36
+ const i = o.toLowerCase(), d = (r) => r == null ? [] : typeof r == "object" ? Object.values(r).flatMap(d) : [String(r)];
37
+ return b.filter((r) => {
38
+ let g = [];
39
+ return s.length > 0 ? s.forEach((M) => {
40
+ r[M] !== void 0 && g.push(...d(r[M]));
41
+ }) : g = d(r), g.some(
42
+ (M) => M.toLowerCase().includes(i)
43
43
  );
44
44
  });
45
- }, ee = Ce.forwardRef(
45
+ }, Z = Le.forwardRef(
46
46
  ({
47
- className: h = "",
48
- variant: n = "contained",
49
- color: i = "default",
50
- size: o = "default",
51
- fullWidth: s = !1,
52
- children: t,
53
- ...p
54
- }, k) => {
55
- var b;
56
- const M = "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", u = {
47
+ className: b = "",
48
+ variant: o = "contained",
49
+ color: s = "default",
50
+ size: i = "default",
51
+ fullWidth: d = !1,
52
+ children: r,
53
+ ...g
54
+ }, M) => {
55
+ var c;
56
+ const S = "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-blue-400 focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", p = {
57
57
  sm: "h-8 px-3 rounded-md text-sm",
58
58
  md: "h-9 px-4 rounded-md text-sm",
59
59
  lg: "h-11 px-6 rounded-md text-base",
@@ -80,151 +80,151 @@ const Pe = (h, n = "DD MMM YYYY") => {
80
80
  outlined: "border border-gray-300 bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-300 dark:border-gray-600 dark:text-gray-200 dark:hover:bg-gray-700 dark:focus:ring-gray-500",
81
81
  text: "bg-transparent text-gray-700 hover:bg-gray-100 focus:ring-gray-300 dark:text-gray-200 dark:hover:bg-gray-700 dark:focus:ring-gray-500"
82
82
  }
83
- }, c = ((b = l[i]) == null ? void 0 : b[n]) || l.default.contained, g = u[o], y = `
84
- ${M}
85
- ${c}
86
- ${g}
87
- ${s ? "w-full" : ""}
88
- ${h}
83
+ }, u = ((c = l[s]) == null ? void 0 : c[o]) || l.default.contained, m = p[i], v = `
84
+ ${S}
85
+ ${u}
86
+ ${m}
87
+ ${d ? "w-full" : ""}
88
+ ${b}
89
89
  `.trim();
90
90
  return /* @__PURE__ */ e(
91
91
  "button",
92
92
  {
93
- ref: k,
94
- type: p.type || "button",
95
- className: y,
96
- ...p,
97
- children: t
93
+ ref: M,
94
+ type: g.type || "button",
95
+ className: v,
96
+ ...g,
97
+ children: r
98
98
  }
99
99
  );
100
100
  }
101
101
  );
102
- ee.displayName = "Button";
103
- function Q({ label: h, required: n = !1 }) {
104
- return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ d("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
105
- h,
106
- n && /* @__PURE__ */ e("span", { className: "ml-1", children: "*" })
102
+ Z.displayName = "Button";
103
+ function q({ label: b, required: o = !1 }) {
104
+ return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("label", { className: "block text-sm font-medium text-gray-700 dark:text-gray-300 mb-1", children: [
105
+ b,
106
+ o && /* @__PURE__ */ e("span", { className: "ml-1", children: "*" })
107
107
  ] }) });
108
108
  }
109
- const ea = ({
110
- options: h = [],
111
- value: n = "",
112
- defaultValue: i = "",
113
- onChange: o,
114
- placeholder: s = "Select option",
115
- className: t = "",
116
- disabled: p = !1,
117
- search: k = !1,
118
- label: M = "",
119
- required: u = !1,
109
+ const ra = ({
110
+ options: b = [],
111
+ value: o = "",
112
+ defaultValue: s = "",
113
+ onChange: i,
114
+ placeholder: d = "Select option",
115
+ className: r = "",
116
+ disabled: g = !1,
117
+ search: M = !1,
118
+ label: S = "",
119
+ required: p = !1,
120
120
  name: l = "",
121
- parentClass: c = "",
122
- multiple: g = !1,
121
+ parentClass: u = "",
122
+ multiple: m = !1,
123
123
  // ✅ NEW
124
- dropdownMaxHeight: y = "",
125
- formData: b = {},
126
- dependencyKey: v = ""
124
+ dropdownMaxHeight: v = "",
125
+ formData: c = {},
126
+ dependencyKey: w = ""
127
127
  }) => {
128
- var q;
129
- const [x, N] = S(!1), [I, D] = S(""), [C, A] = S(!0), B = ae(null), F = ae(null), [R, j] = S([]);
130
- let $ = n || n === !1 ? n : i;
131
- const W = (w) => w == null || w === "" ? "" : String(typeof w == "boolean" ? w : w ?? "");
132
- H(
128
+ var V;
129
+ const [y, k] = R(!1), [I, D] = R(""), [C, O] = R(!0), F = ee(null), P = ee(null), [L, B] = R([]);
130
+ let E = o || o === !1 ? o : s;
131
+ const Y = (x) => x == null || x === "" ? "" : String(typeof x == "boolean" ? x : x ?? "");
132
+ K(
133
133
  () => {
134
134
  (async () => {
135
- if (typeof h == "function") {
136
- const z = await h(b);
137
- j(z);
135
+ if (typeof b == "function") {
136
+ const H = await b(c);
137
+ B(H);
138
138
  } else
139
- j(h || []);
139
+ B(b || []);
140
140
  })();
141
141
  },
142
- v ? [h, b == null ? void 0 : b[v]] : [h]
142
+ w ? [b, c == null ? void 0 : c[w]] : [b]
143
143
  );
144
- const G = g ? ($ || []).map(W) : W($), K = R.filter(
145
- (w) => w.label.toLowerCase().includes(I.toLowerCase())
146
- ), U = (w) => {
147
- const z = W(w);
148
- return g ? G.includes(z) : z === G;
144
+ const $ = m ? (E || []).map(Y) : Y(E), _ = L.filter(
145
+ (x) => x.label.toLowerCase().includes(I.toLowerCase())
146
+ ), z = (x) => {
147
+ const H = Y(x);
148
+ return m ? $.includes(H) : H === $;
149
149
  };
150
- H(() => {
151
- const w = (z) => {
152
- B.current && !B.current.contains(z.target) && (N(!1), D(""));
150
+ K(() => {
151
+ const x = (H) => {
152
+ F.current && !F.current.contains(H.target) && (k(!1), D(""));
153
153
  };
154
- return document.addEventListener("mousedown", w), () => document.removeEventListener("mousedown", w);
155
- }, []), H(() => {
156
- if (x && B.current) {
157
- const w = B.current.getBoundingClientRect(), re = window.innerHeight - w.bottom;
158
- A(re < 200);
154
+ return document.addEventListener("mousedown", x), () => document.removeEventListener("mousedown", x);
155
+ }, []), K(() => {
156
+ if (y && F.current) {
157
+ const x = F.current.getBoundingClientRect(), J = window.innerHeight - x.bottom;
158
+ O(J < 200);
159
159
  }
160
- }, [x]), H(() => {
161
- x && F.current && F.current.focus();
162
- }, [x]);
163
- const O = (w) => {
164
- let z = w;
165
- if (w === "true" ? z = !0 : w === "false" && (z = !1), g) {
166
- const re = G.includes(W(w));
167
- let J;
168
- re ? J = n.filter(
169
- (X) => W(X) !== W(w)
170
- ) : J = [...n || [], z], o(J);
160
+ }, [y]), K(() => {
161
+ y && P.current && P.current.focus();
162
+ }, [y]);
163
+ const A = (x) => {
164
+ let H = x;
165
+ if (x === "true" ? H = !0 : x === "false" && (H = !1), m) {
166
+ const J = $.includes(Y(x));
167
+ let Q;
168
+ J ? Q = o.filter(
169
+ (W) => Y(W) !== Y(x)
170
+ ) : Q = [...o || [], H], i(Q);
171
171
  } else
172
- o(z), N(!1);
172
+ i(H), k(!1);
173
173
  D("");
174
- }, Y = g ? R.filter((w) => U(w.value)).map((w) => w.label).join(", ") : (q = R.find((w) => U(w.value))) == null ? void 0 : q.label;
175
- return H(() => {
176
- ($ || $ === !1) && setTimeout(() => {
177
- o($);
174
+ }, U = m ? L.filter((x) => z(x.value)).map((x) => x.label).join(", ") : (V = L.find((x) => z(x.value))) == null ? void 0 : V.label;
175
+ return K(() => {
176
+ (E || E === !1) && setTimeout(() => {
177
+ i(E);
178
178
  }, 100);
179
- }, []), /* @__PURE__ */ d("div", { className: c || "col-span-12", children: [
180
- /* @__PURE__ */ e(Q, { label: M, required: u }),
181
- /* @__PURE__ */ d("div", { className: `relative ${t}`, ref: B, children: [
179
+ }, []), /* @__PURE__ */ h("div", { className: u || "col-span-12", children: [
180
+ /* @__PURE__ */ e(q, { label: S, required: p }),
181
+ /* @__PURE__ */ h("div", { className: `relative ${r}`, ref: F, children: [
182
182
  /* @__PURE__ */ e(
183
183
  "select",
184
184
  {
185
185
  name: "hidden_select_for_validation",
186
- value: Y || "",
187
- required: u,
188
- multiple: g,
186
+ value: U || "",
187
+ required: p,
188
+ multiple: m,
189
189
  className: "absolute opacity-0 right-1/2 top-[80%] -translate-x-1/2 -translate-y-1/2 pointer-events-none h-[10px]",
190
- children: /* @__PURE__ */ e("option", { hidden: !0, value: Y, children: Y })
190
+ children: /* @__PURE__ */ e("option", { hidden: !0, value: U, children: U })
191
191
  }
192
192
  ),
193
- /* @__PURE__ */ d(
193
+ /* @__PURE__ */ h(
194
194
  "button",
195
195
  {
196
196
  type: "button",
197
- onClick: () => !p && N(!x),
198
- disabled: p,
197
+ onClick: () => !g && k(!y),
198
+ disabled: g,
199
199
  className: `w-full h-10 px-3 border border-gray-300 dark:border-gray-600 rounded-md text-left text-sm flex items-center justify-between
200
- ${Y ? "dark:text-white" : "text-gray-500 dark:text-gray-400"}
201
- ${p ? "opacity-50 cursor-not-allowed" : "dark:bg-gray-700"}`,
200
+ ${U ? "dark:text-white" : "text-gray-500 dark:text-gray-400"}
201
+ ${g ? "opacity-50 cursor-not-allowed" : "dark:bg-gray-700"}`,
202
202
  children: [
203
- /* @__PURE__ */ e("span", { className: "truncate", children: Y || s }),
203
+ /* @__PURE__ */ e("span", { className: "truncate", children: U || d }),
204
204
  /* @__PURE__ */ e(
205
- Te,
205
+ Ie,
206
206
  {
207
- className: `w-4 h-4 transition-transform ${x ? "rotate-180" : ""}`
207
+ className: `w-4 h-4 transition-transform ${y ? "rotate-180" : ""}`
208
208
  }
209
209
  )
210
210
  ]
211
211
  }
212
212
  ),
213
- x && /* @__PURE__ */ d(
213
+ y && /* @__PURE__ */ h(
214
214
  "div",
215
215
  {
216
216
  className: `absolute z-50 w-full border rounded-md bg-white dark:bg-gray-700 shadow-lg
217
217
  ${C ? "bottom-full mb-1" : "top-full mt-1"}`,
218
218
  children: [
219
- k && /* @__PURE__ */ e("div", { className: "p-2 border-b border-gray-200 dark:border-gray-600", children: /* @__PURE__ */ d("div", { className: "relative", children: [
220
- /* @__PURE__ */ e(Re, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400" }),
219
+ M && /* @__PURE__ */ e("div", { className: "p-2 border-b border-gray-200 dark:border-gray-600", children: /* @__PURE__ */ h("div", { className: "relative", children: [
220
+ /* @__PURE__ */ e(Oe, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400" }),
221
221
  /* @__PURE__ */ e(
222
222
  "input",
223
223
  {
224
- ref: F,
224
+ ref: P,
225
225
  type: "text",
226
226
  value: I,
227
- onChange: (w) => D(w.target.value),
227
+ onChange: (x) => D(x.target.value),
228
228
  placeholder: "Search...",
229
229
  className: "w-full pl-9 pr-3 py-2 text-sm border rounded-md bg-white dark:bg-gray-800 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none"
230
230
  }
@@ -235,21 +235,21 @@ const ea = ({
235
235
  {
236
236
  className: "max-h-40 overflow-y-auto",
237
237
  style: {
238
- maxHeight: y || ""
238
+ maxHeight: v || ""
239
239
  },
240
- children: K.length > 0 ? K.map((w) => /* @__PURE__ */ d(
240
+ children: _.length > 0 ? _.map((x) => /* @__PURE__ */ h(
241
241
  "button",
242
242
  {
243
243
  type: "button",
244
- onClick: () => O(String(w.value)),
244
+ onClick: () => A(String(x.value)),
245
245
  className: `w-full px-3 py-2 text-left text-sm flex items-center justify-between hover:bg-gray-100 dark:hover:bg-gray-600
246
- ${U(w.value) ? "bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300" : ""}`,
246
+ ${z(x.value) ? "bg-blue-50 dark:bg-blue-900/20 text-blue-700 dark:text-blue-300" : ""}`,
247
247
  children: [
248
- /* @__PURE__ */ e("span", { children: w.label }),
249
- g && U(w.value) && /* @__PURE__ */ e(Ke, { className: "w-4 h-4" })
248
+ /* @__PURE__ */ e("span", { children: x.label }),
249
+ m && z(x.value) && /* @__PURE__ */ e(Ye, { className: "w-4 h-4" })
250
250
  ]
251
251
  },
252
- String(w.value)
252
+ String(x.value)
253
253
  )) : /* @__PURE__ */ e("div", { className: "px-3 py-2 text-sm text-gray-500 dark:text-gray-400", children: "No options found" })
254
254
  }
255
255
  )
@@ -258,26 +258,26 @@ const ea = ({
258
258
  )
259
259
  ] })
260
260
  ] }, l);
261
- }, aa = ({
262
- value: h = !0,
263
- onChange: n,
264
- text: i,
265
- options: o = [],
266
- label: s,
267
- required: t,
268
- name: p = "",
269
- disabled: k = !1,
270
- parentClass: M = ""
261
+ }, na = ({
262
+ value: b = !0,
263
+ onChange: o,
264
+ text: s,
265
+ options: i = [],
266
+ label: d,
267
+ required: r,
268
+ name: g = "",
269
+ disabled: M = !1,
270
+ parentClass: S = ""
271
271
  }) => {
272
- const u = o.length > 0 ? o : [
272
+ const p = i.length > 0 ? i : [
273
273
  { label: "Active", value: !0 },
274
274
  { label: "Inactive", value: !1 }
275
275
  ];
276
- return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ d("div", { className: M || "col-span-12", children: [
277
- /* @__PURE__ */ e(Q, { label: s, required: t }),
278
- /* @__PURE__ */ d("div", { className: "flex items-center justify-between h-10 gap-4 bg-gray-100 dark:bg-gray-700 px-3 rounded-md border border-gray-100 dark:border-gray-600", children: [
279
- i && /* @__PURE__ */ e("p", { className: "text-xs text-gray-600 dark:text-gray-400 flex-shrink overflow-hidden text-ellipsis whitespace-nowrap max-w-[200px]", children: i }),
280
- /* @__PURE__ */ e("div", { className: "flex items-center gap-6", children: u.map((l, c) => /* @__PURE__ */ d(
276
+ return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("div", { className: S || "col-span-12", children: [
277
+ /* @__PURE__ */ e(q, { label: d, required: r }),
278
+ /* @__PURE__ */ h("div", { className: "flex items-center justify-between h-10 gap-4 bg-gray-100 dark:bg-gray-700 px-3 rounded-md border border-gray-100 dark:border-gray-600", children: [
279
+ s && /* @__PURE__ */ e("p", { className: "text-xs text-gray-600 dark:text-gray-400 flex-shrink overflow-hidden text-ellipsis whitespace-nowrap max-w-[200px]", children: s }),
280
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-6", children: p.map((l, u) => /* @__PURE__ */ h(
281
281
  "label",
282
282
  {
283
283
  className: "flex items-center gap-2 cursor-pointer select-none",
@@ -287,22 +287,22 @@ const ea = ({
287
287
  {
288
288
  type: "radio",
289
289
  name: "switch-field",
290
- required: t && c === 0,
290
+ required: r && u === 0,
291
291
  value: l.value,
292
- disabled: k,
293
- checked: h === l.value,
294
- onChange: () => n(l.value),
292
+ disabled: M,
293
+ checked: b === l.value,
294
+ onChange: () => o(l.value),
295
295
  className: "w-4 h-4 border-gray-300 cursor-pointer"
296
296
  }
297
297
  ),
298
298
  /* @__PURE__ */ e("span", { className: "text-sm text-gray-700 dark:text-white", children: l.label })
299
299
  ]
300
300
  },
301
- c
301
+ u
302
302
  )) })
303
303
  ] })
304
- ] }, p) });
305
- }, xe = [
304
+ ] }, g) });
305
+ }, we = [
306
306
  { label: "Afghanistan", code: "AF", phone: "93" },
307
307
  { label: "Aland Islands", code: "AX", phone: "358" },
308
308
  { label: "Albania", code: "AL", phone: "355" },
@@ -554,90 +554,90 @@ const ea = ({
554
554
  { label: "Zambia", code: "ZM", phone: "260" },
555
555
  { label: "Zimbabwe", code: "ZW", phone: "263" }
556
556
  ];
557
- function ra({
558
- label: h = "",
559
- value: n = "",
560
- name: i = "",
561
- parentClass: o = "",
562
- onChange: s,
563
- disabled: t = !1,
564
- required: p = !1,
565
- placeholder: k = "Phone number",
566
- search: M = !1,
567
- countriesList: u = !1,
557
+ function la({
558
+ label: b = "",
559
+ value: o = "",
560
+ name: s = "",
561
+ parentClass: i = "",
562
+ onChange: d,
563
+ disabled: r = !1,
564
+ required: g = !1,
565
+ placeholder: M = "Phone number",
566
+ search: S = !1,
567
+ countriesList: p = !1,
568
568
  defaultCountry: l = ""
569
569
  }) {
570
- const c = (R) => xe.find((j) => j.code == R), [g, y] = S(
571
- c(l) || xe[0]
572
- ), [b, v] = S(""), [x, N] = S(!1), [I, D] = S(""), C = ae();
573
- H(() => {
574
- if (typeof n == "string" && n.startsWith("+")) {
575
- const R = xe.filter((j) => n.startsWith("+" + j.phone)).sort((j, $) => $.phone.length - j.phone.length)[0];
576
- if (R) {
577
- y(R), v(n.replace("+" + R.phone, ""));
570
+ const u = (L) => we.find((B) => B.code == L), [m, v] = R(
571
+ u(l) || we[0]
572
+ ), [c, w] = R(""), [y, k] = R(!1), [I, D] = R(""), C = ee();
573
+ K(() => {
574
+ if (typeof o == "string" && o.startsWith("+")) {
575
+ const L = we.filter((B) => o.startsWith("+" + B.phone)).sort((B, E) => E.phone.length - B.phone.length)[0];
576
+ if (L) {
577
+ v(L), w(o.replace("+" + L.phone, ""));
578
578
  return;
579
579
  }
580
580
  }
581
- v(n);
582
- }, [n]);
583
- const A = (R) => {
584
- const j = R.target.value.replace(/\D/g, "");
585
- v(j), g && s && s("+" + g.phone + j);
586
- }, B = (R) => {
587
- y(R), s && s("+" + R.phone + b), N(!1), D("");
581
+ w(o);
582
+ }, [o]);
583
+ const O = (L) => {
584
+ const B = L.target.value.replace(/\D/g, "");
585
+ w(B), m && d && d("+" + m.phone + B);
586
+ }, F = (L) => {
587
+ v(L), d && d("+" + L.phone + c), k(!1), D("");
588
588
  };
589
- H(() => {
590
- const R = (j) => {
591
- C.current && !C.current.contains(j.target) && N(!1);
589
+ K(() => {
590
+ const L = (B) => {
591
+ C.current && !C.current.contains(B.target) && k(!1);
592
592
  };
593
- return document.addEventListener("mousedown", R), () => document.removeEventListener("mousedown", R);
593
+ return document.addEventListener("mousedown", L), () => document.removeEventListener("mousedown", L);
594
594
  }, []);
595
- const F = xe.filter(
596
- (R) => R.label.toLowerCase().includes(I.toLowerCase()) || R.phone.includes(I)
595
+ const P = we.filter(
596
+ (L) => L.label.toLowerCase().includes(I.toLowerCase()) || L.phone.includes(I)
597
597
  );
598
- return u ? /* @__PURE__ */ e(E, { children: /* @__PURE__ */ d("div", { className: o || "col-span-12", children: [
599
- /* @__PURE__ */ e(Q, { label: h, required: p }),
600
- /* @__PURE__ */ d("div", { className: "relative ", ref: C, children: [
601
- /* @__PURE__ */ d(
598
+ return p ? /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("div", { className: i || "col-span-12", children: [
599
+ /* @__PURE__ */ e(q, { label: b, required: g }),
600
+ /* @__PURE__ */ h("div", { className: "relative ", ref: C, children: [
601
+ /* @__PURE__ */ h(
602
602
  "div",
603
603
  {
604
604
  className: `h-[40px] flex items-center border rounded-md px-2 bg-white dark:bg-gray-700 transition-all
605
- ${x ? "ring-0.5 ring-blue-100 border-blue-300" : "border-gray-300 dark:border-gray-600"}
606
- ${t ? "opacity-60 cursor-not-allowed" : ""}`,
605
+ ${y ? "ring-0.5 ring-blue-100 border-blue-300" : "border-gray-300 dark:border-gray-600"}
606
+ ${r ? "opacity-60 cursor-not-allowed" : ""}`,
607
607
  children: [
608
- /* @__PURE__ */ d(
608
+ /* @__PURE__ */ h(
609
609
  "button",
610
610
  {
611
611
  type: "button",
612
- disabled: t,
613
- onClick: () => N(!x),
612
+ disabled: r,
613
+ onClick: () => k(!y),
614
614
  className: "flex items-center gap-1 pr-2 border-r border-gray-300 dark:border-gray-700 focus:outline-none",
615
615
  children: [
616
- g ? /* @__PURE__ */ e(
616
+ m ? /* @__PURE__ */ e(
617
617
  "img",
618
618
  {
619
- src: `https://flagcdn.com/w20/${g.code.toLowerCase()}.png`,
620
- alt: g.code,
619
+ src: `https://flagcdn.com/w20/${m.code.toLowerCase()}.png`,
620
+ alt: m.code,
621
621
  className: "w-5 h-3 object-cover"
622
622
  }
623
623
  ) : /* @__PURE__ */ e("span", { className: "text-gray-400 text-xs", children: "🌐" }),
624
- /* @__PURE__ */ e(Te, { className: "w-3 h-3 text-gray-500" })
624
+ /* @__PURE__ */ e(Ie, { className: "w-3 h-3 text-gray-500" })
625
625
  ]
626
626
  }
627
627
  ),
628
- g && /* @__PURE__ */ d("span", { className: "ml-2 text-sm text-gray-700 dark:text-gray-200 whitespace-nowrap", children: [
628
+ m && /* @__PURE__ */ h("span", { className: "ml-2 text-sm text-gray-700 dark:text-gray-200 whitespace-nowrap", children: [
629
629
  "+",
630
- g.phone
630
+ m.phone
631
631
  ] }),
632
632
  /* @__PURE__ */ e(
633
633
  "input",
634
634
  {
635
635
  type: "tel",
636
- value: b,
637
- onChange: A,
638
- required: p,
639
- disabled: t || !g,
640
- placeholder: g ? k : "Select a country",
636
+ value: c,
637
+ onChange: O,
638
+ required: g,
639
+ disabled: r || !m,
640
+ placeholder: m ? M : "Select a country",
641
641
  className: "flex-1 ml-2 bg-transparent outline-none text-sm text-gray-800 dark:text-gray-100 placeholder-gray-400"
642
642
  }
643
643
  ),
@@ -645,10 +645,10 @@ function ra({
645
645
  "input",
646
646
  {
647
647
  type: "tel",
648
- required: p,
648
+ required: g,
649
649
  tabIndex: -1,
650
650
  readOnly: !0,
651
- value: g && b ? "+" + g.phone + b : "",
651
+ value: m && c ? "+" + m.phone + c : "",
652
652
  style: {
653
653
  position: "absolute",
654
654
  opacity: 0,
@@ -660,61 +660,61 @@ function ra({
660
660
  ]
661
661
  }
662
662
  ),
663
- x && /* @__PURE__ */ d("div", { className: "absolute top-full left-0 w-full mt-1 border border-gray-300 dark:border-gray-700 rounded-md bg-white dark:bg-gray-700 shadow-lg z-50 max-h-60 overflow-y-auto", children: [
664
- M && /* @__PURE__ */ e("div", { className: "p-2 border-b border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ d("div", { className: "relative", children: [
665
- /* @__PURE__ */ e(Re, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400" }),
663
+ y && /* @__PURE__ */ h("div", { className: "absolute top-full left-0 w-full mt-1 border border-gray-300 dark:border-gray-700 rounded-md bg-white dark:bg-gray-700 shadow-lg z-50 max-h-60 overflow-y-auto", children: [
664
+ S && /* @__PURE__ */ e("div", { className: "p-2 border-b border-gray-200 dark:border-gray-700", children: /* @__PURE__ */ h("div", { className: "relative", children: [
665
+ /* @__PURE__ */ e(Oe, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 w-4 h-4 text-gray-400" }),
666
666
  /* @__PURE__ */ e(
667
667
  "input",
668
668
  {
669
669
  type: "text",
670
670
  value: I,
671
- onChange: (R) => D(R.target.value),
671
+ onChange: (L) => D(L.target.value),
672
672
  placeholder: "Search country...",
673
673
  className: "w-full pl-9 pr-3 py-2 text-sm border rounded-md bg-white dark:bg-gray-800 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none "
674
674
  }
675
675
  )
676
676
  ] }) }),
677
- F.map((R) => /* @__PURE__ */ d(
677
+ P.map((L) => /* @__PURE__ */ h(
678
678
  "button",
679
679
  {
680
680
  type: "button",
681
- onClick: () => B(R),
681
+ onClick: () => F(L),
682
682
  className: "w-full flex items-center gap-2 px-2 py-1 text-sm hover:bg-blue-50 dark:hover:bg-gray-700 text-gray-800 dark:text-gray-100",
683
683
  children: [
684
684
  /* @__PURE__ */ e(
685
685
  "img",
686
686
  {
687
- src: `https://flagcdn.com/w20/${R.code.toLowerCase()}.png`,
688
- alt: R.code,
687
+ src: `https://flagcdn.com/w20/${L.code.toLowerCase()}.png`,
688
+ alt: L.code,
689
689
  className: "w-5 h-3 object-cover"
690
690
  }
691
691
  ),
692
- /* @__PURE__ */ d("span", { children: [
693
- R.label,
692
+ /* @__PURE__ */ h("span", { children: [
693
+ L.label,
694
694
  " (+",
695
- R.phone,
695
+ L.phone,
696
696
  ")"
697
697
  ] })
698
698
  ]
699
699
  },
700
- R.code
700
+ L.code
701
701
  ))
702
702
  ] })
703
703
  ] })
704
- ] }, i) }) : /* @__PURE__ */ e(E, { children: /* @__PURE__ */ d("div", { className: o || "col-span-12", children: [
705
- /* @__PURE__ */ e(Q, { label: h, required: p }),
704
+ ] }, s) }) : /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("div", { className: i || "col-span-12", children: [
705
+ /* @__PURE__ */ e(q, { label: b, required: g }),
706
706
  /* @__PURE__ */ e(
707
707
  "input",
708
708
  {
709
709
  type: "text",
710
- value: n,
711
- onChange: (j) => {
712
- const $ = j.target.value.replace(/[^+\d]/g, ""), W = $.startsWith("+") ? "+" + $.replace(/[+]/g, "").slice(0) : $;
713
- s(W);
710
+ value: o,
711
+ onChange: (B) => {
712
+ const E = B.target.value.replace(/[^+\d]/g, ""), Y = E.startsWith("+") ? "+" + E.replace(/[+]/g, "").slice(0) : E;
713
+ d(Y);
714
714
  },
715
- placeholder: k,
716
- disabled: t,
717
- required: p,
715
+ placeholder: M,
716
+ disabled: r,
717
+ required: g,
718
718
  className: `w-full h-10 px-3 text-sm border border-gray-300 dark:border-gray-600 rounded-md \r
719
719
  bg-white dark:bg-gray-700 text-gray-900 dark:text-gray-100 focus:outline-none \r
720
720
  focus:ring-1 focus:ring-blue-300 dark:focus:ring-blue-200`,
@@ -722,103 +722,103 @@ function ra({
722
722
  pattern: "^\\+\\d{1,15}$"
723
723
  }
724
724
  )
725
- ] }, i) });
725
+ ] }, s) });
726
726
  }
727
- const Ie = Ce.forwardRef(
728
- ({ className: h = "", label: n, required: i, ...o }, s) => {
729
- const t = `
727
+ const je = Le.forwardRef(
728
+ ({ className: b = "", label: o, required: s, ...i }, d) => {
729
+ const r = `
730
730
  placeholder-gray-400 dark:placeholder-gray-400
731
- ${h}
731
+ ${b}
732
732
  `.trim();
733
- return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ d("div", { className: o.parentClass || "col-span-12", children: [
734
- /* @__PURE__ */ e(Q, { label: n, required: i }),
733
+ return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("div", { className: i.parentClass || "col-span-12", children: [
734
+ /* @__PURE__ */ e(q, { label: o, required: s }),
735
735
  /* @__PURE__ */ e("div", { className: "relative", children: /* @__PURE__ */ e(
736
736
  "textarea",
737
737
  {
738
- className: t,
739
- ref: s,
740
- required: i,
741
- ...o
738
+ className: r,
739
+ ref: d,
740
+ required: s,
741
+ ...i
742
742
  }
743
743
  ) })
744
- ] }, o.name) });
744
+ ] }, i.name) });
745
745
  }
746
746
  );
747
- Ie.displayName = "TextArea";
748
- const ta = ({
749
- label: h = "",
750
- value: n = null,
751
- onChange: i,
752
- required: o = !1,
753
- accept: s = "image/*",
754
- id: t,
755
- dragDrop: p = !1,
756
- name: k = "",
757
- parentClass: M = ""
747
+ je.displayName = "TextArea";
748
+ const oa = ({
749
+ label: b = "",
750
+ value: o = null,
751
+ onChange: s,
752
+ required: i = !1,
753
+ accept: d = "image/*",
754
+ id: r,
755
+ dragDrop: g = !1,
756
+ name: M = "",
757
+ parentClass: S = ""
758
758
  }) => {
759
- const [u, l] = S(n), [c, g] = S(!1), y = ae(null);
760
- H(() => (n instanceof File ? l({ file: n, preview: URL.createObjectURL(n) }) : (n != null && n.preview, l(n)), () => {
761
- u != null && u.preview && u.preview.startsWith("blob:") && URL.revokeObjectURL(u.preview);
762
- }), [n]);
763
- const b = (C) => {
759
+ const [p, l] = R(o), [u, m] = R(!1), v = ee(null);
760
+ K(() => (o instanceof File ? l({ file: o, preview: URL.createObjectURL(o) }) : (o != null && o.preview, l(o)), () => {
761
+ p != null && p.preview && p.preview.startsWith("blob:") && URL.revokeObjectURL(p.preview);
762
+ }), [o]);
763
+ const c = (C) => {
764
764
  if (!C || C.length === 0)
765
765
  return;
766
- const A = C[0], B = URL.createObjectURL(A), F = { file: A, preview: B };
767
- u != null && u.preview && u.preview.startsWith("blob:") && URL.revokeObjectURL(u.preview), l(F), i == null || i(A);
768
- }, v = (C) => {
769
- C && C.stopPropagation(), u != null && u.preview && u.preview.startsWith("blob:") && URL.revokeObjectURL(u.preview), l(null), i == null || i(null), y.current && (y.current.value = "");
770
- }, x = (C) => {
771
- p && (C.preventDefault(), g(!0));
772
- }, N = (C) => {
773
- p && (C.preventDefault(), g(!1));
766
+ const O = C[0], F = URL.createObjectURL(O), P = { file: O, preview: F };
767
+ p != null && p.preview && p.preview.startsWith("blob:") && URL.revokeObjectURL(p.preview), l(P), s == null || s(O);
768
+ }, w = (C) => {
769
+ C && C.stopPropagation(), p != null && p.preview && p.preview.startsWith("blob:") && URL.revokeObjectURL(p.preview), l(null), s == null || s(null), v.current && (v.current.value = "");
770
+ }, y = (C) => {
771
+ g && (C.preventDefault(), m(!0));
772
+ }, k = (C) => {
773
+ g && (C.preventDefault(), m(!1));
774
774
  }, I = (C) => {
775
- p && (C.preventDefault(), g(!1), b(C.dataTransfer.files));
775
+ g && (C.preventDefault(), m(!1), c(C.dataTransfer.files));
776
776
  }, D = () => {
777
- y.current.click();
777
+ v.current.click();
778
778
  };
779
- return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ d("div", { className: M || "col-span-12", children: [
780
- /* @__PURE__ */ e(Q, { label: h, required: o }),
781
- /* @__PURE__ */ d(
779
+ return /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("div", { className: S || "col-span-12", children: [
780
+ /* @__PURE__ */ e(q, { label: b, required: i }),
781
+ /* @__PURE__ */ h(
782
782
  "div",
783
783
  {
784
- className: `relative rounded-md p-2 transition-all ${c ? "border-2 border-dashed border-blue-500 bg-blue-50 dark:bg-blue-900/20" : "border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"}`,
785
- onDragOver: x,
786
- onDragLeave: N,
784
+ className: `relative rounded-md p-2 transition-all ${u ? "border-2 border-dashed border-blue-500 bg-blue-50 dark:bg-blue-900/20" : "border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"}`,
785
+ onDragOver: y,
786
+ onDragLeave: k,
787
787
  onDrop: I,
788
788
  children: [
789
789
  /* @__PURE__ */ e(
790
790
  "input",
791
791
  {
792
- ref: y,
793
- id: t,
792
+ ref: v,
793
+ id: r,
794
794
  type: "file",
795
- accept: s,
796
- onChange: (C) => b(C.target.files),
797
- required: o && !u,
795
+ accept: d,
796
+ onChange: (C) => c(C.target.files),
797
+ required: i && !p,
798
798
  className: "absolute opacity-0 right-[50%] top-[80%] -translate-y-1/2 pointer-events-none h-[10px]"
799
799
  }
800
800
  ),
801
- /* @__PURE__ */ d(
801
+ /* @__PURE__ */ h(
802
802
  "div",
803
803
  {
804
- className: `flex items-center space-x-4 transition-all ${c ? "opacity-50" : ""}`,
804
+ className: `flex items-center space-x-4 transition-all ${u ? "opacity-50" : ""}`,
805
805
  children: [
806
- u ? (
806
+ p ? (
807
807
  // Image preview with close button
808
- /* @__PURE__ */ d("div", { className: "relative group", children: [
808
+ /* @__PURE__ */ h("div", { className: "relative group", children: [
809
809
  /* @__PURE__ */ e(
810
810
  "img",
811
811
  {
812
- src: u.preview || u,
812
+ src: p.preview || p,
813
813
  alt: "preview",
814
814
  className: "object-cover w-20 h-20 rounded-full shadow-md"
815
815
  }
816
816
  ),
817
- !o && /* @__PURE__ */ e(
817
+ !i && /* @__PURE__ */ e(
818
818
  "button",
819
819
  {
820
820
  type: "button",
821
- onClick: v,
821
+ onClick: w,
822
822
  className: "absolute top-0 -right-2 bg-red-500 text-white rounded-full p-1 shadow-lg hover:bg-red-600 transition-colors focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2",
823
823
  "aria-label": "Remove image",
824
824
  children: /* @__PURE__ */ e(te, { icon: "mdi:close", className: "w-3 h-3" })
@@ -835,143 +835,149 @@ const ta = ({
835
835
  }
836
836
  ) })
837
837
  ),
838
- /* @__PURE__ */ d("div", { className: "flex flex-col items-center space-y-1", children: [
838
+ /* @__PURE__ */ h("div", { className: "flex flex-col items-center space-y-1", children: [
839
839
  /* @__PURE__ */ e(
840
- ee,
840
+ Z,
841
841
  {
842
842
  type: "button",
843
843
  onClick: D,
844
844
  variant: "outlined",
845
845
  color: "default",
846
- children: u ? "Change Image" : "Select Image"
846
+ children: p ? "Change Image" : "Select Image"
847
847
  }
848
848
  ),
849
- p && !u && /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "or drag and drop" })
849
+ g && !p && /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "or drag and drop" })
850
850
  ] })
851
851
  ]
852
852
  }
853
853
  ),
854
- p && c && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none bg-blue-500/10 rounded-md", children: /* @__PURE__ */ e("span", { className: "text-blue-600 dark:text-blue-400 font-semibold text-lg", children: "Drop image here" }) })
854
+ g && u && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none bg-blue-500/10 rounded-md", children: /* @__PURE__ */ e("span", { className: "text-blue-600 dark:text-blue-400 font-semibold text-lg", children: "Drop image here" }) })
855
855
  ]
856
856
  }
857
857
  )
858
- ] }, k) });
859
- }, Be = Ce.forwardRef(
858
+ ] }, M) });
859
+ }, Ee = Le.forwardRef(
860
860
  ({
861
- label: h,
862
- required: n,
863
- parentClass: i = "",
864
- className: o = "",
865
- type: s = "text",
866
- onKeyDown: t,
867
- negativeNumberAllow: p = !0,
868
- ...k
869
- }, M) => {
870
- const [u, l] = S(!1), c = (y) => {
871
- if (s === "number") {
872
- if (["e", "E", "+"].includes(y.key)) {
873
- y.preventDefault();
861
+ label: b,
862
+ required: o,
863
+ parentClass: s = "",
864
+ className: i = "",
865
+ type: d = "text",
866
+ onKeyDown: r,
867
+ negativeNumberAllow: g = !0,
868
+ defaultValue: M = "",
869
+ ...S
870
+ }, p) => {
871
+ const [l, u] = R(!1), m = (c) => {
872
+ if (d === "number") {
873
+ if (["e", "E", "+"].includes(c.key)) {
874
+ c.preventDefault();
874
875
  return;
875
876
  }
876
- if (p == !1 && y.key === "-") {
877
- y.preventDefault();
877
+ if (g == !1 && c.key === "-") {
878
+ c.preventDefault();
878
879
  return;
879
880
  }
880
- if (["ArrowUp", "ArrowDown"].includes(y.key)) {
881
- y.preventDefault();
881
+ if (["ArrowUp", "ArrowDown"].includes(c.key)) {
882
+ c.preventDefault();
882
883
  return;
883
884
  }
884
885
  }
885
- t == null || t(y);
886
- }, g = `
886
+ r == null || r(c);
887
+ }, v = `
887
888
  h-10 placeholder-gray-400 dark:placeholder-gray-400
888
- ${s === "password" ? "pr-10" : ""}
889
- ${s === "number" ? "no-spinner" : ""}
890
- ${o}
889
+ ${d === "password" ? "pr-10" : ""}
890
+ ${d === "number" ? "no-spinner" : ""}
891
+ ${i}
891
892
  `.trim();
892
- return /* @__PURE__ */ e(E, { children: /* @__PURE__ */ d("div", { className: i || "col-span-12", children: [
893
- /* @__PURE__ */ e(Q, { label: h, required: n }),
894
- /* @__PURE__ */ d("div", { className: "relative", children: [
893
+ return K(() => {
894
+ M && setTimeout(() => {
895
+ var c;
896
+ (c = S.onChange) == null || c.call(S, { target: { value: M } });
897
+ }, 100);
898
+ }, [M]), /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("div", { className: s || "col-span-12", children: [
899
+ /* @__PURE__ */ e(q, { label: b, required: o }),
900
+ /* @__PURE__ */ h("div", { className: "relative", children: [
895
901
  /* @__PURE__ */ e(
896
902
  "input",
897
903
  {
898
- type: s === "password" && u ? "text" : s,
899
- ref: M,
900
- required: n,
901
- onKeyDown: c,
902
- className: g,
903
- ...k
904
+ type: d === "password" && l ? "text" : d,
905
+ ref: p,
906
+ required: o,
907
+ onKeyDown: m,
908
+ className: v,
909
+ ...S
904
910
  }
905
911
  ),
906
- s === "password" && /* @__PURE__ */ e(
912
+ d === "password" && /* @__PURE__ */ e(
907
913
  "button",
908
914
  {
909
915
  type: "button",
910
916
  tabIndex: -1,
911
- onClick: () => l((y) => !y),
917
+ onClick: () => u((c) => !c),
912
918
  className: "absolute inset-y-0 right-3 flex items-center text-gray-400 hover:text-gray-600 dark:text-gray-400 dark:hover:text-gray-200",
913
919
  children: /* @__PURE__ */ e(
914
920
  te,
915
921
  {
916
- icon: u ? "mdi:eye-outline" : "mdi:eye-off-outline",
922
+ icon: l ? "mdi:eye-outline" : "mdi:eye-off-outline",
917
923
  className: "w-5 h-5"
918
924
  }
919
925
  )
920
926
  }
921
927
  )
922
928
  ] })
923
- ] }, k.name) });
929
+ ] }, S.name) });
924
930
  }
925
931
  );
926
- Be.displayName = "Input";
927
- const na = ({
928
- key: h,
929
- editorKey: n = "",
930
- value: i = "",
931
- onChange: o,
932
- label: s = "",
933
- required: t = !1,
934
- placeholder: p = "",
935
- parentClass: k = "col-span-12",
936
- height: M = 400,
937
- inline: u = !1,
932
+ Ee.displayName = "Input";
933
+ const ia = ({
934
+ key: b,
935
+ editorKey: o = "",
936
+ value: s = "",
937
+ onChange: i,
938
+ label: d = "",
939
+ required: r = !1,
940
+ placeholder: g = "",
941
+ parentClass: M = "col-span-12",
942
+ height: S = 400,
943
+ inline: p = !1,
938
944
  disabled: l = !1,
939
- plugins: c,
940
- toolbar: g,
941
- menubar: y = !1,
942
- fontFamily: b = "Inter, sans-serif",
943
- initConfig: v = {},
944
- imageUploadHandler: x
945
+ plugins: u,
946
+ toolbar: m,
947
+ menubar: v = !1,
948
+ fontFamily: c = "Inter, sans-serif",
949
+ initConfig: w = {},
950
+ imageUploadHandler: y
945
951
  // ✅ Promise function passed from parent
946
- }) => /* @__PURE__ */ d("div", { className: k, children: [
947
- s && /* @__PURE__ */ e(Q, { label: s, required: t }),
952
+ }) => /* @__PURE__ */ h("div", { className: M, children: [
953
+ d && /* @__PURE__ */ e(q, { label: d, required: r }),
948
954
  /* @__PURE__ */ e(
949
- Je,
955
+ ea,
950
956
  {
951
- apiKey: n,
952
- value: i,
957
+ apiKey: o,
958
+ value: s,
953
959
  disabled: l,
954
960
  init: {
955
- height: M,
956
- inline: u,
957
- menubar: y,
961
+ height: S,
962
+ inline: p,
963
+ menubar: v,
958
964
  branding: !1,
959
965
  statusbar: !0,
960
966
  automatic_uploads: !0,
961
- images_upload_handler: (C) => new Promise((A, B) => {
962
- if (!x) {
963
- A(`data:${C.blob().type};base64,${C.base64()}`);
967
+ images_upload_handler: (C) => new Promise((O, F) => {
968
+ if (!y) {
969
+ O(`data:${C.blob().type};base64,${C.base64()}`);
964
970
  return;
965
971
  }
966
- x(C).then((F) => {
967
- F ? A(F) : B("Upload failed: No URL returned");
968
- }).catch((F) => {
969
- B(
970
- typeof F == "string" ? F : (F == null ? void 0 : F.message) || "Image upload failed"
972
+ y(C).then((P) => {
973
+ P ? O(P) : F("Upload failed: No URL returned");
974
+ }).catch((P) => {
975
+ F(
976
+ typeof P == "string" ? P : (P == null ? void 0 : P.message) || "Image upload failed"
971
977
  );
972
978
  });
973
979
  }),
974
- plugins: c ?? [
980
+ plugins: u ?? [
975
981
  "advlist",
976
982
  "autolink",
977
983
  "lists",
@@ -990,178 +996,178 @@ const na = ({
990
996
  "help",
991
997
  "wordcount"
992
998
  ],
993
- toolbar: g ?? "undo redo | blocks | bold italic underline forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media table | removeformat | code fullscreen preview",
994
- placeholder: p,
999
+ toolbar: m ?? "undo redo | blocks | bold italic underline forecolor backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image media table | removeformat | code fullscreen preview",
1000
+ placeholder: g,
995
1001
  content_style: `
996
1002
  body {
997
- font-family: ${b};
1003
+ font-family: ${c};
998
1004
  }
999
1005
  `,
1000
- ...v
1006
+ ...w
1001
1007
  },
1002
1008
  onEditorChange: (C) => {
1003
- o && o(C);
1009
+ i && i(C);
1004
1010
  }
1005
1011
  }
1006
1012
  )
1007
- ] }, h), la = ({
1008
- name: h = "",
1009
- label: n = "",
1013
+ ] }, b), sa = ({
1014
+ name: b = "",
1015
+ label: o = "",
1010
1016
  // label for single checkbox
1011
- options: i = [],
1017
+ options: s = [],
1012
1018
  // array of { label, value } for multiple
1013
- value: o = null,
1019
+ value: i = null,
1014
1020
  // boolean for single, array for multiple, or string for single select
1015
- onChange: s,
1016
- disabled: t = !1,
1017
- required: p = !1,
1018
- parentClass: k = "col-span-12",
1019
- className: M = "",
1020
- multiSelect: u = !1
1021
+ onChange: d,
1022
+ disabled: r = !1,
1023
+ required: g = !1,
1024
+ parentClass: M = "col-span-12",
1025
+ className: S = "",
1026
+ multiSelect: p = !1
1021
1027
  // ✅ if true, only one option can be selected (like radio)
1022
1028
  }) => {
1023
- const l = Array.isArray(i) && i.length > 0, c = (b) => l ? u ? Array.isArray(o) && o.includes(b) : o === b : !!o, g = (b) => {
1024
- s == null || s(b.target.checked, h);
1025
- }, y = (b, v) => {
1026
- if (s)
1027
- if (!u)
1028
- s(v ? b : "", h);
1029
+ const l = Array.isArray(s) && s.length > 0, u = (c) => l ? p ? Array.isArray(i) && i.includes(c) : i === c : !!i, m = (c) => {
1030
+ d == null || d(c.target.checked, b);
1031
+ }, v = (c, w) => {
1032
+ if (d)
1033
+ if (!p)
1034
+ d(w ? c : "", b);
1029
1035
  else {
1030
- const x = Array.isArray(o) ? [...o] : [];
1031
- if (v)
1032
- x.includes(b) || x.push(b);
1036
+ const y = Array.isArray(i) ? [...i] : [];
1037
+ if (w)
1038
+ y.includes(c) || y.push(c);
1033
1039
  else {
1034
- const N = x.indexOf(b);
1035
- N > -1 && x.splice(N, 1);
1040
+ const k = y.indexOf(c);
1041
+ k > -1 && y.splice(k, 1);
1036
1042
  }
1037
- s(x, h);
1043
+ d(y, b);
1038
1044
  }
1039
1045
  };
1040
- return l ? /* @__PURE__ */ e(E, { children: /* @__PURE__ */ d("div", { className: `${k}`, children: [
1041
- /* @__PURE__ */ e(Q, { label: n, required: p }),
1042
- /* @__PURE__ */ e("div", { className: "flex flex-col space-y-2", children: i.map((b, v) => /* @__PURE__ */ d("div", { className: "flex items-center", children: [
1046
+ return l ? /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h("div", { className: `${M}`, children: [
1047
+ /* @__PURE__ */ e(q, { label: o, required: g }),
1048
+ /* @__PURE__ */ e("div", { className: "flex flex-col space-y-2", children: s.map((c, w) => /* @__PURE__ */ h("div", { className: "flex items-center", children: [
1043
1049
  /* @__PURE__ */ e(
1044
1050
  "input",
1045
1051
  {
1046
1052
  type: "checkbox",
1047
- name: h,
1048
- value: b.value,
1049
- checked: c(b.value),
1050
- disabled: t || b.disabled,
1051
- required: p && v === 0,
1052
- onChange: (x) => y(b.value, x.target.checked),
1053
- className: `h-4 w-4 cursor-pointer text-blue-600 border-gray-300 rounded focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 ${M}`
1053
+ name: b,
1054
+ value: c.value,
1055
+ checked: u(c.value),
1056
+ disabled: r || c.disabled,
1057
+ required: g && w === 0,
1058
+ onChange: (y) => v(c.value, y.target.checked),
1059
+ className: `h-4 w-4 cursor-pointer text-blue-600 border-gray-300 rounded focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 ${S}`
1054
1060
  },
1055
- h
1061
+ b
1056
1062
  ),
1057
- b.label && /* @__PURE__ */ e(
1063
+ c.label && /* @__PURE__ */ e(
1058
1064
  "label",
1059
1065
  {
1060
- htmlFor: h,
1066
+ htmlFor: b,
1061
1067
  className: "ml-2 text-sm text-gray-700 dark:text-gray-200 select-none",
1062
- children: b.label
1068
+ children: c.label
1063
1069
  }
1064
1070
  )
1065
- ] }, b.value || b.label)) })
1066
- ] }) }) : /* @__PURE__ */ d("div", { className: `flex items-center ${k}`, children: [
1071
+ ] }, c.value || c.label)) })
1072
+ ] }) }) : /* @__PURE__ */ h("div", { className: `flex items-center ${M}`, children: [
1067
1073
  /* @__PURE__ */ e(
1068
1074
  "input",
1069
1075
  {
1070
1076
  type: "checkbox",
1071
- name: h,
1072
- checked: c(),
1073
- disabled: t,
1074
- required: p,
1075
- onChange: g,
1076
- className: `h-4 w-4 text-blue-600 cursor-pointer border-gray-300 rounded focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 ${M}`
1077
+ name: b,
1078
+ checked: u(),
1079
+ disabled: r,
1080
+ required: g,
1081
+ onChange: m,
1082
+ className: `h-4 w-4 text-blue-600 cursor-pointer border-gray-300 rounded focus:ring-2 focus:ring-blue-500 dark:focus:ring-blue-400 ${S}`
1077
1083
  }
1078
1084
  ),
1079
- n && /* @__PURE__ */ e(
1085
+ o && /* @__PURE__ */ e(
1080
1086
  "label",
1081
1087
  {
1082
- htmlFor: h,
1088
+ htmlFor: b,
1083
1089
  className: "ml-2 text-sm text-gray-700 dark:text-gray-200 select-none",
1084
- children: n
1090
+ children: o
1085
1091
  }
1086
1092
  )
1087
1093
  ] });
1088
- }, oa = ({
1089
- label: h = "",
1090
- value: n = null,
1091
- onChange: i,
1092
- required: o = !1,
1093
- accept: s = "audio/*",
1094
- id: t,
1095
- dragDrop: p = !1,
1096
- name: k = "",
1097
- parentClass: M = ""
1094
+ }, da = ({
1095
+ label: b = "",
1096
+ value: o = null,
1097
+ onChange: s,
1098
+ required: i = !1,
1099
+ accept: d = "audio/*",
1100
+ id: r,
1101
+ dragDrop: g = !1,
1102
+ name: M = "",
1103
+ parentClass: S = ""
1098
1104
  }) => {
1099
- const [u, l] = S(null), [c, g] = S(!1), y = ae(null);
1100
- H(() => {
1101
- if (!n) {
1102
- b(), l(null);
1105
+ const [p, l] = R(null), [u, m] = R(!1), v = ee(null);
1106
+ K(() => {
1107
+ if (!o) {
1108
+ c(), l(null);
1103
1109
  return;
1104
1110
  }
1105
- if (n instanceof File) {
1106
- const A = URL.createObjectURL(n);
1107
- return l({ file: n, preview: A }), () => {
1108
- URL.revokeObjectURL(A);
1111
+ if (o instanceof File) {
1112
+ const O = URL.createObjectURL(o);
1113
+ return l({ file: o, preview: O }), () => {
1114
+ URL.revokeObjectURL(O);
1109
1115
  };
1110
- } else typeof n == "string" ? l({ preview: n }) : n != null && n.preview && l(n);
1111
- }, [n]);
1112
- const b = () => {
1113
- u != null && u.preview && u.preview.startsWith("blob:") && URL.revokeObjectURL(u.preview);
1114
- }, v = (A) => {
1115
- if (!A || A.length === 0)
1116
+ } else typeof o == "string" ? l({ preview: o }) : o != null && o.preview && l(o);
1117
+ }, [o]);
1118
+ const c = () => {
1119
+ p != null && p.preview && p.preview.startsWith("blob:") && URL.revokeObjectURL(p.preview);
1120
+ }, w = (O) => {
1121
+ if (!O || O.length === 0)
1116
1122
  return;
1117
- const B = A[0], F = URL.createObjectURL(B);
1118
- b(), l({ file: B, preview: F }), i == null || i(B);
1119
- }, x = (A) => {
1120
- A && A.stopPropagation(), b(), l(null), i == null || i(null), y.current && (y.current.value = "");
1121
- }, N = (A) => {
1122
- p && (A.preventDefault(), g(!0));
1123
- }, I = (A) => {
1124
- p && (A.preventDefault(), g(!1));
1125
- }, D = (A) => {
1126
- p && (A.preventDefault(), g(!1), v(A.dataTransfer.files));
1123
+ const F = O[0], P = URL.createObjectURL(F);
1124
+ c(), l({ file: F, preview: P }), s == null || s(F);
1125
+ }, y = (O) => {
1126
+ O && O.stopPropagation(), c(), l(null), s == null || s(null), v.current && (v.current.value = "");
1127
+ }, k = (O) => {
1128
+ g && (O.preventDefault(), m(!0));
1129
+ }, I = (O) => {
1130
+ g && (O.preventDefault(), m(!1));
1131
+ }, D = (O) => {
1132
+ g && (O.preventDefault(), m(!1), w(O.dataTransfer.files));
1127
1133
  }, C = () => {
1128
- y.current.click();
1134
+ v.current.click();
1129
1135
  };
1130
- return /* @__PURE__ */ d("div", { className: M || "col-span-12", children: [
1131
- /* @__PURE__ */ e(Q, { label: h, required: o }),
1132
- /* @__PURE__ */ d(
1136
+ return /* @__PURE__ */ h("div", { className: S || "col-span-12", children: [
1137
+ /* @__PURE__ */ e(q, { label: b, required: i }),
1138
+ /* @__PURE__ */ h(
1133
1139
  "div",
1134
1140
  {
1135
- className: `relative rounded-lg p-2 transition-all ${c ? "border-2 border-dashed border-blue-500 bg-blue-50 dark:bg-blue-900/20" : "border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"}`,
1136
- onDragOver: N,
1141
+ className: `relative rounded-lg p-2 transition-all ${u ? "border-2 border-dashed border-blue-500 bg-blue-50 dark:bg-blue-900/20" : "border border-gray-200 dark:border-gray-700 bg-white dark:bg-gray-800"}`,
1142
+ onDragOver: k,
1137
1143
  onDragLeave: I,
1138
1144
  onDrop: D,
1139
1145
  children: [
1140
1146
  /* @__PURE__ */ e(
1141
1147
  "input",
1142
1148
  {
1143
- ref: y,
1144
- id: t,
1149
+ ref: v,
1150
+ id: r,
1145
1151
  type: "file",
1146
- accept: s,
1147
- onChange: (A) => v(A.target.files),
1148
- required: o && !u,
1152
+ accept: d,
1153
+ onChange: (O) => w(O.target.files),
1154
+ required: i && !p,
1149
1155
  className: "absolute opacity-0 right-[50%] top-[80%] -translate-y-1/2 pointer-events-none h-[10px]"
1150
1156
  }
1151
1157
  ),
1152
1158
  /* @__PURE__ */ e(
1153
1159
  "div",
1154
1160
  {
1155
- className: `flex items-center space-x-4 transition-all ${c ? "opacity-50" : ""}`,
1156
- children: u ? (
1161
+ className: `flex items-center space-x-4 transition-all ${u ? "opacity-50" : ""}`,
1162
+ children: p ? (
1157
1163
  // Audio player with close button and change button
1158
- /* @__PURE__ */ d("div", { className: "flex items-center space-x-4", children: [
1159
- /* @__PURE__ */ d("div", { className: "relative w-full", children: [
1160
- !o && /* @__PURE__ */ e(
1164
+ /* @__PURE__ */ h("div", { className: "flex items-center space-x-4", children: [
1165
+ /* @__PURE__ */ h("div", { className: "relative w-full", children: [
1166
+ !i && /* @__PURE__ */ e(
1161
1167
  "button",
1162
1168
  {
1163
1169
  type: "button",
1164
- onClick: x,
1170
+ onClick: y,
1165
1171
  className: "absolute top-0 -right-2 bg-red-500 text-white rounded-full p-1 shadow-lg hover:bg-red-600 transition-colors z-10 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 dark:focus:ring-offset-gray-800",
1166
1172
  "aria-label": "Remove audio",
1167
1173
  children: /* @__PURE__ */ e(te, { icon: "mdi:close", className: "w-3 h-3" })
@@ -1170,21 +1176,21 @@ const na = ({
1170
1176
  /* @__PURE__ */ e(
1171
1177
  "audio",
1172
1178
  {
1173
- src: u.preview,
1179
+ src: p.preview,
1174
1180
  controls: !0,
1175
1181
  controlsList: "nodownload"
1176
1182
  },
1177
- u.preview
1183
+ p.preview
1178
1184
  )
1179
1185
  ] }),
1180
- /* @__PURE__ */ e(ee, { type: "button", onClick: C, children: /* @__PURE__ */ e("span", { children: "Change Audio File" }) })
1186
+ /* @__PURE__ */ e(Z, { type: "button", onClick: C, children: /* @__PURE__ */ e("span", { children: "Change Audio File" }) })
1181
1187
  ] })
1182
1188
  ) : (
1183
1189
  // Empty state with upload button
1184
- /* @__PURE__ */ d("div", { className: "flex items-center justify-center space-x-4", children: [
1190
+ /* @__PURE__ */ h("div", { className: "flex items-center justify-center space-x-4", children: [
1185
1191
  /* @__PURE__ */ e("div", { className: "rounded-full bg-gray-100 dark:bg-gray-700 h-20 w-20 flex items-center justify-center", children: /* @__PURE__ */ e(te, { icon: "mdi:music", className: "text-gray-400 w-10 h-10" }) }),
1186
1192
  /* @__PURE__ */ e(
1187
- ee,
1193
+ Z,
1188
1194
  {
1189
1195
  type: "button",
1190
1196
  onClick: C,
@@ -1192,251 +1198,252 @@ const na = ({
1192
1198
  children: /* @__PURE__ */ e("span", { children: "Choose Audio File" })
1193
1199
  }
1194
1200
  ),
1195
- p && /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "or drag and drop your audio file here" })
1201
+ g && /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: "or drag and drop your audio file here" })
1196
1202
  ] })
1197
1203
  )
1198
1204
  }
1199
1205
  ),
1200
- p && c && !u && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none bg-blue-500/10 rounded-lg", children: /* @__PURE__ */ e("span", { className: "text-blue-600 dark:text-blue-400 font-semibold text-lg bg-white dark:bg-gray-800 px-4 py-2 rounded-lg shadow-lg", children: "Drop audio here" }) })
1206
+ g && u && !p && /* @__PURE__ */ e("div", { className: "absolute inset-0 flex items-center justify-center pointer-events-none bg-blue-500/10 rounded-lg", children: /* @__PURE__ */ e("span", { className: "text-blue-600 dark:text-blue-400 font-semibold text-lg bg-white dark:bg-gray-800 px-4 py-2 rounded-lg shadow-lg", children: "Drop audio here" }) })
1201
1207
  ]
1202
1208
  }
1203
1209
  )
1204
- ] }, k);
1205
- }, Ue = ({ field: h, formData: n, handleChange: i }) => {
1210
+ ] }, M);
1211
+ }, $e = ({ field: b, formData: o, handleChange: s }) => {
1206
1212
  const {
1207
- key: o,
1208
- label: s,
1209
- type: t,
1210
- options: p,
1211
- placeholder: k,
1212
- rows: M,
1213
- inputClass: u,
1213
+ key: i,
1214
+ label: d,
1215
+ type: r,
1216
+ options: g,
1217
+ placeholder: M,
1218
+ rows: S,
1219
+ inputClass: p,
1214
1220
  search: l,
1215
- accept: c,
1216
- text: g,
1217
- required: y = !1,
1218
- minLength: b,
1219
- dragDrop: v,
1220
- parentClass: x,
1221
- countriesList: N,
1221
+ accept: u,
1222
+ text: m,
1223
+ required: v = !1,
1224
+ minLength: c,
1225
+ dragDrop: w,
1226
+ parentClass: y,
1227
+ countriesList: k,
1222
1228
  defaultCountry: I,
1223
1229
  multiple: D,
1224
1230
  dropdownMaxHeight: C,
1225
- editorKey: A,
1226
- fontFamily: B,
1227
- disabled: F,
1228
- negativeNumberAllow: R,
1229
- defaultValue: j,
1230
- renderCondition: $,
1231
- optionDependencyKey: W
1232
- } = h;
1233
- let G = n == null ? void 0 : n[o];
1234
- G == null && (G = "");
1235
- const K = k || (t === "select" ? `Select ${s}` : `Enter ${s}`), U = "w-full px-3 py-2 rounded-md border border-gray-300 dark:border-gray-600 text-sm focus:outline-none focus:ring-1 focus:ring-blue-200 bg-white text-black dark:bg-gray-700 dark:text-white";
1236
- if ($ && typeof $ == "function" && !$(n))
1231
+ editorKey: O,
1232
+ fontFamily: F,
1233
+ disabled: P,
1234
+ negativeNumberAllow: L,
1235
+ defaultValue: B,
1236
+ renderCondition: E,
1237
+ optionDependencyKey: Y
1238
+ } = b;
1239
+ let $ = o == null ? void 0 : o[i];
1240
+ $ == null && ($ = "");
1241
+ const _ = M || (r === "select" ? `Select ${d}` : `Enter ${d}`), z = "w-full px-3 py-2 rounded-md border border-gray-300 dark:border-gray-600 text-sm focus:outline-none focus:ring-1 focus:ring-blue-200 bg-white text-black dark:bg-gray-700 dark:text-white";
1242
+ if (E && typeof E == "function" && !E(o))
1237
1243
  return null;
1238
- switch (t) {
1244
+ switch (r) {
1239
1245
  case "select":
1240
1246
  return /* @__PURE__ */ e(
1241
- ea,
1247
+ ra,
1242
1248
  {
1243
- options: p || [],
1244
- value: G,
1245
- formData: n,
1246
- dependencyKey: W,
1247
- onChange: (O) => i(o, O),
1248
- placeholder: K,
1249
- className: u || "",
1249
+ options: g || [],
1250
+ value: $,
1251
+ formData: o,
1252
+ dependencyKey: Y,
1253
+ onChange: (A) => s(i, A),
1254
+ placeholder: _,
1255
+ className: p || "",
1250
1256
  search: l,
1251
- required: y,
1252
- defaultValue: j,
1253
- label: s,
1254
- name: o,
1255
- disabled: F,
1256
- parentClass: x,
1257
+ required: v,
1258
+ defaultValue: B,
1259
+ label: d,
1260
+ name: i,
1261
+ disabled: P,
1262
+ parentClass: y,
1257
1263
  multiple: D,
1258
1264
  dropdownMaxHeight: C
1259
1265
  }
1260
1266
  );
1261
1267
  case "checkbox":
1262
1268
  return /* @__PURE__ */ e(
1263
- la,
1269
+ sa,
1264
1270
  {
1265
- name: o,
1266
- label: s,
1267
- options: p || [],
1268
- value: G,
1269
- onChange: (O) => i(o, O),
1270
- required: y,
1271
- parentClass: x,
1272
- className: u || "",
1271
+ name: i,
1272
+ label: d,
1273
+ options: g || [],
1274
+ value: $,
1275
+ onChange: (A) => s(i, A),
1276
+ required: v,
1277
+ parentClass: y,
1278
+ className: p || "",
1273
1279
  multiSelect: D,
1274
- disabled: F
1280
+ disabled: P
1275
1281
  }
1276
1282
  );
1277
1283
  case "switch":
1278
1284
  return /* @__PURE__ */ e(
1279
- aa,
1285
+ na,
1280
1286
  {
1281
- value: G,
1282
- onChange: (O) => i(o, O),
1283
- text: g,
1284
- options: p || [],
1285
- label: s,
1286
- required: y,
1287
- name: o,
1288
- disabled: F,
1289
- parentClass: x
1287
+ value: $,
1288
+ onChange: (A) => s(i, A),
1289
+ text: m,
1290
+ options: g || [],
1291
+ label: d,
1292
+ required: v,
1293
+ name: i,
1294
+ disabled: P,
1295
+ parentClass: y
1290
1296
  }
1291
1297
  );
1292
1298
  case "phone":
1293
1299
  return /* @__PURE__ */ e(
1294
- ra,
1300
+ la,
1295
1301
  {
1296
- value: G,
1297
- onChange: (O) => i(o, O),
1298
- countriesList: N,
1302
+ value: $,
1303
+ onChange: (A) => s(i, A),
1304
+ countriesList: k,
1299
1305
  defaultCountry: I,
1300
- required: y,
1301
- placeholder: K,
1306
+ required: v,
1307
+ placeholder: _,
1302
1308
  search: l,
1303
- label: s,
1304
- name: o,
1305
- disabled: F,
1306
- parentClass: x
1309
+ label: d,
1310
+ name: i,
1311
+ disabled: P,
1312
+ parentClass: y
1307
1313
  }
1308
1314
  );
1309
1315
  case "textarea":
1310
1316
  return /* @__PURE__ */ e(
1311
- Ie,
1317
+ je,
1312
1318
  {
1313
- value: G,
1314
- onChange: (O) => i(o, O.target.value),
1315
- placeholder: K,
1316
- rows: M || 3,
1317
- className: `${U} ${u || ""}`,
1318
- required: y,
1319
- name: o,
1320
- label: s,
1321
- disabled: F,
1322
- parentClass: x
1319
+ value: $,
1320
+ onChange: (A) => s(i, A.target.value),
1321
+ placeholder: _,
1322
+ rows: S || 3,
1323
+ className: `${z} ${p || ""}`,
1324
+ required: v,
1325
+ name: i,
1326
+ label: d,
1327
+ disabled: P,
1328
+ parentClass: y
1323
1329
  }
1324
1330
  );
1325
1331
  case "image":
1326
1332
  return /* @__PURE__ */ e(
1327
- ta,
1333
+ oa,
1328
1334
  {
1329
- value: G,
1330
- onChange: (O) => i(o, O),
1331
- required: y,
1332
- accept: c || "image/*",
1333
- id: `file-${o}`,
1334
- dragDrop: v,
1335
- label: s,
1336
- name: o,
1337
- parentClass: x
1335
+ value: $,
1336
+ onChange: (A) => s(i, A),
1337
+ required: v,
1338
+ accept: u || "image/*",
1339
+ id: `file-${i}`,
1340
+ dragDrop: w,
1341
+ label: d,
1342
+ name: i,
1343
+ parentClass: y
1338
1344
  }
1339
1345
  );
1340
1346
  case "audio":
1341
1347
  return /* @__PURE__ */ e(
1342
- oa,
1348
+ da,
1343
1349
  {
1344
- value: G,
1345
- onChange: (O) => i(o, O),
1346
- required: y,
1347
- accept: c || "audio/*",
1348
- id: `file-${o}`,
1349
- dragDrop: v,
1350
- label: s,
1351
- name: o,
1352
- parentClass: x
1350
+ value: $,
1351
+ onChange: (A) => s(i, A),
1352
+ required: v,
1353
+ accept: u || "audio/*",
1354
+ id: `file-${i}`,
1355
+ dragDrop: w,
1356
+ label: d,
1357
+ name: i,
1358
+ parentClass: y
1353
1359
  }
1354
1360
  );
1355
1361
  case "tinyEditor":
1356
1362
  return /* @__PURE__ */ e(
1357
- na,
1363
+ ia,
1358
1364
  {
1359
- value: G,
1360
- onChange: (O) => i(o, O),
1361
- required: y,
1362
- placeholder: K,
1363
- label: s,
1364
- parentClass: x,
1365
- fontFamily: B,
1366
- editorKey: A,
1367
- disabled: F
1365
+ value: $,
1366
+ onChange: (A) => s(i, A),
1367
+ required: v,
1368
+ placeholder: _,
1369
+ label: d,
1370
+ parentClass: y,
1371
+ fontFamily: F,
1372
+ editorKey: O,
1373
+ disabled: P
1368
1374
  },
1369
- `editor-${o}`
1375
+ `editor-${i}`
1370
1376
  );
1371
1377
  default:
1372
1378
  return /* @__PURE__ */ e(
1373
- Be,
1379
+ Ee,
1374
1380
  {
1375
- type: t || "text",
1376
- value: G,
1377
- onChange: (O) => i(o, O.target.value),
1378
- placeholder: K,
1379
- className: `${U} ${u || ""}`,
1380
- required: y,
1381
- name: o,
1382
- minLength: b,
1383
- label: s,
1384
- negativeNumberAllow: R,
1385
- parentClass: x,
1386
- disabled: F
1381
+ type: r || "text",
1382
+ defaultValue: B,
1383
+ value: $,
1384
+ onChange: (A) => s(i, A.target.value),
1385
+ placeholder: _,
1386
+ className: `${z} ${p || ""}`,
1387
+ required: v,
1388
+ name: i,
1389
+ minLength: c,
1390
+ label: d,
1391
+ negativeNumberAllow: L,
1392
+ parentClass: y,
1393
+ disabled: P
1387
1394
  }
1388
1395
  );
1389
1396
  }
1390
- }, ia = ({ isOpen: h, onClose: n, config: i, onApply: o }) => {
1391
- var u;
1392
- const [s, t] = S({}), p = (l, c) => {
1393
- t((g) => ({ ...g, [l]: c }));
1394
- }, k = () => {
1395
- o == null || o(s), n();
1397
+ }, ca = ({ isOpen: b, onClose: o, config: s, onApply: i }) => {
1398
+ var p;
1399
+ const [d, r] = R({}), g = (l, u) => {
1400
+ r((m) => ({ ...m, [l]: u }));
1396
1401
  }, M = () => {
1397
- t({}), o == null || o({}), n();
1402
+ i == null || i(d), o();
1403
+ }, S = () => {
1404
+ r({}), i == null || i({}), o();
1398
1405
  };
1399
- return /* @__PURE__ */ d(E, { children: [
1406
+ return /* @__PURE__ */ h(j, { children: [
1400
1407
  /* @__PURE__ */ e(
1401
1408
  "div",
1402
1409
  {
1403
- className: `fixed inset-0 bg-black/50 z-40 transition-opacity duration-300 ${h ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"}`,
1404
- onClick: n
1410
+ className: `fixed inset-0 bg-black/50 z-40 transition-opacity duration-300 ${b ? "opacity-100 pointer-events-auto" : "opacity-0 pointer-events-none"}`,
1411
+ onClick: o
1405
1412
  }
1406
1413
  ),
1407
- /* @__PURE__ */ d(
1414
+ /* @__PURE__ */ h(
1408
1415
  "div",
1409
1416
  {
1410
1417
  className: `fixed top-0 right-0 h-full w-[28rem] bg-white dark:bg-gray-900 shadow-2xl z-50 flex flex-col border-l border-gray-200 dark:border-gray-700
1411
1418
  transform transition-transform duration-300 ease-in-out
1412
- ${h ? "translate-x-0" : "translate-x-full"}
1419
+ ${b ? "translate-x-0" : "translate-x-full"}
1413
1420
  `,
1414
1421
  children: [
1415
- /* @__PURE__ */ d("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700", children: [
1422
+ /* @__PURE__ */ h("div", { className: "flex items-center justify-between px-4 py-3 border-b border-gray-200 dark:border-gray-700", children: [
1416
1423
  /* @__PURE__ */ e("h2", { className: "text-lg font-semibold text-gray-900 dark:text-white", children: "Filters" }),
1417
1424
  /* @__PURE__ */ e(
1418
1425
  "button",
1419
1426
  {
1420
- onClick: n,
1427
+ onClick: o,
1421
1428
  className: "p-2 hover:bg-gray-100 dark:hover:bg-gray-800 rounded-md transition",
1422
- children: /* @__PURE__ */ e(we, { className: "w-5 h-5 text-gray-500 dark:text-gray-400" })
1429
+ children: /* @__PURE__ */ e(Ne, { className: "w-5 h-5 text-gray-500 dark:text-gray-400" })
1423
1430
  }
1424
1431
  )
1425
1432
  ] }),
1426
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-4 py-3", children: i != null && i.component ? /* @__PURE__ */ e(i.component, { filters: s, onFilterChange: p }) : /* @__PURE__ */ e("div", { className: "space-y-4", children: (u = i == null ? void 0 : i.fields) == null ? void 0 : u.map((l) => /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(
1427
- Ue,
1433
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-4 py-3", children: s != null && s.component ? /* @__PURE__ */ e(s.component, { filters: d, onFilterChange: g }) : /* @__PURE__ */ e("div", { className: "space-y-4", children: (p = s == null ? void 0 : s.fields) == null ? void 0 : p.map((l) => /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(
1434
+ $e,
1428
1435
  {
1429
1436
  field: l,
1430
- formData: s,
1431
- handleChange: p
1437
+ formData: d,
1438
+ handleChange: g
1432
1439
  },
1433
1440
  l.key
1434
1441
  ) })) }) }),
1435
- /* @__PURE__ */ d("div", { className: "flex gap-2 px-4 py-3 border-t border-gray-200 dark:border-gray-700", children: [
1442
+ /* @__PURE__ */ h("div", { className: "flex gap-2 px-4 py-3 border-t border-gray-200 dark:border-gray-700", children: [
1436
1443
  /* @__PURE__ */ e(
1437
- ee,
1444
+ Z,
1438
1445
  {
1439
- onClick: k,
1446
+ onClick: M,
1440
1447
  variant: "contained",
1441
1448
  color: "primary",
1442
1449
  fullWidth: !0,
@@ -1444,9 +1451,9 @@ const na = ({
1444
1451
  }
1445
1452
  ),
1446
1453
  /* @__PURE__ */ e(
1447
- ee,
1454
+ Z,
1448
1455
  {
1449
- onClick: M,
1456
+ onClick: S,
1450
1457
  variant: "contained",
1451
1458
  className: "min-w-[150px]",
1452
1459
  children: "Reset"
@@ -1457,7 +1464,7 @@ const na = ({
1457
1464
  }
1458
1465
  )
1459
1466
  ] });
1460
- }, Oe = {
1467
+ }, Pe = {
1461
1468
  blue: {
1462
1469
  bg: "bg-blue-100 text-blue-800 dark:bg-blue-900/30 dark:text-blue-300",
1463
1470
  border: "border border-blue-300 text-blue-700 dark:border-blue-700 dark:text-blue-300"
@@ -1486,76 +1493,76 @@ const na = ({
1486
1493
  bg: "bg-gray-100 text-gray-800 dark:bg-gray-900/30 dark:text-gray-300",
1487
1494
  border: "border border-gray-300 text-gray-700 dark:border-gray-700 dark:text-gray-300"
1488
1495
  }
1489
- }, Ae = {
1496
+ }, Te = {
1490
1497
  contained: "bg",
1491
1498
  outline: "border !bg-transparent",
1492
1499
  soft: "bg opacity-90"
1493
- }, je = ({
1494
- label: h,
1495
- variant: n = "contained",
1500
+ }, Ge = ({
1501
+ label: b,
1502
+ variant: o = "contained",
1496
1503
  // contained | outline | soft
1497
- color: i = "green",
1498
- className: o = ""
1504
+ color: s = "green",
1505
+ className: i = ""
1499
1506
  }) => {
1500
- const s = Oe[i] || Oe.green, t = Ae[n] || Ae.contained, p = n === "outline" ? s.border : s.bg;
1507
+ const d = Pe[s] || Pe.green, r = Te[o] || Te.contained, g = o === "outline" ? d.border : d.bg;
1501
1508
  return /* @__PURE__ */ e(
1502
1509
  "span",
1503
1510
  {
1504
1511
  className: `inline-flex justify-center items-center rounded-sm text-xs font-semibold px-3 py-1 min-w-[78px]
1505
- ${p}
1506
- ${t}
1507
- ${o}`,
1508
- children: h
1512
+ ${g}
1513
+ ${r}
1514
+ ${i}`,
1515
+ children: b
1509
1516
  }
1510
1517
  );
1511
- }, sa = ({ rows: h = 5, columns: n = 5 }) => /* @__PURE__ */ d(E, { children: [
1518
+ }, ha = ({ rows: b = 5, columns: o = 5 }) => /* @__PURE__ */ h(j, { children: [
1512
1519
  /* @__PURE__ */ e("div", { className: "w-full mb-6 inline-flex justify-end items-center", children: /* @__PURE__ */ e("div", { className: "h-8 w-80 bg-gray-300 dark:bg-gray-700 rounded animate-pulse" }) }),
1513
- /* @__PURE__ */ e("div", { className: "overflow-hidden rounded-md border border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ d("table", { className: "w-full border-collapse", children: [
1514
- /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { className: "bg-gray-50 dark:bg-gray-900", children: Array.from({ length: n }).map((i, o) => /* @__PURE__ */ e("th", { className: "px-4 py-3", children: /* @__PURE__ */ e("div", { className: "h-6 w-24 bg-gray-300 dark:bg-gray-700 rounded animate-pulse inline-flex justify-center items-center" }) }, o)) }) }),
1515
- /* @__PURE__ */ e("tbody", { children: Array.from({ length: h }).map((i, o) => /* @__PURE__ */ e(
1520
+ /* @__PURE__ */ e("div", { className: "overflow-hidden rounded-md border border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ h("table", { className: "w-full border-collapse", children: [
1521
+ /* @__PURE__ */ e("thead", { children: /* @__PURE__ */ e("tr", { className: "bg-gray-50 dark:bg-gray-900", children: Array.from({ length: o }).map((s, i) => /* @__PURE__ */ e("th", { className: "px-4 py-3", children: /* @__PURE__ */ e("div", { className: "h-6 w-24 bg-gray-300 dark:bg-gray-700 rounded animate-pulse inline-flex justify-center items-center" }) }, i)) }) }),
1522
+ /* @__PURE__ */ e("tbody", { children: Array.from({ length: b }).map((s, i) => /* @__PURE__ */ e(
1516
1523
  "tr",
1517
1524
  {
1518
1525
  className: "border-t border-gray-200 dark:border-gray-800",
1519
- children: Array.from({ length: n }).map((s, t) => /* @__PURE__ */ e("td", { className: "px-4 py-6", children: /* @__PURE__ */ e("div", { className: "h-6 w-full bg-gray-300 dark:bg-gray-700 rounded animate-pulse" }) }, t))
1526
+ children: Array.from({ length: o }).map((d, r) => /* @__PURE__ */ e("td", { className: "px-4 py-6", children: /* @__PURE__ */ e("div", { className: "h-6 w-full bg-gray-300 dark:bg-gray-700 rounded animate-pulse" }) }, r))
1520
1527
  },
1521
- o
1528
+ i
1522
1529
  )) })
1523
1530
  ] }) })
1524
- ] }), Ee = ({ src: h, alt: n = "preview", isOpen: i, setIsOpen: o }) => {
1525
- const s = () => o(!1);
1526
- return H(() => {
1527
- const t = (p) => {
1528
- p.key === "Escape" && s();
1531
+ ] }), _e = ({ src: b, alt: o = "preview", isOpen: s, setIsOpen: i }) => {
1532
+ const d = () => i(!1);
1533
+ return K(() => {
1534
+ const r = (g) => {
1535
+ g.key === "Escape" && d();
1529
1536
  };
1530
- return i && (document.body.style.overflow = "hidden", document.addEventListener("keydown", t)), () => {
1531
- document.body.style.overflow = "", document.removeEventListener("keydown", t);
1537
+ return s && (document.body.style.overflow = "hidden", document.addEventListener("keydown", r)), () => {
1538
+ document.body.style.overflow = "", document.removeEventListener("keydown", r);
1532
1539
  };
1533
- }, [i]), /* @__PURE__ */ e(E, { children: /* @__PURE__ */ d(
1540
+ }, [s]), /* @__PURE__ */ e(j, { children: /* @__PURE__ */ h(
1534
1541
  "div",
1535
1542
  {
1536
1543
  className: `fixed inset-0 z-50 flex items-center justify-center bg-black/70 dark:bg-black/80 \r
1537
1544
  backdrop-blur-sm animate-in fade-in duration-200`,
1538
- onClick: s,
1545
+ onClick: d,
1539
1546
  children: [
1540
1547
  /* @__PURE__ */ e(
1541
1548
  "button",
1542
1549
  {
1543
- onClick: s,
1550
+ onClick: d,
1544
1551
  className: `absolute top-4 right-4 bg-white dark:bg-gray-800 text-gray-800 dark:text-gray-200\r
1545
1552
  hover:bg-gray-100 dark:hover:bg-gray-700 rounded-full p-2 shadow-lg transition`,
1546
- children: /* @__PURE__ */ e(we, { size: 20 })
1553
+ children: /* @__PURE__ */ e(Ne, { size: 20 })
1547
1554
  }
1548
1555
  ),
1549
1556
  /* @__PURE__ */ e(
1550
1557
  "div",
1551
1558
  {
1552
1559
  className: "max-w-5xl w-full px-4 transform transition-all duration-200 scale-95 animate-in zoom-in-95",
1553
- onClick: (t) => t.stopPropagation(),
1560
+ onClick: (r) => r.stopPropagation(),
1554
1561
  children: /* @__PURE__ */ e(
1555
1562
  "img",
1556
1563
  {
1557
- src: h,
1558
- alt: n,
1564
+ src: b,
1565
+ alt: o,
1559
1566
  className: "w-full max-h-[90vh] object-contain rounded-xl"
1560
1567
  }
1561
1568
  )
@@ -1564,17 +1571,17 @@ const na = ({
1564
1571
  ]
1565
1572
  }
1566
1573
  ) });
1567
- }, da = ({ config: h, setShowAdd: n, title: i, buttonText: o, description: s }) => {
1574
+ }, ua = ({ config: b, setShowAdd: o, title: s, buttonText: i, description: d }) => {
1568
1575
  const {
1569
- data: t = [],
1570
- table_head: p = [],
1571
- loading: k = !1,
1572
- search: M = {
1576
+ data: r = [],
1577
+ table_head: g = [],
1578
+ loading: M = !1,
1579
+ search: S = {
1573
1580
  enabled: !1,
1574
1581
  placeholder: "Search...",
1575
1582
  useServerSideSearch: !1
1576
1583
  },
1577
- filter: u = {
1584
+ filter: p = {
1578
1585
  enabled: !1,
1579
1586
  useServerSideFilters: !1
1580
1587
  },
@@ -1583,656 +1590,667 @@ const na = ({
1583
1590
  rows_per_page: 10,
1584
1591
  useServerSidePagination: !1
1585
1592
  },
1586
- emptyMessage: c = "No data available",
1587
- onMenuAction: g,
1588
- setServerSidePaginationData: y = () => {
1593
+ emptyMessage: u = "No data available",
1594
+ onMenuAction: m,
1595
+ setServerSidePaginationData: v = () => {
1589
1596
  },
1590
- onFilterApply: b,
1591
- filterConfig: v = null
1592
- } = h, [x, N] = S(""), [I, D] = S(null), [C, A] = S([]), [B, F] = S({}), [R, j] = S(!1), [$, W] = S(null), [G, K] = S(!1), U = Me(() => !M.enabled || !x.trim() || M.useServerSideSearch ? t : Xe(t, x, M.searchKeys || []), [t, x, M]), [O, Y] = S(1), [q, w] = S((l == null ? void 0 : l.rows_per_page) || 50), [z, re] = S(U.length || 0), J = l != null && l.useServerSidePagination ? l.total_pages : Math.ceil(U.length / q), X = Me(() => {
1593
- if (l.useServerSidePagination) return U;
1594
- const r = (O - 1) * q;
1595
- return U.slice(r, r + q);
1596
- }, [U, O, q]), ne = ae(null), ie = ae({}), le = ae(null), se = (r) => {
1597
- N(r), Y(1), M.useServerSideSearch && (le.current && clearTimeout(le.current), le.current = setTimeout(async () => {
1597
+ onFilterApply: c,
1598
+ filterConfig: w = null,
1599
+ rowClick: y = null
1600
+ } = b, [k, I] = R(""), [D, C] = R(null), [O, F] = R([]), [P, L] = R({}), [B, E] = R(!1), [Y, $] = R(null), [_, z] = R(!1), A = Re(() => !S.enabled || !k.trim() || S.useServerSideSearch ? r : ta(r, k, S.searchKeys || []), [r, k, S]), [U, V] = R(1), [x, H] = R((l == null ? void 0 : l.rows_per_page) || 50), [J, Q] = R(A.length || 0), W = l != null && l.useServerSidePagination ? l.total_pages : Math.ceil(A.length / x), oe = Re(() => {
1601
+ if (l.useServerSidePagination) return A;
1602
+ const a = (U - 1) * x;
1603
+ return A.slice(a, a + x);
1604
+ }, [A, U, x]), re = ee(null), ie = ee({}), ae = ee(null), se = (a) => {
1605
+ I(a), V(1), S.useServerSideSearch && (ae.current && clearTimeout(ae.current), ae.current = setTimeout(async () => {
1598
1606
  try {
1599
- await y((f) => ({
1600
- ...f,
1601
- search: r,
1607
+ await v((n) => ({
1608
+ ...n,
1609
+ search: a,
1602
1610
  current_page: 1
1603
1611
  }));
1604
- } catch (f) {
1605
- console.error("Search error:", f);
1612
+ } catch (n) {
1613
+ console.error("Search error:", n);
1606
1614
  }
1607
1615
  }, 800));
1608
- }, de = (r, f, P) => {
1609
- P.stopPropagation(), D(null), g == null || g(r.type, f);
1610
- }, ce = (r, f, P) => {
1611
- f.stopPropagation(), A(P);
1612
- const _ = f.currentTarget;
1613
- ie.current[r] = _;
1614
- const m = _.getBoundingClientRect(), L = 192, T = P.length * 40, Z = window.innerWidth, V = window.innerHeight, Ge = Z - m.right < L ? m.left - L + m.width : m.left, _e = V - m.bottom < T && m.top > T ? m.top - T - 2 : m.bottom + 2;
1615
- F({
1616
- top: Math.max(8, Math.min(_e, V - T - 8)),
1617
- left: Math.max(8, Math.min(Ge, Z - L - 8))
1618
- }), D(I === r ? null : r);
1619
- }, he = (r) => (O - 1) * q + r + 1, ue = (r) => {
1620
- r && r.src instanceof File && (r = { ...r, src: URL.createObjectURL(r.src) }), W(r), K(!0);
1621
- }, oe = (r, f, P, _ = null) => /* @__PURE__ */ e(E, { children: r ? /* @__PURE__ */ e(
1616
+ }, de = (a, n, f) => {
1617
+ f.stopPropagation(), C(null), m == null || m(a.type, n);
1618
+ }, ce = (a, n, f) => {
1619
+ n.stopPropagation(), F(f);
1620
+ const N = n.currentTarget;
1621
+ ie.current[a] = N;
1622
+ const T = N.getBoundingClientRect(), G = 192, X = f.length * 40, ve = window.innerWidth, Ae = window.innerHeight, ze = ve - T.right < G ? T.left - G + T.width : T.left, He = Ae - T.bottom < X && T.top > X ? T.top - X - 2 : T.bottom + 2;
1623
+ L({
1624
+ top: Math.max(8, Math.min(He, Ae - X - 8)),
1625
+ left: Math.max(8, Math.min(ze, ve - G - 8))
1626
+ }), C(D === a ? null : a);
1627
+ }, he = (a) => (U - 1) * x + a + 1, ue = (a) => {
1628
+ a && a.src instanceof File && (a = { ...a, src: URL.createObjectURL(a.src) }), $(a), z(!0);
1629
+ }, ne = (a, n, f, N = null) => /* @__PURE__ */ e(j, { children: a ? /* @__PURE__ */ e(
1622
1630
  "img",
1623
1631
  {
1624
- src: r instanceof File ? URL.createObjectURL(r) : r,
1625
- alt: f || "Avatar",
1626
- onClick: (m) => {
1627
- m.stopPropagation(), m.preventDefault(), ue({ src: r, alt: f });
1632
+ src: a instanceof File ? URL.createObjectURL(a) : a,
1633
+ alt: n || "Avatar",
1634
+ onClick: (T) => {
1635
+ T.stopPropagation(), T.preventDefault(), ue({ src: a, alt: n });
1628
1636
  },
1629
- className: `w-10 h-10 cursor-pointer shrink-0 rounded-full object-cover border border-gray-200 dark:border-gray-700 ${P || ""}`
1637
+ className: `w-10 h-10 cursor-pointer shrink-0 rounded-full object-cover border border-gray-200 dark:border-gray-700 ${f || ""}`
1630
1638
  }
1631
- ) : /* @__PURE__ */ e(E, { children: _ || /* @__PURE__ */ e(
1639
+ ) : /* @__PURE__ */ e(j, { children: N || /* @__PURE__ */ e(
1632
1640
  "div",
1633
1641
  {
1634
- className: `w-10 h-10 flex items-center shrink-0 justify-center rounded-full border border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600 ${P || ""}`,
1635
- children: /* @__PURE__ */ e(Fe, { className: "w-6 h-6 text-gray-400 dark:text-gray-400" })
1642
+ className: `w-10 h-10 flex items-center shrink-0 justify-center rounded-full border border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600 ${f || ""}`,
1643
+ children: /* @__PURE__ */ e(Be, { className: "w-6 h-6 text-gray-400 dark:text-gray-400" })
1636
1644
  }
1637
- ) }) }), be = (r, f) => /* @__PURE__ */ e(E, { children: r ? /* @__PURE__ */ e(
1645
+ ) }) }), be = (a, n) => /* @__PURE__ */ e(j, { children: a ? /* @__PURE__ */ e(
1638
1646
  "audio",
1639
1647
  {
1640
1648
  controls: !0,
1641
- src: r instanceof File ? URL.createObjectURL(r) : r,
1642
- onClick: (P) => {
1643
- P.stopPropagation();
1649
+ src: a instanceof File ? URL.createObjectURL(a) : a,
1650
+ onClick: (f) => {
1651
+ f.stopPropagation();
1644
1652
  },
1645
- className: `w-64 cursor-pointer ${f || ""}`
1653
+ className: `w-64 cursor-pointer ${n || ""}`
1646
1654
  },
1647
- r instanceof File ? URL.createObjectURL(r) : r
1648
- ) : /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(
1655
+ a instanceof File ? URL.createObjectURL(a) : a
1656
+ ) : /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(
1649
1657
  "div",
1650
1658
  {
1651
- className: `w-12 h-12 flex items-center shrink-0 justify-center rounded-full border border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600 ${f || ""}`,
1652
- children: /* @__PURE__ */ e(qe, { className: "w-6 h-6 text-gray-400 dark:text-gray-400" })
1659
+ className: `w-12 h-12 flex items-center shrink-0 justify-center rounded-full border border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600 ${n || ""}`,
1660
+ children: /* @__PURE__ */ e(Qe, { className: "w-6 h-6 text-gray-400 dark:text-gray-400" })
1653
1661
  }
1654
- ) }) }), pe = (r, f) => /* @__PURE__ */ d("div", { className: `flex items-center space-x-4 ${f.className || ""}`, children: [
1655
- f.imageKey ? oe(r[f.imageKey], r[f.titleKey], "group-avatar") : "",
1656
- /* @__PURE__ */ d("div", { children: [
1657
- /* @__PURE__ */ e("p", { className: "font-medium text-gray-900 dark:text-white group-title", children: r[f.titleKey] || "" }),
1658
- /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400 group-sub-title", children: r[f.subtitleKey] || "" })
1662
+ ) }) }), pe = (a, n) => /* @__PURE__ */ h("div", { className: `flex items-center space-x-4 ${n.className || ""}`, children: [
1663
+ n.imageKey ? ne(a[n.imageKey], a[n.titleKey], "group-avatar") : "",
1664
+ /* @__PURE__ */ h("div", { children: [
1665
+ /* @__PURE__ */ e("p", { className: "font-medium text-gray-900 dark:text-white group-title", children: a[n.titleKey] || "" }),
1666
+ /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400 group-sub-title", children: a[n.subtitleKey] || "" })
1659
1667
  ] })
1660
- ] }), ge = (r, f) => {
1661
- var L;
1662
- let P = String(r);
1663
- const _ = f.variant || "contained";
1664
- let m = f.defaultColor;
1665
- if (((L = f == null ? void 0 : f.chipOptions) == null ? void 0 : L.length) > 0) {
1666
- let T = f == null ? void 0 : f.chipOptions.find((Z) => Z.value == r);
1667
- T && (P = T.label, m = T.color);
1668
+ ] }), ge = (a, n) => {
1669
+ var G;
1670
+ let f = String(a);
1671
+ const N = n.variant || "contained";
1672
+ let T = n.defaultColor;
1673
+ if (((G = n == null ? void 0 : n.chipOptions) == null ? void 0 : G.length) > 0) {
1674
+ let X = n == null ? void 0 : n.chipOptions.find((ve) => ve.value == a);
1675
+ X && (f = X.label, T = X.color);
1668
1676
  }
1669
1677
  return /* @__PURE__ */ e(
1670
- je,
1678
+ Ge,
1671
1679
  {
1672
- label: P,
1673
- variant: _,
1674
- color: m,
1675
- className: f.className || ""
1680
+ label: f,
1681
+ variant: N,
1682
+ color: T,
1683
+ className: n.className || ""
1676
1684
  }
1677
1685
  );
1678
- }, me = (r, f, P) => {
1679
- const _ = f[r.key];
1680
- return r.type === "menu_actions" ? /* @__PURE__ */ e("div", { className: `text-center ${r.className || ""}`, children: /* @__PURE__ */ e(
1686
+ }, me = (a, n, f) => {
1687
+ const N = n[a.key];
1688
+ return a.type === "menu_actions" ? /* @__PURE__ */ e("div", { className: `text-center ${a.className || ""}`, children: /* @__PURE__ */ e(
1681
1689
  "button",
1682
1690
  {
1683
- ref: (m) => ie.current[f.id || f._id] = m,
1684
- onClick: (m) => ce(f.id || f._id, m, r.menuList),
1691
+ ref: (T) => ie.current[n.id || n._id] = T,
1692
+ onClick: (T) => ce(n.id || n._id, T, a.menuList),
1685
1693
  className: "p-2 bg-gray-100 dark:bg-gray-700 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-full transition text-gray-700 dark:text-gray-300",
1686
- children: /* @__PURE__ */ e(We, { className: "h-4 w-4" })
1694
+ children: /* @__PURE__ */ e(Je, { className: "h-4 w-4" })
1687
1695
  }
1688
- ) }) : r.type === "index" ? /* @__PURE__ */ e("span", { className: r.className || "", children: he(P) }) : r.type === "group" ? pe(f, r) : r.type === "chip" ? /* @__PURE__ */ e(E, { children: ge(_, r) }) : r.type === "date" ? /* @__PURE__ */ e("span", { className: r.className || "", children: Pe(_, r.format || "DD MMM YYYY") }) : r.type === "avatar" ? /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e("div", { className: "min-w-[40px]", children: oe(_, r.alt, r.className, r.fallback_icon) }) }) : r.type === "audio" ? /* @__PURE__ */ e(E, { children: be(_, r.className) }) : /* @__PURE__ */ e("span", { className: r.className || "", children: _ || "N/A" });
1689
- }, fe = (r, f) => {
1690
- if (r.onClickDetails)
1691
- return g == null ? void 0 : g("view", f);
1692
- if (typeof r.handleClick == "function")
1693
- return r.handleClick(f);
1694
- }, ye = (r) => r.onClickDetails || typeof r.handleClick == "function";
1695
- return H(() => {
1696
- const r = () => {
1697
- I && D(null);
1696
+ ) }) : a.type === "index" ? /* @__PURE__ */ e("span", { className: a.className || "", children: he(f) }) : a.type === "group" ? pe(n, a) : a.type === "chip" ? /* @__PURE__ */ e(j, { children: ge(N, a) }) : a.type === "date" ? /* @__PURE__ */ e("span", { className: a.className || "", children: Ue(N, a.format || "DD MMM YYYY") }) : a.type === "avatar" ? /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e("div", { className: "min-w-[40px]", children: ne(N, a.alt, a.className, a.fallback_icon) }) }) : a.type === "audio" ? /* @__PURE__ */ e(j, { children: be(N, a.className) }) : /* @__PURE__ */ e("span", { className: a.className || "", children: N || "N/A" });
1697
+ }, fe = (a) => {
1698
+ if (typeof y == "function")
1699
+ return y(a);
1700
+ if (y)
1701
+ return m == null ? void 0 : m("view", a);
1702
+ }, ye = (a, n) => {
1703
+ if (a.onClickDetails)
1704
+ return m == null ? void 0 : m("view", n);
1705
+ if (typeof a.handleClick == "function")
1706
+ return a.handleClick(n);
1707
+ }, le = () => y || typeof y == "function", xe = (a) => a.onClickDetails || typeof a.handleClick == "function";
1708
+ return K(() => {
1709
+ const a = () => {
1710
+ D && C(null);
1698
1711
  };
1699
- return window.addEventListener("scroll", r, !0), () => {
1700
- window.removeEventListener("scroll", r, !0);
1712
+ return window.addEventListener("scroll", a, !0), () => {
1713
+ window.removeEventListener("scroll", a, !0);
1701
1714
  };
1702
- }, [I]), H(() => {
1703
- const r = (f) => {
1704
- ne.current && !ne.current.contains(f.target) && D(null);
1715
+ }, [D]), K(() => {
1716
+ const a = (n) => {
1717
+ re.current && !re.current.contains(n.target) && C(null);
1705
1718
  };
1706
- return document.addEventListener("click", r), () => document.removeEventListener("click", r);
1707
- }, []), H(() => {
1708
- l != null && l.rows_per_page && (l != null && l.useServerSidePagination) && w((l == null ? void 0 : l.rows_per_page) || 50), l.current_page && Y(l.current_page);
1719
+ return document.addEventListener("click", a), () => document.removeEventListener("click", a);
1720
+ }, []), K(() => {
1721
+ l != null && l.rows_per_page && (l != null && l.useServerSidePagination) && H((l == null ? void 0 : l.rows_per_page) || 50), l.current_page && V(l.current_page);
1709
1722
  }, [
1710
1723
  l.rows_per_page,
1711
1724
  l == null ? void 0 : l.useServerSidePagination,
1712
1725
  l.current_page
1713
- ]), H(() => {
1714
- re(
1715
- l != null && l.useServerSidePagination ? l.total_records : U.length
1716
- ), U.length <= q * (O - 1) && !(l != null && l.useServerSidePagination) && Y((r) => r - 1 || 1);
1726
+ ]), K(() => {
1727
+ Q(
1728
+ l != null && l.useServerSidePagination ? l.total_records : A.length
1729
+ ), A.length <= x * (U - 1) && !(l != null && l.useServerSidePagination) && V((a) => a - 1 || 1);
1717
1730
  }, [
1718
- U.length,
1731
+ A.length,
1719
1732
  l.total_records,
1720
1733
  l == null ? void 0 : l.useServerSidePagination
1721
- ]), k ? /* @__PURE__ */ e(sa, { rows: 6, columns: 6 }) : /* @__PURE__ */ d(E, { children: [
1722
- /* @__PURE__ */ d("div", { className: "flex flex-col sm:flex-row sm:justify-between gap-4 mb-3", children: [
1723
- /* @__PURE__ */ d("div", { children: [
1724
- /* @__PURE__ */ e("h1", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: i }),
1725
- /* @__PURE__ */ e("p", { className: "text-md text-gray-600 dark:text-gray-400", children: s })
1734
+ ]), M ? /* @__PURE__ */ e(ha, { rows: 6, columns: 6 }) : /* @__PURE__ */ h(j, { children: [
1735
+ /* @__PURE__ */ h("div", { className: "flex flex-col sm:flex-row sm:justify-between gap-4 mb-3", children: [
1736
+ /* @__PURE__ */ h("div", { children: [
1737
+ /* @__PURE__ */ e("h1", { className: "text-2xl font-bold text-gray-900 dark:text-white", children: s }),
1738
+ /* @__PURE__ */ e("p", { className: "text-md text-gray-600 dark:text-gray-400", children: d })
1726
1739
  ] }),
1727
- /* @__PURE__ */ d("div", { className: "flex flex-col justify-end items-end gap-2", children: [
1728
- /* @__PURE__ */ d(
1729
- ee,
1740
+ /* @__PURE__ */ h("div", { className: "flex flex-col justify-end items-end gap-2", children: [
1741
+ /* @__PURE__ */ h(
1742
+ Z,
1730
1743
  {
1731
- onClick: () => n(!0),
1744
+ onClick: () => o(!0),
1732
1745
  variant: "contained",
1733
1746
  color: "primary",
1734
1747
  children: [
1735
- /* @__PURE__ */ e(ze, { className: "w-4 h-4 mr-2" }),
1736
- o || "Add New"
1748
+ /* @__PURE__ */ e(Ve, { className: "w-4 h-4 mr-2" }),
1749
+ i || "Add New"
1737
1750
  ]
1738
1751
  }
1739
1752
  ),
1740
- /* @__PURE__ */ d("div", { className: "flex justify-end items-center gap-2", children: [
1741
- M.enabled && /* @__PURE__ */ e("div", { className: "", children: /* @__PURE__ */ d("div", { className: "relative min-w-[300px]", children: [
1742
- /* @__PURE__ */ e(Re, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-300" }),
1753
+ /* @__PURE__ */ h("div", { className: "flex justify-end items-center gap-2", children: [
1754
+ S.enabled && /* @__PURE__ */ e("div", { className: "", children: /* @__PURE__ */ h("div", { className: "relative min-w-[300px]", children: [
1755
+ /* @__PURE__ */ e(Oe, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-gray-400 dark:text-gray-300" }),
1743
1756
  /* @__PURE__ */ e(
1744
1757
  "input",
1745
1758
  {
1746
1759
  type: "text",
1747
- placeholder: M.placeholder || "Search...",
1748
- value: x,
1749
- onChange: (r) => se(r.target.value),
1760
+ placeholder: S.placeholder || "Search...",
1761
+ value: k,
1762
+ onChange: (a) => se(a.target.value),
1750
1763
  className: "w-full h-[36px] pl-9 pr-4 py-3 text-sm border border-gray-300 dark:border-gray-600 rounded-md bg-gray-50 dark:bg-gray-700 text-gray-900 dark:text-white placeholder-gray-500 dark:placeholder-gray-400 focus:outline-none focus:ring-1 focus:ring-blue-300 dark:ring-blue-200 disabled:opacity-50"
1751
1764
  }
1752
1765
  )
1753
1766
  ] }) }),
1754
- v && u.enabled && /* @__PURE__ */ d(ee, { onClick: () => j(!0), variant: "contained", children: [
1755
- /* @__PURE__ */ e(He, { className: "w-4 h-4 mr-2" }),
1767
+ w && p.enabled && /* @__PURE__ */ h(Z, { onClick: () => E(!0), variant: "contained", children: [
1768
+ /* @__PURE__ */ e(We, { className: "w-4 h-4 mr-2" }),
1756
1769
  "Filters"
1757
1770
  ] })
1758
1771
  ] })
1759
1772
  ] })
1760
1773
  ] }),
1761
- /* @__PURE__ */ d("div", { className: "bg-white dark:bg-gray-800 rounded-lg shadow overflow-hidden border border-gray-200 dark:border-gray-700", children: [
1762
- /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ d("table", { className: "min-w-full divide-y divide-gray-200 dark:divide-gray-700", children: [
1763
- /* @__PURE__ */ e("thead", { className: "bg-gray-50 dark:bg-gray-700/60", children: /* @__PURE__ */ e("tr", { children: p.map((r) => /* @__PURE__ */ e(
1774
+ /* @__PURE__ */ h("div", { className: "bg-white dark:bg-gray-800 rounded-lg shadow overflow-hidden border border-gray-200 dark:border-gray-700", children: [
1775
+ /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ h("table", { className: "min-w-full divide-y divide-gray-200 dark:divide-gray-700", children: [
1776
+ /* @__PURE__ */ e("thead", { className: "bg-gray-50 dark:bg-gray-700/60", children: /* @__PURE__ */ e("tr", { children: g.map((a) => /* @__PURE__ */ e(
1764
1777
  "th",
1765
1778
  {
1766
- className: `px-6 py-4 text-left text-xs font-medium text-black dark:text-white uppercase tracking-wider min-w-max max-w-[180px] truncate ${r.headClass || ""}`,
1767
- children: r.title
1779
+ className: `px-6 py-4 text-left text-xs font-medium text-black dark:text-white uppercase tracking-wider min-w-max max-w-[180px] truncate ${a.headClass || ""}`,
1780
+ children: a.title
1768
1781
  },
1769
- r.key
1782
+ a.key
1770
1783
  )) }) }),
1771
- /* @__PURE__ */ e("tbody", { className: "bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700", children: X.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
1784
+ /* @__PURE__ */ e("tbody", { className: "bg-white dark:bg-gray-800 divide-y divide-gray-200 dark:divide-gray-700", children: oe.length === 0 ? /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e(
1772
1785
  "td",
1773
1786
  {
1774
- colSpan: p.length,
1787
+ colSpan: g.length,
1775
1788
  className: "text-center py-10 text-gray-500 dark:text-gray-400",
1776
- children: c
1789
+ children: u
1777
1790
  }
1778
- ) }) : X.map((r, f) => /* @__PURE__ */ e(
1791
+ ) }) : oe.map((a, n) => /* @__PURE__ */ e(
1779
1792
  "tr",
1780
1793
  {
1781
- className: "hover:bg-gray-50 dark:hover:bg-blue-800/10 transition",
1782
- children: p.map((P) => /* @__PURE__ */ e(
1794
+ className: `hover:bg-gray-50 dark:hover:bg-blue-800/10 transition ${le() ? "cursor-pointer" : ""}`,
1795
+ onClick: (f) => {
1796
+ f.stopPropagation(), f.preventDefault(), le() && fe(a);
1797
+ },
1798
+ children: g.map((f) => /* @__PURE__ */ e(
1783
1799
  "td",
1784
1800
  {
1785
- className: `px-6 py-4 text-sm text-gray-900 dark:text-gray-100 min-w-max ${P.type == "audio" ? "" : "max-w-[300px]"} truncate ${ye(P) ? "cursor-pointer" : ""}`,
1786
- title: String(r[P.key] ?? ""),
1787
- onClick: () => fe(P, r),
1788
- children: P.render ? P.render(r, f) : me(P, r, f)
1801
+ className: `px-6 py-4 text-sm text-gray-900 dark:text-gray-100 min-w-max ${f.type == "audio" ? "" : "max-w-[300px]"} truncate ${xe(f) ? "cursor-pointer" : ""}`,
1802
+ title: String(a[f.key] ?? ""),
1803
+ onClick: (N) => {
1804
+ N.stopPropagation(), N.preventDefault(), ye(f, a);
1805
+ },
1806
+ children: f.render ? f.render(a, n) : me(f, a, n)
1789
1807
  },
1790
- P.key
1808
+ f.key
1791
1809
  ))
1792
1810
  },
1793
- r.id || r._id || f
1811
+ a.id || a._id || n
1794
1812
  )) })
1795
1813
  ] }) }),
1796
- (l == null ? void 0 : l.enabled) && U.length > 0 && /* @__PURE__ */ d("div", { className: " bg-gray-50 dark:bg-gray-700/60 px-6 py-3 flex flex-wrap items-center justify-between border-t border-gray-200 dark:border-gray-600 gap-3", children: [
1797
- /* @__PURE__ */ d("div", { className: "text-sm text-gray-700 dark:text-gray-300", children: [
1814
+ (l == null ? void 0 : l.enabled) && A.length > 0 && /* @__PURE__ */ h("div", { className: " bg-gray-50 dark:bg-gray-700/60 px-6 py-3 flex flex-wrap items-center justify-between border-t border-gray-200 dark:border-gray-600 gap-3", children: [
1815
+ /* @__PURE__ */ h("div", { className: "text-sm text-gray-700 dark:text-gray-300", children: [
1798
1816
  "Showing ",
1799
- (O - 1) * q + 1,
1817
+ (U - 1) * x + 1,
1800
1818
  " to",
1801
1819
  " ",
1802
- Math.min(O * q, z),
1820
+ Math.min(U * x, J),
1803
1821
  " of ",
1804
- z,
1822
+ J,
1805
1823
  " ",
1806
1824
  "results"
1807
1825
  ] }),
1808
- /* @__PURE__ */ d("div", { className: "flex items-center gap-4", children: [
1809
- /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
1826
+ /* @__PURE__ */ h("div", { className: "flex items-center gap-4", children: [
1827
+ /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
1810
1828
  /* @__PURE__ */ e("span", { className: "text-sm text-gray-700 dark:text-gray-300", children: "Rows per page:" }),
1811
1829
  /* @__PURE__ */ e(
1812
1830
  "select",
1813
1831
  {
1814
- value: q,
1815
- onChange: (r) => {
1816
- const f = Number(r.target.value);
1817
- w(f), Y(1), l.useServerSidePagination && y((P) => ({
1818
- ...P,
1832
+ value: x,
1833
+ onChange: (a) => {
1834
+ const n = Number(a.target.value);
1835
+ H(n), V(1), l.useServerSidePagination && v((f) => ({
1836
+ ...f,
1819
1837
  current_page: 1,
1820
- rows_per_page: f
1838
+ rows_per_page: n
1821
1839
  }));
1822
1840
  },
1823
1841
  className: "border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-sm rounded-md px-2 py-1 focus:outline-none focus:ring-1 focus:ring-blue-500",
1824
- children: [2, 10, 25, 50, 100].map((r) => /* @__PURE__ */ e("option", { value: r, children: r }, r))
1842
+ children: [2, 10, 25, 50, 100].map((a) => /* @__PURE__ */ e("option", { value: a, children: a }, a))
1825
1843
  }
1826
1844
  )
1827
1845
  ] }),
1828
- /* @__PURE__ */ d("div", { className: "flex items-center gap-2", children: [
1846
+ /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
1829
1847
  /* @__PURE__ */ e(
1830
1848
  "button",
1831
1849
  {
1832
1850
  onClick: () => {
1833
- if (O > 1) {
1834
- const r = O - 1;
1835
- Y(r), l.useServerSidePagination && y((f) => ({
1836
- ...f,
1837
- current_page: r
1851
+ if (U > 1) {
1852
+ const a = U - 1;
1853
+ V(a), l.useServerSidePagination && v((n) => ({
1854
+ ...n,
1855
+ current_page: a
1838
1856
  }));
1839
1857
  }
1840
1858
  },
1841
- disabled: O === 1,
1859
+ disabled: U === 1,
1842
1860
  className: "p-2 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-md transition text-gray-500 dark:text-gray-300 disabled:opacity-50",
1843
- children: /* @__PURE__ */ e(Ye, { className: "h-4 w-4" })
1861
+ children: /* @__PURE__ */ e(qe, { className: "h-4 w-4" })
1844
1862
  }
1845
1863
  ),
1846
- /* @__PURE__ */ d("span", { className: "text-sm text-gray-800 dark:text-gray-200", children: [
1864
+ /* @__PURE__ */ h("span", { className: "text-sm text-gray-800 dark:text-gray-200", children: [
1847
1865
  "Page ",
1848
- O,
1866
+ U,
1849
1867
  " of ",
1850
- J
1868
+ W
1851
1869
  ] }),
1852
1870
  /* @__PURE__ */ e(
1853
1871
  "button",
1854
1872
  {
1855
1873
  onClick: () => {
1856
- if (O < J) {
1857
- const r = O + 1;
1858
- Y(r), l.useServerSidePagination && y((f) => ({
1859
- ...f,
1860
- current_page: r
1874
+ if (U < W) {
1875
+ const a = U + 1;
1876
+ V(a), l.useServerSidePagination && v((n) => ({
1877
+ ...n,
1878
+ current_page: a
1861
1879
  }));
1862
1880
  }
1863
1881
  },
1864
- disabled: O === J,
1882
+ disabled: U === W,
1865
1883
  className: "p-2 hover:bg-gray-200 dark:hover:bg-gray-600 rounded-md transition text-gray-500 dark:text-gray-300 disabled:opacity-50",
1866
- children: /* @__PURE__ */ e(Ve, { className: "h-4 w-4" })
1884
+ children: /* @__PURE__ */ e(Ze, { className: "h-4 w-4" })
1867
1885
  }
1868
1886
  )
1869
1887
  ] })
1870
1888
  ] })
1871
1889
  ] })
1872
1890
  ] }),
1873
- I && Ze(
1891
+ D && Xe(
1874
1892
  /* @__PURE__ */ e(
1875
1893
  "div",
1876
1894
  {
1877
- ref: ne,
1895
+ ref: re,
1878
1896
  style: {
1879
1897
  position: "fixed",
1880
- top: `${B.top}px`,
1881
- left: `${B.left}px`,
1898
+ top: `${P.top}px`,
1899
+ left: `${P.left}px`,
1882
1900
  zIndex: 9999
1883
1901
  },
1884
1902
  className: "w-48 bg-white dark:bg-gray-700 rounded-md shadow-lg border border-gray-200 dark:border-gray-600",
1885
- children: C.map((r, f) => /* @__PURE__ */ d(
1903
+ children: O.map((a, n) => /* @__PURE__ */ h(
1886
1904
  "button",
1887
1905
  {
1888
- onClick: (P) => de(
1889
- r,
1890
- t.find(
1891
- (_) => _.id === I || _._id == I
1906
+ onClick: (f) => de(
1907
+ a,
1908
+ r.find(
1909
+ (N) => N.id === D || N._id == D
1892
1910
  ),
1893
- P
1911
+ f
1894
1912
  ),
1895
- className: `w-full flex items-center gap-2 px-4 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-gray-600 ${r.variant === "danger" ? "text-red-600 dark:text-red-500" : "text-gray-700 dark:text-gray-200"}`,
1913
+ className: `w-full flex items-center gap-2 px-4 py-2 text-sm text-left hover:bg-gray-100 dark:hover:bg-gray-600 ${a.variant === "danger" ? "text-red-600 dark:text-red-500" : "text-gray-700 dark:text-gray-200"}`,
1896
1914
  children: [
1897
- r.icon && /* @__PURE__ */ e("span", { className: "shrink-0", children: r.icon }),
1898
- r.title
1915
+ a.icon && /* @__PURE__ */ e("span", { className: "shrink-0", children: a.icon }),
1916
+ a.title
1899
1917
  ]
1900
1918
  },
1901
- f
1919
+ n
1902
1920
  ))
1903
1921
  }
1904
1922
  ),
1905
1923
  document.body
1906
1924
  ),
1907
- v && /* @__PURE__ */ e(
1908
- ia,
1925
+ w && /* @__PURE__ */ e(
1926
+ ca,
1909
1927
  {
1910
- isOpen: R,
1911
- onClose: () => j(!1),
1912
- config: v,
1913
- onApply: b
1928
+ isOpen: B,
1929
+ onClose: () => E(!1),
1930
+ config: w,
1931
+ onApply: c
1914
1932
  }
1915
1933
  ),
1916
- G && /* @__PURE__ */ e(
1917
- Ee,
1934
+ _ && /* @__PURE__ */ e(
1935
+ _e,
1918
1936
  {
1919
- src: $.src,
1920
- alt: $.alt,
1921
- isOpen: G,
1922
- setIsOpen: K
1937
+ src: Y.src,
1938
+ alt: Y.alt,
1939
+ isOpen: _,
1940
+ setIsOpen: z
1923
1941
  }
1924
1942
  )
1925
1943
  ] });
1926
- }, ve = ({
1927
- isOpen: h,
1928
- onClose: n,
1929
- icon: i,
1930
- title: o,
1931
- children: s,
1932
- size: t = "md",
1933
- actionButtons: p = [],
1934
- actions: k,
1935
- showDefaultClose: M = !0,
1936
- footerConfig: u = null,
1944
+ }, ke = ({
1945
+ isOpen: b,
1946
+ onClose: o,
1947
+ icon: s,
1948
+ title: i,
1949
+ children: d,
1950
+ size: r = "md",
1951
+ actionButtons: g = [],
1952
+ actions: M,
1953
+ showDefaultClose: S = !0,
1954
+ footerConfig: p = null,
1937
1955
  hideFooter: l = !1,
1938
- onFormSubmit: c = () => {
1956
+ onFormSubmit: u = () => {
1939
1957
  },
1940
- onCancel: g,
1941
- loadingBtn: y = !1,
1942
- executeFunction: b = () => {
1958
+ onCancel: m,
1959
+ loadingBtn: v = !1,
1960
+ executeFunction: c = () => {
1943
1961
  },
1944
- selectedItem: v = null
1962
+ selectedItem: w = null
1945
1963
  }) => {
1946
- if (!h) return null;
1947
- const x = {
1964
+ if (!b) return null;
1965
+ const y = {
1948
1966
  sm: "max-w-md",
1949
1967
  md: "max-w-lg",
1950
1968
  lg: "max-w-2xl",
1951
1969
  xl: "max-w-4xl",
1952
1970
  full: "max-w-full"
1953
1971
  };
1954
- return /* @__PURE__ */ d("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
1972
+ return /* @__PURE__ */ h("div", { className: "fixed inset-0 z-50 flex items-center justify-center p-4", children: [
1955
1973
  /* @__PURE__ */ e(
1956
1974
  "div",
1957
1975
  {
1958
1976
  className: "fixed inset-0 bg-gray-500 opacity-75",
1959
- onClick: () => n()
1977
+ onClick: () => o()
1960
1978
  }
1961
1979
  ),
1962
- /* @__PURE__ */ d(
1980
+ /* @__PURE__ */ h(
1963
1981
  "div",
1964
1982
  {
1965
- className: `relative bg-white rounded-lg shadow-xl w-full ${x[t] || x.md} max-h-[90vh] flex flex-col dark:bg-gray-800`,
1983
+ className: `relative bg-white rounded-lg shadow-xl w-full ${y[r] || y.md} max-h-[90vh] flex flex-col dark:bg-gray-800`,
1966
1984
  children: [
1967
- /* @__PURE__ */ d("div", { className: "flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700 flex-shrink-0", children: [
1968
- /* @__PURE__ */ d("div", { className: "flex items-center gap-1", children: [
1969
- i && /* @__PURE__ */ e("span", { children: i }),
1970
- /* @__PURE__ */ e("h3", { className: "text-lg font-medium text-gray-900 dark:text-white", children: o })
1985
+ /* @__PURE__ */ h("div", { className: "flex items-center justify-between p-4 border-b border-gray-200 dark:border-gray-700 flex-shrink-0", children: [
1986
+ /* @__PURE__ */ h("div", { className: "flex items-center gap-1", children: [
1987
+ s && /* @__PURE__ */ e("span", { children: s }),
1988
+ /* @__PURE__ */ e("h3", { className: "text-lg font-medium text-gray-900 dark:text-white", children: i })
1971
1989
  ] }),
1972
1990
  /* @__PURE__ */ e(
1973
1991
  "button",
1974
1992
  {
1975
- onClick: () => n(),
1993
+ onClick: () => o(),
1976
1994
  className: "text-gray-400 hover:text-gray-600 dark:hover:text-gray-300",
1977
- children: /* @__PURE__ */ e(we, { className: "w-6 h-6" })
1995
+ children: /* @__PURE__ */ e(Ne, { className: "w-6 h-6" })
1978
1996
  }
1979
1997
  )
1980
1998
  ] }),
1981
- /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-4", children: s }),
1982
- p.length > 0 && /* @__PURE__ */ e("div", { className: "px-4 py-3 flex justify-end gap-3 border-t border-gray-200 dark:border-gray-700 sm:px-6", children: p.map((N) => /* @__PURE__ */ e(
1983
- ee,
1999
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto p-4", children: d }),
2000
+ g.length > 0 && /* @__PURE__ */ e("div", { className: "px-4 py-3 flex justify-end gap-3 border-t border-gray-200 dark:border-gray-700 sm:px-6", children: g.map((k) => /* @__PURE__ */ e(
2001
+ Z,
1984
2002
  {
1985
2003
  onClick: (I) => {
1986
- N.type == "submit" ? c(I) : b(
2004
+ k.type == "submit" ? u(I) : c(
1987
2005
  () => {
1988
2006
  var D;
1989
- return (D = N == null ? void 0 : N.onClick) == null ? void 0 : D.call(N, I, v);
2007
+ return (D = k == null ? void 0 : k.onClick) == null ? void 0 : D.call(k, I, w);
1990
2008
  },
1991
- (D) => n == null ? void 0 : n(D)
2009
+ (D) => o == null ? void 0 : o(D)
1992
2010
  );
1993
2011
  },
1994
- disabled: y || N.disabled,
1995
- variant: N.variant || "contained",
1996
- color: N.color || "primary",
1997
- className: `min-w-[100px] ${N.className}`,
1998
- type: N.type || "button",
1999
- children: y ? /* @__PURE__ */ d("div", { className: "flex items-center", children: [
2012
+ disabled: v || k.disabled,
2013
+ variant: k.variant || "contained",
2014
+ color: k.color || "primary",
2015
+ className: `min-w-[100px] ${k.className}`,
2016
+ type: k.type || "button",
2017
+ children: v ? /* @__PURE__ */ h("div", { className: "flex items-center", children: [
2000
2018
  /* @__PURE__ */ e("div", { className: "animate-spin rounded-full h-4 w-4 border-2 border-white/30 border-t-2 border-t-white mr-2" }),
2001
- N.label || "Submit",
2019
+ k.label || "Submit",
2002
2020
  "..."
2003
- ] }) : N.label || "Submit"
2021
+ ] }) : k.label || "Submit"
2004
2022
  }
2005
2023
  )) })
2006
2024
  ]
2007
2025
  }
2008
2026
  )
2009
2027
  ] });
2010
- }, De = ({ config: h, onSubmit: n, initialData: i = {}, type: o = "add" }) => {
2011
- const { formClass: s = "grid grid-cols-12 gap-4", formFields: t = [] } = h || {}, [p, k] = S(i);
2012
- H(() => {
2013
- k(i);
2028
+ }, Fe = ({ config: b, onSubmit: o, initialData: s = {}, type: i = "add" }) => {
2029
+ const { formClass: d = "grid grid-cols-12 gap-4", formFields: r = [] } = b || {}, [g, M] = R(s);
2030
+ K(() => {
2031
+ M(s);
2014
2032
  }, []);
2015
- const M = (l, c) => {
2016
- k((g) => ({ ...g, [l]: c }));
2017
- }, u = (l) => {
2033
+ const S = (l, u) => {
2034
+ M((m) => ({ ...m, [l]: u }));
2035
+ }, p = (l) => {
2018
2036
  l.preventDefault();
2019
- const c = l.target;
2020
- if (!c.checkValidity()) {
2021
- c.reportValidity();
2037
+ const u = l.target;
2038
+ if (!u.checkValidity()) {
2039
+ u.reportValidity();
2022
2040
  return;
2023
2041
  }
2024
- n(p);
2042
+ o(g);
2025
2043
  };
2026
2044
  return /* @__PURE__ */ e(
2027
2045
  "form",
2028
2046
  {
2029
- id: o == "add" ? "addForm" : o == "edit" ? "editForm" : "defaultForm",
2030
- onSubmit: u,
2031
- className: s,
2047
+ id: i == "add" ? "addForm" : i == "edit" ? "editForm" : "defaultForm",
2048
+ onSubmit: p,
2049
+ className: d,
2032
2050
  noValidate: !1,
2033
- children: t.map((l) => /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e(
2034
- Ue,
2051
+ children: r.map((l) => /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(
2052
+ $e,
2035
2053
  {
2036
2054
  field: l,
2037
- formData: p,
2038
- handleChange: M
2055
+ formData: g,
2056
+ handleChange: S
2039
2057
  },
2040
2058
  l.key
2041
2059
  ) }))
2042
2060
  }
2043
2061
  );
2044
2062
  };
2045
- function ca({ data: h, config: n }) {
2046
- const { fields: i, containerClass: o } = n, [s, t] = S(null), [p, k] = S(!1), M = (c) => {
2047
- c && c.src instanceof File && (c = { ...c, src: URL.createObjectURL(c.src) }), t(c), k(!0);
2048
- }, u = ({ col: c }) => {
2063
+ function ba({ data: b, config: o }) {
2064
+ const { fields: s, containerClass: i } = o, [d, r] = R(null), [g, M] = R(!1), S = (u) => {
2065
+ u && u.src instanceof File && (u = { ...u, src: URL.createObjectURL(u.src) }), r(u), M(!0);
2066
+ }, p = ({ col: u }) => {
2049
2067
  var I;
2050
- let g = c == null ? void 0 : c.icon, y = c.label, b = h[c.key], v = c.type, x = c.variant || "outline", N = c.defaultColor;
2051
- if (v === "chip" && ((I = c.chipOptions) == null ? void 0 : I.length) > 0) {
2052
- let D = c == null ? void 0 : c.chipOptions.find((C) => C.value == b);
2053
- D && (b = D.label, N = D.color);
2068
+ let m = u == null ? void 0 : u.icon, v = u.label, c = b[u.key], w = u.type, y = u.variant || "outline", k = u.defaultColor;
2069
+ if (w === "chip" && ((I = u.chipOptions) == null ? void 0 : I.length) > 0) {
2070
+ let D = u == null ? void 0 : u.chipOptions.find((C) => C.value == c);
2071
+ D && (c = D.label, k = D.color);
2054
2072
  }
2055
- return /* @__PURE__ */ d(
2073
+ return /* @__PURE__ */ h(
2056
2074
  "div",
2057
2075
  {
2058
2076
  className: `col-span-12 flex items-center space-x-4 p-4 rounded-xl
2059
- bg-gray-100 dark:bg-gray-900 ${c.blockClass || ""}`,
2077
+ bg-gray-100 dark:bg-gray-900 ${u.blockClass || ""}`,
2060
2078
  children: [
2061
- g && /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: g }),
2062
- /* @__PURE__ */ d("div", { className: "flex-1 min-w-0", children: [
2063
- /* @__PURE__ */ e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: y }),
2064
- v === "chip" ? /* @__PURE__ */ e(
2065
- je,
2079
+ m && /* @__PURE__ */ e("div", { className: "flex-shrink-0", children: m }),
2080
+ /* @__PURE__ */ h("div", { className: "flex-1 min-w-0", children: [
2081
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium text-gray-500 dark:text-gray-400", children: v }),
2082
+ w === "chip" ? /* @__PURE__ */ e(
2083
+ Ge,
2066
2084
  {
2067
- label: b,
2068
- variant: x,
2069
- color: N,
2085
+ label: c,
2086
+ variant: y,
2087
+ color: k,
2070
2088
  className: "mt-1"
2071
2089
  }
2072
2090
  ) : (
2073
2091
  /* TINY EDITOR */
2074
- v === "tinyEditor" ? /* @__PURE__ */ e(
2092
+ w === "tinyEditor" ? /* @__PURE__ */ e(
2075
2093
  "p",
2076
2094
  {
2077
2095
  className: "mt-1 text-sm text-gray-900 dark:text-white break-words",
2078
2096
  dangerouslySetInnerHTML: {
2079
- __html: b
2097
+ __html: c
2080
2098
  }
2081
2099
  }
2082
- ) : v === "audio" ? b ? /* @__PURE__ */ e(
2100
+ ) : w === "audio" ? c ? /* @__PURE__ */ e(
2083
2101
  "audio",
2084
2102
  {
2085
2103
  controls: !0,
2086
- src: b instanceof File ? URL.createObjectURL(b) : b,
2104
+ src: c instanceof File ? URL.createObjectURL(c) : c,
2087
2105
  onClick: (D) => D.stopPropagation(),
2088
2106
  className: "shadow-md rounded-full"
2089
2107
  },
2090
- b instanceof File ? URL.createObjectURL(b) : b
2108
+ c instanceof File ? URL.createObjectURL(c) : c
2091
2109
  ) : /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-400", children: "N/A" }) : (
2092
2110
  /* DEFAULT */
2093
- /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-900 dark:text-white break-words", children: v == "date" ? /* @__PURE__ */ e("span", { children: Pe(b, c.format || "DD MMM YYYY") }) : b || "N/A" })
2111
+ /* @__PURE__ */ e("p", { className: "mt-1 text-sm text-gray-900 dark:text-white break-words", children: w == "date" ? /* @__PURE__ */ e("span", { children: Ue(c, u.format || "DD MMM YYYY") }) : c || "N/A" })
2094
2112
  )
2095
2113
  )
2096
2114
  ] })
2097
2115
  ]
2098
2116
  }
2099
2117
  );
2100
- }, l = ({ col: c }) => {
2101
- let g = h[c.titleKey], y = h[c.subtitleKey], b = h[c.imageKey], v = h[c.fallback_icon];
2102
- return /* @__PURE__ */ d(
2118
+ }, l = ({ col: u }) => {
2119
+ let m = b[u.titleKey], v = b[u.subtitleKey], c = b[u.imageKey], w = b[u.fallback_icon];
2120
+ return /* @__PURE__ */ h(
2103
2121
  "div",
2104
2122
  {
2105
2123
  className: `col-span-12 flex items-center space-x-4 p-4 rounded-xl
2106
2124
  bg-gray-100 dark:bg-gray-900
2107
- ${c.blockClass}`,
2125
+ ${u.blockClass}`,
2108
2126
  children: [
2109
- b ? /* @__PURE__ */ e(
2127
+ c ? /* @__PURE__ */ e(
2110
2128
  "img",
2111
2129
  {
2112
- src: b instanceof File ? URL.createObjectURL(b) : b,
2113
- alt: g,
2114
- onClick: () => M({ src: b, alt: g }),
2130
+ src: c instanceof File ? URL.createObjectURL(c) : c,
2131
+ alt: m,
2132
+ onClick: () => S({ src: c, alt: m }),
2115
2133
  className: "w-16 h-16 cursor-pointer rounded-full object-cover border-2 border-gray-200 dark:border-gray-700"
2116
2134
  }
2117
- ) : v || /* @__PURE__ */ e("div", { className: "w-16 h-16 flex items-center justify-center rounded-full border-2 border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600", children: /* @__PURE__ */ e(Fe, { className: "w-8 h-8 text-gray-400" }) }),
2118
- /* @__PURE__ */ d("div", { children: [
2119
- /* @__PURE__ */ e("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white", children: g }),
2120
- /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: y })
2135
+ ) : w || /* @__PURE__ */ e("div", { className: "w-16 h-16 flex items-center justify-center rounded-full border-2 border-gray-300 dark:border-gray-700 bg-gray-200 dark:bg-gray-600", children: /* @__PURE__ */ e(Be, { className: "w-8 h-8 text-gray-400" }) }),
2136
+ /* @__PURE__ */ h("div", { children: [
2137
+ /* @__PURE__ */ e("h3", { className: "text-xl font-semibold text-gray-900 dark:text-white", children: m }),
2138
+ /* @__PURE__ */ e("p", { className: "text-sm text-gray-500 dark:text-gray-400", children: v })
2121
2139
  ] })
2122
2140
  ]
2123
2141
  }
2124
2142
  );
2125
2143
  };
2126
- return /* @__PURE__ */ d(E, { children: [
2127
- p && /* @__PURE__ */ e(
2128
- Ee,
2144
+ return /* @__PURE__ */ h(j, { children: [
2145
+ g && /* @__PURE__ */ e(
2146
+ _e,
2129
2147
  {
2130
- src: s.src,
2131
- alt: s.alt,
2132
- isOpen: p,
2133
- setIsOpen: k
2148
+ src: d.src,
2149
+ alt: d.alt,
2150
+ isOpen: g,
2151
+ setIsOpen: M
2134
2152
  }
2135
2153
  ),
2136
- /* @__PURE__ */ e("div", { className: `grid grid-cols-12 gap-4 ${o || ""}`, children: i.map(
2137
- (c) => c.type == "group" ? /* @__PURE__ */ e(l, { col: c }) : /* @__PURE__ */ e(u, { col: c })
2154
+ /* @__PURE__ */ e("div", { className: `grid grid-cols-12 gap-4 ${i || ""}`, children: s.map(
2155
+ (u) => u.type == "group" ? /* @__PURE__ */ e(l, { col: u }) : /* @__PURE__ */ e(p, { col: u })
2138
2156
  ) })
2139
2157
  ] });
2140
2158
  }
2141
- const $e = ({ config: h }) => {
2142
- var se, de, ce, he, ue, oe, be, pe, ge, me, fe, ye, r, f, P, _;
2159
+ const Ke = ({ config: b }) => {
2160
+ var ae, se, de, ce, he, ue, ne, be, pe, ge, me, fe, ye, le, xe, a;
2143
2161
  const {
2144
- title: n,
2145
- fetchData: i = async () => {
2162
+ title: o,
2163
+ fetchData: s = async () => {
2146
2164
  },
2147
- isStaticData: o = !1,
2148
- tableConfig: s = {},
2149
- modalConfig: t = {},
2150
- filterConfig: p
2151
- } = h, [k, M] = S(!0), [u, l] = S(!1), [c, g] = S([]), [y, b] = S(null), [v, x] = S({
2165
+ isStaticData: i = !1,
2166
+ tableConfig: d = {},
2167
+ modalConfig: r = {},
2168
+ filterConfig: g
2169
+ } = b, [M, S] = R(!0), [p, l] = R(!1), [u, m] = R([]), [v, c] = R(null), [w, y] = R({
2152
2170
  search: "",
2153
2171
  rows_per_page: 50,
2154
2172
  current_page: 1
2155
- }), [N, I] = S({}), [D, C] = S(!1), [A, B] = S(!1), [F, R] = S(!1), [j, $] = S(!1), [W, G] = S(!1), [K, U] = S(null), O = (m, L) => {
2156
- m === "edit" ? (U(L), R(!0)) : m === "view" ? (U(L), G(!0)) : m === "delete" && (U(L), $(!0));
2157
- }, Y = async (m, L, T = "", Z = "") => {
2173
+ }), [k, I] = R({}), [D, C] = R(!1), [O, F] = R(!1), [P, L] = R(!1), [B, E] = R(!1), [Y, $] = R(!1), [_, z] = R(null), A = (n, f) => {
2174
+ n === "edit" ? (z(f), L(!0)) : n === "view" ? (z(f), $(!0)) : n === "delete" && (z(f), E(!0));
2175
+ }, U = async (n, f, N = "", T = "") => {
2158
2176
  l(!0);
2159
2177
  try {
2160
- const V = await (m == null ? void 0 : m());
2161
- (T || V.message) && ke(T || V.message, {
2178
+ const G = await (n == null ? void 0 : n());
2179
+ (N || G.message) && Se(N || G.message, {
2162
2180
  variant: "success"
2163
- }), L == null || L(V);
2164
- } catch (V) {
2165
- (Z || V.message) && ke(Z || V.message, { variant: "error" });
2181
+ }), f == null || f(G);
2182
+ } catch (G) {
2183
+ (T || G.message) && Se(T || G.message, { variant: "error" });
2166
2184
  } finally {
2167
2185
  l(!1);
2168
2186
  }
2169
- }, q = (m) => {
2170
- let L = m.newObject;
2171
- o ? (g((T) => [L, ...T]), b((T) => ({
2172
- ...T,
2187
+ }, V = (n) => {
2188
+ let f = n.newObject;
2189
+ i ? (m((N) => [f, ...N]), c((N) => ({
2190
+ ...N,
2173
2191
  current_page: 1
2174
- }))) : (x((T) => ({
2175
- ...T,
2192
+ }))) : (y((N) => ({
2193
+ ...N,
2176
2194
  current_page: 1
2177
- })), v.current_page == 1 && X()), B(!1);
2178
- }, w = (m) => {
2179
- let L = m.newObject, T = m.targetObject;
2180
- o ? g(
2181
- (Z) => Z.map(
2182
- (V) => V.id === T.id ? { ...V, ...L } : V
2195
+ })), w.current_page == 1 && W()), F(!1);
2196
+ }, x = (n) => {
2197
+ let f = n.newObject, N = n.targetObject;
2198
+ i ? m(
2199
+ (T) => T.map(
2200
+ (G) => G.id === N.id ? { ...G, ...f } : G
2183
2201
  )
2184
- ) : X(), R(!1);
2185
- }, z = (m) => {
2186
- if (!m) {
2187
- $(!1), U(null);
2202
+ ) : W(), L(!1);
2203
+ }, H = (n) => {
2204
+ if (!n) {
2205
+ E(!1), z(null);
2188
2206
  return;
2189
2207
  }
2190
- o ? g(
2191
- (L) => L.filter((T) => T.id !== m.targetObject.id)
2192
- ) : c.length == 1 && v.current_page > 1 ? x((L) => ({
2193
- ...L,
2194
- current_page: L.current_page - 1
2195
- })) : X(), $(!1), U(null);
2196
- }, re = (m) => Y(
2208
+ i ? m(
2209
+ (f) => f.filter((N) => N.id !== n.targetObject.id)
2210
+ ) : u.length == 1 && w.current_page > 1 ? y((f) => ({
2211
+ ...f,
2212
+ current_page: f.current_page - 1
2213
+ })) : W(), E(!1), z(null);
2214
+ }, J = (n) => U(
2197
2215
  () => {
2198
- var L, T;
2199
- return (T = (L = t == null ? void 0 : t.addModal) == null ? void 0 : L.handleSubmit) == null ? void 0 : T.call(L, m);
2216
+ var f, N;
2217
+ return (N = (f = r == null ? void 0 : r.addModal) == null ? void 0 : f.handleSubmit) == null ? void 0 : N.call(f, n);
2200
2218
  },
2201
- q
2202
- ), J = (m) => Y(
2219
+ V
2220
+ ), Q = (n) => U(
2203
2221
  () => {
2204
- var L, T;
2205
- return (T = (L = t == null ? void 0 : t.editModal) == null ? void 0 : L.handleSubmit) == null ? void 0 : T.call(L, m, K);
2222
+ var f, N;
2223
+ return (N = (f = r == null ? void 0 : r.editModal) == null ? void 0 : f.handleSubmit) == null ? void 0 : N.call(f, n, _);
2206
2224
  },
2207
- w
2208
- ), X = async () => {
2209
- M(!0), i == null || i({ ...v, ...N }).then((m) => {
2210
- g(m.data), b(m.pagination);
2211
- }).catch((m) => {
2212
- ke(m.message, { variant: "error" });
2225
+ x
2226
+ ), W = async () => {
2227
+ S(!0), s == null || s({ ...w, ...k }).then((n) => {
2228
+ m(n.data), c(n.pagination);
2229
+ }).catch((n) => {
2230
+ Se(n.message, { variant: "error" });
2213
2231
  }).finally(() => {
2214
- M(!1);
2232
+ S(!1);
2215
2233
  });
2216
- }, ne = (m) => {
2217
- var L;
2218
- I((T) => ({
2219
- ...m
2220
- })), (L = s == null ? void 0 : s.filter) != null && L.useServerSideFilters && C((T) => !T);
2221
- }, ie = (m, L) => m.filter(
2222
- (T) => Object.entries(L).every(([Z, V]) => T[Z] === V)
2223
- ), le = Me(() => {
2224
- var m;
2225
- return (m = s == null ? void 0 : s.filter) != null && m.useServerSideFilters ? c : ie(c, N);
2226
- }, [c, N]);
2227
- return H(() => {
2228
- X();
2234
+ }, oe = (n) => {
2235
+ var f;
2236
+ I((N) => ({
2237
+ ...n
2238
+ })), (f = d == null ? void 0 : d.filter) != null && f.useServerSideFilters && C((N) => !N);
2239
+ }, re = (n, f) => n.filter(
2240
+ (N) => Object.entries(f).every(([T, G]) => N[T] === G)
2241
+ ), ie = Re(() => {
2242
+ var n;
2243
+ return (n = d == null ? void 0 : d.filter) != null && n.useServerSideFilters ? u : re(u, k);
2244
+ }, [u, k]);
2245
+ return K(() => {
2246
+ W();
2229
2247
  }, [
2230
- v.search,
2231
- v.rows_per_page,
2232
- v.current_page,
2248
+ w.search,
2249
+ w.rows_per_page,
2250
+ w.current_page,
2233
2251
  D
2234
2252
  ]), /* @__PURE__ */ e(
2235
- Qe,
2253
+ aa,
2236
2254
  {
2237
2255
  maxSnack: 3,
2238
2256
  anchorOrigin: {
@@ -2240,133 +2258,133 @@ const $e = ({ config: h }) => {
2240
2258
  horizontal: "right"
2241
2259
  },
2242
2260
  autoHideDuration: 3e3,
2243
- action: (m) => /* @__PURE__ */ e(
2261
+ action: (n) => /* @__PURE__ */ e(
2244
2262
  "button",
2245
2263
  {
2246
2264
  onClick: () => {
2247
2265
  window.dispatchEvent(
2248
- new CustomEvent("closeSnackbar", { detail: m })
2266
+ new CustomEvent("closeSnackbar", { detail: n })
2249
2267
  );
2250
2268
  },
2251
2269
  className: "p-1 hover:bg-white/20 rounded-full transition-colors duration-200 text-white flex items-center justify-center",
2252
- children: /* @__PURE__ */ e(we, { className: "h-4 w-4" })
2270
+ children: /* @__PURE__ */ e(Ne, { className: "h-4 w-4" })
2253
2271
  }
2254
2272
  ),
2255
- children: /* @__PURE__ */ d("div", { children: [
2273
+ children: /* @__PURE__ */ h("div", { children: [
2256
2274
  /* @__PURE__ */ e(
2257
- da,
2275
+ ua,
2258
2276
  {
2259
- title: n,
2260
- setShowAdd: B,
2261
- description: h.description,
2262
- buttonText: h.buttonText,
2277
+ title: o,
2278
+ setShowAdd: F,
2279
+ description: b.description,
2280
+ buttonText: b.buttonText,
2263
2281
  config: {
2264
- ...s,
2282
+ ...d,
2265
2283
  pagination: {
2266
- ...s.pagination,
2267
- ...y
2284
+ ...d.pagination,
2285
+ ...v
2268
2286
  },
2269
- data: le,
2270
- setServerSidePaginationData: x,
2271
- onMenuAction: O,
2272
- filterConfig: p,
2273
- onFilterApply: ne,
2274
- loading: k
2287
+ data: ie,
2288
+ setServerSidePaginationData: y,
2289
+ onMenuAction: A,
2290
+ filterConfig: g,
2291
+ onFilterApply: oe,
2292
+ loading: M
2275
2293
  }
2276
2294
  }
2277
2295
  ),
2278
2296
  /* @__PURE__ */ e(
2279
- ve,
2297
+ ke,
2280
2298
  {
2281
- isOpen: A,
2299
+ isOpen: O,
2282
2300
  onClose: () => {
2283
- u || B(!1);
2301
+ p || F(!1);
2284
2302
  },
2285
- icon: (se = t.addModal) == null ? void 0 : se.icon,
2286
- title: ((de = t.addModal) == null ? void 0 : de.title) || "Add New",
2287
- size: ((ce = t.addModal) == null ? void 0 : ce.size) || "md",
2303
+ icon: (ae = r.addModal) == null ? void 0 : ae.icon,
2304
+ title: ((se = r.addModal) == null ? void 0 : se.title) || "Add New",
2305
+ size: ((de = r.addModal) == null ? void 0 : de.size) || "md",
2288
2306
  onFormSubmit: () => {
2289
- var m;
2290
- return (m = document.querySelector("#addForm")) == null ? void 0 : m.requestSubmit();
2307
+ var n;
2308
+ return (n = document.querySelector("#addForm")) == null ? void 0 : n.requestSubmit();
2291
2309
  },
2292
- loadingBtn: u,
2293
- actionButtons: t.addModal.actionButtons,
2310
+ loadingBtn: p,
2311
+ actionButtons: r.addModal.actionButtons,
2294
2312
  children: /* @__PURE__ */ e(
2295
- De,
2313
+ Fe,
2296
2314
  {
2297
- config: (t == null ? void 0 : t.addModal) || [],
2298
- onSubmit: re,
2315
+ config: (r == null ? void 0 : r.addModal) || [],
2316
+ onSubmit: J,
2299
2317
  initialData: {},
2300
2318
  type: "add",
2301
- loading: u
2319
+ loading: p
2302
2320
  }
2303
2321
  )
2304
2322
  }
2305
2323
  ),
2306
2324
  /* @__PURE__ */ e(
2307
- ve,
2325
+ ke,
2308
2326
  {
2309
- isOpen: F,
2327
+ isOpen: P,
2310
2328
  onClose: () => {
2311
- u || R(!1);
2329
+ p || L(!1);
2312
2330
  },
2313
- icon: (he = t.editModal) == null ? void 0 : he.icon,
2314
- title: ((ue = t.editModal) == null ? void 0 : ue.title) || "Edit",
2315
- size: ((oe = t.editModal) == null ? void 0 : oe.size) || "md",
2331
+ icon: (ce = r.editModal) == null ? void 0 : ce.icon,
2332
+ title: ((he = r.editModal) == null ? void 0 : he.title) || "Edit",
2333
+ size: ((ue = r.editModal) == null ? void 0 : ue.size) || "md",
2316
2334
  onFormSubmit: () => {
2317
- var m;
2318
- return (m = document.querySelector("#editForm")) == null ? void 0 : m.requestSubmit();
2335
+ var n;
2336
+ return (n = document.querySelector("#editForm")) == null ? void 0 : n.requestSubmit();
2319
2337
  },
2320
- actionButtons: t.editModal.actionButtons,
2321
- loadingBtn: u,
2338
+ actionButtons: r.editModal.actionButtons,
2339
+ loadingBtn: p,
2322
2340
  children: /* @__PURE__ */ e(
2323
- De,
2341
+ Fe,
2324
2342
  {
2325
- config: t.editModal || [],
2326
- onSubmit: J,
2327
- initialData: K,
2343
+ config: r.editModal || [],
2344
+ onSubmit: Q,
2345
+ initialData: _,
2328
2346
  type: "edit",
2329
- loading: u
2347
+ loading: p
2330
2348
  }
2331
2349
  )
2332
2350
  }
2333
2351
  ),
2334
- j && /* @__PURE__ */ e(
2335
- ve,
2352
+ B && /* @__PURE__ */ e(
2353
+ ke,
2336
2354
  {
2337
- isOpen: j,
2338
- onClose: (m) => {
2339
- z(m);
2355
+ isOpen: B,
2356
+ onClose: (n) => {
2357
+ H(n);
2340
2358
  },
2341
- icon: ((be = t.deleteModal) == null ? void 0 : be.icon) || /* @__PURE__ */ e(te, { icon: "ph:warning-bold", className: "w-6 h-6 text-red-500" }),
2342
- title: ((pe = t.deleteModal) == null ? void 0 : pe.title) || "Confirm Delete",
2343
- size: ((ge = t.deleteModal) == null ? void 0 : ge.size) || "md",
2344
- loading: u,
2345
- actionButtons: t.deleteModal.actionButtons,
2346
- executeFunction: Y,
2347
- selectedItem: K,
2348
- children: /* @__PURE__ */ e("div", { className: "flex items-center space-x-2 py-3", children: /* @__PURE__ */ d("div", { children: [
2349
- /* @__PURE__ */ e("p", { className: "text-md text-gray-700 dark:text-white", children: ((me = t.deleteModal) == null ? void 0 : me.confirmText) || "Are you sure you want to delete this item?" }),
2350
- ((fe = t.deleteModal) == null ? void 0 : fe.referenceKey) && /* @__PURE__ */ e("p", { className: "text-md font-semibold text-gray-700 dark:text-white", children: K[(ye = t.deleteModal) == null ? void 0 : ye.referenceKey] })
2359
+ icon: ((ne = r.deleteModal) == null ? void 0 : ne.icon) || /* @__PURE__ */ e(te, { icon: "ph:warning-bold", className: "w-6 h-6 text-red-500" }),
2360
+ title: ((be = r.deleteModal) == null ? void 0 : be.title) || "Confirm Delete",
2361
+ size: ((pe = r.deleteModal) == null ? void 0 : pe.size) || "md",
2362
+ loading: p,
2363
+ actionButtons: r.deleteModal.actionButtons,
2364
+ executeFunction: U,
2365
+ selectedItem: _,
2366
+ children: /* @__PURE__ */ e("div", { className: "flex items-center space-x-2 py-3", children: /* @__PURE__ */ h("div", { children: [
2367
+ /* @__PURE__ */ e("p", { className: "text-md text-gray-700 dark:text-white", children: ((ge = r.deleteModal) == null ? void 0 : ge.confirmText) || "Are you sure you want to delete this item?" }),
2368
+ ((me = r.deleteModal) == null ? void 0 : me.referenceKey) && /* @__PURE__ */ e("p", { className: "text-md font-semibold text-gray-700 dark:text-white", children: _[(fe = r.deleteModal) == null ? void 0 : fe.referenceKey] })
2351
2369
  ] }) })
2352
2370
  }
2353
2371
  ),
2354
- t.viewModal && /* @__PURE__ */ e(
2355
- ve,
2372
+ r.viewModal && /* @__PURE__ */ e(
2373
+ ke,
2356
2374
  {
2357
- isOpen: W,
2375
+ isOpen: Y,
2358
2376
  onClose: () => {
2359
- G(!1), U(null);
2377
+ $(!1), z(null);
2360
2378
  },
2361
- icon: (r = t.viewModal) == null ? void 0 : r.icon,
2362
- title: ((f = t.viewModal) == null ? void 0 : f.title) || "View Details",
2363
- size: ((P = t.viewModal) == null ? void 0 : P.size) || "lg",
2364
- footerConfig: t == null ? void 0 : t.viewModal.footer,
2365
- children: (_ = t.viewModal) != null && _.component ? /* @__PURE__ */ e(t.viewModal.component, { data: K }) : /* @__PURE__ */ e(
2366
- ca,
2379
+ icon: (ye = r.viewModal) == null ? void 0 : ye.icon,
2380
+ title: ((le = r.viewModal) == null ? void 0 : le.title) || "View Details",
2381
+ size: ((xe = r.viewModal) == null ? void 0 : xe.size) || "lg",
2382
+ footerConfig: r == null ? void 0 : r.viewModal.footer,
2383
+ children: (a = r.viewModal) != null && a.component ? /* @__PURE__ */ e(r.viewModal.component, { data: _ }) : /* @__PURE__ */ e(
2384
+ ba,
2367
2385
  {
2368
- data: K,
2369
- config: t.viewModal || {}
2386
+ data: _,
2387
+ config: r.viewModal || {}
2370
2388
  }
2371
2389
  )
2372
2390
  }
@@ -2374,145 +2392,145 @@ const $e = ({ config: h }) => {
2374
2392
  ] })
2375
2393
  }
2376
2394
  );
2377
- }, Le = a.shape({
2378
- value: a.oneOfType([
2379
- a.string,
2380
- a.number,
2381
- a.bool
2395
+ }, De = t.shape({
2396
+ value: t.oneOfType([
2397
+ t.string,
2398
+ t.number,
2399
+ t.bool
2382
2400
  ]).isRequired,
2383
- label: a.string.isRequired,
2384
- color: a.string
2385
- }), Ne = a.shape({
2386
- type: a.string.isRequired,
2387
- label: a.string.isRequired,
2388
- color: a.string,
2389
- variant: a.string,
2390
- onClick: a.func
2391
- }), ha = a.shape({
2392
- title: a.string.isRequired,
2393
- type: a.string.isRequired,
2394
- variant: a.string,
2395
- icon: a.node
2396
- }), ua = a.shape({
2397
- key: a.string.isRequired,
2398
- title: a.string,
2399
- type: a.string,
2400
- imageKey: a.string,
2401
- titleKey: a.string,
2402
- subtitleKey: a.string,
2403
- onClickDetails: a.bool,
2404
- variant: a.string,
2405
- chipOptions: a.arrayOf(Le),
2406
- defaultColor: a.string,
2407
- className: a.string,
2408
- format: a.string,
2409
- menuList: a.arrayOf(ha)
2410
- }), Se = a.shape({
2411
- key: a.string.isRequired,
2412
- label: a.string,
2413
- type: a.string.isRequired,
2414
- required: a.bool,
2415
- minLength: a.number,
2416
- parentClass: a.string,
2417
- search: a.bool,
2418
- multiple: a.bool,
2419
- dropdownMaxHeight: a.string,
2420
- dragDrop: a.bool,
2421
- countriesList: a.bool,
2422
- defaultCountry: a.string,
2423
- placeholder: a.string,
2424
- rows: a.number,
2425
- text: a.string,
2426
- editorKey: a.string,
2427
- options: a.arrayOf(Le)
2428
- }), ba = a.shape({
2429
- key: a.string,
2430
- label: a.string,
2431
- type: a.string,
2432
- imageKey: a.string,
2433
- titleKey: a.string,
2434
- subtitleKey: a.string,
2435
- blockClass: a.string,
2436
- icon: a.node,
2437
- variant: a.string,
2438
- chipOptions: a.arrayOf(Le),
2439
- defaultColor: a.string,
2440
- className: a.string,
2441
- format: a.string
2401
+ label: t.string.isRequired,
2402
+ color: t.string
2403
+ }), Me = t.shape({
2404
+ type: t.string.isRequired,
2405
+ label: t.string.isRequired,
2406
+ color: t.string,
2407
+ variant: t.string,
2408
+ onClick: t.func
2409
+ }), pa = t.shape({
2410
+ title: t.string.isRequired,
2411
+ type: t.string.isRequired,
2412
+ variant: t.string,
2413
+ icon: t.node
2414
+ }), ga = t.shape({
2415
+ key: t.string.isRequired,
2416
+ title: t.string,
2417
+ type: t.string,
2418
+ imageKey: t.string,
2419
+ titleKey: t.string,
2420
+ subtitleKey: t.string,
2421
+ onClickDetails: t.bool,
2422
+ variant: t.string,
2423
+ chipOptions: t.arrayOf(De),
2424
+ defaultColor: t.string,
2425
+ className: t.string,
2426
+ format: t.string,
2427
+ menuList: t.arrayOf(pa)
2428
+ }), Ce = t.shape({
2429
+ key: t.string.isRequired,
2430
+ label: t.string,
2431
+ type: t.string.isRequired,
2432
+ required: t.bool,
2433
+ minLength: t.number,
2434
+ parentClass: t.string,
2435
+ search: t.bool,
2436
+ multiple: t.bool,
2437
+ dropdownMaxHeight: t.string,
2438
+ dragDrop: t.bool,
2439
+ countriesList: t.bool,
2440
+ defaultCountry: t.string,
2441
+ placeholder: t.string,
2442
+ rows: t.number,
2443
+ text: t.string,
2444
+ editorKey: t.string,
2445
+ options: t.arrayOf(De)
2446
+ }), ma = t.shape({
2447
+ key: t.string,
2448
+ label: t.string,
2449
+ type: t.string,
2450
+ imageKey: t.string,
2451
+ titleKey: t.string,
2452
+ subtitleKey: t.string,
2453
+ blockClass: t.string,
2454
+ icon: t.node,
2455
+ variant: t.string,
2456
+ chipOptions: t.arrayOf(De),
2457
+ defaultColor: t.string,
2458
+ className: t.string,
2459
+ format: t.string
2442
2460
  });
2443
- $e.propTypes = {
2444
- config: a.shape({
2445
- title: a.string.isRequired,
2446
- description: a.string,
2447
- buttonText: a.string,
2448
- fetchData: a.func.isRequired,
2449
- isStaticData: a.bool,
2461
+ Ke.propTypes = {
2462
+ config: t.shape({
2463
+ title: t.string.isRequired,
2464
+ description: t.string,
2465
+ buttonText: t.string,
2466
+ fetchData: t.func.isRequired,
2467
+ isStaticData: t.bool,
2450
2468
  /* ================= TABLE CONFIG ================= */
2451
- tableConfig: a.shape({
2452
- table_head: a.arrayOf(ua).isRequired,
2453
- search: a.shape({
2454
- enabled: a.bool,
2455
- useServerSideSearch: a.bool,
2456
- searchKeys: a.arrayOf(a.string)
2469
+ tableConfig: t.shape({
2470
+ table_head: t.arrayOf(ga).isRequired,
2471
+ search: t.shape({
2472
+ enabled: t.bool,
2473
+ useServerSideSearch: t.bool,
2474
+ searchKeys: t.arrayOf(t.string)
2457
2475
  }),
2458
- pagination: a.shape({
2459
- enabled: a.bool,
2460
- useServerSidePagination: a.bool
2476
+ pagination: t.shape({
2477
+ enabled: t.bool,
2478
+ useServerSidePagination: t.bool
2461
2479
  }),
2462
- filter: a.shape({
2463
- enabled: a.bool,
2464
- useServerSideFilters: a.bool
2480
+ filter: t.shape({
2481
+ enabled: t.bool,
2482
+ useServerSideFilters: t.bool
2465
2483
  })
2466
2484
  }).isRequired,
2467
2485
  /* ================= MODAL CONFIG ================= */
2468
- modalConfig: a.shape({
2469
- addModal: a.shape({
2470
- title: a.string.isRequired,
2471
- size: a.string,
2472
- formClass: a.string,
2473
- formFields: a.arrayOf(Se),
2474
- handleSubmit: a.func.isRequired,
2475
- actionButtons: a.arrayOf(Ne)
2486
+ modalConfig: t.shape({
2487
+ addModal: t.shape({
2488
+ title: t.string.isRequired,
2489
+ size: t.string,
2490
+ formClass: t.string,
2491
+ formFields: t.arrayOf(Ce),
2492
+ handleSubmit: t.func.isRequired,
2493
+ actionButtons: t.arrayOf(Me)
2476
2494
  }),
2477
- editModal: a.shape({
2478
- title: a.string.isRequired,
2479
- size: a.string,
2480
- formClass: a.string,
2481
- formFields: a.arrayOf(Se),
2482
- handleSubmit: a.func.isRequired,
2483
- actionButtons: a.arrayOf(Ne)
2495
+ editModal: t.shape({
2496
+ title: t.string.isRequired,
2497
+ size: t.string,
2498
+ formClass: t.string,
2499
+ formFields: t.arrayOf(Ce),
2500
+ handleSubmit: t.func.isRequired,
2501
+ actionButtons: t.arrayOf(Me)
2484
2502
  }),
2485
- deleteModal: a.shape({
2486
- title: a.string.isRequired,
2487
- size: a.string,
2488
- confirmText: a.string,
2489
- referenceKey: a.string,
2490
- actionButtons: a.arrayOf(Ne)
2503
+ deleteModal: t.shape({
2504
+ title: t.string.isRequired,
2505
+ size: t.string,
2506
+ confirmText: t.string,
2507
+ referenceKey: t.string,
2508
+ actionButtons: t.arrayOf(Me)
2491
2509
  }),
2492
- viewModal: a.shape({
2493
- title: a.string.isRequired,
2494
- size: a.string,
2510
+ viewModal: t.shape({
2511
+ title: t.string.isRequired,
2512
+ size: t.string,
2495
2513
  // 👇 This covers your commented code:
2496
- component: a.elementType,
2514
+ component: t.elementType,
2497
2515
  // for custom component like TeamMemberDetail
2498
- fields: a.arrayOf(ba),
2499
- footer: a.shape({
2500
- cancelButton: a.bool,
2501
- cancelText: a.string
2516
+ fields: t.arrayOf(ma),
2517
+ footer: t.shape({
2518
+ cancelButton: t.bool,
2519
+ cancelText: t.string
2502
2520
  })
2503
2521
  })
2504
2522
  }),
2505
2523
  /* ================= FILTER CONFIG ================= */
2506
- filterConfig: a.shape({
2507
- fields: a.arrayOf(Se)
2524
+ filterConfig: t.shape({
2525
+ fields: t.arrayOf(Ce)
2508
2526
  })
2509
2527
  }).isRequired
2510
2528
  };
2511
- const pa = () => {
2529
+ const fa = () => {
2512
2530
  if (typeof document > "u" || document.getElementById("react-admin-crud-manager-styles")) return;
2513
- const h = document.createElement("style");
2514
- h.id = "react-admin-crud-manager-styles";
2515
- const n = `
2531
+ const b = document.createElement("style");
2532
+ b.id = "react-admin-crud-manager-styles";
2533
+ const o = `
2516
2534
  .no-spinner::-webkit-outer-spin-button,
2517
2535
  .no-spinner::-webkit-inner-spin-button {
2518
2536
  -webkit-appearance: none;
@@ -2528,14 +2546,14 @@ const pa = () => {
2528
2546
  box-shadow: none !important;
2529
2547
  }
2530
2548
  `;
2531
- h.textContent = n, document.head.appendChild(h);
2549
+ b.textContent = o, document.head.appendChild(b);
2532
2550
  };
2533
- function Ma(h) {
2534
- return H(() => {
2535
- pa();
2536
- }, []), /* @__PURE__ */ e(E, { children: /* @__PURE__ */ e($e, { config: h.config }) });
2551
+ function La(b) {
2552
+ return K(() => {
2553
+ fa();
2554
+ }, []), /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e(Ke, { config: b.config }) });
2537
2555
  }
2538
2556
  export {
2539
- Ma as default
2557
+ La as default
2540
2558
  };
2541
2559
  //# sourceMappingURL=index.es.js.map