@springmicro/auth 0.5.4 → 0.5.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Index-64ac63ff-BCXnQfVb.js → Index-64ac63ff-C7Av5-xP.js} +1 -1
- package/dist/{Index-6c094240-DYAqbl99.js → Index-6c094240-BCXMyaWx.js} +1 -1
- package/dist/{Web3Auth--YGIRlpi.js → Web3Auth-hzrmIcT1.js} +10 -10
- package/dist/{hashMessage-DVaouzH3.js → hashMessage-DysoAmGZ.js} +1 -1
- package/dist/{index-CYwANJTC.js → index-BeiBc_gv.js} +2 -2
- package/dist/{index-OihqBtMt.js → index-C2eVtjVv.js} +1 -1
- package/dist/{index-Dki94ql9.js → index-DUwhqFWy.js} +1 -1
- package/dist/{index-UN50UbLN.js → index-DXfwe7Zk.js} +2 -2
- package/dist/{index-BqD_7DAd.js → index-DYTvS1uk.js} +4 -4
- package/dist/{index-DpnM6mYu.js → index-Da0T7bYG.js} +4 -4
- package/dist/{index-C_JIrc2I.js → index-LO_EWnJy.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/{number-FGOy03eH.js → number-CYbm8TMo.js} +1 -1
- package/package.json +2 -2
- package/src/components/forms/SendCodeInput.tsx +1 -1
- package/src/components/forms/util/user-api.ts +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Y as I, Z as N, $ as M, a0 as O, am as me, a4 as _, a7 as w, a8 as G, a9 as T, aa as V, ab as C, ac as Y, ad as _e, ae as we, af as D, a1 as h, a3 as m, aA as Ce, ah as H, a2 as L, b7 as W, ai as $, a5 as g, a6 as S, ay as be, bg as ze, bh as Te, bi as je, aD as Le, aU as xe, aG as Pe, aW as Se, aj as F, aO as Z, aR as Re, bj as Ee, bk as ye, aV as Ie, az as Ne, bl as U, bm as B, aw as A, aH as he, an as Me, ao as ge, bn as Oe, ag as ke, bo as X, bp as J, al as E, bq as Q, au as R, aC as K, br as ee, bs as De, bt as te, bu as x, at as He, aX as q, bv as $e } from "./Web3Auth
|
|
1
|
+
import { Y as I, Z as N, $ as M, a0 as O, am as me, a4 as _, a7 as w, a8 as G, a9 as T, aa as V, ab as C, ac as Y, ad as _e, ae as we, af as D, a1 as h, a3 as m, aA as Ce, ah as H, a2 as L, b7 as W, ai as $, a5 as g, a6 as S, ay as be, bg as ze, bh as Te, bi as je, aD as Le, aU as xe, aG as Pe, aW as Se, aj as F, aO as Z, aR as Re, bj as Ee, bk as ye, aV as Ie, az as Ne, bl as U, bm as B, aw as A, aH as he, an as Me, ao as ge, bn as Oe, ag as ke, bo as X, bp as J, al as E, bq as Q, au as R, aC as K, br as ee, bs as De, bt as te, bu as x, at as He, aX as q, bv as $e } from "./Web3Auth-hzrmIcT1.js";
|
|
2
2
|
function Fe(i, { from: e, to: t }, n = {}) {
|
|
3
3
|
const o = getComputedStyle(i), a = o.transform === "none" ? "" : o.transform, [f, l] = o.transformOrigin.split(" ").map(parseFloat), s = e.left + e.width * f / t.width - (t.left + f), r = e.top + e.height * l / t.height - (t.top + l), { delay: c = 0, duration: d = (u) => Math.sqrt(u) * 120, easing: v = ye } = n;
|
|
4
4
|
return {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as He, J as Ht, K as Bt, L as Dt, M as Wt, N as Nt, O as Et, P as Ft, Q as Ot, R as Zt, T as Rt, U as Gt, V as Ut, W as Xt, X as Yt, Y as pe, Z as ve, $ as me, a0 as he, a1 as h, a2 as z, a3 as p, a4 as M, a5 as c, a6 as Y, a7 as y, a8 as ae, a9 as A, aa as ie, ab as S, ac as te, ad as ye, ae as Ce, af as ee, ag as Jt, ah as F, ai as O, aj as Z, ak as Be, al as R, am as ue, an as Me, ao as qe, ap as $t, aq as De, ar as P, as as be, at as ge, au as L, av as _e, aw as ce, ax as Kt, ay as fe, az as we, aA as At, aB as Qt, aC as j, aD as Ae, aE as We, aF as Ne, aG as Ee, aH as ke, aI as Tt, aJ as xt, aK as en, aL as Ve, aM as ze, aN as Mt, aO as tn, aP as nn, aQ as rn, aR as St, aS as on, aT as de, aU as Ie, aV as $e, aW as ln, aX as je, aY as an, aZ as sn, a_ as It, a$ as Pt, b0 as cn, b1 as dn, b2 as Fe, b3 as un, b4 as Oe, b5 as fn, b6 as Ze, b7 as Pe, b8 as Re, b9 as pn, ba as Le, bb as Ge, bc as vn, bd as mn, be as Ue, bf as hn } from "./Web3Auth
|
|
1
|
+
import { _ as He, J as Ht, K as Bt, L as Dt, M as Wt, N as Nt, O as Et, P as Ft, Q as Ot, R as Zt, T as Rt, U as Gt, V as Ut, W as Xt, X as Yt, Y as pe, Z as ve, $ as me, a0 as he, a1 as h, a2 as z, a3 as p, a4 as M, a5 as c, a6 as Y, a7 as y, a8 as ae, a9 as A, aa as ie, ab as S, ac as te, ad as ye, ae as Ce, af as ee, ag as Jt, ah as F, ai as O, aj as Z, ak as Be, al as R, am as ue, an as Me, ao as qe, ap as $t, aq as De, ar as P, as as be, at as ge, au as L, av as _e, aw as ce, ax as Kt, ay as fe, az as we, aA as At, aB as Qt, aC as j, aD as Ae, aE as We, aF as Ne, aG as Ee, aH as ke, aI as Tt, aJ as xt, aK as en, aL as Ve, aM as ze, aN as Mt, aO as tn, aP as nn, aQ as rn, aR as St, aS as on, aT as de, aU as Ie, aV as $e, aW as ln, aX as je, aY as an, aZ as sn, a_ as It, a$ as Pt, b0 as cn, b1 as dn, b2 as Fe, b3 as un, b4 as Oe, b5 as fn, b6 as Ze, b7 as Pe, b8 as Re, b9 as pn, ba as Le, bb as Ge, bc as vn, bd as mn, be as Ue, bf as hn } from "./Web3Auth-hzrmIcT1.js";
|
|
2
2
|
var gn = function(e) {
|
|
3
3
|
He(t, e);
|
|
4
4
|
function t(n, r) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as pu, g as mp, a as yp } from "./index-
|
|
1
|
+
import { s as pu, g as mp, a as yp } from "./index-DYTvS1uk.js";
|
|
2
2
|
import gu from "i18next";
|
|
3
3
|
var Ze = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
4
4
|
function _o(e) {
|
|
@@ -21308,7 +21308,7 @@ const py = (e) => py(), KE = (e) => {
|
|
|
21308
21308
|
const t = Uu(e, "bigint");
|
|
21309
21309
|
return hy(t);
|
|
21310
21310
|
}, VI = (e) => Zf(e), zc = (e, t) => t ? typeof t == "function" ? `Please <a href="#" onclick="${() => t()}">install</a> or enable to ${e} to continue` : `Please <a href="${t}" target="_blank">install</a> or enable to ${e} to continue` : `Please switch to ${e} to continue`, JE = async (e) => {
|
|
21311
|
-
const t = await import("./index-
|
|
21311
|
+
const t = await import("./index-BeiBc_gv.js"), { id: r, label: n, token: i, publicRpcUrl: o, blockExplorerUrl: a, rpcUrl: s } = e;
|
|
21312
21312
|
switch (r) {
|
|
21313
21313
|
case "0x89": {
|
|
21314
21314
|
const { polygon: l } = t;
|
|
@@ -21371,7 +21371,7 @@ const py = (e) => py(), KE = (e) => {
|
|
|
21371
21371
|
return l;
|
|
21372
21372
|
}
|
|
21373
21373
|
default: {
|
|
21374
|
-
const { extractChain: l, defineChain: u } = await import("./index-
|
|
21374
|
+
const { extractChain: l, defineChain: u } = await import("./index-Da0T7bYG.js"), f = l({
|
|
21375
21375
|
chains: Object.values(t),
|
|
21376
21376
|
id: Uu(r, "number")
|
|
21377
21377
|
});
|
|
@@ -24450,7 +24450,7 @@ const Ya = async (e, t) => {
|
|
|
24450
24450
|
const r = t.rpcUrl;
|
|
24451
24451
|
return !t.secondaryTokens || !t.secondaryTokens.length || !r ? [] : await Promise.all(t.secondaryTokens.map(async (i) => {
|
|
24452
24452
|
try {
|
|
24453
|
-
const { createPublicClient: o, http: a } = await import("./index-
|
|
24453
|
+
const { createPublicClient: o, http: a } = await import("./index-Da0T7bYG.js"), s = await JE(t), l = o({
|
|
24454
24454
|
chain: s,
|
|
24455
24455
|
transport: a(t.providerConnectionInfo && t.providerConnectionInfo.url ? t.providerConnectionInfo.url : r)
|
|
24456
24456
|
}), u = {
|
|
@@ -24493,7 +24493,7 @@ async function K9(e) {
|
|
|
24493
24493
|
const t = await E7(e.id);
|
|
24494
24494
|
if (!t)
|
|
24495
24495
|
return null;
|
|
24496
|
-
const { createPublicClient: r, http: n } = await import("./index-
|
|
24496
|
+
const { createPublicClient: r, http: n } = await import("./index-Da0T7bYG.js"), i = r({
|
|
24497
24497
|
chain: t,
|
|
24498
24498
|
transport: n()
|
|
24499
24499
|
});
|
|
@@ -29806,7 +29806,7 @@ function OA(e, t, r) {
|
|
|
29806
29806
|
bottomLeft: `
|
|
29807
29807
|
bottom: var(--${O}-position-bottom, 0);
|
|
29808
29808
|
left: var(--${O}-position-left, 0);`
|
|
29809
|
-
}), $ = u.enabled ? import("./Index-6c094240-
|
|
29809
|
+
}), $ = u.enabled ? import("./Index-6c094240-BCXMyaWx.js").then((O) => O.default) : Promise.resolve(null), M = c.enabled ? import("./Index-64ac63ff-C7Av5-xP.js").then((O) => O.default) : Promise.resolve(null), j = u.enabled && b && b.accountCenter, A = (O, I, P, S) => {
|
|
29810
29810
|
const T = O.attachShadow({ mode: "open" });
|
|
29811
29811
|
let R = document.querySelector("onboard-v2").shadowRoot.styleSheets;
|
|
29812
29812
|
const U = new CSSStyleSheet();
|
|
@@ -29952,7 +29952,7 @@ function $A(e) {
|
|
|
29952
29952
|
return Ms;
|
|
29953
29953
|
}
|
|
29954
29954
|
const kA = (e, t) => t || document.body && (getComputedStyle(document.body).getPropertyValue("--onboard-font-family-normal") || getComputedStyle(document.body).getPropertyValue("--w3o-font-family")) ? !0 : e ? !!(typeof e == "object" && e["--w3o-font-family"]) : !1, RA = async () => {
|
|
29955
|
-
const { InterVar: e } = await import("./index-
|
|
29955
|
+
const { InterVar: e } = await import("./index-C2eVtjVv.js"), t = document.createElement("style");
|
|
29956
29956
|
t.innerHTML = `
|
|
29957
29957
|
${e}
|
|
29958
29958
|
`, document.body.appendChild(t);
|
|
@@ -31962,7 +31962,7 @@ function yI() {
|
|
|
31962
31962
|
label: "Frontier",
|
|
31963
31963
|
getIcon: async () => (await import("./icon-C_O4nprO.js")).default,
|
|
31964
31964
|
getInterface: async () => {
|
|
31965
|
-
const { createEIP1193Provider: e } = await import("./index-
|
|
31965
|
+
const { createEIP1193Provider: e } = await import("./index-C2eVtjVv.js"), t = window.hasOwnProperty("ethereum");
|
|
31966
31966
|
let r;
|
|
31967
31967
|
if (t && window.ethereum.isFrontier)
|
|
31968
31968
|
r = e(window.ethereum);
|
|
@@ -32223,7 +32223,7 @@ function AI({ supportedWalletType: e = "all", darkMode: t = !1, enableMobileWall
|
|
|
32223
32223
|
getIcon: async () => (await import("./icon-DbgmZCnU.js")).default,
|
|
32224
32224
|
getInterface: async ({ chains: i, appMetadata: o }) => {
|
|
32225
32225
|
(r || n || t) && console.warn("darkMode, enableMobileWalletLink and reloadOnDisconnect init props are deprecated after version 2.2.7 of @web3-onboard/coinbase");
|
|
32226
|
-
const { name: a, icon: s } = o || {}, { default: l } = await import("./index-
|
|
32226
|
+
const { name: a, icon: s } = o || {}, { default: l } = await import("./index-DUwhqFWy.js").then(($) => $.i), u = l.default ? l.default : l, { isHex: f, toHex: c, createEIP1193Provider: h, fromHex: d } = await import("./index-C2eVtjVv.js"), g = `data:image/svg+xml;base64,${window.btoa(s || "")}`, b = i.map(({ id: $ }) => d($, "number")), m = new u({
|
|
32227
32227
|
appName: a || "",
|
|
32228
32228
|
appLogoUrl: g,
|
|
32229
32229
|
appChainIds: b
|
|
@@ -32258,7 +32258,7 @@ function CI(e) {
|
|
|
32258
32258
|
label: "Safe",
|
|
32259
32259
|
getIcon: async () => (await import("./icon-2Zqy7pqQ.js")).default,
|
|
32260
32260
|
getInterface: async () => {
|
|
32261
|
-
const { default: n } = await import("./index-
|
|
32261
|
+
const { default: n } = await import("./index-LO_EWnJy.js"), { SafeAppProvider: i } = await import("./index-DXfwe7Zk.js").then((h) => h.i), { createEIP1193Provider: o } = await import("./index-C2eVtjVv.js"), a = (
|
|
32262
32262
|
// @ts-ignore
|
|
32263
32263
|
n.default || n
|
|
32264
32264
|
), s = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ac as e, $ as G, D as J, a0 as V, a2 as ee, af as X, a as q, a5 as Z, i as k, I as E, a3 as te, ae as de, ah as me, X as ae, F as ue, o as be, V as he, z as ke, ad as xe } from "./number-
|
|
2
|
-
import { h as i, q as o, e as W, B as u, f as fe, g as R, t as K, G as ye } from "./Web3Auth
|
|
1
|
+
import { ac as e, $ as G, D as J, a0 as V, a2 as ee, af as X, a as q, a5 as Z, i as k, I as E, a3 as te, ae as de, ah as me, X as ae, F as ue, o as be, V as he, z as ke, ad as xe } from "./number-CYbm8TMo.js";
|
|
2
|
+
import { h as i, q as o, e as W, B as u, f as fe, g as R, t as K, G as ye } from "./Web3Auth-hzrmIcT1.js";
|
|
3
3
|
const et = /* @__PURE__ */ e({
|
|
4
4
|
id: 787,
|
|
5
5
|
name: "Acala",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bw as o, b2 as r, bs as t, bC as i, bE as n, bF as f, bG as b, bB as d, bx as c, D as l, bA as m, i as p, q as h, bD as w, by as x, bz as I } from "./Web3Auth
|
|
1
|
+
import { bw as o, b2 as r, bs as t, bC as i, bE as n, bF as f, bG as b, bB as d, bx as c, D as l, bA as m, i as p, q as h, bD as w, by as x, bz as I } from "./Web3Auth-hzrmIcT1.js";
|
|
2
2
|
const a = `
|
|
3
3
|
@font-face {
|
|
4
4
|
font-family: 'Inter';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { bH as Xi, bI as qt, bJ as es, bK as Z, bL as de, bM as Wn, bN as Sa } from "./Web3Auth
|
|
1
|
+
import { bH as Xi, bI as qt, bJ as es, bK as Z, bL as de, bM as Wn, bN as Sa } from "./Web3Auth-hzrmIcT1.js";
|
|
2
2
|
var ts = {}, gt = {}, Kt = {};
|
|
3
3
|
Object.defineProperty(Kt, "__esModule", { value: !0 });
|
|
4
4
|
Kt.walletLogo = void 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { bK as V, bM as Jc, bH as Xc } from "./Web3Auth
|
|
2
|
-
import { b as nt, c as go, i as wo, d as vo, B as _, g as rt, A as as, f as st, t as Jt, k as se, j as le, l as at, n as C, m as H, o as rr, p as q, q as Pe, I as xo, r as G, s as te, u as Ce, v as sn, w as Is, x as Po, y as Eo, z as sr, C as Io, D as Ye, E as Xt, F as Ts, G as Z, H as O, J as N, K as we, L as ae, M as oe, N as Ra, O as To, P as Ur, Q as jn, R as _o, S as Qc, T as So, U as ve, e as Te, V as Ao, W as _s, X as an, Y as xt, Z as Qt, _ as Ss, $ as As, a0 as en, a1 as Bs, a2 as ar, a3 as wt, a4 as or, a5 as Bo, a6 as os, a7 as Co, a8 as ko, a9 as Kt, aa as Mo, ab as eu, ac as tu, ad as $o, ae as nu, af as Ro, ag as Ee, ah as No, ai as An, h as ir, a as Cs, aj as ks, ak as is, al as ru, am as su, an as au, ao as ou, ap as Oo, aq as Fo, ar as Lo, as as jo, at as iu, au as cu, av as uu, aw as du, ax as lu, ay as fu, az as pu, aA as hu, aB as mu, aC as yu, aD as bu, aE as gu, aF as wu, aG as vu, aH as xu, aI as Pu, aJ as Eu, aK as Iu, aL as Bn, aM as Tu, aN as _u, aO as Su, aP as Au, aQ as Bu, aR as Cu, aS as ku, aT as Na, aU as Mu, aV as $u } from "./hashMessage-
|
|
1
|
+
import { bK as V, bM as Jc, bH as Xc } from "./Web3Auth-hzrmIcT1.js";
|
|
2
|
+
import { b as nt, c as go, i as wo, d as vo, B as _, g as rt, A as as, f as st, t as Jt, k as se, j as le, l as at, n as C, m as H, o as rr, p as q, q as Pe, I as xo, r as G, s as te, u as Ce, v as sn, w as Is, x as Po, y as Eo, z as sr, C as Io, D as Ye, E as Xt, F as Ts, G as Z, H as O, J as N, K as we, L as ae, M as oe, N as Ra, O as To, P as Ur, Q as jn, R as _o, S as Qc, T as So, U as ve, e as Te, V as Ao, W as _s, X as an, Y as xt, Z as Qt, _ as Ss, $ as As, a0 as en, a1 as Bs, a2 as ar, a3 as wt, a4 as or, a5 as Bo, a6 as os, a7 as Co, a8 as ko, a9 as Kt, aa as Mo, ab as eu, ac as tu, ad as $o, ae as nu, af as Ro, ag as Ee, ah as No, ai as An, h as ir, a as Cs, aj as ks, ak as is, al as ru, am as su, an as au, ao as ou, ap as Oo, aq as Fo, ar as Lo, as as jo, at as iu, au as cu, av as uu, aw as du, ax as lu, ay as fu, az as pu, aA as hu, aB as mu, aC as yu, aD as bu, aE as gu, aF as wu, aG as vu, aH as xu, aI as Pu, aJ as Eu, aK as Iu, aL as Bn, aM as Tu, aN as _u, aO as Su, aP as Au, aQ as Bu, aR as Cu, aS as ku, aT as Na, aU as Mu, aV as $u } from "./hashMessage-DysoAmGZ.js";
|
|
3
3
|
function Ru(e, t) {
|
|
4
4
|
for (var n = 0; n < t.length; n++) {
|
|
5
5
|
const r = t[n];
|
|
@@ -1606,12 +1606,12 @@ function Nt(t, e) {
|
|
|
1606
1606
|
}
|
|
1607
1607
|
function Dt(t, e, o, r, a = "", l, u, g, c = "") {
|
|
1608
1608
|
const f = new FormData();
|
|
1609
|
-
return f.append("captchaType", t), f.append("captchaToken", e), f.append("clientSecret", o), f.append("method", r), f.append("countryCode", a), f.append("dest", l), f.append("type", u), f.append("applicationId", "admin/" + g), f.append("checkUser", c),
|
|
1609
|
+
return f.append("captchaType", t), f.append("captchaToken", e), f.append("clientSecret", o), f.append("method", r), f.append("countryCode", a), f.append("dest", l), f.append("type", u), f.append("applicationId", "admin/" + g), f.append("checkUser", c), fetch(`${I.casdoor}/api/send-verification-code`, {
|
|
1610
1610
|
method: "POST",
|
|
1611
1611
|
credentials: "include",
|
|
1612
1612
|
body: f,
|
|
1613
1613
|
headers: {
|
|
1614
|
-
"Content-Type": "application/json",
|
|
1614
|
+
// "Content-Type": "application/json",
|
|
1615
1615
|
"Accept-Language": te()
|
|
1616
1616
|
}
|
|
1617
1617
|
}).then((h) => h.json()).then((h) => h.status === "ok" ? (G("success", "Verification code sent"), !0) : (G("error", h.msg), !1));
|
|
@@ -3004,10 +3004,10 @@ function Qe(t, e) {
|
|
|
3004
3004
|
});
|
|
3005
3005
|
}
|
|
3006
3006
|
function Bt(t, e, o) {
|
|
3007
|
-
e.type === "MetaMask" ? import("./Web3Auth
|
|
3007
|
+
e.type === "MetaMask" ? import("./Web3Auth-hzrmIcT1.js").then((r) => r.bO).then((r) => {
|
|
3008
3008
|
const a = r.authViaMetaMask;
|
|
3009
3009
|
a(t, e, o);
|
|
3010
|
-
}) : e.type === "Web3Onboard" && import("./Web3Auth
|
|
3010
|
+
}) : e.type === "Web3Onboard" && import("./Web3Auth-hzrmIcT1.js").then((r) => r.bO).then((r) => {
|
|
3011
3011
|
const a = r.authViaWeb3Onboard;
|
|
3012
3012
|
a(t, e, o);
|
|
3013
3013
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { B as O, s as Z, t as Ne, n as j, p as he, b as ys, a as gs, i as Re, c as Bt, d as Q, h as Ue, e as At, I as ms, f as ft, g as ws, j as pr, k as vs, l as lt, m as Cn, o as ye, q as qe } from "./Web3Auth
|
|
2
|
-
import { v as lc, w as dc, x as pc, S as bc, y as hc, z as yc, r as gc, C as mc, D as wc, u as vc, E as Ec, F as xc, A as Pc, G as Bc, H as Ac } from "./Web3Auth
|
|
3
|
-
import { k as W, c as ee, i as te, I as ve, s as xt, a as br, b as Es, d as xs, e as Ps, p as an, f as ge, E as mt, F as Ht, g as jn, N as Fn, h as qn, j as Mn, l as zn, m as Ln, n as _n, T as Dn, o as Gt, U as cn, q as Bs, r as hr, t as As, u as Ts, v as Is, w as Os, x as Ss, y as yr, P as ks, z as Ee, C as Ut, A as gr, B as mr, D as Ns, G as wr, H as Rs, J as $s, K as Cs, L as js, M as Hn, O as Fs, Q as qs, R as Ms, S as zs, W as Gn } from "./number-
|
|
4
|
-
import { X as Ic, Y as Oc, Z as Sc, _ as kc, a6 as Nc, a7 as Rc, a8 as $c, a9 as Cc, ab as jc, $ as Fc, ac as qc, a0 as Mc, a2 as zc, a3 as Lc, V as _c, a4 as Dc, ae as Hc, af as Gc, ad as Uc, ag as Vc, aa as Zc, a5 as Wc, a1 as Yc } from "./number-
|
|
1
|
+
import { B as O, s as Z, t as Ne, n as j, p as he, b as ys, a as gs, i as Re, c as Bt, d as Q, h as Ue, e as At, I as ms, f as ft, g as ws, j as pr, k as vs, l as lt, m as Cn, o as ye, q as qe } from "./Web3Auth-hzrmIcT1.js";
|
|
2
|
+
import { v as lc, w as dc, x as pc, S as bc, y as hc, z as yc, r as gc, C as mc, D as wc, u as vc, E as Ec, F as xc, A as Pc, G as Bc, H as Ac } from "./Web3Auth-hzrmIcT1.js";
|
|
3
|
+
import { k as W, c as ee, i as te, I as ve, s as xt, a as br, b as Es, d as xs, e as Ps, p as an, f as ge, E as mt, F as Ht, g as jn, N as Fn, h as qn, j as Mn, l as zn, m as Ln, n as _n, T as Dn, o as Gt, U as cn, q as Bs, r as hr, t as As, u as Ts, v as Is, w as Os, x as Ss, y as yr, P as ks, z as Ee, C as Ut, A as gr, B as mr, D as Ns, G as wr, H as Rs, J as $s, K as Cs, L as js, M as Hn, O as Fs, Q as qs, R as Ms, S as zs, W as Gn } from "./number-CYbm8TMo.js";
|
|
4
|
+
import { X as Ic, Y as Oc, Z as Sc, _ as kc, a6 as Nc, a7 as Rc, a8 as $c, a9 as Cc, ab as jc, $ as Fc, ac as qc, a0 as Mc, a2 as zc, a3 as Lc, V as _c, a4 as Dc, ae as Hc, af as Gc, ad as Uc, ag as Vc, aa as Zc, a5 as Wc, a1 as Yc } from "./number-CYbm8TMo.js";
|
|
5
5
|
function Ls(e, t) {
|
|
6
6
|
const n = e.exec(t);
|
|
7
7
|
return n == null ? void 0 : n.groups;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { e as y, h as T, a as k } from "./hashMessage-
|
|
1
|
+
import { e as y, h as T, a as k } from "./hashMessage-DysoAmGZ.js";
|
|
2
2
|
const I = () => "9.1.0", q = (t) => t.toString(16).padStart(2, "0"), v = (t) => {
|
|
3
3
|
const e = new Uint8Array(t / 2);
|
|
4
4
|
return window.crypto.getRandomValues(e), Array.from(e, q).join("");
|
package/dist/index.js
CHANGED
package/dist/index.umd.cjs
CHANGED
|
@@ -32,7 +32,7 @@ React keys must be passed directly to JSX without using spread:
|
|
|
32
32
|
<img src="data:image/png;base64,${i.data}" alt="Wechat QR code" style="width: 100%;" />
|
|
33
33
|
</div>
|
|
34
34
|
<button onclick="window.closeDialog()">Close</button>
|
|
35
|
-
`,l=document.createElement("dialog");l.innerHTML=c,l.id="WechatOfficialAccountModal",document.body.appendChild(l),s()}AU(`${t.owner}/${t.name}`).then(async i=>{if(i.status!=="ok"){ji("error",i==null?void 0:i.msg);return}const o=setInterval(await SU,1e3,e,t,i.data2,n);r(i,o)})}function nv(e,t){return fetch(`${ki.casdoor}/api/get-invitation-info?code=${e}&applicationId=${encodeURIComponent(t)}`,{method:"GET",credentials:"include",headers:{"Accept-Language":aa()}}).then(n=>n.json())}function rv(e,t,n,r,i="",o,s,a,c=""){const l=new FormData;return l.append("captchaType",e),l.append("captchaToken",t),l.append("clientSecret",n),l.append("method",r),l.append("countryCode",i),l.append("dest",o),l.append("type",s),l.append("applicationId","admin/"+a),l.append("checkUser",c),console.log(Object.fromEntries(l.entries())),fetch(`${ki.casdoor}/api/send-verification-code`,{method:"POST",credentials:"include",body:l,headers:{"Content-Type":"application/json","Accept-Language":aa()}}).then(f=>f.json()).then(f=>f.status==="ok"?(ji("success","Verification code sent"),!0):(ji("error",f.msg),!1))}function iv(e,t,n){return fetch(`${ki.casdoor}/api/get-captcha?applicationId=${e}/${encodeURIComponent(t)}&isCurrentProvider=${n}`,{method:"GET",headers:{"Accept-Language":aa()}}).then(r=>r.json()).then(r=>r.data)}const IU=e=>{const{captchaType:t,subType:n,siteKey:r,clientSecret:i,clientId2:o,clientSecret2:s,onChange:a}=e,c=l=>{const f=document.createElement("script");f.async=!1,f.src=l,document.getElementsByTagName("body")[0].appendChild(f)};return Tt.useEffect(()=>{switch(t){case"reCAPTCHA":{const l=setInterval(()=>{window.grecaptcha||c("https://recaptcha.net/recaptcha/api.js"),window.grecaptcha&&window.grecaptcha.render&&(window.grecaptcha.render("captcha",{sitekey:r,callback:a}),clearInterval(l))},300);break}case"hCaptcha":{const l=setInterval(()=>{window.hcaptcha||c("https://js.hcaptcha.com/1/api.js"),window.hcaptcha&&window.hcaptcha.render&&(window.hcaptcha.render("captcha",{sitekey:r,callback:a}),clearInterval(l))},300);break}case"Aliyun Captcha":{const l=setInterval(()=>{window.AWSC||c("https://g.alicdn.com/AWSC/AWSC/awsc.js"),window.AWSC&&(s&&s!=="***"&&window.AWSC.use(n,function(f,u){u.init({appkey:s,scene:o,renderTo:"captcha",success:function(d){a(`SessionId=${d.sessionId}&AccessKeyId=${r}&Scene=${o}&AppKey=${s}&Token=${d.token}&Sig=${d.sig}&RemoteIp=192.168.0.1`)}})}),clearInterval(l))},300);break}case"GEETEST":{let l=!1;const f=setInterval(()=>{if(window.initGeetest4||c("https://static.geetest.com/v4/gt4.js"),window.initGeetest4&&r&&!l){const u=String(r);window.initGeetest4({captchaId:u,product:"float"},function(d){l||(d.appendTo("#captcha"),l=!0),d.onSuccess(function(){const h=d.getValidate();a(`lot_number=${h.lot_number}&captcha_output=${h.captcha_output}&pass_token=${h.pass_token}&gen_time=${h.gen_time}&captcha_id=${r}`)})}),clearInterval(f)}},500);break}case"Cloudflare Turnstile":{const l=setInterval(()=>{window.turnstile||c("https://challenges.cloudflare.com/turnstile/v0/api.js"),window.turnstile&&window.turnstile.render&&(window.turnstile.render("#captcha",{sitekey:r,callback:a}),clearInterval(l))},300);break}}},[t,n,r,i,o,s]),_e.jsx("div",{id:"captcha"})},TU=e=>{const{t}=su.useTranslation(),{owner:n,name:r,visible:i,onOk:o,onCancel:s,isCurrentProvider:a}=e,[c,l]=Tt.useState("none"),[f,u]=Tt.useState(""),[d,h]=Tt.useState(""),[p,m]=Tt.useState(""),[b,g]=Tt.useState(""),[y,w]=Tt.useState(""),[v,x]=Tt.useState(!1),[S,T]=Tt.useState(""),[E,_]=Tt.useState(""),I=Tt.useRef(null);Tt.useEffect(()=>{i?B():(A(),x(!1))},[i]);const L=()=>{o==null||o(c,E,d)},A=()=>{_(""),s==null||s()},B=()=>{iv(n,r,a).then(H=>{H.type==="none"?L():H.type==="Default"?(x(!0),h(H.captchaId),T(H.captchaImage),l("Default")):(x(!0),l(H.type),u(H.clientId),h(H.clientSecret),m(H.subType),g(H.clientId2),w(H.clientSecret2))})},C=()=>_e.jsxs("div",{className:"flex flex-col items-center",children:[_e.jsx("div",{className:"bg-no-repeat mb-4 border border-current rounded w-[200px] h-[80px]",style:{backgroundImage:`url('data:image/png;base64,${S}')`}}),_e.jsx("input",{className:"input input-bordered w-[200px]",type:"text",ref:I,value:E,placeholder:t("general.captcha"),onKeyDown:H=>H.key==="Enter"?L():null,onChange:H=>_(H.target.value)})]}),O=H=>{_(H)},j=()=>c==="Default"?C():_e.jsx("div",{className:"flex justify-center",children:_e.jsx(IU,{captchaType:c,subType:p,siteKey:f,clientSecret:d,onChange:O,clientId2:b,clientSecret2:y})}),F=()=>{let H=!1;return c==="Default"?/^\d{5}$/.test(E)||(H=!0):E===""&&(H=!0),[_e.jsx("button",{className:"btn",onClick:A,children:"Cancel"},"closebtn"),_e.jsx("button",{className:"btn btn-primary",disabled:H,onClick:L,children:"OK"},"okbtn")]};return _e.jsx("dialog",{id:"captcha-modal",className:"modal",children:_e.jsxs("div",{className:"modal-box",children:[_e.jsx("div",{className:"mt-4 mb-8",children:j()}),_e.jsxs("div",{className:"modal-action",children:[_e.jsx("form",{method:"dialog",className:"modal-backdrop",children:_e.jsx("button",{children:"Close"})}),_e.jsx("form",{method:"dialog",className:"flex gap-3",children:F()})]})]})})},BU=({value:e,disabled:t,textBefore:n,onChange:r,onButtonClickArgs:i,application:o,method:s,countryCode:a})=>{const{t:c}=su.useTranslation(),[l,f]=Tt.useState(!1),[u,d]=Tt.useState(0),[h,p]=Tt.useState(!1),m=Tt.useRef(null),b=(w=60)=>{let v=w;d(v);const x=()=>{v--,d(v),v!==0&&setTimeout(x,1e3)};setTimeout(x,1e3)},g=(w,v,x)=>{f(!1),p(!0),rv(w,v,x,s,a,...i).then(S=>{p(!1),S&&b(60)})},y=()=>{f(!1)};return Tt.useEffect(()=>{m.current=document.getElementById("captcha-modal")},[]),Tt.useEffect(()=>{m.current&&(l?m.current.showModal():m.current.close())},[l]),_e.jsxs(Tt.Fragment,{children:[_e.jsxs("div",{className:"flex",children:[_e.jsx("input",{className:"input",disabled:t,value:e,placeholder:"Enter your code",onChange:w=>r(w.target.value),autoComplete:"one-time-code"}),_e.jsx("button",{className:"btn",disabled:t||u>0,onClick:()=>f(!0),children:u>0?`${u} s`:c(h?"code.sending":"code.sendCode")})]}),_e.jsx(TU,{owner:o.owner,name:o.name,visible:l,onOk:g,onCancel:y,isCurrentProvider:!1})]})};var PU=Object.create,Id=Object.defineProperty,OU=Object.defineProperties,MU=Object.getOwnPropertyDescriptor,LU=Object.getOwnPropertyDescriptors,RU=Object.getOwnPropertyNames,ov=Object.getOwnPropertySymbols,jU=Object.getPrototypeOf,sv=Object.prototype.hasOwnProperty,NU=Object.prototype.propertyIsEnumerable,av=(e,t,n)=>t in e?Id(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ii=(e,t)=>{for(var n in t||(t={}))sv.call(t,n)&&av(e,n,t[n]);if(ov)for(var n of ov(t))NU.call(t,n)&&av(e,n,t[n]);return e},cv=(e,t)=>OU(e,LU(t)),$U=(e,t)=>{for(var n in t)Id(e,n,{get:t[n],enumerable:!0})},lv=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of RU(t))!sv.call(e,i)&&i!==n&&Id(e,i,{get:()=>t[i],enumerable:!(r=MU(t,i))||r.enumerable});return e},fr=(e,t,n)=>(n=e!=null?PU(jU(e)):{},lv(!e||!e.__esModule?Id(n,"default",{value:e,enumerable:!0}):n,e)),FU=e=>lv(Id({},"__esModule",{value:!0}),e),uv={};$U(uv,{AmazonLoginButton:()=>aH,AppleLoginButton:()=>CH,BufferLoginButton:()=>wH,DiscordLoginButton:()=>IH,FacebookLoginButton:()=>QU,GithubLoginButton:()=>tH,GitlabLoginButton:()=>QH,GoogleLoginButton:()=>JU,InstagramLoginButton:()=>uH,LinkedInLoginButton:()=>hH,MetamaskLoginButton:()=>WH,MicrosoftLoginButton:()=>gH,OktaLoginButton:()=>PH,SlackLoginButton:()=>LH,TelegramLoginButton:()=>xH,TikTokLoginButton:()=>zH,TwitterLoginButton:()=>iH,XLoginButton:()=>JH,YahooLoginButton:()=>NH,ZaloLoginButton:()=>DH,createButton:()=>Mr});var er=FU(uv),h3=fr(Tt),Ja=fr(Tt),DU=fr(Tt),UU=({name:e,size:t,format:n})=>DU.default.createElement("i",{className:n(e),style:{fontSize:t}}),HU=UU,fv=fr(Tt),zU=({type:e,size:t,format:n,color:r="#FFFFFF"})=>typeof e=="string"?fv.default.createElement(HU,Ii({},{format:n,name:e,size:t})):fv.default.createElement(e,{size:t,color:r}),GU="#FFFFFF",VU=e=>{const[t,n]=(0,Ja.useState)(!1),[r,i]=(0,Ja.useState)(!1),o=()=>{var _;i(!0),(_=e.onMouseEnter)==null||_.call(e)},s=()=>{var _;i(!1),(_=e.onMouseLeave)==null||_.call(e)},a=()=>n(!0),c=()=>n(!1),l=()=>{var _;return(_=e.onClick)==null?void 0:_.call(e)},{activeStyle:f,align:u="left",text:d,children:h=d,className:p,icon:m,iconFormat:b=_=>_,iconSize:g="26px",iconColor:y=GU,preventActiveStyles:w=!1,size:v="50px",style:x,disabled:S,type:T="button"}=e,E=WU(p3.button,{activeStyle:w?x:f,customStyle:x,active:r||t,size:v});return Ja.default.createElement("button",Ii({style:E,onClick:l,onMouseEnter:o,onMouseLeave:s,onFocus:a,onBlur:c},{className:p,disabled:S,type:T}),Ja.default.createElement("div",{style:p3.flex},!dv(g)&&!!m&&Ja.default.createElement("div",{style:{display:"flex",justifyContent:"center",minWidth:g}},Ja.default.createElement(zU,{type:m,size:g,format:b,color:y})),!dv(g)&&Ja.default.createElement("div",{style:p3.divider}),Ja.default.createElement("div",{style:{textAlign:u,width:"100%"}},h)))},dv=e=>e==="0"||e==="0px"||e===0,WU=(e,{size:t,customStyle:n,active:r,activeStyle:i})=>Ii(Ii(cv(Ii({},e),{height:t}),n),r&&i),p3={button:{display:"block",border:0,borderRadius:3,boxShadow:"rgba(0, 0, 0, 0.5) 0 1px 2px",color:"#ffffff",cursor:"pointer",fontSize:"19px",margin:"5px",width:"calc(100% - 10px)",overflow:"hidden",padding:"0 10px",userSelect:"none"},divider:{width:"10px"},flex:{alignItems:"center",display:"flex",height:"100%"}},qU=fr(Tt),Mr=e=>t=>{const n=cv(Ii(Ii({activeStyle:Ii(Ii({},e==null?void 0:e.activeStyle),t.activeStyle)},e),t),{style:Ii(Ii({},e==null?void 0:e.style),t.style)});return qU.default.createElement(VU,Ii({},n))},ZU={activeStyle:{background:"#293e69"},icon:KU,style:{background:"#3b5998"},text:"Log in with Facebook"},QU=Mr(ZU);function KU({size:e,color:t}){return h3.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 90 90"},h3.default.createElement("g",null,h3.default.createElement("path",{d:"M90,15.001C90,7.119,82.884,0,75,0H15C7.116,0,0,7.119,0,15.001v59.998 C0,82.881,7.116,90,15.001,90H45V56H34V41h11v-5.844C45,25.077,52.568,16,61.875,16H74v15H61.875C60.548,31,59,32.611,59,35.024V41 h15v15H59v34h16c7.884,0,15-7.119,15-15.001V15.001z",fill:t})))}var dr=fr(Tt),YU={activeStyle:{background:"#EFF0EE"},icon:XU,style:{background:"white",color:"black"},text:"Log in with Google"},JU=Mr(YU);function XU({size:e}){return dr.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",width:e,height:e},dr.default.createElement("linearGradient",{id:"95yY7w43Oj6n2vH63j6HJb",x1:"29.401",x2:"29.401",y1:"4.064",y2:"106.734",gradientTransform:"matrix(1 0 0 -1 0 66)",gradientUnits:"userSpaceOnUse"},dr.default.createElement("stop",{offset:"0",stopColor:"#ff5840"}),dr.default.createElement("stop",{offset:".007",stopColor:"#ff5840"}),dr.default.createElement("stop",{offset:".989",stopColor:"#fa528c"}),dr.default.createElement("stop",{offset:"1",stopColor:"#fa528c"})),dr.default.createElement("path",{fill:"url(#95yY7w43Oj6n2vH63j6HJb)",d:`M47.46,15.5l-1.37,1.48c-1.34,1.44-3.5,1.67-5.15,0.6c-2.71-1.75-6.43-3.13-11-2.37 c-4.94,0.83-9.17,3.85-11.64,
|
|
35
|
+
`,l=document.createElement("dialog");l.innerHTML=c,l.id="WechatOfficialAccountModal",document.body.appendChild(l),s()}AU(`${t.owner}/${t.name}`).then(async i=>{if(i.status!=="ok"){ji("error",i==null?void 0:i.msg);return}const o=setInterval(await SU,1e3,e,t,i.data2,n);r(i,o)})}function nv(e,t){return fetch(`${ki.casdoor}/api/get-invitation-info?code=${e}&applicationId=${encodeURIComponent(t)}`,{method:"GET",credentials:"include",headers:{"Accept-Language":aa()}}).then(n=>n.json())}function rv(e,t,n,r,i="",o,s,a,c=""){const l=new FormData;return l.append("captchaType",e),l.append("captchaToken",t),l.append("clientSecret",n),l.append("method",r),l.append("countryCode",i),l.append("dest",o),l.append("type",s),l.append("applicationId","admin/"+a),l.append("checkUser",c),fetch(`${ki.casdoor}/api/send-verification-code`,{method:"POST",credentials:"include",body:l,headers:{"Accept-Language":aa()}}).then(f=>f.json()).then(f=>f.status==="ok"?(ji("success","Verification code sent"),!0):(ji("error",f.msg),!1))}function iv(e,t,n){return fetch(`${ki.casdoor}/api/get-captcha?applicationId=${e}/${encodeURIComponent(t)}&isCurrentProvider=${n}`,{method:"GET",headers:{"Accept-Language":aa()}}).then(r=>r.json()).then(r=>r.data)}const IU=e=>{const{captchaType:t,subType:n,siteKey:r,clientSecret:i,clientId2:o,clientSecret2:s,onChange:a}=e,c=l=>{const f=document.createElement("script");f.async=!1,f.src=l,document.getElementsByTagName("body")[0].appendChild(f)};return Tt.useEffect(()=>{switch(t){case"reCAPTCHA":{const l=setInterval(()=>{window.grecaptcha||c("https://recaptcha.net/recaptcha/api.js"),window.grecaptcha&&window.grecaptcha.render&&(window.grecaptcha.render("captcha",{sitekey:r,callback:a}),clearInterval(l))},300);break}case"hCaptcha":{const l=setInterval(()=>{window.hcaptcha||c("https://js.hcaptcha.com/1/api.js"),window.hcaptcha&&window.hcaptcha.render&&(window.hcaptcha.render("captcha",{sitekey:r,callback:a}),clearInterval(l))},300);break}case"Aliyun Captcha":{const l=setInterval(()=>{window.AWSC||c("https://g.alicdn.com/AWSC/AWSC/awsc.js"),window.AWSC&&(s&&s!=="***"&&window.AWSC.use(n,function(f,u){u.init({appkey:s,scene:o,renderTo:"captcha",success:function(d){a(`SessionId=${d.sessionId}&AccessKeyId=${r}&Scene=${o}&AppKey=${s}&Token=${d.token}&Sig=${d.sig}&RemoteIp=192.168.0.1`)}})}),clearInterval(l))},300);break}case"GEETEST":{let l=!1;const f=setInterval(()=>{if(window.initGeetest4||c("https://static.geetest.com/v4/gt4.js"),window.initGeetest4&&r&&!l){const u=String(r);window.initGeetest4({captchaId:u,product:"float"},function(d){l||(d.appendTo("#captcha"),l=!0),d.onSuccess(function(){const h=d.getValidate();a(`lot_number=${h.lot_number}&captcha_output=${h.captcha_output}&pass_token=${h.pass_token}&gen_time=${h.gen_time}&captcha_id=${r}`)})}),clearInterval(f)}},500);break}case"Cloudflare Turnstile":{const l=setInterval(()=>{window.turnstile||c("https://challenges.cloudflare.com/turnstile/v0/api.js"),window.turnstile&&window.turnstile.render&&(window.turnstile.render("#captcha",{sitekey:r,callback:a}),clearInterval(l))},300);break}}},[t,n,r,i,o,s]),_e.jsx("div",{id:"captcha"})},TU=e=>{const{t}=su.useTranslation(),{owner:n,name:r,visible:i,onOk:o,onCancel:s,isCurrentProvider:a}=e,[c,l]=Tt.useState("none"),[f,u]=Tt.useState(""),[d,h]=Tt.useState(""),[p,m]=Tt.useState(""),[b,g]=Tt.useState(""),[y,w]=Tt.useState(""),[v,x]=Tt.useState(!1),[S,T]=Tt.useState(""),[E,_]=Tt.useState(""),I=Tt.useRef(null);Tt.useEffect(()=>{i?B():(A(),x(!1))},[i]);const L=()=>{o==null||o(c,E,d)},A=()=>{_(""),s==null||s()},B=()=>{iv(n,r,a).then(H=>{H.type==="none"?L():H.type==="Default"?(x(!0),h(H.captchaId),T(H.captchaImage),l("Default")):(x(!0),l(H.type),u(H.clientId),h(H.clientSecret),m(H.subType),g(H.clientId2),w(H.clientSecret2))})},C=()=>_e.jsxs("div",{className:"flex flex-col items-center",children:[_e.jsx("div",{className:"bg-no-repeat mb-4 border border-current rounded w-[200px] h-[80px]",style:{backgroundImage:`url('data:image/png;base64,${S}')`}}),_e.jsx("input",{className:"input input-bordered w-[200px]",type:"text",ref:I,value:E,placeholder:t("general.captcha"),onKeyDown:H=>H.key==="Enter"?L():null,onChange:H=>_(H.target.value)})]}),O=H=>{_(H)},j=()=>c==="Default"?C():_e.jsx("div",{className:"flex justify-center",children:_e.jsx(IU,{captchaType:c,subType:p,siteKey:f,clientSecret:d,onChange:O,clientId2:b,clientSecret2:y})}),F=()=>{let H=!1;return c==="Default"?/^\d{5}$/.test(E)||(H=!0):E===""&&(H=!0),[_e.jsx("button",{className:"btn",onClick:A,children:"Cancel"},"closebtn"),_e.jsx("button",{className:"btn btn-primary",disabled:H,onClick:L,children:"OK"},"okbtn")]};return _e.jsx("dialog",{id:"captcha-modal",className:"modal",children:_e.jsxs("div",{className:"modal-box",children:[_e.jsx("div",{className:"mt-4 mb-8",children:j()}),_e.jsxs("div",{className:"modal-action",children:[_e.jsx("form",{method:"dialog",className:"modal-backdrop",children:_e.jsx("button",{children:"Close"})}),_e.jsx("form",{method:"dialog",className:"flex gap-3",children:F()})]})]})})},BU=({value:e,disabled:t,textBefore:n,onChange:r,onButtonClickArgs:i,application:o,method:s,countryCode:a})=>{const{t:c}=su.useTranslation(),[l,f]=Tt.useState(!1),[u,d]=Tt.useState(0),[h,p]=Tt.useState(!1),m=Tt.useRef(null),b=(w=60)=>{let v=w;d(v);const x=()=>{v--,d(v),v!==0&&setTimeout(x,1e3)};setTimeout(x,1e3)},g=(w,v,x)=>{f(!1),p(!0),rv(w,v,x,s,a,...i).then(S=>{p(!1),S&&b(60)})},y=()=>{f(!1)};return Tt.useEffect(()=>{m.current=document.getElementById("captcha-modal")},[]),Tt.useEffect(()=>{m.current&&(l?m.current.showModal():m.current.close())},[l]),_e.jsxs(Tt.Fragment,{children:[_e.jsxs("div",{className:"flex",children:[_e.jsx("input",{className:"input",disabled:t,value:e,placeholder:"Enter your code",onChange:w=>r(w.target.value),autoComplete:"one-time-code"}),_e.jsx("button",{className:"btn",disabled:t||u>0,onClick:()=>f(!0),children:u>0?`${u} s`:c(h?"code.sending":"code.sendCode")})]}),_e.jsx(TU,{owner:o.owner,name:o.name,visible:l,onOk:g,onCancel:y,isCurrentProvider:!1})]})};var PU=Object.create,Id=Object.defineProperty,OU=Object.defineProperties,MU=Object.getOwnPropertyDescriptor,LU=Object.getOwnPropertyDescriptors,RU=Object.getOwnPropertyNames,ov=Object.getOwnPropertySymbols,jU=Object.getPrototypeOf,sv=Object.prototype.hasOwnProperty,NU=Object.prototype.propertyIsEnumerable,av=(e,t,n)=>t in e?Id(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ii=(e,t)=>{for(var n in t||(t={}))sv.call(t,n)&&av(e,n,t[n]);if(ov)for(var n of ov(t))NU.call(t,n)&&av(e,n,t[n]);return e},cv=(e,t)=>OU(e,LU(t)),$U=(e,t)=>{for(var n in t)Id(e,n,{get:t[n],enumerable:!0})},lv=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of RU(t))!sv.call(e,i)&&i!==n&&Id(e,i,{get:()=>t[i],enumerable:!(r=MU(t,i))||r.enumerable});return e},fr=(e,t,n)=>(n=e!=null?PU(jU(e)):{},lv(!e||!e.__esModule?Id(n,"default",{value:e,enumerable:!0}):n,e)),FU=e=>lv(Id({},"__esModule",{value:!0}),e),uv={};$U(uv,{AmazonLoginButton:()=>aH,AppleLoginButton:()=>CH,BufferLoginButton:()=>wH,DiscordLoginButton:()=>IH,FacebookLoginButton:()=>QU,GithubLoginButton:()=>tH,GitlabLoginButton:()=>QH,GoogleLoginButton:()=>JU,InstagramLoginButton:()=>uH,LinkedInLoginButton:()=>hH,MetamaskLoginButton:()=>WH,MicrosoftLoginButton:()=>gH,OktaLoginButton:()=>PH,SlackLoginButton:()=>LH,TelegramLoginButton:()=>xH,TikTokLoginButton:()=>zH,TwitterLoginButton:()=>iH,XLoginButton:()=>JH,YahooLoginButton:()=>NH,ZaloLoginButton:()=>DH,createButton:()=>Mr});var er=FU(uv),h3=fr(Tt),Ja=fr(Tt),DU=fr(Tt),UU=({name:e,size:t,format:n})=>DU.default.createElement("i",{className:n(e),style:{fontSize:t}}),HU=UU,fv=fr(Tt),zU=({type:e,size:t,format:n,color:r="#FFFFFF"})=>typeof e=="string"?fv.default.createElement(HU,Ii({},{format:n,name:e,size:t})):fv.default.createElement(e,{size:t,color:r}),GU="#FFFFFF",VU=e=>{const[t,n]=(0,Ja.useState)(!1),[r,i]=(0,Ja.useState)(!1),o=()=>{var _;i(!0),(_=e.onMouseEnter)==null||_.call(e)},s=()=>{var _;i(!1),(_=e.onMouseLeave)==null||_.call(e)},a=()=>n(!0),c=()=>n(!1),l=()=>{var _;return(_=e.onClick)==null?void 0:_.call(e)},{activeStyle:f,align:u="left",text:d,children:h=d,className:p,icon:m,iconFormat:b=_=>_,iconSize:g="26px",iconColor:y=GU,preventActiveStyles:w=!1,size:v="50px",style:x,disabled:S,type:T="button"}=e,E=WU(p3.button,{activeStyle:w?x:f,customStyle:x,active:r||t,size:v});return Ja.default.createElement("button",Ii({style:E,onClick:l,onMouseEnter:o,onMouseLeave:s,onFocus:a,onBlur:c},{className:p,disabled:S,type:T}),Ja.default.createElement("div",{style:p3.flex},!dv(g)&&!!m&&Ja.default.createElement("div",{style:{display:"flex",justifyContent:"center",minWidth:g}},Ja.default.createElement(zU,{type:m,size:g,format:b,color:y})),!dv(g)&&Ja.default.createElement("div",{style:p3.divider}),Ja.default.createElement("div",{style:{textAlign:u,width:"100%"}},h)))},dv=e=>e==="0"||e==="0px"||e===0,WU=(e,{size:t,customStyle:n,active:r,activeStyle:i})=>Ii(Ii(cv(Ii({},e),{height:t}),n),r&&i),p3={button:{display:"block",border:0,borderRadius:3,boxShadow:"rgba(0, 0, 0, 0.5) 0 1px 2px",color:"#ffffff",cursor:"pointer",fontSize:"19px",margin:"5px",width:"calc(100% - 10px)",overflow:"hidden",padding:"0 10px",userSelect:"none"},divider:{width:"10px"},flex:{alignItems:"center",display:"flex",height:"100%"}},qU=fr(Tt),Mr=e=>t=>{const n=cv(Ii(Ii({activeStyle:Ii(Ii({},e==null?void 0:e.activeStyle),t.activeStyle)},e),t),{style:Ii(Ii({},e==null?void 0:e.style),t.style)});return qU.default.createElement(VU,Ii({},n))},ZU={activeStyle:{background:"#293e69"},icon:KU,style:{background:"#3b5998"},text:"Log in with Facebook"},QU=Mr(ZU);function KU({size:e,color:t}){return h3.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 0 90 90"},h3.default.createElement("g",null,h3.default.createElement("path",{d:"M90,15.001C90,7.119,82.884,0,75,0H15C7.116,0,0,7.119,0,15.001v59.998 C0,82.881,7.116,90,15.001,90H45V56H34V41h11v-5.844C45,25.077,52.568,16,61.875,16H74v15H61.875C60.548,31,59,32.611,59,35.024V41 h15v15H59v34h16c7.884,0,15-7.119,15-15.001V15.001z",fill:t})))}var dr=fr(Tt),YU={activeStyle:{background:"#EFF0EE"},icon:XU,style:{background:"white",color:"black"},text:"Log in with Google"},JU=Mr(YU);function XU({size:e}){return dr.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 64 64",width:e,height:e},dr.default.createElement("linearGradient",{id:"95yY7w43Oj6n2vH63j6HJb",x1:"29.401",x2:"29.401",y1:"4.064",y2:"106.734",gradientTransform:"matrix(1 0 0 -1 0 66)",gradientUnits:"userSpaceOnUse"},dr.default.createElement("stop",{offset:"0",stopColor:"#ff5840"}),dr.default.createElement("stop",{offset:".007",stopColor:"#ff5840"}),dr.default.createElement("stop",{offset:".989",stopColor:"#fa528c"}),dr.default.createElement("stop",{offset:"1",stopColor:"#fa528c"})),dr.default.createElement("path",{fill:"url(#95yY7w43Oj6n2vH63j6HJb)",d:`M47.46,15.5l-1.37,1.48c-1.34,1.44-3.5,1.67-5.15,0.6c-2.71-1.75-6.43-3.13-11-2.37 c-4.94,0.83-9.17,3.85-11.64,
|
|
36
36
|
7.97l-8.03-6.08C14.99,9.82,23.2,5,32.5,5c5,0,9.94,1.56,14.27,4.46 C48.81,10.83,49.13,13.71,47.46,15.5z`}),dr.default.createElement("linearGradient",{id:"95yY7w43Oj6n2vH63j6HJc",x1:"12.148",x2:"12.148",y1:".872",y2:"47.812",gradientTransform:"matrix(1 0 0 -1 0 66)",gradientUnits:"userSpaceOnUse"},dr.default.createElement("stop",{offset:"0",stopColor:"#feaa53"}),dr.default.createElement("stop",{offset:".612",stopColor:"#ffcd49"}),dr.default.createElement("stop",{offset:"1",stopColor:"#ffde44"})),dr.default.createElement("path",{fill:"url(#95yY7w43Oj6n2vH63j6HJc)",d:`M16.01,30.91c-0.09,2.47,0.37,4.83,1.27,6.96l-8.21,6.05c-1.35-2.51-2.3-5.28-2.75-8.22 c-1.06-6.88,0.54-13.38,
|
|
37
37
|
3.95-18.6l8.03,6.08C16.93,25.47,16.1,28.11,16.01,30.91z`}),dr.default.createElement("linearGradient",{id:"95yY7w43Oj6n2vH63j6HJd",x1:"29.76",x2:"29.76",y1:"32.149",y2:"-6.939",gradientTransform:"matrix(1 0 0 -1 0 66)",gradientUnits:"userSpaceOnUse"},dr.default.createElement("stop",{offset:"0",stopColor:"#42d778"}),dr.default.createElement("stop",{offset:".428",stopColor:"#3dca76"}),dr.default.createElement("stop",{offset:"1",stopColor:"#34b171"})),dr.default.createElement("path",{fill:"url(#95yY7w43Oj6n2vH63j6HJd)",d:`M50.45,51.28c-4.55,4.07-10.61,6.57-17.36,6.71C22.91,58.2,13.66,52.53,9.07,43.92l8.21-6.05 C19.78,43.81,
|
|
38
38
|
25.67,48,32.5,48c3.94,0,7.52-1.28,10.33-3.44L50.45,51.28z`}),dr.default.createElement("linearGradient",{id:"95yY7w43Oj6n2vH63j6HJe",x1:"46",x2:"46",y1:"3.638",y2:"35.593",gradientTransform:"matrix(1 0 0 -1 0 66)",gradientUnits:"userSpaceOnUse"},dr.default.createElement("stop",{offset:"0",stopColor:"#155cde"}),dr.default.createElement("stop",{offset:".278",stopColor:"#1f7fe5"}),dr.default.createElement("stop",{offset:".569",stopColor:"#279ceb"}),dr.default.createElement("stop",{offset:".82",stopColor:"#2cafef"}),dr.default.createElement("stop",{offset:"1",stopColor:"#2eb5f0"})),dr.default.createElement("path",{fill:"url(#95yY7w43Oj6n2vH63j6HJe)",d:`M59,31.97c0.01,7.73-3.26,14.58-8.55,19.31l-7.62-6.72c2.1-1.61,3.77-3.71,4.84-6.15
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as D, t as ue, q as h, B as f, o as He, s as I, y as ce, C as ze, u as je, d as P, n as w, f as $, g as U, e as te } from "./Web3Auth
|
|
1
|
+
import { i as D, t as ue, q as h, B as f, o as He, s as I, y as ce, C as ze, u as je, d as P, n as w, f as $, g as U, e as te } from "./Web3Auth-hzrmIcT1.js";
|
|
2
2
|
function A(e) {
|
|
3
3
|
if (!Number.isSafeInteger(e) || e < 0)
|
|
4
4
|
throw new Error(`Wrong positive integer: ${e}`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@springmicro/auth",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public",
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"react-social-login-buttons": "^4.1.0",
|
|
55
55
|
"uuid": "^9.0.1"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "9ccb87063f4e9e3a6b51bf48c27c1323b3de2858"
|
|
58
58
|
}
|
|
@@ -182,13 +182,13 @@ export function sendCode(
|
|
|
182
182
|
formData.append("type", type);
|
|
183
183
|
formData.append("applicationId", "admin/" + applicationId);
|
|
184
184
|
formData.append("checkUser", checkUser);
|
|
185
|
-
|
|
185
|
+
|
|
186
186
|
return fetch(`${ROOT_URLS.casdoor}/api/send-verification-code`, {
|
|
187
187
|
method: "POST",
|
|
188
188
|
credentials: "include",
|
|
189
189
|
body: formData,
|
|
190
190
|
headers: {
|
|
191
|
-
"Content-Type": "application/json",
|
|
191
|
+
// "Content-Type": "application/json",
|
|
192
192
|
"Accept-Language": getAcceptLanguage(),
|
|
193
193
|
},
|
|
194
194
|
})
|