@neuctra/authix 1.1.29 → 1.1.31
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 +426 -400
- package/dist/neuctra-authix.umd.js +23 -23
- package/dist/react/SignedIn.d.ts.map +1 -1
- package/dist/sdk/index.d.ts +27 -0
- package/dist/sdk/index.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import Le, { forwardRef as Nt, createElement as
|
|
1
|
+
import Le, { forwardRef as Nt, createElement as Xe, useState as O, useEffect as te, useRef as xt } from "react";
|
|
2
2
|
function Ut(t, e) {
|
|
3
3
|
return function() {
|
|
4
4
|
return t.apply(e, arguments);
|
|
@@ -7,7 +7,7 @@ function Ut(t, e) {
|
|
|
7
7
|
const { toString: fr } = Object.prototype, { getPrototypeOf: st } = Object, { iterator: Fe, toStringTag: Dt } = Symbol, Me = /* @__PURE__ */ ((t) => (e) => {
|
|
8
8
|
const r = fr.call(e);
|
|
9
9
|
return t[r] || (t[r] = r.slice(8, -1).toLowerCase());
|
|
10
|
-
})(/* @__PURE__ */ Object.create(null)), oe = (t) => (t = t.toLowerCase(), (e) => Me(e) === t),
|
|
10
|
+
})(/* @__PURE__ */ Object.create(null)), oe = (t) => (t = t.toLowerCase(), (e) => Me(e) === t), qe = (t) => (e) => typeof e === t, { isArray: we } = Array, ye = qe("undefined");
|
|
11
11
|
function Ce(t) {
|
|
12
12
|
return t !== null && !ye(t) && t.constructor !== null && !ye(t.constructor) && re(t.constructor.isBuffer) && t.constructor.isBuffer(t);
|
|
13
13
|
}
|
|
@@ -16,7 +16,7 @@ function xr(t) {
|
|
|
16
16
|
let e;
|
|
17
17
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? e = ArrayBuffer.isView(t) : e = t && t.buffer && Lt(t.buffer), e;
|
|
18
18
|
}
|
|
19
|
-
const hr =
|
|
19
|
+
const hr = qe("string"), re = qe("function"), Ft = qe("number"), Te = (t) => t !== null && typeof t == "object", gr = (t) => t === !0 || t === !1, Ae = (t) => {
|
|
20
20
|
if (Me(t) !== "object")
|
|
21
21
|
return !1;
|
|
22
22
|
const e = st(t);
|
|
@@ -61,9 +61,9 @@ function Mt(t, e) {
|
|
|
61
61
|
return a;
|
|
62
62
|
return null;
|
|
63
63
|
}
|
|
64
|
-
const
|
|
64
|
+
const fe = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : global, qt = (t) => !ye(t) && t !== fe;
|
|
65
65
|
function Ze() {
|
|
66
|
-
const { caseless: t, skipUndefined: e } =
|
|
66
|
+
const { caseless: t, skipUndefined: e } = qt(this) && this || {}, r = {}, s = (a, i) => {
|
|
67
67
|
const o = t && Mt(r, i) || i;
|
|
68
68
|
Ae(r[o]) && Ae(a) ? r[o] = Ze(r[o], a) : Ae(a) ? r[o] = Ze({}, a) : we(a) ? r[o] = a.slice() : (!e || !ye(a)) && (r[o] = a);
|
|
69
69
|
};
|
|
@@ -118,14 +118,14 @@ const Pr = (t, e, r, { allOwnKeys: s } = {}) => (Re(e, (a, i) => {
|
|
|
118
118
|
function(r, s, a) {
|
|
119
119
|
return s.toUpperCase() + a;
|
|
120
120
|
}
|
|
121
|
-
), ht = (({ hasOwnProperty: t }) => (e, r) => t.call(e, r))(Object.prototype), Mr = oe("RegExp"),
|
|
121
|
+
), ht = (({ hasOwnProperty: t }) => (e, r) => t.call(e, r))(Object.prototype), Mr = oe("RegExp"), Wt = (t, e) => {
|
|
122
122
|
const r = Object.getOwnPropertyDescriptors(t), s = {};
|
|
123
123
|
Re(r, (a, i) => {
|
|
124
124
|
let o;
|
|
125
125
|
(o = e(a, i, t)) !== !1 && (s[i] = o || a);
|
|
126
126
|
}), Object.defineProperties(t, s);
|
|
127
|
-
},
|
|
128
|
-
|
|
127
|
+
}, qr = (t) => {
|
|
128
|
+
Wt(t, (e, r) => {
|
|
129
129
|
if (re(t) && ["arguments", "caller", "callee"].indexOf(r) !== -1)
|
|
130
130
|
return !1;
|
|
131
131
|
const s = t[r];
|
|
@@ -139,7 +139,7 @@ const Pr = (t, e, r, { allOwnKeys: s } = {}) => (Re(e, (a, i) => {
|
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
141
|
});
|
|
142
|
-
},
|
|
142
|
+
}, Wr = (t, e) => {
|
|
143
143
|
const r = {}, s = (a) => {
|
|
144
144
|
a.forEach((i) => {
|
|
145
145
|
r[i] = !0;
|
|
@@ -170,14 +170,14 @@ const Yr = (t) => {
|
|
|
170
170
|
return s;
|
|
171
171
|
};
|
|
172
172
|
return r(t, 0);
|
|
173
|
-
}, Kr = oe("AsyncFunction"), Jr = (t) => t && (Te(t) || re(t)) && re(t.then) && re(t.catch), Bt = ((t, e) => t ? setImmediate : e ? ((r, s) => (
|
|
174
|
-
a ===
|
|
173
|
+
}, Kr = oe("AsyncFunction"), Jr = (t) => t && (Te(t) || re(t)) && re(t.then) && re(t.catch), Bt = ((t, e) => t ? setImmediate : e ? ((r, s) => (fe.addEventListener("message", ({ source: a, data: i }) => {
|
|
174
|
+
a === fe && i === r && s.length && s.shift()();
|
|
175
175
|
}, !1), (a) => {
|
|
176
|
-
s.push(a),
|
|
176
|
+
s.push(a), fe.postMessage(r, "*");
|
|
177
177
|
}))(`axios@${Math.random()}`, []) : (r) => setTimeout(r))(
|
|
178
178
|
typeof setImmediate == "function",
|
|
179
|
-
re(
|
|
180
|
-
),
|
|
179
|
+
re(fe.postMessage)
|
|
180
|
+
), Gr = typeof queueMicrotask < "u" ? queueMicrotask.bind(fe) : typeof process < "u" && process.nextTick || Bt, Xr = (t) => t != null && re(t[Fe]), p = {
|
|
181
181
|
isArray: we,
|
|
182
182
|
isArrayBuffer: Lt,
|
|
183
183
|
isBuffer: Ce,
|
|
@@ -220,22 +220,22 @@ const Yr = (t) => {
|
|
|
220
220
|
hasOwnProperty: ht,
|
|
221
221
|
hasOwnProp: ht,
|
|
222
222
|
// an alias to avoid ESLint no-prototype-builtins detection
|
|
223
|
-
reduceDescriptors:
|
|
224
|
-
freezeMethods:
|
|
225
|
-
toObjectSet:
|
|
223
|
+
reduceDescriptors: Wt,
|
|
224
|
+
freezeMethods: qr,
|
|
225
|
+
toObjectSet: Wr,
|
|
226
226
|
toCamelCase: Fr,
|
|
227
227
|
noop: Br,
|
|
228
228
|
toFiniteNumber: Hr,
|
|
229
229
|
findKey: Mt,
|
|
230
|
-
global:
|
|
231
|
-
isContextDefined:
|
|
230
|
+
global: fe,
|
|
231
|
+
isContextDefined: qt,
|
|
232
232
|
isSpecCompliantForm: Vr,
|
|
233
233
|
toJSONObject: Yr,
|
|
234
234
|
isAsyncFn: Kr,
|
|
235
235
|
isThenable: Jr,
|
|
236
236
|
setImmediate: Bt,
|
|
237
|
-
asap:
|
|
238
|
-
isIterable:
|
|
237
|
+
asap: Gr,
|
|
238
|
+
isIterable: Xr
|
|
239
239
|
};
|
|
240
240
|
function L(t, e, r, s, a) {
|
|
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), r && (this.config = r), s && (this.request = s), a && (this.response = a, this.status = a.status ? a.status : null);
|
|
@@ -283,8 +283,8 @@ Object.defineProperties(L, Vt);
|
|
|
283
283
|
Object.defineProperty(Ht, "isAxiosError", { value: !0 });
|
|
284
284
|
L.from = (t, e, r, s, a, i) => {
|
|
285
285
|
const o = Object.create(Ht);
|
|
286
|
-
p.toFlatObject(t, o, function(
|
|
287
|
-
return
|
|
286
|
+
p.toFlatObject(t, o, function(u) {
|
|
287
|
+
return u !== Error.prototype;
|
|
288
288
|
}, (c) => c !== "isAxiosError");
|
|
289
289
|
const l = t && t.message ? t.message : "Error", h = e == null && t ? t.code : e;
|
|
290
290
|
return L.call(o, l, h, r, s, a), t && o.cause == null && Object.defineProperty(o, "cause", { value: t, configurable: !0 }), o.name = t && t.name || "Error", i && Object.assign(o, i), o;
|
|
@@ -307,7 +307,7 @@ function Qr(t) {
|
|
|
307
307
|
const en = p.toFlatObject(p, {}, null, function(e) {
|
|
308
308
|
return /^is[A-Z]/.test(e);
|
|
309
309
|
});
|
|
310
|
-
function
|
|
310
|
+
function We(t, e, r) {
|
|
311
311
|
if (!p.isObject(t))
|
|
312
312
|
throw new TypeError("target must be an object");
|
|
313
313
|
e = e || new FormData(), r = p.toFlatObject(r, {
|
|
@@ -317,25 +317,25 @@ function qe(t, e, r) {
|
|
|
317
317
|
}, !1, function(j, m) {
|
|
318
318
|
return !p.isUndefined(m[j]);
|
|
319
319
|
});
|
|
320
|
-
const s = r.metaTokens, a = r.visitor ||
|
|
320
|
+
const s = r.metaTokens, a = r.visitor || u, i = r.dots, o = r.indexes, h = (r.Blob || typeof Blob < "u" && Blob) && p.isSpecCompliantForm(e);
|
|
321
321
|
if (!p.isFunction(a))
|
|
322
322
|
throw new TypeError("visitor must be a function");
|
|
323
|
-
function c(
|
|
324
|
-
if (
|
|
325
|
-
if (p.isDate(
|
|
326
|
-
return
|
|
327
|
-
if (p.isBoolean(
|
|
328
|
-
return
|
|
329
|
-
if (!h && p.isBlob(
|
|
323
|
+
function c(d) {
|
|
324
|
+
if (d === null) return "";
|
|
325
|
+
if (p.isDate(d))
|
|
326
|
+
return d.toISOString();
|
|
327
|
+
if (p.isBoolean(d))
|
|
328
|
+
return d.toString();
|
|
329
|
+
if (!h && p.isBlob(d))
|
|
330
330
|
throw new L("Blob is not supported. Use a Buffer instead.");
|
|
331
|
-
return p.isArrayBuffer(
|
|
331
|
+
return p.isArrayBuffer(d) || p.isTypedArray(d) ? h && typeof Blob == "function" ? new Blob([d]) : Buffer.from(d) : d;
|
|
332
332
|
}
|
|
333
|
-
function d
|
|
334
|
-
let _ =
|
|
335
|
-
if (
|
|
333
|
+
function u(d, j, m) {
|
|
334
|
+
let _ = d;
|
|
335
|
+
if (d && !m && typeof d == "object") {
|
|
336
336
|
if (p.endsWith(j, "{}"))
|
|
337
|
-
j = s ? j : j.slice(0, -2),
|
|
338
|
-
else if (p.isArray(
|
|
337
|
+
j = s ? j : j.slice(0, -2), d = JSON.stringify(d);
|
|
338
|
+
else if (p.isArray(d) && Qr(d) || (p.isFileList(d) || p.endsWith(j, "[]")) && (_ = p.toArray(d)))
|
|
339
339
|
return j = Yt(j), _.forEach(function(A, C) {
|
|
340
340
|
!(p.isUndefined(A) || A === null) && e.append(
|
|
341
341
|
// eslint-disable-next-line no-nested-ternary
|
|
@@ -344,18 +344,18 @@ function qe(t, e, r) {
|
|
|
344
344
|
);
|
|
345
345
|
}), !1;
|
|
346
346
|
}
|
|
347
|
-
return Qe(
|
|
347
|
+
return Qe(d) ? !0 : (e.append(gt(m, j, i), c(d)), !1);
|
|
348
348
|
}
|
|
349
349
|
const b = [], y = Object.assign(en, {
|
|
350
|
-
defaultVisitor:
|
|
350
|
+
defaultVisitor: u,
|
|
351
351
|
convertValue: c,
|
|
352
352
|
isVisitable: Qe
|
|
353
353
|
});
|
|
354
|
-
function w(
|
|
355
|
-
if (!p.isUndefined(
|
|
356
|
-
if (b.indexOf(
|
|
354
|
+
function w(d, j) {
|
|
355
|
+
if (!p.isUndefined(d)) {
|
|
356
|
+
if (b.indexOf(d) !== -1)
|
|
357
357
|
throw Error("Circular reference detected in " + j.join("."));
|
|
358
|
-
b.push(
|
|
358
|
+
b.push(d), p.forEach(d, function(_, R) {
|
|
359
359
|
(!(p.isUndefined(_) || _ === null) && a.call(
|
|
360
360
|
e,
|
|
361
361
|
_,
|
|
@@ -385,7 +385,7 @@ function mt(t) {
|
|
|
385
385
|
});
|
|
386
386
|
}
|
|
387
387
|
function at(t, e) {
|
|
388
|
-
this._pairs = [], t &&
|
|
388
|
+
this._pairs = [], t && We(t, this, e);
|
|
389
389
|
}
|
|
390
390
|
const Kt = at.prototype;
|
|
391
391
|
Kt.append = function(e, r) {
|
|
@@ -471,7 +471,7 @@ class yt {
|
|
|
471
471
|
});
|
|
472
472
|
}
|
|
473
473
|
}
|
|
474
|
-
const
|
|
474
|
+
const Gt = {
|
|
475
475
|
silentJSONParsing: !0,
|
|
476
476
|
forcedJSONParsing: !0,
|
|
477
477
|
clarifyTimeoutError: !1
|
|
@@ -496,7 +496,7 @@ self instanceof WorkerGlobalScope && typeof self.importScripts == "function", cn
|
|
|
496
496
|
...an
|
|
497
497
|
};
|
|
498
498
|
function un(t, e) {
|
|
499
|
-
return
|
|
499
|
+
return We(t, new ee.classes.URLSearchParams(), {
|
|
500
500
|
visitor: function(r, s, a, i) {
|
|
501
501
|
return ee.isNode && p.isBuffer(r) ? (this.append(s, r.toString("base64")), !1) : i.defaultVisitor.apply(this, arguments);
|
|
502
502
|
},
|
|
@@ -515,7 +515,7 @@ function fn(t) {
|
|
|
515
515
|
i = r[s], e[i] = t[i];
|
|
516
516
|
return e;
|
|
517
517
|
}
|
|
518
|
-
function
|
|
518
|
+
function Xt(t) {
|
|
519
519
|
function e(r, s, a, i) {
|
|
520
520
|
let o = r[i++];
|
|
521
521
|
if (o === "__proto__") return !0;
|
|
@@ -541,12 +541,12 @@ function xn(t, e, r) {
|
|
|
541
541
|
return (r || JSON.stringify)(t);
|
|
542
542
|
}
|
|
543
543
|
const Ie = {
|
|
544
|
-
transitional:
|
|
544
|
+
transitional: Gt,
|
|
545
545
|
adapter: ["xhr", "http", "fetch"],
|
|
546
546
|
transformRequest: [function(e, r) {
|
|
547
547
|
const s = r.getContentType() || "", a = s.indexOf("application/json") > -1, i = p.isObject(e);
|
|
548
548
|
if (i && p.isHTMLForm(e) && (e = new FormData(e)), p.isFormData(e))
|
|
549
|
-
return a ? JSON.stringify(
|
|
549
|
+
return a ? JSON.stringify(Xt(e)) : e;
|
|
550
550
|
if (p.isArrayBuffer(e) || p.isBuffer(e) || p.isStream(e) || p.isFile(e) || p.isBlob(e) || p.isReadableStream(e))
|
|
551
551
|
return e;
|
|
552
552
|
if (p.isArrayBufferView(e))
|
|
@@ -559,7 +559,7 @@ const Ie = {
|
|
|
559
559
|
return un(e, this.formSerializer).toString();
|
|
560
560
|
if ((l = p.isFileList(e)) || s.indexOf("multipart/form-data") > -1) {
|
|
561
561
|
const h = this.env && this.env.FormData;
|
|
562
|
-
return
|
|
562
|
+
return We(
|
|
563
563
|
l ? { "files[]": e } : e,
|
|
564
564
|
h && new h(),
|
|
565
565
|
this.formSerializer
|
|
@@ -680,23 +680,23 @@ let ne = class {
|
|
|
680
680
|
set(e, r, s) {
|
|
681
681
|
const a = this;
|
|
682
682
|
function i(l, h, c) {
|
|
683
|
-
const
|
|
684
|
-
if (!
|
|
683
|
+
const u = Se(h);
|
|
684
|
+
if (!u)
|
|
685
685
|
throw new Error("header name must be a non-empty string");
|
|
686
|
-
const b = p.findKey(a,
|
|
686
|
+
const b = p.findKey(a, u);
|
|
687
687
|
(!b || a[b] === void 0 || c === !0 || c === void 0 && a[b] !== !1) && (a[b || h] = _e(l));
|
|
688
688
|
}
|
|
689
|
-
const o = (l, h) => p.forEach(l, (c,
|
|
689
|
+
const o = (l, h) => p.forEach(l, (c, u) => i(c, u, h));
|
|
690
690
|
if (p.isPlainObject(e) || e instanceof this.constructor)
|
|
691
691
|
o(e, r);
|
|
692
692
|
else if (p.isString(e) && (e = e.trim()) && !yn(e))
|
|
693
693
|
o(gn(e), r);
|
|
694
694
|
else if (p.isObject(e) && p.isIterable(e)) {
|
|
695
695
|
let l = {}, h, c;
|
|
696
|
-
for (const
|
|
697
|
-
if (!p.isArray(
|
|
696
|
+
for (const u of e) {
|
|
697
|
+
if (!p.isArray(u))
|
|
698
698
|
throw TypeError("Object iterator must return a key-value pair");
|
|
699
|
-
l[c =
|
|
699
|
+
l[c = u[0]] = (h = l[c]) ? p.isArray(h) ? [...h, u[1]] : [h, u[1]] : u[1];
|
|
700
700
|
}
|
|
701
701
|
o(l, r);
|
|
702
702
|
} else
|
|
@@ -845,25 +845,25 @@ function vn(t, e) {
|
|
|
845
845
|
const r = new Array(t), s = new Array(t);
|
|
846
846
|
let a = 0, i = 0, o;
|
|
847
847
|
return e = e !== void 0 ? e : 1e3, function(h) {
|
|
848
|
-
const c = Date.now(),
|
|
848
|
+
const c = Date.now(), u = s[i];
|
|
849
849
|
o || (o = c), r[a] = h, s[a] = c;
|
|
850
850
|
let b = i, y = 0;
|
|
851
851
|
for (; b !== a; )
|
|
852
852
|
y += r[b++], b = b % t;
|
|
853
853
|
if (a = (a + 1) % t, a === i && (i = (i + 1) % t), c - o < e)
|
|
854
854
|
return;
|
|
855
|
-
const w =
|
|
855
|
+
const w = u && c - u;
|
|
856
856
|
return w ? Math.round(y * 1e3 / w) : void 0;
|
|
857
857
|
};
|
|
858
858
|
}
|
|
859
859
|
function Sn(t, e) {
|
|
860
860
|
let r = 0, s = 1e3 / e, a, i;
|
|
861
|
-
const o = (c,
|
|
862
|
-
r =
|
|
861
|
+
const o = (c, u = Date.now()) => {
|
|
862
|
+
r = u, a = null, i && (clearTimeout(i), i = null), t(...c);
|
|
863
863
|
};
|
|
864
864
|
return [(...c) => {
|
|
865
|
-
const
|
|
866
|
-
b >= s ? o(c,
|
|
865
|
+
const u = Date.now(), b = u - r;
|
|
866
|
+
b >= s ? o(c, u) : (a = c, i || (i = setTimeout(() => {
|
|
867
867
|
i = null, o(a);
|
|
868
868
|
}, s - b)));
|
|
869
869
|
}, () => a && o(a)];
|
|
@@ -872,7 +872,7 @@ const De = (t, e, r = 3) => {
|
|
|
872
872
|
let s = 0;
|
|
873
873
|
const a = vn(50, 250);
|
|
874
874
|
return Sn((i) => {
|
|
875
|
-
const o = i.loaded, l = i.lengthComputable ? i.total : void 0, h = o - s, c = a(h),
|
|
875
|
+
const o = i.loaded, l = i.lengthComputable ? i.total : void 0, h = o - s, c = a(h), u = o <= l;
|
|
876
876
|
s = o;
|
|
877
877
|
const b = {
|
|
878
878
|
loaded: o,
|
|
@@ -880,7 +880,7 @@ const De = (t, e, r = 3) => {
|
|
|
880
880
|
progress: l ? o / l : void 0,
|
|
881
881
|
bytes: h,
|
|
882
882
|
rate: c || void 0,
|
|
883
|
-
estimated: c && l &&
|
|
883
|
+
estimated: c && l && u ? (l - o) / c : void 0,
|
|
884
884
|
event: i,
|
|
885
885
|
lengthComputable: l != null,
|
|
886
886
|
[e ? "download" : "upload"]: !0
|
|
@@ -935,31 +935,31 @@ function er(t, e, r) {
|
|
|
935
935
|
return t && (s || r == !1) ? Tn(t, e) : e;
|
|
936
936
|
}
|
|
937
937
|
const vt = (t) => t instanceof ne ? { ...t } : t;
|
|
938
|
-
function
|
|
938
|
+
function he(t, e) {
|
|
939
939
|
e = e || {};
|
|
940
940
|
const r = {};
|
|
941
|
-
function s(c,
|
|
942
|
-
return p.isPlainObject(c) && p.isPlainObject(
|
|
941
|
+
function s(c, u, b, y) {
|
|
942
|
+
return p.isPlainObject(c) && p.isPlainObject(u) ? p.merge.call({ caseless: y }, c, u) : p.isPlainObject(u) ? p.merge({}, u) : p.isArray(u) ? u.slice() : u;
|
|
943
943
|
}
|
|
944
|
-
function a(c,
|
|
945
|
-
if (p.isUndefined(
|
|
944
|
+
function a(c, u, b, y) {
|
|
945
|
+
if (p.isUndefined(u)) {
|
|
946
946
|
if (!p.isUndefined(c))
|
|
947
947
|
return s(void 0, c, b, y);
|
|
948
|
-
} else return s(c,
|
|
948
|
+
} else return s(c, u, b, y);
|
|
949
949
|
}
|
|
950
|
-
function i(c,
|
|
951
|
-
if (!p.isUndefined(
|
|
952
|
-
return s(void 0,
|
|
950
|
+
function i(c, u) {
|
|
951
|
+
if (!p.isUndefined(u))
|
|
952
|
+
return s(void 0, u);
|
|
953
953
|
}
|
|
954
|
-
function o(c,
|
|
955
|
-
if (p.isUndefined(
|
|
954
|
+
function o(c, u) {
|
|
955
|
+
if (p.isUndefined(u)) {
|
|
956
956
|
if (!p.isUndefined(c))
|
|
957
957
|
return s(void 0, c);
|
|
958
|
-
} else return s(void 0,
|
|
958
|
+
} else return s(void 0, u);
|
|
959
959
|
}
|
|
960
|
-
function l(c,
|
|
960
|
+
function l(c, u, b) {
|
|
961
961
|
if (b in e)
|
|
962
|
-
return s(c,
|
|
962
|
+
return s(c, u);
|
|
963
963
|
if (b in t)
|
|
964
964
|
return s(void 0, c);
|
|
965
965
|
}
|
|
@@ -992,15 +992,15 @@ function ge(t, e) {
|
|
|
992
992
|
socketPath: o,
|
|
993
993
|
responseEncoding: o,
|
|
994
994
|
validateStatus: l,
|
|
995
|
-
headers: (c,
|
|
995
|
+
headers: (c, u, b) => a(vt(c), vt(u), b, !0)
|
|
996
996
|
};
|
|
997
|
-
return p.forEach(Object.keys({ ...t, ...e }), function(
|
|
998
|
-
const b = h[
|
|
999
|
-
p.isUndefined(y) && b !== l || (r[
|
|
997
|
+
return p.forEach(Object.keys({ ...t, ...e }), function(u) {
|
|
998
|
+
const b = h[u] || a, y = b(t[u], e[u], u);
|
|
999
|
+
p.isUndefined(y) && b !== l || (r[u] = y);
|
|
1000
1000
|
}), r;
|
|
1001
1001
|
}
|
|
1002
1002
|
const tr = (t) => {
|
|
1003
|
-
const e =
|
|
1003
|
+
const e = he({}, t);
|
|
1004
1004
|
let { data: r, withXSRFToken: s, xsrfHeaderName: a, xsrfCookieName: i, headers: o, auth: l } = e;
|
|
1005
1005
|
if (e.headers = o = ne.from(o), e.url = Jt(er(e.baseURL, e.url, e.allowAbsoluteUrls), t.params, t.paramsSerializer), l && o.set(
|
|
1006
1006
|
"Authorization",
|
|
@@ -1010,8 +1010,8 @@ const tr = (t) => {
|
|
|
1010
1010
|
o.setContentType(void 0);
|
|
1011
1011
|
else if (p.isFunction(r.getHeaders)) {
|
|
1012
1012
|
const h = r.getHeaders(), c = ["content-type", "content-length"];
|
|
1013
|
-
Object.entries(h).forEach(([
|
|
1014
|
-
c.includes(
|
|
1013
|
+
Object.entries(h).forEach(([u, b]) => {
|
|
1014
|
+
c.includes(u.toLowerCase()) && o.set(u, b);
|
|
1015
1015
|
});
|
|
1016
1016
|
}
|
|
1017
1017
|
}
|
|
@@ -1025,9 +1025,9 @@ const tr = (t) => {
|
|
|
1025
1025
|
const a = tr(t);
|
|
1026
1026
|
let i = a.data;
|
|
1027
1027
|
const o = ne.from(a.headers).normalize();
|
|
1028
|
-
let { responseType: l, onUploadProgress: h, onDownloadProgress: c } = a,
|
|
1028
|
+
let { responseType: l, onUploadProgress: h, onDownloadProgress: c } = a, u, b, y, w, d;
|
|
1029
1029
|
function j() {
|
|
1030
|
-
w && w(),
|
|
1030
|
+
w && w(), d && d(), a.cancelToken && a.cancelToken.unsubscribe(u), a.signal && a.signal.removeEventListener("abort", u);
|
|
1031
1031
|
}
|
|
1032
1032
|
let m = new XMLHttpRequest();
|
|
1033
1033
|
m.open(a.method.toUpperCase(), a.url, !0), m.timeout = a.timeout;
|
|
@@ -1059,7 +1059,7 @@ const tr = (t) => {
|
|
|
1059
1059
|
g.event = C || null, s(g), m = null;
|
|
1060
1060
|
}, m.ontimeout = function() {
|
|
1061
1061
|
let C = a.timeout ? "timeout of " + a.timeout + "ms exceeded" : "timeout exceeded";
|
|
1062
|
-
const M = a.transitional ||
|
|
1062
|
+
const M = a.transitional || Gt;
|
|
1063
1063
|
a.timeoutErrorMessage && (C = a.timeoutErrorMessage), s(new L(
|
|
1064
1064
|
C,
|
|
1065
1065
|
M.clarifyTimeoutError ? L.ETIMEDOUT : L.ECONNABORTED,
|
|
@@ -1068,9 +1068,9 @@ const tr = (t) => {
|
|
|
1068
1068
|
)), m = null;
|
|
1069
1069
|
}, i === void 0 && o.setContentType(null), "setRequestHeader" in m && p.forEach(o.toJSON(), function(C, M) {
|
|
1070
1070
|
m.setRequestHeader(M, C);
|
|
1071
|
-
}), p.isUndefined(a.withCredentials) || (m.withCredentials = !!a.withCredentials), l && l !== "json" && (m.responseType = a.responseType), c && ([y,
|
|
1071
|
+
}), p.isUndefined(a.withCredentials) || (m.withCredentials = !!a.withCredentials), l && l !== "json" && (m.responseType = a.responseType), c && ([y, d] = De(c, !0), m.addEventListener("progress", y)), h && m.upload && ([b, w] = De(h), m.upload.addEventListener("progress", b), m.upload.addEventListener("loadend", w)), (a.cancelToken || a.signal) && (u = (A) => {
|
|
1072
1072
|
m && (s(!A || A.type ? new je(null, t, m) : A), m.abort(), m = null);
|
|
1073
|
-
}, a.cancelToken && a.cancelToken.subscribe(
|
|
1073
|
+
}, a.cancelToken && a.cancelToken.subscribe(u), a.signal && (a.signal.aborted ? u() : a.signal.addEventListener("abort", u)));
|
|
1074
1074
|
const R = jn(a.url);
|
|
1075
1075
|
if (R && ee.protocols.indexOf(R) === -1) {
|
|
1076
1076
|
s(new L("Unsupported protocol " + R + ":", L.ERR_BAD_REQUEST, t));
|
|
@@ -1085,8 +1085,8 @@ const tr = (t) => {
|
|
|
1085
1085
|
const i = function(c) {
|
|
1086
1086
|
if (!a) {
|
|
1087
1087
|
a = !0, l();
|
|
1088
|
-
const
|
|
1089
|
-
s.abort(
|
|
1088
|
+
const u = c instanceof Error ? c : this.reason;
|
|
1089
|
+
s.abort(u instanceof L ? u : new je(u instanceof Error ? u.message : u));
|
|
1090
1090
|
}
|
|
1091
1091
|
};
|
|
1092
1092
|
let o = e && setTimeout(() => {
|
|
@@ -1137,17 +1137,17 @@ const tr = (t) => {
|
|
|
1137
1137
|
return new ReadableStream({
|
|
1138
1138
|
async pull(h) {
|
|
1139
1139
|
try {
|
|
1140
|
-
const { done: c, value:
|
|
1140
|
+
const { done: c, value: u } = await a.next();
|
|
1141
1141
|
if (c) {
|
|
1142
1142
|
l(), h.close();
|
|
1143
1143
|
return;
|
|
1144
1144
|
}
|
|
1145
|
-
let b =
|
|
1145
|
+
let b = u.byteLength;
|
|
1146
1146
|
if (r) {
|
|
1147
1147
|
let y = i += b;
|
|
1148
1148
|
r(y);
|
|
1149
1149
|
}
|
|
1150
|
-
h.enqueue(new Uint8Array(
|
|
1150
|
+
h.enqueue(new Uint8Array(u));
|
|
1151
1151
|
} catch (c) {
|
|
1152
1152
|
throw l(c), c;
|
|
1153
1153
|
}
|
|
@@ -1177,46 +1177,46 @@ const tr = (t) => {
|
|
|
1177
1177
|
const { fetch: e, Request: r, Response: s } = t, a = e ? Oe(e) : typeof fetch == "function", i = Oe(r), o = Oe(s);
|
|
1178
1178
|
if (!a)
|
|
1179
1179
|
return !1;
|
|
1180
|
-
const l = a && Oe(Et), h = a && (typeof Ct == "function" ? /* @__PURE__ */ ((
|
|
1181
|
-
let
|
|
1180
|
+
const l = a && Oe(Et), h = a && (typeof Ct == "function" ? /* @__PURE__ */ ((d) => (j) => d.encode(j))(new Ct()) : async (d) => new Uint8Array(await new r(d).arrayBuffer())), c = i && l && Tt(() => {
|
|
1181
|
+
let d = !1;
|
|
1182
1182
|
const j = new r(ee.origin, {
|
|
1183
1183
|
body: new Et(),
|
|
1184
1184
|
method: "POST",
|
|
1185
1185
|
get duplex() {
|
|
1186
|
-
return
|
|
1186
|
+
return d = !0, "half";
|
|
1187
1187
|
}
|
|
1188
1188
|
}).headers.has("Content-Type");
|
|
1189
|
-
return
|
|
1190
|
-
}),
|
|
1191
|
-
stream:
|
|
1189
|
+
return d && !j;
|
|
1190
|
+
}), u = o && l && Tt(() => p.isReadableStream(new s("").body)), b = {
|
|
1191
|
+
stream: u && ((d) => d.body)
|
|
1192
1192
|
};
|
|
1193
|
-
a && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((
|
|
1194
|
-
!b[
|
|
1195
|
-
let _ = j && j[
|
|
1193
|
+
a && ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((d) => {
|
|
1194
|
+
!b[d] && (b[d] = (j, m) => {
|
|
1195
|
+
let _ = j && j[d];
|
|
1196
1196
|
if (_)
|
|
1197
1197
|
return _.call(j);
|
|
1198
|
-
throw new L(`Response type '${
|
|
1198
|
+
throw new L(`Response type '${d}' is not supported`, L.ERR_NOT_SUPPORT, m);
|
|
1199
1199
|
});
|
|
1200
1200
|
});
|
|
1201
|
-
const y = async (
|
|
1202
|
-
if (
|
|
1201
|
+
const y = async (d) => {
|
|
1202
|
+
if (d == null)
|
|
1203
1203
|
return 0;
|
|
1204
|
-
if (p.isBlob(
|
|
1205
|
-
return
|
|
1206
|
-
if (p.isSpecCompliantForm(
|
|
1204
|
+
if (p.isBlob(d))
|
|
1205
|
+
return d.size;
|
|
1206
|
+
if (p.isSpecCompliantForm(d))
|
|
1207
1207
|
return (await new r(ee.origin, {
|
|
1208
1208
|
method: "POST",
|
|
1209
|
-
body:
|
|
1209
|
+
body: d
|
|
1210
1210
|
}).arrayBuffer()).byteLength;
|
|
1211
|
-
if (p.isArrayBufferView(
|
|
1212
|
-
return
|
|
1213
|
-
if (p.isURLSearchParams(
|
|
1214
|
-
return (await h(
|
|
1215
|
-
}, w = async (
|
|
1216
|
-
const m = p.toFiniteNumber(
|
|
1211
|
+
if (p.isArrayBufferView(d) || p.isArrayBuffer(d))
|
|
1212
|
+
return d.byteLength;
|
|
1213
|
+
if (p.isURLSearchParams(d) && (d = d + ""), p.isString(d))
|
|
1214
|
+
return (await h(d)).byteLength;
|
|
1215
|
+
}, w = async (d, j) => {
|
|
1216
|
+
const m = p.toFiniteNumber(d.getContentLength());
|
|
1217
1217
|
return m ?? y(j);
|
|
1218
1218
|
};
|
|
1219
|
-
return async (
|
|
1219
|
+
return async (d) => {
|
|
1220
1220
|
let {
|
|
1221
1221
|
url: j,
|
|
1222
1222
|
method: m,
|
|
@@ -1229,8 +1229,8 @@ const tr = (t) => {
|
|
|
1229
1229
|
responseType: I,
|
|
1230
1230
|
headers: v,
|
|
1231
1231
|
withCredentials: U = "same-origin",
|
|
1232
|
-
fetchOptions:
|
|
1233
|
-
} = tr(
|
|
1232
|
+
fetchOptions: W
|
|
1233
|
+
} = tr(d), F = e || fetch;
|
|
1234
1234
|
I = I ? (I + "").toLowerCase() : "text";
|
|
1235
1235
|
let V = Pn([R, A && A.toAbortSignal()], C), Z = null;
|
|
1236
1236
|
const T = V && V.unsubscribe && (() => {
|
|
@@ -1254,7 +1254,7 @@ const tr = (t) => {
|
|
|
1254
1254
|
}
|
|
1255
1255
|
p.isString(U) || (U = U ? "include" : "omit");
|
|
1256
1256
|
const z = i && "credentials" in r.prototype, P = {
|
|
1257
|
-
...
|
|
1257
|
+
...W,
|
|
1258
1258
|
signal: V,
|
|
1259
1259
|
method: m.toUpperCase(),
|
|
1260
1260
|
headers: v.normalize().toJSON(),
|
|
@@ -1263,9 +1263,9 @@ const tr = (t) => {
|
|
|
1263
1263
|
credentials: z ? U : void 0
|
|
1264
1264
|
};
|
|
1265
1265
|
Z = i && new r(j, P);
|
|
1266
|
-
let K = await (i ? F(Z,
|
|
1267
|
-
const Q =
|
|
1268
|
-
if (
|
|
1266
|
+
let K = await (i ? F(Z, W) : F(j, P));
|
|
1267
|
+
const Q = u && (I === "stream" || I === "response");
|
|
1268
|
+
if (u && (M || Q && T)) {
|
|
1269
1269
|
const f = {};
|
|
1270
1270
|
["status", "statusText", "headers"].forEach(($) => {
|
|
1271
1271
|
f[$] = K[$];
|
|
@@ -1282,24 +1282,24 @@ const tr = (t) => {
|
|
|
1282
1282
|
);
|
|
1283
1283
|
}
|
|
1284
1284
|
I = I || "text";
|
|
1285
|
-
let
|
|
1285
|
+
let G = await b[p.findKey(b, I) || "text"](K, d);
|
|
1286
1286
|
return !Q && T && T(), await new Promise((f, S) => {
|
|
1287
1287
|
Qt(f, S, {
|
|
1288
|
-
data:
|
|
1288
|
+
data: G,
|
|
1289
1289
|
headers: ne.from(K.headers),
|
|
1290
1290
|
status: K.status,
|
|
1291
1291
|
statusText: K.statusText,
|
|
1292
|
-
config:
|
|
1292
|
+
config: d,
|
|
1293
1293
|
request: Z
|
|
1294
1294
|
});
|
|
1295
1295
|
});
|
|
1296
1296
|
} catch (z) {
|
|
1297
1297
|
throw T && T(), z && z.name === "TypeError" && /Load failed|fetch/i.test(z.message) ? Object.assign(
|
|
1298
|
-
new L("Network Error", L.ERR_NETWORK,
|
|
1298
|
+
new L("Network Error", L.ERR_NETWORK, d, Z),
|
|
1299
1299
|
{
|
|
1300
1300
|
cause: z.cause || z
|
|
1301
1301
|
}
|
|
1302
|
-
) : L.from(z, z && z.code,
|
|
1302
|
+
) : L.from(z, z && z.code, d, Z);
|
|
1303
1303
|
}
|
|
1304
1304
|
};
|
|
1305
1305
|
}, Nn = /* @__PURE__ */ new Map(), rr = (t) => {
|
|
@@ -1309,9 +1309,9 @@ const tr = (t) => {
|
|
|
1309
1309
|
a,
|
|
1310
1310
|
r
|
|
1311
1311
|
];
|
|
1312
|
-
let o = i.length, l = o, h, c,
|
|
1312
|
+
let o = i.length, l = o, h, c, u = Nn;
|
|
1313
1313
|
for (; l--; )
|
|
1314
|
-
h = i[l], c =
|
|
1314
|
+
h = i[l], c = u.get(h), c === void 0 && u.set(h, c = l ? /* @__PURE__ */ new Map() : $n(e)), u = c;
|
|
1315
1315
|
return c;
|
|
1316
1316
|
};
|
|
1317
1317
|
rr();
|
|
@@ -1433,7 +1433,7 @@ const $e = {
|
|
|
1433
1433
|
assertOptions: Dn,
|
|
1434
1434
|
validators: Be
|
|
1435
1435
|
}, ie = $e.validators;
|
|
1436
|
-
let
|
|
1436
|
+
let xe = class {
|
|
1437
1437
|
constructor(e) {
|
|
1438
1438
|
this.defaults = e || {}, this.interceptors = {
|
|
1439
1439
|
request: new yt(),
|
|
@@ -1466,7 +1466,7 @@ let he = class {
|
|
|
1466
1466
|
}
|
|
1467
1467
|
}
|
|
1468
1468
|
_request(e, r) {
|
|
1469
|
-
typeof e == "string" ? (r = r || {}, r.url = e) : r = e || {}, r =
|
|
1469
|
+
typeof e == "string" ? (r = r || {}, r.url = e) : r = e || {}, r = he(this.defaults, r);
|
|
1470
1470
|
const { transitional: s, paramsSerializer: a, headers: i } = r;
|
|
1471
1471
|
s !== void 0 && $e.assertOptions(s, {
|
|
1472
1472
|
silentJSONParsing: ie.transitional(ie.boolean),
|
|
@@ -1487,8 +1487,8 @@ let he = class {
|
|
|
1487
1487
|
);
|
|
1488
1488
|
i && p.forEach(
|
|
1489
1489
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1490
|
-
(
|
|
1491
|
-
delete i[
|
|
1490
|
+
(d) => {
|
|
1491
|
+
delete i[d];
|
|
1492
1492
|
}
|
|
1493
1493
|
), r.headers = ne.concat(o, i);
|
|
1494
1494
|
const l = [];
|
|
@@ -1500,42 +1500,42 @@ let he = class {
|
|
|
1500
1500
|
this.interceptors.response.forEach(function(j) {
|
|
1501
1501
|
c.push(j.fulfilled, j.rejected);
|
|
1502
1502
|
});
|
|
1503
|
-
let
|
|
1503
|
+
let u, b = 0, y;
|
|
1504
1504
|
if (!h) {
|
|
1505
|
-
const
|
|
1506
|
-
for (
|
|
1507
|
-
|
|
1508
|
-
return
|
|
1505
|
+
const d = [It.bind(this), void 0];
|
|
1506
|
+
for (d.unshift(...l), d.push(...c), y = d.length, u = Promise.resolve(r); b < y; )
|
|
1507
|
+
u = u.then(d[b++], d[b++]);
|
|
1508
|
+
return u;
|
|
1509
1509
|
}
|
|
1510
1510
|
y = l.length;
|
|
1511
1511
|
let w = r;
|
|
1512
1512
|
for (; b < y; ) {
|
|
1513
|
-
const
|
|
1513
|
+
const d = l[b++], j = l[b++];
|
|
1514
1514
|
try {
|
|
1515
|
-
w =
|
|
1515
|
+
w = d(w);
|
|
1516
1516
|
} catch (m) {
|
|
1517
1517
|
j.call(this, m);
|
|
1518
1518
|
break;
|
|
1519
1519
|
}
|
|
1520
1520
|
}
|
|
1521
1521
|
try {
|
|
1522
|
-
|
|
1523
|
-
} catch (
|
|
1524
|
-
return Promise.reject(
|
|
1522
|
+
u = It.call(this, w);
|
|
1523
|
+
} catch (d) {
|
|
1524
|
+
return Promise.reject(d);
|
|
1525
1525
|
}
|
|
1526
1526
|
for (b = 0, y = c.length; b < y; )
|
|
1527
|
-
|
|
1528
|
-
return
|
|
1527
|
+
u = u.then(c[b++], c[b++]);
|
|
1528
|
+
return u;
|
|
1529
1529
|
}
|
|
1530
1530
|
getUri(e) {
|
|
1531
|
-
e =
|
|
1531
|
+
e = he(this.defaults, e);
|
|
1532
1532
|
const r = er(e.baseURL, e.url, e.allowAbsoluteUrls);
|
|
1533
1533
|
return Jt(r, e.params, e.paramsSerializer);
|
|
1534
1534
|
}
|
|
1535
1535
|
};
|
|
1536
1536
|
p.forEach(["delete", "get", "head", "options"], function(e) {
|
|
1537
|
-
|
|
1538
|
-
return this.request(
|
|
1537
|
+
xe.prototype[e] = function(r, s) {
|
|
1538
|
+
return this.request(he(s || {}, {
|
|
1539
1539
|
method: e,
|
|
1540
1540
|
url: r,
|
|
1541
1541
|
data: (s || {}).data
|
|
@@ -1545,7 +1545,7 @@ p.forEach(["delete", "get", "head", "options"], function(e) {
|
|
|
1545
1545
|
p.forEach(["post", "put", "patch"], function(e) {
|
|
1546
1546
|
function r(s) {
|
|
1547
1547
|
return function(i, o, l) {
|
|
1548
|
-
return this.request(
|
|
1548
|
+
return this.request(he(l || {}, {
|
|
1549
1549
|
method: e,
|
|
1550
1550
|
headers: s ? {
|
|
1551
1551
|
"Content-Type": "multipart/form-data"
|
|
@@ -1555,7 +1555,7 @@ p.forEach(["post", "put", "patch"], function(e) {
|
|
|
1555
1555
|
}));
|
|
1556
1556
|
};
|
|
1557
1557
|
}
|
|
1558
|
-
|
|
1558
|
+
xe.prototype[e] = r(), xe.prototype[e + "Form"] = r(!0);
|
|
1559
1559
|
});
|
|
1560
1560
|
let Ln = class ar {
|
|
1561
1561
|
constructor(e) {
|
|
@@ -1707,36 +1707,36 @@ Object.entries(rt).forEach(([t, e]) => {
|
|
|
1707
1707
|
rt[e] = t;
|
|
1708
1708
|
});
|
|
1709
1709
|
function or(t) {
|
|
1710
|
-
const e = new
|
|
1711
|
-
return p.extend(r,
|
|
1712
|
-
return or(
|
|
1710
|
+
const e = new xe(t), r = Ut(xe.prototype.request, e);
|
|
1711
|
+
return p.extend(r, xe.prototype, e, { allOwnKeys: !0 }), p.extend(r, e, null, { allOwnKeys: !0 }), r.create = function(a) {
|
|
1712
|
+
return or(he(t, a));
|
|
1713
1713
|
}, r;
|
|
1714
1714
|
}
|
|
1715
|
-
const
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1715
|
+
const q = or(Ie);
|
|
1716
|
+
q.Axios = xe;
|
|
1717
|
+
q.CanceledError = je;
|
|
1718
|
+
q.CancelToken = Ln;
|
|
1719
|
+
q.isCancel = Zt;
|
|
1720
|
+
q.VERSION = sr;
|
|
1721
|
+
q.toFormData = We;
|
|
1722
|
+
q.AxiosError = L;
|
|
1723
|
+
q.Cancel = q.CanceledError;
|
|
1724
|
+
q.all = function(e) {
|
|
1725
1725
|
return Promise.all(e);
|
|
1726
1726
|
};
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1727
|
+
q.spread = Fn;
|
|
1728
|
+
q.isAxiosError = Mn;
|
|
1729
|
+
q.mergeConfig = he;
|
|
1730
|
+
q.AxiosHeaders = ne;
|
|
1731
|
+
q.formToJSON = (t) => Xt(p.isHTMLForm(t) ? new FormData(t) : t);
|
|
1732
|
+
q.getAdapter = nr.getAdapter;
|
|
1733
|
+
q.HttpStatusCode = rt;
|
|
1734
|
+
q.default = q;
|
|
1735
1735
|
const {
|
|
1736
1736
|
Axios: Ks,
|
|
1737
1737
|
AxiosError: Js,
|
|
1738
|
-
CanceledError:
|
|
1739
|
-
isCancel:
|
|
1738
|
+
CanceledError: Gs,
|
|
1739
|
+
isCancel: Xs,
|
|
1740
1740
|
CancelToken: Zs,
|
|
1741
1741
|
VERSION: Qs,
|
|
1742
1742
|
all: ea,
|
|
@@ -1749,7 +1749,7 @@ const {
|
|
|
1749
1749
|
formToJSON: ia,
|
|
1750
1750
|
getAdapter: la,
|
|
1751
1751
|
mergeConfig: ca
|
|
1752
|
-
} =
|
|
1752
|
+
} = q;
|
|
1753
1753
|
class da {
|
|
1754
1754
|
baseUrl;
|
|
1755
1755
|
apiKey;
|
|
@@ -1762,7 +1762,7 @@ class da {
|
|
|
1762
1762
|
constructor(e) {
|
|
1763
1763
|
if (!e || !e.baseUrl)
|
|
1764
1764
|
throw new Error("NeuctraAuthixClient: 'baseUrl' is required in config");
|
|
1765
|
-
this.baseUrl = e.baseUrl.replace(/\/$/, ""), this.apiKey = e.apiKey || null, this.appId = e.appId || null, this.client =
|
|
1765
|
+
this.baseUrl = e.baseUrl.replace(/\/$/, ""), this.apiKey = e.apiKey || null, this.appId = e.appId || null, this.client = q.create({
|
|
1766
1766
|
baseURL: this.baseUrl,
|
|
1767
1767
|
headers: {
|
|
1768
1768
|
"Content-Type": "application/json",
|
|
@@ -1939,6 +1939,21 @@ class da {
|
|
|
1939
1939
|
appId: i || this.appId
|
|
1940
1940
|
});
|
|
1941
1941
|
}
|
|
1942
|
+
/**
|
|
1943
|
+
* Check if a user exists for this app (lightweight)
|
|
1944
|
+
* @param userId user id to check
|
|
1945
|
+
* @returns { exists: boolean }
|
|
1946
|
+
*/
|
|
1947
|
+
async checkUser(e) {
|
|
1948
|
+
if (!e)
|
|
1949
|
+
throw new Error("checkUser: 'userId' is required");
|
|
1950
|
+
if (!this.appId)
|
|
1951
|
+
throw new Error("checkUser: SDK 'appId' is missing in config");
|
|
1952
|
+
return this.request(
|
|
1953
|
+
"GET",
|
|
1954
|
+
`/users/check-user/${e}?appId=${this.appId}`
|
|
1955
|
+
);
|
|
1956
|
+
}
|
|
1942
1957
|
// ================= USER EXTRA DATA =================
|
|
1943
1958
|
async searchAllUsersData(e) {
|
|
1944
1959
|
if (!this.appId) throw new Error("searchAllUsersData: appId missing");
|
|
@@ -1951,6 +1966,28 @@ class da {
|
|
|
1951
1966
|
const a = new URLSearchParams(s).toString();
|
|
1952
1967
|
return this.request("GET", `/users/${r}/data/search?${a}`);
|
|
1953
1968
|
}
|
|
1969
|
+
/**
|
|
1970
|
+
* Search user's extra data by dynamic reference keys
|
|
1971
|
+
* @example
|
|
1972
|
+
* searchUserDataByKeys({
|
|
1973
|
+
* userId: "123",
|
|
1974
|
+
* category: "orders",
|
|
1975
|
+
* shopId: 12,
|
|
1976
|
+
* productId: 99,
|
|
1977
|
+
* status: "active"
|
|
1978
|
+
* })
|
|
1979
|
+
*/
|
|
1980
|
+
async searchUserDataByKeys(e) {
|
|
1981
|
+
const { userId: r, ...s } = e;
|
|
1982
|
+
if (!r)
|
|
1983
|
+
throw new Error("searchUserDataByKeys: 'userId' is required");
|
|
1984
|
+
if (!s.category)
|
|
1985
|
+
throw new Error("searchUserDataByKeys: 'category' is required");
|
|
1986
|
+
const a = new URLSearchParams(
|
|
1987
|
+
Object.entries(s).reduce((i, [o, l]) => (l != null && (i[o] = String(l)), i), {})
|
|
1988
|
+
).toString();
|
|
1989
|
+
return this.request("GET", `/users/${r}/data/searchbyref?${a}`);
|
|
1990
|
+
}
|
|
1954
1991
|
/**
|
|
1955
1992
|
* Fetch ALL users' merged data for a specific app
|
|
1956
1993
|
* @param params requires appId
|
|
@@ -2027,7 +2064,7 @@ var ze = { exports: {} }, ke = {};
|
|
|
2027
2064
|
* LICENSE file in the root directory of this source tree.
|
|
2028
2065
|
*/
|
|
2029
2066
|
var Ot;
|
|
2030
|
-
function
|
|
2067
|
+
function qn() {
|
|
2031
2068
|
if (Ot) return ke;
|
|
2032
2069
|
Ot = 1;
|
|
2033
2070
|
var t = Symbol.for("react.transitional.element"), e = Symbol.for("react.fragment");
|
|
@@ -2059,7 +2096,7 @@ var Ee = {};
|
|
|
2059
2096
|
* LICENSE file in the root directory of this source tree.
|
|
2060
2097
|
*/
|
|
2061
2098
|
var zt;
|
|
2062
|
-
function
|
|
2099
|
+
function Wn() {
|
|
2063
2100
|
return zt || (zt = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
2064
2101
|
function t(f) {
|
|
2065
2102
|
if (f == null) return null;
|
|
@@ -2077,7 +2114,7 @@ function qn() {
|
|
|
2077
2114
|
return "Suspense";
|
|
2078
2115
|
case I:
|
|
2079
2116
|
return "SuspenseList";
|
|
2080
|
-
case
|
|
2117
|
+
case W:
|
|
2081
2118
|
return "Activity";
|
|
2082
2119
|
}
|
|
2083
2120
|
if (typeof f == "object")
|
|
@@ -2170,7 +2207,7 @@ function qn() {
|
|
|
2170
2207
|
function c(f, S, x, k, $, N) {
|
|
2171
2208
|
var Y = x.ref;
|
|
2172
2209
|
return f = {
|
|
2173
|
-
$$typeof:
|
|
2210
|
+
$$typeof: d,
|
|
2174
2211
|
type: f,
|
|
2175
2212
|
key: S,
|
|
2176
2213
|
props: x,
|
|
@@ -2200,7 +2237,7 @@ function qn() {
|
|
|
2200
2237
|
value: N
|
|
2201
2238
|
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
|
|
2202
2239
|
}
|
|
2203
|
-
function
|
|
2240
|
+
function u(f, S, x, k, $, N) {
|
|
2204
2241
|
var Y = S.children;
|
|
2205
2242
|
if (Y !== void 0)
|
|
2206
2243
|
if (k)
|
|
@@ -2218,7 +2255,7 @@ function qn() {
|
|
|
2218
2255
|
var se = Object.keys(S).filter(function(ve) {
|
|
2219
2256
|
return ve !== "key";
|
|
2220
2257
|
});
|
|
2221
|
-
k = 0 < se.length ? "{key: someKey, " + se.join(": ..., ") + ": ...}" : "{key: someKey}",
|
|
2258
|
+
k = 0 < se.length ? "{key: someKey, " + se.join(": ..., ") + ": ...}" : "{key: someKey}", G[Y + k] || (se = 0 < se.length ? "{" + se.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
2222
2259
|
`A props object containing a "key" prop is being spread into JSX:
|
|
2223
2260
|
let props = %s;
|
|
2224
2261
|
<%s {...props} />
|
|
@@ -2229,12 +2266,12 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2229
2266
|
Y,
|
|
2230
2267
|
se,
|
|
2231
2268
|
Y
|
|
2232
|
-
),
|
|
2269
|
+
), G[Y + k] = !0);
|
|
2233
2270
|
}
|
|
2234
2271
|
if (Y = null, x !== void 0 && (r(x), Y = "" + x), o(S) && (r(S.key), Y = "" + S.key), "key" in S) {
|
|
2235
2272
|
x = {};
|
|
2236
|
-
for (var
|
|
2237
|
-
|
|
2273
|
+
for (var ue in S)
|
|
2274
|
+
ue !== "key" && (x[ue] = S[ue]);
|
|
2238
2275
|
} else x = S;
|
|
2239
2276
|
return Y && l(
|
|
2240
2277
|
x,
|
|
@@ -2252,9 +2289,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2252
2289
|
y(f) ? f._store && (f._store.validated = 1) : typeof f == "object" && f !== null && f.$$typeof === U && (f._payload.status === "fulfilled" ? y(f._payload.value) && f._payload.value._store && (f._payload.value._store.validated = 1) : f._store && (f._store.validated = 1));
|
|
2253
2290
|
}
|
|
2254
2291
|
function y(f) {
|
|
2255
|
-
return typeof f == "object" && f !== null && f.$$typeof ===
|
|
2292
|
+
return typeof f == "object" && f !== null && f.$$typeof === d;
|
|
2256
2293
|
}
|
|
2257
|
-
var w = Le,
|
|
2294
|
+
var w = Le, d = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), m = Symbol.for("react.fragment"), _ = Symbol.for("react.strict_mode"), R = Symbol.for("react.profiler"), A = Symbol.for("react.consumer"), C = Symbol.for("react.context"), M = Symbol.for("react.forward_ref"), g = Symbol.for("react.suspense"), I = Symbol.for("react.suspense_list"), v = Symbol.for("react.memo"), U = Symbol.for("react.lazy"), W = Symbol.for("react.activity"), F = Symbol.for("react.client.reference"), V = w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, Z = Object.prototype.hasOwnProperty, T = Array.isArray, J = console.createTask ? console.createTask : function() {
|
|
2258
2295
|
return null;
|
|
2259
2296
|
};
|
|
2260
2297
|
w = {
|
|
@@ -2265,10 +2302,10 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2265
2302
|
var z, P = {}, K = w.react_stack_bottom_frame.bind(
|
|
2266
2303
|
w,
|
|
2267
2304
|
i
|
|
2268
|
-
)(), Q = J(s(i)),
|
|
2305
|
+
)(), Q = J(s(i)), G = {};
|
|
2269
2306
|
Ee.Fragment = m, Ee.jsx = function(f, S, x) {
|
|
2270
2307
|
var k = 1e4 > V.recentlyCreatedOwnerStacks++;
|
|
2271
|
-
return
|
|
2308
|
+
return u(
|
|
2272
2309
|
f,
|
|
2273
2310
|
S,
|
|
2274
2311
|
x,
|
|
@@ -2278,7 +2315,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2278
2315
|
);
|
|
2279
2316
|
}, Ee.jsxs = function(f, S, x) {
|
|
2280
2317
|
var k = 1e4 > V.recentlyCreatedOwnerStacks++;
|
|
2281
|
-
return
|
|
2318
|
+
return u(
|
|
2282
2319
|
f,
|
|
2283
2320
|
S,
|
|
2284
2321
|
x,
|
|
@@ -2291,17 +2328,17 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2291
2328
|
}
|
|
2292
2329
|
var At;
|
|
2293
2330
|
function Bn() {
|
|
2294
|
-
return At || (At = 1, process.env.NODE_ENV === "production" ? ze.exports =
|
|
2331
|
+
return At || (At = 1, process.env.NODE_ENV === "production" ? ze.exports = qn() : ze.exports = Wn()), ze.exports;
|
|
2295
2332
|
}
|
|
2296
2333
|
var n = Bn();
|
|
2297
2334
|
const Hn = async (t, e) => {
|
|
2298
|
-
const { name: r, email: s, password: a, appId: i, phone: o, address: l, avatarUrl: h, isActive: c = !0, role:
|
|
2335
|
+
const { name: r, email: s, password: a, appId: i, phone: o, address: l, avatarUrl: h, isActive: c = !0, role: u = "user" } = t, { baseUrl: b, apiKey: y } = e;
|
|
2299
2336
|
if (!y)
|
|
2300
2337
|
throw new Error("API key is required for signup");
|
|
2301
2338
|
if (!r || !s || !a || !i)
|
|
2302
2339
|
throw new Error("Name, email, password, and appId are required");
|
|
2303
2340
|
try {
|
|
2304
|
-
const w = await
|
|
2341
|
+
const w = await q.post(
|
|
2305
2342
|
`${b}/users/signup`,
|
|
2306
2343
|
{
|
|
2307
2344
|
name: r,
|
|
@@ -2312,7 +2349,7 @@ const Hn = async (t, e) => {
|
|
|
2312
2349
|
address: l,
|
|
2313
2350
|
avatarUrl: h,
|
|
2314
2351
|
isActive: c,
|
|
2315
|
-
role:
|
|
2352
|
+
role: u
|
|
2316
2353
|
},
|
|
2317
2354
|
{
|
|
2318
2355
|
headers: {
|
|
@@ -2323,15 +2360,15 @@ const Hn = async (t, e) => {
|
|
|
2323
2360
|
);
|
|
2324
2361
|
return w.data?.user && localStorage.setItem("userInfo", JSON.stringify(w.data.user)), w.data.user;
|
|
2325
2362
|
} catch (w) {
|
|
2326
|
-
const
|
|
2327
|
-
if (console.error("Signup API Error:",
|
|
2328
|
-
if (
|
|
2363
|
+
const d = w.response?.data?.message || w.message || "Signup failed";
|
|
2364
|
+
if (console.error("Signup API Error:", d), w.response?.status === 400) {
|
|
2365
|
+
if (d.includes("already exists"))
|
|
2329
2366
|
throw {
|
|
2330
2367
|
success: !1,
|
|
2331
2368
|
message: "User with this email already exists for this app",
|
|
2332
2369
|
status: 400
|
|
2333
2370
|
};
|
|
2334
|
-
if (
|
|
2371
|
+
if (d.includes("inactive"))
|
|
2335
2372
|
throw {
|
|
2336
2373
|
success: !1,
|
|
2337
2374
|
message: "Cannot signup under an inactive app",
|
|
@@ -2344,7 +2381,7 @@ const Hn = async (t, e) => {
|
|
|
2344
2381
|
status: 404
|
|
2345
2382
|
} : {
|
|
2346
2383
|
success: !1,
|
|
2347
|
-
message:
|
|
2384
|
+
message: d,
|
|
2348
2385
|
status: w.response?.status || 500
|
|
2349
2386
|
};
|
|
2350
2387
|
}
|
|
@@ -2389,7 +2426,7 @@ var Jn = {
|
|
|
2389
2426
|
* This source code is licensed under the ISC license.
|
|
2390
2427
|
* See the LICENSE file in the root directory of this source tree.
|
|
2391
2428
|
*/
|
|
2392
|
-
const
|
|
2429
|
+
const Gn = Nt(
|
|
2393
2430
|
({
|
|
2394
2431
|
color: t = "currentColor",
|
|
2395
2432
|
size: e = 24,
|
|
@@ -2399,7 +2436,7 @@ const Xn = Nt(
|
|
|
2399
2436
|
children: i,
|
|
2400
2437
|
iconNode: o,
|
|
2401
2438
|
...l
|
|
2402
|
-
}, h) =>
|
|
2439
|
+
}, h) => Xe(
|
|
2403
2440
|
"svg",
|
|
2404
2441
|
{
|
|
2405
2442
|
ref: h,
|
|
@@ -2413,7 +2450,7 @@ const Xn = Nt(
|
|
|
2413
2450
|
...l
|
|
2414
2451
|
},
|
|
2415
2452
|
[
|
|
2416
|
-
...o.map(([c,
|
|
2453
|
+
...o.map(([c, u]) => Xe(c, u)),
|
|
2417
2454
|
...Array.isArray(i) ? i : [i]
|
|
2418
2455
|
]
|
|
2419
2456
|
)
|
|
@@ -2426,7 +2463,7 @@ const Xn = Nt(
|
|
|
2426
2463
|
*/
|
|
2427
2464
|
const B = (t, e) => {
|
|
2428
2465
|
const r = Nt(
|
|
2429
|
-
({ className: s, ...a }, i) =>
|
|
2466
|
+
({ className: s, ...a }, i) => Xe(Gn, {
|
|
2430
2467
|
ref: i,
|
|
2431
2468
|
iconNode: e,
|
|
2432
2469
|
className: ir(
|
|
@@ -2445,7 +2482,7 @@ const B = (t, e) => {
|
|
|
2445
2482
|
* This source code is licensed under the ISC license.
|
|
2446
2483
|
* See the LICENSE file in the root directory of this source tree.
|
|
2447
2484
|
*/
|
|
2448
|
-
const
|
|
2485
|
+
const Xn = [
|
|
2449
2486
|
[
|
|
2450
2487
|
"path",
|
|
2451
2488
|
{
|
|
@@ -2454,7 +2491,7 @@ const Gn = [
|
|
|
2454
2491
|
}
|
|
2455
2492
|
],
|
|
2456
2493
|
["circle", { cx: "12", cy: "13", r: "3", key: "1vg3eu" }]
|
|
2457
|
-
], nt = B("camera",
|
|
2494
|
+
], nt = B("camera", Xn);
|
|
2458
2495
|
/**
|
|
2459
2496
|
* @license lucide-react v0.544.0 - ISC
|
|
2460
2497
|
*
|
|
@@ -2492,7 +2529,7 @@ const ts = [
|
|
|
2492
2529
|
const rs = [
|
|
2493
2530
|
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
|
2494
2531
|
["path", { d: "m9 12 2 2 4-4", key: "dzmm74" }]
|
|
2495
|
-
],
|
|
2532
|
+
], Ge = B("circle-check", rs);
|
|
2496
2533
|
/**
|
|
2497
2534
|
* @license lucide-react v0.544.0 - ISC
|
|
2498
2535
|
*
|
|
@@ -2854,7 +2891,7 @@ const Ls = [
|
|
|
2854
2891
|
if (!t.baseUrl || !t.apiKey || !t.appId)
|
|
2855
2892
|
throw new Error("baseUrl, apiKey, and appId are required");
|
|
2856
2893
|
Ue.baseUrl = t.baseUrl, Ue.apiKey = t.apiKey, Ue.appId = t.appId;
|
|
2857
|
-
},
|
|
2894
|
+
}, ge = () => Ue, pa = ({
|
|
2858
2895
|
logoUrl: t,
|
|
2859
2896
|
logoLinkUrl: e,
|
|
2860
2897
|
title: r = "Create Your Account",
|
|
@@ -2867,19 +2904,19 @@ const Ls = [
|
|
|
2867
2904
|
showAvatar: h = !1,
|
|
2868
2905
|
roles: c = [],
|
|
2869
2906
|
// 🔥 FIXED
|
|
2870
|
-
showRoleSelector:
|
|
2907
|
+
showRoleSelector: u = !1,
|
|
2871
2908
|
// 🔥 FIXED
|
|
2872
2909
|
loginUrl: b,
|
|
2873
2910
|
onSuccess: y,
|
|
2874
2911
|
onError: w
|
|
2875
2912
|
}) => {
|
|
2876
|
-
const { baseUrl:
|
|
2913
|
+
const { baseUrl: d, apiKey: j, appId: m } = ge(), _ = {
|
|
2877
2914
|
name: "",
|
|
2878
2915
|
email: "",
|
|
2879
2916
|
password: "",
|
|
2880
2917
|
role: c.length ? c[0] : "user",
|
|
2881
2918
|
...h && { avatarUrl: "" }
|
|
2882
|
-
}, [R, A] = O(_), [C, M] = O(!1), [g, I] = O(!1), [v, U] = O(null), [
|
|
2919
|
+
}, [R, A] = O(_), [C, M] = O(!1), [g, I] = O(!1), [v, U] = O(null), [W, F] = O({}), [V, Z] = O(!1), T = l ? "#ffffff" : "#111827", J = l ? "#a1a1aa" : "#6b7280", z = l ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.02)", P = l ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)";
|
|
2883
2920
|
Le.useEffect(() => {
|
|
2884
2921
|
if (typeof window < "u") {
|
|
2885
2922
|
const S = () => Z(window.innerWidth < 768);
|
|
@@ -2888,18 +2925,18 @@ const Ls = [
|
|
|
2888
2925
|
}, []);
|
|
2889
2926
|
const K = (S) => {
|
|
2890
2927
|
const { name: x, value: k } = S.target;
|
|
2891
|
-
A(($) => ({ ...$, [x]: k })),
|
|
2928
|
+
A(($) => ({ ...$, [x]: k })), W[x] && F(($) => ({ ...$, [x]: void 0 }));
|
|
2892
2929
|
}, Q = () => {
|
|
2893
2930
|
const S = {};
|
|
2894
2931
|
return R.name.trim() || (S.name = "Name is required"), R.email.trim() ? /\S+@\S+\.\S+/.test(R.email) || (S.email = "Invalid email address") : S.email = "Email is required", R.password ? R.password.length < 6 && (S.password = "Password must be at least 6 characters") : S.password = "Password is required", F(S), Object.keys(S).length === 0;
|
|
2895
|
-
},
|
|
2932
|
+
}, G = async (S) => {
|
|
2896
2933
|
if (S.preventDefault(), !!Q()) {
|
|
2897
2934
|
I(!0), U(null);
|
|
2898
2935
|
try {
|
|
2899
2936
|
const x = {
|
|
2900
2937
|
...R,
|
|
2901
2938
|
appId: m
|
|
2902
|
-
}, k = await Hn(x, { baseUrl:
|
|
2939
|
+
}, k = await Hn(x, { baseUrl: d, apiKey: j });
|
|
2903
2940
|
U({ type: "success", text: "Account created successfully!" }), y && y(k);
|
|
2904
2941
|
} catch (x) {
|
|
2905
2942
|
const k = x.message || "Signup failed. Please try again.";
|
|
@@ -3033,10 +3070,10 @@ const Ls = [
|
|
|
3033
3070
|
/* @__PURE__ */ n.jsxs(
|
|
3034
3071
|
"form",
|
|
3035
3072
|
{
|
|
3036
|
-
onSubmit:
|
|
3073
|
+
onSubmit: G,
|
|
3037
3074
|
style: { display: "flex", flexDirection: "column", gap: "14px" },
|
|
3038
3075
|
children: [
|
|
3039
|
-
|
|
3076
|
+
u && c && c.length === 2 && /* @__PURE__ */ n.jsxs(
|
|
3040
3077
|
"div",
|
|
3041
3078
|
{
|
|
3042
3079
|
style: { display: "flex", flexDirection: "column", gap: "4px" },
|
|
@@ -3173,12 +3210,12 @@ const Ls = [
|
|
|
3173
3210
|
onChange: K,
|
|
3174
3211
|
style: {
|
|
3175
3212
|
...f,
|
|
3176
|
-
borderColor:
|
|
3213
|
+
borderColor: W.name ? "#ef4444" : P
|
|
3177
3214
|
}
|
|
3178
3215
|
}
|
|
3179
3216
|
)
|
|
3180
3217
|
] }),
|
|
3181
|
-
|
|
3218
|
+
W.name && /* @__PURE__ */ n.jsx(
|
|
3182
3219
|
"span",
|
|
3183
3220
|
{
|
|
3184
3221
|
style: {
|
|
@@ -3186,7 +3223,7 @@ const Ls = [
|
|
|
3186
3223
|
fontSize: "12px",
|
|
3187
3224
|
marginTop: "2px"
|
|
3188
3225
|
},
|
|
3189
|
-
children:
|
|
3226
|
+
children: W.name
|
|
3190
3227
|
}
|
|
3191
3228
|
)
|
|
3192
3229
|
] }),
|
|
@@ -3228,12 +3265,12 @@ const Ls = [
|
|
|
3228
3265
|
onChange: K,
|
|
3229
3266
|
style: {
|
|
3230
3267
|
...f,
|
|
3231
|
-
borderColor:
|
|
3268
|
+
borderColor: W.email ? "#ef4444" : P
|
|
3232
3269
|
}
|
|
3233
3270
|
}
|
|
3234
3271
|
)
|
|
3235
3272
|
] }),
|
|
3236
|
-
|
|
3273
|
+
W.email && /* @__PURE__ */ n.jsx(
|
|
3237
3274
|
"span",
|
|
3238
3275
|
{
|
|
3239
3276
|
style: {
|
|
@@ -3241,7 +3278,7 @@ const Ls = [
|
|
|
3241
3278
|
fontSize: "12px",
|
|
3242
3279
|
marginTop: "2px"
|
|
3243
3280
|
},
|
|
3244
|
-
children:
|
|
3281
|
+
children: W.email
|
|
3245
3282
|
}
|
|
3246
3283
|
)
|
|
3247
3284
|
] }),
|
|
@@ -3283,7 +3320,7 @@ const Ls = [
|
|
|
3283
3320
|
onChange: K,
|
|
3284
3321
|
style: {
|
|
3285
3322
|
...f,
|
|
3286
|
-
borderColor:
|
|
3323
|
+
borderColor: W.password ? "#ef4444" : P
|
|
3287
3324
|
}
|
|
3288
3325
|
}
|
|
3289
3326
|
),
|
|
@@ -3307,7 +3344,7 @@ const Ls = [
|
|
|
3307
3344
|
}
|
|
3308
3345
|
)
|
|
3309
3346
|
] }),
|
|
3310
|
-
|
|
3347
|
+
W.password && /* @__PURE__ */ n.jsx(
|
|
3311
3348
|
"span",
|
|
3312
3349
|
{
|
|
3313
3350
|
style: {
|
|
@@ -3315,7 +3352,7 @@ const Ls = [
|
|
|
3315
3352
|
fontSize: "12px",
|
|
3316
3353
|
marginTop: "2px"
|
|
3317
3354
|
},
|
|
3318
|
-
children:
|
|
3355
|
+
children: W.password
|
|
3319
3356
|
}
|
|
3320
3357
|
)
|
|
3321
3358
|
] }),
|
|
@@ -3477,7 +3514,7 @@ const Ls = [
|
|
|
3477
3514
|
if (!o)
|
|
3478
3515
|
throw new Error("API key is required for login");
|
|
3479
3516
|
try {
|
|
3480
|
-
const l = await
|
|
3517
|
+
const l = await q.post(
|
|
3481
3518
|
`${i}/users/login`,
|
|
3482
3519
|
{ email: r, password: s, appId: a },
|
|
3483
3520
|
{
|
|
@@ -3507,9 +3544,9 @@ const Ls = [
|
|
|
3507
3544
|
darkMode: l = !0,
|
|
3508
3545
|
signupUrl: h,
|
|
3509
3546
|
onSuccess: c,
|
|
3510
|
-
onError:
|
|
3547
|
+
onError: u
|
|
3511
3548
|
}) => {
|
|
3512
|
-
const { baseUrl: b, apiKey: y, appId: w } =
|
|
3549
|
+
const { baseUrl: b, apiKey: y, appId: w } = ge(), [d, j] = O("login"), [m, _] = O(1), [R, A] = O(!1), [C, M] = O(!1), [g, I] = O(null), [v, U] = O(""), [W, F] = O(""), [V, Z] = O({
|
|
3513
3550
|
email: "",
|
|
3514
3551
|
otp: "",
|
|
3515
3552
|
newPassword: "",
|
|
@@ -3521,17 +3558,17 @@ const Ls = [
|
|
|
3521
3558
|
return $(), window.addEventListener("resize", $), () => window.removeEventListener("resize", $);
|
|
3522
3559
|
}
|
|
3523
3560
|
}, []);
|
|
3524
|
-
const
|
|
3561
|
+
const G = async ($) => {
|
|
3525
3562
|
$.preventDefault(), M(!0), I(null);
|
|
3526
3563
|
try {
|
|
3527
3564
|
const N = await Fs(
|
|
3528
|
-
{ email: v, password:
|
|
3565
|
+
{ email: v, password: W, appId: w },
|
|
3529
3566
|
{ baseUrl: b, apiKey: y }
|
|
3530
3567
|
);
|
|
3531
3568
|
I({ type: "success", text: `Welcome ${N.name}` }), c?.(N);
|
|
3532
3569
|
} catch (N) {
|
|
3533
3570
|
const Y = N.message || "Login failed";
|
|
3534
|
-
I({ type: "error", text: Y }),
|
|
3571
|
+
I({ type: "error", text: Y }), u?.(N);
|
|
3535
3572
|
} finally {
|
|
3536
3573
|
M(!1);
|
|
3537
3574
|
}
|
|
@@ -3540,7 +3577,7 @@ const Ls = [
|
|
|
3540
3577
|
}, S = async ($) => {
|
|
3541
3578
|
$.preventDefault(), M(!0), I(null);
|
|
3542
3579
|
try {
|
|
3543
|
-
const N = await
|
|
3580
|
+
const N = await q.post(
|
|
3544
3581
|
`${b}/users/forgot-password`,
|
|
3545
3582
|
{
|
|
3546
3583
|
email: V.email,
|
|
@@ -3563,7 +3600,7 @@ const Ls = [
|
|
|
3563
3600
|
}, x = async ($) => {
|
|
3564
3601
|
$.preventDefault(), M(!0), I(null);
|
|
3565
3602
|
try {
|
|
3566
|
-
const N = await
|
|
3603
|
+
const N = await q.post(
|
|
3567
3604
|
`${b}/users/reset-password`,
|
|
3568
3605
|
V,
|
|
3569
3606
|
{ headers: { "x-api-key": y } }
|
|
@@ -3653,7 +3690,7 @@ const Ls = [
|
|
|
3653
3690
|
color: z,
|
|
3654
3691
|
margin: 0
|
|
3655
3692
|
},
|
|
3656
|
-
children:
|
|
3693
|
+
children: d === "login" ? r : m === 1 ? "Forgot Password" : "Reset Password"
|
|
3657
3694
|
}
|
|
3658
3695
|
),
|
|
3659
3696
|
/* @__PURE__ */ n.jsx(
|
|
@@ -3663,16 +3700,16 @@ const Ls = [
|
|
|
3663
3700
|
fontSize: "14px",
|
|
3664
3701
|
color: P
|
|
3665
3702
|
},
|
|
3666
|
-
children:
|
|
3703
|
+
children: d === "login" ? s : "Follow the steps to reset your password"
|
|
3667
3704
|
}
|
|
3668
3705
|
)
|
|
3669
3706
|
]
|
|
3670
3707
|
}
|
|
3671
3708
|
),
|
|
3672
|
-
|
|
3709
|
+
d === "login" && /* @__PURE__ */ n.jsxs(
|
|
3673
3710
|
"form",
|
|
3674
3711
|
{
|
|
3675
|
-
onSubmit:
|
|
3712
|
+
onSubmit: G,
|
|
3676
3713
|
style: { display: "flex", flexDirection: "column", gap: "14px" },
|
|
3677
3714
|
children: [
|
|
3678
3715
|
/* @__PURE__ */ n.jsxs(
|
|
@@ -3758,7 +3795,7 @@ const Ls = [
|
|
|
3758
3795
|
id: "login-password",
|
|
3759
3796
|
type: R ? "text" : "password",
|
|
3760
3797
|
placeholder: "Enter your password",
|
|
3761
|
-
value:
|
|
3798
|
+
value: W,
|
|
3762
3799
|
onChange: ($) => F($.target.value),
|
|
3763
3800
|
style: k
|
|
3764
3801
|
}
|
|
@@ -3845,7 +3882,7 @@ const Ls = [
|
|
|
3845
3882
|
]
|
|
3846
3883
|
}
|
|
3847
3884
|
),
|
|
3848
|
-
|
|
3885
|
+
d === "forgot" && /* @__PURE__ */ n.jsxs(
|
|
3849
3886
|
"form",
|
|
3850
3887
|
{
|
|
3851
3888
|
onSubmit: m === 1 ? S : x,
|
|
@@ -4089,42 +4126,31 @@ const Ls = [
|
|
|
4089
4126
|
width: s,
|
|
4090
4127
|
height: a
|
|
4091
4128
|
}) => {
|
|
4092
|
-
const
|
|
4129
|
+
const [i, o] = O(() => {
|
|
4130
|
+
if (typeof window > "u") return !1;
|
|
4131
|
+
try {
|
|
4132
|
+
const l = localStorage.getItem("userInfo");
|
|
4133
|
+
return !!(l && l !== "undefined" && l !== "null");
|
|
4134
|
+
} catch {
|
|
4135
|
+
return !1;
|
|
4136
|
+
}
|
|
4137
|
+
});
|
|
4093
4138
|
return te(() => {
|
|
4094
|
-
|
|
4095
|
-
|
|
4096
|
-
|
|
4097
|
-
|
|
4098
|
-
|
|
4099
|
-
|
|
4100
|
-
|
|
4101
|
-
}
|
|
4102
|
-
|
|
4103
|
-
if (!u?.id) {
|
|
4104
|
-
l(!1);
|
|
4105
|
-
return;
|
|
4106
|
-
}
|
|
4107
|
-
const j = await fetch(
|
|
4108
|
-
`https://server.authix.neuctra.com/api/users/check-user/${u.id}?appId=${i}`
|
|
4109
|
-
);
|
|
4110
|
-
if (!j.ok) {
|
|
4111
|
-
l(!1);
|
|
4112
|
-
return;
|
|
4139
|
+
const l = () => {
|
|
4140
|
+
if (!(typeof window > "u"))
|
|
4141
|
+
try {
|
|
4142
|
+
const h = localStorage.getItem("userInfo");
|
|
4143
|
+
o(
|
|
4144
|
+
!!(h && h !== "undefined" && h !== "null")
|
|
4145
|
+
);
|
|
4146
|
+
} catch {
|
|
4147
|
+
o(!1);
|
|
4113
4148
|
}
|
|
4114
|
-
const m = await j.json();
|
|
4115
|
-
d || l(!!m?.exists);
|
|
4116
|
-
} catch {
|
|
4117
|
-
d || l(!1);
|
|
4118
|
-
} finally {
|
|
4119
|
-
d || c(!1);
|
|
4120
|
-
}
|
|
4121
4149
|
};
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
return window.addEventListener("storage", y), () => {
|
|
4125
|
-
d = !0, window.removeEventListener("storage", y);
|
|
4150
|
+
return window.addEventListener("storage", l), () => {
|
|
4151
|
+
window.removeEventListener("storage", l);
|
|
4126
4152
|
};
|
|
4127
|
-
}, [
|
|
4153
|
+
}, []), i ? /* @__PURE__ */ n.jsx(
|
|
4128
4154
|
"div",
|
|
4129
4155
|
{
|
|
4130
4156
|
className: r,
|
|
@@ -4187,7 +4213,7 @@ const Ls = [
|
|
|
4187
4213
|
token: i,
|
|
4188
4214
|
colors: o
|
|
4189
4215
|
}) => {
|
|
4190
|
-
const { baseUrl: l, apiKey: h, appId: c } =
|
|
4216
|
+
const { baseUrl: l, apiKey: h, appId: c } = ge(), [u, b] = O(!1), [y, w] = O(""), [d, j] = O("warning"), [m, _] = O(!1);
|
|
4191
4217
|
if (te(() => {
|
|
4192
4218
|
if (typeof window > "u") return;
|
|
4193
4219
|
const g = () => {
|
|
@@ -4198,7 +4224,7 @@ const Ls = [
|
|
|
4198
4224
|
const R = async () => {
|
|
4199
4225
|
b(!0), j("processing");
|
|
4200
4226
|
try {
|
|
4201
|
-
const { data: g } = await
|
|
4227
|
+
const { data: g } = await q.delete(`${l}/users/delete/${a}`, {
|
|
4202
4228
|
data: { appId: c },
|
|
4203
4229
|
headers: {
|
|
4204
4230
|
"x-api-key": h
|
|
@@ -4213,9 +4239,9 @@ const Ls = [
|
|
|
4213
4239
|
b(!1);
|
|
4214
4240
|
}
|
|
4215
4241
|
}, A = y.toLowerCase() === "delete my account", C = (g) => {
|
|
4216
|
-
g.target === g.currentTarget &&
|
|
4242
|
+
g.target === g.currentTarget && d !== "processing" && d !== "success" && e();
|
|
4217
4243
|
}, M = () => {
|
|
4218
|
-
switch (
|
|
4244
|
+
switch (d) {
|
|
4219
4245
|
case "warning":
|
|
4220
4246
|
return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
4221
4247
|
/* @__PURE__ */ n.jsxs(
|
|
@@ -4566,7 +4592,7 @@ const Ls = [
|
|
|
4566
4592
|
fontWeight: 500
|
|
4567
4593
|
},
|
|
4568
4594
|
children: [
|
|
4569
|
-
/* @__PURE__ */ n.jsx(
|
|
4595
|
+
/* @__PURE__ */ n.jsx(Ge, { size: 16 }),
|
|
4570
4596
|
/* @__PURE__ */ n.jsx("span", { children: "Confirmation accepted" })
|
|
4571
4597
|
]
|
|
4572
4598
|
}
|
|
@@ -4615,7 +4641,7 @@ const Ls = [
|
|
|
4615
4641
|
"button",
|
|
4616
4642
|
{
|
|
4617
4643
|
onClick: R,
|
|
4618
|
-
disabled: !A ||
|
|
4644
|
+
disabled: !A || u,
|
|
4619
4645
|
style: {
|
|
4620
4646
|
padding: "10px 24px",
|
|
4621
4647
|
borderRadius: "10px",
|
|
@@ -4624,22 +4650,22 @@ const Ls = [
|
|
|
4624
4650
|
color: "white",
|
|
4625
4651
|
fontSize: "14px",
|
|
4626
4652
|
fontWeight: 600,
|
|
4627
|
-
cursor: !A ||
|
|
4653
|
+
cursor: !A || u ? "not-allowed" : "pointer",
|
|
4628
4654
|
flex: m ? "none" : 1,
|
|
4629
4655
|
minWidth: m ? "100%" : "140px",
|
|
4630
|
-
opacity: !A ||
|
|
4656
|
+
opacity: !A || u ? 0.6 : 1,
|
|
4631
4657
|
display: "flex",
|
|
4632
4658
|
alignItems: "center",
|
|
4633
4659
|
justifyContent: "center",
|
|
4634
4660
|
gap: "8px",
|
|
4635
4661
|
transition: "all 0.2s ease",
|
|
4636
|
-
boxShadow: !A ||
|
|
4662
|
+
boxShadow: !A || u ? "none" : "0 4px 12px rgba(239, 68, 68, 0.4)"
|
|
4637
4663
|
},
|
|
4638
4664
|
onMouseOver: (g) => {
|
|
4639
|
-
A && !
|
|
4665
|
+
A && !u && (g.currentTarget.style.transform = "translateY(-1px)", g.currentTarget.style.boxShadow = "0 6px 20px rgba(239, 68, 68, 0.5)");
|
|
4640
4666
|
},
|
|
4641
4667
|
onMouseOut: (g) => {
|
|
4642
|
-
A && !
|
|
4668
|
+
A && !u && (g.currentTarget.style.transform = "translateY(0)", g.currentTarget.style.boxShadow = "0 4px 12px rgba(239, 68, 68, 0.4)");
|
|
4643
4669
|
},
|
|
4644
4670
|
children: [
|
|
4645
4671
|
/* @__PURE__ */ n.jsx(Ne, { size: 16 }),
|
|
@@ -4825,7 +4851,7 @@ const Ls = [
|
|
|
4825
4851
|
color: "white",
|
|
4826
4852
|
flexShrink: 0
|
|
4827
4853
|
},
|
|
4828
|
-
children: /* @__PURE__ */ n.jsx(
|
|
4854
|
+
children: /* @__PURE__ */ n.jsx(Ge, { size: 20 })
|
|
4829
4855
|
}
|
|
4830
4856
|
),
|
|
4831
4857
|
/* @__PURE__ */ n.jsxs("div", { style: { flex: 1 }, children: [
|
|
@@ -4871,7 +4897,7 @@ const Ls = [
|
|
|
4871
4897
|
},
|
|
4872
4898
|
children: [
|
|
4873
4899
|
/* @__PURE__ */ n.jsx(
|
|
4874
|
-
|
|
4900
|
+
Ge,
|
|
4875
4901
|
{
|
|
4876
4902
|
size: 48,
|
|
4877
4903
|
style: {
|
|
@@ -5033,26 +5059,26 @@ const Ls = [
|
|
|
5033
5059
|
]
|
|
5034
5060
|
}
|
|
5035
5061
|
);
|
|
5036
|
-
},
|
|
5062
|
+
}, qs = ({
|
|
5037
5063
|
isOpen: t,
|
|
5038
5064
|
onClose: e,
|
|
5039
5065
|
onUpdate: r,
|
|
5040
5066
|
colors: s
|
|
5041
5067
|
}) => {
|
|
5042
|
-
const [a, i] = O(""), [o, l] = O(!1), [h, c] = O(!1), [
|
|
5068
|
+
const [a, i] = O(""), [o, l] = O(!1), [h, c] = O(!1), [u, b] = O({ isValid: !1, message: "", type: null });
|
|
5043
5069
|
if (te(() => {
|
|
5044
5070
|
if (typeof window > "u") return;
|
|
5045
|
-
const
|
|
5071
|
+
const d = () => {
|
|
5046
5072
|
c(window.innerWidth < 640);
|
|
5047
5073
|
};
|
|
5048
|
-
return
|
|
5074
|
+
return d(), window.addEventListener("resize", d), () => window.removeEventListener("resize", d);
|
|
5049
5075
|
}, []), te(() => {
|
|
5050
5076
|
if (!a.trim()) {
|
|
5051
5077
|
b({ isValid: !1, message: "", type: null });
|
|
5052
5078
|
return;
|
|
5053
5079
|
}
|
|
5054
5080
|
try {
|
|
5055
|
-
const
|
|
5081
|
+
const d = new URL(a), j = /\.(jpg|jpeg|png|gif|webp|svg)$/i.test(d.pathname);
|
|
5056
5082
|
b(j ? {
|
|
5057
5083
|
isValid: !0,
|
|
5058
5084
|
message: "Valid image URL",
|
|
@@ -5071,7 +5097,7 @@ const Ls = [
|
|
|
5071
5097
|
}
|
|
5072
5098
|
}, [a]), !t) return null;
|
|
5073
5099
|
const y = async () => {
|
|
5074
|
-
if (!(!a || !
|
|
5100
|
+
if (!(!a || !u.isValid)) {
|
|
5075
5101
|
l(!0);
|
|
5076
5102
|
try {
|
|
5077
5103
|
await r(a) && (i(""), e());
|
|
@@ -5079,8 +5105,8 @@ const Ls = [
|
|
|
5079
5105
|
l(!1);
|
|
5080
5106
|
}
|
|
5081
5107
|
}
|
|
5082
|
-
}, w = (
|
|
5083
|
-
|
|
5108
|
+
}, w = (d) => {
|
|
5109
|
+
d.target === d.currentTarget && e();
|
|
5084
5110
|
};
|
|
5085
5111
|
return /* @__PURE__ */ n.jsxs(
|
|
5086
5112
|
"div",
|
|
@@ -5187,11 +5213,11 @@ const Ls = [
|
|
|
5187
5213
|
flexShrink: 0,
|
|
5188
5214
|
transition: "all 0.2s ease"
|
|
5189
5215
|
},
|
|
5190
|
-
onMouseOver: (
|
|
5191
|
-
|
|
5216
|
+
onMouseOver: (d) => {
|
|
5217
|
+
d.currentTarget.style.backgroundColor = s.border, d.currentTarget.style.color = s.textPrimary;
|
|
5192
5218
|
},
|
|
5193
|
-
onMouseOut: (
|
|
5194
|
-
|
|
5219
|
+
onMouseOut: (d) => {
|
|
5220
|
+
d.currentTarget.style.backgroundColor = "transparent", d.currentTarget.style.color = s.textTertiary;
|
|
5195
5221
|
},
|
|
5196
5222
|
children: /* @__PURE__ */ n.jsx(Pe, { size: 20 })
|
|
5197
5223
|
}
|
|
@@ -5236,13 +5262,13 @@ const Ls = [
|
|
|
5236
5262
|
id: "avatar-url",
|
|
5237
5263
|
placeholder: "https://example.com/your-avatar.jpg",
|
|
5238
5264
|
value: a,
|
|
5239
|
-
onChange: (
|
|
5265
|
+
onChange: (d) => i(d.target.value),
|
|
5240
5266
|
style: {
|
|
5241
5267
|
width: "100%",
|
|
5242
5268
|
padding: "14px 16px",
|
|
5243
5269
|
paddingLeft: "44px",
|
|
5244
5270
|
borderRadius: "12px",
|
|
5245
|
-
border: `1.5px solid ${
|
|
5271
|
+
border: `1.5px solid ${u.type === "error" ? s.error : u.type === "success" ? s.success : s.border}`,
|
|
5246
5272
|
backgroundColor: "transparent",
|
|
5247
5273
|
color: s.textPrimary,
|
|
5248
5274
|
fontSize: "15px",
|
|
@@ -5250,11 +5276,11 @@ const Ls = [
|
|
|
5250
5276
|
transition: "all 0.2s ease",
|
|
5251
5277
|
boxSizing: "border-box"
|
|
5252
5278
|
},
|
|
5253
|
-
onFocus: (
|
|
5254
|
-
|
|
5279
|
+
onFocus: (d) => {
|
|
5280
|
+
d.target.style.borderColor = s.accent, d.target.style.boxShadow = `0 0 0 3px ${s.accent}20`;
|
|
5255
5281
|
},
|
|
5256
|
-
onBlur: (
|
|
5257
|
-
|
|
5282
|
+
onBlur: (d) => {
|
|
5283
|
+
d.target.style.borderColor = u.type === "error" ? s.error : u.type === "success" ? s.success : s.border, d.target.style.boxShadow = "none";
|
|
5258
5284
|
},
|
|
5259
5285
|
disabled: o
|
|
5260
5286
|
}
|
|
@@ -5273,7 +5299,7 @@ const Ls = [
|
|
|
5273
5299
|
}
|
|
5274
5300
|
)
|
|
5275
5301
|
] }),
|
|
5276
|
-
|
|
5302
|
+
u.message && /* @__PURE__ */ n.jsxs(
|
|
5277
5303
|
"div",
|
|
5278
5304
|
{
|
|
5279
5305
|
style: {
|
|
@@ -5282,18 +5308,18 @@ const Ls = [
|
|
|
5282
5308
|
gap: "6px",
|
|
5283
5309
|
marginTop: "8px",
|
|
5284
5310
|
fontSize: "13px",
|
|
5285
|
-
color:
|
|
5311
|
+
color: u.type === "success" ? s.success : u.type === "error" ? s.error : s.textTertiary
|
|
5286
5312
|
},
|
|
5287
5313
|
children: [
|
|
5288
|
-
|
|
5289
|
-
|
|
5290
|
-
|
|
5291
|
-
|
|
5314
|
+
u.type === "success" && /* @__PURE__ */ n.jsx(ce, { size: 14 }),
|
|
5315
|
+
u.type === "error" && /* @__PURE__ */ n.jsx(le, { size: 14 }),
|
|
5316
|
+
u.type === "warning" && /* @__PURE__ */ n.jsx(le, { size: 14 }),
|
|
5317
|
+
u.message
|
|
5292
5318
|
]
|
|
5293
5319
|
}
|
|
5294
5320
|
)
|
|
5295
5321
|
] }),
|
|
5296
|
-
a &&
|
|
5322
|
+
a && u.type === "success" && /* @__PURE__ */ n.jsxs(
|
|
5297
5323
|
"div",
|
|
5298
5324
|
{
|
|
5299
5325
|
style: {
|
|
@@ -5329,8 +5355,8 @@ const Ls = [
|
|
|
5329
5355
|
border: `2px solid ${s.success}40`,
|
|
5330
5356
|
margin: "0 auto"
|
|
5331
5357
|
},
|
|
5332
|
-
onError: (
|
|
5333
|
-
|
|
5358
|
+
onError: (d) => {
|
|
5359
|
+
d.currentTarget.style.display = "none";
|
|
5334
5360
|
}
|
|
5335
5361
|
}
|
|
5336
5362
|
)
|
|
@@ -5371,11 +5397,11 @@ const Ls = [
|
|
|
5371
5397
|
opacity: o ? 0.6 : 1,
|
|
5372
5398
|
transition: "all 0.2s ease"
|
|
5373
5399
|
},
|
|
5374
|
-
onMouseOver: (
|
|
5375
|
-
o || (
|
|
5400
|
+
onMouseOver: (d) => {
|
|
5401
|
+
o || (d.currentTarget.style.backgroundColor = s.border, d.currentTarget.style.transform = "translateY(-1px)");
|
|
5376
5402
|
},
|
|
5377
|
-
onMouseOut: (
|
|
5378
|
-
o || (
|
|
5403
|
+
onMouseOut: (d) => {
|
|
5404
|
+
o || (d.currentTarget.style.backgroundColor = "transparent", d.currentTarget.style.transform = "translateY(0)");
|
|
5379
5405
|
},
|
|
5380
5406
|
children: "Cancel"
|
|
5381
5407
|
}
|
|
@@ -5384,7 +5410,7 @@ const Ls = [
|
|
|
5384
5410
|
"button",
|
|
5385
5411
|
{
|
|
5386
5412
|
onClick: y,
|
|
5387
|
-
disabled: o || !
|
|
5413
|
+
disabled: o || !u.isValid,
|
|
5388
5414
|
style: {
|
|
5389
5415
|
padding: "10px 24px",
|
|
5390
5416
|
borderRadius: "10px",
|
|
@@ -5393,22 +5419,22 @@ const Ls = [
|
|
|
5393
5419
|
color: "#fff",
|
|
5394
5420
|
fontSize: "14px",
|
|
5395
5421
|
fontWeight: 600,
|
|
5396
|
-
cursor: o || !
|
|
5422
|
+
cursor: o || !u.isValid ? "not-allowed" : "pointer",
|
|
5397
5423
|
flex: h ? "none" : 1,
|
|
5398
5424
|
minWidth: h ? "100%" : "140px",
|
|
5399
|
-
opacity: o || !
|
|
5425
|
+
opacity: o || !u.isValid ? 0.6 : 1,
|
|
5400
5426
|
display: "flex",
|
|
5401
5427
|
alignItems: "center",
|
|
5402
5428
|
justifyContent: "center",
|
|
5403
5429
|
gap: "8px",
|
|
5404
5430
|
transition: "all 0.2s ease",
|
|
5405
|
-
boxShadow: o || !
|
|
5431
|
+
boxShadow: o || !u.isValid ? "none" : `0 4px 12px ${s.accent}40`
|
|
5406
5432
|
},
|
|
5407
|
-
onMouseOver: (
|
|
5408
|
-
!o &&
|
|
5433
|
+
onMouseOver: (d) => {
|
|
5434
|
+
!o && u.isValid && (d.currentTarget.style.transform = "translateY(-1px)", d.currentTarget.style.boxShadow = `0 6px 20px ${s.accent}60`);
|
|
5409
5435
|
},
|
|
5410
|
-
onMouseOut: (
|
|
5411
|
-
!o &&
|
|
5436
|
+
onMouseOut: (d) => {
|
|
5437
|
+
!o && u.isValid && (d.currentTarget.style.transform = "translateY(0)", d.currentTarget.style.boxShadow = `0 4px 12px ${s.accent}40`);
|
|
5412
5438
|
},
|
|
5413
5439
|
children: o ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
5414
5440
|
/* @__PURE__ */ n.jsx(
|
|
@@ -5485,7 +5511,7 @@ const Ls = [
|
|
|
5485
5511
|
]
|
|
5486
5512
|
}
|
|
5487
5513
|
);
|
|
5488
|
-
},
|
|
5514
|
+
}, Ws = ({
|
|
5489
5515
|
isOpen: t,
|
|
5490
5516
|
onClose: e,
|
|
5491
5517
|
onSuccess: r,
|
|
@@ -5493,11 +5519,11 @@ const Ls = [
|
|
|
5493
5519
|
userId: a,
|
|
5494
5520
|
colors: i
|
|
5495
5521
|
}) => {
|
|
5496
|
-
const { baseUrl: o, apiKey: l, appId: h } =
|
|
5522
|
+
const { baseUrl: o, apiKey: l, appId: h } = ge(), [c, u] = O({
|
|
5497
5523
|
currentPassword: "",
|
|
5498
5524
|
newPassword: "",
|
|
5499
5525
|
confirmPassword: ""
|
|
5500
|
-
}), [b, y] = O({}), [w,
|
|
5526
|
+
}), [b, y] = O({}), [w, d] = O(!1), [j, m] = O({
|
|
5501
5527
|
currentPassword: !1,
|
|
5502
5528
|
newPassword: !1,
|
|
5503
5529
|
confirmPassword: !1
|
|
@@ -5510,8 +5536,8 @@ const Ls = [
|
|
|
5510
5536
|
return v(), window.addEventListener("resize", v), () => window.removeEventListener("resize", v);
|
|
5511
5537
|
}, []), !t) return null;
|
|
5512
5538
|
const A = (v) => {
|
|
5513
|
-
const { name: U, value:
|
|
5514
|
-
|
|
5539
|
+
const { name: U, value: W } = v.target;
|
|
5540
|
+
u((F) => ({ ...F, [U]: W })), b[U] && y((F) => ({ ...F, [U]: "" }));
|
|
5515
5541
|
}, C = (v) => {
|
|
5516
5542
|
m((U) => ({ ...U, [v]: !U[v] }));
|
|
5517
5543
|
}, M = () => {
|
|
@@ -5519,9 +5545,9 @@ const Ls = [
|
|
|
5519
5545
|
return c.currentPassword || (v.currentPassword = "Current password is required"), c.newPassword ? c.newPassword.length < 6 && (v.newPassword = "Password must be at least 6 characters") : v.newPassword = "New password is required", c.newPassword !== c.confirmPassword && (v.confirmPassword = "Passwords do not match"), y(v), Object.keys(v).length === 0;
|
|
5520
5546
|
}, g = async (v) => {
|
|
5521
5547
|
if (v.preventDefault(), !!M()) {
|
|
5522
|
-
|
|
5548
|
+
d(!0);
|
|
5523
5549
|
try {
|
|
5524
|
-
const { data: U } = await
|
|
5550
|
+
const { data: U } = await q.put(
|
|
5525
5551
|
`${o}/users/change-password/${a}`,
|
|
5526
5552
|
{
|
|
5527
5553
|
appId: h,
|
|
@@ -5534,7 +5560,7 @@ const Ls = [
|
|
|
5534
5560
|
}
|
|
5535
5561
|
}
|
|
5536
5562
|
);
|
|
5537
|
-
U.success ? (r(U.message || "Password updated successfully"),
|
|
5563
|
+
U.success ? (r(U.message || "Password updated successfully"), u({
|
|
5538
5564
|
currentPassword: "",
|
|
5539
5565
|
newPassword: "",
|
|
5540
5566
|
confirmPassword: ""
|
|
@@ -5542,7 +5568,7 @@ const Ls = [
|
|
|
5542
5568
|
} catch (U) {
|
|
5543
5569
|
s(U.response?.data?.message || "Something went wrong");
|
|
5544
5570
|
} finally {
|
|
5545
|
-
|
|
5571
|
+
d(!1);
|
|
5546
5572
|
}
|
|
5547
5573
|
}
|
|
5548
5574
|
}, I = [
|
|
@@ -5678,7 +5704,7 @@ const Ls = [
|
|
|
5678
5704
|
}
|
|
5679
5705
|
),
|
|
5680
5706
|
/* @__PURE__ */ n.jsxs("form", { onSubmit: g, children: [
|
|
5681
|
-
I.map(({ field: v, label: U, icon:
|
|
5707
|
+
I.map(({ field: v, label: U, icon: W }) => /* @__PURE__ */ n.jsxs(
|
|
5682
5708
|
"div",
|
|
5683
5709
|
{
|
|
5684
5710
|
style: {
|
|
@@ -5713,7 +5739,7 @@ const Ls = [
|
|
|
5713
5739
|
color: i.textTertiary,
|
|
5714
5740
|
zIndex: 2
|
|
5715
5741
|
},
|
|
5716
|
-
children:
|
|
5742
|
+
children: W
|
|
5717
5743
|
}
|
|
5718
5744
|
),
|
|
5719
5745
|
/* @__PURE__ */ n.jsx(
|
|
@@ -5941,7 +5967,7 @@ const Ls = [
|
|
|
5941
5967
|
verifying: l,
|
|
5942
5968
|
user: h,
|
|
5943
5969
|
colors: c,
|
|
5944
|
-
darkMode:
|
|
5970
|
+
darkMode: u
|
|
5945
5971
|
}) => {
|
|
5946
5972
|
if (!t) return null;
|
|
5947
5973
|
const b = () => {
|
|
@@ -5952,7 +5978,7 @@ const Ls = [
|
|
|
5952
5978
|
{
|
|
5953
5979
|
className: "modal-overlay",
|
|
5954
5980
|
style: {
|
|
5955
|
-
backgroundColor:
|
|
5981
|
+
backgroundColor: u ? "rgba(0, 0, 0, 0.8)" : "rgba(0, 0, 0, 0.5)"
|
|
5956
5982
|
},
|
|
5957
5983
|
children: [
|
|
5958
5984
|
/* @__PURE__ */ n.jsxs(
|
|
@@ -6111,7 +6137,7 @@ const Ls = [
|
|
|
6111
6137
|
}
|
|
6112
6138
|
|
|
6113
6139
|
.close-btn:hover {
|
|
6114
|
-
background-color: ${
|
|
6140
|
+
background-color: ${u ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)"};
|
|
6115
6141
|
}
|
|
6116
6142
|
|
|
6117
6143
|
.verify-form {
|
|
@@ -6222,7 +6248,7 @@ const Ls = [
|
|
|
6222
6248
|
onVerify: i,
|
|
6223
6249
|
primaryColor: o = "#00C212"
|
|
6224
6250
|
}) => {
|
|
6225
|
-
const { baseUrl: l, apiKey: h, appId: c } =
|
|
6251
|
+
const { baseUrl: l, apiKey: h, appId: c } = ge(), [u, b] = O(null), [y, w] = O(e), [d, j] = O(!0), [m, _] = O(!1), [R, A] = O(!1), [C, M] = O(!1), [g, I] = O(!1), [v, U] = O(!1), [W, F] = O(!1), [V, Z] = O(!1), [T, J] = O(!1), [z, P] = O(null), [K, Q] = O(!1), [G, f] = O({
|
|
6226
6252
|
email: "",
|
|
6227
6253
|
otp: "",
|
|
6228
6254
|
appId: c
|
|
@@ -6244,23 +6270,23 @@ const Ls = [
|
|
|
6244
6270
|
};
|
|
6245
6271
|
te(() => {
|
|
6246
6272
|
const E = (H) => {
|
|
6247
|
-
const
|
|
6248
|
-
|
|
6273
|
+
const X = document.querySelector(".dropdown-container");
|
|
6274
|
+
X && !X.contains(H.target) && Y();
|
|
6249
6275
|
};
|
|
6250
6276
|
return V && document.addEventListener("mousedown", E), () => {
|
|
6251
6277
|
document.removeEventListener("mousedown", E);
|
|
6252
6278
|
};
|
|
6253
6279
|
}, [V]);
|
|
6254
6280
|
const se = async () => {
|
|
6255
|
-
if (!
|
|
6281
|
+
if (!G.email || !/\S+@\S+\.\S+/.test(G.email)) {
|
|
6256
6282
|
N("error", "Please enter a valid email");
|
|
6257
6283
|
return;
|
|
6258
6284
|
}
|
|
6259
6285
|
try {
|
|
6260
6286
|
$(!0);
|
|
6261
|
-
const E = await
|
|
6287
|
+
const E = await q.post(
|
|
6262
6288
|
`${l}/users/send-verify-otp/${y?.id}`,
|
|
6263
|
-
{ email:
|
|
6289
|
+
{ email: G.email },
|
|
6264
6290
|
{
|
|
6265
6291
|
headers: { "x-api-key": h, "x-app-id": c }
|
|
6266
6292
|
}
|
|
@@ -6271,24 +6297,24 @@ const Ls = [
|
|
|
6271
6297
|
} finally {
|
|
6272
6298
|
$(!1);
|
|
6273
6299
|
}
|
|
6274
|
-
},
|
|
6275
|
-
if (E.preventDefault(), !
|
|
6300
|
+
}, ue = async (E) => {
|
|
6301
|
+
if (E.preventDefault(), !G.email || !G.otp) {
|
|
6276
6302
|
N("error", "Please fill in all fields");
|
|
6277
6303
|
return;
|
|
6278
6304
|
}
|
|
6279
6305
|
try {
|
|
6280
6306
|
$(!0);
|
|
6281
|
-
const H = await
|
|
6307
|
+
const H = await q.post(
|
|
6282
6308
|
`${l}/users/verify-email`,
|
|
6283
|
-
|
|
6309
|
+
G
|
|
6284
6310
|
);
|
|
6285
6311
|
if (H.data.success) {
|
|
6286
6312
|
if (N("success", H.data.message || "Email verified!"), y) {
|
|
6287
|
-
const
|
|
6288
|
-
w(
|
|
6313
|
+
const X = { ...y, isVerified: !0 };
|
|
6314
|
+
w(X), localStorage.setItem(
|
|
6289
6315
|
"userInfo",
|
|
6290
|
-
JSON.stringify({ ...
|
|
6291
|
-
), typeof i == "function" && i(
|
|
6316
|
+
JSON.stringify({ ...X, token: t })
|
|
6317
|
+
), typeof i == "function" && i(X);
|
|
6292
6318
|
}
|
|
6293
6319
|
f({ email: "", otp: "", appId: c }), x(!1), F(!1);
|
|
6294
6320
|
} else
|
|
@@ -6304,15 +6330,15 @@ const Ls = [
|
|
|
6304
6330
|
}, ve = async (E) => {
|
|
6305
6331
|
if (!y) return !1;
|
|
6306
6332
|
try {
|
|
6307
|
-
const H = { ...y, avatarUrl: E }, { data:
|
|
6333
|
+
const H = { ...y, avatarUrl: E }, { data: X } = await q.put(
|
|
6308
6334
|
`${l}/users/update/${y.id}`,
|
|
6309
6335
|
H,
|
|
6310
6336
|
{ headers: { "x-api-key": h } }
|
|
6311
6337
|
);
|
|
6312
|
-
return
|
|
6338
|
+
return X.success ? (w(H), localStorage.setItem(
|
|
6313
6339
|
"userInfo",
|
|
6314
6340
|
JSON.stringify({ ...H, token: t })
|
|
6315
|
-
), N("success", "Avatar updated successfully!"), !0) : (N("error",
|
|
6341
|
+
), N("success", "Avatar updated successfully!"), !0) : (N("error", X.message || "Failed to update avatar"), !1);
|
|
6316
6342
|
} catch (H) {
|
|
6317
6343
|
return console.error("Avatar update error:", H), N("error", "Failed to update avatar"), !1;
|
|
6318
6344
|
}
|
|
@@ -6320,7 +6346,7 @@ const Ls = [
|
|
|
6320
6346
|
if (y) {
|
|
6321
6347
|
A(!0);
|
|
6322
6348
|
try {
|
|
6323
|
-
const { data: E } = await
|
|
6349
|
+
const { data: E } = await q.put(
|
|
6324
6350
|
`${l}/users/update/${y.id}`,
|
|
6325
6351
|
y,
|
|
6326
6352
|
{ headers: { "x-api-key": h } }
|
|
@@ -6337,7 +6363,7 @@ const Ls = [
|
|
|
6337
6363
|
}
|
|
6338
6364
|
}, pt = async (E) => {
|
|
6339
6365
|
try {
|
|
6340
|
-
const { data: H } = await
|
|
6366
|
+
const { data: H } = await q.get(
|
|
6341
6367
|
`${l}/users/check-user/${E}?appId=${c}`,
|
|
6342
6368
|
{ headers: { "x-api-key": h } }
|
|
6343
6369
|
);
|
|
@@ -6353,8 +6379,8 @@ const Ls = [
|
|
|
6353
6379
|
else {
|
|
6354
6380
|
const H = localStorage.getItem("userInfo");
|
|
6355
6381
|
if (H) {
|
|
6356
|
-
const
|
|
6357
|
-
w(
|
|
6382
|
+
const X = JSON.parse(H);
|
|
6383
|
+
w(X), j(!1), pt(X.id);
|
|
6358
6384
|
} else
|
|
6359
6385
|
j(!1);
|
|
6360
6386
|
}
|
|
@@ -6363,8 +6389,8 @@ const Ls = [
|
|
|
6363
6389
|
y?.email && f((E) => ({ ...E, email: y.email }));
|
|
6364
6390
|
}, [y?.email]);
|
|
6365
6391
|
const ft = (E, H) => {
|
|
6366
|
-
let
|
|
6367
|
-
return
|
|
6392
|
+
let X = parseInt(E.replace("#", ""), 16), pe = (X >> 16) + H, He = (X >> 8 & 255) + H, Ve = (X & 255) + H;
|
|
6393
|
+
return pe = Math.min(255, Math.max(0, pe)), He = Math.min(255, Math.max(0, He)), Ve = Math.min(255, Math.max(0, Ve)), `#${(Ve | He << 8 | pe << 16).toString(16).padStart(6, "0")}`;
|
|
6368
6394
|
}, D = r ? {
|
|
6369
6395
|
background: "#000000",
|
|
6370
6396
|
surface: "#09090b",
|
|
@@ -6394,7 +6420,7 @@ const Ls = [
|
|
|
6394
6420
|
border: "#e4e4e7",
|
|
6395
6421
|
warning: "#d97706"
|
|
6396
6422
|
};
|
|
6397
|
-
if (
|
|
6423
|
+
if (d)
|
|
6398
6424
|
return /* @__PURE__ */ n.jsx(
|
|
6399
6425
|
"div",
|
|
6400
6426
|
{
|
|
@@ -6562,14 +6588,14 @@ const Ls = [
|
|
|
6562
6588
|
display: "grid",
|
|
6563
6589
|
gap: "24px",
|
|
6564
6590
|
gridTemplateColumns: "1fr",
|
|
6565
|
-
...
|
|
6591
|
+
...u && window.innerWidth >= 1024 && {
|
|
6566
6592
|
gridTemplateColumns: "1fr 2fr",
|
|
6567
6593
|
gap: "10px"
|
|
6568
6594
|
},
|
|
6569
|
-
...
|
|
6595
|
+
...u && window.innerWidth >= 768 && u && window.innerWidth < 1024 && {
|
|
6570
6596
|
gap: "10px"
|
|
6571
6597
|
},
|
|
6572
|
-
...
|
|
6598
|
+
...u && window.innerWidth >= 600 && u && window.innerWidth < 768 && {
|
|
6573
6599
|
gap: "28px"
|
|
6574
6600
|
}
|
|
6575
6601
|
},
|
|
@@ -6754,7 +6780,7 @@ const Ls = [
|
|
|
6754
6780
|
gap: "8px",
|
|
6755
6781
|
textDecoration: "none",
|
|
6756
6782
|
minHeight: "36px",
|
|
6757
|
-
flex:
|
|
6783
|
+
flex: u && window.innerWidth < 1024 ? "1" : "auto"
|
|
6758
6784
|
},
|
|
6759
6785
|
children: [
|
|
6760
6786
|
/* @__PURE__ */ n.jsx(Pe, { size: 16, "aria-hidden": "true" }),
|
|
@@ -6784,7 +6810,7 @@ const Ls = [
|
|
|
6784
6810
|
gap: "8px",
|
|
6785
6811
|
textDecoration: "none",
|
|
6786
6812
|
minHeight: "36px",
|
|
6787
|
-
flex:
|
|
6813
|
+
flex: u && window.innerWidth < 1024 ? "1" : "auto"
|
|
6788
6814
|
},
|
|
6789
6815
|
children: [
|
|
6790
6816
|
R ? /* @__PURE__ */ n.jsx(
|
|
@@ -6820,7 +6846,7 @@ const Ls = [
|
|
|
6820
6846
|
gap: "8px",
|
|
6821
6847
|
textDecoration: "none",
|
|
6822
6848
|
minHeight: "36px",
|
|
6823
|
-
flex:
|
|
6849
|
+
flex: u && window.innerWidth < 1024 ? "1" : "auto"
|
|
6824
6850
|
},
|
|
6825
6851
|
children: [
|
|
6826
6852
|
/* @__PURE__ */ n.jsx(Es, { size: 16, "aria-hidden": "true" }),
|
|
@@ -6850,7 +6876,7 @@ const Ls = [
|
|
|
6850
6876
|
gap: "8px",
|
|
6851
6877
|
minHeight: "36px",
|
|
6852
6878
|
opacity: K ? 0.7 : 1,
|
|
6853
|
-
flex:
|
|
6879
|
+
flex: u && window.innerWidth < 1024 ? "1" : "auto"
|
|
6854
6880
|
},
|
|
6855
6881
|
children: [
|
|
6856
6882
|
K ? /* @__PURE__ */ n.jsx(
|
|
@@ -7060,7 +7086,7 @@ const Ls = [
|
|
|
7060
7086
|
display: "grid",
|
|
7061
7087
|
gap: "20px",
|
|
7062
7088
|
gridTemplateColumns: "1fr",
|
|
7063
|
-
...
|
|
7089
|
+
...u && window.innerWidth >= 600 && {
|
|
7064
7090
|
gridTemplateColumns: "1fr 1fr",
|
|
7065
7091
|
gap: "20px"
|
|
7066
7092
|
}
|
|
@@ -7099,8 +7125,8 @@ const Ls = [
|
|
|
7099
7125
|
type: E.type,
|
|
7100
7126
|
name: E.name,
|
|
7101
7127
|
value: y[E.name],
|
|
7102
|
-
onChange: (
|
|
7103
|
-
(
|
|
7128
|
+
onChange: (X) => w(
|
|
7129
|
+
(pe) => pe && { ...pe, [X.target.name]: X.target.value }
|
|
7104
7130
|
),
|
|
7105
7131
|
style: {
|
|
7106
7132
|
padding: "12px",
|
|
@@ -7277,7 +7303,7 @@ const Ls = [
|
|
|
7277
7303
|
}
|
|
7278
7304
|
),
|
|
7279
7305
|
/* @__PURE__ */ n.jsx(
|
|
7280
|
-
|
|
7306
|
+
qs,
|
|
7281
7307
|
{
|
|
7282
7308
|
isOpen: C,
|
|
7283
7309
|
onClose: () => {
|
|
@@ -7288,7 +7314,7 @@ const Ls = [
|
|
|
7288
7314
|
}
|
|
7289
7315
|
),
|
|
7290
7316
|
/* @__PURE__ */ n.jsx(
|
|
7291
|
-
|
|
7317
|
+
Ws,
|
|
7292
7318
|
{
|
|
7293
7319
|
baseUrl: l,
|
|
7294
7320
|
apiKey: h,
|
|
@@ -7319,13 +7345,13 @@ const Ls = [
|
|
|
7319
7345
|
/* @__PURE__ */ n.jsx(
|
|
7320
7346
|
Bs,
|
|
7321
7347
|
{
|
|
7322
|
-
isOpen:
|
|
7348
|
+
isOpen: W,
|
|
7323
7349
|
onClose: () => {
|
|
7324
7350
|
F(!1), x(!1), f({ email: y?.email || "", otp: "", appId: c });
|
|
7325
7351
|
},
|
|
7326
|
-
onVerify:
|
|
7352
|
+
onVerify: ue,
|
|
7327
7353
|
onSendOTP: se,
|
|
7328
|
-
verifyFormData:
|
|
7354
|
+
verifyFormData: G,
|
|
7329
7355
|
setVerifyFormData: f,
|
|
7330
7356
|
otpSent: S,
|
|
7331
7357
|
verifying: k,
|
|
@@ -7439,14 +7465,14 @@ const Ls = [
|
|
|
7439
7465
|
// Menu item visibility with defaults
|
|
7440
7466
|
showProfileMenuItem: h = !0,
|
|
7441
7467
|
showSettingsMenuItem: c = !0,
|
|
7442
|
-
showViewProfileMenuItem:
|
|
7468
|
+
showViewProfileMenuItem: u = !0,
|
|
7443
7469
|
// Custom labels with defaults
|
|
7444
7470
|
profileLabel: b = "My Profile",
|
|
7445
7471
|
settingsLabel: y = "Settings",
|
|
7446
7472
|
viewProfileLabel: w = "View Profile",
|
|
7447
|
-
logoutLabel:
|
|
7473
|
+
logoutLabel: d = "Sign Out"
|
|
7448
7474
|
}) => {
|
|
7449
|
-
const { baseUrl: j, apiKey: m, appId: _ } =
|
|
7475
|
+
const { baseUrl: j, apiKey: m, appId: _ } = ge(), [R, A] = O(!1), [C, M] = O(null), [g, I] = O(!0), [v, U] = O(null), W = xt(null), F = xt(null), [V, Z] = O(!1), [T, J] = O(!1);
|
|
7450
7476
|
te(() => {
|
|
7451
7477
|
if (typeof window > "u") return;
|
|
7452
7478
|
const x = () => {
|
|
@@ -7482,9 +7508,9 @@ const Ls = [
|
|
|
7482
7508
|
if (typeof window > "u") return;
|
|
7483
7509
|
const x = () => {
|
|
7484
7510
|
if (!R || !F.current) return;
|
|
7485
|
-
const k = F.current.getBoundingClientRect(), $ = window.innerWidth, N = window.innerHeight, Y = 280, se = $ - k.right,
|
|
7511
|
+
const k = F.current.getBoundingClientRect(), $ = window.innerWidth, N = window.innerHeight, Y = 280, se = $ - k.right, ue = k.left;
|
|
7486
7512
|
N - k.bottom;
|
|
7487
|
-
const ve = se >= Y || se >
|
|
7513
|
+
const ve = se >= Y || se > ue;
|
|
7488
7514
|
Z(ve);
|
|
7489
7515
|
};
|
|
7490
7516
|
return x(), window.addEventListener("resize", x), () => window.removeEventListener("resize", x);
|
|
@@ -7492,7 +7518,7 @@ const Ls = [
|
|
|
7492
7518
|
if (typeof window > "u" || typeof document > "u")
|
|
7493
7519
|
return;
|
|
7494
7520
|
const x = (N) => {
|
|
7495
|
-
|
|
7521
|
+
W.current && !W.current.contains(N.target) && !F.current?.contains(N.target) && A(!1);
|
|
7496
7522
|
}, k = (N) => {
|
|
7497
7523
|
N.key === "Escape" && A(!1);
|
|
7498
7524
|
}, $ = () => {
|
|
@@ -7733,8 +7759,8 @@ const Ls = [
|
|
|
7733
7759
|
}
|
|
7734
7760
|
}, Q = (x, k) => {
|
|
7735
7761
|
(x.key === "Enter" || x.key === " ") && (x.preventDefault(), k());
|
|
7736
|
-
},
|
|
7737
|
-
const x =
|
|
7762
|
+
}, G = () => o || C?.profileUrl, f = () => {
|
|
7763
|
+
const x = G();
|
|
7738
7764
|
x && window.open(x, "_self", "noopener,noreferrer");
|
|
7739
7765
|
}, S = () => {
|
|
7740
7766
|
l && window.open(l, "_self", "noopener,noreferrer");
|
|
@@ -7743,7 +7769,7 @@ const Ls = [
|
|
|
7743
7769
|
"div",
|
|
7744
7770
|
{
|
|
7745
7771
|
style: P.wrapper,
|
|
7746
|
-
ref:
|
|
7772
|
+
ref: W,
|
|
7747
7773
|
className: i,
|
|
7748
7774
|
role: "menu",
|
|
7749
7775
|
"aria-label": "User menu",
|
|
@@ -7886,7 +7912,7 @@ const Ls = [
|
|
|
7886
7912
|
] })
|
|
7887
7913
|
] }),
|
|
7888
7914
|
/* @__PURE__ */ n.jsxs("div", { style: P.dropdownSection, children: [
|
|
7889
|
-
h &&
|
|
7915
|
+
h && G() && /* @__PURE__ */ n.jsxs(
|
|
7890
7916
|
"button",
|
|
7891
7917
|
{
|
|
7892
7918
|
style: P.menuItem,
|
|
@@ -7926,7 +7952,7 @@ const Ls = [
|
|
|
7926
7952
|
]
|
|
7927
7953
|
}
|
|
7928
7954
|
),
|
|
7929
|
-
|
|
7955
|
+
u && C.profileUrl && /* @__PURE__ */ n.jsxs(
|
|
7930
7956
|
"a",
|
|
7931
7957
|
{
|
|
7932
7958
|
href: C.profileUrl,
|
|
@@ -7970,7 +7996,7 @@ const Ls = [
|
|
|
7970
7996
|
"aria-hidden": "true"
|
|
7971
7997
|
}
|
|
7972
7998
|
),
|
|
7973
|
-
/* @__PURE__ */ n.jsx("span", { style: P.menuItemText, children:
|
|
7999
|
+
/* @__PURE__ */ n.jsx("span", { style: P.menuItemText, children: d })
|
|
7974
8000
|
]
|
|
7975
8001
|
}
|
|
7976
8002
|
) })
|
|
@@ -8009,13 +8035,13 @@ const Ls = [
|
|
|
8009
8035
|
primaryColor: r = "#00C212",
|
|
8010
8036
|
onVerify: s
|
|
8011
8037
|
}) => {
|
|
8012
|
-
const { appId: a, baseUrl: i, apiKey: o } =
|
|
8038
|
+
const { appId: a, baseUrl: i, apiKey: o } = ge(), [l, h] = O({
|
|
8013
8039
|
email: t?.email || "",
|
|
8014
8040
|
otp: "",
|
|
8015
8041
|
appId: a
|
|
8016
|
-
}), [c,
|
|
8017
|
-
let v = parseInt(g.replace("#", ""), 16), U = (v >> 16) + I,
|
|
8018
|
-
return U = Math.min(255, Math.max(0, U)),
|
|
8042
|
+
}), [c, u] = O(!1), [b, y] = O(!1), [w, d] = O(null), j = (g, I) => {
|
|
8043
|
+
let v = parseInt(g.replace("#", ""), 16), U = (v >> 16) + I, W = (v >> 8 & 255) + I, F = (v & 255) + I;
|
|
8044
|
+
return U = Math.min(255, Math.max(0, U)), W = Math.min(255, Math.max(0, W)), F = Math.min(255, Math.max(0, F)), `#${(F | W << 8 | U << 16).toString(16).padStart(6, "0")}`;
|
|
8019
8045
|
}, m = e ? {
|
|
8020
8046
|
surface: "#09090b",
|
|
8021
8047
|
surfaceLight: "#27272a",
|
|
@@ -8043,7 +8069,7 @@ const Ls = [
|
|
|
8043
8069
|
t?.email && h((g) => ({ ...g, email: t.email }));
|
|
8044
8070
|
}, [t?.email]);
|
|
8045
8071
|
const _ = (g, I) => {
|
|
8046
|
-
|
|
8072
|
+
d({ type: g, message: I }), setTimeout(() => d(null), 3e3);
|
|
8047
8073
|
}, R = async () => {
|
|
8048
8074
|
if (!l.email || !/\S+@\S+\.\S+/.test(l.email)) {
|
|
8049
8075
|
_("error", "Please enter a valid email");
|
|
@@ -8051,12 +8077,12 @@ const Ls = [
|
|
|
8051
8077
|
}
|
|
8052
8078
|
try {
|
|
8053
8079
|
y(!0);
|
|
8054
|
-
const g = await
|
|
8080
|
+
const g = await q.post(
|
|
8055
8081
|
`${i}/users/send-verify-otp/${t?.id}`,
|
|
8056
8082
|
{ email: l.email },
|
|
8057
8083
|
{ headers: { "x-api-key": o, "x-app-id": a } }
|
|
8058
8084
|
);
|
|
8059
|
-
g.data.success ? (_("success", g.data.message || "OTP sent!"),
|
|
8085
|
+
g.data.success ? (_("success", g.data.message || "OTP sent!"), u(!0)) : _("error", g.data.message || "Failed to send OTP");
|
|
8060
8086
|
} catch (g) {
|
|
8061
8087
|
_("error", g.response?.data?.message || "Server error");
|
|
8062
8088
|
} finally {
|
|
@@ -8069,10 +8095,10 @@ const Ls = [
|
|
|
8069
8095
|
}
|
|
8070
8096
|
try {
|
|
8071
8097
|
y(!0);
|
|
8072
|
-
const I = await
|
|
8098
|
+
const I = await q.post(`${i}/users/verify-email`, l);
|
|
8073
8099
|
if (I.data.success && t) {
|
|
8074
8100
|
const v = { ...t, isVerified: !0 };
|
|
8075
|
-
s?.(v), _("success", I.data.message || "Email verified!"),
|
|
8101
|
+
s?.(v), _("success", I.data.message || "Email verified!"), u(!1), h({ email: t.email, otp: "", appId: a });
|
|
8076
8102
|
} else
|
|
8077
8103
|
_("error", I.data.message || "Verification failed");
|
|
8078
8104
|
} catch (I) {
|
|
@@ -8231,6 +8257,6 @@ export {
|
|
|
8231
8257
|
fa as ReactUserLogin,
|
|
8232
8258
|
ga as ReactUserProfile,
|
|
8233
8259
|
pa as ReactUserSignUp,
|
|
8234
|
-
|
|
8260
|
+
ge as getSdkConfig,
|
|
8235
8261
|
ua as setSdkConfig
|
|
8236
8262
|
};
|