react-admin-crud-manager 1.0.10 → 1.0.11

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