proctoring-ui-3 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ui-3.es.js +738 -739
- package/dist/ui-3.umd.js +94 -94
- package/package.json +1 -1
package/dist/ui-3.es.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import ve, { useState as
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { useNavigate as Te, useLocation as xe, Link as ne } from "react-router-dom";
|
|
1
|
+
import ve, { useState as z, useRef as K, useEffect as J } from "react";
|
|
2
|
+
import { Heart as je, Home as Ne, Calendar as ye, Users as Ee, Settings as Ce, User as pe, ChevronDown as ae, LogOut as fe, X, AlertCircle as he, Upload as Se, File as $e, Trash2 as Le, Search as le, Save as Re, Edit as oe, Sparkles as Me, Check as re, ChevronRight as se, CheckCircle as _e, ChevronLeft as ie, AlertTriangle as ke } from "lucide-react";
|
|
3
|
+
import { useNavigate as ze, useLocation as xe, Link as ne } from "react-router-dom";
|
|
5
4
|
import { createPortal as de } from "react-dom";
|
|
6
5
|
var ce = { exports: {} }, ee = {};
|
|
7
6
|
/**
|
|
@@ -14,23 +13,23 @@ var ce = { exports: {} }, ee = {};
|
|
|
14
13
|
* LICENSE file in the root directory of this source tree.
|
|
15
14
|
*/
|
|
16
15
|
var be;
|
|
17
|
-
function
|
|
16
|
+
function Te() {
|
|
18
17
|
if (be) return ee;
|
|
19
18
|
be = 1;
|
|
20
19
|
var t = Symbol.for("react.transitional.element"), r = Symbol.for("react.fragment");
|
|
21
|
-
function n(l,
|
|
22
|
-
var
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
for (var
|
|
26
|
-
|
|
27
|
-
} else
|
|
28
|
-
return
|
|
20
|
+
function n(l, c, h) {
|
|
21
|
+
var x = null;
|
|
22
|
+
if (h !== void 0 && (x = "" + h), c.key !== void 0 && (x = "" + c.key), "key" in c) {
|
|
23
|
+
h = {};
|
|
24
|
+
for (var m in c)
|
|
25
|
+
m !== "key" && (h[m] = c[m]);
|
|
26
|
+
} else h = c;
|
|
27
|
+
return c = h.ref, {
|
|
29
28
|
$$typeof: t,
|
|
30
29
|
type: l,
|
|
31
|
-
key:
|
|
32
|
-
ref:
|
|
33
|
-
props:
|
|
30
|
+
key: x,
|
|
31
|
+
ref: c !== void 0 ? c : null,
|
|
32
|
+
props: h
|
|
34
33
|
};
|
|
35
34
|
}
|
|
36
35
|
return ee.Fragment = r, ee.jsx = n, ee.jsxs = n, ee;
|
|
@@ -46,19 +45,19 @@ var te = {};
|
|
|
46
45
|
* LICENSE file in the root directory of this source tree.
|
|
47
46
|
*/
|
|
48
47
|
var ue;
|
|
49
|
-
function
|
|
48
|
+
function Oe() {
|
|
50
49
|
return ue || (ue = 1, process.env.NODE_ENV !== "production" && function() {
|
|
51
50
|
function t(s) {
|
|
52
51
|
if (s == null) return null;
|
|
53
52
|
if (typeof s == "function")
|
|
54
|
-
return s.$$typeof ===
|
|
53
|
+
return s.$$typeof === d ? null : s.displayName || s.name || null;
|
|
55
54
|
if (typeof s == "string") return s;
|
|
56
55
|
switch (s) {
|
|
57
|
-
case
|
|
56
|
+
case i:
|
|
58
57
|
return "Fragment";
|
|
59
|
-
case
|
|
58
|
+
case D:
|
|
60
59
|
return "Profiler";
|
|
61
|
-
case
|
|
60
|
+
case j:
|
|
62
61
|
return "StrictMode";
|
|
63
62
|
case Y:
|
|
64
63
|
return "Suspense";
|
|
@@ -75,14 +74,14 @@ function Ae() {
|
|
|
75
74
|
return "Portal";
|
|
76
75
|
case V:
|
|
77
76
|
return s.displayName || "Context";
|
|
78
|
-
case
|
|
77
|
+
case T:
|
|
79
78
|
return (s._context.displayName || "Context") + ".Consumer";
|
|
80
|
-
case
|
|
79
|
+
case I:
|
|
81
80
|
var a = s.render;
|
|
82
81
|
return s = s.displayName, s || (s = a.displayName || a.name || "", s = s !== "" ? "ForwardRef(" + s + ")" : "ForwardRef"), s;
|
|
83
82
|
case B:
|
|
84
83
|
return a = s.displayName || null, a !== null ? a : t(s.type) || "Memo";
|
|
85
|
-
case
|
|
84
|
+
case w:
|
|
86
85
|
a = s._payload, s = s._init;
|
|
87
86
|
try {
|
|
88
87
|
return t(s(a));
|
|
@@ -103,17 +102,17 @@ function Ae() {
|
|
|
103
102
|
}
|
|
104
103
|
if (a) {
|
|
105
104
|
a = console;
|
|
106
|
-
var o = a.error,
|
|
105
|
+
var o = a.error, f = typeof Symbol == "function" && Symbol.toStringTag && s[Symbol.toStringTag] || s.constructor.name || "Object";
|
|
107
106
|
return o.call(
|
|
108
107
|
a,
|
|
109
108
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
110
|
-
|
|
109
|
+
f
|
|
111
110
|
), r(s);
|
|
112
111
|
}
|
|
113
112
|
}
|
|
114
113
|
function l(s) {
|
|
115
|
-
if (s ===
|
|
116
|
-
if (typeof s == "object" && s !== null && s.$$typeof ===
|
|
114
|
+
if (s === i) return "<>";
|
|
115
|
+
if (typeof s == "object" && s !== null && s.$$typeof === w)
|
|
117
116
|
return "<...>";
|
|
118
117
|
try {
|
|
119
118
|
var a = t(s);
|
|
@@ -122,21 +121,21 @@ function Ae() {
|
|
|
122
121
|
return "<...>";
|
|
123
122
|
}
|
|
124
123
|
}
|
|
125
|
-
function
|
|
124
|
+
function c() {
|
|
126
125
|
var s = v.A;
|
|
127
126
|
return s === null ? null : s.getOwner();
|
|
128
127
|
}
|
|
129
|
-
function
|
|
128
|
+
function h() {
|
|
130
129
|
return Error("react-stack-top-frame");
|
|
131
130
|
}
|
|
132
|
-
function
|
|
133
|
-
if (
|
|
131
|
+
function x(s) {
|
|
132
|
+
if (C.call(s, "key")) {
|
|
134
133
|
var a = Object.getOwnPropertyDescriptor(s, "key").get;
|
|
135
134
|
if (a && a.isReactWarning) return !1;
|
|
136
135
|
}
|
|
137
136
|
return s.key !== void 0;
|
|
138
137
|
}
|
|
139
|
-
function
|
|
138
|
+
function m(s, a) {
|
|
140
139
|
function o() {
|
|
141
140
|
b || (b = !0, console.error(
|
|
142
141
|
"%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)",
|
|
@@ -148,23 +147,23 @@ function Ae() {
|
|
|
148
147
|
configurable: !0
|
|
149
148
|
});
|
|
150
149
|
}
|
|
151
|
-
function
|
|
150
|
+
function p() {
|
|
152
151
|
var s = t(this.type);
|
|
153
152
|
return $[s] || ($[s] = !0, console.error(
|
|
154
153
|
"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."
|
|
155
154
|
)), s = this.props.ref, s !== void 0 ? s : null;
|
|
156
155
|
}
|
|
157
|
-
function
|
|
158
|
-
var
|
|
156
|
+
function N(s, a, o, f, k, P) {
|
|
157
|
+
var L = o.ref;
|
|
159
158
|
return s = {
|
|
160
|
-
$$typeof:
|
|
159
|
+
$$typeof: M,
|
|
161
160
|
type: s,
|
|
162
161
|
key: a,
|
|
163
162
|
props: o,
|
|
164
|
-
_owner:
|
|
165
|
-
}, (
|
|
163
|
+
_owner: f
|
|
164
|
+
}, (L !== void 0 ? L : null) !== null ? Object.defineProperty(s, "ref", {
|
|
166
165
|
enumerable: !1,
|
|
167
|
-
get:
|
|
166
|
+
get: p
|
|
168
167
|
}) : Object.defineProperty(s, "ref", { enumerable: !1, value: null }), s._store = {}, Object.defineProperty(s._store, "validated", {
|
|
169
168
|
configurable: !1,
|
|
170
169
|
enumerable: !1,
|
|
@@ -179,132 +178,132 @@ function Ae() {
|
|
|
179
178
|
configurable: !1,
|
|
180
179
|
enumerable: !1,
|
|
181
180
|
writable: !0,
|
|
182
|
-
value:
|
|
181
|
+
value: k
|
|
183
182
|
}), Object.defineProperty(s, "_debugTask", {
|
|
184
183
|
configurable: !1,
|
|
185
184
|
enumerable: !1,
|
|
186
185
|
writable: !0,
|
|
187
|
-
value:
|
|
186
|
+
value: P
|
|
188
187
|
}), Object.freeze && (Object.freeze(s.props), Object.freeze(s)), s;
|
|
189
188
|
}
|
|
190
|
-
function
|
|
191
|
-
var
|
|
192
|
-
if (
|
|
193
|
-
if (
|
|
194
|
-
if (
|
|
195
|
-
for (
|
|
196
|
-
|
|
197
|
-
Object.freeze && Object.freeze(
|
|
189
|
+
function S(s, a, o, f, k, P) {
|
|
190
|
+
var L = a.children;
|
|
191
|
+
if (L !== void 0)
|
|
192
|
+
if (f)
|
|
193
|
+
if (A(L)) {
|
|
194
|
+
for (f = 0; f < L.length; f++)
|
|
195
|
+
R(L[f]);
|
|
196
|
+
Object.freeze && Object.freeze(L);
|
|
198
197
|
} else
|
|
199
198
|
console.error(
|
|
200
199
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
201
200
|
);
|
|
202
|
-
else
|
|
203
|
-
if (
|
|
204
|
-
|
|
201
|
+
else R(L);
|
|
202
|
+
if (C.call(a, "key")) {
|
|
203
|
+
L = t(s);
|
|
205
204
|
var q = Object.keys(a).filter(function(Q) {
|
|
206
205
|
return Q !== "key";
|
|
207
206
|
});
|
|
208
|
-
|
|
207
|
+
f = 0 < q.length ? "{key: someKey, " + q.join(": ..., ") + ": ...}" : "{key: someKey}", G[L + f] || (q = 0 < q.length ? "{" + q.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
209
208
|
`A props object containing a "key" prop is being spread into JSX:
|
|
210
209
|
let props = %s;
|
|
211
210
|
<%s {...props} />
|
|
212
211
|
React keys must be passed directly to JSX without using spread:
|
|
213
212
|
let props = %s;
|
|
214
213
|
<%s key={someKey} {...props} />`,
|
|
215
|
-
|
|
216
|
-
|
|
214
|
+
f,
|
|
215
|
+
L,
|
|
217
216
|
q,
|
|
218
|
-
|
|
219
|
-
), G[
|
|
217
|
+
L
|
|
218
|
+
), G[L + f] = !0);
|
|
220
219
|
}
|
|
221
|
-
if (
|
|
220
|
+
if (L = null, o !== void 0 && (n(o), L = "" + o), x(a) && (n(a.key), L = "" + a.key), "key" in a) {
|
|
222
221
|
o = {};
|
|
223
222
|
for (var u in a)
|
|
224
223
|
u !== "key" && (o[u] = a[u]);
|
|
225
224
|
} else o = a;
|
|
226
|
-
return
|
|
225
|
+
return L && m(
|
|
227
226
|
o,
|
|
228
227
|
typeof s == "function" ? s.displayName || s.name || "Unknown" : s
|
|
229
|
-
),
|
|
228
|
+
), N(
|
|
230
229
|
s,
|
|
231
|
-
|
|
230
|
+
L,
|
|
232
231
|
o,
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
232
|
+
c(),
|
|
233
|
+
k,
|
|
234
|
+
P
|
|
236
235
|
);
|
|
237
236
|
}
|
|
238
|
-
function
|
|
239
|
-
|
|
237
|
+
function R(s) {
|
|
238
|
+
y(s) ? s._store && (s._store.validated = 1) : typeof s == "object" && s !== null && s.$$typeof === w && (s._payload.status === "fulfilled" ? y(s._payload.value) && s._payload.value._store && (s._payload.value._store.validated = 1) : s._store && (s._store.validated = 1));
|
|
240
239
|
}
|
|
241
|
-
function
|
|
242
|
-
return typeof s == "object" && s !== null && s.$$typeof ===
|
|
240
|
+
function y(s) {
|
|
241
|
+
return typeof s == "object" && s !== null && s.$$typeof === M;
|
|
243
242
|
}
|
|
244
|
-
var
|
|
243
|
+
var E = ve, M = Symbol.for("react.transitional.element"), g = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), j = Symbol.for("react.strict_mode"), D = Symbol.for("react.profiler"), T = Symbol.for("react.consumer"), V = Symbol.for("react.context"), I = Symbol.for("react.forward_ref"), Y = Symbol.for("react.suspense"), U = Symbol.for("react.suspense_list"), B = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), W = Symbol.for("react.activity"), d = Symbol.for("react.client.reference"), v = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, C = Object.prototype.hasOwnProperty, A = Array.isArray, O = console.createTask ? console.createTask : function() {
|
|
245
244
|
return null;
|
|
246
245
|
};
|
|
247
|
-
|
|
246
|
+
E = {
|
|
248
247
|
react_stack_bottom_frame: function(s) {
|
|
249
248
|
return s();
|
|
250
249
|
}
|
|
251
250
|
};
|
|
252
|
-
var b, $ = {}, F =
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
)(), H =
|
|
256
|
-
te.Fragment =
|
|
257
|
-
var
|
|
258
|
-
return
|
|
251
|
+
var b, $ = {}, F = E.react_stack_bottom_frame.bind(
|
|
252
|
+
E,
|
|
253
|
+
h
|
|
254
|
+
)(), H = O(l(h)), G = {};
|
|
255
|
+
te.Fragment = i, te.jsx = function(s, a, o) {
|
|
256
|
+
var f = 1e4 > v.recentlyCreatedOwnerStacks++;
|
|
257
|
+
return S(
|
|
259
258
|
s,
|
|
260
259
|
a,
|
|
261
260
|
o,
|
|
262
261
|
!1,
|
|
263
|
-
|
|
264
|
-
|
|
262
|
+
f ? Error("react-stack-top-frame") : F,
|
|
263
|
+
f ? O(l(s)) : H
|
|
265
264
|
);
|
|
266
265
|
}, te.jsxs = function(s, a, o) {
|
|
267
|
-
var
|
|
268
|
-
return
|
|
266
|
+
var f = 1e4 > v.recentlyCreatedOwnerStacks++;
|
|
267
|
+
return S(
|
|
269
268
|
s,
|
|
270
269
|
a,
|
|
271
270
|
o,
|
|
272
271
|
!0,
|
|
273
|
-
|
|
274
|
-
|
|
272
|
+
f ? Error("react-stack-top-frame") : F,
|
|
273
|
+
f ? O(l(s)) : H
|
|
275
274
|
);
|
|
276
275
|
};
|
|
277
276
|
}()), te;
|
|
278
277
|
}
|
|
279
|
-
process.env.NODE_ENV === "production" ? ce.exports =
|
|
278
|
+
process.env.NODE_ENV === "production" ? ce.exports = Te() : ce.exports = Oe();
|
|
280
279
|
var e = ce.exports;
|
|
281
|
-
function
|
|
282
|
-
const
|
|
280
|
+
function Be({ text: t, link: r, linkText: n, year: l, navigationItems: c = [] }) {
|
|
281
|
+
const h = ze(), x = xe(), m = [
|
|
283
282
|
{
|
|
284
|
-
icon:
|
|
283
|
+
icon: Ne,
|
|
285
284
|
label: "Dashboard",
|
|
286
285
|
path: "/dashboard",
|
|
287
286
|
key: "dashboard"
|
|
288
287
|
},
|
|
289
288
|
{
|
|
290
|
-
icon:
|
|
289
|
+
icon: ye,
|
|
291
290
|
label: "Calendar",
|
|
292
291
|
path: "/calendar",
|
|
293
292
|
key: "calendar"
|
|
294
293
|
},
|
|
295
294
|
{
|
|
296
|
-
icon:
|
|
295
|
+
icon: Ee,
|
|
297
296
|
label: "Admins",
|
|
298
297
|
path: "/admins",
|
|
299
298
|
key: "admins"
|
|
300
299
|
},
|
|
301
300
|
{
|
|
302
|
-
icon:
|
|
301
|
+
icon: Ce,
|
|
303
302
|
label: "Settings",
|
|
304
303
|
path: "/settings",
|
|
305
304
|
key: "settings"
|
|
306
305
|
}
|
|
307
|
-
],
|
|
306
|
+
], p = c.length > 0 ? c : m, N = (S) => x.pathname === S;
|
|
308
307
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
309
308
|
/* @__PURE__ */ e.jsxs("footer", { className: "hidden md:block relative overflow-hidden border-t transition-all duration-300 bg-gradient-to-r from-white via-violet-50/30 to-white border-slate-200/50 dark:bg-gradient-to-r dark:from-slate-800 dark:via-slate-900 dark:to-slate-800 dark:border-slate-700/50 shadow-sm", children: [
|
|
310
309
|
/* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 w-full h-full opacity-5 bg-gradient-to-r from-violet-300 to-indigo-300 dark:bg-gradient-to-r dark:from-violet-500 dark:to-indigo-500" }),
|
|
@@ -339,7 +338,7 @@ function Ye({ text: t, link: r, linkText: n, year: l, navigationItems: d = [] })
|
|
|
339
338
|
target: "_blank",
|
|
340
339
|
rel: "noopener noreferrer",
|
|
341
340
|
className: "text-sm font-medium transition-all duration-200 hover:scale-105 inline-block text-violet-600 hover:text-violet-700 dark:text-violet-400 dark:hover:text-violet-300",
|
|
342
|
-
children:
|
|
341
|
+
children: t || n || "Footer Text"
|
|
343
342
|
}
|
|
344
343
|
)
|
|
345
344
|
] }),
|
|
@@ -362,7 +361,7 @@ function Ye({ text: t, link: r, linkText: n, year: l, navigationItems: d = [] })
|
|
|
362
361
|
),
|
|
363
362
|
/* @__PURE__ */ e.jsxs("span", { className: "text-xs text-slate-500 dark:text-slate-500", children: [
|
|
364
363
|
"Made with ",
|
|
365
|
-
/* @__PURE__ */ e.jsx(
|
|
364
|
+
/* @__PURE__ */ e.jsx(je, { className: "w-3 h-3 inline text-red-500 fill-red-500" })
|
|
366
365
|
] })
|
|
367
366
|
] })
|
|
368
367
|
] }) })
|
|
@@ -370,30 +369,30 @@ function Ye({ text: t, link: r, linkText: n, year: l, navigationItems: d = [] })
|
|
|
370
369
|
/* @__PURE__ */ e.jsx("nav", { className: "md:hidden fixed bottom-0 left-0 right-0 z-50 safe-area-bottom", children: /* @__PURE__ */ e.jsxs("div", { className: "relative backdrop-blur-2xl bg-white/90 dark:bg-slate-900/95 border-t border-slate-200/50 dark:border-slate-700/50 shadow-2xl", children: [
|
|
371
370
|
/* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 bg-gradient-to-t from-violet-50/30 to-transparent dark:from-violet-950/20 dark:to-transparent pointer-events-none" }),
|
|
372
371
|
/* @__PURE__ */ e.jsx("div", { className: "absolute top-0 left-0 right-0 h-0.5 bg-gradient-to-r from-transparent via-violet-500 to-transparent opacity-50" }),
|
|
373
|
-
/* @__PURE__ */ e.jsx("div", { className: "relative grid grid-cols-4 gap-1 px-2 py-2 pb-safe", children:
|
|
374
|
-
const
|
|
372
|
+
/* @__PURE__ */ e.jsx("div", { className: "relative grid grid-cols-4 gap-1 px-2 py-2 pb-safe", children: p.map((S, R) => {
|
|
373
|
+
const y = S.icon, E = N(S.path);
|
|
375
374
|
return /* @__PURE__ */ e.jsxs(
|
|
376
375
|
"button",
|
|
377
376
|
{
|
|
378
|
-
onClick: () =>
|
|
379
|
-
className: `relative flex flex-col items-center justify-center py-2 px-1 rounded-2xl transition-all duration-300 group ${
|
|
377
|
+
onClick: () => h(S.path),
|
|
378
|
+
className: `relative flex flex-col items-center justify-center py-2 px-1 rounded-2xl transition-all duration-300 group ${E ? "bg-gradient-to-br from-violet-500 to-indigo-600 shadow-lg shadow-violet-500/30" : "hover:bg-slate-100 dark:hover:bg-slate-800/50 active:scale-95"}`,
|
|
380
379
|
children: [
|
|
381
|
-
|
|
382
|
-
/* @__PURE__ */ e.jsxs("div", { className: `relative mb-1 transition-transform duration-300 ${
|
|
380
|
+
E && /* @__PURE__ */ e.jsx("div", { className: "absolute -top-1 left-1/2 -translate-x-1/2 w-1 h-1 rounded-full bg-white shadow-lg shadow-white/50 animate-pulse" }),
|
|
381
|
+
/* @__PURE__ */ e.jsxs("div", { className: `relative mb-1 transition-transform duration-300 ${E ? "scale-110" : "group-hover:scale-110"}`, children: [
|
|
383
382
|
/* @__PURE__ */ e.jsx(
|
|
384
|
-
|
|
383
|
+
y,
|
|
385
384
|
{
|
|
386
|
-
className: `w-6 h-6 transition-colors duration-300 ${
|
|
387
|
-
strokeWidth:
|
|
385
|
+
className: `w-6 h-6 transition-colors duration-300 ${E ? "text-white" : "text-slate-600 dark:text-slate-400 group-hover:text-violet-600 dark:group-hover:text-violet-400"}`,
|
|
386
|
+
strokeWidth: E ? 2.5 : 2
|
|
388
387
|
}
|
|
389
388
|
),
|
|
390
|
-
|
|
389
|
+
E && /* @__PURE__ */ e.jsx("div", { className: "absolute inset-0 rounded-full bg-white/20 animate-ping" })
|
|
391
390
|
] }),
|
|
392
|
-
/* @__PURE__ */ e.jsx("span", { className: `text-xs font-semibold transition-all duration-300 ${
|
|
393
|
-
|
|
391
|
+
/* @__PURE__ */ e.jsx("span", { className: `text-xs font-semibold transition-all duration-300 ${E ? "text-white scale-105" : "text-slate-600 dark:text-slate-400 group-hover:text-violet-600 dark:group-hover:text-violet-400"}`, children: S.label }),
|
|
392
|
+
S.badge && /* @__PURE__ */ e.jsx("div", { className: "absolute top-1 right-2 w-2 h-2 rounded-full bg-red-500 border-2 border-white dark:border-slate-900 animate-pulse" })
|
|
394
393
|
]
|
|
395
394
|
},
|
|
396
|
-
|
|
395
|
+
S.key || R
|
|
397
396
|
);
|
|
398
397
|
}) }),
|
|
399
398
|
/* @__PURE__ */ e.jsx("div", { className: "h-safe-area-inset-bottom bg-white/50 dark:bg-slate-900/50" })
|
|
@@ -411,27 +410,27 @@ function Ye({ text: t, link: r, linkText: n, year: l, navigationItems: d = [] })
|
|
|
411
410
|
` })
|
|
412
411
|
] });
|
|
413
412
|
}
|
|
414
|
-
const
|
|
415
|
-
const [l,
|
|
413
|
+
const Ae = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
414
|
+
const [l, c] = z(!1), [h, x] = z({ top: 0, right: 0 }), m = K(null), p = K(null);
|
|
416
415
|
return J(() => {
|
|
417
|
-
const
|
|
418
|
-
|
|
416
|
+
const N = (S) => {
|
|
417
|
+
m.current && !m.current.contains(S.target) && p.current && !p.current.contains(S.target) && c(!1);
|
|
419
418
|
};
|
|
420
|
-
return l && document.addEventListener("mousedown",
|
|
419
|
+
return l && document.addEventListener("mousedown", N), () => document.removeEventListener("mousedown", N);
|
|
421
420
|
}, [l]), /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
422
421
|
/* @__PURE__ */ e.jsxs(
|
|
423
422
|
"button",
|
|
424
423
|
{
|
|
425
|
-
ref:
|
|
424
|
+
ref: m,
|
|
426
425
|
onClick: () => {
|
|
427
|
-
if (!l &&
|
|
428
|
-
const
|
|
429
|
-
|
|
430
|
-
top:
|
|
431
|
-
right: window.innerWidth -
|
|
426
|
+
if (!l && m.current) {
|
|
427
|
+
const N = m.current.getBoundingClientRect();
|
|
428
|
+
x({
|
|
429
|
+
top: N.bottom + 6,
|
|
430
|
+
right: window.innerWidth - N.right
|
|
432
431
|
});
|
|
433
432
|
}
|
|
434
|
-
|
|
433
|
+
c(!l);
|
|
435
434
|
},
|
|
436
435
|
title: "Account",
|
|
437
436
|
className: `p-2 sm:p-2.5 rounded-xl transition-all duration-200
|
|
@@ -441,7 +440,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
441
440
|
hover:scale-105 active:scale-95
|
|
442
441
|
flex items-center gap-1`,
|
|
443
442
|
children: [
|
|
444
|
-
/* @__PURE__ */ e.jsx(
|
|
443
|
+
/* @__PURE__ */ e.jsx(pe, { className: "w-[18px] h-[18px]" }),
|
|
445
444
|
/* @__PURE__ */ e.jsx(
|
|
446
445
|
ae,
|
|
447
446
|
{
|
|
@@ -455,8 +454,8 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
455
454
|
/* @__PURE__ */ e.jsxs(
|
|
456
455
|
"div",
|
|
457
456
|
{
|
|
458
|
-
ref:
|
|
459
|
-
style: { top:
|
|
457
|
+
ref: p,
|
|
458
|
+
style: { top: h.top, right: h.right },
|
|
460
459
|
className: `fixed w-48 rounded-xl border shadow-lg overflow-hidden z-[9999]
|
|
461
460
|
bg-white border-slate-200/60
|
|
462
461
|
dark:bg-slate-800 dark:border-slate-700/60
|
|
@@ -470,14 +469,14 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
470
469
|
"button",
|
|
471
470
|
{
|
|
472
471
|
onClick: () => {
|
|
473
|
-
|
|
472
|
+
c(!1), r();
|
|
474
473
|
},
|
|
475
474
|
className: `w-full flex items-center gap-2 px-3.5 py-2.5
|
|
476
475
|
text-sm font-medium text-red-600 dark:text-red-400
|
|
477
476
|
hover:bg-red-50 dark:hover:bg-red-900/20
|
|
478
477
|
transition-colors duration-150`,
|
|
479
478
|
children: [
|
|
480
|
-
/* @__PURE__ */ e.jsx(
|
|
479
|
+
/* @__PURE__ */ e.jsx(fe, { className: "w-4 h-4 flex-shrink-0" }),
|
|
481
480
|
"Logout"
|
|
482
481
|
]
|
|
483
482
|
}
|
|
@@ -488,33 +487,33 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
488
487
|
document.body
|
|
489
488
|
)
|
|
490
489
|
] });
|
|
491
|
-
},
|
|
490
|
+
}, He = ({
|
|
492
491
|
appIcon: t,
|
|
493
492
|
appName: r,
|
|
494
493
|
appShortName: n,
|
|
495
494
|
appTagline: l,
|
|
496
|
-
userName:
|
|
495
|
+
userName: c,
|
|
497
496
|
// <-- Taken from props!
|
|
498
|
-
userEmail:
|
|
497
|
+
userEmail: h,
|
|
499
498
|
// <-- Taken from props!
|
|
500
|
-
userRole:
|
|
501
|
-
onLogout:
|
|
499
|
+
userRole: x,
|
|
500
|
+
onLogout: m,
|
|
502
501
|
// <-- Added onLogout prop!
|
|
503
|
-
navLinks:
|
|
504
|
-
showAccessibility:
|
|
505
|
-
showUserInfo:
|
|
506
|
-
showLanguageSelector:
|
|
507
|
-
showThemeToggle:
|
|
508
|
-
showAppIcon:
|
|
509
|
-
showAppFullName:
|
|
502
|
+
navLinks: p = [],
|
|
503
|
+
showAccessibility: N = !0,
|
|
504
|
+
showUserInfo: S = !0,
|
|
505
|
+
showLanguageSelector: R = !0,
|
|
506
|
+
showThemeToggle: y = !0,
|
|
507
|
+
showAppIcon: E = !0,
|
|
508
|
+
showAppFullName: M = !0,
|
|
510
509
|
showAppTagline: g = !1,
|
|
511
|
-
showNavLinks:
|
|
512
|
-
rightContent:
|
|
510
|
+
showNavLinks: i = !1,
|
|
511
|
+
rightContent: j
|
|
513
512
|
}) => {
|
|
514
513
|
var q;
|
|
515
|
-
const
|
|
514
|
+
const D = xe(), [T, V] = z(
|
|
516
515
|
localStorage.getItem("language") || "eng"
|
|
517
|
-
), [
|
|
516
|
+
), [I, Y] = z(!1), [U, B] = z(!1), [w, W] = z(16), [d, v] = z(!1), [C, A] = z(!1), [O, b] = z(!1), [$, F] = z(!1), [H, G] = z(!1);
|
|
518
517
|
J(() => {
|
|
519
518
|
const u = localStorage.getItem("theme") || "light";
|
|
520
519
|
b(u === "dark"), document.documentElement.classList.toggle("dark", u === "dark");
|
|
@@ -523,7 +522,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
523
522
|
return window.addEventListener("scroll", u, { passive: !0 }), () => window.removeEventListener("scroll", u);
|
|
524
523
|
}, []), J(() => {
|
|
525
524
|
F(!1);
|
|
526
|
-
}, [
|
|
525
|
+
}, [D.pathname]);
|
|
527
526
|
const s = () => {
|
|
528
527
|
b((u) => {
|
|
529
528
|
const Q = !u;
|
|
@@ -533,16 +532,16 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
533
532
|
V(u), localStorage.setItem("language", u), B(!1);
|
|
534
533
|
};
|
|
535
534
|
J(() => {
|
|
536
|
-
document.documentElement.style.fontSize = `${
|
|
537
|
-
}, [
|
|
535
|
+
document.documentElement.style.fontSize = `${w}px`, document.body.style.filter = d ? "grayscale(100%)" : "none", document.body.style.fontFamily = C ? "OpenDyslexic, Arial, sans-serif" : "inherit";
|
|
536
|
+
}, [w, d, C]);
|
|
538
537
|
const o = {
|
|
539
538
|
eng: { label: "English", disabled: !1 },
|
|
540
539
|
hin: { label: "Hindi", disabled: !1 }
|
|
541
|
-
},
|
|
542
|
-
|
|
543
|
-
},
|
|
544
|
-
|
|
545
|
-
},
|
|
540
|
+
}, f = () => {
|
|
541
|
+
w < 24 && W(w + 2);
|
|
542
|
+
}, k = () => {
|
|
543
|
+
w > 12 && W(w - 2);
|
|
544
|
+
}, P = () => W(16), L = (u) => u === "/" ? D.pathname === "/" : D.pathname.startsWith(u);
|
|
546
545
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
547
546
|
/* @__PURE__ */ e.jsxs(
|
|
548
547
|
"nav",
|
|
@@ -560,7 +559,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
560
559
|
/* @__PURE__ */ e.jsxs("div", { className: "relative z-10 mx-auto px-3 sm:px-5 lg:px-6 py-2 sm:py-0", children: [
|
|
561
560
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between h-14 sm:h-20", children: [
|
|
562
561
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2 sm:gap-4 group flex-shrink-0", children: [
|
|
563
|
-
|
|
562
|
+
E && t && /* @__PURE__ */ e.jsx("div", { className: "w-8 h-8 sm:w-16 sm:h-16 flex items-center justify-center group-hover:scale-105 transition-transform duration-200", children: /* @__PURE__ */ e.jsx(
|
|
564
563
|
"img",
|
|
565
564
|
{
|
|
566
565
|
src: t,
|
|
@@ -572,12 +571,12 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
572
571
|
/* @__PURE__ */ e.jsx("span", { className: "font-extrabold text-base sm:text-xl text-slate-900 dark:text-white sm:hidden tracking-tight", children: n || r }),
|
|
573
572
|
/* @__PURE__ */ e.jsxs("div", { className: "hidden sm:flex flex-col", children: [
|
|
574
573
|
/* @__PURE__ */ e.jsx("span", { className: "font-extrabold text-slate-900 dark:text-white tracking-tight text-lg lg:hidden", children: n || r }),
|
|
575
|
-
|
|
574
|
+
M && /* @__PURE__ */ e.jsx("span", { className: "font-extrabold text-slate-900 dark:text-white tracking-tight hidden lg:block text-[17px] xl:text-lg leading-tight max-w-md", children: r }),
|
|
576
575
|
g && l && /* @__PURE__ */ e.jsx("span", { className: "mt-0.5 text-[10px] font-semibold tracking-[0.2em] text-violet-600 dark:text-violet-400 uppercase", children: l })
|
|
577
576
|
] })
|
|
578
577
|
] })
|
|
579
578
|
] }),
|
|
580
|
-
|
|
579
|
+
i && p.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "hidden md:flex items-center gap-2", children: p.map((u) => {
|
|
581
580
|
var Z;
|
|
582
581
|
return u != null && u.to ? ((Z = u == null ? void 0 : u.to) == null ? void 0 : Z.startsWith("http")) ? /* @__PURE__ */ e.jsx(
|
|
583
582
|
"a",
|
|
@@ -595,18 +594,18 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
595
594
|
to: u.to,
|
|
596
595
|
target: u.target || "_self",
|
|
597
596
|
rel: u.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
598
|
-
className: `relative px-4 lg:px-5 py-2.5 rounded-xl text-sm font-semibold tracking-wide transition-all duration-200 ${
|
|
597
|
+
className: `relative px-4 lg:px-5 py-2.5 rounded-xl text-sm font-semibold tracking-wide transition-all duration-200 ${L(u.to) ? "text-violet-700 dark:text-violet-400 bg-violet-50 dark:bg-violet-600/10 shadow-sm" : "text-slate-600 dark:text-slate-300 hover:text-violet-700 dark:hover:text-violet-400 hover:bg-violet-50/80 dark:hover:bg-slate-700/50"}`,
|
|
599
598
|
children: [
|
|
600
599
|
u.label,
|
|
601
|
-
|
|
600
|
+
L(u.to) && /* @__PURE__ */ e.jsx("span", { className: "absolute bottom-1 left-1/2 -translate-x-1/2 w-4 h-0.5 rounded-full bg-gradient-to-r from-violet-600 to-indigo-600" })
|
|
602
601
|
]
|
|
603
602
|
},
|
|
604
603
|
u.to
|
|
605
604
|
) : null;
|
|
606
605
|
}) }),
|
|
607
606
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1.5 sm:gap-2", children: [
|
|
608
|
-
|
|
609
|
-
|
|
607
|
+
j && /* @__PURE__ */ e.jsx("div", { className: "flex items-center", children: j }),
|
|
608
|
+
N && /* @__PURE__ */ e.jsx(
|
|
610
609
|
"button",
|
|
611
610
|
{
|
|
612
611
|
onClick: () => Y(!0),
|
|
@@ -615,28 +614,28 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
615
614
|
children: /* @__PURE__ */ e.jsx("svg", { className: "w-4 h-4 sm:w-[18px] sm:h-[18px]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4" }) })
|
|
616
615
|
}
|
|
617
616
|
),
|
|
618
|
-
|
|
617
|
+
y && /* @__PURE__ */ e.jsx(
|
|
619
618
|
"button",
|
|
620
619
|
{
|
|
621
620
|
onClick: s,
|
|
622
621
|
"aria-label": "Toggle theme",
|
|
623
|
-
title:
|
|
622
|
+
title: O ? "Switch to Light Mode" : "Switch to Dark Mode",
|
|
624
623
|
className: "p-2 sm:p-2.5 rounded-xl transition-all duration-200 bg-white hover:bg-slate-50 text-slate-700 border border-slate-200 shadow-sm dark:bg-slate-700/50 dark:hover:bg-slate-700 dark:text-yellow-400 dark:border-slate-600/50 hover:scale-105 active:scale-95",
|
|
625
|
-
children:
|
|
624
|
+
children: O ? /* @__PURE__ */ e.jsx("svg", { className: "w-4 h-4 sm:w-[18px] sm:h-[18px]", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", d: "M10 2a1 1 0 011 1v1a1 1 0 11-2 0V3a1 1 0 011-1zm4 8a4 4 0 11-8 0 4 4 0 018 0zm-.464 4.95l.707.707a1 1 0 001.414-1.414l-.707-.707a1 1 0 00-1.414 1.414zm2.12-10.607a1 1 0 010 1.414l-.706.707a1 1 0 11-1.414-1.414l.707-.707a1 1 0 011.414 0zM17 11a1 1 0 100-2h-1a1 1 0 100 2h1zm-7 4a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1zM5.05 6.464A1 1 0 106.465 5.05l-.708-.707a1 1 0 00-1.414 1.414l.707.707zm1.414 8.486l-.707.707a1 1 0 01-1.414-1.414l.707-.707a1 1 0 011.414 1.414zM4 11a1 1 0 100-2H3a1 1 0 000 2h1z", clipRule: "evenodd" }) }) : /* @__PURE__ */ e.jsx("svg", { className: "w-4 h-4 sm:w-[18px] sm:h-[18px]", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e.jsx("path", { d: "M17.293 13.293A8 8 0 016.707 2.707a8.001 8.001 0 1010.586 10.586z" }) })
|
|
626
625
|
}
|
|
627
626
|
),
|
|
628
|
-
|
|
627
|
+
R && /* @__PURE__ */ e.jsxs(
|
|
629
628
|
"button",
|
|
630
629
|
{
|
|
631
630
|
onClick: () => B(!0),
|
|
632
631
|
className: "hidden sm:flex items-center gap-2 px-4 py-2.5 rounded-xl bg-white hover:bg-slate-50 text-slate-700 border border-slate-200 shadow-sm dark:bg-slate-700/50 dark:hover:bg-slate-700 dark:text-slate-300 dark:border-slate-600/50 hover:scale-105 active:scale-95 transition-all duration-200",
|
|
633
632
|
children: [
|
|
634
633
|
/* @__PURE__ */ e.jsx("svg", { className: "w-[18px] h-[18px]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 2a10 10 0 100 20 10 10 0 000-20zm0 0c2.5 2.5 4 6 4 10s-1.5 7.5-4 10m0-20C9.5 4.5 8 8 8 12s1.5 7.5 4 10m-9-10h18" }) }),
|
|
635
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium", children: (q = o[
|
|
634
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium", children: (q = o[T]) == null ? void 0 : q.label })
|
|
636
635
|
]
|
|
637
636
|
}
|
|
638
637
|
),
|
|
639
|
-
|
|
638
|
+
R && /* @__PURE__ */ e.jsx(
|
|
640
639
|
"button",
|
|
641
640
|
{
|
|
642
641
|
onClick: () => B(!0),
|
|
@@ -644,15 +643,15 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
644
643
|
children: /* @__PURE__ */ e.jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M12 2a10 10 0 100 20 10 10 0 000-20zm0 0c2.5 2.5 4 6 4 10s-1.5 7.5-4 10m0-20C9.5 4.5 8 8 8 12s1.5 7.5 4 10m-9-10h18" }) })
|
|
645
644
|
}
|
|
646
645
|
),
|
|
647
|
-
|
|
648
|
-
|
|
646
|
+
S && /* @__PURE__ */ e.jsx(
|
|
647
|
+
Ae,
|
|
649
648
|
{
|
|
650
|
-
user: { name:
|
|
651
|
-
onLogout:
|
|
649
|
+
user: { name: c, email: h },
|
|
650
|
+
onLogout: m,
|
|
652
651
|
showEmail: !0
|
|
653
652
|
}
|
|
654
653
|
),
|
|
655
|
-
|
|
654
|
+
i && p.length > 0 && /* @__PURE__ */ e.jsx(
|
|
656
655
|
"button",
|
|
657
656
|
{
|
|
658
657
|
onClick: () => F((u) => !u),
|
|
@@ -663,7 +662,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
663
662
|
)
|
|
664
663
|
] })
|
|
665
664
|
] }),
|
|
666
|
-
|
|
665
|
+
i && $ && p.length > 0 && /* @__PURE__ */ e.jsx("div", { className: "md:hidden border-t border-slate-200 dark:border-slate-700 pb-3 animate-in slide-in-from-top-2 duration-200", children: /* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-0.5 pt-2", children: p.map((u) => {
|
|
667
666
|
var Z;
|
|
668
667
|
return u != null && u.to ? ((Z = u == null ? void 0 : u.to) == null ? void 0 : Z.startsWith("http")) ? /* @__PURE__ */ e.jsx(
|
|
669
668
|
"a",
|
|
@@ -681,10 +680,10 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
681
680
|
to: u.to,
|
|
682
681
|
target: u.target || "_self",
|
|
683
682
|
rel: u.target === "_blank" ? "noopener noreferrer" : void 0,
|
|
684
|
-
className: `flex items-center justify-between px-3 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200 ${
|
|
683
|
+
className: `flex items-center justify-between px-3 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200 ${L(u.to) ? "bg-violet-50 dark:bg-violet-600/10 text-violet-700 dark:text-violet-400" : "text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-700/50"}`,
|
|
685
684
|
children: [
|
|
686
685
|
u.label,
|
|
687
|
-
|
|
686
|
+
L(u.to) && /* @__PURE__ */ e.jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-gradient-to-r from-violet-600 to-indigo-600" })
|
|
688
687
|
]
|
|
689
688
|
},
|
|
690
689
|
u.to
|
|
@@ -694,7 +693,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
694
693
|
]
|
|
695
694
|
}
|
|
696
695
|
),
|
|
697
|
-
|
|
696
|
+
I && /* Accessibility Modal (unchanged) */
|
|
698
697
|
/* @__PURE__ */ e.jsx("div", { className: "overflow-hidden overflow-x-hidden fixed top-0 right-0 left-0 z-50 flex justify-center items-center w-full h-full bg-gray-800 bg-opacity-50", children: /* @__PURE__ */ e.jsx("div", { className: "relative p-4 w-full max-w-md", children: /* @__PURE__ */ e.jsxs("div", { className: "relative rounded-2xl shadow-2xl bg-white border border-slate-200 dark:bg-gradient-to-br dark:from-slate-800 dark:to-slate-900 dark:border dark:border-slate-700", children: [
|
|
699
698
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between p-5 border-b rounded-t-2xl border-slate-200 dark:border-slate-700 bg-gradient-to-r from-slate-50 to-violet-50/30 dark:bg-gradient-to-r dark:from-slate-800 dark:to-slate-900", children: [
|
|
700
699
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-3", children: [
|
|
@@ -708,25 +707,25 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
708
707
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
709
708
|
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-semibold text-slate-700 dark:text-slate-300", children: "Font Size" }),
|
|
710
709
|
/* @__PURE__ */ e.jsxs("span", { className: "text-sm font-medium px-3 py-1 rounded-lg bg-violet-100 text-violet-700 border border-violet-200 dark:bg-violet-600/20 dark:text-violet-400 dark:border dark:border-violet-500/30", children: [
|
|
711
|
-
|
|
710
|
+
w,
|
|
712
711
|
"px"
|
|
713
712
|
] })
|
|
714
713
|
] }),
|
|
715
714
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2", children: [
|
|
716
|
-
/* @__PURE__ */ e.jsx("button", { onClick:
|
|
717
|
-
/* @__PURE__ */ e.jsx("button", { onClick:
|
|
718
|
-
/* @__PURE__ */ e.jsx("button", { onClick:
|
|
715
|
+
/* @__PURE__ */ e.jsx("button", { onClick: k, className: "flex-1 py-3 px-4 rounded-xl font-semibold transition-all duration-200 bg-slate-100 hover:bg-slate-200 text-slate-700 border border-slate-200 dark:bg-slate-700 dark:hover:bg-slate-600 dark:text-slate-300 dark:border dark:border-slate-600", children: "A-" }),
|
|
716
|
+
/* @__PURE__ */ e.jsx("button", { onClick: P, className: "flex-1 py-3 px-4 rounded-xl font-semibold transition-all duration-200 bg-slate-100 hover:bg-slate-200 text-slate-700 border border-slate-200 dark:bg-slate-700 dark:hover:bg-slate-600 dark:text-slate-300 dark:border dark:border-slate-600", children: "A" }),
|
|
717
|
+
/* @__PURE__ */ e.jsx("button", { onClick: f, className: "flex-1 py-3 px-4 rounded-xl font-semibold transition-all duration-200 bg-slate-100 hover:bg-slate-200 text-slate-700 border border-slate-200 dark:bg-slate-700 dark:hover:bg-slate-600 dark:text-slate-300 dark:border dark:border-slate-600", children: "A+" })
|
|
719
718
|
] })
|
|
720
719
|
] }),
|
|
721
720
|
/* @__PURE__ */ e.jsx("div", { className: "border-t border-slate-200 dark:border-slate-700" }),
|
|
722
721
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
723
722
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm font-semibold text-slate-700 dark:text-slate-300", children: "Grayscale Mode" }),
|
|
724
|
-
/* @__PURE__ */ e.jsx("button", { onClick: () => v(!
|
|
723
|
+
/* @__PURE__ */ e.jsx("button", { onClick: () => v(!d), className: `relative inline-flex h-7 w-12 items-center rounded-full transition-colors ${d ? "bg-gradient-to-r from-violet-600 to-indigo-600" : "bg-slate-300 dark:bg-slate-700"}`, children: /* @__PURE__ */ e.jsx("span", { className: `inline-block h-5 w-5 transform rounded-full bg-white shadow-lg transition-transform ${d ? "translate-x-6" : "translate-x-1"}` }) })
|
|
725
724
|
] }),
|
|
726
725
|
/* @__PURE__ */ e.jsx("div", { className: "border-t border-slate-200 dark:border-slate-700" }),
|
|
727
726
|
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
728
727
|
/* @__PURE__ */ e.jsx("label", { className: "text-sm font-semibold text-slate-700 dark:text-slate-300", children: "Dyslexia-Friendly Font" }),
|
|
729
|
-
/* @__PURE__ */ e.jsx("button", { onClick: () =>
|
|
728
|
+
/* @__PURE__ */ e.jsx("button", { onClick: () => A(!C), className: `relative inline-flex h-7 w-12 items-center rounded-full transition-colors ${C ? "bg-gradient-to-r from-violet-600 to-indigo-600" : "bg-slate-300 dark:bg-slate-700"}`, children: /* @__PURE__ */ e.jsx("span", { className: `inline-block h-5 w-5 transform rounded-full bg-white shadow-lg transition-transform ${C ? "translate-x-6" : "translate-x-1"}` }) })
|
|
730
729
|
] })
|
|
731
730
|
] }),
|
|
732
731
|
/* @__PURE__ */ e.jsx("div", { className: "flex p-5 border-t rounded-b border-slate-200 dark:border-slate-700", children: /* @__PURE__ */ e.jsx("button", { onClick: () => Y(!1), className: "w-full py-3 px-5 text-sm font-semibold text-white bg-gradient-to-r from-violet-600 to-indigo-600 hover:from-violet-700 hover:to-indigo-700 rounded-xl shadow-lg transition-all duration-200", children: "Close" }) })
|
|
@@ -740,77 +739,77 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
740
739
|
] }),
|
|
741
740
|
/* @__PURE__ */ e.jsx("button", { onClick: () => B(!1), className: "p-2 rounded-lg transition-colors text-slate-400 hover:bg-slate-100 hover:text-slate-900 dark:hover:bg-slate-700 dark:hover:text-white", children: /* @__PURE__ */ e.jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) })
|
|
742
741
|
] }),
|
|
743
|
-
/* @__PURE__ */ e.jsx("div", { className: "p-5", children: /* @__PURE__ */ e.jsx("ul", { className: "space-y-3", children: Object.keys(o).map((u) => /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("button", { onClick: () => a(u), disabled: o[u].disabled, className: `w-full px-5 py-4 rounded-xl text-left font-semibold transition-all duration-200 ${u ===
|
|
742
|
+
/* @__PURE__ */ e.jsx("div", { className: "p-5", children: /* @__PURE__ */ e.jsx("ul", { className: "space-y-3", children: Object.keys(o).map((u) => /* @__PURE__ */ e.jsx("li", { children: /* @__PURE__ */ e.jsx("button", { onClick: () => a(u), disabled: o[u].disabled, className: `w-full px-5 py-4 rounded-xl text-left font-semibold transition-all duration-200 ${u === T ? "bg-gradient-to-r from-violet-600 to-indigo-600 text-white shadow-lg" : "bg-slate-50 hover:bg-slate-100 text-slate-700 border border-slate-200 dark:bg-slate-700/50 dark:hover:bg-slate-700 dark:text-slate-300 dark:border dark:border-slate-600"} ${o[u].disabled ? "opacity-50 cursor-not-allowed" : "hover:scale-[1.02]"}`, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
744
743
|
/* @__PURE__ */ e.jsx("span", { children: o[u].label }),
|
|
745
|
-
u ===
|
|
744
|
+
u === T && /* @__PURE__ */ e.jsx("svg", { className: "w-5 h-5", fill: "currentColor", viewBox: "0 0 20 20", children: /* @__PURE__ */ e.jsx("path", { fillRule: "evenodd", d: "M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z", clipRule: "evenodd" }) })
|
|
746
745
|
] }) }) }, u)) }) }),
|
|
747
746
|
/* @__PURE__ */ e.jsx("div", { className: "flex p-5 border-t rounded-b border-slate-200 dark:border-slate-700", children: /* @__PURE__ */ e.jsx("button", { onClick: () => B(!1), className: "w-full py-3 px-5 text-sm font-semibold text-white bg-gradient-to-r from-violet-600 to-indigo-600 hover:from-violet-700 hover:to-indigo-700 rounded-xl shadow-lg transition-all duration-200", children: "Close" }) })
|
|
748
747
|
] }) }) })
|
|
749
748
|
] });
|
|
750
749
|
}, ge = (t, r) => {
|
|
751
|
-
const n = {}, l = (
|
|
752
|
-
for (const
|
|
753
|
-
if (
|
|
754
|
-
const
|
|
755
|
-
(
|
|
750
|
+
const n = {}, l = (c) => {
|
|
751
|
+
for (const h of c)
|
|
752
|
+
if (h.subItems) {
|
|
753
|
+
const x = h.subItems.some(
|
|
754
|
+
(m) => m.path && r.startsWith(m.path)
|
|
756
755
|
);
|
|
757
|
-
l(
|
|
756
|
+
l(h.subItems), x && (n[h.name] = !0);
|
|
758
757
|
}
|
|
759
758
|
};
|
|
760
759
|
return l(t), n;
|
|
761
|
-
},
|
|
762
|
-
const
|
|
763
|
-
() => ge(t,
|
|
764
|
-
),
|
|
760
|
+
}, Ye = ({ menuItems: t, user: r, onLogout: n, onNavigate: l }) => {
|
|
761
|
+
const [c, h] = z(!1), x = K(null), m = xe(), [p, N] = z(
|
|
762
|
+
() => ge(t, m.pathname)
|
|
763
|
+
), S = (i) => N((j) => ({ ...j, [i]: !j[i] })), R = (i) => m.pathname === i;
|
|
765
764
|
J(() => {
|
|
766
|
-
|
|
767
|
-
...
|
|
768
|
-
...ge(t,
|
|
765
|
+
N((i) => ({
|
|
766
|
+
...i,
|
|
767
|
+
...ge(t, m.pathname)
|
|
769
768
|
}));
|
|
770
|
-
}, [
|
|
771
|
-
const
|
|
772
|
-
|
|
769
|
+
}, [m.pathname, t]), J(() => {
|
|
770
|
+
const i = (j) => {
|
|
771
|
+
x.current && !x.current.contains(j.target) && h(!1);
|
|
773
772
|
};
|
|
774
|
-
return
|
|
775
|
-
}, [
|
|
776
|
-
const
|
|
777
|
-
const
|
|
778
|
-
return
|
|
773
|
+
return c && document.addEventListener("mousedown", i), () => document.removeEventListener("mousedown", i);
|
|
774
|
+
}, [c]);
|
|
775
|
+
const y = "bg-violet-100 text-violet-700 dark:bg-violet-600/20 dark:text-violet-400", E = "bg-violet-600 dark:bg-violet-400", M = "bg-slate-300 group-hover:bg-violet-400 dark:bg-slate-600 dark:group-hover:bg-slate-500", g = ({ item: i, depth: j = 0 }) => {
|
|
776
|
+
const D = !!i.path, T = R(i.path);
|
|
777
|
+
return j === 0 ? /* @__PURE__ */ e.jsx("div", { children: D ? /* @__PURE__ */ e.jsx(ne, { to: i.path, onClick: () => l == null ? void 0 : l(), children: /* @__PURE__ */ e.jsxs("div", { className: `
|
|
779
778
|
flex items-center gap-2.5
|
|
780
779
|
px-3 py-2 rounded-xl cursor-pointer
|
|
781
780
|
transition-all duration-150 group
|
|
782
|
-
${
|
|
781
|
+
${T ? "bg-gradient-to-r from-violet-600 to-indigo-600 text-white shadow-sm shadow-violet-500/20" : "text-slate-600 hover:bg-slate-100/80 hover:text-slate-900 dark:text-slate-400 dark:hover:bg-slate-700/50 dark:hover:text-white"}
|
|
783
782
|
`, children: [
|
|
784
783
|
/* @__PURE__ */ e.jsx("div", { className: `
|
|
785
784
|
w-6 h-6 rounded-lg flex items-center justify-center flex-shrink-0
|
|
786
|
-
${
|
|
787
|
-
`, children: /* @__PURE__ */ e.jsx(
|
|
788
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium leading-none", children:
|
|
785
|
+
${T ? "bg-white/20" : "bg-slate-100 group-hover:bg-slate-200 dark:bg-slate-700/60 dark:group-hover:bg-slate-700"}
|
|
786
|
+
`, children: /* @__PURE__ */ e.jsx(i.icon, { className: `w-3.5 h-3.5 ${T ? "text-white" : "text-slate-500 dark:text-slate-400"}` }) }),
|
|
787
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-medium leading-none", children: i.name })
|
|
789
788
|
] }) }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
790
789
|
/* @__PURE__ */ e.jsxs(
|
|
791
790
|
"div",
|
|
792
791
|
{
|
|
793
|
-
onClick: () =>
|
|
792
|
+
onClick: () => S(i.name),
|
|
794
793
|
className: `
|
|
795
794
|
flex items-center justify-between
|
|
796
795
|
px-3 py-2 rounded-xl cursor-pointer
|
|
797
796
|
transition-all duration-150 group
|
|
798
|
-
${
|
|
797
|
+
${p[i.name] ? "bg-slate-100/80 text-slate-900 dark:bg-slate-700/40 dark:text-white" : "text-slate-600 hover:bg-slate-100/80 hover:text-slate-900 dark:text-slate-400 dark:hover:bg-slate-700/50 dark:hover:text-white"}
|
|
799
798
|
`,
|
|
800
799
|
children: [
|
|
801
800
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2.5", children: [
|
|
802
801
|
/* @__PURE__ */ e.jsx("div", { className: `
|
|
803
802
|
w-6 h-6 rounded-lg flex items-center justify-center flex-shrink-0
|
|
804
|
-
${
|
|
805
|
-
`, children: /* @__PURE__ */ e.jsx(
|
|
806
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-semibold leading-none", children:
|
|
803
|
+
${p[i.name] ? "bg-violet-100 dark:bg-violet-600/20" : "bg-slate-100 group-hover:bg-slate-200 dark:bg-slate-700/60 dark:group-hover:bg-slate-700"}
|
|
804
|
+
`, children: /* @__PURE__ */ e.jsx(i.icon, { className: `w-3.5 h-3.5 ${p[i.name] ? "text-violet-600 dark:text-violet-400" : "text-slate-500 dark:text-slate-400"}` }) }),
|
|
805
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-sm font-semibold leading-none", children: i.name })
|
|
807
806
|
] }),
|
|
808
807
|
/* @__PURE__ */ e.jsx(
|
|
809
808
|
"svg",
|
|
810
809
|
{
|
|
811
810
|
className: `w-3 h-3 flex-shrink-0 transition-transform duration-200
|
|
812
811
|
text-slate-400 dark:text-slate-500
|
|
813
|
-
${
|
|
812
|
+
${p[i.name] ? "rotate-90" : ""}`,
|
|
814
813
|
fill: "none",
|
|
815
814
|
stroke: "currentColor",
|
|
816
815
|
viewBox: "0 0 24 24",
|
|
@@ -820,39 +819,39 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
820
819
|
]
|
|
821
820
|
}
|
|
822
821
|
),
|
|
823
|
-
|
|
824
|
-
] }) }) : /* @__PURE__ */ e.jsx("div", { children:
|
|
822
|
+
i.subItems && p[i.name] && /* @__PURE__ */ e.jsx("div", { className: "mt-0.5 ml-3.5 pl-3 space-y-0.5 border-l border-slate-200/70 dark:border-slate-700/70", children: i.subItems.map((V) => /* @__PURE__ */ e.jsx(g, { item: V, depth: 1 }, V.name)) })
|
|
823
|
+
] }) }) : /* @__PURE__ */ e.jsx("div", { children: D ? /* @__PURE__ */ e.jsx(ne, { to: i.path, onClick: () => l == null ? void 0 : l(), children: /* @__PURE__ */ e.jsxs("div", { className: `
|
|
825
824
|
flex items-center gap-2
|
|
826
825
|
px-2.5 py-1.5 rounded-lg cursor-pointer
|
|
827
826
|
transition-all duration-150 group
|
|
828
|
-
${
|
|
827
|
+
${T ? y : "text-slate-500 hover:bg-slate-100/70 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-slate-700/30 dark:hover:text-slate-300"}
|
|
829
828
|
`, children: [
|
|
830
829
|
/* @__PURE__ */ e.jsx("div", { className: `w-1.5 h-1.5 rounded-full flex-shrink-0 transition-all duration-200
|
|
831
|
-
${
|
|
832
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-[13px] font-medium", children:
|
|
830
|
+
${T ? E : M}` }),
|
|
831
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-[13px] font-medium", children: i.name })
|
|
833
832
|
] }) }) : /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
834
833
|
/* @__PURE__ */ e.jsxs(
|
|
835
834
|
"div",
|
|
836
835
|
{
|
|
837
|
-
onClick: () =>
|
|
836
|
+
onClick: () => S(i.name),
|
|
838
837
|
className: `
|
|
839
838
|
flex items-center justify-between
|
|
840
839
|
px-2.5 py-1.5 rounded-lg cursor-pointer
|
|
841
840
|
transition-all duration-150 group
|
|
842
|
-
${
|
|
841
|
+
${p[i.name] ? "bg-slate-100/70 text-slate-700 dark:bg-slate-700/30 dark:text-slate-300" : "text-slate-500 hover:bg-slate-100/70 hover:text-slate-700 dark:text-slate-400 dark:hover:bg-slate-700/30 dark:hover:text-slate-300"}
|
|
843
842
|
`,
|
|
844
843
|
children: [
|
|
845
844
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
846
845
|
/* @__PURE__ */ e.jsx("div", { className: `w-1.5 h-1.5 rounded-full flex-shrink-0 transition-all duration-200
|
|
847
|
-
${
|
|
848
|
-
/* @__PURE__ */ e.jsx("span", { className: "text-[13px] font-medium", children:
|
|
846
|
+
${p[i.name] ? E : M}` }),
|
|
847
|
+
/* @__PURE__ */ e.jsx("span", { className: "text-[13px] font-medium", children: i.name })
|
|
849
848
|
] }),
|
|
850
849
|
/* @__PURE__ */ e.jsx(
|
|
851
850
|
"svg",
|
|
852
851
|
{
|
|
853
852
|
className: `w-3 h-3 flex-shrink-0 transition-transform duration-200
|
|
854
853
|
text-slate-400 dark:text-slate-500
|
|
855
|
-
${
|
|
854
|
+
${p[i.name] ? "rotate-90" : ""}`,
|
|
856
855
|
fill: "none",
|
|
857
856
|
stroke: "currentColor",
|
|
858
857
|
viewBox: "0 0 24 24",
|
|
@@ -862,7 +861,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
862
861
|
]
|
|
863
862
|
}
|
|
864
863
|
),
|
|
865
|
-
|
|
864
|
+
i.subItems && p[i.name] && /* @__PURE__ */ e.jsx("div", { className: "mt-0.5 ml-3 pl-2.5 space-y-0.5 border-l border-slate-200/70 dark:border-slate-700/70", children: i.subItems.map((V) => /* @__PURE__ */ e.jsx(g, { item: V, depth: j + 1 }, V.name)) })
|
|
866
865
|
] }) });
|
|
867
866
|
};
|
|
868
867
|
return /* @__PURE__ */ e.jsxs("div", { className: "h-full w-full flex pl-2.5 sm:pl-3.5 max-sm:pr-2.5 sm:max-sm:pr-3.5", children: [
|
|
@@ -898,16 +897,16 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
898
897
|
{
|
|
899
898
|
className: "flex-1 overflow-y-auto space-y-0.5 custom-scrollbar",
|
|
900
899
|
"aria-label": "Main navigation",
|
|
901
|
-
children: t.map((
|
|
900
|
+
children: t.map((i) => /* @__PURE__ */ e.jsx(g, { item: i, depth: 0 }, i.name))
|
|
902
901
|
}
|
|
903
902
|
),
|
|
904
903
|
r && /* @__PURE__ */ e.jsxs(
|
|
905
904
|
"div",
|
|
906
905
|
{
|
|
907
|
-
ref:
|
|
906
|
+
ref: x,
|
|
908
907
|
className: "flex-shrink-0 mt-2.5 sm:mt-3.5 pt-2.5 sm:pt-3.5 border-t border-slate-200/80 dark:border-slate-700/80",
|
|
909
908
|
children: [
|
|
910
|
-
|
|
909
|
+
c && n && /* @__PURE__ */ e.jsx("div", { className: `
|
|
911
910
|
mb-1.5 rounded-xl overflow-hidden
|
|
912
911
|
bg-white dark:bg-slate-800
|
|
913
912
|
border border-red-100 dark:border-red-500/20
|
|
@@ -917,7 +916,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
917
916
|
"button",
|
|
918
917
|
{
|
|
919
918
|
onClick: () => {
|
|
920
|
-
n(),
|
|
919
|
+
n(), h(!1);
|
|
921
920
|
},
|
|
922
921
|
className: `
|
|
923
922
|
w-full flex items-center gap-2.5 px-3 py-2.5
|
|
@@ -926,7 +925,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
926
925
|
transition-colors duration-150
|
|
927
926
|
`,
|
|
928
927
|
children: [
|
|
929
|
-
/* @__PURE__ */ e.jsx(
|
|
928
|
+
/* @__PURE__ */ e.jsx(fe, { className: "w-3.5 h-3.5 flex-shrink-0" }),
|
|
930
929
|
"Sign out"
|
|
931
930
|
]
|
|
932
931
|
}
|
|
@@ -934,19 +933,19 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
934
933
|
/* @__PURE__ */ e.jsxs(
|
|
935
934
|
"button",
|
|
936
935
|
{
|
|
937
|
-
onClick: () =>
|
|
936
|
+
onClick: () => h((i) => !i),
|
|
938
937
|
className: `
|
|
939
938
|
w-full flex items-center gap-2.5
|
|
940
939
|
px-2.5 py-2 rounded-xl border
|
|
941
940
|
transition-all duration-150
|
|
942
|
-
${
|
|
941
|
+
${c ? "bg-violet-50 border-violet-200/60 dark:bg-violet-900/20 dark:border-violet-700/40" : "bg-slate-50/60 border-slate-200/50 hover:bg-violet-50 hover:border-violet-200/60 dark:bg-slate-800/40 dark:border-slate-700/50 dark:hover:bg-violet-900/20 dark:hover:border-violet-700/40"}
|
|
943
942
|
`,
|
|
944
943
|
children: [
|
|
945
944
|
/* @__PURE__ */ e.jsx("div", { className: `
|
|
946
945
|
w-7 h-7 rounded-lg flex-shrink-0
|
|
947
946
|
bg-gradient-to-br from-violet-600 to-indigo-600
|
|
948
947
|
flex items-center justify-center shadow-sm shadow-violet-500/20
|
|
949
|
-
`, children: /* @__PURE__ */ e.jsx(
|
|
948
|
+
`, children: /* @__PURE__ */ e.jsx(pe, { className: "w-3.5 h-3.5 text-white" }) }),
|
|
950
949
|
/* @__PURE__ */ e.jsxs("div", { className: "flex-1 text-left min-w-0", children: [
|
|
951
950
|
/* @__PURE__ */ e.jsx("p", { className: "text-[13px] font-semibold text-slate-900 dark:text-white truncate leading-none", children: r.username }),
|
|
952
951
|
/* @__PURE__ */ e.jsx("p", { className: "text-[11px] text-slate-400 dark:text-slate-500 truncate mt-0.5 leading-none", children: r.email })
|
|
@@ -954,7 +953,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
954
953
|
/* @__PURE__ */ e.jsx(ae, { className: `
|
|
955
954
|
w-3 h-3 flex-shrink-0 text-slate-400 dark:text-slate-500
|
|
956
955
|
transition-transform duration-200
|
|
957
|
-
${
|
|
956
|
+
${c ? "rotate-180" : ""}
|
|
958
957
|
` })
|
|
959
958
|
]
|
|
960
959
|
}
|
|
@@ -971,15 +970,15 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
971
970
|
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: rgb(148 163 184); }
|
|
972
971
|
` })
|
|
973
972
|
] });
|
|
974
|
-
},
|
|
973
|
+
}, Ue = ({
|
|
975
974
|
icon: t,
|
|
976
975
|
title: r,
|
|
977
976
|
subtitle: n,
|
|
978
977
|
badge: l,
|
|
979
|
-
actions:
|
|
980
|
-
searchBar:
|
|
981
|
-
onIconClick:
|
|
982
|
-
iconTitle:
|
|
978
|
+
actions: c,
|
|
979
|
+
searchBar: h,
|
|
980
|
+
onIconClick: x,
|
|
981
|
+
iconTitle: m
|
|
983
982
|
}) => /* @__PURE__ */ e.jsxs(
|
|
984
983
|
"div",
|
|
985
984
|
{
|
|
@@ -1010,14 +1009,14 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1010
1009
|
flex items-center justify-center
|
|
1011
1010
|
shadow-md shadow-violet-200/40 dark:shadow-violet-900/30
|
|
1012
1011
|
transition-all duration-200
|
|
1013
|
-
${
|
|
1012
|
+
${x ? "cursor-pointer hover:scale-110 hover:shadow-lg active:scale-95" : "hover:scale-105"}
|
|
1014
1013
|
`,
|
|
1015
|
-
onClick:
|
|
1016
|
-
title:
|
|
1017
|
-
role:
|
|
1018
|
-
tabIndex:
|
|
1019
|
-
onKeyDown:
|
|
1020
|
-
(
|
|
1014
|
+
onClick: x,
|
|
1015
|
+
title: m,
|
|
1016
|
+
role: x ? "button" : void 0,
|
|
1017
|
+
tabIndex: x ? 0 : void 0,
|
|
1018
|
+
onKeyDown: x ? (p) => {
|
|
1019
|
+
(p.key === "Enter" || p.key === " ") && (p.preventDefault(), x());
|
|
1021
1020
|
} : void 0,
|
|
1022
1021
|
children: /* @__PURE__ */ e.jsx(t, { className: "w-[18px] h-[18px] sm:w-5 sm:h-5 text-white" })
|
|
1023
1022
|
}
|
|
@@ -1036,7 +1035,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1036
1035
|
] }),
|
|
1037
1036
|
n && /* @__PURE__ */ e.jsx("p", { className: "mt-0.5 text-xs text-slate-500 dark:text-slate-400 leading-snug truncate", children: n })
|
|
1038
1037
|
] }),
|
|
1039
|
-
|
|
1038
|
+
c && /* @__PURE__ */ e.jsx("div", { className: `
|
|
1040
1039
|
flex-shrink-0
|
|
1041
1040
|
flex items-center gap-1.5
|
|
1042
1041
|
overflow-x-auto sm:overflow-x-visible
|
|
@@ -1046,31 +1045,31 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1046
1045
|
sm:max-w-none
|
|
1047
1046
|
sm:flex-wrap
|
|
1048
1047
|
[&::-webkit-scrollbar]:hidden
|
|
1049
|
-
`, children:
|
|
1048
|
+
`, children: c })
|
|
1050
1049
|
] }),
|
|
1051
|
-
|
|
1050
|
+
h && /* @__PURE__ */ e.jsx("div", { className: "mt-3 pt-3 border-t border-slate-200/40 dark:border-slate-700/50", children: h })
|
|
1052
1051
|
] })
|
|
1053
1052
|
]
|
|
1054
1053
|
}
|
|
1055
|
-
),
|
|
1054
|
+
), qe = ({
|
|
1056
1055
|
icon: t,
|
|
1057
1056
|
onClick: r,
|
|
1058
1057
|
title: n,
|
|
1059
1058
|
variant: l = "secondary",
|
|
1060
|
-
size:
|
|
1059
|
+
size: c = "md"
|
|
1061
1060
|
// sm | md
|
|
1062
1061
|
}) => {
|
|
1063
|
-
const
|
|
1062
|
+
const h = {
|
|
1064
1063
|
secondary: `bg-white hover:bg-slate-50 text-slate-700 border border-slate-200 shadow-sm
|
|
1065
1064
|
dark:bg-slate-700/50 dark:hover:bg-slate-700 dark:text-slate-300 dark:border-slate-600/50`,
|
|
1066
1065
|
danger: `bg-white hover:bg-red-50 text-slate-500 hover:text-red-600 border border-slate-200 shadow-sm
|
|
1067
1066
|
dark:bg-slate-700/50 dark:hover:bg-red-900/20 dark:text-slate-400 dark:hover:text-red-400 dark:border-slate-600/50`,
|
|
1068
1067
|
primary: `bg-violet-100 hover:bg-violet-200 text-violet-700 border border-violet-200 shadow-sm
|
|
1069
1068
|
dark:bg-violet-600/20 dark:hover:bg-violet-600/30 dark:text-violet-400 dark:border-violet-500/30`
|
|
1070
|
-
},
|
|
1069
|
+
}, x = {
|
|
1071
1070
|
sm: "p-1.5",
|
|
1072
1071
|
md: "p-2 sm:p-2.5"
|
|
1073
|
-
},
|
|
1072
|
+
}, m = {
|
|
1074
1073
|
sm: "w-3.5 h-3.5",
|
|
1075
1074
|
md: "w-4 h-4 sm:w-[18px] sm:h-[18px]"
|
|
1076
1075
|
};
|
|
@@ -1082,62 +1081,62 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1082
1081
|
"aria-label": n,
|
|
1083
1082
|
className: `
|
|
1084
1083
|
rounded-xl transition-all duration-200
|
|
1085
|
-
${
|
|
1086
|
-
${
|
|
1084
|
+
${x[c]}
|
|
1085
|
+
${h[l] ?? h.secondary}
|
|
1087
1086
|
hover:scale-105 active:scale-95
|
|
1088
1087
|
`,
|
|
1089
|
-
children: /* @__PURE__ */ e.jsx(t, { className:
|
|
1088
|
+
children: /* @__PURE__ */ e.jsx(t, { className: m[c] })
|
|
1090
1089
|
}
|
|
1091
1090
|
);
|
|
1092
|
-
},
|
|
1091
|
+
}, Ge = ({
|
|
1093
1092
|
children: t,
|
|
1094
1093
|
icon: r,
|
|
1095
1094
|
iconPosition: n = "left",
|
|
1096
1095
|
disabled: l = !1,
|
|
1097
|
-
onClick:
|
|
1098
|
-
variant:
|
|
1099
|
-
loading:
|
|
1100
|
-
size:
|
|
1096
|
+
onClick: c,
|
|
1097
|
+
variant: h = "primary",
|
|
1098
|
+
loading: x = !1,
|
|
1099
|
+
size: m = "md",
|
|
1101
1100
|
// sm | md | lg
|
|
1102
|
-
className:
|
|
1103
|
-
...
|
|
1101
|
+
className: p = "",
|
|
1102
|
+
...N
|
|
1104
1103
|
}) => {
|
|
1105
|
-
const
|
|
1104
|
+
const S = {
|
|
1106
1105
|
sm: "px-3 py-1.5 text-xs rounded-lg gap-1.5",
|
|
1107
1106
|
md: "px-4 py-2 sm:px-5 sm:py-2.5 text-sm rounded-xl gap-2",
|
|
1108
1107
|
lg: "px-5 py-2.5 sm:px-6 sm:py-3 text-sm sm:text-base rounded-xl gap-2"
|
|
1109
|
-
},
|
|
1108
|
+
}, R = {
|
|
1110
1109
|
sm: "w-3.5 h-3.5",
|
|
1111
1110
|
md: "w-4 h-4",
|
|
1112
1111
|
lg: "w-4 h-4 sm:w-5 sm:h-5"
|
|
1113
|
-
},
|
|
1114
|
-
primary: l ||
|
|
1115
|
-
secondary: l ||
|
|
1116
|
-
danger: l ||
|
|
1112
|
+
}, y = {
|
|
1113
|
+
primary: l || x ? "bg-violet-300 text-white cursor-not-allowed opacity-60 dark:bg-violet-800/50" : "bg-gradient-to-r from-violet-600 to-indigo-600 text-white hover:from-violet-700 hover:to-indigo-700 shadow-md hover:shadow-lg hover:scale-105 active:scale-95",
|
|
1114
|
+
secondary: l || x ? "bg-gray-200 text-gray-400 cursor-not-allowed opacity-60 dark:bg-gray-700 dark:text-gray-500" : "bg-white text-slate-700 border border-slate-200 hover:bg-slate-50 dark:bg-slate-700/50 dark:text-slate-300 dark:border-slate-600 dark:hover:bg-slate-700 shadow-sm hover:shadow-md hover:scale-105 active:scale-95",
|
|
1115
|
+
danger: l || x ? "bg-red-300 text-white cursor-not-allowed opacity-60 dark:bg-red-800/50" : "bg-red-600 text-white hover:bg-red-700 shadow-md hover:shadow-lg hover:scale-105 active:scale-95"
|
|
1117
1116
|
};
|
|
1118
1117
|
return /* @__PURE__ */ e.jsxs(
|
|
1119
1118
|
"button",
|
|
1120
1119
|
{
|
|
1121
|
-
disabled: l ||
|
|
1122
|
-
onClick: l ||
|
|
1120
|
+
disabled: l || x,
|
|
1121
|
+
onClick: l || x ? void 0 : c,
|
|
1123
1122
|
className: `
|
|
1124
1123
|
inline-flex items-center justify-center font-semibold whitespace-nowrap
|
|
1125
1124
|
transition-all duration-200
|
|
1126
|
-
${
|
|
1127
|
-
${
|
|
1128
|
-
${
|
|
1125
|
+
${S[m]}
|
|
1126
|
+
${y[h]}
|
|
1127
|
+
${p}
|
|
1129
1128
|
`,
|
|
1130
|
-
...
|
|
1129
|
+
...N,
|
|
1131
1130
|
children: [
|
|
1132
|
-
r && n === "left" && !
|
|
1133
|
-
|
|
1131
|
+
r && n === "left" && !x && /* @__PURE__ */ e.jsx(r, { className: `${R[m]} flex-shrink-0` }),
|
|
1132
|
+
x && /* @__PURE__ */ e.jsx("span", { className: `${R[m]} flex-shrink-0 animate-spin rounded-full
|
|
1134
1133
|
border-2 border-white/30 border-t-white` }),
|
|
1135
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
1136
|
-
r && n === "right" && !
|
|
1134
|
+
/* @__PURE__ */ e.jsx("span", { children: x ? "Loading..." : t }),
|
|
1135
|
+
r && n === "right" && !x && /* @__PURE__ */ e.jsx(r, { className: `${R[m]} flex-shrink-0` })
|
|
1137
1136
|
]
|
|
1138
1137
|
}
|
|
1139
1138
|
);
|
|
1140
|
-
},
|
|
1139
|
+
}, Je = ({
|
|
1141
1140
|
value: t,
|
|
1142
1141
|
onChange: r,
|
|
1143
1142
|
placeholder: n = "Search...",
|
|
@@ -1179,59 +1178,59 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1179
1178
|
children: /* @__PURE__ */ e.jsx("svg", { className: "w-5 h-5", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
1180
1179
|
}
|
|
1181
1180
|
)
|
|
1182
|
-
] }),
|
|
1181
|
+
] }), Xe = ({
|
|
1183
1182
|
columns: t,
|
|
1184
1183
|
data: r,
|
|
1185
1184
|
onSort: n,
|
|
1186
1185
|
sortConfig: l,
|
|
1187
|
-
emptyMessage:
|
|
1188
|
-
emptyDescription:
|
|
1189
|
-
emptyIcon:
|
|
1186
|
+
emptyMessage: c = "No data found",
|
|
1187
|
+
emptyDescription: h = "Try adjusting your filters or add new data",
|
|
1188
|
+
emptyIcon: x
|
|
1190
1189
|
}) => r.length === 0 ? /* @__PURE__ */ e.jsx("div", { className: "h-full rounded-2xl border bg-white border-slate-200/50 dark:bg-slate-800/50 dark:border-slate-700/50 flex items-center justify-center", children: /* @__PURE__ */ e.jsxs("div", { className: "text-center py-12 px-6", children: [
|
|
1191
|
-
/* @__PURE__ */ e.jsx("div", { className: "w-16 h-16 rounded-full bg-slate-100 dark:bg-slate-700 flex items-center justify-center mx-auto mb-4", children:
|
|
1192
|
-
/* @__PURE__ */ e.jsx("h3", { className: "text-lg font-semibold text-slate-900 dark:text-slate-300 mb-2", children:
|
|
1193
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-slate-600 dark:text-slate-400", children:
|
|
1190
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-16 h-16 rounded-full bg-slate-100 dark:bg-slate-700 flex items-center justify-center mx-auto mb-4", children: x ? /* @__PURE__ */ e.jsx(x, { className: "w-8 h-8 text-slate-400 dark:text-slate-500" }) : /* @__PURE__ */ e.jsx("svg", { className: "w-8 h-8 text-slate-400 dark:text-slate-500", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ e.jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4" }) }) }),
|
|
1191
|
+
/* @__PURE__ */ e.jsx("h3", { className: "text-lg font-semibold text-slate-900 dark:text-slate-300 mb-2", children: c }),
|
|
1192
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-sm text-slate-600 dark:text-slate-400", children: h })
|
|
1194
1193
|
] }) }) : /* @__PURE__ */ e.jsx("div", { className: "h-full rounded-2xl border bg-white border-slate-200/50 dark:bg-slate-800/50 dark:border-slate-700/50 flex flex-col overflow-hidden", children: /* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-auto", children: /* @__PURE__ */ e.jsxs("table", { className: "w-full", children: [
|
|
1195
|
-
/* @__PURE__ */ e.jsx("thead", { className: "bg-slate-50 dark:bg-slate-800/50 sticky top-0 ", children: /* @__PURE__ */ e.jsx("tr", { children: t.map((
|
|
1194
|
+
/* @__PURE__ */ e.jsx("thead", { className: "bg-slate-50 dark:bg-slate-800/50 sticky top-0 ", children: /* @__PURE__ */ e.jsx("tr", { children: t.map((m) => /* @__PURE__ */ e.jsx(
|
|
1196
1195
|
"th",
|
|
1197
1196
|
{
|
|
1198
|
-
onClick: () =>
|
|
1197
|
+
onClick: () => m.sortable && n && n(m.key),
|
|
1199
1198
|
className: `
|
|
1200
1199
|
px-6 py-4 text-left text-xs font-semibold text-slate-700 dark:text-slate-300 uppercase tracking-wider
|
|
1201
|
-
${
|
|
1200
|
+
${m.sortable ? "cursor-pointer select-none hover:bg-slate-100 dark:hover:bg-slate-700/50" : ""}
|
|
1202
1201
|
`,
|
|
1203
1202
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2", children: [
|
|
1204
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
1205
|
-
|
|
1203
|
+
/* @__PURE__ */ e.jsx("span", { children: m.label }),
|
|
1204
|
+
m.sortable && (l == null ? void 0 : l.key) === m.key && /* @__PURE__ */ e.jsx("span", { className: "text-violet-600 dark:text-violet-400", children: l.direction === "asc" ? "↑" : "↓" })
|
|
1206
1205
|
] })
|
|
1207
1206
|
},
|
|
1208
|
-
|
|
1207
|
+
m.key
|
|
1209
1208
|
)) }) }),
|
|
1210
|
-
/* @__PURE__ */ e.jsx("tbody", { className: "divide-y divide-slate-200 dark:divide-slate-700", children: r.map((
|
|
1209
|
+
/* @__PURE__ */ e.jsx("tbody", { className: "divide-y divide-slate-200 dark:divide-slate-700", children: r.map((m, p) => /* @__PURE__ */ e.jsx(
|
|
1211
1210
|
"tr",
|
|
1212
1211
|
{
|
|
1213
1212
|
className: "hover:bg-slate-50 dark:hover:bg-slate-800/30 transition-colors",
|
|
1214
|
-
children: t.map((
|
|
1213
|
+
children: t.map((N) => /* @__PURE__ */ e.jsx(
|
|
1215
1214
|
"td",
|
|
1216
1215
|
{
|
|
1217
1216
|
className: "px-6 py-4 whitespace-nowrap text-sm",
|
|
1218
|
-
children:
|
|
1217
|
+
children: N.render ? N.render(m) : m[N.key]
|
|
1219
1218
|
},
|
|
1220
|
-
|
|
1219
|
+
N.key
|
|
1221
1220
|
))
|
|
1222
1221
|
},
|
|
1223
|
-
|
|
1222
|
+
m.id || p
|
|
1224
1223
|
)) })
|
|
1225
|
-
] }) }) }),
|
|
1224
|
+
] }) }) }), Qe = ({
|
|
1226
1225
|
icon: t,
|
|
1227
1226
|
onClick: r,
|
|
1228
1227
|
children: n,
|
|
1229
1228
|
variant: l = "primary",
|
|
1230
|
-
disabled:
|
|
1231
|
-
title:
|
|
1232
|
-
size:
|
|
1229
|
+
disabled: c = !1,
|
|
1230
|
+
title: h = "",
|
|
1231
|
+
size: x = "md"
|
|
1233
1232
|
}) => {
|
|
1234
|
-
const
|
|
1233
|
+
const m = {
|
|
1235
1234
|
primary: "bg-violet-100 text-violet-700 hover:bg-violet-200 border border-violet-200 dark:bg-violet-600/20 dark:text-violet-400 dark:hover:bg-violet-600/30 dark:border dark:border-violet-500/30",
|
|
1236
1235
|
amber: "bg-amber-50 text-amber-700 border border-amber-200 hover:bg-amber-100 dark:bg-amber-900/20 dark:text-amber-300 dark:border-amber-700/40",
|
|
1237
1236
|
emerald: "bg-emerald-50 text-emerald-700 border border-emerald-200 hover:bg-emerald-100 dark:bg-emerald-900/20 dark:text-emerald-300 dark:border-emerald-700/40",
|
|
@@ -1246,10 +1245,10 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1246
1245
|
ghost: "bg-transparent text-slate-600 border border-dashed border-slate-300 hover:bg-slate-50 dark:text-slate-400 dark:border-slate-600 dark:hover:bg-slate-800/50",
|
|
1247
1246
|
rainbow: "action-btn-rainbow",
|
|
1248
1247
|
disabled: "bg-slate-100/50 text-slate-400 border border-slate-200/50 cursor-not-allowed dark:bg-slate-800/30 dark:text-slate-500 dark:border-slate-700/50"
|
|
1249
|
-
},
|
|
1248
|
+
}, p = {
|
|
1250
1249
|
sm: "px-2.5 py-1.5 text-xs gap-1",
|
|
1251
1250
|
md: "px-3 py-1.5 sm:px-3.5 sm:py-2 text-sm gap-1.5"
|
|
1252
|
-
},
|
|
1251
|
+
}, N = c ? m.disabled : m[l] ?? m.primary;
|
|
1253
1252
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1254
1253
|
/* @__PURE__ */ e.jsx("style", { children: `
|
|
1255
1254
|
@property --beam-angle {
|
|
@@ -1337,17 +1336,17 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1337
1336
|
/* @__PURE__ */ e.jsxs(
|
|
1338
1337
|
"button",
|
|
1339
1338
|
{
|
|
1340
|
-
onClick:
|
|
1339
|
+
onClick: c ? void 0 : r,
|
|
1341
1340
|
type: "button",
|
|
1342
|
-
title:
|
|
1343
|
-
disabled:
|
|
1341
|
+
title: h,
|
|
1342
|
+
disabled: c,
|
|
1344
1343
|
className: `
|
|
1345
1344
|
inline-flex items-center justify-center relative
|
|
1346
|
-
${
|
|
1345
|
+
${p[x]}
|
|
1347
1346
|
rounded-xl font-semibold whitespace-nowrap
|
|
1348
1347
|
transition-all duration-200
|
|
1349
|
-
${
|
|
1350
|
-
${
|
|
1348
|
+
${N}
|
|
1349
|
+
${c ? "opacity-60" : "active:scale-95"}
|
|
1351
1350
|
`,
|
|
1352
1351
|
children: [
|
|
1353
1352
|
t && /* @__PURE__ */ e.jsx(t, { className: "w-3.5 h-3.5 flex-shrink-0" }),
|
|
@@ -1356,38 +1355,38 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1356
1355
|
}
|
|
1357
1356
|
)
|
|
1358
1357
|
] });
|
|
1359
|
-
},
|
|
1358
|
+
}, Ze = ({
|
|
1360
1359
|
isOpen: t,
|
|
1361
1360
|
onClose: r,
|
|
1362
1361
|
title: n,
|
|
1363
1362
|
subtitle: l,
|
|
1364
|
-
icon:
|
|
1365
|
-
children:
|
|
1366
|
-
size:
|
|
1367
|
-
fullscreen:
|
|
1368
|
-
hideHeader:
|
|
1363
|
+
icon: c,
|
|
1364
|
+
children: h,
|
|
1365
|
+
size: x = "md",
|
|
1366
|
+
fullscreen: m = !1,
|
|
1367
|
+
hideHeader: p = !1
|
|
1369
1368
|
}) => {
|
|
1370
1369
|
if (J(() => {
|
|
1371
|
-
const
|
|
1372
|
-
|
|
1370
|
+
const R = (y) => {
|
|
1371
|
+
y.key === "Escape" && r();
|
|
1373
1372
|
};
|
|
1374
|
-
return t && (document.addEventListener("keydown",
|
|
1375
|
-
document.removeEventListener("keydown",
|
|
1373
|
+
return t && (document.addEventListener("keydown", R), document.body.style.overflow = "hidden"), () => {
|
|
1374
|
+
document.removeEventListener("keydown", R), document.body.style.overflow = "unset";
|
|
1376
1375
|
};
|
|
1377
1376
|
}, [t, r]), !t) return null;
|
|
1378
|
-
const
|
|
1377
|
+
const N = {
|
|
1379
1378
|
sm: "max-w-md",
|
|
1380
1379
|
md: "max-w-2xl",
|
|
1381
1380
|
lg: "max-w-4xl",
|
|
1382
1381
|
xl: "max-w-6xl"
|
|
1383
|
-
},
|
|
1382
|
+
}, S = /* @__PURE__ */ e.jsx("div", { className: `flex-shrink-0 px-4 py-3 sm:px-5 sm:py-4
|
|
1384
1383
|
bg-gradient-to-r from-violet-50 via-indigo-50 to-violet-50
|
|
1385
1384
|
dark:from-slate-700/50 dark:via-slate-800/50 dark:to-slate-700/50
|
|
1386
1385
|
border-b border-slate-200 dark:border-slate-700`, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
1387
1386
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2.5 sm:gap-3 min-w-0", children: [
|
|
1388
|
-
|
|
1387
|
+
c && /* @__PURE__ */ e.jsx("div", { className: `flex-shrink-0 w-9 h-9 sm:w-10 sm:h-10 rounded-xl
|
|
1389
1388
|
flex items-center justify-center
|
|
1390
|
-
bg-gradient-to-br from-violet-600 to-indigo-600 shadow-lg`, children: /* @__PURE__ */ e.jsx(
|
|
1389
|
+
bg-gradient-to-br from-violet-600 to-indigo-600 shadow-lg`, children: /* @__PURE__ */ e.jsx(c, { className: "w-[18px] h-[18px] sm:w-5 sm:h-5 text-white" }) }),
|
|
1391
1390
|
/* @__PURE__ */ e.jsxs("div", { className: "min-w-0", children: [
|
|
1392
1391
|
/* @__PURE__ */ e.jsx("h3", { className: "text-sm sm:text-base font-bold text-slate-900 dark:text-white truncate", children: n }),
|
|
1393
1392
|
l && /* @__PURE__ */ e.jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400 mt-0.5 truncate", children: l })
|
|
@@ -1409,10 +1408,10 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1409
1408
|
}
|
|
1410
1409
|
)
|
|
1411
1410
|
] }) });
|
|
1412
|
-
return
|
|
1411
|
+
return m ? de(
|
|
1413
1412
|
/* @__PURE__ */ e.jsxs("div", { className: "fixed inset-0 z-[11000] flex flex-col animate-in fade-in duration-200 bg-white dark:bg-slate-800", children: [
|
|
1414
|
-
!
|
|
1415
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex-1 min-h-0 overflow-hidden", children:
|
|
1413
|
+
!p && S,
|
|
1414
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex-1 min-h-0 overflow-hidden", children: h })
|
|
1416
1415
|
] }),
|
|
1417
1416
|
document.body
|
|
1418
1417
|
) : de(
|
|
@@ -1424,28 +1423,28 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1424
1423
|
onClick: r
|
|
1425
1424
|
}
|
|
1426
1425
|
),
|
|
1427
|
-
/* @__PURE__ */ e.jsx("div", { className: `relative z-[11001] w-full ${
|
|
1426
|
+
/* @__PURE__ */ e.jsx("div", { className: `relative z-[11001] w-full ${N[x]} animate-in zoom-in-95 duration-200 my-auto`, children: /* @__PURE__ */ e.jsxs("div", { className: `
|
|
1428
1427
|
rounded-xl sm:rounded-2xl border overflow-hidden
|
|
1429
1428
|
bg-white border-slate-200/50 shadow-2xl ml-2 mr-2
|
|
1430
1429
|
dark:bg-slate-800 dark:border-slate-700/50
|
|
1431
1430
|
flex flex-col max-h-[70dvh] sm:max-h-[80dvh]
|
|
1432
1431
|
`, children: [
|
|
1433
|
-
!
|
|
1434
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex-1 min-h-0 overflow-y-auto", children:
|
|
1432
|
+
!p && S,
|
|
1433
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex-1 min-h-0 overflow-y-auto", children: h })
|
|
1435
1434
|
] }) })
|
|
1436
1435
|
] }),
|
|
1437
1436
|
document.body
|
|
1438
1437
|
);
|
|
1439
|
-
},
|
|
1438
|
+
}, Pe = ({
|
|
1440
1439
|
checked: t = !1,
|
|
1441
1440
|
onChange: r,
|
|
1442
1441
|
disabled: n = !1,
|
|
1443
1442
|
label: l,
|
|
1444
|
-
name:
|
|
1445
|
-
helpText:
|
|
1443
|
+
name: c,
|
|
1444
|
+
helpText: h
|
|
1446
1445
|
}) => {
|
|
1447
|
-
const
|
|
1448
|
-
n || r(
|
|
1446
|
+
const x = () => {
|
|
1447
|
+
n || r(c, !t);
|
|
1449
1448
|
};
|
|
1450
1449
|
return /* @__PURE__ */ e.jsxs("div", { className: "space-y-1.5", children: [
|
|
1451
1450
|
l && /* @__PURE__ */ e.jsx("span", { className: "block text-sm font-semibold text-slate-700 dark:text-slate-300", children: l }),
|
|
@@ -1456,7 +1455,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1456
1455
|
type: "button",
|
|
1457
1456
|
role: "switch",
|
|
1458
1457
|
"aria-checked": t,
|
|
1459
|
-
onClick:
|
|
1458
|
+
onClick: x,
|
|
1460
1459
|
disabled: n,
|
|
1461
1460
|
className: `
|
|
1462
1461
|
relative inline-flex h-6 w-11 flex-shrink-0 items-center rounded-full
|
|
@@ -1479,53 +1478,53 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1479
1478
|
),
|
|
1480
1479
|
/* @__PURE__ */ e.jsx("span", { className: `text-sm font-medium ${t ? "text-violet-700 dark:text-violet-400" : "text-slate-500 dark:text-slate-400"}`, children: t ? "Yes" : "No" })
|
|
1481
1480
|
] }),
|
|
1482
|
-
|
|
1481
|
+
h && /* @__PURE__ */ e.jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400 leading-snug", children: h })
|
|
1483
1482
|
] });
|
|
1484
|
-
},
|
|
1485
|
-
var
|
|
1486
|
-
const [
|
|
1483
|
+
}, we = ({ field: t, value: r, onChange: n, error: l, index: c, mode: h = "create" }) => {
|
|
1484
|
+
var O;
|
|
1485
|
+
const [x, m] = z(""), [p, N] = z(!1), [S, R] = z(!1), [y, E] = z(null), [M, g] = z(""), [i, j] = z(!1), D = (b) => {
|
|
1487
1486
|
const $ = b.target.value;
|
|
1488
1487
|
n(t.name, $);
|
|
1489
|
-
},
|
|
1490
|
-
n(t.name, b),
|
|
1488
|
+
}, T = (b) => {
|
|
1489
|
+
n(t.name, b), N(!1), m("");
|
|
1491
1490
|
}, V = () => {
|
|
1492
|
-
|
|
1493
|
-
},
|
|
1494
|
-
|
|
1491
|
+
N(!1), m(""), j(!1), E(null);
|
|
1492
|
+
}, I = () => {
|
|
1493
|
+
x.trim() && (n(t.name, x.trim()), R(!0), N(!1), m(""));
|
|
1495
1494
|
}, Y = (b, $) => {
|
|
1496
|
-
$.preventDefault(), $.stopPropagation(),
|
|
1495
|
+
$.preventDefault(), $.stopPropagation(), E(b), g(b.label), j(!0);
|
|
1497
1496
|
}, U = async (b) => {
|
|
1498
|
-
b.preventDefault(), b.stopPropagation(),
|
|
1497
|
+
b.preventDefault(), b.stopPropagation(), M.trim() && y && t.onEditRank && await t.onEditRank(y.value, M.trim()) && (r === y.value && n(t.name, y.value), j(!1), E(null), g(""));
|
|
1499
1498
|
}, B = (b) => {
|
|
1500
|
-
b.preventDefault(), b.stopPropagation(),
|
|
1501
|
-
},
|
|
1502
|
-
if (!
|
|
1499
|
+
b.preventDefault(), b.stopPropagation(), j(!1), E(null), g("");
|
|
1500
|
+
}, w = (() => {
|
|
1501
|
+
if (!x) return t.options || [];
|
|
1503
1502
|
const b = Array.isArray(t.options) ? t.options : [];
|
|
1504
1503
|
if (t.fuzzySearch && typeof t.findFuzzyMatches == "function")
|
|
1505
1504
|
try {
|
|
1506
|
-
return t.findFuzzyMatches(
|
|
1505
|
+
return t.findFuzzyMatches(x, b, t.fuzzyThreshold || 0.5);
|
|
1507
1506
|
} catch ($) {
|
|
1508
1507
|
return console.error("Fuzzy search error:", $), b.filter(
|
|
1509
1508
|
(F) => {
|
|
1510
1509
|
var H;
|
|
1511
|
-
return (H = F.label) == null ? void 0 : H.toLowerCase().includes(
|
|
1510
|
+
return (H = F.label) == null ? void 0 : H.toLowerCase().includes(x.toLowerCase());
|
|
1512
1511
|
}
|
|
1513
1512
|
);
|
|
1514
1513
|
}
|
|
1515
1514
|
return b.filter(
|
|
1516
1515
|
($) => {
|
|
1517
1516
|
var F;
|
|
1518
|
-
return (F = $.label) == null ? void 0 : F.toLowerCase().includes(
|
|
1517
|
+
return (F = $.label) == null ? void 0 : F.toLowerCase().includes(x.toLowerCase());
|
|
1519
1518
|
}
|
|
1520
1519
|
) || [];
|
|
1521
|
-
})(), W =
|
|
1520
|
+
})(), W = x.trim() && t.fuzzySearch && t.options && typeof t.checkForDuplicateDesignation == "function" ? t.checkForDuplicateDesignation(x, t.options, 0.8) : null, d = W && W.similarityScore === 1, v = t.type === "select-or-custom" && r && !((O = t.options) != null && O.some((b) => b.value === r)), C = () => {
|
|
1522
1521
|
var $;
|
|
1523
1522
|
if (!r) return t.placeholder;
|
|
1524
1523
|
if (t.type === "select-or-custom" && v)
|
|
1525
1524
|
return r;
|
|
1526
1525
|
const b = ($ = t.options) == null ? void 0 : $.find((F) => F.value === r);
|
|
1527
1526
|
return b ? b.label : t.placeholder;
|
|
1528
|
-
},
|
|
1527
|
+
}, A = () => {
|
|
1529
1528
|
var H, G;
|
|
1530
1529
|
const b = t.icon, $ = `
|
|
1531
1530
|
w-full px-3.5 py-2.5 rounded-xl border transition-all duration-200
|
|
@@ -1534,7 +1533,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1534
1533
|
`, F = l ? "border-red-300 dark:border-red-700 focus:border-red-500 focus:ring-red-500" : "border-slate-300 dark:border-slate-600 focus:border-violet-500 focus:ring-violet-500";
|
|
1535
1534
|
switch (t.type) {
|
|
1536
1535
|
case "select-or-custom":
|
|
1537
|
-
return
|
|
1536
|
+
return S || v ? /* @__PURE__ */ e.jsxs("div", { className: "relative", children: [
|
|
1538
1537
|
b && /* @__PURE__ */ e.jsx("div", { className: "absolute left-3 sm:left-4 top-1/2 -translate-y-1/2 pointer-events-none", children: /* @__PURE__ */ e.jsx(b, { className: "w-4 h-4 sm:w-5 sm:h-5 text-slate-400" }) }),
|
|
1539
1538
|
/* @__PURE__ */ e.jsx(
|
|
1540
1539
|
"input",
|
|
@@ -1552,7 +1551,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1552
1551
|
{
|
|
1553
1552
|
type: "button",
|
|
1554
1553
|
onClick: (s) => {
|
|
1555
|
-
s.preventDefault(), s.stopPropagation(),
|
|
1554
|
+
s.preventDefault(), s.stopPropagation(), R(!1), n(t.name, "");
|
|
1556
1555
|
},
|
|
1557
1556
|
className: "absolute right-3 top-1/2 -translate-y-1/2 px-3 py-1.5 text-xs font-semibold text-slate-600 hover:text-slate-900 dark:text-slate-400 dark:hover:text-white transition-colors rounded-lg hover:bg-slate-100 dark:hover:bg-slate-700",
|
|
1558
1557
|
children: "Select Existing"
|
|
@@ -1564,7 +1563,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1564
1563
|
{
|
|
1565
1564
|
type: "button",
|
|
1566
1565
|
onClick: (s) => {
|
|
1567
|
-
s.preventDefault(), s.stopPropagation(), t.disabled ||
|
|
1566
|
+
s.preventDefault(), s.stopPropagation(), t.disabled || N(!0);
|
|
1568
1567
|
},
|
|
1569
1568
|
disabled: t.disabled,
|
|
1570
1569
|
className: ` relative ${$} ${F} ${b ? "pl-12" : ""} pr-4 text-left flex items-center justify-between disabled:opacity-50 disabled:cursor-not-allowed hover:border-violet-400 dark:hover:border-violet-500`,
|
|
@@ -1574,15 +1573,15 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1574
1573
|
"span",
|
|
1575
1574
|
{
|
|
1576
1575
|
className: `${r ? "" : "text-slate-400"} truncate pr-2`,
|
|
1577
|
-
title:
|
|
1578
|
-
children:
|
|
1576
|
+
title: C(),
|
|
1577
|
+
children: C()
|
|
1579
1578
|
}
|
|
1580
1579
|
),
|
|
1581
1580
|
/* @__PURE__ */ e.jsx(ae, { className: "w-5 h-5 text-slate-400 " })
|
|
1582
1581
|
]
|
|
1583
1582
|
}
|
|
1584
1583
|
),
|
|
1585
|
-
|
|
1584
|
+
p && /* @__PURE__ */ e.jsx(
|
|
1586
1585
|
"div",
|
|
1587
1586
|
{
|
|
1588
1587
|
className: "fixed inset-0 z-50 flex items-center justify-center p-3 sm:p-4 bg-slate-900/50 backdrop-blur-sm animate-in fade-in duration-200",
|
|
@@ -1600,8 +1599,8 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1600
1599
|
dark:from-slate-700/50 dark:via-slate-800/50 dark:to-slate-700/50
|
|
1601
1600
|
border-b border-slate-200 dark:border-slate-700 rounded-t-2xl`, children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
1602
1601
|
/* @__PURE__ */ e.jsxs("div", { className: "min-w-0", children: [
|
|
1603
|
-
/* @__PURE__ */ e.jsx("h3", { className: "text-sm sm:text-base font-bold text-slate-900 dark:text-white truncate", children:
|
|
1604
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400 mt-0.5 truncate", children:
|
|
1602
|
+
/* @__PURE__ */ e.jsx("h3", { className: "text-sm sm:text-base font-bold text-slate-900 dark:text-white truncate", children: i ? "Edit Rank Designation" : t.modalTitle || t.label }),
|
|
1603
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400 mt-0.5 truncate", children: i ? `Editing: ${y == null ? void 0 : y.label}` : t.modalSubtitle || "Search existing or create new" })
|
|
1605
1604
|
] }),
|
|
1606
1605
|
/* @__PURE__ */ e.jsx(
|
|
1607
1606
|
"button",
|
|
@@ -1620,7 +1619,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1620
1619
|
}
|
|
1621
1620
|
)
|
|
1622
1621
|
] }) }),
|
|
1623
|
-
|
|
1622
|
+
i ? /* @__PURE__ */ e.jsxs("div", { className: "p-4 sm:p-5 space-y-3 sm:space-y-4", children: [
|
|
1624
1623
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
1625
1624
|
/* @__PURE__ */ e.jsx("label", { className: `block text-xs font-semibold uppercase tracking-wide
|
|
1626
1625
|
text-slate-700 dark:text-slate-300 mb-1.5`, children: "Edit Rank Designation" }),
|
|
@@ -1628,7 +1627,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1628
1627
|
"input",
|
|
1629
1628
|
{
|
|
1630
1629
|
type: "text",
|
|
1631
|
-
value:
|
|
1630
|
+
value: M,
|
|
1632
1631
|
onChange: (s) => g(s.target.value),
|
|
1633
1632
|
className: `w-full px-3 py-2.5 sm:px-4 sm:py-3 rounded-xl border
|
|
1634
1633
|
border-slate-200/50 dark:border-slate-700/50
|
|
@@ -1671,7 +1670,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1671
1670
|
shadow-md hover:shadow-lg
|
|
1672
1671
|
transition-all duration-200 hover:scale-105 active:scale-95`,
|
|
1673
1672
|
children: [
|
|
1674
|
-
/* @__PURE__ */ e.jsx(
|
|
1673
|
+
/* @__PURE__ */ e.jsx(Re, { className: "w-4 h-4" }),
|
|
1675
1674
|
" Save Changes"
|
|
1676
1675
|
]
|
|
1677
1676
|
}
|
|
@@ -1684,8 +1683,8 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1684
1683
|
"input",
|
|
1685
1684
|
{
|
|
1686
1685
|
type: "text",
|
|
1687
|
-
value:
|
|
1688
|
-
onChange: (s) =>
|
|
1686
|
+
value: x,
|
|
1687
|
+
onChange: (s) => m(s.target.value),
|
|
1689
1688
|
placeholder: t.fuzzySearch ? "Search or type to create new..." : "Search...",
|
|
1690
1689
|
className: "w-full pl-10 pr-4 py-2.5 rounded-lg border border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 text-slate-900 dark:text-white placeholder-slate-400 focus:border-violet-500 focus:ring-2 focus:ring-violet-500/20 transition-all",
|
|
1691
1690
|
autoFocus: !0
|
|
@@ -1703,17 +1702,17 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1703
1702
|
] })
|
|
1704
1703
|
] })
|
|
1705
1704
|
] }) }),
|
|
1706
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-y-auto p-2", children:
|
|
1705
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-y-auto p-2", children: x.trim() ? (
|
|
1707
1706
|
/* Show filtered results + Create New when user types */
|
|
1708
1707
|
/* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
1709
|
-
|
|
1708
|
+
w.length > 0 && /* @__PURE__ */ e.jsxs("div", { className: "space-y-1 mb-3", children: [
|
|
1710
1709
|
/* @__PURE__ */ e.jsx("p", { className: "px-4 py-2 text-xs font-semibold text-slate-500 dark:text-slate-400 uppercase tracking-wider", children: "Existing Options" }),
|
|
1711
|
-
|
|
1710
|
+
w.map((s) => /* @__PURE__ */ e.jsx("div", { className: "group relative", children: /* @__PURE__ */ e.jsxs(
|
|
1712
1711
|
"button",
|
|
1713
1712
|
{
|
|
1714
1713
|
type: "button",
|
|
1715
1714
|
onClick: (a) => {
|
|
1716
|
-
a.preventDefault(), a.stopPropagation(),
|
|
1715
|
+
a.preventDefault(), a.stopPropagation(), T(s.value);
|
|
1717
1716
|
},
|
|
1718
1717
|
className: `w-full text-left px-4 py-3 rounded-lg transition-all duration-200 flex items-center justify-between ${r === s.value ? "bg-violet-100 dark:bg-violet-600/20 text-violet-900 dark:text-violet-300 font-semibold" : "hover:bg-slate-100 dark:hover:bg-slate-700 text-slate-700 dark:text-slate-300"}`,
|
|
1719
1718
|
children: [
|
|
@@ -1738,22 +1737,22 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1738
1737
|
}
|
|
1739
1738
|
) }, s.value))
|
|
1740
1739
|
] }),
|
|
1741
|
-
(!
|
|
1742
|
-
/* @__PURE__ */ e.jsx("p", { className: "px-4 py-2 text-xs font-semibold text-slate-500 dark:text-slate-400 uppercase tracking-wider", children:
|
|
1740
|
+
(!d || (W == null ? void 0 : W.similarityScore) < 1) && /* @__PURE__ */ e.jsxs("div", { className: w.length > 0 ? "border-t border-slate-200 dark:border-slate-700 pt-3" : "", children: [
|
|
1741
|
+
/* @__PURE__ */ e.jsx("p", { className: "px-4 py-2 text-xs font-semibold text-slate-500 dark:text-slate-400 uppercase tracking-wider", children: w.length > 0 ? h === "edit" ? "Or Update To" : "Or Create New" : "No matches found" }),
|
|
1743
1742
|
/* @__PURE__ */ e.jsx("div", { className: "px-2", children: /* @__PURE__ */ e.jsx(
|
|
1744
1743
|
"button",
|
|
1745
1744
|
{
|
|
1746
1745
|
type: "button",
|
|
1747
1746
|
onClick: (s) => {
|
|
1748
|
-
s.preventDefault(), s.stopPropagation(),
|
|
1747
|
+
s.preventDefault(), s.stopPropagation(), I();
|
|
1749
1748
|
},
|
|
1750
1749
|
className: "w-full px-4 py-3 rounded-lg transition-all duration-200 bg-gradient-to-r from-violet-600 to-indigo-600 hover:from-violet-700 hover:to-indigo-700 text-white font-semibold shadow-lg hover:shadow-xl transform hover:-translate-y-0.5 min-w-0",
|
|
1751
1750
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-center space-x-2 min-w-0", children: [
|
|
1752
|
-
/* @__PURE__ */ e.jsx(
|
|
1751
|
+
/* @__PURE__ */ e.jsx(Me, { className: "w-5 h-5 flex-shrink-0" }),
|
|
1753
1752
|
/* @__PURE__ */ e.jsxs("span", { className: "truncate", children: [
|
|
1754
|
-
|
|
1753
|
+
h === "edit" ? "Update to" : "Create New",
|
|
1755
1754
|
": ",
|
|
1756
|
-
|
|
1755
|
+
x.trim()
|
|
1757
1756
|
] })
|
|
1758
1757
|
] })
|
|
1759
1758
|
}
|
|
@@ -1767,7 +1766,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1767
1766
|
{
|
|
1768
1767
|
type: "button",
|
|
1769
1768
|
onClick: (a) => {
|
|
1770
|
-
a.preventDefault(), a.stopPropagation(),
|
|
1769
|
+
a.preventDefault(), a.stopPropagation(), T(s.value);
|
|
1771
1770
|
},
|
|
1772
1771
|
className: `w-full text-left px-4 py-3 rounded-lg transition-all duration-200 break-words whitespace-normal ${r === s.value ? "bg-violet-100 dark:bg-violet-600/20 text-violet-900 dark:text-violet-300 font-semibold" : "hover:bg-slate-100 dark:hover:bg-slate-700 text-slate-700 dark:text-slate-300"}`,
|
|
1773
1772
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
@@ -1788,8 +1787,8 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1788
1787
|
) })
|
|
1789
1788
|
] }),
|
|
1790
1789
|
/* @__PURE__ */ e.jsx("div", { className: "flex-shrink-0 px-6 py-3 border-t border-slate-200 dark:border-slate-700 bg-slate-50 dark:bg-slate-800/50", children: /* @__PURE__ */ e.jsxs("p", { className: "text-xs text-slate-500 dark:text-slate-400 text-center", children: [
|
|
1791
|
-
!
|
|
1792
|
-
|
|
1790
|
+
!i && (w ? `${w.length} option${w.length !== 1 ? "s" : ""} available` : ""),
|
|
1791
|
+
i && "Edit the rank designation and save changes"
|
|
1793
1792
|
] }) })
|
|
1794
1793
|
] })
|
|
1795
1794
|
}
|
|
@@ -1804,18 +1803,18 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1804
1803
|
{
|
|
1805
1804
|
type: "button",
|
|
1806
1805
|
onClick: (s) => {
|
|
1807
|
-
s.preventDefault(), s.stopPropagation(), t.disabled ||
|
|
1806
|
+
s.preventDefault(), s.stopPropagation(), t.disabled || N(!0);
|
|
1808
1807
|
},
|
|
1809
1808
|
disabled: t.disabled,
|
|
1810
1809
|
className: `relative ${$} ${F} flex items-center justify-between ${b ? "pl-12" : ""} pr-4 text-left disabled:opacity-50 disabled:cursor-not-allowed hover:border-violet-400 dark:hover:border-violet-500`,
|
|
1811
1810
|
children: [
|
|
1812
1811
|
b && /* @__PURE__ */ e.jsx("div", { className: "absolute left-3 sm:left-4 top-1/2 -translate-y-1/2 pointer-events-none", children: /* @__PURE__ */ e.jsx(b, { className: "w-4 h-4 sm:w-5 sm:h-5 text-slate-400" }) }),
|
|
1813
|
-
/* @__PURE__ */ e.jsx("span", { className: r ? "text-slate-900 dark:text-white truncate" : "text-slate-400", children:
|
|
1812
|
+
/* @__PURE__ */ e.jsx("span", { className: r ? "text-slate-900 dark:text-white truncate" : "text-slate-400", children: C() }),
|
|
1814
1813
|
/* @__PURE__ */ e.jsx(ae, { className: "w-5 h-5 text-slate-400" })
|
|
1815
1814
|
]
|
|
1816
1815
|
}
|
|
1817
1816
|
),
|
|
1818
|
-
|
|
1817
|
+
p && /* @__PURE__ */ e.jsx(
|
|
1819
1818
|
"div",
|
|
1820
1819
|
{
|
|
1821
1820
|
className: "fixed inset-0 z-50 flex items-center justify-center p-3 sm:p-4 bg-black/50 backdrop-blur-sm animate-in fade-in duration-200",
|
|
@@ -1858,20 +1857,20 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1858
1857
|
"input",
|
|
1859
1858
|
{
|
|
1860
1859
|
type: "text",
|
|
1861
|
-
value:
|
|
1862
|
-
onChange: (s) =>
|
|
1860
|
+
value: x,
|
|
1861
|
+
onChange: (s) => m(s.target.value),
|
|
1863
1862
|
placeholder: "Search...",
|
|
1864
1863
|
className: "w-full pl-10 pr-4 py-2.5 rounded-lg border border-slate-300 dark:border-slate-600 bg-white dark:bg-slate-700 text-slate-900 dark:text-white placeholder-slate-400 focus:border-violet-500 focus:ring-2 focus:ring-violet-500/20 transition-all",
|
|
1865
1864
|
autoFocus: !0
|
|
1866
1865
|
}
|
|
1867
1866
|
)
|
|
1868
1867
|
] }) }),
|
|
1869
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-y-auto p-2", children:
|
|
1868
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex-1 overflow-y-auto p-2", children: w.length > 0 ? /* @__PURE__ */ e.jsx("div", { className: "space-y-1", children: w.map((s) => /* @__PURE__ */ e.jsx(
|
|
1870
1869
|
"button",
|
|
1871
1870
|
{
|
|
1872
1871
|
type: "button",
|
|
1873
1872
|
onClick: (a) => {
|
|
1874
|
-
a.preventDefault(), a.stopPropagation(),
|
|
1873
|
+
a.preventDefault(), a.stopPropagation(), T(s.value);
|
|
1875
1874
|
},
|
|
1876
1875
|
className: `w-full text-left px-4 py-3 rounded-lg transition-all duration-200 break-all whitespace-normal ${r === s.value ? "bg-violet-100 dark:bg-violet-600/20 text-violet-900 dark:text-violet-300 font-semibold" : "hover:bg-slate-100 dark:hover:bg-slate-700 text-slate-700 dark:text-slate-300"}`,
|
|
1877
1876
|
children: s.label
|
|
@@ -1889,7 +1888,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1889
1888
|
"select",
|
|
1890
1889
|
{
|
|
1891
1890
|
value: r,
|
|
1892
|
-
onChange:
|
|
1891
|
+
onChange: D,
|
|
1893
1892
|
disabled: t.disabled,
|
|
1894
1893
|
className: `${$} ${F} ${b ? "pl-12" : ""} pr-10 appearance-none cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed focus:outline-none focus:ring-2 focus:ring-violet-500/20`,
|
|
1895
1894
|
children: [
|
|
@@ -1968,7 +1967,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
1968
1967
|
] });
|
|
1969
1968
|
case "toggle":
|
|
1970
1969
|
return /* @__PURE__ */ e.jsx(
|
|
1971
|
-
|
|
1970
|
+
Pe,
|
|
1972
1971
|
{
|
|
1973
1972
|
checked: r || !1,
|
|
1974
1973
|
onChange: n,
|
|
@@ -2028,7 +2027,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2028
2027
|
},
|
|
2029
2028
|
className: "absolute right-2 top-1/2 -translate-y-1/2 p-2 rounded-lg bg-violet-600 hover:bg-violet-700 active:bg-violet-800 disabled:opacity-50 disabled:cursor-not-allowed text-white transition-colors",
|
|
2030
2029
|
title: "Browse files",
|
|
2031
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2030
|
+
children: /* @__PURE__ */ e.jsx(Se, { className: "w-4 h-4" })
|
|
2032
2031
|
}
|
|
2033
2032
|
),
|
|
2034
2033
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2045,11 +2044,11 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2045
2044
|
}
|
|
2046
2045
|
)
|
|
2047
2046
|
] }),
|
|
2048
|
-
a.map(({ tempId: o, file:
|
|
2049
|
-
/* @__PURE__ */ e.jsx("div", { className: "w-8 h-8 rounded-lg bg-violet-100 dark:bg-violet-900/30 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ e.jsx(
|
|
2047
|
+
a.map(({ tempId: o, file: f, documentName: k }) => /* @__PURE__ */ e.jsxs("div", { className: "group flex items-center gap-3 px-4 py-3 rounded-xl border border-violet-200 dark:border-violet-700/40 bg-violet-50/50 dark:bg-violet-900/10 transition-colors", children: [
|
|
2048
|
+
/* @__PURE__ */ e.jsx("div", { className: "w-8 h-8 rounded-lg bg-violet-100 dark:bg-violet-900/30 flex items-center justify-center flex-shrink-0", children: /* @__PURE__ */ e.jsx($e, { className: "w-4 h-4 text-violet-600 dark:text-violet-400" }) }),
|
|
2050
2049
|
/* @__PURE__ */ e.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
2051
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-sm font-semibold text-slate-800 dark:text-slate-200 truncate", children:
|
|
2052
|
-
(
|
|
2050
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-sm font-semibold text-slate-800 dark:text-slate-200 truncate", children: k || (f == null ? void 0 : f.name) }),
|
|
2051
|
+
(f == null ? void 0 : f.size) !== void 0 && /* @__PURE__ */ e.jsx("p", { className: "text-xs text-violet-600 dark:text-violet-400 mt-0.5", children: f.size < 1024 * 1024 ? `${(f.size / 1024).toFixed(1)} KB` : `${(f.size / (1024 * 1024)).toFixed(2)} MB` })
|
|
2053
2052
|
] }),
|
|
2054
2053
|
t.onRemove && /* @__PURE__ */ e.jsx(
|
|
2055
2054
|
"button",
|
|
@@ -2058,7 +2057,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2058
2057
|
onClick: () => t.onRemove(o),
|
|
2059
2058
|
className: "w-7 h-7 rounded-lg flex items-center justify-center text-red-500 hover:bg-red-50 dark:hover:bg-red-900/20 transition-all flex-shrink-0 opacity-60 sm:opacity-0 sm:group-hover:opacity-100",
|
|
2060
2059
|
title: "Remove",
|
|
2061
|
-
children: /* @__PURE__ */ e.jsx(
|
|
2060
|
+
children: /* @__PURE__ */ e.jsx(Le, { className: "w-3.5 h-3.5" })
|
|
2062
2061
|
}
|
|
2063
2062
|
)
|
|
2064
2063
|
] }, o))
|
|
@@ -2089,100 +2088,100 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2089
2088
|
/* @__PURE__ */ e.jsx("span", { children: t.label }),
|
|
2090
2089
|
t.required && /* @__PURE__ */ e.jsx("span", { className: "text-red-500 dark:text-red-400", children: "*" })
|
|
2091
2090
|
] }) }),
|
|
2092
|
-
/* @__PURE__ */ e.jsx("div", { className: "mt-2", children:
|
|
2091
|
+
/* @__PURE__ */ e.jsx("div", { className: "mt-2", children: A() }),
|
|
2093
2092
|
l && /* @__PURE__ */ e.jsxs("p", { className: "text-xs sm:text-sm text-red-600 dark:text-red-400 flex items-center gap-1.5 animate-in slide-in-from-top-1 duration-200", children: [
|
|
2094
2093
|
/* @__PURE__ */ e.jsx(he, { className: "w-3.5 h-3.5 flex-shrink-0" }),
|
|
2095
2094
|
/* @__PURE__ */ e.jsx("span", { children: l })
|
|
2096
2095
|
] }),
|
|
2097
2096
|
t.helpText && !l && /* @__PURE__ */ e.jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400", children: t.helpText })
|
|
2098
2097
|
] });
|
|
2099
|
-
},
|
|
2098
|
+
}, Ke = ({
|
|
2100
2099
|
fields: t = [],
|
|
2101
2100
|
initialData: r = {},
|
|
2102
2101
|
onSubmit: n,
|
|
2103
2102
|
onCancel: l,
|
|
2104
|
-
onEdit:
|
|
2105
|
-
onFieldChange:
|
|
2106
|
-
submitButtonText:
|
|
2107
|
-
cancelButtonText:
|
|
2108
|
-
editButtonText:
|
|
2109
|
-
showEditingBadge:
|
|
2110
|
-
editingEntity:
|
|
2111
|
-
helpText:
|
|
2112
|
-
isModal:
|
|
2113
|
-
mode:
|
|
2114
|
-
disabled:
|
|
2103
|
+
onEdit: c,
|
|
2104
|
+
onFieldChange: h,
|
|
2105
|
+
submitButtonText: x = "Submit",
|
|
2106
|
+
cancelButtonText: m = "Cancel",
|
|
2107
|
+
editButtonText: p = "Edit",
|
|
2108
|
+
showEditingBadge: N = !1,
|
|
2109
|
+
editingEntity: S = "",
|
|
2110
|
+
helpText: R = "All fields marked with * are required",
|
|
2111
|
+
isModal: y = !0,
|
|
2112
|
+
mode: E = "edit",
|
|
2113
|
+
disabled: M = !1,
|
|
2115
2114
|
// ✅ Add disabled prop for loading states
|
|
2116
2115
|
renderCustomField: g
|
|
2117
2116
|
}) => {
|
|
2118
|
-
const
|
|
2119
|
-
const
|
|
2120
|
-
return (typeof t == "function" ? t(r) : t).forEach((
|
|
2121
|
-
|
|
2122
|
-
}),
|
|
2123
|
-
}), [
|
|
2117
|
+
const i = K(!0), [j, D] = z(() => {
|
|
2118
|
+
const d = {};
|
|
2119
|
+
return (typeof t == "function" ? t(r) : t).forEach((C) => {
|
|
2120
|
+
d[C.name] = r[C.name] || "";
|
|
2121
|
+
}), d;
|
|
2122
|
+
}), [T, V] = z({}), I = E === "view", Y = I ? !0 : !y;
|
|
2124
2123
|
J(() => {
|
|
2125
|
-
if (
|
|
2126
|
-
|
|
2124
|
+
if (i.current) {
|
|
2125
|
+
i.current = !1;
|
|
2127
2126
|
return;
|
|
2128
2127
|
}
|
|
2129
2128
|
if (r && Object.keys(r).length > 0 && r.id) {
|
|
2130
2129
|
const v = {};
|
|
2131
|
-
(typeof t == "function" ? t(
|
|
2132
|
-
v[
|
|
2133
|
-
}),
|
|
2130
|
+
(typeof t == "function" ? t(j) : t).forEach((A) => {
|
|
2131
|
+
v[A.name] = r[A.name] || "";
|
|
2132
|
+
}), D(v);
|
|
2134
2133
|
}
|
|
2135
2134
|
}, [r.id]);
|
|
2136
|
-
const U = typeof t == "function" ? t(
|
|
2137
|
-
if (
|
|
2138
|
-
const
|
|
2139
|
-
|
|
2140
|
-
const
|
|
2141
|
-
delete
|
|
2135
|
+
const U = typeof t == "function" ? t(j) : t, B = (d, v) => {
|
|
2136
|
+
if (I) return;
|
|
2137
|
+
const C = { ...j, [d]: v };
|
|
2138
|
+
D(C);
|
|
2139
|
+
const A = { ...T };
|
|
2140
|
+
delete A[d], U.forEach((O) => {
|
|
2142
2141
|
var b;
|
|
2143
|
-
if ((b =
|
|
2144
|
-
const $ =
|
|
2145
|
-
|
|
2142
|
+
if ((b = O.validation) != null && b.custom && A[O.name]) {
|
|
2143
|
+
const $ = O.name === d ? v : j[O.name];
|
|
2144
|
+
O.validation.custom($, C) === !0 && delete A[O.name];
|
|
2146
2145
|
}
|
|
2147
|
-
}), V(
|
|
2148
|
-
},
|
|
2149
|
-
if (
|
|
2150
|
-
const
|
|
2146
|
+
}), V(A), h && h(d, v, C);
|
|
2147
|
+
}, w = () => {
|
|
2148
|
+
if (I) return !0;
|
|
2149
|
+
const d = {};
|
|
2151
2150
|
return U.forEach((v) => {
|
|
2152
|
-
const
|
|
2153
|
-
if (v.required &&
|
|
2154
|
-
|
|
2151
|
+
const C = j[v.name], A = v.isHtml ? !(C || "").replace(/<[^>]*>/g, "").trim() : !C;
|
|
2152
|
+
if (v.required && A) {
|
|
2153
|
+
d[v.name] = `${v.label} is required`;
|
|
2155
2154
|
return;
|
|
2156
2155
|
}
|
|
2157
|
-
if (v.validation &&
|
|
2158
|
-
const { minLength:
|
|
2159
|
-
if (
|
|
2160
|
-
|
|
2156
|
+
if (v.validation && C) {
|
|
2157
|
+
const { minLength: O, maxLength: b, pattern: $, custom: F } = v.validation, H = v.isHtml ? (C || "").replace(/<[^>]*>/g, "").trim() : C;
|
|
2158
|
+
if (O && H.length < O) {
|
|
2159
|
+
d[v.name] = `Minimum ${O} characters required`;
|
|
2161
2160
|
return;
|
|
2162
2161
|
}
|
|
2163
2162
|
if (b && H.length > b) {
|
|
2164
|
-
|
|
2163
|
+
d[v.name] = `Maximum ${b} characters allowed`;
|
|
2165
2164
|
return;
|
|
2166
2165
|
}
|
|
2167
|
-
if ($ && !$.test(
|
|
2168
|
-
|
|
2166
|
+
if ($ && !$.test(C)) {
|
|
2167
|
+
d[v.name] = v.validation.patternMessage || v.validation.message || "Invalid format";
|
|
2169
2168
|
return;
|
|
2170
2169
|
}
|
|
2171
2170
|
if (F) {
|
|
2172
|
-
const G = F(
|
|
2171
|
+
const G = F(C, j);
|
|
2173
2172
|
if (G !== !0) {
|
|
2174
|
-
|
|
2173
|
+
d[v.name] = typeof G == "string" ? G : v.validation.message || "Validation failed";
|
|
2175
2174
|
return;
|
|
2176
2175
|
}
|
|
2177
2176
|
}
|
|
2178
2177
|
}
|
|
2179
|
-
}), V(
|
|
2180
|
-
}, W = (
|
|
2181
|
-
|
|
2178
|
+
}), V(d), Object.keys(d).length === 0;
|
|
2179
|
+
}, W = (d) => {
|
|
2180
|
+
d.preventDefault(), !I && w() && n(j);
|
|
2182
2181
|
};
|
|
2183
2182
|
return /* @__PURE__ */ e.jsxs("form", { onSubmit: W, className: "flex flex-col h-full max-h-[75vh] sm:max-h-[70vh]", children: [
|
|
2184
2183
|
/* @__PURE__ */ e.jsxs("div", { className: "flex-1 overflow-y-auto px-4 pt-4 sm:px-5 sm:pt-5", children: [
|
|
2185
|
-
|
|
2184
|
+
I && /* @__PURE__ */ e.jsxs("div", { className: `mb-4 flex items-center gap-3 p-3 sm:p-3.5 rounded-xl
|
|
2186
2185
|
bg-blue-50 border border-blue-200
|
|
2187
2186
|
dark:bg-blue-600/10 dark:border-blue-500/30`, children: [
|
|
2188
2187
|
/* @__PURE__ */ e.jsx("div", { className: "flex-shrink-0 p-1.5 rounded-lg bg-blue-600 dark:bg-blue-500", children: /* @__PURE__ */ e.jsx(re, { className: "w-3.5 h-3.5 text-white" }) }),
|
|
@@ -2191,7 +2190,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2191
2190
|
/* @__PURE__ */ e.jsx("p", { className: "text-xs text-slate-500 dark:text-slate-400 leading-snug", children: "Read-only — no changes will be saved" })
|
|
2192
2191
|
] })
|
|
2193
2192
|
] }),
|
|
2194
|
-
!
|
|
2193
|
+
!I && N && S && /* @__PURE__ */ e.jsxs("div", { className: `mb-4 flex items-center gap-3 p-3 sm:p-3.5 rounded-xl
|
|
2195
2194
|
bg-violet-50 border border-violet-200
|
|
2196
2195
|
dark:bg-violet-600/10 dark:border-violet-500/30`, children: [
|
|
2197
2196
|
/* @__PURE__ */ e.jsx("span", { className: "flex-shrink-0 w-2 h-2 rounded-full bg-violet-500 animate-pulse" }),
|
|
@@ -2200,47 +2199,47 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2200
2199
|
/* @__PURE__ */ e.jsxs("p", { className: "text-xs text-slate-500 dark:text-slate-400 truncate", children: [
|
|
2201
2200
|
"Modifying:",
|
|
2202
2201
|
" ",
|
|
2203
|
-
/* @__PURE__ */ e.jsx("span", { className: "font-semibold text-violet-600 dark:text-violet-400", children:
|
|
2202
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-semibold text-violet-600 dark:text-violet-400", children: S })
|
|
2204
2203
|
] })
|
|
2205
2204
|
] })
|
|
2206
2205
|
] }),
|
|
2207
|
-
/* @__PURE__ */ e.jsx("div", { className: "space-y-4 pb-4", children: U.map((
|
|
2208
|
-
const
|
|
2206
|
+
/* @__PURE__ */ e.jsx("div", { className: "space-y-4 pb-4", children: U.map((d, v) => {
|
|
2207
|
+
const C = j[d.name], A = T[d.name];
|
|
2209
2208
|
if (g) {
|
|
2210
|
-
const
|
|
2211
|
-
field:
|
|
2212
|
-
value:
|
|
2213
|
-
error:
|
|
2209
|
+
const O = g({
|
|
2210
|
+
field: d,
|
|
2211
|
+
value: C,
|
|
2212
|
+
error: A,
|
|
2214
2213
|
index: v,
|
|
2215
|
-
mode:
|
|
2216
|
-
disabled:
|
|
2214
|
+
mode: E,
|
|
2215
|
+
disabled: I || d.disabled || M,
|
|
2217
2216
|
onChange: B
|
|
2218
2217
|
});
|
|
2219
|
-
if (
|
|
2218
|
+
if (O) return /* @__PURE__ */ e.jsx("div", { children: O }, d.name || v);
|
|
2220
2219
|
}
|
|
2221
2220
|
return /* @__PURE__ */ e.jsx(
|
|
2222
|
-
|
|
2221
|
+
we,
|
|
2223
2222
|
{
|
|
2224
|
-
field: { ...
|
|
2225
|
-
value:
|
|
2223
|
+
field: { ...d, disabled: I || d.disabled || M },
|
|
2224
|
+
value: C,
|
|
2226
2225
|
onChange: B,
|
|
2227
|
-
error:
|
|
2228
|
-
mode:
|
|
2226
|
+
error: A,
|
|
2227
|
+
mode: E
|
|
2229
2228
|
},
|
|
2230
|
-
|
|
2229
|
+
d.name || v
|
|
2231
2230
|
);
|
|
2232
2231
|
}) })
|
|
2233
2232
|
] }),
|
|
2234
2233
|
/* @__PURE__ */ e.jsxs("div", { className: `flex-shrink-0 bg-white dark:bg-slate-800
|
|
2235
2234
|
border-t border-slate-200 dark:border-slate-700
|
|
2236
2235
|
px-4 py-3 sm:px-5 sm:py-4`, children: [
|
|
2237
|
-
|
|
2236
|
+
I ? /* @__PURE__ */ e.jsxs("div", { className: `flex ${y ? "flex-col-reverse sm:flex-row" : "flex-row"} gap-2.5`, children: [
|
|
2238
2237
|
Y && l && /* @__PURE__ */ e.jsxs(
|
|
2239
2238
|
"button",
|
|
2240
2239
|
{
|
|
2241
2240
|
type: "button",
|
|
2242
2241
|
onClick: l,
|
|
2243
|
-
className: `${
|
|
2242
|
+
className: `${y ? "flex-1 sm:flex-none" : "w-auto"}
|
|
2244
2243
|
flex items-center justify-center gap-2
|
|
2245
2244
|
px-4 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200
|
|
2246
2245
|
bg-slate-100 hover:bg-slate-200 text-slate-700 border border-slate-200
|
|
@@ -2252,12 +2251,12 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2252
2251
|
]
|
|
2253
2252
|
}
|
|
2254
2253
|
),
|
|
2255
|
-
|
|
2254
|
+
c && /* @__PURE__ */ e.jsxs(
|
|
2256
2255
|
"button",
|
|
2257
2256
|
{
|
|
2258
2257
|
type: "button",
|
|
2259
|
-
onClick:
|
|
2260
|
-
className: `${
|
|
2258
|
+
onClick: c,
|
|
2259
|
+
className: `${y ? "flex-1" : "w-auto"}
|
|
2261
2260
|
flex items-center justify-center gap-2
|
|
2262
2261
|
px-4 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200
|
|
2263
2262
|
bg-gradient-to-r from-violet-600 to-indigo-600
|
|
@@ -2266,20 +2265,20 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2266
2265
|
hover:scale-[1.02] active:scale-[0.98]`,
|
|
2267
2266
|
children: [
|
|
2268
2267
|
/* @__PURE__ */ e.jsx(oe, { className: "w-4 h-4" }),
|
|
2269
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
2268
|
+
/* @__PURE__ */ e.jsx("span", { children: p })
|
|
2270
2269
|
]
|
|
2271
2270
|
}
|
|
2272
2271
|
)
|
|
2273
2272
|
] }) : (
|
|
2274
2273
|
/* Edit mode actions */
|
|
2275
|
-
/* @__PURE__ */ e.jsxs("div", { className: `flex ${
|
|
2274
|
+
/* @__PURE__ */ e.jsxs("div", { className: `flex ${y ? "flex-col-reverse sm:flex-row" : "flex-row justify-start"} gap-2.5`, children: [
|
|
2276
2275
|
l && /* @__PURE__ */ e.jsxs(
|
|
2277
2276
|
"button",
|
|
2278
2277
|
{
|
|
2279
2278
|
type: "button",
|
|
2280
2279
|
onClick: l,
|
|
2281
|
-
disabled:
|
|
2282
|
-
className: `${
|
|
2280
|
+
disabled: M,
|
|
2281
|
+
className: `${y ? "flex-1 sm:flex-none" : "w-auto"}
|
|
2283
2282
|
flex items-center justify-center gap-2
|
|
2284
2283
|
px-4 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200
|
|
2285
2284
|
bg-slate-100 hover:bg-slate-200 text-slate-700 border border-slate-200
|
|
@@ -2288,7 +2287,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2288
2287
|
hover:scale-[1.02] active:scale-[0.98]`,
|
|
2289
2288
|
children: [
|
|
2290
2289
|
/* @__PURE__ */ e.jsx(X, { className: "w-4 h-4" }),
|
|
2291
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
2290
|
+
/* @__PURE__ */ e.jsx("span", { children: m })
|
|
2292
2291
|
]
|
|
2293
2292
|
}
|
|
2294
2293
|
),
|
|
@@ -2296,8 +2295,8 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2296
2295
|
"button",
|
|
2297
2296
|
{
|
|
2298
2297
|
type: "submit",
|
|
2299
|
-
disabled:
|
|
2300
|
-
className: `${
|
|
2298
|
+
disabled: M,
|
|
2299
|
+
className: `${y ? "flex-1" : "w-auto"}
|
|
2301
2300
|
flex items-center justify-center gap-2
|
|
2302
2301
|
px-4 py-2.5 rounded-xl text-sm font-semibold transition-all duration-200
|
|
2303
2302
|
bg-gradient-to-r from-violet-600 to-indigo-600
|
|
@@ -2306,14 +2305,14 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2306
2305
|
disabled:opacity-50 disabled:cursor-not-allowed
|
|
2307
2306
|
hover:scale-[1.02] active:scale-[0.98] disabled:hover:scale-100`,
|
|
2308
2307
|
children: [
|
|
2309
|
-
|
|
2310
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
2308
|
+
M ? /* @__PURE__ */ e.jsx("span", { className: "w-4 h-4 rounded-full border-2 border-white/30 border-t-white animate-spin flex-shrink-0" }) : /* @__PURE__ */ e.jsx(re, { className: "w-4 h-4 flex-shrink-0" }),
|
|
2309
|
+
/* @__PURE__ */ e.jsx("span", { children: M ? "Saving..." : x })
|
|
2311
2310
|
]
|
|
2312
2311
|
}
|
|
2313
2312
|
)
|
|
2314
2313
|
] })
|
|
2315
2314
|
),
|
|
2316
|
-
!
|
|
2315
|
+
!I && R && /* @__PURE__ */ e.jsx("p", { className: "mt-2.5 text-xs text-slate-400 dark:text-slate-500 text-center", children: R })
|
|
2317
2316
|
] })
|
|
2318
2317
|
] });
|
|
2319
2318
|
}, Fe = ({
|
|
@@ -2321,27 +2320,27 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2321
2320
|
onClose: r,
|
|
2322
2321
|
onSelect: n,
|
|
2323
2322
|
options: l = [],
|
|
2324
|
-
selectedValue:
|
|
2325
|
-
title:
|
|
2326
|
-
subtitle:
|
|
2327
|
-
icon:
|
|
2328
|
-
searchable:
|
|
2329
|
-
searchPlaceholder:
|
|
2323
|
+
selectedValue: c,
|
|
2324
|
+
title: h = "Select Option",
|
|
2325
|
+
subtitle: x = "Choose from the list below",
|
|
2326
|
+
icon: m,
|
|
2327
|
+
searchable: p = !0,
|
|
2328
|
+
searchPlaceholder: N = "Search options..."
|
|
2330
2329
|
}) => {
|
|
2331
|
-
const [
|
|
2330
|
+
const [S, R] = z(""), y = K(null);
|
|
2332
2331
|
J(() => {
|
|
2333
|
-
const g = (
|
|
2334
|
-
|
|
2332
|
+
const g = (i) => {
|
|
2333
|
+
i.key === "Escape" && r();
|
|
2335
2334
|
};
|
|
2336
|
-
return t && (document.addEventListener("keydown", g),
|
|
2337
|
-
var
|
|
2338
|
-
return (
|
|
2335
|
+
return t && (document.addEventListener("keydown", g), p && y.current && setTimeout(() => {
|
|
2336
|
+
var i;
|
|
2337
|
+
return (i = y.current) == null ? void 0 : i.focus();
|
|
2339
2338
|
}, 100)), () => document.removeEventListener("keydown", g);
|
|
2340
|
-
}, [t, r,
|
|
2341
|
-
const
|
|
2342
|
-
(g) => g.label.toLowerCase().includes(
|
|
2343
|
-
) : l,
|
|
2344
|
-
n(g), r(),
|
|
2339
|
+
}, [t, r, p]);
|
|
2340
|
+
const E = S ? l.filter(
|
|
2341
|
+
(g) => g.label.toLowerCase().includes(S.toLowerCase())
|
|
2342
|
+
) : l, M = (g) => {
|
|
2343
|
+
n(g), r(), R("");
|
|
2345
2344
|
};
|
|
2346
2345
|
return t ? /* @__PURE__ */ e.jsxs("div", { className: "fixed inset-0 z-[60] flex items-center justify-center p-4 animate-in fade-in duration-200", children: [
|
|
2347
2346
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2355,10 +2354,10 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2355
2354
|
/* @__PURE__ */ e.jsxs("div", { className: "flex-shrink-0 px-6 py-5 bg-gradient-to-r from-violet-50 via-indigo-50 to-violet-50 border-b border-slate-200 dark:bg-gradient-to-r dark:from-slate-700/50 dark:via-slate-800/50 dark:to-slate-700/50 dark:border-slate-700", children: [
|
|
2356
2355
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center justify-between", children: [
|
|
2357
2356
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-3", children: [
|
|
2358
|
-
|
|
2357
|
+
m && /* @__PURE__ */ e.jsx("div", { className: "w-12 h-12 rounded-xl flex items-center justify-center bg-gradient-to-br from-violet-600 to-indigo-600 shadow-lg", children: /* @__PURE__ */ e.jsx(m, { className: "w-6 h-6 text-white" }) }),
|
|
2359
2358
|
/* @__PURE__ */ e.jsxs("div", { children: [
|
|
2360
|
-
/* @__PURE__ */ e.jsx("h3", { className: "text-lg font-bold text-slate-900 dark:text-white", children:
|
|
2361
|
-
|
|
2359
|
+
/* @__PURE__ */ e.jsx("h3", { className: "text-lg font-bold text-slate-900 dark:text-white", children: h }),
|
|
2360
|
+
x && /* @__PURE__ */ e.jsx("p", { className: "text-sm text-slate-600 dark:text-slate-400 mt-0.5", children: x })
|
|
2362
2361
|
] })
|
|
2363
2362
|
] }),
|
|
2364
2363
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2370,16 +2369,16 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2370
2369
|
}
|
|
2371
2370
|
)
|
|
2372
2371
|
] }),
|
|
2373
|
-
|
|
2372
|
+
p && /* @__PURE__ */ e.jsxs("div", { className: "mt-4 relative", children: [
|
|
2374
2373
|
/* @__PURE__ */ e.jsx(le, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-slate-400 dark:text-slate-500" }),
|
|
2375
2374
|
/* @__PURE__ */ e.jsx(
|
|
2376
2375
|
"input",
|
|
2377
2376
|
{
|
|
2378
|
-
ref:
|
|
2377
|
+
ref: y,
|
|
2379
2378
|
type: "text",
|
|
2380
|
-
value:
|
|
2381
|
-
onChange: (g) =>
|
|
2382
|
-
placeholder:
|
|
2379
|
+
value: S,
|
|
2380
|
+
onChange: (g) => R(g.target.value),
|
|
2381
|
+
placeholder: N,
|
|
2383
2382
|
className: `w-full pl-11 pr-4 py-3 rounded-xl border transition-all duration-200
|
|
2384
2383
|
bg-white border-slate-200 text-slate-900 placeholder-slate-400
|
|
2385
2384
|
focus:border-violet-400 focus:bg-slate-50
|
|
@@ -2390,18 +2389,18 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2390
2389
|
)
|
|
2391
2390
|
] })
|
|
2392
2391
|
] }),
|
|
2393
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex-grow overflow-y-auto custom-scrollbar", children:
|
|
2394
|
-
const
|
|
2392
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex-grow overflow-y-auto custom-scrollbar", children: E.length > 0 ? /* @__PURE__ */ e.jsx("div", { className: "p-3 space-y-1", children: E.map((g) => {
|
|
2393
|
+
const i = g.value === c;
|
|
2395
2394
|
return /* @__PURE__ */ e.jsxs(
|
|
2396
2395
|
"button",
|
|
2397
2396
|
{
|
|
2398
2397
|
type: "button",
|
|
2399
|
-
onClick: () =>
|
|
2398
|
+
onClick: () => M(g.value),
|
|
2400
2399
|
className: `w-full px-4 py-3.5 rounded-xl text-left flex items-center justify-between transition-all duration-200 group
|
|
2401
|
-
${
|
|
2400
|
+
${i ? "bg-gradient-to-r from-violet-600 to-indigo-600 text-white shadow-lg shadow-violet-500/30 dark:shadow-violet-900/30" : "text-slate-700 hover:bg-slate-100 dark:text-slate-300 dark:hover:bg-slate-700/50"}`,
|
|
2402
2401
|
children: [
|
|
2403
2402
|
/* @__PURE__ */ e.jsx("span", { className: "font-medium", children: g.label }),
|
|
2404
|
-
|
|
2403
|
+
i && /* @__PURE__ */ e.jsx("div", { className: "w-6 h-6 rounded-full bg-white/20 flex items-center justify-center", children: /* @__PURE__ */ e.jsx(re, { className: "w-4 h-4 text-white" }) })
|
|
2405
2404
|
]
|
|
2406
2405
|
},
|
|
2407
2406
|
g.value
|
|
@@ -2412,163 +2411,163 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2412
2411
|
/* @__PURE__ */ e.jsx("p", { className: "text-xs text-slate-500 dark:text-slate-500 mt-1", children: "Try adjusting your search terms" })
|
|
2413
2412
|
] }) }),
|
|
2414
2413
|
/* @__PURE__ */ e.jsx("div", { className: "flex-shrink-0 px-6 py-3 border-t border-slate-200 dark:border-slate-700 bg-slate-50 dark:bg-slate-800/50", children: /* @__PURE__ */ e.jsxs("p", { className: "text-xs text-slate-500 dark:text-slate-400 text-center", children: [
|
|
2415
|
-
|
|
2414
|
+
E.length,
|
|
2416
2415
|
" option",
|
|
2417
|
-
|
|
2416
|
+
E.length !== 1 ? "s" : "",
|
|
2418
2417
|
" available"
|
|
2419
2418
|
] }) })
|
|
2420
2419
|
] }) })
|
|
2421
2420
|
] }) : null;
|
|
2422
|
-
},
|
|
2421
|
+
}, et = ({
|
|
2423
2422
|
value: t,
|
|
2424
2423
|
onChange: r,
|
|
2425
2424
|
options: n = [],
|
|
2426
2425
|
placeholder: l = "Select an option",
|
|
2427
|
-
label:
|
|
2428
|
-
icon:
|
|
2429
|
-
required:
|
|
2430
|
-
disabled:
|
|
2431
|
-
error:
|
|
2432
|
-
searchable:
|
|
2433
|
-
name:
|
|
2434
|
-
modalTitle:
|
|
2435
|
-
modalSubtitle:
|
|
2426
|
+
label: c,
|
|
2427
|
+
icon: h,
|
|
2428
|
+
required: x = !1,
|
|
2429
|
+
disabled: m = !1,
|
|
2430
|
+
error: p,
|
|
2431
|
+
searchable: N = !0,
|
|
2432
|
+
name: S,
|
|
2433
|
+
modalTitle: R,
|
|
2434
|
+
modalSubtitle: y
|
|
2436
2435
|
}) => {
|
|
2437
|
-
const [
|
|
2438
|
-
r(
|
|
2436
|
+
const [E, M] = z(!1), g = n.find((D) => D.value === t), i = (g == null ? void 0 : g.label) || l, j = (D) => {
|
|
2437
|
+
r(S, D);
|
|
2439
2438
|
};
|
|
2440
2439
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2441
2440
|
/* @__PURE__ */ e.jsxs("div", { className: "space-y-2", children: [
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2441
|
+
c && /* @__PURE__ */ e.jsxs("label", { className: "flex items-center text-sm font-semibold text-slate-700 dark:text-slate-300", children: [
|
|
2442
|
+
h && /* @__PURE__ */ e.jsx(h, { className: "w-4 h-4 mr-2 text-violet-600 dark:text-violet-400" }),
|
|
2443
|
+
c,
|
|
2444
|
+
x && /* @__PURE__ */ e.jsx("span", { className: "text-red-500 ml-1", children: "*" })
|
|
2446
2445
|
] }),
|
|
2447
2446
|
/* @__PURE__ */ e.jsxs(
|
|
2448
2447
|
"button",
|
|
2449
2448
|
{
|
|
2450
2449
|
type: "button",
|
|
2451
|
-
onClick: () => !
|
|
2452
|
-
disabled:
|
|
2450
|
+
onClick: () => !m && M(!0),
|
|
2451
|
+
disabled: m,
|
|
2453
2452
|
className: `w-full px-4 py-3 rounded-xl border transition-all duration-200 flex items-center justify-between text-left
|
|
2454
|
-
${
|
|
2455
|
-
${
|
|
2453
|
+
${p ? "border-red-500 focus:border-red-500 focus:ring-red-500/20" : "border-slate-200 focus:border-violet-400 dark:border-slate-600 dark:focus:border-violet-500"}
|
|
2454
|
+
${m ? "opacity-50 cursor-not-allowed bg-slate-100 dark:bg-slate-800" : "bg-slate-50 hover:bg-white dark:bg-slate-700/50 dark:hover:bg-slate-700 cursor-pointer"}
|
|
2456
2455
|
text-slate-900 dark:text-white focus:outline-none focus:ring-2 focus:ring-violet-500/20`,
|
|
2457
2456
|
children: [
|
|
2458
2457
|
/* @__PURE__ */ e.jsx(
|
|
2459
2458
|
"span",
|
|
2460
2459
|
{
|
|
2461
2460
|
className: `text-sm ${t ? "" : "text-slate-400 dark:text-slate-500"}`,
|
|
2462
|
-
children:
|
|
2461
|
+
children: i
|
|
2463
2462
|
}
|
|
2464
2463
|
),
|
|
2465
2464
|
/* @__PURE__ */ e.jsx(se, { className: "w-5 h-5 text-slate-400 dark:text-slate-500" })
|
|
2466
2465
|
]
|
|
2467
2466
|
}
|
|
2468
2467
|
),
|
|
2469
|
-
!
|
|
2468
|
+
!p && t && /* @__PURE__ */ e.jsxs("div", { className: "flex items-center space-x-2 mt-2", children: [
|
|
2470
2469
|
/* @__PURE__ */ e.jsx("div", { className: "w-5 h-5 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center", children: /* @__PURE__ */ e.jsx(re, { className: "w-3 h-3 text-green-600 dark:text-green-400" }) }),
|
|
2471
2470
|
/* @__PURE__ */ e.jsx("span", { className: "text-xs text-green-600 dark:text-green-400 font-medium", children: "Selected" })
|
|
2472
2471
|
] }),
|
|
2473
|
-
|
|
2472
|
+
p && /* @__PURE__ */ e.jsx("p", { className: "text-xs text-red-500 flex items-center space-x-1 mt-1", children: /* @__PURE__ */ e.jsx("span", { children: p }) })
|
|
2474
2473
|
] }),
|
|
2475
2474
|
/* @__PURE__ */ e.jsx(
|
|
2476
2475
|
Fe,
|
|
2477
2476
|
{
|
|
2478
|
-
isOpen:
|
|
2479
|
-
onClose: () =>
|
|
2480
|
-
onSelect:
|
|
2477
|
+
isOpen: E,
|
|
2478
|
+
onClose: () => M(!1),
|
|
2479
|
+
onSelect: j,
|
|
2481
2480
|
options: n,
|
|
2482
2481
|
selectedValue: t,
|
|
2483
|
-
title:
|
|
2484
|
-
subtitle:
|
|
2485
|
-
icon:
|
|
2486
|
-
searchable:
|
|
2482
|
+
title: R || c || "Select Option",
|
|
2483
|
+
subtitle: y || `Choose from ${n.length} options`,
|
|
2484
|
+
icon: h,
|
|
2485
|
+
searchable: N
|
|
2487
2486
|
}
|
|
2488
2487
|
)
|
|
2489
2488
|
] });
|
|
2490
|
-
},
|
|
2489
|
+
}, tt = ({
|
|
2491
2490
|
steps: t = [],
|
|
2492
2491
|
initialData: r = {},
|
|
2493
2492
|
onSubmit: n,
|
|
2494
2493
|
onCancel: l,
|
|
2495
|
-
onEdit:
|
|
2496
|
-
onStepChange:
|
|
2497
|
-
submitButtonText:
|
|
2498
|
-
cancelButtonText:
|
|
2499
|
-
editButtonText:
|
|
2500
|
-
showEditingBadge:
|
|
2501
|
-
editingEntity:
|
|
2502
|
-
helpText:
|
|
2503
|
-
isModal:
|
|
2504
|
-
mode:
|
|
2494
|
+
onEdit: c,
|
|
2495
|
+
onStepChange: h,
|
|
2496
|
+
submitButtonText: x = "Submit",
|
|
2497
|
+
cancelButtonText: m = "Cancel",
|
|
2498
|
+
editButtonText: p = "Edit Record",
|
|
2499
|
+
showEditingBadge: N = !1,
|
|
2500
|
+
editingEntity: S = "",
|
|
2501
|
+
helpText: R = "All fields marked with * are required",
|
|
2502
|
+
isModal: y = !0,
|
|
2503
|
+
mode: E = "create"
|
|
2505
2504
|
}) => {
|
|
2506
2505
|
var s;
|
|
2507
|
-
const
|
|
2506
|
+
const M = K(null), [g, i] = z(0), [j, D] = z(
|
|
2508
2507
|
() => typeof window < "u" ? window.innerWidth >= 1024 : !0
|
|
2509
|
-
), [
|
|
2508
|
+
), [T, V] = z(() => {
|
|
2510
2509
|
const a = typeof t == "function" ? t(r) : t, o = {};
|
|
2511
|
-
return a.forEach((
|
|
2512
|
-
|
|
2513
|
-
o[
|
|
2510
|
+
return a.forEach((f) => {
|
|
2511
|
+
f.fields && f.fields.forEach((k) => {
|
|
2512
|
+
o[k.name] = r[k.name] || "";
|
|
2514
2513
|
});
|
|
2515
2514
|
}), o;
|
|
2516
|
-
}), [
|
|
2515
|
+
}), [I, Y] = z({}), [U, B] = z(/* @__PURE__ */ new Set([0])), w = E === "view", W = E === "edit", d = typeof t == "function" ? t(T) : t;
|
|
2517
2516
|
J(() => {
|
|
2518
|
-
|
|
2519
|
-
}, [g,
|
|
2517
|
+
h && h(g, T);
|
|
2518
|
+
}, [g, T, h]);
|
|
2520
2519
|
const v = () => {
|
|
2521
2520
|
var a;
|
|
2522
|
-
(a =
|
|
2523
|
-
},
|
|
2524
|
-
if (
|
|
2525
|
-
const
|
|
2526
|
-
V((
|
|
2527
|
-
const
|
|
2528
|
-
return
|
|
2529
|
-
|
|
2530
|
-
}),
|
|
2531
|
-
}),
|
|
2532
|
-
},
|
|
2533
|
-
if (
|
|
2534
|
-
const o = {},
|
|
2535
|
-
if (
|
|
2536
|
-
const
|
|
2537
|
-
Object.assign(o,
|
|
2521
|
+
(a = M.current) == null || a.scrollTo({ top: 0, behavior: "smooth" });
|
|
2522
|
+
}, C = (a, o) => {
|
|
2523
|
+
if (w) return;
|
|
2524
|
+
const k = d.flatMap((P) => P.fields || []).find((P) => P.name === a);
|
|
2525
|
+
V((P) => {
|
|
2526
|
+
const L = { ...P, [a]: o };
|
|
2527
|
+
return k != null && k.resetFieldsOnChange && k.resetFieldsOnChange.forEach((q) => {
|
|
2528
|
+
L[q] = "";
|
|
2529
|
+
}), L;
|
|
2530
|
+
}), I[a] && Y((P) => ({ ...P, [a]: "" })), k != null && k.onChange && k.onChange(a, o);
|
|
2531
|
+
}, A = (a) => {
|
|
2532
|
+
if (w) return !0;
|
|
2533
|
+
const o = {}, f = d[a];
|
|
2534
|
+
if (f.customValidator) {
|
|
2535
|
+
const k = f.customValidator(a, T);
|
|
2536
|
+
Object.assign(o, k);
|
|
2538
2537
|
}
|
|
2539
|
-
return
|
|
2540
|
-
const
|
|
2541
|
-
if (
|
|
2542
|
-
o[
|
|
2538
|
+
return f.fields && f.fields.length > 0 && f.fields.forEach((k) => {
|
|
2539
|
+
const P = T[k.name];
|
|
2540
|
+
if (k.required && !P) {
|
|
2541
|
+
o[k.name] = `${k.label} is required`;
|
|
2543
2542
|
return;
|
|
2544
2543
|
}
|
|
2545
|
-
if (
|
|
2546
|
-
const { minLength:
|
|
2547
|
-
|
|
2544
|
+
if (P && k.validation) {
|
|
2545
|
+
const { minLength: L, maxLength: q, pattern: u, min: Q, max: Z, custom: me } = k.validation;
|
|
2546
|
+
L && P.length < L && (o[k.name] = `Minimum ${L} characters required`), q && P.length > q && (o[k.name] = `Maximum ${q} characters allowed`), u && !u.test(P) && (o[k.name] = k.validation.message || "Invalid format"), Q !== void 0 && parseFloat(P) < Q && (o[k.name] = k.validation.message || `Minimum value is ${Q}`), Z !== void 0 && parseFloat(P) > Z && (o[k.name] = k.validation.message || `Maximum value is ${Z}`), me && !me(P) && (o[k.name] = k.validation.message || "Validation failed");
|
|
2548
2547
|
}
|
|
2549
2548
|
}), Y(o), Object.keys(o).length === 0;
|
|
2550
|
-
},
|
|
2551
|
-
if (a.preventDefault(), a.stopPropagation(),
|
|
2549
|
+
}, O = (a) => {
|
|
2550
|
+
if (a.preventDefault(), a.stopPropagation(), A(g)) {
|
|
2552
2551
|
const o = g + 1;
|
|
2553
|
-
|
|
2552
|
+
i(o), B((f) => /* @__PURE__ */ new Set([...f, o])), v();
|
|
2554
2553
|
}
|
|
2555
2554
|
}, b = (a) => {
|
|
2556
|
-
a.preventDefault(), a.stopPropagation(),
|
|
2555
|
+
a.preventDefault(), a.stopPropagation(), i((o) => o - 1), v();
|
|
2557
2556
|
}, $ = (a) => {
|
|
2558
|
-
if (typeof window < "u" && window.innerWidth < 1024 &&
|
|
2559
|
-
|
|
2557
|
+
if (typeof window < "u" && window.innerWidth < 1024 && D(!1), w) {
|
|
2558
|
+
i(a), B((o) => /* @__PURE__ */ new Set([...o, a])), v();
|
|
2560
2559
|
return;
|
|
2561
2560
|
}
|
|
2562
|
-
(U.has(a) || a === g + 1) && (a > g ?
|
|
2561
|
+
(U.has(a) || a === g + 1) && (a > g ? A(g) && (i(a), B((o) => /* @__PURE__ */ new Set([...o, a])), v()) : (i(a), v()));
|
|
2563
2562
|
}, F = (a) => {
|
|
2564
|
-
a.preventDefault(), !
|
|
2565
|
-
}, H = g ===
|
|
2563
|
+
a.preventDefault(), !w && A(g) && n(T);
|
|
2564
|
+
}, H = g === d.length - 1, G = g === 0;
|
|
2566
2565
|
return /* @__PURE__ */ e.jsxs("form", { onSubmit: F, className: "flex h-full overflow-hidden relative", children: [
|
|
2567
|
-
|
|
2566
|
+
j && /* @__PURE__ */ e.jsx(
|
|
2568
2567
|
"div",
|
|
2569
2568
|
{
|
|
2570
2569
|
className: "lg:hidden absolute inset-0 z-20 bg-black/40 backdrop-blur-[1px]",
|
|
2571
|
-
onClick: () =>
|
|
2570
|
+
onClick: () => D(!1)
|
|
2572
2571
|
}
|
|
2573
2572
|
),
|
|
2574
2573
|
/* @__PURE__ */ e.jsxs("div", { className: `
|
|
@@ -2576,20 +2575,20 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2576
2575
|
border-r border-slate-200 dark:border-slate-700
|
|
2577
2576
|
absolute z-30 h-full bg-white dark:bg-slate-800
|
|
2578
2577
|
lg:relative lg:flex-shrink-0 lg:z-auto lg:h-auto lg:bg-transparent dark:lg:bg-transparent
|
|
2579
|
-
${
|
|
2578
|
+
${j ? "w-52 lg:w-56" : "w-0 lg:w-10"}
|
|
2580
2579
|
`, children: [
|
|
2581
|
-
!
|
|
2582
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center gap-2 flex-1 justify-center", children:
|
|
2583
|
-
const
|
|
2580
|
+
!j && /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col h-full items-center justify-between py-4 px-2 gap-3", children: [
|
|
2581
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col items-center gap-2 flex-1 justify-center", children: d.map((a, o) => {
|
|
2582
|
+
const f = o === g, k = o < g;
|
|
2584
2583
|
return /* @__PURE__ */ e.jsx(
|
|
2585
2584
|
"button",
|
|
2586
2585
|
{
|
|
2587
2586
|
type: "button",
|
|
2588
2587
|
onClick: () => $(o),
|
|
2589
|
-
title:
|
|
2588
|
+
title: d[o].title,
|
|
2590
2589
|
className: `
|
|
2591
2590
|
rounded-full transition-all duration-300 flex-shrink-0
|
|
2592
|
-
${
|
|
2591
|
+
${k ? "w-2 h-2 bg-emerald-500 shadow-sm" : f ? w ? "w-2.5 h-2.5 bg-blue-500 shadow-md ring-2 ring-blue-300/40 dark:ring-blue-600/40" : "w-2.5 h-2.5 bg-violet-500 shadow-md ring-2 ring-violet-300/40 dark:ring-violet-600/40" : "w-2 h-2 bg-slate-300 dark:bg-slate-600 hover:bg-slate-400"}
|
|
2593
2592
|
`
|
|
2594
2593
|
},
|
|
2595
2594
|
o
|
|
@@ -2598,23 +2597,23 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2598
2597
|
/* @__PURE__ */ e.jsx("div", { className: "w-1 h-16 bg-slate-200/60 dark:bg-slate-700/60 rounded-full overflow-hidden", children: /* @__PURE__ */ e.jsx(
|
|
2599
2598
|
"div",
|
|
2600
2599
|
{
|
|
2601
|
-
className: `w-full rounded-full transition-all duration-500 ${
|
|
2602
|
-
style: { height: `${(g + 1) /
|
|
2600
|
+
className: `w-full rounded-full transition-all duration-500 ${w ? "bg-blue-500" : "bg-gradient-to-b from-violet-500 to-indigo-500"}`,
|
|
2601
|
+
style: { height: `${(g + 1) / d.length * 100}%` }
|
|
2603
2602
|
}
|
|
2604
2603
|
) })
|
|
2605
2604
|
] }),
|
|
2606
|
-
|
|
2607
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex-1 space-y-1.5 mb-4", children:
|
|
2608
|
-
const
|
|
2605
|
+
j && /* @__PURE__ */ e.jsxs("div", { className: "h-full flex flex-col px-3 sm:px-4 pt-4 pb-4 overflow-y-auto", children: [
|
|
2606
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex-1 space-y-1.5 mb-4", children: d.map((a, o) => {
|
|
2607
|
+
const f = o === g, k = (w || U.has(o)) && o < g, P = w ? !0 : U.has(o) || o === g + 1, L = a.icon;
|
|
2609
2608
|
return /* @__PURE__ */ e.jsx(
|
|
2610
2609
|
"button",
|
|
2611
2610
|
{
|
|
2612
2611
|
type: "button",
|
|
2613
|
-
onClick: () =>
|
|
2614
|
-
disabled: !
|
|
2612
|
+
onClick: () => P && $(o),
|
|
2613
|
+
disabled: !P,
|
|
2615
2614
|
className: `
|
|
2616
2615
|
w-full p-3 rounded-xl transition-all duration-200 text-left
|
|
2617
|
-
${
|
|
2616
|
+
${f ? w ? "bg-gradient-to-r from-blue-600 to-cyan-600 text-white shadow-md scale-[1.01]" : "bg-gradient-to-r from-violet-600 to-indigo-600 text-white shadow-md scale-[1.01]" : k ? "bg-white dark:bg-slate-800/50 border border-emerald-200 dark:border-emerald-500/30 hover:shadow-sm" : P ? "bg-white dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 hover:shadow-sm" : "bg-slate-100 dark:bg-slate-800/30 border border-slate-200 dark:border-slate-700 opacity-50 cursor-not-allowed"}
|
|
2618
2617
|
`,
|
|
2619
2618
|
children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2.5", children: [
|
|
2620
2619
|
/* @__PURE__ */ e.jsx(
|
|
@@ -2622,35 +2621,35 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2622
2621
|
{
|
|
2623
2622
|
className: `
|
|
2624
2623
|
w-8 h-8 rounded-lg flex items-center justify-center flex-shrink-0 transition-all
|
|
2625
|
-
${
|
|
2624
|
+
${f ? "bg-white/20" : k ? "bg-emerald-100 dark:bg-emerald-500/20" : "bg-slate-100 dark:bg-slate-700"}
|
|
2626
2625
|
`,
|
|
2627
|
-
children:
|
|
2628
|
-
|
|
2626
|
+
children: k && !f ? /* @__PURE__ */ e.jsx(_e, { className: "w-4 h-4 text-emerald-600 dark:text-emerald-400" }) : /* @__PURE__ */ e.jsx(
|
|
2627
|
+
L,
|
|
2629
2628
|
{
|
|
2630
|
-
className: `w-4 h-4 ${
|
|
2629
|
+
className: `w-4 h-4 ${f ? "text-white" : P ? w ? "text-blue-600 dark:text-blue-400" : "text-violet-600 dark:text-violet-400" : "text-slate-400 dark:text-slate-500"}`
|
|
2631
2630
|
}
|
|
2632
2631
|
)
|
|
2633
2632
|
}
|
|
2634
2633
|
),
|
|
2635
2634
|
/* @__PURE__ */ e.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
2636
2635
|
/* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-1.5 mb-0.5", children: [
|
|
2637
|
-
/* @__PURE__ */ e.jsxs("span", { className: `text-[10px] font-semibold uppercase tracking-wider ${
|
|
2638
|
-
|
|
2636
|
+
/* @__PURE__ */ e.jsxs("span", { className: `text-[10px] font-semibold uppercase tracking-wider ${f ? "text-white/70" : "text-slate-400 dark:text-slate-500"}`, children: [
|
|
2637
|
+
w ? "§" : "#",
|
|
2639
2638
|
o + 1
|
|
2640
2639
|
] }),
|
|
2641
|
-
|
|
2640
|
+
k && !f && !w && /* @__PURE__ */ e.jsx("span", { className: "inline-flex items-center px-1.5 py-0.5 rounded-full text-[10px] font-semibold bg-emerald-100 text-emerald-700 dark:bg-emerald-500/20 dark:text-emerald-400", children: "✓" })
|
|
2642
2641
|
] }),
|
|
2643
|
-
/* @__PURE__ */ e.jsx("p", { className: `text-xs font-semibold truncate leading-tight ${
|
|
2644
|
-
a.subtitle && /* @__PURE__ */ e.jsx("p", { className: `text-[10px] mt-0.5 line-clamp-1 leading-snug ${
|
|
2642
|
+
/* @__PURE__ */ e.jsx("p", { className: `text-xs font-semibold truncate leading-tight ${f ? "text-white" : k ? "text-slate-900 dark:text-white" : P ? "text-slate-700 dark:text-slate-300" : "text-slate-400 dark:text-slate-500"}`, children: a.title }),
|
|
2643
|
+
a.subtitle && /* @__PURE__ */ e.jsx("p", { className: `text-[10px] mt-0.5 line-clamp-1 leading-snug ${f ? "text-white/75" : "text-slate-400 dark:text-slate-500"}`, children: a.subtitle })
|
|
2645
2644
|
] })
|
|
2646
2645
|
] })
|
|
2647
2646
|
},
|
|
2648
2647
|
o
|
|
2649
2648
|
);
|
|
2650
2649
|
}) }),
|
|
2651
|
-
!
|
|
2650
|
+
!w && R && /* @__PURE__ */ e.jsx("div", { className: "p-3 rounded-xl bg-blue-50 border border-blue-200 dark:bg-blue-900/20 dark:border-blue-800/30 flex-shrink-0", children: /* @__PURE__ */ e.jsxs("p", { className: "text-[11px] text-slate-600 dark:text-slate-400 leading-relaxed", children: [
|
|
2652
2651
|
/* @__PURE__ */ e.jsx("span", { className: "font-semibold text-blue-600 dark:text-blue-400", children: "Tip: " }),
|
|
2653
|
-
|
|
2652
|
+
R
|
|
2654
2653
|
] }) })
|
|
2655
2654
|
] })
|
|
2656
2655
|
] }),
|
|
@@ -2662,31 +2661,31 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2662
2661
|
"button",
|
|
2663
2662
|
{
|
|
2664
2663
|
type: "button",
|
|
2665
|
-
onClick: () =>
|
|
2664
|
+
onClick: () => D(!j),
|
|
2666
2665
|
className: `p-2.5 rounded-lg border border-slate-200 dark:border-slate-600
|
|
2667
2666
|
bg-white dark:bg-slate-700 text-slate-500 dark:text-slate-400
|
|
2668
2667
|
hover:bg-violet-50 hover:border-violet-300 hover:text-violet-600
|
|
2669
2668
|
dark:hover:bg-violet-900/30 dark:hover:border-violet-600 dark:hover:text-violet-400
|
|
2670
2669
|
transition-all duration-200 active:scale-95`,
|
|
2671
2670
|
"aria-label": "Toggle steps",
|
|
2672
|
-
children:
|
|
2671
|
+
children: j ? /* @__PURE__ */ e.jsx(ie, { className: "w-4 h-4" }) : /* @__PURE__ */ e.jsx(se, { className: "w-4 h-4" })
|
|
2673
2672
|
}
|
|
2674
2673
|
),
|
|
2675
2674
|
/* @__PURE__ */ e.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
2676
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-xs font-semibold text-slate-700 dark:text-slate-300 truncate", children:
|
|
2677
|
-
/* @__PURE__ */ e.jsxs("p", { className: `text-[10px] font-medium ${
|
|
2678
|
-
|
|
2675
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-xs font-semibold text-slate-700 dark:text-slate-300 truncate", children: d[g].title }),
|
|
2676
|
+
/* @__PURE__ */ e.jsxs("p", { className: `text-[10px] font-medium ${w ? "text-blue-500" : "text-violet-500"}`, children: [
|
|
2677
|
+
w ? "Section" : "Step",
|
|
2679
2678
|
" ",
|
|
2680
2679
|
g + 1,
|
|
2681
2680
|
"/",
|
|
2682
|
-
|
|
2681
|
+
d.length
|
|
2683
2682
|
] })
|
|
2684
2683
|
] }),
|
|
2685
2684
|
/* @__PURE__ */ e.jsx("div", { className: "w-16 h-1.5 bg-slate-200 dark:bg-slate-700 rounded-full overflow-hidden flex-shrink-0", children: /* @__PURE__ */ e.jsx(
|
|
2686
2685
|
"div",
|
|
2687
2686
|
{
|
|
2688
|
-
className: `h-1.5 rounded-full transition-all duration-300 ${
|
|
2689
|
-
style: { width: `${(g + 1) /
|
|
2687
|
+
className: `h-1.5 rounded-full transition-all duration-300 ${w ? "bg-blue-500" : "bg-gradient-to-r from-violet-500 to-indigo-500"}`,
|
|
2688
|
+
style: { width: `${(g + 1) / d.length * 100}%` }
|
|
2690
2689
|
}
|
|
2691
2690
|
) })
|
|
2692
2691
|
] }),
|
|
@@ -2694,7 +2693,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2694
2693
|
"button",
|
|
2695
2694
|
{
|
|
2696
2695
|
type: "button",
|
|
2697
|
-
onClick: () =>
|
|
2696
|
+
onClick: () => D(!j),
|
|
2698
2697
|
className: `hidden lg:flex absolute left-0 top-5 -translate-x-[1.625rem] z-20
|
|
2699
2698
|
w-6 h-6 lg:w-7 lg:h-7 rounded-full
|
|
2700
2699
|
bg-white dark:bg-slate-800
|
|
@@ -2705,19 +2704,19 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2705
2704
|
hover:border-violet-300 dark:hover:border-violet-600
|
|
2706
2705
|
hover:scale-110 active:scale-95
|
|
2707
2706
|
transition-all duration-200 group`,
|
|
2708
|
-
"aria-label":
|
|
2709
|
-
children:
|
|
2707
|
+
"aria-label": j ? "Collapse steps" : "Expand steps",
|
|
2708
|
+
children: j ? /* @__PURE__ */ e.jsx(ie, { className: "w-3 h-3 lg:w-3.5 lg:h-3.5 text-slate-400 group-hover:text-violet-500 transition-colors" }) : /* @__PURE__ */ e.jsx(se, { className: "w-3 h-3 lg:w-3.5 lg:h-3.5 text-slate-400 group-hover:text-violet-500 transition-colors" })
|
|
2710
2709
|
}
|
|
2711
2710
|
),
|
|
2712
|
-
/* @__PURE__ */ e.jsx("div", { ref:
|
|
2713
|
-
|
|
2711
|
+
/* @__PURE__ */ e.jsx("div", { ref: M, className: "flex-1 min-h-0 overflow-y-auto px-3.5 sm:px-5 lg:px-6 py-4 sm:py-5", children: /* @__PURE__ */ e.jsx("div", { className: "space-y-4 sm:space-y-5 w-full", children: d[g].customRender ? w && d[g].customViewRender ? /* @__PURE__ */ e.jsx("div", { className: "w-full", children: typeof d[g].customViewRender == "function" ? d[g].customViewRender() : d[g].customViewRender }) : /* @__PURE__ */ e.jsx("div", { className: "w-full", children: typeof d[g].customRender == "function" ? d[g].customRender({ formData: T, errors: I, handleChange: C, mode: E }) : d[g].customRender }) : (s = d[g].fields) == null ? void 0 : s.map((a, o) => /* @__PURE__ */ e.jsx(
|
|
2712
|
+
we,
|
|
2714
2713
|
{
|
|
2715
2714
|
index: o,
|
|
2716
|
-
field: { ...a, disabled:
|
|
2717
|
-
value:
|
|
2718
|
-
onChange:
|
|
2719
|
-
error:
|
|
2720
|
-
mode:
|
|
2715
|
+
field: { ...a, disabled: w || a.disabled },
|
|
2716
|
+
value: T[a.name],
|
|
2717
|
+
onChange: C,
|
|
2718
|
+
error: I[a.name],
|
|
2719
|
+
mode: E
|
|
2721
2720
|
},
|
|
2722
2721
|
a.name || o
|
|
2723
2722
|
)) }) }),
|
|
@@ -2742,7 +2741,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2742
2741
|
}
|
|
2743
2742
|
),
|
|
2744
2743
|
/* @__PURE__ */ e.jsx("div", { className: "flex-1" }),
|
|
2745
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children:
|
|
2744
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-2", children: w ? /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
2746
2745
|
/* @__PURE__ */ e.jsxs(
|
|
2747
2746
|
"button",
|
|
2748
2747
|
{
|
|
@@ -2764,7 +2763,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2764
2763
|
"button",
|
|
2765
2764
|
{
|
|
2766
2765
|
type: "button",
|
|
2767
|
-
onClick:
|
|
2766
|
+
onClick: O,
|
|
2768
2767
|
className: `inline-flex items-center gap-1.5 px-3.5 py-2.5 sm:px-4 sm:py-2.5
|
|
2769
2768
|
rounded-xl text-sm font-semibold transition-all duration-200
|
|
2770
2769
|
bg-white hover:bg-slate-50 text-slate-700
|
|
@@ -2777,11 +2776,11 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2777
2776
|
]
|
|
2778
2777
|
}
|
|
2779
2778
|
),
|
|
2780
|
-
|
|
2779
|
+
c && /* @__PURE__ */ e.jsxs(
|
|
2781
2780
|
"button",
|
|
2782
2781
|
{
|
|
2783
2782
|
type: "button",
|
|
2784
|
-
onClick:
|
|
2783
|
+
onClick: c,
|
|
2785
2784
|
className: `inline-flex items-center gap-1.5 px-3.5 py-2.5 sm:px-4 sm:py-2.5
|
|
2786
2785
|
rounded-xl text-sm font-semibold transition-all duration-200
|
|
2787
2786
|
bg-gradient-to-r from-violet-600 to-indigo-600
|
|
@@ -2790,7 +2789,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2790
2789
|
hover:scale-105 active:scale-95`,
|
|
2791
2790
|
children: [
|
|
2792
2791
|
/* @__PURE__ */ e.jsx(oe, { className: "w-4 h-4 flex-shrink-0" }),
|
|
2793
|
-
/* @__PURE__ */ e.jsx("span", { className: "hidden sm:inline", children:
|
|
2792
|
+
/* @__PURE__ */ e.jsx("span", { className: "hidden sm:inline", children: p }),
|
|
2794
2793
|
/* @__PURE__ */ e.jsx("span", { className: "sm:hidden", children: "Edit" })
|
|
2795
2794
|
]
|
|
2796
2795
|
}
|
|
@@ -2812,7 +2811,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2812
2811
|
`,
|
|
2813
2812
|
children: [
|
|
2814
2813
|
/* @__PURE__ */ e.jsx(X, { className: "w-4 h-4 flex-shrink-0" }),
|
|
2815
|
-
/* @__PURE__ */ e.jsx("span", { className: "hidden sm:inline", children:
|
|
2814
|
+
/* @__PURE__ */ e.jsx("span", { className: "hidden sm:inline", children: m })
|
|
2816
2815
|
]
|
|
2817
2816
|
}
|
|
2818
2817
|
),
|
|
@@ -2828,14 +2827,14 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2828
2827
|
hover:scale-105 active:scale-95`,
|
|
2829
2828
|
children: [
|
|
2830
2829
|
/* @__PURE__ */ e.jsx(re, { className: "w-4 h-4 flex-shrink-0" }),
|
|
2831
|
-
/* @__PURE__ */ e.jsx("span", { children:
|
|
2830
|
+
/* @__PURE__ */ e.jsx("span", { children: x })
|
|
2832
2831
|
]
|
|
2833
2832
|
}
|
|
2834
2833
|
) : /* @__PURE__ */ e.jsxs(
|
|
2835
2834
|
"button",
|
|
2836
2835
|
{
|
|
2837
2836
|
type: "button",
|
|
2838
|
-
onClick:
|
|
2837
|
+
onClick: O,
|
|
2839
2838
|
className: `inline-flex items-center gap-1.5 px-3.5 py-2.5 sm:px-4 sm:py-2.5
|
|
2840
2839
|
rounded-xl text-sm font-semibold transition-all duration-200
|
|
2841
2840
|
bg-white hover:bg-slate-50 text-slate-700
|
|
@@ -2852,14 +2851,14 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2852
2851
|
] }) })
|
|
2853
2852
|
] })
|
|
2854
2853
|
] });
|
|
2855
|
-
},
|
|
2854
|
+
}, st = ({
|
|
2856
2855
|
header: t,
|
|
2857
2856
|
error: r = null,
|
|
2858
2857
|
errorDescription: n = null,
|
|
2859
2858
|
onErrorClose: l,
|
|
2860
|
-
children:
|
|
2861
|
-
loading:
|
|
2862
|
-
loadingMessage:
|
|
2859
|
+
children: c,
|
|
2860
|
+
loading: h = !1,
|
|
2861
|
+
loadingMessage: x = "Loading data..."
|
|
2863
2862
|
}) => /* @__PURE__ */ e.jsx("div", { className: "h-full w-full flex flex-col overflow-hidden p-2.5 sm:p-3.5", children: /* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-2.5 sm:gap-3 h-full overflow-hidden", children: [
|
|
2864
2863
|
t && /* @__PURE__ */ e.jsx("div", { className: "flex-shrink-0", children: t }),
|
|
2865
2864
|
r && /* @__PURE__ */ e.jsx("div", { className: `
|
|
@@ -2872,7 +2871,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2872
2871
|
flex-shrink-0 w-7 h-7 sm:w-8 sm:h-8 rounded-lg mt-0.5
|
|
2873
2872
|
bg-red-100 dark:bg-red-800/30
|
|
2874
2873
|
flex items-center justify-center
|
|
2875
|
-
`, children: /* @__PURE__ */ e.jsx(
|
|
2874
|
+
`, children: /* @__PURE__ */ e.jsx(ke, { className: "w-3.5 h-3.5 sm:w-4 sm:h-4 text-red-600 dark:text-red-400" }) }),
|
|
2876
2875
|
/* @__PURE__ */ e.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
2877
2876
|
/* @__PURE__ */ e.jsx("p", { className: "text-sm font-semibold text-red-800 dark:text-red-300 leading-snug", children: r }),
|
|
2878
2877
|
n && /* @__PURE__ */ e.jsx("p", { className: "mt-0.5 text-xs text-red-700/80 dark:text-red-400 leading-relaxed", children: n })
|
|
@@ -2891,7 +2890,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2891
2890
|
}
|
|
2892
2891
|
)
|
|
2893
2892
|
] }) }) }),
|
|
2894
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex-grow min-h-0 overflow-y-auto", children:
|
|
2893
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex-grow min-h-0 overflow-y-auto", children: h ? /* @__PURE__ */ e.jsx("div", { className: `
|
|
2895
2894
|
h-full flex items-center justify-center
|
|
2896
2895
|
rounded-xl sm:rounded-2xl border
|
|
2897
2896
|
bg-white border-slate-200/60 shadow-sm
|
|
@@ -2902,51 +2901,51 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2902
2901
|
/* @__PURE__ */ e.jsx("div", { className: `absolute inset-0 rounded-full border-[2.5px] border-transparent
|
|
2903
2902
|
border-t-violet-600 dark:border-t-violet-400 animate-spin` })
|
|
2904
2903
|
] }),
|
|
2905
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-1", children: [0, 120, 240].map((
|
|
2904
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-1", children: [0, 120, 240].map((m) => /* @__PURE__ */ e.jsx(
|
|
2906
2905
|
"span",
|
|
2907
2906
|
{
|
|
2908
2907
|
className: `w-1 h-1 rounded-full bg-gradient-to-r from-violet-500 to-indigo-500
|
|
2909
2908
|
animate-bounce`,
|
|
2910
|
-
style: { animationDelay: `${
|
|
2909
|
+
style: { animationDelay: `${m}ms` }
|
|
2911
2910
|
},
|
|
2912
|
-
|
|
2911
|
+
m
|
|
2913
2912
|
)) }),
|
|
2914
|
-
/* @__PURE__ */ e.jsx("p", { className: "text-xs font-medium text-slate-500 dark:text-slate-400", children:
|
|
2915
|
-
] }) }) :
|
|
2916
|
-
] }) }),
|
|
2913
|
+
/* @__PURE__ */ e.jsx("p", { className: "text-xs font-medium text-slate-500 dark:text-slate-400", children: x })
|
|
2914
|
+
] }) }) : c })
|
|
2915
|
+
] }) }), at = ({
|
|
2917
2916
|
message: t = "Loading...",
|
|
2918
2917
|
supportingMessage: r = !1,
|
|
2919
2918
|
title: n = "Loading Data",
|
|
2920
2919
|
className: l = "",
|
|
2921
|
-
size:
|
|
2920
|
+
size: c = "lg"
|
|
2922
2921
|
}) => {
|
|
2923
|
-
const
|
|
2922
|
+
const h = {
|
|
2924
2923
|
sm: "h-7 w-7 border-2",
|
|
2925
2924
|
md: "h-9 w-9 border-[3px]",
|
|
2926
2925
|
lg: "h-10 w-10 sm:h-12 sm:w-12 border-[3px] sm:border-[4px]",
|
|
2927
2926
|
xl: "h-12 w-12 sm:h-16 sm:w-16 border-[4px]"
|
|
2928
2927
|
};
|
|
2929
2928
|
return /* @__PURE__ */ e.jsxs("div", { className: `flex flex-col items-center justify-center h-full w-full text-center px-4 ${l}`, children: [
|
|
2930
|
-
/* @__PURE__ */ e.jsx("div", { className: `animate-spin rounded-full ${
|
|
2929
|
+
/* @__PURE__ */ e.jsx("div", { className: `animate-spin rounded-full ${h[c]}
|
|
2931
2930
|
border-slate-200 border-t-violet-500 border-r-violet-500 mb-4` }),
|
|
2932
|
-
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-1 mb-3", children: [0, 120, 240].map((
|
|
2931
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex items-center gap-1 mb-3", children: [0, 120, 240].map((x) => /* @__PURE__ */ e.jsx(
|
|
2933
2932
|
"span",
|
|
2934
2933
|
{
|
|
2935
2934
|
className: "w-1 h-1 rounded-full bg-gradient-to-r from-violet-500 to-indigo-500 animate-bounce",
|
|
2936
|
-
style: { animationDelay: `${
|
|
2935
|
+
style: { animationDelay: `${x}ms` }
|
|
2937
2936
|
},
|
|
2938
|
-
|
|
2937
|
+
x
|
|
2939
2938
|
)) }),
|
|
2940
2939
|
/* @__PURE__ */ e.jsx("h3", { className: "text-sm sm:text-base font-semibold text-slate-900 dark:text-slate-200 mb-1", children: n }),
|
|
2941
2940
|
/* @__PURE__ */ e.jsx("p", { className: "text-xs sm:text-sm text-slate-500 dark:text-slate-400 max-w-xs", children: r || t })
|
|
2942
2941
|
] });
|
|
2943
|
-
},
|
|
2942
|
+
}, rt = ({ error: t, errorDescription: r, onClose: n }) => t ? /* @__PURE__ */ e.jsx("div", { className: `mx-4 mt-3 sm:mx-5 sm:mt-4 rounded-xl border
|
|
2944
2943
|
border-red-200 bg-red-50
|
|
2945
2944
|
dark:bg-red-900/20 dark:border-red-800/50
|
|
2946
2945
|
animate-in slide-in-from-top-1 duration-200`, children: /* @__PURE__ */ e.jsx("div", { className: "px-3.5 py-3 sm:px-4", children: /* @__PURE__ */ e.jsxs("div", { className: "flex items-start gap-2.5", children: [
|
|
2947
2946
|
/* @__PURE__ */ e.jsx("div", { className: `flex-shrink-0 w-7 h-7 rounded-lg mt-0.5
|
|
2948
2947
|
bg-red-100 dark:bg-red-800/30
|
|
2949
|
-
flex items-center justify-center`, children: /* @__PURE__ */ e.jsx(
|
|
2948
|
+
flex items-center justify-center`, children: /* @__PURE__ */ e.jsx(ke, { className: "w-3.5 h-3.5 text-red-600 dark:text-red-400" }) }),
|
|
2950
2949
|
/* @__PURE__ */ e.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
2951
2950
|
/* @__PURE__ */ e.jsx("p", { className: "text-sm font-semibold text-red-800 dark:text-red-300 leading-snug", children: t }),
|
|
2952
2951
|
r && /* @__PURE__ */ e.jsx("p", { className: "mt-0.5 text-xs text-red-700/80 dark:text-red-400 leading-relaxed", children: r })
|
|
@@ -2965,7 +2964,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2965
2964
|
children: /* @__PURE__ */ e.jsx(X, { className: "w-3.5 h-3.5" })
|
|
2966
2965
|
}
|
|
2967
2966
|
)
|
|
2968
|
-
] }) }) }) : null,
|
|
2967
|
+
] }) }) }) : null, lt = ({
|
|
2969
2968
|
content: t,
|
|
2970
2969
|
className: r = "",
|
|
2971
2970
|
emptyText: n = null,
|
|
@@ -2974,7 +2973,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2974
2973
|
}) => {
|
|
2975
2974
|
if (!t || !t.replace(/<[^>]*>/g, "").trim())
|
|
2976
2975
|
return n ? /* @__PURE__ */ e.jsx("span", { className: "text-slate-400 dark:text-slate-500 text-sm italic", children: n }) : null;
|
|
2977
|
-
const
|
|
2976
|
+
const c = {
|
|
2978
2977
|
xs: "prose-xs text-xs",
|
|
2979
2978
|
sm: "prose-sm text-sm",
|
|
2980
2979
|
md: "prose-base text-base"
|
|
@@ -2983,7 +2982,7 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
2983
2982
|
"div",
|
|
2984
2983
|
{
|
|
2985
2984
|
className: `
|
|
2986
|
-
prose ${
|
|
2985
|
+
prose ${c} max-w-none
|
|
2987
2986
|
text-slate-700 dark:text-slate-300
|
|
2988
2987
|
|
|
2989
2988
|
[&>*]:my-0.5
|
|
@@ -3005,105 +3004,105 @@ const Pe = ({ user: t, onLogout: r, showEmail: n = !0 }) => {
|
|
|
3005
3004
|
}
|
|
3006
3005
|
);
|
|
3007
3006
|
};
|
|
3008
|
-
let
|
|
3009
|
-
const
|
|
3007
|
+
let _ = null;
|
|
3008
|
+
const ot = ({
|
|
3010
3009
|
items: t = [],
|
|
3011
3010
|
onReorder: r,
|
|
3012
3011
|
onDropFrom: n,
|
|
3013
3012
|
onDropTo: l,
|
|
3014
|
-
listId:
|
|
3015
|
-
disabled:
|
|
3016
|
-
renderItem:
|
|
3017
|
-
className:
|
|
3018
|
-
dropZoneClassName:
|
|
3019
|
-
activeDropZoneClassName:
|
|
3020
|
-
children:
|
|
3021
|
-
footer:
|
|
3013
|
+
listId: c = "default",
|
|
3014
|
+
disabled: h = !1,
|
|
3015
|
+
renderItem: x,
|
|
3016
|
+
className: m = "",
|
|
3017
|
+
dropZoneClassName: p = "",
|
|
3018
|
+
activeDropZoneClassName: N = "",
|
|
3019
|
+
children: S,
|
|
3020
|
+
footer: R = null
|
|
3022
3021
|
}) => {
|
|
3023
|
-
const
|
|
3022
|
+
const y = K(null), [E, M] = z(null), [g, i] = z(!1), [j, D] = z(null);
|
|
3024
3023
|
J(() => {
|
|
3025
|
-
const
|
|
3026
|
-
|
|
3024
|
+
const d = () => {
|
|
3025
|
+
_ && (_ = null, D(null), M(null), i(!1), y.current = null);
|
|
3027
3026
|
};
|
|
3028
|
-
return document.addEventListener("dragend",
|
|
3027
|
+
return document.addEventListener("dragend", d), () => document.removeEventListener("dragend", d);
|
|
3029
3028
|
}, []);
|
|
3030
|
-
const
|
|
3031
|
-
|
|
3032
|
-
}, V = (
|
|
3033
|
-
|
|
3034
|
-
},
|
|
3035
|
-
|
|
3036
|
-
}, Y = (
|
|
3037
|
-
|
|
3038
|
-
}, U = (
|
|
3039
|
-
|
|
3040
|
-
}, B = (
|
|
3041
|
-
if (
|
|
3042
|
-
if (
|
|
3043
|
-
const
|
|
3044
|
-
if (
|
|
3045
|
-
|
|
3029
|
+
const T = (d, v) => {
|
|
3030
|
+
y.current = v, D(t[v].id), _ = { listId: c, index: v, item: t[v] }, d.dataTransfer.effectAllowed = "move";
|
|
3031
|
+
}, V = (d, v) => {
|
|
3032
|
+
d.preventDefault(), (_ == null ? void 0 : _.listId) === c && M(v);
|
|
3033
|
+
}, I = () => {
|
|
3034
|
+
y.current = null, D(null), M(null), i(!1), _ = null;
|
|
3035
|
+
}, Y = (d) => {
|
|
3036
|
+
d.preventDefault(), !h && (_ == null ? void 0 : _.listId) !== c && i(!0);
|
|
3037
|
+
}, U = (d) => {
|
|
3038
|
+
d.currentTarget.contains(d.relatedTarget) || (i(!1), (_ == null ? void 0 : _.listId) === c && M(null));
|
|
3039
|
+
}, B = (d, v) => {
|
|
3040
|
+
if (d.preventDefault(), d.stopPropagation(), !!_) {
|
|
3041
|
+
if (_.listId === c) {
|
|
3042
|
+
const C = y.current;
|
|
3043
|
+
if (C === v) {
|
|
3044
|
+
I();
|
|
3046
3045
|
return;
|
|
3047
3046
|
}
|
|
3048
|
-
const
|
|
3049
|
-
|
|
3047
|
+
const A = [...t], [O] = A.splice(C, 1);
|
|
3048
|
+
A.splice(v, 0, O), r == null || r(A);
|
|
3050
3049
|
} else
|
|
3051
|
-
n == null || n({ item:
|
|
3052
|
-
|
|
3050
|
+
n == null || n({ item: _.item, fromListId: _.listId, toIndex: v }), l == null || l({ item: _.item, fromIndex: _.index });
|
|
3051
|
+
I();
|
|
3053
3052
|
}
|
|
3054
|
-
},
|
|
3055
|
-
if (
|
|
3056
|
-
if (
|
|
3057
|
-
|
|
3053
|
+
}, w = (d) => {
|
|
3054
|
+
if (d.preventDefault(), !!_) {
|
|
3055
|
+
if (_.listId === c) {
|
|
3056
|
+
I();
|
|
3058
3057
|
return;
|
|
3059
3058
|
}
|
|
3060
|
-
n == null || n({ item:
|
|
3059
|
+
n == null || n({ item: _.item, fromListId: _.listId, toIndex: t.length }), l == null || l({ item: _.item, fromIndex: _.index }), I();
|
|
3061
3060
|
}
|
|
3062
|
-
}, W = g && !
|
|
3061
|
+
}, W = g && !h && (_ == null ? void 0 : _.listId) !== c;
|
|
3063
3062
|
return /* @__PURE__ */ e.jsxs(
|
|
3064
3063
|
"div",
|
|
3065
3064
|
{
|
|
3066
|
-
className: `${
|
|
3067
|
-
onDragOver:
|
|
3068
|
-
onDragLeave:
|
|
3069
|
-
onDrop:
|
|
3065
|
+
className: `${p} ${W ? N : ""} ${m}`,
|
|
3066
|
+
onDragOver: h ? void 0 : Y,
|
|
3067
|
+
onDragLeave: h ? void 0 : U,
|
|
3068
|
+
onDrop: h ? void 0 : w,
|
|
3070
3069
|
children: [
|
|
3071
|
-
t.length === 0 ?
|
|
3072
|
-
const
|
|
3073
|
-
return
|
|
3070
|
+
t.length === 0 ? S : t.map((d, v) => {
|
|
3071
|
+
const C = j === d.id, A = (_ == null ? void 0 : _.listId) === c && E === v && j !== d.id;
|
|
3072
|
+
return x(d, v, h ? {} : {
|
|
3074
3073
|
draggable: !0,
|
|
3075
|
-
onDragStart: (b) =>
|
|
3074
|
+
onDragStart: (b) => T(b, v),
|
|
3076
3075
|
onDragEnter: (b) => V(b, v),
|
|
3077
|
-
onDragEnd:
|
|
3076
|
+
onDragEnd: I,
|
|
3078
3077
|
onDrop: (b) => B(b, v)
|
|
3079
|
-
},
|
|
3078
|
+
}, C, A);
|
|
3080
3079
|
}),
|
|
3081
|
-
|
|
3080
|
+
R
|
|
3082
3081
|
]
|
|
3083
3082
|
}
|
|
3084
3083
|
);
|
|
3085
3084
|
};
|
|
3086
3085
|
export {
|
|
3087
|
-
|
|
3088
|
-
|
|
3089
|
-
|
|
3090
|
-
|
|
3091
|
-
|
|
3092
|
-
|
|
3093
|
-
|
|
3094
|
-
|
|
3095
|
-
|
|
3096
|
-
|
|
3097
|
-
|
|
3098
|
-
|
|
3099
|
-
|
|
3100
|
-
|
|
3101
|
-
|
|
3102
|
-
|
|
3103
|
-
|
|
3086
|
+
Qe as ActionButton,
|
|
3087
|
+
Xe as DataTable,
|
|
3088
|
+
ot as DragDropList,
|
|
3089
|
+
Ke as DynamicForm,
|
|
3090
|
+
tt as DynamicFormMultiStep,
|
|
3091
|
+
Be as Footer,
|
|
3092
|
+
we as FormField,
|
|
3093
|
+
lt as HtmlContent,
|
|
3094
|
+
qe as IconButton,
|
|
3095
|
+
at as Loader,
|
|
3096
|
+
st as ManagerLayout,
|
|
3097
|
+
Ze as Modal,
|
|
3098
|
+
rt as ModalErrorAlert,
|
|
3099
|
+
He as Navbar,
|
|
3100
|
+
Ue as PageHeader,
|
|
3101
|
+
Ge as PrimaryButton,
|
|
3102
|
+
Je as SearchInput,
|
|
3104
3103
|
Fe as SelectModal,
|
|
3105
|
-
|
|
3106
|
-
|
|
3107
|
-
|
|
3108
|
-
|
|
3104
|
+
et as SelectModalField,
|
|
3105
|
+
Ye as Sidebar,
|
|
3106
|
+
Pe as Toggle,
|
|
3107
|
+
Ae as UserMenu
|
|
3109
3108
|
};
|