@neuctra/authix 1.0.18 → 1.0.20

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.
@@ -1,4 +1,4 @@
1
- import zt, { forwardRef as At, createElement as Ge, useState as O, useEffect as ie, useRef as dt } from "react";
1
+ import At, { forwardRef as zt, createElement as Ge, useState as O, useEffect as ie, useRef as dt } from "react";
2
2
  function _t(e, t) {
3
3
  return function() {
4
4
  return e.apply(t, arguments);
@@ -16,7 +16,7 @@ function ur(e) {
16
16
  let t;
17
17
  return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? t = ArrayBuffer.isView(e) : t = e && e.buffer && $t(e.buffer), t;
18
18
  }
19
- const pr = Me("string"), te = Me("function"), Ut = Me("number"), Te = (e) => e !== null && typeof e == "object", fr = (e) => e === !0 || e === !1, Ae = (e) => {
19
+ const pr = Me("string"), te = Me("function"), Ut = Me("number"), Te = (e) => e !== null && typeof e == "object", fr = (e) => e === !0 || e === !1, ze = (e) => {
20
20
  if (Le(e) !== "object")
21
21
  return !1;
22
22
  const t = st(e);
@@ -65,7 +65,7 @@ const pe = typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typ
65
65
  function Ze() {
66
66
  const { caseless: e, skipUndefined: t } = Ft(this) && this || {}, r = {}, s = (o, i) => {
67
67
  const a = e && Dt(r, i) || i;
68
- Ae(r[a]) && Ae(o) ? r[a] = Ze(r[a], o) : Ae(o) ? r[a] = Ze({}, o) : we(o) ? r[a] = o.slice() : (!t || !ye(o)) && (r[a] = o);
68
+ ze(r[a]) && ze(o) ? r[a] = Ze(r[a], o) : ze(o) ? r[a] = Ze({}, o) : we(o) ? r[a] = o.slice() : (!t || !ye(o)) && (r[a] = o);
69
69
  };
70
70
  for (let o = 0, i = arguments.length; o < i; o++)
71
71
  arguments[o] && Re(arguments[o], s);
@@ -91,7 +91,7 @@ const Tr = (e, t, r, { allOwnKeys: s } = {}) => (Re(t, (o, i) => {
91
91
  e = String(e), (r === void 0 || r > e.length) && (r = e.length), r -= t.length;
92
92
  const s = e.indexOf(t, r);
93
93
  return s !== -1 && s === r;
94
- }, zr = (e) => {
94
+ }, Ar = (e) => {
95
95
  if (!e) return null;
96
96
  if (we(e)) return e;
97
97
  let t = e.length;
@@ -100,7 +100,7 @@ const Tr = (e, t, r, { allOwnKeys: s } = {}) => (Re(t, (o, i) => {
100
100
  for (; t-- > 0; )
101
101
  r[t] = e[t];
102
102
  return r;
103
- }, Ar = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && st(Uint8Array)), _r = (e, t) => {
103
+ }, zr = /* @__PURE__ */ ((e) => (t) => e && t instanceof e)(typeof Uint8Array < "u" && st(Uint8Array)), _r = (e, t) => {
104
104
  const s = (e && e[Fe]).call(e);
105
105
  let o;
106
106
  for (; (o = s.next()) && !o.done; ) {
@@ -187,7 +187,7 @@ const qr = (e) => {
187
187
  isNumber: Ut,
188
188
  isBoolean: fr,
189
189
  isObject: Te,
190
- isPlainObject: Ae,
190
+ isPlainObject: ze,
191
191
  isEmptyObject: xr,
192
192
  isReadableStream: vr,
193
193
  isRequest: Sr,
@@ -201,7 +201,7 @@ const qr = (e) => {
201
201
  isFunction: te,
202
202
  isStream: br,
203
203
  isURLSearchParams: jr,
204
- isTypedArray: Ar,
204
+ isTypedArray: zr,
205
205
  isFileList: yr,
206
206
  forEach: Re,
207
207
  merge: Ze,
@@ -213,7 +213,7 @@ const qr = (e) => {
213
213
  kindOf: Le,
214
214
  kindOfTest: oe,
215
215
  endsWith: Or,
216
- toArray: zr,
216
+ toArray: Ar,
217
217
  forEachEntry: _r,
218
218
  matchAll: Nr,
219
219
  isHTMLForm: $r,
@@ -336,11 +336,11 @@ function Be(e, t, r) {
336
336
  if (p.endsWith(b, "{}"))
337
337
  b = s ? b : b.slice(0, -2), d = JSON.stringify(d);
338
338
  else if (p.isArray(d) && Xr(d) || (p.isFileList(d) || p.endsWith(b, "[]")) && (L = p.toArray(d)))
339
- return b = qt(b), L.forEach(function(z, k) {
340
- !(p.isUndefined(z) || z === null) && t.append(
339
+ return b = qt(b), L.forEach(function(A, k) {
340
+ !(p.isUndefined(A) || A === null) && t.append(
341
341
  // eslint-disable-next-line no-nested-ternary
342
342
  a === !0 ? pt([b], k, i) : a === null ? b : b + "[]",
343
- c(z)
343
+ c(A)
344
344
  );
345
345
  }), !1;
346
346
  }
@@ -1034,13 +1034,13 @@ const Zt = (e) => {
1034
1034
  function L() {
1035
1035
  if (!g)
1036
1036
  return;
1037
- const z = re.from(
1037
+ const A = re.from(
1038
1038
  "getAllResponseHeaders" in g && g.getAllResponseHeaders()
1039
1039
  ), M = {
1040
1040
  data: !l || l === "text" || l === "json" ? g.responseText : g.response,
1041
1041
  status: g.status,
1042
1042
  statusText: g.statusText,
1043
- headers: z,
1043
+ headers: A,
1044
1044
  config: e,
1045
1045
  request: g
1046
1046
  };
@@ -1068,8 +1068,8 @@ const Zt = (e) => {
1068
1068
  )), g = null;
1069
1069
  }, i === void 0 && a.setContentType(null), "setRequestHeader" in g && p.forEach(a.toJSON(), function(k, M) {
1070
1070
  g.setRequestHeader(M, k);
1071
- }), p.isUndefined(o.withCredentials) || (g.withCredentials = !!o.withCredentials), l && l !== "json" && (g.responseType = o.responseType), c && ([T, d] = De(c, !0), g.addEventListener("progress", T)), h && g.upload && ([y, S] = De(h), g.upload.addEventListener("progress", y), g.upload.addEventListener("loadend", S)), (o.cancelToken || o.signal) && (u = (z) => {
1072
- g && (s(!z || z.type ? new je(null, e, g) : z), g.abort(), g = null);
1071
+ }), p.isUndefined(o.withCredentials) || (g.withCredentials = !!o.withCredentials), l && l !== "json" && (g.responseType = o.responseType), c && ([T, d] = De(c, !0), g.addEventListener("progress", T)), h && g.upload && ([y, S] = De(h), g.upload.addEventListener("progress", y), g.upload.addEventListener("loadend", S)), (o.cancelToken || o.signal) && (u = (A) => {
1072
+ g && (s(!A || A.type ? new je(null, e, g) : A), g.abort(), g = null);
1073
1073
  }, o.cancelToken && o.cancelToken.subscribe(u), o.signal && (o.signal.aborted ? u() : o.signal.addEventListener("abort", u)));
1074
1074
  const $ = yn(o.url);
1075
1075
  if ($ && ee.protocols.indexOf($) === -1) {
@@ -1170,7 +1170,7 @@ const Zt = (e) => {
1170
1170
  } catch {
1171
1171
  return !1;
1172
1172
  }
1173
- }, zn = (e) => {
1173
+ }, An = (e) => {
1174
1174
  e = p.merge.call({
1175
1175
  skipUndefined: !0
1176
1176
  }, On, e);
@@ -1222,7 +1222,7 @@ const Zt = (e) => {
1222
1222
  method: g,
1223
1223
  data: L,
1224
1224
  signal: $,
1225
- cancelToken: z,
1225
+ cancelToken: A,
1226
1226
  timeout: k,
1227
1227
  onDownloadProgress: M,
1228
1228
  onUploadProgress: m,
@@ -1232,7 +1232,7 @@ const Zt = (e) => {
1232
1232
  fetchOptions: K
1233
1233
  } = Zt(d), F = t || fetch;
1234
1234
  N = N ? (N + "").toLowerCase() : "text";
1235
- let V = Tn([$, z && z.toAbortSignal()], k), Z = null;
1235
+ let V = Tn([$, A && A.toAbortSignal()], k), Z = null;
1236
1236
  const E = V && V.unsubscribe && (() => {
1237
1237
  V.unsubscribe();
1238
1238
  });
@@ -1253,7 +1253,7 @@ const Zt = (e) => {
1253
1253
  }
1254
1254
  }
1255
1255
  p.isString(D) || (D = D ? "include" : "omit");
1256
- const q = i && "credentials" in r.prototype, A = {
1256
+ const q = i && "credentials" in r.prototype, z = {
1257
1257
  ...K,
1258
1258
  signal: V,
1259
1259
  method: g.toUpperCase(),
@@ -1262,8 +1262,8 @@ const Zt = (e) => {
1262
1262
  duplex: "half",
1263
1263
  credentials: q ? D : void 0
1264
1264
  };
1265
- Z = i && new r(b, A);
1266
- let R = await (i ? F(Z, K) : F(b, A));
1265
+ Z = i && new r(b, z);
1266
+ let R = await (i ? F(Z, K) : F(b, z));
1267
1267
  const Y = u && (N === "stream" || N === "response");
1268
1268
  if (u && (M || Y && E)) {
1269
1269
  const C = {};
@@ -1302,16 +1302,16 @@ const Zt = (e) => {
1302
1302
  ) : U.from(q, q && q.code, d, Z);
1303
1303
  }
1304
1304
  };
1305
- }, An = /* @__PURE__ */ new Map(), Qt = (e) => {
1305
+ }, zn = /* @__PURE__ */ new Map(), Qt = (e) => {
1306
1306
  let t = e ? e.env : {};
1307
1307
  const { fetch: r, Request: s, Response: o } = t, i = [
1308
1308
  s,
1309
1309
  o,
1310
1310
  r
1311
1311
  ];
1312
- let a = i.length, l = a, h, c, u = An;
1312
+ let a = i.length, l = a, h, c, u = zn;
1313
1313
  for (; l--; )
1314
- h = i[l], c = u.get(h), c === void 0 && u.set(h, c = l ? /* @__PURE__ */ new Map() : zn(t)), u = c;
1314
+ h = i[l], c = u.get(h), c === void 0 && u.set(h, c = l ? /* @__PURE__ */ new Map() : An(t)), u = c;
1315
1315
  return c;
1316
1316
  };
1317
1317
  Qt();
@@ -1773,47 +1773,32 @@ class co {
1773
1773
  });
1774
1774
  }
1775
1775
  /**
1776
- * 🌐 Universal request helper with structured responses and error handling
1777
- * @param method HTTP method (GET, POST, PUT, DELETE)
1778
- * @param path API endpoint path
1779
- * @param data optional request body
1780
- * @param extraHeaders optional headers
1781
- */
1776
+ * 🌐 Universal request helper with structured responses and error handling
1777
+ * @param method HTTP method (GET, POST, PUT, DELETE)
1778
+ * @param path API endpoint path
1779
+ * @param data Optional request body
1780
+ * @param extraHeaders Optional custom headers
1781
+ */
1782
1782
  async request(t, r, s, o = {}) {
1783
- if (!t) return { success: !1, message: "HTTP method is required" };
1784
- if (!r) return { success: !1, message: "Request path is required" };
1783
+ if (!t) throw new Error("HTTP method is required");
1784
+ if (!r) throw new Error("Request path is required");
1785
1785
  try {
1786
1786
  const i = {
1787
1787
  ...this.appId ? { appId: this.appId } : {},
1788
1788
  ...s || {}
1789
1789
  };
1790
- return {
1791
- success: !0,
1792
- data: (await this.client.request({
1793
- url: r,
1794
- method: t,
1795
- data: i,
1796
- headers: o
1797
- })).data,
1798
- message: "✅ Request completed successfully"
1799
- };
1790
+ return (await this.client.request({
1791
+ url: r,
1792
+ method: t,
1793
+ data: i,
1794
+ headers: o
1795
+ })).data;
1800
1796
  } catch (i) {
1801
- if (console.error("❌ [Request Error]:", i), i.isAxiosError && !i.response)
1802
- return {
1803
- success: !1,
1804
- message: `🌐 Network error: ${i.message}`
1805
- };
1806
- if (i.response) {
1807
- const a = i.response.status, l = i.response.data?.message || i.response.statusText || "Server returned an error";
1808
- return {
1809
- success: !1,
1810
- message: `⚠️ Request failed (${a}): ${l}`
1811
- };
1797
+ if (console.error("❌ [Request Error]:", i), i.isAxiosError) {
1798
+ const a = i.response?.status || 0, l = i.response?.data?.message || i.message || "Unknown Axios error occurred";
1799
+ throw new Error(`Request failed (${a}): ${l}`);
1812
1800
  }
1813
- return {
1814
- success: !1,
1815
- message: `🚨 Unexpected error: ${i.message || "Something went wrong"}`
1816
- };
1801
+ throw new Error(`Unexpected error: ${i.message || "Unknown failure"}`);
1817
1802
  }
1818
1803
  }
1819
1804
  // ================= USERS =================
@@ -2006,7 +1991,7 @@ class co {
2006
1991
  return this.request("DELETE", `/users/${r}/data/${s}`);
2007
1992
  }
2008
1993
  }
2009
- var ze = { exports: {} }, ke = {};
1994
+ var Ae = { exports: {} }, ke = {};
2010
1995
  /**
2011
1996
  * @license React
2012
1997
  * react-jsx-runtime.production.js
@@ -2076,7 +2061,7 @@ function Ln() {
2076
2061
  ), f.$$typeof) {
2077
2062
  case d:
2078
2063
  return "Portal";
2079
- case z:
2064
+ case A:
2080
2065
  return (f.displayName || "Context") + ".Provider";
2081
2066
  case $:
2082
2067
  return (f._context.displayName || "Context") + ".Consumer";
@@ -2242,7 +2227,7 @@ React keys must be passed directly to JSX without using spread:
2242
2227
  function y(f) {
2243
2228
  typeof f == "object" && f !== null && f.$$typeof === S && f._store && (f._store.validated = 1);
2244
2229
  }
2245
- var T = zt, S = Symbol.for("react.transitional.element"), d = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), L = Symbol.for("react.profiler"), $ = Symbol.for("react.consumer"), z = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), N = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), D = Symbol.for("react.activity"), K = Symbol.for("react.client.reference"), F = T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, Z = Array.isArray, E = console.createTask ? console.createTask : function() {
2230
+ var T = At, S = Symbol.for("react.transitional.element"), d = Symbol.for("react.portal"), b = Symbol.for("react.fragment"), g = Symbol.for("react.strict_mode"), L = Symbol.for("react.profiler"), $ = Symbol.for("react.consumer"), A = Symbol.for("react.context"), k = Symbol.for("react.forward_ref"), M = Symbol.for("react.suspense"), m = Symbol.for("react.suspense_list"), N = Symbol.for("react.memo"), w = Symbol.for("react.lazy"), D = Symbol.for("react.activity"), K = Symbol.for("react.client.reference"), F = T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, V = Object.prototype.hasOwnProperty, Z = Array.isArray, E = console.createTask ? console.createTask : function() {
2246
2231
  return null;
2247
2232
  };
2248
2233
  T = {
@@ -2250,7 +2235,7 @@ React keys must be passed directly to JSX without using spread:
2250
2235
  return f();
2251
2236
  }
2252
2237
  };
2253
- var J, q = {}, A = T.react_stack_bottom_frame.bind(
2238
+ var J, q = {}, z = T.react_stack_bottom_frame.bind(
2254
2239
  T,
2255
2240
  i
2256
2241
  )(), R = E(s(i)), Y = {};
@@ -2263,7 +2248,7 @@ React keys must be passed directly to JSX without using spread:
2263
2248
  !1,
2264
2249
  P,
2265
2250
  x,
2266
- j ? Error("react-stack-top-frame") : A,
2251
+ j ? Error("react-stack-top-frame") : z,
2267
2252
  j ? E(s(f)) : R
2268
2253
  );
2269
2254
  }, Ee.jsxs = function(f, C, _, P, x) {
@@ -2275,7 +2260,7 @@ React keys must be passed directly to JSX without using spread:
2275
2260
  !0,
2276
2261
  P,
2277
2262
  x,
2278
- j ? Error("react-stack-top-frame") : A,
2263
+ j ? Error("react-stack-top-frame") : z,
2279
2264
  j ? E(s(f)) : R
2280
2265
  );
2281
2266
  };
@@ -2283,7 +2268,7 @@ React keys must be passed directly to JSX without using spread:
2283
2268
  }
2284
2269
  var It;
2285
2270
  function Mn() {
2286
- return It || (It = 1, process.env.NODE_ENV === "production" ? ze.exports = Fn() : ze.exports = Ln()), ze.exports;
2271
+ return It || (It = 1, process.env.NODE_ENV === "production" ? Ae.exports = Fn() : Ae.exports = Ln()), Ae.exports;
2287
2272
  }
2288
2273
  var n = Mn();
2289
2274
  const Bn = async (e, t) => {
@@ -2381,7 +2366,7 @@ var Vn = {
2381
2366
  * This source code is licensed under the ISC license.
2382
2367
  * See the LICENSE file in the root directory of this source tree.
2383
2368
  */
2384
- const Yn = At(
2369
+ const Yn = zt(
2385
2370
  ({
2386
2371
  color: e = "currentColor",
2387
2372
  size: t = 24,
@@ -2417,7 +2402,7 @@ const Yn = At(
2417
2402
  * See the LICENSE file in the root directory of this source tree.
2418
2403
  */
2419
2404
  const W = (e, t) => {
2420
- const r = At(
2405
+ const r = zt(
2421
2406
  ({ className: s, ...o }, i) => Ge(Yn, {
2422
2407
  ref: i,
2423
2408
  iconNode: t,
@@ -2796,7 +2781,7 @@ const Os = [
2796
2781
  * This source code is licensed under the ISC license.
2797
2782
  * See the LICENSE file in the root directory of this source tree.
2798
2783
  */
2799
- const zs = [
2784
+ const As = [
2800
2785
  [
2801
2786
  "path",
2802
2787
  {
@@ -2806,19 +2791,19 @@ const zs = [
2806
2791
  ],
2807
2792
  ["path", { d: "M12 9v4", key: "juzpu7" }],
2808
2793
  ["path", { d: "M12 17h.01", key: "p32p05" }]
2809
- ], Ot = W("triangle-alert", zs);
2794
+ ], Ot = W("triangle-alert", As);
2810
2795
  /**
2811
2796
  * @license lucide-react v0.544.0 - ISC
2812
2797
  *
2813
2798
  * This source code is licensed under the ISC license.
2814
2799
  * See the LICENSE file in the root directory of this source tree.
2815
2800
  */
2816
- const As = [
2801
+ const zs = [
2817
2802
  ["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2", key: "1yyitq" }],
2818
2803
  ["circle", { cx: "9", cy: "7", r: "4", key: "nufk8" }],
2819
2804
  ["line", { x1: "17", x2: "22", y1: "8", y2: "13", key: "3nzzx3" }],
2820
2805
  ["line", { x1: "22", x2: "17", y1: "8", y2: "13", key: "1swrse" }]
2821
- ], _s = W("user-x", As);
2806
+ ], _s = W("user-x", zs);
2822
2807
  /**
2823
2808
  * @license lucide-react v0.544.0 - ISC
2824
2809
  *
@@ -2866,13 +2851,13 @@ const $s = [
2866
2851
  email: "",
2867
2852
  password: "",
2868
2853
  ...h && { avatarUrl: "" }
2869
- }, [g, L] = O(b), [$, z] = O(!1), [k, M] = O(!1), [m, N] = O(null), [w, D] = O({}), K = typeof window < "u" ? window.innerWidth < 768 : !1, F = l ? "#ffffff" : "#111827", V = l ? "#a1a1aa" : "#6b7280", Z = l ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.02)", E = l ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)", J = (Y) => {
2854
+ }, [g, L] = O(b), [$, A] = O(!1), [k, M] = O(!1), [m, N] = O(null), [w, D] = O({}), K = typeof window < "u" ? window.innerWidth < 768 : !1, F = l ? "#ffffff" : "#111827", V = l ? "#a1a1aa" : "#6b7280", Z = l ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.02)", E = l ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)", J = (Y) => {
2870
2855
  const { name: f, value: C } = Y.target;
2871
2856
  L((_) => ({ ..._, [f]: C })), w[f] && D((_) => ({ ..._, [f]: void 0 }));
2872
2857
  }, q = () => {
2873
2858
  const Y = {};
2874
2859
  return g.name.trim() || (Y.name = "Name is required"), g.email.trim() ? /\S+@\S+\.\S+/.test(g.email) || (Y.email = "Invalid email address") : Y.email = "Email is required", g.password ? g.password.length < 6 && (Y.password = "Password must be at least 6 characters") : Y.password = "Password is required", D(Y), Object.keys(Y).length === 0;
2875
- }, A = async (Y) => {
2860
+ }, z = async (Y) => {
2876
2861
  if (Y.preventDefault(), !!q()) {
2877
2862
  M(!0), N(null);
2878
2863
  try {
@@ -3005,7 +2990,7 @@ const $s = [
3005
2990
  /* @__PURE__ */ n.jsxs(
3006
2991
  "form",
3007
2992
  {
3008
- onSubmit: A,
2993
+ onSubmit: z,
3009
2994
  style: { display: "flex", flexDirection: "column", gap: "14px" },
3010
2995
  children: [
3011
2996
  /* @__PURE__ */ n.jsxs("div", { style: { display: "flex", flexDirection: "column", gap: "4px" }, children: [
@@ -3164,7 +3149,7 @@ const $s = [
3164
3149
  "button",
3165
3150
  {
3166
3151
  type: "button",
3167
- onClick: () => z(!$),
3152
+ onClick: () => A(!$),
3168
3153
  style: {
3169
3154
  position: "absolute",
3170
3155
  right: "14px",
@@ -3382,12 +3367,12 @@ const $s = [
3382
3367
  onSuccess: c,
3383
3368
  onError: u
3384
3369
  }) => {
3385
- const { baseUrl: y, apiKey: T, appId: S } = ve(), [d, b] = O("login"), [g, L] = O(1), [$, z] = O(!1), [k, M] = O(!1), [m, N] = O(null), [w, D] = O(""), [K, F] = O(""), [V, Z] = O({
3370
+ const { baseUrl: y, apiKey: T, appId: S } = ve(), [d, b] = O("login"), [g, L] = O(1), [$, A] = O(!1), [k, M] = O(!1), [m, N] = O(null), [w, D] = O(""), [K, F] = O(""), [V, Z] = O({
3386
3371
  email: "",
3387
3372
  otp: "",
3388
3373
  newPassword: "",
3389
3374
  appId: S
3390
- }), E = window.innerWidth < 768, J = l ? "#ffffff" : "#111827", q = l ? "#a1a1aa" : "#6b7280", A = l ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.02)", R = l ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)", Y = async (x) => {
3375
+ }), E = window.innerWidth < 768, J = l ? "#ffffff" : "#111827", q = l ? "#a1a1aa" : "#6b7280", z = l ? "rgba(255,255,255,0.05)" : "rgba(0,0,0,0.02)", R = l ? "rgba(255,255,255,0.1)" : "rgba(0,0,0,0.1)", Y = async (x) => {
3391
3376
  x.preventDefault(), M(!0), N(null);
3392
3377
  try {
3393
3378
  const j = await Us(
@@ -3446,7 +3431,7 @@ const $s = [
3446
3431
  }, P = {
3447
3432
  width: "100%",
3448
3433
  padding: E ? "10px 14px 10px 44px" : "10px 16px 10px 44px",
3449
- backgroundColor: A,
3434
+ backgroundColor: z,
3450
3435
  border: `1px solid ${R}`,
3451
3436
  borderRadius: "10px",
3452
3437
  color: J,
@@ -3625,7 +3610,7 @@ const $s = [
3625
3610
  "button",
3626
3611
  {
3627
3612
  type: "button",
3628
- onClick: () => z(!$),
3613
+ onClick: () => A(!$),
3629
3614
  style: {
3630
3615
  position: "absolute",
3631
3616
  right: "14px",
@@ -4017,7 +4002,7 @@ const $s = [
4017
4002
  } finally {
4018
4003
  y(!1);
4019
4004
  }
4020
- }, z = T.toLowerCase() === "delete my account", k = (m) => {
4005
+ }, A = T.toLowerCase() === "delete my account", k = (m) => {
4021
4006
  m.target === m.currentTarget && d !== "processing" && d !== "success" && t();
4022
4007
  }, M = () => {
4023
4008
  switch (d) {
@@ -4341,7 +4326,7 @@ const $s = [
4341
4326
  width: "100%",
4342
4327
  padding: "14px 16px",
4343
4328
  borderRadius: "10px",
4344
- border: `2px solid ${z ? a.success : a.error}`,
4329
+ border: `2px solid ${A ? a.success : a.error}`,
4345
4330
  backgroundColor: "transparent",
4346
4331
  color: a.textPrimary,
4347
4332
  fontSize: "15px",
@@ -4358,7 +4343,7 @@ const $s = [
4358
4343
  autoFocus: !0
4359
4344
  }
4360
4345
  ),
4361
- z && /* @__PURE__ */ n.jsxs(
4346
+ A && /* @__PURE__ */ n.jsxs(
4362
4347
  "div",
4363
4348
  {
4364
4349
  style: {
@@ -4420,7 +4405,7 @@ const $s = [
4420
4405
  "button",
4421
4406
  {
4422
4407
  onClick: $,
4423
- disabled: !z || u,
4408
+ disabled: !A || u,
4424
4409
  style: {
4425
4410
  padding: "10px 24px",
4426
4411
  borderRadius: "10px",
@@ -4429,22 +4414,22 @@ const $s = [
4429
4414
  color: "white",
4430
4415
  fontSize: "14px",
4431
4416
  fontWeight: 600,
4432
- cursor: !z || u ? "not-allowed" : "pointer",
4417
+ cursor: !A || u ? "not-allowed" : "pointer",
4433
4418
  flex: g ? "none" : 1,
4434
4419
  minWidth: g ? "100%" : "140px",
4435
- opacity: !z || u ? 0.6 : 1,
4420
+ opacity: !A || u ? 0.6 : 1,
4436
4421
  display: "flex",
4437
4422
  alignItems: "center",
4438
4423
  justifyContent: "center",
4439
4424
  gap: "8px",
4440
4425
  transition: "all 0.2s ease",
4441
- boxShadow: !z || u ? "none" : "0 4px 12px rgba(239, 68, 68, 0.4)"
4426
+ boxShadow: !A || u ? "none" : "0 4px 12px rgba(239, 68, 68, 0.4)"
4442
4427
  },
4443
4428
  onMouseOver: (m) => {
4444
- z && !u && (m.currentTarget.style.transform = "translateY(-1px)", m.currentTarget.style.boxShadow = "0 6px 20px rgba(239, 68, 68, 0.5)");
4429
+ A && !u && (m.currentTarget.style.transform = "translateY(-1px)", m.currentTarget.style.boxShadow = "0 6px 20px rgba(239, 68, 68, 0.5)");
4445
4430
  },
4446
4431
  onMouseOut: (m) => {
4447
- z && !u && (m.currentTarget.style.transform = "translateY(0)", m.currentTarget.style.boxShadow = "0 4px 12px rgba(239, 68, 68, 0.4)");
4432
+ A && !u && (m.currentTarget.style.transform = "translateY(0)", m.currentTarget.style.boxShadow = "0 4px 12px rgba(239, 68, 68, 0.4)");
4448
4433
  },
4449
4434
  children: [
4450
4435
  /* @__PURE__ */ n.jsx($e, { size: 16 }),
@@ -5306,13 +5291,13 @@ const $s = [
5306
5291
  newPassword: !1,
5307
5292
  confirmPassword: !1
5308
5293
  }), [L, $] = O(!1);
5309
- if (zt.useEffect(() => {
5294
+ if (At.useEffect(() => {
5310
5295
  const w = () => {
5311
5296
  $(window.innerWidth < 640);
5312
5297
  };
5313
5298
  return w(), window.addEventListener("resize", w), () => window.removeEventListener("resize", w);
5314
5299
  }, []), !e) return null;
5315
- const z = (w) => {
5300
+ const A = (w) => {
5316
5301
  const { name: D, value: K } = w.target;
5317
5302
  u((F) => ({ ...F, [D]: K })), y[D] && T((F) => ({ ...F, [D]: "" }));
5318
5303
  }, k = (w) => {
@@ -5527,7 +5512,7 @@ const $s = [
5527
5512
  name: w,
5528
5513
  placeholder: `Enter ${D.toLowerCase()}`,
5529
5514
  value: c[w],
5530
- onChange: z,
5515
+ onChange: A,
5531
5516
  style: {
5532
5517
  width: "100%",
5533
5518
  padding: "14px 48px 14px 44px",
@@ -6024,7 +6009,7 @@ const $s = [
6024
6009
  onLogout: o,
6025
6010
  primaryColor: i = "#00C212"
6026
6011
  }) => {
6027
- const { baseUrl: a, apiKey: l, appId: h } = ve(), [c, u] = O(t), [y, T] = O(!0), [S, d] = O(!1), [b, g] = O(!1), [L, $] = O(!1), [z, k] = O(!1), [M, m] = O(!1), [N, w] = O(!1), [D, K] = O(!1), [F, V] = O(!1), [Z, E] = O(null), [J, q] = O(!1), [A, R] = O({
6012
+ const { baseUrl: a, apiKey: l, appId: h } = ve(), [c, u] = O(t), [y, T] = O(!0), [S, d] = O(!1), [b, g] = O(!1), [L, $] = O(!1), [A, k] = O(!1), [M, m] = O(!1), [N, w] = O(!1), [D, K] = O(!1), [F, V] = O(!1), [Z, E] = O(null), [J, q] = O(!1), [z, R] = O({
6028
6013
  email: "",
6029
6014
  otp: "",
6030
6015
  appId: h
@@ -6047,7 +6032,7 @@ const $s = [
6047
6032
  };
6048
6033
  }, [D]);
6049
6034
  const j = async () => {
6050
- if (!A.email || !/\S+@\S+\.\S+/.test(A.email)) {
6035
+ if (!z.email || !/\S+@\S+\.\S+/.test(z.email)) {
6051
6036
  P("error", "Please enter a valid email");
6052
6037
  return;
6053
6038
  }
@@ -6055,7 +6040,7 @@ const $s = [
6055
6040
  _(!0);
6056
6041
  const v = await B.post(
6057
6042
  `${a}/users/send-verify-otp/${c?.id}`,
6058
- { email: A.email },
6043
+ { email: z.email },
6059
6044
  {
6060
6045
  headers: { "x-api-key": l, "x-app-id": h }
6061
6046
  }
@@ -6067,7 +6052,7 @@ const $s = [
6067
6052
  _(!1);
6068
6053
  }
6069
6054
  }, X = async (v) => {
6070
- if (v.preventDefault(), !A.email || !A.otp) {
6055
+ if (v.preventDefault(), !z.email || !z.otp) {
6071
6056
  P("error", "Please fill in all fields");
6072
6057
  return;
6073
6058
  }
@@ -6075,7 +6060,7 @@ const $s = [
6075
6060
  _(!0);
6076
6061
  const H = await B.post(
6077
6062
  `${a}/users/verify-email`,
6078
- A
6063
+ z
6079
6064
  );
6080
6065
  if (H.data.success) {
6081
6066
  if (P("success", H.data.message || "Email verified!"), c) {
@@ -7095,7 +7080,7 @@ const $s = [
7095
7080
  apiKey: l,
7096
7081
  appId: h,
7097
7082
  userId: c.id,
7098
- isOpen: z,
7083
+ isOpen: A,
7099
7084
  onClose: () => k(!1),
7100
7085
  onSuccess: (v) => P("success", v),
7101
7086
  onError: (v) => P("error", v),
@@ -7126,7 +7111,7 @@ const $s = [
7126
7111
  },
7127
7112
  onVerify: X,
7128
7113
  onSendOTP: j,
7129
- verifyFormData: A,
7114
+ verifyFormData: z,
7130
7115
  setVerifyFormData: R,
7131
7116
  otpSent: Y,
7132
7117
  verifying: C,
@@ -7247,7 +7232,7 @@ const $s = [
7247
7232
  viewProfileLabel: S = "View Profile",
7248
7233
  logoutLabel: d = "Sign Out"
7249
7234
  }) => {
7250
- const { baseUrl: b, apiKey: g, appId: L } = ve(), [$, z] = O(!1), [k, M] = O(null), [m, N] = O(!0), [w, D] = O(null), K = dt(null), F = dt(null), [V, Z] = O(!1), [E, J] = O(!1);
7235
+ const { baseUrl: b, apiKey: g, appId: L } = ve(), [$, A] = O(!1), [k, M] = O(null), [m, N] = O(!0), [w, D] = O(null), K = dt(null), F = dt(null), [V, Z] = O(!1), [E, J] = O(!1);
7251
7236
  ie(() => {
7252
7237
  const x = () => {
7253
7238
  J(window.innerWidth < 768);
@@ -7308,17 +7293,17 @@ const $s = [
7308
7293
  return x(), window.addEventListener("resize", x), () => window.removeEventListener("resize", x);
7309
7294
  }, [$]), ie(() => {
7310
7295
  const x = (ne) => {
7311
- K.current && !K.current.contains(ne.target) && !F.current?.contains(ne.target) && z(!1);
7296
+ K.current && !K.current.contains(ne.target) && !F.current?.contains(ne.target) && A(!1);
7312
7297
  }, j = (ne) => {
7313
- ne.key === "Escape" && z(!1);
7298
+ ne.key === "Escape" && A(!1);
7314
7299
  }, X = () => {
7315
- $ && z(!1);
7300
+ $ && A(!1);
7316
7301
  };
7317
7302
  return $ && (document.addEventListener("mousedown", x), document.addEventListener("keydown", j), window.addEventListener("scroll", X, { passive: !0 })), () => {
7318
7303
  document.removeEventListener("mousedown", x), document.removeEventListener("keydown", j), window.removeEventListener("scroll", X);
7319
7304
  };
7320
7305
  }, [$]);
7321
- const A = e ? {
7306
+ const z = e ? {
7322
7307
  surface: "#000000",
7323
7308
  surfaceElevated: "#000000",
7324
7309
  surfaceHover: "#262626",
@@ -7353,7 +7338,7 @@ const $s = [
7353
7338
  gap: E ? "6px" : "8px",
7354
7339
  padding: E ? "6px 10px 6px 6px" : "8px 12px 8px 8px",
7355
7340
  borderRadius: "24px",
7356
- backgroundColor: A.surface,
7341
+ backgroundColor: z.surface,
7357
7342
  cursor: "pointer",
7358
7343
  transition: "all 0.2s cubic-bezier(0.4, 0, 0.2, 1)",
7359
7344
  minWidth: E ? "auto" : "140px",
@@ -7365,7 +7350,7 @@ const $s = [
7365
7350
  height: E ? "28px" : "32px",
7366
7351
  borderRadius: "50%",
7367
7352
  objectFit: "cover",
7368
- border: `2px solid ${A.borderLight}`,
7353
+ border: `2px solid ${z.borderLight}`,
7369
7354
  flexShrink: 0
7370
7355
  },
7371
7356
  userInfo: {
@@ -7379,7 +7364,7 @@ const $s = [
7379
7364
  userName: {
7380
7365
  fontSize: E ? "13px" : "14px",
7381
7366
  fontWeight: 600,
7382
- color: A.textPrimary,
7367
+ color: z.textPrimary,
7383
7368
  lineHeight: "1.2",
7384
7369
  whiteSpace: "nowrap",
7385
7370
  overflow: "hidden",
@@ -7388,7 +7373,7 @@ const $s = [
7388
7373
  },
7389
7374
  userEmail: {
7390
7375
  fontSize: E ? "11px" : "12px",
7391
- color: A.textTertiary,
7376
+ color: z.textTertiary,
7392
7377
  lineHeight: "1.2",
7393
7378
  whiteSpace: "nowrap",
7394
7379
  overflow: "hidden",
@@ -7398,7 +7383,7 @@ const $s = [
7398
7383
  chevron: {
7399
7384
  transition: "transform 0.2s ease",
7400
7385
  transform: $ ? "rotate(180deg)" : "rotate(0deg)",
7401
- color: A.textTertiary,
7386
+ color: z.textTertiary,
7402
7387
  flexShrink: 0
7403
7388
  },
7404
7389
  dropdown: {
@@ -7406,8 +7391,8 @@ const $s = [
7406
7391
  top: "100%",
7407
7392
  marginTop: "8px",
7408
7393
  [V ? "left" : "right"]: "0",
7409
- backgroundColor: A.surfaceElevated,
7410
- border: `1px solid ${A.border}`,
7394
+ backgroundColor: z.surfaceElevated,
7395
+ border: `1px solid ${z.border}`,
7411
7396
  borderRadius: "12px",
7412
7397
  boxShadow: "0 20px 40px rgba(0,0,0,0.15), 0 4px 12px rgba(0,0,0,0.1)",
7413
7398
  width: "min(280px, 90vw)",
@@ -7438,7 +7423,7 @@ const $s = [
7438
7423
  height: E ? "40px" : "48px",
7439
7424
  borderRadius: "50%",
7440
7425
  objectFit: "cover",
7441
- border: `2px solid ${A.borderLight}`,
7426
+ border: `2px solid ${z.borderLight}`,
7442
7427
  flexShrink: 0
7443
7428
  },
7444
7429
  dropdownUserInfo: {
@@ -7450,7 +7435,7 @@ const $s = [
7450
7435
  dropdownUserName: {
7451
7436
  fontSize: E ? "15px" : "16px",
7452
7437
  fontWeight: 600,
7453
- color: A.textPrimary,
7438
+ color: z.textPrimary,
7454
7439
  lineHeight: "1.2",
7455
7440
  marginBottom: "2px",
7456
7441
  overflow: "hidden",
@@ -7458,7 +7443,7 @@ const $s = [
7458
7443
  },
7459
7444
  dropdownUserEmail: {
7460
7445
  fontSize: E ? "13px" : "14px",
7461
- color: A.textSecondary,
7446
+ color: z.textSecondary,
7462
7447
  lineHeight: "1.2",
7463
7448
  overflow: "hidden",
7464
7449
  textOverflow: "ellipsis"
@@ -7471,7 +7456,7 @@ const $s = [
7471
7456
  borderRadius: "8px",
7472
7457
  cursor: "pointer",
7473
7458
  transition: "all 0.15s ease",
7474
- color: A.textPrimary,
7459
+ color: z.textPrimary,
7475
7460
  textDecoration: "none",
7476
7461
  border: "none",
7477
7462
  background: "none",
@@ -7486,7 +7471,7 @@ const $s = [
7486
7471
  icon: {
7487
7472
  width: E ? "16px" : "18px",
7488
7473
  height: E ? "16px" : "18px",
7489
- color: A.textSecondary,
7474
+ color: z.textSecondary,
7490
7475
  flexShrink: 0
7491
7476
  },
7492
7477
  logoutButton: {
@@ -7501,20 +7486,20 @@ const $s = [
7501
7486
  border: "none",
7502
7487
  width: "100%",
7503
7488
  fontSize: E ? "13px" : "14px",
7504
- color: A.error,
7489
+ color: z.error,
7505
7490
  textAlign: "left",
7506
7491
  outline: "none"
7507
7492
  },
7508
7493
  loadingText: {
7509
7494
  padding: E ? "16px 12px" : "20px 16px",
7510
7495
  textAlign: "center",
7511
- color: A.textSecondary,
7496
+ color: z.textSecondary,
7512
7497
  fontSize: E ? "13px" : "14px"
7513
7498
  },
7514
7499
  errorState: {
7515
7500
  padding: E ? "16px 12px" : "20px 16px",
7516
7501
  textAlign: "center",
7517
- color: A.textSecondary,
7502
+ color: z.textSecondary,
7518
7503
  fontSize: E ? "13px" : "14px",
7519
7504
  display: "flex",
7520
7505
  alignItems: "center",
@@ -7525,7 +7510,7 @@ const $s = [
7525
7510
  retryButton: {
7526
7511
  marginTop: "8px",
7527
7512
  padding: "8px 16px",
7528
- backgroundColor: A.accent,
7513
+ backgroundColor: z.accent,
7529
7514
  color: "#ffffff",
7530
7515
  border: "none",
7531
7516
  borderRadius: "6px",
@@ -7566,8 +7551,8 @@ const $s = [
7566
7551
  "div",
7567
7552
  {
7568
7553
  ref: F,
7569
- onClick: () => z((x) => !x),
7570
- onKeyDown: (x) => f(x, () => z((j) => !j)),
7554
+ onClick: () => A((x) => !x),
7555
+ onKeyDown: (x) => f(x, () => A((j) => !j)),
7571
7556
  tabIndex: 0,
7572
7557
  role: "button",
7573
7558
  "aria-haspopup": "true",
@@ -7583,7 +7568,7 @@ const $s = [
7583
7568
  height: E ? "34px" : "40px",
7584
7569
  borderRadius: "50%",
7585
7570
  objectFit: "cover",
7586
- border: `2px solid ${A.borderLight}`,
7571
+ border: `2px solid ${z.borderLight}`,
7587
7572
  flexShrink: 0
7588
7573
  },
7589
7574
  loading: "lazy",
@@ -7606,7 +7591,7 @@ const $s = [
7606
7591
  height: E ? "34px" : "40px",
7607
7592
  borderRadius: "50%",
7608
7593
  objectFit: "cover",
7609
- border: `2px solid ${A.borderLight}`,
7594
+ border: `2px solid ${z.borderLight}`,
7610
7595
  flexShrink: 0
7611
7596
  },
7612
7597
  loading: "lazy"
@@ -7618,18 +7603,18 @@ const $s = [
7618
7603
  {
7619
7604
  ref: F,
7620
7605
  style: R.avatarButton,
7621
- onClick: () => z((x) => !x),
7622
- onKeyDown: (x) => f(x, () => z((j) => !j)),
7606
+ onClick: () => A((x) => !x),
7607
+ onKeyDown: (x) => f(x, () => A((j) => !j)),
7623
7608
  tabIndex: 0,
7624
7609
  role: "button",
7625
7610
  "aria-haspopup": "true",
7626
7611
  "aria-expanded": $,
7627
7612
  "aria-label": "Toggle user menu",
7628
7613
  onMouseOver: (x) => {
7629
- x.currentTarget.style.backgroundColor = A.surfaceHover, x.currentTarget.style.boxShadow = "0 4px 12px rgba(0,0,0,0.15)";
7614
+ x.currentTarget.style.backgroundColor = z.surfaceHover, x.currentTarget.style.boxShadow = "0 4px 12px rgba(0,0,0,0.15)";
7630
7615
  },
7631
7616
  onMouseOut: (x) => {
7632
- x.currentTarget.style.backgroundColor = A.surface, x.currentTarget.style.boxShadow = "none";
7617
+ x.currentTarget.style.backgroundColor = z.surface, x.currentTarget.style.boxShadow = "none";
7633
7618
  },
7634
7619
  onBlur: (x) => {
7635
7620
  x.currentTarget.style.outline = "none";
@@ -7706,7 +7691,7 @@ const $s = [
7706
7691
  style: R.menuItem,
7707
7692
  onClick: _,
7708
7693
  onMouseOver: (x) => {
7709
- x.currentTarget.style.backgroundColor = A.surfaceHover;
7694
+ x.currentTarget.style.backgroundColor = z.surfaceHover;
7710
7695
  },
7711
7696
  onMouseOut: (x) => {
7712
7697
  x.currentTarget.style.backgroundColor = "transparent";
@@ -7726,7 +7711,7 @@ const $s = [
7726
7711
  style: R.menuItem,
7727
7712
  onClick: P,
7728
7713
  onMouseOver: (x) => {
7729
- x.currentTarget.style.backgroundColor = A.surfaceHover;
7714
+ x.currentTarget.style.backgroundColor = z.surfaceHover;
7730
7715
  },
7731
7716
  onMouseOut: (x) => {
7732
7717
  x.currentTarget.style.backgroundColor = "transparent";
@@ -7748,7 +7733,7 @@ const $s = [
7748
7733
  rel: "noopener noreferrer",
7749
7734
  style: R.menuItem,
7750
7735
  onMouseOver: (x) => {
7751
- x.currentTarget.style.backgroundColor = A.surfaceHover;
7736
+ x.currentTarget.style.backgroundColor = z.surfaceHover;
7752
7737
  },
7753
7738
  onMouseOut: (x) => {
7754
7739
  x.currentTarget.style.backgroundColor = "transparent";
@@ -7768,7 +7753,7 @@ const $s = [
7768
7753
  style: R.logoutButton,
7769
7754
  onClick: r,
7770
7755
  onMouseOver: (x) => {
7771
- x.currentTarget.style.backgroundColor = A.surfaceHover;
7756
+ x.currentTarget.style.backgroundColor = z.surfaceHover;
7772
7757
  },
7773
7758
  onMouseOut: (x) => {
7774
7759
  x.currentTarget.style.backgroundColor = "transparent";
@@ -7780,7 +7765,7 @@ const $s = [
7780
7765
  /* @__PURE__ */ n.jsx(
7781
7766
  ct,
7782
7767
  {
7783
- style: { ...R.icon, color: A.error },
7768
+ style: { ...R.icon, color: z.error },
7784
7769
  "aria-hidden": "true"
7785
7770
  }
7786
7771
  ),
@@ -7805,10 +7790,10 @@ const $s = [
7805
7790
  style: R.retryButton,
7806
7791
  onClick: Y,
7807
7792
  onMouseOver: (x) => {
7808
- x.currentTarget.style.backgroundColor = A.accentHover;
7793
+ x.currentTarget.style.backgroundColor = z.accentHover;
7809
7794
  },
7810
7795
  onMouseOut: (x) => {
7811
- x.currentTarget.style.backgroundColor = A.accent;
7796
+ x.currentTarget.style.backgroundColor = z.accent;
7812
7797
  },
7813
7798
  children: "Try Again"
7814
7799
  }
@@ -3,7 +3,7 @@
3
3
  `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...r){const s=new this(t);return r.forEach(o=>s.set(o)),s}static accessor(t){const s=(this[Rt]=this[Rt]={accessors:{}}).accessors,o=this.prototype;function i(a){const l=Te(a);s[l]||(ln(o,a),s[l]=!0)}return p.isArray(t)?t.forEach(i):i(t),this}};ne.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),p.reduceDescriptors(ne.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(s){this[r]=s}}}),p.freezeMethods(ne);function Ge(e,t){const r=this||Ce,s=t||r,o=ne.from(s.headers);let i=s.data;return p.forEach(e,function(l){i=l.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function It(e){return!!(e&&e.__CANCEL__)}function we(e,t,r){U.call(this,e??"canceled",U.ERR_CANCELED,t,r),this.name="CanceledError"}p.inherits(we,U,{__CANCEL__:!0});function Pt(e,t,r){const s=r.config.validateStatus;!r.status||!s||s(r.status)?e(r):t(new U("Request failed with status code "+r.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}function cn(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function dn(e,t){e=e||10;const r=new Array(e),s=new Array(e);let o=0,i=0,a;return t=t!==void 0?t:1e3,function(h){const c=Date.now(),u=s[i];a||(a=c),r[o]=h,s[o]=c;let y=i,R=0;for(;y!==o;)R+=r[y++],y=y%e;if(o=(o+1)%e,o===i&&(i=(i+1)%e),c-a<t)return;const k=u&&c-u;return k?Math.round(R*1e3/k):void 0}}function un(e,t){let r=0,s=1e3/t,o,i;const a=(c,u=Date.now())=>{r=u,o=null,i&&(clearTimeout(i),i=null),e(...c)};return[(...c)=>{const u=Date.now(),y=u-r;y>=s?a(c,u):(o=c,i||(i=setTimeout(()=>{i=null,a(o)},s-y)))},()=>o&&a(o)]}const De=(e,t,r=3)=>{let s=0;const o=dn(50,250);return un(i=>{const a=i.loaded,l=i.lengthComputable?i.total:void 0,h=a-s,c=o(h),u=a<=l;s=a;const y={loaded:a,total:l,progress:l?a/l:void 0,bytes:h,rate:c||void 0,estimated:c&&l&&u?(l-a)/c:void 0,event:i,lengthComputable:l!=null,[t?"download":"upload"]:!0};e(y)},r)},Ot=(e,t)=>{const r=e!=null;return[s=>t[0]({lengthComputable:r,total:e,loaded:s}),t[1]]},_t=e=>(...t)=>p.asap(()=>e(...t)),pn=ee.hasStandardBrowserEnv?((e,t)=>r=>(r=new URL(r,ee.origin),e.protocol===r.protocol&&e.host===r.host&&(t||e.port===r.port)))(new URL(ee.origin),ee.navigator&&/(msie|trident)/i.test(ee.navigator.userAgent)):()=>!0,fn=ee.hasStandardBrowserEnv?{write(e,t,r,s,o,i){const a=[e+"="+encodeURIComponent(t)];p.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),p.isString(s)&&a.push("path="+s),p.isString(o)&&a.push("domain="+o),i===!0&&a.push("secure"),document.cookie=a.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function xn(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function hn(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function At(e,t,r){let s=!xn(t);return e&&(s||r==!1)?hn(e,t):t}const zt=e=>e instanceof ne?{...e}:e;function pe(e,t){t=t||{};const r={};function s(c,u,y,R){return p.isPlainObject(c)&&p.isPlainObject(u)?p.merge.call({caseless:R},c,u):p.isPlainObject(u)?p.merge({},u):p.isArray(u)?u.slice():u}function o(c,u,y,R){if(p.isUndefined(u)){if(!p.isUndefined(c))return s(void 0,c,y,R)}else return s(c,u,y,R)}function i(c,u){if(!p.isUndefined(u))return s(void 0,u)}function a(c,u){if(p.isUndefined(u)){if(!p.isUndefined(c))return s(void 0,c)}else return s(void 0,u)}function l(c,u,y){if(y in t)return s(c,u);if(y in e)return s(void 0,c)}const h={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:l,headers:(c,u,y)=>o(zt(c),zt(u),y,!0)};return p.forEach(Object.keys({...e,...t}),function(u){const y=h[u]||o,R=y(e[u],t[u],u);p.isUndefined(R)&&y!==l||(r[u]=R)}),r}const Nt=e=>{const t=pe({},e);let{data:r,withXSRFToken:s,xsrfHeaderName:o,xsrfCookieName:i,headers:a,auth:l}=t;if(t.headers=a=ne.from(a),t.url=kt(At(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),p.isFormData(r)){if(ee.hasStandardBrowserEnv||ee.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(p.isFunction(r.getHeaders)){const h=r.getHeaders(),c=["content-type","content-length"];Object.entries(h).forEach(([u,y])=>{c.includes(u.toLowerCase())&&a.set(u,y)})}}if(ee.hasStandardBrowserEnv&&(s&&p.isFunction(s)&&(s=s(t)),s||s!==!1&&pn(t.url))){const h=o&&i&&fn.read(i);h&&a.set(o,h)}return t},gn=typeof XMLHttpRequest<"u"&&function(e){return new Promise(function(r,s){const o=Nt(e);let i=o.data;const a=ne.from(o.headers).normalize();let{responseType:l,onUploadProgress:h,onDownloadProgress:c}=o,u,y,R,k,d;function b(){k&&k(),d&&d(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let g=new XMLHttpRequest;g.open(o.method.toUpperCase(),o.url,!0),g.timeout=o.timeout;function M(){if(!g)return;const _=ne.from("getAllResponseHeaders"in g&&g.getAllResponseHeaders()),B={data:!l||l==="text"||l==="json"?g.responseText:g.response,status:g.status,statusText:g.statusText,headers:_,config:e,request:g};Pt(function(N){r(N),b()},function(N){s(N),b()},B),g=null}"onloadend"in g?g.onloadend=M:g.onreadystatechange=function(){!g||g.readyState!==4||g.status===0&&!(g.responseURL&&g.responseURL.indexOf("file:")===0)||setTimeout(M)},g.onabort=function(){g&&(s(new U("Request aborted",U.ECONNABORTED,e,g)),g=null)},g.onerror=function(E){const B=E&&E.message?E.message:"Network Error",m=new U(B,U.ERR_NETWORK,e,g);m.event=E||null,s(m),g=null},g.ontimeout=function(){let E=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const B=o.transitional||Ct;o.timeoutErrorMessage&&(E=o.timeoutErrorMessage),s(new U(E,B.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,g)),g=null},i===void 0&&a.setContentType(null),"setRequestHeader"in g&&p.forEach(a.toJSON(),function(E,B){g.setRequestHeader(B,E)}),p.isUndefined(o.withCredentials)||(g.withCredentials=!!o.withCredentials),l&&l!=="json"&&(g.responseType=o.responseType),c&&([R,d]=De(c,!0),g.addEventListener("progress",R)),h&&g.upload&&([y,k]=De(h),g.upload.addEventListener("progress",y),g.upload.addEventListener("loadend",k)),(o.cancelToken||o.signal)&&(u=_=>{g&&(s(!_||_.type?new we(null,e,g):_),g.abort(),g=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const D=cn(o.url);if(D&&ee.protocols.indexOf(D)===-1){s(new U("Unsupported protocol "+D+":",U.ERR_BAD_REQUEST,e));return}g.send(i||null)})},mn=(e,t)=>{const{length:r}=e=e?e.filter(Boolean):[];if(t||r){let s=new AbortController,o;const i=function(c){if(!o){o=!0,l();const u=c instanceof Error?c:this.reason;s.abort(u instanceof U?u:new we(u instanceof Error?u.message:u))}};let a=t&&setTimeout(()=>{a=null,i(new U(`timeout ${t} of ms exceeded`,U.ETIMEDOUT))},t);const l=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(c=>{c.unsubscribe?c.unsubscribe(i):c.removeEventListener("abort",i)}),e=null)};e.forEach(c=>c.addEventListener("abort",i));const{signal:h}=s;return h.unsubscribe=()=>p.asap(l),h}},yn=function*(e,t){let r=e.byteLength;if(r<t){yield e;return}let s=0,o;for(;s<r;)o=s+t,yield e.slice(s,o),s=o},bn=async function*(e,t){for await(const r of wn(e))yield*yn(r,t)},wn=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:r,value:s}=await t.read();if(r)break;yield s}}finally{await t.cancel()}},Ut=(e,t,r,s)=>{const o=bn(e,t);let i=0,a,l=h=>{a||(a=!0,s&&s(h))};return new ReadableStream({async pull(h){try{const{done:c,value:u}=await o.next();if(c){l(),h.close();return}let y=u.byteLength;if(r){let R=i+=y;r(R)}h.enqueue(new Uint8Array(u))}catch(c){throw l(c),c}},cancel(h){return l(h),o.return()}},{highWaterMark:2})},Dt=64*1024,{isFunction:Fe}=p,Sn=(({Request:e,Response:t})=>({Request:e,Response:t}))(p.global),{ReadableStream:Ft,TextEncoder:Lt}=p.global,Mt=(e,...t)=>{try{return!!e(...t)}catch{return!1}},jn=e=>{e=p.merge.call({skipUndefined:!0},Sn,e);const{fetch:t,Request:r,Response:s}=e,o=t?Fe(t):typeof fetch=="function",i=Fe(r),a=Fe(s);if(!o)return!1;const l=o&&Fe(Ft),h=o&&(typeof Lt=="function"?(d=>b=>d.encode(b))(new Lt):async d=>new Uint8Array(await new r(d).arrayBuffer())),c=i&&l&&Mt(()=>{let d=!1;const b=new r(ee.origin,{body:new Ft,method:"POST",get duplex(){return d=!0,"half"}}).headers.has("Content-Type");return d&&!b}),u=a&&l&&Mt(()=>p.isReadableStream(new s("").body)),y={stream:u&&(d=>d.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(d=>{!y[d]&&(y[d]=(b,g)=>{let M=b&&b[d];if(M)return M.call(b);throw new U(`Response type '${d}' is not supported`,U.ERR_NOT_SUPPORT,g)})});const R=async d=>{if(d==null)return 0;if(p.isBlob(d))return d.size;if(p.isSpecCompliantForm(d))return(await new r(ee.origin,{method:"POST",body:d}).arrayBuffer()).byteLength;if(p.isArrayBufferView(d)||p.isArrayBuffer(d))return d.byteLength;if(p.isURLSearchParams(d)&&(d=d+""),p.isString(d))return(await h(d)).byteLength},k=async(d,b)=>{const g=p.toFiniteNumber(d.getContentLength());return g??R(b)};return async d=>{let{url:b,method:g,data:M,signal:D,cancelToken:_,timeout:E,onDownloadProgress:B,onUploadProgress:m,responseType:N,headers:w,withCredentials:F="same-origin",fetchOptions:K}=Nt(d),L=t||fetch;N=N?(N+"").toLowerCase():"text";let Y=mn([D,_&&_.toAbortSignal()],E),Z=null;const C=Y&&Y.unsubscribe&&(()=>{Y.unsubscribe()});let J;try{if(m&&c&&g!=="get"&&g!=="head"&&(J=await k(w,M))!==0){let T=new r(b,{method:"POST",body:M,duplex:"half"}),z;if(p.isFormData(M)&&(z=T.headers.get("content-type"))&&w.setContentType(z),T.body){const[O,x]=Ot(J,De(_t(m)));M=Ut(T.body,Dt,O,x)}}p.isString(F)||(F=F?"include":"omit");const H=i&&"credentials"in r.prototype,A={...K,signal:Y,method:g.toUpperCase(),headers:w.normalize().toJSON(),body:M,duplex:"half",credentials:H?F:void 0};Z=i&&new r(b,A);let I=await(i?L(Z,K):L(b,A));const q=u&&(N==="stream"||N==="response");if(u&&(B||q&&C)){const T={};["status","statusText","headers"].forEach(j=>{T[j]=I[j]});const z=p.toFiniteNumber(I.headers.get("content-length")),[O,x]=B&&Ot(z,De(_t(B),!0))||[];I=new s(Ut(I.body,Dt,O,()=>{x&&x(),C&&C()}),T)}N=N||"text";let f=await y[p.findKey(y,N)||"text"](I,d);return!q&&C&&C(),await new Promise((T,z)=>{Pt(T,z,{data:f,headers:ne.from(I.headers),status:I.status,statusText:I.statusText,config:d,request:Z})})}catch(H){throw C&&C(),H&&H.name==="TypeError"&&/Load failed|fetch/i.test(H.message)?Object.assign(new U("Network Error",U.ERR_NETWORK,d,Z),{cause:H.cause||H}):U.from(H,H&&H.code,d,Z)}}},vn=new Map,Bt=e=>{let t=e?e.env:{};const{fetch:r,Request:s,Response:o}=t,i=[s,o,r];let a=i.length,l=a,h,c,u=vn;for(;l--;)h=i[l],c=u.get(h),c===void 0&&u.set(h,c=l?new Map:jn(t)),u=c;return c};Bt();const Ze={http:Hr,xhr:gn,fetch:{get:Bt}};p.forEach(Ze,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Wt=e=>`- ${e}`,kn=e=>p.isFunction(e)||e===null||e===!1,$t={getAdapter:(e,t)=>{e=p.isArray(e)?e:[e];const{length:r}=e;let s,o;const i={};for(let a=0;a<r;a++){s=e[a];let l;if(o=s,!kn(s)&&(o=Ze[(l=String(s)).toLowerCase()],o===void 0))throw new U(`Unknown adapter '${l}'`);if(o&&(p.isFunction(o)||(o=o.get(t))))break;i[l||"#"+a]=o}if(!o){const a=Object.entries(i).map(([h,c])=>`adapter ${h} `+(c===!1?"is not supported by the environment":"is not available in the build"));let l=r?a.length>1?`since :
4
4
  `+a.map(Wt).join(`
5
5
  `):" "+Wt(a[0]):"as no adapter specified";throw new U("There is no suitable adapter to dispatch the request "+l,"ERR_NOT_SUPPORT")}return o},adapters:Ze};function Qe(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new we(null,e)}function Ht(e){return Qe(e),e.headers=ne.from(e.headers),e.data=Ge.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),$t.getAdapter(e.adapter||Ce.adapter,e)(e).then(function(s){return Qe(e),s.data=Ge.call(e,e.transformResponse,s),s.headers=ne.from(s.headers),s},function(s){return It(s)||(Qe(e),s&&s.response&&(s.response.data=Ge.call(e,e.transformResponse,s.response),s.response.headers=ne.from(s.response.headers))),Promise.reject(s)})}const Vt="1.12.2",Le={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Le[e]=function(s){return typeof s===e||"a"+(t<1?"n ":" ")+e}});const Yt={};Le.transitional=function(t,r,s){function o(i,a){return"[Axios v"+Vt+"] Transitional option '"+i+"'"+a+(s?". "+s:"")}return(i,a,l)=>{if(t===!1)throw new U(o(a," has been removed"+(r?" in "+r:"")),U.ERR_DEPRECATED);return r&&!Yt[a]&&(Yt[a]=!0,console.warn(o(a," has been deprecated since v"+r+" and will be removed in the near future"))),t?t(i,a,l):!0}},Le.spelling=function(t){return(r,s)=>(console.warn(`${s} is likely a misspelling of ${t}`),!0)};function En(e,t,r){if(typeof e!="object")throw new U("options must be an object",U.ERR_BAD_OPTION_VALUE);const s=Object.keys(e);let o=s.length;for(;o-- >0;){const i=s[o],a=t[i];if(a){const l=e[i],h=l===void 0||a(l,i,e);if(h!==!0)throw new U("option "+i+" must be "+h,U.ERR_BAD_OPTION_VALUE);continue}if(r!==!0)throw new U("Unknown option "+i,U.ERR_BAD_OPTION)}}const Me={assertOptions:En,validators:Le},ie=Me.validators;let fe=class{constructor(t){this.defaults=t||{},this.interceptors={request:new Et,response:new Et}}async request(t,r){try{return await this._request(t,r)}catch(s){if(s instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;const i=o.stack?o.stack.replace(/^.+\n/,""):"";try{s.stack?i&&!String(s.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(s.stack+=`
6
- `+i):s.stack=i}catch{}}throw s}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=pe(this.defaults,r);const{transitional:s,paramsSerializer:o,headers:i}=r;s!==void 0&&Me.assertOptions(s,{silentJSONParsing:ie.transitional(ie.boolean),forcedJSONParsing:ie.transitional(ie.boolean),clarifyTimeoutError:ie.transitional(ie.boolean)},!1),o!=null&&(p.isFunction(o)?r.paramsSerializer={serialize:o}:Me.assertOptions(o,{encode:ie.function,serialize:ie.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Me.assertOptions(r,{baseUrl:ie.spelling("baseURL"),withXsrfToken:ie.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=i&&p.merge(i.common,i[r.method]);i&&p.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),r.headers=ne.concat(a,i);const l=[];let h=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(r)===!1||(h=h&&b.synchronous,l.unshift(b.fulfilled,b.rejected))});const c=[];this.interceptors.response.forEach(function(b){c.push(b.fulfilled,b.rejected)});let u,y=0,R;if(!h){const d=[Ht.bind(this),void 0];for(d.unshift(...l),d.push(...c),R=d.length,u=Promise.resolve(r);y<R;)u=u.then(d[y++],d[y++]);return u}R=l.length;let k=r;for(;y<R;){const d=l[y++],b=l[y++];try{k=d(k)}catch(g){b.call(this,g);break}}try{u=Ht.call(this,k)}catch(d){return Promise.reject(d)}for(y=0,R=c.length;y<R;)u=u.then(c[y++],c[y++]);return u}getUri(t){t=pe(this.defaults,t);const r=At(t.baseURL,t.url,t.allowAbsoluteUrls);return kt(r,t.params,t.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(t){fe.prototype[t]=function(r,s){return this.request(pe(s||{},{method:t,url:r,data:(s||{}).data}))}}),p.forEach(["post","put","patch"],function(t){function r(s){return function(i,a,l){return this.request(pe(l||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}fe.prototype[t]=r(),fe.prototype[t+"Form"]=r(!0)});let Cn=class or{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const s=this;this.promise.then(o=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](o);s._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(l=>{s.subscribe(l),i=l}).then(o);return a.cancel=function(){s.unsubscribe(i)},a},t(function(i,a,l){s.reason||(s.reason=new we(i,a,l),r(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=s=>{t.abort(s)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new or(function(o){t=o}),cancel:t}}};function Tn(e){return function(r){return e.apply(null,r)}}function Rn(e){return p.isObject(e)&&e.isAxiosError===!0}const et={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(et).forEach(([e,t])=>{et[t]=e});function qt(e){const t=new fe(e),r=ct(fe.prototype.request,t);return p.extend(r,fe.prototype,t,{allOwnKeys:!0}),p.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return qt(pe(e,o))},r}const W=qt(Ce);W.Axios=fe,W.CanceledError=we,W.CancelToken=Cn,W.isCancel=It,W.VERSION=Vt,W.toFormData=Ne,W.AxiosError=U,W.Cancel=W.CanceledError,W.all=function(t){return Promise.all(t)},W.spread=Tn,W.isAxiosError=Rn,W.mergeConfig=pe,W.AxiosHeaders=ne,W.formToJSON=e=>Tt(p.isHTMLForm(e)?new FormData(e):e),W.getAdapter=$t.getAdapter,W.HttpStatusCode=et,W.default=W;const{Axios:ms,AxiosError:ys,CanceledError:bs,isCancel:ws,CancelToken:Ss,VERSION:js,all:vs,Cancel:ks,isAxiosError:Es,spread:Cs,toFormData:Ts,AxiosHeaders:Rs,HttpStatusCode:Is,formToJSON:Ps,getAdapter:Os,mergeConfig:_s}=W;class In{baseUrl;apiKey;appId;client;constructor(t){if(!t||!t.baseUrl)throw new Error("NeuctraAuthixClient: 'baseUrl' is required in config");this.baseUrl=t.baseUrl.replace(/\/$/,""),this.apiKey=t.apiKey||null,this.appId=t.appId||null,this.client=W.create({baseURL:this.baseUrl,headers:{"Content-Type":"application/json",...this.apiKey?{"x-api-key":this.apiKey}:{}},timeout:1e4})}async request(t,r,s,o={}){if(!t)return{success:!1,message:"HTTP method is required"};if(!r)return{success:!1,message:"Request path is required"};try{const i={...this.appId?{appId:this.appId}:{},...s||{}};return{success:!0,data:(await this.client.request({url:r,method:t,data:i,headers:o})).data,message:"✅ Request completed successfully"}}catch(i){if(console.error("❌ [Request Error]:",i),i.isAxiosError&&!i.response)return{success:!1,message:`🌐 Network error: ${i.message}`};if(i.response){const a=i.response.status,l=i.response.data?.message||i.response.statusText||"Server returned an error";return{success:!1,message:`⚠️ Request failed (${a}): ${l}`}}return{success:!1,message:`🚨 Unexpected error: ${i.message||"Something went wrong"}`}}}async signup(t){const{name:r,email:s,password:o}=t;if(!r||!s||!o)throw new Error("signup: 'name', 'email', and 'password' are required");return this.request("POST","/users/signup",t)}async login(t){const{email:r,password:s,appId:o}=t;if(!r||!s)throw new Error("login: 'email' and 'password' are required");return this.request("POST","/users/login",{email:r,password:s,appId:o||this.appId})}async updateUser(t){const{userId:r,appId:s}=t;if(!r)throw new Error("updateUser: 'userId' is required");return this.request("PUT",`/users/update/${r}`,{...t,appId:s||this.appId})}async changePassword(t){const{userId:r,currentPassword:s,newPassword:o,appId:i}=t;if(!r)throw new Error("changePassword: 'userId' is required");if(!s||!o)throw new Error("changePassword: both 'currentPassword' and 'newPassword' are required");return this.request("PUT",`/users/change-password/${r}`,{currentPassword:s,newPassword:o,appId:i||this.appId})}async deleteUser(t){const{userId:r,appId:s}=t;if(!r)throw new Error("deleteUser: 'userId' is required");return this.request("DELETE",`/users/delete/${r}`,{appId:s||this.appId})}async getProfile(t){const{token:r}=t;if(!r)throw new Error("getProfile: 'token' is required");return this.request("GET","/users/profile",{},{Authorization:`Bearer ${r}`})}async sendVerifyOTP(t){const{token:r,appId:s}=t;if(!r)throw new Error("sendVerifyOTP: 'token' is required");return this.request("POST","/users/send-verify-otp",{appId:s||this.appId},{Authorization:`Bearer ${r}`})}async verifyEmail(t){const{token:r,otp:s,appId:o}=t;if(!r)throw new Error("verifyEmail: 'token' is required");if(!s)throw new Error("verifyEmail: 'otp' is required");return this.request("POST","/users/verify-email",{otp:s,appId:o||this.appId},{Authorization:`Bearer ${r}`})}async forgotPassword(t){const{email:r,appId:s}=t;if(!r)throw new Error("forgotPassword: 'email' is required");return this.request("POST","/users/forgot-password",{email:r,appId:s||this.appId})}async resetPassword(t){const{email:r,otp:s,newPassword:o,appId:i}=t;if(!r||!s||!o)throw new Error("resetPassword: 'email', 'otp' and 'newPassword' are required");return this.request("POST","/users/reset-password",{email:r,otp:s,newPassword:o,appId:i||this.appId})}async getUserData(t){const{userId:r}=t;if(!r)throw new Error("getUserData: 'userId' is required");return this.request("GET",`/users/${r}/data`)}async getSingleUserData(t){const{userId:r,dataId:s}=t;if(!r||!s)throw new Error("getSingleUserData: 'userId' and 'dataId' are required");return this.request("GET",`/users/${r}/data/${s}`)}async addUserData(t){const{userId:r,data:s}=t;if(!r)throw new Error("addUserData: 'userId' is required");if(!s)throw new Error("addUserData: 'data' is required");return this.request("POST",`/users/${r}/data`,s)}async updateUserData(t){const{userId:r,dataId:s,data:o}=t;if(!r||!s)throw new Error("updateUserData: 'userId' and 'dataId' are required");if(!o)throw new Error("updateUserData: 'data' is required");return this.request("PUT",`/users/${r}/data/${s}`,o)}async deleteUserData(t){const{userId:r,dataId:s}=t;if(!r||!s)throw new Error("deleteUserData: 'userId' and 'dataId' are required");return this.request("DELETE",`/users/${r}/data/${s}`)}}var Be={exports:{}},Re={};/**
6
+ `+i):s.stack=i}catch{}}throw s}}_request(t,r){typeof t=="string"?(r=r||{},r.url=t):r=t||{},r=pe(this.defaults,r);const{transitional:s,paramsSerializer:o,headers:i}=r;s!==void 0&&Me.assertOptions(s,{silentJSONParsing:ie.transitional(ie.boolean),forcedJSONParsing:ie.transitional(ie.boolean),clarifyTimeoutError:ie.transitional(ie.boolean)},!1),o!=null&&(p.isFunction(o)?r.paramsSerializer={serialize:o}:Me.assertOptions(o,{encode:ie.function,serialize:ie.function},!0)),r.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?r.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:r.allowAbsoluteUrls=!0),Me.assertOptions(r,{baseUrl:ie.spelling("baseURL"),withXsrfToken:ie.spelling("withXSRFToken")},!0),r.method=(r.method||this.defaults.method||"get").toLowerCase();let a=i&&p.merge(i.common,i[r.method]);i&&p.forEach(["delete","get","head","post","put","patch","common"],d=>{delete i[d]}),r.headers=ne.concat(a,i);const l=[];let h=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(r)===!1||(h=h&&b.synchronous,l.unshift(b.fulfilled,b.rejected))});const c=[];this.interceptors.response.forEach(function(b){c.push(b.fulfilled,b.rejected)});let u,y=0,R;if(!h){const d=[Ht.bind(this),void 0];for(d.unshift(...l),d.push(...c),R=d.length,u=Promise.resolve(r);y<R;)u=u.then(d[y++],d[y++]);return u}R=l.length;let k=r;for(;y<R;){const d=l[y++],b=l[y++];try{k=d(k)}catch(g){b.call(this,g);break}}try{u=Ht.call(this,k)}catch(d){return Promise.reject(d)}for(y=0,R=c.length;y<R;)u=u.then(c[y++],c[y++]);return u}getUri(t){t=pe(this.defaults,t);const r=At(t.baseURL,t.url,t.allowAbsoluteUrls);return kt(r,t.params,t.paramsSerializer)}};p.forEach(["delete","get","head","options"],function(t){fe.prototype[t]=function(r,s){return this.request(pe(s||{},{method:t,url:r,data:(s||{}).data}))}}),p.forEach(["post","put","patch"],function(t){function r(s){return function(i,a,l){return this.request(pe(l||{},{method:t,headers:s?{"Content-Type":"multipart/form-data"}:{},url:i,data:a}))}}fe.prototype[t]=r(),fe.prototype[t+"Form"]=r(!0)});let Cn=class or{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let r;this.promise=new Promise(function(i){r=i});const s=this;this.promise.then(o=>{if(!s._listeners)return;let i=s._listeners.length;for(;i-- >0;)s._listeners[i](o);s._listeners=null}),this.promise.then=o=>{let i;const a=new Promise(l=>{s.subscribe(l),i=l}).then(o);return a.cancel=function(){s.unsubscribe(i)},a},t(function(i,a,l){s.reason||(s.reason=new we(i,a,l),r(s.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const r=this._listeners.indexOf(t);r!==-1&&this._listeners.splice(r,1)}toAbortSignal(){const t=new AbortController,r=s=>{t.abort(s)};return this.subscribe(r),t.signal.unsubscribe=()=>this.unsubscribe(r),t.signal}static source(){let t;return{token:new or(function(o){t=o}),cancel:t}}};function Tn(e){return function(r){return e.apply(null,r)}}function Rn(e){return p.isObject(e)&&e.isAxiosError===!0}const et={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(et).forEach(([e,t])=>{et[t]=e});function qt(e){const t=new fe(e),r=ct(fe.prototype.request,t);return p.extend(r,fe.prototype,t,{allOwnKeys:!0}),p.extend(r,t,null,{allOwnKeys:!0}),r.create=function(o){return qt(pe(e,o))},r}const W=qt(Ce);W.Axios=fe,W.CanceledError=we,W.CancelToken=Cn,W.isCancel=It,W.VERSION=Vt,W.toFormData=Ne,W.AxiosError=U,W.Cancel=W.CanceledError,W.all=function(t){return Promise.all(t)},W.spread=Tn,W.isAxiosError=Rn,W.mergeConfig=pe,W.AxiosHeaders=ne,W.formToJSON=e=>Tt(p.isHTMLForm(e)?new FormData(e):e),W.getAdapter=$t.getAdapter,W.HttpStatusCode=et,W.default=W;const{Axios:ms,AxiosError:ys,CanceledError:bs,isCancel:ws,CancelToken:Ss,VERSION:js,all:vs,Cancel:ks,isAxiosError:Es,spread:Cs,toFormData:Ts,AxiosHeaders:Rs,HttpStatusCode:Is,formToJSON:Ps,getAdapter:Os,mergeConfig:_s}=W;class In{baseUrl;apiKey;appId;client;constructor(t){if(!t||!t.baseUrl)throw new Error("NeuctraAuthixClient: 'baseUrl' is required in config");this.baseUrl=t.baseUrl.replace(/\/$/,""),this.apiKey=t.apiKey||null,this.appId=t.appId||null,this.client=W.create({baseURL:this.baseUrl,headers:{"Content-Type":"application/json",...this.apiKey?{"x-api-key":this.apiKey}:{}},timeout:1e4})}async request(t,r,s,o={}){if(!t)throw new Error("HTTP method is required");if(!r)throw new Error("Request path is required");try{const i={...this.appId?{appId:this.appId}:{},...s||{}};return(await this.client.request({url:r,method:t,data:i,headers:o})).data}catch(i){if(console.error("❌ [Request Error]:",i),i.isAxiosError){const a=i.response?.status||0,l=i.response?.data?.message||i.message||"Unknown Axios error occurred";throw new Error(`Request failed (${a}): ${l}`)}throw new Error(`Unexpected error: ${i.message||"Unknown failure"}`)}}async signup(t){const{name:r,email:s,password:o}=t;if(!r||!s||!o)throw new Error("signup: 'name', 'email', and 'password' are required");return this.request("POST","/users/signup",t)}async login(t){const{email:r,password:s,appId:o}=t;if(!r||!s)throw new Error("login: 'email' and 'password' are required");return this.request("POST","/users/login",{email:r,password:s,appId:o||this.appId})}async updateUser(t){const{userId:r,appId:s}=t;if(!r)throw new Error("updateUser: 'userId' is required");return this.request("PUT",`/users/update/${r}`,{...t,appId:s||this.appId})}async changePassword(t){const{userId:r,currentPassword:s,newPassword:o,appId:i}=t;if(!r)throw new Error("changePassword: 'userId' is required");if(!s||!o)throw new Error("changePassword: both 'currentPassword' and 'newPassword' are required");return this.request("PUT",`/users/change-password/${r}`,{currentPassword:s,newPassword:o,appId:i||this.appId})}async deleteUser(t){const{userId:r,appId:s}=t;if(!r)throw new Error("deleteUser: 'userId' is required");return this.request("DELETE",`/users/delete/${r}`,{appId:s||this.appId})}async getProfile(t){const{token:r}=t;if(!r)throw new Error("getProfile: 'token' is required");return this.request("GET","/users/profile",{},{Authorization:`Bearer ${r}`})}async sendVerifyOTP(t){const{token:r,appId:s}=t;if(!r)throw new Error("sendVerifyOTP: 'token' is required");return this.request("POST","/users/send-verify-otp",{appId:s||this.appId},{Authorization:`Bearer ${r}`})}async verifyEmail(t){const{token:r,otp:s,appId:o}=t;if(!r)throw new Error("verifyEmail: 'token' is required");if(!s)throw new Error("verifyEmail: 'otp' is required");return this.request("POST","/users/verify-email",{otp:s,appId:o||this.appId},{Authorization:`Bearer ${r}`})}async forgotPassword(t){const{email:r,appId:s}=t;if(!r)throw new Error("forgotPassword: 'email' is required");return this.request("POST","/users/forgot-password",{email:r,appId:s||this.appId})}async resetPassword(t){const{email:r,otp:s,newPassword:o,appId:i}=t;if(!r||!s||!o)throw new Error("resetPassword: 'email', 'otp' and 'newPassword' are required");return this.request("POST","/users/reset-password",{email:r,otp:s,newPassword:o,appId:i||this.appId})}async getUserData(t){const{userId:r}=t;if(!r)throw new Error("getUserData: 'userId' is required");return this.request("GET",`/users/${r}/data`)}async getSingleUserData(t){const{userId:r,dataId:s}=t;if(!r||!s)throw new Error("getSingleUserData: 'userId' and 'dataId' are required");return this.request("GET",`/users/${r}/data/${s}`)}async addUserData(t){const{userId:r,data:s}=t;if(!r)throw new Error("addUserData: 'userId' is required");if(!s)throw new Error("addUserData: 'data' is required");return this.request("POST",`/users/${r}/data`,s)}async updateUserData(t){const{userId:r,dataId:s,data:o}=t;if(!r||!s)throw new Error("updateUserData: 'userId' and 'dataId' are required");if(!o)throw new Error("updateUserData: 'data' is required");return this.request("PUT",`/users/${r}/data/${s}`,o)}async deleteUserData(t){const{userId:r,dataId:s}=t;if(!r||!s)throw new Error("deleteUserData: 'userId' and 'dataId' are required");return this.request("DELETE",`/users/${r}/data/${s}`)}}var Be={exports:{}},Re={};/**
7
7
  * @license React
8
8
  * react-jsx-runtime.production.js
9
9
  *
@@ -120,67 +120,43 @@ export declare class NeuctraAuthix {
120
120
  */
121
121
  constructor(config: NeuctraAuthixConfig);
122
122
  /**
123
- * 🌐 Universal request helper with structured responses and error handling
124
- * @param method HTTP method (GET, POST, PUT, DELETE)
125
- * @param path API endpoint path
126
- * @param data optional request body
127
- * @param extraHeaders optional headers
128
- */
123
+ * 🌐 Universal request helper with structured responses and error handling
124
+ * @param method HTTP method (GET, POST, PUT, DELETE)
125
+ * @param path API endpoint path
126
+ * @param data Optional request body
127
+ * @param extraHeaders Optional custom headers
128
+ */
129
129
  private request;
130
130
  /**
131
131
  * Register a new user
132
132
  * @param params user details
133
133
  */
134
- signup(params: SignupParams): Promise<{
135
- success: boolean;
136
- data?: any;
137
- message: string;
138
- }>;
134
+ signup(params: SignupParams): Promise<any>;
139
135
  /**
140
136
  * Login a user
141
137
  * @param params login details
142
138
  */
143
- login(params: LoginParams): Promise<{
144
- success: boolean;
145
- data?: any;
146
- message: string;
147
- }>;
139
+ login(params: LoginParams): Promise<any>;
148
140
  /**
149
141
  * Update an existing user
150
142
  * @param params fields to update
151
143
  */
152
- updateUser(params: UpdateUserParams): Promise<{
153
- success: boolean;
154
- data?: any;
155
- message: string;
156
- }>;
144
+ updateUser(params: UpdateUserParams): Promise<any>;
157
145
  /**
158
146
  * Change a user's password (Admin only)
159
147
  * @param params requires userId, currentPassword, newPassword
160
148
  */
161
- changePassword(params: ChangePasswordParams): Promise<{
162
- success: boolean;
163
- data?: any;
164
- message: string;
165
- }>;
149
+ changePassword(params: ChangePasswordParams): Promise<any>;
166
150
  /**
167
151
  * Delete a user
168
152
  * @param params requires userId and optionally appId
169
153
  */
170
- deleteUser(params: DeleteUserParams): Promise<{
171
- success: boolean;
172
- data?: any;
173
- message: string;
174
- }>;
154
+ deleteUser(params: DeleteUserParams): Promise<any>;
175
155
  /**
176
156
  * Get the profile of the authenticated user
177
157
  * @param params requires JWT token
178
158
  */
179
- getProfile(params: GetProfileParams): Promise<{
180
- success: boolean;
181
- data?: any;
182
- message: string;
183
- }>;
159
+ getProfile(params: GetProfileParams): Promise<any>;
184
160
  /**
185
161
  * Send verification OTP (requires logged-in user token)
186
162
  * @param params requires token
@@ -188,11 +164,7 @@ export declare class NeuctraAuthix {
188
164
  sendVerifyOTP(params: {
189
165
  token: string;
190
166
  appId?: string;
191
- }): Promise<{
192
- success: boolean;
193
- data?: any;
194
- message: string;
195
- }>;
167
+ }): Promise<any>;
196
168
  /**
197
169
  * Verify email with OTP (requires logged-in user token)
198
170
  * @param params requires token + otp
@@ -201,11 +173,7 @@ export declare class NeuctraAuthix {
201
173
  token: string;
202
174
  otp: string;
203
175
  appId?: string;
204
- }): Promise<{
205
- success: boolean;
206
- data?: any;
207
- message: string;
208
- }>;
176
+ }): Promise<any>;
209
177
  /**
210
178
  * Forgot password (public route)
211
179
  * @param params requires email
@@ -213,11 +181,7 @@ export declare class NeuctraAuthix {
213
181
  forgotPassword(params: {
214
182
  email: string;
215
183
  appId?: string;
216
- }): Promise<{
217
- success: boolean;
218
- data?: any;
219
- message: string;
220
- }>;
184
+ }): Promise<any>;
221
185
  /**
222
186
  * Reset password (public route)
223
187
  * @param params requires email, otp, newPassword
@@ -227,55 +191,31 @@ export declare class NeuctraAuthix {
227
191
  otp: string;
228
192
  newPassword: string;
229
193
  appId?: string;
230
- }): Promise<{
231
- success: boolean;
232
- data?: any;
233
- message: string;
234
- }>;
194
+ }): Promise<any>;
235
195
  /**
236
196
  * Get all data objects for a user
237
197
  * @param params requires userId
238
198
  */
239
- getUserData(params: GetUserDataParams): Promise<{
240
- success: boolean;
241
- data?: any;
242
- message: string;
243
- }>;
199
+ getUserData(params: GetUserDataParams): Promise<any>;
244
200
  /**
245
201
  * Get a single data object for a user
246
202
  * @param params requires userId and dataId
247
203
  */
248
- getSingleUserData(params: GetSingleUserDataParams): Promise<{
249
- success: boolean;
250
- data?: any;
251
- message: string;
252
- }>;
204
+ getSingleUserData(params: GetSingleUserDataParams): Promise<any>;
253
205
  /**
254
206
  * Add a new data object to a user
255
207
  * @param params requires userId and data object
256
208
  */
257
- addUserData(params: AddUserDataParams): Promise<{
258
- success: boolean;
259
- data?: any;
260
- message: string;
261
- }>;
209
+ addUserData(params: AddUserDataParams): Promise<any>;
262
210
  /**
263
211
  * Update a data object by its id
264
212
  * @param params requires userId, dataId, and updated fields
265
213
  */
266
- updateUserData(params: UpdateUserDataParams): Promise<{
267
- success: boolean;
268
- data?: any;
269
- message: string;
270
- }>;
214
+ updateUserData(params: UpdateUserDataParams): Promise<any>;
271
215
  /**
272
216
  * Delete a data object by its id
273
217
  * @param params requires userId and dataId
274
218
  */
275
- deleteUserData(params: DeleteUserDataParams): Promise<{
276
- success: boolean;
277
- data?: any;
278
- message: string;
279
- }>;
219
+ deleteUserData(params: DeleteUserDataParams): Promise<any>;
280
220
  }
281
221
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neuctra/authix",
3
- "version": "1.0.18",
3
+ "version": "1.0.20",
4
4
  "description": "Authentication SDK and UI components library for React and Vue with TailwindCSS",
5
5
  "author": "Taha Asif",
6
6
  "license": "MIT",