@seams/wallet 0.29.0 → 0.30.0
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 +6 -6
- package/dist/.build-inputs.sha256 +1 -1
- package/dist/esm/SeamsWeb/SeamsWeb.js +2 -0
- package/dist/esm/SeamsWeb/walletIframe/client/inboundMessages.js +9 -0
- package/dist/esm/SeamsWeb/walletIframe/client/router.js +30 -0
- package/dist/esm/SeamsWeb/walletIframe/coordinator.js +18 -0
- package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuSurface.js +88 -47
- package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/WalletAlternativesSection.js +67 -0
- package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/mountAuthMenuSurface.js +13 -0
- package/dist/esm/SeamsWeb/walletIframe/host/walletMutationGuard.js +1 -0
- package/dist/esm/SeamsWeb/walletIframe/shared/messages.js +20 -6
- package/dist/esm/SeamsWeb/walletIframe/shared/walletAlternatives.js +109 -0
- package/dist/esm/core/config/configBuilder.js +1 -1
- package/dist/esm/core/config/defaultConfigs.js +9 -2
- package/dist/esm/core/ui/messages.js +3 -1
- package/dist/esm/core/ui/walletIcon.js +10 -0
- package/dist/esm/externalEvm/boundary.js +4 -2
- package/dist/esm/react/components/HostedSeamsAuthMenu/shell.js +26 -6
- package/dist/esm/react/components/HostedSeamsAuthMenu/walletAlternatives.js +178 -0
- package/dist/esm/react/index.js +1 -2
- package/dist/esm/react/styles/styles.css +0 -183
- package/dist/esm/react/styles.css +0 -1
- package/dist/esm/sdk/{ConfirmationDrawer-BRnd5SEf.js → ConfirmationDrawer-fyl4IDRl.js} +1 -1
- package/dist/{public/sdk/NonceCoordinator-CNXYrOoy.js → esm/sdk/NonceCoordinator-C1lw03Ce.js} +1 -1
- package/dist/esm/sdk/{activeWalletSession-BJ4B-nJo.js → activeWalletSession-HAOgRKzn.js} +1 -1
- package/dist/esm/sdk/{adapters-B2k8y0MB.js → adapters-BY1wGpm5.js} +1 -1
- package/dist/esm/sdk/appearance-token-vars-CzlRDVQ7.js +1 -0
- package/dist/esm/sdk/{authorization-gVWwKwav.js → authorization-D_NueqAv.js} +1 -1
- package/dist/esm/sdk/{clientSessionPersistenceState-BxpITYM_.js → clientSessionPersistenceState-B3gU3515.js} +1 -1
- package/dist/esm/sdk/{commitQueue-C1wkey4q.js → commitQueue-CbyuhEW9.js} +1 -1
- package/dist/{public/sdk/confirm-ui-Dx6c4-Rk.js → esm/sdk/confirm-ui-DWFcGTsT.js} +1 -1
- package/dist/{public/sdk/device-linking-_o3_fgiG.js → esm/sdk/device-linking-BL2aDEUF.js} +1 -1
- package/dist/esm/sdk/{deviceLinkApproval-CObsEWBa.js → deviceLinkApproval-C4T8XAmi.js} +1 -1
- package/dist/esm/sdk/{digestEncoding-34kXJoJr.js → digestEncoding-Rx8Vjy4J.js} +1 -1
- package/dist/esm/sdk/{display-CUWg48tD.js → display-8NGPOhQT.js} +1 -1
- package/dist/{public/sdk/ecdsaCapabilityManifest--1Ztngfx.js → esm/sdk/ecdsaCapabilityManifest-BbPXL-qh.js} +1 -1
- package/dist/{public/sdk/ecdsaDerivationClientWasm-DJh2uN-q.js → esm/sdk/ecdsaDerivationClientWasm-GCt9yVsd.js} +1 -1
- package/dist/{public/sdk/ecdsaDerivationExport-BUUUGc6o.js → esm/sdk/ecdsaDerivationExport-jm2VBMz_.js} +1 -1
- package/dist/esm/sdk/{emailOtpEcdsaDerivationIdentity-Qd4pBwHv.js → emailOtpEcdsaDerivationIdentity-DJmMyqL-.js} +1 -1
- package/dist/esm/sdk/{export-viewer-host-O0OV1Oou.js → export-viewer-host-TzgdJQuZ.js} +1 -1
- package/dist/{public/sdk/exportKeypairOperation-DkqY9Bpf.js → esm/sdk/exportKeypairOperation-B9_ulzNz.js} +1 -1
- package/dist/esm/sdk/host-Csu5L7VF.js +1 -0
- package/dist/esm/sdk/{indexedDB-CA4tGqkr.js → indexedDB-BqsYXybq.js} +1 -1
- package/dist/esm/sdk/{lanes-vBKm6yBJ.js → lanes-0WT2w1Xz.js} +1 -1
- package/dist/esm/sdk/{localOnly-U_MucUAe.js → localOnly-DFrtrfdO.js} +1 -1
- package/dist/esm/sdk/{mountExportPrivateKeySurface-C2-fnvP6.js → mountExportPrivateKeySurface-D8juRQJM.js} +1 -1
- package/dist/{public/sdk/mountRecoveryCodeBackupSurface-C_tJNPJX.js → esm/sdk/mountRecoveryCodeBackupSurface-CMtByh-L.js} +1 -1
- package/dist/esm/sdk/{nearEd25519YaoSigningPreparation-CnbgQfZc.js → nearEd25519YaoSigningPreparation-Cz2Gb95g.js} +1 -1
- package/dist/esm/sdk/{operationFingerprint-Bas59T7L.js → operationFingerprint-GKEY-X5I.js} +1 -1
- package/dist/esm/sdk/ownerNearOperation-DCxxHcwX.js +1 -0
- package/dist/esm/sdk/{pendingWalletRecoveryCodeBackup-DXFrQmO5.js → pendingWalletRecoveryCodeBackup-8iMhQU-E.js} +1 -1
- package/dist/{public/sdk/presignaturePool-Dq4RhzXn.js → esm/sdk/presignaturePool-CaI45td2.js} +1 -1
- package/dist/esm/sdk/{presignatures-CkhuZ0YQ.js → presignatures-B9KnQyfE.js} +1 -1
- package/dist/esm/sdk/{recovery-entrypoint-s9OoKBcl.js → recovery-entrypoint-DA2FGLG6.js} +1 -1
- package/dist/esm/sdk/{registration-CTtTocyo.js → registration-C7w_51wE.js} +1 -1
- package/dist/esm/sdk/{registration-D3p7muCc.js → registration-XNyt1YRK.js} +1 -1
- package/dist/esm/sdk/{registrationIntent-C1-Kyx_-.js → registrationIntent-Cb3tggIM.js} +1 -1
- package/dist/{public/sdk/requireStepUpAuth-iVo6h_U-.js → esm/sdk/requireStepUpAuth-ByMTPBu4.js} +1 -1
- package/dist/esm/sdk/resealedEnvelopeResult-DKY5fVNY.js +1 -0
- package/dist/esm/sdk/routerAbNormalSigning-CPLDkttX.js +1 -0
- package/dist/esm/sdk/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/esm/sdk/runtime-auth-BMT_gIKI.js +1 -0
- package/dist/esm/sdk/{runtime-device-link-qmYvGep9.js → runtime-device-link-DQe0aqRi.js} +1 -1
- package/dist/{public/sdk/runtime-ecdsa-tempo-Zh95TuLV.js → esm/sdk/runtime-ecdsa-tempo-DKkeMMpm.js} +1 -1
- package/dist/esm/sdk/{runtime-email-otp-CnLuW4H1.js → runtime-email-otp-CzTe7r9I.js} +1 -1
- package/dist/esm/sdk/{runtime-export-m8lvrXtw.js → runtime-export-BiyLbdCe.js} +1 -1
- package/dist/esm/sdk/{runtime-near-BiXzXXhH.js → runtime-near-Kk0n1FSf.js} +1 -1
- package/dist/esm/sdk/runtime-preferences-B-A3hddU.js +1 -0
- package/dist/esm/sdk/runtime-recovery-C9p1TU1w.js +1 -0
- package/dist/esm/sdk/{runtime-recovery-codes-B033ake_.js → runtime-recovery-codes-CFOWDVd9.js} +1 -1
- package/dist/esm/sdk/{runtimeContext-RNS2E5wy.js → runtimeContext-ChuvOC0h.js} +3 -3
- package/dist/esm/sdk/{secp256k1-DPeaOjM0.js → secp256k1-sDDAa4Ga.js} +1 -1
- package/dist/{public/sdk/signEvmFamily-Cksw3RpU.js → esm/sdk/signEvmFamily-CMrXkVsZ.js} +1 -1
- package/dist/esm/sdk/{signEvmFamilyWithUiConfirmForTempo-B7p9UVix.js → signEvmFamilyWithUiConfirmForTempo-CnRoo0e8.js} +1 -1
- package/dist/esm/sdk/{signEvmWithUiConfirm-B14zYdwE.js → signEvmWithUiConfirm-yITc3ZvP.js} +1 -1
- package/dist/esm/sdk/{signNear-D0rFEYP1.js → signNear-DyFk--I3.js} +1 -1
- package/dist/{public/sdk/signingFlow-Bd1X0e-1.js → esm/sdk/signingFlow-DTP4D19E.js} +1 -1
- package/dist/{public/sdk/signingQueue-DoUBeaCv.js → esm/sdk/signingQueue-Dy5mYMus.js} +1 -1
- package/dist/esm/sdk/{thresholdEcdsa-BxfOZmiR.js → thresholdEcdsa-CRfx6RP1.js} +1 -1
- package/dist/esm/sdk/{trace-BnhLKxcu.js → trace-BA8jya7O.js} +1 -1
- package/dist/{public/sdk/transactionState-G_FPe-U8.js → esm/sdk/transactionState-BCbaT2hO.js} +1 -1
- package/dist/esm/sdk/tx-confirm-ui.js +3 -1
- package/dist/esm/sdk/{types-A-w1cYlJ.js → types-D2Zk1W7I.js} +1 -1
- package/dist/{public/sdk/unlockedEd25519ExportRootCapability-5F1egCSv.js → esm/sdk/unlockedEd25519ExportRootCapability-BbGMlikr.js} +1 -1
- package/dist/esm/sdk/voiceid-host.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-ecdsa.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-full.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-near.js +1 -1
- package/dist/esm/sdk/wallet-iframe-host-runtime.js +1 -1
- package/dist/esm/sdk/{wallet-recovery-DXdm68_Q.js → wallet-recovery-Bfm-oUoP.js} +1 -1
- package/dist/esm/sdk/wallet-ui.css +1 -1
- package/dist/{public/sdk/walletAuthMethodRecord-BW-XV4fv.js → esm/sdk/walletAuthMethodRecord--fvGr8r1.js} +1 -1
- package/dist/{public/sdk/walletAuthority-DbGaSw7D.js → esm/sdk/walletAuthority-CU9nO0Ze.js} +1 -1
- package/dist/esm/sdk/{walletCustodyEcdsaContinuity-BnyL1Ryu.js → walletCustodyEcdsaContinuity-BUdDyRl_.js} +1 -1
- package/dist/esm/sdk/{walletDbName-Ca0rCq5r.js → walletDbName-B6-CV_Rq.js} +1 -1
- package/dist/esm/sdk/{walletOwnerOperation-CScYv2K6.js → walletOwnerOperation-BJPxzo-k.js} +1 -1
- package/dist/esm/sdk/{walletOwnershipGeneration-BZc6UKqX.js → walletOwnershipGeneration-B3uE9GRG.js} +1 -1
- package/dist/{public/sdk/walletRecoveryAdminProof-DdwikrW3.js → esm/sdk/walletRecoveryAdminProof-BmZaP0Q8.js} +1 -1
- package/dist/{public/sdk/walletRecoveryCommit-DbAoiJp5.js → esm/sdk/walletRecoveryCommit-CSYNbYNd.js} +1 -1
- package/dist/esm/sdk/{walletSessionAuthorizationStatus-GhcGvDCX.js → walletSessionAuthorizationStatus-CQ3qA9tI.js} +1 -1
- package/dist/{public/sdk/walletSessionAuthorizationStore-BivTUoKY.js → esm/sdk/walletSessionAuthorizationStore-CGt-s5fX.js} +1 -1
- package/dist/esm/shared-ts/src/utils/index.js +1 -1
- package/dist/esm/wasm/near_signer/pkg/wasm_signer_worker_bg.wasm +0 -0
- package/dist/esm/wasm/router_ab_ecdsa_client/pkg/router_ab_ecdsa_client_bg.wasm +0 -0
- package/dist/esm/wasm/router_ab_ed25519_yao_client/pkg/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/public/headers.manifest.json +1 -1
- package/dist/public/sdk/{ConfirmationDrawer-BRnd5SEf.js → ConfirmationDrawer-fyl4IDRl.js} +1 -1
- package/dist/{esm/sdk/NonceCoordinator-CNXYrOoy.js → public/sdk/NonceCoordinator-C1lw03Ce.js} +1 -1
- package/dist/public/sdk/{activeWalletSession-BJ4B-nJo.js → activeWalletSession-HAOgRKzn.js} +1 -1
- package/dist/public/sdk/{adapters-B2k8y0MB.js → adapters-BY1wGpm5.js} +1 -1
- package/dist/public/sdk/appearance-token-vars-CzlRDVQ7.js +1 -0
- package/dist/public/sdk/{authorization-gVWwKwav.js → authorization-D_NueqAv.js} +1 -1
- package/dist/public/sdk/{clientSessionPersistenceState-BxpITYM_.js → clientSessionPersistenceState-B3gU3515.js} +1 -1
- package/dist/public/sdk/{commitQueue-C1wkey4q.js → commitQueue-CbyuhEW9.js} +1 -1
- package/dist/{esm/sdk/confirm-ui-Dx6c4-Rk.js → public/sdk/confirm-ui-DWFcGTsT.js} +1 -1
- package/dist/{esm/sdk/device-linking-_o3_fgiG.js → public/sdk/device-linking-BL2aDEUF.js} +1 -1
- package/dist/public/sdk/{deviceLinkApproval-CObsEWBa.js → deviceLinkApproval-C4T8XAmi.js} +1 -1
- package/dist/public/sdk/{digestEncoding-34kXJoJr.js → digestEncoding-Rx8Vjy4J.js} +1 -1
- package/dist/public/sdk/{display-CUWg48tD.js → display-8NGPOhQT.js} +1 -1
- package/dist/{esm/sdk/ecdsaCapabilityManifest--1Ztngfx.js → public/sdk/ecdsaCapabilityManifest-BbPXL-qh.js} +1 -1
- package/dist/{esm/sdk/ecdsaDerivationClientWasm-DJh2uN-q.js → public/sdk/ecdsaDerivationClientWasm-GCt9yVsd.js} +1 -1
- package/dist/{esm/sdk/ecdsaDerivationExport-BUUUGc6o.js → public/sdk/ecdsaDerivationExport-jm2VBMz_.js} +1 -1
- package/dist/public/sdk/{emailOtpEcdsaDerivationIdentity-Qd4pBwHv.js → emailOtpEcdsaDerivationIdentity-DJmMyqL-.js} +1 -1
- package/dist/public/sdk/{export-viewer-host-O0OV1Oou.js → export-viewer-host-TzgdJQuZ.js} +1 -1
- package/dist/{esm/sdk/exportKeypairOperation-DkqY9Bpf.js → public/sdk/exportKeypairOperation-B9_ulzNz.js} +1 -1
- package/dist/public/sdk/host-Csu5L7VF.js +1 -0
- package/dist/public/sdk/{indexedDB-CA4tGqkr.js → indexedDB-BqsYXybq.js} +1 -1
- package/dist/public/sdk/{lanes-vBKm6yBJ.js → lanes-0WT2w1Xz.js} +1 -1
- package/dist/public/sdk/{localOnly-U_MucUAe.js → localOnly-DFrtrfdO.js} +1 -1
- package/dist/public/sdk/{mountExportPrivateKeySurface-C2-fnvP6.js → mountExportPrivateKeySurface-D8juRQJM.js} +1 -1
- package/dist/{esm/sdk/mountRecoveryCodeBackupSurface-C_tJNPJX.js → public/sdk/mountRecoveryCodeBackupSurface-CMtByh-L.js} +1 -1
- package/dist/public/sdk/{nearEd25519YaoSigningPreparation-CnbgQfZc.js → nearEd25519YaoSigningPreparation-Cz2Gb95g.js} +1 -1
- package/dist/public/sdk/{operationFingerprint-Bas59T7L.js → operationFingerprint-GKEY-X5I.js} +1 -1
- package/dist/public/sdk/ownerNearOperation-DCxxHcwX.js +1 -0
- package/dist/public/sdk/{pendingWalletRecoveryCodeBackup-DXFrQmO5.js → pendingWalletRecoveryCodeBackup-8iMhQU-E.js} +1 -1
- package/dist/{esm/sdk/presignaturePool-Dq4RhzXn.js → public/sdk/presignaturePool-CaI45td2.js} +1 -1
- package/dist/public/sdk/{presignatures-CkhuZ0YQ.js → presignatures-B9KnQyfE.js} +1 -1
- package/dist/public/sdk/{recovery-entrypoint-s9OoKBcl.js → recovery-entrypoint-DA2FGLG6.js} +1 -1
- package/dist/public/sdk/{registration-CTtTocyo.js → registration-C7w_51wE.js} +1 -1
- package/dist/public/sdk/{registration-D3p7muCc.js → registration-XNyt1YRK.js} +1 -1
- package/dist/public/sdk/{registrationIntent-C1-Kyx_-.js → registrationIntent-Cb3tggIM.js} +1 -1
- package/dist/{esm/sdk/requireStepUpAuth-iVo6h_U-.js → public/sdk/requireStepUpAuth-ByMTPBu4.js} +1 -1
- package/dist/public/sdk/resealedEnvelopeResult-DKY5fVNY.js +1 -0
- package/dist/public/sdk/routerAbNormalSigning-CPLDkttX.js +1 -0
- package/dist/public/sdk/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/public/sdk/runtime-auth-BMT_gIKI.js +1 -0
- package/dist/public/sdk/{runtime-device-link-qmYvGep9.js → runtime-device-link-DQe0aqRi.js} +1 -1
- package/dist/{esm/sdk/runtime-ecdsa-tempo-Zh95TuLV.js → public/sdk/runtime-ecdsa-tempo-DKkeMMpm.js} +1 -1
- package/dist/public/sdk/{runtime-email-otp-CnLuW4H1.js → runtime-email-otp-CzTe7r9I.js} +1 -1
- package/dist/public/sdk/{runtime-export-m8lvrXtw.js → runtime-export-BiyLbdCe.js} +1 -1
- package/dist/public/sdk/{runtime-near-BiXzXXhH.js → runtime-near-Kk0n1FSf.js} +1 -1
- package/dist/public/sdk/runtime-preferences-B-A3hddU.js +1 -0
- package/dist/public/sdk/runtime-recovery-C9p1TU1w.js +1 -0
- package/dist/public/sdk/{runtime-recovery-codes-B033ake_.js → runtime-recovery-codes-CFOWDVd9.js} +1 -1
- package/dist/public/sdk/{runtimeContext-RNS2E5wy.js → runtimeContext-ChuvOC0h.js} +3 -3
- package/dist/public/sdk/{secp256k1-DPeaOjM0.js → secp256k1-sDDAa4Ga.js} +1 -1
- package/dist/{esm/sdk/signEvmFamily-Cksw3RpU.js → public/sdk/signEvmFamily-CMrXkVsZ.js} +1 -1
- package/dist/public/sdk/{signEvmFamilyWithUiConfirmForTempo-B7p9UVix.js → signEvmFamilyWithUiConfirmForTempo-CnRoo0e8.js} +1 -1
- package/dist/public/sdk/{signEvmWithUiConfirm-B14zYdwE.js → signEvmWithUiConfirm-yITc3ZvP.js} +1 -1
- package/dist/public/sdk/{signNear-D0rFEYP1.js → signNear-DyFk--I3.js} +1 -1
- package/dist/{esm/sdk/signingFlow-Bd1X0e-1.js → public/sdk/signingFlow-DTP4D19E.js} +1 -1
- package/dist/{esm/sdk/signingQueue-DoUBeaCv.js → public/sdk/signingQueue-Dy5mYMus.js} +1 -1
- package/dist/public/sdk/{thresholdEcdsa-BxfOZmiR.js → thresholdEcdsa-CRfx6RP1.js} +1 -1
- package/dist/public/sdk/{trace-BnhLKxcu.js → trace-BA8jya7O.js} +1 -1
- package/dist/{esm/sdk/transactionState-G_FPe-U8.js → public/sdk/transactionState-BCbaT2hO.js} +1 -1
- package/dist/public/sdk/tx-confirm-ui.js +3 -1
- package/dist/public/sdk/{types-A-w1cYlJ.js → types-D2Zk1W7I.js} +1 -1
- package/dist/{esm/sdk/unlockedEd25519ExportRootCapability-5F1egCSv.js → public/sdk/unlockedEd25519ExportRootCapability-BbGMlikr.js} +1 -1
- package/dist/public/sdk/voiceid-host.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-ecdsa.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-full.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-near.js +1 -1
- package/dist/public/sdk/wallet-iframe-host-runtime.js +1 -1
- package/dist/public/sdk/{wallet-recovery-DXdm68_Q.js → wallet-recovery-Bfm-oUoP.js} +1 -1
- package/dist/public/sdk/wallet-ui.css +1 -1
- package/dist/{esm/sdk/walletAuthMethodRecord-BW-XV4fv.js → public/sdk/walletAuthMethodRecord--fvGr8r1.js} +1 -1
- package/dist/{esm/sdk/walletAuthority-DbGaSw7D.js → public/sdk/walletAuthority-CU9nO0Ze.js} +1 -1
- package/dist/public/sdk/{walletCustodyEcdsaContinuity-BnyL1Ryu.js → walletCustodyEcdsaContinuity-BUdDyRl_.js} +1 -1
- package/dist/public/sdk/{walletDbName-Ca0rCq5r.js → walletDbName-B6-CV_Rq.js} +1 -1
- package/dist/public/sdk/{walletOwnerOperation-CScYv2K6.js → walletOwnerOperation-BJPxzo-k.js} +1 -1
- package/dist/public/sdk/{walletOwnershipGeneration-BZc6UKqX.js → walletOwnershipGeneration-B3uE9GRG.js} +1 -1
- package/dist/{esm/sdk/walletRecoveryAdminProof-DdwikrW3.js → public/sdk/walletRecoveryAdminProof-BmZaP0Q8.js} +1 -1
- package/dist/{esm/sdk/walletRecoveryCommit-DbAoiJp5.js → public/sdk/walletRecoveryCommit-CSYNbYNd.js} +1 -1
- package/dist/public/sdk/{walletSessionAuthorizationStatus-GhcGvDCX.js → walletSessionAuthorizationStatus-CQ3qA9tI.js} +1 -1
- package/dist/{esm/sdk/walletSessionAuthorizationStore-BivTUoKY.js → public/sdk/walletSessionAuthorizationStore-CGt-s5fX.js} +1 -1
- package/dist/public/sdk/workers/email_otp_runtime_bg.wasm +0 -0
- package/dist/public/sdk/workers/evm_crypto_bg.wasm +0 -0
- package/dist/public/sdk/workers/router_ab_ecdsa_client_bg.wasm +0 -0
- package/dist/public/sdk/workers/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/public/sdk/workers/shamir3pass_runtime_bg.wasm +0 -0
- package/dist/public/sdk/workers/tempo_signer_bg.wasm +0 -0
- package/dist/public/sdk/workers/wallet_custody_ceremony_bg.wasm +0 -0
- package/dist/public/sdk/workers/wasm_signer_worker_bg.wasm +0 -0
- package/dist/public/wallet-assets.manifest.json +153 -153
- package/dist/public/wallet-service/index.html +4 -4
- package/dist/types/wallet/src/SeamsWeb/index.d.ts +1 -0
- package/dist/types/wallet/src/SeamsWeb/publicApi/types.d.ts +3 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/client/inboundMessages.d.ts +5 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/client/router.d.ts +3 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/coordinator.d.ts +6 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/auth-menu/controller.d.ts +2 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/auth-menu/domain.d.ts +3 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/auth-menu/session.d.ts +4 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/requestRouter.d.ts +1 -1
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuSurface.d.ts +5 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ui/auth-menu/WalletAlternativesSection.d.ts +13 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ui/auth-menu/mountAuthMenuSurface.d.ts +3 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/shared/messages.d.ts +11 -4
- package/dist/types/wallet/src/SeamsWeb/walletIframe/shared/walletAlternatives.d.ts +52 -0
- package/dist/types/wallet/src/core/types/seams.d.ts +2 -2
- package/dist/types/wallet/src/core/ui/messages.d.ts +1 -1
- package/dist/types/wallet/src/core/ui/walletIcon.d.ts +3 -0
- package/dist/types/wallet/src/index.d.ts +1 -0
- package/dist/types/wallet/src/react/components/HostedSeamsAuthMenu/public.d.ts +1 -0
- package/dist/types/wallet/src/react/components/HostedSeamsAuthMenu/types.d.ts +4 -0
- package/dist/types/wallet/src/react/components/HostedSeamsAuthMenu/walletAlternatives.d.ts +48 -0
- package/dist/types/wallet/src/react/index.d.ts +1 -2
- package/dist/workers/email_otp_runtime_bg.wasm +0 -0
- package/dist/workers/evm_crypto_bg.wasm +0 -0
- package/dist/workers/router_ab_ecdsa_client_bg.wasm +0 -0
- package/dist/workers/router_ab_ed25519_yao_client_bg.wasm +0 -0
- package/dist/workers/shamir3pass_runtime_bg.wasm +0 -0
- package/dist/workers/tempo_signer_bg.wasm +0 -0
- package/dist/workers/wallet_custody_ceremony_bg.wasm +0 -0
- package/dist/workers/wasm_signer_worker_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/esm/react/components/HostedSeamsAuthMenu/WalletConnectorMenu.css +0 -182
- package/dist/esm/react/components/HostedSeamsAuthMenu/WalletConnectorMenu.js +0 -315
- package/dist/esm/sdk/appearance-token-vars-DkF3EBbF.js +0 -1
- package/dist/esm/sdk/host-BeE2dIU4.js +0 -1
- package/dist/esm/sdk/ownerNearOperation-DjNDxW3_.js +0 -1
- package/dist/esm/sdk/resealedEnvelopeResult-DXDo-72P.js +0 -1
- package/dist/esm/sdk/routerAbNormalSigning-DVFFkNhJ.js +0 -1
- package/dist/esm/sdk/runtime-auth-Dsmw_dUA.js +0 -1
- package/dist/esm/sdk/runtime-preferences-DlKHDIjb.js +0 -1
- package/dist/esm/sdk/runtime-recovery-C6lS71Jp.js +0 -1
- package/dist/public/sdk/appearance-token-vars-DkF3EBbF.js +0 -1
- package/dist/public/sdk/host-BeE2dIU4.js +0 -1
- package/dist/public/sdk/ownerNearOperation-DjNDxW3_.js +0 -1
- package/dist/public/sdk/resealedEnvelopeResult-DXDo-72P.js +0 -1
- package/dist/public/sdk/routerAbNormalSigning-DVFFkNhJ.js +0 -1
- package/dist/public/sdk/runtime-auth-Dsmw_dUA.js +0 -1
- package/dist/public/sdk/runtime-preferences-DlKHDIjb.js +0 -1
- package/dist/public/sdk/runtime-recovery-C6lS71Jp.js +0 -1
- package/dist/types/wallet/src/react/components/HostedSeamsAuthMenu/WalletConnectorMenu.d.ts +0 -31
- /package/dist/esm/sdk/{canonicalPrimitives-Jd3i_Ngz.js → canonicalPrimitives-DKeS3M40.js} +0 -0
- /package/dist/esm/sdk/{capabilityKinds-DVlGMspk.js → capabilityKinds-Cafn86Y1.js} +0 -0
- /package/dist/esm/sdk/{walletIframeIdentity-CpgyEnKg.js → walletIframeIdentity-Cz82I_Uh.js} +0 -0
- /package/dist/public/sdk/{canonicalPrimitives-Jd3i_Ngz.js → canonicalPrimitives-DKeS3M40.js} +0 -0
- /package/dist/public/sdk/{capabilityKinds-DVlGMspk.js → capabilityKinds-Cafn86Y1.js} +0 -0
- /package/dist/public/sdk/{walletIframeIdentity-CpgyEnKg.js → walletIframeIdentity-Cz82I_Uh.js} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{n as e}from"./chunk-dVx5-UGu.js";import{v as t}from"./digests-BIaE0DMd.js";import{i as n}from"./chains-B72I4PDH.js";import{r}from"./transactionReviewAdmission-Cf_qUZJt.js";import{a as i,i as a,r as o,t as s}from"./actions-7SvZZut1.js";import{t as c}from"./surface-measurement-reporter-DJ_dQhBV.js";import{a as l,i as u,o as d,r as f,s as p}from"./csp-stylesheet-5LU6VGKK.js";import{t as m}from"./SeamsWordmark-CeEi2RlU.js";import{i as h,r as g}from"./intentDigest-gM3r4SVX.js";import{t as _}from"./promptText-bcKcsSka.js";import{a as v}from"./transaction-activity-BXSxMp1E.js";import{a as y,c as b,i as x,n as S,o as C,r as w,s as T,t as ee}from"./appearance-token-vars-DkF3EBbF.js";import{i as E,n as te,r as ne,t as re}from"./ConfirmationDrawer-BRnd5SEf.js";import{n as ie,t as ae}from"./appearance-DL7c6bML.js";let oe=!1;function se(e=!0){oe=!!e}function ce(){return oe}function le(e){if(!e)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,(e,t)=>typeof t==`bigint`?t.toString():t,2)}catch{return String(e)}}function D(e){if(!e||e===`0`)return`0 NEAR`;try{let t=BigInt(e),n=BigInt(`1000000000000000000000000`),r=t/n,i=t%n;if(i===BigInt(0))return`${r.toString()} NEAR`;let a=i.toString().padStart(24,`0`).slice(0,5);return a=a.replace(/0+$/g,``),a.length===0?`${r.toString()} NEAR`:`${r.toString()}.${a} NEAR`}catch{return e}}function ue(e){if(!e)return``;try{return`${BigInt(e)/BigInt(`1000000000000`)} Tgas`}catch{return e}}function O(e,t={}){if(!e||typeof e!=`string`)return``;let{prefix:n=12,suffix:r=6}=t;return e.length<=n+r+3?e:`${e.slice(0,n)}...${e.slice(-r)}`}function k(e){return e?e instanceof Uint8Array?`${e.byteLength} bytes`:Array.isArray(e)||typeof e==`string`?`${e.length} bytes`:`unknown`:`0 bytes`}function de(e){if(!e)return;let t=String(e.decoded||``),n=String(e.raw||``);if(!(!t||!n)&&t!==n)return{decoded:t,raw:n,defaultMode:e.defaultMode===`raw`?`raw`:`decoded`}}function fe(e,t){if(!/Value \(wei\)$/i.test(e.trim()))return!1;let n=t.trim();if(!n)return!1;if(n===`0`||/^0x0+$/i.test(n))return!0;try{return BigInt(n)===0n}catch{return!1}}function pe(e,t){return!Array.isArray(t)||t.length===0?[]:t.flatMap((t,n)=>{let r=String(t.label||``).trim(),i=String(t.value||``),a=t.renderAs||`inline`;if(fe(r,i))return[];if(a===`file-content`){let a=de(t.contentVariants),o=a?.defaultMode===`raw`?a.raw:a?.decoded||i;return[{id:`${e}-field-${n}`,label:r?`${r}:`:``,fieldLabel:r?`${r}:`:void 0,type:`file`,open:!1,content:o,...a?{contentVariants:a}:{},copyValue:typeof t.copyValue==`string`?t.copyValue:void 0,hideLabel:!!t.hideLabel,hideChevron:typeof t.hideChevron==`boolean`?t.hideChevron:!0}]}return[{id:`${e}-field-${n}`,label:r?`${r}: ${i}`:i,fieldLabel:r?`${r}:`:void 0,type:`file`,open:!1,copyValue:typeof t.copyValue==`string`?t.copyValue:void 0}]})}const me=({operation:e,depth:t,path:n,renderChild:r})=>{let i=String(e.id||``).trim()||`op-${n}`,a=(()=>{let t=String(e.to||``).trim();return/^0x[0-9a-fA-F]{40}$/.test(t)?t:void 0})(),o=String(e.description||``).trim(),s=Array.isArray(e.children)?e.children.map((e,i)=>r(e,t+1,`${n}.${i}`)):[],c=pe(i,e.fields),l=o?[{id:`${i}-description`,label:o,type:`file`,open:!1}]:[];if(e.kind===`raw.fallback`){let t=String(e.raw||``).trim();t&&l.push({id:`${i}-raw`,label:`Raw payload`,type:`file`,open:!1,content:t})}let u=[...l,...c,...s];return u.length===0?{id:i,label:String(e.label||e.kind),type:`file`,open:!1,contractAddress:a}:{id:i,label:String(e.label||e.kind),type:`folder`,open:t<1,contractAddress:a,children:u}};function he(e){switch(e){case`near`:return`NEAR`;case`evm`:return`EVM`;case`tempo`:return`Tempo`;default:return`Unknown`}}function ge(e){return!Array.isArray(e)||e.length===0?[]:[{id:`warnings-root`,label:`Warnings`,type:`folder`,open:!0,children:e.map((e,t)=>({id:`warning-${t}`,label:`[${String(e.severity||`warning`).toUpperCase()}] ${String(e.message||``)}`,type:`file`,open:!1}))}]}function _e(e,t,n){return me({operation:e,depth:t,path:n,renderChild:(e,t,n)=>_e(e,t,n)})}function ve(e){let t=Array.isArray(e.children)?e.children.map(e=>ve(e)):void 0;return e.type===`folder`?{...e,hideChevron:!0,children:t}:t?{...e,children:t}:e}function ye(e,t){let n=Array.isArray(e.children)?e.children.map(e=>ye(e,t)):void 0;return{...e,chain:t,...n?{children:n}:{}}}function be(e){let t=e.chain===`evm`||e.chain===`tempo`,n=(Array.isArray(e.operations)?e.operations:[]).map((e,t)=>_e(e,0,String(t))).map(t=>ye(t,e.chain)).map(e=>t?ve(e):e),r=[...ge(e.warnings).map(t=>ye(t,e.chain)).map(e=>t?ve(e):e),...n];r.length===0&&r.push({id:`no-operations`,label:`No operations`,type:`file`,open:!1});let i=he(e.chain);return{id:`display-root`,label:String(e.title||``).trim()||`${i} Transaction`,type:`folder`,open:!0,children:r}}function xe(e,n){let r;switch(e.type){case`FunctionCall`:r=[{id:`a${n}-args`,label:`using args:`,type:`file`,open:!1,hideChevron:!0,hideLabel:!0,content:le(e.args)}];break;case`Transfer`:r=[];break;case`CreateAccount`:r=[];break;case`DeployContract`:{let t=k(e.code);r=[{id:`a${n}-code-size`,label:`WASM contract code size: ${t}`,type:`file`,open:!1}];break}case`DeployGlobalContract`:{let t=e.code,i=e.deployMode,a=k(t);r=[{id:`a${n}-deploy-mode`,label:`mode: ${String(i||``)}`,type:`file`,open:!1},{id:`a${n}-code-size`,label:`WASM global contract code size: ${a}`,type:`file`,open:!1}];break}case`UseGlobalContract`:{let t=e.accountId,i=e.codeHash,a;a=t?`by account: ${String(t)}`:i?`by hash: ${O(String(i),{prefix:10,suffix:6})}`:`by global contract identifier`,r=[{id:`a${n}-identifier`,label:a,type:`file`,open:!1}];break}case`Stake`:r=[{id:`a${n}-publicKey`,label:`validator: ${O(e.publicKey)}`,type:`file`,open:!0,copyValue:e.publicKey}];break;case`AddKey`:{let i=e.accessKey,a=``;try{a=(t(i)?JSON.parse(i):i).permission===`FullAccess`?`Full Access`:`Function Call`}catch{a=`Unknown`}r=[{id:`a${n}-publicKey`,label:`key: ${O(e.publicKey)}`,open:!1,type:`file`,copyValue:e.publicKey},{id:`a${n}-permissions`,label:`permissions: ${a}`,open:!1,type:`file`}];break}case`DeleteKey`:r=[{id:`a${n}-publicKey`,label:`key: ${O(e.publicKey)}`,open:!1,type:`file`,copyValue:e.publicKey}];break;case`DeleteAccount`:r=[{id:`a${n}-beneficiaryId`,label:`sending balance to: ${e.beneficiaryId}`,open:!1,type:`file`}];break;default:return Se(e)}return{id:`action-${n}`,label:``,type:`folder`,open:!1,hideChevron:!0,action:e,actionIndex:n,children:r}}function Se(e){throw Error(`Unsupported NEAR action: ${String(e)}`)}function Ce(e,t,n){let r=e.actions.map((e,t)=>xe(e,t));return{id:`tx-${t}`,label:``,type:`folder`,open:!0,hideChevron:!0,transaction:e,transactionIndex:t,totalTransactions:n,children:[...r]}}function we(e){let t=e.length,n=e.map((e,n)=>Ce(e,n,t));return{id:`txs-root`,label:t>1?`Transactions`:`Transaction`,type:`folder`,open:!0,children:n}}function Te(e){let t=e.abiDecodeHint;if(t&&Array.isArray(t.abi)&&t.abi.length>0){let e=String(t.dataHex||``).trim();if(e&&e!==`0x`)return!0}return(Array.isArray(e.children)?e.children:[]).some(Te)}function Ee(e){return(Array.isArray(e.operations)?e.operations:[]).some(Te)}function A(e){let t=Array.isArray(e.txSigningRequests)?e.txSigningRequests:[];if(t.length>0)return we(o(t));let n=e.model;if(!n)return null;let r=Array.isArray(n.operations)?n.operations:[],i=Array.isArray(n.warnings)?n.warnings:[];return r.length>0||i.length>0?be(n):null}const De=/^NEAR account ([^\s]+) needs funding before signing\.$/;function Oe(e){let t=String(e||``).trim();return t.length<=8?t:`${t.slice(0,4)}...${t.slice(-4)}`}function ke(e){let t=String(e||``).trim();return t?`NEAR account ${t} needs funding before signing.`:`NEAR account needs funding before signing.`}function Ae(e){let t=String(e||``).trim(),n=De.exec(t);if(!n)return null;let r=String(n[1]||``).trim();return r?{accountId:r,shortAccountId:Oe(r)}:null}function je(e){return String(e||``).trim()===`Topping up account...`}function Me(e){let t=Oe(e);return t?`Funding NEAR account ${t}...`:`Funding NEAR account...`}function Ne(e){let t=String(e||``).trim();return t.startsWith(`Funding NEAR account`)&&t.endsWith(`...`)}function Pe(e){return je(e)||Ne(e)}function Fe(e){let t=e.trim();if(!t)return{kind:`empty`};if(Pe(t))return{kind:`status`,text:t};let n=Ae(t);return n?{kind:`funding`,accountId:n.accountId,shortAccountId:n.shortAccountId}:{kind:`text`,text:t}}function Ie(e){let t=e.presentation,n=t.errorMessage??``,r=t.cancelText??`Cancel`,i=t.securityContext?.passkeyRegistration;if(i?.kind===`passkey_registration_confirm_display_v1`)return{ok:!0,model:{appearance:e.appearance,content:{kind:`registration`,registration:{display:i,heading:t.title?.trim()||`Create your passkey`,body:t.body?.trim()||`Use Touch ID or your device passkey to create credentials for this account.`,cancelText:r,errorMessage:n,decision:t.loading?{kind:`creating`}:{kind:`ready`,onConfirm:e.callbacks.confirm},onCancel:e.callbacks.cancel}}}};let a;switch(t.signingAuthMode){case`emailOtp`:{let r=t.emailOtpPrompt,i=r?.challengeId.trim();if(!r||!i)return{ok:!1,error:`missing_email_challenge`};a={kind:`email`,email:{prompt:{challengeId:i,title:r.title,body:r.body,helperText:r.helperText,emailHint:r.emailHint,resendDebounceMs:r.resendDebounceMs,onResend:r.onResend},verification:Le(t.loading===!0,n),onSubmit:e.callbacks.submitEmail}};break}case`warmSession`:a={kind:`session`};break;case`webauthn`:case void 0:a={kind:`passkey`};break;default:return He(t.signingAuthMode)}let o=Fe(t.body??``);return{ok:!0,model:{appearance:e.appearance,content:{kind:`transaction`,capture:t.authMethodCapture??null,review:{model:t.model??null,tree:e.tree},header:{heading:Re(t),website:ze(t.securityContext?.rpId?.trim()??``),chainDetails:Be(t,t.loading===!0||o.kind===`status`),errorMessage:n},body:o,prompt:a,transaction:{tree:e.tree,theme:e.appearance.theme.mode,explorers:{near:t.nearExplorerUrl||`https://testnet.nearblocks.io`,tempo:t.tempoExplorerUrl,evm:t.evmExplorerUrl},decision:t.loading||t.preparing?{kind:`preparing`}:{kind:`ready`,onConfirm:e.callbacks.confirm},confirmText:t.signingAuthMode===`emailOtp`?`Confirm Code`:t.confirmText??`Confirm`,cancelText:r,errorMessage:n,onCancel:e.callbacks.cancel,onBack:t.onBack,authMethodApprovalMessage:t.authMethodApprovalMessage}}}}}function Le(e,t){return e?{kind:`pending`}:t?{kind:`rejected`,message:t}:{kind:`ready`}}function Re(e){let t=(e.model?.operations.length??0)===0?`Register with Passkey`:`Confirm with Passkey`;switch(e.signingAuthMode){case`emailOtp`:return e.emailOtpPrompt?.title?.trim()||`Enter email code to sign`;case`warmSession`:return`Review transaction`;case`webauthn`:return t;case void 0:return e.title?.trim()||t;default:return He(e.signingAuthMode)}}function ze(e){return e?{kind:`ready`,text:e}:{kind:`loading`}}function Be(e,t){let n=e.model;if(n?.chainId)return{kind:`ready`,text:`${Ve(n.chain)} | ChainID: ${n.chainId}`};let r=String(e.securityContext?.blockHeight||``).trim();return r?{kind:`ready`,text:`block ${r}`}:t?{kind:`loading`}:{kind:`ready`,text:`block`}}function Ve(e){switch(e){case`near`:return`NEAR`;case`evm`:return`EVM`;case`tempo`:return`Tempo`;case`unknown`:return`Unknown`;default:return He(e)}}function He(e){throw Error(`Unexpected confirmation presentation: ${String(e)}`)}const j=`seams-surface-resize-begin`;function Ue(e,t){return e.dispatchEvent(new CustomEvent(j,{bubbles:!0,composed:!0,detail:t}))}function We(e,t,n){let r=t;return e.addEventListener(j,r,n),()=>e.removeEventListener(j,r,n)}const Ge=`data-seams-confirm-surface`,M=`seams-confirm-surface-pinned`,N=`seams-confirm-surface-pinned-root`,P=`seams-surface-height-driven`,F=`--seams-surface-height-driven-target`;function Ke(e,t){let{fromCssPx:n,toCssPx:r}=t;if(!Number.isFinite(n)||!Number.isFinite(r))return!1;let i=r-n;if(Math.abs(i)<1)return!1;let a=Math.min(n,r),o=Math.max(n,r),s=null,c=!1,l=null,u=e=>{if(c)return;let r=n+(Number.isFinite(e)?Math.min(Math.max(e,0),1):0)*i;t.setHeightCssPx(Math.min(Math.max(r,a),o))},d=()=>{c||(c=!0,l!==null&&window.clearTimeout(l),t.finish())},f=()=>s||c?null:(t.onClaimed?.(),u(0),l=window.setTimeout(()=>{u(1),d()},1500),s={setProgress:u,finish:d},s);return Ue(e,{...t.reason?{reason:t.reason}:{},deltaCssPx:i,claim:f}),s!==null}function qe(e){let t=null,n=null,r=()=>{let e=n;n=null,e&&e.classList.remove(P)};return{capture(){let n=e.element();t=n?n.getBoundingClientRect().height:null},commit(){let i=t;t=null;let a=e.element();!a||i===null||document.documentElement.classList.contains(N)||a.parentElement?.closest(`.${P}`)||(n=a,a.classList.add(P),e.setHeightCssPx(i),Promise.resolve(e.settled?.()).then(()=>new Promise(e=>requestAnimationFrame(()=>e()))).then(()=>{if(n!==a)return;if(document.documentElement.classList.contains(N)){r();return}a.classList.remove(P);let t=a.getBoundingClientRect().height;a.classList.add(P),!I({...e.reason?{reason:e.reason}:{},element:a,fromCssPx:i,toCssPx:t,setHeightCssPx:t=>e.setHeightCssPx(t),onSettled:()=>{n=null}})&&(r(),Je(a,i,t))}))},dispose:r}}function Je(e,t,n){Math.abs(n-t)<1||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||e.animate([{height:`${t}px`},{height:`${n}px`}],{duration:200,easing:`cubic-bezier(0.32, 0.72, 0, 1)`})}function I(e){let{element:t,fromCssPx:n,toCssPx:r}=e;if(!Number.isFinite(n)||!Number.isFinite(r)||Math.abs(r-n)<1)return!1;let i=e.drivenClasses??[P],a=i.filter(e=>!t.classList.contains(e));t.classList.add(...a),e.setHeightCssPx(n);let o=Ke(t,{...e.reason?{reason:e.reason}:{},fromCssPx:n,toCssPx:r,setHeightCssPx:e.setHeightCssPx,finish:()=>{t.classList.remove(...i),e.onSettled?.()}});return o||t.classList.remove(...a),o}let Ye=null;const Xe={blipFrames:0,trace(e=2e3){return new Promise(t=>{let n=[],r=performance.now(),i=()=>{let a=Ye,o=a?.classList.contains(M)?`*`:``;n.push(`${Math.round(performance.now()-r)}: box=${document.documentElement.clientHeight} content=${a?Math.round(a.getBoundingClientRect().height):`-`}${o}`),performance.now()-r<e?requestAnimationFrame(i):t(n)};requestAnimationFrame(i)})}};function Ze(e){Ye=e;try{window.__seamsSurfaceMotion=Xe}catch{}}function Qe(){let e=document.documentElement?.clientHeight??0;return e>0?e:window.innerHeight}function $e(e,t,n){return Math.min(Math.max(e,t),n)}function et(e){return e.getAttribute(Ge)===`wallet-iframe`}function tt(e){if(typeof CSSStyleSheet!=`function`||!(`adoptedStyleSheets`in document))return null;let t=null,n=()=>{e.classList.remove(M),document.documentElement.classList.remove(N)};return{set(n){try{t||=new CSSStyleSheet,t.replaceSync(`.${M}{height:${Math.max(0,Math.round(n))}px}.${N}{overflow:hidden}`),document.adoptedStyleSheets.includes(t)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,t])}catch{return!1}return e.classList.add(M),document.documentElement.classList.add(N),!0},release:n,dispose(){if(n(),!t)return;let e=t;t=null;try{document.adoptedStyleSheets=document.adoptedStyleSheets.filter(t=>t!==e)}catch{}}}}function nt(e,t={}){let n=t.viewportHeightCssPx??Qe,r=tt(e);Ze(e);let i=null,a=()=>{let e=i;e&&(i=null,e.frame!==null&&cancelAnimationFrame(e.frame),e.driver.setProgress(1),e.driver.finish(),r?.release())},o=()=>{let e=i;if(!e)return;e.frame=null;let t=n();t===e.lastViewportPx?e.framesSinceChange+=1:(e.lastViewportPx=t,e.framesSinceChange=0,e.moved=!0);let r=$e((t-e.originHostPx)/e.deltaCssPx,0,1);if(t===Math.round(e.originHostPx+e.deltaCssPx)){if(e.framesAtTarget+=1,e.sawIntermediate||e.framesAtTarget>=3){a();return}e.frame=requestAnimationFrame(o);return}e.framesAtTarget>0&&(Xe.blipFrames+=1),e.framesAtTarget=0,r>0&&r<1&&(e.sawIntermediate=!0),e.driver.setProgress(r);let s=e.moved?8:20;if(e.framesSinceChange>=s){a();return}e.frame=requestAnimationFrame(o)},s=We(e,t=>{let s=t.detail;if(!r||!s||!et(e))return;let c=s.deltaCssPx;if(!Number.isFinite(c)||Math.abs(c)<1)return;a();let l=n(),u=e.getBoundingClientRect().height;if(!(l>0)||!(u>0)||Math.abs(l-u)>1)return;let d=Math.round(u),f=d+c;if(!(f>0)||!r.set(f))return;let p=s.claim();if(!p){r.release();return}i={driver:p,originHostPx:d,deltaCssPx:c,lastViewportPx:l,framesSinceChange:0,moved:!1,sawIntermediate:!1,framesAtTarget:0,frame:null},i.frame=requestAnimationFrame(o)});return{dispose(){s(),a(),r?.dispose()}}}function L(e){let t=e.size??`100%`,n=e.strokeWidth??2;return f(`svg`,{class:`padlock-icon seams-padlock-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":n,"stroke-linecap":`round`,"stroke-linejoin":`round`,width:t,height:t,"aria-hidden":`true`,focusable:`false`,children:[f(`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}),f(`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`})]})}let rt=0;var it=class extends u{id=`seams-halo-${++rt}`;element=l();motion=null;frame=null;startedAt=null;angle=null;componentDidMount(){this.motion=this.element.current.ownerDocument.defaultView.matchMedia(`(prefers-reduced-motion: no-preference)`),this.motion.addEventListener(`change`,this.updateAnimation),this.syncDynamicStyles(),this.updateAnimation()}componentDidUpdate(e){e.styles!==this.props.styles&&e.styles.deleteDynamicRule(this.id),e.innerPadding!==this.props.innerPadding&&this.syncDynamicStyles(),(e.animated!==this.props.animated||e.durationMs!==this.props.durationMs||e.styles!==this.props.styles)&&this.updateAnimation()}componentWillUnmount(){this.cancelFrame(),this.motion?.removeEventListener(`change`,this.updateAnimation),this.motion=null,this.props.styles.deleteDynamicRule(this.id)}cancelFrame(){let e=this.element.current?.ownerDocument.defaultView;this.frame!==null&&e?.cancelAnimationFrame(this.frame),this.frame=null,this.startedAt=null}updateAnimation=()=>{this.cancelFrame(),this.angle=null,this.syncDynamicStyles(),this.props.animated&&this.motion?.matches&&(this.frame=this.element.current.ownerDocument.defaultView.requestAnimationFrame(this.tick))};tick=e=>{if(!this.element.current||!this.props.animated||!this.motion?.matches)return;this.startedAt??=e;let t=this.props.durationMs,n=t&&Number.isFinite(t)&&t>0?t:1150;this.angle=`${(e-this.startedAt)%n/n*360}deg`,this.syncDynamicStyles(),this.frame=this.element.current.ownerDocument.defaultView.requestAnimationFrame(this.tick)};syncDynamicStyles(){let e={};if(this.props.innerPadding&&(e[`--inner-padding`]=this.props.innerPadding),this.angle&&(e[`--halo-angle`]=this.angle),Object.keys(e).length===0){this.props.styles.deleteDynamicRule(this.id);return}this.props.styles.setDynamicDeclarations(this.id,`#${this.id}`,e)}render(){return f(`div`,{id:this.id,ref:this.element,class:`seams-halo-border`,children:f(`div`,{class:`halo-root${this.props.animated?` animated`:``}`,children:f(`div`,{class:`halo-inner`,children:f(`div`,{class:`halo-outer`,children:[this.props.animated&&f(`div`,{class:`halo-ring`,"aria-hidden":`true`}),f(`div`,{class:`halo-content`,children:this.props.children})]})})})})}};function at(e){return f(`div`,{class:`seams-passkey-halo-loading`,"aria-hidden":`true`,children:f(`div`,{class:`seams-passkey-loading-root`,children:f(it,{animated:e.animated,innerPadding:e.innerPadding,styles:e.styles,children:f(`div`,{class:`seams-passkey-loading-touch-icon-container`,children:f(`svg`,{class:`seams-passkey-loading-touch-icon`,"data-icon":e.icon,width:e.size??36,height:e.size??36,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,focusable:`false`,children:e.icon===`mail`?f(ot,{}):f(st,{})})})})})})}function ot(){return f(p,{children:[f(`path`,{d:`M4.5 6.5H19.5C20.0523 6.5 20.5 6.94772 20.5 7.5V16.5C20.5 17.0523 20.0523 17.5 19.5 17.5H4.5C3.94772 17.5 3.5 17.0523 3.5 16.5V7.5C3.5 6.94772 3.94772 6.5 4.5 6.5Z`,stroke:`currentColor`,"stroke-width":`var(--seams-modal__passkey-halo-loading-touch-icon__stroke-width, 3)`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"vector-effect":`non-scaling-stroke`}),f(`path`,{d:`M4.25 7.25L12 12.75L19.75 7.25`,stroke:`currentColor`,"stroke-width":`var(--seams-modal__passkey-halo-loading-touch-icon__stroke-width, 3)`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"vector-effect":`non-scaling-stroke`})]})}function st(){return f(`path`,{d:`M6.40519 19.0481C6.58912 18.6051 6.75832 18.1545 6.91219 17.6969M14.3433 20.6926C14.6095 19.9418 14.8456 19.1768 15.0502 18.399C15.2359 17.6934 15.3956 16.9772 15.5283 16.2516M19.4477 17.0583C19.8121 15.0944 20.0026 13.0694 20.0026 11C20.0026 6.58172 16.4209 3 12.0026 3C10.7472 3 9.55932 3.28918 8.50195 3.80456M3.52344 15.0245C3.83663 13.7343 4.00262 12.3865 4.00262 11C4.00262 9.25969 4.55832 7.64917 5.50195 6.33621M12.003 11C12.003 13.7604 11.5557 16.4163 10.7295 18.8992C10.5169 19.5381 10.2792 20.1655 10.0176 20.7803M7.71227 14.5C7.90323 13.3618 8.00262 12.1925 8.00262 11C8.00262 8.79086 9.79348 7 12.0026 7C14.2118 7 16.0026 8.79086 16.0026 11C16.0026 11.6166 15.9834 12.2287 15.9455 12.8357`,stroke:`currentColor`,"stroke-width":`var(--seams-modal__passkey-halo-loading-touch-icon__stroke-width, 3)`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"vector-effect":`non-scaling-stroke`,pathLength:`1`})}function ct(e){return f(p,{children:[f(`span`,{class:`loading-ellipsis`,"aria-hidden":`true`,children:[f(`span`,{class:`loading-ellipsis__dot`,children:`.`}),f(`span`,{class:`loading-ellipsis__dot`,children:`.`}),f(`span`,{class:`loading-ellipsis__dot`,children:`.`})]}),f(`span`,{class:`sr-only`,children:f(x,{copy:e.label})})]})}function lt(e,t){return`${e.trim().replace(/\/$/,``)}/address/${encodeURIComponent(t)}`}function R(e){return f(`a`,{class:`highlight-receiver-id`,href:lt(e.base,e.address),target:`_blank`,rel:`noopener noreferrer`,children:e.children})}function z(e){let t=e.trim();return/^0x[0-9a-fA-F]{40}$/.test(t)?`${t.slice(0,8)}...${t.slice(-4)}`:t}function B(e){let t=e.label.trim().match(/^(Transaction(?:\s+\d+)?\s+to contract)\b/i);return t?`${t[1]} `:void 0}function ut(e){throw Error(`Unsupported transaction action: ${String(e)}`)}function V(e){let t=e.action;if(t)switch(t.type){case s.FunctionCall:return`Calling ${t.methodName} with ${D(t.deposit)} using ${ue(t.gas)}`;case s.Transfer:return`Transfer ${D(t.amount)}`;case s.CreateAccount:return`Creating Account`;case s.DeleteAccount:return`Deleting Account`;case s.Stake:return`Staking ${D(t.stake)}`;case s.AddKey:return`Adding Key`;case s.DeleteKey:return`Deleting Key`;case s.DeployContract:return`Deploying WASM contract`;case s.DeployGlobalContract:return`Deploy global WASM contract (mode: ${t.deployMode}, size ${k(t.code)})`;case s.UseGlobalContract:return t.accountId?`Use global contract by account ${t.accountId}`:t.codeHash?`Use global contract by hash ${t.codeHash}`:`Use global contract`;default:return ut(t)}if(e.transaction)return((e.totalTransactions??1)>1?`Transaction ${(e.transactionIndex??0)+1}: to `:`Transaction to `)+e.transaction.receiverId;let n=B(e);return e.contractAddress?.trim()&&n?n+z(e.contractAddress):e.label}function dt({node:e,explorers:t}){let n=e.action;if(n)switch(n.type){case s.FunctionCall:{let e=ue(n.gas),t=D(n.deposit);return f(p,{children:[f(x,{message:`Calling`}),` `,f(`span`,{class:`highlight-method-name`,children:n.methodName}),t!==`0 NEAR`&&f(p,{children:[` `,f(x,{message:`with`}),` `,f(`span`,{class:`highlight-method-name`,children:t})]}),e&&f(p,{children:[` `,f(x,{message:`using`}),` `,f(`span`,{class:`highlight-method-name`,children:e})]})]})}case s.Transfer:return f(p,{children:[f(x,{message:`Transfer`}),` `,f(`span`,{class:`highlight-amount`,children:D(n.amount)})]});case s.CreateAccount:return f(x,{message:`Creating Account`});case s.DeleteAccount:return f(x,{message:`Deleting Account`});case s.Stake:return f(x,{message:`Staking {value0}`,values:{value0:D(n.stake)}});case s.AddKey:return f(x,{message:`Adding Key`});case s.DeleteKey:return f(x,{message:`Deleting Key`});case s.DeployContract:return f(x,{message:`Deploying WASM contract ({value0})`,values:{value0:k(n.code)}});case s.DeployGlobalContract:return f(x,{copy:V(e)});case s.UseGlobalContract:return n.accountId?f(p,{children:[f(x,{message:`Use global contract`}),` `,f(R,{base:t.near,address:n.accountId,children:n.accountId})]}):n.codeHash?f(p,{children:[f(x,{message:`Use global contract by hash`}),` `,f(`span`,{class:`highlight-method-name`,children:O(n.codeHash,{prefix:10,suffix:6})})]}):f(x,{message:`Use global contract`});default:return ut(n)}if(e.transaction)return f(p,{children:[f(x,{copy:(e.totalTransactions??1)>1?`Transaction ${(e.transactionIndex??0)+1}: to `:`Transaction to `}),f(R,{base:t.near,address:e.transaction.receiverId,children:e.transaction.receiverId})]});let r=B(e),i=e.contractAddress?.trim();if(i&&r){let n=e.chain&&e.chain!==`unknown`?t[e.chain]:void 0;return f(p,{children:[f(x,{copy:r}),n?f(R,{base:n,address:i,children:z(i)}):f(`span`,{class:`highlight-receiver-id`,children:z(i)})]})}let a=e.label.trim();if(a.toLowerCase().startsWith(`calling `)){let e=a.slice(8).trim(),t=e.toLowerCase().indexOf(` using `);if(t<0&&e)return f(p,{children:[f(x,{message:`Calling`}),` `,f(`span`,{class:`highlight-method-name`,children:e})]});let n=e.slice(0,t).trim(),r=e.slice(t+7).trim();if(t>=0&&n)return f(p,{children:[f(x,{message:`Calling`}),` `,f(`span`,{class:`highlight-method-name`,children:n}),r&&f(p,{children:[f(x,{message:`using`}),` `,r]})]})}return e.fieldLabel?f(p,{children:[f(x,{copy:e.fieldLabel}),e.label.slice(e.fieldLabel.length)]}):f(x,{copy:e.label})}const H=[`anim-h`,`anim-h-active`,`anim-h-driven`],ft=[...H,`anim-h-hold`];let pt=0;function mt(){return f(`svg`,{class:`chevron`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:f(`path`,{fill:`currentColor`,d:`M6 3l5 5-5 5z`})})}function ht(e){return!!e.contentVariants?.decoded&&!!e.contentVariants.raw&&e.contentVariants.decoded!==e.contentVariants.raw}function gt(e,t,n){return f(vt,{node:n,depth:t,styles:e.styles,explorers:e.explorers,onToggle:e.onToggle,onCopy:e.onCopy},n.id)}function _t(e){if(!e.node.children?.length)return null;let t=f(`div`,{class:`tooltip-tree-root`,children:f(`div`,{class:`tooltip-tree-children`,children:e.node.children.map(gt.bind(null,e,1))})});return f(`div`,{class:`seams-tx-tree`,"data-theme":e.theme,children:e.showShadow?f(`div`,{class:`tooltip-border-outer`,children:t}):t})}var vt=class extends u{static contextType=w;state={mode:this.props.node.contentVariants?.defaultMode===`raw`?`raw`:`decoded`,copied:!1};id=`seams-tree-node-${++pt}`;details=l();shell=l();disposed=!1;copiedTimer=null;frame=null;motionTimer=null;motion=null;modeHeight=null;componentDidUpdate(e){if(e.styles!==this.props.styles&&e.styles.deleteDynamicRule(this.id),this.modeHeight!==null&&this.shell.current){let e=this.shell.current,t=this.modeHeight;this.modeHeight=null,e.classList.remove(...H);let n=e.getBoundingClientRect().height;e.classList.add(...H),I({reason:`${this.props.node.id}:file-content-mode`,element:e,drivenClasses:H,fromCssPx:t,toCssPx:n,setHeightCssPx:this.setHeight,onSettled:this.releaseHeight})||(e.classList.remove(...H),this.releaseHeight())}}componentWillUnmount(){this.disposed=!0,this.copiedTimer!==null&&clearTimeout(this.copiedTimer),this.motionTimer!==null&&clearTimeout(this.motionTimer),this.frame!==null&&this.details.current?.ownerDocument.defaultView?.cancelAnimationFrame(this.frame),this.motion?.body.removeEventListener(`transitionend`,this.onTransitionEnd),this.motion=null,this.releaseHeight()}setHeight=e=>{this.disposed||this.props.styles.setDynamicDeclarations(this.id,`#${this.id}`,{"--seams-tree__anim-target":`${e}px`})};releaseHeight=()=>{this.props.styles.deleteDynamicRule(this.id)};clearCopied=()=>{this.copiedTimer=null,this.disposed||this.setState({copied:!1})};copy=async e=>{e.preventDefault(),e.stopPropagation();let t=this.props.node.copyValue;if(!t)return;let n=e.currentTarget.closest(`.seams-tx-tree`);if(n)try{if(!await E(n,t)||this.disposed)return;this.copiedTimer!==null&&clearTimeout(this.copiedTimer),this.setState({copied:!0}),this.copiedTimer=setTimeout(this.clearCopied,2e3),this.props.onCopy?.(t)}catch{}};toggleMode=e=>{e.preventDefault(),e.stopPropagation(),ht(this.props.node)&&(this.shell.current&&(this.modeHeight=this.shell.current.getBoundingClientRect().height,this.setHeight(this.modeHeight),this.shell.current.classList.add(...H)),this.setState({mode:this.state.mode===`decoded`?`raw`:`decoded`}))};toggle=e=>{if(e.target.closest(`a, button`)){e.stopPropagation();return}e.preventDefault(),e.stopPropagation();let t=this.details.current;if(!t||this.motion)return;let n=t.querySelector(`:scope > .folder-children`),r=!t.open,i=t.ownerDocument.defaultView.matchMedia(`(prefers-reduced-motion: reduce)`).matches;if(!n||i){t.open=r,this.props.onToggle?.(this.props.node.id,r);return}this.motion={body:n,open:r};let a=r?0:n.getBoundingClientRect().height;this.setHeight(a),n.classList.add(`anim-h`,`anim-h-active`,`anim-h-hold`),t.open=!0,n.offsetHeight,this.frame=t.ownerDocument.defaultView.requestAnimationFrame(this.startMotion)};startMotion=()=>{if(this.frame=null,!this.motion||this.disposed)return;let{body:e,open:t}=this.motion,n=e.getBoundingClientRect().height,r=t?e.scrollHeight:0;I({reason:this.props.node.id,element:e,drivenClasses:H,fromCssPx:n,toCssPx:r,setHeightCssPx:this.setHeight,onSettled:this.finishMotion})||(e.addEventListener(`transitionend`,this.onTransitionEnd),e.classList.remove(`anim-h-hold`),this.setHeight(r),this.motionTimer=setTimeout(this.finishMotion,t?200:250))};onTransitionEnd=e=>{e.target===this.motion?.body&&e.propertyName===`height`&&this.finishMotion()};finishMotion=()=>{if(this.disposed||!this.motion)return;let{body:e,open:t}=this.motion;this.motion=null,this.motionTimer!==null&&clearTimeout(this.motionTimer),this.motionTimer=null,e.removeEventListener(`transitionend`,this.onTransitionEnd),e.classList.remove(...ft),this.details.current&&(this.details.current.open=t),this.releaseHeight(),this.props.onToggle?.(this.props.node.id,t)};label(e){let t=this.props.node;return f(`span`,{class:`label${t.type===`file`?` label-action-node`:``}`,hidden:t.hideLabel,children:[e&&!t.hideChevron&&f(mt,{}),f(`span`,{class:`label-text`,title:T(this.context,V(t)),children:f(dt,{node:t,explorers:this.props.explorers})}),t.type===`file`&&t.copyValue&&f(`button`,{type:`button`,class:`copy-badge`,"data-copied":String(this.state.copied),onClick:this.copy,title:T(this.context,this.state.copied?`Copied`:`Copy`),children:this.state.copied?`copied`:`copy`})]})}render(){let{node:e,depth:t}=this.props,n=`row summary-row depth-${Math.max(0,t-1)}`;if(e.type===`file`&&!e.content)return f(`div`,{id:this.id,class:`row file-row depth-${Math.max(0,t-1)}`,"data-no-elbow":String(!!e.hideLabel),children:[f(`span`,{class:`indent`}),this.label(!1)]});let r=ht(e),i=r&&e.contentVariants?e.contentVariants[this.state.mode]:e.content,a=this.state.mode===`decoded`?`bytes`:`decoded`;return f(`details`,{id:this.id,ref:this.details,class:`tree-node ${e.type}`,open:!!e.open,"data-node-id":e.id,children:[f(`summary`,{class:n,"data-no-elbow":String(!!e.hideLabel),onClick:this.toggle,children:[f(`span`,{class:`indent`}),this.label(!0),e.type===`file`&&f(`div`,{ref:this.shell,class:`file-content-shell${r?` has-mode-toggle`:``}`,children:[r&&f(`button`,{type:`button`,class:`file-content-mode-toggle`,title:T(this.context,`Show ${a}`),"aria-label":T(this.context,`Show ${a}`),onClick:this.toggleMode,children:f(x,{copy:a})}),f(`div`,{class:`file-content`,children:i})]})]}),e.type===`folder`&&!!e.children?.length&&f(`div`,{class:`folder-children`,children:e.children.map(gt.bind(null,this.props,t+1))})]})}};let yt=0;function U(e){e.stopPropagation()}var bt=class extends u{static contextType=w;state={armed:!1};id=`seams-confirm-content-${++yt}`;root=l();reflow;frame=null;capturedBeforeUpdate=!1;reflowEnabled=!0;constructor(e){super(e),this.reflow=qe({reason:`tx-body`,element:this.getReflowElement,setHeightCssPx:this.setHeight})}getReflowElement=()=>{let e=this.root.current;return e?.closest(`.modal-container-root, .seams-confirmation-drawer`)??e};setHeight=e=>{let t=this.getReflowElement(),n=t?.id?`#${t.id}`:`#${this.id}`;this.props.styles.setDynamicDeclarations(this.id,n,{[F]:`${e}px`})};componentDidMount(){this.reflowEnabled=this.getReflowElement()===this.root.current,this.frame=this.root.current.ownerDocument.defaultView.requestAnimationFrame(this.afterFirstPaint)}afterFirstPaint=()=>{this.frame=this.root.current.ownerDocument.defaultView.requestAnimationFrame(this.arm)};arm=()=>{this.frame=null,this.setState({armed:!0})};componentWillReceiveProps(){this.reflowEnabled&&(this.reflow.capture(),this.capturedBeforeUpdate=!0)}componentWillUpdate(){this.reflowEnabled&&(this.capturedBeforeUpdate||this.reflow.capture())}componentDidUpdate(e){this.reflowEnabled&&(this.capturedBeforeUpdate=!1,e.styles!==this.props.styles&&e.styles.deleteDynamicRule(this.id),this.reflow.commit())}componentWillUnmount(){this.frame!==null&&this.root.current?.ownerDocument.defaultView?.cancelAnimationFrame(this.frame),this.frame=null,this.reflow.dispose(),this.props.styles.deleteDynamicRule(this.id)}confirm=()=>{this.state.armed&&this.props.decision.kind===`ready`&&this.props.decision.onConfirm()};cancel=()=>{this.props.onCancel()};render(){let e=this.props.decision.kind===`preparing`;return f(`div`,{class:`seams-tx-confirm-content`,onPointerDown:U,onMouseDown:U,onTouchStart:U,children:f(`div`,{id:this.id,ref:this.root,class:`txc-root`,children:[this.props.errorMessage&&f(`div`,{class:`error`,role:`alert`,children:f(x,{copy:this.props.errorMessage})}),this.props.tree&&f(`div`,{class:`tooltip-width`,children:f(_t,{node:this.props.tree,theme:this.props.theme,explorers:this.props.explorers,styles:this.props.styles,showShadow:!1,onToggle:this.props.onTreeToggle,onCopy:this.props.onCopy})}),this.props.authMethodApprovalMessage&&f(`p`,{class:`seams-voiceid-instructions`,"data-seams-voice-id":`required`,role:`status`,children:this.props.authMethodApprovalMessage}),f(`div`,{class:`actions`,children:[!this.props.cancelInHeader&&f(`button`,{type:`button`,class:`cancel`,onClick:this.cancel,children:f(x,{copy:this.props.cancelText})}),f(`button`,{type:this.props.decision.kind===`form`?`submit`:`button`,form:this.props.decision.kind===`form`?this.props.decision.formId:void 0,class:`confirm${e?` loading`:``}`,onClick:this.confirm,disabled:e||!this.state.armed,children:e?f(p,{children:[f(`span`,{class:`loading-indicator`,role:`progressbar`,"aria-label":b(this.context,`Loading`)}),f(`span`,{children:f(x,{message:`Loading...`})})]}):f(p,{children:[this.props.confirmIcon,f(x,{copy:this.props.confirmText})]})})]})]})})}};function xt(e){throw Error(`Unexpected confirmation body: ${String(e)}`)}var St=class extends u{static contextType=w;copy=()=>{this.props.model.kind===`funding`&&this.props.onCopyAccount(this.props.model.accountId)};render(){let e=this.props.model;switch(e.kind){case`empty`:return null;case`text`:return f(`div`,{class:`confirmation-body`,children:f(x,{copy:e.text})});case`status`:return f(`div`,{class:`confirmation-body confirmation-body--status`,children:f(x,{copy:e.text})});case`funding`:return f(`div`,{class:`confirmation-body confirmation-body--funding`,children:[f(x,{message:`NEAR account`}),f(`button`,{type:`button`,class:`confirmation-body__copy-target`,title:T(this.context,`Copy ${e.accountId}`),"aria-label":T(this.context,`Copy NEAR account ${e.accountId}`),onClick:this.copy,children:e.shortAccountId}),f(x,{message:`needs funding`})]});default:return xt(e)}}};function Ct(e){let t=y();return f(`div`,{class:`passkey-registration-confirm__identity`,"aria-label":b(t,`Passkey registration details`),children:[f(`div`,{class:`passkey-registration-confirm__row`,children:[f(`span`,{class:`passkey-registration-confirm__label`,children:f(x,{message:`Account`})}),f(`span`,{class:`passkey-registration-confirm__value`,title:T(t,e.display.intendedUserName),children:e.display.intendedUserName})]}),f(`div`,{class:`passkey-registration-confirm__row`,children:[f(`span`,{class:`passkey-registration-confirm__label`,children:f(x,{message:`Website`})}),f(`span`,{class:`passkey-registration-confirm__value`,title:T(t,e.display.rpId),children:e.display.rpId})]})]})}var wt=class extends u{static contextType=w;confirm=()=>{this.props.decision.kind===`ready`&&this.props.decision.onConfirm()};cancel=()=>{this.props.onCancel()};render(){let e=this.props.decision.kind===`creating`;return f(`div`,{ref:this.props.root,class:`passkey-registration-confirm`,children:[f(`div`,{class:`hero passkey-registration-confirm__hero`,children:[f(at,{animated:!this.props.errorMessage,icon:`fingerprint`,size:44,styles:this.props.styles}),f(`div`,{class:`hero-container passkey-registration-confirm__hero-copy`,children:[f(`h2`,{class:`hero-heading`,children:f(x,{copy:this.props.heading})}),f(`p`,{class:`passkey-registration-confirm__body`,children:f(x,{copy:this.props.body})})]})]}),this.props.errorMessage&&f(`div`,{class:`error-banner`,children:f(x,{copy:this.props.errorMessage})}),f(Ct,{display:this.props.display}),f(`div`,{class:`passkey-registration-confirm__actions`,children:[f(`button`,{type:`button`,class:`btn btn-cancel`,onClick:this.cancel,children:f(x,{copy:this.props.cancelText})}),f(`button`,{type:`button`,class:`btn btn-confirm`,disabled:e,onClick:this.confirm,children:e?f(p,{children:[f(`span`,{class:`loading-indicator passkey-registration-confirm__spinner`,role:`progressbar`,"aria-label":b(this.context,`Creating passkey`)}),f(`span`,{class:`passkey-registration-confirm__busy-label`,children:f(x,{message:`Creating passkey...`})})]}):f(x,{message:`Create passkey`})})]})]})}};let Tt=0;var Et=class extends u{id=`seams-email-code-${++Tt}`;input=e=>{this.props.state.kind===`editing`&&this.props.state.onInput(e.currentTarget.value)};resend=()=>{this.props.resend?.kind===`available`&&this.props.resend.onResend()};renderDigit=e=>{let t=this.props.code[e]||``;return f(`span`,{class:`email-otp-confirm__slot${t?` is-filled`:``}`,children:t},e)};render(){let e=this.props.state.kind!==`editing`,t=`${this.id}-helper`,n=`${this.id}-error`;return f(`div`,{class:`email-otp-confirm`,children:[f(`label`,{class:`email-otp-confirm__label`,for:this.id,children:f(x,{message:`Email code`})}),f(`div`,{class:`email-otp-confirm__code-field`,"data-disabled":e?`true`:`false`,children:[f(`input`,{id:this.id,name:`email-code`,type:`text`,class:`email-otp-confirm__input`,inputMode:`numeric`,autoComplete:`one-time-code`,"data-email-otp-challenge-id":this.props.challengeId,pattern:`[0-9]*`,maxLength:6,spellcheck:!1,value:this.props.code,disabled:e,onInput:this.input,"aria-invalid":this.props.errorMessage?`true`:void 0,"aria-describedby":this.props.errorMessage?`${t} ${n}`:t}),f(`div`,{class:`email-otp-confirm__slots${e?` is-submitting`:``}`,"aria-hidden":`true`,children:[0,1,2,3,4,5].map(this.renderDigit)})]}),f(`div`,{id:t,class:`email-otp-confirm__helper`,children:f(x,{copy:this.props.helperText})}),this.props.errorMessage&&f(`div`,{id:n,class:`email-otp-confirm__error`,children:f(x,{copy:this.props.errorMessage})}),this.props.resend&&f(`button`,{type:`button`,class:`email-otp-confirm__resend`,disabled:this.props.resend.kind===`unavailable`,onClick:this.resend,children:f(x,{copy:this.props.resend.label})})]})}},Dt=class{codeState={kind:`editing`,code:``};resendState={kind:`available`,label:`Resend code`};error=``;countdown=null;options;constructor(e){this.options=e}input=e=>{if(this.codeState.kind!==`editing`)return;let t=e.replace(/\D/g,``).slice(0,6);this.error=``,this.codeState={kind:`editing`,code:t},t.length===6?this.confirm():this.publish()};confirm(){if(this.codeState.kind!==`editing`)return`ignored`;let e=this.codeState.code;return e.length===6?(this.error=``,this.codeState={kind:`fading`,code:e,timer:setTimeout(this.submit,150)},this.publish(),`accepted`):(this.error=`Enter the 6-digit Email OTP code.`,this.publish(),`invalid`)}submit=()=>{if(this.codeState.kind!==`fading`)return;let e=this.codeState.code;this.codeState={kind:`submitting`,code:e},this.publish(),this.isDisposed()||this.options.onSubmit(e)};retry(e){this.codeState.kind!==`disposed`&&(this.cancelFade(),this.codeState={kind:`editing`,code:this.codeState.code},this.error=e,this.publish())}setVerification(e){if(this.codeState.kind!==`disposed`)switch(e.kind){case`ready`:this.codeState.kind===`submitting`&&this.retry(``);return;case`pending`:this.cancelFade(),this.codeState={kind:`submitting`,code:this.codeState.code},this.publish();return;case`rejected`:this.retry(e.message);return}}resend=async()=>{if(this.codeState.kind!==`editing`||this.resendState.kind!==`available`)return;let e=this.options.resend;if(!e)return;let t=Date.now()+e.cooldownMs,n={kind:`sending`,until:t};if(this.resendState=n,this.error=``,this.publish(),this.isDisposed())return;let r;try{r=await e.send()}catch{r={kind:`failed`,message:`Could not send code.`}}if(this.isDisposed()||this.resendState!==n)return;let i=r.kind===`sent`?`Code sent`:`Resend code`;r.kind===`failed`&&(this.error=r.message),Date.now()>=t?this.resendState={kind:`available`,label:i}:(this.resendState={kind:`cooldown`,until:t,label:i},this.countdown=setInterval(this.tick,250)),this.publish()};tick=()=>{this.resendState.kind===`cooldown`&&(Date.now()>=this.resendState.until&&(this.resendState={kind:`available`,label:this.resendState.label},this.clearCountdown()),this.publish())};isDisposed(){return this.codeState.kind===`disposed`}publish(){this.codeState.kind!==`disposed`&&this.options.onChange({code:this.codeState.code,phase:this.codeState.kind,error:this.error,resend:this.options.resend?this.resendSnapshot():null})}resendSnapshot(){switch(this.resendState.kind){case`available`:return{available:this.codeState.kind===`editing`,label:this.resendState.label};case`sending`:return{available:!1,label:`Sending...`};case`cooldown`:return{available:!1,label:`Resend in ${Math.max(1,Math.ceil((this.resendState.until-Date.now())/1e3))}s`}}}cancelFade(){this.codeState.kind===`fading`&&clearTimeout(this.codeState.timer)}clearCountdown(){this.countdown!==null&&clearInterval(this.countdown),this.countdown=null}dispose(){this.cancelFade(),this.clearCountdown(),this.codeState={kind:`disposed`},this.error=``}};function Ot(e){return f(kt,{...e},e.prompt.challengeId)}var kt=class extends u{static contextType=w;session;form=l();lifetime;constructor(e){super(e),this.lifetime={kind:`active`,challengeId:e.prompt.challengeId,emailHint:e.prompt.emailHint?.trim()||``},this.state={code:``,phase:`editing`,error:``,resend:e.prompt.onResend?{available:!0,label:`Resend code`}:null},this.session=new Dt({onSubmit:this.submit,onChange:this.change,resend:e.prompt.onResend?{send:this.send,cooldownMs:Math.max(1e3,Math.floor(Number(e.prompt.resendDebounceMs)||1e4))}:null})}submit=e=>{this.lifetime.kind===`active`&&this.props.onSubmit(e,this.lifetime.challengeId)};send=async()=>{let e=this.props.prompt.onResend;if(!e)return{kind:`failed`,message:`Could not send code.`};try{let t=await e();if(this.lifetime.kind===`disposed`)return{kind:`sent`};let n=String(t?.challengeId||``).trim(),r=String(t?.emailHint||``).trim();return n&&(this.lifetime={kind:`active`,challengeId:n,emailHint:r||this.lifetime.emailHint}),{kind:`sent`}}catch(e){return{kind:`failed`,message:jt(e)}}};change=e=>{this.setState(e)};confirm=e=>{e.preventDefault(),e.stopPropagation(),this.session.confirm()===`invalid`&&this.setState({},this.focusCode)};focusCode=()=>{this.form.current?.querySelector(`input`)?.focus({preventScroll:!0})};componentDidMount(){this.session.setVerification(this.props.verification)}componentDidUpdate(e){At(e.verification,this.props.verification)&&this.session.setVerification(this.props.verification)}componentWillUnmount(){this.lifetime={kind:`disposed`},this.session.dispose()}inputState(){switch(this.state.phase){case`editing`:return{kind:`editing`,onInput:this.session.input};case`fading`:return{kind:`fading`};case`submitting`:return{kind:`submitting`}}}resendAction(){let e=this.state.resend;return e?e.available?{kind:`available`,label:e.label,onResend:this.session.resend}:{kind:`unavailable`,label:e.label}:null}render(){return f(`form`,{ref:this.form,id:this.props.formId,onSubmit:this.confirm,noValidate:!0,children:f(Et,{challengeId:this.lifetime.kind===`active`?this.lifetime.challengeId:``,code:this.state.code,helperText:this.props.prompt.helperText?.trim()||_(this.lifetime.kind===`active`?this.lifetime.emailHint:``),errorMessage:T(this.context,this.state.error||void 0),state:this.inputState(),resend:this.resendAction()})})}};function At(e,t){return e.kind===t.kind?e.kind===`rejected`&&t.kind===`rejected`&&e.message!==t.message:!0}function jt(e){if(e&&typeof e==`object`&&`code`in e&&e.code===`rate_limited`){let t=`retryAfterMs`in e?Number(e.retryAfterMs):NaN;return Number.isFinite(t)&&t>0?`Too many requests. Try again in ${Math.max(1,Math.ceil(t/1e3))}s.`:`Too many requests. Try again shortly.`}return e instanceof Error&&e.message?e.message:`Could not send code.`}let Mt=0;var W=class extends u{root=l();id=`seams-review-disclosure-${++Mt}`;componentDidMount(){this.root.current&&(this.root.current.open=this.props.initiallyOpen??!1)}motion=null;componentWillUnmount(){this.clearMotion(),this.root.current&&S(this.root.current.ownerDocument).deleteDynamicRule(this.id)}clearMotion(){this.motion&&(this.motion.kind===`local`&&(this.motion.size.onfinish=null,this.motion.size.cancel(),this.motion.fade.cancel()),this.motion=null,this.root.current?.removeAttribute(`data-resizing`))}setHeight=e=>{let t=this.root.current;t&&S(t.ownerDocument).setDynamicDeclarations(this.id,`#${this.id}`,{"--seams-review-disclosure-height":`${e}px`})};finish=()=>{let e=this.motion?.kind===`local`;if(this.root.current&&this.motion&&(this.root.current.open=this.motion.opening,this.root.current.removeAttribute(`data-closing`)),this.clearMotion(),e){let e=this.root.current?.closest(`.seams-confirmation-surface`),t=e?.ownerDocument.activeElement;if(t instanceof HTMLElement&&t.tabIndex>=0&&e?.contains(t)){let e=t.getBoundingClientRect(),n=t.ownerDocument.documentElement.clientHeight;(e.top<0||e.bottom>n)&&t.scrollIntoView({block:`center`,inline:`nearest`})}}};toggle=e=>{let t=this.root.current;if(!t||(e.preventDefault(),this.motion?.kind===`hosted`))return;let n=this.motion?!this.motion.opening:!t.open,r=t.lastElementChild;if(!(r instanceof HTMLElement))return;let i=t.open?r.getBoundingClientRect().height:0;if(this.clearMotion(),t.toggleAttribute(`data-closing`,!n),window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||!t.animate){t.open=n,t.removeAttribute(`data-closing`);return}t.open=!0;let a=t.parentElement?.closest(`.seams-review-technical > div`);if(a&&a.scrollHeight>a.clientHeight){t.open=n,t.removeAttribute(`data-closing`);return}t.setAttribute(`data-resizing`,``);let o=n?r.getBoundingClientRect().height:0;if(this.motion={kind:`hosted`,opening:n},I({element:r,reason:`review-details`,fromCssPx:i,toCssPx:o,drivenClasses:[`seams-review-disclosure-driven`],setHeightCssPx:this.setHeight,onSettled:this.finish}))return;let s=r.animate([{height:`${i}px`,overflow:`hidden`},{height:`${o}px`,overflow:`hidden`}],{duration:n?220:180,easing:`cubic-bezier(.2,0,0,1)`,fill:`both`});this.motion={kind:`local`,opening:n,size:s,fade:r.animate(n?[{opacity:0},{opacity:1}]:[{opacity:1},{opacity:0}],{duration:n?180:100,easing:`ease-out`,fill:`both`})},s.onfinish=this.finish};render(){return f(`details`,{ref:this.root,class:`seams-review-${this.props.kind??`technical`}`,children:[f(`summary`,{onClick:this.toggle,children:[f(x,{copy:this.props.label}),f(`svg`,{class:`seams-review-caret`,viewBox:`0 0 20 20`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.6`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,children:f(`path`,{d:`m5 7.5 5 5 5-5`})})]}),f(`div`,{id:this.id,children:this.props.children})]})}};function G({kind:e}){let t={back:`m15 6-6 6 6 6`,close:`M6 6l12 12M6 18L18 6`,minimize:`M5 12h14`,check:`m5 12 4 4L19 6`,arrow:`M7 17 17 7M7 7h10v10`,copy:`M8 8h12v12H8ZM4 16V4h12`,loader:`M12 3a9 9 0 1 1-9 9`,alert:`M12 8v5m0 3v.1M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0`,fingerprint:`M6.405 19.048c.184-.443.353-.894.507-1.351M14.343 20.693c.266-.751.502-1.516.707-2.294.186-.706.346-1.422.478-2.147M19.448 17.058c.364-1.964.555-3.989.555-6.058 0-4.418-3.582-8-8-8-1.255 0-2.443.289-3.501.805M3.523 15.025c.314-1.29.48-2.638.48-4.025 0-1.74.556-3.351 1.499-4.664M12.003 11c0 2.76-.447 5.416-1.273 7.899-.213.639-.451 1.266-.712 1.881M7.712 14.5c.191-1.138.291-2.308.291-3.5 0-2.209 1.791-4 4-4s4 1.791 4 4c0 .617-.02 1.229-.058 1.836`};return f(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.6`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,children:f(`path`,{d:t[e]})})}function Nt(e){return e?e.chain===`evm`&&e.chainId===5042?`Arc`:e.chain===`evm`&&e.chainId===5042002?`Arc Testnet`:e.chain===`evm`&&e.chainId===8453?`Base`:e.chain===`evm`&&e.chainId===84532?`Base Sepolia`:e.chain===`evm`&&e.chainId===1?`Ethereum`:e.chain===`evm`&&e.chainId===11155111?`Ethereum Sepolia`:`${e.chain.toUpperCase()}${e.chainId?` · ${e.chainId}`:``}`:`Wallet transaction`}function Pt(e){if(e?.operations.length!==1)return null;let t=e.operations[0];return t.kind===`generic.contractCall`||t.kind===`tempo.eip2718`?t.to??null:null}function Ft({value:e,class:t}){let n=y();return f(`bdi`,{class:`seams-review-middle ${t}`,dir:`ltr`,title:T(n,e),children:[f(`span`,{children:e.slice(0,-8)}),f(`span`,{children:e.slice(-8)})]})}function It({symbol:e}){return e===`NEAR`?f(`svg`,{class:`seams-review-token`,viewBox:`0 0 48 48`,"aria-hidden":`true`,children:[f(`circle`,{cx:`24`,cy:`24`,r:`24`,fill:`#000`}),f(`svg`,{x:`9`,y:`9`,width:`30`,height:`30`,viewBox:`108 108 351 351`,children:f(`path`,{d:`m421.61,108c-13,0-25.07,6.74-31.88,17.82l-73.37,108.93c-2.39,3.59-1.42,8.43,2.17,10.82,2.91,1.94,6.76,1.7,9.41-.58l72.22-62.64c1.2-1.08,3.05-.97,4.13.23.49.55.75,1.26.75,1.99v196.12c0,1.62-1.31,2.92-2.93,2.92-.87,0-1.69-.38-2.24-1.05L181.56,121.24c-7.11-8.39-17.55-13.23-28.54-13.24h-7.63c-20.65,0-37.39,16.74-37.39,37.39v276.22c0,20.65,16.74,37.39,37.39,37.39,13,0,25.07-6.74,31.88-17.82l73.37-108.93c2.39-3.59,1.42-8.43-2.17-10.82-2.91-1.94-6.76-1.7-9.41.58l-72.22,62.64c-1.2,1.08-3.05.97-4.13-.23-.49-.55-.75-1.26-.74-1.99v-196.17c0-1.62,1.31-2.92,2.93-2.92.86,0,1.69.38,2.24,1.05l218.28,261.37c7.11,8.39,17.55,13.23,28.54,13.24h7.63c20.65.01,37.4-16.72,37.42-37.37V145.39c0-20.65-16.74-37.39-37.39-37.39Z`,fill:`#fff`})})]}):e===`ETH`?f(`svg`,{class:`seams-review-token`,viewBox:`0 0 42 42`,"aria-hidden":`true`,children:[f(`circle`,{cx:`21`,cy:`21`,r:`21`,fill:`#eef0fb`}),f(`path`,{d:`m21 6-9 15 9 5 9-5Z`,fill:`#627eea`}),f(`path`,{d:`m21 6 9 15-9 5Z`,fill:`#465da9`}),f(`path`,{d:`m12 23 9 13 9-13-9 5Z`,fill:`#627eea`})]}):e===`USDC`?f(`svg`,{class:`seams-review-token`,viewBox:`0 0 96 96`,fill:`none`,"aria-hidden":`true`,children:[f(`path`,{d:`M48 95C73.9574 95 95 73.9574 95 48C95 22.0426 73.9574 1 48 1C22.0426 1 1 22.0426 1 48C1 73.9574 22.0426 95 48 95Z`,fill:`#0B53BF`}),f(`path`,{d:`M56.4609 13.7778V19.8291C68.5341 23.4716 77.3759 34.6928 77.3759 47.9997C77.3759 61.3066 68.5341 72.5278 56.4609 76.1703V82.2216C71.8534 78.4616 83.2509 64.5672 83.2509 47.9997C83.2509 31.4322 71.8534 17.5378 56.4609 13.7778Z`,fill:`white`}),f(`path`,{d:`M18.625 47.9997C18.625 34.6928 27.4669 23.4716 39.54 19.8291V13.7778C24.1475 17.5378 12.75 31.4322 12.75 47.9997C12.75 64.5672 24.1475 78.4616 39.54 82.2216V76.1703C27.4669 72.5572 18.625 61.3066 18.625 47.9997Z`,fill:`white`}),f(`path`,{d:`M60.6319 54.5506C60.6319 42.5362 41.8025 47.4713 41.8025 40.8325C41.8025 38.4531 43.7119 36.9256 47.3544 36.9256C51.7019 36.9256 53.2 39.0406 53.67 41.89H59.6625C59.1279 36.5426 56.0588 33.1662 50.9382 32.1604V27.4375H45.0632V31.9918C39.4534 32.7062 35.9275 35.973 35.9275 40.8325C35.9275 52.9056 54.7863 48.3819 54.7863 54.9031C54.7863 57.3706 52.4069 59.0156 48.3825 59.0156C43.1244 59.0156 41.3913 56.695 40.745 53.4931H34.8994C35.2781 59.3502 38.8897 63.0159 45.0632 63.9307V68.5625H50.9382V63.9923C56.9633 63.2139 60.6319 59.7089 60.6319 54.5506Z`,fill:`white`})]}):f(`span`,{class:`seams-review-token seams-review-token-fallback`,"aria-hidden":`true`,children:e.slice(0,1)})}function Lt({model:e,compact:t=!1}){let n=Bt(e);return n?f(`div`,{class:`seams-review-amount${t?` seams-review-amount--compact`:``}`,children:[f(It,{symbol:n.symbol}),f(`div`,{children:[f(`span`,{children:n.value}),` `,f(`small`,{children:n.symbol})]})]}):null}function Rt(){return f(`div`,{class:`seams-receipt-footer`,children:[f(`span`,{children:f(x,{message:`Secured by`})}),` `,f(m,{})]})}function zt(e,t){if(!/^\d+$/.test(e))return e;let n=e.padStart(t+1,`0`),r=n.slice(-t).replace(/0+$/,``);return`${n.slice(0,-t)}${r?`.${r}`:``}`}function Bt(e){let t=e?.totals;return t?.nativeValue?t.nativeSymbol===`yoctoNEAR`?{value:zt(t.nativeValue,24),symbol:`NEAR`}:e?.chain===`evm`&&(e.chainId===5042||e.chainId===5042002)&&t.nativeSymbol===`wei`?{value:zt(t.nativeValue,18),symbol:`USDC`}:{value:t.nativeValue,symbol:t.nativeSymbol??``}:null}var K=class extends u{static contextType=w;state={copied:!1};lifetime=new AbortController;timer=null;resetCopied=()=>{this.setState({copied:!1})};componentWillUnmount(){this.lifetime.abort(),this.timer!==null&&clearTimeout(this.timer)}componentDidUpdate(e){e.value!==this.props.value&&(this.lifetime.abort(),this.lifetime=new AbortController,this.timer!==null&&clearTimeout(this.timer),this.resetCopied())}copy=async e=>{let t=e.currentTarget;if(!(t instanceof HTMLElement))return;let n=this.lifetime.signal;try{if(!await E(t,this.props.value,n)||n.aborted)return;this.setState({copied:!0}),this.timer!==null&&clearTimeout(this.timer),this.timer=setTimeout(this.resetCopied,3e3)}catch{n.aborted||this.setState({copied:!1})}};render(){return f(`button`,{type:`button`,class:`seams-review-copy${this.props.address?` seams-review-copy-address`:``}${this.state.copied?` copied`:``}`,onClick:this.copy,"aria-label":T(this.context,this.state.copied?`Copied`:this.props.label??`Copy value`),children:[this.props.address&&f(`bdi`,{class:`seams-review-full-address`,dir:`ltr`,children:this.props.value}),f(ne,{})]})}};function Vt({node:e}){let t=y();if(e.action||e.transaction)return f(p,{children:f(x,{copy:V(e)})});let n=B(e);if(n&&e.contractAddress){let r=e.contractAddress;return f(`span`,{class:`seams-review-contract`,children:[f(x,{copy:n.trim()}),f(`span`,{class:`seams-review-contract-value`,children:[f(Ft,{value:r,class:`seams-review-contract-address`}),f(K,{value:r,label:T(t,`Copy contract address ${r}`)})]})]})}if(e.fieldLabel){let t=e.label.slice(e.fieldLabel.length);return f(p,{children:[f(x,{copy:e.fieldLabel}),e.fieldLabel===`Method:`?f(`span`,{class:`seams-review-function`,children:t}):t]})}let r=/^(Call(?:ing)? )([^\s]+)(.*)$/.exec(e.label);return r?f(p,{children:[f(x,{copy:r[1]}),f(`span`,{class:`seams-review-function`,children:r[2]}),r[3]]}):f(p,{children:f(x,{copy:e.label})})}function Ht({node:e}){let t=y(),n=e.contentVariants?.decoded??e.content,r=!!(e.contentVariants||n?.includes(`
|
|
1
|
+
import{n as e}from"./chunk-dVx5-UGu.js";import{v as t}from"./digests-BIaE0DMd.js";import{i as n}from"./chains-B72I4PDH.js";import{r}from"./transactionReviewAdmission-Cf_qUZJt.js";import{a as i,i as a,r as o,t as s}from"./actions-7SvZZut1.js";import{t as c}from"./surface-measurement-reporter-DJ_dQhBV.js";import{a as l,i as u,o as d,r as f,s as p}from"./csp-stylesheet-5LU6VGKK.js";import{t as m}from"./SeamsWordmark-CeEi2RlU.js";import{i as h,r as g}from"./intentDigest-gM3r4SVX.js";import{t as _}from"./promptText-bcKcsSka.js";import{a as v}from"./transaction-activity-BXSxMp1E.js";import{a as y,c as b,i as x,n as S,o as C,r as w,s as T,t as ee}from"./appearance-token-vars-CzlRDVQ7.js";import{i as E,n as te,r as ne,t as re}from"./ConfirmationDrawer-fyl4IDRl.js";import{n as ie,t as ae}from"./appearance-DL7c6bML.js";let oe=!1;function se(e=!0){oe=!!e}function ce(){return oe}function le(e){if(!e)return``;if(typeof e==`string`)return e;try{return JSON.stringify(e,(e,t)=>typeof t==`bigint`?t.toString():t,2)}catch{return String(e)}}function D(e){if(!e||e===`0`)return`0 NEAR`;try{let t=BigInt(e),n=BigInt(`1000000000000000000000000`),r=t/n,i=t%n;if(i===BigInt(0))return`${r.toString()} NEAR`;let a=i.toString().padStart(24,`0`).slice(0,5);return a=a.replace(/0+$/g,``),a.length===0?`${r.toString()} NEAR`:`${r.toString()}.${a} NEAR`}catch{return e}}function ue(e){if(!e)return``;try{return`${BigInt(e)/BigInt(`1000000000000`)} Tgas`}catch{return e}}function O(e,t={}){if(!e||typeof e!=`string`)return``;let{prefix:n=12,suffix:r=6}=t;return e.length<=n+r+3?e:`${e.slice(0,n)}...${e.slice(-r)}`}function k(e){return e?e instanceof Uint8Array?`${e.byteLength} bytes`:Array.isArray(e)||typeof e==`string`?`${e.length} bytes`:`unknown`:`0 bytes`}function de(e){if(!e)return;let t=String(e.decoded||``),n=String(e.raw||``);if(!(!t||!n)&&t!==n)return{decoded:t,raw:n,defaultMode:e.defaultMode===`raw`?`raw`:`decoded`}}function fe(e,t){if(!/Value \(wei\)$/i.test(e.trim()))return!1;let n=t.trim();if(!n)return!1;if(n===`0`||/^0x0+$/i.test(n))return!0;try{return BigInt(n)===0n}catch{return!1}}function pe(e,t){return!Array.isArray(t)||t.length===0?[]:t.flatMap((t,n)=>{let r=String(t.label||``).trim(),i=String(t.value||``),a=t.renderAs||`inline`;if(fe(r,i))return[];if(a===`file-content`){let a=de(t.contentVariants),o=a?.defaultMode===`raw`?a.raw:a?.decoded||i;return[{id:`${e}-field-${n}`,label:r?`${r}:`:``,fieldLabel:r?`${r}:`:void 0,type:`file`,open:!1,content:o,...a?{contentVariants:a}:{},copyValue:typeof t.copyValue==`string`?t.copyValue:void 0,hideLabel:!!t.hideLabel,hideChevron:typeof t.hideChevron==`boolean`?t.hideChevron:!0}]}return[{id:`${e}-field-${n}`,label:r?`${r}: ${i}`:i,fieldLabel:r?`${r}:`:void 0,type:`file`,open:!1,copyValue:typeof t.copyValue==`string`?t.copyValue:void 0}]})}const me=({operation:e,depth:t,path:n,renderChild:r})=>{let i=String(e.id||``).trim()||`op-${n}`,a=(()=>{let t=String(e.to||``).trim();return/^0x[0-9a-fA-F]{40}$/.test(t)?t:void 0})(),o=String(e.description||``).trim(),s=Array.isArray(e.children)?e.children.map((e,i)=>r(e,t+1,`${n}.${i}`)):[],c=pe(i,e.fields),l=o?[{id:`${i}-description`,label:o,type:`file`,open:!1}]:[];if(e.kind===`raw.fallback`){let t=String(e.raw||``).trim();t&&l.push({id:`${i}-raw`,label:`Raw payload`,type:`file`,open:!1,content:t})}let u=[...l,...c,...s];return u.length===0?{id:i,label:String(e.label||e.kind),type:`file`,open:!1,contractAddress:a}:{id:i,label:String(e.label||e.kind),type:`folder`,open:t<1,contractAddress:a,children:u}};function he(e){switch(e){case`near`:return`NEAR`;case`evm`:return`EVM`;case`tempo`:return`Tempo`;default:return`Unknown`}}function ge(e){return!Array.isArray(e)||e.length===0?[]:[{id:`warnings-root`,label:`Warnings`,type:`folder`,open:!0,children:e.map((e,t)=>({id:`warning-${t}`,label:`[${String(e.severity||`warning`).toUpperCase()}] ${String(e.message||``)}`,type:`file`,open:!1}))}]}function _e(e,t,n){return me({operation:e,depth:t,path:n,renderChild:(e,t,n)=>_e(e,t,n)})}function ve(e){let t=Array.isArray(e.children)?e.children.map(e=>ve(e)):void 0;return e.type===`folder`?{...e,hideChevron:!0,children:t}:t?{...e,children:t}:e}function ye(e,t){let n=Array.isArray(e.children)?e.children.map(e=>ye(e,t)):void 0;return{...e,chain:t,...n?{children:n}:{}}}function be(e){let t=e.chain===`evm`||e.chain===`tempo`,n=(Array.isArray(e.operations)?e.operations:[]).map((e,t)=>_e(e,0,String(t))).map(t=>ye(t,e.chain)).map(e=>t?ve(e):e),r=[...ge(e.warnings).map(t=>ye(t,e.chain)).map(e=>t?ve(e):e),...n];r.length===0&&r.push({id:`no-operations`,label:`No operations`,type:`file`,open:!1});let i=he(e.chain);return{id:`display-root`,label:String(e.title||``).trim()||`${i} Transaction`,type:`folder`,open:!0,children:r}}function xe(e,n){let r;switch(e.type){case`FunctionCall`:r=[{id:`a${n}-args`,label:`using args:`,type:`file`,open:!1,hideChevron:!0,hideLabel:!0,content:le(e.args)}];break;case`Transfer`:r=[];break;case`CreateAccount`:r=[];break;case`DeployContract`:{let t=k(e.code);r=[{id:`a${n}-code-size`,label:`WASM contract code size: ${t}`,type:`file`,open:!1}];break}case`DeployGlobalContract`:{let t=e.code,i=e.deployMode,a=k(t);r=[{id:`a${n}-deploy-mode`,label:`mode: ${String(i||``)}`,type:`file`,open:!1},{id:`a${n}-code-size`,label:`WASM global contract code size: ${a}`,type:`file`,open:!1}];break}case`UseGlobalContract`:{let t=e.accountId,i=e.codeHash,a;a=t?`by account: ${String(t)}`:i?`by hash: ${O(String(i),{prefix:10,suffix:6})}`:`by global contract identifier`,r=[{id:`a${n}-identifier`,label:a,type:`file`,open:!1}];break}case`Stake`:r=[{id:`a${n}-publicKey`,label:`validator: ${O(e.publicKey)}`,type:`file`,open:!0,copyValue:e.publicKey}];break;case`AddKey`:{let i=e.accessKey,a=``;try{a=(t(i)?JSON.parse(i):i).permission===`FullAccess`?`Full Access`:`Function Call`}catch{a=`Unknown`}r=[{id:`a${n}-publicKey`,label:`key: ${O(e.publicKey)}`,open:!1,type:`file`,copyValue:e.publicKey},{id:`a${n}-permissions`,label:`permissions: ${a}`,open:!1,type:`file`}];break}case`DeleteKey`:r=[{id:`a${n}-publicKey`,label:`key: ${O(e.publicKey)}`,open:!1,type:`file`,copyValue:e.publicKey}];break;case`DeleteAccount`:r=[{id:`a${n}-beneficiaryId`,label:`sending balance to: ${e.beneficiaryId}`,open:!1,type:`file`}];break;default:return Se(e)}return{id:`action-${n}`,label:``,type:`folder`,open:!1,hideChevron:!0,action:e,actionIndex:n,children:r}}function Se(e){throw Error(`Unsupported NEAR action: ${String(e)}`)}function Ce(e,t,n){let r=e.actions.map((e,t)=>xe(e,t));return{id:`tx-${t}`,label:``,type:`folder`,open:!0,hideChevron:!0,transaction:e,transactionIndex:t,totalTransactions:n,children:[...r]}}function we(e){let t=e.length,n=e.map((e,n)=>Ce(e,n,t));return{id:`txs-root`,label:t>1?`Transactions`:`Transaction`,type:`folder`,open:!0,children:n}}function Te(e){let t=e.abiDecodeHint;if(t&&Array.isArray(t.abi)&&t.abi.length>0){let e=String(t.dataHex||``).trim();if(e&&e!==`0x`)return!0}return(Array.isArray(e.children)?e.children:[]).some(Te)}function Ee(e){return(Array.isArray(e.operations)?e.operations:[]).some(Te)}function A(e){let t=Array.isArray(e.txSigningRequests)?e.txSigningRequests:[];if(t.length>0)return we(o(t));let n=e.model;if(!n)return null;let r=Array.isArray(n.operations)?n.operations:[],i=Array.isArray(n.warnings)?n.warnings:[];return r.length>0||i.length>0?be(n):null}const De=/^NEAR account ([^\s]+) needs funding before signing\.$/;function Oe(e){let t=String(e||``).trim();return t.length<=8?t:`${t.slice(0,4)}...${t.slice(-4)}`}function ke(e){let t=String(e||``).trim();return t?`NEAR account ${t} needs funding before signing.`:`NEAR account needs funding before signing.`}function Ae(e){let t=String(e||``).trim(),n=De.exec(t);if(!n)return null;let r=String(n[1]||``).trim();return r?{accountId:r,shortAccountId:Oe(r)}:null}function je(e){return String(e||``).trim()===`Topping up account...`}function Me(e){let t=Oe(e);return t?`Funding NEAR account ${t}...`:`Funding NEAR account...`}function Ne(e){let t=String(e||``).trim();return t.startsWith(`Funding NEAR account`)&&t.endsWith(`...`)}function Pe(e){return je(e)||Ne(e)}function Fe(e){let t=e.trim();if(!t)return{kind:`empty`};if(Pe(t))return{kind:`status`,text:t};let n=Ae(t);return n?{kind:`funding`,accountId:n.accountId,shortAccountId:n.shortAccountId}:{kind:`text`,text:t}}function Ie(e){let t=e.presentation,n=t.errorMessage??``,r=t.cancelText??`Cancel`,i=t.securityContext?.passkeyRegistration;if(i?.kind===`passkey_registration_confirm_display_v1`)return{ok:!0,model:{appearance:e.appearance,content:{kind:`registration`,registration:{display:i,heading:t.title?.trim()||`Create your passkey`,body:t.body?.trim()||`Use Touch ID or your device passkey to create credentials for this account.`,cancelText:r,errorMessage:n,decision:t.loading?{kind:`creating`}:{kind:`ready`,onConfirm:e.callbacks.confirm},onCancel:e.callbacks.cancel}}}};let a;switch(t.signingAuthMode){case`emailOtp`:{let r=t.emailOtpPrompt,i=r?.challengeId.trim();if(!r||!i)return{ok:!1,error:`missing_email_challenge`};a={kind:`email`,email:{prompt:{challengeId:i,title:r.title,body:r.body,helperText:r.helperText,emailHint:r.emailHint,resendDebounceMs:r.resendDebounceMs,onResend:r.onResend},verification:Le(t.loading===!0,n),onSubmit:e.callbacks.submitEmail}};break}case`warmSession`:a={kind:`session`};break;case`webauthn`:case void 0:a={kind:`passkey`};break;default:return He(t.signingAuthMode)}let o=Fe(t.body??``);return{ok:!0,model:{appearance:e.appearance,content:{kind:`transaction`,capture:t.authMethodCapture??null,review:{model:t.model??null,tree:e.tree},header:{heading:Re(t),website:ze(t.securityContext?.rpId?.trim()??``),chainDetails:Be(t,t.loading===!0||o.kind===`status`),errorMessage:n},body:o,prompt:a,transaction:{tree:e.tree,theme:e.appearance.theme.mode,explorers:{near:t.nearExplorerUrl||`https://testnet.nearblocks.io`,tempo:t.tempoExplorerUrl,evm:t.evmExplorerUrl},decision:t.loading||t.preparing?{kind:`preparing`}:{kind:`ready`,onConfirm:e.callbacks.confirm},confirmText:t.signingAuthMode===`emailOtp`?`Confirm Code`:t.confirmText??`Confirm`,cancelText:r,errorMessage:n,onCancel:e.callbacks.cancel,onBack:t.onBack,authMethodApprovalMessage:t.authMethodApprovalMessage}}}}}function Le(e,t){return e?{kind:`pending`}:t?{kind:`rejected`,message:t}:{kind:`ready`}}function Re(e){let t=(e.model?.operations.length??0)===0?`Register with Passkey`:`Confirm with Passkey`;switch(e.signingAuthMode){case`emailOtp`:return e.emailOtpPrompt?.title?.trim()||`Enter email code to sign`;case`warmSession`:return`Review transaction`;case`webauthn`:return t;case void 0:return e.title?.trim()||t;default:return He(e.signingAuthMode)}}function ze(e){return e?{kind:`ready`,text:e}:{kind:`loading`}}function Be(e,t){let n=e.model;if(n?.chainId)return{kind:`ready`,text:`${Ve(n.chain)} | ChainID: ${n.chainId}`};let r=String(e.securityContext?.blockHeight||``).trim();return r?{kind:`ready`,text:`block ${r}`}:t?{kind:`loading`}:{kind:`ready`,text:`block`}}function Ve(e){switch(e){case`near`:return`NEAR`;case`evm`:return`EVM`;case`tempo`:return`Tempo`;case`unknown`:return`Unknown`;default:return He(e)}}function He(e){throw Error(`Unexpected confirmation presentation: ${String(e)}`)}const j=`seams-surface-resize-begin`;function Ue(e,t){return e.dispatchEvent(new CustomEvent(j,{bubbles:!0,composed:!0,detail:t}))}function We(e,t,n){let r=t;return e.addEventListener(j,r,n),()=>e.removeEventListener(j,r,n)}const Ge=`data-seams-confirm-surface`,M=`seams-confirm-surface-pinned`,N=`seams-confirm-surface-pinned-root`,P=`seams-surface-height-driven`,F=`--seams-surface-height-driven-target`;function Ke(e,t){let{fromCssPx:n,toCssPx:r}=t;if(!Number.isFinite(n)||!Number.isFinite(r))return!1;let i=r-n;if(Math.abs(i)<1)return!1;let a=Math.min(n,r),o=Math.max(n,r),s=null,c=!1,l=null,u=e=>{if(c)return;let r=n+(Number.isFinite(e)?Math.min(Math.max(e,0),1):0)*i;t.setHeightCssPx(Math.min(Math.max(r,a),o))},d=()=>{c||(c=!0,l!==null&&window.clearTimeout(l),t.finish())},f=()=>s||c?null:(t.onClaimed?.(),u(0),l=window.setTimeout(()=>{u(1),d()},1500),s={setProgress:u,finish:d},s);return Ue(e,{...t.reason?{reason:t.reason}:{},deltaCssPx:i,claim:f}),s!==null}function qe(e){let t=null,n=null,r=()=>{let e=n;n=null,e&&e.classList.remove(P)};return{capture(){let n=e.element();t=n?n.getBoundingClientRect().height:null},commit(){let i=t;t=null;let a=e.element();!a||i===null||document.documentElement.classList.contains(N)||a.parentElement?.closest(`.${P}`)||(n=a,a.classList.add(P),e.setHeightCssPx(i),Promise.resolve(e.settled?.()).then(()=>new Promise(e=>requestAnimationFrame(()=>e()))).then(()=>{if(n!==a)return;if(document.documentElement.classList.contains(N)){r();return}a.classList.remove(P);let t=a.getBoundingClientRect().height;a.classList.add(P),!I({...e.reason?{reason:e.reason}:{},element:a,fromCssPx:i,toCssPx:t,setHeightCssPx:t=>e.setHeightCssPx(t),onSettled:()=>{n=null}})&&(r(),Je(a,i,t))}))},dispose:r}}function Je(e,t,n){Math.abs(n-t)<1||window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||e.animate([{height:`${t}px`},{height:`${n}px`}],{duration:200,easing:`cubic-bezier(0.32, 0.72, 0, 1)`})}function I(e){let{element:t,fromCssPx:n,toCssPx:r}=e;if(!Number.isFinite(n)||!Number.isFinite(r)||Math.abs(r-n)<1)return!1;let i=e.drivenClasses??[P],a=i.filter(e=>!t.classList.contains(e));t.classList.add(...a),e.setHeightCssPx(n);let o=Ke(t,{...e.reason?{reason:e.reason}:{},fromCssPx:n,toCssPx:r,setHeightCssPx:e.setHeightCssPx,finish:()=>{t.classList.remove(...i),e.onSettled?.()}});return o||t.classList.remove(...a),o}let Ye=null;const Xe={blipFrames:0,trace(e=2e3){return new Promise(t=>{let n=[],r=performance.now(),i=()=>{let a=Ye,o=a?.classList.contains(M)?`*`:``;n.push(`${Math.round(performance.now()-r)}: box=${document.documentElement.clientHeight} content=${a?Math.round(a.getBoundingClientRect().height):`-`}${o}`),performance.now()-r<e?requestAnimationFrame(i):t(n)};requestAnimationFrame(i)})}};function Ze(e){Ye=e;try{window.__seamsSurfaceMotion=Xe}catch{}}function Qe(){let e=document.documentElement?.clientHeight??0;return e>0?e:window.innerHeight}function $e(e,t,n){return Math.min(Math.max(e,t),n)}function et(e){return e.getAttribute(Ge)===`wallet-iframe`}function tt(e){if(typeof CSSStyleSheet!=`function`||!(`adoptedStyleSheets`in document))return null;let t=null,n=()=>{e.classList.remove(M),document.documentElement.classList.remove(N)};return{set(n){try{t||=new CSSStyleSheet,t.replaceSync(`.${M}{height:${Math.max(0,Math.round(n))}px}.${N}{overflow:hidden}`),document.adoptedStyleSheets.includes(t)||(document.adoptedStyleSheets=[...document.adoptedStyleSheets,t])}catch{return!1}return e.classList.add(M),document.documentElement.classList.add(N),!0},release:n,dispose(){if(n(),!t)return;let e=t;t=null;try{document.adoptedStyleSheets=document.adoptedStyleSheets.filter(t=>t!==e)}catch{}}}}function nt(e,t={}){let n=t.viewportHeightCssPx??Qe,r=tt(e);Ze(e);let i=null,a=()=>{let e=i;e&&(i=null,e.frame!==null&&cancelAnimationFrame(e.frame),e.driver.setProgress(1),e.driver.finish(),r?.release())},o=()=>{let e=i;if(!e)return;e.frame=null;let t=n();t===e.lastViewportPx?e.framesSinceChange+=1:(e.lastViewportPx=t,e.framesSinceChange=0,e.moved=!0);let r=$e((t-e.originHostPx)/e.deltaCssPx,0,1);if(t===Math.round(e.originHostPx+e.deltaCssPx)){if(e.framesAtTarget+=1,e.sawIntermediate||e.framesAtTarget>=3){a();return}e.frame=requestAnimationFrame(o);return}e.framesAtTarget>0&&(Xe.blipFrames+=1),e.framesAtTarget=0,r>0&&r<1&&(e.sawIntermediate=!0),e.driver.setProgress(r);let s=e.moved?8:20;if(e.framesSinceChange>=s){a();return}e.frame=requestAnimationFrame(o)},s=We(e,t=>{let s=t.detail;if(!r||!s||!et(e))return;let c=s.deltaCssPx;if(!Number.isFinite(c)||Math.abs(c)<1)return;a();let l=n(),u=e.getBoundingClientRect().height;if(!(l>0)||!(u>0)||Math.abs(l-u)>1)return;let d=Math.round(u),f=d+c;if(!(f>0)||!r.set(f))return;let p=s.claim();if(!p){r.release();return}i={driver:p,originHostPx:d,deltaCssPx:c,lastViewportPx:l,framesSinceChange:0,moved:!1,sawIntermediate:!1,framesAtTarget:0,frame:null},i.frame=requestAnimationFrame(o)});return{dispose(){s(),a(),r?.dispose()}}}function L(e){let t=e.size??`100%`,n=e.strokeWidth??2;return f(`svg`,{class:`padlock-icon seams-padlock-icon`,xmlns:`http://www.w3.org/2000/svg`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":n,"stroke-linecap":`round`,"stroke-linejoin":`round`,width:t,height:t,"aria-hidden":`true`,focusable:`false`,children:[f(`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`}),f(`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`})]})}let rt=0;var it=class extends u{id=`seams-halo-${++rt}`;element=l();motion=null;frame=null;startedAt=null;angle=null;componentDidMount(){this.motion=this.element.current.ownerDocument.defaultView.matchMedia(`(prefers-reduced-motion: no-preference)`),this.motion.addEventListener(`change`,this.updateAnimation),this.syncDynamicStyles(),this.updateAnimation()}componentDidUpdate(e){e.styles!==this.props.styles&&e.styles.deleteDynamicRule(this.id),e.innerPadding!==this.props.innerPadding&&this.syncDynamicStyles(),(e.animated!==this.props.animated||e.durationMs!==this.props.durationMs||e.styles!==this.props.styles)&&this.updateAnimation()}componentWillUnmount(){this.cancelFrame(),this.motion?.removeEventListener(`change`,this.updateAnimation),this.motion=null,this.props.styles.deleteDynamicRule(this.id)}cancelFrame(){let e=this.element.current?.ownerDocument.defaultView;this.frame!==null&&e?.cancelAnimationFrame(this.frame),this.frame=null,this.startedAt=null}updateAnimation=()=>{this.cancelFrame(),this.angle=null,this.syncDynamicStyles(),this.props.animated&&this.motion?.matches&&(this.frame=this.element.current.ownerDocument.defaultView.requestAnimationFrame(this.tick))};tick=e=>{if(!this.element.current||!this.props.animated||!this.motion?.matches)return;this.startedAt??=e;let t=this.props.durationMs,n=t&&Number.isFinite(t)&&t>0?t:1150;this.angle=`${(e-this.startedAt)%n/n*360}deg`,this.syncDynamicStyles(),this.frame=this.element.current.ownerDocument.defaultView.requestAnimationFrame(this.tick)};syncDynamicStyles(){let e={};if(this.props.innerPadding&&(e[`--inner-padding`]=this.props.innerPadding),this.angle&&(e[`--halo-angle`]=this.angle),Object.keys(e).length===0){this.props.styles.deleteDynamicRule(this.id);return}this.props.styles.setDynamicDeclarations(this.id,`#${this.id}`,e)}render(){return f(`div`,{id:this.id,ref:this.element,class:`seams-halo-border`,children:f(`div`,{class:`halo-root${this.props.animated?` animated`:``}`,children:f(`div`,{class:`halo-inner`,children:f(`div`,{class:`halo-outer`,children:[this.props.animated&&f(`div`,{class:`halo-ring`,"aria-hidden":`true`}),f(`div`,{class:`halo-content`,children:this.props.children})]})})})})}};function at(e){return f(`div`,{class:`seams-passkey-halo-loading`,"aria-hidden":`true`,children:f(`div`,{class:`seams-passkey-loading-root`,children:f(it,{animated:e.animated,innerPadding:e.innerPadding,styles:e.styles,children:f(`div`,{class:`seams-passkey-loading-touch-icon-container`,children:f(`svg`,{class:`seams-passkey-loading-touch-icon`,"data-icon":e.icon,width:e.size??36,height:e.size??36,viewBox:`0 0 24 24`,fill:`none`,xmlns:`http://www.w3.org/2000/svg`,focusable:`false`,children:e.icon===`mail`?f(ot,{}):f(st,{})})})})})})}function ot(){return f(p,{children:[f(`path`,{d:`M4.5 6.5H19.5C20.0523 6.5 20.5 6.94772 20.5 7.5V16.5C20.5 17.0523 20.0523 17.5 19.5 17.5H4.5C3.94772 17.5 3.5 17.0523 3.5 16.5V7.5C3.5 6.94772 3.94772 6.5 4.5 6.5Z`,stroke:`currentColor`,"stroke-width":`var(--seams-modal__passkey-halo-loading-touch-icon__stroke-width, 3)`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"vector-effect":`non-scaling-stroke`}),f(`path`,{d:`M4.25 7.25L12 12.75L19.75 7.25`,stroke:`currentColor`,"stroke-width":`var(--seams-modal__passkey-halo-loading-touch-icon__stroke-width, 3)`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"vector-effect":`non-scaling-stroke`})]})}function st(){return f(`path`,{d:`M6.40519 19.0481C6.58912 18.6051 6.75832 18.1545 6.91219 17.6969M14.3433 20.6926C14.6095 19.9418 14.8456 19.1768 15.0502 18.399C15.2359 17.6934 15.3956 16.9772 15.5283 16.2516M19.4477 17.0583C19.8121 15.0944 20.0026 13.0694 20.0026 11C20.0026 6.58172 16.4209 3 12.0026 3C10.7472 3 9.55932 3.28918 8.50195 3.80456M3.52344 15.0245C3.83663 13.7343 4.00262 12.3865 4.00262 11C4.00262 9.25969 4.55832 7.64917 5.50195 6.33621M12.003 11C12.003 13.7604 11.5557 16.4163 10.7295 18.8992C10.5169 19.5381 10.2792 20.1655 10.0176 20.7803M7.71227 14.5C7.90323 13.3618 8.00262 12.1925 8.00262 11C8.00262 8.79086 9.79348 7 12.0026 7C14.2118 7 16.0026 8.79086 16.0026 11C16.0026 11.6166 15.9834 12.2287 15.9455 12.8357`,stroke:`currentColor`,"stroke-width":`var(--seams-modal__passkey-halo-loading-touch-icon__stroke-width, 3)`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"vector-effect":`non-scaling-stroke`,pathLength:`1`})}function ct(e){return f(p,{children:[f(`span`,{class:`loading-ellipsis`,"aria-hidden":`true`,children:[f(`span`,{class:`loading-ellipsis__dot`,children:`.`}),f(`span`,{class:`loading-ellipsis__dot`,children:`.`}),f(`span`,{class:`loading-ellipsis__dot`,children:`.`})]}),f(`span`,{class:`sr-only`,children:f(x,{copy:e.label})})]})}function lt(e,t){return`${e.trim().replace(/\/$/,``)}/address/${encodeURIComponent(t)}`}function R(e){return f(`a`,{class:`highlight-receiver-id`,href:lt(e.base,e.address),target:`_blank`,rel:`noopener noreferrer`,children:e.children})}function z(e){let t=e.trim();return/^0x[0-9a-fA-F]{40}$/.test(t)?`${t.slice(0,8)}...${t.slice(-4)}`:t}function B(e){let t=e.label.trim().match(/^(Transaction(?:\s+\d+)?\s+to contract)\b/i);return t?`${t[1]} `:void 0}function ut(e){throw Error(`Unsupported transaction action: ${String(e)}`)}function V(e){let t=e.action;if(t)switch(t.type){case s.FunctionCall:return`Calling ${t.methodName} with ${D(t.deposit)} using ${ue(t.gas)}`;case s.Transfer:return`Transfer ${D(t.amount)}`;case s.CreateAccount:return`Creating Account`;case s.DeleteAccount:return`Deleting Account`;case s.Stake:return`Staking ${D(t.stake)}`;case s.AddKey:return`Adding Key`;case s.DeleteKey:return`Deleting Key`;case s.DeployContract:return`Deploying WASM contract`;case s.DeployGlobalContract:return`Deploy global WASM contract (mode: ${t.deployMode}, size ${k(t.code)})`;case s.UseGlobalContract:return t.accountId?`Use global contract by account ${t.accountId}`:t.codeHash?`Use global contract by hash ${t.codeHash}`:`Use global contract`;default:return ut(t)}if(e.transaction)return((e.totalTransactions??1)>1?`Transaction ${(e.transactionIndex??0)+1}: to `:`Transaction to `)+e.transaction.receiverId;let n=B(e);return e.contractAddress?.trim()&&n?n+z(e.contractAddress):e.label}function dt({node:e,explorers:t}){let n=e.action;if(n)switch(n.type){case s.FunctionCall:{let e=ue(n.gas),t=D(n.deposit);return f(p,{children:[f(x,{message:`Calling`}),` `,f(`span`,{class:`highlight-method-name`,children:n.methodName}),t!==`0 NEAR`&&f(p,{children:[` `,f(x,{message:`with`}),` `,f(`span`,{class:`highlight-method-name`,children:t})]}),e&&f(p,{children:[` `,f(x,{message:`using`}),` `,f(`span`,{class:`highlight-method-name`,children:e})]})]})}case s.Transfer:return f(p,{children:[f(x,{message:`Transfer`}),` `,f(`span`,{class:`highlight-amount`,children:D(n.amount)})]});case s.CreateAccount:return f(x,{message:`Creating Account`});case s.DeleteAccount:return f(x,{message:`Deleting Account`});case s.Stake:return f(x,{message:`Staking {value0}`,values:{value0:D(n.stake)}});case s.AddKey:return f(x,{message:`Adding Key`});case s.DeleteKey:return f(x,{message:`Deleting Key`});case s.DeployContract:return f(x,{message:`Deploying WASM contract ({value0})`,values:{value0:k(n.code)}});case s.DeployGlobalContract:return f(x,{copy:V(e)});case s.UseGlobalContract:return n.accountId?f(p,{children:[f(x,{message:`Use global contract`}),` `,f(R,{base:t.near,address:n.accountId,children:n.accountId})]}):n.codeHash?f(p,{children:[f(x,{message:`Use global contract by hash`}),` `,f(`span`,{class:`highlight-method-name`,children:O(n.codeHash,{prefix:10,suffix:6})})]}):f(x,{message:`Use global contract`});default:return ut(n)}if(e.transaction)return f(p,{children:[f(x,{copy:(e.totalTransactions??1)>1?`Transaction ${(e.transactionIndex??0)+1}: to `:`Transaction to `}),f(R,{base:t.near,address:e.transaction.receiverId,children:e.transaction.receiverId})]});let r=B(e),i=e.contractAddress?.trim();if(i&&r){let n=e.chain&&e.chain!==`unknown`?t[e.chain]:void 0;return f(p,{children:[f(x,{copy:r}),n?f(R,{base:n,address:i,children:z(i)}):f(`span`,{class:`highlight-receiver-id`,children:z(i)})]})}let a=e.label.trim();if(a.toLowerCase().startsWith(`calling `)){let e=a.slice(8).trim(),t=e.toLowerCase().indexOf(` using `);if(t<0&&e)return f(p,{children:[f(x,{message:`Calling`}),` `,f(`span`,{class:`highlight-method-name`,children:e})]});let n=e.slice(0,t).trim(),r=e.slice(t+7).trim();if(t>=0&&n)return f(p,{children:[f(x,{message:`Calling`}),` `,f(`span`,{class:`highlight-method-name`,children:n}),r&&f(p,{children:[f(x,{message:`using`}),` `,r]})]})}return e.fieldLabel?f(p,{children:[f(x,{copy:e.fieldLabel}),e.label.slice(e.fieldLabel.length)]}):f(x,{copy:e.label})}const H=[`anim-h`,`anim-h-active`,`anim-h-driven`],ft=[...H,`anim-h-hold`];let pt=0;function mt(){return f(`svg`,{class:`chevron`,viewBox:`0 0 16 16`,"aria-hidden":`true`,children:f(`path`,{fill:`currentColor`,d:`M6 3l5 5-5 5z`})})}function ht(e){return!!e.contentVariants?.decoded&&!!e.contentVariants.raw&&e.contentVariants.decoded!==e.contentVariants.raw}function gt(e,t,n){return f(vt,{node:n,depth:t,styles:e.styles,explorers:e.explorers,onToggle:e.onToggle,onCopy:e.onCopy},n.id)}function _t(e){if(!e.node.children?.length)return null;let t=f(`div`,{class:`tooltip-tree-root`,children:f(`div`,{class:`tooltip-tree-children`,children:e.node.children.map(gt.bind(null,e,1))})});return f(`div`,{class:`seams-tx-tree`,"data-theme":e.theme,children:e.showShadow?f(`div`,{class:`tooltip-border-outer`,children:t}):t})}var vt=class extends u{static contextType=w;state={mode:this.props.node.contentVariants?.defaultMode===`raw`?`raw`:`decoded`,copied:!1};id=`seams-tree-node-${++pt}`;details=l();shell=l();disposed=!1;copiedTimer=null;frame=null;motionTimer=null;motion=null;modeHeight=null;componentDidUpdate(e){if(e.styles!==this.props.styles&&e.styles.deleteDynamicRule(this.id),this.modeHeight!==null&&this.shell.current){let e=this.shell.current,t=this.modeHeight;this.modeHeight=null,e.classList.remove(...H);let n=e.getBoundingClientRect().height;e.classList.add(...H),I({reason:`${this.props.node.id}:file-content-mode`,element:e,drivenClasses:H,fromCssPx:t,toCssPx:n,setHeightCssPx:this.setHeight,onSettled:this.releaseHeight})||(e.classList.remove(...H),this.releaseHeight())}}componentWillUnmount(){this.disposed=!0,this.copiedTimer!==null&&clearTimeout(this.copiedTimer),this.motionTimer!==null&&clearTimeout(this.motionTimer),this.frame!==null&&this.details.current?.ownerDocument.defaultView?.cancelAnimationFrame(this.frame),this.motion?.body.removeEventListener(`transitionend`,this.onTransitionEnd),this.motion=null,this.releaseHeight()}setHeight=e=>{this.disposed||this.props.styles.setDynamicDeclarations(this.id,`#${this.id}`,{"--seams-tree__anim-target":`${e}px`})};releaseHeight=()=>{this.props.styles.deleteDynamicRule(this.id)};clearCopied=()=>{this.copiedTimer=null,this.disposed||this.setState({copied:!1})};copy=async e=>{e.preventDefault(),e.stopPropagation();let t=this.props.node.copyValue;if(!t)return;let n=e.currentTarget.closest(`.seams-tx-tree`);if(n)try{if(!await E(n,t)||this.disposed)return;this.copiedTimer!==null&&clearTimeout(this.copiedTimer),this.setState({copied:!0}),this.copiedTimer=setTimeout(this.clearCopied,2e3),this.props.onCopy?.(t)}catch{}};toggleMode=e=>{e.preventDefault(),e.stopPropagation(),ht(this.props.node)&&(this.shell.current&&(this.modeHeight=this.shell.current.getBoundingClientRect().height,this.setHeight(this.modeHeight),this.shell.current.classList.add(...H)),this.setState({mode:this.state.mode===`decoded`?`raw`:`decoded`}))};toggle=e=>{if(e.target.closest(`a, button`)){e.stopPropagation();return}e.preventDefault(),e.stopPropagation();let t=this.details.current;if(!t||this.motion)return;let n=t.querySelector(`:scope > .folder-children`),r=!t.open,i=t.ownerDocument.defaultView.matchMedia(`(prefers-reduced-motion: reduce)`).matches;if(!n||i){t.open=r,this.props.onToggle?.(this.props.node.id,r);return}this.motion={body:n,open:r};let a=r?0:n.getBoundingClientRect().height;this.setHeight(a),n.classList.add(`anim-h`,`anim-h-active`,`anim-h-hold`),t.open=!0,n.offsetHeight,this.frame=t.ownerDocument.defaultView.requestAnimationFrame(this.startMotion)};startMotion=()=>{if(this.frame=null,!this.motion||this.disposed)return;let{body:e,open:t}=this.motion,n=e.getBoundingClientRect().height,r=t?e.scrollHeight:0;I({reason:this.props.node.id,element:e,drivenClasses:H,fromCssPx:n,toCssPx:r,setHeightCssPx:this.setHeight,onSettled:this.finishMotion})||(e.addEventListener(`transitionend`,this.onTransitionEnd),e.classList.remove(`anim-h-hold`),this.setHeight(r),this.motionTimer=setTimeout(this.finishMotion,t?200:250))};onTransitionEnd=e=>{e.target===this.motion?.body&&e.propertyName===`height`&&this.finishMotion()};finishMotion=()=>{if(this.disposed||!this.motion)return;let{body:e,open:t}=this.motion;this.motion=null,this.motionTimer!==null&&clearTimeout(this.motionTimer),this.motionTimer=null,e.removeEventListener(`transitionend`,this.onTransitionEnd),e.classList.remove(...ft),this.details.current&&(this.details.current.open=t),this.releaseHeight(),this.props.onToggle?.(this.props.node.id,t)};label(e){let t=this.props.node;return f(`span`,{class:`label${t.type===`file`?` label-action-node`:``}`,hidden:t.hideLabel,children:[e&&!t.hideChevron&&f(mt,{}),f(`span`,{class:`label-text`,title:T(this.context,V(t)),children:f(dt,{node:t,explorers:this.props.explorers})}),t.type===`file`&&t.copyValue&&f(`button`,{type:`button`,class:`copy-badge`,"data-copied":String(this.state.copied),onClick:this.copy,title:T(this.context,this.state.copied?`Copied`:`Copy`),children:this.state.copied?`copied`:`copy`})]})}render(){let{node:e,depth:t}=this.props,n=`row summary-row depth-${Math.max(0,t-1)}`;if(e.type===`file`&&!e.content)return f(`div`,{id:this.id,class:`row file-row depth-${Math.max(0,t-1)}`,"data-no-elbow":String(!!e.hideLabel),children:[f(`span`,{class:`indent`}),this.label(!1)]});let r=ht(e),i=r&&e.contentVariants?e.contentVariants[this.state.mode]:e.content,a=this.state.mode===`decoded`?`bytes`:`decoded`;return f(`details`,{id:this.id,ref:this.details,class:`tree-node ${e.type}`,open:!!e.open,"data-node-id":e.id,children:[f(`summary`,{class:n,"data-no-elbow":String(!!e.hideLabel),onClick:this.toggle,children:[f(`span`,{class:`indent`}),this.label(!0),e.type===`file`&&f(`div`,{ref:this.shell,class:`file-content-shell${r?` has-mode-toggle`:``}`,children:[r&&f(`button`,{type:`button`,class:`file-content-mode-toggle`,title:T(this.context,`Show ${a}`),"aria-label":T(this.context,`Show ${a}`),onClick:this.toggleMode,children:f(x,{copy:a})}),f(`div`,{class:`file-content`,children:i})]})]}),e.type===`folder`&&!!e.children?.length&&f(`div`,{class:`folder-children`,children:e.children.map(gt.bind(null,this.props,t+1))})]})}};let yt=0;function U(e){e.stopPropagation()}var bt=class extends u{static contextType=w;state={armed:!1};id=`seams-confirm-content-${++yt}`;root=l();reflow;frame=null;capturedBeforeUpdate=!1;reflowEnabled=!0;constructor(e){super(e),this.reflow=qe({reason:`tx-body`,element:this.getReflowElement,setHeightCssPx:this.setHeight})}getReflowElement=()=>{let e=this.root.current;return e?.closest(`.modal-container-root, .seams-confirmation-drawer`)??e};setHeight=e=>{let t=this.getReflowElement(),n=t?.id?`#${t.id}`:`#${this.id}`;this.props.styles.setDynamicDeclarations(this.id,n,{[F]:`${e}px`})};componentDidMount(){this.reflowEnabled=this.getReflowElement()===this.root.current,this.frame=this.root.current.ownerDocument.defaultView.requestAnimationFrame(this.afterFirstPaint)}afterFirstPaint=()=>{this.frame=this.root.current.ownerDocument.defaultView.requestAnimationFrame(this.arm)};arm=()=>{this.frame=null,this.setState({armed:!0})};componentWillReceiveProps(){this.reflowEnabled&&(this.reflow.capture(),this.capturedBeforeUpdate=!0)}componentWillUpdate(){this.reflowEnabled&&(this.capturedBeforeUpdate||this.reflow.capture())}componentDidUpdate(e){this.reflowEnabled&&(this.capturedBeforeUpdate=!1,e.styles!==this.props.styles&&e.styles.deleteDynamicRule(this.id),this.reflow.commit())}componentWillUnmount(){this.frame!==null&&this.root.current?.ownerDocument.defaultView?.cancelAnimationFrame(this.frame),this.frame=null,this.reflow.dispose(),this.props.styles.deleteDynamicRule(this.id)}confirm=()=>{this.state.armed&&this.props.decision.kind===`ready`&&this.props.decision.onConfirm()};cancel=()=>{this.props.onCancel()};render(){let e=this.props.decision.kind===`preparing`;return f(`div`,{class:`seams-tx-confirm-content`,onPointerDown:U,onMouseDown:U,onTouchStart:U,children:f(`div`,{id:this.id,ref:this.root,class:`txc-root`,children:[this.props.errorMessage&&f(`div`,{class:`error`,role:`alert`,children:f(x,{copy:this.props.errorMessage})}),this.props.tree&&f(`div`,{class:`tooltip-width`,children:f(_t,{node:this.props.tree,theme:this.props.theme,explorers:this.props.explorers,styles:this.props.styles,showShadow:!1,onToggle:this.props.onTreeToggle,onCopy:this.props.onCopy})}),this.props.authMethodApprovalMessage&&f(`p`,{class:`seams-voiceid-instructions`,"data-seams-voice-id":`required`,role:`status`,children:this.props.authMethodApprovalMessage}),f(`div`,{class:`actions`,children:[!this.props.cancelInHeader&&f(`button`,{type:`button`,class:`cancel`,onClick:this.cancel,children:f(x,{copy:this.props.cancelText})}),f(`button`,{type:this.props.decision.kind===`form`?`submit`:`button`,form:this.props.decision.kind===`form`?this.props.decision.formId:void 0,class:`confirm${e?` loading`:``}`,onClick:this.confirm,disabled:e||!this.state.armed,children:e?f(p,{children:[f(`span`,{class:`loading-indicator`,role:`progressbar`,"aria-label":b(this.context,`Loading`)}),f(`span`,{children:f(x,{message:`Loading...`})})]}):f(p,{children:[this.props.confirmIcon,f(x,{copy:this.props.confirmText})]})})]})]})})}};function xt(e){throw Error(`Unexpected confirmation body: ${String(e)}`)}var St=class extends u{static contextType=w;copy=()=>{this.props.model.kind===`funding`&&this.props.onCopyAccount(this.props.model.accountId)};render(){let e=this.props.model;switch(e.kind){case`empty`:return null;case`text`:return f(`div`,{class:`confirmation-body`,children:f(x,{copy:e.text})});case`status`:return f(`div`,{class:`confirmation-body confirmation-body--status`,children:f(x,{copy:e.text})});case`funding`:return f(`div`,{class:`confirmation-body confirmation-body--funding`,children:[f(x,{message:`NEAR account`}),f(`button`,{type:`button`,class:`confirmation-body__copy-target`,title:T(this.context,`Copy ${e.accountId}`),"aria-label":T(this.context,`Copy NEAR account ${e.accountId}`),onClick:this.copy,children:e.shortAccountId}),f(x,{message:`needs funding`})]});default:return xt(e)}}};function Ct(e){let t=y();return f(`div`,{class:`passkey-registration-confirm__identity`,"aria-label":b(t,`Passkey registration details`),children:[f(`div`,{class:`passkey-registration-confirm__row`,children:[f(`span`,{class:`passkey-registration-confirm__label`,children:f(x,{message:`Account`})}),f(`span`,{class:`passkey-registration-confirm__value`,title:T(t,e.display.intendedUserName),children:e.display.intendedUserName})]}),f(`div`,{class:`passkey-registration-confirm__row`,children:[f(`span`,{class:`passkey-registration-confirm__label`,children:f(x,{message:`Website`})}),f(`span`,{class:`passkey-registration-confirm__value`,title:T(t,e.display.rpId),children:e.display.rpId})]})]})}var wt=class extends u{static contextType=w;confirm=()=>{this.props.decision.kind===`ready`&&this.props.decision.onConfirm()};cancel=()=>{this.props.onCancel()};render(){let e=this.props.decision.kind===`creating`;return f(`div`,{ref:this.props.root,class:`passkey-registration-confirm`,children:[f(`div`,{class:`hero passkey-registration-confirm__hero`,children:[f(at,{animated:!this.props.errorMessage,icon:`fingerprint`,size:44,styles:this.props.styles}),f(`div`,{class:`hero-container passkey-registration-confirm__hero-copy`,children:[f(`h2`,{class:`hero-heading`,children:f(x,{copy:this.props.heading})}),f(`p`,{class:`passkey-registration-confirm__body`,children:f(x,{copy:this.props.body})})]})]}),this.props.errorMessage&&f(`div`,{class:`error-banner`,children:f(x,{copy:this.props.errorMessage})}),f(Ct,{display:this.props.display}),f(`div`,{class:`passkey-registration-confirm__actions`,children:[f(`button`,{type:`button`,class:`btn btn-cancel`,onClick:this.cancel,children:f(x,{copy:this.props.cancelText})}),f(`button`,{type:`button`,class:`btn btn-confirm`,disabled:e,onClick:this.confirm,children:e?f(p,{children:[f(`span`,{class:`loading-indicator passkey-registration-confirm__spinner`,role:`progressbar`,"aria-label":b(this.context,`Creating passkey`)}),f(`span`,{class:`passkey-registration-confirm__busy-label`,children:f(x,{message:`Creating passkey...`})})]}):f(x,{message:`Create passkey`})})]})]})}};let Tt=0;var Et=class extends u{id=`seams-email-code-${++Tt}`;input=e=>{this.props.state.kind===`editing`&&this.props.state.onInput(e.currentTarget.value)};resend=()=>{this.props.resend?.kind===`available`&&this.props.resend.onResend()};renderDigit=e=>{let t=this.props.code[e]||``;return f(`span`,{class:`email-otp-confirm__slot${t?` is-filled`:``}`,children:t},e)};render(){let e=this.props.state.kind!==`editing`,t=`${this.id}-helper`,n=`${this.id}-error`;return f(`div`,{class:`email-otp-confirm`,children:[f(`label`,{class:`email-otp-confirm__label`,for:this.id,children:f(x,{message:`Email code`})}),f(`div`,{class:`email-otp-confirm__code-field`,"data-disabled":e?`true`:`false`,children:[f(`input`,{id:this.id,name:`email-code`,type:`text`,class:`email-otp-confirm__input`,inputMode:`numeric`,autoComplete:`one-time-code`,"data-email-otp-challenge-id":this.props.challengeId,pattern:`[0-9]*`,maxLength:6,spellcheck:!1,value:this.props.code,disabled:e,onInput:this.input,"aria-invalid":this.props.errorMessage?`true`:void 0,"aria-describedby":this.props.errorMessage?`${t} ${n}`:t}),f(`div`,{class:`email-otp-confirm__slots${e?` is-submitting`:``}`,"aria-hidden":`true`,children:[0,1,2,3,4,5].map(this.renderDigit)})]}),f(`div`,{id:t,class:`email-otp-confirm__helper`,children:f(x,{copy:this.props.helperText})}),this.props.errorMessage&&f(`div`,{id:n,class:`email-otp-confirm__error`,children:f(x,{copy:this.props.errorMessage})}),this.props.resend&&f(`button`,{type:`button`,class:`email-otp-confirm__resend`,disabled:this.props.resend.kind===`unavailable`,onClick:this.resend,children:f(x,{copy:this.props.resend.label})})]})}},Dt=class{codeState={kind:`editing`,code:``};resendState={kind:`available`,label:`Resend code`};error=``;countdown=null;options;constructor(e){this.options=e}input=e=>{if(this.codeState.kind!==`editing`)return;let t=e.replace(/\D/g,``).slice(0,6);this.error=``,this.codeState={kind:`editing`,code:t},t.length===6?this.confirm():this.publish()};confirm(){if(this.codeState.kind!==`editing`)return`ignored`;let e=this.codeState.code;return e.length===6?(this.error=``,this.codeState={kind:`fading`,code:e,timer:setTimeout(this.submit,150)},this.publish(),`accepted`):(this.error=`Enter the 6-digit Email OTP code.`,this.publish(),`invalid`)}submit=()=>{if(this.codeState.kind!==`fading`)return;let e=this.codeState.code;this.codeState={kind:`submitting`,code:e},this.publish(),this.isDisposed()||this.options.onSubmit(e)};retry(e){this.codeState.kind!==`disposed`&&(this.cancelFade(),this.codeState={kind:`editing`,code:this.codeState.code},this.error=e,this.publish())}setVerification(e){if(this.codeState.kind!==`disposed`)switch(e.kind){case`ready`:this.codeState.kind===`submitting`&&this.retry(``);return;case`pending`:this.cancelFade(),this.codeState={kind:`submitting`,code:this.codeState.code},this.publish();return;case`rejected`:this.retry(e.message);return}}resend=async()=>{if(this.codeState.kind!==`editing`||this.resendState.kind!==`available`)return;let e=this.options.resend;if(!e)return;let t=Date.now()+e.cooldownMs,n={kind:`sending`,until:t};if(this.resendState=n,this.error=``,this.publish(),this.isDisposed())return;let r;try{r=await e.send()}catch{r={kind:`failed`,message:`Could not send code.`}}if(this.isDisposed()||this.resendState!==n)return;let i=r.kind===`sent`?`Code sent`:`Resend code`;r.kind===`failed`&&(this.error=r.message),Date.now()>=t?this.resendState={kind:`available`,label:i}:(this.resendState={kind:`cooldown`,until:t,label:i},this.countdown=setInterval(this.tick,250)),this.publish()};tick=()=>{this.resendState.kind===`cooldown`&&(Date.now()>=this.resendState.until&&(this.resendState={kind:`available`,label:this.resendState.label},this.clearCountdown()),this.publish())};isDisposed(){return this.codeState.kind===`disposed`}publish(){this.codeState.kind!==`disposed`&&this.options.onChange({code:this.codeState.code,phase:this.codeState.kind,error:this.error,resend:this.options.resend?this.resendSnapshot():null})}resendSnapshot(){switch(this.resendState.kind){case`available`:return{available:this.codeState.kind===`editing`,label:this.resendState.label};case`sending`:return{available:!1,label:`Sending...`};case`cooldown`:return{available:!1,label:`Resend in ${Math.max(1,Math.ceil((this.resendState.until-Date.now())/1e3))}s`}}}cancelFade(){this.codeState.kind===`fading`&&clearTimeout(this.codeState.timer)}clearCountdown(){this.countdown!==null&&clearInterval(this.countdown),this.countdown=null}dispose(){this.cancelFade(),this.clearCountdown(),this.codeState={kind:`disposed`},this.error=``}};function Ot(e){return f(kt,{...e},e.prompt.challengeId)}var kt=class extends u{static contextType=w;session;form=l();lifetime;constructor(e){super(e),this.lifetime={kind:`active`,challengeId:e.prompt.challengeId,emailHint:e.prompt.emailHint?.trim()||``},this.state={code:``,phase:`editing`,error:``,resend:e.prompt.onResend?{available:!0,label:`Resend code`}:null},this.session=new Dt({onSubmit:this.submit,onChange:this.change,resend:e.prompt.onResend?{send:this.send,cooldownMs:Math.max(1e3,Math.floor(Number(e.prompt.resendDebounceMs)||1e4))}:null})}submit=e=>{this.lifetime.kind===`active`&&this.props.onSubmit(e,this.lifetime.challengeId)};send=async()=>{let e=this.props.prompt.onResend;if(!e)return{kind:`failed`,message:`Could not send code.`};try{let t=await e();if(this.lifetime.kind===`disposed`)return{kind:`sent`};let n=String(t?.challengeId||``).trim(),r=String(t?.emailHint||``).trim();return n&&(this.lifetime={kind:`active`,challengeId:n,emailHint:r||this.lifetime.emailHint}),{kind:`sent`}}catch(e){return{kind:`failed`,message:jt(e)}}};change=e=>{this.setState(e)};confirm=e=>{e.preventDefault(),e.stopPropagation(),this.session.confirm()===`invalid`&&this.setState({},this.focusCode)};focusCode=()=>{this.form.current?.querySelector(`input`)?.focus({preventScroll:!0})};componentDidMount(){this.session.setVerification(this.props.verification)}componentDidUpdate(e){At(e.verification,this.props.verification)&&this.session.setVerification(this.props.verification)}componentWillUnmount(){this.lifetime={kind:`disposed`},this.session.dispose()}inputState(){switch(this.state.phase){case`editing`:return{kind:`editing`,onInput:this.session.input};case`fading`:return{kind:`fading`};case`submitting`:return{kind:`submitting`}}}resendAction(){let e=this.state.resend;return e?e.available?{kind:`available`,label:e.label,onResend:this.session.resend}:{kind:`unavailable`,label:e.label}:null}render(){return f(`form`,{ref:this.form,id:this.props.formId,onSubmit:this.confirm,noValidate:!0,children:f(Et,{challengeId:this.lifetime.kind===`active`?this.lifetime.challengeId:``,code:this.state.code,helperText:this.props.prompt.helperText?.trim()||_(this.lifetime.kind===`active`?this.lifetime.emailHint:``),errorMessage:T(this.context,this.state.error||void 0),state:this.inputState(),resend:this.resendAction()})})}};function At(e,t){return e.kind===t.kind?e.kind===`rejected`&&t.kind===`rejected`&&e.message!==t.message:!0}function jt(e){if(e&&typeof e==`object`&&`code`in e&&e.code===`rate_limited`){let t=`retryAfterMs`in e?Number(e.retryAfterMs):NaN;return Number.isFinite(t)&&t>0?`Too many requests. Try again in ${Math.max(1,Math.ceil(t/1e3))}s.`:`Too many requests. Try again shortly.`}return e instanceof Error&&e.message?e.message:`Could not send code.`}let Mt=0;var W=class extends u{root=l();id=`seams-review-disclosure-${++Mt}`;componentDidMount(){this.root.current&&(this.root.current.open=this.props.initiallyOpen??!1)}motion=null;componentWillUnmount(){this.clearMotion(),this.root.current&&S(this.root.current.ownerDocument).deleteDynamicRule(this.id)}clearMotion(){this.motion&&(this.motion.kind===`local`&&(this.motion.size.onfinish=null,this.motion.size.cancel(),this.motion.fade.cancel()),this.motion=null,this.root.current?.removeAttribute(`data-resizing`))}setHeight=e=>{let t=this.root.current;t&&S(t.ownerDocument).setDynamicDeclarations(this.id,`#${this.id}`,{"--seams-review-disclosure-height":`${e}px`})};finish=()=>{let e=this.motion?.kind===`local`;if(this.root.current&&this.motion&&(this.root.current.open=this.motion.opening,this.root.current.removeAttribute(`data-closing`)),this.clearMotion(),e){let e=this.root.current?.closest(`.seams-confirmation-surface`),t=e?.ownerDocument.activeElement;if(t instanceof HTMLElement&&t.tabIndex>=0&&e?.contains(t)){let e=t.getBoundingClientRect(),n=t.ownerDocument.documentElement.clientHeight;(e.top<0||e.bottom>n)&&t.scrollIntoView({block:`center`,inline:`nearest`})}}};toggle=e=>{let t=this.root.current;if(!t||(e.preventDefault(),this.motion?.kind===`hosted`))return;let n=this.motion?!this.motion.opening:!t.open,r=t.lastElementChild;if(!(r instanceof HTMLElement))return;let i=t.open?r.getBoundingClientRect().height:0;if(this.clearMotion(),t.toggleAttribute(`data-closing`,!n),window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||!t.animate){t.open=n,t.removeAttribute(`data-closing`);return}t.open=!0;let a=t.parentElement?.closest(`.seams-review-technical > div`);if(a&&a.scrollHeight>a.clientHeight){t.open=n,t.removeAttribute(`data-closing`);return}t.setAttribute(`data-resizing`,``);let o=n?r.getBoundingClientRect().height:0;if(this.motion={kind:`hosted`,opening:n},I({element:r,reason:`review-details`,fromCssPx:i,toCssPx:o,drivenClasses:[`seams-review-disclosure-driven`],setHeightCssPx:this.setHeight,onSettled:this.finish}))return;let s=r.animate([{height:`${i}px`,overflow:`hidden`},{height:`${o}px`,overflow:`hidden`}],{duration:n?220:180,easing:`cubic-bezier(.2,0,0,1)`,fill:`both`});this.motion={kind:`local`,opening:n,size:s,fade:r.animate(n?[{opacity:0},{opacity:1}]:[{opacity:1},{opacity:0}],{duration:n?180:100,easing:`ease-out`,fill:`both`})},s.onfinish=this.finish};render(){return f(`details`,{ref:this.root,class:`seams-review-${this.props.kind??`technical`}`,children:[f(`summary`,{onClick:this.toggle,children:[f(x,{copy:this.props.label}),f(`svg`,{class:`seams-review-caret`,viewBox:`0 0 20 20`,width:`16`,height:`16`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.6`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,children:f(`path`,{d:`m5 7.5 5 5 5-5`})})]}),f(`div`,{id:this.id,children:this.props.children})]})}};function G({kind:e}){let t={back:`m15 6-6 6 6 6`,close:`M6 6l12 12M6 18L18 6`,minimize:`M5 12h14`,check:`m5 12 4 4L19 6`,arrow:`M7 17 17 7M7 7h10v10`,copy:`M8 8h12v12H8ZM4 16V4h12`,loader:`M12 3a9 9 0 1 1-9 9`,alert:`M12 8v5m0 3v.1M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0`,fingerprint:`M6.405 19.048c.184-.443.353-.894.507-1.351M14.343 20.693c.266-.751.502-1.516.707-2.294.186-.706.346-1.422.478-2.147M19.448 17.058c.364-1.964.555-3.989.555-6.058 0-4.418-3.582-8-8-8-1.255 0-2.443.289-3.501.805M3.523 15.025c.314-1.29.48-2.638.48-4.025 0-1.74.556-3.351 1.499-4.664M12.003 11c0 2.76-.447 5.416-1.273 7.899-.213.639-.451 1.266-.712 1.881M7.712 14.5c.191-1.138.291-2.308.291-3.5 0-2.209 1.791-4 4-4s4 1.791 4 4c0 .617-.02 1.229-.058 1.836`};return f(`svg`,{viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`1.6`,"stroke-linecap":`round`,"stroke-linejoin":`round`,"aria-hidden":`true`,children:f(`path`,{d:t[e]})})}function Nt(e){return e?e.chain===`evm`&&e.chainId===5042?`Arc`:e.chain===`evm`&&e.chainId===5042002?`Arc Testnet`:e.chain===`evm`&&e.chainId===8453?`Base`:e.chain===`evm`&&e.chainId===84532?`Base Sepolia`:e.chain===`evm`&&e.chainId===1?`Ethereum`:e.chain===`evm`&&e.chainId===11155111?`Ethereum Sepolia`:`${e.chain.toUpperCase()}${e.chainId?` · ${e.chainId}`:``}`:`Wallet transaction`}function Pt(e){if(e?.operations.length!==1)return null;let t=e.operations[0];return t.kind===`generic.contractCall`||t.kind===`tempo.eip2718`?t.to??null:null}function Ft({value:e,class:t}){let n=y();return f(`bdi`,{class:`seams-review-middle ${t}`,dir:`ltr`,title:T(n,e),children:[f(`span`,{children:e.slice(0,-8)}),f(`span`,{children:e.slice(-8)})]})}function It({symbol:e}){return e===`NEAR`?f(`svg`,{class:`seams-review-token`,viewBox:`0 0 48 48`,"aria-hidden":`true`,children:[f(`circle`,{cx:`24`,cy:`24`,r:`24`,fill:`#000`}),f(`svg`,{x:`9`,y:`9`,width:`30`,height:`30`,viewBox:`108 108 351 351`,children:f(`path`,{d:`m421.61,108c-13,0-25.07,6.74-31.88,17.82l-73.37,108.93c-2.39,3.59-1.42,8.43,2.17,10.82,2.91,1.94,6.76,1.7,9.41-.58l72.22-62.64c1.2-1.08,3.05-.97,4.13.23.49.55.75,1.26.75,1.99v196.12c0,1.62-1.31,2.92-2.93,2.92-.87,0-1.69-.38-2.24-1.05L181.56,121.24c-7.11-8.39-17.55-13.23-28.54-13.24h-7.63c-20.65,0-37.39,16.74-37.39,37.39v276.22c0,20.65,16.74,37.39,37.39,37.39,13,0,25.07-6.74,31.88-17.82l73.37-108.93c2.39-3.59,1.42-8.43-2.17-10.82-2.91-1.94-6.76-1.7-9.41.58l-72.22,62.64c-1.2,1.08-3.05.97-4.13-.23-.49-.55-.75-1.26-.74-1.99v-196.17c0-1.62,1.31-2.92,2.93-2.92.86,0,1.69.38,2.24,1.05l218.28,261.37c7.11,8.39,17.55,13.23,28.54,13.24h7.63c20.65.01,37.4-16.72,37.42-37.37V145.39c0-20.65-16.74-37.39-37.39-37.39Z`,fill:`#fff`})})]}):e===`ETH`?f(`svg`,{class:`seams-review-token`,viewBox:`0 0 42 42`,"aria-hidden":`true`,children:[f(`circle`,{cx:`21`,cy:`21`,r:`21`,fill:`#eef0fb`}),f(`path`,{d:`m21 6-9 15 9 5 9-5Z`,fill:`#627eea`}),f(`path`,{d:`m21 6 9 15-9 5Z`,fill:`#465da9`}),f(`path`,{d:`m12 23 9 13 9-13-9 5Z`,fill:`#627eea`})]}):e===`USDC`?f(`svg`,{class:`seams-review-token`,viewBox:`0 0 96 96`,fill:`none`,"aria-hidden":`true`,children:[f(`path`,{d:`M48 95C73.9574 95 95 73.9574 95 48C95 22.0426 73.9574 1 48 1C22.0426 1 1 22.0426 1 48C1 73.9574 22.0426 95 48 95Z`,fill:`#0B53BF`}),f(`path`,{d:`M56.4609 13.7778V19.8291C68.5341 23.4716 77.3759 34.6928 77.3759 47.9997C77.3759 61.3066 68.5341 72.5278 56.4609 76.1703V82.2216C71.8534 78.4616 83.2509 64.5672 83.2509 47.9997C83.2509 31.4322 71.8534 17.5378 56.4609 13.7778Z`,fill:`white`}),f(`path`,{d:`M18.625 47.9997C18.625 34.6928 27.4669 23.4716 39.54 19.8291V13.7778C24.1475 17.5378 12.75 31.4322 12.75 47.9997C12.75 64.5672 24.1475 78.4616 39.54 82.2216V76.1703C27.4669 72.5572 18.625 61.3066 18.625 47.9997Z`,fill:`white`}),f(`path`,{d:`M60.6319 54.5506C60.6319 42.5362 41.8025 47.4713 41.8025 40.8325C41.8025 38.4531 43.7119 36.9256 47.3544 36.9256C51.7019 36.9256 53.2 39.0406 53.67 41.89H59.6625C59.1279 36.5426 56.0588 33.1662 50.9382 32.1604V27.4375H45.0632V31.9918C39.4534 32.7062 35.9275 35.973 35.9275 40.8325C35.9275 52.9056 54.7863 48.3819 54.7863 54.9031C54.7863 57.3706 52.4069 59.0156 48.3825 59.0156C43.1244 59.0156 41.3913 56.695 40.745 53.4931H34.8994C35.2781 59.3502 38.8897 63.0159 45.0632 63.9307V68.5625H50.9382V63.9923C56.9633 63.2139 60.6319 59.7089 60.6319 54.5506Z`,fill:`white`})]}):f(`span`,{class:`seams-review-token seams-review-token-fallback`,"aria-hidden":`true`,children:e.slice(0,1)})}function Lt({model:e,compact:t=!1}){let n=Bt(e);return n?f(`div`,{class:`seams-review-amount${t?` seams-review-amount--compact`:``}`,children:[f(It,{symbol:n.symbol}),f(`div`,{children:[f(`span`,{children:n.value}),` `,f(`small`,{children:n.symbol})]})]}):null}function Rt(){return f(`div`,{class:`seams-receipt-footer`,children:[f(`span`,{children:f(x,{message:`Secured by`})}),` `,f(m,{})]})}function zt(e,t){if(!/^\d+$/.test(e))return e;let n=e.padStart(t+1,`0`),r=n.slice(-t).replace(/0+$/,``);return`${n.slice(0,-t)}${r?`.${r}`:``}`}function Bt(e){let t=e?.totals;return t?.nativeValue?t.nativeSymbol===`yoctoNEAR`?{value:zt(t.nativeValue,24),symbol:`NEAR`}:e?.chain===`evm`&&(e.chainId===5042||e.chainId===5042002)&&t.nativeSymbol===`wei`?{value:zt(t.nativeValue,18),symbol:`USDC`}:{value:t.nativeValue,symbol:t.nativeSymbol??``}:null}var K=class extends u{static contextType=w;state={copied:!1};lifetime=new AbortController;timer=null;resetCopied=()=>{this.setState({copied:!1})};componentWillUnmount(){this.lifetime.abort(),this.timer!==null&&clearTimeout(this.timer)}componentDidUpdate(e){e.value!==this.props.value&&(this.lifetime.abort(),this.lifetime=new AbortController,this.timer!==null&&clearTimeout(this.timer),this.resetCopied())}copy=async e=>{let t=e.currentTarget;if(!(t instanceof HTMLElement))return;let n=this.lifetime.signal;try{if(!await E(t,this.props.value,n)||n.aborted)return;this.setState({copied:!0}),this.timer!==null&&clearTimeout(this.timer),this.timer=setTimeout(this.resetCopied,3e3)}catch{n.aborted||this.setState({copied:!1})}};render(){return f(`button`,{type:`button`,class:`seams-review-copy${this.props.address?` seams-review-copy-address`:``}${this.state.copied?` copied`:``}`,onClick:this.copy,"aria-label":T(this.context,this.state.copied?`Copied`:this.props.label??`Copy value`),children:[this.props.address&&f(`bdi`,{class:`seams-review-full-address`,dir:`ltr`,children:this.props.value}),f(ne,{})]})}};function Vt({node:e}){let t=y();if(e.action||e.transaction)return f(p,{children:f(x,{copy:V(e)})});let n=B(e);if(n&&e.contractAddress){let r=e.contractAddress;return f(`span`,{class:`seams-review-contract`,children:[f(x,{copy:n.trim()}),f(`span`,{class:`seams-review-contract-value`,children:[f(Ft,{value:r,class:`seams-review-contract-address`}),f(K,{value:r,label:T(t,`Copy contract address ${r}`)})]})]})}if(e.fieldLabel){let t=e.label.slice(e.fieldLabel.length);return f(p,{children:[f(x,{copy:e.fieldLabel}),e.fieldLabel===`Method:`?f(`span`,{class:`seams-review-function`,children:t}):t]})}let r=/^(Call(?:ing)? )([^\s]+)(.*)$/.exec(e.label);return r?f(p,{children:[f(x,{copy:r[1]}),f(`span`,{class:`seams-review-function`,children:r[2]}),r[3]]}):f(p,{children:f(x,{copy:e.label})})}function Ht({node:e}){let t=y(),n=e.contentVariants?.decoded??e.content,r=!!(e.contentVariants||n?.includes(`
|
|
2
2
|
`));return f(`div`,{class:`seams-review-detail`,children:[f(`div`,{class:n?`seams-review-detail-row${r?` seams-review-detail-row--block`:``}`:`seams-review-detail-label`,children:[f(`span`,{children:f(Vt,{node:e})}),n&&f(`pre`,{children:n}),e.copyValue&&f(K,{value:e.copyValue})]}),e.contentVariants&&f(W,{label:b(t,`Raw data`),kind:`raw`,children:f(`pre`,{children:e.contentVariants.raw})}),!!e.children?.length&&f(`div`,{class:`seams-review-detail-children`,children:e.children?.map(e=>f(Ht,{node:e},e.id))})]})}function Ut({data:e,details:t=!0}){let n=y(),r=e.model,i=r?.operations[0],a=Pt(r);return f(`div`,{class:`seams-transaction-review`,children:[f(Lt,{model:r}),r?.warnings?.map(e=>f(`div`,{class:`seams-review-warning`,role:`alert`,children:f(x,{copy:e.message})},e.code)),f(`dl`,{class:`seams-review-fields`,children:[a&&f(`div`,{children:[f(`dt`,{children:f(x,{message:`To`})}),f(`dd`,{class:`seams-review-recipient`,children:f(K,{value:a,address:!0,label:T(n,`Copy recipient address ${a}`)})})]}),r&&f(`div`,{children:[f(`dt`,{children:f(x,{message:`Network`})}),f(`dd`,{children:[f(`span`,{class:`seams-review-network-dot`}),Nt(r)]})]}),r?.totals?.estimatedFee&&f(`div`,{children:[f(`dt`,{children:f(x,{message:`Estimated network fee`})}),f(`dd`,{children:[r.totals.estimatedFee,` `,r.totals.feeSymbol]})]})]}),t&&e.tree&&f(W,{initiallyOpen:e.detailsInitiallyOpen,label:T(n,i?.kind===`near.message`?`Message details`:`Transaction details`),children:f(Ht,{node:e.tree})}),r?.signerAccount&&f(`div`,{class:`seams-review-account`,children:[f(`span`,{class:`seams-review-avatar`,"aria-hidden":`true`,children:`S`}),f(`div`,{children:[f(x,{message:`Signing account`}),f(`small`,{children:f(K,{value:r.signerAccount,address:!0,label:T(n,`Copy signing account address ${r.signerAccount}`)})})]})]})]})}let Wt=0;var Gt=class extends u{static contextType=w;root=l();otpFormId=`seams-confirmation-email-${++Wt}`;reflowId=`seams-confirmation-content-surface-${Wt}`;getReflowElement=()=>this.root.current?.closest(`.modal-container-root, .seams-confirmation-drawer`)??null;setHeight=e=>{let t=this.getReflowElement();t?.id&&this.props.styles.setDynamicDeclarations(this.reflowId,`#${t.id}`,{[F]:`${e}px`})};reflow=qe({reason:`confirm-body`,element:this.getReflowElement,setHeightCssPx:this.setHeight});copyAccount=e=>{let t=this.root.current;t&&E(t,e).catch(Kt)};componentWillReceiveProps(){this.reflow.capture()}componentDidUpdate(e){e.styles!==this.props.styles&&e.styles.deleteDynamicRule(this.reflowId),this.reflow.commit()}componentWillUnmount(){this.reflow.dispose(),this.props.styles.deleteDynamicRule(this.reflowId)}render(){let e=this.props.model;switch(e.kind){case`registration`:return f(wt,{...e.registration,root:this.root,styles:this.props.styles});case`transaction`:return this.renderTransaction(e);default:return qt(e)}}renderTransaction(e){let t=this.props.variant===`drawer`?`seams-confirmation-content seams-confirmation-content--drawer`:`seams-confirmation-content`,n=e.prompt.kind===`email`&&e.transaction.decision.kind===`ready`?{kind:`form`,formId:this.otpFormId}:e.transaction.decision;return e.capture?f(`div`,{ref:this.root,class:t,children:f(`div`,{class:`seams-review-content seams-review-content--capture`,children:[this.props.variant!==`drawer`&&this.renderToolbar(e,n),f(Jt,{element:e.capture}),f(Rt,{})]})}):f(`div`,{ref:this.root,class:t,children:f(`div`,{class:`seams-review-content`,children:[this.props.variant!==`drawer`&&this.renderToolbar(e,n),e.review.model&&f(`div`,{class:`seams-review-eyebrow`,children:e.review.model.operations.length===1?f(x,{copy:e.review.model.operations[0].label.replace(/\s+using\s+[\d,.]+\s+gas$/i,``)}):f(x,{message:`Transaction`})}),f(`h2`,{class:`seams-review-title`,children:f(x,{copy:e.header.heading})}),f(Ut,{data:e.review}),f(`div`,{class:`seams-review-context`,children:[f(St,{model:e.body,onCopyAccount:this.copyAccount}),e.prompt.kind===`email`&&f(Ot,{...e.prompt.email,formId:this.otpFormId})]}),f(bt,{...e.transaction,tree:null,styles:this.props.styles,decision:n,cancelInHeader:!0,confirmIcon:e.prompt.kind===`passkey`?f(G,{kind:`fingerprint`}):void 0}),f(Rt,{})]})})}renderToolbar(e,t){return f(`div`,{class:`seams-review-toolbar`,children:[f(`div`,{class:`seams-review-origin`,children:[e.transaction.onBack&&f(`button`,{type:`button`,"aria-label":b(this.context,`Back to review`),title:b(this.context,`Back to review`),disabled:t.kind===`preparing`,onClick:e.transaction.onBack,children:f(G,{kind:`back`})}),f(L,{}),e.header.website.kind===`ready`?e.header.website.text:f(ct,{label:b(this.context,`Loading website`)})]}),f(`button`,{type:`button`,"aria-label":T(this.context,e.transaction.cancelText),onClick:e.transaction.onCancel,children:f(G,{kind:`close`})})]})}};function Kt(){}function qt(e){throw Error(`Unexpected confirmation content: ${String(e)}`)}var Jt=class extends u{container=l();componentDidMount(){this.container.current?.append(this.props.element),this.props.element.querySelector(`button`)?.focus()}componentDidUpdate(e){e.element!==this.props.element&&this.container.current?.replaceChildren(this.props.element)}componentWillUnmount(){this.props.element.remove()}render(){return f(`div`,{ref:this.container,class:`seams-auth-method-capture`})}};function Yt(e){let{kind:t}=e.state;return t===`signing`||t===`broadcasting`||t===`submitted`}function Xt(e){return e.state.kind===`confirmed`||e.state.kind===`signed`}function Zt(e){if(e.subject===`message`)return e.state.kind===`signed`?3:0;let{state:t}=e;switch(t.kind){case`signing`:return 0;case`signed`:case`broadcasting`:return 1;case`submitted`:case`reverted`:return 2;case`confirmed`:return 3;case`failed`:case`unknown`:return t.hash?2:0;default:return q(t)}}function Qt(e){return e.subject===`message`?`Message signature`:`Transaction receipt`}function $t(e){if(e.subject===`message`)return tn(e.state);let{state:t}=e;switch(t.kind){case`signing`:return`Signing transaction`;case`signed`:return`Signature ready`;case`broadcasting`:return`Broadcasting transaction`;case`submitted`:return`Waiting for confirmation`;case`confirmed`:return`Transaction complete`;case`failed`:return`Transaction failed`;case`reverted`:return`Transaction reverted`;case`unknown`:return`Confirmation unavailable`;default:return q(t)}}function en(e){if(e.subject===`message`)return nn(e.state);let{state:t}=e;switch(t.kind){case`signing`:return`Preparing your signed transaction.`;case`signed`:return`Signature created, ready to broadcast.`;case`broadcasting`:return`Submitting your signed transaction to the network.`;case`submitted`:return`Submitted to the network. Waiting for the receipt.`;case`confirmed`:return`The network confirmed your transaction.`;case`failed`:case`reverted`:case`unknown`:return t.message;default:return q(t)}}function tn(e){switch(e.kind){case`signing`:return`Signing message`;case`signed`:return`Message signed`;case`failed`:return`Signature failed`;default:return q(e)}}function nn(e){switch(e.kind){case`signing`:return`Preparing your message signature.`;case`signed`:return`Signed off-chain. Nothing was sent to the network.`;case`failed`:return e.message;default:return q(e)}}function q(e){throw Error(`Unexpected transaction receipt state: ${String(e)}`)}const rn=`cubic-bezier(0.22, 1, 0.36, 1)`;let an=0;var on=class extends u{static contextType=w;explorerRow=l();explorerRowId=`seams-receipt-explorer-row-${++an}`;minimize=()=>{this.props.receipt.onView(`toast`)};expand=()=>{this.props.receipt.onView(`expanded`)};close=()=>{Yt(this.props.receipt)?this.minimize():this.props.receipt.onDismiss()};componentDidUpdate(e){let{receipt:t}=this.props;t.view===`expanded`&&e.receipt.view===`expanded`&&t.subject===`transaction`&&t.state.kind===`confirmed`&&e.receipt.state.kind!==`confirmed`&&this.revealExplorerLink()}componentWillUnmount(){this.releaseExplorerRow()}setExplorerRowHeight=e=>{let t=this.explorerRow.current;t&&S(t.ownerDocument).setDynamicDeclarations(this.explorerRowId,`#${this.explorerRowId}`,{"--seams-receipt-explorer-height":`${e}px`})};releaseExplorerRow=()=>{let e=this.explorerRow.current;e&&(delete e.dataset.opening,S(e.ownerDocument).deleteDynamicRule(this.explorerRowId))};revealExplorerLink(){let e=this.explorerRow.current,t=e?.firstElementChild;if(!e||!t||e.ownerDocument.defaultView?.matchMedia(`(prefers-reduced-motion: reduce)`).matches)return;let n=e.getBoundingClientRect().height;e.dataset.opening=``;let r=()=>{this.releaseExplorerRow(),t.animate([{opacity:0,filter:`blur(4px)`,transform:`translateY(6px)`},{opacity:1,filter:`blur(0)`,transform:`translateY(0)`}],{duration:240,easing:rn})};if(!I({reason:`receipt-explorer`,element:e,fromCssPx:0,toCssPx:n,drivenClasses:[`seams-receipt-explorer-driven`],setHeightCssPx:this.setExplorerRowHeight,onSettled:r})){let t=e.animate([{height:`0px`},{height:`${n}px`}],{duration:240,easing:rn});t.onfinish=r,t.oncancel=this.releaseExplorerRow}}render(){let{receipt:e,data:t}=this.props,n=$t(e),r=Xt(e),i=Yt(e),a=Zt(e),o=Pt(t.model),s=e.subject===`transaction`?e.state:null,c=s?.kind===`confirmed`&&s.hash?sn(t.model,this.props.explorers,s.hash):null;return e.view===`toast`?f(`div`,{class:`seams-transaction-toast`,"data-completed-stages":a,"data-stage":e.state.kind,"data-pending":i,children:[f(`div`,{class:`seams-toast-progress`,"aria-hidden":`true`,children:f(`span`,{class:`seams-toast-progress-fill`,children:i&&f(`span`,{class:`seams-toast-progress-active`})})}),f(`span`,{class:`seams-receipt-symbol`,"data-pending":i,children:f(G,{kind:i?`loader`:r?`check`:`alert`})}),f(`div`,{class:`seams-transaction-toast-text`,children:[f(`strong`,{role:`status`,children:f(x,{copy:n})}),f(`span`,{children:Nt(t.model)})]}),f(`button`,{type:`button`,class:`seams-receipt-open`,onClick:this.expand,children:[f(x,{message:`Open`}),` `,f(G,{kind:`arrow`})]}),!i&&f(`button`,{type:`button`,class:`seams-receipt-dismiss`,"aria-label":b(this.context,`Close transaction`),onClick:e.onDismiss,children:f(G,{kind:`close`})})]}):f(`div`,{class:`seams-transaction-receipt`,children:[f(`div`,{class:`seams-review-toolbar`,children:[f(`span`,{children:f(x,{copy:Qt(e)})}),f(`button`,{type:`button`,"aria-label":b(this.context,`Minimize transaction`),onClick:this.minimize,children:f(G,{kind:`minimize`})})]}),f(`div`,{class:`seams-receipt-heading`,children:[f(`span`,{class:`seams-receipt-symbol`,"data-pending":i,children:f(G,{kind:i?`loader`:r?`check`:`alert`})}),f(`div`,{children:[f(`h2`,{role:`status`,children:f(x,{copy:n})}),f(`p`,{children:f(x,{copy:en(e)})})]})]}),f(Lt,{model:t.model,compact:!0}),f(`div`,{class:`seams-receipt-destination`,children:[o&&f(p,{children:[f(x,{message:`To`}),` `,f(K,{value:o,address:!0,label:T(this.context,`Copy recipient address ${o}`)})]}),!o&&Nt(t.model)]}),t.model?.totals?.estimatedFee&&f(`dl`,{class:`seams-review-fields`,children:f(`div`,{children:[f(`dt`,{children:f(x,{message:`Estimated network fee`})}),f(`dd`,{children:[t.model.totals.estimatedFee,` `,t.model.totals.feeSymbol]})]})}),s?f(ln,{state:s}):e.subject===`message`&&f(un,{state:e.state}),f(W,{label:b(this.context,`Receipt details`),children:f(`dl`,{class:`seams-review-fields`,children:[s&&t.model?.signerAccount&&f(`div`,{children:[f(`dt`,{children:f(x,{message:`From`})}),f(`dd`,{class:`seams-review-recipient`,children:f(K,{value:t.model.signerAccount,address:!0,label:T(this.context,`Copy signer address ${t.model.signerAccount}`)})})]}),o&&f(`div`,{children:[f(`dt`,{children:[f(x,{message:`To`}),` `]}),f(`dd`,{class:`seams-review-recipient`,children:f(K,{value:o,address:!0,label:T(this.context,`Copy recipient address ${o}`)})})]}),s?.hash&&f(`div`,{children:[f(`dt`,{children:f(x,{message:`Transaction`})}),f(`dd`,{children:[f(Ft,{value:s.hash,class:`seams-review-hash`}),f(K,{value:s.hash})]})]}),e.subject===`message`&&f(dn,{model:t.model}),f(`div`,{children:[f(`dt`,{children:f(x,{message:`Status`})}),f(`dd`,{children:f(x,{copy:n})})]})]})}),f(`button`,{type:`button`,class:`seams-receipt-primary`,onClick:this.close,children:i?f(x,{message:`Continue in background`}):f(x,{message:`Done`})}),c&&f(`div`,{id:this.explorerRowId,class:`seams-receipt-explorer-row`,ref:this.explorerRow,children:f(`a`,{class:`seams-receipt-explorer`,href:c,target:`_blank`,rel:`noopener noreferrer`,children:[f(x,{message:`View transaction`}),` `,f(G,{kind:`arrow`})]})}),f(Rt,{})]})}};function sn(e,t,n){if(!e)return null;let r;switch(e.chain){case`near`:r=t.near;break;case`evm`:r=t.evm;break;case`tempo`:r=t.tempo;break;case`unknown`:return null;default:return cn(e.chain)}if(!r)return null;let i=e.chain===`near`?`txns`:`tx`;return`${r.trim().replace(/\/$/,``)}/${i}/${encodeURIComponent(n)}`}function cn(e){throw Error(`Unexpected display chain: ${String(e)}`)}function ln({state:e}){let t=y(),n=Zt({subject:`transaction`,state:e});return f(`div`,{class:`seams-receipt-steps`,"aria-label":b(t,`Transaction progress`),children:[f(J,{stage:`signing`,label:b(t,`Signed`),activeLabel:`Signing`,complete:n>=1,active:e.kind===`signing`}),f(J,{stage:`broadcast`,label:b(t,`Broadcast`),activeLabel:`Broadcasting`,complete:n>=2,active:e.kind===`broadcasting`}),f(J,{stage:`confirming`,label:T(t,e.kind===`reverted`?`Reverted`:`Confirmed`),activeLabel:`Confirming`,complete:n===3,active:e.kind===`submitted`})]})}function un({state:e}){let t=y(),n=e.kind===`signed`,r=e.kind===`signing`;return f(`div`,{class:`seams-receipt-steps`,"aria-label":b(t,`Transaction progress`),children:[f(J,{stage:`signing`,label:b(t,`Signed`),activeLabel:`Signing`,complete:n,active:r}),f(J,{stage:`signed`,label:``,activeLabel:``,complete:n,active:!1}),f(J,{stage:`signed`,label:``,activeLabel:``,complete:n,active:!1})]})}function dn({model:e}){let t=y(),n=e?.operations.length===1?e.operations[0]:null;return n?.kind===`near.message`?f(p,{children:n.fields?.map(e=>f(`div`,{children:[f(`dt`,{children:f(x,{copy:e.label})}),e.renderAs===`file-content`?f(`dd`,{children:[f(`span`,{class:`seams-receipt-message`,children:e.value}),f(K,{value:e.copyValue??e.value})]}):f(`dd`,{class:`seams-review-recipient`,children:f(K,{value:e.copyValue??e.value,address:!0,label:T(t,`Copy ${e.label.toLowerCase()} address ${e.value}`)})})]},e.label))}):null}function J(e){let t=e.complete?`complete`:e.active?`active`:`waiting`;return f(`span`,{class:`seams-receipt-step`,"data-stage":e.stage,"data-state":t,"aria-current":e.active?`step`:void 0,children:[f(`span`,{class:`seams-receipt-track`,"aria-hidden":`true`}),f(x,{copy:e.active?e.activeLabel:e.label})]})}const fn=`cubic-bezier(0.22, 1, 0.36, 1)`,pn=[`.seams-receipt-symbol`,`[role="status"]`,`.seams-review-amount`,`.seams-receipt-footer`];function mn(e){let t=[];for(let n of pn){let r=e.querySelector(n);r&&t.push({selector:n,text:r.textContent,bounds:r.getBoundingClientRect(),fontSize:getComputedStyle(r).fontSize,textGeometry:r.matches(`[role="status"]`)?hn(r):null})}return t}function hn(e){let t=e.ownerDocument.createRange();return t.selectNodeContents(e),{bounds:t.getBoundingClientRect(),lineCount:t.getClientRects().length}}function gn(e,t){let n=t.getBoundingClientRect(),r=parseFloat(e.fontSize)/parseFloat(getComputedStyle(t).fontSize),i=r,a=r,o=e.bounds.left-n.left,s=e.bounds.top-n.top;if(e.textGeometry){let r=hn(t),c=e.textGeometry.bounds,l=r.bounds;e.textGeometry.lineCount===r.lineCount&&l.width>0&&l.height>0&&(i=c.width/l.width,a=c.height/l.height,o=c.left-n.left-(l.left-n.left)*i,s=c.top-n.top-(l.top-n.top)*a)}return`translate(${o}px, ${s}px) scale(${i}, ${a})`}function _n(e){let t=e.querySelector(`[data-seams-progress-line]`);if(!t)return[];let n=getComputedStyle(t).color,r=Array.from(t.querySelectorAll(`[data-seams-progress-segment]`));if(r.length===3&&r.every(yn))return r.map(e=>({bounds:e.getBoundingClientRect(),opacity:e.getAttribute(`opacity`)??`1`,color:n})).sort((e,t)=>e.bounds.left-t.bounds.left);let i=t.getBoundingClientRect(),a=i.width/3;return[0,1,2].map(e=>({bounds:new DOMRect(i.left+e*a,i.top+i.height/2,a,0),opacity:`0.55`,color:n}))}function vn(){}function yn(e){return e.getAttribute(`opacity`)!==`0`}let bn=0;var xn=class{element;styles;presentation;state;receipt=null;receiptMotion=[];receiptShell=null;receiptGhost=null;receiptSegments=[];receiptResize=null;clearReceiptMotion=()=>{this.element.querySelector(`.seams-receipt-footer--hosted`)?.classList.remove(`seams-receipt-footer--hosted`),this.receiptResize?.element.classList.remove(`seams-surface-height-driven`),this.receiptResize=null,this.styles.deleteDynamicRule(`${this.element.id}-receipt-resize`);for(let e of this.receiptMotion)e.cancel();this.receiptMotion=[],this.receiptShell?.remove(),this.receiptShell=null,this.receiptGhost?.remove(),this.receiptGhost=null;for(let e of this.receiptSegments)e.remove();this.receiptSegments=[],this.element.removeAttribute(`data-receipt-segments`),this.element.removeAttribute(`data-receipt-morphing`)};constructor(e){let t=e.parent.ownerDocument;this.styles=S(t),this.presentation={variant:e.presentation.variant,context:e.presentation.context},this.state={kind:`mounted`,model:e.model,onClosed:e.onClosed},this.element=t.createElement(`div`),this.element.id=`seams-confirmation-surface-${++bn}`,this.element.className=`seams-wallet-ui seams-confirmation-surface`,this.element.dataset.seamsConfirmSurface=e.presentation.context,this.element.dataset.seamsConfirmVariant=e.presentation.variant,this.element.addEventListener(`cancel`,this.cancel),e.parent.appendChild(this.element);try{this.update(e.model)}catch(e){throw this.remove(),e}}update(e){this.state.kind===`mounted`&&(this.state.model=e,this.element.dataset.confirmationKind=e.content.kind,this.element.dataset.seamsConfirmReady=String(e.content.kind===`transaction`&&e.content.transaction.decision.kind===`ready`),this.element.lang=e.appearance.locale??`en`,this.element.dataset.theme=e.appearance.theme.mode,this.styles.setDynamicRule(this.element.id,ee(this.element.id,e.appearance)),this.renderSurface())}close(){this.state.kind===`mounted`&&(this.state={kind:`closing`,model:this.state.model,onClosed:this.state.onClosed},this.presentation.variant===`modal`?this.dispose():this.renderSurface())}showReceipt(e){if(this.state.kind!==`mounted`||this.state.model.content.kind!==`transaction`)return;let t=this.receipt?.view!==e.view||this.receiptMotion.length>0,n=this.receiptShell??this.element.querySelector(`.modal-container-root`),r=n?.getBoundingClientRect(),i=t?mn(this.element):[],a=t?this.liveCapture():null,o=n?getComputedStyle(n).borderRadius:`26px`;t&&this.clearReceiptMotion(),this.receipt=e,this.element.dataset.receiptView=e.view,this.element.dataset.seamsConfirmSurface=`wallet-iframe`,this.element.dataset.seamsConfirmVariant=`modal`,this.renderSurface();let s=this.element.querySelector(`.modal-container-root`);if(t&&r&&s&&!window.matchMedia(`(prefers-reduced-motion: reduce)`).matches){let t=s.getBoundingClientRect(),n=this.element.ownerDocument.createElement(`div`);n.className=`seams-receipt-morph-shell`,n.setAttribute(`aria-hidden`,`true`),this.element.appendChild(n),this.receiptShell=n,this.element.setAttribute(`data-receipt-morphing`,``);let c=n.animate([{left:`${r.left}px`,top:`${r.top}px`,width:`${r.width}px`,height:`${r.height}px`,borderRadius:o},{left:`${t.left}px`,top:`${t.top}px`,width:`${t.width}px`,height:`${t.height}px`,borderRadius:getComputedStyle(s).borderRadius}],{duration:640,easing:fn,fill:`both`});this.receiptMotion=[c];let l=[c],u=a?this.handOverCapture(a,s):!1,d=new Set;for(let e of i){let t=s.querySelector(e.selector);if(!t||t.textContent!==e.text)continue;d.add(t);let n=t.animate([{transform:gn(e,t),transformOrigin:`top left`},{transform:`translate(0, 0) scale(1)`,transformOrigin:`top left`}],{duration:640,easing:fn});this.receiptMotion.push(n),l.push(n)}let f=s.querySelectorAll(`.seams-transaction-receipt > :not(.seams-receipt-heading), .seams-receipt-heading > .seams-receipt-symbol, .seams-receipt-heading h2, .seams-receipt-heading p, .seams-transaction-toast > :not(.seams-transaction-toast-text, .seams-toast-progress), .seams-transaction-toast-text > *`),p=0;for(let t of f){if(d.has(t))continue;let n=a!==null&&t.matches(`.seams-review-toolbar`),r=n||t.matches(`.seams-receipt-footer`);this.receiptMotion.push(t.animate(r?[{opacity:0},{opacity:1}]:[{opacity:0,transform:`translateY(8px)`},{opacity:1,transform:`translateY(0)`}],a?{duration:360,delay:n?0:u&&t.matches(`.seams-receipt-steps`)?560:200+Math.min(p,6)*40,fill:`backwards`,easing:`cubic-bezier(0.2, 0, 0, 1)`}:{duration:120,delay:e.view===`toast`?240:180+Math.min(p,4)*15,fill:`backwards`,easing:`ease-out`})),n||(p+=1)}this.resizeReceipt({element:s,animations:l,fromHeight:r.height,toHeight:t.height});let m=this.receiptMotion;Promise.all(m.map(e=>e.finished)).then(()=>{this.receiptMotion===m&&this.clearReceiptMotion()},vn)}}resizeReceipt(e){if(!(Math.abs(e.toHeight-e.fromHeight)<1)){this.receiptResize=e;for(let t of e.animations)t.pause(),t.effect?.updateTiming({easing:`linear`});if(e.element.classList.add(`seams-surface-height-driven`),this.setReceiptHeight(e,e.fromHeight),Ke(e.element,{reason:`receipt-transition`,fromCssPx:e.fromHeight,toCssPx:e.toHeight,setHeightCssPx:this.setReceiptHeight.bind(this,e),finish:this.finishReceiptResize.bind(this,e)})){this.fitReceiptToViewport(e);return}this.receiptResize=null,e.element.classList.remove(`seams-surface-height-driven`),this.styles.deleteDynamicRule(`${this.element.id}-receipt-resize`);for(let t of e.animations)t.effect?.updateTiming({easing:fn}),t.play()}}fitReceiptToViewport(e){let t=e.element.querySelector(`.seams-receipt-footer`);for(let n of e.animations){let e=n.effect;if(e instanceof KeyframeEffect){if(e.target===this.receiptShell){this.receiptShell?.classList.add(`seams-receipt-morph-shell--hosted`);let t=e.getKeyframes();for(let e of t)delete e.height,delete e.width;e.setKeyframes(t)}else if(t&&e.target===t){let t=e.getKeyframes();for(let e of t)delete e.transform;e.setKeyframes(t)}}}t?.classList.add(`seams-receipt-footer--hosted`)}setReceiptHeight(e,t){if(this.receiptResize!==e)return;this.styles.setDynamicDeclarations(`${this.element.id}-receipt-resize`,`#${e.element.id}`,{[F]:`${t}px`,"--seams-receipt-target-height":`${e.toHeight}px`});let n=(t-e.fromHeight)/(e.toHeight-e.fromHeight);for(let t of e.animations)t.currentTime=Math.max(0,Math.min(1,n))*640}finishReceiptResize(e){if(this.receiptResize===e){this.receiptResize=null,e.element.classList.remove(`seams-surface-height-driven`),e.element.querySelector(`.seams-receipt-footer--hosted`)?.classList.remove(`seams-receipt-footer--hosted`),this.styles.deleteDynamicRule(`${this.element.id}-receipt-resize`);for(let t of e.animations)t.finish()}}liveCapture(){if(this.state.kind!==`mounted`||this.state.model.content.kind!==`transaction`)return null;let e=this.state.model.content.capture;return e?.isConnected?{element:e,bounds:e.getBoundingClientRect(),segments:_n(e)}:null}handOverCapture(e,t){let n=this.element.ownerDocument.createElement(`div`);n.className=`seams-receipt-capture-ghost`,n.setAttribute(`aria-hidden`,`true`),n.append(e.element),this.element.appendChild(n),this.receiptGhost=n;let r={left:`${e.bounds.left}px`,top:`${e.bounds.top}px`,width:`${e.bounds.width}px`,height:`${e.bounds.height}px`};this.receiptMotion.push(n.animate([{...r,opacity:1},{...r,opacity:0}],{duration:160,easing:`ease-out`,fill:`both`}));let i=t.querySelectorAll(`.seams-receipt-track`);if(e.segments.length===0||i.length!==e.segments.length)return!1;this.element.setAttribute(`data-receipt-segments`,``);for(let[t,n]of i.entries()){let r=e.segments[t],i=n.getBoundingClientRect(),a=n.closest(`.seams-receipt-step`)?.dataset.state===`complete`,o=this.element.ownerDocument.createElement(`div`);o.className=`seams-receipt-segment`,o.setAttribute(`aria-hidden`,`true`),this.element.appendChild(o),this.receiptSegments.push(o),this.receiptMotion.push(o.animate([{left:`${r.bounds.left}px`,top:`${r.bounds.top+r.bounds.height/2-.5}px`,width:`${r.bounds.width}px`,height:`1px`,borderRadius:`1px`,opacity:r.opacity,backgroundColor:r.color},{left:`${i.left}px`,top:`${i.top}px`,width:`${i.width}px`,height:`${i.height}px`,borderRadius:getComputedStyle(n).borderRadius,opacity:1,backgroundColor:getComputedStyle(n,a?`::after`:null).backgroundColor}],{duration:800,delay:120,easing:`cubic-bezier(0.65, 0, 0.35, 1)`,fill:`both`}))}return!0}dispose=()=>{if(this.state.kind===`disposed`)return;let e=this.state.onClosed;this.remove(),e()};remove(){this.clearReceiptMotion(),this.state={kind:`disposed`},this.element.removeEventListener(`cancel`,this.cancel),d(null,this.element),this.styles.deleteDynamicRule(this.element.id),this.element.remove()}cancel=()=>{if(this.state.kind!==`mounted`)return;if(this.receipt){Yt(this.receipt)?this.receipt.onView(`toast`):this.receipt.onDismiss();return}let e=this.state.model.content;e.kind===`registration`?e.registration.onCancel():e.transaction.onCancel()};confirm=()=>{if(this.state.kind!==`mounted`)return;let e=this.state.model.content,t=e.kind===`registration`?e.registration.decision:e.transaction.decision;t.kind===`ready`&&t.onConfirm()};submitOtp=(e,t)=>{if(this.state.kind!==`mounted`)return;let n=this.state.model.content;n.kind===`transaction`&&n.prompt.kind===`email`&&n.prompt.email.onSubmit(e,t)};renderSurface(){let e=this.state;if(e.kind===`disposed`)return;let t=e.model.content,n=this.contentModel(t,e.kind===`closing`),r=this.receipt&&t.kind===`transaction`?f(on,{receipt:this.receipt,data:t.review,explorers:t.transaction.explorers}):f(Gt,{model:n,styles:this.styles,variant:this.presentation.variant}),i=t.kind===`registration`?t.registration.heading:t.header.heading;if(this.receipt||this.presentation.variant===`modal`){d(C(e.model.appearance.locale??`en`,f(te,{context:this.receipt?`wallet-iframe`:this.presentation.context,label:i,onCancel:this.cancel,children:r})),this.element);return}let a=t.kind===`registration`?t.registration.decision:t.transaction.decision;d(C(e.model.appearance.locale??`en`,f(re,{context:this.presentation.context,label:i,origin:t.kind===`transaction`&&t.header.website.kind===`ready`?f(p,{children:[f(L,{}),t.header.website.text]}):void 0,errorMessage:t.kind===`registration`?t.registration.errorMessage:t.transaction.errorMessage,styles:this.styles,state:e.kind===`closing`?{kind:`closing`,onClosed:this.dispose}:{kind:`open`,interaction:a.kind===`ready`?`ready`:`busy`},onCancel:this.cancel,children:r})),this.element)}contentModel(e,t){switch(e.kind){case`registration`:return{kind:`registration`,registration:{...e.registration,decision:!t&&e.registration.decision.kind===`ready`?{kind:`ready`,onConfirm:this.confirm}:{kind:`creating`},onCancel:this.cancel}};case`transaction`:return{kind:`transaction`,capture:e.capture,header:e.header,body:e.body,review:e.review,prompt:e.prompt.kind===`email`?{kind:`email`,email:{prompt:e.prompt.email.prompt,verification:t?{kind:`pending`}:e.prompt.email.verification,onSubmit:this.submitOtp}}:e.prompt,transaction:{...e.transaction,decision:!t&&e.transaction.decision.kind===`ready`?{kind:`ready`,onConfirm:this.confirm}:{kind:`preparing`},onCancel:this.cancel}};default:return Sn(e)}}};function Sn(e){throw Error(`Unexpected confirmation content: ${String(e)}`)}function Cn(e){return new xn(e)}var wn=class{element;surface;callbacks;appearance;presentation;tree;currentModel;constructor(e){this.callbacks=e.callbacks,this.appearance=e.appearance,this.presentation=e.presentation,this.tree=e.tree,this.currentModel=this.normalize(),this.surface=Cn({parent:e.parent,presentation:{variant:e.variant,context:e.context},model:this.currentModel,onClosed:e.onClosed}),this.element=this.surface.element}update(e){this.presentation=Tn(this.presentation,e),e.appearance&&(this.appearance=e.appearance),Object.hasOwn(e,`model`)&&(this.tree=A({model:e.model})),this.currentModel=this.normalize(),this.surface.update(this.currentModel)}setTree(e){this.tree=e,this.currentModel=this.normalize(),this.surface.update(this.currentModel)}close(){this.surface.close()}showReceipt(e){this.surface.showReceipt(e)}dispose(){this.surface.dispose()}normalize(){let e=Ie({presentation:this.presentation,appearance:this.appearance,tree:this.tree,callbacks:this.callbacks});if(!e.ok)throw Error(`Cannot render confirmation surface: ${e.error}`);return e.model}};function Tn(e,t){return{model:Object.hasOwn(t,`model`)?t.model:e.model,securityContext:Object.hasOwn(t,`securityContext`)?t.securityContext:e.securityContext,loading:Object.hasOwn(t,`loading`)?t.loading:e.loading,preparing:Object.hasOwn(t,`preparing`)?t.preparing:e.preparing,title:Object.hasOwn(t,`title`)?t.title:e.title,body:Object.hasOwn(t,`body`)?t.body:e.body,authMethodCapture:Object.hasOwn(t,`authMethodCapture`)?t.authMethodCapture:e.authMethodCapture,authMethodApprovalMessage:Object.hasOwn(t,`authMethodApprovalMessage`)?t.authMethodApprovalMessage:e.authMethodApprovalMessage,errorMessage:Object.hasOwn(t,`errorMessage`)?t.errorMessage:e.errorMessage,confirmText:Object.hasOwn(t,`confirmText`)?t.confirmText:e.confirmText,cancelText:Object.hasOwn(t,`cancelText`)?t.cancelText:e.cancelText,onBack:Object.hasOwn(t,`onBack`)?t.onBack:e.onBack,signingAuthMode:Object.hasOwn(t,`signingAuthMode`)?t.signingAuthMode:e.signingAuthMode,emailOtpPrompt:Object.hasOwn(t,`emailOtpPrompt`)?t.emailOtpPrompt:e.emailOtpPrompt,nearExplorerUrl:Object.hasOwn(t,`nearExplorerUrl`)?t.nearExplorerUrl:e.nearExplorerUrl,tempoExplorerUrl:Object.hasOwn(t,`tempoExplorerUrl`)?t.tempoExplorerUrl:e.tempoExplorerUrl,evmExplorerUrl:Object.hasOwn(t,`evmExplorerUrl`)?t.evmExplorerUrl:e.evmExplorerUrl}}function En(e){return new wn(e)}var Dn=e({awaitConfirmUIDecision:()=>nr,mountConfirmUI:()=>Zn,prepareConfirmUISurface:()=>tr});const Y=`seams-confirm-portal`;function On(e){return Math.max(0,Math.round(performance.now()-e))}const kn=new WeakMap,An=new WeakMap,jn=new WeakMap,X=new WeakMap,Mn=new WeakMap,Z=new WeakMap;function Nn(e){try{if(!ce()||typeof window>`u`||window.parent===window)return;window.parent?.postMessage({type:e},`*`)}catch{}}function Pn(e){return e===`drawer`?`drawer`:`modal`}function Fn(e){return(e||[]).map(e=>({receiverId:e.receiverId,actions:(e.actions||[]).map(e=>a(e)?e:i(e)).map(e=>h(e))}))}async function In(e,t){if(!(!((t?.length||0)>0)||!e))try{return await g(Fn(t))===e?void 0:`INTENT_DIGEST_MISMATCH`}catch{return`UI_DIGEST_VALIDATION_FAILED`}}function Ln(e){e.childElementCount>0?e.classList.add(`seams-portal--visible`):e.classList.remove(`seams-portal--visible`)}function Rn(){let e=[];for(let t of document.querySelectorAll(`.seams-confirmation-surface`))t.parentElement?.closest(`.seams-confirmation-surface`)||e.push(t);return e}function zn(){for(let e of Rn())Mn.get(e)?.callbacks.cancel(),X.get(e)?.dispose(),Z.delete(e),$(e),e.remove();let e=document.getElementById(Y);e&&Ln(e)}function Bn(){let e=document.getElementById(Y);if(!e){e=document.createElement(`div`),e.id=Y,e.classList.add(`seams-portal`);let t=document.body??document.documentElement;t&&t.appendChild(e)}return e}function Vn(e){X.delete(e),Z.delete(e),$(e),e.remove();let t=document.getElementById(Y);t&&Ln(t)}function Hn(){(document.getElementById(Y)?.childElementCount??0)>0||Nn(`WALLET_UI_CLOSED`)}function Un(e,t){let r=t?.chain;if(r!==`near`&&r!==`tempo`&&r!==`evm`)return{};let i=n({chains:e.chains,family:r,chainId:t?.chainId});return i?r===`near`?{nearExplorerUrl:i}:r===`tempo`?{tempoExplorerUrl:i}:{evmExplorerUrl:i}:{}}function Wn(e,t){t&&(e.update(t),Object.hasOwn(t,`model`)&&Q(e.element,e,t.model))}function Q(e,t,n){let r=(Z.get(e)??0)+1;Z.set(e,r),!(!n||!Ee(n))&&import(`./enrichDisplayModelWithAbi-JeAcpa7r.js`).then(i=>{if(Z.get(e)!==r||!e.isConnected||X.get(e)!==t)return;let a=i.enrichDisplayModelWithAbi(n);Z.get(e)===r&&t.setTree(A({model:a}))}).catch(e=>{console.warn(`[ConfirmUI] failed to lazy-load ABI display enrichment`,e)})}function $(e){kn.get(e)?.disconnect(),kn.delete(e),An.get(e)?.dispose(),An.delete(e),jn.delete(e)}function Gn(e,t){switch(e.kind){case`disabled`:return null;case`wallet_iframe`:return c({kind:t.getAttribute(`data-seams-confirm-variant`)===`modal`?`request_scroll_surface`:`request_surface`,element:t,requestId:e.requestId,postMeasurement:e.postMeasurement});default:{let t=e;throw Error(`Unhandled confirmation measurement binding: ${String(t)}`)}}}function Kn(e,t,n){e.setAttribute(Ge,ir(n,t)),e.setAttribute(`data-seams-confirm-variant`,t),e.toggleAttribute(`data-seams-review-frame`,!!r(n))}function qn(e,t,n){if(r(n)?.attach(e),Kn(e,t,n),ie(jn.get(e),n))return;$(e),jn.set(e,n);let i=Gn(n,e);i&&(kn.set(e,i),An.set(e,nt(e)))}function Jn(e,t){t.kind===`review_available`&&e.returnToReview()}var Yn=class{view=null;navigation={kind:`review_available`};queuedDecisions=[];decisionWaiters=[];phase=`pending`;cancelListeners=new Set;onBack;callbacks={confirm:this.confirm.bind(this),cancel:this.cancel.bind(this),submitEmail:this.submitEmail.bind(this)};constructor(e){this.admission=e,this.onBack=e?this.back.bind(this):void 0}attachView(e){this.view=e;let t=this.admission;t?.requiresAuthMethodApproval&&this.prepareAuthMethod(t,e)}async prepareAuthMethod(e,t){this.phase=`preparing`,t.update({preparing:!0,authMethodCapture:e.authMethodApprovalSurface});try{if(await e.prepareAuthMethod(),this.phase!==`preparing`)return;this.phase=`pending`,t.update({preparing:!1,authMethodCapture:null})}catch(e){this.cancel(e instanceof Error?e.message:`VoiceID preparation failed.`)}}publishDecision(e){if(this.phase===`published`)return;this.phase=`published`,this.navigation.kind=`decision_published`;let t=this.decisionWaiters.shift();if(t){t(e);return}this.queuedDecisions.push(e)}back(){this.phase===`preparing`||this.phase===`checking`?this.cancel(`Voice approval was cancelled.`):this.admission&&Jn(this.admission,this.navigation)}cancel(e){if(this.phase!==`published`){this.publishDecision({kind:`cancelled`,error:e??null}),this.admission?.cancel(Error(e??`Wallet approval was cancelled.`));for(let t of this.cancelListeners)t({...e?{error:e}:{}})}}confirm(){this.approve({kind:`confirmed`,emailOtp:{kind:`absent`}})}submitEmail(e,t){let n=e.trim(),r=t.trim();if(!n||!r){this.cancel(`Email OTP challenge is missing.`);return}this.approve({kind:`confirmed`,emailOtp:{kind:`provided`,code:n,challengeId:r}})}async approve(e){if(!(this.phase!==`pending`||this.admission&&!this.admission.allowInteraction())){this.phase=`checking`;try{this.admission?.authMethodApprovalMessages&&this.view?.update({preparing:!0,authMethodCapture:this.admission.authMethodApprovalSurface});let t=await this.admission?.approveAuthMethod();if(t?.kind===`retry`){this.phase=`pending`,this.view?.update({preparing:!1,authMethodCapture:null,authMethodApprovalMessage:t.message});return}this.admission?.authMethodApprovalMessages&&this.view?.update({preparing:!1,authMethodApprovalMessage:this.admission.authMethodApprovalMessages.approved}),this.publishDecision(e)}catch(e){this.cancel(e instanceof Error?e.message:`Authentication method approval failed.`)}}}async takeDecision(){return this.queuedDecisions.shift()||(this.phase===`published`&&(this.phase=`pending`),await new Promise(this.waitForDecision))}waitForDecision=e=>{this.decisionWaiters.push(e)}};function Xn(e,t,n){let r=!1;return{element:e.element,close:i=>{r||(r=!0,i||t.callbacks.cancel(),t.cancelListeners.clear(),!(i&&n.kind===`wallet_iframe`&&v(n.requestId,e))&&($(e.element),e.close()))},update:t=>Wn(e,t),onCancel:e=>(t.cancelListeners.add(e),()=>t.cancelListeners.delete(e)),takeDecision:()=>t.takeDecision()}}async function Zn({ctx:e,summary:t,txSigningRequests:n,model:r,securityContext:i,loading:a,theme:o,appearance:s,uiMode:c,signingAuthMode:l,emailOtpPrompt:u}){return rr({ctx:e,summary:t,txSigningRequests:n,model:r,securityContext:i,loading:a,theme:o,appearance:s,variant:Pn(c),signingAuthMode:l,emailOtpPrompt:u})}function Qn(e){let t=e.surface.handle,n=t.element;if(!n.isConnected)throw Error(`Cannot reuse a detached confirmation surface`);let r=X.get(n);if(!r)throw Error(`Cannot reuse an unmanaged confirmation surface`);qn(n,e.variant,e.ctx.surfaceMeasurementBinding);let i=ae({getAppearance:e.ctx.getAppearance,requestedAppearance:e.appearance,requestedMode:e.theme}),a=Un(e.ctx,e.model);return r.update({model:e.model,securityContext:e.securityContext,loading:e.loading??!1,appearance:i,title:e.summary.title??``,body:e.summary.body??``,signingAuthMode:e.signingAuthMode,emailOtpPrompt:e.emailOtpPrompt,errorMessage:``,...a}),r.setTree(A({txSigningRequests:e.txSigningRequests,model:e.model})),Q(n,r,e.model),{handle:t,reused:!0}}function $n(e){throw Error(`Unhandled confirmation surface: ${JSON.stringify(e)}`)}function er(e){switch(e.surface.kind){case`mount_new`:return{handle:rr({ctx:e.ctx,summary:e.summary,txSigningRequests:e.txSigningRequests,model:e.model,securityContext:e.securityContext,loading:e.loading,theme:e.theme,appearance:e.appearance,variant:e.variant,signingAuthMode:e.signingAuthMode,emailOtpPrompt:e.emailOtpPrompt}),reused:!1};case`reuse_mounted`:return Qn({...e,surface:e.surface});case`preparation_cancelled`:throw Error(`A cancelled preparation surface cannot be mounted`);default:return $n(e.surface)}}async function tr(e){return er({ctx:e.ctx,summary:e.summary,txSigningRequests:e.txSigningRequests,model:e.model,securityContext:e.securityContext,loading:e.loading,theme:e.theme,appearance:e.appearance,variant:Pn(e.uiMode),signingAuthMode:e.signingAuthMode,emailOtpPrompt:e.emailOtpPrompt,surface:e.surface}).handle}async function nr({ctx:e,summary:t,txSigningRequests:n,model:r,securityContext:i,loading:a,theme:o,appearance:s,uiMode:c,onMounted:l,signingAuthMode:u,emailOtpPrompt:d,surface:f}){let p=Pn(c);return new Promise(c=>{let m=performance.now(),{handle:h,reused:g}=er({ctx:e,summary:t,txSigningRequests:n,model:r,securityContext:i,loading:a,theme:o,appearance:s,variant:p,signingAuthMode:u,emailOtpPrompt:d,surface:f}),_=On(m),v=performance.now(),y=0,b=g?_:0,x=0,S=e=>e>0?e:On(v);Promise.resolve().then(()=>{y=S(y),g||(b=S(b))});try{l?.(h)}catch{}let C=e=>{let t={kind:`confirm_ui_prompt_diagnostics_v1`,elementDefineMs:0,mountMs:_,hostFirstUpdateMs:y,hostInteractiveMs:b,confirmEventMs:x,decisionWaitMs:On(v)};T(),c({...e,handle:h,diagnostics:t})},w=async e=>{if(x=S(x),e.kind===`cancelled`){let t=e.error||void 0;h.update({...t?{errorMessage:t}:{},loading:!1}),C({confirmed:!1,error:t});return}let i,a=await In(String(r?.intentDigest||t?.intentDigest||``).trim(),n);if(a&&(i=a),i){h.update({errorMessage:i,loading:!1}),C({confirmed:!1,error:i});return}C({confirmed:!0,...e.emailOtp.kind===`provided`?{otpCode:e.emailOtp.code,emailOtpChallengeId:e.emailOtp.challengeId}:{}})},T=()=>{y=Math.max(y,0)};(async()=>{let e=await h.takeDecision();u===`emailOtp`&&e.kind===`confirmed`&&e.emailOtp.kind===`absent`&&(h.update({loading:!1}),e=await h.takeDecision()),await w(e)})()})}function rr({ctx:e,summary:t,txSigningRequests:n,model:i,securityContext:a,loading:o,theme:s,appearance:c,variant:l,signingAuthMode:u,emailOtpPrompt:d}){r(e.surfaceMeasurementBinding)?.assertPending(),zn();let f=ae({getAppearance:e.getAppearance,requestedAppearance:c,requestedMode:s}),p=Bn(),m=Un(e,i),h=new Yn(r(e.surfaceMeasurementBinding)),g;return g=En({parent:p,variant:l,context:ir(e.surfaceMeasurementBinding,l),appearance:f,presentation:{onBack:h.onBack,model:i,securityContext:a,loading:o,title:t?.title??(t?.delegate?`Sign Delegate Action`:void 0),body:t?.body,confirmText:r(e.surfaceMeasurementBinding)?.authMethodApprovalMessages?.confirm,signingAuthMode:u,emailOtpPrompt:d,nearExplorerUrl:e.nearExplorerUrl??m.nearExplorerUrl,tempoExplorerUrl:e.tempoExplorerUrl??m.tempoExplorerUrl,evmExplorerUrl:e.evmExplorerUrl??m.evmExplorerUrl},tree:A({txSigningRequests:n,model:i}),callbacks:h.callbacks,onClosed:()=>{Vn(g.element),Hn()}}),h.attachView(g),X.set(g.element,g),Mn.set(g.element,h),Ln(p),qn(g.element,l,e.surfaceMeasurementBinding),Q(g.element,g,i),p.classList.remove(`seams-portal--visible`),requestAnimationFrame(()=>{p.classList.add(`seams-portal--visible`)}),Nn(`WALLET_UI_OPENED`),Xn(g,h,e.surfaceMeasurementBinding)}function ir(e,t){let n=e.kind===`wallet_iframe`?e.hostSurfaceVariant??t:t;return e.kind===`wallet_iframe`&&n===`modal`?`wallet-iframe`:`standalone`}export{L as a,ce as c,tr as i,se as l,Dn as n,ke as o,Zn as r,Me as s,nr as t};
|