@neuctra/authix 1.2.2 → 1.2.4
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/neuctra-authix.es.js +605 -597
- package/dist/neuctra-authix.umd.js +51 -51
- package/dist/react/SignedIn.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import Ce, { forwardRef as zt, createElement as Ke, createContext as cr, useContext as dr, useState as P, useEffect as ee, useRef as dt } from "react";
|
|
2
2
|
function At(t, e) {
|
|
3
3
|
return function() {
|
|
4
4
|
return t.apply(e, arguments);
|
|
@@ -8,7 +8,7 @@ const { toString: ur } = Object.prototype, { getPrototypeOf: rt } = Object, { it
|
|
|
8
8
|
const n = ur.call(e);
|
|
9
9
|
return t[n] || (t[n] = n.slice(8, -1).toLowerCase());
|
|
10
10
|
})(/* @__PURE__ */ Object.create(null)), ae = (t) => (t = t.toLowerCase(), (e) => Le(e) === t), qe = (t) => (e) => typeof e === t, { isArray: je } = Array, be = qe("undefined");
|
|
11
|
-
function
|
|
11
|
+
function Te(t) {
|
|
12
12
|
return t !== null && !be(t) && t.constructor !== null && !be(t.constructor) && te(t.constructor.isBuffer) && t.constructor.isBuffer(t);
|
|
13
13
|
}
|
|
14
14
|
const Ut = ae("ArrayBuffer");
|
|
@@ -22,7 +22,7 @@ const fr = qe("string"), te = qe("function"), $t = qe("number"), Re = (t) => t !
|
|
|
22
22
|
const e = rt(t);
|
|
23
23
|
return (e === null || e === Object.prototype || Object.getPrototypeOf(e) === null) && !(_t in t) && !(Fe in t);
|
|
24
24
|
}, hr = (t) => {
|
|
25
|
-
if (!Re(t) ||
|
|
25
|
+
if (!Re(t) || Te(t))
|
|
26
26
|
return !1;
|
|
27
27
|
try {
|
|
28
28
|
return Object.keys(t).length === 0 && Object.getPrototypeOf(t) === Object.prototype;
|
|
@@ -33,7 +33,7 @@ const fr = qe("string"), te = qe("function"), $t = qe("number"), Re = (t) => t !
|
|
|
33
33
|
let e;
|
|
34
34
|
return t && (typeof FormData == "function" && t instanceof FormData || te(t.append) && ((e = Le(t)) === "formdata" || // detect form-data instance
|
|
35
35
|
e === "object" && te(t.toString) && t.toString() === "[object FormData]"));
|
|
36
|
-
}, vr = ae("URLSearchParams"), [Sr,
|
|
36
|
+
}, vr = ae("URLSearchParams"), [Sr, kr, Er, Cr] = ["ReadableStream", "Request", "Response", "Headers"].map(ae), Tr = (t) => t.trim ? t.trim() : t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, "");
|
|
37
37
|
function Pe(t, e, { allOwnKeys: n = !1 } = {}) {
|
|
38
38
|
if (t === null || typeof t > "u")
|
|
39
39
|
return;
|
|
@@ -42,7 +42,7 @@ function Pe(t, e, { allOwnKeys: n = !1 } = {}) {
|
|
|
42
42
|
for (s = 0, i = t.length; s < i; s++)
|
|
43
43
|
e.call(null, t[s], s, t);
|
|
44
44
|
else {
|
|
45
|
-
if (
|
|
45
|
+
if (Te(t))
|
|
46
46
|
return;
|
|
47
47
|
const a = n ? Object.getOwnPropertyNames(t) : Object.keys(t), o = a.length;
|
|
48
48
|
let c;
|
|
@@ -51,7 +51,7 @@ function Pe(t, e, { allOwnKeys: n = !1 } = {}) {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
function Dt(t, e) {
|
|
54
|
-
if (
|
|
54
|
+
if (Te(t))
|
|
55
55
|
return null;
|
|
56
56
|
e = e.toLowerCase();
|
|
57
57
|
const n = Object.keys(t);
|
|
@@ -61,7 +61,7 @@ function Dt(t, e) {
|
|
|
61
61
|
return i;
|
|
62
62
|
return null;
|
|
63
63
|
}
|
|
64
|
-
const
|
|
64
|
+
const xe = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, Nt = (t) => !be(t) && t !== xe;
|
|
65
65
|
function Ge() {
|
|
66
66
|
const { caseless: t, skipUndefined: e } = Nt(this) && this || {}, n = {}, s = (i, a) => {
|
|
67
67
|
const o = t && Dt(n, a) || a;
|
|
@@ -156,7 +156,7 @@ const Hr = (t) => {
|
|
|
156
156
|
if (Re(s)) {
|
|
157
157
|
if (e.indexOf(s) >= 0)
|
|
158
158
|
return;
|
|
159
|
-
if (
|
|
159
|
+
if (Te(s))
|
|
160
160
|
return s;
|
|
161
161
|
if (!("toJSON" in s)) {
|
|
162
162
|
e[i] = s;
|
|
@@ -170,17 +170,17 @@ const Hr = (t) => {
|
|
|
170
170
|
return s;
|
|
171
171
|
};
|
|
172
172
|
return n(t, 0);
|
|
173
|
-
}, Vr = ae("AsyncFunction"), Yr = (t) => t && (Re(t) || te(t)) && te(t.then) && te(t.catch), Lt = ((t, e) => t ? setImmediate : e ? ((n, s) => (
|
|
174
|
-
i ===
|
|
173
|
+
}, Vr = ae("AsyncFunction"), Yr = (t) => t && (Re(t) || te(t)) && te(t.then) && te(t.catch), Lt = ((t, e) => t ? setImmediate : e ? ((n, s) => (xe.addEventListener("message", ({ source: i, data: a }) => {
|
|
174
|
+
i === xe && a === n && s.length && s.shift()();
|
|
175
175
|
}, !1), (i) => {
|
|
176
|
-
s.push(i),
|
|
176
|
+
s.push(i), xe.postMessage(n, "*");
|
|
177
177
|
}))(`axios@${Math.random()}`, []) : (n) => setTimeout(n))(
|
|
178
178
|
typeof setImmediate == "function",
|
|
179
|
-
te(
|
|
180
|
-
), Jr = typeof queueMicrotask < "u" ? queueMicrotask.bind(
|
|
179
|
+
te(xe.postMessage)
|
|
180
|
+
), Jr = typeof queueMicrotask < "u" ? queueMicrotask.bind(xe) : typeof process < "u" && process.nextTick || Lt, Kr = (t) => t != null && te(t[Fe]), x = {
|
|
181
181
|
isArray: je,
|
|
182
182
|
isArrayBuffer: Ut,
|
|
183
|
-
isBuffer:
|
|
183
|
+
isBuffer: Te,
|
|
184
184
|
isFormData: jr,
|
|
185
185
|
isArrayBufferView: pr,
|
|
186
186
|
isString: fr,
|
|
@@ -190,9 +190,9 @@ const Hr = (t) => {
|
|
|
190
190
|
isPlainObject: _e,
|
|
191
191
|
isEmptyObject: hr,
|
|
192
192
|
isReadableStream: Sr,
|
|
193
|
-
isRequest:
|
|
194
|
-
isResponse:
|
|
195
|
-
isHeaders:
|
|
193
|
+
isRequest: kr,
|
|
194
|
+
isResponse: Er,
|
|
195
|
+
isHeaders: Cr,
|
|
196
196
|
isUndefined: be,
|
|
197
197
|
isDate: mr,
|
|
198
198
|
isFile: gr,
|
|
@@ -206,7 +206,7 @@ const Hr = (t) => {
|
|
|
206
206
|
forEach: Pe,
|
|
207
207
|
merge: Ge,
|
|
208
208
|
extend: Rr,
|
|
209
|
-
trim:
|
|
209
|
+
trim: Tr,
|
|
210
210
|
stripBOM: Pr,
|
|
211
211
|
inherits: Or,
|
|
212
212
|
toFlatObject: Ir,
|
|
@@ -227,7 +227,7 @@ const Hr = (t) => {
|
|
|
227
227
|
noop: Mr,
|
|
228
228
|
toFiniteNumber: Wr,
|
|
229
229
|
findKey: Dt,
|
|
230
|
-
global:
|
|
230
|
+
global: xe,
|
|
231
231
|
isContextDefined: Nt,
|
|
232
232
|
isSpecCompliantForm: Br,
|
|
233
233
|
toJSONObject: Hr,
|
|
@@ -240,7 +240,7 @@ const Hr = (t) => {
|
|
|
240
240
|
function $(t, e, n, s, i) {
|
|
241
241
|
Error.call(this), Error.captureStackTrace ? Error.captureStackTrace(this, this.constructor) : this.stack = new Error().stack, this.message = t, this.name = "AxiosError", e && (this.code = e), n && (this.config = n), s && (this.request = s), i && (this.response = i, this.status = i.status ? i.status : null);
|
|
242
242
|
}
|
|
243
|
-
|
|
243
|
+
x.inherits($, Error, {
|
|
244
244
|
toJSON: function() {
|
|
245
245
|
return {
|
|
246
246
|
// Standard
|
|
@@ -255,7 +255,7 @@ f.inherits($, Error, {
|
|
|
255
255
|
columnNumber: this.columnNumber,
|
|
256
256
|
stack: this.stack,
|
|
257
257
|
// Axios
|
|
258
|
-
config:
|
|
258
|
+
config: x.toJSONObject(this.config),
|
|
259
259
|
code: this.code,
|
|
260
260
|
status: this.status
|
|
261
261
|
};
|
|
@@ -283,18 +283,18 @@ Object.defineProperties($, Mt);
|
|
|
283
283
|
Object.defineProperty(qt, "isAxiosError", { value: !0 });
|
|
284
284
|
$.from = (t, e, n, s, i, a) => {
|
|
285
285
|
const o = Object.create(qt);
|
|
286
|
-
|
|
287
|
-
return
|
|
288
|
-
}, (
|
|
286
|
+
x.toFlatObject(t, o, function(p) {
|
|
287
|
+
return p !== Error.prototype;
|
|
288
|
+
}, (f) => f !== "isAxiosError");
|
|
289
289
|
const c = t && t.message ? t.message : "Error", d = e == null && t ? t.code : e;
|
|
290
290
|
return $.call(o, c, d, n, s, i), t && o.cause == null && Object.defineProperty(o, "cause", { value: t, configurable: !0 }), o.name = t && t.name || "Error", a && Object.assign(o, a), o;
|
|
291
291
|
};
|
|
292
292
|
const Gr = null;
|
|
293
293
|
function Xe(t) {
|
|
294
|
-
return
|
|
294
|
+
return x.isPlainObject(t) || x.isArray(t);
|
|
295
295
|
}
|
|
296
296
|
function Wt(t) {
|
|
297
|
-
return
|
|
297
|
+
return x.endsWith(t, "[]") ? t.slice(0, -2) : t;
|
|
298
298
|
}
|
|
299
299
|
function pt(t, e, n) {
|
|
300
300
|
return t ? t.concat(e).map(function(i, a) {
|
|
@@ -302,73 +302,73 @@ function pt(t, e, n) {
|
|
|
302
302
|
}).join(n ? "." : "") : e;
|
|
303
303
|
}
|
|
304
304
|
function Xr(t) {
|
|
305
|
-
return
|
|
305
|
+
return x.isArray(t) && !t.some(Xe);
|
|
306
306
|
}
|
|
307
|
-
const Zr =
|
|
307
|
+
const Zr = x.toFlatObject(x, {}, null, function(e) {
|
|
308
308
|
return /^is[A-Z]/.test(e);
|
|
309
309
|
});
|
|
310
310
|
function Me(t, e, n) {
|
|
311
|
-
if (!
|
|
311
|
+
if (!x.isObject(t))
|
|
312
312
|
throw new TypeError("target must be an object");
|
|
313
|
-
e = e || new FormData(), n =
|
|
313
|
+
e = e || new FormData(), n = x.toFlatObject(n, {
|
|
314
314
|
metaTokens: !0,
|
|
315
315
|
dots: !1,
|
|
316
316
|
indexes: !1
|
|
317
317
|
}, !1, function(w, h) {
|
|
318
|
-
return !
|
|
318
|
+
return !x.isUndefined(h[w]);
|
|
319
319
|
});
|
|
320
|
-
const s = n.metaTokens, i = n.visitor ||
|
|
321
|
-
if (!
|
|
320
|
+
const s = n.metaTokens, i = n.visitor || p, a = n.dots, o = n.indexes, d = (n.Blob || typeof Blob < "u" && Blob) && x.isSpecCompliantForm(e);
|
|
321
|
+
if (!x.isFunction(i))
|
|
322
322
|
throw new TypeError("visitor must be a function");
|
|
323
|
-
function u
|
|
324
|
-
if (
|
|
325
|
-
if (
|
|
326
|
-
return
|
|
327
|
-
if (
|
|
328
|
-
return
|
|
329
|
-
if (!d &&
|
|
323
|
+
function f(u) {
|
|
324
|
+
if (u === null) return "";
|
|
325
|
+
if (x.isDate(u))
|
|
326
|
+
return u.toISOString();
|
|
327
|
+
if (x.isBoolean(u))
|
|
328
|
+
return u.toString();
|
|
329
|
+
if (!d && x.isBlob(u))
|
|
330
330
|
throw new $("Blob is not supported. Use a Buffer instead.");
|
|
331
|
-
return
|
|
331
|
+
return x.isArrayBuffer(u) || x.isTypedArray(u) ? d && typeof Blob == "function" ? new Blob([u]) : Buffer.from(u) : u;
|
|
332
332
|
}
|
|
333
|
-
function
|
|
334
|
-
let O =
|
|
335
|
-
if (
|
|
336
|
-
if (
|
|
337
|
-
w = s ? w : w.slice(0, -2),
|
|
338
|
-
else if (
|
|
333
|
+
function p(u, w, h) {
|
|
334
|
+
let O = u;
|
|
335
|
+
if (u && !h && typeof u == "object") {
|
|
336
|
+
if (x.endsWith(w, "{}"))
|
|
337
|
+
w = s ? w : w.slice(0, -2), u = JSON.stringify(u);
|
|
338
|
+
else if (x.isArray(u) && Xr(u) || (x.isFileList(u) || x.endsWith(w, "[]")) && (O = x.toArray(u)))
|
|
339
339
|
return w = Wt(w), O.forEach(function(g, A) {
|
|
340
|
-
!(
|
|
340
|
+
!(x.isUndefined(g) || g === null) && e.append(
|
|
341
341
|
// eslint-disable-next-line no-nested-ternary
|
|
342
342
|
o === !0 ? pt([w], A, a) : o === null ? w : w + "[]",
|
|
343
|
-
|
|
343
|
+
f(g)
|
|
344
344
|
);
|
|
345
345
|
}), !1;
|
|
346
346
|
}
|
|
347
|
-
return Xe(
|
|
347
|
+
return Xe(u) ? !0 : (e.append(pt(h, w, a), f(u)), !1);
|
|
348
348
|
}
|
|
349
|
-
const y = [],
|
|
350
|
-
defaultVisitor:
|
|
351
|
-
convertValue:
|
|
349
|
+
const y = [], k = Object.assign(Zr, {
|
|
350
|
+
defaultVisitor: p,
|
|
351
|
+
convertValue: f,
|
|
352
352
|
isVisitable: Xe
|
|
353
353
|
});
|
|
354
|
-
function
|
|
355
|
-
if (!
|
|
356
|
-
if (y.indexOf(
|
|
354
|
+
function E(u, w) {
|
|
355
|
+
if (!x.isUndefined(u)) {
|
|
356
|
+
if (y.indexOf(u) !== -1)
|
|
357
357
|
throw Error("Circular reference detected in " + w.join("."));
|
|
358
|
-
y.push(
|
|
359
|
-
(!(
|
|
358
|
+
y.push(u), x.forEach(u, function(O, C) {
|
|
359
|
+
(!(x.isUndefined(O) || O === null) && i.call(
|
|
360
360
|
e,
|
|
361
361
|
O,
|
|
362
|
-
|
|
362
|
+
x.isString(C) ? C.trim() : C,
|
|
363
363
|
w,
|
|
364
|
-
|
|
365
|
-
)) === !0 &&
|
|
364
|
+
k
|
|
365
|
+
)) === !0 && E(O, w ? w.concat(C) : [C]);
|
|
366
366
|
}), y.pop();
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
|
-
if (!
|
|
369
|
+
if (!x.isObject(t))
|
|
370
370
|
throw new TypeError("data must be an object");
|
|
371
|
-
return
|
|
371
|
+
return E(t), e;
|
|
372
372
|
}
|
|
373
373
|
function ft(t) {
|
|
374
374
|
const e = {
|
|
@@ -406,12 +406,12 @@ function Ht(t, e, n) {
|
|
|
406
406
|
if (!e)
|
|
407
407
|
return t;
|
|
408
408
|
const s = n && n.encode || Qr;
|
|
409
|
-
|
|
409
|
+
x.isFunction(n) && (n = {
|
|
410
410
|
serialize: n
|
|
411
411
|
});
|
|
412
412
|
const i = n && n.serialize;
|
|
413
413
|
let a;
|
|
414
|
-
if (i ? a = i(e, n) : a =
|
|
414
|
+
if (i ? a = i(e, n) : a = x.isURLSearchParams(e) ? e.toString() : new nt(e, n).toString(s), a) {
|
|
415
415
|
const o = t.indexOf("#");
|
|
416
416
|
o !== -1 && (t = t.slice(0, o)), t += (t.indexOf("?") === -1 ? "?" : "&") + a;
|
|
417
417
|
}
|
|
@@ -466,7 +466,7 @@ class xt {
|
|
|
466
466
|
* @returns {void}
|
|
467
467
|
*/
|
|
468
468
|
forEach(e) {
|
|
469
|
-
|
|
469
|
+
x.forEach(this.handlers, function(s) {
|
|
470
470
|
s !== null && e(s);
|
|
471
471
|
});
|
|
472
472
|
}
|
|
@@ -498,13 +498,13 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", on
|
|
|
498
498
|
function cn(t, e) {
|
|
499
499
|
return Me(t, new Q.classes.URLSearchParams(), {
|
|
500
500
|
visitor: function(n, s, i, a) {
|
|
501
|
-
return Q.isNode &&
|
|
501
|
+
return Q.isNode && x.isBuffer(n) ? (this.append(s, n.toString("base64")), !1) : a.defaultVisitor.apply(this, arguments);
|
|
502
502
|
},
|
|
503
503
|
...e
|
|
504
504
|
});
|
|
505
505
|
}
|
|
506
506
|
function dn(t) {
|
|
507
|
-
return
|
|
507
|
+
return x.matchAll(/\w+|\[(\w*)]/g, t).map((e) => e[0] === "[]" ? "" : e[1] || e[0]);
|
|
508
508
|
}
|
|
509
509
|
function un(t) {
|
|
510
510
|
const e = {}, n = Object.keys(t);
|
|
@@ -520,20 +520,20 @@ function Yt(t) {
|
|
|
520
520
|
let o = n[a++];
|
|
521
521
|
if (o === "__proto__") return !0;
|
|
522
522
|
const c = Number.isFinite(+o), d = a >= n.length;
|
|
523
|
-
return o = !o &&
|
|
523
|
+
return o = !o && x.isArray(i) ? i.length : o, d ? (x.hasOwnProp(i, o) ? i[o] = [i[o], s] : i[o] = s, !c) : ((!i[o] || !x.isObject(i[o])) && (i[o] = []), e(n, s, i[o], a) && x.isArray(i[o]) && (i[o] = un(i[o])), !c);
|
|
524
524
|
}
|
|
525
|
-
if (
|
|
525
|
+
if (x.isFormData(t) && x.isFunction(t.entries)) {
|
|
526
526
|
const n = {};
|
|
527
|
-
return
|
|
527
|
+
return x.forEachEntry(t, (s, i) => {
|
|
528
528
|
e(dn(s), i, n, 0);
|
|
529
529
|
}), n;
|
|
530
530
|
}
|
|
531
531
|
return null;
|
|
532
532
|
}
|
|
533
533
|
function pn(t, e, n) {
|
|
534
|
-
if (
|
|
534
|
+
if (x.isString(t))
|
|
535
535
|
try {
|
|
536
|
-
return (e || JSON.parse)(t),
|
|
536
|
+
return (e || JSON.parse)(t), x.trim(t);
|
|
537
537
|
} catch (s) {
|
|
538
538
|
if (s.name !== "SyntaxError")
|
|
539
539
|
throw s;
|
|
@@ -544,20 +544,20 @@ const Oe = {
|
|
|
544
544
|
transitional: Vt,
|
|
545
545
|
adapter: ["xhr", "http", "fetch"],
|
|
546
546
|
transformRequest: [function(e, n) {
|
|
547
|
-
const s = n.getContentType() || "", i = s.indexOf("application/json") > -1, a =
|
|
548
|
-
if (a &&
|
|
547
|
+
const s = n.getContentType() || "", i = s.indexOf("application/json") > -1, a = x.isObject(e);
|
|
548
|
+
if (a && x.isHTMLForm(e) && (e = new FormData(e)), x.isFormData(e))
|
|
549
549
|
return i ? JSON.stringify(Yt(e)) : e;
|
|
550
|
-
if (
|
|
550
|
+
if (x.isArrayBuffer(e) || x.isBuffer(e) || x.isStream(e) || x.isFile(e) || x.isBlob(e) || x.isReadableStream(e))
|
|
551
551
|
return e;
|
|
552
|
-
if (
|
|
552
|
+
if (x.isArrayBufferView(e))
|
|
553
553
|
return e.buffer;
|
|
554
|
-
if (
|
|
554
|
+
if (x.isURLSearchParams(e))
|
|
555
555
|
return n.setContentType("application/x-www-form-urlencoded;charset=utf-8", !1), e.toString();
|
|
556
556
|
let c;
|
|
557
557
|
if (a) {
|
|
558
558
|
if (s.indexOf("application/x-www-form-urlencoded") > -1)
|
|
559
559
|
return cn(e, this.formSerializer).toString();
|
|
560
|
-
if ((c =
|
|
560
|
+
if ((c = x.isFileList(e)) || s.indexOf("multipart/form-data") > -1) {
|
|
561
561
|
const d = this.env && this.env.FormData;
|
|
562
562
|
return Me(
|
|
563
563
|
c ? { "files[]": e } : e,
|
|
@@ -570,9 +570,9 @@ const Oe = {
|
|
|
570
570
|
}],
|
|
571
571
|
transformResponse: [function(e) {
|
|
572
572
|
const n = this.transitional || Oe.transitional, s = n && n.forcedJSONParsing, i = this.responseType === "json";
|
|
573
|
-
if (
|
|
573
|
+
if (x.isResponse(e) || x.isReadableStream(e))
|
|
574
574
|
return e;
|
|
575
|
-
if (e &&
|
|
575
|
+
if (e && x.isString(e) && (s && !this.responseType || i)) {
|
|
576
576
|
const o = !(n && n.silentJSONParsing) && i;
|
|
577
577
|
try {
|
|
578
578
|
return JSON.parse(e, this.parseReviver);
|
|
@@ -606,10 +606,10 @@ const Oe = {
|
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
608
|
};
|
|
609
|
-
|
|
609
|
+
x.forEach(["delete", "get", "head", "post", "put", "patch"], (t) => {
|
|
610
610
|
Oe.headers[t] = {};
|
|
611
611
|
});
|
|
612
|
-
const fn =
|
|
612
|
+
const fn = x.toObjectSet([
|
|
613
613
|
"age",
|
|
614
614
|
"authorization",
|
|
615
615
|
"content-length",
|
|
@@ -639,7 +639,7 @@ function Se(t) {
|
|
|
639
639
|
return t && String(t).trim().toLowerCase();
|
|
640
640
|
}
|
|
641
641
|
function Ue(t) {
|
|
642
|
-
return t === !1 || t == null ? t :
|
|
642
|
+
return t === !1 || t == null ? t : x.isArray(t) ? t.map(Ue) : String(t);
|
|
643
643
|
}
|
|
644
644
|
function hn(t) {
|
|
645
645
|
const e = /* @__PURE__ */ Object.create(null), n = /([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;
|
|
@@ -650,12 +650,12 @@ function hn(t) {
|
|
|
650
650
|
}
|
|
651
651
|
const mn = (t) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());
|
|
652
652
|
function He(t, e, n, s, i) {
|
|
653
|
-
if (
|
|
653
|
+
if (x.isFunction(s))
|
|
654
654
|
return s.call(this, e, n);
|
|
655
|
-
if (i && (e = n), !!
|
|
656
|
-
if (
|
|
655
|
+
if (i && (e = n), !!x.isString(e)) {
|
|
656
|
+
if (x.isString(s))
|
|
657
657
|
return e.indexOf(s) !== -1;
|
|
658
|
-
if (
|
|
658
|
+
if (x.isRegExp(s))
|
|
659
659
|
return s.test(e);
|
|
660
660
|
}
|
|
661
661
|
}
|
|
@@ -663,7 +663,7 @@ function gn(t) {
|
|
|
663
663
|
return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g, (e, n, s) => n.toUpperCase() + s);
|
|
664
664
|
}
|
|
665
665
|
function yn(t, e) {
|
|
666
|
-
const n =
|
|
666
|
+
const n = x.toCamelCase(" " + e);
|
|
667
667
|
["get", "set", "has"].forEach((s) => {
|
|
668
668
|
Object.defineProperty(t, s + n, {
|
|
669
669
|
value: function(i, a, o) {
|
|
@@ -679,24 +679,24 @@ let re = class {
|
|
|
679
679
|
}
|
|
680
680
|
set(e, n, s) {
|
|
681
681
|
const i = this;
|
|
682
|
-
function a(c, d,
|
|
683
|
-
const
|
|
684
|
-
if (!
|
|
682
|
+
function a(c, d, f) {
|
|
683
|
+
const p = Se(d);
|
|
684
|
+
if (!p)
|
|
685
685
|
throw new Error("header name must be a non-empty string");
|
|
686
|
-
const y =
|
|
687
|
-
(!y || i[y] === void 0 ||
|
|
686
|
+
const y = x.findKey(i, p);
|
|
687
|
+
(!y || i[y] === void 0 || f === !0 || f === void 0 && i[y] !== !1) && (i[y || d] = Ue(c));
|
|
688
688
|
}
|
|
689
|
-
const o = (c, d) =>
|
|
690
|
-
if (
|
|
689
|
+
const o = (c, d) => x.forEach(c, (f, p) => a(f, p, d));
|
|
690
|
+
if (x.isPlainObject(e) || e instanceof this.constructor)
|
|
691
691
|
o(e, n);
|
|
692
|
-
else if (
|
|
692
|
+
else if (x.isString(e) && (e = e.trim()) && !mn(e))
|
|
693
693
|
o(xn(e), n);
|
|
694
|
-
else if (
|
|
695
|
-
let c = {}, d,
|
|
696
|
-
for (const
|
|
697
|
-
if (!
|
|
694
|
+
else if (x.isObject(e) && x.isIterable(e)) {
|
|
695
|
+
let c = {}, d, f;
|
|
696
|
+
for (const p of e) {
|
|
697
|
+
if (!x.isArray(p))
|
|
698
698
|
throw TypeError("Object iterator must return a key-value pair");
|
|
699
|
-
c[
|
|
699
|
+
c[f = p[0]] = (d = c[f]) ? x.isArray(d) ? [...d, p[1]] : [d, p[1]] : p[1];
|
|
700
700
|
}
|
|
701
701
|
o(c, n);
|
|
702
702
|
} else
|
|
@@ -705,16 +705,16 @@ let re = class {
|
|
|
705
705
|
}
|
|
706
706
|
get(e, n) {
|
|
707
707
|
if (e = Se(e), e) {
|
|
708
|
-
const s =
|
|
708
|
+
const s = x.findKey(this, e);
|
|
709
709
|
if (s) {
|
|
710
710
|
const i = this[s];
|
|
711
711
|
if (!n)
|
|
712
712
|
return i;
|
|
713
713
|
if (n === !0)
|
|
714
714
|
return hn(i);
|
|
715
|
-
if (
|
|
715
|
+
if (x.isFunction(n))
|
|
716
716
|
return n.call(this, i, s);
|
|
717
|
-
if (
|
|
717
|
+
if (x.isRegExp(n))
|
|
718
718
|
return n.exec(i);
|
|
719
719
|
throw new TypeError("parser must be boolean|regexp|function");
|
|
720
720
|
}
|
|
@@ -722,7 +722,7 @@ let re = class {
|
|
|
722
722
|
}
|
|
723
723
|
has(e, n) {
|
|
724
724
|
if (e = Se(e), e) {
|
|
725
|
-
const s =
|
|
725
|
+
const s = x.findKey(this, e);
|
|
726
726
|
return !!(s && this[s] !== void 0 && (!n || He(this, this[s], s, n)));
|
|
727
727
|
}
|
|
728
728
|
return !1;
|
|
@@ -732,11 +732,11 @@ let re = class {
|
|
|
732
732
|
let i = !1;
|
|
733
733
|
function a(o) {
|
|
734
734
|
if (o = Se(o), o) {
|
|
735
|
-
const c =
|
|
735
|
+
const c = x.findKey(s, o);
|
|
736
736
|
c && (!n || He(s, s[c], c, n)) && (delete s[c], i = !0);
|
|
737
737
|
}
|
|
738
738
|
}
|
|
739
|
-
return
|
|
739
|
+
return x.isArray(e) ? e.forEach(a) : a(e), i;
|
|
740
740
|
}
|
|
741
741
|
clear(e) {
|
|
742
742
|
const n = Object.keys(this);
|
|
@@ -749,8 +749,8 @@ let re = class {
|
|
|
749
749
|
}
|
|
750
750
|
normalize(e) {
|
|
751
751
|
const n = this, s = {};
|
|
752
|
-
return
|
|
753
|
-
const o =
|
|
752
|
+
return x.forEach(this, (i, a) => {
|
|
753
|
+
const o = x.findKey(s, a);
|
|
754
754
|
if (o) {
|
|
755
755
|
n[o] = Ue(i), delete n[a];
|
|
756
756
|
return;
|
|
@@ -764,8 +764,8 @@ let re = class {
|
|
|
764
764
|
}
|
|
765
765
|
toJSON(e) {
|
|
766
766
|
const n = /* @__PURE__ */ Object.create(null);
|
|
767
|
-
return
|
|
768
|
-
s != null && s !== !1 && (n[i] = e &&
|
|
767
|
+
return x.forEach(this, (s, i) => {
|
|
768
|
+
s != null && s !== !1 && (n[i] = e && x.isArray(s) ? s.join(", ") : s);
|
|
769
769
|
}), n;
|
|
770
770
|
}
|
|
771
771
|
[Symbol.iterator]() {
|
|
@@ -796,11 +796,11 @@ let re = class {
|
|
|
796
796
|
const c = Se(o);
|
|
797
797
|
s[c] || (yn(i, o), s[c] = !0);
|
|
798
798
|
}
|
|
799
|
-
return
|
|
799
|
+
return x.isArray(e) ? e.forEach(a) : a(e), this;
|
|
800
800
|
}
|
|
801
801
|
};
|
|
802
802
|
re.accessor(["Content-Type", "Content-Length", "Accept", "Accept-Encoding", "User-Agent", "Authorization"]);
|
|
803
|
-
|
|
803
|
+
x.reduceDescriptors(re.prototype, ({ value: t }, e) => {
|
|
804
804
|
let n = e[0].toUpperCase() + e.slice(1);
|
|
805
805
|
return {
|
|
806
806
|
get: () => t,
|
|
@@ -809,11 +809,11 @@ f.reduceDescriptors(re.prototype, ({ value: t }, e) => {
|
|
|
809
809
|
}
|
|
810
810
|
};
|
|
811
811
|
});
|
|
812
|
-
|
|
812
|
+
x.freezeMethods(re);
|
|
813
813
|
function Ve(t, e) {
|
|
814
814
|
const n = this || Oe, s = e || n, i = re.from(s.headers);
|
|
815
815
|
let a = s.data;
|
|
816
|
-
return
|
|
816
|
+
return x.forEach(t, function(c) {
|
|
817
817
|
a = c.call(n, a, i.normalize(), e ? e.status : void 0);
|
|
818
818
|
}), i.normalize(), a;
|
|
819
819
|
}
|
|
@@ -823,7 +823,7 @@ function Jt(t) {
|
|
|
823
823
|
function ve(t, e, n) {
|
|
824
824
|
$.call(this, t ?? "canceled", $.ERR_CANCELED, e, n), this.name = "CanceledError";
|
|
825
825
|
}
|
|
826
|
-
|
|
826
|
+
x.inherits(ve, $, {
|
|
827
827
|
__CANCEL__: !0
|
|
828
828
|
});
|
|
829
829
|
function Kt(t, e, n) {
|
|
@@ -845,25 +845,25 @@ function wn(t, e) {
|
|
|
845
845
|
const n = new Array(t), s = new Array(t);
|
|
846
846
|
let i = 0, a = 0, o;
|
|
847
847
|
return e = e !== void 0 ? e : 1e3, function(d) {
|
|
848
|
-
const
|
|
849
|
-
o || (o =
|
|
850
|
-
let y = a,
|
|
848
|
+
const f = Date.now(), p = s[a];
|
|
849
|
+
o || (o = f), n[i] = d, s[i] = f;
|
|
850
|
+
let y = a, k = 0;
|
|
851
851
|
for (; y !== i; )
|
|
852
|
-
|
|
853
|
-
if (i = (i + 1) % t, i === a && (a = (a + 1) % t),
|
|
852
|
+
k += n[y++], y = y % t;
|
|
853
|
+
if (i = (i + 1) % t, i === a && (a = (a + 1) % t), f - o < e)
|
|
854
854
|
return;
|
|
855
|
-
const
|
|
856
|
-
return
|
|
855
|
+
const E = p && f - p;
|
|
856
|
+
return E ? Math.round(k * 1e3 / E) : void 0;
|
|
857
857
|
};
|
|
858
858
|
}
|
|
859
859
|
function jn(t, e) {
|
|
860
860
|
let n = 0, s = 1e3 / e, i, a;
|
|
861
|
-
const o = (
|
|
862
|
-
n =
|
|
861
|
+
const o = (f, p = Date.now()) => {
|
|
862
|
+
n = p, i = null, a && (clearTimeout(a), a = null), t(...f);
|
|
863
863
|
};
|
|
864
|
-
return [(...
|
|
865
|
-
const
|
|
866
|
-
y >= s ? o(
|
|
864
|
+
return [(...f) => {
|
|
865
|
+
const p = Date.now(), y = p - n;
|
|
866
|
+
y >= s ? o(f, p) : (i = f, a || (a = setTimeout(() => {
|
|
867
867
|
a = null, o(i);
|
|
868
868
|
}, s - y)));
|
|
869
869
|
}, () => i && o(i)];
|
|
@@ -872,15 +872,15 @@ const Ne = (t, e, n = 3) => {
|
|
|
872
872
|
let s = 0;
|
|
873
873
|
const i = wn(50, 250);
|
|
874
874
|
return jn((a) => {
|
|
875
|
-
const o = a.loaded, c = a.lengthComputable ? a.total : void 0, d = o - s,
|
|
875
|
+
const o = a.loaded, c = a.lengthComputable ? a.total : void 0, d = o - s, f = i(d), p = o <= c;
|
|
876
876
|
s = o;
|
|
877
877
|
const y = {
|
|
878
878
|
loaded: o,
|
|
879
879
|
total: c,
|
|
880
880
|
progress: c ? o / c : void 0,
|
|
881
881
|
bytes: d,
|
|
882
|
-
rate:
|
|
883
|
-
estimated:
|
|
882
|
+
rate: f || void 0,
|
|
883
|
+
estimated: f && c && p ? (c - o) / f : void 0,
|
|
884
884
|
event: a,
|
|
885
885
|
lengthComputable: c != null,
|
|
886
886
|
[e ? "download" : "upload"]: !0
|
|
@@ -894,7 +894,7 @@ const Ne = (t, e, n = 3) => {
|
|
|
894
894
|
total: t,
|
|
895
895
|
loaded: s
|
|
896
896
|
}), e[1]];
|
|
897
|
-
}, gt = (t) => (...e) =>
|
|
897
|
+
}, gt = (t) => (...e) => x.asap(() => t(...e)), vn = Q.hasStandardBrowserEnv ? /* @__PURE__ */ ((t, e) => (n) => (n = new URL(n, Q.origin), t.protocol === n.protocol && t.host === n.host && (e || t.port === n.port)))(
|
|
898
898
|
new URL(Q.origin),
|
|
899
899
|
Q.navigator && /(msie|trident)/i.test(Q.navigator.userAgent)
|
|
900
900
|
) : () => !0, Sn = Q.hasStandardBrowserEnv ? (
|
|
@@ -902,7 +902,7 @@ const Ne = (t, e, n = 3) => {
|
|
|
902
902
|
{
|
|
903
903
|
write(t, e, n, s, i, a) {
|
|
904
904
|
const o = [t + "=" + encodeURIComponent(e)];
|
|
905
|
-
|
|
905
|
+
x.isNumber(n) && o.push("expires=" + new Date(n).toGMTString()), x.isString(s) && o.push("path=" + s), x.isString(i) && o.push("domain=" + i), a === !0 && o.push("secure"), document.cookie = o.join("; ");
|
|
906
906
|
},
|
|
907
907
|
read(t) {
|
|
908
908
|
const e = document.cookie.match(new RegExp("(^|;\\s*)(" + t + ")=([^;]*)"));
|
|
@@ -924,44 +924,44 @@ const Ne = (t, e, n = 3) => {
|
|
|
924
924
|
}
|
|
925
925
|
}
|
|
926
926
|
);
|
|
927
|
-
function
|
|
927
|
+
function kn(t) {
|
|
928
928
|
return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);
|
|
929
929
|
}
|
|
930
|
-
function
|
|
930
|
+
function En(t, e) {
|
|
931
931
|
return e ? t.replace(/\/?\/$/, "") + "/" + e.replace(/^\/+/, "") : t;
|
|
932
932
|
}
|
|
933
933
|
function Gt(t, e, n) {
|
|
934
|
-
let s = !
|
|
935
|
-
return t && (s || n == !1) ?
|
|
934
|
+
let s = !kn(e);
|
|
935
|
+
return t && (s || n == !1) ? En(t, e) : e;
|
|
936
936
|
}
|
|
937
937
|
const yt = (t) => t instanceof re ? { ...t } : t;
|
|
938
|
-
function
|
|
938
|
+
function me(t, e) {
|
|
939
939
|
e = e || {};
|
|
940
940
|
const n = {};
|
|
941
|
-
function s(
|
|
942
|
-
return
|
|
941
|
+
function s(f, p, y, k) {
|
|
942
|
+
return x.isPlainObject(f) && x.isPlainObject(p) ? x.merge.call({ caseless: k }, f, p) : x.isPlainObject(p) ? x.merge({}, p) : x.isArray(p) ? p.slice() : p;
|
|
943
943
|
}
|
|
944
|
-
function i(
|
|
945
|
-
if (
|
|
946
|
-
if (!
|
|
947
|
-
return s(void 0,
|
|
948
|
-
} else return s(
|
|
944
|
+
function i(f, p, y, k) {
|
|
945
|
+
if (x.isUndefined(p)) {
|
|
946
|
+
if (!x.isUndefined(f))
|
|
947
|
+
return s(void 0, f, y, k);
|
|
948
|
+
} else return s(f, p, y, k);
|
|
949
949
|
}
|
|
950
|
-
function a(
|
|
951
|
-
if (!
|
|
952
|
-
return s(void 0,
|
|
950
|
+
function a(f, p) {
|
|
951
|
+
if (!x.isUndefined(p))
|
|
952
|
+
return s(void 0, p);
|
|
953
953
|
}
|
|
954
|
-
function o(
|
|
955
|
-
if (
|
|
956
|
-
if (!
|
|
957
|
-
return s(void 0,
|
|
958
|
-
} else return s(void 0,
|
|
954
|
+
function o(f, p) {
|
|
955
|
+
if (x.isUndefined(p)) {
|
|
956
|
+
if (!x.isUndefined(f))
|
|
957
|
+
return s(void 0, f);
|
|
958
|
+
} else return s(void 0, p);
|
|
959
959
|
}
|
|
960
|
-
function c(
|
|
960
|
+
function c(f, p, y) {
|
|
961
961
|
if (y in e)
|
|
962
|
-
return s(
|
|
962
|
+
return s(f, p);
|
|
963
963
|
if (y in t)
|
|
964
|
-
return s(void 0,
|
|
964
|
+
return s(void 0, f);
|
|
965
965
|
}
|
|
966
966
|
const d = {
|
|
967
967
|
url: a,
|
|
@@ -992,42 +992,42 @@ function he(t, e) {
|
|
|
992
992
|
socketPath: o,
|
|
993
993
|
responseEncoding: o,
|
|
994
994
|
validateStatus: c,
|
|
995
|
-
headers: (
|
|
995
|
+
headers: (f, p, y) => i(yt(f), yt(p), y, !0)
|
|
996
996
|
};
|
|
997
|
-
return
|
|
998
|
-
const y = d[
|
|
999
|
-
|
|
997
|
+
return x.forEach(Object.keys({ ...t, ...e }), function(p) {
|
|
998
|
+
const y = d[p] || i, k = y(t[p], e[p], p);
|
|
999
|
+
x.isUndefined(k) && y !== c || (n[p] = k);
|
|
1000
1000
|
}), n;
|
|
1001
1001
|
}
|
|
1002
1002
|
const Xt = (t) => {
|
|
1003
|
-
const e =
|
|
1003
|
+
const e = me({}, t);
|
|
1004
1004
|
let { data: n, withXSRFToken: s, xsrfHeaderName: i, xsrfCookieName: a, headers: o, auth: c } = e;
|
|
1005
1005
|
if (e.headers = o = re.from(o), e.url = Ht(Gt(e.baseURL, e.url, e.allowAbsoluteUrls), t.params, t.paramsSerializer), c && o.set(
|
|
1006
1006
|
"Authorization",
|
|
1007
1007
|
"Basic " + btoa((c.username || "") + ":" + (c.password ? unescape(encodeURIComponent(c.password)) : ""))
|
|
1008
|
-
),
|
|
1008
|
+
), x.isFormData(n)) {
|
|
1009
1009
|
if (Q.hasStandardBrowserEnv || Q.hasStandardBrowserWebWorkerEnv)
|
|
1010
1010
|
o.setContentType(void 0);
|
|
1011
|
-
else if (
|
|
1012
|
-
const d = n.getHeaders(),
|
|
1013
|
-
Object.entries(d).forEach(([
|
|
1014
|
-
|
|
1011
|
+
else if (x.isFunction(n.getHeaders)) {
|
|
1012
|
+
const d = n.getHeaders(), f = ["content-type", "content-length"];
|
|
1013
|
+
Object.entries(d).forEach(([p, y]) => {
|
|
1014
|
+
f.includes(p.toLowerCase()) && o.set(p, y);
|
|
1015
1015
|
});
|
|
1016
1016
|
}
|
|
1017
1017
|
}
|
|
1018
|
-
if (Q.hasStandardBrowserEnv && (s &&
|
|
1018
|
+
if (Q.hasStandardBrowserEnv && (s && x.isFunction(s) && (s = s(e)), s || s !== !1 && vn(e.url))) {
|
|
1019
1019
|
const d = i && a && Sn.read(a);
|
|
1020
1020
|
d && o.set(i, d);
|
|
1021
1021
|
}
|
|
1022
1022
|
return e;
|
|
1023
|
-
},
|
|
1023
|
+
}, Cn = typeof XMLHttpRequest < "u", Tn = Cn && function(t) {
|
|
1024
1024
|
return new Promise(function(n, s) {
|
|
1025
1025
|
const i = Xt(t);
|
|
1026
1026
|
let a = i.data;
|
|
1027
1027
|
const o = re.from(i.headers).normalize();
|
|
1028
|
-
let { responseType: c, onUploadProgress: d, onDownloadProgress:
|
|
1028
|
+
let { responseType: c, onUploadProgress: d, onDownloadProgress: f } = i, p, y, k, E, u;
|
|
1029
1029
|
function w() {
|
|
1030
|
-
|
|
1030
|
+
E && E(), u && u(), i.cancelToken && i.cancelToken.unsubscribe(p), i.signal && i.signal.removeEventListener("abort", p);
|
|
1031
1031
|
}
|
|
1032
1032
|
let h = new XMLHttpRequest();
|
|
1033
1033
|
h.open(i.method.toUpperCase(), i.url, !0), h.timeout = i.timeout;
|
|
@@ -1066,14 +1066,14 @@ const Xt = (t) => {
|
|
|
1066
1066
|
t,
|
|
1067
1067
|
h
|
|
1068
1068
|
)), h = null;
|
|
1069
|
-
}, a === void 0 && o.setContentType(null), "setRequestHeader" in h &&
|
|
1069
|
+
}, a === void 0 && o.setContentType(null), "setRequestHeader" in h && x.forEach(o.toJSON(), function(A, N) {
|
|
1070
1070
|
h.setRequestHeader(N, A);
|
|
1071
|
-
}),
|
|
1071
|
+
}), x.isUndefined(i.withCredentials) || (h.withCredentials = !!i.withCredentials), c && c !== "json" && (h.responseType = i.responseType), f && ([k, u] = Ne(f, !0), h.addEventListener("progress", k)), d && h.upload && ([y, E] = Ne(d), h.upload.addEventListener("progress", y), h.upload.addEventListener("loadend", E)), (i.cancelToken || i.signal) && (p = (g) => {
|
|
1072
1072
|
h && (s(!g || g.type ? new ve(null, t, h) : g), h.abort(), h = null);
|
|
1073
|
-
}, i.cancelToken && i.cancelToken.subscribe(
|
|
1074
|
-
const
|
|
1075
|
-
if (
|
|
1076
|
-
s(new $("Unsupported protocol " +
|
|
1073
|
+
}, i.cancelToken && i.cancelToken.subscribe(p), i.signal && (i.signal.aborted ? p() : i.signal.addEventListener("abort", p)));
|
|
1074
|
+
const C = bn(i.url);
|
|
1075
|
+
if (C && Q.protocols.indexOf(C) === -1) {
|
|
1076
|
+
s(new $("Unsupported protocol " + C + ":", $.ERR_BAD_REQUEST, t));
|
|
1077
1077
|
return;
|
|
1078
1078
|
}
|
|
1079
1079
|
h.send(a || null);
|
|
@@ -1082,24 +1082,24 @@ const Xt = (t) => {
|
|
|
1082
1082
|
const { length: n } = t = t ? t.filter(Boolean) : [];
|
|
1083
1083
|
if (e || n) {
|
|
1084
1084
|
let s = new AbortController(), i;
|
|
1085
|
-
const a = function(
|
|
1085
|
+
const a = function(f) {
|
|
1086
1086
|
if (!i) {
|
|
1087
1087
|
i = !0, c();
|
|
1088
|
-
const
|
|
1089
|
-
s.abort(
|
|
1088
|
+
const p = f instanceof Error ? f : this.reason;
|
|
1089
|
+
s.abort(p instanceof $ ? p : new ve(p instanceof Error ? p.message : p));
|
|
1090
1090
|
}
|
|
1091
1091
|
};
|
|
1092
1092
|
let o = e && setTimeout(() => {
|
|
1093
1093
|
o = null, a(new $(`timeout ${e} of ms exceeded`, $.ETIMEDOUT));
|
|
1094
1094
|
}, e);
|
|
1095
1095
|
const c = () => {
|
|
1096
|
-
t && (o && clearTimeout(o), o = null, t.forEach((
|
|
1097
|
-
|
|
1096
|
+
t && (o && clearTimeout(o), o = null, t.forEach((f) => {
|
|
1097
|
+
f.unsubscribe ? f.unsubscribe(a) : f.removeEventListener("abort", a);
|
|
1098
1098
|
}), t = null);
|
|
1099
1099
|
};
|
|
1100
|
-
t.forEach((
|
|
1100
|
+
t.forEach((f) => f.addEventListener("abort", a));
|
|
1101
1101
|
const { signal: d } = s;
|
|
1102
|
-
return d.unsubscribe = () =>
|
|
1102
|
+
return d.unsubscribe = () => x.asap(c), d;
|
|
1103
1103
|
}
|
|
1104
1104
|
}, Pn = function* (t, e) {
|
|
1105
1105
|
let n = t.byteLength;
|
|
@@ -1137,19 +1137,19 @@ const Xt = (t) => {
|
|
|
1137
1137
|
return new ReadableStream({
|
|
1138
1138
|
async pull(d) {
|
|
1139
1139
|
try {
|
|
1140
|
-
const { done:
|
|
1141
|
-
if (
|
|
1140
|
+
const { done: f, value: p } = await i.next();
|
|
1141
|
+
if (f) {
|
|
1142
1142
|
c(), d.close();
|
|
1143
1143
|
return;
|
|
1144
1144
|
}
|
|
1145
|
-
let y =
|
|
1145
|
+
let y = p.byteLength;
|
|
1146
1146
|
if (n) {
|
|
1147
|
-
let
|
|
1148
|
-
n(
|
|
1147
|
+
let k = a += y;
|
|
1148
|
+
n(k);
|
|
1149
1149
|
}
|
|
1150
|
-
d.enqueue(new Uint8Array(
|
|
1151
|
-
} catch (
|
|
1152
|
-
throw c(
|
|
1150
|
+
d.enqueue(new Uint8Array(p));
|
|
1151
|
+
} catch (f) {
|
|
1152
|
+
throw c(f), f;
|
|
1153
1153
|
}
|
|
1154
1154
|
},
|
|
1155
1155
|
cancel(d) {
|
|
@@ -1158,70 +1158,70 @@ const Xt = (t) => {
|
|
|
1158
1158
|
}, {
|
|
1159
1159
|
highWaterMark: 2
|
|
1160
1160
|
});
|
|
1161
|
-
}, wt = 64 * 1024, { isFunction: ze } =
|
|
1161
|
+
}, wt = 64 * 1024, { isFunction: ze } = x, zn = (({ Request: t, Response: e }) => ({
|
|
1162
1162
|
Request: t,
|
|
1163
1163
|
Response: e
|
|
1164
|
-
}))(
|
|
1164
|
+
}))(x.global), {
|
|
1165
1165
|
ReadableStream: jt,
|
|
1166
1166
|
TextEncoder: vt
|
|
1167
|
-
} =
|
|
1167
|
+
} = x.global, St = (t, ...e) => {
|
|
1168
1168
|
try {
|
|
1169
1169
|
return !!t(...e);
|
|
1170
1170
|
} catch {
|
|
1171
1171
|
return !1;
|
|
1172
1172
|
}
|
|
1173
1173
|
}, An = (t) => {
|
|
1174
|
-
t =
|
|
1174
|
+
t = x.merge.call({
|
|
1175
1175
|
skipUndefined: !0
|
|
1176
1176
|
}, zn, t);
|
|
1177
1177
|
const { fetch: e, Request: n, Response: s } = t, i = e ? ze(e) : typeof fetch == "function", a = ze(n), o = ze(s);
|
|
1178
1178
|
if (!i)
|
|
1179
1179
|
return !1;
|
|
1180
|
-
const c = i && ze(jt), d = i && (typeof vt == "function" ? /* @__PURE__ */ ((
|
|
1181
|
-
let
|
|
1180
|
+
const c = i && ze(jt), d = i && (typeof vt == "function" ? /* @__PURE__ */ ((u) => (w) => u.encode(w))(new vt()) : async (u) => new Uint8Array(await new n(u).arrayBuffer())), f = a && c && St(() => {
|
|
1181
|
+
let u = !1;
|
|
1182
1182
|
const w = new n(Q.origin, {
|
|
1183
1183
|
body: new jt(),
|
|
1184
1184
|
method: "POST",
|
|
1185
1185
|
get duplex() {
|
|
1186
|
-
return
|
|
1186
|
+
return u = !0, "half";
|
|
1187
1187
|
}
|
|
1188
1188
|
}).headers.has("Content-Type");
|
|
1189
|
-
return
|
|
1190
|
-
}),
|
|
1191
|
-
stream:
|
|
1189
|
+
return u && !w;
|
|
1190
|
+
}), p = o && c && St(() => x.isReadableStream(new s("").body)), y = {
|
|
1191
|
+
stream: p && ((u) => u.body)
|
|
1192
1192
|
};
|
|
1193
|
-
i && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((
|
|
1194
|
-
!y[
|
|
1195
|
-
let O = w && w[
|
|
1193
|
+
i && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((u) => {
|
|
1194
|
+
!y[u] && (y[u] = (w, h) => {
|
|
1195
|
+
let O = w && w[u];
|
|
1196
1196
|
if (O)
|
|
1197
1197
|
return O.call(w);
|
|
1198
|
-
throw new $(`Response type '${
|
|
1198
|
+
throw new $(`Response type '${u}' is not supported`, $.ERR_NOT_SUPPORT, h);
|
|
1199
1199
|
});
|
|
1200
1200
|
});
|
|
1201
|
-
const
|
|
1202
|
-
if (
|
|
1201
|
+
const k = async (u) => {
|
|
1202
|
+
if (u == null)
|
|
1203
1203
|
return 0;
|
|
1204
|
-
if (
|
|
1205
|
-
return
|
|
1206
|
-
if (
|
|
1204
|
+
if (x.isBlob(u))
|
|
1205
|
+
return u.size;
|
|
1206
|
+
if (x.isSpecCompliantForm(u))
|
|
1207
1207
|
return (await new n(Q.origin, {
|
|
1208
1208
|
method: "POST",
|
|
1209
|
-
body:
|
|
1209
|
+
body: u
|
|
1210
1210
|
}).arrayBuffer()).byteLength;
|
|
1211
|
-
if (
|
|
1212
|
-
return
|
|
1213
|
-
if (
|
|
1214
|
-
return (await d(
|
|
1215
|
-
},
|
|
1216
|
-
const h =
|
|
1217
|
-
return h ??
|
|
1211
|
+
if (x.isArrayBufferView(u) || x.isArrayBuffer(u))
|
|
1212
|
+
return u.byteLength;
|
|
1213
|
+
if (x.isURLSearchParams(u) && (u = u + ""), x.isString(u))
|
|
1214
|
+
return (await d(u)).byteLength;
|
|
1215
|
+
}, E = async (u, w) => {
|
|
1216
|
+
const h = x.toFiniteNumber(u.getContentLength());
|
|
1217
|
+
return h ?? k(w);
|
|
1218
1218
|
};
|
|
1219
|
-
return async (
|
|
1219
|
+
return async (u) => {
|
|
1220
1220
|
let {
|
|
1221
1221
|
url: w,
|
|
1222
1222
|
method: h,
|
|
1223
1223
|
data: O,
|
|
1224
|
-
signal:
|
|
1224
|
+
signal: C,
|
|
1225
1225
|
cancelToken: g,
|
|
1226
1226
|
timeout: A,
|
|
1227
1227
|
onDownloadProgress: N,
|
|
@@ -1230,21 +1230,21 @@ const Xt = (t) => {
|
|
|
1230
1230
|
headers: q,
|
|
1231
1231
|
withCredentials: I = "same-origin",
|
|
1232
1232
|
fetchOptions: X
|
|
1233
|
-
} = Xt(
|
|
1233
|
+
} = Xt(u), W = e || fetch;
|
|
1234
1234
|
j = j ? (j + "").toLowerCase() : "text";
|
|
1235
|
-
let
|
|
1236
|
-
const R =
|
|
1237
|
-
|
|
1235
|
+
let T = Rn([C, g && g.toAbortSignal()], A), G = null;
|
|
1236
|
+
const R = T && T.unsubscribe && (() => {
|
|
1237
|
+
T.unsubscribe();
|
|
1238
1238
|
});
|
|
1239
1239
|
let z;
|
|
1240
1240
|
try {
|
|
1241
|
-
if (b &&
|
|
1241
|
+
if (b && f && h !== "get" && h !== "head" && (z = await E(q, O)) !== 0) {
|
|
1242
1242
|
let l = new n(w, {
|
|
1243
1243
|
method: "POST",
|
|
1244
1244
|
body: O,
|
|
1245
1245
|
duplex: "half"
|
|
1246
1246
|
}), m;
|
|
1247
|
-
if (
|
|
1247
|
+
if (x.isFormData(O) && (m = l.headers.get("content-type")) && q.setContentType(m), l.body) {
|
|
1248
1248
|
const [S, D] = mt(
|
|
1249
1249
|
z,
|
|
1250
1250
|
Ne(gt(b))
|
|
@@ -1252,10 +1252,10 @@ const Xt = (t) => {
|
|
|
1252
1252
|
O = bt(l.body, wt, S, D);
|
|
1253
1253
|
}
|
|
1254
1254
|
}
|
|
1255
|
-
|
|
1255
|
+
x.isString(I) || (I = I ? "include" : "omit");
|
|
1256
1256
|
const M = a && "credentials" in n.prototype, K = {
|
|
1257
1257
|
...X,
|
|
1258
|
-
signal:
|
|
1258
|
+
signal: T,
|
|
1259
1259
|
method: h.toUpperCase(),
|
|
1260
1260
|
headers: q.normalize().toJSON(),
|
|
1261
1261
|
body: O,
|
|
@@ -1264,13 +1264,13 @@ const Xt = (t) => {
|
|
|
1264
1264
|
};
|
|
1265
1265
|
G = a && new n(w, K);
|
|
1266
1266
|
let H = await (a ? W(G, X) : W(w, K));
|
|
1267
|
-
const F =
|
|
1268
|
-
if (
|
|
1267
|
+
const F = p && (j === "stream" || j === "response");
|
|
1268
|
+
if (p && (N || F && R)) {
|
|
1269
1269
|
const l = {};
|
|
1270
1270
|
["status", "statusText", "headers"].forEach((ne) => {
|
|
1271
1271
|
l[ne] = H[ne];
|
|
1272
1272
|
});
|
|
1273
|
-
const m =
|
|
1273
|
+
const m = x.toFiniteNumber(H.headers.get("content-length")), [S, D] = N && mt(
|
|
1274
1274
|
m,
|
|
1275
1275
|
Ne(gt(N), !0)
|
|
1276
1276
|
) || [];
|
|
@@ -1282,24 +1282,24 @@ const Xt = (t) => {
|
|
|
1282
1282
|
);
|
|
1283
1283
|
}
|
|
1284
1284
|
j = j || "text";
|
|
1285
|
-
let Y = await y[
|
|
1285
|
+
let Y = await y[x.findKey(y, j) || "text"](H, u);
|
|
1286
1286
|
return !F && R && R(), await new Promise((l, m) => {
|
|
1287
1287
|
Kt(l, m, {
|
|
1288
1288
|
data: Y,
|
|
1289
1289
|
headers: re.from(H.headers),
|
|
1290
1290
|
status: H.status,
|
|
1291
1291
|
statusText: H.statusText,
|
|
1292
|
-
config:
|
|
1292
|
+
config: u,
|
|
1293
1293
|
request: G
|
|
1294
1294
|
});
|
|
1295
1295
|
});
|
|
1296
1296
|
} catch (M) {
|
|
1297
1297
|
throw R && R(), M && M.name === "TypeError" && /Load failed|fetch/i.test(M.message) ? Object.assign(
|
|
1298
|
-
new $("Network Error", $.ERR_NETWORK,
|
|
1298
|
+
new $("Network Error", $.ERR_NETWORK, u, G),
|
|
1299
1299
|
{
|
|
1300
1300
|
cause: M.cause || M
|
|
1301
1301
|
}
|
|
1302
|
-
) : $.from(M, M && M.code,
|
|
1302
|
+
) : $.from(M, M && M.code, u, G);
|
|
1303
1303
|
}
|
|
1304
1304
|
};
|
|
1305
1305
|
}, _n = /* @__PURE__ */ new Map(), Zt = (t) => {
|
|
@@ -1309,20 +1309,20 @@ const Xt = (t) => {
|
|
|
1309
1309
|
i,
|
|
1310
1310
|
n
|
|
1311
1311
|
];
|
|
1312
|
-
let o = a.length, c = o, d,
|
|
1312
|
+
let o = a.length, c = o, d, f, p = _n;
|
|
1313
1313
|
for (; c--; )
|
|
1314
|
-
d = a[c],
|
|
1315
|
-
return
|
|
1314
|
+
d = a[c], f = p.get(d), f === void 0 && p.set(d, f = c ? /* @__PURE__ */ new Map() : An(e)), p = f;
|
|
1315
|
+
return f;
|
|
1316
1316
|
};
|
|
1317
1317
|
Zt();
|
|
1318
1318
|
const Qe = {
|
|
1319
1319
|
http: Gr,
|
|
1320
|
-
xhr:
|
|
1320
|
+
xhr: Tn,
|
|
1321
1321
|
fetch: {
|
|
1322
1322
|
get: Zt
|
|
1323
1323
|
}
|
|
1324
1324
|
};
|
|
1325
|
-
|
|
1325
|
+
x.forEach(Qe, (t, e) => {
|
|
1326
1326
|
if (t) {
|
|
1327
1327
|
try {
|
|
1328
1328
|
Object.defineProperty(t, "name", { value: e });
|
|
@@ -1331,9 +1331,9 @@ f.forEach(Qe, (t, e) => {
|
|
|
1331
1331
|
Object.defineProperty(t, "adapterName", { value: e });
|
|
1332
1332
|
}
|
|
1333
1333
|
});
|
|
1334
|
-
const
|
|
1334
|
+
const kt = (t) => `- ${t}`, Un = (t) => x.isFunction(t) || t === null || t === !1, Qt = {
|
|
1335
1335
|
getAdapter: (t, e) => {
|
|
1336
|
-
t =
|
|
1336
|
+
t = x.isArray(t) ? t : [t];
|
|
1337
1337
|
const { length: n } = t;
|
|
1338
1338
|
let s, i;
|
|
1339
1339
|
const a = {};
|
|
@@ -1342,17 +1342,17 @@ const Et = (t) => `- ${t}`, Un = (t) => f.isFunction(t) || t === null || t === !
|
|
|
1342
1342
|
let c;
|
|
1343
1343
|
if (i = s, !Un(s) && (i = Qe[(c = String(s)).toLowerCase()], i === void 0))
|
|
1344
1344
|
throw new $(`Unknown adapter '${c}'`);
|
|
1345
|
-
if (i && (
|
|
1345
|
+
if (i && (x.isFunction(i) || (i = i.get(e))))
|
|
1346
1346
|
break;
|
|
1347
1347
|
a[c || "#" + o] = i;
|
|
1348
1348
|
}
|
|
1349
1349
|
if (!i) {
|
|
1350
1350
|
const o = Object.entries(a).map(
|
|
1351
|
-
([d,
|
|
1351
|
+
([d, f]) => `adapter ${d} ` + (f === !1 ? "is not supported by the environment" : "is not available in the build")
|
|
1352
1352
|
);
|
|
1353
1353
|
let c = n ? o.length > 1 ? `since :
|
|
1354
|
-
` + o.map(
|
|
1355
|
-
`) : " " +
|
|
1354
|
+
` + o.map(kt).join(`
|
|
1355
|
+
`) : " " + kt(o[0]) : "as no adapter specified";
|
|
1356
1356
|
throw new $(
|
|
1357
1357
|
"There is no suitable adapter to dispatch the request " + c,
|
|
1358
1358
|
"ERR_NOT_SUPPORT"
|
|
@@ -1366,7 +1366,7 @@ function Ye(t) {
|
|
|
1366
1366
|
if (t.cancelToken && t.cancelToken.throwIfRequested(), t.signal && t.signal.aborted)
|
|
1367
1367
|
throw new ve(null, t);
|
|
1368
1368
|
}
|
|
1369
|
-
function
|
|
1369
|
+
function Et(t) {
|
|
1370
1370
|
return Ye(t), t.headers = re.from(t.headers), t.data = Ve.call(
|
|
1371
1371
|
t,
|
|
1372
1372
|
t.transformRequest
|
|
@@ -1390,7 +1390,7 @@ const er = "1.12.2", We = {};
|
|
|
1390
1390
|
return typeof s === t || "a" + (e < 1 ? "n " : " ") + t;
|
|
1391
1391
|
};
|
|
1392
1392
|
});
|
|
1393
|
-
const
|
|
1393
|
+
const Ct = {};
|
|
1394
1394
|
We.transitional = function(e, n, s) {
|
|
1395
1395
|
function i(a, o) {
|
|
1396
1396
|
return "[Axios v" + er + "] Transitional option '" + a + "'" + o + (s ? ". " + s : "");
|
|
@@ -1401,7 +1401,7 @@ We.transitional = function(e, n, s) {
|
|
|
1401
1401
|
i(o, " has been removed" + (n ? " in " + n : "")),
|
|
1402
1402
|
$.ERR_DEPRECATED
|
|
1403
1403
|
);
|
|
1404
|
-
return n && !
|
|
1404
|
+
return n && !Ct[o] && (Ct[o] = !0, console.warn(
|
|
1405
1405
|
i(
|
|
1406
1406
|
o,
|
|
1407
1407
|
" has been deprecated since v" + n + " and will be removed in the near future"
|
|
@@ -1433,7 +1433,7 @@ const $e = {
|
|
|
1433
1433
|
assertOptions: $n,
|
|
1434
1434
|
validators: We
|
|
1435
1435
|
}, ce = $e.validators;
|
|
1436
|
-
let
|
|
1436
|
+
let he = class {
|
|
1437
1437
|
constructor(e) {
|
|
1438
1438
|
this.defaults = e || {}, this.interceptors = {
|
|
1439
1439
|
request: new xt(),
|
|
@@ -1466,13 +1466,13 @@ let xe = class {
|
|
|
1466
1466
|
}
|
|
1467
1467
|
}
|
|
1468
1468
|
_request(e, n) {
|
|
1469
|
-
typeof e == "string" ? (n = n || {}, n.url = e) : n = e || {}, n =
|
|
1469
|
+
typeof e == "string" ? (n = n || {}, n.url = e) : n = e || {}, n = me(this.defaults, n);
|
|
1470
1470
|
const { transitional: s, paramsSerializer: i, headers: a } = n;
|
|
1471
1471
|
s !== void 0 && $e.assertOptions(s, {
|
|
1472
1472
|
silentJSONParsing: ce.transitional(ce.boolean),
|
|
1473
1473
|
forcedJSONParsing: ce.transitional(ce.boolean),
|
|
1474
1474
|
clarifyTimeoutError: ce.transitional(ce.boolean)
|
|
1475
|
-
}, !1), i != null && (
|
|
1475
|
+
}, !1), i != null && (x.isFunction(i) ? n.paramsSerializer = {
|
|
1476
1476
|
serialize: i
|
|
1477
1477
|
} : $e.assertOptions(i, {
|
|
1478
1478
|
encode: ce.function,
|
|
@@ -1481,14 +1481,14 @@ let xe = class {
|
|
|
1481
1481
|
baseUrl: ce.spelling("baseURL"),
|
|
1482
1482
|
withXsrfToken: ce.spelling("withXSRFToken")
|
|
1483
1483
|
}, !0), n.method = (n.method || this.defaults.method || "get").toLowerCase();
|
|
1484
|
-
let o = a &&
|
|
1484
|
+
let o = a && x.merge(
|
|
1485
1485
|
a.common,
|
|
1486
1486
|
a[n.method]
|
|
1487
1487
|
);
|
|
1488
|
-
a &&
|
|
1488
|
+
a && x.forEach(
|
|
1489
1489
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1490
|
-
(
|
|
1491
|
-
delete a[
|
|
1490
|
+
(u) => {
|
|
1491
|
+
delete a[u];
|
|
1492
1492
|
}
|
|
1493
1493
|
), n.headers = re.concat(o, a);
|
|
1494
1494
|
const c = [];
|
|
@@ -1496,56 +1496,56 @@ let xe = class {
|
|
|
1496
1496
|
this.interceptors.request.forEach(function(w) {
|
|
1497
1497
|
typeof w.runWhen == "function" && w.runWhen(n) === !1 || (d = d && w.synchronous, c.unshift(w.fulfilled, w.rejected));
|
|
1498
1498
|
});
|
|
1499
|
-
const
|
|
1499
|
+
const f = [];
|
|
1500
1500
|
this.interceptors.response.forEach(function(w) {
|
|
1501
|
-
|
|
1501
|
+
f.push(w.fulfilled, w.rejected);
|
|
1502
1502
|
});
|
|
1503
|
-
let
|
|
1503
|
+
let p, y = 0, k;
|
|
1504
1504
|
if (!d) {
|
|
1505
|
-
const
|
|
1506
|
-
for (
|
|
1507
|
-
|
|
1508
|
-
return
|
|
1505
|
+
const u = [Et.bind(this), void 0];
|
|
1506
|
+
for (u.unshift(...c), u.push(...f), k = u.length, p = Promise.resolve(n); y < k; )
|
|
1507
|
+
p = p.then(u[y++], u[y++]);
|
|
1508
|
+
return p;
|
|
1509
1509
|
}
|
|
1510
|
-
|
|
1511
|
-
let
|
|
1512
|
-
for (; y <
|
|
1513
|
-
const
|
|
1510
|
+
k = c.length;
|
|
1511
|
+
let E = n;
|
|
1512
|
+
for (; y < k; ) {
|
|
1513
|
+
const u = c[y++], w = c[y++];
|
|
1514
1514
|
try {
|
|
1515
|
-
|
|
1515
|
+
E = u(E);
|
|
1516
1516
|
} catch (h) {
|
|
1517
1517
|
w.call(this, h);
|
|
1518
1518
|
break;
|
|
1519
1519
|
}
|
|
1520
1520
|
}
|
|
1521
1521
|
try {
|
|
1522
|
-
|
|
1523
|
-
} catch (
|
|
1524
|
-
return Promise.reject(
|
|
1522
|
+
p = Et.call(this, E);
|
|
1523
|
+
} catch (u) {
|
|
1524
|
+
return Promise.reject(u);
|
|
1525
1525
|
}
|
|
1526
|
-
for (y = 0,
|
|
1527
|
-
|
|
1528
|
-
return
|
|
1526
|
+
for (y = 0, k = f.length; y < k; )
|
|
1527
|
+
p = p.then(f[y++], f[y++]);
|
|
1528
|
+
return p;
|
|
1529
1529
|
}
|
|
1530
1530
|
getUri(e) {
|
|
1531
|
-
e =
|
|
1531
|
+
e = me(this.defaults, e);
|
|
1532
1532
|
const n = Gt(e.baseURL, e.url, e.allowAbsoluteUrls);
|
|
1533
1533
|
return Ht(n, e.params, e.paramsSerializer);
|
|
1534
1534
|
}
|
|
1535
1535
|
};
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
return this.request(
|
|
1536
|
+
x.forEach(["delete", "get", "head", "options"], function(e) {
|
|
1537
|
+
he.prototype[e] = function(n, s) {
|
|
1538
|
+
return this.request(me(s || {}, {
|
|
1539
1539
|
method: e,
|
|
1540
1540
|
url: n,
|
|
1541
1541
|
data: (s || {}).data
|
|
1542
1542
|
}));
|
|
1543
1543
|
};
|
|
1544
1544
|
});
|
|
1545
|
-
|
|
1545
|
+
x.forEach(["post", "put", "patch"], function(e) {
|
|
1546
1546
|
function n(s) {
|
|
1547
1547
|
return function(a, o, c) {
|
|
1548
|
-
return this.request(
|
|
1548
|
+
return this.request(me(c || {}, {
|
|
1549
1549
|
method: e,
|
|
1550
1550
|
headers: s ? {
|
|
1551
1551
|
"Content-Type": "multipart/form-data"
|
|
@@ -1555,7 +1555,7 @@ f.forEach(["post", "put", "patch"], function(e) {
|
|
|
1555
1555
|
}));
|
|
1556
1556
|
};
|
|
1557
1557
|
}
|
|
1558
|
-
|
|
1558
|
+
he.prototype[e] = n(), he.prototype[e + "Form"] = n(!0);
|
|
1559
1559
|
});
|
|
1560
1560
|
let Dn = class tr {
|
|
1561
1561
|
constructor(e) {
|
|
@@ -1636,7 +1636,7 @@ function Nn(t) {
|
|
|
1636
1636
|
};
|
|
1637
1637
|
}
|
|
1638
1638
|
function Fn(t) {
|
|
1639
|
-
return
|
|
1639
|
+
return x.isObject(t) && t.isAxiosError === !0;
|
|
1640
1640
|
}
|
|
1641
1641
|
const et = {
|
|
1642
1642
|
Continue: 100,
|
|
@@ -1707,13 +1707,13 @@ Object.entries(et).forEach(([t, e]) => {
|
|
|
1707
1707
|
et[e] = t;
|
|
1708
1708
|
});
|
|
1709
1709
|
function rr(t) {
|
|
1710
|
-
const e = new
|
|
1711
|
-
return
|
|
1712
|
-
return rr(
|
|
1710
|
+
const e = new he(t), n = At(he.prototype.request, e);
|
|
1711
|
+
return x.extend(n, he.prototype, e, { allOwnKeys: !0 }), x.extend(n, e, null, { allOwnKeys: !0 }), n.create = function(i) {
|
|
1712
|
+
return rr(me(t, i));
|
|
1713
1713
|
}, n;
|
|
1714
1714
|
}
|
|
1715
1715
|
const J = rr(Oe);
|
|
1716
|
-
J.Axios =
|
|
1716
|
+
J.Axios = he;
|
|
1717
1717
|
J.CanceledError = ve;
|
|
1718
1718
|
J.CancelToken = Dn;
|
|
1719
1719
|
J.isCancel = Jt;
|
|
@@ -1726,9 +1726,9 @@ J.all = function(e) {
|
|
|
1726
1726
|
};
|
|
1727
1727
|
J.spread = Nn;
|
|
1728
1728
|
J.isAxiosError = Fn;
|
|
1729
|
-
J.mergeConfig =
|
|
1729
|
+
J.mergeConfig = me;
|
|
1730
1730
|
J.AxiosHeaders = re;
|
|
1731
|
-
J.formToJSON = (t) => Yt(
|
|
1731
|
+
J.formToJSON = (t) => Yt(x.isHTMLForm(t) ? new FormData(t) : t);
|
|
1732
1732
|
J.getAdapter = Qt.getAdapter;
|
|
1733
1733
|
J.HttpStatusCode = et;
|
|
1734
1734
|
J.default = J;
|
|
@@ -2275,7 +2275,7 @@ class li {
|
|
|
2275
2275
|
);
|
|
2276
2276
|
}
|
|
2277
2277
|
}
|
|
2278
|
-
var Ae = { exports: {} },
|
|
2278
|
+
var Ae = { exports: {} }, ke = {};
|
|
2279
2279
|
/**
|
|
2280
2280
|
* @license React
|
|
2281
2281
|
* react-jsx-runtime.production.js
|
|
@@ -2285,10 +2285,10 @@ var Ae = { exports: {} }, Ee = {};
|
|
|
2285
2285
|
* This source code is licensed under the MIT license found in the
|
|
2286
2286
|
* LICENSE file in the root directory of this source tree.
|
|
2287
2287
|
*/
|
|
2288
|
-
var
|
|
2288
|
+
var Tt;
|
|
2289
2289
|
function Ln() {
|
|
2290
|
-
if (
|
|
2291
|
-
|
|
2290
|
+
if (Tt) return ke;
|
|
2291
|
+
Tt = 1;
|
|
2292
2292
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
2293
2293
|
function n(s, i, a) {
|
|
2294
2294
|
var o = null;
|
|
@@ -2305,9 +2305,9 @@ function Ln() {
|
|
|
2305
2305
|
props: a
|
|
2306
2306
|
};
|
|
2307
2307
|
}
|
|
2308
|
-
return
|
|
2308
|
+
return ke.Fragment = e, ke.jsx = n, ke.jsxs = n, ke;
|
|
2309
2309
|
}
|
|
2310
|
-
var
|
|
2310
|
+
var Ee = {};
|
|
2311
2311
|
/**
|
|
2312
2312
|
* @license React
|
|
2313
2313
|
* react-jsx-runtime.development.js
|
|
@@ -2328,7 +2328,7 @@ function qn() {
|
|
|
2328
2328
|
switch (l) {
|
|
2329
2329
|
case h:
|
|
2330
2330
|
return "Fragment";
|
|
2331
|
-
case
|
|
2331
|
+
case C:
|
|
2332
2332
|
return "Profiler";
|
|
2333
2333
|
case O:
|
|
2334
2334
|
return "StrictMode";
|
|
@@ -2395,7 +2395,7 @@ function qn() {
|
|
|
2395
2395
|
}
|
|
2396
2396
|
}
|
|
2397
2397
|
function i() {
|
|
2398
|
-
var l =
|
|
2398
|
+
var l = T.A;
|
|
2399
2399
|
return l === null ? null : l.getOwner();
|
|
2400
2400
|
}
|
|
2401
2401
|
function a() {
|
|
@@ -2426,10 +2426,10 @@ function qn() {
|
|
|
2426
2426
|
"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."
|
|
2427
2427
|
)), l = this.props.ref, l !== void 0 ? l : null;
|
|
2428
2428
|
}
|
|
2429
|
-
function
|
|
2429
|
+
function f(l, m, S, D, ne, oe) {
|
|
2430
2430
|
var B = S.ref;
|
|
2431
2431
|
return l = {
|
|
2432
|
-
$$typeof:
|
|
2432
|
+
$$typeof: u,
|
|
2433
2433
|
type: l,
|
|
2434
2434
|
key: m,
|
|
2435
2435
|
props: S,
|
|
@@ -2459,7 +2459,7 @@ function qn() {
|
|
|
2459
2459
|
value: oe
|
|
2460
2460
|
}), Object.freeze && (Object.freeze(l.props), Object.freeze(l)), l;
|
|
2461
2461
|
}
|
|
2462
|
-
function
|
|
2462
|
+
function p(l, m, S, D, ne, oe) {
|
|
2463
2463
|
var B = m.children;
|
|
2464
2464
|
if (B !== void 0)
|
|
2465
2465
|
if (D)
|
|
@@ -2498,7 +2498,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2498
2498
|
return B && c(
|
|
2499
2499
|
S,
|
|
2500
2500
|
typeof l == "function" ? l.displayName || l.name || "Unknown" : l
|
|
2501
|
-
),
|
|
2501
|
+
), f(
|
|
2502
2502
|
l,
|
|
2503
2503
|
B,
|
|
2504
2504
|
S,
|
|
@@ -2508,26 +2508,26 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2508
2508
|
);
|
|
2509
2509
|
}
|
|
2510
2510
|
function y(l) {
|
|
2511
|
-
|
|
2511
|
+
k(l) ? l._store && (l._store.validated = 1) : typeof l == "object" && l !== null && l.$$typeof === I && (l._payload.status === "fulfilled" ? k(l._payload.value) && l._payload.value._store && (l._payload.value._store.validated = 1) : l._store && (l._store.validated = 1));
|
|
2512
2512
|
}
|
|
2513
|
-
function
|
|
2514
|
-
return typeof l == "object" && l !== null && l.$$typeof ===
|
|
2513
|
+
function k(l) {
|
|
2514
|
+
return typeof l == "object" && l !== null && l.$$typeof === u;
|
|
2515
2515
|
}
|
|
2516
|
-
var
|
|
2516
|
+
var E = Ce, u = Symbol.for("react.transitional.element"), w = Symbol.for("react.portal"), h = Symbol.for("react.fragment"), O = Symbol.for("react.strict_mode"), C = Symbol.for("react.profiler"), g = Symbol.for("react.consumer"), A = Symbol.for("react.context"), N = Symbol.for("react.forward_ref"), b = Symbol.for("react.suspense"), j = Symbol.for("react.suspense_list"), q = Symbol.for("react.memo"), I = Symbol.for("react.lazy"), X = Symbol.for("react.activity"), W = Symbol.for("react.client.reference"), T = E.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, G = Object.prototype.hasOwnProperty, R = Array.isArray, z = console.createTask ? console.createTask : function() {
|
|
2517
2517
|
return null;
|
|
2518
2518
|
};
|
|
2519
|
-
|
|
2519
|
+
E = {
|
|
2520
2520
|
react_stack_bottom_frame: function(l) {
|
|
2521
2521
|
return l();
|
|
2522
2522
|
}
|
|
2523
2523
|
};
|
|
2524
|
-
var M, K = {}, H =
|
|
2525
|
-
|
|
2524
|
+
var M, K = {}, H = E.react_stack_bottom_frame.bind(
|
|
2525
|
+
E,
|
|
2526
2526
|
a
|
|
2527
2527
|
)(), F = z(s(a)), Y = {};
|
|
2528
|
-
|
|
2529
|
-
var D = 1e4 >
|
|
2530
|
-
return
|
|
2528
|
+
Ee.Fragment = h, Ee.jsx = function(l, m, S) {
|
|
2529
|
+
var D = 1e4 > T.recentlyCreatedOwnerStacks++;
|
|
2530
|
+
return p(
|
|
2531
2531
|
l,
|
|
2532
2532
|
m,
|
|
2533
2533
|
S,
|
|
@@ -2535,9 +2535,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2535
2535
|
D ? Error("react-stack-top-frame") : H,
|
|
2536
2536
|
D ? z(s(l)) : F
|
|
2537
2537
|
);
|
|
2538
|
-
},
|
|
2539
|
-
var D = 1e4 >
|
|
2540
|
-
return
|
|
2538
|
+
}, Ee.jsxs = function(l, m, S) {
|
|
2539
|
+
var D = 1e4 > T.recentlyCreatedOwnerStacks++;
|
|
2540
|
+
return p(
|
|
2541
2541
|
l,
|
|
2542
2542
|
m,
|
|
2543
2543
|
S,
|
|
@@ -2546,7 +2546,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2546
2546
|
D ? z(s(l)) : F
|
|
2547
2547
|
);
|
|
2548
2548
|
};
|
|
2549
|
-
})()),
|
|
2549
|
+
})()), Ee;
|
|
2550
2550
|
}
|
|
2551
2551
|
var Pt;
|
|
2552
2552
|
function Mn() {
|
|
@@ -2617,7 +2617,7 @@ const Yn = zt(
|
|
|
2617
2617
|
...c
|
|
2618
2618
|
},
|
|
2619
2619
|
[
|
|
2620
|
-
...o.map(([
|
|
2620
|
+
...o.map(([f, p]) => Ke(f, p)),
|
|
2621
2621
|
...Array.isArray(a) ? a : [a]
|
|
2622
2622
|
]
|
|
2623
2623
|
)
|
|
@@ -2925,14 +2925,14 @@ const Ss = [
|
|
|
2925
2925
|
key: "1a8usu"
|
|
2926
2926
|
}
|
|
2927
2927
|
]
|
|
2928
|
-
],
|
|
2928
|
+
], ks = L("pen-line", Ss);
|
|
2929
2929
|
/**
|
|
2930
2930
|
* @license lucide-react v0.544.0 - ISC
|
|
2931
2931
|
*
|
|
2932
2932
|
* This source code is licensed under the ISC license.
|
|
2933
2933
|
* See the LICENSE file in the root directory of this source tree.
|
|
2934
2934
|
*/
|
|
2935
|
-
const
|
|
2935
|
+
const Es = [
|
|
2936
2936
|
[
|
|
2937
2937
|
"path",
|
|
2938
2938
|
{
|
|
@@ -2940,14 +2940,14 @@ const ks = [
|
|
|
2940
2940
|
key: "9njp5v"
|
|
2941
2941
|
}
|
|
2942
2942
|
]
|
|
2943
|
-
],
|
|
2943
|
+
], Cs = L("phone", Es);
|
|
2944
2944
|
/**
|
|
2945
2945
|
* @license lucide-react v0.544.0 - ISC
|
|
2946
2946
|
*
|
|
2947
2947
|
* This source code is licensed under the ISC license.
|
|
2948
2948
|
* See the LICENSE file in the root directory of this source tree.
|
|
2949
2949
|
*/
|
|
2950
|
-
const
|
|
2950
|
+
const Ts = [
|
|
2951
2951
|
[
|
|
2952
2952
|
"path",
|
|
2953
2953
|
{
|
|
@@ -2957,7 +2957,7 @@ const Cs = [
|
|
|
2957
2957
|
],
|
|
2958
2958
|
["path", { d: "M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7", key: "1ydtos" }],
|
|
2959
2959
|
["path", { d: "M7 3v4a1 1 0 0 0 1 1h7", key: "t51u73" }]
|
|
2960
|
-
], Rs = L("save",
|
|
2960
|
+
], Rs = L("save", Ts);
|
|
2961
2961
|
/**
|
|
2962
2962
|
* @license lucide-react v0.544.0 - ISC
|
|
2963
2963
|
*
|
|
@@ -3069,7 +3069,7 @@ const Ns = [
|
|
|
3069
3069
|
], Ie = L("x", Ns), or = cr(null), ci = ({
|
|
3070
3070
|
authix: t,
|
|
3071
3071
|
children: e
|
|
3072
|
-
}) => /* @__PURE__ */ r.jsx(or.Provider, { value: t, children: e }),
|
|
3072
|
+
}) => /* @__PURE__ */ r.jsx(or.Provider, { value: t, children: e }), fe = () => {
|
|
3073
3073
|
const t = dr(or);
|
|
3074
3074
|
if (!t)
|
|
3075
3075
|
throw new Error("useAuthix must be used inside <AuthixProvider />");
|
|
@@ -3086,20 +3086,20 @@ const Ns = [
|
|
|
3086
3086
|
showAvatar: c = !1,
|
|
3087
3087
|
roles: d = [],
|
|
3088
3088
|
// 🔥 FIXED
|
|
3089
|
-
showRoleSelector:
|
|
3089
|
+
showRoleSelector: f = !1,
|
|
3090
3090
|
// 🔥 FIXED
|
|
3091
|
-
loginUrl:
|
|
3091
|
+
loginUrl: p,
|
|
3092
3092
|
onSuccess: y,
|
|
3093
|
-
onError:
|
|
3093
|
+
onError: k
|
|
3094
3094
|
}) => {
|
|
3095
|
-
const
|
|
3095
|
+
const E = fe(), u = {
|
|
3096
3096
|
name: "",
|
|
3097
3097
|
email: "",
|
|
3098
3098
|
password: "",
|
|
3099
3099
|
role: d.length ? d[0] : "user",
|
|
3100
3100
|
...c && { avatarUrl: "" }
|
|
3101
|
-
}, [w, h] = P(
|
|
3102
|
-
|
|
3101
|
+
}, [w, h] = P(u), [O, C] = P(!1), [g, A] = P(!1), [N, b] = P(null), [j, q] = P({}), [I, X] = P(!1), W = o ? "#ffffff" : "#111827", T = o ? "#a1a1aa" : "#6b7280", G = o ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.02)", R = o ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)";
|
|
3102
|
+
Ce.useEffect(() => {
|
|
3103
3103
|
if (typeof window < "u") {
|
|
3104
3104
|
const F = () => X(window.innerWidth < 768);
|
|
3105
3105
|
return F(), window.addEventListener("resize", F), () => window.removeEventListener("resize", F);
|
|
@@ -3121,16 +3121,16 @@ const Ns = [
|
|
|
3121
3121
|
password: w.password,
|
|
3122
3122
|
role: w.role,
|
|
3123
3123
|
...w.avatarUrl ? { avatarUrl: w.avatarUrl } : {}
|
|
3124
|
-
}, l = await
|
|
3124
|
+
}, l = await E.signupUser(Y);
|
|
3125
3125
|
l.success ? (b({
|
|
3126
3126
|
type: "success",
|
|
3127
3127
|
text: l.message || "Account created successfully!"
|
|
3128
|
-
}), y?.(l.user)) : (b({ type: "error", text: l.message || "Signup failed" }),
|
|
3128
|
+
}), y?.(l.user)) : (b({ type: "error", text: l.message || "Signup failed" }), k?.(l));
|
|
3129
3129
|
} catch (Y) {
|
|
3130
3130
|
b({
|
|
3131
3131
|
type: "error",
|
|
3132
3132
|
text: Y.message || "Signup failed. Please try again."
|
|
3133
|
-
}),
|
|
3133
|
+
}), k?.(Y);
|
|
3134
3134
|
} finally {
|
|
3135
3135
|
A(!1);
|
|
3136
3136
|
}
|
|
@@ -3221,7 +3221,7 @@ const Ns = [
|
|
|
3221
3221
|
{
|
|
3222
3222
|
style: {
|
|
3223
3223
|
fontSize: "14px",
|
|
3224
|
-
color:
|
|
3224
|
+
color: T
|
|
3225
3225
|
},
|
|
3226
3226
|
children: s
|
|
3227
3227
|
}
|
|
@@ -3263,7 +3263,7 @@ const Ns = [
|
|
|
3263
3263
|
onSubmit: K,
|
|
3264
3264
|
style: { display: "flex", flexDirection: "column", gap: "14px" },
|
|
3265
3265
|
children: [
|
|
3266
|
-
|
|
3266
|
+
f && d && d.length === 2 && /* @__PURE__ */ r.jsxs(
|
|
3267
3267
|
"div",
|
|
3268
3268
|
{
|
|
3269
3269
|
style: { display: "flex", flexDirection: "column", gap: "4px" },
|
|
@@ -3385,7 +3385,7 @@ const Ns = [
|
|
|
3385
3385
|
left: "14px",
|
|
3386
3386
|
top: "50%",
|
|
3387
3387
|
transform: "translateY(-50%)",
|
|
3388
|
-
color:
|
|
3388
|
+
color: T
|
|
3389
3389
|
}
|
|
3390
3390
|
}
|
|
3391
3391
|
),
|
|
@@ -3440,7 +3440,7 @@ const Ns = [
|
|
|
3440
3440
|
left: "14px",
|
|
3441
3441
|
top: "50%",
|
|
3442
3442
|
transform: "translateY(-50%)",
|
|
3443
|
-
color:
|
|
3443
|
+
color: T
|
|
3444
3444
|
}
|
|
3445
3445
|
}
|
|
3446
3446
|
),
|
|
@@ -3495,7 +3495,7 @@ const Ns = [
|
|
|
3495
3495
|
left: "14px",
|
|
3496
3496
|
top: "50%",
|
|
3497
3497
|
transform: "translateY(-50%)",
|
|
3498
|
-
color:
|
|
3498
|
+
color: T
|
|
3499
3499
|
}
|
|
3500
3500
|
}
|
|
3501
3501
|
),
|
|
@@ -3518,7 +3518,7 @@ const Ns = [
|
|
|
3518
3518
|
"button",
|
|
3519
3519
|
{
|
|
3520
3520
|
type: "button",
|
|
3521
|
-
onClick: () =>
|
|
3521
|
+
onClick: () => C(!O),
|
|
3522
3522
|
style: {
|
|
3523
3523
|
position: "absolute",
|
|
3524
3524
|
right: "14px",
|
|
@@ -3526,7 +3526,7 @@ const Ns = [
|
|
|
3526
3526
|
transform: "translateY(-50%)",
|
|
3527
3527
|
background: "transparent",
|
|
3528
3528
|
border: "none",
|
|
3529
|
-
color:
|
|
3529
|
+
color: T,
|
|
3530
3530
|
cursor: "pointer",
|
|
3531
3531
|
padding: "4px"
|
|
3532
3532
|
},
|
|
@@ -3573,7 +3573,7 @@ const Ns = [
|
|
|
3573
3573
|
left: "14px",
|
|
3574
3574
|
top: "50%",
|
|
3575
3575
|
transform: "translateY(-50%)",
|
|
3576
|
-
color:
|
|
3576
|
+
color: T
|
|
3577
3577
|
}
|
|
3578
3578
|
}
|
|
3579
3579
|
),
|
|
@@ -3593,7 +3593,7 @@ const Ns = [
|
|
|
3593
3593
|
]
|
|
3594
3594
|
}
|
|
3595
3595
|
),
|
|
3596
|
-
|
|
3596
|
+
p && /* @__PURE__ */ r.jsx(
|
|
3597
3597
|
"div",
|
|
3598
3598
|
{
|
|
3599
3599
|
style: {
|
|
@@ -3604,7 +3604,7 @@ const Ns = [
|
|
|
3604
3604
|
children: /* @__PURE__ */ r.jsx(
|
|
3605
3605
|
"a",
|
|
3606
3606
|
{
|
|
3607
|
-
href:
|
|
3607
|
+
href: p,
|
|
3608
3608
|
style: {
|
|
3609
3609
|
color: i,
|
|
3610
3610
|
textDecoration: "none",
|
|
@@ -3676,7 +3676,7 @@ const Ns = [
|
|
|
3676
3676
|
style: {
|
|
3677
3677
|
textAlign: "center",
|
|
3678
3678
|
fontSize: "12px",
|
|
3679
|
-
color:
|
|
3679
|
+
color: T,
|
|
3680
3680
|
marginTop: "16px",
|
|
3681
3681
|
padding: "0 4px"
|
|
3682
3682
|
},
|
|
@@ -3709,23 +3709,23 @@ const Ns = [
|
|
|
3709
3709
|
darkMode: o = !0,
|
|
3710
3710
|
signupUrl: c,
|
|
3711
3711
|
onSuccess: d,
|
|
3712
|
-
onError:
|
|
3712
|
+
onError: f
|
|
3713
3713
|
}) => {
|
|
3714
|
-
const
|
|
3714
|
+
const p = fe(), [y, k] = P("login"), [E, u] = P(1), [w, h] = P(!1), [O, C] = P(!1), [g, A] = P(null), [N, b] = P(""), [j, q] = P(""), [I, X] = P({
|
|
3715
3715
|
email: "",
|
|
3716
3716
|
otp: "",
|
|
3717
3717
|
newPassword: ""
|
|
3718
|
-
}), [W,
|
|
3719
|
-
|
|
3718
|
+
}), [W, T] = P(!1), G = o ? "#ffffff" : "#111827", R = o ? "#a1a1aa" : "#6b7280", z = o ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.02)", M = o ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)";
|
|
3719
|
+
Ce.useEffect(() => {
|
|
3720
3720
|
if (typeof window < "u") {
|
|
3721
|
-
const m = () =>
|
|
3721
|
+
const m = () => T(window.innerWidth < 768);
|
|
3722
3722
|
return m(), window.addEventListener("resize", m), () => window.removeEventListener("resize", m);
|
|
3723
3723
|
}
|
|
3724
3724
|
}, []);
|
|
3725
3725
|
const K = async (m) => {
|
|
3726
|
-
m.preventDefault(),
|
|
3726
|
+
m.preventDefault(), C(!0), A(null);
|
|
3727
3727
|
try {
|
|
3728
|
-
const S = await
|
|
3728
|
+
const S = await p.loginUser({ email: N, password: j }), { user: D } = S;
|
|
3729
3729
|
if (!D)
|
|
3730
3730
|
throw new Error(S.message || "Login failed");
|
|
3731
3731
|
if (typeof document < "u") {
|
|
@@ -3735,19 +3735,19 @@ const Ns = [
|
|
|
3735
3735
|
A({ type: "success", text: `Welcome ${D.name}` }), d?.(D);
|
|
3736
3736
|
} catch (S) {
|
|
3737
3737
|
const D = S.message || "Login failed";
|
|
3738
|
-
A({ type: "error", text: D }),
|
|
3738
|
+
A({ type: "error", text: D }), f?.(S);
|
|
3739
3739
|
} finally {
|
|
3740
|
-
|
|
3740
|
+
C(!1);
|
|
3741
3741
|
}
|
|
3742
3742
|
}, H = (m) => {
|
|
3743
3743
|
X({ ...I, [m.target.name]: m.target.value });
|
|
3744
3744
|
}, F = async (m) => {
|
|
3745
|
-
m.preventDefault(),
|
|
3745
|
+
m.preventDefault(), C(!0), A(null);
|
|
3746
3746
|
try {
|
|
3747
|
-
const S = await
|
|
3747
|
+
const S = await p.requestResetUserPasswordOTP({
|
|
3748
3748
|
email: I.email
|
|
3749
3749
|
});
|
|
3750
|
-
S.success ? (
|
|
3750
|
+
S.success ? (u(2), A({
|
|
3751
3751
|
type: "success",
|
|
3752
3752
|
text: S.message || "OTP sent to your email"
|
|
3753
3753
|
})) : A({
|
|
@@ -3760,12 +3760,12 @@ const Ns = [
|
|
|
3760
3760
|
text: S.message || "Something went wrong"
|
|
3761
3761
|
});
|
|
3762
3762
|
} finally {
|
|
3763
|
-
|
|
3763
|
+
C(!1);
|
|
3764
3764
|
}
|
|
3765
3765
|
}, Y = async (m) => {
|
|
3766
|
-
m.preventDefault(),
|
|
3766
|
+
m.preventDefault(), C(!0), A(null);
|
|
3767
3767
|
try {
|
|
3768
|
-
const S = await
|
|
3768
|
+
const S = await p.resetUserPassword({
|
|
3769
3769
|
email: I.email,
|
|
3770
3770
|
otp: I.otp,
|
|
3771
3771
|
newPassword: I.newPassword
|
|
@@ -3773,14 +3773,14 @@ const Ns = [
|
|
|
3773
3773
|
S.success ? (A({
|
|
3774
3774
|
type: "success",
|
|
3775
3775
|
text: S.message || "Password reset successfully!"
|
|
3776
|
-
}),
|
|
3776
|
+
}), u(1), X({ email: "", otp: "", newPassword: "" }), k("login")) : A({ type: "error", text: S.message || "Reset failed" });
|
|
3777
3777
|
} catch (S) {
|
|
3778
3778
|
A({
|
|
3779
3779
|
type: "error",
|
|
3780
3780
|
text: S.message || "Something went wrong"
|
|
3781
3781
|
});
|
|
3782
3782
|
} finally {
|
|
3783
|
-
|
|
3783
|
+
C(!1);
|
|
3784
3784
|
}
|
|
3785
3785
|
}, l = {
|
|
3786
3786
|
width: "100%",
|
|
@@ -3858,7 +3858,7 @@ const Ns = [
|
|
|
3858
3858
|
color: G,
|
|
3859
3859
|
margin: 0
|
|
3860
3860
|
},
|
|
3861
|
-
children: y === "login" ? n :
|
|
3861
|
+
children: y === "login" ? n : E === 1 ? "Forgot Password" : "Reset Password"
|
|
3862
3862
|
}
|
|
3863
3863
|
),
|
|
3864
3864
|
/* @__PURE__ */ r.jsx(
|
|
@@ -4016,7 +4016,7 @@ const Ns = [
|
|
|
4016
4016
|
"button",
|
|
4017
4017
|
{
|
|
4018
4018
|
type: "button",
|
|
4019
|
-
onClick: () =>
|
|
4019
|
+
onClick: () => k("forgot"),
|
|
4020
4020
|
style: {
|
|
4021
4021
|
background: "none",
|
|
4022
4022
|
border: "none",
|
|
@@ -4053,10 +4053,10 @@ const Ns = [
|
|
|
4053
4053
|
y === "forgot" && /* @__PURE__ */ r.jsxs(
|
|
4054
4054
|
"form",
|
|
4055
4055
|
{
|
|
4056
|
-
onSubmit:
|
|
4056
|
+
onSubmit: E === 1 ? F : Y,
|
|
4057
4057
|
style: { display: "flex", flexDirection: "column", gap: "14px" },
|
|
4058
4058
|
children: [
|
|
4059
|
-
|
|
4059
|
+
E === 1 ? /* @__PURE__ */ r.jsxs(
|
|
4060
4060
|
"div",
|
|
4061
4061
|
{
|
|
4062
4062
|
style: { display: "flex", flexDirection: "column", gap: "4px" },
|
|
@@ -4220,7 +4220,7 @@ const Ns = [
|
|
|
4220
4220
|
borderRadius: "10px",
|
|
4221
4221
|
fontWeight: 600
|
|
4222
4222
|
},
|
|
4223
|
-
children: O ? "Please wait..." :
|
|
4223
|
+
children: O ? "Please wait..." : E === 1 ? "Send Reset OTP" : "Reset Password"
|
|
4224
4224
|
}
|
|
4225
4225
|
),
|
|
4226
4226
|
/* @__PURE__ */ r.jsx(
|
|
@@ -4228,7 +4228,7 @@ const Ns = [
|
|
|
4228
4228
|
{
|
|
4229
4229
|
type: "button",
|
|
4230
4230
|
onClick: () => {
|
|
4231
|
-
|
|
4231
|
+
k("login"), u(1);
|
|
4232
4232
|
},
|
|
4233
4233
|
style: {
|
|
4234
4234
|
background: "none",
|
|
@@ -4291,14 +4291,22 @@ const Ns = [
|
|
|
4291
4291
|
children: t,
|
|
4292
4292
|
fallback: e = null
|
|
4293
4293
|
}) => {
|
|
4294
|
-
const
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
|
|
4301
|
-
|
|
4294
|
+
const n = fe(), [s, i] = P("loading");
|
|
4295
|
+
ee(() => {
|
|
4296
|
+
(async () => {
|
|
4297
|
+
if (!(document.cookie.split(";").map((p) => p.trim()).find((p) => p.startsWith("a_s_b="))?.split("=")[1] === "true")) {
|
|
4298
|
+
i("unauthenticated");
|
|
4299
|
+
return;
|
|
4300
|
+
}
|
|
4301
|
+
try {
|
|
4302
|
+
(await n.checkUserSession())?.user?.id ? i("authenticated") : (document.cookie = "a_s_b=false; path=/; max-age=0; SameSite=Lax", i("unauthenticated"));
|
|
4303
|
+
} catch (p) {
|
|
4304
|
+
console.error("Session validation failed:", p), document.cookie = "a_s_b=false; path=/; max-age=0; SameSite=Lax", i("unauthenticated");
|
|
4305
|
+
}
|
|
4306
|
+
})();
|
|
4307
|
+
}, [n]);
|
|
4308
|
+
const a = (o) => typeof o == "function" ? o() : o;
|
|
4309
|
+
return s === "loading" ? null : s === "unauthenticated" ? a(e) ?? null : /* @__PURE__ */ r.jsx(r.Fragment, { children: t });
|
|
4302
4310
|
}, fi = ({
|
|
4303
4311
|
children: t,
|
|
4304
4312
|
fallback: e = null
|
|
@@ -4306,7 +4314,7 @@ const Ns = [
|
|
|
4306
4314
|
const [n, s] = P(!1), [i, a] = P(null);
|
|
4307
4315
|
if (ee(() => {
|
|
4308
4316
|
s(!0);
|
|
4309
|
-
const d = document.cookie.split(";").map((
|
|
4317
|
+
const d = document.cookie.split(";").map((f) => f.trim()).find((f) => f.startsWith("a_s_b="));
|
|
4310
4318
|
a(d?.split("=")[1] !== "true");
|
|
4311
4319
|
}, []), !n) return null;
|
|
4312
4320
|
const o = (c) => typeof c == "function" ? c() : c;
|
|
@@ -4319,31 +4327,31 @@ const Ns = [
|
|
|
4319
4327
|
userId: i,
|
|
4320
4328
|
colors: a
|
|
4321
4329
|
}) => {
|
|
4322
|
-
const o =
|
|
4330
|
+
const o = fe(), [c, d] = P(!1), [f, p] = P(""), [y, k] = P("warning"), [E, u] = P(!1);
|
|
4323
4331
|
if (ee(() => {
|
|
4324
4332
|
if (typeof window > "u") return;
|
|
4325
4333
|
const g = () => {
|
|
4326
|
-
|
|
4334
|
+
u(window.innerWidth < 640);
|
|
4327
4335
|
};
|
|
4328
4336
|
return g(), window.addEventListener("resize", g), () => window.removeEventListener("resize", g);
|
|
4329
4337
|
}, []), !t) return null;
|
|
4330
4338
|
const w = async () => {
|
|
4331
|
-
d(!0),
|
|
4339
|
+
d(!0), k("processing");
|
|
4332
4340
|
try {
|
|
4333
4341
|
const g = await o.deleteUser({
|
|
4334
4342
|
userId: i
|
|
4335
4343
|
});
|
|
4336
|
-
g.success ? (n(g.message || "Account deleted successfully"),
|
|
4344
|
+
g.success ? (n(g.message || "Account deleted successfully"), k("success"), setTimeout(() => {
|
|
4337
4345
|
localStorage.removeItem("userInfo"), localStorage.removeItem("userToken"), window.location.href = "/";
|
|
4338
|
-
}, 2e3)) : (s(g.message || "Failed to delete account"),
|
|
4346
|
+
}, 2e3)) : (s(g.message || "Failed to delete account"), k("warning"));
|
|
4339
4347
|
} catch (g) {
|
|
4340
|
-
s(g.response?.data?.message || "Something went wrong"),
|
|
4348
|
+
s(g.response?.data?.message || "Something went wrong"), k("warning");
|
|
4341
4349
|
} finally {
|
|
4342
4350
|
d(!1);
|
|
4343
4351
|
}
|
|
4344
|
-
}, h =
|
|
4352
|
+
}, h = f.toLowerCase() === "delete my account", O = (g) => {
|
|
4345
4353
|
g.target === g.currentTarget && y !== "processing" && y !== "success" && e();
|
|
4346
|
-
},
|
|
4354
|
+
}, C = () => {
|
|
4347
4355
|
switch (y) {
|
|
4348
4356
|
case "warning":
|
|
4349
4357
|
return /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
@@ -4521,7 +4529,7 @@ const Ns = [
|
|
|
4521
4529
|
style: {
|
|
4522
4530
|
display: "flex",
|
|
4523
4531
|
gap: "12px",
|
|
4524
|
-
flexDirection:
|
|
4532
|
+
flexDirection: E ? "column-reverse" : "row",
|
|
4525
4533
|
justifyContent: "flex-end",
|
|
4526
4534
|
alignItems: "stretch"
|
|
4527
4535
|
},
|
|
@@ -4539,8 +4547,8 @@ const Ns = [
|
|
|
4539
4547
|
fontSize: "14px",
|
|
4540
4548
|
fontWeight: 500,
|
|
4541
4549
|
cursor: "pointer",
|
|
4542
|
-
flex:
|
|
4543
|
-
minWidth:
|
|
4550
|
+
flex: E ? "none" : 1,
|
|
4551
|
+
minWidth: E ? "100%" : "120px",
|
|
4544
4552
|
transition: "all 0.2s ease"
|
|
4545
4553
|
},
|
|
4546
4554
|
onMouseOver: (g) => {
|
|
@@ -4555,7 +4563,7 @@ const Ns = [
|
|
|
4555
4563
|
/* @__PURE__ */ r.jsxs(
|
|
4556
4564
|
"button",
|
|
4557
4565
|
{
|
|
4558
|
-
onClick: () =>
|
|
4566
|
+
onClick: () => k("confirmation"),
|
|
4559
4567
|
style: {
|
|
4560
4568
|
padding: "10px 24px",
|
|
4561
4569
|
borderRadius: "10px",
|
|
@@ -4565,8 +4573,8 @@ const Ns = [
|
|
|
4565
4573
|
fontSize: "14px",
|
|
4566
4574
|
fontWeight: 600,
|
|
4567
4575
|
cursor: "pointer",
|
|
4568
|
-
flex:
|
|
4569
|
-
minWidth:
|
|
4576
|
+
flex: E ? "none" : 1,
|
|
4577
|
+
minWidth: E ? "100%" : "140px",
|
|
4570
4578
|
display: "flex",
|
|
4571
4579
|
alignItems: "center",
|
|
4572
4580
|
justifyContent: "center",
|
|
@@ -4658,8 +4666,8 @@ const Ns = [
|
|
|
4658
4666
|
"input",
|
|
4659
4667
|
{
|
|
4660
4668
|
type: "text",
|
|
4661
|
-
value:
|
|
4662
|
-
onChange: (g) =>
|
|
4669
|
+
value: f,
|
|
4670
|
+
onChange: (g) => p(g.target.value),
|
|
4663
4671
|
placeholder: "delete my account",
|
|
4664
4672
|
style: {
|
|
4665
4673
|
width: "100%",
|
|
@@ -4716,7 +4724,7 @@ const Ns = [
|
|
|
4716
4724
|
"button",
|
|
4717
4725
|
{
|
|
4718
4726
|
onClick: () => {
|
|
4719
|
-
|
|
4727
|
+
k("warning"), p("");
|
|
4720
4728
|
},
|
|
4721
4729
|
style: {
|
|
4722
4730
|
padding: "10px 24px",
|
|
@@ -4727,8 +4735,8 @@ const Ns = [
|
|
|
4727
4735
|
fontSize: "14px",
|
|
4728
4736
|
fontWeight: 500,
|
|
4729
4737
|
cursor: "pointer",
|
|
4730
|
-
flex:
|
|
4731
|
-
minWidth:
|
|
4738
|
+
flex: E ? "none" : 1,
|
|
4739
|
+
minWidth: E ? "100%" : "120px",
|
|
4732
4740
|
transition: "all 0.2s ease"
|
|
4733
4741
|
},
|
|
4734
4742
|
onMouseOver: (g) => {
|
|
@@ -4754,8 +4762,8 @@ const Ns = [
|
|
|
4754
4762
|
fontSize: "14px",
|
|
4755
4763
|
fontWeight: 600,
|
|
4756
4764
|
cursor: !h || c ? "not-allowed" : "pointer",
|
|
4757
|
-
flex:
|
|
4758
|
-
minWidth:
|
|
4765
|
+
flex: E ? "none" : 1,
|
|
4766
|
+
minWidth: E ? "100%" : "140px",
|
|
4759
4767
|
opacity: !h || c ? 0.6 : 1,
|
|
4760
4768
|
display: "flex",
|
|
4761
4769
|
alignItems: "center",
|
|
@@ -5101,7 +5109,7 @@ const Ns = [
|
|
|
5101
5109
|
animation: "scaleIn 0.3s ease-out"
|
|
5102
5110
|
},
|
|
5103
5111
|
className: "delete-modal-container",
|
|
5104
|
-
children:
|
|
5112
|
+
children: C()
|
|
5105
5113
|
}
|
|
5106
5114
|
),
|
|
5107
5115
|
/* @__PURE__ */ r.jsx("style", { children: `
|
|
@@ -5168,20 +5176,20 @@ const Ns = [
|
|
|
5168
5176
|
onUpdate: n,
|
|
5169
5177
|
colors: s
|
|
5170
5178
|
}) => {
|
|
5171
|
-
const [i, a] = P(""), [o, c] = P(!1), [d,
|
|
5179
|
+
const [i, a] = P(""), [o, c] = P(!1), [d, f] = P(!1), [p, y] = P({ isValid: !1, message: "", type: null });
|
|
5172
5180
|
if (ee(() => {
|
|
5173
5181
|
if (typeof window > "u") return;
|
|
5174
|
-
const
|
|
5175
|
-
|
|
5182
|
+
const u = () => {
|
|
5183
|
+
f(window.innerWidth < 640);
|
|
5176
5184
|
};
|
|
5177
|
-
return
|
|
5185
|
+
return u(), window.addEventListener("resize", u), () => window.removeEventListener("resize", u);
|
|
5178
5186
|
}, []), ee(() => {
|
|
5179
5187
|
if (!i.trim()) {
|
|
5180
5188
|
y({ isValid: !1, message: "", type: null });
|
|
5181
5189
|
return;
|
|
5182
5190
|
}
|
|
5183
5191
|
try {
|
|
5184
|
-
const
|
|
5192
|
+
const u = new URL(i), w = /\.(jpg|jpeg|png|gif|webp|svg)$/i.test(u.pathname);
|
|
5185
5193
|
y(w ? {
|
|
5186
5194
|
isValid: !0,
|
|
5187
5195
|
message: "Valid image URL",
|
|
@@ -5199,8 +5207,8 @@ const Ns = [
|
|
|
5199
5207
|
});
|
|
5200
5208
|
}
|
|
5201
5209
|
}, [i]), !t) return null;
|
|
5202
|
-
const
|
|
5203
|
-
if (!(!i || !
|
|
5210
|
+
const k = async () => {
|
|
5211
|
+
if (!(!i || !p.isValid)) {
|
|
5204
5212
|
c(!0);
|
|
5205
5213
|
try {
|
|
5206
5214
|
await n(i) && (a(""), e());
|
|
@@ -5208,8 +5216,8 @@ const Ns = [
|
|
|
5208
5216
|
c(!1);
|
|
5209
5217
|
}
|
|
5210
5218
|
}
|
|
5211
|
-
},
|
|
5212
|
-
|
|
5219
|
+
}, E = (u) => {
|
|
5220
|
+
u.target === u.currentTarget && e();
|
|
5213
5221
|
};
|
|
5214
5222
|
return /* @__PURE__ */ r.jsxs(
|
|
5215
5223
|
"div",
|
|
@@ -5225,7 +5233,7 @@ const Ns = [
|
|
|
5225
5233
|
padding: "16px",
|
|
5226
5234
|
zIndex: 1e3
|
|
5227
5235
|
},
|
|
5228
|
-
onClick:
|
|
5236
|
+
onClick: E,
|
|
5229
5237
|
children: [
|
|
5230
5238
|
/* @__PURE__ */ r.jsxs(
|
|
5231
5239
|
"div",
|
|
@@ -5316,11 +5324,11 @@ const Ns = [
|
|
|
5316
5324
|
flexShrink: 0,
|
|
5317
5325
|
transition: "all 0.2s ease"
|
|
5318
5326
|
},
|
|
5319
|
-
onMouseOver: (
|
|
5320
|
-
|
|
5327
|
+
onMouseOver: (u) => {
|
|
5328
|
+
u.currentTarget.style.backgroundColor = s.border, u.currentTarget.style.color = s.textPrimary;
|
|
5321
5329
|
},
|
|
5322
|
-
onMouseOut: (
|
|
5323
|
-
|
|
5330
|
+
onMouseOut: (u) => {
|
|
5331
|
+
u.currentTarget.style.backgroundColor = "transparent", u.currentTarget.style.color = s.textTertiary;
|
|
5324
5332
|
},
|
|
5325
5333
|
children: /* @__PURE__ */ r.jsx(Ie, { size: 20 })
|
|
5326
5334
|
}
|
|
@@ -5365,13 +5373,13 @@ const Ns = [
|
|
|
5365
5373
|
id: "avatar-url",
|
|
5366
5374
|
placeholder: "https://example.com/your-avatar.jpg",
|
|
5367
5375
|
value: i,
|
|
5368
|
-
onChange: (
|
|
5376
|
+
onChange: (u) => a(u.target.value),
|
|
5369
5377
|
style: {
|
|
5370
5378
|
width: "100%",
|
|
5371
5379
|
padding: "14px 16px",
|
|
5372
5380
|
paddingLeft: "44px",
|
|
5373
5381
|
borderRadius: "12px",
|
|
5374
|
-
border: `1.5px solid ${
|
|
5382
|
+
border: `1.5px solid ${p.type === "error" ? s.error : p.type === "success" ? s.success : s.border}`,
|
|
5375
5383
|
backgroundColor: "transparent",
|
|
5376
5384
|
color: s.textPrimary,
|
|
5377
5385
|
fontSize: "15px",
|
|
@@ -5379,11 +5387,11 @@ const Ns = [
|
|
|
5379
5387
|
transition: "all 0.2s ease",
|
|
5380
5388
|
boxSizing: "border-box"
|
|
5381
5389
|
},
|
|
5382
|
-
onFocus: (
|
|
5383
|
-
|
|
5390
|
+
onFocus: (u) => {
|
|
5391
|
+
u.target.style.borderColor = s.accent, u.target.style.boxShadow = `0 0 0 3px ${s.accent}20`;
|
|
5384
5392
|
},
|
|
5385
|
-
onBlur: (
|
|
5386
|
-
|
|
5393
|
+
onBlur: (u) => {
|
|
5394
|
+
u.target.style.borderColor = p.type === "error" ? s.error : p.type === "success" ? s.success : s.border, u.target.style.boxShadow = "none";
|
|
5387
5395
|
},
|
|
5388
5396
|
disabled: o
|
|
5389
5397
|
}
|
|
@@ -5402,7 +5410,7 @@ const Ns = [
|
|
|
5402
5410
|
}
|
|
5403
5411
|
)
|
|
5404
5412
|
] }),
|
|
5405
|
-
|
|
5413
|
+
p.message && /* @__PURE__ */ r.jsxs(
|
|
5406
5414
|
"div",
|
|
5407
5415
|
{
|
|
5408
5416
|
style: {
|
|
@@ -5411,18 +5419,18 @@ const Ns = [
|
|
|
5411
5419
|
gap: "6px",
|
|
5412
5420
|
marginTop: "8px",
|
|
5413
5421
|
fontSize: "13px",
|
|
5414
|
-
color:
|
|
5422
|
+
color: p.type === "success" ? s.success : p.type === "error" ? s.error : s.textTertiary
|
|
5415
5423
|
},
|
|
5416
5424
|
children: [
|
|
5417
|
-
|
|
5418
|
-
|
|
5419
|
-
|
|
5420
|
-
|
|
5425
|
+
p.type === "success" && /* @__PURE__ */ r.jsx(ue, { size: 14 }),
|
|
5426
|
+
p.type === "error" && /* @__PURE__ */ r.jsx(se, { size: 14 }),
|
|
5427
|
+
p.type === "warning" && /* @__PURE__ */ r.jsx(se, { size: 14 }),
|
|
5428
|
+
p.message
|
|
5421
5429
|
]
|
|
5422
5430
|
}
|
|
5423
5431
|
)
|
|
5424
5432
|
] }),
|
|
5425
|
-
i &&
|
|
5433
|
+
i && p.type === "success" && /* @__PURE__ */ r.jsxs(
|
|
5426
5434
|
"div",
|
|
5427
5435
|
{
|
|
5428
5436
|
style: {
|
|
@@ -5458,8 +5466,8 @@ const Ns = [
|
|
|
5458
5466
|
border: `2px solid ${s.success}40`,
|
|
5459
5467
|
margin: "0 auto"
|
|
5460
5468
|
},
|
|
5461
|
-
onError: (
|
|
5462
|
-
|
|
5469
|
+
onError: (u) => {
|
|
5470
|
+
u.currentTarget.style.display = "none";
|
|
5463
5471
|
}
|
|
5464
5472
|
}
|
|
5465
5473
|
)
|
|
@@ -5500,11 +5508,11 @@ const Ns = [
|
|
|
5500
5508
|
opacity: o ? 0.6 : 1,
|
|
5501
5509
|
transition: "all 0.2s ease"
|
|
5502
5510
|
},
|
|
5503
|
-
onMouseOver: (
|
|
5504
|
-
o || (
|
|
5511
|
+
onMouseOver: (u) => {
|
|
5512
|
+
o || (u.currentTarget.style.backgroundColor = s.border, u.currentTarget.style.transform = "translateY(-1px)");
|
|
5505
5513
|
},
|
|
5506
|
-
onMouseOut: (
|
|
5507
|
-
o || (
|
|
5514
|
+
onMouseOut: (u) => {
|
|
5515
|
+
o || (u.currentTarget.style.backgroundColor = "transparent", u.currentTarget.style.transform = "translateY(0)");
|
|
5508
5516
|
},
|
|
5509
5517
|
children: "Cancel"
|
|
5510
5518
|
}
|
|
@@ -5512,8 +5520,8 @@ const Ns = [
|
|
|
5512
5520
|
/* @__PURE__ */ r.jsx(
|
|
5513
5521
|
"button",
|
|
5514
5522
|
{
|
|
5515
|
-
onClick:
|
|
5516
|
-
disabled: o || !
|
|
5523
|
+
onClick: k,
|
|
5524
|
+
disabled: o || !p.isValid,
|
|
5517
5525
|
style: {
|
|
5518
5526
|
padding: "10px 24px",
|
|
5519
5527
|
borderRadius: "10px",
|
|
@@ -5522,22 +5530,22 @@ const Ns = [
|
|
|
5522
5530
|
color: "#fff",
|
|
5523
5531
|
fontSize: "14px",
|
|
5524
5532
|
fontWeight: 600,
|
|
5525
|
-
cursor: o || !
|
|
5533
|
+
cursor: o || !p.isValid ? "not-allowed" : "pointer",
|
|
5526
5534
|
flex: d ? "none" : 1,
|
|
5527
5535
|
minWidth: d ? "100%" : "140px",
|
|
5528
|
-
opacity: o || !
|
|
5536
|
+
opacity: o || !p.isValid ? 0.6 : 1,
|
|
5529
5537
|
display: "flex",
|
|
5530
5538
|
alignItems: "center",
|
|
5531
5539
|
justifyContent: "center",
|
|
5532
5540
|
gap: "8px",
|
|
5533
5541
|
transition: "all 0.2s ease",
|
|
5534
|
-
boxShadow: o || !
|
|
5542
|
+
boxShadow: o || !p.isValid ? "none" : `0 4px 12px ${s.accent}40`
|
|
5535
5543
|
},
|
|
5536
|
-
onMouseOver: (
|
|
5537
|
-
!o &&
|
|
5544
|
+
onMouseOver: (u) => {
|
|
5545
|
+
!o && p.isValid && (u.currentTarget.style.transform = "translateY(-1px)", u.currentTarget.style.boxShadow = `0 6px 20px ${s.accent}60`);
|
|
5538
5546
|
},
|
|
5539
|
-
onMouseOut: (
|
|
5540
|
-
!o &&
|
|
5547
|
+
onMouseOut: (u) => {
|
|
5548
|
+
!o && p.isValid && (u.currentTarget.style.transform = "translateY(0)", u.currentTarget.style.boxShadow = `0 4px 12px ${s.accent}40`);
|
|
5541
5549
|
},
|
|
5542
5550
|
children: o ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
5543
5551
|
/* @__PURE__ */ r.jsx(
|
|
@@ -5622,16 +5630,16 @@ const Ns = [
|
|
|
5622
5630
|
userId: i,
|
|
5623
5631
|
colors: a
|
|
5624
5632
|
}) => {
|
|
5625
|
-
const o =
|
|
5633
|
+
const o = fe(), [c, d] = P({
|
|
5626
5634
|
currentPassword: "",
|
|
5627
5635
|
newPassword: "",
|
|
5628
5636
|
confirmPassword: ""
|
|
5629
|
-
}), [
|
|
5637
|
+
}), [f, p] = P({}), [y, k] = P(!1), [E, u] = P({
|
|
5630
5638
|
currentPassword: !1,
|
|
5631
5639
|
newPassword: !1,
|
|
5632
5640
|
confirmPassword: !1
|
|
5633
5641
|
}), [w, h] = P(!1);
|
|
5634
|
-
if (
|
|
5642
|
+
if (Ce.useEffect(() => {
|
|
5635
5643
|
if (typeof window > "u") return;
|
|
5636
5644
|
const b = () => {
|
|
5637
5645
|
h(window.innerWidth < 640);
|
|
@@ -5640,15 +5648,15 @@ const Ns = [
|
|
|
5640
5648
|
}, []), !t) return null;
|
|
5641
5649
|
const O = (b) => {
|
|
5642
5650
|
const { name: j, value: q } = b.target;
|
|
5643
|
-
d((I) => ({ ...I, [j]: q })),
|
|
5644
|
-
},
|
|
5645
|
-
|
|
5651
|
+
d((I) => ({ ...I, [j]: q })), f[j] && p((I) => ({ ...I, [j]: "" }));
|
|
5652
|
+
}, C = (b) => {
|
|
5653
|
+
u((j) => ({ ...j, [b]: !j[b] }));
|
|
5646
5654
|
}, g = () => {
|
|
5647
5655
|
const b = {};
|
|
5648
|
-
return c.currentPassword || (b.currentPassword = "Current password is required"), c.newPassword ? c.newPassword.length < 6 && (b.newPassword = "Password must be at least 6 characters") : b.newPassword = "New password is required", c.newPassword !== c.confirmPassword && (b.confirmPassword = "Passwords do not match"),
|
|
5656
|
+
return c.currentPassword || (b.currentPassword = "Current password is required"), c.newPassword ? c.newPassword.length < 6 && (b.newPassword = "Password must be at least 6 characters") : b.newPassword = "New password is required", c.newPassword !== c.confirmPassword && (b.confirmPassword = "Passwords do not match"), p(b), Object.keys(b).length === 0;
|
|
5649
5657
|
}, A = async (b) => {
|
|
5650
5658
|
if (b.preventDefault(), !!g()) {
|
|
5651
|
-
|
|
5659
|
+
k(!0);
|
|
5652
5660
|
try {
|
|
5653
5661
|
const { data: j } = await o.changePassword({
|
|
5654
5662
|
currentPassword: c.currentPassword,
|
|
@@ -5663,7 +5671,7 @@ const Ns = [
|
|
|
5663
5671
|
} catch (j) {
|
|
5664
5672
|
s(j.response?.data?.message || "Something went wrong");
|
|
5665
5673
|
} finally {
|
|
5666
|
-
|
|
5674
|
+
k(!1);
|
|
5667
5675
|
}
|
|
5668
5676
|
}
|
|
5669
5677
|
}, N = [
|
|
@@ -5840,7 +5848,7 @@ const Ns = [
|
|
|
5840
5848
|
/* @__PURE__ */ r.jsx(
|
|
5841
5849
|
"input",
|
|
5842
5850
|
{
|
|
5843
|
-
type:
|
|
5851
|
+
type: E[b] ? "text" : "password",
|
|
5844
5852
|
id: b,
|
|
5845
5853
|
name: b,
|
|
5846
5854
|
placeholder: `Enter ${j.toLowerCase()}`,
|
|
@@ -5850,7 +5858,7 @@ const Ns = [
|
|
|
5850
5858
|
width: "100%",
|
|
5851
5859
|
padding: "14px 48px 14px 44px",
|
|
5852
5860
|
borderRadius: "10px",
|
|
5853
|
-
border: `1.5px solid ${
|
|
5861
|
+
border: `1.5px solid ${f[b] ? a.error : a.border}`,
|
|
5854
5862
|
backgroundColor: "transparent",
|
|
5855
5863
|
color: a.textPrimary,
|
|
5856
5864
|
fontSize: "15px",
|
|
@@ -5862,7 +5870,7 @@ const Ns = [
|
|
|
5862
5870
|
I.target.style.borderColor = a.accent, I.target.style.boxShadow = `0 0 0 3px ${a.accent}20`;
|
|
5863
5871
|
},
|
|
5864
5872
|
onBlur: (I) => {
|
|
5865
|
-
I.target.style.borderColor =
|
|
5873
|
+
I.target.style.borderColor = f[b] ? a.error : a.border, I.target.style.boxShadow = "none";
|
|
5866
5874
|
}
|
|
5867
5875
|
}
|
|
5868
5876
|
),
|
|
@@ -5870,7 +5878,7 @@ const Ns = [
|
|
|
5870
5878
|
"button",
|
|
5871
5879
|
{
|
|
5872
5880
|
type: "button",
|
|
5873
|
-
onClick: () =>
|
|
5881
|
+
onClick: () => C(b),
|
|
5874
5882
|
style: {
|
|
5875
5883
|
position: "absolute",
|
|
5876
5884
|
right: "14px",
|
|
@@ -5894,11 +5902,11 @@ const Ns = [
|
|
|
5894
5902
|
onMouseOut: (I) => {
|
|
5895
5903
|
I.currentTarget.style.backgroundColor = "transparent", I.currentTarget.style.color = a.textTertiary;
|
|
5896
5904
|
},
|
|
5897
|
-
children:
|
|
5905
|
+
children: E[b] ? /* @__PURE__ */ r.jsx(it, { size: 18 }) : /* @__PURE__ */ r.jsx(at, { size: 18 })
|
|
5898
5906
|
}
|
|
5899
5907
|
)
|
|
5900
5908
|
] }),
|
|
5901
|
-
|
|
5909
|
+
f[b] && /* @__PURE__ */ r.jsxs(
|
|
5902
5910
|
"div",
|
|
5903
5911
|
{
|
|
5904
5912
|
style: {
|
|
@@ -5911,7 +5919,7 @@ const Ns = [
|
|
|
5911
5919
|
},
|
|
5912
5920
|
children: [
|
|
5913
5921
|
/* @__PURE__ */ r.jsx("span", { style: { fontSize: "16px" }, children: "⚠" }),
|
|
5914
|
-
|
|
5922
|
+
f[b]
|
|
5915
5923
|
]
|
|
5916
5924
|
}
|
|
5917
5925
|
)
|
|
@@ -6061,8 +6069,8 @@ const Ns = [
|
|
|
6061
6069
|
otpSent: o,
|
|
6062
6070
|
verifying: c,
|
|
6063
6071
|
user: d,
|
|
6064
|
-
colors:
|
|
6065
|
-
darkMode:
|
|
6072
|
+
colors: f,
|
|
6073
|
+
darkMode: p
|
|
6066
6074
|
}) => {
|
|
6067
6075
|
if (!t) return null;
|
|
6068
6076
|
const y = () => {
|
|
@@ -6073,7 +6081,7 @@ const Ns = [
|
|
|
6073
6081
|
{
|
|
6074
6082
|
className: "modal-overlay",
|
|
6075
6083
|
style: {
|
|
6076
|
-
backgroundColor:
|
|
6084
|
+
backgroundColor: p ? "rgba(0, 0, 0, 0.8)" : "rgba(0, 0, 0, 0.5)"
|
|
6077
6085
|
},
|
|
6078
6086
|
children: [
|
|
6079
6087
|
/* @__PURE__ */ r.jsxs(
|
|
@@ -6081,18 +6089,18 @@ const Ns = [
|
|
|
6081
6089
|
{
|
|
6082
6090
|
className: "verify-email-modal",
|
|
6083
6091
|
style: {
|
|
6084
|
-
backgroundColor:
|
|
6085
|
-
border: `1px solid ${
|
|
6092
|
+
backgroundColor: f.surface,
|
|
6093
|
+
border: `1px solid ${f.border}`
|
|
6086
6094
|
},
|
|
6087
6095
|
children: [
|
|
6088
6096
|
/* @__PURE__ */ r.jsxs("div", { className: "modal-header", children: [
|
|
6089
|
-
/* @__PURE__ */ r.jsx("h3", { style: { color:
|
|
6097
|
+
/* @__PURE__ */ r.jsx("h3", { style: { color: f.textPrimary }, children: "Verify Your Email" }),
|
|
6090
6098
|
/* @__PURE__ */ r.jsx(
|
|
6091
6099
|
"button",
|
|
6092
6100
|
{
|
|
6093
6101
|
onClick: y,
|
|
6094
6102
|
className: "close-btn",
|
|
6095
|
-
style: { color:
|
|
6103
|
+
style: { color: f.textTertiary },
|
|
6096
6104
|
"aria-label": "Close verification modal",
|
|
6097
6105
|
children: /* @__PURE__ */ r.jsx(Ie, { size: 20, "aria-hidden": "true" })
|
|
6098
6106
|
}
|
|
@@ -6100,13 +6108,13 @@ const Ns = [
|
|
|
6100
6108
|
] }),
|
|
6101
6109
|
/* @__PURE__ */ r.jsxs("form", { className: "verify-form", onSubmit: n, children: [
|
|
6102
6110
|
/* @__PURE__ */ r.jsxs("div", { className: "form-group", children: [
|
|
6103
|
-
/* @__PURE__ */ r.jsx("label", { style: { color:
|
|
6111
|
+
/* @__PURE__ */ r.jsx("label", { style: { color: f.textSecondary }, children: "Email" }),
|
|
6104
6112
|
/* @__PURE__ */ r.jsxs("div", { className: "input-container", children: [
|
|
6105
6113
|
/* @__PURE__ */ r.jsx(
|
|
6106
6114
|
pe,
|
|
6107
6115
|
{
|
|
6108
6116
|
size: 18,
|
|
6109
|
-
style: { color:
|
|
6117
|
+
style: { color: f.textTertiary },
|
|
6110
6118
|
"aria-hidden": "true"
|
|
6111
6119
|
}
|
|
6112
6120
|
),
|
|
@@ -6115,15 +6123,15 @@ const Ns = [
|
|
|
6115
6123
|
{
|
|
6116
6124
|
type: "email",
|
|
6117
6125
|
value: i.email,
|
|
6118
|
-
onChange: (
|
|
6119
|
-
...
|
|
6120
|
-
email:
|
|
6126
|
+
onChange: (k) => a((E) => ({
|
|
6127
|
+
...E,
|
|
6128
|
+
email: k.target.value
|
|
6121
6129
|
})),
|
|
6122
6130
|
placeholder: "Enter your email",
|
|
6123
6131
|
style: {
|
|
6124
|
-
backgroundColor:
|
|
6125
|
-
color:
|
|
6126
|
-
borderColor:
|
|
6132
|
+
backgroundColor: f.surfaceLight,
|
|
6133
|
+
color: f.textPrimary,
|
|
6134
|
+
borderColor: f.border
|
|
6127
6135
|
},
|
|
6128
6136
|
required: !0,
|
|
6129
6137
|
"aria-required": "true",
|
|
@@ -6133,13 +6141,13 @@ const Ns = [
|
|
|
6133
6141
|
] })
|
|
6134
6142
|
] }),
|
|
6135
6143
|
o && /* @__PURE__ */ r.jsxs("div", { className: "form-group", children: [
|
|
6136
|
-
/* @__PURE__ */ r.jsx("label", { style: { color:
|
|
6144
|
+
/* @__PURE__ */ r.jsx("label", { style: { color: f.textSecondary }, children: "OTP" }),
|
|
6137
6145
|
/* @__PURE__ */ r.jsxs("div", { className: "input-container", children: [
|
|
6138
6146
|
/* @__PURE__ */ r.jsx(
|
|
6139
6147
|
ir,
|
|
6140
6148
|
{
|
|
6141
6149
|
size: 18,
|
|
6142
|
-
style: { color:
|
|
6150
|
+
style: { color: f.textTertiary },
|
|
6143
6151
|
"aria-hidden": "true"
|
|
6144
6152
|
}
|
|
6145
6153
|
),
|
|
@@ -6148,15 +6156,15 @@ const Ns = [
|
|
|
6148
6156
|
{
|
|
6149
6157
|
type: "text",
|
|
6150
6158
|
value: i.otp,
|
|
6151
|
-
onChange: (
|
|
6152
|
-
...
|
|
6153
|
-
otp:
|
|
6159
|
+
onChange: (k) => a((E) => ({
|
|
6160
|
+
...E,
|
|
6161
|
+
otp: k.target.value
|
|
6154
6162
|
})),
|
|
6155
6163
|
placeholder: "Enter OTP",
|
|
6156
6164
|
style: {
|
|
6157
|
-
backgroundColor:
|
|
6158
|
-
color:
|
|
6159
|
-
borderColor:
|
|
6165
|
+
backgroundColor: f.surfaceLight,
|
|
6166
|
+
color: f.textPrimary,
|
|
6167
|
+
borderColor: f.border
|
|
6160
6168
|
},
|
|
6161
6169
|
required: !0,
|
|
6162
6170
|
"aria-required": "true",
|
|
@@ -6172,7 +6180,7 @@ const Ns = [
|
|
|
6172
6180
|
disabled: c,
|
|
6173
6181
|
className: "btn-primary",
|
|
6174
6182
|
style: {
|
|
6175
|
-
background: `linear-gradient(to right, ${
|
|
6183
|
+
background: `linear-gradient(to right, ${f.accent}, ${f.accentHover})`,
|
|
6176
6184
|
opacity: c ? 0.7 : 1
|
|
6177
6185
|
},
|
|
6178
6186
|
"aria-label": c ? "Verifying email" : "Verify email",
|
|
@@ -6189,7 +6197,7 @@ const Ns = [
|
|
|
6189
6197
|
disabled: c,
|
|
6190
6198
|
className: "btn-primary",
|
|
6191
6199
|
style: {
|
|
6192
|
-
background: `linear-gradient(to right, ${
|
|
6200
|
+
background: `linear-gradient(to right, ${f.accent}, ${f.accentHover})`,
|
|
6193
6201
|
opacity: c ? 0.7 : 1
|
|
6194
6202
|
},
|
|
6195
6203
|
"aria-label": c ? "Sending OTP" : "Send OTP",
|
|
@@ -6252,7 +6260,7 @@ const Ns = [
|
|
|
6252
6260
|
}
|
|
6253
6261
|
|
|
6254
6262
|
.close-btn:hover {
|
|
6255
|
-
background-color: ${
|
|
6263
|
+
background-color: ${p ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)"};
|
|
6256
6264
|
}
|
|
6257
6265
|
|
|
6258
6266
|
.verify-form {
|
|
@@ -6296,8 +6304,8 @@ const Ns = [
|
|
|
6296
6304
|
}
|
|
6297
6305
|
|
|
6298
6306
|
.input-container input:focus {
|
|
6299
|
-
border-color: ${
|
|
6300
|
-
box-shadow: 0 0 0 3px ${
|
|
6307
|
+
border-color: ${f.accent};
|
|
6308
|
+
box-shadow: 0 0 0 3px ${f.accent}20;
|
|
6301
6309
|
}
|
|
6302
6310
|
|
|
6303
6311
|
.modal-actions {
|
|
@@ -6361,7 +6369,7 @@ const Ns = [
|
|
|
6361
6369
|
onVerify: s,
|
|
6362
6370
|
primaryColor: i = "#00C212"
|
|
6363
6371
|
}) => {
|
|
6364
|
-
const a =
|
|
6372
|
+
const a = fe(), [o, c] = P(null), [d, f] = P(), [p, y] = P(!0), [k, E] = P(!1), [u, w] = P(!1), [h, O] = P(!1), [C, g] = P(!1), [A, N] = P(!1), [b, j] = P(!1), [q, I] = P(!1), [X, W] = P(!1), [T, G] = P(null), [R, z] = P(!1), [M, K] = P({
|
|
6365
6373
|
email: "",
|
|
6366
6374
|
otp: ""
|
|
6367
6375
|
}), [H, F] = P(!1), [Y, l] = P(!1);
|
|
@@ -6429,7 +6437,7 @@ const Ns = [
|
|
|
6429
6437
|
if (V) {
|
|
6430
6438
|
m("success", Z || "Email verified!");
|
|
6431
6439
|
const de = { ...d, isVerified: !0 };
|
|
6432
|
-
|
|
6440
|
+
f(de), typeof s == "function" && s(de), K({ email: de.email, otp: "" }), F(!1), j?.(!1);
|
|
6433
6441
|
} else
|
|
6434
6442
|
m("error", Z || "Verification failed");
|
|
6435
6443
|
} catch (U) {
|
|
@@ -6453,7 +6461,7 @@ const Ns = [
|
|
|
6453
6461
|
// 🔁 merge backend response if present
|
|
6454
6462
|
avatarUrl: v
|
|
6455
6463
|
};
|
|
6456
|
-
return
|
|
6464
|
+
return f(V), m("success", "Avatar updated successfully!"), !0;
|
|
6457
6465
|
}
|
|
6458
6466
|
return m("error", U?.message || "Failed to update avatar"), !1;
|
|
6459
6467
|
} catch (U) {
|
|
@@ -6475,10 +6483,10 @@ const Ns = [
|
|
|
6475
6483
|
// overwrite updated fields
|
|
6476
6484
|
isVerified: V ? !1 : d.isVerified
|
|
6477
6485
|
};
|
|
6478
|
-
|
|
6486
|
+
f(Z), localStorage.setItem("userInfo", JSON.stringify(Z)), m(
|
|
6479
6487
|
"success",
|
|
6480
6488
|
V ? "Email updated. Please verify your new email." : "Profile updated successfully"
|
|
6481
|
-
),
|
|
6489
|
+
), E(!1);
|
|
6482
6490
|
} else
|
|
6483
6491
|
m("error", U.message || "Update failed");
|
|
6484
6492
|
} catch (v) {
|
|
@@ -6490,7 +6498,7 @@ const Ns = [
|
|
|
6490
6498
|
}, le = async (v) => {
|
|
6491
6499
|
try {
|
|
6492
6500
|
const U = await a.checkIfUserExists(v);
|
|
6493
|
-
U?.success === !0 && U?.exists === !1 && (console.warn("❌ User does not exist on server. Clearing session..."), localStorage.removeItem("userInfo"),
|
|
6501
|
+
U?.success === !0 && U?.exists === !1 && (console.warn("❌ User does not exist on server. Clearing session..."), localStorage.removeItem("userInfo"), f(null));
|
|
6494
6502
|
} catch (U) {
|
|
6495
6503
|
console.error("⚠️ User validation request failed:", U);
|
|
6496
6504
|
}
|
|
@@ -6504,13 +6512,13 @@ const Ns = [
|
|
|
6504
6512
|
const V = U.user.id, Z = await a.getUserProfile({ userId: V });
|
|
6505
6513
|
if (Z.user) {
|
|
6506
6514
|
const de = Z.user;
|
|
6507
|
-
|
|
6515
|
+
f(de), le(V);
|
|
6508
6516
|
} else
|
|
6509
|
-
|
|
6517
|
+
f(null), localStorage.removeItem("userInfo");
|
|
6510
6518
|
} else
|
|
6511
|
-
|
|
6519
|
+
f(null), localStorage.removeItem("userInfo");
|
|
6512
6520
|
} catch (U) {
|
|
6513
|
-
console.error("User init failed:", U),
|
|
6521
|
+
console.error("User init failed:", U), f(null), localStorage.removeItem("userInfo");
|
|
6514
6522
|
} finally {
|
|
6515
6523
|
y(!1);
|
|
6516
6524
|
}
|
|
@@ -6550,7 +6558,7 @@ const Ns = [
|
|
|
6550
6558
|
border: "#e4e4e7",
|
|
6551
6559
|
warning: "#d97706"
|
|
6552
6560
|
};
|
|
6553
|
-
if (
|
|
6561
|
+
if (p)
|
|
6554
6562
|
return /* @__PURE__ */ r.jsx(
|
|
6555
6563
|
"div",
|
|
6556
6564
|
{
|
|
@@ -6640,7 +6648,7 @@ const Ns = [
|
|
|
6640
6648
|
value: d.phone || "Not set",
|
|
6641
6649
|
name: "phone",
|
|
6642
6650
|
type: "tel",
|
|
6643
|
-
icon:
|
|
6651
|
+
icon: Cs
|
|
6644
6652
|
},
|
|
6645
6653
|
{
|
|
6646
6654
|
label: "Address",
|
|
@@ -6664,7 +6672,7 @@ const Ns = [
|
|
|
6664
6672
|
minHeight: "80vh"
|
|
6665
6673
|
},
|
|
6666
6674
|
children: [
|
|
6667
|
-
|
|
6675
|
+
T && /* @__PURE__ */ r.jsxs(
|
|
6668
6676
|
"div",
|
|
6669
6677
|
{
|
|
6670
6678
|
style: {
|
|
@@ -6684,7 +6692,7 @@ const Ns = [
|
|
|
6684
6692
|
fontWeight: 500,
|
|
6685
6693
|
maxWidth: "400px",
|
|
6686
6694
|
animation: "slideIn 0.3s ease-out",
|
|
6687
|
-
...
|
|
6695
|
+
...T.type === "success" ? {
|
|
6688
6696
|
backgroundColor: t ? "rgba(16, 185, 129, 0.1)" : "rgba(16, 185, 129, 0.05)",
|
|
6689
6697
|
borderColor: t ? "rgba(16, 185, 129, 0.3)" : "rgba(16, 185, 129, 0.2)",
|
|
6690
6698
|
color: t ? "#34d399" : "#059669"
|
|
@@ -6697,8 +6705,8 @@ const Ns = [
|
|
|
6697
6705
|
role: "alert",
|
|
6698
6706
|
"aria-live": "polite",
|
|
6699
6707
|
children: [
|
|
6700
|
-
|
|
6701
|
-
|
|
6708
|
+
T.type === "success" ? /* @__PURE__ */ r.jsx(ue, { size: 20, "aria-hidden": "true" }) : /* @__PURE__ */ r.jsx(se, { size: 20, "aria-hidden": "true" }),
|
|
6709
|
+
T.message
|
|
6702
6710
|
]
|
|
6703
6711
|
}
|
|
6704
6712
|
),
|
|
@@ -6888,11 +6896,11 @@ const Ns = [
|
|
|
6888
6896
|
flexDirection: "column",
|
|
6889
6897
|
gap: "6px"
|
|
6890
6898
|
},
|
|
6891
|
-
children:
|
|
6899
|
+
children: k ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
6892
6900
|
/* @__PURE__ */ r.jsxs(
|
|
6893
6901
|
"button",
|
|
6894
6902
|
{
|
|
6895
|
-
onClick: () =>
|
|
6903
|
+
onClick: () => E(!1),
|
|
6896
6904
|
style: {
|
|
6897
6905
|
backgroundColor: _.surfaceLight,
|
|
6898
6906
|
border: `1px solid ${_.border}`,
|
|
@@ -6922,15 +6930,15 @@ const Ns = [
|
|
|
6922
6930
|
"button",
|
|
6923
6931
|
{
|
|
6924
6932
|
onClick: B,
|
|
6925
|
-
disabled:
|
|
6933
|
+
disabled: u,
|
|
6926
6934
|
style: {
|
|
6927
6935
|
background: `linear-gradient(to right, ${_.accent}, ${_.accentHover})`,
|
|
6928
|
-
opacity:
|
|
6936
|
+
opacity: u ? 0.7 : 1,
|
|
6929
6937
|
color: "white",
|
|
6930
6938
|
padding: "10px 20px",
|
|
6931
6939
|
borderRadius: "6px",
|
|
6932
6940
|
border: "none",
|
|
6933
|
-
cursor:
|
|
6941
|
+
cursor: u ? "not-allowed" : "pointer",
|
|
6934
6942
|
transition: "all 0.2s ease",
|
|
6935
6943
|
fontSize: "12px",
|
|
6936
6944
|
fontWeight: 500,
|
|
@@ -6943,7 +6951,7 @@ const Ns = [
|
|
|
6943
6951
|
flex: o && window.innerWidth < 1024 ? "1" : "auto"
|
|
6944
6952
|
},
|
|
6945
6953
|
children: [
|
|
6946
|
-
|
|
6954
|
+
u ? /* @__PURE__ */ r.jsx(
|
|
6947
6955
|
ie,
|
|
6948
6956
|
{
|
|
6949
6957
|
size: 16,
|
|
@@ -6951,7 +6959,7 @@ const Ns = [
|
|
|
6951
6959
|
"aria-hidden": "true"
|
|
6952
6960
|
}
|
|
6953
6961
|
) : /* @__PURE__ */ r.jsx(Rs, { size: 16, "aria-hidden": "true" }),
|
|
6954
|
-
|
|
6962
|
+
u ? "Saving..." : "Save Changes"
|
|
6955
6963
|
]
|
|
6956
6964
|
}
|
|
6957
6965
|
)
|
|
@@ -6959,7 +6967,7 @@ const Ns = [
|
|
|
6959
6967
|
/* @__PURE__ */ r.jsxs(
|
|
6960
6968
|
"button",
|
|
6961
6969
|
{
|
|
6962
|
-
onClick: () =>
|
|
6970
|
+
onClick: () => E(!0),
|
|
6963
6971
|
style: {
|
|
6964
6972
|
background: `linear-gradient(to right, ${_.accent}, ${_.accentHover})`,
|
|
6965
6973
|
color: "white",
|
|
@@ -6979,7 +6987,7 @@ const Ns = [
|
|
|
6979
6987
|
flex: o && window.innerWidth < 1024 ? "1" : "auto"
|
|
6980
6988
|
},
|
|
6981
6989
|
children: [
|
|
6982
|
-
/* @__PURE__ */ r.jsx(
|
|
6990
|
+
/* @__PURE__ */ r.jsx(ks, { size: 16, "aria-hidden": "true" }),
|
|
6983
6991
|
"Edit Profile"
|
|
6984
6992
|
]
|
|
6985
6993
|
}
|
|
@@ -7249,13 +7257,13 @@ const Ns = [
|
|
|
7249
7257
|
]
|
|
7250
7258
|
}
|
|
7251
7259
|
),
|
|
7252
|
-
|
|
7260
|
+
k ? /* @__PURE__ */ r.jsx(
|
|
7253
7261
|
"input",
|
|
7254
7262
|
{
|
|
7255
7263
|
type: v.type,
|
|
7256
7264
|
name: v.name,
|
|
7257
7265
|
value: d[v.name],
|
|
7258
|
-
onChange: (V) =>
|
|
7266
|
+
onChange: (V) => f(
|
|
7259
7267
|
(Z) => Z && { ...Z, [V.target.name]: V.target.value }
|
|
7260
7268
|
),
|
|
7261
7269
|
style: {
|
|
@@ -7447,7 +7455,7 @@ const Ns = [
|
|
|
7447
7455
|
qs,
|
|
7448
7456
|
{
|
|
7449
7457
|
userId: d.id,
|
|
7450
|
-
isOpen:
|
|
7458
|
+
isOpen: C,
|
|
7451
7459
|
onClose: () => g(!1),
|
|
7452
7460
|
onSuccess: (v) => m("success", v),
|
|
7453
7461
|
onError: (v) => m("error", v),
|
|
@@ -7587,15 +7595,15 @@ const Ns = [
|
|
|
7587
7595
|
settingsUrl: c,
|
|
7588
7596
|
// Menu item visibility with defaults
|
|
7589
7597
|
showProfileMenuItem: d = !0,
|
|
7590
|
-
showSettingsMenuItem:
|
|
7591
|
-
showViewProfileMenuItem:
|
|
7598
|
+
showSettingsMenuItem: f = !0,
|
|
7599
|
+
showViewProfileMenuItem: p = !0,
|
|
7592
7600
|
// Custom labels with defaults
|
|
7593
7601
|
profileLabel: y = "My Profile",
|
|
7594
|
-
settingsLabel:
|
|
7595
|
-
viewProfileLabel:
|
|
7596
|
-
logoutLabel:
|
|
7602
|
+
settingsLabel: k = "Settings",
|
|
7603
|
+
viewProfileLabel: E = "View Profile",
|
|
7604
|
+
logoutLabel: u = "Sign Out"
|
|
7597
7605
|
}) => {
|
|
7598
|
-
const w =
|
|
7606
|
+
const w = fe(), [h, O] = P(!1), [C, g] = P(null), [A, N] = P(!0), [b, j] = P(null), q = dt(null), I = dt(null), [X, W] = P(!1), [T, G] = P(!1);
|
|
7599
7607
|
ee(() => {
|
|
7600
7608
|
if (typeof window > "u") return;
|
|
7601
7609
|
const l = () => {
|
|
@@ -7689,19 +7697,19 @@ const Ns = [
|
|
|
7689
7697
|
avatarButton: {
|
|
7690
7698
|
display: "flex",
|
|
7691
7699
|
alignItems: "center",
|
|
7692
|
-
gap:
|
|
7693
|
-
padding:
|
|
7700
|
+
gap: T ? "6px" : "8px",
|
|
7701
|
+
padding: T ? "6px 10px 6px 6px" : "8px 12px 8px 8px",
|
|
7694
7702
|
borderRadius: "24px",
|
|
7695
7703
|
backgroundColor: R.surface,
|
|
7696
7704
|
cursor: "pointer",
|
|
7697
7705
|
transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
|
|
7698
|
-
minWidth:
|
|
7699
|
-
maxWidth:
|
|
7706
|
+
minWidth: T ? "auto" : "140px",
|
|
7707
|
+
maxWidth: T ? "200px" : "none",
|
|
7700
7708
|
outline: "none"
|
|
7701
7709
|
},
|
|
7702
7710
|
avatarImage: {
|
|
7703
|
-
width:
|
|
7704
|
-
height:
|
|
7711
|
+
width: T ? "28px" : "32px",
|
|
7712
|
+
height: T ? "28px" : "32px",
|
|
7705
7713
|
borderRadius: "50%",
|
|
7706
7714
|
objectFit: "cover",
|
|
7707
7715
|
border: `2px solid ${R.borderLight}`,
|
|
@@ -7716,23 +7724,23 @@ const Ns = [
|
|
|
7716
7724
|
overflow: "hidden"
|
|
7717
7725
|
},
|
|
7718
7726
|
userName: {
|
|
7719
|
-
fontSize:
|
|
7727
|
+
fontSize: T ? "13px" : "14px",
|
|
7720
7728
|
fontWeight: 600,
|
|
7721
7729
|
color: R.textPrimary,
|
|
7722
7730
|
lineHeight: "1.2",
|
|
7723
7731
|
whiteSpace: "nowrap",
|
|
7724
7732
|
overflow: "hidden",
|
|
7725
7733
|
textOverflow: "ellipsis",
|
|
7726
|
-
maxWidth:
|
|
7734
|
+
maxWidth: T ? "80px" : "120px"
|
|
7727
7735
|
},
|
|
7728
7736
|
userEmail: {
|
|
7729
|
-
fontSize:
|
|
7737
|
+
fontSize: T ? "11px" : "12px",
|
|
7730
7738
|
color: R.textTertiary,
|
|
7731
7739
|
lineHeight: "1.2",
|
|
7732
7740
|
whiteSpace: "nowrap",
|
|
7733
7741
|
overflow: "hidden",
|
|
7734
7742
|
textOverflow: "ellipsis",
|
|
7735
|
-
maxWidth:
|
|
7743
|
+
maxWidth: T ? "80px" : "120px"
|
|
7736
7744
|
},
|
|
7737
7745
|
chevron: {
|
|
7738
7746
|
transition: "transform 0.2s ease",
|
|
@@ -7761,7 +7769,7 @@ const Ns = [
|
|
|
7761
7769
|
overflow: "hidden"
|
|
7762
7770
|
},
|
|
7763
7771
|
dropdownSection: {
|
|
7764
|
-
padding:
|
|
7772
|
+
padding: T ? "10px 12px" : "0px 16px",
|
|
7765
7773
|
"&:last-child": {
|
|
7766
7774
|
borderBottom: "none"
|
|
7767
7775
|
}
|
|
@@ -7769,12 +7777,12 @@ const Ns = [
|
|
|
7769
7777
|
userSection: {
|
|
7770
7778
|
display: "flex",
|
|
7771
7779
|
alignItems: "center",
|
|
7772
|
-
gap:
|
|
7773
|
-
padding:
|
|
7780
|
+
gap: T ? "10px" : "12px",
|
|
7781
|
+
padding: T ? "14px" : "16px"
|
|
7774
7782
|
},
|
|
7775
7783
|
dropdownAvatar: {
|
|
7776
|
-
width:
|
|
7777
|
-
height:
|
|
7784
|
+
width: T ? "40px" : "48px",
|
|
7785
|
+
height: T ? "40px" : "48px",
|
|
7778
7786
|
borderRadius: "50%",
|
|
7779
7787
|
objectFit: "cover",
|
|
7780
7788
|
border: `2px solid ${R.borderLight}`,
|
|
@@ -7787,7 +7795,7 @@ const Ns = [
|
|
|
7787
7795
|
minWidth: 0
|
|
7788
7796
|
},
|
|
7789
7797
|
dropdownUserName: {
|
|
7790
|
-
fontSize:
|
|
7798
|
+
fontSize: T ? "15px" : "16px",
|
|
7791
7799
|
fontWeight: 600,
|
|
7792
7800
|
color: R.textPrimary,
|
|
7793
7801
|
lineHeight: "1.2",
|
|
@@ -7796,7 +7804,7 @@ const Ns = [
|
|
|
7796
7804
|
textOverflow: "ellipsis"
|
|
7797
7805
|
},
|
|
7798
7806
|
dropdownUserEmail: {
|
|
7799
|
-
fontSize:
|
|
7807
|
+
fontSize: T ? "13px" : "14px",
|
|
7800
7808
|
color: R.textSecondary,
|
|
7801
7809
|
lineHeight: "1.2",
|
|
7802
7810
|
overflow: "hidden",
|
|
@@ -7805,8 +7813,8 @@ const Ns = [
|
|
|
7805
7813
|
menuItem: {
|
|
7806
7814
|
display: "flex",
|
|
7807
7815
|
alignItems: "center",
|
|
7808
|
-
gap:
|
|
7809
|
-
padding:
|
|
7816
|
+
gap: T ? "10px" : "12px",
|
|
7817
|
+
padding: T ? "10px 12px" : "12px 16px",
|
|
7810
7818
|
borderRadius: "8px",
|
|
7811
7819
|
cursor: "pointer",
|
|
7812
7820
|
transition: "all 0.15s ease",
|
|
@@ -7815,7 +7823,7 @@ const Ns = [
|
|
|
7815
7823
|
border: "none",
|
|
7816
7824
|
background: "none",
|
|
7817
7825
|
width: "100%",
|
|
7818
|
-
fontSize:
|
|
7826
|
+
fontSize: T ? "13px" : "14px",
|
|
7819
7827
|
textAlign: "left",
|
|
7820
7828
|
outline: "none"
|
|
7821
7829
|
},
|
|
@@ -7823,38 +7831,38 @@ const Ns = [
|
|
|
7823
7831
|
flex: 1
|
|
7824
7832
|
},
|
|
7825
7833
|
icon: {
|
|
7826
|
-
width:
|
|
7827
|
-
height:
|
|
7834
|
+
width: T ? "16px" : "18px",
|
|
7835
|
+
height: T ? "16px" : "18px",
|
|
7828
7836
|
color: R.textSecondary,
|
|
7829
7837
|
flexShrink: 0
|
|
7830
7838
|
},
|
|
7831
7839
|
logoutButton: {
|
|
7832
7840
|
display: "flex",
|
|
7833
7841
|
alignItems: "center",
|
|
7834
|
-
gap:
|
|
7835
|
-
padding:
|
|
7842
|
+
gap: T ? "10px" : "12px",
|
|
7843
|
+
padding: T ? "10px 12px" : "12px 16px",
|
|
7836
7844
|
borderRadius: "8px",
|
|
7837
7845
|
cursor: "pointer",
|
|
7838
7846
|
transition: "all 0.15s ease",
|
|
7839
7847
|
background: "none",
|
|
7840
7848
|
border: "none",
|
|
7841
7849
|
width: "100%",
|
|
7842
|
-
fontSize:
|
|
7850
|
+
fontSize: T ? "13px" : "14px",
|
|
7843
7851
|
color: R.error,
|
|
7844
7852
|
textAlign: "left",
|
|
7845
7853
|
outline: "none"
|
|
7846
7854
|
},
|
|
7847
7855
|
loadingText: {
|
|
7848
|
-
padding:
|
|
7856
|
+
padding: T ? "16px 12px" : "20px 16px",
|
|
7849
7857
|
textAlign: "center",
|
|
7850
7858
|
color: R.textSecondary,
|
|
7851
|
-
fontSize:
|
|
7859
|
+
fontSize: T ? "13px" : "14px"
|
|
7852
7860
|
},
|
|
7853
7861
|
errorState: {
|
|
7854
|
-
padding:
|
|
7862
|
+
padding: T ? "16px 12px" : "20px 16px",
|
|
7855
7863
|
textAlign: "center",
|
|
7856
7864
|
color: R.textSecondary,
|
|
7857
|
-
fontSize:
|
|
7865
|
+
fontSize: T ? "13px" : "14px",
|
|
7858
7866
|
display: "flex",
|
|
7859
7867
|
alignItems: "center",
|
|
7860
7868
|
justifyContent: "center",
|
|
@@ -7901,7 +7909,7 @@ const Ns = [
|
|
|
7901
7909
|
}
|
|
7902
7910
|
}, K = (l, m) => {
|
|
7903
7911
|
(l.key === "Enter" || l.key === " ") && (l.preventDefault(), m());
|
|
7904
|
-
}, H = () => o ||
|
|
7912
|
+
}, H = () => o || C?.profileUrl, F = () => {
|
|
7905
7913
|
const l = H();
|
|
7906
7914
|
l && window.open(l, "_self", "noopener,noreferrer");
|
|
7907
7915
|
}, Y = () => {
|
|
@@ -7927,14 +7935,14 @@ const Ns = [
|
|
|
7927
7935
|
"aria-haspopup": "true",
|
|
7928
7936
|
"aria-expanded": h,
|
|
7929
7937
|
"aria-label": "Toggle user menu",
|
|
7930
|
-
children:
|
|
7938
|
+
children: C?.avatarUrl ? /* @__PURE__ */ r.jsx(
|
|
7931
7939
|
"img",
|
|
7932
7940
|
{
|
|
7933
|
-
src:
|
|
7934
|
-
alt: `${
|
|
7941
|
+
src: C.avatarUrl,
|
|
7942
|
+
alt: `${C?.name || "User"}'s avatar`,
|
|
7935
7943
|
style: {
|
|
7936
|
-
width:
|
|
7937
|
-
height:
|
|
7944
|
+
width: T ? "34px" : "36px",
|
|
7945
|
+
height: T ? "34px" : "36px",
|
|
7938
7946
|
borderRadius: "50%",
|
|
7939
7947
|
objectFit: "cover",
|
|
7940
7948
|
border: `2px solid ${R.borderLight}`,
|
|
@@ -7944,7 +7952,7 @@ const Ns = [
|
|
|
7944
7952
|
onError: (l) => {
|
|
7945
7953
|
const m = l.target;
|
|
7946
7954
|
m.onerror = null, m.src = `https://api.dicebear.com/9.x/initials/svg?seed=${encodeURIComponent(
|
|
7947
|
-
|
|
7955
|
+
C?.name || "User"
|
|
7948
7956
|
)}`;
|
|
7949
7957
|
}
|
|
7950
7958
|
}
|
|
@@ -7952,12 +7960,12 @@ const Ns = [
|
|
|
7952
7960
|
"img",
|
|
7953
7961
|
{
|
|
7954
7962
|
src: `https://api.dicebear.com/9.x/initials/svg?seed=${encodeURIComponent(
|
|
7955
|
-
|
|
7963
|
+
C?.name || "User"
|
|
7956
7964
|
)}`,
|
|
7957
7965
|
alt: "Default user avatar",
|
|
7958
7966
|
style: {
|
|
7959
|
-
width:
|
|
7960
|
-
height:
|
|
7967
|
+
width: T ? "34px" : "40px",
|
|
7968
|
+
height: T ? "34px" : "40px",
|
|
7961
7969
|
borderRadius: "50%",
|
|
7962
7970
|
objectFit: "cover",
|
|
7963
7971
|
border: `2px solid ${R.borderLight}`,
|
|
@@ -7989,11 +7997,11 @@ const Ns = [
|
|
|
7989
7997
|
l.currentTarget.style.outline = "none";
|
|
7990
7998
|
},
|
|
7991
7999
|
children: [
|
|
7992
|
-
|
|
8000
|
+
C?.avatarUrl ? /* @__PURE__ */ r.jsx(
|
|
7993
8001
|
"img",
|
|
7994
8002
|
{
|
|
7995
|
-
src:
|
|
7996
|
-
alt: `${
|
|
8003
|
+
src: C.avatarUrl,
|
|
8004
|
+
alt: `${C.name}'s avatar`,
|
|
7997
8005
|
style: z.avatarImage,
|
|
7998
8006
|
loading: "lazy",
|
|
7999
8007
|
onError: (l) => {
|
|
@@ -8010,14 +8018,14 @@ const Ns = [
|
|
|
8010
8018
|
loading: "lazy"
|
|
8011
8019
|
}
|
|
8012
8020
|
),
|
|
8013
|
-
!
|
|
8014
|
-
/* @__PURE__ */ r.jsx("div", { style: z.userName, title:
|
|
8015
|
-
|
|
8021
|
+
!T && /* @__PURE__ */ r.jsxs("div", { style: z.userInfo, children: [
|
|
8022
|
+
/* @__PURE__ */ r.jsx("div", { style: z.userName, title: C?.name, children: C?.name || "Guest" }),
|
|
8023
|
+
C?.email && /* @__PURE__ */ r.jsx("div", { style: z.userEmail, title: C.email, children: C.email })
|
|
8016
8024
|
] }),
|
|
8017
8025
|
/* @__PURE__ */ r.jsx(
|
|
8018
8026
|
Zn,
|
|
8019
8027
|
{
|
|
8020
|
-
size:
|
|
8028
|
+
size: T ? 14 : 16,
|
|
8021
8029
|
style: z.chevron,
|
|
8022
8030
|
"aria-hidden": "true"
|
|
8023
8031
|
}
|
|
@@ -8025,32 +8033,32 @@ const Ns = [
|
|
|
8025
8033
|
]
|
|
8026
8034
|
}
|
|
8027
8035
|
),
|
|
8028
|
-
h && /* @__PURE__ */ r.jsx("div", { style: z.dropdown, role: "menu", "aria-label": "User options", children: A ? /* @__PURE__ */ r.jsx("div", { style: z.loadingText, role: "status", "aria-live": "polite", children: "Loading user information..." }) :
|
|
8036
|
+
h && /* @__PURE__ */ r.jsx("div", { style: z.dropdown, role: "menu", "aria-label": "User options", children: A ? /* @__PURE__ */ r.jsx("div", { style: z.loadingText, role: "status", "aria-live": "polite", children: "Loading user information..." }) : C ? /* @__PURE__ */ r.jsxs(r.Fragment, { children: [
|
|
8029
8037
|
/* @__PURE__ */ r.jsxs("div", { style: z.userSection, children: [
|
|
8030
|
-
|
|
8038
|
+
C?.avatarUrl ? /* @__PURE__ */ r.jsx(
|
|
8031
8039
|
"img",
|
|
8032
8040
|
{
|
|
8033
|
-
src:
|
|
8034
|
-
alt: `${
|
|
8041
|
+
src: C.avatarUrl,
|
|
8042
|
+
alt: `${C.name}'s profile picture`,
|
|
8035
8043
|
style: z.dropdownAvatar,
|
|
8036
8044
|
loading: "lazy",
|
|
8037
8045
|
onError: (l) => {
|
|
8038
8046
|
const m = l.target;
|
|
8039
|
-
m.src = `https://api.dicebear.com/9.x/initials/svg?seed=${
|
|
8047
|
+
m.src = `https://api.dicebear.com/9.x/initials/svg?seed=${C.name}`;
|
|
8040
8048
|
}
|
|
8041
8049
|
}
|
|
8042
8050
|
) : /* @__PURE__ */ r.jsx(
|
|
8043
8051
|
"img",
|
|
8044
8052
|
{
|
|
8045
|
-
src: `https://api.dicebear.com/9.x/initials/svg?seed=${
|
|
8046
|
-
alt: `${
|
|
8053
|
+
src: `https://api.dicebear.com/9.x/initials/svg?seed=${C.name}`,
|
|
8054
|
+
alt: `${C.name}'s default avatar`,
|
|
8047
8055
|
style: z.dropdownAvatar,
|
|
8048
8056
|
loading: "lazy"
|
|
8049
8057
|
}
|
|
8050
8058
|
),
|
|
8051
8059
|
/* @__PURE__ */ r.jsxs("div", { style: z.dropdownUserInfo, children: [
|
|
8052
|
-
/* @__PURE__ */ r.jsx("div", { style: z.dropdownUserName, title:
|
|
8053
|
-
/* @__PURE__ */ r.jsx("div", { style: z.dropdownUserEmail, title:
|
|
8060
|
+
/* @__PURE__ */ r.jsx("div", { style: z.dropdownUserName, title: C.name, children: C.name }),
|
|
8061
|
+
/* @__PURE__ */ r.jsx("div", { style: z.dropdownUserEmail, title: C.email, children: C.email })
|
|
8054
8062
|
] })
|
|
8055
8063
|
] }),
|
|
8056
8064
|
/* @__PURE__ */ r.jsxs("div", { style: z.dropdownSection, children: [
|
|
@@ -8074,7 +8082,7 @@ const Ns = [
|
|
|
8074
8082
|
]
|
|
8075
8083
|
}
|
|
8076
8084
|
),
|
|
8077
|
-
|
|
8085
|
+
f && c && /* @__PURE__ */ r.jsxs(
|
|
8078
8086
|
"button",
|
|
8079
8087
|
{
|
|
8080
8088
|
style: z.menuItem,
|
|
@@ -8090,14 +8098,14 @@ const Ns = [
|
|
|
8090
8098
|
tabIndex: 0,
|
|
8091
8099
|
children: [
|
|
8092
8100
|
/* @__PURE__ */ r.jsx(Is, { style: z.icon, "aria-hidden": "true" }),
|
|
8093
|
-
/* @__PURE__ */ r.jsx("span", { style: z.menuItemText, children:
|
|
8101
|
+
/* @__PURE__ */ r.jsx("span", { style: z.menuItemText, children: k })
|
|
8094
8102
|
]
|
|
8095
8103
|
}
|
|
8096
8104
|
),
|
|
8097
|
-
|
|
8105
|
+
p && C.profileUrl && /* @__PURE__ */ r.jsxs(
|
|
8098
8106
|
"a",
|
|
8099
8107
|
{
|
|
8100
|
-
href:
|
|
8108
|
+
href: C.profileUrl,
|
|
8101
8109
|
target: "_self",
|
|
8102
8110
|
rel: "noopener noreferrer",
|
|
8103
8111
|
style: z.menuItem,
|
|
@@ -8111,7 +8119,7 @@ const Ns = [
|
|
|
8111
8119
|
tabIndex: 0,
|
|
8112
8120
|
children: [
|
|
8113
8121
|
/* @__PURE__ */ r.jsx(pe, { style: z.icon, "aria-hidden": "true" }),
|
|
8114
|
-
/* @__PURE__ */ r.jsx("span", { style: z.menuItemText, children:
|
|
8122
|
+
/* @__PURE__ */ r.jsx("span", { style: z.menuItemText, children: E })
|
|
8115
8123
|
]
|
|
8116
8124
|
}
|
|
8117
8125
|
)
|
|
@@ -8138,7 +8146,7 @@ const Ns = [
|
|
|
8138
8146
|
"aria-hidden": "true"
|
|
8139
8147
|
}
|
|
8140
8148
|
),
|
|
8141
|
-
/* @__PURE__ */ r.jsx("span", { style: z.menuItemText, children:
|
|
8149
|
+
/* @__PURE__ */ r.jsx("span", { style: z.menuItemText, children: u })
|
|
8142
8150
|
]
|
|
8143
8151
|
}
|
|
8144
8152
|
) })
|
|
@@ -8177,7 +8185,7 @@ const Ns = [
|
|
|
8177
8185
|
primaryColor: n = "#00C212",
|
|
8178
8186
|
onVerify: s
|
|
8179
8187
|
}) => {
|
|
8180
|
-
const i =
|
|
8188
|
+
const i = fe();
|
|
8181
8189
|
if (!t)
|
|
8182
8190
|
return /* @__PURE__ */ r.jsxs(
|
|
8183
8191
|
"div",
|
|
@@ -8204,8 +8212,8 @@ const Ns = [
|
|
|
8204
8212
|
const [a, o] = P(!1), [c, d] = P({
|
|
8205
8213
|
email: t?.email || "",
|
|
8206
8214
|
otp: ""
|
|
8207
|
-
}), [
|
|
8208
|
-
|
|
8215
|
+
}), [f, p] = P(!1), [y, k] = P(!1), [E, u] = P(null);
|
|
8216
|
+
Ce.useEffect(() => {
|
|
8209
8217
|
if (typeof window < "u") {
|
|
8210
8218
|
const b = () => o(window.innerWidth < 768);
|
|
8211
8219
|
return b(), window.addEventListener("resize", b), () => window.removeEventListener("resize", b);
|
|
@@ -8239,8 +8247,8 @@ const Ns = [
|
|
|
8239
8247
|
t?.email && d((b) => ({ ...b, email: t.email }));
|
|
8240
8248
|
}, [t?.email]);
|
|
8241
8249
|
const O = (b, j) => {
|
|
8242
|
-
|
|
8243
|
-
},
|
|
8250
|
+
u({ type: b, message: j }), setTimeout(() => u(null), 3e3);
|
|
8251
|
+
}, C = async () => {
|
|
8244
8252
|
if (!c.email || !/\S+@\S+\.\S+/.test(c.email)) {
|
|
8245
8253
|
O("error", "Please enter a valid email");
|
|
8246
8254
|
return;
|
|
@@ -8250,14 +8258,14 @@ const Ns = [
|
|
|
8250
8258
|
return;
|
|
8251
8259
|
}
|
|
8252
8260
|
try {
|
|
8253
|
-
|
|
8261
|
+
k(!0);
|
|
8254
8262
|
const b = await i.requestEmailVerificationOTP({
|
|
8255
8263
|
userId: t.id,
|
|
8256
8264
|
email: c.email
|
|
8257
8265
|
});
|
|
8258
8266
|
if (console.log("Send OTP response:", b), b.success || b.data?.success) {
|
|
8259
8267
|
const j = b.message || b.data?.message || "OTP sent!";
|
|
8260
|
-
O("success", j),
|
|
8268
|
+
O("success", j), p(!0);
|
|
8261
8269
|
} else {
|
|
8262
8270
|
const j = b.message || b.data?.message || "Failed to send OTP";
|
|
8263
8271
|
O("error", j);
|
|
@@ -8265,7 +8273,7 @@ const Ns = [
|
|
|
8265
8273
|
} catch (b) {
|
|
8266
8274
|
console.error("Send OTP error:", b), O("error", b.message || "Server error");
|
|
8267
8275
|
} finally {
|
|
8268
|
-
|
|
8276
|
+
k(!1);
|
|
8269
8277
|
}
|
|
8270
8278
|
}, g = async (b) => {
|
|
8271
8279
|
if (b.preventDefault(), !c.email || !c.otp) {
|
|
@@ -8273,20 +8281,20 @@ const Ns = [
|
|
|
8273
8281
|
return;
|
|
8274
8282
|
}
|
|
8275
8283
|
try {
|
|
8276
|
-
|
|
8284
|
+
k(!0);
|
|
8277
8285
|
const j = await i.verifyEmail({
|
|
8278
8286
|
email: c.email,
|
|
8279
8287
|
otp: c.otp
|
|
8280
8288
|
});
|
|
8281
8289
|
if (j.success) {
|
|
8282
8290
|
const q = { ...t, isVerified: !0 };
|
|
8283
|
-
s?.(q), O("success", j.message || "Email verified!"),
|
|
8291
|
+
s?.(q), O("success", j.message || "Email verified!"), p(!1), d({ email: t.email, otp: "" });
|
|
8284
8292
|
} else
|
|
8285
8293
|
O("error", j.message || "Verification failed");
|
|
8286
8294
|
} catch (j) {
|
|
8287
8295
|
O("error", j.message || "Server error");
|
|
8288
8296
|
} finally {
|
|
8289
|
-
|
|
8297
|
+
k(!1);
|
|
8290
8298
|
}
|
|
8291
8299
|
}, A = {
|
|
8292
8300
|
width: "100%",
|
|
@@ -8368,7 +8376,7 @@ const Ns = [
|
|
|
8368
8376
|
]
|
|
8369
8377
|
}
|
|
8370
8378
|
),
|
|
8371
|
-
|
|
8379
|
+
E && /* @__PURE__ */ r.jsxs(
|
|
8372
8380
|
"div",
|
|
8373
8381
|
{
|
|
8374
8382
|
style: {
|
|
@@ -8376,16 +8384,16 @@ const Ns = [
|
|
|
8376
8384
|
borderRadius: 12,
|
|
8377
8385
|
fontSize: 13,
|
|
8378
8386
|
fontWeight: 500,
|
|
8379
|
-
color:
|
|
8380
|
-
border: `1px solid ${
|
|
8381
|
-
backgroundColor:
|
|
8387
|
+
color: E.type === "success" ? h.success : h.warning,
|
|
8388
|
+
border: `1px solid ${E.type === "success" ? h.success : h.warning}`,
|
|
8389
|
+
backgroundColor: E.type === "success" ? `${h.success}20` : `${h.warning}20`,
|
|
8382
8390
|
display: "flex",
|
|
8383
8391
|
alignItems: "center",
|
|
8384
8392
|
gap: 8
|
|
8385
8393
|
},
|
|
8386
8394
|
children: [
|
|
8387
|
-
|
|
8388
|
-
|
|
8395
|
+
E.type === "success" ? /* @__PURE__ */ r.jsx(ue, { size: 16 }) : /* @__PURE__ */ r.jsx(se, { size: 16 }),
|
|
8396
|
+
E.message
|
|
8389
8397
|
]
|
|
8390
8398
|
}
|
|
8391
8399
|
),
|
|
@@ -8440,7 +8448,7 @@ const Ns = [
|
|
|
8440
8448
|
}
|
|
8441
8449
|
)
|
|
8442
8450
|
] }),
|
|
8443
|
-
|
|
8451
|
+
f && /* @__PURE__ */ r.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: 4 }, children: [
|
|
8444
8452
|
/* @__PURE__ */ r.jsxs(
|
|
8445
8453
|
"div",
|
|
8446
8454
|
{
|
|
@@ -8490,7 +8498,7 @@ const Ns = [
|
|
|
8490
8498
|
}
|
|
8491
8499
|
)
|
|
8492
8500
|
] }),
|
|
8493
|
-
/* @__PURE__ */ r.jsx("div", { style: { display: "flex", gap: 12 }, children:
|
|
8501
|
+
/* @__PURE__ */ r.jsx("div", { style: { display: "flex", gap: 12 }, children: f ? /* @__PURE__ */ r.jsxs(
|
|
8494
8502
|
"button",
|
|
8495
8503
|
{
|
|
8496
8504
|
type: "submit",
|
|
@@ -8510,7 +8518,7 @@ const Ns = [
|
|
|
8510
8518
|
"button",
|
|
8511
8519
|
{
|
|
8512
8520
|
type: "button",
|
|
8513
|
-
onClick:
|
|
8521
|
+
onClick: C,
|
|
8514
8522
|
disabled: y || !t?.id,
|
|
8515
8523
|
style: {
|
|
8516
8524
|
...N(y),
|