@neuctra/authix 1.1.25 → 1.1.27
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.
|
@@ -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(d) {
|
|
287
|
+
return d !== 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;
|
|
@@ -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 || d, 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(u) {
|
|
324
|
+
if (u === null) return "";
|
|
325
|
+
if (p.isDate(u))
|
|
326
|
+
return u.toISOString();
|
|
327
|
+
if (p.isBoolean(u))
|
|
328
|
+
return u.toString();
|
|
329
|
+
if (!h && p.isBlob(u))
|
|
330
330
|
throw new L("Blob is not supported. Use a Buffer instead.");
|
|
331
|
-
return p.isArrayBuffer(
|
|
331
|
+
return p.isArrayBuffer(u) || p.isTypedArray(u) ? h && typeof Blob == "function" ? new Blob([u]) : Buffer.from(u) : u;
|
|
332
332
|
}
|
|
333
|
-
function u
|
|
334
|
-
let _ =
|
|
335
|
-
if (
|
|
333
|
+
function d(u, j, m) {
|
|
334
|
+
let _ = u;
|
|
335
|
+
if (u && !m && typeof u == "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), u = JSON.stringify(u);
|
|
338
|
+
else if (p.isArray(u) && Qr(u) || (p.isFileList(u) || p.endsWith(j, "[]")) && (_ = p.toArray(u)))
|
|
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(u) ? !0 : (e.append(gt(m, j, i), c(u)), !1);
|
|
348
348
|
}
|
|
349
349
|
const b = [], y = Object.assign(en, {
|
|
350
|
-
defaultVisitor:
|
|
350
|
+
defaultVisitor: d,
|
|
351
351
|
convertValue: c,
|
|
352
352
|
isVisitable: Qe
|
|
353
353
|
});
|
|
354
|
-
function w(
|
|
355
|
-
if (!p.isUndefined(
|
|
356
|
-
if (b.indexOf(
|
|
354
|
+
function w(u, j) {
|
|
355
|
+
if (!p.isUndefined(u)) {
|
|
356
|
+
if (b.indexOf(u) !== -1)
|
|
357
357
|
throw Error("Circular reference detected in " + j.join("."));
|
|
358
|
-
b.push(
|
|
358
|
+
b.push(u), p.forEach(u, function(_, R) {
|
|
359
359
|
(!(p.isUndefined(_) || _ === null) && a.call(
|
|
360
360
|
e,
|
|
361
361
|
_,
|
|
@@ -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 d = Se(h);
|
|
684
|
+
if (!d)
|
|
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, d);
|
|
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, d) => i(c, d, 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 d of e) {
|
|
697
|
+
if (!p.isArray(d))
|
|
698
698
|
throw TypeError("Object iterator must return a key-value pair");
|
|
699
|
-
l[c =
|
|
699
|
+
l[c = d[0]] = (h = l[c]) ? p.isArray(h) ? [...h, d[1]] : [h, d[1]] : d[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(), d = 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 = d && c - d;
|
|
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, d = Date.now()) => {
|
|
862
|
+
r = d, a = null, i && (clearTimeout(i), i = null), t(...c);
|
|
863
863
|
};
|
|
864
864
|
return [(...c) => {
|
|
865
|
-
const
|
|
866
|
-
b >= s ? o(c,
|
|
865
|
+
const d = Date.now(), b = d - r;
|
|
866
|
+
b >= s ? o(c, d) : (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), d = 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 && d ? (l - o) / c : void 0,
|
|
884
884
|
event: i,
|
|
885
885
|
lengthComputable: l != null,
|
|
886
886
|
[e ? "download" : "upload"]: !0
|
|
@@ -938,28 +938,28 @@ const vt = (t) => t instanceof ne ? { ...t } : t;
|
|
|
938
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, d, b, y) {
|
|
942
|
+
return p.isPlainObject(c) && p.isPlainObject(d) ? p.merge.call({ caseless: y }, c, d) : p.isPlainObject(d) ? p.merge({}, d) : p.isArray(d) ? d.slice() : d;
|
|
943
943
|
}
|
|
944
|
-
function a(c,
|
|
945
|
-
if (p.isUndefined(
|
|
944
|
+
function a(c, d, b, y) {
|
|
945
|
+
if (p.isUndefined(d)) {
|
|
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, d, b, y);
|
|
949
949
|
}
|
|
950
|
-
function i(c,
|
|
951
|
-
if (!p.isUndefined(
|
|
952
|
-
return s(void 0,
|
|
950
|
+
function i(c, d) {
|
|
951
|
+
if (!p.isUndefined(d))
|
|
952
|
+
return s(void 0, d);
|
|
953
953
|
}
|
|
954
|
-
function o(c,
|
|
955
|
-
if (p.isUndefined(
|
|
954
|
+
function o(c, d) {
|
|
955
|
+
if (p.isUndefined(d)) {
|
|
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, d);
|
|
959
959
|
}
|
|
960
|
-
function l(c,
|
|
960
|
+
function l(c, d, b) {
|
|
961
961
|
if (b in e)
|
|
962
|
-
return s(c,
|
|
962
|
+
return s(c, d);
|
|
963
963
|
if (b in t)
|
|
964
964
|
return s(void 0, c);
|
|
965
965
|
}
|
|
@@ -992,11 +992,11 @@ function he(t, e) {
|
|
|
992
992
|
socketPath: o,
|
|
993
993
|
responseEncoding: o,
|
|
994
994
|
validateStatus: l,
|
|
995
|
-
headers: (c,
|
|
995
|
+
headers: (c, d, b) => a(vt(c), vt(d), 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(d) {
|
|
998
|
+
const b = h[d] || a, y = b(t[d], e[d], d);
|
|
999
|
+
p.isUndefined(y) && b !== l || (r[d] = y);
|
|
1000
1000
|
}), r;
|
|
1001
1001
|
}
|
|
1002
1002
|
const tr = (t) => {
|
|
@@ -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(([d, b]) => {
|
|
1014
|
+
c.includes(d.toLowerCase()) && o.set(d, 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, d, b, y, w, u;
|
|
1029
1029
|
function j() {
|
|
1030
|
-
w && w(),
|
|
1030
|
+
w && w(), u && u(), a.cancelToken && a.cancelToken.unsubscribe(d), a.signal && a.signal.removeEventListener("abort", d);
|
|
1031
1031
|
}
|
|
1032
1032
|
let m = new XMLHttpRequest();
|
|
1033
1033
|
m.open(a.method.toUpperCase(), a.url, !0), m.timeout = a.timeout;
|
|
@@ -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, u] = 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) && (d = (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(d), a.signal && (a.signal.aborted ? d() : a.signal.addEventListener("abort", d)));
|
|
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 d = c instanceof Error ? c : this.reason;
|
|
1089
|
+
s.abort(d instanceof L ? d : new je(d instanceof Error ? d.message : d));
|
|
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: d } = await a.next();
|
|
1141
1141
|
if (c) {
|
|
1142
1142
|
l(), h.close();
|
|
1143
1143
|
return;
|
|
1144
1144
|
}
|
|
1145
|
-
let b =
|
|
1145
|
+
let b = d.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(d));
|
|
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__ */ ((u) => (j) => u.encode(j))(new Ct()) : async (u) => new Uint8Array(await new r(u).arrayBuffer())), c = i && l && Tt(() => {
|
|
1181
|
+
let u = !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 u = !0, "half";
|
|
1187
1187
|
}
|
|
1188
1188
|
}).headers.has("Content-Type");
|
|
1189
|
-
return
|
|
1190
|
-
}),
|
|
1191
|
-
stream:
|
|
1189
|
+
return u && !j;
|
|
1190
|
+
}), d = o && l && Tt(() => p.isReadableStream(new s("").body)), b = {
|
|
1191
|
+
stream: d && ((u) => u.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((u) => {
|
|
1194
|
+
!b[u] && (b[u] = (j, m) => {
|
|
1195
|
+
let _ = j && j[u];
|
|
1196
1196
|
if (_)
|
|
1197
1197
|
return _.call(j);
|
|
1198
|
-
throw new L(`Response type '${
|
|
1198
|
+
throw new L(`Response type '${u}' is not supported`, L.ERR_NOT_SUPPORT, m);
|
|
1199
1199
|
});
|
|
1200
1200
|
});
|
|
1201
|
-
const y = async (
|
|
1202
|
-
if (
|
|
1201
|
+
const y = async (u) => {
|
|
1202
|
+
if (u == null)
|
|
1203
1203
|
return 0;
|
|
1204
|
-
if (p.isBlob(
|
|
1205
|
-
return
|
|
1206
|
-
if (p.isSpecCompliantForm(
|
|
1204
|
+
if (p.isBlob(u))
|
|
1205
|
+
return u.size;
|
|
1206
|
+
if (p.isSpecCompliantForm(u))
|
|
1207
1207
|
return (await new r(ee.origin, {
|
|
1208
1208
|
method: "POST",
|
|
1209
|
-
body:
|
|
1209
|
+
body: u
|
|
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(u) || p.isArrayBuffer(u))
|
|
1212
|
+
return u.byteLength;
|
|
1213
|
+
if (p.isURLSearchParams(u) && (u = u + ""), p.isString(u))
|
|
1214
|
+
return (await h(u)).byteLength;
|
|
1215
|
+
}, w = async (u, j) => {
|
|
1216
|
+
const m = p.toFiniteNumber(u.getContentLength());
|
|
1217
1217
|
return m ?? y(j);
|
|
1218
1218
|
};
|
|
1219
|
-
return async (
|
|
1219
|
+
return async (u) => {
|
|
1220
1220
|
let {
|
|
1221
1221
|
url: j,
|
|
1222
1222
|
method: m,
|
|
@@ -1230,7 +1230,7 @@ const tr = (t) => {
|
|
|
1230
1230
|
headers: v,
|
|
1231
1231
|
withCredentials: U = "same-origin",
|
|
1232
1232
|
fetchOptions: q
|
|
1233
|
-
} = tr(
|
|
1233
|
+
} = tr(u), 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 && (() => {
|
|
@@ -1264,8 +1264,8 @@ const tr = (t) => {
|
|
|
1264
1264
|
};
|
|
1265
1265
|
Z = i && new r(j, P);
|
|
1266
1266
|
let K = await (i ? F(Z, q) : F(j, P));
|
|
1267
|
-
const Q =
|
|
1268
|
-
if (
|
|
1267
|
+
const Q = d && (I === "stream" || I === "response");
|
|
1268
|
+
if (d && (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 X = await b[p.findKey(b, I) || "text"](K,
|
|
1285
|
+
let X = await b[p.findKey(b, I) || "text"](K, u);
|
|
1286
1286
|
return !Q && T && T(), await new Promise((f, S) => {
|
|
1287
1287
|
Qt(f, S, {
|
|
1288
1288
|
data: X,
|
|
1289
1289
|
headers: ne.from(K.headers),
|
|
1290
1290
|
status: K.status,
|
|
1291
1291
|
statusText: K.statusText,
|
|
1292
|
-
config:
|
|
1292
|
+
config: u,
|
|
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, u, 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, u, 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, d = Nn;
|
|
1313
1313
|
for (; l--; )
|
|
1314
|
-
h = i[l], c =
|
|
1314
|
+
h = i[l], c = d.get(h), c === void 0 && d.set(h, c = l ? /* @__PURE__ */ new Map() : $n(e)), d = c;
|
|
1315
1315
|
return c;
|
|
1316
1316
|
};
|
|
1317
1317
|
rr();
|
|
@@ -1487,8 +1487,8 @@ let xe = class {
|
|
|
1487
1487
|
);
|
|
1488
1488
|
i && p.forEach(
|
|
1489
1489
|
["delete", "get", "head", "post", "put", "patch", "common"],
|
|
1490
|
-
(
|
|
1491
|
-
delete i[
|
|
1490
|
+
(u) => {
|
|
1491
|
+
delete i[u];
|
|
1492
1492
|
}
|
|
1493
1493
|
), r.headers = ne.concat(o, i);
|
|
1494
1494
|
const l = [];
|
|
@@ -1500,32 +1500,32 @@ let xe = class {
|
|
|
1500
1500
|
this.interceptors.response.forEach(function(j) {
|
|
1501
1501
|
c.push(j.fulfilled, j.rejected);
|
|
1502
1502
|
});
|
|
1503
|
-
let
|
|
1503
|
+
let d, b = 0, y;
|
|
1504
1504
|
if (!h) {
|
|
1505
|
-
const
|
|
1506
|
-
for (
|
|
1507
|
-
|
|
1508
|
-
return
|
|
1505
|
+
const u = [It.bind(this), void 0];
|
|
1506
|
+
for (u.unshift(...l), u.push(...c), y = u.length, d = Promise.resolve(r); b < y; )
|
|
1507
|
+
d = d.then(u[b++], u[b++]);
|
|
1508
|
+
return d;
|
|
1509
1509
|
}
|
|
1510
1510
|
y = l.length;
|
|
1511
1511
|
let w = r;
|
|
1512
1512
|
for (; b < y; ) {
|
|
1513
|
-
const
|
|
1513
|
+
const u = l[b++], j = l[b++];
|
|
1514
1514
|
try {
|
|
1515
|
-
w =
|
|
1515
|
+
w = u(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
|
+
d = It.call(this, w);
|
|
1523
|
+
} catch (u) {
|
|
1524
|
+
return Promise.reject(u);
|
|
1525
1525
|
}
|
|
1526
1526
|
for (b = 0, y = c.length; b < y; )
|
|
1527
|
-
|
|
1528
|
-
return
|
|
1527
|
+
d = d.then(c[b++], c[b++]);
|
|
1528
|
+
return d;
|
|
1529
1529
|
}
|
|
1530
1530
|
getUri(e) {
|
|
1531
1531
|
e = he(this.defaults, e);
|
|
@@ -2170,7 +2170,7 @@ function qn() {
|
|
|
2170
2170
|
function c(f, S, x, k, $, N) {
|
|
2171
2171
|
var Y = x.ref;
|
|
2172
2172
|
return f = {
|
|
2173
|
-
$$typeof:
|
|
2173
|
+
$$typeof: u,
|
|
2174
2174
|
type: f,
|
|
2175
2175
|
key: S,
|
|
2176
2176
|
props: x,
|
|
@@ -2200,7 +2200,7 @@ function qn() {
|
|
|
2200
2200
|
value: N
|
|
2201
2201
|
}), Object.freeze && (Object.freeze(f.props), Object.freeze(f)), f;
|
|
2202
2202
|
}
|
|
2203
|
-
function
|
|
2203
|
+
function d(f, S, x, k, $, N) {
|
|
2204
2204
|
var Y = S.children;
|
|
2205
2205
|
if (Y !== void 0)
|
|
2206
2206
|
if (k)
|
|
@@ -2252,9 +2252,9 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2252
2252
|
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
2253
|
}
|
|
2254
2254
|
function y(f) {
|
|
2255
|
-
return typeof f == "object" && f !== null && f.$$typeof ===
|
|
2255
|
+
return typeof f == "object" && f !== null && f.$$typeof === u;
|
|
2256
2256
|
}
|
|
2257
|
-
var w = Le,
|
|
2257
|
+
var w = Le, u = 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"), q = 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
2258
|
return null;
|
|
2259
2259
|
};
|
|
2260
2260
|
w = {
|
|
@@ -2268,7 +2268,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2268
2268
|
)(), Q = J(s(i)), X = {};
|
|
2269
2269
|
Ee.Fragment = m, Ee.jsx = function(f, S, x) {
|
|
2270
2270
|
var k = 1e4 > V.recentlyCreatedOwnerStacks++;
|
|
2271
|
-
return
|
|
2271
|
+
return d(
|
|
2272
2272
|
f,
|
|
2273
2273
|
S,
|
|
2274
2274
|
x,
|
|
@@ -2278,7 +2278,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
2278
2278
|
);
|
|
2279
2279
|
}, Ee.jsxs = function(f, S, x) {
|
|
2280
2280
|
var k = 1e4 > V.recentlyCreatedOwnerStacks++;
|
|
2281
|
-
return
|
|
2281
|
+
return d(
|
|
2282
2282
|
f,
|
|
2283
2283
|
S,
|
|
2284
2284
|
x,
|
|
@@ -2295,7 +2295,7 @@ function Bn() {
|
|
|
2295
2295
|
}
|
|
2296
2296
|
var n = Bn();
|
|
2297
2297
|
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:
|
|
2298
|
+
const { name: r, email: s, password: a, appId: i, phone: o, address: l, avatarUrl: h, isActive: c = !0, role: d = "user" } = t, { baseUrl: b, apiKey: y } = e;
|
|
2299
2299
|
if (!y)
|
|
2300
2300
|
throw new Error("API key is required for signup");
|
|
2301
2301
|
if (!r || !s || !a || !i)
|
|
@@ -2312,7 +2312,7 @@ const Hn = async (t, e) => {
|
|
|
2312
2312
|
address: l,
|
|
2313
2313
|
avatarUrl: h,
|
|
2314
2314
|
isActive: c,
|
|
2315
|
-
role:
|
|
2315
|
+
role: d
|
|
2316
2316
|
},
|
|
2317
2317
|
{
|
|
2318
2318
|
headers: {
|
|
@@ -2323,15 +2323,15 @@ const Hn = async (t, e) => {
|
|
|
2323
2323
|
);
|
|
2324
2324
|
return w.data?.user && localStorage.setItem("userInfo", JSON.stringify(w.data.user)), w.data.user;
|
|
2325
2325
|
} catch (w) {
|
|
2326
|
-
const
|
|
2327
|
-
if (console.error("Signup API Error:",
|
|
2328
|
-
if (
|
|
2326
|
+
const u = w.response?.data?.message || w.message || "Signup failed";
|
|
2327
|
+
if (console.error("Signup API Error:", u), w.response?.status === 400) {
|
|
2328
|
+
if (u.includes("already exists"))
|
|
2329
2329
|
throw {
|
|
2330
2330
|
success: !1,
|
|
2331
2331
|
message: "User with this email already exists for this app",
|
|
2332
2332
|
status: 400
|
|
2333
2333
|
};
|
|
2334
|
-
if (
|
|
2334
|
+
if (u.includes("inactive"))
|
|
2335
2335
|
throw {
|
|
2336
2336
|
success: !1,
|
|
2337
2337
|
message: "Cannot signup under an inactive app",
|
|
@@ -2344,7 +2344,7 @@ const Hn = async (t, e) => {
|
|
|
2344
2344
|
status: 404
|
|
2345
2345
|
} : {
|
|
2346
2346
|
success: !1,
|
|
2347
|
-
message:
|
|
2347
|
+
message: u,
|
|
2348
2348
|
status: w.response?.status || 500
|
|
2349
2349
|
};
|
|
2350
2350
|
}
|
|
@@ -2413,7 +2413,7 @@ const Xn = Nt(
|
|
|
2413
2413
|
...l
|
|
2414
2414
|
},
|
|
2415
2415
|
[
|
|
2416
|
-
...o.map(([c,
|
|
2416
|
+
...o.map(([c, d]) => Ge(c, d)),
|
|
2417
2417
|
...Array.isArray(i) ? i : [i]
|
|
2418
2418
|
]
|
|
2419
2419
|
)
|
|
@@ -2867,13 +2867,13 @@ const Ls = [
|
|
|
2867
2867
|
showAvatar: h = !1,
|
|
2868
2868
|
roles: c = [],
|
|
2869
2869
|
// 🔥 FIXED
|
|
2870
|
-
showRoleSelector:
|
|
2870
|
+
showRoleSelector: d = !1,
|
|
2871
2871
|
// 🔥 FIXED
|
|
2872
2872
|
loginUrl: b,
|
|
2873
2873
|
onSuccess: y,
|
|
2874
2874
|
onError: w
|
|
2875
2875
|
}) => {
|
|
2876
|
-
const { baseUrl:
|
|
2876
|
+
const { baseUrl: u, apiKey: j, appId: m } = ge(), _ = {
|
|
2877
2877
|
name: "",
|
|
2878
2878
|
email: "",
|
|
2879
2879
|
password: "",
|
|
@@ -2899,7 +2899,7 @@ const Ls = [
|
|
|
2899
2899
|
const x = {
|
|
2900
2900
|
...R,
|
|
2901
2901
|
appId: m
|
|
2902
|
-
}, k = await Hn(x, { baseUrl:
|
|
2902
|
+
}, k = await Hn(x, { baseUrl: u, apiKey: j });
|
|
2903
2903
|
U({ type: "success", text: "Account created successfully!" }), y && y(k);
|
|
2904
2904
|
} catch (x) {
|
|
2905
2905
|
const k = x.message || "Signup failed. Please try again.";
|
|
@@ -3036,7 +3036,7 @@ const Ls = [
|
|
|
3036
3036
|
onSubmit: X,
|
|
3037
3037
|
style: { display: "flex", flexDirection: "column", gap: "14px" },
|
|
3038
3038
|
children: [
|
|
3039
|
-
|
|
3039
|
+
d && c && c.length === 2 && /* @__PURE__ */ n.jsxs(
|
|
3040
3040
|
"div",
|
|
3041
3041
|
{
|
|
3042
3042
|
style: { display: "flex", flexDirection: "column", gap: "4px" },
|
|
@@ -3507,9 +3507,9 @@ const Ls = [
|
|
|
3507
3507
|
darkMode: l = !0,
|
|
3508
3508
|
signupUrl: h,
|
|
3509
3509
|
onSuccess: c,
|
|
3510
|
-
onError:
|
|
3510
|
+
onError: d
|
|
3511
3511
|
}) => {
|
|
3512
|
-
const { baseUrl: b, apiKey: y, appId: w } = ge(), [
|
|
3512
|
+
const { baseUrl: b, apiKey: y, appId: w } = ge(), [u, j] = O("login"), [m, _] = O(1), [R, A] = O(!1), [C, M] = O(!1), [g, I] = O(null), [v, U] = O(""), [q, F] = O(""), [V, Z] = O({
|
|
3513
3513
|
email: "",
|
|
3514
3514
|
otp: "",
|
|
3515
3515
|
newPassword: "",
|
|
@@ -3531,7 +3531,7 @@ const Ls = [
|
|
|
3531
3531
|
I({ type: "success", text: `Welcome ${N.name}` }), c?.(N);
|
|
3532
3532
|
} catch (N) {
|
|
3533
3533
|
const Y = N.message || "Login failed";
|
|
3534
|
-
I({ type: "error", text: Y }),
|
|
3534
|
+
I({ type: "error", text: Y }), d?.(N);
|
|
3535
3535
|
} finally {
|
|
3536
3536
|
M(!1);
|
|
3537
3537
|
}
|
|
@@ -3653,7 +3653,7 @@ const Ls = [
|
|
|
3653
3653
|
color: z,
|
|
3654
3654
|
margin: 0
|
|
3655
3655
|
},
|
|
3656
|
-
children:
|
|
3656
|
+
children: u === "login" ? r : m === 1 ? "Forgot Password" : "Reset Password"
|
|
3657
3657
|
}
|
|
3658
3658
|
),
|
|
3659
3659
|
/* @__PURE__ */ n.jsx(
|
|
@@ -3663,13 +3663,13 @@ const Ls = [
|
|
|
3663
3663
|
fontSize: "14px",
|
|
3664
3664
|
color: P
|
|
3665
3665
|
},
|
|
3666
|
-
children:
|
|
3666
|
+
children: u === "login" ? s : "Follow the steps to reset your password"
|
|
3667
3667
|
}
|
|
3668
3668
|
)
|
|
3669
3669
|
]
|
|
3670
3670
|
}
|
|
3671
3671
|
),
|
|
3672
|
-
|
|
3672
|
+
u === "login" && /* @__PURE__ */ n.jsxs(
|
|
3673
3673
|
"form",
|
|
3674
3674
|
{
|
|
3675
3675
|
onSubmit: X,
|
|
@@ -3845,7 +3845,7 @@ const Ls = [
|
|
|
3845
3845
|
]
|
|
3846
3846
|
}
|
|
3847
3847
|
),
|
|
3848
|
-
|
|
3848
|
+
u === "forgot" && /* @__PURE__ */ n.jsxs(
|
|
3849
3849
|
"form",
|
|
3850
3850
|
{
|
|
3851
3851
|
onSubmit: m === 1 ? S : x,
|
|
@@ -4087,36 +4087,60 @@ const Ls = [
|
|
|
4087
4087
|
fallback: e = null,
|
|
4088
4088
|
className: r,
|
|
4089
4089
|
width: s,
|
|
4090
|
-
height: a
|
|
4090
|
+
height: a,
|
|
4091
|
+
appId: i
|
|
4091
4092
|
}) => {
|
|
4092
|
-
const [
|
|
4093
|
+
const [o, l] = O(!1), [h, c] = O(!0);
|
|
4093
4094
|
return te(() => {
|
|
4094
|
-
|
|
4095
|
-
|
|
4095
|
+
let d = !1;
|
|
4096
|
+
const b = async () => {
|
|
4096
4097
|
try {
|
|
4097
|
-
const
|
|
4098
|
-
|
|
4098
|
+
const w = localStorage.getItem("userInfo");
|
|
4099
|
+
if (!w || w === "undefined" || w === "null") {
|
|
4100
|
+
l(!1);
|
|
4101
|
+
return;
|
|
4102
|
+
}
|
|
4103
|
+
const u = JSON.parse(w);
|
|
4104
|
+
if (!u?.id) {
|
|
4105
|
+
l(!1);
|
|
4106
|
+
return;
|
|
4107
|
+
}
|
|
4108
|
+
const j = await fetch(
|
|
4109
|
+
`https://server.authix.neuctra.com/api/users/check-user/${u.id}?appId=${i}`,
|
|
4110
|
+
{
|
|
4111
|
+
credentials: "include"
|
|
4112
|
+
}
|
|
4113
|
+
);
|
|
4114
|
+
if (!j.ok) {
|
|
4115
|
+
l(!1);
|
|
4116
|
+
return;
|
|
4117
|
+
}
|
|
4118
|
+
const m = await j.json();
|
|
4119
|
+
d || l(!!m?.exists);
|
|
4099
4120
|
} catch {
|
|
4100
|
-
|
|
4121
|
+
d || l(!1);
|
|
4122
|
+
} finally {
|
|
4123
|
+
d || c(!1);
|
|
4101
4124
|
}
|
|
4102
|
-
}, h = () => o(l());
|
|
4103
|
-
return h(), typeof window < "u" && window.addEventListener("storage", h), () => {
|
|
4104
|
-
typeof window < "u" && window.removeEventListener("storage", h);
|
|
4105
4125
|
};
|
|
4106
|
-
|
|
4107
|
-
|
|
4126
|
+
b();
|
|
4127
|
+
const y = () => b();
|
|
4128
|
+
return window.addEventListener("storage", y), () => {
|
|
4129
|
+
d = !0, window.removeEventListener("storage", y);
|
|
4130
|
+
};
|
|
4131
|
+
}, [i]), h ? null : o ? /* @__PURE__ */ n.jsx(
|
|
4132
|
+
"div",
|
|
4108
4133
|
{
|
|
4109
4134
|
className: r,
|
|
4110
4135
|
style: {
|
|
4111
|
-
display: "
|
|
4136
|
+
display: "flex",
|
|
4112
4137
|
alignItems: "center",
|
|
4113
|
-
verticalAlign: "middle",
|
|
4114
4138
|
width: s,
|
|
4115
4139
|
height: a
|
|
4116
4140
|
},
|
|
4117
4141
|
children: t
|
|
4118
4142
|
}
|
|
4119
|
-
) :
|
|
4143
|
+
) : typeof e == "function" ? e() : e;
|
|
4120
4144
|
}, ha = ({
|
|
4121
4145
|
children: t,
|
|
4122
4146
|
fallback: e = null,
|
|
@@ -4124,31 +4148,40 @@ const Ls = [
|
|
|
4124
4148
|
width: s,
|
|
4125
4149
|
height: a
|
|
4126
4150
|
}) => {
|
|
4127
|
-
const [i, o] = O(
|
|
4151
|
+
const [i, o] = O(() => {
|
|
4152
|
+
if (typeof window > "u") return !0;
|
|
4153
|
+
try {
|
|
4154
|
+
const l = localStorage.getItem("userInfo");
|
|
4155
|
+
return !l || l === "undefined" || l === "null";
|
|
4156
|
+
} catch {
|
|
4157
|
+
return !0;
|
|
4158
|
+
}
|
|
4159
|
+
});
|
|
4128
4160
|
return te(() => {
|
|
4129
4161
|
const l = () => {
|
|
4130
4162
|
try {
|
|
4131
|
-
const
|
|
4132
|
-
|
|
4163
|
+
const h = localStorage.getItem("userInfo");
|
|
4164
|
+
o(
|
|
4165
|
+
!h || h === "undefined" || h === "null"
|
|
4166
|
+
);
|
|
4133
4167
|
} catch {
|
|
4134
|
-
|
|
4168
|
+
o(!0);
|
|
4135
4169
|
}
|
|
4136
|
-
}
|
|
4137
|
-
return
|
|
4170
|
+
};
|
|
4171
|
+
return l(), window.addEventListener("storage", l), () => window.removeEventListener("storage", l);
|
|
4138
4172
|
}, []), i ? /* @__PURE__ */ n.jsx(
|
|
4139
|
-
"
|
|
4173
|
+
"div",
|
|
4140
4174
|
{
|
|
4141
4175
|
className: r,
|
|
4142
4176
|
style: {
|
|
4143
|
-
display: "
|
|
4177
|
+
display: "flex",
|
|
4144
4178
|
alignItems: "center",
|
|
4145
|
-
verticalAlign: "middle",
|
|
4146
4179
|
width: s,
|
|
4147
4180
|
height: a
|
|
4148
4181
|
},
|
|
4149
4182
|
children: t
|
|
4150
4183
|
}
|
|
4151
|
-
) :
|
|
4184
|
+
) : typeof e == "function" ? e() : e;
|
|
4152
4185
|
}, Ms = ({
|
|
4153
4186
|
isOpen: t,
|
|
4154
4187
|
onClose: e,
|
|
@@ -4158,7 +4191,7 @@ const Ls = [
|
|
|
4158
4191
|
token: i,
|
|
4159
4192
|
colors: o
|
|
4160
4193
|
}) => {
|
|
4161
|
-
const { baseUrl: l, apiKey: h, appId: c } = ge(), [
|
|
4194
|
+
const { baseUrl: l, apiKey: h, appId: c } = ge(), [d, b] = O(!1), [y, w] = O(""), [u, j] = O("warning"), [m, _] = O(!1);
|
|
4162
4195
|
if (te(() => {
|
|
4163
4196
|
if (typeof window > "u") return;
|
|
4164
4197
|
const g = () => {
|
|
@@ -4184,9 +4217,9 @@ const Ls = [
|
|
|
4184
4217
|
b(!1);
|
|
4185
4218
|
}
|
|
4186
4219
|
}, A = y.toLowerCase() === "delete my account", C = (g) => {
|
|
4187
|
-
g.target === g.currentTarget &&
|
|
4220
|
+
g.target === g.currentTarget && u !== "processing" && u !== "success" && e();
|
|
4188
4221
|
}, M = () => {
|
|
4189
|
-
switch (
|
|
4222
|
+
switch (u) {
|
|
4190
4223
|
case "warning":
|
|
4191
4224
|
return /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
4192
4225
|
/* @__PURE__ */ n.jsxs(
|
|
@@ -4586,7 +4619,7 @@ const Ls = [
|
|
|
4586
4619
|
"button",
|
|
4587
4620
|
{
|
|
4588
4621
|
onClick: R,
|
|
4589
|
-
disabled: !A ||
|
|
4622
|
+
disabled: !A || d,
|
|
4590
4623
|
style: {
|
|
4591
4624
|
padding: "10px 24px",
|
|
4592
4625
|
borderRadius: "10px",
|
|
@@ -4595,22 +4628,22 @@ const Ls = [
|
|
|
4595
4628
|
color: "white",
|
|
4596
4629
|
fontSize: "14px",
|
|
4597
4630
|
fontWeight: 600,
|
|
4598
|
-
cursor: !A ||
|
|
4631
|
+
cursor: !A || d ? "not-allowed" : "pointer",
|
|
4599
4632
|
flex: m ? "none" : 1,
|
|
4600
4633
|
minWidth: m ? "100%" : "140px",
|
|
4601
|
-
opacity: !A ||
|
|
4634
|
+
opacity: !A || d ? 0.6 : 1,
|
|
4602
4635
|
display: "flex",
|
|
4603
4636
|
alignItems: "center",
|
|
4604
4637
|
justifyContent: "center",
|
|
4605
4638
|
gap: "8px",
|
|
4606
4639
|
transition: "all 0.2s ease",
|
|
4607
|
-
boxShadow: !A ||
|
|
4640
|
+
boxShadow: !A || d ? "none" : "0 4px 12px rgba(239, 68, 68, 0.4)"
|
|
4608
4641
|
},
|
|
4609
4642
|
onMouseOver: (g) => {
|
|
4610
|
-
A && !
|
|
4643
|
+
A && !d && (g.currentTarget.style.transform = "translateY(-1px)", g.currentTarget.style.boxShadow = "0 6px 20px rgba(239, 68, 68, 0.5)");
|
|
4611
4644
|
},
|
|
4612
4645
|
onMouseOut: (g) => {
|
|
4613
|
-
A && !
|
|
4646
|
+
A && !d && (g.currentTarget.style.transform = "translateY(0)", g.currentTarget.style.boxShadow = "0 4px 12px rgba(239, 68, 68, 0.4)");
|
|
4614
4647
|
},
|
|
4615
4648
|
children: [
|
|
4616
4649
|
/* @__PURE__ */ n.jsx(Ne, { size: 16 }),
|
|
@@ -5010,20 +5043,20 @@ const Ls = [
|
|
|
5010
5043
|
onUpdate: r,
|
|
5011
5044
|
colors: s
|
|
5012
5045
|
}) => {
|
|
5013
|
-
const [a, i] = O(""), [o, l] = O(!1), [h, c] = O(!1), [
|
|
5046
|
+
const [a, i] = O(""), [o, l] = O(!1), [h, c] = O(!1), [d, b] = O({ isValid: !1, message: "", type: null });
|
|
5014
5047
|
if (te(() => {
|
|
5015
5048
|
if (typeof window > "u") return;
|
|
5016
|
-
const
|
|
5049
|
+
const u = () => {
|
|
5017
5050
|
c(window.innerWidth < 640);
|
|
5018
5051
|
};
|
|
5019
|
-
return
|
|
5052
|
+
return u(), window.addEventListener("resize", u), () => window.removeEventListener("resize", u);
|
|
5020
5053
|
}, []), te(() => {
|
|
5021
5054
|
if (!a.trim()) {
|
|
5022
5055
|
b({ isValid: !1, message: "", type: null });
|
|
5023
5056
|
return;
|
|
5024
5057
|
}
|
|
5025
5058
|
try {
|
|
5026
|
-
const
|
|
5059
|
+
const u = new URL(a), j = /\.(jpg|jpeg|png|gif|webp|svg)$/i.test(u.pathname);
|
|
5027
5060
|
b(j ? {
|
|
5028
5061
|
isValid: !0,
|
|
5029
5062
|
message: "Valid image URL",
|
|
@@ -5042,7 +5075,7 @@ const Ls = [
|
|
|
5042
5075
|
}
|
|
5043
5076
|
}, [a]), !t) return null;
|
|
5044
5077
|
const y = async () => {
|
|
5045
|
-
if (!(!a || !
|
|
5078
|
+
if (!(!a || !d.isValid)) {
|
|
5046
5079
|
l(!0);
|
|
5047
5080
|
try {
|
|
5048
5081
|
await r(a) && (i(""), e());
|
|
@@ -5050,8 +5083,8 @@ const Ls = [
|
|
|
5050
5083
|
l(!1);
|
|
5051
5084
|
}
|
|
5052
5085
|
}
|
|
5053
|
-
}, w = (
|
|
5054
|
-
|
|
5086
|
+
}, w = (u) => {
|
|
5087
|
+
u.target === u.currentTarget && e();
|
|
5055
5088
|
};
|
|
5056
5089
|
return /* @__PURE__ */ n.jsxs(
|
|
5057
5090
|
"div",
|
|
@@ -5158,11 +5191,11 @@ const Ls = [
|
|
|
5158
5191
|
flexShrink: 0,
|
|
5159
5192
|
transition: "all 0.2s ease"
|
|
5160
5193
|
},
|
|
5161
|
-
onMouseOver: (
|
|
5162
|
-
|
|
5194
|
+
onMouseOver: (u) => {
|
|
5195
|
+
u.currentTarget.style.backgroundColor = s.border, u.currentTarget.style.color = s.textPrimary;
|
|
5163
5196
|
},
|
|
5164
|
-
onMouseOut: (
|
|
5165
|
-
|
|
5197
|
+
onMouseOut: (u) => {
|
|
5198
|
+
u.currentTarget.style.backgroundColor = "transparent", u.currentTarget.style.color = s.textTertiary;
|
|
5166
5199
|
},
|
|
5167
5200
|
children: /* @__PURE__ */ n.jsx(Pe, { size: 20 })
|
|
5168
5201
|
}
|
|
@@ -5207,13 +5240,13 @@ const Ls = [
|
|
|
5207
5240
|
id: "avatar-url",
|
|
5208
5241
|
placeholder: "https://example.com/your-avatar.jpg",
|
|
5209
5242
|
value: a,
|
|
5210
|
-
onChange: (
|
|
5243
|
+
onChange: (u) => i(u.target.value),
|
|
5211
5244
|
style: {
|
|
5212
5245
|
width: "100%",
|
|
5213
5246
|
padding: "14px 16px",
|
|
5214
5247
|
paddingLeft: "44px",
|
|
5215
5248
|
borderRadius: "12px",
|
|
5216
|
-
border: `1.5px solid ${
|
|
5249
|
+
border: `1.5px solid ${d.type === "error" ? s.error : d.type === "success" ? s.success : s.border}`,
|
|
5217
5250
|
backgroundColor: "transparent",
|
|
5218
5251
|
color: s.textPrimary,
|
|
5219
5252
|
fontSize: "15px",
|
|
@@ -5221,11 +5254,11 @@ const Ls = [
|
|
|
5221
5254
|
transition: "all 0.2s ease",
|
|
5222
5255
|
boxSizing: "border-box"
|
|
5223
5256
|
},
|
|
5224
|
-
onFocus: (
|
|
5225
|
-
|
|
5257
|
+
onFocus: (u) => {
|
|
5258
|
+
u.target.style.borderColor = s.accent, u.target.style.boxShadow = `0 0 0 3px ${s.accent}20`;
|
|
5226
5259
|
},
|
|
5227
|
-
onBlur: (
|
|
5228
|
-
|
|
5260
|
+
onBlur: (u) => {
|
|
5261
|
+
u.target.style.borderColor = d.type === "error" ? s.error : d.type === "success" ? s.success : s.border, u.target.style.boxShadow = "none";
|
|
5229
5262
|
},
|
|
5230
5263
|
disabled: o
|
|
5231
5264
|
}
|
|
@@ -5244,7 +5277,7 @@ const Ls = [
|
|
|
5244
5277
|
}
|
|
5245
5278
|
)
|
|
5246
5279
|
] }),
|
|
5247
|
-
|
|
5280
|
+
d.message && /* @__PURE__ */ n.jsxs(
|
|
5248
5281
|
"div",
|
|
5249
5282
|
{
|
|
5250
5283
|
style: {
|
|
@@ -5253,18 +5286,18 @@ const Ls = [
|
|
|
5253
5286
|
gap: "6px",
|
|
5254
5287
|
marginTop: "8px",
|
|
5255
5288
|
fontSize: "13px",
|
|
5256
|
-
color:
|
|
5289
|
+
color: d.type === "success" ? s.success : d.type === "error" ? s.error : s.textTertiary
|
|
5257
5290
|
},
|
|
5258
5291
|
children: [
|
|
5259
|
-
|
|
5260
|
-
|
|
5261
|
-
|
|
5262
|
-
|
|
5292
|
+
d.type === "success" && /* @__PURE__ */ n.jsx(ce, { size: 14 }),
|
|
5293
|
+
d.type === "error" && /* @__PURE__ */ n.jsx(le, { size: 14 }),
|
|
5294
|
+
d.type === "warning" && /* @__PURE__ */ n.jsx(le, { size: 14 }),
|
|
5295
|
+
d.message
|
|
5263
5296
|
]
|
|
5264
5297
|
}
|
|
5265
5298
|
)
|
|
5266
5299
|
] }),
|
|
5267
|
-
a &&
|
|
5300
|
+
a && d.type === "success" && /* @__PURE__ */ n.jsxs(
|
|
5268
5301
|
"div",
|
|
5269
5302
|
{
|
|
5270
5303
|
style: {
|
|
@@ -5300,8 +5333,8 @@ const Ls = [
|
|
|
5300
5333
|
border: `2px solid ${s.success}40`,
|
|
5301
5334
|
margin: "0 auto"
|
|
5302
5335
|
},
|
|
5303
|
-
onError: (
|
|
5304
|
-
|
|
5336
|
+
onError: (u) => {
|
|
5337
|
+
u.currentTarget.style.display = "none";
|
|
5305
5338
|
}
|
|
5306
5339
|
}
|
|
5307
5340
|
)
|
|
@@ -5342,11 +5375,11 @@ const Ls = [
|
|
|
5342
5375
|
opacity: o ? 0.6 : 1,
|
|
5343
5376
|
transition: "all 0.2s ease"
|
|
5344
5377
|
},
|
|
5345
|
-
onMouseOver: (
|
|
5346
|
-
o || (
|
|
5378
|
+
onMouseOver: (u) => {
|
|
5379
|
+
o || (u.currentTarget.style.backgroundColor = s.border, u.currentTarget.style.transform = "translateY(-1px)");
|
|
5347
5380
|
},
|
|
5348
|
-
onMouseOut: (
|
|
5349
|
-
o || (
|
|
5381
|
+
onMouseOut: (u) => {
|
|
5382
|
+
o || (u.currentTarget.style.backgroundColor = "transparent", u.currentTarget.style.transform = "translateY(0)");
|
|
5350
5383
|
},
|
|
5351
5384
|
children: "Cancel"
|
|
5352
5385
|
}
|
|
@@ -5355,7 +5388,7 @@ const Ls = [
|
|
|
5355
5388
|
"button",
|
|
5356
5389
|
{
|
|
5357
5390
|
onClick: y,
|
|
5358
|
-
disabled: o || !
|
|
5391
|
+
disabled: o || !d.isValid,
|
|
5359
5392
|
style: {
|
|
5360
5393
|
padding: "10px 24px",
|
|
5361
5394
|
borderRadius: "10px",
|
|
@@ -5364,22 +5397,22 @@ const Ls = [
|
|
|
5364
5397
|
color: "#fff",
|
|
5365
5398
|
fontSize: "14px",
|
|
5366
5399
|
fontWeight: 600,
|
|
5367
|
-
cursor: o || !
|
|
5400
|
+
cursor: o || !d.isValid ? "not-allowed" : "pointer",
|
|
5368
5401
|
flex: h ? "none" : 1,
|
|
5369
5402
|
minWidth: h ? "100%" : "140px",
|
|
5370
|
-
opacity: o || !
|
|
5403
|
+
opacity: o || !d.isValid ? 0.6 : 1,
|
|
5371
5404
|
display: "flex",
|
|
5372
5405
|
alignItems: "center",
|
|
5373
5406
|
justifyContent: "center",
|
|
5374
5407
|
gap: "8px",
|
|
5375
5408
|
transition: "all 0.2s ease",
|
|
5376
|
-
boxShadow: o || !
|
|
5409
|
+
boxShadow: o || !d.isValid ? "none" : `0 4px 12px ${s.accent}40`
|
|
5377
5410
|
},
|
|
5378
|
-
onMouseOver: (
|
|
5379
|
-
!o &&
|
|
5411
|
+
onMouseOver: (u) => {
|
|
5412
|
+
!o && d.isValid && (u.currentTarget.style.transform = "translateY(-1px)", u.currentTarget.style.boxShadow = `0 6px 20px ${s.accent}60`);
|
|
5380
5413
|
},
|
|
5381
|
-
onMouseOut: (
|
|
5382
|
-
!o &&
|
|
5414
|
+
onMouseOut: (u) => {
|
|
5415
|
+
!o && d.isValid && (u.currentTarget.style.transform = "translateY(0)", u.currentTarget.style.boxShadow = `0 4px 12px ${s.accent}40`);
|
|
5383
5416
|
},
|
|
5384
5417
|
children: o ? /* @__PURE__ */ n.jsxs(n.Fragment, { children: [
|
|
5385
5418
|
/* @__PURE__ */ n.jsx(
|
|
@@ -5464,11 +5497,11 @@ const Ls = [
|
|
|
5464
5497
|
userId: a,
|
|
5465
5498
|
colors: i
|
|
5466
5499
|
}) => {
|
|
5467
|
-
const { baseUrl: o, apiKey: l, appId: h } = ge(), [c,
|
|
5500
|
+
const { baseUrl: o, apiKey: l, appId: h } = ge(), [c, d] = O({
|
|
5468
5501
|
currentPassword: "",
|
|
5469
5502
|
newPassword: "",
|
|
5470
5503
|
confirmPassword: ""
|
|
5471
|
-
}), [b, y] = O({}), [w,
|
|
5504
|
+
}), [b, y] = O({}), [w, u] = O(!1), [j, m] = O({
|
|
5472
5505
|
currentPassword: !1,
|
|
5473
5506
|
newPassword: !1,
|
|
5474
5507
|
confirmPassword: !1
|
|
@@ -5482,7 +5515,7 @@ const Ls = [
|
|
|
5482
5515
|
}, []), !t) return null;
|
|
5483
5516
|
const A = (v) => {
|
|
5484
5517
|
const { name: U, value: q } = v.target;
|
|
5485
|
-
|
|
5518
|
+
d((F) => ({ ...F, [U]: q })), b[U] && y((F) => ({ ...F, [U]: "" }));
|
|
5486
5519
|
}, C = (v) => {
|
|
5487
5520
|
m((U) => ({ ...U, [v]: !U[v] }));
|
|
5488
5521
|
}, M = () => {
|
|
@@ -5490,7 +5523,7 @@ const Ls = [
|
|
|
5490
5523
|
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;
|
|
5491
5524
|
}, g = async (v) => {
|
|
5492
5525
|
if (v.preventDefault(), !!M()) {
|
|
5493
|
-
|
|
5526
|
+
u(!0);
|
|
5494
5527
|
try {
|
|
5495
5528
|
const { data: U } = await W.put(
|
|
5496
5529
|
`${o}/users/change-password/${a}`,
|
|
@@ -5505,7 +5538,7 @@ const Ls = [
|
|
|
5505
5538
|
}
|
|
5506
5539
|
}
|
|
5507
5540
|
);
|
|
5508
|
-
U.success ? (r(U.message || "Password updated successfully"),
|
|
5541
|
+
U.success ? (r(U.message || "Password updated successfully"), d({
|
|
5509
5542
|
currentPassword: "",
|
|
5510
5543
|
newPassword: "",
|
|
5511
5544
|
confirmPassword: ""
|
|
@@ -5513,7 +5546,7 @@ const Ls = [
|
|
|
5513
5546
|
} catch (U) {
|
|
5514
5547
|
s(U.response?.data?.message || "Something went wrong");
|
|
5515
5548
|
} finally {
|
|
5516
|
-
|
|
5549
|
+
u(!1);
|
|
5517
5550
|
}
|
|
5518
5551
|
}
|
|
5519
5552
|
}, I = [
|
|
@@ -5912,7 +5945,7 @@ const Ls = [
|
|
|
5912
5945
|
verifying: l,
|
|
5913
5946
|
user: h,
|
|
5914
5947
|
colors: c,
|
|
5915
|
-
darkMode:
|
|
5948
|
+
darkMode: d
|
|
5916
5949
|
}) => {
|
|
5917
5950
|
if (!t) return null;
|
|
5918
5951
|
const b = () => {
|
|
@@ -5923,7 +5956,7 @@ const Ls = [
|
|
|
5923
5956
|
{
|
|
5924
5957
|
className: "modal-overlay",
|
|
5925
5958
|
style: {
|
|
5926
|
-
backgroundColor:
|
|
5959
|
+
backgroundColor: d ? "rgba(0, 0, 0, 0.8)" : "rgba(0, 0, 0, 0.5)"
|
|
5927
5960
|
},
|
|
5928
5961
|
children: [
|
|
5929
5962
|
/* @__PURE__ */ n.jsxs(
|
|
@@ -6082,7 +6115,7 @@ const Ls = [
|
|
|
6082
6115
|
}
|
|
6083
6116
|
|
|
6084
6117
|
.close-btn:hover {
|
|
6085
|
-
background-color: ${
|
|
6118
|
+
background-color: ${d ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)"};
|
|
6086
6119
|
}
|
|
6087
6120
|
|
|
6088
6121
|
.verify-form {
|
|
@@ -6193,7 +6226,7 @@ const Ls = [
|
|
|
6193
6226
|
onVerify: i,
|
|
6194
6227
|
primaryColor: o = "#00C212"
|
|
6195
6228
|
}) => {
|
|
6196
|
-
const { baseUrl: l, apiKey: h, appId: c } = ge(), [
|
|
6229
|
+
const { baseUrl: l, apiKey: h, appId: c } = ge(), [d, b] = O(null), [y, w] = O(e), [u, j] = O(!0), [m, _] = O(!1), [R, A] = O(!1), [C, M] = O(!1), [g, I] = O(!1), [v, U] = O(!1), [q, F] = O(!1), [V, Z] = O(!1), [T, J] = O(!1), [z, P] = O(null), [K, Q] = O(!1), [X, f] = O({
|
|
6197
6230
|
email: "",
|
|
6198
6231
|
otp: "",
|
|
6199
6232
|
appId: c
|
|
@@ -6365,7 +6398,7 @@ const Ls = [
|
|
|
6365
6398
|
border: "#e4e4e7",
|
|
6366
6399
|
warning: "#d97706"
|
|
6367
6400
|
};
|
|
6368
|
-
if (
|
|
6401
|
+
if (u)
|
|
6369
6402
|
return /* @__PURE__ */ n.jsx(
|
|
6370
6403
|
"div",
|
|
6371
6404
|
{
|
|
@@ -6533,14 +6566,14 @@ const Ls = [
|
|
|
6533
6566
|
display: "grid",
|
|
6534
6567
|
gap: "24px",
|
|
6535
6568
|
gridTemplateColumns: "1fr",
|
|
6536
|
-
...
|
|
6569
|
+
...d && window.innerWidth >= 1024 && {
|
|
6537
6570
|
gridTemplateColumns: "1fr 2fr",
|
|
6538
6571
|
gap: "10px"
|
|
6539
6572
|
},
|
|
6540
|
-
...
|
|
6573
|
+
...d && window.innerWidth >= 768 && d && window.innerWidth < 1024 && {
|
|
6541
6574
|
gap: "10px"
|
|
6542
6575
|
},
|
|
6543
|
-
...
|
|
6576
|
+
...d && window.innerWidth >= 600 && d && window.innerWidth < 768 && {
|
|
6544
6577
|
gap: "28px"
|
|
6545
6578
|
}
|
|
6546
6579
|
},
|
|
@@ -6725,7 +6758,7 @@ const Ls = [
|
|
|
6725
6758
|
gap: "8px",
|
|
6726
6759
|
textDecoration: "none",
|
|
6727
6760
|
minHeight: "36px",
|
|
6728
|
-
flex:
|
|
6761
|
+
flex: d && window.innerWidth < 1024 ? "1" : "auto"
|
|
6729
6762
|
},
|
|
6730
6763
|
children: [
|
|
6731
6764
|
/* @__PURE__ */ n.jsx(Pe, { size: 16, "aria-hidden": "true" }),
|
|
@@ -6755,7 +6788,7 @@ const Ls = [
|
|
|
6755
6788
|
gap: "8px",
|
|
6756
6789
|
textDecoration: "none",
|
|
6757
6790
|
minHeight: "36px",
|
|
6758
|
-
flex:
|
|
6791
|
+
flex: d && window.innerWidth < 1024 ? "1" : "auto"
|
|
6759
6792
|
},
|
|
6760
6793
|
children: [
|
|
6761
6794
|
R ? /* @__PURE__ */ n.jsx(
|
|
@@ -6791,7 +6824,7 @@ const Ls = [
|
|
|
6791
6824
|
gap: "8px",
|
|
6792
6825
|
textDecoration: "none",
|
|
6793
6826
|
minHeight: "36px",
|
|
6794
|
-
flex:
|
|
6827
|
+
flex: d && window.innerWidth < 1024 ? "1" : "auto"
|
|
6795
6828
|
},
|
|
6796
6829
|
children: [
|
|
6797
6830
|
/* @__PURE__ */ n.jsx(Es, { size: 16, "aria-hidden": "true" }),
|
|
@@ -6821,7 +6854,7 @@ const Ls = [
|
|
|
6821
6854
|
gap: "8px",
|
|
6822
6855
|
minHeight: "36px",
|
|
6823
6856
|
opacity: K ? 0.7 : 1,
|
|
6824
|
-
flex:
|
|
6857
|
+
flex: d && window.innerWidth < 1024 ? "1" : "auto"
|
|
6825
6858
|
},
|
|
6826
6859
|
children: [
|
|
6827
6860
|
K ? /* @__PURE__ */ n.jsx(
|
|
@@ -7031,7 +7064,7 @@ const Ls = [
|
|
|
7031
7064
|
display: "grid",
|
|
7032
7065
|
gap: "20px",
|
|
7033
7066
|
gridTemplateColumns: "1fr",
|
|
7034
|
-
...
|
|
7067
|
+
...d && window.innerWidth >= 600 && {
|
|
7035
7068
|
gridTemplateColumns: "1fr 1fr",
|
|
7036
7069
|
gap: "20px"
|
|
7037
7070
|
}
|
|
@@ -7410,12 +7443,12 @@ const Ls = [
|
|
|
7410
7443
|
// Menu item visibility with defaults
|
|
7411
7444
|
showProfileMenuItem: h = !0,
|
|
7412
7445
|
showSettingsMenuItem: c = !0,
|
|
7413
|
-
showViewProfileMenuItem:
|
|
7446
|
+
showViewProfileMenuItem: d = !0,
|
|
7414
7447
|
// Custom labels with defaults
|
|
7415
7448
|
profileLabel: b = "My Profile",
|
|
7416
7449
|
settingsLabel: y = "Settings",
|
|
7417
7450
|
viewProfileLabel: w = "View Profile",
|
|
7418
|
-
logoutLabel:
|
|
7451
|
+
logoutLabel: u = "Sign Out"
|
|
7419
7452
|
}) => {
|
|
7420
7453
|
const { baseUrl: j, apiKey: m, appId: _ } = ge(), [R, A] = O(!1), [C, M] = O(null), [g, I] = O(!0), [v, U] = O(null), q = xt(null), F = xt(null), [V, Z] = O(!1), [T, J] = O(!1);
|
|
7421
7454
|
te(() => {
|
|
@@ -7736,8 +7769,8 @@ const Ls = [
|
|
|
7736
7769
|
src: C.avatarUrl,
|
|
7737
7770
|
alt: `${C?.name || "User"}'s avatar`,
|
|
7738
7771
|
style: {
|
|
7739
|
-
width: T ? "34px" : "
|
|
7740
|
-
height: T ? "34px" : "
|
|
7772
|
+
width: T ? "34px" : "36px",
|
|
7773
|
+
height: T ? "34px" : "36px",
|
|
7741
7774
|
borderRadius: "50%",
|
|
7742
7775
|
objectFit: "cover",
|
|
7743
7776
|
border: `2px solid ${z.borderLight}`,
|
|
@@ -7897,7 +7930,7 @@ const Ls = [
|
|
|
7897
7930
|
]
|
|
7898
7931
|
}
|
|
7899
7932
|
),
|
|
7900
|
-
|
|
7933
|
+
d && C.profileUrl && /* @__PURE__ */ n.jsxs(
|
|
7901
7934
|
"a",
|
|
7902
7935
|
{
|
|
7903
7936
|
href: C.profileUrl,
|
|
@@ -7941,7 +7974,7 @@ const Ls = [
|
|
|
7941
7974
|
"aria-hidden": "true"
|
|
7942
7975
|
}
|
|
7943
7976
|
),
|
|
7944
|
-
/* @__PURE__ */ n.jsx("span", { style: P.menuItemText, children:
|
|
7977
|
+
/* @__PURE__ */ n.jsx("span", { style: P.menuItemText, children: u })
|
|
7945
7978
|
]
|
|
7946
7979
|
}
|
|
7947
7980
|
) })
|
|
@@ -7984,7 +8017,7 @@ const Ls = [
|
|
|
7984
8017
|
email: t?.email || "",
|
|
7985
8018
|
otp: "",
|
|
7986
8019
|
appId: a
|
|
7987
|
-
}), [c,
|
|
8020
|
+
}), [c, d] = O(!1), [b, y] = O(!1), [w, u] = O(null), j = (g, I) => {
|
|
7988
8021
|
let v = parseInt(g.replace("#", ""), 16), U = (v >> 16) + I, q = (v >> 8 & 255) + I, F = (v & 255) + I;
|
|
7989
8022
|
return U = Math.min(255, Math.max(0, U)), q = Math.min(255, Math.max(0, q)), F = Math.min(255, Math.max(0, F)), `#${(F | q << 8 | U << 16).toString(16).padStart(6, "0")}`;
|
|
7990
8023
|
}, m = e ? {
|
|
@@ -8014,7 +8047,7 @@ const Ls = [
|
|
|
8014
8047
|
t?.email && h((g) => ({ ...g, email: t.email }));
|
|
8015
8048
|
}, [t?.email]);
|
|
8016
8049
|
const _ = (g, I) => {
|
|
8017
|
-
|
|
8050
|
+
u({ type: g, message: I }), setTimeout(() => u(null), 3e3);
|
|
8018
8051
|
}, R = async () => {
|
|
8019
8052
|
if (!l.email || !/\S+@\S+\.\S+/.test(l.email)) {
|
|
8020
8053
|
_("error", "Please enter a valid email");
|
|
@@ -8027,7 +8060,7 @@ const Ls = [
|
|
|
8027
8060
|
{ email: l.email },
|
|
8028
8061
|
{ headers: { "x-api-key": o, "x-app-id": a } }
|
|
8029
8062
|
);
|
|
8030
|
-
g.data.success ? (_("success", g.data.message || "OTP sent!"),
|
|
8063
|
+
g.data.success ? (_("success", g.data.message || "OTP sent!"), d(!0)) : _("error", g.data.message || "Failed to send OTP");
|
|
8031
8064
|
} catch (g) {
|
|
8032
8065
|
_("error", g.response?.data?.message || "Server error");
|
|
8033
8066
|
} finally {
|
|
@@ -8043,7 +8076,7 @@ const Ls = [
|
|
|
8043
8076
|
const I = await W.post(`${i}/users/verify-email`, l);
|
|
8044
8077
|
if (I.data.success && t) {
|
|
8045
8078
|
const v = { ...t, isVerified: !0 };
|
|
8046
|
-
s?.(v), _("success", I.data.message || "Email verified!"),
|
|
8079
|
+
s?.(v), _("success", I.data.message || "Email verified!"), d(!1), h({ email: t.email, otp: "", appId: a });
|
|
8047
8080
|
} else
|
|
8048
8081
|
_("error", I.data.message || "Verification failed");
|
|
8049
8082
|
} catch (I) {
|