astra-modal-test 1.0.10 → 1.0.12
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/README.md +206 -134
- package/dist/{SwapController-DyormRqe.js → SwapController-mYFErPzx.js} +1 -1
- package/dist/{add-C1zIRxeS.js → add-CXtFvysR.js} +1 -1
- package/dist/{all-wallets-5a2U9fLw.js → all-wallets-B9fFXw5x.js} +1 -1
- package/dist/{app-store-2IKrZeLe.js → app-store-BXf1yvR8.js} +1 -1
- package/dist/{apple-DH9ESSKX.js → apple-DtcOcX1n.js} +1 -1
- package/dist/{arrow-bottom-BxAPS43J.js → arrow-bottom-BXeLKqSV.js} +1 -1
- package/dist/{arrow-bottom-circle-Cy5Gjca4.js → arrow-bottom-circle-BVUU200N.js} +1 -1
- package/dist/{arrow-left-CBX7JaHB.js → arrow-left-LguJPyNR.js} +1 -1
- package/dist/{arrow-right-G72bt1-M.js → arrow-right-D9kKZzGG.js} +1 -1
- package/dist/{arrow-top-DCkQG0Dq.js → arrow-top-C5JcaCqz.js} +1 -1
- package/dist/{bank-FNxAUs8r.js → bank-DgbCzr0A.js} +1 -1
- package/dist/{bin-B-c2CIPW.js → bin-ykHym2bC.js} +1 -1
- package/dist/{bitcoin-jk4NLDu1.js → bitcoin-B8jzy_uV.js} +1 -1
- package/dist/{browser-D6w0J78l.js → browser-Bk8u8PAA.js} +1 -1
- package/dist/{card-BLWRKU-r.js → card-DcwQMUca.js} +1 -1
- package/dist/ccip-CwJvuExU.js +239 -0
- package/dist/{checkmark-C1pTfaGr.js → checkmark-D3aEYZ8B.js} +1 -1
- package/dist/{checkmark-bold-UzogCu8g.js → checkmark-bold-5H7N-CDG.js} +1 -1
- package/dist/{chevron-bottom-w_rMAO7x.js → chevron-bottom-BA3C4MR1.js} +1 -1
- package/dist/{chevron-left-DGNJGxiP.js → chevron-left-BX18UWKM.js} +1 -1
- package/dist/{chevron-right-VFQCvCyG.js → chevron-right-DG7ovxTe.js} +1 -1
- package/dist/{chevron-top-DVhFmsKp.js → chevron-top-DHfev7lV.js} +1 -1
- package/dist/{chrome-store-BkYX3All.js → chrome-store-BSVzpGdu.js} +1 -1
- package/dist/{circle-B1A3j4eP.js → circle-SYFB9f2-.js} +1 -1
- package/dist/{clock-BKr-VHDU.js → clock-Cygqlf1g.js} +1 -1
- package/dist/{close-BEacRQ8Q.js → close-B43cuuko.js} +1 -1
- package/dist/{coinPlaceholder-0ZwtMAHl.js → coinPlaceholder-BHdR6bKb.js} +1 -1
- package/dist/{compass-pulK-BFi.js → compass-7S6b6wyA.js} +1 -1
- package/dist/{copy-MWCQE0T4.js → copy-CT53bEwd.js} +1 -1
- package/dist/{cursor-transparent-Co_5p0du.js → cursor-transparent-LmjzjsFm.js} +1 -1
- package/dist/{cursor-C2GVfUuM.js → cursor-vtqRnrF7.js} +1 -1
- package/dist/{desktop-C91EoSqM.js → desktop-Doa7TQsq.js} +1 -1
- package/dist/{disconnect-BWg1-rml.js → disconnect-C5G6Ncu_.js} +1 -1
- package/dist/{discord-Bi0Bfa_e.js → discord-DX7Cl3Ko.js} +1 -1
- package/dist/{email-U2WCRPFh.js → email-CyHWh9wL.js} +1 -1
- package/dist/{embedded-wallet-B6P0kU9A.js → embedded-wallet-BZQImi7s.js} +8 -8
- package/dist/{ethereum-BeZyayQW.js → ethereum-Bwvtk5-_.js} +1 -1
- package/dist/{etherscan-BQTsufjv.js → etherscan-CyVRICvw.js} +1 -1
- package/dist/{exclamation-triangle-JT-YKNXX.js → exclamation-triangle-BDbPL3nL.js} +1 -1
- package/dist/{extension-TnYLHoFA.js → extension-Cx3t2k-R.js} +1 -1
- package/dist/{external-link-Dhgai9sc.js → external-link-DZCYpOZI.js} +1 -1
- package/dist/{facebook-C6XFGRDw.js → facebook-BEnPrhG3.js} +1 -1
- package/dist/{farcaster-CvYbxZQq.js → farcaster-DyBPLb_k.js} +1 -1
- package/dist/{filters-DwVRjAav.js → filters-CTwxivn_.js} +1 -1
- package/dist/{github-BVZSx-z9.js → github-kzQb61pT.js} +1 -1
- package/dist/{google-NbJiQLc5.js → google-DSC-rYNu.js} +1 -1
- package/dist/{help-circle-Cum2UOMJ.js → help-circle-C5XfimVx.js} +1 -1
- package/dist/{id-kRR6YgVc.js → id-B9fQOT4E.js} +1 -1
- package/dist/{image-BWUCRAmp.js → image-1CCj36XM.js} +1 -1
- package/dist/{index-RFYbqmu0.js → index-Bjik7E9u.js} +1 -1
- package/dist/{index-DQ5AZLMt.js → index-C1fgrzi0.js} +16 -16
- package/dist/{index-BZZHE-1t.js → index-CyeGBcX0.js} +1 -1
- package/dist/{index-Dq0LIBEh.js → index-DKEMW9N8.js} +25 -25
- package/dist/{index-2vYoun4O.js → index-LucuShOc.js} +45292 -56275
- package/dist/{info-Br-SBtj3.js → info-Begf9tO0.js} +1 -1
- package/dist/{info-circle-Ew4RoR_Q.js → info-circle-Bo1H2OXh.js} +1 -1
- package/dist/{lightbulb-BRBVOE_b.js → lightbulb-C-SU_z2I.js} +1 -1
- package/dist/{mail-Dzi4AncY.js → mail-CXsYiNAT.js} +1 -1
- package/dist/{mobile-BGGxQ5be.js → mobile-C7bUjgog.js} +1 -1
- package/dist/{more-BmNaKbYJ.js → more-29BC-wmy.js} +1 -1
- package/dist/{network-placeholder-EMiMf4q1.js → network-placeholder-B-x3-6jN.js} +1 -1
- package/dist/{nftPlaceholder-CvSqy3Sd.js → nftPlaceholder-pM-Hmswq.js} +1 -1
- package/dist/nodeflow-sdk.es.js +15 -0
- package/dist/{off-DF9uz0Nc.js → off-DEa_uc7_.js} +1 -1
- package/dist/{onramp-cKzTmKku.js → onramp-ZXqyloYt.js} +10 -10
- package/dist/{play-store-CGxW4MgL.js → play-store-WgSEpEI1.js} +1 -1
- package/dist/{plus-CQ6wWkN0.js → plus-u4UZhYAg.js} +1 -1
- package/dist/{qr-code-VBqx9nAF.js → qr-code-DxZGxoPE.js} +1 -1
- package/dist/{receive-CVzkHmKR.js → receive-Ct_mQWzk.js} +1 -1
- package/dist/{recycle-horizontal-Oq1YtvUx.js → recycle-horizontal-BWVpmHJc.js} +1 -1
- package/dist/{refresh-BDlGAzmY.js → refresh-gi4TfgEU.js} +1 -1
- package/dist/{reown-logo-BlIpXIlG.js → reown-logo-Bg731n4w.js} +1 -1
- package/dist/{search-DfmCmp0m.js → search-BQv7DVJG.js} +1 -1
- package/dist/{send-BXudz514.js → send-BzmnFT2p.js} +1 -1
- package/dist/{send-Cz0L5LmE.js → send-CyxKtrQ9.js} +17 -17
- package/dist/{socials-CDOh8MRf.js → socials-vziOn4zi.js} +5 -5
- package/dist/{solana-CbiyOE-8.js → solana-Dz48awbr.js} +1 -1
- package/dist/{swapHorizontal-DyU1TH_e.js → swapHorizontal-Cwe1PoMp.js} +1 -1
- package/dist/{swapHorizontalBold-CGXW7Ocj.js → swapHorizontalBold-Dxu58sRG.js} +1 -1
- package/dist/{swapHorizontalMedium-2KTcj67d.js → swapHorizontalMedium-DOZZthlB.js} +1 -1
- package/dist/{swapHorizontalRoundedBold-TxFtmmda.js → swapHorizontalRoundedBold-BkIZQXnD.js} +1 -1
- package/dist/{swapVertical-BKD6lxM3.js → swapVertical-LSq66ctC.js} +1 -1
- package/dist/{swaps-BuGsEQaI.js → swaps-C2EO6dQA.js} +9 -9
- package/dist/{telegram-CAsl9DeG.js → telegram-ITq9s69Y.js} +1 -1
- package/dist/{three-dots-BoE2aHZi.js → three-dots-JH3A1TFR.js} +1 -1
- package/dist/{transactions-C1NtsnD6.js → transactions-DpMVZVap.js} +1 -1
- package/dist/{twitch-CvkZZxgT.js → twitch-BKs5FlDf.js} +1 -1
- package/dist/{twitterIcon-CrhnOl_O.js → twitterIcon-CCXEj_Nv.js} +1 -1
- package/dist/{ui-BJcuThPA.js → ui-D5ULRvGt.js} +6 -6
- package/dist/{user-BZRWUXG7.js → user-CBgAUjZv.js} +1 -1
- package/dist/{verify-y9F4DcJ4.js → verify-BPlPPkhG.js} +1 -1
- package/dist/{verify-filled-X_8-BhMk.js → verify-filled-qTRg0OWM.js} +1 -1
- package/dist/{w3m-modal-BX--v1Nc.js → w3m-modal-DSdDfy32.js} +27 -27
- package/dist/{wallet-CIaVVkjQ.js → wallet-BuDEi_8z.js} +1 -1
- package/dist/{wallet-placeholder-Cq1ofde1.js → wallet-placeholder-D4DKTuB_.js} +1 -1
- package/dist/{walletconnect-CINzSCJ3.js → walletconnect-Dt3q5XFc.js} +1 -1
- package/dist/{warning-circle-BvBNhMKH.js → warning-circle-B8Fkc0_4.js} +1 -1
- package/dist/{x-xHY7JehW.js → x-Cm_V3zUI.js} +1 -1
- package/dist/{x-mark-DEmnBt6u.js → x-mark-BVvwdxda.js} +1 -1
- package/package.json +11 -10
- package/.github/workflows/code-quality.yml +0 -43
- package/.github/workflows/publish.yml +0 -64
- package/dist/astra-sdk.es.js +0 -9
- package/dist/ccip-DkYvh7hg.js +0 -149
- package/dist/clsx.m-DCYaa4RU.js +0 -20
- package/dist/index-BDE-2VTp.js +0 -315
- package/dist/index-BjLIiJQa.js +0 -21034
- package/dist/index-CIr4zlVp.js +0 -386
- package/dist/index-ChxXyuZj.js +0 -572
- package/dist/index-D-T7kk3G.js +0 -15911
- package/dist/index-DSX3HrTS.js +0 -10785
- package/dist/secp256k1-CsKSDHNi.js +0 -1257
- package/eslint.config.mjs +0 -41
- package/index.html +0 -13
- package/public/font/ClashDisplay-Variable.ttf +0 -0
- package/public/font/ClashDisplay-Variable.woff +0 -0
- package/public/font/ClashDisplay-Variable.woff2 +0 -0
- package/public/vite.svg +0 -1
- package/src/App.css +0 -170
- package/src/apis/lspApi.js +0 -82
- package/src/apis/request.js +0 -59
- package/src/assets/arrow-right.svg +0 -3
- package/src/assets/astr.svg +0 -13
- package/src/assets/bridge-loading.png +0 -0
- package/src/assets/ln.png +0 -0
- package/src/assets/network/Arbitrum.png +0 -0
- package/src/assets/network/Polygon.png +0 -0
- package/src/assets/network/Solana.png +0 -0
- package/src/assets/network/base.png +0 -0
- package/src/assets/network/botanix.png +0 -0
- package/src/assets/network/bsc.svg +0 -13
- package/src/assets/network/eth.png +0 -0
- package/src/assets/network/lighting.png +0 -0
- package/src/assets/network/ligtning.svg +0 -22
- package/src/assets/network/solona.png +0 -0
- package/src/assets/pay.png +0 -0
- package/src/assets/powerby.svg +0 -14
- package/src/assets/react.svg +0 -1
- package/src/assets/success.svg +0 -3
- package/src/assets/tip.svg +0 -5
- package/src/assets/tokens/sol.png +0 -0
- package/src/assets/tokens/usdc.png +0 -0
- package/src/assets/tokens/usdt.png +0 -0
- package/src/comps/AstraImage.jsx +0 -37
- package/src/comps/AstraModal.jsx +0 -202
- package/src/comps/AstraModalLogo.jsx +0 -29
- package/src/comps/AstraNetwork.jsx +0 -261
- package/src/comps/CheckErc20Button.jsx +0 -28
- package/src/comps/CommonStyle.jsx +0 -4
- package/src/comps/ConnectButton.jsx +0 -19
- package/src/comps/EllipsisMiddle.jsx +0 -42
- package/src/comps/ResultModal.jsx +0 -312
- package/src/comps/ToLightning.jsx +0 -653
- package/src/comps/ToToken.jsx +0 -550
- package/src/constants/index.js +0 -21
- package/src/font/ClashDisplay-Variable.ttf +0 -0
- package/src/font/ClashDisplay-Variable.woff +0 -0
- package/src/font/ClashDisplay-Variable.woff2 +0 -0
- package/src/hooks/useContract.js +0 -179
- package/src/hooks/useGetMinAndMax.js +0 -48
- package/src/hooks/useLspApi.js +0 -70
- package/src/hooks/useParseInvoice.js +0 -95
- package/src/index.css +0 -69
- package/src/index.jsx +0 -161
- package/src/lib/bolt11.min.js +0 -1
- package/src/main.jsx +0 -75
- package/src/store/index.js +0 -25
- package/src/theme.js +0 -108
- package/src/utils/index.js +0 -267
- package/vite.config.js +0 -50
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aA as q, aT as C, Y as O, V as y, P as g, aU as B, O as h, aV as j, M as z, Q as _, S as T, _ as A, R as Y, aH as x, a4 as X, a5 as J, E as W, J as F, K as m, a9 as v, aa as w, I as H, a8 as Z, a3 as G, a6 as Q } from "./index-LucuShOc.js";
|
|
2
2
|
const o = {
|
|
3
3
|
INVALID_PAYMENT_CONFIG: "INVALID_PAYMENT_CONFIG",
|
|
4
4
|
INVALID_RECIPIENT: "INVALID_RECIPIENT",
|
|
@@ -12,7 +12,7 @@ const o = {
|
|
|
12
12
|
ASSET_NOT_SUPPORTED: "ASSET_NOT_SUPPORTED",
|
|
13
13
|
UNABLE_TO_GET_PAY_URL: "UNABLE_TO_GET_PAY_URL",
|
|
14
14
|
UNABLE_TO_GET_BUY_STATUS: "UNABLE_TO_GET_BUY_STATUS"
|
|
15
|
-
},
|
|
15
|
+
}, N = {
|
|
16
16
|
[o.INVALID_PAYMENT_CONFIG]: "Invalid payment configuration",
|
|
17
17
|
[o.INVALID_RECIPIENT]: "Invalid recipient address",
|
|
18
18
|
[o.INVALID_ASSET]: "Invalid asset specified",
|
|
@@ -28,10 +28,10 @@ const o = {
|
|
|
28
28
|
};
|
|
29
29
|
class c extends Error {
|
|
30
30
|
get message() {
|
|
31
|
-
return
|
|
31
|
+
return N[this.code];
|
|
32
32
|
}
|
|
33
33
|
constructor(e, s) {
|
|
34
|
-
super(
|
|
34
|
+
super(N[e]), this.name = "AppKitPayError", this.code = e, this.details = s, Error.captureStackTrace && Error.captureStackTrace(this, c);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
const ee = "https://rpc.walletconnect.org/v1/json-rpc";
|
|
@@ -240,7 +240,7 @@ const $ = 0, k = "unknown", n = z({
|
|
|
240
240
|
});
|
|
241
241
|
n.exchanges = t.exchanges.slice(0, 2);
|
|
242
242
|
} catch {
|
|
243
|
-
throw T.showError(
|
|
243
|
+
throw T.showError(N.UNABLE_TO_GET_EXCHANGES), new c(o.UNABLE_TO_GET_EXCHANGES);
|
|
244
244
|
} finally {
|
|
245
245
|
n.isLoading = !1;
|
|
246
246
|
}
|
|
@@ -314,13 +314,13 @@ const $ = 0, k = "unknown", n = z({
|
|
|
314
314
|
const i = t.openInNewTab ?? !0 ? "_blank" : "_self";
|
|
315
315
|
return O.openHref(a.url, i), a;
|
|
316
316
|
} catch (a) {
|
|
317
|
-
throw a instanceof c ? n.error = a.message : n.error =
|
|
317
|
+
throw a instanceof c ? n.error = a.message : n.error = N.GENERIC_PAYMENT_ERROR, new c(o.UNABLE_TO_GET_PAY_URL);
|
|
318
318
|
}
|
|
319
319
|
},
|
|
320
320
|
subscribeEvents() {
|
|
321
321
|
n.isConfigured || (h.subscribeKey("connections", (t) => {
|
|
322
322
|
t.size > 0 && this.handlePayment();
|
|
323
|
-
}),
|
|
323
|
+
}), A.subscribeKey("caipAddress", (t) => {
|
|
324
324
|
const e = h.hasAnyConnection(g.CONNECTOR_ID.WALLET_CONNECT);
|
|
325
325
|
t && (e ? setTimeout(() => {
|
|
326
326
|
this.handlePayment();
|
|
@@ -332,7 +332,7 @@ const $ = 0, k = "unknown", n = z({
|
|
|
332
332
|
type: "wallet",
|
|
333
333
|
status: "IN_PROGRESS"
|
|
334
334
|
};
|
|
335
|
-
const t =
|
|
335
|
+
const t = A.state.caipAddress;
|
|
336
336
|
if (!t)
|
|
337
337
|
return;
|
|
338
338
|
const { chainId: e, address: s } = C.parseCaipAddress(t), a = y.state.activeChain;
|
|
@@ -374,7 +374,7 @@ const $ = 0, k = "unknown", n = z({
|
|
|
374
374
|
throw new c(o.INVALID_CHAIN_NAMESPACE);
|
|
375
375
|
}
|
|
376
376
|
} catch (l) {
|
|
377
|
-
l instanceof c ? n.error = l.message : n.error =
|
|
377
|
+
l instanceof c ? n.error = l.message : n.error = N.GENERIC_PAYMENT_ERROR, n.currentPayment.status = "FAILED", T.showError(n.error);
|
|
378
378
|
} finally {
|
|
379
379
|
n.isPaymentInProgress = !1;
|
|
380
380
|
}
|
|
@@ -394,7 +394,7 @@ const $ = 0, k = "unknown", n = z({
|
|
|
394
394
|
throw new c(o.INVALID_AMOUNT);
|
|
395
395
|
},
|
|
396
396
|
handlePayWithWallet() {
|
|
397
|
-
const t =
|
|
397
|
+
const t = A.state.caipAddress;
|
|
398
398
|
if (!t) {
|
|
399
399
|
Y.push("Connect");
|
|
400
400
|
return;
|
|
@@ -425,7 +425,7 @@ const $ = 0, k = "unknown", n = z({
|
|
|
425
425
|
openInNewTab: n.openInNewTab
|
|
426
426
|
};
|
|
427
427
|
} catch (e) {
|
|
428
|
-
return e instanceof c ? n.error = e.message : n.error =
|
|
428
|
+
return e instanceof c ? n.error = e.message : n.error = N.GENERIC_PAYMENT_ERROR, n.isPaymentInProgress = !1, T.showError(n.error), null;
|
|
429
429
|
}
|
|
430
430
|
},
|
|
431
431
|
async getBuyStatus(t, e) {
|
|
@@ -528,10 +528,10 @@ var E = function(t, e, s, a) {
|
|
|
528
528
|
};
|
|
529
529
|
let p = class extends F {
|
|
530
530
|
constructor() {
|
|
531
|
-
super(), this.unsubscribe = [], this.amount = "", this.tokenSymbol = "", this.networkName = "", this.exchanges = u.state.exchanges, this.isLoading = u.state.isLoading, this.loadingExchangeId = null, this.connectedWalletInfo =
|
|
531
|
+
super(), this.unsubscribe = [], this.amount = "", this.tokenSymbol = "", this.networkName = "", this.exchanges = u.state.exchanges, this.isLoading = u.state.isLoading, this.loadingExchangeId = null, this.connectedWalletInfo = A.state.connectedWalletInfo, this.initializePaymentDetails(), this.unsubscribe.push(u.subscribeKey("exchanges", (e) => this.exchanges = e)), this.unsubscribe.push(u.subscribeKey("isLoading", (e) => this.isLoading = e)), this.unsubscribe.push(A.subscribe((e) => this.connectedWalletInfo = e.connectedWalletInfo)), u.fetchExchanges();
|
|
532
532
|
}
|
|
533
533
|
get isWalletConnected() {
|
|
534
|
-
return
|
|
534
|
+
return A.state.status === "connected";
|
|
535
535
|
}
|
|
536
536
|
render() {
|
|
537
537
|
return m`
|
|
@@ -813,7 +813,7 @@ let I = class extends F {
|
|
|
813
813
|
}
|
|
814
814
|
}
|
|
815
815
|
if (e.type === "wallet") {
|
|
816
|
-
const a = (s =
|
|
816
|
+
const a = (s = A.state.connectedWalletInfo) == null ? void 0 : s.icon;
|
|
817
817
|
if (a)
|
|
818
818
|
return a;
|
|
819
819
|
const r = y.state.activeChain;
|
|
@@ -851,7 +851,7 @@ const ye = 3e5;
|
|
|
851
851
|
async function he(t) {
|
|
852
852
|
return u.handleOpenPay(t);
|
|
853
853
|
}
|
|
854
|
-
async function
|
|
854
|
+
async function Ne(t, e = ye) {
|
|
855
855
|
if (e <= 0)
|
|
856
856
|
throw new c(o.INVALID_PAYMENT_CONFIG, "Timeout must be greater than 0");
|
|
857
857
|
try {
|
|
@@ -1051,7 +1051,7 @@ export {
|
|
|
1051
1051
|
he as openPay,
|
|
1052
1052
|
Ue as optimismUSDC,
|
|
1053
1053
|
Oe as optimismUSDT,
|
|
1054
|
-
|
|
1054
|
+
Ne as pay,
|
|
1055
1055
|
Re as polygonUSDC,
|
|
1056
1056
|
Me as polygonUSDT,
|
|
1057
1057
|
Ge as solanaSOL,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as a, b as s, d as i, f as n, W as o, h as W, i as w, k as m, a as c, q as V, c as l, l as u, u as A, m as C, n as p, p as r, o as B, r as h, s as g, e as k, v as N, w as S, j as K, g as d, C as f, x, z as I, B as b, y as v, t as M } from "./index-
|
|
1
|
+
import { A as a, b as s, d as i, f as n, W as o, h as W, i as w, k as m, a as c, q as V, c as l, l as u, u as A, m as C, n as p, p as r, o as B, r as h, s as g, e as k, v as N, w as S, j as K, g as d, C as f, x, z as I, B as b, y as v, t as M } from "./index-LucuShOc.js";
|
|
2
2
|
export {
|
|
3
3
|
a as AppKitAccountButton,
|
|
4
4
|
s as AppKitButton,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { E, F as U, G as M, H as C, I as d, J as v, K as u,
|
|
1
|
+
import { E, F as U, G as M, H as C, I as d, J as v, K as u, aa as m, a7 as D, aW as A, R as l, a3 as h, Y as O, S as f, V, O as N, aA as x, Q as c, aH as W, aP as H, aR as B, aN as q, P as G } from "./index-LucuShOc.js";
|
|
2
2
|
const K = E`
|
|
3
3
|
:host {
|
|
4
4
|
position: relative;
|
|
@@ -178,13 +178,13 @@ let w = class extends v {
|
|
|
178
178
|
const n = e.target, o = this.getInputElement(n);
|
|
179
179
|
if (o) {
|
|
180
180
|
const i = o.value;
|
|
181
|
-
e.inputType === "insertFromPaste" ? this.handlePaste(o, i, t) :
|
|
181
|
+
e.inputType === "insertFromPaste" ? this.handlePaste(o, i, t) : D.isNumber(i) && e.data ? (this.updateInput(o, t, e.data), this.focusInputField("next", t)) : this.updateInput(o, t, "");
|
|
182
182
|
}
|
|
183
183
|
this.dispatchInputChangeEvent();
|
|
184
184
|
}
|
|
185
185
|
handlePaste(e, t, n) {
|
|
186
186
|
const o = t[0];
|
|
187
|
-
if (o &&
|
|
187
|
+
if (o && D.isNumber(o)) {
|
|
188
188
|
this.updateInput(e, n, o);
|
|
189
189
|
const r = t.substring(1);
|
|
190
190
|
if (n + 1 < this.length && r.length) {
|
|
@@ -221,7 +221,7 @@ _([
|
|
|
221
221
|
w = _([
|
|
222
222
|
d("wui-otp")
|
|
223
223
|
], w);
|
|
224
|
-
const
|
|
224
|
+
const J = E`
|
|
225
225
|
wui-loading-spinner {
|
|
226
226
|
margin: 9px auto;
|
|
227
227
|
}
|
|
@@ -236,8 +236,8 @@ var R = function(a, e, t, n) {
|
|
|
236
236
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(a, e, t, n);
|
|
237
237
|
else for (var s = a.length - 1; s >= 0; s--) (r = a[s]) && (i = (o < 3 ? r(i) : o > 3 ? r(e, t, i) : r(e, t)) || i);
|
|
238
238
|
return o > 3 && i && Object.defineProperty(e, t, i), i;
|
|
239
|
-
},
|
|
240
|
-
let p =
|
|
239
|
+
}, S;
|
|
240
|
+
let p = S = class extends v {
|
|
241
241
|
firstUpdated() {
|
|
242
242
|
this.startOTPTimeout();
|
|
243
243
|
}
|
|
@@ -246,7 +246,7 @@ let p = T = class extends v {
|
|
|
246
246
|
}
|
|
247
247
|
constructor() {
|
|
248
248
|
var e;
|
|
249
|
-
super(), this.loading = !1, this.timeoutTimeLeft =
|
|
249
|
+
super(), this.loading = !1, this.timeoutTimeLeft = A.getTimeToNextEmailLogin(), this.error = "", this.otp = "", this.email = (e = l.state.data) == null ? void 0 : e.email, this.authConnector = h.getAuthConnector();
|
|
250
250
|
}
|
|
251
251
|
render() {
|
|
252
252
|
if (!this.email)
|
|
@@ -299,8 +299,8 @@ let p = T = class extends v {
|
|
|
299
299
|
`;
|
|
300
300
|
}
|
|
301
301
|
startOTPTimeout() {
|
|
302
|
-
this.timeoutTimeLeft =
|
|
303
|
-
this.timeoutTimeLeft > 0 ? this.timeoutTimeLeft =
|
|
302
|
+
this.timeoutTimeLeft = A.getTimeToNextEmailLogin(), this.OTPTimeout = setInterval(() => {
|
|
303
|
+
this.timeoutTimeLeft > 0 ? this.timeoutTimeLeft = A.getTimeToNextEmailLogin() : clearInterval(this.OTPTimeout);
|
|
304
304
|
}, 1e3);
|
|
305
305
|
}
|
|
306
306
|
async onOtpInputChange(e) {
|
|
@@ -336,11 +336,11 @@ let p = T = class extends v {
|
|
|
336
336
|
};
|
|
337
337
|
}
|
|
338
338
|
shouldSubmitOnOtpChange() {
|
|
339
|
-
return this.authConnector && this.otp.length ===
|
|
339
|
+
return this.authConnector && this.otp.length === S.OTP_LENGTH;
|
|
340
340
|
}
|
|
341
341
|
};
|
|
342
342
|
p.OTP_LENGTH = 6;
|
|
343
|
-
p.styles =
|
|
343
|
+
p.styles = J;
|
|
344
344
|
R([
|
|
345
345
|
m()
|
|
346
346
|
], p.prototype, "loading", void 0);
|
|
@@ -350,10 +350,10 @@ R([
|
|
|
350
350
|
R([
|
|
351
351
|
m()
|
|
352
352
|
], p.prototype, "error", void 0);
|
|
353
|
-
p =
|
|
353
|
+
p = S = R([
|
|
354
354
|
d("w3m-email-otp-widget")
|
|
355
355
|
], p);
|
|
356
|
-
var
|
|
356
|
+
var Q = function(a, e, t, n) {
|
|
357
357
|
var o = arguments.length, i = o < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, r;
|
|
358
358
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(a, e, t, n);
|
|
359
359
|
else for (var s = a.length - 1; s >= 0; s--) (r = a[s]) && (i = (o < 3 ? r(i) : o > 3 ? r(e, t, i) : r(e, t)) || i);
|
|
@@ -402,7 +402,7 @@ let L = class extends p {
|
|
|
402
402
|
};
|
|
403
403
|
}
|
|
404
404
|
};
|
|
405
|
-
L =
|
|
405
|
+
L = Q([
|
|
406
406
|
d("w3m-email-verify-otp-view")
|
|
407
407
|
], L);
|
|
408
408
|
const X = E`
|
|
@@ -506,7 +506,7 @@ const Z = E`
|
|
|
506
506
|
position: relative;
|
|
507
507
|
}
|
|
508
508
|
`;
|
|
509
|
-
var
|
|
509
|
+
var P = function(a, e, t, n) {
|
|
510
510
|
var o = arguments.length, i = o < 3 ? e : n === null ? n = Object.getOwnPropertyDescriptor(e, t) : n, r;
|
|
511
511
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function") i = Reflect.decorate(a, e, t, n);
|
|
512
512
|
else for (var s = a.length - 1; s >= 0; s--) (r = a[s]) && (i = (o < 3 ? r(i) : o > 3 ? r(e, t, i) : r(e, t)) || i);
|
|
@@ -515,7 +515,7 @@ var D = function(a, e, t, n) {
|
|
|
515
515
|
let b = class extends v {
|
|
516
516
|
constructor() {
|
|
517
517
|
var e, t;
|
|
518
|
-
super(...arguments), this.formRef =
|
|
518
|
+
super(...arguments), this.formRef = H(), this.initialEmail = ((e = l.state.data) == null ? void 0 : e.email) ?? "", this.redirectView = (t = l.state.data) == null ? void 0 : t.redirectView, this.email = "", this.loading = !1;
|
|
519
519
|
}
|
|
520
520
|
firstUpdated() {
|
|
521
521
|
var e;
|
|
@@ -526,7 +526,7 @@ let b = class extends v {
|
|
|
526
526
|
render() {
|
|
527
527
|
return u`
|
|
528
528
|
<wui-flex flexDirection="column" padding="m" gap="m">
|
|
529
|
-
<form ${
|
|
529
|
+
<form ${B(this.formRef)} @submit=${this.onSubmitEmail.bind(this)}>
|
|
530
530
|
<wui-email-input
|
|
531
531
|
value=${this.initialEmail}
|
|
532
532
|
.disabled=${this.loading}
|
|
@@ -598,13 +598,13 @@ let b = class extends v {
|
|
|
598
598
|
}
|
|
599
599
|
};
|
|
600
600
|
b.styles = Z;
|
|
601
|
-
|
|
601
|
+
P([
|
|
602
602
|
m()
|
|
603
603
|
], b.prototype, "email", void 0);
|
|
604
|
-
|
|
604
|
+
P([
|
|
605
605
|
m()
|
|
606
606
|
], b.prototype, "loading", void 0);
|
|
607
|
-
b =
|
|
607
|
+
b = P([
|
|
608
608
|
d("w3m-update-email-wallet-view")
|
|
609
609
|
], b);
|
|
610
610
|
var ee = function(a, e, t, n) {
|
|
@@ -667,7 +667,7 @@ var z = function(a, e, t, n) {
|
|
|
667
667
|
else for (var s = a.length - 1; s >= 0; s--) (r = a[s]) && (i = (o < 3 ? r(i) : o > 3 ? r(e, t, i) : r(e, t)) || i);
|
|
668
668
|
return o > 3 && i && Object.defineProperty(e, t, i), i;
|
|
669
669
|
};
|
|
670
|
-
let
|
|
670
|
+
let T = class extends v {
|
|
671
671
|
constructor() {
|
|
672
672
|
var e;
|
|
673
673
|
super(), this.authConnector = h.getAuthConnector(), this.isEmailEnabled = (e = x.state.remoteFeatures) == null ? void 0 : e.email, this.isAuthEnabled = this.checkIfAuthEnabled(h.state.connectors), this.connectors = h.state.connectors, h.subscribeKey("connectors", (t) => {
|
|
@@ -694,16 +694,16 @@ let A = class extends v {
|
|
|
694
694
|
};
|
|
695
695
|
z([
|
|
696
696
|
m()
|
|
697
|
-
],
|
|
698
|
-
|
|
697
|
+
], T.prototype, "connectors", void 0);
|
|
698
|
+
T = z([
|
|
699
699
|
d("w3m-email-login-view")
|
|
700
|
-
],
|
|
700
|
+
], T);
|
|
701
701
|
export {
|
|
702
702
|
L as W,
|
|
703
703
|
I as a,
|
|
704
704
|
b,
|
|
705
705
|
F as c,
|
|
706
706
|
j as d,
|
|
707
|
-
|
|
707
|
+
T as e,
|
|
708
708
|
p as f
|
|
709
709
|
};
|