@seams/wallet 0.17.0 → 0.18.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 +4 -5
- package/dist/.build-inputs.sha256 +1 -1
- package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuFooter.js +5 -4
- package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuSurface.js +89 -241
- package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/mountAuthMenuSurface.js +4 -2
- package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/presentation.js +116 -0
- package/dist/esm/SeamsWeb/walletIframe/host/ui/auth-menu/recovery-code-input.js +60 -0
- package/dist/esm/SeamsWeb/walletIframe/shared/facadeBoundary.js +2 -0
- package/dist/esm/core/config/configBuilder.js +2 -0
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/ConfirmContent.js +7 -4
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/ConfirmHeader.js +10 -6
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/ConfirmationBody.js +9 -6
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/ConfirmationContent.js +9 -6
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/ConfirmationDrawer.js +7 -4
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/ConfirmationModal.js +4 -1
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/EmailOtpContent.js +4 -1
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/EmailOtpInput.js +5 -4
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/PasskeyRegistrationContent.js +10 -7
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/PasskeyRegistrationDetails.js +9 -5
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/RecoveryCodeBackupSurface.js +28 -22
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/ReviewDisclosure.js +2 -1
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/TransactionLabel.js +51 -26
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/TransactionReceipt.js +42 -27
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/TransactionReview.js +25 -18
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/TransactionTree.js +8 -5
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/WalletLocale.js +24 -0
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/mountConfirmationSurface.js +6 -4
- package/dist/esm/core/signingEngine/uiConfirm/ui/preact/mountRecoveryCodeBackupSurface.js +4 -2
- package/dist/esm/core/ui/locale.js +10 -0
- package/dist/esm/core/ui/messages.js +694 -0
- package/dist/esm/index.js +2 -1
- package/dist/esm/react/components/AccountMenuButton/AccountMenuButtonMock.js +7 -3
- package/dist/esm/react/components/AccountMenuButton/AccountMenuButtonView.js +6 -3
- package/dist/esm/react/components/AccountMenuButton/AccountMenuDeviceDetails.js +4 -3
- package/dist/esm/react/components/AccountMenuButton/AccountMenuDialog.js +5 -2
- package/dist/esm/react/components/AccountMenuButton/AccountMenuMockScreens.js +31 -27
- package/dist/esm/react/components/AccountMenuButton/AccountMenuScreen.js +6 -3
- package/dist/esm/react/components/AccountMenuButton/AccountsSection.js +6 -3
- package/dist/esm/react/components/AccountMenuButton/AuthenticationMethodRow.js +5 -4
- package/dist/esm/react/components/AccountMenuButton/AuthenticationMethodsModal.js +33 -27
- package/dist/esm/react/components/AccountMenuButton/AuthenticationMethodsView.js +5 -2
- package/dist/esm/react/components/AccountMenuButton/ExportKeysScreen.js +5 -3
- package/dist/esm/react/components/AccountMenuButton/ExportKeysSection.js +4 -3
- package/dist/esm/react/components/AccountMenuButton/LinkedDevicesModal.js +50 -41
- package/dist/esm/react/components/AccountMenuButton/LockMenuItem.js +2 -1
- package/dist/esm/react/components/AccountMenuButton/MenuItem.js +3 -2
- package/dist/esm/react/components/AccountMenuButton/ProfileDropdown.js +8 -4
- package/dist/esm/react/components/AccountMenuButton/RecoveryCodeAcknowledgement.js +3 -2
- package/dist/esm/react/components/AccountMenuButton/RecoveryCodeActions.js +4 -3
- package/dist/esm/react/components/AccountMenuButton/SegmentedControl.js +2 -1
- package/dist/esm/react/components/AccountMenuButton/TransactionSettingsSection.js +11 -10
- package/dist/esm/react/components/AccountMenuButton/UserAccountButton.js +8 -4
- package/dist/esm/react/components/AccountMenuButton/WalletRegionSection.js +22 -15
- package/dist/esm/react/components/AccountMenuButton/WalletSettingsLayout.js +20 -16
- package/dist/esm/react/components/AccountMenuButton/index.js +18 -15
- package/dist/esm/react/components/HostedSeamsAuthMenu/SeamsAuthMenuMock.js +30 -26
- package/dist/esm/react/components/QRCodeScanner.js +28 -23
- package/dist/esm/react/components/ShowQRCode.js +39 -31
- package/dist/esm/react/components/theme/ThemeProvider.js +3 -0
- package/dist/esm/react/context/WalletLocale.js +15 -0
- package/dist/esm/react/context/index.js +8 -3
- package/dist/esm/sdk/ConfirmationDrawer-mu3iThxX.js +1 -0
- package/dist/{public/sdk/NonceCoordinator-DuDKN-B8.js → esm/sdk/NonceCoordinator-Dq-FZpBz.js} +1 -1
- package/dist/{public/sdk/accountLifecycle-D61FIpFS.js → esm/sdk/accountLifecycle-fLNUdjct.js} +1 -1
- package/dist/{public/sdk/activeWalletSession-Ba6X4CUN.js → esm/sdk/activeWalletSession-BpbnpU9s.js} +1 -1
- package/dist/esm/sdk/adapters-u7LVXthY.js +2 -0
- package/dist/esm/sdk/appearance-token-vars-CzBVbO39.js +2 -0
- package/dist/esm/sdk/{canonicalPrimitives-BOzRXzfv.js → canonicalPrimitives-BMP5yILS.js} +1 -1
- package/dist/esm/sdk/{challengeDelivery-FD9GHK1T.js → challengeDelivery-CG2J5Qxs.js} +1 -1
- package/dist/{public/sdk/clientSessionPersistenceState-BHRUSWMt.js → esm/sdk/clientSessionPersistenceState-BgO4P6CZ.js} +1 -1
- package/dist/esm/sdk/{commitQueue-DOIaR0Hr.js → commitQueue-BW7BpYyA.js} +1 -1
- package/dist/esm/sdk/configBuilder-BMNShuOu.js +1 -0
- package/dist/esm/sdk/{configHelpers-BXdl5Mxs.js → configHelpers-D50F_Txb.js} +1 -1
- package/dist/esm/sdk/{digestEncoding-CbEFYvlJ.js → digestEncoding-aC4dSf_x.js} +1 -1
- package/dist/esm/sdk/{display-CY_aJEn6.js → display-WtILOPQR.js} +1 -1
- package/dist/{public/sdk/ecdsaCapabilityManifest-DzA996y9.js → esm/sdk/ecdsaCapabilityManifest-DRc423SV.js} +1 -1
- package/dist/{public/sdk/ecdsaDerivationClientWasm-DQlajPpE.js → esm/sdk/ecdsaDerivationClientWasm-DmwKWUEb.js} +1 -1
- package/dist/{public/sdk/ecdsaDerivationExport-DyugdheE.js → esm/sdk/ecdsaDerivationExport-DX89rq_u.js} +1 -1
- package/dist/esm/sdk/{ecdsaWalletRecords-C_v74n5X.js → ecdsaWalletRecords-CxxUt3fS.js} +1 -1
- package/dist/{public/sdk/emailOtpEcdsaDerivationIdentity-BDVjvnmO.js → esm/sdk/emailOtpEcdsaDerivationIdentity-CupWCKNg.js} +1 -1
- package/dist/esm/sdk/{export-viewer-host-DsRaS0UH.js → export-viewer-host-ivf9LlBo.js} +1 -1
- package/dist/{public/sdk/exportKeypairOperation-SJPysnE1.js → esm/sdk/exportKeypairOperation-Gw7L5Htj.js} +1 -1
- package/dist/esm/sdk/{helpers-D3CUEdHI.js → helpers-DS0bksx9.js} +1 -1
- package/dist/esm/sdk/{host-GPb_mSAQ.js → host-B-2QXolt.js} +1 -1
- package/dist/esm/sdk/{intentDigest-CGLrsMgj.js → intentDigest-Rh5Mg8X7.js} +1 -1
- package/dist/esm/sdk/{lanes-DJKIHJBm.js → lanes-BzU7cv2T.js} +1 -1
- package/dist/esm/sdk/localOnly-BKpUHtHa.js +1 -0
- package/dist/esm/sdk/mountExportPrivateKeySurface-C8pUK6PQ.js +1 -0
- package/dist/esm/sdk/mountRecoveryCodeBackupSurface-DUudF89t.js +2 -0
- package/dist/{public/sdk/nearEd25519YaoMaterialActivation-J6EHFScV.js → esm/sdk/nearEd25519YaoMaterialActivation-DgWDGRI_.js} +1 -1
- package/dist/{public/sdk/nearEd25519YaoSigningPreparation-CqBNMG87.js → esm/sdk/nearEd25519YaoSigningPreparation-yKDLQXBS.js} +1 -1
- package/dist/esm/sdk/{nonceLaneKeys-D18nlLjh.js → nonceLaneKeys-BzMBVxMU.js} +1 -1
- package/dist/esm/sdk/{operationFingerprint-Boa9DQ51.js → operationFingerprint-C4VX-0NI.js} +1 -1
- package/dist/{public/sdk/passkey-custody-CBSal3E9.js → esm/sdk/passkey-custody-Ba-NQ_4C.js} +1 -1
- package/dist/esm/sdk/{pendingWalletRecoveryCodeBackup-CvsrXbzn.js → pendingWalletRecoveryCodeBackup-7tBjuSe7.js} +1 -1
- package/dist/{public/sdk/presignaturePool-CQNt13kE.js → esm/sdk/presignaturePool-BHoxnbOA.js} +1 -1
- package/dist/esm/sdk/{prfCache-DJ93rtDv.js → prfCache-BAFh1skJ.js} +1 -1
- package/dist/esm/sdk/{primitives-cC0a9GRC.js → primitives-CTmDwMNc.js} +1 -1
- package/dist/esm/sdk/{recovery-entrypoint-nj7Zo3CR.js → recovery-entrypoint-DWghFZrZ.js} +1 -1
- package/dist/esm/sdk/{registration-49OGU_GZ.js → registration-CWpOVwhj.js} +1 -1
- package/dist/esm/sdk/{registration-C7tywPXF.js → registration-D2OEgY7O.js} +1 -1
- package/dist/esm/sdk/{registrationAccounts-9GFI0Ger.js → registrationAccounts-CD1u1ZqZ.js} +1 -1
- package/dist/esm/sdk/{registrationIds-Br-zI4_5.js → registrationIds-B1OpqRAt.js} +1 -1
- package/dist/{public/sdk/registrationIntent-PqmcTEE3.js → esm/sdk/registrationIntent-D4YDjf2U.js} +1 -1
- package/dist/esm/sdk/{requireStepUpAuth-C4PGTly-.js → requireStepUpAuth-CnSCFSOZ.js} +1 -1
- package/dist/{public/sdk/routerAbNormalSigning-xxATTIh5.js → esm/sdk/routerAbNormalSigning-BV1t27aB.js} +1 -1
- package/dist/esm/sdk/runtime-auth-jtyQAuxZ.js +1 -0
- package/dist/esm/sdk/runtime-device-link-vhRhB-wS.js +1 -0
- package/dist/esm/sdk/runtime-ecdsa-tempo-BXWgFVBa.js +1 -0
- package/dist/esm/sdk/runtime-email-otp-BlAaSKtk.js +1 -0
- package/dist/esm/sdk/runtime-export-B4FuHhcH.js +1 -0
- package/dist/esm/sdk/runtime-near-BnWOpEpA.js +1 -0
- package/dist/esm/sdk/runtime-preferences-COm-LTiu.js +1 -0
- package/dist/esm/sdk/runtime-recovery-BJTo5Idi.js +1 -0
- package/dist/esm/sdk/{runtime-recovery-codes-LR4mg7-k.js → runtime-recovery-codes-CEOjdUHV.js} +1 -1
- package/dist/esm/sdk/{secp256k1-BldUPNQI.js → secp256k1-wOOHtPcK.js} +1 -1
- package/dist/esm/sdk/{secureRandomId-LwBFx84B.js → secureRandomId-8LSc91aN.js} +1 -1
- package/dist/esm/sdk/sessionObservationRevision-C7v-wN8_.js +1 -0
- package/dist/esm/sdk/shared-BKPGtAps.js +6 -0
- package/dist/esm/sdk/{signEvmFamily-C_RvEnDB.js → signEvmFamily-DT34Vtpa.js} +1 -1
- package/dist/esm/sdk/{signEvmFamilyWithUiConfirmForTempo-CUKdq5dE.js → signEvmFamilyWithUiConfirmForTempo-NYCFU6Li.js} +1 -1
- package/dist/esm/sdk/{signEvmWithUiConfirm-CxXzcvj2.js → signEvmWithUiConfirm-D6nmJr_L.js} +1 -1
- package/dist/{public/sdk/signNear-Dno7NsP_.js → esm/sdk/signNear-B000QxBd.js} +1 -1
- package/dist/{public/sdk/signingFlow-DtugI_2z.js → esm/sdk/signingFlow-gl85GOW4.js} +1 -1
- package/dist/esm/sdk/{signingQueue-C1Pb07gm.js → signingQueue-gW7wmOuL.js} +1 -1
- package/dist/esm/sdk/{singletons-DxIyVhNb.js → singletons-CAsc9LvA.js} +1 -1
- package/dist/{public/sdk/thresholdEcdsa-murTq-xz.js → esm/sdk/thresholdEcdsa-Ci7yz395.js} +1 -1
- package/dist/{public/sdk/transactionState-XbZm9Zon.js → esm/sdk/transactionState-lB2qpkOm.js} +1 -1
- package/dist/esm/sdk/tx-confirm-ui.js +1795 -432
- 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-CVUalZ3p.js → wallet-recovery-DFaS3geI.js} +1 -1
- package/dist/{public/sdk/walletAuthMethodRecord-Bv68Vq-g.js → esm/sdk/walletAuthMethodRecord-CWdqdY_s.js} +1 -1
- package/dist/{public/sdk/walletAuthority-v5wvv3IB.js → esm/sdk/walletAuthority-BY3kyKQ-.js} +1 -1
- package/dist/{public/sdk/walletCustodyEcdsaContinuity-rRHExT_R.js → esm/sdk/walletCustodyEcdsaContinuity-mGh1Ysko.js} +1 -1
- package/dist/esm/sdk/{walletDbName-DRzPv5Ir.js → walletDbName-BxWApBQF.js} +1 -1
- package/dist/{public/sdk/walletOwnershipGeneration-pMmmJ6XA.js → esm/sdk/walletOwnershipGeneration-DSGfjuV2.js} +1 -1
- package/dist/esm/sdk/{walletRecoveryCommit-DvC6WlGz.js → walletRecoveryCommit-DQA_wveK.js} +1 -1
- package/dist/esm/sdk/{walletRecoveryRotate-Dd3prJpr.js → walletRecoveryRotate-zvQThn37.js} +1 -1
- package/dist/esm/sdk/walletRegistrationSetupPrewarm-DdVpKccU.js +1 -0
- package/dist/{public/sdk/walletSessionAuthorizationStatus-DVV3xkAx.js → esm/sdk/walletSessionAuthorizationStatus-ONPRiEbK.js} +1 -1
- package/dist/{public/sdk/walletSessionAuthorizationStore-D-MhJ0PC.js → esm/sdk/walletSessionAuthorizationStore-DnUMtkev.js} +1 -1
- package/dist/esm/sdk/warmSessionHydration-D8Vdro9n.js +1 -0
- package/dist/{public/sdk/webauthnP256-XgYu-Y6E.js → esm/sdk/webauthnP256-_ajaNl90.js} +1 -1
- package/dist/esm/sdk/{webauthnPromptCoordinator-D5sP8Q7e.js → webauthnPromptCoordinator-9bVeHcTZ.js} +1 -1
- package/dist/public/headers.manifest.json +1 -1
- package/dist/public/sdk/ConfirmationDrawer-mu3iThxX.js +1 -0
- package/dist/{esm/sdk/NonceCoordinator-DuDKN-B8.js → public/sdk/NonceCoordinator-Dq-FZpBz.js} +1 -1
- package/dist/{esm/sdk/accountLifecycle-D61FIpFS.js → public/sdk/accountLifecycle-fLNUdjct.js} +1 -1
- package/dist/{esm/sdk/activeWalletSession-Ba6X4CUN.js → public/sdk/activeWalletSession-BpbnpU9s.js} +1 -1
- package/dist/public/sdk/adapters-u7LVXthY.js +2 -0
- package/dist/public/sdk/appearance-token-vars-CzBVbO39.js +2 -0
- package/dist/public/sdk/{canonicalPrimitives-BOzRXzfv.js → canonicalPrimitives-BMP5yILS.js} +1 -1
- package/dist/public/sdk/{challengeDelivery-FD9GHK1T.js → challengeDelivery-CG2J5Qxs.js} +1 -1
- package/dist/{esm/sdk/clientSessionPersistenceState-BHRUSWMt.js → public/sdk/clientSessionPersistenceState-BgO4P6CZ.js} +1 -1
- package/dist/public/sdk/{commitQueue-DOIaR0Hr.js → commitQueue-BW7BpYyA.js} +1 -1
- package/dist/public/sdk/configBuilder-BMNShuOu.js +1 -0
- package/dist/public/sdk/{configHelpers-BXdl5Mxs.js → configHelpers-D50F_Txb.js} +1 -1
- package/dist/public/sdk/{digestEncoding-CbEFYvlJ.js → digestEncoding-aC4dSf_x.js} +1 -1
- package/dist/public/sdk/{display-CY_aJEn6.js → display-WtILOPQR.js} +1 -1
- package/dist/{esm/sdk/ecdsaCapabilityManifest-DzA996y9.js → public/sdk/ecdsaCapabilityManifest-DRc423SV.js} +1 -1
- package/dist/{esm/sdk/ecdsaDerivationClientWasm-DQlajPpE.js → public/sdk/ecdsaDerivationClientWasm-DmwKWUEb.js} +1 -1
- package/dist/{esm/sdk/ecdsaDerivationExport-DyugdheE.js → public/sdk/ecdsaDerivationExport-DX89rq_u.js} +1 -1
- package/dist/public/sdk/{ecdsaWalletRecords-C_v74n5X.js → ecdsaWalletRecords-CxxUt3fS.js} +1 -1
- package/dist/{esm/sdk/emailOtpEcdsaDerivationIdentity-BDVjvnmO.js → public/sdk/emailOtpEcdsaDerivationIdentity-CupWCKNg.js} +1 -1
- package/dist/public/sdk/{export-viewer-host-DsRaS0UH.js → export-viewer-host-ivf9LlBo.js} +1 -1
- package/dist/{esm/sdk/exportKeypairOperation-SJPysnE1.js → public/sdk/exportKeypairOperation-Gw7L5Htj.js} +1 -1
- package/dist/public/sdk/{helpers-D3CUEdHI.js → helpers-DS0bksx9.js} +1 -1
- package/dist/public/sdk/{host-GPb_mSAQ.js → host-B-2QXolt.js} +1 -1
- package/dist/public/sdk/{intentDigest-CGLrsMgj.js → intentDigest-Rh5Mg8X7.js} +1 -1
- package/dist/public/sdk/{lanes-DJKIHJBm.js → lanes-BzU7cv2T.js} +1 -1
- package/dist/public/sdk/localOnly-BKpUHtHa.js +1 -0
- package/dist/public/sdk/mountExportPrivateKeySurface-C8pUK6PQ.js +1 -0
- package/dist/public/sdk/mountRecoveryCodeBackupSurface-DUudF89t.js +2 -0
- package/dist/{esm/sdk/nearEd25519YaoMaterialActivation-J6EHFScV.js → public/sdk/nearEd25519YaoMaterialActivation-DgWDGRI_.js} +1 -1
- package/dist/{esm/sdk/nearEd25519YaoSigningPreparation-CqBNMG87.js → public/sdk/nearEd25519YaoSigningPreparation-yKDLQXBS.js} +1 -1
- package/dist/public/sdk/{nonceLaneKeys-D18nlLjh.js → nonceLaneKeys-BzMBVxMU.js} +1 -1
- package/dist/public/sdk/{operationFingerprint-Boa9DQ51.js → operationFingerprint-C4VX-0NI.js} +1 -1
- package/dist/{esm/sdk/passkey-custody-CBSal3E9.js → public/sdk/passkey-custody-Ba-NQ_4C.js} +1 -1
- package/dist/public/sdk/{pendingWalletRecoveryCodeBackup-CvsrXbzn.js → pendingWalletRecoveryCodeBackup-7tBjuSe7.js} +1 -1
- package/dist/{esm/sdk/presignaturePool-CQNt13kE.js → public/sdk/presignaturePool-BHoxnbOA.js} +1 -1
- package/dist/public/sdk/{prfCache-DJ93rtDv.js → prfCache-BAFh1skJ.js} +1 -1
- package/dist/public/sdk/{primitives-cC0a9GRC.js → primitives-CTmDwMNc.js} +1 -1
- package/dist/public/sdk/{recovery-entrypoint-nj7Zo3CR.js → recovery-entrypoint-DWghFZrZ.js} +1 -1
- package/dist/public/sdk/{registration-49OGU_GZ.js → registration-CWpOVwhj.js} +1 -1
- package/dist/public/sdk/{registration-C7tywPXF.js → registration-D2OEgY7O.js} +1 -1
- package/dist/public/sdk/{registrationAccounts-9GFI0Ger.js → registrationAccounts-CD1u1ZqZ.js} +1 -1
- package/dist/public/sdk/{registrationIds-Br-zI4_5.js → registrationIds-B1OpqRAt.js} +1 -1
- package/dist/{esm/sdk/registrationIntent-PqmcTEE3.js → public/sdk/registrationIntent-D4YDjf2U.js} +1 -1
- package/dist/public/sdk/{requireStepUpAuth-C4PGTly-.js → requireStepUpAuth-CnSCFSOZ.js} +1 -1
- package/dist/{esm/sdk/routerAbNormalSigning-xxATTIh5.js → public/sdk/routerAbNormalSigning-BV1t27aB.js} +1 -1
- package/dist/public/sdk/runtime-auth-jtyQAuxZ.js +1 -0
- package/dist/public/sdk/runtime-device-link-vhRhB-wS.js +1 -0
- package/dist/public/sdk/runtime-ecdsa-tempo-BXWgFVBa.js +1 -0
- package/dist/public/sdk/runtime-email-otp-BlAaSKtk.js +1 -0
- package/dist/public/sdk/runtime-export-B4FuHhcH.js +1 -0
- package/dist/public/sdk/runtime-near-BnWOpEpA.js +1 -0
- package/dist/public/sdk/runtime-preferences-COm-LTiu.js +1 -0
- package/dist/public/sdk/runtime-recovery-BJTo5Idi.js +1 -0
- package/dist/public/sdk/{runtime-recovery-codes-LR4mg7-k.js → runtime-recovery-codes-CEOjdUHV.js} +1 -1
- package/dist/public/sdk/{secp256k1-BldUPNQI.js → secp256k1-wOOHtPcK.js} +1 -1
- package/dist/public/sdk/{secureRandomId-LwBFx84B.js → secureRandomId-8LSc91aN.js} +1 -1
- package/dist/public/sdk/sessionObservationRevision-C7v-wN8_.js +1 -0
- package/dist/public/sdk/shared-BKPGtAps.js +6 -0
- package/dist/public/sdk/{signEvmFamily-C_RvEnDB.js → signEvmFamily-DT34Vtpa.js} +1 -1
- package/dist/public/sdk/{signEvmFamilyWithUiConfirmForTempo-CUKdq5dE.js → signEvmFamilyWithUiConfirmForTempo-NYCFU6Li.js} +1 -1
- package/dist/public/sdk/{signEvmWithUiConfirm-CxXzcvj2.js → signEvmWithUiConfirm-D6nmJr_L.js} +1 -1
- package/dist/{esm/sdk/signNear-Dno7NsP_.js → public/sdk/signNear-B000QxBd.js} +1 -1
- package/dist/{esm/sdk/signingFlow-DtugI_2z.js → public/sdk/signingFlow-gl85GOW4.js} +1 -1
- package/dist/public/sdk/{signingQueue-C1Pb07gm.js → signingQueue-gW7wmOuL.js} +1 -1
- package/dist/public/sdk/{singletons-DxIyVhNb.js → singletons-CAsc9LvA.js} +1 -1
- package/dist/{esm/sdk/thresholdEcdsa-murTq-xz.js → public/sdk/thresholdEcdsa-Ci7yz395.js} +1 -1
- package/dist/{esm/sdk/transactionState-XbZm9Zon.js → public/sdk/transactionState-lB2qpkOm.js} +1 -1
- package/dist/public/sdk/tx-confirm-ui.js +1795 -432
- 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-CVUalZ3p.js → wallet-recovery-DFaS3geI.js} +1 -1
- package/dist/{esm/sdk/walletAuthMethodRecord-Bv68Vq-g.js → public/sdk/walletAuthMethodRecord-CWdqdY_s.js} +1 -1
- package/dist/{esm/sdk/walletAuthority-v5wvv3IB.js → public/sdk/walletAuthority-BY3kyKQ-.js} +1 -1
- package/dist/{esm/sdk/walletCustodyEcdsaContinuity-rRHExT_R.js → public/sdk/walletCustodyEcdsaContinuity-mGh1Ysko.js} +1 -1
- package/dist/public/sdk/{walletDbName-DRzPv5Ir.js → walletDbName-BxWApBQF.js} +1 -1
- package/dist/{esm/sdk/walletOwnershipGeneration-pMmmJ6XA.js → public/sdk/walletOwnershipGeneration-DSGfjuV2.js} +1 -1
- package/dist/public/sdk/{walletRecoveryCommit-DvC6WlGz.js → walletRecoveryCommit-DQA_wveK.js} +1 -1
- package/dist/public/sdk/{walletRecoveryRotate-Dd3prJpr.js → walletRecoveryRotate-zvQThn37.js} +1 -1
- package/dist/public/sdk/walletRegistrationSetupPrewarm-DdVpKccU.js +1 -0
- package/dist/{esm/sdk/walletSessionAuthorizationStatus-DVV3xkAx.js → public/sdk/walletSessionAuthorizationStatus-ONPRiEbK.js} +1 -1
- package/dist/{esm/sdk/walletSessionAuthorizationStore-D-MhJ0PC.js → public/sdk/walletSessionAuthorizationStore-DnUMtkev.js} +1 -1
- package/dist/public/sdk/warmSessionHydration-D8Vdro9n.js +1 -0
- package/dist/{esm/sdk/webauthnP256-XgYu-Y6E.js → public/sdk/webauthnP256-_ajaNl90.js} +1 -1
- package/dist/public/sdk/{webauthnPromptCoordinator-D5sP8Q7e.js → webauthnPromptCoordinator-9bVeHcTZ.js} +1 -1
- package/dist/public/wallet-assets.manifest.json +192 -192
- package/dist/public/wallet-service/index.html +4 -4
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuFooter.d.ts +0 -1
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ui/auth-menu/AuthMenuSurface.d.ts +4 -6
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ui/auth-menu/presentation.d.ts +35 -0
- package/dist/types/wallet/src/SeamsWeb/walletIframe/host/ui/auth-menu/recovery-code-input.d.ts +17 -0
- package/dist/types/wallet/src/core/signingEngine/uiConfirm/ui/preact/ConfirmContent.d.ts +3 -1
- package/dist/types/wallet/src/core/signingEngine/uiConfirm/ui/preact/ConfirmHeader.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/uiConfirm/ui/preact/ConfirmationBody.d.ts +3 -1
- package/dist/types/wallet/src/core/signingEngine/uiConfirm/ui/preact/ConfirmationContent.d.ts +3 -1
- package/dist/types/wallet/src/core/signingEngine/uiConfirm/ui/preact/ConfirmationDrawer.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/uiConfirm/ui/preact/ConfirmationModal.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/uiConfirm/ui/preact/EmailOtpInput.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/uiConfirm/ui/preact/ExportPrivateKeySurface.d.ts +1 -1
- package/dist/types/wallet/src/core/signingEngine/uiConfirm/ui/preact/PasskeyRegistrationContent.d.ts +3 -1
- package/dist/types/wallet/src/core/signingEngine/uiConfirm/ui/preact/PasskeyRegistrationDetails.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/uiConfirm/ui/preact/RecoveryCodeBackupSurface.d.ts +3 -1
- package/dist/types/wallet/src/core/signingEngine/uiConfirm/ui/preact/ReviewDisclosure.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/uiConfirm/ui/preact/TransactionLabel.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/uiConfirm/ui/preact/TransactionReceipt.d.ts +3 -1
- package/dist/types/wallet/src/core/signingEngine/uiConfirm/ui/preact/TransactionReview.d.ts +3 -1
- package/dist/types/wallet/src/core/signingEngine/uiConfirm/ui/preact/TransactionTree.d.ts +0 -1
- package/dist/types/wallet/src/core/signingEngine/uiConfirm/ui/preact/WalletLocale.d.ts +18 -0
- package/dist/types/wallet/src/core/types/seams.d.ts +3 -0
- package/dist/types/wallet/src/core/ui/locale.d.ts +5 -0
- package/dist/types/wallet/src/core/ui/messages.d.ts +8 -0
- package/dist/types/wallet/src/index.d.ts +3 -1
- package/dist/types/wallet/src/react/components/AccountMenuButton/AccountMenuButtonMock.d.ts +1 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/WalletRegionSection.d.ts +3 -0
- package/dist/types/wallet/src/react/components/AccountMenuButton/WalletSettingsLayout.d.ts +4 -1
- package/dist/types/wallet/src/react/components/HostedSeamsAuthMenu/SeamsAuthMenuMock.d.ts +2 -1
- package/dist/types/wallet/src/react/context/WalletLocale.d.ts +16 -0
- package/package.json +1 -1
- package/dist/esm/sdk/ConfirmationDrawer-CXVNmfTy.js +0 -1
- package/dist/esm/sdk/adapters-CTlDBRJy.js +0 -2
- package/dist/esm/sdk/configBuilder-BMawmNpz.js +0 -1
- package/dist/esm/sdk/jsxRuntime.module-DKsgiFjd.js +0 -2
- package/dist/esm/sdk/localOnly-CPmpw381.js +0 -1
- package/dist/esm/sdk/mountExportPrivateKeySurface-C8_tpDHF.js +0 -1
- package/dist/esm/sdk/mountRecoveryCodeBackupSurface-BtNFtmSj.js +0 -2
- package/dist/esm/sdk/runtime-auth-CpjGW90U.js +0 -1
- package/dist/esm/sdk/runtime-device-link-CKgfGi7D.js +0 -1
- package/dist/esm/sdk/runtime-ecdsa-tempo-5VV9xSEh.js +0 -1
- package/dist/esm/sdk/runtime-email-otp-D1hYZNn6.js +0 -1
- package/dist/esm/sdk/runtime-export-B92wQD25.js +0 -1
- package/dist/esm/sdk/runtime-near-CUuKg38M.js +0 -1
- package/dist/esm/sdk/runtime-preferences-EdL3G_MO.js +0 -1
- package/dist/esm/sdk/runtime-recovery-uyw8sywI.js +0 -1
- package/dist/esm/sdk/sessionObservationRevision-DmmNV25w.js +0 -1
- package/dist/esm/sdk/shared-ha31XIdc.js +0 -6
- package/dist/esm/sdk/walletRegistrationSetupPrewarm-DcbhVNMQ.js +0 -1
- package/dist/esm/sdk/warmSessionHydration-CsQpQVuy.js +0 -1
- package/dist/public/sdk/ConfirmationDrawer-CXVNmfTy.js +0 -1
- package/dist/public/sdk/adapters-CTlDBRJy.js +0 -2
- package/dist/public/sdk/configBuilder-BMawmNpz.js +0 -1
- package/dist/public/sdk/jsxRuntime.module-DKsgiFjd.js +0 -2
- package/dist/public/sdk/localOnly-CPmpw381.js +0 -1
- package/dist/public/sdk/mountExportPrivateKeySurface-C8_tpDHF.js +0 -1
- package/dist/public/sdk/mountRecoveryCodeBackupSurface-BtNFtmSj.js +0 -2
- package/dist/public/sdk/runtime-auth-CpjGW90U.js +0 -1
- package/dist/public/sdk/runtime-device-link-CKgfGi7D.js +0 -1
- package/dist/public/sdk/runtime-ecdsa-tempo-5VV9xSEh.js +0 -1
- package/dist/public/sdk/runtime-email-otp-D1hYZNn6.js +0 -1
- package/dist/public/sdk/runtime-export-B92wQD25.js +0 -1
- package/dist/public/sdk/runtime-near-CUuKg38M.js +0 -1
- package/dist/public/sdk/runtime-preferences-EdL3G_MO.js +0 -1
- package/dist/public/sdk/runtime-recovery-uyw8sywI.js +0 -1
- package/dist/public/sdk/sessionObservationRevision-DmmNV25w.js +0 -1
- package/dist/public/sdk/shared-ha31XIdc.js +0 -6
- package/dist/public/sdk/walletRegistrationSetupPrewarm-DcbhVNMQ.js +0 -1
- package/dist/public/sdk/warmSessionHydration-CsQpQVuy.js +0 -1
- /package/dist/esm/sdk/{base64-DW79QA0h.js → base64-BmKR3UqU.js} +0 -0
- /package/dist/esm/sdk/{signingSessionSeal-DX41aXUL.js → signingSessionSeal-DqbjG8c8.js} +0 -0
- /package/dist/esm/sdk/{theme-BKaFqCAj.js → theme-os0Salmo.js} +0 -0
- /package/dist/public/sdk/{base64-DW79QA0h.js → base64-BmKR3UqU.js} +0 -0
- /package/dist/public/sdk/{signingSessionSeal-DX41aXUL.js → signingSessionSeal-DqbjG8c8.js} +0 -0
- /package/dist/public/sdk/{theme-BKaFqCAj.js → theme-os0Salmo.js} +0 -0
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h={},g=[],_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,v=Array.isArray;function y(e,t){for(var n in t)e[n]=t[n];return e}function b(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function x(t,n,r){var i,a,o,s={};for(o in n)o==`key`?i=n[o]:o==`ref`?a=n[o]:s[o]=n[o];if(arguments.length>2&&(s.children=arguments.length>3?e.call(arguments,2):r),typeof t==`function`&&t.defaultProps!=null)for(o in t.defaultProps)s[o]===void 0&&(s[o]=t.defaultProps[o]);return S(t,s,i,a,null)}function S(e,r,i,a,o){var s={type:e,props:r,key:i,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++n,__i:-1,__u:0};return o==null&&t.vnode!=null&&t.vnode(s),s}function C(){return{current:null}}function w(e){return e.children}function T(e,t){this.props=e,this.context=t}function E(e,t){if(t==null)return e.__?E(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if((n=e.__k[t])!=null&&n.__e!=null)return n.__e;return typeof e.type==`function`?E(e):null}function D(e){if(e.__P&&e.__d){var n=e.__v,r=n.__e,i=[],a=[],o=y({},n);o.__v=n.__v+1,t.vnode&&t.vnode(o),L(e.__P,o,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,i,r??E(n),!!(32&n.__u),a),o.__v=n.__v,o.__.__k[o.__i]=o,z(i,o,a),n.__e=n.__=null,o.__e!=r&&O(o)}}function O(e){if((e=e.__)!=null&&e.__c!=null)return e.__e=e.__c.base=null,e.__k.some(function(t){if(t!=null&&t.__e!=null)return e.__e=e.__c.base=t.__e}),O(e)}function k(e){(!e.__d&&(e.__d=!0)&&r.push(e)&&!A.__r++||i!=t.debounceRendering)&&((i=t.debounceRendering)||a)(A)}function A(){try{for(var e,t=1;r.length;)r.length>t&&r.sort(o),e=r.shift(),t=r.length,D(e)}finally{r.length=A.__r=0}}function j(e,t,n,r,i,a,o,s,c,l,u){var d,f,p,m,_,v,y=r&&r.__k||g,b=t.length;for(c=M(n,t,y,c,b),d=0;d<b;d++)(p=n.__k[d])!=null&&(f=p.__i!=-1&&y[p.__i]||h,p.__i=d,v=L(e,p,f,i,a,o,s,c,l,u),m=p.__e,p.ref&&f.ref!=p.ref&&(f.ref&&V(f.ref,null,p),u.push(p.ref,p.__c||m,p)),_==null&&m!=null&&(_=m),4&p.__u?(c=N(p,c,e),f.__e&&=null):typeof p.type==`function`&&v!==void 0?c=v:m&&(c=m.nextSibling),p.__u&=-7);return n.__e=_,c}function M(e,t,n,r,i){var a,o,s,c,l,u=n.length,d=u,f=0;for(e.__k=Array(i),a=0;a<i;a++)(o=t[a])!=null&&typeof o!=`boolean`&&typeof o!=`function`?(typeof o==`string`||typeof o==`number`||typeof o==`bigint`||o.constructor==String?o=e.__k[a]=S(null,o,null,null,null):v(o)?o=e.__k[a]=S(w,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=e.__k[a]=S(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):e.__k[a]=o,c=a+f,o.__=e,o.__b=e.__b+1,s=null,(l=o.__i=P(o,n,c,d))!=-1&&(d--,(s=n[l])&&(s.__u|=2)),s==null||s.__v==null?(l==-1&&(i>u?f--:i<u&&f++),typeof o.type!=`function`&&(o.__u|=4)):l!=c&&(l==c-1?f--:l==c+1?f++:(l>c?f--:f++,o.__u|=4))):e.__k[a]=null;if(d)for(a=0;a<u;a++)(s=n[a])!=null&&!(2&s.__u)&&(s.__e==r&&(r=E(s)),ne(s,s));return r}function N(e,t,n){var r,i;if(typeof e.type==`function`){for(r=e.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=e,t=N(r[i],t,n));return t}e.__e!=t&&(t&&e.type&&!t.parentNode&&(t=E(e)),t=n.insertBefore(e.__e,t||null));do t&&=t.nextSibling;while(t!=null&&t.nodeType==8);return t}function P(e,t,n,r){var i,a,o,s=e.key,c=e.type,l=t[n],u=l!=null&&(2&l.__u)==0;if(l===null&&s==null||u&&s==l.key&&c==l.type)return n;if(r>(u?1:0)){for(i=n-1,a=n+1;i>=0||a<t.length;)if((l=t[o=i>=0?i--:a++])!=null&&!(2&l.__u)&&s==l.key&&c==l.type)return o}return-1}function F(e,t,n){t[0]==`-`?e.setProperty(t,n??``):e[t]=n==null?``:typeof n!=`number`||_.test(t)?n:n+`px`}function I(e,t,n,r,i){var a,o;n:if(t==`style`)if(typeof n==`string`)e.style.cssText=n;else{if(typeof r==`string`&&(e.style.cssText=r=``),r)for(t in r)n&&t in n||F(e.style,t,``);if(n)for(t in n)r&&n[t]==r[t]||F(e.style,t,n[t])}else if(t[0]==`o`&&t[1]==`n`)a=t!=(t=t.replace(u,`$1`)),o=t.toLowerCase(),t=o in e||t==`onFocusOut`||t==`onFocusIn`?o.slice(2):t.slice(2),e.l||={},e.l[t+a]=n,n?r?n[l]=r[l]:(n[l]=d,e.addEventListener(t,a?p:f,a)):e.removeEventListener(t,a?p:f,a);else{if(i==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in e)try{e[t]=n??``;break n}catch{}typeof n==`function`||(n==null||!1===n&&t[4]!=`-`?e.removeAttribute(t):e.setAttribute(t,t==`popover`&&n==1?``:n))}}function ee(e){return function(n){if(this.l){var r=this.l[n.type+e];if(n[c]==null)n[c]=d++;else if(n[c]<r[l])return;return r(t.event?t.event(n):n)}}}function L(e,n,r,i,a,o,s,c,l,u){var d,f,p,m,h,_,x,S,C,D,O,k,A,M,N,P,F=n.type;if(n.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[c=n.__e=r.__e]),(d=t.__b)&&d(n);n:if(typeof F==`function`){f=s.length;try{if(C=n.props,D=F.prototype&&F.prototype.render,O=(d=F.contextType)&&i[d.__c],k=d?O?O.props.value:d.__:i,r.__c?S=(p=n.__c=r.__c).__=p.__E:(D?n.__c=p=new F(C,k):(n.__c=p=new T(C,k),p.constructor=F,p.render=re),O&&O.sub(p),p.state||={},p.__n=i,m=p.__d=!0,p.__h=[],p._sb=[]),D&&p.__s==null&&(p.__s=p.state),D&&F.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=y({},p.__s)),y(p.__s,F.getDerivedStateFromProps(C,p.__s))),h=p.props,_=p.state,p.__v=n,m)D&&F.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),D&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(D&&F.getDerivedStateFromProps==null&&C!==h&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(C,k),n.__v==r.__v||!p.__e&&p.shouldComponentUpdate!=null&&!1===p.shouldComponentUpdate(C,p.__s,k)){n.__v!=r.__v&&(p.props=C,p.state=p.__s,p.__d=!1),n.__e=r.__e,n.__k=r.__k,n.__k.some(function(e){e&&(e.__=n)}),g.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&s.push(p),c=E(r);break n}p.componentWillUpdate!=null&&p.componentWillUpdate(C,p.__s,k),D&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(h,_,x)})}if(p.context=k,p.props=C,p.__P=e,p.__e=!1,A=t.__r,M=0,D)p.state=p.__s,p.__d=!1,A&&A(n),d=p.render(p.props,p.state,p.context),g.push.apply(p.__h,p._sb),p._sb=[];else do p.__d=!1,A&&A(n),d=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++M<25);p.state=p.__s,p.getChildContext!=null&&(i=y(y({},i),p.getChildContext())),D&&!m&&p.getSnapshotBeforeUpdate!=null&&(x=p.getSnapshotBeforeUpdate(h,_)),N=d!=null&&d.type===w&&d.key==null?B(d.props.children):d,c=j(e,v(N)?N:[N],n,r,i,a,o,s,c,l,u),p.base=n.__e,n.__u&=-161,p.__h.length&&s.push(p),S&&(p.__E=p.__=null)}catch(e){if(s.length=f,n.__v=null,l||o!=null){if(e.then){for(n.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;o!=null&&(o[o.indexOf(c)]=null),n.__e=c}else if(o!=null)for(P=o.length;P--;)b(o[P])}else n.__e=r.__e;n.__k??=r.__k||[],e.then||R(n),t.__e(e,n,r)}}else o==null&&n.__v==r.__v?(n.__k=r.__k,n.__e=r.__e):c=n.__e=te(r.__e,n,r,i,a,o,s,l,u);return(d=t.diffed)&&d(n),128&n.__u?void 0:c}function R(e){e&&(e.__c&&(e.__c.__e=!0),e.__k&&e.__k.some(R))}function z(e,n,r){for(var i=0;i<r.length;i++)V(r[i],r[++i],r[++i]);t.__c&&t.__c(n,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(e){e.call(n)})}catch(e){t.__e(e,n.__v)}})}function B(e){return typeof e!=`object`||!e||e.__b>0?e:v(e)?e.map(B):e.constructor===void 0?y({},e):null}function te(n,r,i,a,o,s,c,l,u){var d,f,p,m,g,_,y,x=i.props||h,S=r.props,C=r.type;if(C==`svg`?o=`http://www.w3.org/2000/svg`:C==`math`?o=`http://www.w3.org/1998/Math/MathML`:o||=`http://www.w3.org/1999/xhtml`,s!=null){for(d=0;d<s.length;d++)if((g=s[d])&&`setAttribute`in g==!!C&&(C?g.localName==C:g.nodeType==3)){n=g,s[d]=null;break}}if(n==null){if(C==null)return document.createTextNode(S);n=document.createElementNS(o,C,S.is&&S),l&&=(t.__m&&t.__m(r,s),!1),s=null}if(C==null)x===S||l&&n.data==S||(n.data=S);else{if(s=C==`textarea`&&S.defaultValue!=null?null:s&&e.call(n.childNodes),!l&&s!=null)for(x={},d=0;d<n.attributes.length;d++)x[(g=n.attributes[d]).name]=g.value;for(d in x)g=x[d],d==`dangerouslySetInnerHTML`?p=g:d==`children`||d in S||d==`value`&&`defaultValue`in S||d==`checked`&&`defaultChecked`in S||I(n,d,null,g,o);for(d in S)g=S[d],d==`children`?m=g:d==`dangerouslySetInnerHTML`?f=g:d==`value`?_=g:d==`checked`?y=g:l&&typeof g!=`function`||x[d]===g||I(n,d,g,x[d],o);if(f)l||p&&(f.__html==p.__html||f.__html==n.innerHTML)||(n.innerHTML=f.__html),r.__k=[];else if(p&&(n.innerHTML=``),j(r.type==`template`?n.content:n,v(m)?m:[m],r,i,a,C==`foreignObject`?`http://www.w3.org/1999/xhtml`:o,s,c,s?s[0]:i.__k&&E(i,0),l,u),s!=null)for(d=s.length;d--;)b(s[d]);l&&C!=`textarea`||(d=`value`,C==`progress`&&_==null?n.removeAttribute(`value`):_!=null&&(_!==n[d]||C==`progress`&&!_||C==`option`&&_!=x[d])&&I(n,d,_,x[d],o),d=`checked`,y!=null&&y!=n[d]&&I(n,d,y,x[d],o))}return n}function V(e,n,r){try{if(typeof e==`function`){var i=typeof e.__u==`function`;i&&e.__u(),i&&n==null||(e.__u=e(n))}else e.current=n}catch(e){t.__e(e,r)}}function ne(e,n,r){var i,a;if(t.unmount&&t.unmount(e),(i=e.ref)&&(i.current&&i.current!=e.__e||V(i,null,n)),(i=e.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){t.__e(e,n)}i.base=i.__P=i.__n=null}if(i=e.__k)for(a=0;a<i.length;a++)i[a]&&ne(i[a],n,r||typeof e.type!=`function`);r||b(e.__e),e.__c=e.__=e.__e=void 0}function re(e,t,n){return this.constructor(e,n)}function ie(n,r,i){var a,o,s,c;r==document&&(r=document.documentElement),t.__&&t.__(n,r),o=(a=typeof i==`function`)?null:i&&i.__k||r.__k,s=[],c=[],L(r,n=(!a&&i||r).__k=x(w,null,[n]),o||h,h,r.namespaceURI,!a&&i?[i]:o?null:r.firstChild?e.call(r.childNodes):null,s,!a&&i?i:o?o.__e:r.firstChild,a,c),z(s,n,c),n.props.children=null}function ae(e){function t(e){var n,r;return this.getChildContext||(n=new Set,(r={})[t.__c]=this,this.getChildContext=function(){return r},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach(function(e){e.__e=!0,k(e)})},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c=`__cC`+ m++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}e=g.slice,t={__e:function(e,t,n,r){for(var i,a,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(e)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,r||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},n=0,T.prototype.setState=function(e,t){var n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=y({},this.state);typeof e==`function`&&(e=e(y({},n),this.props)),e&&y(n,e),e!=null&&this.__v&&(t&&this._sb.push(t),k(this))},T.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),k(this))},T.prototype.render=w,r=[],a=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,o=function(e,t){return e.__v.__b-t.__v.__b},A.__r=0,s=Math.random().toString(8),c=`__d`+s,l=`__a`+s,u=/(PointerCapture)$|Capture$/i,d=0,f=ee(!1),p=ee(!0),m=0;var H,U,W,G,K=0,q=[],J=t,oe=J.__b,se=J.__r,ce=J.diffed,le=J.__c,ue=J.unmount,de=J.__;function fe(e,t){J.__h&&J.__h(U,e,K||t),K=0;var n=U.__H||={__:[],__h:[]};return e>=n.__.length&&n.__.push({}),n.__[e]}function pe(e){var t=U.context[e.__c],n=fe(H++,9);return n.c=e,t?(n.__??(n.__=!0,t.sub(U)),t.props.value):e.__}function me(){for(var e;e=q.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(Y),t.__h.some(X),t.__h=[]}catch(n){t.__h=[],J.__e(n,e.__v)}}}J.__b=function(e){U=null,oe&&oe(e)},J.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),de&&de(e,t)},J.__r=function(e){se&&se(e),H=0;var t=(U=e.__c).__H;t&&(W===U?(t.__h=[],U.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(Y),t.__h.some(X),t.__h=[],H=0)),W=U},J.diffed=function(e){ce&&ce(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(q.push(t)!==1&&G===J.requestAnimationFrame||((G=J.requestAnimationFrame)||ge)(me)),t.__H.__.some(function(e){e.u&&=(e.__H=e.u,void 0)})),W=U=null},J.__c=function(e,t){t.some(function(e){try{e.__h.some(Y),e.__h=e.__h.filter(function(e){return!e.__||X(e)})}catch(n){t.some(function(e){e.__h&&=[]}),t=[],J.__e(n,e.__v)}}),le&&le(e,t)},J.unmount=function(e){ue&&ue(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.some(function(e){try{Y(e)}catch(e){t=e}}),n.__H=void 0,t&&J.__e(t,n.__v))};var he=typeof requestAnimationFrame==`function`;function ge(e){var t,n=function(){clearTimeout(r),he&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,35);he&&(t=requestAnimationFrame(n))}function Y(e){var t=U,n=e.__c;typeof n==`function`&&(e.__c=void 0,n()),U=t}function X(e){var t=U;e.__c=e.__(),U=t}const _e=[[`Verify`,`確認`],[`block {value0}`,`ブロック {value0}`],[`active`,`有効`],[`provisioning`,`設定中`],[`suspended`,`一時停止中`],[`expired`,`期限切れ`],[`revoked`,`削除済み`],[`Today, 09:41`,`今日 09:41`],[`Wallet`,`ウォレット`],[`Passkey authentication`,`パスキー認証`],[`Complete the prompt on your device.`,`デバイスに表示された操作を完了してください。`],[`Google sign-in`,`Google ログイン`],[`Choose your Google account.`,`Google アカウントを選択してください。`],[`Creating passkey wallet…`,`パスキーでウォレットを作成中…`],[`Unlocking wallet…`,`ウォレットのロックを解除中…`],[`Too many attempts. Wait a moment.`,`試行回数が多すぎます。しばらくお待ちください。`],[`Can’t reach Seams right now.`,`現在 Seams に接続できません。`],[`That took too long.`,`時間がかかりすぎたため、操作を終了しました。`],[`Something went wrong.`,`エラーが発生しました。`],[`That recovery code can’t be used. Check the code and try again.`,`このリカバリーコードは使用できません。コードを確認して、もう一度お試しください。`],[`That recovery code has already been used. Use another code.`,`このリカバリーコードは使用済みです。別のコードを使用してください。`],[`Enter a recovery code.`,`リカバリーコードを入力してください。`],[`Google sign-in was cancelled.`,`Google ログインがキャンセルされました。`],[`Google sign-in was cancelled`,`Google ログインがキャンセルされました`],[`Scan and link device`,`スキャンしてデバイスを連携`],[`Scan this code with your other device.`,`別のデバイスでこのコードをスキャンしてください。`],[`Recover wallet`,`ウォレットを復元`],[`Your Google account is ready to unlock your wallet.`,`Google アカウントでウォレットのロックを解除できます。`],[`Your wallet is ready. Unlock it with your passkey.`,`ウォレットの準備ができました。パスキーでロックを解除してください。`],[`Choose how you will sign in to this wallet from now on.`,`今後このウォレットで使用するログイン方法を選択してください。`],[`Enter a recovery code to recover your wallet.`,`リカバリーコードを入力してウォレットを復元してください。`],[`Create new passkey`,`新しいパスキーを作成`],[`Continue with Google`,`Google で続ける`],[`Verify email code`,`メールのコードを確認`],[`Unlock with Google`,`Google でロック解除`],[`Unlock with new passkey`,`新しいパスキーでロック解除`],[`Create a passkey`,`パスキーを作成`],[`Continue`,`続ける`],[`Recovery couldn’t be completed. Try again.`,`復元を完了できませんでした。もう一度お試しください。`],[`A passkey couldn’t be created. Try again.`,`パスキーを作成できませんでした。もう一度お試しください。`],[`Passkey preparation expired. Retry to continue.`,`パスキーの準備が期限切れになりました。もう一度お試しください。`],[`Waiting for Google login…`,`Google ログインを待機中…`],[`Starting Google sign-in`,`Google ログインを開始中`],[`Waiting for Google sign-in`,`Google ログインを待機中`],[`Checking recovery code…`,`リカバリーコードを確認中…`],[`Google sign-in is unavailable. Try again.`,`Google ログインを利用できません。もう一度お試しください。`],[`Verifying email code…`,`メールのコードを確認中…`],[`Creating new passkey…`,`新しいパスキーを作成中…`],[`Finishing recovery…`,`復元を完了中…`],[`Preparing to unlock…`,`ロック解除を準備中…`],[`Your wallet was recovered. Unlock it again to continue.`,`ウォレットを復元しました。再度ロックを解除して続けてください。`],[`Generating QR code...`,`QR コードを生成中…`],[`This linking request expired. Start again to link this device.`,`この連携リクエストは期限切れです。最初からやり直してください。`],[`Go back and unlock the new linked method to finish setup.`,`前の画面に戻り、新しく連携した方法でロックを解除して設定を完了してください。`],[`The other device cancelled this linking request. Go back to try again.`,`別のデバイスが連携をキャンセルしました。前の画面に戻ってもう一度お試しください。`],[`Create a passkey to finish linking this device`,`パスキーを作成してデバイスの連携を完了してください`],[`Waiting for device to scan`,`別のデバイスでのスキャンを待機中`],[`Follow the passkey prompt on your screen`,`画面に表示されたパスキーの操作を完了してください`],[`Sending a new email code`,`新しいメールのコードを送信中`],[`Enter the 6-digit code from your email.`,`メールに記載された6桁のコードを入力してください。`],[`Verifying your email code`,`メールのコードを確認中`],[`Generating another wallet name`,`別のウォレット名を生成中`],[`Creating your wallet`,`ウォレットを作成中`],[`Continue with your passkey`,`パスキーで続ける`],[`Accounts`,`アカウント`],[`View accounts on block explorers`,`ブロックエクスプローラーでアカウントを表示`],[`Export keys`,`鍵をエクスポート`],[`Export wallet signing keys`,`ウォレットの署名鍵をエクスポート`],[`Recovery codes`,`リカバリーコード`],[`Back up wallet recovery codes`,`ウォレットのリカバリーコードを保存`],[`Authentication methods`,`認証方法`],[`Add or remove ways to unlock this device`,`このデバイスのロック解除方法を追加・削除`],[`Scan QR to link a device`,`QR コードをスキャンしてデバイスを連携`],[`Linked devices`,`連携済みデバイス`],[`See devices using this wallet`,`このウォレットを使用するデバイスを表示`],[`Transaction settings`,`トランザクション設定`],[`Customize confirmation behavior`,`確認操作をカスタマイズ`],[`Logged out`,`ログアウト済み`],[`Settings`,`設定`],[`Back`,`戻る`],[`Unlock this wallet with a sibling authentication method first.`,`先に別の認証方法でこのウォレットのロックを解除してください。`],[`Unlock with the sibling authentication method before removing this one.`,`この認証方法を削除する前に、別の認証方法でロックを解除してください。`],[`In use now`,`現在使用中`],[`Finishing setup`,`設定を完了中`],[`Paused`,`一時停止中`],[`Expired`,`期限切れ`],[`Removed`,`削除済み`],[`Email code`,`メールのコード`],[`your email code`,`メールのコード`],[`another sign-in method`,`別のログイン方法`],[`this passkey`,`このパスキー`],[`Synced passkey`,`同期済みパスキー`],[`Passkey`,`パスキー`],[`Try again.`,`もう一度お試しください。`],[`Loading your devices timed out. Try again.`,`デバイスの読み込みが時間切れになりました。もう一度お試しください。`],[`Wallet identity is unavailable. Try again.`,`ウォレット情報を取得できません。もう一度お試しください。`],[`Device details`,`デバイスの詳細`],[`Status`,`状態`],[`Anything listed here can unlock this wallet.`,`ここに表示されるすべてのデバイスで、このウォレットのロックを解除できます。`],[`Checking your devices…`,`デバイスを確認中…`],[`Unable to load your devices:`,`デバイスを読み込めません:`],[`Try again`,`再試行`],[`Try Again`,`再試行`],[`No other devices are using this wallet.`,`このウォレットを使用する別のデバイスはありません。`],[`Remove`,`削除`],[`Keep it`,`削除しない`],[`Yes, remove`,`削除する`],[`Removing…`,`削除中…`],[`Review appearance`,`確認画面の表示`],[`Choose where transaction details appear before signing.`,`署名前にトランザクションの詳細を表示する場所を選択してください。`],[`Confirmation step`,`確認操作`],[`Choose Modal or Drawer to configure the confirmation step.`,`確認操作を設定するには、モーダルまたはドロワーを選択してください。`],[`Choose whether to click Continue before authentication starts.`,`認証開始前に「続ける」をクリックするか選択してください。`],[`Confirmer UI`,`確認画面`],[`Confirmation Options`,`確認オプション`],[`skip click`,`クリックを省略`],[`require click`,`クリックが必要`],[`none`,`表示なし`],[`modal`,`モーダル`],[`drawer`,`ドロワー`],[`No review`,`確認画面なし`],[`Start authentication without showing a review panel.`,`確認画面を表示せずに認証を開始します。`],[`Modal`,`モーダル`],[`Review the transaction in a centered dialog.`,`画面中央のダイアログでトランザクションを確認します。`],[`Drawer`,`ドロワー`],[`Review the transaction in a slide-out panel.`,`スライド式パネルでトランザクションを確認します。`],[`Start automatically`,`自動で開始`],[`Begin authentication as soon as the review opens.`,`確認画面を開くと同時に認証を開始します。`],[`Click to continue`,`クリックして続ける`],[`Review the details, then click Continue to start authentication.`,`詳細を確認し、「続ける」をクリックして認証を開始します。`],[`Unable to refresh your wallet. Try again.`,`ウォレットを更新できません。もう一度お試しください。`],[`Key export is unavailable for this wallet.`,`このウォレットでは鍵をエクスポートできません。`],[`NEAR signer provisioning is still in progress. Try again shortly.`,`NEAR 署名機能を準備中です。しばらくしてからもう一度お試しください。`],[`Ed25519 export requires an active NEAR signer.`,`Ed25519 のエクスポートには有効な NEAR 署名機能が必要です。`],[`User`,`ユーザー`],[`Key export requires an unlocked wallet.`,`鍵をエクスポートするにはウォレットのロックを解除してください。`],[`Owner key export is not available on this device yet`,`このデバイスでは、まだ所有者の鍵をエクスポートできません`],[`Wallet region`,`ウォレットのリージョン`],[`Choose where your wallet runs`,`ウォレットを実行するリージョンを選択`],[`Loading transaction settings…`,`トランザクション設定を読み込み中…`],[`Your addresses across networks.`,`各ネットワークのアドレスです。`],[`Keep a recovery code somewhere safe. Use it to restore access to your wallet.`,`リカバリーコードを安全な場所に保管してください。ウォレットへのアクセスを復元する際に使用します。`],[`Only you should have this code. Anyone with it can start recovering your wallet.`,`このコードを他人に渡さないでください。コードを持つ人は、ウォレットの復元を開始できます。`],[`Opening recovery codes…`,`リカバリーコードを開いています…`],[`View recovery codes`,`リカバリーコードを表示`],[`Scan QR code`,`QR コードをスキャン`],[`Wallet settings`,`ウォレット設定`],[`Unlock your wallet to manage your accounts, security, and devices.`,`ウォレットのロックを解除すると、アカウント、セキュリティ、デバイスを管理できます。`],[`Now`,`現在`],[`Yesterday`,`昨日`],[`Email OTP`,`メールのワンタイムコード`],[`Passkey + Email OTP`,`パスキー + メールのワンタイムコード`],[`Touch ID · This device`,`Touch ID · このデバイス`],[`Export NEAR key`,`NEAR の鍵をエクスポート`],[`Export EVM keys`,`EVM の鍵をエクスポート`],[`Your wallet requires authentication before revealing this signing key.`,`この署名鍵を表示するには認証が必要です。`],[`Key type`,`鍵の種類`],[`Protection`,`保護`],[`Authentication required`,`認証が必要`],[`Active`,`有効`],[`Manage how your devices unlock your wallet.`,`デバイスでウォレットのロックを解除する方法を管理します。`],[`Link a device`,`デバイスを連携`],[`Last used`,`最終使用`],[`Open your wallet on the other device, then scan its pairing code.`,`別のデバイスでウォレットを開き、ペアリングコードをスキャンしてください。`],[`Position the QR code inside the frame.`,`QR コードを枠内に合わせてください。`],[`Your recovery codes`,`リカバリーコード`],[`Save these codes in your password manager or another secure place.`,`パスワードマネージャーなどの安全な場所にコードを保存してください。`],[`Keep your recovery codes somewhere safe. Use a code to restore access to your wallet.`,`リカバリーコードを安全な場所に保管してください。ウォレットへのアクセスを復元する際に使用します。`],[`Keep these codes private. Anyone with a code can start recovering your wallet.`,`コードを他人に渡さないでください。コードを持つ人は、ウォレットの復元を開始できます。`],[`Reveal with passkey`,`パスキーで表示`],[`View on explorer`,`エクスプローラーで表示`],[`This wallet`,`このウォレット`],[`Addresses`,`アドレス`],[`Security & devices`,`セキュリティとデバイス`],[`Close wallet settings`,`ウォレット設定を閉じる`],[`Wallet account`,`ウォレットアカウント`],[`Secured by`,`セキュリティ提供:`],[`Copied all codes.`,`すべてのコードをコピーしました。`],[`Unable to copy. Download the codes instead.`,`コピーできません。コードをダウンロードしてください。`],[`Downloaded all codes.`,`すべてのコードをダウンロードしました。`],[`Unable to download. Copy the codes instead.`,`ダウンロードできません。コードをコピーしてください。`],[`Copy all`,`すべてコピー`],[`Download all`,`すべてダウンロード`],[`Cancel`,`キャンセル`],[`Create your passkey`,`パスキーを作成`],[`Use Touch ID or your device passkey to create credentials for this account.`,`Touch ID またはデバイスのパスキーで、このアカウントの認証情報を作成してください。`],[`Confirm Code`,`コードを確認`],[`Confirm`,`確認`],[`Register with Passkey`,`パスキーで登録`],[`Confirm with Passkey`,`パスキーで確認`],[`Enter email code to sign`,`メールのコードを入力して署名`],[`Review transaction`,`トランザクションを確認`],[`Unknown`,`不明`],[`The operation did not complete.`,`操作を完了できませんでした。`],[`The network reverted this transaction. Network fees may still apply.`,`ネットワークがこのトランザクションを取り消しました。ネットワーク手数料が発生する場合があります。`],[`The network could not execute this transaction. Network fees may still apply.`,`ネットワークがこのトランザクションを実行できませんでした。ネットワーク手数料が発生する場合があります。`],[`Submitted to the network. The response did not include a final execution outcome.`,`ネットワークに送信しました。応答には最終的な実行結果が含まれていません。`],[`The network response did not include an execution status.`,`ネットワークの応答には実行状態が含まれていません。`],[`The transaction did not complete as expected. Check its network status before retrying.`,`トランザクションが正常に完了しませんでした。再試行前にネットワークで状態を確認してください。`],[`Signing transaction`,`トランザクションに署名中`],[`Signature ready`,`署名の準備完了`],[`Broadcasting transaction`,`トランザクションを送信中`],[`Waiting for confirmation`,`承認を待機中`],[`Transaction complete`,`トランザクション完了`],[`Transaction failed`,`トランザクション失敗`],[`Transaction reverted`,`トランザクションが取り消されました`],[`Confirmation unavailable`,`承認状態を取得できません`],[`Preparing your signed transaction.`,`署名済みトランザクションを準備中です。`],[`Signature created, ready to broadcast.`,`署名を作成しました。送信する準備ができました。`],[`Submitting your signed transaction to the network.`,`署名済みトランザクションをネットワークに送信中です。`],[`Submitted to the network. Waiting for the receipt.`,`ネットワークに送信しました。レシートを待機中です。`],[`The network confirmed your transaction.`,`ネットワークがトランザクションを承認しました。`],[`Email OTP challenge is missing.`,`メール認証のリクエストが見つかりません。`],[`Sign Delegate Action`,`委任アクションに署名`],[`Demo email code:`,`デモ用メールコード:`],[`Recovery code accepted.`,`リカバリーコードを確認しました。`],[`Wallet recovered. Unlock it to continue.`,`ウォレットを復元しました。ロックを解除して続けてください。`],[`Back to recovery code`,`リカバリーコードに戻る`],[`Back to unlock wallet`,`ウォレットのロック解除に戻る`],[`Already have a wallet?`,`すでにウォレットをお持ちですか?`],[`Unlock wallet`,`ウォレットのロックを解除`],[`Don't have a wallet?`,`ウォレットをお持ちでないですか?`],[`Create a wallet`,`ウォレットを作成`],[`Create wallet with passkey`,`パスキーでウォレットを作成`],[`Unlock with passkey`,`パスキーでロック解除`],[`Saved wallets`,`保存済みウォレット`],[`Generate another name`,`別の名前を生成`],[`Other options`,`その他の方法`],[`Link this device`,`このデバイスを連携`],[`Scan a code with your other device`,`別のデバイスでコードをスキャン`],[`Use your recovery code`,`リカバリーコードを使用`],[`Recovery code`,`リカバリーコード`],[`You can paste the whole code.`,`コード全体を貼り付けできます。`],[`This adds a new sign-in method to your wallet.`,`ウォレットに新しいログイン方法を追加します。`],[`Continue with Google, then verify the code sent to your email.`,`Google で続けてから、メールに届いたコードを確認してください。`],[`Finishing recovery with Google…`,`Google での復元を完了中…`],[`Create a new passkey to finish recovering this wallet.`,`新しいパスキーを作成して、ウォレットの復元を完了してください。`],[`Retry finalization`,`完了処理を再試行`],[`Loading`,`読み込み中`],[`Linking expired`,`連携の有効期限切れ`],[`Linking cancelled`,`連携をキャンセルしました`],[`Return to unlock wallet`,`ウォレットのロック解除に戻る`],[`QR code to link this device`,`このデバイスを連携する QR コード`],[`Preparing a one-time code for your other device.`,`別のデバイス用のワンタイムコードを準備中です。`],[`Generating QR code`,`QR コードを生成中`],[`Match your other device`,`別のデバイスと同じ方法を選択`],[`Choose the unlock method for Device 2. Email code sends a one-time code to the address you enter.`,`2台目のデバイスのロック解除方法を選択してください。メールのコードを選ぶと、入力したアドレスにワンタイムコードを送信します。`],[`Wallet unlock method`,`ウォレットのロック解除方法`],[`Email address`,`メールアドレス`],[`Email verification code`,`メール認証コード`],[`Send a new code`,`新しいコードを送信`],[`Verifying`,`確認中`],[`Verify code`,`コードを確認`],[`Send another code`,`別のコードを送信`],[`Device linked`,`デバイスを連携しました`],[`Couldn't link device`,`デバイスを連携できませんでした`],[`Unable to open the wallet. Go back and try again.`,`ウォレットを開けません。前の画面に戻ってもう一度お試しください。`],[`Opening linked wallet`,`連携したウォレットを開いています`],[`Waiting for passkey`,`パスキーを待機中`],[`Create passkey`,`パスキーを作成`],[`Unlocking…`,`ロックを解除中…`],[`Sending…`,`送信中…`],[`Resend Code`,`コードを再送信`],[`Generating…`,`生成中…`],[`Creating...`,`作成中…`],[`Sending your code`,`コードを送信中`],[`Emailing a 6-digit code`,`6桁のコードをメールで送信中`],[`Sending a new code`,`新しいコードを送信中`],[`Emailing a fresh 6-digit code`,`新しい6桁のコードをメールで送信中`],[`Checking your code`,`コードを確認中`],[`Verifying the code you entered`,`入力したコードを確認中`],[`Verify your email`,`メールを確認`],[`Enter the 6-digit code we just sent.`,`送信した6桁のコードを入力してください。`],[`That code expired`,`コードの有効期限が切れました`],[`Email code unavailable`,`メールのコードを利用できません`],[`Email verified`,`メールを確認しました`],[`Finishing linking this device`,`デバイスの連携を完了中`],[`Choose the signing key to export. Your wallet will ask you to authenticate.`,`エクスポートする署名鍵を選択してください。ウォレットで認証が必要です。`],[`Keep exported keys private. Anyone with a signing key can control its accounts.`,`エクスポートした鍵を他人に渡さないでください。署名鍵を持つ人は、そのアカウントを操作できます。`],[`Back up your wallet recovery codes`,`ウォレットのリカバリーコードを保存`],[`Choose how you unlock this device`,`このデバイスのロック解除方法を選択`],[`Scan a QR code to link a device`,`QR コードをスキャンしてデバイスを連携`],[`Light mode`,`ライトモード`],[`Dark mode`,`ダークモード`],[`Unable to lock your wallet. Try again.`,`ウォレットをロックできません。もう一度お試しください。`],[`Unlocked on this device`,`このデバイスでロック解除済み`],[`All settings`,`すべての設定`],[`Locking…`,`ロック中…`],[`Lock wallet`,`ウォレットをロック`],[`Lock Wallet`,`ウォレットをロック`],[`This setting is unavailable for the current wallet or device.`,`このウォレットまたはデバイスでは、この設定を利用できません。`],[`Your wallet. Your control.`,`ウォレットの管理は、あなたの手に。`],[`I’ve saved these codes. They won’t be shown again.`,`コードを保存しました。この後は再表示できません。`],[`Done`,`完了`],[`Export NEAR Key`,`NEAR の鍵をエクスポート`],[`Ed25519 signing key`,`Ed25519 署名鍵`],[`Export EVM Keys`,`EVM の鍵をエクスポート`],[`ECDSA threshold key set`,`ECDSA しきい値署名の鍵セット`],[`Preparing export…`,`エクスポートを準備中…`],[`Export key`,`鍵をエクスポート`],[`United States`,`米国`],[`Western Europe`,`西ヨーロッパ`],[`Asia Pacific`,`アジア太平洋`],[`Oceania`,`オセアニア`],[`Your wallet is in the new region.`,`ウォレットは新しいリージョンにあります。`],[`The move needs service recovery. Your wallet data remains preserved. You can lock this wallet while recovery continues.`,`移動にはサービスの復旧が必要です。ウォレットのデータは保持されています。復旧中もウォレットをロックできます。`],[`The service will retry this stage. Closing or locking this wallet does not cancel the move.`,`サービスがこの段階を再試行します。ウォレットを閉じたりロックしたりしても、移動はキャンセルされません。`],[`Preparing your wallet`,`ウォレットを準備中`],[`Transferring wallet data`,`ウォレットのデータを転送中`],[`Checking the new region`,`新しいリージョンを確認中`],[`Activating the new region`,`新しいリージョンを有効化中`],[`The new region is active. Source cleanup continues.`,`新しいリージョンが有効です。移動元のクリーンアップを継続中です。`],[`Checking wallet placement…`,`ウォレットの配置を確認中…`],[`Unable to check wallet placement. Unlock this wallet or reconnect to try again.`,`ウォレットの配置を確認できません。ロックを解除するか、再接続してお試しください。`],[`Reconnecting to check progress. The previous request may have been accepted.`,`進行状況を確認するため再接続しています。前のリクエストは受け付けられた可能性があります。`],[`Unable to check wallet placement. Reconnect to try again.`,`ウォレットの配置を確認できません。再接続してお試しください。`],[`Reconnecting to check progress. Retry this same request to continue.`,`進行状況を確認するため再接続しています。同じリクエストを再試行してください。`],[`Reconnecting to check progress. Unlock this wallet if authentication expired.`,`進行状況を確認するため再接続しています。認証が期限切れの場合は、ウォレットのロックを解除してください。`],[`You can lock this wallet. An accepted move continues on the server.`,`このウォレットをロックできます。受け付けられた移動はサーバーで継続します。`],[`Check again`,`再確認`],[`Retry same move`,`同じ移動を再試行`],[`Your wallet is active in the new region. Another move must wait until cleanup completes.`,`ウォレットは新しいリージョンで有効です。次の移動はクリーンアップ完了後に実行できます。`],[`Signing and wallet changes are paused. Closing or locking this wallet does not cancel the move.`,`署名とウォレットの変更を一時停止しています。ウォレットを閉じたりロックしたりしても、移動はキャンセルされません。`],[`Current region:`,`現在のリージョン:`],[`Destination region`,`移動先リージョン`],[`Moving your wallet ends signing sessions on all devices. After the move, unlock your wallet again to sign.`,`ウォレットを移動すると、すべてのデバイスの署名セッションが終了します。移動後に署名するには、再度ロックを解除してください。`],[`Another move is available after`,`次の移動が可能になる日時:`],[`Move wallet`,`ウォレットを移動`],[`Passkey on this device`,`このデバイスのパスキー`],[`Email OTP on this device`,`このデバイスのメール認証`],[`Checking methods…`,`認証方法を確認中…`],[`Unavailable`,`利用不可`],[`Unlock to manage`,`ロックを解除して管理`],[`Unlock this wallet to manage authentication.`,`認証を管理するには、このウォレットのロックを解除してください。`],[`Enter the email address to verify.`,`確認するメールアドレスを入力してください。`],[`Adding a passkey…`,`パスキーを追加中…`],[`Adding Email OTP…`,`メール認証を追加中…`],[`Passkey added.`,`パスキーを追加しました。`],[`Email OTP added.`,`メール認証を追加しました。`],[`Unlocking wallet management…`,`ウォレット管理のロックを解除中…`],[`Wallet management unlocked.`,`ウォレット管理のロックを解除しました。`],[`Checking authentication methods…`,`認証方法を確認中…`],[`Unable to load authentication methods:`,`認証方法を読み込めません:`],[`Active authentication methods`,`有効な認証方法`],[`Remove method`,`認証方法を削除`],[`Add another method before removing this one.`,`この方法を削除する前に、別の認証方法を追加してください。`],[`Add a method`,`認証方法を追加`],[`Adding…`,`追加中…`],[`Add passkey`,`パスキーを追加`],[`Use a passkey from this device to unlock the wallet.`,`このデバイスのパスキーでウォレットのロックを解除します。`],[`Add Email OTP`,`メール認証を追加`],[`Unlock to manage methods`,`ロックを解除して認証方法を管理`],[`Confirm your current authentication method to add or remove methods.`,`認証方法を追加・削除するには、現在の認証方法を確認してください。`],[`Transfer`,`送金`],[`Warnings`,`警告`],[`No operations`,`操作なし`],[`using args:`,`引数:`],[`by global contract identifier`,`グローバルコントラクト識別子を使用`],[`Stake`,`ステーキング`],[`Full Access`,`フルアクセス`],[`Function Call`,`関数呼び出し`],[`Transactions`,`トランザクション`],[`Transaction`,`トランザクション`],[`Resend code`,`コードを再送信`],[`Enter the 6-digit Email OTP code.`,`メールの6桁のワンタイムコードを入力してください。`],[`Could not send code.`,`コードを送信できませんでした。`],[`Code sent`,`コードを送信しました`],[`Creating passkey`,`パスキーを作成中`],[`Creating passkey...`,`パスキーを作成中…`],[`Loading website`,`ウェブサイトを読み込み中`],[`Loading chain details`,`チェーンの詳細を読み込み中`],[`Exported Keys`,`エクスポートした鍵`],[`Close exported keys`,`エクスポートした鍵を閉じる`],[`Near Account ID`,`NEAR アカウント ID`],[`Preparing private key…`,`秘密鍵を準備中…`],[`No keys available`,`利用可能な鍵がありません`],[`Warning: your private keys grant full control of your account and funds. Keep it in a secret place.`,`警告:秘密鍵を持つ人は、アカウントと資金を完全に操作できます。秘密鍵を他人に知られない場所に保管してください。`],[`Next Steps`,`次の手順`],[`Address`,`アドレス`],[`Public key copied`,`公開鍵をコピーしました`],[`Copy public key`,`公開鍵をコピー`],[`Public Key`,`公開鍵`],[`Private key copied`,`秘密鍵をコピーしました`],[`Copy private key`,`秘密鍵をコピー`],[`Private Key`,`秘密鍵`],[`Decrypting private key`,`秘密鍵を復号中`],[`Private key ready`,`秘密鍵の準備完了`],[`Data`,`データ`],[`Copied`,`コピーしました`],[`Copy`,`コピー`],[`Passkey registration details`,`パスキー登録の詳細`],[`Account`,`アカウント`],[`Website`,`ウェブサイト`],[`Open`,`開く`],[`Close transaction`,`トランザクションを閉じる`],[`Transaction receipt`,`トランザクションのレシート`],[`Minimize transaction`,`トランザクションを最小化`],[`To`,`宛先`],[`Estimated network fee`,`推定ネットワーク手数料`],[`Transaction progress`,`トランザクションの進行状況`],[`Signed`,`署名済み`],[`Signing`,`署名中`],[`Broadcast`,`送信済み`],[`Broadcasting`,`送信中`],[`Reverted`,`取り消し済み`],[`Confirmed`,`承認済み`],[`Confirming`,`承認中`],[`Receipt details`,`レシートの詳細`],[`From`,`送信元`],[`Continue in background`,`バックグラウンドで続ける`],[`View transaction`,`トランザクションを表示`],[`Wallet transaction`,`ウォレットのトランザクション`],[`Copy value`,`値をコピー`],[`Method:`,`メソッド:`],[`Raw data`,`未加工データ`],[`Network`,`ネットワーク`],[`Message details`,`メッセージの詳細`],[`Transaction details`,`トランザクションの詳細`],[`Signing account`,`署名アカウント`],[`Raw payload`,`未加工ペイロード`],[`Dismiss confirmation`,`確認画面を閉じる`],[`Close`,`閉じる`],[`Creating Account`,`アカウントを作成`],[`Deleting Account`,`アカウントを削除`],[`Adding Key`,`鍵を追加`],[`Deleting Key`,`鍵を削除`],[`Deploying WASM contract`,`WASM コントラクトをデプロイ`],[`Use global contract`,`グローバルコントラクトを使用`],[`Transaction to`,`トランザクションの宛先`],[`Calling`,`呼び出し`],[`Use global contract by hash`,`ハッシュでグローバルコントラクトを使用`],[`Backup needed`,`バックアップが必要`],[`Backed up`,`バックアップ済み`],[`No recovery set`,`リカバリーコード未設定`],[`Authorization required`,`認証が必要`],[`Could not load`,`読み込めませんでした`],[`Checking your codes…`,`コードを確認中…`],[`Status unavailable`,`状態を取得できません`],[`Seams wallet recovery codes`,`Seams ウォレットのリカバリーコード`],[`Save these codes somewhere private. Each code can be used once.`,`他人に知られない場所にコードを保存してください。各コードは1回のみ使用できます。`],[`Finish backup`,`バックアップを完了`],[`Back up later`,`後でバックアップ`],[`Could not load recovery-code status`,`リカバリーコードの状態を読み込めませんでした`],[`Recovery codes are no longer available on this device.`,`このデバイスでは、リカバリーコードを表示できなくなりました。`],[`Could not open recovery codes`,`リカバリーコードを開けませんでした`],[`Recovery codes downloaded.`,`リカバリーコードをダウンロードしました。`],[`Unable to download the codes. Copy them or try again.`,`コードをダウンロードできません。コピーするか、もう一度お試しください。`],[`Recovery codes copied.`,`リカバリーコードをコピーしました。`],[`Unable to copy the codes. Download them or try again.`,`コードをコピーできません。ダウンロードするか、もう一度お試しください。`],[`Close recovery codes`,`リカバリーコードを閉じる`],[`Wallet recovery codes`,`ウォレットのリカバリーコード`],[`View and save the recovery codes retained by this wallet after registration.`,`登録後にウォレットが保持するリカバリーコードを表示・保存します。`],[`Security`,`セキュリティ`],[`Opening recovery codes`,`リカバリーコードを開いています`],[`Loading recovery-code status…`,`リカバリーコードの状態を読み込み中…`],[`Retry status`,`状態を再取得`],[`Each code can recover your wallet once. Save them now, or back them up later from Recovery Codes.`,`各コードでウォレットを1回復元できます。今すぐ保存するか、後で「リカバリーコード」から保存してください。`],[`Each code can recover your wallet once. Keep them somewhere private.`,`各コードでウォレットを1回復元できます。他人に知られない場所に保管してください。`],[`Save your recovery codes`,`リカバリーコードを保存`],[`{value0} single-use codes`,`1回限りのコード:{value0}個`],[`Download codes`,`コードをダウンロード`],[`Copy codes`,`コードをコピー`],[`I saved these recovery codes somewhere safe.`,`リカバリーコードを安全な場所に保存しました。`],[`They won’t be shown again after you finish.`,`完了後は再表示できません。`],[`Back to review`,`確認画面に戻る`],[`NEAR account`,`NEAR アカウント`],[`needs funding`,`への入金が必要です`],[`Too many requests. Try again shortly.`,`リクエストが多すぎます。しばらくしてからもう一度お試しください。`],[`Device linking expired`,`デバイス連携の有効期限が切れました`],[`Device linking was cancelled`,`デバイス連携がキャンセルされました`],[`Unable to scan a QR code`,`QR コードをスキャンできません`],[`Choose an Email OTP method`,`メール認証の方法を選択`],[`Select the masked address to authorize this linked device.`,`一部を伏せたアドレスを選択して、連携するデバイスを認証してください。`],[`Available methods`,`利用可能な方法`],[`Authorizing`,`認証中`],[`Close scanner`,`スキャナーを閉じる`],[`Scan and link a device`,`スキャンしてデバイスを連携`],[`This linking request expired. Scan the QR code again to retry.`,`この連携リクエストは期限切れです。QR コードを再度スキャンしてください。`],[`Linking device`,`デバイスを連携中`],[`Continue linking on your other device.`,`別のデバイスで連携を続けてください。`],[`Cancel linking`,`連携をキャンセル`],[`Position the QR code within the frame`,`QR コードを枠内に合わせてください`],[`Device linking failed`,`デバイスの連携に失敗しました`],[`The address is normalized before the QR code is created.`,`QR コードの作成前に、アドレスの表記を統一します。`],[`Device 2 will create a new passkey for this wallet.`,`2台目のデバイスで、このウォレット用の新しいパスキーを作成します。`],[`Device Linking QR Code`,`デバイス連携用 QR コード`],[`Scan and Link Device`,`スキャンしてデバイスを連携`],[`Scan to backup your other device.`,`スキャンして別のデバイスをバックアップしてください。`],[`Confirm on this device to finish linking it to your wallet.`,`このデバイスで確認し、ウォレットとの連携を完了してください。`],[`Creating passkey…`,`パスキーを作成中…`],[`Enter the 6-digit email code.`,`メールの6桁のコードを入力してください。`],[`Confirm with an email code`,`メールのコードで確認`],[`Use the code sent to`,`コードの送信先:`],[`Sending your email code…`,`メールのコードを送信中…`],[`Sending a new email code…`,`新しいメールのコードを送信中…`],[`Email code accepted. Finishing device activation…`,`メールのコードを確認しました。デバイスの有効化を完了中…`],[`Checking code…`,`コードを確認中…`],[`Confirm code`,`コードを確認`],[`Trying again…`,`再試行中…`],[`Send code again`,`コードを再送信`],[`Choose another factor`,`別の認証方法を選択`],[`Welcome back`,`おかえりなさい`],[`Wallet name`,`ウォレット名`],[`Sign in`,`ログイン`],[`Use your passkey to continue.`,`パスキーで続けてください。`],[`Continue with passkey`,`パスキーで続ける`],[`Close authentication menu`,`認証メニューを閉じる`],[`Passkey name`,`パスキー名`],[`Use a passkey to create your wallet.`,`パスキーでウォレットを作成します。`],[`Restore access to your wallet.`,`ウォレットへのアクセスを復元します。`],[`Preparing a one-time code…`,`ワンタイムコードを準備中…`],[`Create a passkey on this device.`,`このデバイスでパスキーを作成してください。`],[`Creating your passkey…`,`パスキーを作成中…`],[`This code has expired.`,`コードの有効期限が切れました。`],[`Device linking was cancelled.`,`デバイス連携がキャンセルされました。`],[`Unable to link this device.`,`このデバイスを連携できません。`],[`Switch to light mode`,`ライトモードに切り替え`],[`Switch to dark mode`,`ダークモードに切り替え`],[`Copy recipient address {value}`,`送信先アドレス {value} をコピー`],[`Copy signing account address {value}`,`署名アカウントのアドレス {value} をコピー`],[`Copy contract address {value}`,`コントラクトアドレス {value} をコピー`],[`Use the code already sent to {value}.`,`{value} に送信済みのコードを使用してください。`],[`A 6-digit code was sent to {value}.`,`{value} に6桁のコードを送信しました。`],[`Loading...`,`読み込み中…`],[`Scanning...`,`スキャン中…`],[`with`,`金額:`],[`using`,`使用量:`],[`(recommended)`,`(推奨)`],[`. The destination is managed by your wallet and cannot be changed here.`,`。送信先はウォレットが管理しており、ここでは変更できません。`],[`? It will lose access right away.`,`を削除しますか?このデバイスは直ちにアクセスできなくなります。`],[`from this device? You will need the other active method to unlock it.`,`をこのデバイスから削除しますか?ロック解除には別の有効な認証方法が必要です。`],[`Enter all {value0} characters of the recovery code.`,`リカバリーコードを{value0}文字すべて入力してください。`],[`{value0} days ago`,`{value0}日前`],[`Device {value0}`,`デバイス {value0}`],[`Added {value0}`,`追加日:{value0}`],[`Last used {value0}`,`最終使用:{value0}`],[`your "{value0}" passkey`,`「{value0}」のパスキー`],[`You're signed in with {value0}. To remove it, sign in with {value1} first.`,`{value0}でログインしています。削除するには、先に{value1}でログインしてください。`],[`Device {value0}, {value1} (ID {value2})`,`デバイス {value0}、{value1}(ID {value2})`],[`Removing {value0}…`,`{value0}を削除中…`],[`{value0} can no longer use this wallet.`,`{value0}は、このウォレットを使用できなくなりました。`],[`Remove {value0}`,`{value0}を削除`],[`NEAR signer provisioning must be retried ({value0}).`,`NEAR 署名機能の準備を再試行してください({value0})。`],[`Recovery code {value0}`,`リカバリーコード {value0}`],[`Saved wallets. Selected wallet ID {value0}, email {value1}`,`保存済みウォレット。選択中のウォレット ID:{value0}、メール:{value1}`],[`Saved wallets. Selected {value0}`,`保存済みウォレット。選択中:{value0}`],[`Recovery codes don’t use {value0}.`,`リカバリーコードに{value0}は使用できません。`],[`WASM contract code size: {value0}`,`WASM コントラクトのコードサイズ:{value0}`],[`WASM global contract code size: {value0}`,`WASM グローバルコントラクトのコードサイズ:{value0}`],[`sending balance to: {value0}`,`残高の送信先:{value0}`],[`Calling {value0} using {value1}`,`{value0}を呼び出し、使用量:{value1}`],[`Resend in {value0}s`,`{value0}秒後に再送信`],[`Too many requests. Try again in {value0}s.`,`リクエストが多すぎます。{value0}秒後にもう一度お試しください。`],[`Copy {value0}`,`{value0}をコピー`],[`Copy NEAR account {value0}`,`NEAR アカウント {value0} をコピー`],[`Calling {value0} with {value1} using {value2}`,`{value0}を呼び出し、金額:{value1}、使用量:{value2}`],[`Transfer {value0}`,`{value0}を送金`],[`Staking {value0}`,`{value0}をステーキング`],[`Deploy global WASM contract (mode: {value0}, size {value1})`,`グローバル WASM コントラクトをデプロイ(モード:{value0}、サイズ:{value1})`],[`Use global contract by account {value0}`,`アカウント {value0} のグローバルコントラクトを使用`],[`Use global contract by hash {value0}`,`ハッシュ {value0} のグローバルコントラクトを使用`],[`Deploying WASM contract ({value0})`,`WASM コントラクトをデプロイ({value0})`],[`{value0} of {value1} codes left`,`コード残数:{value0}/{value1}`],[`Copy signer address {value0}`,`署名者のアドレス {value0} をコピー`],[`Show {value0}`,`{value0}を表示`],[`Camera {value0}...`,`カメラ {value0}…`],[`Remove {value0}? It will lose access right away.`,`{value0}を削除しますか?このデバイスは直ちにアクセスできなくなります。`],[`Remove {value0} from this device? You will need the other active method to unlock it.`,`このデバイスから{value0}を削除しますか?ロック解除には別の有効な認証方法が必要です。`],[`today`,`今日`],[`yesterday`,`昨日`],[`Message`,`メッセージ`],[`Signer`,`署名者`],[`Recipient`,`受信者`],[`Receiver`,`受信者`],[`Method`,`メソッド`],[`Value (wei)`,`金額(wei)`],[`Action Count`,`アクション数`],[`Amount (yoctoNEAR)`,`金額(yoctoNEAR)`],[`Beneficiary`,`残高の受取先`],[`By Account`,`アカウントで指定`],[`By Code Hash`,`コードハッシュで指定`],[`Code Bytes`,`コードサイズ(バイト)`],[`Deploy Mode`,`デプロイモード`],[`Deposit (yoctoNEAR)`,`付随する金額(yoctoNEAR)`],[`Gas`,`ガス`],[`Permission`,`権限`],[`Stake (yoctoNEAR)`,`ステーキング額(yoctoNEAR)`],[`Validator Key`,`バリデーターの鍵`],[`Valid After`,`有効期間の開始`],[`Valid Before`,`有効期間の終了`],[`EVM Transaction`,`EVM トランザクション`],[`NEAR Transaction`,`NEAR トランザクション`],[`Tempo Transaction`,`Tempo トランザクション`],[`Message signature`,`メッセージへの署名`],[`NEP-413 message`,`NEP-413 メッセージ`],[`Contract Call`,`コントラクト呼び出し`],[`Unsupported EVM Payload`,`未対応の EVM ペイロード`],[`Unsupported Tempo Payload`,`未対応の Tempo ペイロード`],[`Tempo Payload Missing Calls`,`Tempo ペイロードに呼び出しがありません`],[`Function Arguments`,`関数の引数`],[`Signed Delegate Payload`,`署名済み委任ペイロード`],[`Enter the 6-digit code sent to {value0}`,`{value0} に送信した6桁のコードを入力してください`],[`Transaction {value0}`,`トランザクション {value0}`],[`Transaction {value0}: to`,`トランザクション {value0} の宛先:`],[`Transaction to contract`,`コントラクトへのトランザクション`],[`Transaction {value0} to contract`,`コントラクトへのトランザクション {value0}`],[`Action {value0}: CreateAccount`,`アクション {value0}:アカウント作成`],[`Action {value0}: Transfer`,`アクション {value0}:送金`],[`Action {value0}: FunctionCall`,`アクション {value0}:関数呼び出し`],[`Action {value0}: Stake`,`アクション {value0}:ステーキング`],[`Action {value0}: AddKey`,`アクション {value0}:鍵の追加`],[`Action {value0}: DeleteKey`,`アクション {value0}:鍵の削除`],[`Action {value0}: DeployContract`,`アクション {value0}:コントラクトのデプロイ`],[`Action {value0}: DeployGlobalContract`,`アクション {value0}:グローバルコントラクトのデプロイ`],[`Action {value0}: UseGlobalContract`,`アクション {value0}:グローバルコントラクトの使用`],[`Action {value0}: DeleteAccount`,`アクション {value0}:アカウント削除`],[`Action {value0}: SignedDelegate`,`アクション {value0}:署名済み委任`],[`Action {value0}: Unsupported`,`アクション {value0}:未対応の操作`],[`mode: {value0}`,`モード:{value0}`],[`by account: {value0}`,`アカウント:{value0}`],[`by hash: {value0}`,`ハッシュ:{value0}`],[`validator: {value0}`,`バリデーター:{value0}`],[`key: {value0}`,`鍵:{value0}`],[`permissions: {value0}`,`権限:{value0}`],[`Your email`,`メールアドレス`],[`your email`,`メールアドレス`],[`Create your wallet`,`ウォレットを作成`],[`Continue with your Google account.`,`Google アカウントで続けてください。`],[`Create wallet`,`ウォレットを作成`],[`Check this recovery code and try again.`,`リカバリーコードを確認して、もう一度お試しください。`]];function ve([e,t]){return[e,{en:e,ja:t}]}const Z=new Map(_e.map(ve));function ye(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function be([e,t]){let n=[],r=[],i=0;for(let t of e.matchAll(/\{(\w+)\}/g))r.push(ye(e.slice(i,t.index)),`(.+?)`),n.push(t[1]),i=t.index+t[0].length;return r.push(ye(e.slice(i))),{expression:RegExp(`^`+r.join(``)+`$`,`s`),parameters:n,japanese:t}}function xe(e){return e[0].includes(`{`)}function Se(e,t){return t[0].length-e[0].length}const Ce=_e.filter(xe).sort(Se).map(be);function we(e,t,n={}){let r=Z.get(t);if(!r)throw Error(`Unknown wallet message`);let i=r[e];for(let[e,t]of Object.entries(n))i=i.split(`{`+e+`}`).join(String(t));return i}function Q(e,t){if(typeof t!=`string`||e===`en`)return t;let n=t.trim(),r=Z.get(n);if(r)return r[e];let i=n.endsWith(`:`)?Z.get(n.slice(0,-1)):void 0;if(i)return i[e]+`:`;for(let e of Ce){let t=e.expression.exec(n);if(!t)continue;let r=e.japanese;for(let[n,i]of e.parameters.entries())r=r.split(`{`+i+`}`).join(t[n+1]);return r}return t}var Te=0;Array.isArray;function Ee(e,n,r,i,a,o){n||={};var s,c,l=n;if(`ref`in l)for(c in l={},n)c==`ref`?s=n[c]:l[c]=n[c];var u={type:e,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Te,__i:-1,__u:0,__source:a,__self:o};if(typeof e==`function`&&(s=e.defaultProps))for(c in s)l[c]===void 0&&(l[c]=s[c]);return t.vnode&&t.vnode(u),u}const $=ae(`en`);function De(){return pe($)}function Oe(e,t){return Ee($.Provider,{value:e,children:t})}function ke(e){let t=De();return e.message===void 0?Q(t,e.copy):we(t,e.message,e.values)}function Ae(e,t){return`${e}{${Object.entries(t).map(([e,t])=>`${e}:${t};`).join(``)}}`}function je(){if(typeof window>`u`)return;let e=window;return e.seamsNonce||e.litNonce||void 0}function Me(e){let{doc:t,baseCss:n,baseStyleDataAttr:r,dynamicStyleDataAttr:i,nonce:a}=e,o={baseSheet:null,dynamicSheet:null,declarationSheet:null,baseStyleEl:null,dynamicStyleEl:null,rules:new Map,declarationRules:new Map,supportConstructable:null},s=()=>{if(a)return typeof a==`function`?a():a},c=()=>(o.supportConstructable??=typeof CSSStyleSheet<`u`&&`adoptedStyleSheets`in t,o.supportConstructable),l=e=>{let n=t.adoptedStyleSheets||[],r=[...n];for(let t of e)n.includes(t)||r.push(t);t.adoptedStyleSheets=r},u=e=>{(t.head||t.documentElement||t.body)?.appendChild(e)},d=(e,n)=>{let r=t.createElement(`style`),i=s();if(i)try{r.setAttribute(`nonce`,i)}catch{}if(e)try{r.setAttribute(e,``)}catch{}return n!=null&&(r.textContent=n),r},f=()=>{if(o.baseSheet||o.baseStyleEl)return;if(c())try{o.baseSheet=new CSSStyleSheet,o.baseSheet.replaceSync(n),l([o.baseSheet]);return}catch{o.baseSheet=null,o.supportConstructable=!1}let e=d(r,n);u(e),o.baseStyleEl=e},p=()=>Array.from(o.rules.values()).join(`
|
|
2
|
+
`),m=()=>{if(c()){o.dynamicSheet||(o.dynamicSheet=new CSSStyleSheet,l([o.dynamicSheet]));return}if(!o.dynamicStyleEl){let e=d(i);u(e),o.dynamicStyleEl=e}},h=()=>{let e=p();if(c())try{m(),o.dynamicSheet?.replaceSync(e);return}catch{o.supportConstructable=!1,o.dynamicSheet=null}m(),o.dynamicStyleEl&&(o.dynamicStyleEl.textContent=e)},g=(e,t)=>{let n=o.declarationRules.get(e);if(n&&n.selector===t)return n.rule;if(!c())return null;try{o.declarationSheet||(o.declarationSheet=new CSSStyleSheet,l([o.declarationSheet]));let r=o.declarationSheet;if(n){let t=Array.prototype.indexOf.call(r.cssRules,n.rule);t>=0&&r.deleteRule(t),o.declarationRules.delete(e)}let i=r.insertRule(`${t}{}`,r.cssRules.length),a=r.cssRules[i];return a instanceof CSSStyleRule?(o.declarationRules.set(e,{selector:t,rule:a,applied:{}}),a):(r.deleteRule(i),null)}catch{return o.declarationSheet=null,o.declarationRules.clear(),null}},_=e=>{let t=o.declarationRules.get(e);if(!t)return!1;o.declarationRules.delete(e);let n=o.declarationSheet;if(!n)return!0;try{let e=Array.prototype.indexOf.call(n.cssRules,t.rule);e>=0&&n.deleteRule(e)}catch{}return!0};return{ensureBase:()=>{f()},setDynamicDeclarations:(e,t,n)=>{f();let r=g(e,t);if(!r){let r=Ae(t,n);if(o.rules.get(e)===r)return;o.rules.set(e,r),h();return}let i=o.declarationRules.get(e),a=i?i.applied:{};for(let[e,t]of Object.entries(n))a[e]!==t&&r.style.setProperty(e,t);for(let e of Object.keys(a))e in n||r.style.removeProperty(e);i&&(i.applied={...n})},setDynamicRule:(e,t)=>{f(),o.rules.get(e)!==t&&(o.rules.set(e,t),h())},deleteDynamicRule:e=>{_(e),o.rules.delete(e)&&h()},clearDynamicRules:()=>{for(let e of Array.from(o.declarationRules.keys()))_(e);o.rules.size!==0&&(o.rules.clear(),h())},hasDynamicRule:e=>o.rules.has(e)||o.declarationRules.has(e)}}const Ne=new WeakMap;function Pe(e){let t=Ne.get(e);return t||(t=Me({doc:e,baseCss:``,dynamicStyleDataAttr:`data-seams-confirmation-dynamic`,nonce:je}),Ne.set(e,t)),t}function Fe(e){let t=e.trim();if(t)return/^[A-Za-z][A-Za-z0-9_-]*$/.test(t)?t:void 0}function Ie(e){let t=e.trim();if(!(!t||t.length>1024)&&!/[{};\n\r]/.test(t))return t}function Le(e){let t={};for(let n of[`colors`,`shape`])for(let[r,i]of Object.entries(e?.theme[n]??{})){if(typeof i!=`string`)continue;let e=Fe(r);if(!e)continue;let a=Ie(i);a&&(t[`--seams-${n}-${e}`]=`${a} !important`)}return t}function Re(e,t){return`:where(#${e}){${Object.entries(Le(t)).map(([e,t])=>`${e}:${t};`).join(``)}}`}export{$ as a,Oe as c,we as d,T as f,w as h,je as i,Ee as l,ie as m,Pe as n,ke as o,C as p,Me as r,De as s,Re as t,Q as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as e,u as t}from"./chains-CPmd4s9f.js";import{i as n,r}from"./base64-
|
|
1
|
+
import{l as e,u as t}from"./chains-CPmd4s9f.js";import{i as n,r}from"./base64-BmKR3UqU.js";function i(e){if(typeof e!=`string`||e.trim()!==e||e.length===0)throw Error(`correlation id must be a non-empty canonical string`);return e}function a(e){if(typeof e!=`string`||!/^[A-Za-z0-9_-]+$/.test(e))throw Error(`digest must be unpadded base64url`);let t;try{t=r(e)}catch{throw Error(`digest must be valid base64url`)}if(t.length!==32||n(t)!==e)throw Error(`digest must be canonical base64url for 32 bytes`);return e}function o(e){if(typeof e!=`string`)throw Error(`timestamp must be an ISO timestamp`);let t=Date.parse(e);if(!Number.isFinite(t)||new Date(t).toISOString()!==e)throw Error(`timestamp must be canonical ISO-8601 UTC`);return e}function s(e){if(!Number.isSafeInteger(e)||Number(e)<=0)throw Error(`timestamp milliseconds must be a positive safe integer`);return o(new Date(Number(e)).toISOString())}async function c(t){return a(n(await e(t)))}async function l(e){return a(n(await t(e)))}export{c as a,o as i,i as n,l as o,a as r,s as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{D as e,M as t,O as n,h as r,k as i,l as a,r as o,u as s}from"./domainIds-C3fUa33Q.js";import{A as c,j as l,k as u}from"./chains-CPmd4s9f.js";import{n as ee,r as d,s as f}from"./primitives-cC0a9GRC.js";import{i as p,r as m}from"./base64-DW79QA0h.js";import{l as h}from"./capabilityKinds-D0Yrp9uf.js";import{r as te}from"./canonicalPrimitives-BOzRXzfv.js";import{c as g,s as ne}from"./accountIds-Cpvlkvbe.js";import{Qt as _,Xt as re,en as v,nn as y,ot as ie}from"./emailOtpEcdsaDerivationIdentity-BDVjvnmO.js";import{r as ae}from"./registrationIds-Br-zI4_5.js";const b=new TextEncoder;function x(e,t){if(typeof e!=`string`||e.length===0)throw Error(`${t} must be a non-empty visible ASCII string`);for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r<33||r>126)throw Error(`${t} must contain visible ASCII bytes`)}return e}function oe(e,t){if(typeof e!=`number`||!Number.isInteger(e)||e<0||e>255)throw Error(`${t} must be a byte`);return e}function se(e,t,n,r){if(!Array.isArray(e))throw Error(`${t} must be a byte array`);if(e.length<n||e.length>r)throw Error(`${t} has an invalid length`);let i=[];for(let n=0;n<e.length;n+=1)i.push(oe(e[n],`${t}[${n}]`));return i}function S(e,t,n){let r=se(e,t,32,32);if(n&&ce(r))throw Error(`${t} must be nonzero`);return r}function ce(e){for(let t of e)if(t!==0)return!1;return!0}function C(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function le(e){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!1),t}function ue(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function w(e){return ue([le(e.length),e])}function T(e,t){return ue([w(b.encode(e)),w(t)])}async function de(e){let t=await globalThis.crypto.subtle.digest(`SHA-256`,e);return new Uint8Array(t)}async function fe(e){let t=ue([w(b.encode(`seams/router-ab/ed25519-yao/application-binding/v1`)),T(`walletId`,b.encode(e.wallet_id)),T(`nearEd25519SigningKeyId`,b.encode(e.near_ed25519_signing_key_id)),T(`signingRootId`,b.encode(e.signing_root_id)),T(`keyCreationSignerSlot`,le(e.key_creation_signer_slot))]);return Array.from(await de(t))}const pe=`/router-ab/ed25519/yao/registration/admit`,me=`/router-ab/ed25519/yao/registration/execute`,he=`/router-ab/ed25519/yao/recovery/admit`,ge=`/router-ab/ed25519/yao/recovery/execute`,_e=`/router-ab/ed25519/yao/recovery/activate`,ve=`x-seams-wallet-recovery-challenge-id`,ye=`/router-ab/ed25519/yao/recovery/bootstrap`,be=`router_ab_ed25519_yao_email_otp_recovery_v1`,xe=`/router-ab/ed25519/yao/export/admit`,Se=`/router-ab/ed25519/yao/export/execute`,Ce=64*1024;function we(e,t){return e.operation===t.operation&&E(e.session_id,t.session_id)&&E(e.stable_key_context_binding,t.stable_key_context_binding)&&y(e.material_activation,t.material_activation)&&e.lifecycle.lifecycle_id===t.lifecycle.lifecycle_id&&e.lifecycle.work_kind===t.lifecycle.work_kind&&e.lifecycle.primitive_request_kind===t.lifecycle.primitive_request_kind&&e.lifecycle.root_share_epoch===t.lifecycle.root_share_epoch&&e.lifecycle.account_id===t.lifecycle.account_id&&e.lifecycle.session_id===t.lifecycle.session_id&&e.lifecycle.signer_set_id===t.lifecycle.signer_set_id&&e.lifecycle.selected_server_id===t.lifecycle.selected_server_id}function E(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function Te(e,t){return e[0]===t[0]&&e[1]===t[1]}function Ee(e,t){return e.lifecycle_id===t.lifecycle_id&&e.root_share_epoch===t.root_share_epoch&&e.account_id===t.account_id&&e.threshold_session_id===t.threshold_session_id&&e.signer_set_id===t.signer_set_id&&e.signing_worker_id===t.signing_worker_id&&y(e.material_activation,t.material_activation)}function De(e,t){return e.wallet_id===t.wallet_id&&e.near_ed25519_signing_key_id===t.near_ed25519_signing_key_id&&e.signing_root_id===t.signing_root_id&&e.key_creation_signer_slot===t.key_creation_signer_slot}function Oe(e,t){return Ee(e.scope,t.scope)&&De(e.application_binding,t.application_binding)&&Te(e.participant_ids,t.participant_ids)}const D=`registration_prepare`,ke=`registration`,O=`recovery`,Ae=`recovery`,k=`key_export`,A=`export`;function j(e,t,n){let r=new Set(n);for(let n of Object.keys(e))if(!r.has(n))throw Error(`${t}.${n} is not a supported field`);for(let r of n)if(!Object.hasOwn(e,r))throw Error(`${t}.${r} is required`)}function je(e,t){if(!Number.isInteger(e)||typeof e!=`number`||e<=0||e>4294967295)throw Error(`${t} must be a positive u32`);return e}function Me(e,t){if(typeof e!=`number`||!Number.isSafeInteger(e)||e<=0)throw Error(`${t} must be a positive safe integer`);return e}function Ne(e,t){switch(e){case`registration`:case`recovery`:case`refresh`:case`export`:case`lane_provisioning`:case`lane_refresh`:return e;default:throw Error(`${t} is invalid`)}}function Pe(e,t){switch(e){case`deriver_a`:case`deriver_b`:return e;default:throw Error(`${t} is invalid`)}}function Fe(e,t){switch(e){case`activation`:case`export`:return e;default:throw Error(`${t} is invalid`)}}function Ie(e,t){switch(e){case`activation_client`:case`activation_signing_worker`:case`export_client`:return e;default:throw Error(`${t} is invalid`)}}function Le(e,t){switch(e){case`registration_prepare`:case`key_export`:case`recovery`:case`server_share_refresh`:return e;default:throw Error(`${t} is invalid`)}}function Re(e,t){switch(e){case`registration`:case`recovery`:case`export`:case`refresh`:return e;default:throw Error(`${t} is invalid`)}}function M(e){let t=u(e,`application_binding`);return j(t,`application_binding`,[`wallet_id`,`near_ed25519_signing_key_id`,`signing_root_id`,`key_creation_signer_slot`]),{wallet_id:x(t.wallet_id,`application_binding.wallet_id`),near_ed25519_signing_key_id:x(t.near_ed25519_signing_key_id,`application_binding.near_ed25519_signing_key_id`),signing_root_id:x(t.signing_root_id,`application_binding.signing_root_id`),key_creation_signer_slot:je(t.key_creation_signer_slot,`application_binding.key_creation_signer_slot`)}}function ze(e){let t=u(e,`scope`);j(t,`scope`,[`lifecycle_id`,`root_share_epoch`,`account_id`,`threshold_session_id`,`signer_set_id`,`signing_worker_id`,`material_activation`]);let n=x(t.account_id,`scope.account_id`),r=x(t.signing_worker_id,`scope.signing_worker_id`),i=_(t.material_activation);if(i.material_owner!==n||i.signing_worker!==r)throw Error(`scope.material_activation does not match the lifecycle owner and worker`);return{lifecycle_id:x(t.lifecycle_id,`scope.lifecycle_id`),root_share_epoch:x(t.root_share_epoch,`scope.root_share_epoch`),account_id:n,threshold_session_id:x(t.threshold_session_id,`scope.threshold_session_id`),signer_set_id:x(t.signer_set_id,`scope.signer_set_id`),signing_worker_id:r,material_activation:i}}function N(e){if(!Array.isArray(e)||e.length!==2)throw Error(`participant_ids must contain exactly two values`);let t=je(e[0],`participant_ids[0]`),n=je(e[1],`participant_ids[1]`);if(t>65535||n>65535||t>=n)throw Error(`participant_ids must be distinct, nonzero, ascending u16 values`);return[t,n]}function P(e){return N(e)}function Be(e){let t=u(e,`binding.lifecycle`);j(t,`binding.lifecycle`,[`lifecycle_id`,`work_kind`,`primitive_request_kind`,`root_share_epoch`,`account_id`,`session_id`,`signer_set_id`,`selected_server_id`]);let n={lifecycle_id:x(t.lifecycle_id,`binding.lifecycle.lifecycle_id`),work_kind:Le(t.work_kind,`binding.lifecycle.work_kind`),primitive_request_kind:Re(t.primitive_request_kind,`binding.lifecycle.primitive_request_kind`),root_share_epoch:x(t.root_share_epoch,`binding.lifecycle.root_share_epoch`),account_id:x(t.account_id,`binding.lifecycle.account_id`),session_id:x(t.session_id,`binding.lifecycle.session_id`),signer_set_id:x(t.signer_set_id,`binding.lifecycle.signer_set_id`),selected_server_id:x(t.selected_server_id,`binding.lifecycle.selected_server_id`)};if(n.work_kind===D&&n.primitive_request_kind!==ke||n.work_kind===O&&n.primitive_request_kind!==Ae||n.work_kind===k&&n.primitive_request_kind!==A)throw Error(`binding.lifecycle primitive request kind does not match its work kind`);return n}function F(e){let t=u(e,`binding`);j(t,`binding`,[`lifecycle`,`operation`,`session_id`,`stable_key_context_binding`,`material_activation`]);let n={lifecycle:Be(t.lifecycle),operation:Ne(t.operation,`binding.operation`),session_id:S(t.session_id,`binding.session_id`,!0),stable_key_context_binding:S(t.stable_key_context_binding,`binding.stable_key_context_binding`,!1),material_activation:_(t.material_activation)};if(n.operation===`registration`&&n.lifecycle.work_kind!==D||n.operation===`recovery`&&n.lifecycle.work_kind!==O||n.operation===`export`&&n.lifecycle.work_kind!==k)throw Error(`binding operation does not match its lifecycle work kind`);if(n.material_activation.material_owner!==n.lifecycle.account_id||n.material_activation.signing_worker!==n.lifecycle.selected_server_id)throw Error(`binding material activation does not match its lifecycle owner and worker`);return n}function Ve(e){return F(e)}function He(e){let t=F(e);if(t.operation!==`export`||t.lifecycle.work_kind!==k||t.lifecycle.primitive_request_kind!==A)throw Error(`export binding requires the exact export lifecycle`);return{lifecycle:{lifecycle_id:t.lifecycle.lifecycle_id,work_kind:k,primitive_request_kind:A,root_share_epoch:t.lifecycle.root_share_epoch,account_id:t.lifecycle.account_id,session_id:t.lifecycle.session_id,signer_set_id:t.lifecycle.signer_set_id,selected_server_id:t.lifecycle.selected_server_id},operation:`export`,session_id:t.session_id,stable_key_context_binding:t.stable_key_context_binding,material_activation:t.material_activation}}function I(e){let t=u(e,`export binding`);return j(t,`export binding`,[`ceremony`,`registered_public_key`,`state_epoch`,`runtime_policy_binding`,`authorization_digest`]),{ceremony:He(t.ceremony),registered_public_key:S(t.registered_public_key,`export binding.registered_public_key`,!0),state_epoch:Me(t.state_epoch,`export binding.state_epoch`),runtime_policy_binding:S(t.runtime_policy_binding,`export binding.runtime_policy_binding`,!0),authorization_digest:S(t.authorization_digest,`export binding.authorization_digest`,!0)}}function L(e){let t=F(e);switch(t.operation){case`registration`:if(t.lifecycle.work_kind!==D||t.lifecycle.primitive_request_kind!==ke)throw Error(`activation binding has the wrong registration lifecycle kind`);return{lifecycle:{lifecycle_id:t.lifecycle.lifecycle_id,work_kind:D,primitive_request_kind:ke,root_share_epoch:t.lifecycle.root_share_epoch,account_id:t.lifecycle.account_id,session_id:t.lifecycle.session_id,signer_set_id:t.lifecycle.signer_set_id,selected_server_id:t.lifecycle.selected_server_id},operation:`registration`,session_id:t.session_id,stable_key_context_binding:t.stable_key_context_binding,material_activation:t.material_activation};case`recovery`:if(t.lifecycle.work_kind!==O||t.lifecycle.primitive_request_kind!==Ae)throw Error(`activation binding has the wrong recovery lifecycle kind`);return{lifecycle:{lifecycle_id:t.lifecycle.lifecycle_id,work_kind:O,primitive_request_kind:Ae,root_share_epoch:t.lifecycle.root_share_epoch,account_id:t.lifecycle.account_id,session_id:t.lifecycle.session_id,signer_set_id:t.lifecycle.signer_set_id,selected_server_id:t.lifecycle.selected_server_id},operation:`recovery`,session_id:t.session_id,stable_key_context_binding:t.stable_key_context_binding,material_activation:t.material_activation};case`refresh`:case`export`:case`lane_provisioning`:case`lane_refresh`:throw Error(`activation binding has a non-activation operation`)}}function Ue(e){let t=u(e,`keyset`);j(t,`keyset`,[`deriver_a_input_public_key`,`deriver_b_input_public_key`,`signing_worker_recipient_public_key`]);let n={deriver_a_input_public_key:S(t.deriver_a_input_public_key,`keyset.deriver_a_input_public_key`,!0),deriver_b_input_public_key:S(t.deriver_b_input_public_key,`keyset.deriver_b_input_public_key`,!0),signing_worker_recipient_public_key:S(t.signing_worker_recipient_public_key,`keyset.signing_worker_recipient_public_key`,!0)};if(C(n.deriver_a_input_public_key,n.deriver_b_input_public_key)||C(n.deriver_a_input_public_key,n.signing_worker_recipient_public_key)||C(n.deriver_b_input_public_key,n.signing_worker_recipient_public_key))throw Error(`keyset public keys must be distinct`);return n}function R(e,t){let n=u(e,t);j(n,t,[`kind`,`deriver`,`operation`,`session`,`stable_context_binding`,`encapsulated_key`,`ciphertext`]);let r={kind:Fe(n.kind,`${t}.kind`),deriver:Pe(n.deriver,`${t}.deriver`),operation:Ne(n.operation,`${t}.operation`),session:S(n.session,`${t}.session`,!0),stable_context_binding:S(n.stable_context_binding,`${t}.stable_context_binding`,!0),encapsulated_key:S(n.encapsulated_key,`${t}.encapsulated_key`,!0),ciphertext:se(n.ciphertext,`${t}.ciphertext`,16,Ce)};if(r.kind===`activation`&&r.operation===`export`||r.kind===`export`&&r.operation!==`export`)throw Error(`${t} operation does not match its circuit family`);return r}function We(e,t,n,r){if(t.kind!==`activation`||t.deriver!==n||t.operation!==e.operation||!C(t.session,e.session_id)||!C(t.stable_context_binding,e.stable_key_context_binding))throw Error(`${r} does not match the admitted activation binding`);switch(e.operation){case`registration`:return{kind:`activation`,deriver:n,operation:`registration`,session:t.session,stable_context_binding:t.stable_context_binding,encapsulated_key:t.encapsulated_key,ciphertext:t.ciphertext};case`recovery`:return{kind:`activation`,deriver:n,operation:`recovery`,session:t.session,stable_context_binding:t.stable_context_binding,encapsulated_key:t.encapsulated_key,ciphertext:t.ciphertext}}}function Ge(e,t,n,r){if(t.kind!==`export`||t.deriver!==n||t.operation!==`export`||!C(t.session,e.ceremony.session_id)||!C(t.stable_context_binding,e.ceremony.stable_key_context_binding))throw Error(`${r} does not match the admitted export binding`);return{kind:`export`,deriver:n,operation:`export`,session:t.session,stable_context_binding:t.stable_context_binding,encapsulated_key:t.encapsulated_key,ciphertext:t.ciphertext}}function z(e,t){let n=u(e,t);return j(n,t,[`kind`,`deriver`,`session`,`transcript`,`encapsulated_key`,`ciphertext`]),{kind:Ie(n.kind,`${t}.kind`),deriver:Pe(n.deriver,`${t}.deriver`),session:S(n.session,`${t}.session`,!0),transcript:S(n.transcript,`${t}.transcript`,!0),encapsulated_key:S(n.encapsulated_key,`${t}.encapsulated_key`,!0),ciphertext:se(n.ciphertext,`${t}.ciphertext`,16,Ce)}}function B(e){let t=u(e,`public_receipt`);return j(t,`public_receipt`,[`transcript`,`registered_public_key`,`joined_client_commitment`,`joined_signing_worker_commitment`,`signing_worker_verifying_share`,`state_epoch`,`material_activation`]),{transcript:S(t.transcript,`public_receipt.transcript`,!0),registered_public_key:S(t.registered_public_key,`public_receipt.registered_public_key`,!0),joined_client_commitment:S(t.joined_client_commitment,`public_receipt.joined_client_commitment`,!0),joined_signing_worker_commitment:S(t.joined_signing_worker_commitment,`public_receipt.joined_signing_worker_commitment`,!0),signing_worker_verifying_share:S(t.signing_worker_verifying_share,`public_receipt.signing_worker_verifying_share`,!0),state_epoch:Me(t.state_epoch,`public_receipt.state_epoch`),material_activation:_(t.material_activation)}}function Ke(e,t,n,r,i){if(n.kind!==`activation_client`||n.deriver!==r||!C(n.session,e.session_id)||!C(n.transcript,t.transcript))throw Error(`${i} does not match the terminal activation receipt`);return{kind:`activation_client`,deriver:r,session:n.session,transcript:n.transcript,encapsulated_key:n.encapsulated_key,ciphertext:n.ciphertext}}function qe(e,t,n,r,i){if(n.kind!==`export_client`||n.deriver!==r||!C(n.session,e.ceremony.session_id)||!C(n.transcript,t))throw Error(`${i} does not match the terminal export result`);return{kind:`export_client`,deriver:r,session:n.session,transcript:n.transcript,encapsulated_key:n.encapsulated_key,ciphertext:n.ciphertext}}function V(e,t){try{return{ok:!0,value:e(t)}}catch(e){return{ok:!1,code:`invalid_body`,message:e instanceof Error?e.message:String(e)}}}function Je(e){let t=u(e,`registration admission request`);return j(t,`registration admission request`,[`scope`,`application_binding`,`participant_ids`]),{scope:ze(t.scope),application_binding:M(t.application_binding),participant_ids:N(t.participant_ids)}}function Ye(e){let t=u(e,`recovery admission request`);j(t,`recovery admission request`,[`scope`,`active_material_activation`,`application_binding`,`participant_ids`,`active_capability_binding`,`replacement_capability_binding`,`registered_public_key`]);let n=S(t.active_capability_binding,`recovery admission request.active_capability_binding`,!0),r=S(t.replacement_capability_binding,`recovery admission request.replacement_capability_binding`,!0);if(C(n,r))throw Error(`recovery replacement capability binding must be fresh`);let i=ze(t.scope),a=_(t.active_material_activation),o=i.material_activation;if(a.activation_id===o.activation_id||a.lifecycle_binding===o.lifecycle_binding)throw Error(`recovery replacement material activation identity must be fresh`);if(a.capability!==o.capability||a.material_owner!==o.material_owner||a.key_binding!==o.key_binding||a.signing_worker!==o.signing_worker)throw Error(`recovery replacement material activation changed stable identity facts`);return{scope:i,active_material_activation:a,application_binding:M(t.application_binding),participant_ids:N(t.participant_ids),active_capability_binding:n,replacement_capability_binding:r,registered_public_key:S(t.registered_public_key,`recovery admission request.registered_public_key`,!0)}}function Xe(e){let t=u(e,`warm recovery bootstrap request`);if(j(t,`warm recovery bootstrap request`,[`kind`,`walletId`,`nearAccountId`,`nearEd25519SigningKeyId`,`signerSlot`,`thresholdSessionId`,`signingWorkerId`,`participantIds`]),t.kind!==`router_ab_ed25519_yao_warm_recovery_bootstrap_request_v1`)throw Error(`warm recovery bootstrap request.kind is invalid`);return{kind:`router_ab_ed25519_yao_warm_recovery_bootstrap_request_v1`,walletId:x(t.walletId,`warm recovery bootstrap request.walletId`),nearAccountId:x(t.nearAccountId,`warm recovery bootstrap request.nearAccountId`),nearEd25519SigningKeyId:x(t.nearEd25519SigningKeyId,`warm recovery bootstrap request.nearEd25519SigningKeyId`),signerSlot:Me(t.signerSlot,`warm recovery bootstrap request.signerSlot`),thresholdSessionId:x(t.thresholdSessionId,`warm recovery bootstrap request.thresholdSessionId`),signingWorkerId:x(t.signingWorkerId,`warm recovery bootstrap request.signingWorkerId`),participantIds:N(t.participantIds)}}function Ze(e){let t=u(e,`export admission receipt`);return j(t,`export admission receipt`,[`binding`,`keyset`]),{binding:I(t.binding),keyset:Ue(t.keyset)}}function Qe(e){let t=u(e,`export execute request`);j(t,`export execute request`,[`binding`,`deriver_a_input`,`deriver_b_input`]);let n=I(t.binding);return{binding:n,deriver_a_input:Ge(n,R(t.deriver_a_input,`deriver_a_input`),`deriver_a`,`deriver_a_input`),deriver_b_input:Ge(n,R(t.deriver_b_input,`deriver_b_input`),`deriver_b`,`deriver_b_input`)}}function $e(e){let t=u(e,`export result`);j(t,`export result`,[`binding`,`transcript`,`deriver_a_client_package`,`deriver_b_client_package`]);let n=I(t.binding),r=S(t.transcript,`export result.transcript`,!0);return{binding:n,transcript:r,deriver_a_client_package:qe(n,r,z(t.deriver_a_client_package,`deriver_a_client_package`),`deriver_a`,`deriver_a_client_package`),deriver_b_client_package:qe(n,r,z(t.deriver_b_client_package,`deriver_b_client_package`),`deriver_b`,`deriver_b_client_package`)}}function et(e){let t=u(e,`activation admission receipt`);j(t,`activation admission receipt`,[`binding`,`keyset`]);let n=L(t.binding),r=Ue(t.keyset);switch(n.operation){case`registration`:return{binding:n,keyset:r};case`recovery`:return{binding:n,keyset:r}}}function tt(e){let t=u(e,`activation execute request`);j(t,`activation execute request`,[`binding`,`deriver_a_input`,`deriver_b_input`]);let n=L(t.binding),r=We(n,R(t.deriver_a_input,`deriver_a_input`),`deriver_a`,`deriver_a_input`),i=We(n,R(t.deriver_b_input,`deriver_b_input`),`deriver_b`,`deriver_b_input`);if(n.operation===`registration`){if(r.operation!==`registration`||i.operation!==`registration`)throw Error(`activation inputs do not match registration binding`);return{binding:n,deriver_a_input:r,deriver_b_input:i}}if(r.operation!==`recovery`||i.operation!==`recovery`)throw Error(`activation inputs do not match recovery binding`);return{binding:n,deriver_a_input:r,deriver_b_input:i}}function nt(e){let t=u(e,`activation result`);j(t,`activation result`,[`binding`,`deriver_a_client_package`,`deriver_b_client_package`,`public_receipt`]);let n=L(t.binding),r=B(t.public_receipt);if(!y(n.material_activation,r.material_activation))throw Error(`activation result receipt material does not match the admitted binding`);let i=z(t.deriver_a_client_package,`deriver_a_client_package`),a=z(t.deriver_b_client_package,`deriver_b_client_package`),o=Ke(n,r,i,`deriver_a`,`deriver_a_client_package`),s=Ke(n,r,a,`deriver_b`,`deriver_b_client_package`);switch(n.operation){case`registration`:return{binding:n,deriver_a_client_package:o,deriver_b_client_package:s,public_receipt:r};case`recovery`:return{binding:n,deriver_a_client_package:o,deriver_b_client_package:s,public_receipt:r}}}function rt(e){let t=L(e);switch(t.operation){case`registration`:throw Error(`recovery activation requires a recovery binding`);case`recovery`:return t}}function it(e){let t=u(e,`recovery activation receipt`);j(t,`recovery activation receipt`,[`binding`,`public_receipt`,`active_capability_binding`,`retired_capability_binding`]);let n=S(t.active_capability_binding,`recovery activation receipt.active_capability_binding`,!0),r=S(t.retired_capability_binding,`recovery activation receipt.retired_capability_binding`,!0);if(C(n,r))throw Error(`recovery activation receipt capability bindings must be distinct`);return{binding:rt(t.binding),public_receipt:B(t.public_receipt),active_capability_binding:n,retired_capability_binding:r}}function at(e,t){return e.binding.operation===t}function ot(e,t){return e.binding.operation===t}function st(e,t){return e.binding.operation===t}function H(e){return{ok:!1,code:`invalid_body`,message:`activation value must use the ${e} operation`}}function ct(e){return V(Je,e)}function lt(e){return V(Ye,e)}function ut(e){return V(Xe,e)}function dt(e){return V(Ze,e)}function ft(e){return V(Qe,e)}function pt(e){return V($e,e)}function mt(e){return V(et,e)}function ht(e){let t=mt(e);return t.ok?at(t.value,`registration`)?{ok:!0,value:t.value}:H(`registration`):t}function gt(e){let t=mt(e);return t.ok?at(t.value,`recovery`)?{ok:!0,value:t.value}:H(`recovery`):t}function _t(e){return V(tt,e)}function vt(e){let t=_t(e);return t.ok?ot(t.value,`registration`)?{ok:!0,value:t.value}:H(`registration`):t}function yt(e){let t=_t(e);return t.ok?ot(t.value,`recovery`)?{ok:!0,value:t.value}:H(`recovery`):t}function bt(e){return V(nt,e)}function xt(e){let t=bt(e);return t.ok?st(t.value,`registration`)?{ok:!0,value:t.value}:H(`registration`):t}function St(e){let t=bt(e);return t.ok?st(t.value,`recovery`)?{ok:!0,value:t.value}:H(`recovery`):t}function Ct(e){return V(it,e)}function wt(e){return V(Tt,e)}function Tt(e){return z(e,`encrypted_package`)}const Et=`seams/linked-device/ecdsa-source-contribution-envelope/v1`;function Dt(e){let t=c(e,`linked-device ordinary source contribution`);switch(t.kind){case`linked_device_ed25519_source_contribution_v1`:return Pt(t);case`linked_device_ecdsa_source_contribution_v1`:return Ft(t);default:throw Error(`linked-device ordinary source contribution kind is invalid`)}}function Ot(e){let t=Q(e,[`state`,`reservation_id`,`participant_ids`,`activation_receipt`,`deriver_a_client_package`,`deriver_b_client_package`],`linked-device Ed25519 source-preserving reservation`);if(t.state!==`inactive`)throw Error(`linked-device Ed25519 source-preserving reservation is not inactive`);let n=B(t.activation_receipt),r=P(t.participant_ids),i=U(t.deriver_a_client_package,`deriver_a`),a=U(t.deriver_b_client_package,`deriver_b`);if(!E(n.transcript,i.transcript)||!E(n.transcript,a.transcript))throw Error(`linked-device Ed25519 reservation packages have mismatched transcripts`);return{state:`inactive`,reservationId:Z(t.reservation_id,`reservation_id`),participantIds:r,activationReceipt:n,deriver_a_client_package:i,deriver_b_client_package:a}}function kt(e){if(!Array.isArray(e)||e.length===0||e.length>2)throw Error(`linked-device ordinary source contributions must contain one or two entries`);let t=e.map(Dt),n=t.map(e=>e.keyFamily);if(new Set(n).size!==n.length)throw Error(`linked-device ordinary source contributions repeat a key family`);if(t.length===2&&(t[0]?.keyFamily!==`ed25519`||t[1]?.keyFamily!==`ecdsa_secp256k1`))throw Error(`linked-device ordinary source contributions must be Ed25519 then ECDSA`);let r=t[0];if(!r)throw Error(`linked-device ordinary source contributions are empty`);return[r,...t.slice(1)]}function At(e){let t=Q(e,[`linkSessionId`,`enrollmentId`,`sourceAuthorityId`,`source`,`target`],`linked-device ECDSA source contribution preparation`),n=Ut(t.source),r=Wt(t.target);return Zt(n.activation,r.activation),{linkSessionId:G(t.linkSessionId),enrollmentId:K(t.enrollmentId),sourceAuthorityId:q(t.sourceAuthorityId),source:n,target:r}}function jt(e){let t=c(e,`linked-device ordinary source contribution preparation`);if(t.kind===`linked_device_ed25519_source_contribution_preparation_v1`)return Nt(t);if(Object.prototype.hasOwnProperty.call(t,`source`)&&Object.prototype.hasOwnProperty.call(t,`target`))return At(t);throw Error(`linked-device ordinary source contribution preparation family is invalid`)}function Mt(e){if(!Array.isArray(e)||e.length===0||e.length>2)throw Error(`linked-device ordinary source contribution preparations must contain one or two entries`);let t=e.map(jt),n=t.map(e=>`kind`in e?`ed25519`:`ecdsa_secp256k1`);if(new Set(n).size!==n.length)throw Error(`linked-device ordinary source contribution preparations repeat a key family`);if(t.length===2&&(n[0]!==`ed25519`||n[1]!==`ecdsa_secp256k1`))throw Error(`linked-device ordinary source contribution preparations must be ordered Ed25519 then ECDSA`);let r=t[0];if(!r)throw Error(`linked-device ordinary source contribution preparation is empty`);return[r,...t.slice(1)]}function Nt(e){if(Q(e,[`kind`,`linkSessionId`,`enrollmentId`,`sourceAuthorityId`,`walletKeyId`,`targetDeviceId`,`targetFactorVerificationDigestB64u`,`sourceBinding`,`targetAdmission`,`applicationBinding`,`sourceRevocationEpoch`,`participantIds`,`targetMaterialActivation`,`targetClientRecipientPublicKeyB64u`,`targetSigningWorkerRecipientPublicKeyB64u`,`sourceRegisteredPublicKeyB64u`],`linked-device Ed25519 source contribution preparation`),e.kind!==`linked_device_ed25519_source_contribution_preparation_v1`)throw Error(`linked-device Ed25519 source contribution preparation kind is invalid`);let t=L(e.sourceBinding),n=ht(e.targetAdmission);if(!n.ok)throw Error(`targetAdmission ${n.message}`);let r=n.value,i=M(e.applicationBinding);if(typeof e.sourceRevocationEpoch!=`number`||!Number.isSafeInteger(e.sourceRevocationEpoch)||e.sourceRevocationEpoch<0)throw Error(`sourceRevocationEpoch must be a non-negative safe integer`);let a=W(e.targetMaterialActivation,`targetMaterialActivation`),s=G(e.linkSessionId),c=K(e.enrollmentId),l=q(e.sourceAuthorityId),u=$t(e.walletKeyId),d=J(e.targetDeviceId),f=Y(e.targetFactorVerificationDigestB64u,`targetFactorVerificationDigestB64u`),p=X(e.targetClientRecipientPublicKeyB64u,32,`targetClientRecipientPublicKeyB64u`),m=X(e.targetSigningWorkerRecipientPublicKeyB64u,32,`targetSigningWorkerRecipientPublicKeyB64u`);if(p===m)throw Error(`linked-device Ed25519 source contribution recipients must differ`);let h=P(e.participantIds);if(Jt(t,s,`sourceBinding`),!o(a,v(r.binding.material_activation)))throw Error(`targetAdmission activation differs from targetMaterialActivation`);if(!Yt(t,r.binding))throw Error(`source and target Ed25519 contribution bindings differ`);if(t.material_activation.activation_id===a.activationId)throw Error(`source and target Ed25519 contribution activations must differ`);return{kind:`linked_device_ed25519_source_contribution_preparation_v1`,linkSessionId:s,enrollmentId:c,sourceAuthorityId:l,walletKeyId:u,targetDeviceId:d,targetFactorVerificationDigestB64u:f,sourceBinding:t,targetAdmission:r,applicationBinding:i,sourceRevocationEpoch:e.sourceRevocationEpoch,participantIds:h,targetMaterialActivation:a,targetClientRecipientPublicKeyB64u:p,targetSigningWorkerRecipientPublicKeyB64u:m,sourceRegisteredPublicKeyB64u:ee(e.sourceRegisteredPublicKeyB64u,`sourceRegisteredPublicKeyB64u`)}}function Pt(e){if(Q(e,[`kind`,`keyFamily`,`linkSessionId`,`enrollmentId`,`sourceAuthorityId`,`walletKeyId`,`targetDeviceId`,`targetFactorVerificationDigestB64u`,`targetMaterialActivation`,`targetClientRecipientPublicKeyB64u`,`targetSigningWorkerRecipientPublicKeyB64u`,`sourceBinding`,`reservationId`,`targetBinding`,`activationReceipt`,`participantIds`,`deriver_a_client_package`,`deriver_b_client_package`,`sourceRegisteredPublicKeyB64u`],`linked-device Ed25519 source contribution`),e.kind!==`linked_device_ed25519_source_contribution_v1`)throw Error(`linked-device Ed25519 source contribution kind is invalid`);if(e.keyFamily!==`ed25519`)throw Error(`linked-device Ed25519 source contribution family is invalid`);let t=L(e.sourceBinding),n=W(e.targetMaterialActivation,`source contribution targetMaterialActivation`),r=Kt(e.targetBinding,`targetBinding`),i=B(e.activationReceipt),a=Z(e.reservationId,`reservationId`),s=P(e.participantIds),c=G(e.linkSessionId),l=K(e.enrollmentId),u=q(e.sourceAuthorityId),d=$t(e.walletKeyId),f=J(e.targetDeviceId),p=Y(e.targetFactorVerificationDigestB64u,`targetFactorVerificationDigestB64u`),h=X(e.targetClientRecipientPublicKeyB64u,32,`targetClientRecipientPublicKeyB64u`),te=X(e.targetSigningWorkerRecipientPublicKeyB64u,32,`targetSigningWorkerRecipientPublicKeyB64u`);if(h===te)throw Error(`linked-device Ed25519 source contribution recipients must differ`);if(Jt(t,c,`sourceBinding`),qt(r,c,n,`targetBinding`),!Yt(t,r))throw Error(`linked-device Ed25519 source contribution stable identity differs`);if(!o(v(i.material_activation),n))throw Error(`linked-device Ed25519 source contribution receipt activation differs`);let g=ee(e.sourceRegisteredPublicKeyB64u,`sourceRegisteredPublicKeyB64u`);if(!E(i.registered_public_key,Array.from(m(g))))throw Error(`linked-device Ed25519 source contribution receipt public key differs`);let ne=U(e.deriver_a_client_package,`deriver_a`),_=U(e.deriver_b_client_package,`deriver_b`);if(!E(i.transcript,ne.transcript)||!E(i.transcript,_.transcript))throw Error(`linked-device Ed25519 source contribution package transcript differs`);if(t.material_activation.activation_id===n.activationId)throw Error(`linked-device Ed25519 source contribution reuses the source activation`);return{kind:`linked_device_ed25519_source_contribution_v1`,keyFamily:`ed25519`,linkSessionId:c,enrollmentId:l,sourceAuthorityId:u,walletKeyId:d,targetDeviceId:f,targetFactorVerificationDigestB64u:p,targetMaterialActivation:n,targetClientRecipientPublicKeyB64u:h,targetSigningWorkerRecipientPublicKeyB64u:te,sourceBinding:t,reservationId:a,targetBinding:r,activationReceipt:i,participantIds:s,deriver_a_client_package:ne,deriver_b_client_package:_,sourceRegisteredPublicKeyB64u:g}}function Ft(e){if(Q(e,[`kind`,`keyFamily`,`linkSessionId`,`enrollmentId`,`sourceAuthorityId`,`walletKeyId`,`targetDeviceId`,`targetFactorVerificationDigestB64u`,`sourceSigner`,`sourceDerivation`,`target`,`package`],`linked-device ECDSA source contribution`),e.kind!==`linked_device_ecdsa_source_contribution_v1`)throw Error(`linked-device ECDSA source contribution kind is invalid`);if(e.keyFamily!==`ecdsa_secp256k1`)throw Error(`linked-device ECDSA source contribution family is invalid`);let t=G(e.linkSessionId),n=K(e.enrollmentId),r=q(e.sourceAuthorityId),i=$t(e.walletKeyId),a=J(e.targetDeviceId),o=Y(e.targetFactorVerificationDigestB64u,`targetFactorVerificationDigestB64u`),s=Ut(e.sourceSigner),c=It(e.sourceDerivation),l=Wt(e.target);Zt(s.activation,l.activation);let u=Vt(e.package);if(u.binding.linkSessionId!==t||u.binding.enrollmentId!==n||u.binding.sourceAuthorityId!==r||u.binding.target.targetDeviceId!==a||u.binding.target.targetFactorVerificationDigestB64u!==o)throw Error(`linked-device ECDSA source contribution package binding differs`);if(!Xt(u.binding.source,s))throw Error(`linked-device ECDSA source contribution signer differs from package binding`);if(!Qt(u.binding.target,l))throw Error(`linked-device ECDSA source contribution target differs from package binding`);return{kind:`linked_device_ecdsa_source_contribution_v1`,keyFamily:`ecdsa_secp256k1`,linkSessionId:t,enrollmentId:n,sourceAuthorityId:r,walletKeyId:i,targetDeviceId:a,targetFactorVerificationDigestB64u:o,sourceSigner:s,sourceDerivation:c,target:l,package:u}}function It(e){let t=Q(e,[`applicationBindingDigestB64u`,`clientShareRetryCounter`,`ecdsaThresholdKeyId`,`sourceNormalSigning`],`linked-device ECDSA source derivation`),n=t.clientShareRetryCounter;if(typeof n!=`number`||!Number.isSafeInteger(n)||n<0)throw Error(`linked-device ECDSA source derivation retry counter is invalid`);let r=Y(t.applicationBindingDigestB64u,`sourceDerivation.applicationBindingDigestB64u`),i=ie(t.sourceNormalSigning),a=re(t.ecdsaThresholdKeyId);if(i.scope.context.application_binding_digest_b64u!==r||i.scope.public_identity.client_share_retry_counter!==n||i.scope.ecdsa_threshold_key_id!==a)throw Error(`linked-device ECDSA source derivation differs from normal signing`);return{applicationBindingDigestB64u:r,clientShareRetryCounter:n,ecdsaThresholdKeyId:a,sourceNormalSigning:i}}function Lt(e){let t=Q(e,[`state`,`binding`,`sourceDerivation`,`targetRelayerPublicKey33B64u`,`thresholdPublicKey33B64u`,`thresholdEthereumAddress20B64u`,`normalSigning`],`linked-device ECDSA source-preserving activation receipt`);if(t.state!==`inactive`)throw Error(`linked-device ECDSA source-preserving activation receipt is not inactive`);let n=Ht(t.binding),r=It(t.sourceDerivation),i=f(t.targetRelayerPublicKey33B64u,`targetRelayerPublicKey33B64u`),a=f(t.thresholdPublicKey33B64u,`thresholdPublicKey33B64u`),o=X(t.thresholdEthereumAddress20B64u,20,`thresholdEthereumAddress20B64u`),s=ie(t.normalSigning);return Rt({binding:n,sourceDerivation:r,targetRelayerPublicKey33B64u:i,thresholdPublicKey33B64u:a,thresholdEthereumAddress20B64u:o,normalSigning:s}),{state:`inactive`,binding:n,sourceDerivation:r,targetRelayerPublicKey33B64u:i,thresholdPublicKey33B64u:a,thresholdEthereumAddress20B64u:o,normalSigning:s}}function Rt(e){let t=e.sourceDerivation.sourceNormalSigning.scope,n=e.normalSigning.scope;if(!o(v(t.material_activation),e.binding.source.activation)||!o(v(n.material_activation),e.binding.target.activation)||t.wallet_id!==n.wallet_id||t.wallet_id!==e.binding.source.activation.materialOwner||n.wallet_id!==e.binding.target.activation.materialOwner||t.ecdsa_threshold_key_id!==n.ecdsa_threshold_key_id||t.signing_root_id!==n.signing_root_id||t.signing_root_version!==n.signing_root_version||t.context.application_binding_digest_b64u!==n.context.application_binding_digest_b64u||t.activation_epoch!==n.activation_epoch||t.public_identity.derivation_client_share_public_key33_b64u!==e.binding.source.clientPublicKey33B64u||t.public_identity.server_public_key33_b64u!==e.binding.source.relayerPublicKey33B64u||t.public_identity.threshold_public_key33_b64u!==e.binding.source.thresholdPublicKey33B64u||t.public_identity.ethereum_address20_b64u!==e.binding.source.thresholdEthereumAddress20B64u||n.public_identity.context_binding_b64u!==t.public_identity.context_binding_b64u||n.public_identity.derivation_client_share_public_key33_b64u!==e.binding.targetClientPublicKey33B64u||n.public_identity.server_public_key33_b64u!==e.targetRelayerPublicKey33B64u||n.public_identity.threshold_public_key33_b64u!==e.thresholdPublicKey33B64u||n.public_identity.ethereum_address20_b64u!==e.thresholdEthereumAddress20B64u||n.public_identity.client_share_retry_counter!==t.public_identity.client_share_retry_counter||n.public_identity.server_share_retry_counter!==t.public_identity.server_share_retry_counter||n.signing_worker.server_id!==e.binding.target.activation.signingWorker||n.signing_worker.key_epoch!==t.signing_worker.key_epoch||n.signing_worker.recipient_encryption_key!==zt(e.binding.target.signingWorkerRecipientPublicKeyB64u))throw Error(`linked-device ECDSA normal signing state differs from its activation receipt`)}function zt(e){let t=m(e);if(t.length!==32||p(t)!==e)throw Error(`linked-device signing-worker recipient key is invalid`);let n=``;for(let e of t)n+=e.toString(16).padStart(2,`0`);return`x25519:${n}`}function U(e,t){let n=Bt(e,`${t} client package`);if(n.kind!==`activation_client`||n.deriver!==t)throw Error(`${t} client package is not an activation client package`);return t===`deriver_a`?{kind:`activation_client`,deriver:`deriver_a`,session:n.session,transcript:n.transcript,encapsulated_key:n.encapsulated_key,ciphertext:n.ciphertext}:{kind:`activation_client`,deriver:`deriver_b`,session:n.session,transcript:n.transcript,encapsulated_key:n.encapsulated_key,ciphertext:n.ciphertext}}function Bt(e,t){let n=wt(e);if(!n.ok)throw Error(`${t} ${n.message}`);return n.value}function Vt(e){let t=Q(e,[`binding`,`encryptedDelta`,`encryptedTargetClientShare`],`linked-device ECDSA source contribution package`),n=Ht(t.binding),r=Gt(t.encryptedDelta,`encryptedDelta`),i=Gt(t.encryptedTargetClientShare,`encryptedTargetClientShare`),a=r.bindingDigestB64u;if(i.bindingDigestB64u!==a)throw Error(`linked-device ECDSA source contribution envelope bindings differ`);if(r.recipientPublicKeyB64u!==n.target.signingWorkerRecipientPublicKeyB64u||i.recipientPublicKeyB64u!==n.target.clientRecipientPublicKeyB64u)throw Error(`linked-device ECDSA source contribution envelope recipients differ`);return{binding:n,encryptedDelta:r,encryptedTargetClientShare:i}}function Ht(e){let t=Q(e,[`linkSessionId`,`enrollmentId`,`sourceAuthorityId`,`source`,`target`,`targetClientPublicKey33B64u`],`linked-device ECDSA source contribution binding`),n=Ut(t.source),r=Wt(t.target);return Zt(n.activation,r.activation),{linkSessionId:Z(t.linkSessionId,`binding.linkSessionId`),enrollmentId:Z(t.enrollmentId,`binding.enrollmentId`),sourceAuthorityId:Z(t.sourceAuthorityId,`binding.sourceAuthorityId`),source:n,target:r,targetClientPublicKey33B64u:f(t.targetClientPublicKey33B64u,`binding.targetClientPublicKey33B64u`)}}function Ut(e){let t=Q(e,[`activation`,`clientPublicKey33B64u`,`relayerPublicKey33B64u`,`thresholdPublicKey33B64u`,`thresholdEthereumAddress20B64u`],`linked-device ECDSA source signer`);return{activation:W(t.activation,`source.activation`),clientPublicKey33B64u:f(t.clientPublicKey33B64u,`source.clientPublicKey33B64u`),relayerPublicKey33B64u:f(t.relayerPublicKey33B64u,`source.relayerPublicKey33B64u`),thresholdPublicKey33B64u:f(t.thresholdPublicKey33B64u,`source.thresholdPublicKey33B64u`),thresholdEthereumAddress20B64u:X(t.thresholdEthereumAddress20B64u,20,`source.thresholdEthereumAddress20B64u`)}}function Wt(e){let t=Q(e,[`activation`,`targetDeviceId`,`targetFactorVerificationDigestB64u`,`clientRecipientPublicKeyB64u`,`signingWorkerRecipientPublicKeyB64u`],`linked-device ECDSA target recipient`),n=X(t.clientRecipientPublicKeyB64u,32,`target.clientRecipientPublicKeyB64u`),r=X(t.signingWorkerRecipientPublicKeyB64u,32,`target.signingWorkerRecipientPublicKeyB64u`);if(n===r)throw Error(`linked-device ECDSA target recipients must differ`);return{activation:W(t.activation,`target.activation`),targetDeviceId:J(t.targetDeviceId),targetFactorVerificationDigestB64u:Y(t.targetFactorVerificationDigestB64u,`target.targetFactorVerificationDigestB64u`),clientRecipientPublicKeyB64u:n,signingWorkerRecipientPublicKeyB64u:r}}function Gt(e,t){let n=Q(e,[`kind`,`recipientPublicKeyB64u`,`bindingDigestB64u`,`encappedKeyB64u`,`ciphertextB64u`],`linked-device ECDSA ${t}`);if(n.kind!==Et)throw Error(`${t}.kind is invalid`);return{kind:Et,recipientPublicKeyB64u:X(n.recipientPublicKeyB64u,32,`${t}.recipientPublicKeyB64u`),bindingDigestB64u:Y(n.bindingDigestB64u,`${t}.bindingDigestB64u`),encappedKeyB64u:X(n.encappedKeyB64u,32,`${t}.encappedKeyB64u`),ciphertextB64u:d(n.ciphertextB64u,`${t}.ciphertextB64u`)}}function Kt(e,t){let n=L(e);if(n.operation!==`registration`)throw Error(`${t} must use the registration operation`);return n}function qt(e,t,n,r){if(e.material_activation.activation_id!==n.activationId)throw Error(`${r} activation does not match the target activation`);if(e.material_activation.material_owner!==n.materialOwner)throw Error(`${r} material owner does not match the target activation`);if(e.material_activation.signing_worker!==n.signingWorker)throw Error(`${r} signing worker does not match the target activation`);if(e.session_id.length!==32||String(t).length===0)throw Error(`${r} link binding is invalid`)}function Jt(e,t,n){if(e.session_id.length!==32||String(t).length===0)throw Error(`${n} link binding is invalid`)}function Yt(e,t){return e.stable_key_context_binding.every((e,n)=>e===t.stable_key_context_binding[n])&&e.material_activation.capability===t.material_activation.capability&&e.material_activation.material_owner===t.material_activation.material_owner&&e.material_activation.key_binding===t.material_activation.key_binding&&e.material_activation.lifecycle_binding===t.material_activation.lifecycle_binding&&e.material_activation.signing_worker===t.material_activation.signing_worker&&e.lifecycle.root_share_epoch===t.lifecycle.root_share_epoch&&e.lifecycle.account_id===t.lifecycle.account_id&&e.lifecycle.signer_set_id===t.lifecycle.signer_set_id&&e.lifecycle.selected_server_id===t.lifecycle.selected_server_id}function Xt(e,t){return o(e.activation,t.activation)&&e.clientPublicKey33B64u===t.clientPublicKey33B64u&&e.relayerPublicKey33B64u===t.relayerPublicKey33B64u&&e.thresholdPublicKey33B64u===t.thresholdPublicKey33B64u&&e.thresholdEthereumAddress20B64u===t.thresholdEthereumAddress20B64u}function Zt(e,t){if(o(e,t)||e.materialOwner!==t.materialOwner||e.signingWorker!==t.signingWorker)throw Error(`linked-device ECDSA source and target activations are invalid`)}function Qt(e,t){return o(e.activation,t.activation)&&e.targetDeviceId===t.targetDeviceId&&e.targetFactorVerificationDigestB64u===t.targetFactorVerificationDigestB64u&&e.clientRecipientPublicKeyB64u===t.clientRecipientPublicKeyB64u&&e.signingWorkerRecipientPublicKeyB64u===t.signingWorkerRecipientPublicKeyB64u}function W(e,t){let n=r(e);if(!n.ok)throw Error(`${t} ${n.error.message}`);return n.value}function G(e){let t=a(Z(e,`linkSessionId`));if(!t.ok)throw Error(`linkSessionId ${t.error.message}`);return t.value}function K(e){let t=s(Z(e,`enrollmentId`));if(!t.ok)throw Error(`enrollmentId ${t.error.message}`);return t.value}function q(t){let n=e(Z(t,`sourceAuthorityId`));if(!n.ok)throw Error(`sourceAuthorityId ${n.error.message}`);return n.value}function $t(e){let t=i(Z(e,`walletKeyId`));if(!t.ok)throw Error(`walletKeyId ${t.error.message}`);return t.value}function J(e){let t=h(Z(e,`targetDeviceId`));if(!t.ok)throw Error(`targetDeviceId ${t.error.message}`);return t.value}function Y(e,t){try{return te(e)}catch(e){throw Error(`${t} ${e instanceof Error?e.message:`is invalid`}`)}}function X(e,t,n){if(typeof e!=`string`||!/^[A-Za-z0-9_-]+$/.test(e))throw Error(`${n} must be canonical base64url`);let r;try{r=m(e)}catch{throw Error(`${n} must be canonical base64url`)}if(r.length!==t||p(r)!==e)throw Error(`${n} must decode to ${t} bytes`);return e}function Z(e,t){if(typeof e!=`string`||e.length===0||e.trim()!==e||[...e].some(e=>{let t=e.charCodeAt(0);return t<32||t===127}))throw Error(`${t} must be a non-empty visible string`);return e}function Q(e,t,n){let r=c(e,n),i=new Set(t),a=Object.keys(r);if(a.length!==t.length||a.some(e=>!i.has(e))||t.some(e=>!Object.prototype.hasOwnProperty.call(r,e)))throw Error(`${n} contains unknown or missing fields`);return r}function en(e){return!e||typeof e!=`object`||Array.isArray(e)?null:e}function $(e){return typeof e==`string`?e.trim():``}function tn(e,t){let n=$(e);return n?{ok:!0,value:n}:{ok:!1,error:{code:`missing`,message:`${t} is required`}}}function nn(e){let t=typeof e==`number`?e:Number(e);return!Number.isSafeInteger(t)||t<1?{ok:!1,error:{code:`invalid`,message:`signerSlot must be an integer >= 1`}}:{ok:!0,value:t}}function rn(e){return{ok:!1,error:{code:`invalid`,message:`${e} must be an object`}}}function an(e){let n=t(e);return n.ok?{ok:!0,value:n.value}:{ok:!1,error:n.error}}function on(e){let t=en(e);if(!t)return rn(`WalletIdentity`);let r=n(t.walletId);return r.ok?{ok:!0,value:{walletId:r.value}}:{ok:!1,error:r.error}}function sn(e){return{walletId:e.walletId}}function cn(e){return{wallet:e.wallet,rpId:e.rpId}}function ln(e){let t=$(e.credentialIdB64u);if(!t)throw Error(`credentialIdB64u is required`);return{kind:`passkey`,walletAuthMethodId:e.walletAuthMethodId,scope:e.scope,credentialIdB64u:t}}function un(e){let t=$(e.emailHashHex),n=$(e.registrationAuthorityId);if(!t)throw Error(`emailHashHex is required`);if(!n)throw Error(`registrationAuthorityId is required`);return{kind:`email_otp`,walletAuthMethodId:e.walletAuthMethodId,wallet:e.wallet,emailHashHex:t,registrationAuthorityId:n}}function dn(e){return{kind:`implicit_near_account`,wallet:e.wallet,nearAccountId:e.nearAccountId}}function fn(e){return{kind:`named_near_account`,wallet:e.wallet,nearAccountId:e.nearAccountId}}function pn(e){let t=en(e);if(!t)return rn(`NearAccountBinding`);let n=on(t.wallet);if(!n.ok)return n;let r=$(t.kind);if(r===`implicit_near_account`){let e=ne(t.nearAccountId);return e.ok?{ok:!0,value:dn({wallet:n.value,nearAccountId:e.value})}:{ok:!1,error:{code:e.code,message:e.message}}}if(r===`named_near_account`){let e=g(t.nearAccountId);return e.ok?{ok:!0,value:fn({wallet:n.value,nearAccountId:e.value})}:{ok:!1,error:{code:e.code,message:e.message}}}return{ok:!1,error:{code:`invalid`,message:`NearAccountBinding kind is invalid`}}}function mn(e){let t=nn(e.signerSlot);if(!t.ok)throw Error(t.error.message);return{kind:`near_ed25519_signer`,account:e.account,nearEd25519SigningKeyId:e.nearEd25519SigningKeyId,signerSlot:t.value}}function hn(e){let t=en(e);if(!t)return rn(`NearEd25519SignerBinding`);let n=pn(t.account);if(!n.ok)return n;let r=tn(t.nearEd25519SigningKeyId,`nearEd25519SigningKeyId`);if(!r.ok)return r;let i=nn(t.signerSlot);return i.ok?{ok:!0,value:mn({account:n.value,nearEd25519SigningKeyId:ae(r.value),signerSlot:i.value})}:i}function gn(e,t){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`${t} must be an object`);return e}function _n(e,t){let n=l(e,t);switch(n){case`sent`:case`reused`:return n;default:throw Error(`${t} must be sent or reused`)}}function vn(e,t){return{kind:`provider`,status:e,emailHint:t}}function yn(e,t){let n=gn(e,t),r=l(n.kind,`${t}.kind`),i=_n(n.status,`${t}.status`),a=l(n.emailHint,`${t}.emailHint`);switch(r){case`provider`:case`development`:if(n.otpCode!==void 0)throw Error(`${t}.otpCode is only valid for code-bearing delivery`);return vn(i,a);case`demo_code_response`:case`provider_and_demo_code`:{let e=l(n.otpCode,`${t}.otpCode`);if(!/^\d{6}$/.test(e))throw Error(`${t}.otpCode must be a 6-digit code`);return{kind:r,status:i,emailHint:a,otpCode:e}}default:throw Error(`${t}.kind is invalid`)}}function bn(e){switch(e.kind){case`provider`:return null;case`demo_code_response`:case`provider_and_demo_code`:return e.otpCode}}export{B as A,Ct as B,_e as C,pe as D,ge as E,ft as F,xt as G,lt as H,pt as I,we as J,ct as K,P as L,Ve as M,wt as N,me as O,dt as P,gt as R,Se as S,ve as T,ht as U,St as V,vt as W,Oe as X,E as Y,fe as Z,kt as _,fn as a,be as b,ln as c,an as d,Gt as f,jt as g,Mt as h,dn as i,M as j,ye as k,sn as l,Ot as m,yn as n,mn as o,Lt as p,ut as q,un as r,cn as s,bn as t,hn as u,Xt as v,he as w,xe as x,Qt as y,yt as z};
|
|
1
|
+
import{D as e,M as t,O as n,h as r,k as i,l as a,r as o,u as s}from"./domainIds-C3fUa33Q.js";import{A as c,j as l,k as u}from"./chains-CPmd4s9f.js";import{n as ee,r as d,s as f}from"./primitives-CTmDwMNc.js";import{i as p,r as m}from"./base64-BmKR3UqU.js";import{l as h}from"./capabilityKinds-D0Yrp9uf.js";import{r as te}from"./canonicalPrimitives-BMP5yILS.js";import{c as g,s as ne}from"./accountIds-Cpvlkvbe.js";import{Qt as _,Xt as re,en as v,nn as y,ot as ie}from"./emailOtpEcdsaDerivationIdentity-CupWCKNg.js";import{r as ae}from"./registrationIds-B1OpqRAt.js";const b=new TextEncoder;function x(e,t){if(typeof e!=`string`||e.length===0)throw Error(`${t} must be a non-empty visible ASCII string`);for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r<33||r>126)throw Error(`${t} must contain visible ASCII bytes`)}return e}function oe(e,t){if(typeof e!=`number`||!Number.isInteger(e)||e<0||e>255)throw Error(`${t} must be a byte`);return e}function se(e,t,n,r){if(!Array.isArray(e))throw Error(`${t} must be a byte array`);if(e.length<n||e.length>r)throw Error(`${t} has an invalid length`);let i=[];for(let n=0;n<e.length;n+=1)i.push(oe(e[n],`${t}[${n}]`));return i}function S(e,t,n){let r=se(e,t,32,32);if(n&&ce(r))throw Error(`${t} must be nonzero`);return r}function ce(e){for(let t of e)if(t!==0)return!1;return!0}function C(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(e[n]!==t[n])return!1;return!0}function le(e){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e,!1),t}function ue(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function w(e){return ue([le(e.length),e])}function T(e,t){return ue([w(b.encode(e)),w(t)])}async function de(e){let t=await globalThis.crypto.subtle.digest(`SHA-256`,e);return new Uint8Array(t)}async function fe(e){let t=ue([w(b.encode(`seams/router-ab/ed25519-yao/application-binding/v1`)),T(`walletId`,b.encode(e.wallet_id)),T(`nearEd25519SigningKeyId`,b.encode(e.near_ed25519_signing_key_id)),T(`signingRootId`,b.encode(e.signing_root_id)),T(`keyCreationSignerSlot`,le(e.key_creation_signer_slot))]);return Array.from(await de(t))}const pe=`/router-ab/ed25519/yao/registration/admit`,me=`/router-ab/ed25519/yao/registration/execute`,he=`/router-ab/ed25519/yao/recovery/admit`,ge=`/router-ab/ed25519/yao/recovery/execute`,_e=`/router-ab/ed25519/yao/recovery/activate`,ve=`x-seams-wallet-recovery-challenge-id`,ye=`/router-ab/ed25519/yao/recovery/bootstrap`,be=`router_ab_ed25519_yao_email_otp_recovery_v1`,xe=`/router-ab/ed25519/yao/export/admit`,Se=`/router-ab/ed25519/yao/export/execute`,Ce=64*1024;function we(e,t){return e.operation===t.operation&&E(e.session_id,t.session_id)&&E(e.stable_key_context_binding,t.stable_key_context_binding)&&y(e.material_activation,t.material_activation)&&e.lifecycle.lifecycle_id===t.lifecycle.lifecycle_id&&e.lifecycle.work_kind===t.lifecycle.work_kind&&e.lifecycle.primitive_request_kind===t.lifecycle.primitive_request_kind&&e.lifecycle.root_share_epoch===t.lifecycle.root_share_epoch&&e.lifecycle.account_id===t.lifecycle.account_id&&e.lifecycle.session_id===t.lifecycle.session_id&&e.lifecycle.signer_set_id===t.lifecycle.signer_set_id&&e.lifecycle.selected_server_id===t.lifecycle.selected_server_id}function E(e,t){return e.length===t.length&&e.every((e,n)=>e===t[n])}function Te(e,t){return e[0]===t[0]&&e[1]===t[1]}function Ee(e,t){return e.lifecycle_id===t.lifecycle_id&&e.root_share_epoch===t.root_share_epoch&&e.account_id===t.account_id&&e.threshold_session_id===t.threshold_session_id&&e.signer_set_id===t.signer_set_id&&e.signing_worker_id===t.signing_worker_id&&y(e.material_activation,t.material_activation)}function De(e,t){return e.wallet_id===t.wallet_id&&e.near_ed25519_signing_key_id===t.near_ed25519_signing_key_id&&e.signing_root_id===t.signing_root_id&&e.key_creation_signer_slot===t.key_creation_signer_slot}function Oe(e,t){return Ee(e.scope,t.scope)&&De(e.application_binding,t.application_binding)&&Te(e.participant_ids,t.participant_ids)}const D=`registration_prepare`,ke=`registration`,O=`recovery`,Ae=`recovery`,k=`key_export`,A=`export`;function j(e,t,n){let r=new Set(n);for(let n of Object.keys(e))if(!r.has(n))throw Error(`${t}.${n} is not a supported field`);for(let r of n)if(!Object.hasOwn(e,r))throw Error(`${t}.${r} is required`)}function je(e,t){if(!Number.isInteger(e)||typeof e!=`number`||e<=0||e>4294967295)throw Error(`${t} must be a positive u32`);return e}function Me(e,t){if(typeof e!=`number`||!Number.isSafeInteger(e)||e<=0)throw Error(`${t} must be a positive safe integer`);return e}function Ne(e,t){switch(e){case`registration`:case`recovery`:case`refresh`:case`export`:case`lane_provisioning`:case`lane_refresh`:return e;default:throw Error(`${t} is invalid`)}}function Pe(e,t){switch(e){case`deriver_a`:case`deriver_b`:return e;default:throw Error(`${t} is invalid`)}}function Fe(e,t){switch(e){case`activation`:case`export`:return e;default:throw Error(`${t} is invalid`)}}function Ie(e,t){switch(e){case`activation_client`:case`activation_signing_worker`:case`export_client`:return e;default:throw Error(`${t} is invalid`)}}function Le(e,t){switch(e){case`registration_prepare`:case`key_export`:case`recovery`:case`server_share_refresh`:return e;default:throw Error(`${t} is invalid`)}}function Re(e,t){switch(e){case`registration`:case`recovery`:case`export`:case`refresh`:return e;default:throw Error(`${t} is invalid`)}}function M(e){let t=u(e,`application_binding`);return j(t,`application_binding`,[`wallet_id`,`near_ed25519_signing_key_id`,`signing_root_id`,`key_creation_signer_slot`]),{wallet_id:x(t.wallet_id,`application_binding.wallet_id`),near_ed25519_signing_key_id:x(t.near_ed25519_signing_key_id,`application_binding.near_ed25519_signing_key_id`),signing_root_id:x(t.signing_root_id,`application_binding.signing_root_id`),key_creation_signer_slot:je(t.key_creation_signer_slot,`application_binding.key_creation_signer_slot`)}}function ze(e){let t=u(e,`scope`);j(t,`scope`,[`lifecycle_id`,`root_share_epoch`,`account_id`,`threshold_session_id`,`signer_set_id`,`signing_worker_id`,`material_activation`]);let n=x(t.account_id,`scope.account_id`),r=x(t.signing_worker_id,`scope.signing_worker_id`),i=_(t.material_activation);if(i.material_owner!==n||i.signing_worker!==r)throw Error(`scope.material_activation does not match the lifecycle owner and worker`);return{lifecycle_id:x(t.lifecycle_id,`scope.lifecycle_id`),root_share_epoch:x(t.root_share_epoch,`scope.root_share_epoch`),account_id:n,threshold_session_id:x(t.threshold_session_id,`scope.threshold_session_id`),signer_set_id:x(t.signer_set_id,`scope.signer_set_id`),signing_worker_id:r,material_activation:i}}function N(e){if(!Array.isArray(e)||e.length!==2)throw Error(`participant_ids must contain exactly two values`);let t=je(e[0],`participant_ids[0]`),n=je(e[1],`participant_ids[1]`);if(t>65535||n>65535||t>=n)throw Error(`participant_ids must be distinct, nonzero, ascending u16 values`);return[t,n]}function P(e){return N(e)}function Be(e){let t=u(e,`binding.lifecycle`);j(t,`binding.lifecycle`,[`lifecycle_id`,`work_kind`,`primitive_request_kind`,`root_share_epoch`,`account_id`,`session_id`,`signer_set_id`,`selected_server_id`]);let n={lifecycle_id:x(t.lifecycle_id,`binding.lifecycle.lifecycle_id`),work_kind:Le(t.work_kind,`binding.lifecycle.work_kind`),primitive_request_kind:Re(t.primitive_request_kind,`binding.lifecycle.primitive_request_kind`),root_share_epoch:x(t.root_share_epoch,`binding.lifecycle.root_share_epoch`),account_id:x(t.account_id,`binding.lifecycle.account_id`),session_id:x(t.session_id,`binding.lifecycle.session_id`),signer_set_id:x(t.signer_set_id,`binding.lifecycle.signer_set_id`),selected_server_id:x(t.selected_server_id,`binding.lifecycle.selected_server_id`)};if(n.work_kind===D&&n.primitive_request_kind!==ke||n.work_kind===O&&n.primitive_request_kind!==Ae||n.work_kind===k&&n.primitive_request_kind!==A)throw Error(`binding.lifecycle primitive request kind does not match its work kind`);return n}function F(e){let t=u(e,`binding`);j(t,`binding`,[`lifecycle`,`operation`,`session_id`,`stable_key_context_binding`,`material_activation`]);let n={lifecycle:Be(t.lifecycle),operation:Ne(t.operation,`binding.operation`),session_id:S(t.session_id,`binding.session_id`,!0),stable_key_context_binding:S(t.stable_key_context_binding,`binding.stable_key_context_binding`,!1),material_activation:_(t.material_activation)};if(n.operation===`registration`&&n.lifecycle.work_kind!==D||n.operation===`recovery`&&n.lifecycle.work_kind!==O||n.operation===`export`&&n.lifecycle.work_kind!==k)throw Error(`binding operation does not match its lifecycle work kind`);if(n.material_activation.material_owner!==n.lifecycle.account_id||n.material_activation.signing_worker!==n.lifecycle.selected_server_id)throw Error(`binding material activation does not match its lifecycle owner and worker`);return n}function Ve(e){return F(e)}function He(e){let t=F(e);if(t.operation!==`export`||t.lifecycle.work_kind!==k||t.lifecycle.primitive_request_kind!==A)throw Error(`export binding requires the exact export lifecycle`);return{lifecycle:{lifecycle_id:t.lifecycle.lifecycle_id,work_kind:k,primitive_request_kind:A,root_share_epoch:t.lifecycle.root_share_epoch,account_id:t.lifecycle.account_id,session_id:t.lifecycle.session_id,signer_set_id:t.lifecycle.signer_set_id,selected_server_id:t.lifecycle.selected_server_id},operation:`export`,session_id:t.session_id,stable_key_context_binding:t.stable_key_context_binding,material_activation:t.material_activation}}function I(e){let t=u(e,`export binding`);return j(t,`export binding`,[`ceremony`,`registered_public_key`,`state_epoch`,`runtime_policy_binding`,`authorization_digest`]),{ceremony:He(t.ceremony),registered_public_key:S(t.registered_public_key,`export binding.registered_public_key`,!0),state_epoch:Me(t.state_epoch,`export binding.state_epoch`),runtime_policy_binding:S(t.runtime_policy_binding,`export binding.runtime_policy_binding`,!0),authorization_digest:S(t.authorization_digest,`export binding.authorization_digest`,!0)}}function L(e){let t=F(e);switch(t.operation){case`registration`:if(t.lifecycle.work_kind!==D||t.lifecycle.primitive_request_kind!==ke)throw Error(`activation binding has the wrong registration lifecycle kind`);return{lifecycle:{lifecycle_id:t.lifecycle.lifecycle_id,work_kind:D,primitive_request_kind:ke,root_share_epoch:t.lifecycle.root_share_epoch,account_id:t.lifecycle.account_id,session_id:t.lifecycle.session_id,signer_set_id:t.lifecycle.signer_set_id,selected_server_id:t.lifecycle.selected_server_id},operation:`registration`,session_id:t.session_id,stable_key_context_binding:t.stable_key_context_binding,material_activation:t.material_activation};case`recovery`:if(t.lifecycle.work_kind!==O||t.lifecycle.primitive_request_kind!==Ae)throw Error(`activation binding has the wrong recovery lifecycle kind`);return{lifecycle:{lifecycle_id:t.lifecycle.lifecycle_id,work_kind:O,primitive_request_kind:Ae,root_share_epoch:t.lifecycle.root_share_epoch,account_id:t.lifecycle.account_id,session_id:t.lifecycle.session_id,signer_set_id:t.lifecycle.signer_set_id,selected_server_id:t.lifecycle.selected_server_id},operation:`recovery`,session_id:t.session_id,stable_key_context_binding:t.stable_key_context_binding,material_activation:t.material_activation};case`refresh`:case`export`:case`lane_provisioning`:case`lane_refresh`:throw Error(`activation binding has a non-activation operation`)}}function Ue(e){let t=u(e,`keyset`);j(t,`keyset`,[`deriver_a_input_public_key`,`deriver_b_input_public_key`,`signing_worker_recipient_public_key`]);let n={deriver_a_input_public_key:S(t.deriver_a_input_public_key,`keyset.deriver_a_input_public_key`,!0),deriver_b_input_public_key:S(t.deriver_b_input_public_key,`keyset.deriver_b_input_public_key`,!0),signing_worker_recipient_public_key:S(t.signing_worker_recipient_public_key,`keyset.signing_worker_recipient_public_key`,!0)};if(C(n.deriver_a_input_public_key,n.deriver_b_input_public_key)||C(n.deriver_a_input_public_key,n.signing_worker_recipient_public_key)||C(n.deriver_b_input_public_key,n.signing_worker_recipient_public_key))throw Error(`keyset public keys must be distinct`);return n}function R(e,t){let n=u(e,t);j(n,t,[`kind`,`deriver`,`operation`,`session`,`stable_context_binding`,`encapsulated_key`,`ciphertext`]);let r={kind:Fe(n.kind,`${t}.kind`),deriver:Pe(n.deriver,`${t}.deriver`),operation:Ne(n.operation,`${t}.operation`),session:S(n.session,`${t}.session`,!0),stable_context_binding:S(n.stable_context_binding,`${t}.stable_context_binding`,!0),encapsulated_key:S(n.encapsulated_key,`${t}.encapsulated_key`,!0),ciphertext:se(n.ciphertext,`${t}.ciphertext`,16,Ce)};if(r.kind===`activation`&&r.operation===`export`||r.kind===`export`&&r.operation!==`export`)throw Error(`${t} operation does not match its circuit family`);return r}function We(e,t,n,r){if(t.kind!==`activation`||t.deriver!==n||t.operation!==e.operation||!C(t.session,e.session_id)||!C(t.stable_context_binding,e.stable_key_context_binding))throw Error(`${r} does not match the admitted activation binding`);switch(e.operation){case`registration`:return{kind:`activation`,deriver:n,operation:`registration`,session:t.session,stable_context_binding:t.stable_context_binding,encapsulated_key:t.encapsulated_key,ciphertext:t.ciphertext};case`recovery`:return{kind:`activation`,deriver:n,operation:`recovery`,session:t.session,stable_context_binding:t.stable_context_binding,encapsulated_key:t.encapsulated_key,ciphertext:t.ciphertext}}}function Ge(e,t,n,r){if(t.kind!==`export`||t.deriver!==n||t.operation!==`export`||!C(t.session,e.ceremony.session_id)||!C(t.stable_context_binding,e.ceremony.stable_key_context_binding))throw Error(`${r} does not match the admitted export binding`);return{kind:`export`,deriver:n,operation:`export`,session:t.session,stable_context_binding:t.stable_context_binding,encapsulated_key:t.encapsulated_key,ciphertext:t.ciphertext}}function z(e,t){let n=u(e,t);return j(n,t,[`kind`,`deriver`,`session`,`transcript`,`encapsulated_key`,`ciphertext`]),{kind:Ie(n.kind,`${t}.kind`),deriver:Pe(n.deriver,`${t}.deriver`),session:S(n.session,`${t}.session`,!0),transcript:S(n.transcript,`${t}.transcript`,!0),encapsulated_key:S(n.encapsulated_key,`${t}.encapsulated_key`,!0),ciphertext:se(n.ciphertext,`${t}.ciphertext`,16,Ce)}}function B(e){let t=u(e,`public_receipt`);return j(t,`public_receipt`,[`transcript`,`registered_public_key`,`joined_client_commitment`,`joined_signing_worker_commitment`,`signing_worker_verifying_share`,`state_epoch`,`material_activation`]),{transcript:S(t.transcript,`public_receipt.transcript`,!0),registered_public_key:S(t.registered_public_key,`public_receipt.registered_public_key`,!0),joined_client_commitment:S(t.joined_client_commitment,`public_receipt.joined_client_commitment`,!0),joined_signing_worker_commitment:S(t.joined_signing_worker_commitment,`public_receipt.joined_signing_worker_commitment`,!0),signing_worker_verifying_share:S(t.signing_worker_verifying_share,`public_receipt.signing_worker_verifying_share`,!0),state_epoch:Me(t.state_epoch,`public_receipt.state_epoch`),material_activation:_(t.material_activation)}}function Ke(e,t,n,r,i){if(n.kind!==`activation_client`||n.deriver!==r||!C(n.session,e.session_id)||!C(n.transcript,t.transcript))throw Error(`${i} does not match the terminal activation receipt`);return{kind:`activation_client`,deriver:r,session:n.session,transcript:n.transcript,encapsulated_key:n.encapsulated_key,ciphertext:n.ciphertext}}function qe(e,t,n,r,i){if(n.kind!==`export_client`||n.deriver!==r||!C(n.session,e.ceremony.session_id)||!C(n.transcript,t))throw Error(`${i} does not match the terminal export result`);return{kind:`export_client`,deriver:r,session:n.session,transcript:n.transcript,encapsulated_key:n.encapsulated_key,ciphertext:n.ciphertext}}function V(e,t){try{return{ok:!0,value:e(t)}}catch(e){return{ok:!1,code:`invalid_body`,message:e instanceof Error?e.message:String(e)}}}function Je(e){let t=u(e,`registration admission request`);return j(t,`registration admission request`,[`scope`,`application_binding`,`participant_ids`]),{scope:ze(t.scope),application_binding:M(t.application_binding),participant_ids:N(t.participant_ids)}}function Ye(e){let t=u(e,`recovery admission request`);j(t,`recovery admission request`,[`scope`,`active_material_activation`,`application_binding`,`participant_ids`,`active_capability_binding`,`replacement_capability_binding`,`registered_public_key`]);let n=S(t.active_capability_binding,`recovery admission request.active_capability_binding`,!0),r=S(t.replacement_capability_binding,`recovery admission request.replacement_capability_binding`,!0);if(C(n,r))throw Error(`recovery replacement capability binding must be fresh`);let i=ze(t.scope),a=_(t.active_material_activation),o=i.material_activation;if(a.activation_id===o.activation_id||a.lifecycle_binding===o.lifecycle_binding)throw Error(`recovery replacement material activation identity must be fresh`);if(a.capability!==o.capability||a.material_owner!==o.material_owner||a.key_binding!==o.key_binding||a.signing_worker!==o.signing_worker)throw Error(`recovery replacement material activation changed stable identity facts`);return{scope:i,active_material_activation:a,application_binding:M(t.application_binding),participant_ids:N(t.participant_ids),active_capability_binding:n,replacement_capability_binding:r,registered_public_key:S(t.registered_public_key,`recovery admission request.registered_public_key`,!0)}}function Xe(e){let t=u(e,`warm recovery bootstrap request`);if(j(t,`warm recovery bootstrap request`,[`kind`,`walletId`,`nearAccountId`,`nearEd25519SigningKeyId`,`signerSlot`,`thresholdSessionId`,`signingWorkerId`,`participantIds`]),t.kind!==`router_ab_ed25519_yao_warm_recovery_bootstrap_request_v1`)throw Error(`warm recovery bootstrap request.kind is invalid`);return{kind:`router_ab_ed25519_yao_warm_recovery_bootstrap_request_v1`,walletId:x(t.walletId,`warm recovery bootstrap request.walletId`),nearAccountId:x(t.nearAccountId,`warm recovery bootstrap request.nearAccountId`),nearEd25519SigningKeyId:x(t.nearEd25519SigningKeyId,`warm recovery bootstrap request.nearEd25519SigningKeyId`),signerSlot:Me(t.signerSlot,`warm recovery bootstrap request.signerSlot`),thresholdSessionId:x(t.thresholdSessionId,`warm recovery bootstrap request.thresholdSessionId`),signingWorkerId:x(t.signingWorkerId,`warm recovery bootstrap request.signingWorkerId`),participantIds:N(t.participantIds)}}function Ze(e){let t=u(e,`export admission receipt`);return j(t,`export admission receipt`,[`binding`,`keyset`]),{binding:I(t.binding),keyset:Ue(t.keyset)}}function Qe(e){let t=u(e,`export execute request`);j(t,`export execute request`,[`binding`,`deriver_a_input`,`deriver_b_input`]);let n=I(t.binding);return{binding:n,deriver_a_input:Ge(n,R(t.deriver_a_input,`deriver_a_input`),`deriver_a`,`deriver_a_input`),deriver_b_input:Ge(n,R(t.deriver_b_input,`deriver_b_input`),`deriver_b`,`deriver_b_input`)}}function $e(e){let t=u(e,`export result`);j(t,`export result`,[`binding`,`transcript`,`deriver_a_client_package`,`deriver_b_client_package`]);let n=I(t.binding),r=S(t.transcript,`export result.transcript`,!0);return{binding:n,transcript:r,deriver_a_client_package:qe(n,r,z(t.deriver_a_client_package,`deriver_a_client_package`),`deriver_a`,`deriver_a_client_package`),deriver_b_client_package:qe(n,r,z(t.deriver_b_client_package,`deriver_b_client_package`),`deriver_b`,`deriver_b_client_package`)}}function et(e){let t=u(e,`activation admission receipt`);j(t,`activation admission receipt`,[`binding`,`keyset`]);let n=L(t.binding),r=Ue(t.keyset);switch(n.operation){case`registration`:return{binding:n,keyset:r};case`recovery`:return{binding:n,keyset:r}}}function tt(e){let t=u(e,`activation execute request`);j(t,`activation execute request`,[`binding`,`deriver_a_input`,`deriver_b_input`]);let n=L(t.binding),r=We(n,R(t.deriver_a_input,`deriver_a_input`),`deriver_a`,`deriver_a_input`),i=We(n,R(t.deriver_b_input,`deriver_b_input`),`deriver_b`,`deriver_b_input`);if(n.operation===`registration`){if(r.operation!==`registration`||i.operation!==`registration`)throw Error(`activation inputs do not match registration binding`);return{binding:n,deriver_a_input:r,deriver_b_input:i}}if(r.operation!==`recovery`||i.operation!==`recovery`)throw Error(`activation inputs do not match recovery binding`);return{binding:n,deriver_a_input:r,deriver_b_input:i}}function nt(e){let t=u(e,`activation result`);j(t,`activation result`,[`binding`,`deriver_a_client_package`,`deriver_b_client_package`,`public_receipt`]);let n=L(t.binding),r=B(t.public_receipt);if(!y(n.material_activation,r.material_activation))throw Error(`activation result receipt material does not match the admitted binding`);let i=z(t.deriver_a_client_package,`deriver_a_client_package`),a=z(t.deriver_b_client_package,`deriver_b_client_package`),o=Ke(n,r,i,`deriver_a`,`deriver_a_client_package`),s=Ke(n,r,a,`deriver_b`,`deriver_b_client_package`);switch(n.operation){case`registration`:return{binding:n,deriver_a_client_package:o,deriver_b_client_package:s,public_receipt:r};case`recovery`:return{binding:n,deriver_a_client_package:o,deriver_b_client_package:s,public_receipt:r}}}function rt(e){let t=L(e);switch(t.operation){case`registration`:throw Error(`recovery activation requires a recovery binding`);case`recovery`:return t}}function it(e){let t=u(e,`recovery activation receipt`);j(t,`recovery activation receipt`,[`binding`,`public_receipt`,`active_capability_binding`,`retired_capability_binding`]);let n=S(t.active_capability_binding,`recovery activation receipt.active_capability_binding`,!0),r=S(t.retired_capability_binding,`recovery activation receipt.retired_capability_binding`,!0);if(C(n,r))throw Error(`recovery activation receipt capability bindings must be distinct`);return{binding:rt(t.binding),public_receipt:B(t.public_receipt),active_capability_binding:n,retired_capability_binding:r}}function at(e,t){return e.binding.operation===t}function ot(e,t){return e.binding.operation===t}function st(e,t){return e.binding.operation===t}function H(e){return{ok:!1,code:`invalid_body`,message:`activation value must use the ${e} operation`}}function ct(e){return V(Je,e)}function lt(e){return V(Ye,e)}function ut(e){return V(Xe,e)}function dt(e){return V(Ze,e)}function ft(e){return V(Qe,e)}function pt(e){return V($e,e)}function mt(e){return V(et,e)}function ht(e){let t=mt(e);return t.ok?at(t.value,`registration`)?{ok:!0,value:t.value}:H(`registration`):t}function gt(e){let t=mt(e);return t.ok?at(t.value,`recovery`)?{ok:!0,value:t.value}:H(`recovery`):t}function _t(e){return V(tt,e)}function vt(e){let t=_t(e);return t.ok?ot(t.value,`registration`)?{ok:!0,value:t.value}:H(`registration`):t}function yt(e){let t=_t(e);return t.ok?ot(t.value,`recovery`)?{ok:!0,value:t.value}:H(`recovery`):t}function bt(e){return V(nt,e)}function xt(e){let t=bt(e);return t.ok?st(t.value,`registration`)?{ok:!0,value:t.value}:H(`registration`):t}function St(e){let t=bt(e);return t.ok?st(t.value,`recovery`)?{ok:!0,value:t.value}:H(`recovery`):t}function Ct(e){return V(it,e)}function wt(e){return V(Tt,e)}function Tt(e){return z(e,`encrypted_package`)}const Et=`seams/linked-device/ecdsa-source-contribution-envelope/v1`;function Dt(e){let t=c(e,`linked-device ordinary source contribution`);switch(t.kind){case`linked_device_ed25519_source_contribution_v1`:return Pt(t);case`linked_device_ecdsa_source_contribution_v1`:return Ft(t);default:throw Error(`linked-device ordinary source contribution kind is invalid`)}}function Ot(e){let t=Q(e,[`state`,`reservation_id`,`participant_ids`,`activation_receipt`,`deriver_a_client_package`,`deriver_b_client_package`],`linked-device Ed25519 source-preserving reservation`);if(t.state!==`inactive`)throw Error(`linked-device Ed25519 source-preserving reservation is not inactive`);let n=B(t.activation_receipt),r=P(t.participant_ids),i=U(t.deriver_a_client_package,`deriver_a`),a=U(t.deriver_b_client_package,`deriver_b`);if(!E(n.transcript,i.transcript)||!E(n.transcript,a.transcript))throw Error(`linked-device Ed25519 reservation packages have mismatched transcripts`);return{state:`inactive`,reservationId:Z(t.reservation_id,`reservation_id`),participantIds:r,activationReceipt:n,deriver_a_client_package:i,deriver_b_client_package:a}}function kt(e){if(!Array.isArray(e)||e.length===0||e.length>2)throw Error(`linked-device ordinary source contributions must contain one or two entries`);let t=e.map(Dt),n=t.map(e=>e.keyFamily);if(new Set(n).size!==n.length)throw Error(`linked-device ordinary source contributions repeat a key family`);if(t.length===2&&(t[0]?.keyFamily!==`ed25519`||t[1]?.keyFamily!==`ecdsa_secp256k1`))throw Error(`linked-device ordinary source contributions must be Ed25519 then ECDSA`);let r=t[0];if(!r)throw Error(`linked-device ordinary source contributions are empty`);return[r,...t.slice(1)]}function At(e){let t=Q(e,[`linkSessionId`,`enrollmentId`,`sourceAuthorityId`,`source`,`target`],`linked-device ECDSA source contribution preparation`),n=Ut(t.source),r=Wt(t.target);return Zt(n.activation,r.activation),{linkSessionId:G(t.linkSessionId),enrollmentId:K(t.enrollmentId),sourceAuthorityId:q(t.sourceAuthorityId),source:n,target:r}}function jt(e){let t=c(e,`linked-device ordinary source contribution preparation`);if(t.kind===`linked_device_ed25519_source_contribution_preparation_v1`)return Nt(t);if(Object.prototype.hasOwnProperty.call(t,`source`)&&Object.prototype.hasOwnProperty.call(t,`target`))return At(t);throw Error(`linked-device ordinary source contribution preparation family is invalid`)}function Mt(e){if(!Array.isArray(e)||e.length===0||e.length>2)throw Error(`linked-device ordinary source contribution preparations must contain one or two entries`);let t=e.map(jt),n=t.map(e=>`kind`in e?`ed25519`:`ecdsa_secp256k1`);if(new Set(n).size!==n.length)throw Error(`linked-device ordinary source contribution preparations repeat a key family`);if(t.length===2&&(n[0]!==`ed25519`||n[1]!==`ecdsa_secp256k1`))throw Error(`linked-device ordinary source contribution preparations must be ordered Ed25519 then ECDSA`);let r=t[0];if(!r)throw Error(`linked-device ordinary source contribution preparation is empty`);return[r,...t.slice(1)]}function Nt(e){if(Q(e,[`kind`,`linkSessionId`,`enrollmentId`,`sourceAuthorityId`,`walletKeyId`,`targetDeviceId`,`targetFactorVerificationDigestB64u`,`sourceBinding`,`targetAdmission`,`applicationBinding`,`sourceRevocationEpoch`,`participantIds`,`targetMaterialActivation`,`targetClientRecipientPublicKeyB64u`,`targetSigningWorkerRecipientPublicKeyB64u`,`sourceRegisteredPublicKeyB64u`],`linked-device Ed25519 source contribution preparation`),e.kind!==`linked_device_ed25519_source_contribution_preparation_v1`)throw Error(`linked-device Ed25519 source contribution preparation kind is invalid`);let t=L(e.sourceBinding),n=ht(e.targetAdmission);if(!n.ok)throw Error(`targetAdmission ${n.message}`);let r=n.value,i=M(e.applicationBinding);if(typeof e.sourceRevocationEpoch!=`number`||!Number.isSafeInteger(e.sourceRevocationEpoch)||e.sourceRevocationEpoch<0)throw Error(`sourceRevocationEpoch must be a non-negative safe integer`);let a=W(e.targetMaterialActivation,`targetMaterialActivation`),s=G(e.linkSessionId),c=K(e.enrollmentId),l=q(e.sourceAuthorityId),u=$t(e.walletKeyId),d=J(e.targetDeviceId),f=Y(e.targetFactorVerificationDigestB64u,`targetFactorVerificationDigestB64u`),p=X(e.targetClientRecipientPublicKeyB64u,32,`targetClientRecipientPublicKeyB64u`),m=X(e.targetSigningWorkerRecipientPublicKeyB64u,32,`targetSigningWorkerRecipientPublicKeyB64u`);if(p===m)throw Error(`linked-device Ed25519 source contribution recipients must differ`);let h=P(e.participantIds);if(Jt(t,s,`sourceBinding`),!o(a,v(r.binding.material_activation)))throw Error(`targetAdmission activation differs from targetMaterialActivation`);if(!Yt(t,r.binding))throw Error(`source and target Ed25519 contribution bindings differ`);if(t.material_activation.activation_id===a.activationId)throw Error(`source and target Ed25519 contribution activations must differ`);return{kind:`linked_device_ed25519_source_contribution_preparation_v1`,linkSessionId:s,enrollmentId:c,sourceAuthorityId:l,walletKeyId:u,targetDeviceId:d,targetFactorVerificationDigestB64u:f,sourceBinding:t,targetAdmission:r,applicationBinding:i,sourceRevocationEpoch:e.sourceRevocationEpoch,participantIds:h,targetMaterialActivation:a,targetClientRecipientPublicKeyB64u:p,targetSigningWorkerRecipientPublicKeyB64u:m,sourceRegisteredPublicKeyB64u:ee(e.sourceRegisteredPublicKeyB64u,`sourceRegisteredPublicKeyB64u`)}}function Pt(e){if(Q(e,[`kind`,`keyFamily`,`linkSessionId`,`enrollmentId`,`sourceAuthorityId`,`walletKeyId`,`targetDeviceId`,`targetFactorVerificationDigestB64u`,`targetMaterialActivation`,`targetClientRecipientPublicKeyB64u`,`targetSigningWorkerRecipientPublicKeyB64u`,`sourceBinding`,`reservationId`,`targetBinding`,`activationReceipt`,`participantIds`,`deriver_a_client_package`,`deriver_b_client_package`,`sourceRegisteredPublicKeyB64u`],`linked-device Ed25519 source contribution`),e.kind!==`linked_device_ed25519_source_contribution_v1`)throw Error(`linked-device Ed25519 source contribution kind is invalid`);if(e.keyFamily!==`ed25519`)throw Error(`linked-device Ed25519 source contribution family is invalid`);let t=L(e.sourceBinding),n=W(e.targetMaterialActivation,`source contribution targetMaterialActivation`),r=Kt(e.targetBinding,`targetBinding`),i=B(e.activationReceipt),a=Z(e.reservationId,`reservationId`),s=P(e.participantIds),c=G(e.linkSessionId),l=K(e.enrollmentId),u=q(e.sourceAuthorityId),d=$t(e.walletKeyId),f=J(e.targetDeviceId),p=Y(e.targetFactorVerificationDigestB64u,`targetFactorVerificationDigestB64u`),h=X(e.targetClientRecipientPublicKeyB64u,32,`targetClientRecipientPublicKeyB64u`),te=X(e.targetSigningWorkerRecipientPublicKeyB64u,32,`targetSigningWorkerRecipientPublicKeyB64u`);if(h===te)throw Error(`linked-device Ed25519 source contribution recipients must differ`);if(Jt(t,c,`sourceBinding`),qt(r,c,n,`targetBinding`),!Yt(t,r))throw Error(`linked-device Ed25519 source contribution stable identity differs`);if(!o(v(i.material_activation),n))throw Error(`linked-device Ed25519 source contribution receipt activation differs`);let g=ee(e.sourceRegisteredPublicKeyB64u,`sourceRegisteredPublicKeyB64u`);if(!E(i.registered_public_key,Array.from(m(g))))throw Error(`linked-device Ed25519 source contribution receipt public key differs`);let ne=U(e.deriver_a_client_package,`deriver_a`),_=U(e.deriver_b_client_package,`deriver_b`);if(!E(i.transcript,ne.transcript)||!E(i.transcript,_.transcript))throw Error(`linked-device Ed25519 source contribution package transcript differs`);if(t.material_activation.activation_id===n.activationId)throw Error(`linked-device Ed25519 source contribution reuses the source activation`);return{kind:`linked_device_ed25519_source_contribution_v1`,keyFamily:`ed25519`,linkSessionId:c,enrollmentId:l,sourceAuthorityId:u,walletKeyId:d,targetDeviceId:f,targetFactorVerificationDigestB64u:p,targetMaterialActivation:n,targetClientRecipientPublicKeyB64u:h,targetSigningWorkerRecipientPublicKeyB64u:te,sourceBinding:t,reservationId:a,targetBinding:r,activationReceipt:i,participantIds:s,deriver_a_client_package:ne,deriver_b_client_package:_,sourceRegisteredPublicKeyB64u:g}}function Ft(e){if(Q(e,[`kind`,`keyFamily`,`linkSessionId`,`enrollmentId`,`sourceAuthorityId`,`walletKeyId`,`targetDeviceId`,`targetFactorVerificationDigestB64u`,`sourceSigner`,`sourceDerivation`,`target`,`package`],`linked-device ECDSA source contribution`),e.kind!==`linked_device_ecdsa_source_contribution_v1`)throw Error(`linked-device ECDSA source contribution kind is invalid`);if(e.keyFamily!==`ecdsa_secp256k1`)throw Error(`linked-device ECDSA source contribution family is invalid`);let t=G(e.linkSessionId),n=K(e.enrollmentId),r=q(e.sourceAuthorityId),i=$t(e.walletKeyId),a=J(e.targetDeviceId),o=Y(e.targetFactorVerificationDigestB64u,`targetFactorVerificationDigestB64u`),s=Ut(e.sourceSigner),c=It(e.sourceDerivation),l=Wt(e.target);Zt(s.activation,l.activation);let u=Vt(e.package);if(u.binding.linkSessionId!==t||u.binding.enrollmentId!==n||u.binding.sourceAuthorityId!==r||u.binding.target.targetDeviceId!==a||u.binding.target.targetFactorVerificationDigestB64u!==o)throw Error(`linked-device ECDSA source contribution package binding differs`);if(!Xt(u.binding.source,s))throw Error(`linked-device ECDSA source contribution signer differs from package binding`);if(!Qt(u.binding.target,l))throw Error(`linked-device ECDSA source contribution target differs from package binding`);return{kind:`linked_device_ecdsa_source_contribution_v1`,keyFamily:`ecdsa_secp256k1`,linkSessionId:t,enrollmentId:n,sourceAuthorityId:r,walletKeyId:i,targetDeviceId:a,targetFactorVerificationDigestB64u:o,sourceSigner:s,sourceDerivation:c,target:l,package:u}}function It(e){let t=Q(e,[`applicationBindingDigestB64u`,`clientShareRetryCounter`,`ecdsaThresholdKeyId`,`sourceNormalSigning`],`linked-device ECDSA source derivation`),n=t.clientShareRetryCounter;if(typeof n!=`number`||!Number.isSafeInteger(n)||n<0)throw Error(`linked-device ECDSA source derivation retry counter is invalid`);let r=Y(t.applicationBindingDigestB64u,`sourceDerivation.applicationBindingDigestB64u`),i=ie(t.sourceNormalSigning),a=re(t.ecdsaThresholdKeyId);if(i.scope.context.application_binding_digest_b64u!==r||i.scope.public_identity.client_share_retry_counter!==n||i.scope.ecdsa_threshold_key_id!==a)throw Error(`linked-device ECDSA source derivation differs from normal signing`);return{applicationBindingDigestB64u:r,clientShareRetryCounter:n,ecdsaThresholdKeyId:a,sourceNormalSigning:i}}function Lt(e){let t=Q(e,[`state`,`binding`,`sourceDerivation`,`targetRelayerPublicKey33B64u`,`thresholdPublicKey33B64u`,`thresholdEthereumAddress20B64u`,`normalSigning`],`linked-device ECDSA source-preserving activation receipt`);if(t.state!==`inactive`)throw Error(`linked-device ECDSA source-preserving activation receipt is not inactive`);let n=Ht(t.binding),r=It(t.sourceDerivation),i=f(t.targetRelayerPublicKey33B64u,`targetRelayerPublicKey33B64u`),a=f(t.thresholdPublicKey33B64u,`thresholdPublicKey33B64u`),o=X(t.thresholdEthereumAddress20B64u,20,`thresholdEthereumAddress20B64u`),s=ie(t.normalSigning);return Rt({binding:n,sourceDerivation:r,targetRelayerPublicKey33B64u:i,thresholdPublicKey33B64u:a,thresholdEthereumAddress20B64u:o,normalSigning:s}),{state:`inactive`,binding:n,sourceDerivation:r,targetRelayerPublicKey33B64u:i,thresholdPublicKey33B64u:a,thresholdEthereumAddress20B64u:o,normalSigning:s}}function Rt(e){let t=e.sourceDerivation.sourceNormalSigning.scope,n=e.normalSigning.scope;if(!o(v(t.material_activation),e.binding.source.activation)||!o(v(n.material_activation),e.binding.target.activation)||t.wallet_id!==n.wallet_id||t.wallet_id!==e.binding.source.activation.materialOwner||n.wallet_id!==e.binding.target.activation.materialOwner||t.ecdsa_threshold_key_id!==n.ecdsa_threshold_key_id||t.signing_root_id!==n.signing_root_id||t.signing_root_version!==n.signing_root_version||t.context.application_binding_digest_b64u!==n.context.application_binding_digest_b64u||t.activation_epoch!==n.activation_epoch||t.public_identity.derivation_client_share_public_key33_b64u!==e.binding.source.clientPublicKey33B64u||t.public_identity.server_public_key33_b64u!==e.binding.source.relayerPublicKey33B64u||t.public_identity.threshold_public_key33_b64u!==e.binding.source.thresholdPublicKey33B64u||t.public_identity.ethereum_address20_b64u!==e.binding.source.thresholdEthereumAddress20B64u||n.public_identity.context_binding_b64u!==t.public_identity.context_binding_b64u||n.public_identity.derivation_client_share_public_key33_b64u!==e.binding.targetClientPublicKey33B64u||n.public_identity.server_public_key33_b64u!==e.targetRelayerPublicKey33B64u||n.public_identity.threshold_public_key33_b64u!==e.thresholdPublicKey33B64u||n.public_identity.ethereum_address20_b64u!==e.thresholdEthereumAddress20B64u||n.public_identity.client_share_retry_counter!==t.public_identity.client_share_retry_counter||n.public_identity.server_share_retry_counter!==t.public_identity.server_share_retry_counter||n.signing_worker.server_id!==e.binding.target.activation.signingWorker||n.signing_worker.key_epoch!==t.signing_worker.key_epoch||n.signing_worker.recipient_encryption_key!==zt(e.binding.target.signingWorkerRecipientPublicKeyB64u))throw Error(`linked-device ECDSA normal signing state differs from its activation receipt`)}function zt(e){let t=m(e);if(t.length!==32||p(t)!==e)throw Error(`linked-device signing-worker recipient key is invalid`);let n=``;for(let e of t)n+=e.toString(16).padStart(2,`0`);return`x25519:${n}`}function U(e,t){let n=Bt(e,`${t} client package`);if(n.kind!==`activation_client`||n.deriver!==t)throw Error(`${t} client package is not an activation client package`);return t===`deriver_a`?{kind:`activation_client`,deriver:`deriver_a`,session:n.session,transcript:n.transcript,encapsulated_key:n.encapsulated_key,ciphertext:n.ciphertext}:{kind:`activation_client`,deriver:`deriver_b`,session:n.session,transcript:n.transcript,encapsulated_key:n.encapsulated_key,ciphertext:n.ciphertext}}function Bt(e,t){let n=wt(e);if(!n.ok)throw Error(`${t} ${n.message}`);return n.value}function Vt(e){let t=Q(e,[`binding`,`encryptedDelta`,`encryptedTargetClientShare`],`linked-device ECDSA source contribution package`),n=Ht(t.binding),r=Gt(t.encryptedDelta,`encryptedDelta`),i=Gt(t.encryptedTargetClientShare,`encryptedTargetClientShare`),a=r.bindingDigestB64u;if(i.bindingDigestB64u!==a)throw Error(`linked-device ECDSA source contribution envelope bindings differ`);if(r.recipientPublicKeyB64u!==n.target.signingWorkerRecipientPublicKeyB64u||i.recipientPublicKeyB64u!==n.target.clientRecipientPublicKeyB64u)throw Error(`linked-device ECDSA source contribution envelope recipients differ`);return{binding:n,encryptedDelta:r,encryptedTargetClientShare:i}}function Ht(e){let t=Q(e,[`linkSessionId`,`enrollmentId`,`sourceAuthorityId`,`source`,`target`,`targetClientPublicKey33B64u`],`linked-device ECDSA source contribution binding`),n=Ut(t.source),r=Wt(t.target);return Zt(n.activation,r.activation),{linkSessionId:Z(t.linkSessionId,`binding.linkSessionId`),enrollmentId:Z(t.enrollmentId,`binding.enrollmentId`),sourceAuthorityId:Z(t.sourceAuthorityId,`binding.sourceAuthorityId`),source:n,target:r,targetClientPublicKey33B64u:f(t.targetClientPublicKey33B64u,`binding.targetClientPublicKey33B64u`)}}function Ut(e){let t=Q(e,[`activation`,`clientPublicKey33B64u`,`relayerPublicKey33B64u`,`thresholdPublicKey33B64u`,`thresholdEthereumAddress20B64u`],`linked-device ECDSA source signer`);return{activation:W(t.activation,`source.activation`),clientPublicKey33B64u:f(t.clientPublicKey33B64u,`source.clientPublicKey33B64u`),relayerPublicKey33B64u:f(t.relayerPublicKey33B64u,`source.relayerPublicKey33B64u`),thresholdPublicKey33B64u:f(t.thresholdPublicKey33B64u,`source.thresholdPublicKey33B64u`),thresholdEthereumAddress20B64u:X(t.thresholdEthereumAddress20B64u,20,`source.thresholdEthereumAddress20B64u`)}}function Wt(e){let t=Q(e,[`activation`,`targetDeviceId`,`targetFactorVerificationDigestB64u`,`clientRecipientPublicKeyB64u`,`signingWorkerRecipientPublicKeyB64u`],`linked-device ECDSA target recipient`),n=X(t.clientRecipientPublicKeyB64u,32,`target.clientRecipientPublicKeyB64u`),r=X(t.signingWorkerRecipientPublicKeyB64u,32,`target.signingWorkerRecipientPublicKeyB64u`);if(n===r)throw Error(`linked-device ECDSA target recipients must differ`);return{activation:W(t.activation,`target.activation`),targetDeviceId:J(t.targetDeviceId),targetFactorVerificationDigestB64u:Y(t.targetFactorVerificationDigestB64u,`target.targetFactorVerificationDigestB64u`),clientRecipientPublicKeyB64u:n,signingWorkerRecipientPublicKeyB64u:r}}function Gt(e,t){let n=Q(e,[`kind`,`recipientPublicKeyB64u`,`bindingDigestB64u`,`encappedKeyB64u`,`ciphertextB64u`],`linked-device ECDSA ${t}`);if(n.kind!==Et)throw Error(`${t}.kind is invalid`);return{kind:Et,recipientPublicKeyB64u:X(n.recipientPublicKeyB64u,32,`${t}.recipientPublicKeyB64u`),bindingDigestB64u:Y(n.bindingDigestB64u,`${t}.bindingDigestB64u`),encappedKeyB64u:X(n.encappedKeyB64u,32,`${t}.encappedKeyB64u`),ciphertextB64u:d(n.ciphertextB64u,`${t}.ciphertextB64u`)}}function Kt(e,t){let n=L(e);if(n.operation!==`registration`)throw Error(`${t} must use the registration operation`);return n}function qt(e,t,n,r){if(e.material_activation.activation_id!==n.activationId)throw Error(`${r} activation does not match the target activation`);if(e.material_activation.material_owner!==n.materialOwner)throw Error(`${r} material owner does not match the target activation`);if(e.material_activation.signing_worker!==n.signingWorker)throw Error(`${r} signing worker does not match the target activation`);if(e.session_id.length!==32||String(t).length===0)throw Error(`${r} link binding is invalid`)}function Jt(e,t,n){if(e.session_id.length!==32||String(t).length===0)throw Error(`${n} link binding is invalid`)}function Yt(e,t){return e.stable_key_context_binding.every((e,n)=>e===t.stable_key_context_binding[n])&&e.material_activation.capability===t.material_activation.capability&&e.material_activation.material_owner===t.material_activation.material_owner&&e.material_activation.key_binding===t.material_activation.key_binding&&e.material_activation.lifecycle_binding===t.material_activation.lifecycle_binding&&e.material_activation.signing_worker===t.material_activation.signing_worker&&e.lifecycle.root_share_epoch===t.lifecycle.root_share_epoch&&e.lifecycle.account_id===t.lifecycle.account_id&&e.lifecycle.signer_set_id===t.lifecycle.signer_set_id&&e.lifecycle.selected_server_id===t.lifecycle.selected_server_id}function Xt(e,t){return o(e.activation,t.activation)&&e.clientPublicKey33B64u===t.clientPublicKey33B64u&&e.relayerPublicKey33B64u===t.relayerPublicKey33B64u&&e.thresholdPublicKey33B64u===t.thresholdPublicKey33B64u&&e.thresholdEthereumAddress20B64u===t.thresholdEthereumAddress20B64u}function Zt(e,t){if(o(e,t)||e.materialOwner!==t.materialOwner||e.signingWorker!==t.signingWorker)throw Error(`linked-device ECDSA source and target activations are invalid`)}function Qt(e,t){return o(e.activation,t.activation)&&e.targetDeviceId===t.targetDeviceId&&e.targetFactorVerificationDigestB64u===t.targetFactorVerificationDigestB64u&&e.clientRecipientPublicKeyB64u===t.clientRecipientPublicKeyB64u&&e.signingWorkerRecipientPublicKeyB64u===t.signingWorkerRecipientPublicKeyB64u}function W(e,t){let n=r(e);if(!n.ok)throw Error(`${t} ${n.error.message}`);return n.value}function G(e){let t=a(Z(e,`linkSessionId`));if(!t.ok)throw Error(`linkSessionId ${t.error.message}`);return t.value}function K(e){let t=s(Z(e,`enrollmentId`));if(!t.ok)throw Error(`enrollmentId ${t.error.message}`);return t.value}function q(t){let n=e(Z(t,`sourceAuthorityId`));if(!n.ok)throw Error(`sourceAuthorityId ${n.error.message}`);return n.value}function $t(e){let t=i(Z(e,`walletKeyId`));if(!t.ok)throw Error(`walletKeyId ${t.error.message}`);return t.value}function J(e){let t=h(Z(e,`targetDeviceId`));if(!t.ok)throw Error(`targetDeviceId ${t.error.message}`);return t.value}function Y(e,t){try{return te(e)}catch(e){throw Error(`${t} ${e instanceof Error?e.message:`is invalid`}`)}}function X(e,t,n){if(typeof e!=`string`||!/^[A-Za-z0-9_-]+$/.test(e))throw Error(`${n} must be canonical base64url`);let r;try{r=m(e)}catch{throw Error(`${n} must be canonical base64url`)}if(r.length!==t||p(r)!==e)throw Error(`${n} must decode to ${t} bytes`);return e}function Z(e,t){if(typeof e!=`string`||e.length===0||e.trim()!==e||[...e].some(e=>{let t=e.charCodeAt(0);return t<32||t===127}))throw Error(`${t} must be a non-empty visible string`);return e}function Q(e,t,n){let r=c(e,n),i=new Set(t),a=Object.keys(r);if(a.length!==t.length||a.some(e=>!i.has(e))||t.some(e=>!Object.prototype.hasOwnProperty.call(r,e)))throw Error(`${n} contains unknown or missing fields`);return r}function en(e){return!e||typeof e!=`object`||Array.isArray(e)?null:e}function $(e){return typeof e==`string`?e.trim():``}function tn(e,t){let n=$(e);return n?{ok:!0,value:n}:{ok:!1,error:{code:`missing`,message:`${t} is required`}}}function nn(e){let t=typeof e==`number`?e:Number(e);return!Number.isSafeInteger(t)||t<1?{ok:!1,error:{code:`invalid`,message:`signerSlot must be an integer >= 1`}}:{ok:!0,value:t}}function rn(e){return{ok:!1,error:{code:`invalid`,message:`${e} must be an object`}}}function an(e){let n=t(e);return n.ok?{ok:!0,value:n.value}:{ok:!1,error:n.error}}function on(e){let t=en(e);if(!t)return rn(`WalletIdentity`);let r=n(t.walletId);return r.ok?{ok:!0,value:{walletId:r.value}}:{ok:!1,error:r.error}}function sn(e){return{walletId:e.walletId}}function cn(e){return{wallet:e.wallet,rpId:e.rpId}}function ln(e){let t=$(e.credentialIdB64u);if(!t)throw Error(`credentialIdB64u is required`);return{kind:`passkey`,walletAuthMethodId:e.walletAuthMethodId,scope:e.scope,credentialIdB64u:t}}function un(e){let t=$(e.emailHashHex),n=$(e.registrationAuthorityId);if(!t)throw Error(`emailHashHex is required`);if(!n)throw Error(`registrationAuthorityId is required`);return{kind:`email_otp`,walletAuthMethodId:e.walletAuthMethodId,wallet:e.wallet,emailHashHex:t,registrationAuthorityId:n}}function dn(e){return{kind:`implicit_near_account`,wallet:e.wallet,nearAccountId:e.nearAccountId}}function fn(e){return{kind:`named_near_account`,wallet:e.wallet,nearAccountId:e.nearAccountId}}function pn(e){let t=en(e);if(!t)return rn(`NearAccountBinding`);let n=on(t.wallet);if(!n.ok)return n;let r=$(t.kind);if(r===`implicit_near_account`){let e=ne(t.nearAccountId);return e.ok?{ok:!0,value:dn({wallet:n.value,nearAccountId:e.value})}:{ok:!1,error:{code:e.code,message:e.message}}}if(r===`named_near_account`){let e=g(t.nearAccountId);return e.ok?{ok:!0,value:fn({wallet:n.value,nearAccountId:e.value})}:{ok:!1,error:{code:e.code,message:e.message}}}return{ok:!1,error:{code:`invalid`,message:`NearAccountBinding kind is invalid`}}}function mn(e){let t=nn(e.signerSlot);if(!t.ok)throw Error(t.error.message);return{kind:`near_ed25519_signer`,account:e.account,nearEd25519SigningKeyId:e.nearEd25519SigningKeyId,signerSlot:t.value}}function hn(e){let t=en(e);if(!t)return rn(`NearEd25519SignerBinding`);let n=pn(t.account);if(!n.ok)return n;let r=tn(t.nearEd25519SigningKeyId,`nearEd25519SigningKeyId`);if(!r.ok)return r;let i=nn(t.signerSlot);return i.ok?{ok:!0,value:mn({account:n.value,nearEd25519SigningKeyId:ae(r.value),signerSlot:i.value})}:i}function gn(e,t){if(!e||typeof e!=`object`||Array.isArray(e))throw Error(`${t} must be an object`);return e}function _n(e,t){let n=l(e,t);switch(n){case`sent`:case`reused`:return n;default:throw Error(`${t} must be sent or reused`)}}function vn(e,t){return{kind:`provider`,status:e,emailHint:t}}function yn(e,t){let n=gn(e,t),r=l(n.kind,`${t}.kind`),i=_n(n.status,`${t}.status`),a=l(n.emailHint,`${t}.emailHint`);switch(r){case`provider`:case`development`:if(n.otpCode!==void 0)throw Error(`${t}.otpCode is only valid for code-bearing delivery`);return vn(i,a);case`demo_code_response`:case`provider_and_demo_code`:{let e=l(n.otpCode,`${t}.otpCode`);if(!/^\d{6}$/.test(e))throw Error(`${t}.otpCode must be a 6-digit code`);return{kind:r,status:i,emailHint:a,otpCode:e}}default:throw Error(`${t}.kind is invalid`)}}function bn(e){switch(e.kind){case`provider`:return null;case`demo_code_response`:case`provider_and_demo_code`:return e.otpCode}}export{B as A,Ct as B,_e as C,pe as D,ge as E,ft as F,xt as G,lt as H,pt as I,we as J,ct as K,P as L,Ve as M,wt as N,me as O,dt as P,gt as R,Se as S,ve as T,ht as U,St as V,vt as W,Oe as X,E as Y,fe as Z,kt as _,fn as a,be as b,ln as c,an as d,Gt as f,jt as g,Mt as h,dn as i,M as j,ye as k,sn as l,Ot as m,yn as n,mn as o,Lt as p,ut as q,un as r,cn as s,bn as t,hn as u,Xt as v,he as w,xe as x,Qt as y,yt as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{P as e,r as t}from"./domainIds-C3fUa33Q.js";import{t as n}from"./accountIds-Cpvlkvbe.js";import{c as r,o as i}from"./ecdsaChainTarget-DkOrgv4y.js";import{Nt as a,T as o,g as s}from"./emailOtpEcdsaDerivationIdentity-BDVjvnmO.js";import{r as c}from"./registrationIds-Br-zI4_5.js";import{t as l}from"./signerSlot-FJAGOhmg.js";import{c as u,s as d}from"./types-CQTWmtqu.js";import{a as f,k as p}from"./nearEd25519YaoSigningPreparation-CqBNMG87.js";function m(e){let t=Math.floor(Number(e));return!Number.isFinite(t)||t<=0?null:t.toString(10).padStart(20,`0`)}function h(e,t){if(e.length===0)return{kind:`no_current_lane`,unusableFacts:[]};let n=_(e,t),r=v(n,t);if(r.length)return{kind:`conflicting_key_material`,conflicts:r};if(n.length!==1)return{kind:`ambiguous_material`,candidates:e};let i=n[0];return i?g(i,t.supersession):{kind:`no_current_lane`,unusableFacts:[]}}function g(e,t){let n=e.facts.filter(t.isOperationUsable);if(n.length===0)return{kind:`no_current_lane`,unusableFacts:e.facts};let r=y(n,t);return r.kind===`ambiguous`?{kind:`ambiguous_material`,candidates:r.candidates}:{kind:`selected`,selectedFact:r.fact,supersededFacts:e.facts.filter(e=>e!==r.fact)}}function _(e,t){let n=new Map;for(let r of e){let e=t.groupKey(r),i=t.groupKeyString(e),a=n.get(i);n.set(i,a?{groupKey:a.groupKey,facts:[...a.facts,r]}:{groupKey:e,facts:[r]})}return[...n.values()]}function v(e,t){return e.flatMap(e=>t.groupConflicts(e.facts))}function y(e,t){let n=e[0];if(n===void 0)return{kind:`ambiguous`,candidates:[]};let r=n;for(let n of e.slice(1)){let e=b(r,n,t);switch(e.kind){case`left`:break;case`right`:r=n;break;case`ambiguous`:return{kind:`ambiguous`,candidates:e.candidates};default:return e}}return{kind:`selected`,fact:r}}function b(e,t,n){let r=x(e,t,n);if(r.kind!==`equal`)return r;let i=S(e,t,n);if(i.kind!==`equal`)return i;let a=n.tieBreak(e,t);switch(a){case 1:return{kind:`left`};case-1:return{kind:`right`};case 0:return{kind:`ambiguous`,candidates:[e,t]};default:return a}}function x(e,t,n){let r=n.generation(e),i=n.generation(t);return!r||!i?{kind:`ambiguous`,candidates:[e,t]}:r>i?{kind:`left`}:i>r?{kind:`right`}:{kind:`equal`}}function S(e,t,n){let r=n.exactness(e);return r===n.exactness(t)?{kind:`equal`}:r===`exact_target`?{kind:`left`}:{kind:`right`}}function C(e){return{kind:`ed25519_durable_material`,authMethod:e.authMethod,materialActivation:e.materialActivation}}function w(e){return[e.activationId,e.capability,e.materialOwner,e.keyBinding,e.lifecycleBinding,e.signingWorker].map(e=>encodeURIComponent(String(e))).join(`:`)}function T(e){let t={source:e.source,runtime:e.runtime,key:e.key,materialActivation:e.materialActivation,publicFacts:e.publicFacts,curve:`ecdsa`,chainTarget:e.chainTarget,state:e.state,authorizationState:e.authorizationState};if(e.auth.kind===`passkey`){if(!e.resolvedKey)throw Error(`active Wallet Authority passkey lane is missing its resolved ECDSA key`);return{...t,auth:e.auth,resolvedKey:e.resolvedKey}}return{...t,auth:e.auth}}function ee(e){let t=e.authorization;return t?e.remainingUses===t.runtime.remainingUses&&e.expiresAtMs===t.runtime.expiresAtMs:!0}function E(e){return u(e.auth)}function D(e){return u(e.auth)}function O(e){let t=e.ed25519Restore;if(e.authMethod===`passkey`){if(!t.credentialIdB64u)return null;try{return{kind:`passkey`,rpId:o(t.rpId),credentialIdB64u:t.credentialIdB64u}}catch{return null}}return t.providerSubjectId?{kind:`email_otp`,providerSubjectId:t.providerSubjectId}:null}function k(e){let{authorization:t}=e;if(String(t.session.walletId)!==e.walletId||t.selectedAuthMethod.kind!==e.auth.kind||t.operationCredential.walletSessionId.length===0||t.session.quotaId.length===0||!f({session:t.session,materialActivation:e.materialActivation}))return!1;if(e.auth.kind===`passkey`){if(t.selectedAuthMethod.kind!==`passkey`||String(t.selectedAuthMethod.rpId)!==String(e.auth.rpId)||t.selectedAuthMethod.credentialIdB64u!==e.auth.credentialIdB64u)return!1}else if(t.selectedAuthMethod.kind!==`email_otp`||t.selectedFactorAuthority.factor.kind!==`email_otp`||t.selectedFactorAuthority.factor.providerUserId!==e.auth.providerSubjectId)return!1;return!!(e.ownerScope&&d(e.auth)===d(e.ownerScope.auth))}function te(e,t,i){if(e.curve!==`ed25519`)return null;let a=String(e.thresholdSessionIds.ed25519||``).trim(),o=String(e.walletId||``).trim(),s=e.ed25519Restore,u=l(s.signerSlot),d=O(e);if(!a||!o||u===null||!d)return null;let f=Math.floor(Number(e.expiresAtMs)||0),p=Math.max(0,Math.floor(Number(e.remainingUses)||0)),m=f>0&&f<=Date.now()?`expired`:p===0?`exhausted`:`restorable`,h=t&&k({authorization:t,auth:d,walletId:o,materialActivation:s.materialActivation,ownerScope:i})?t:null;try{let t={auth:d,curve:`ed25519`,chain:`near`,materialActivation:s.materialActivation,walletId:r(o),nearAccountId:n(s.nearAccountId),nearEd25519SigningKeyId:c(s.nearEd25519SigningKeyId),signerSlot:u,source:`durable_sealed_record`,thresholdSessionId:a,remainingUses:p,...f>0?{expiresAtMs:f}:{},updatedAtMs:Math.floor(Number(e.updatedAtMs)||0),...P(e)?{policyHint:P(e)}:{}};return h?{...t,state:m,authorizationState:`authorized`,authorization:h}:{...t,state:`deferred`,authorizationState:`authorization_required`}}catch{return null}}function ne(e){return e.auth.kind===`email_otp`}function re(e,t,i){let a=String(e.walletId||``).trim(),o=String(e.nearAccountId||``).trim(),s=String(e.thresholdSessionId||``).trim();if(!a||!o||!s)return null;let c=t&&k({authorization:t,auth:e.auth,walletId:a,materialActivation:e.materialActivation,ownerScope:i})?t:null;try{let t={auth:e.auth,curve:`ed25519`,chain:`near`,materialActivation:e.materialActivation,walletId:r(a),nearAccountId:n(o),nearEd25519SigningKeyId:e.nearEd25519SigningKeyId,signerSlot:e.signerSlot,thresholdSessionId:s,source:`public_capability_reference`};if(!c)return{...t,state:`deferred`,authorizationState:`authorization_required`};let i=Math.floor(Number(c.status.expiresAtMs)||0),l=ne(e)?e:null,u=l?Math.min(l.expiresAtMs,i):i,d=u>0&&u<=Date.now()?`expired`:`ready`;return{...t,state:d,authorizationState:`authorized`,authorization:c,remainingUses:c.status.remainingUses,...u>0?{expiresAtMs:u}:{}}}catch{return null}}function A(e){if(e.state===`missing`)return!1;if(e.curve!==`ecdsa`){let t=String(e.thresholdSessionId||``).trim();return e.thresholdSessionId!==t||!t?!1:e.authorizationState===`authorization_required`?e.state===`deferred`:!e.authorization.operationCredential.walletSessionId||!e.authorization.session.quotaId||e.authorization.status.remainingUses<=0||e.authorization.status.expiresAtMs<=Date.now()?!1:e.auth.kind===`email_otp`||e.auth.kind===`passkey`}return e.auth.kind!==`email_otp`&&e.auth.kind!==`passkey`||e.source===`active_wallet_authority`&&(e.state!==`deferred`||e.authorizationState!==`authorization_required`||e.runtime.kind!==`active_wallet_authority_ecdsa_runtime_v1`||String(e.runtime.walletId)!==String(e.key.walletId)||!t(e.runtime.materialActivation,e.materialActivation)||e.runtime.publicFacts!==e.publicFacts)||!(e.key&&String(e.key.walletId||``).trim()&&String(e.key.ecdsaThresholdKeyId||``).trim()&&String(e.key.signingRootId||``).trim()&&String(e.key.signingRootVersion||``).trim()&&Array.isArray(e.key.participantIds)&&e.key.participantIds.length>0&&String(e.key.thresholdOwnerAddress||``).trim()&&`publicFacts`in e&&e.publicFacts&&e.publicFacts.keyHandle&&String(e.publicFacts.publicKeyB64u||``).trim()&&Array.isArray(e.publicFacts.participantIds)&&e.publicFacts.participantIds.length>0&&String(e.publicFacts.thresholdOwnerAddress||``).trim())||e.source===`canonical_capability`&&!ee(e)?!1:u(e.auth)===`passkey`?e.resolvedKey?.kind===`resolved_evm_family_ecdsa_key`&&e.resolvedKey.authBinding.kind===`passkey_ecdsa_auth_binding`&&String(e.resolvedKey.walletId)===String(e.key.walletId)&&e.resolvedKey.publicFacts===e.publicFacts:!(`resolvedKey`in e)}function j(e){return e===`missing`?null:e}function ie(e){return e||`unknown`}function ae(e){let t=Math.floor(Number(e));return Number.isFinite(t)&&t>0?t:null}function oe(e){let t=Math.max(0,Math.floor(Number(e)));return Number.isFinite(t)?t:null}function se(e){if(!A(e.lane)||e.lane.curve!==`ed25519`)return null;let t=j(e.lane.state);if(!t)return null;let n={kind:`lane_candidate`,walletId:e.lane.walletId,nearAccountId:e.lane.nearAccountId,nearEd25519SigningKeyId:e.lane.nearEd25519SigningKeyId,signerSlot:e.lane.signerSlot,materialActivation:e.lane.materialActivation,auth:e.lane.auth,curve:`ed25519`,chain:`near`,thresholdSessionId:e.lane.thresholdSessionId,state:t,remainingUses:oe(e.lane.remainingUses),expiresAtMs:ae(e.lane.expiresAtMs),updatedAtMs:ae(e.lane.updatedAtMs),source:ie(e.lane.source)};return e.lane.authorizationState===`authorization_required`?{...n,authorizationState:`authorization_required`,state:`deferred`}:{...n,authorizationState:`authorized`,authorization:e.lane.authorization}}function ce(e){if(!A(e.lane)||e.lane.curve!==`ecdsa`)return null;let t=j(e.lane.state);if(!t)return null;let n=u(e.lane.auth),i={kind:`lane_candidate`,walletId:r(e.walletId),auth:e.lane.auth,authMethod:n,curve:`ecdsa`,chain:e.lane.chainTarget.kind,key:e.lane.key,materialActivation:e.lane.materialActivation,...n===`passkey`?{resolvedKey:e.lane.resolvedKey}:{},keyHandle:e.lane.publicFacts.keyHandle,chainTarget:e.lane.chainTarget};switch(e.lane.source){case`active_wallet_authority`:return{...i,source:`active_wallet_authority`,runtime:e.lane.runtime,authorizationState:`authorization_required`,state:`deferred`};case`canonical_capability`:return e.lane.authorization?{...i,source:`canonical_capability`,authorizationState:`authorized`,authorization:e.lane.authorization,state:t}:{...i,source:`canonical_capability`,authorizationState:`authorization_required`,state:`deferred`};default:return e.lane}}function le(e){if(!e||e.curve!==`ecdsa`||!e.chainTarget||!(`key`in e)||!e.key||!(`auth`in e)||!e.auth)return null;let t=u(e.auth);try{let n=d(e.auth);return[t,`ecdsa`,i(e.chainTarget),n,ue(e),w(e.materialActivation)].join(`:`)}catch{return null}}function ue(e){return s({walletId:e.key.walletId,publicFacts:e.publicFacts})}function M(e){if(!e||e.curve!==`ed25519`||e.chain!==`near`||e.state===`missing`||!e.auth)return null;let t=u(e.auth),n=String(e.walletId||``).trim(),r=String(e.nearAccountId||``).trim(),i=String(e.nearEd25519SigningKeyId||``).trim(),a=String(e.signerSlot||``).trim(),o=String(e.thresholdSessionId||``).trim(),s=e.materialActivation?w(e.materialActivation):``;return!t||!n||!r||!i||!a||!o||!s?null:[n,r,i,a,t,`ed25519`,`near`,o,s].join(`:`)}function N(e){return{curve:`ecdsa`,chainTarget:e.chainTarget,state:`missing`}}function de(e,t){let n=i(t);return e.ecdsa.lanesByTarget[n]||N({chainTarget:t})}function fe(e,t){let n=i(t);return e.ecdsa.candidatesByTarget[n]||[]}function pe(){return{curve:`ed25519`,chain:`near`,state:`missing`}}function P(e){let t=Math.floor(Number(e.remainingUses)),n=Math.floor(Number(e.expiresAtMs)),r={};return Number.isFinite(t)&&t>=0&&(r.remainingUses=t),Number.isFinite(n)&&n>0&&(r.expiresAtMs=n),Object.keys(r).length?r:void 0}function F(e){return Math.floor(Number(`updatedAtMs`in e?e.updatedAtMs:0)||0)}function I(e){return m(e.expiresAtMs??e.policyHint?.expiresAtMs)}function L(e){switch(e.state){case`ready`:return 5;case`restorable`:return 4;case`deferred`:return 3;case`expired`:case`exhausted`:return 2;case`missing`:return 1}}function R(e){return!A(e)||e.curve===`ecdsa`?0:e.source===`durable_sealed_record`?1:0}function z(e,t){return L(e)-L(t)||R(e)-R(t)||F(e)-F(t)}function me(e,t){return z(e,t)}function he(e,t){return L(e)-L(t)||R(e)-R(t)||F(e)-F(t)}function B(e){let t=d(e.auth),n=String(e.walletId||``).trim(),r=String(e.nearAccountId||``).trim(),i=String(e.nearEd25519SigningKeyId||``).trim(),a=String(e.signerSlot||``).trim(),o=w(e.materialActivation);return!t||!n||!r||!i||!a||!o?null:{walletId:n,authKey:t,nearAccountId:r,nearEd25519SigningKeyId:i,signerSlot:a,materialActivationKey:o}}function V(e){return[e.walletId,e.authKey,e.nearAccountId,e.nearEd25519SigningKeyId,e.signerSlot,e.materialActivationKey].map(e=>encodeURIComponent(e)).join(`|`)}function ge(e){if(!A(e)||e.curve!==`ed25519`)return null;let t=B(e);return t?{groupKey:t,lane:e}:null}function H(e,t){return me(t,e)}function U(e,t){return e>t?1:t>e?-1:0}function W(e,t){let n=e.localeCompare(t);return n>0?1:n<0?-1:0}function G(e){for(let t of e)if(t!==0)return t;return 0}function _e(e){return[]}function ve(e){return!0}function ye(e){return I(e.lane)}function be(){return`exact_target`}function xe(e,t){return G([U(L(e.lane),L(t.lane)),U(R(e.lane),R(t.lane)),W(Se(e.lane),Se(t.lane))])}function Se(e){return[e.thresholdSessionId,e.authorizationState===`authorized`?e.authorization.operationCredential.walletSessionId:``,e.authorizationState===`authorized`?e.authorization.session.quotaId:``,e.source||`durable_sealed_record`].map(e=>String(e)).join(`|`)}const Ce={groupKey:we,groupKeyString:V,groupConflicts:_e,supersession:{isOperationUsable:ve,generation:ye,exactness:be,tieBreak:xe}};function we(e){return e.groupKey}function Te(e){let t=new Map;for(let n of e){let e=V(n.groupKey);t.set(e,[...t.get(e)||[],n])}return t}function Ee(e,t){let n=h(e,Ce);switch(n.kind){case`selected`:return[n.selectedFact.lane];case`no_current_lane`:return[];case`conflicting_key_material`:return t.push({curve:`ed25519`,source:`canonical_lane_inventory`,reason:`conflicting_key_material`,message:`Ed25519 canonical lane inventory has conflicting material facts`}),[];case`ambiguous_material`:return t.push({curve:`ed25519`,source:`canonical_lane_inventory`,reason:`ambiguous_material`,message:`Ed25519 canonical lane inventory has incomparable usable records`}),[];default:return n}}function De(e,t){let n=e.map(ge).filter(e=>e!==null),r=[];for(let e of Te(n).values())r.push(...Ee(e,t));return r.sort(H)}function Oe(e){if(!A(e)||e.curve!==`ed25519`)return null;let t=String(e.thresholdSessionId||``).trim();return e.authorizationState!==`authorized`||!t?null:`${e.authorization.operationCredential.walletSessionId}:${e.authorization.session.quotaId}:${t}`}function ke(e){if(!A(e.primaryLane)||e.primaryLane.curve!==`ed25519`||D(e.primaryLane)!==`passkey`)return e.primaryLane;let t=Oe(e.primaryLane);return t&&e.candidates.find(e=>A(e)&&e.curve===`ed25519`&&D(e)===`email_otp`&&Oe(e)===t)||e.primaryLane}function Ae(){try{return globalThis.localStorage?.getItem(`seams:debug:signing-session`)===`1`}catch{return!1}}function K(e){return e?A(e)?{present:!0,authMethod:u(e.auth),curve:e.curve,keyHandle:e.publicFacts.keyHandle,walletId:e.key.walletId,chainTarget:e.chainTarget,targetKey:i(e.chainTarget),state:e.state,source:e.source,evmFamilyKeyFingerprint:ue(e),ecdsaThresholdKeyId:e.key.ecdsaThresholdKeyId,participantIds:e.publicFacts.participantIds,thresholdOwnerAddress:e.publicFacts.thresholdOwnerAddress,remainingUses:e.remainingUses,expiresAtMs:e.expiresAtMs,updatedAtMs:e.updatedAtMs}:{present:!0,curve:e.curve,chainTarget:e.chainTarget,state:e.state}:{present:!1}}function je(e){switch(e.source){case`canonical_capability`:return`canonical_capability`;case`active_wallet_authority`:return`active_wallet_authority`;default:return e}}function Me(e){let t=d(e.auth);return{walletId:String(e.key.walletId),authKey:t,materialActivationKey:w(e.materialActivation),ecdsaThresholdKeyId:String(e.key.ecdsaThresholdKeyId),signingRootId:String(e.key.signingRootId),signingRootVersion:String(e.key.signingRootVersion||`default`)}}function Ne(e){return[e.walletId,e.authKey,e.materialActivationKey,e.ecdsaThresholdKeyId,e.signingRootId,e.signingRootVersion].map(e=>encodeURIComponent(e)).join(`|`)}function Pe(e){let t=Me(e);return t?{source:je(e),groupKey:t,chainTargetKey:i(e.chainTarget),lane:e}:null}function Fe(e){let t=d(e.auth);return[String(e.key.walletId),t,w(e.materialActivation),String(e.key.signingRootId),String(e.key.signingRootVersion||`default`)].map(e=>encodeURIComponent(e)).join(`|`)}function q(e,t){return[...new Set(e.map(e=>t(e.lane)).filter(Boolean))].sort()}function Ie(e){return[{field:`ecdsaThresholdKeyId`,values:q(e.facts,e=>String(e.key.ecdsaThresholdKeyId||``))},{field:`thresholdOwnerAddress`,values:q(e.facts,e=>String(e.publicFacts.thresholdOwnerAddress||``).toLowerCase())},{field:`keyHandle`,values:q(e.facts,e=>String(e.publicFacts.keyHandle||``))},{field:`publicKeyB64u`,values:q(e.facts,e=>String(e.publicFacts.publicKeyB64u||``))},{field:`participantIds`,values:q(e.facts,e=>e.publicFacts.participantIds.map(e=>Number(e)).join(`,`))}].filter(e=>e.values.length>1).map(t=>({groupKey:e.key,field:t.field,values:t.values}))}function Le(e){let t=new Map;for(let n of e){let e=Fe(n.lane);e&&t.set(e,[...t.get(e)||[],n])}let n=new Map;for(let[e,r]of t){let t=r[0];if(!t)continue;let i=Ie({key:t.groupKey,facts:r});i.length&&n.set(e,i)}return n}function Re(e){let t=Fe(e.fact.lane);return t&&e.conflictsByFamilyGroup.get(t)||[]}function ze(e){return e.filter(e=>A(e)&&e.curve===`ecdsa`).map(Pe).filter(e=>e!==null)}function Be(e){return e.source===`active_wallet_authority`?2:1}function Ve(e){return e.groupKey}function He(e){let t=e[0];return t?Ie({key:t.groupKey,facts:e}):[]}function Ue(e){return e.lane.source===`active_wallet_authority`?!0:e.lane.state!==`deferred`||!e.lane.authorization}function We(e){return I(e.lane)}function Ge(e){return`exact_target`}function J(e){return[w(e.materialActivation),e.source,i(e.chainTarget)].map(e=>String(e)).join(`|`)}function Ke(e,t){return G([U(L(e.lane),L(t.lane)),U(Be(e.lane),Be(t.lane)),W(J(e.lane),J(t.lane))])}const qe={groupKey:Ve,groupKeyString:Ne,groupConflicts:He,supersession:{isOperationUsable:Ue,generation:We,exactness:Ge,tieBreak:Ke}};function Je(e){let t=new Map;for(let n of e)t.set(Ne(n.groupKey),n.groupKey);return[...t.values()]}function Ye(e){let t=h(e,qe);switch(t.kind){case`selected`:return{kind:`selected`,selectedFact:t.selectedFact,supersededFacts:t.supersededFacts};case`no_current_lane`:return{kind:`no_current_lane`,unusableFacts:t.unusableFacts};case`conflicting_key_material`:return{kind:`conflicting_key_material`,conflicts:t.conflicts};case`ambiguous_material`:return{kind:`ambiguous_material`,candidates:Je(t.candidates),candidateFacts:t.candidates};default:return t}}function Xe(e){return A(e)?J(e):null}function Ze(e){let t={},n={},r=Object.fromEntries(Object.entries(e.candidatesByTarget).map(([e,t])=>[e,Qe(t,Xe)])),a=Le(Object.values(r).flatMap(ze));for(let o of e.targets){let s=i(o),c=ze(r[s]||[]),l=c.flatMap(e=>Re({fact:e,conflictsByFamilyGroup:a}));if(l.length){e.invalidLanes.push({curve:`ecdsa`,source:`canonical_lane_inventory`,reason:`conflicting_key_material`,targetKey:s,groupKey:l[0]?.groupKey,conflicts:l}),t[s]=[],n[s]=N({chainTarget:o});continue}let u=Ye(c);switch(u.kind){case`selected`:t[s]=[u.selectedFact.lane],n[s]=u.selectedFact.lane;break;case`no_current_lane`:t[s]=[],n[s]=N({chainTarget:o});break;case`conflicting_key_material`:e.invalidLanes.push({curve:`ecdsa`,source:`canonical_lane_inventory`,reason:`conflicting_key_material`,targetKey:s,groupKey:u.conflicts[0]?.groupKey,conflicts:u.conflicts}),t[s]=[],n[s]=N({chainTarget:o});break;case`ambiguous_material`:e.invalidLanes.push({curve:`ecdsa`,source:`canonical_lane_inventory`,reason:`ambiguous_material`,targetKey:s}),t[s]=[],n[s]=N({chainTarget:o});break}}return{lanesByTarget:n,candidatesByTarget:t}}function Qe(e,t,n=z){let r=new Map,i=[];for(let n of e){let e=t(n);if(!e){i.push(n);continue}r.set(e,[...r.get(e)||[],n])}return[...[...r.values()].map(e=>[...e].sort((e,t)=>n(t,e))[0]),...i]}function $e(e){let t=new Set(e.filter(e=>A(e)&&e.curve===`ed25519`&&e.source===`durable_sealed_record`&&(e.state===`ready`||e.state===`restorable`)).map(B).filter(e=>e!==null).map(V));return t.size?e.filter(e=>{if(!A(e)||e.curve!==`ed25519`||e.source!==`public_capability_reference`)return!0;let n=B(e);return!n||!t.has(V(n))}):[...e]}async function et(e,t){return e.state===`missing`||d(e.auth)!==d(t.auth)||!await rt(e,t)?!1:t.auth.kind===`email_otp`?!0:`keyFamily`in t&&t.keyFamily===`ecdsa`?!1:e.signerSlot===t.signerSlot}function tt(e,t){return e.state===`missing`||d(e.auth)!==d(t.auth)?!1:nt(e,t)}function nt(e,t){let n=t.auth.kind===`email_otp`?t.ownerAuthority:void 0;if(!n)return!0;if(e.curve===`ecdsa`&&e.source===`active_wallet_authority`)return e.runtime.factorAuthorityRef.walletAuthMethodId===n.walletAuthMethodId&&String(e.runtime.factorAuthorityRef.authorityDigest)===String(n.authorityDigest);if(e.curve===`ecdsa`&&e.source===`canonical_capability`){let t=e.capability.manifest.signer.authority;return t.walletAuthMethodId===n.walletAuthMethodId&&String(t.authorityDigest)===String(n.authorityDigest)}return!1}async function rt(e,t){let n=t.auth.kind===`email_otp`?t.ownerAuthority:void 0;if(!n)return!0;if(e.state===`missing`||e.curve!==`ed25519`)return!1;if(e.authorizationState===`authorization_required`)return!0;try{let t=await a({authority:e.authorization.selectedFactorAuthority});return t.walletId===e.walletId&&t.walletAuthMethodId===n.walletAuthMethodId&&t.authorityDigest===n.authorityDigest}catch{return!1}}async function it(e,t){let n=[];for(let r of e)await et(r,t)&&n.push(r);return n}async function at(e,t){let n=r(e.walletId),a=new Map;for(let t of e.ecdsaChainTargets)a.set(i(t),t);let o=[...a.values()],[s,c,l,d]=await Promise.all([t.listSealedRecordsForWallet({walletId:n,filter:{...e.authMethod?{authMethod:e.authMethod}:{},curve:`ed25519`}}),t.listPublicCapabilityReferences?.()??[],t.readActiveWalletSessionAuthorization?.(n)??{kind:`missing`},o.length>0&&t.listCanonicalEcdsaLanesForWallet?t.listCanonicalEcdsaLanesForWallet({walletId:n}):[]]),f=l.kind===`found`?l.authorization:null,p=[...o],m={},h={},g={};for(let e of p){let t=i(e);m[t]=N({chainTarget:e}),h[t]=[],g[t]=0}let _=[],v=0,y=Ae(),b=[],x=[];for(let t of s){let n=te(t,f,e.ownerScope);if(!n)continue;_.push(n);let r=F(n);v=Math.max(v,r)}for(let r of c){if(String(r.walletId)!==String(n))continue;let i=l.kind===`exhausted`||l.kind===`expired`;if(!t.isPublicCapabilityActive?.(r)&&!i)continue;let a=re(r,f,e.ownerScope);a&&(e.authMethod&&u(a.auth)!==e.authMethod||_.push(a))}for(let t of d){let r=u(t.auth);if(e.authMethod&&r!==e.authMethod||String(t.key.walletId)!==String(n))continue;let o=i(t.chainTarget);if(!a.has(o))continue;h[o]||=[],h[o].push(t);let s=F(t);v=Math.max(v,s),b.push({result:`accepted`,targetKey:o,lane:K(t)})}let S=o.length>0&&t.listActiveWalletAuthorityEcdsaLanesForWallet?await t.listActiveWalletAuthorityEcdsaLanesForWallet({walletId:n,chainTargets:o}):[];for(let t of S){let r=u(t.auth);if(e.authMethod&&r!==e.authMethod||String(t.key.walletId)!==String(n))continue;let o=i(t.chainTarget);a.has(o)&&(h[o]||=[],h[o].push(t),b.push({result:`accepted`,targetKey:o,lane:K(t)}))}let C=e.ownerScope,w=C?await it(_,C):_;if(C)for(let e of Object.keys(h))h[e]=(h[e]||[]).filter(e=>tt(e,C));let T=De(Qe($e(w),M,he).sort(H),x),ee=ke({primaryLane:T[0]||pe(),candidates:T}),E=Ze({targets:p,candidatesByTarget:Ze({targets:p,candidatesByTarget:h,invalidLanes:x}).candidatesByTarget,invalidLanes:x}),D={walletId:n,generation:v,ecdsa:{targets:p,lanesByTarget:E.lanesByTarget,candidatesByTarget:E.candidatesByTarget},lanes:{ed25519:{near:ee}},candidates:{ed25519:{near:T}},diagnostics:{invalidLanes:x}},O=p.map(e=>{let t=i(e),n=D.ecdsa.candidatesByTarget[t]||[],r=D.ecdsa.lanesByTarget[t],a=r?.state||`missing`;return n.length>0&&a!==`missing`?null:{chainTarget:e,targetKey:t,candidateCount:n.length,selectedLane:K(r)}}).filter(e=>!!e),k={walletId:n,authMethod:e.authMethod||`any`,requestedTargets:p.map(e=>({chainTarget:e,targetKey:i(e)})),sealedRecordCount:0,runtimeRecordCount:d.length,durableDiscovery:[],runtimeDiscovery:b,resultSelectedLanesByTarget:Object.fromEntries(Object.entries(D.ecdsa.lanesByTarget).map(([e,t])=>[e,K(t)])),resultCandidatesByTarget:Object.fromEntries(Object.entries(D.ecdsa.candidatesByTarget).map(([e,t])=>[e,t.map(e=>K(e))]))};if(y&&O.length>0)try{console.warn(`[SigningLanes][available][ecdsa][missing-candidates]`,JSON.stringify({...k,missingEcdsaTargets:O}))}catch{}if(y)try{console.info(`[SigningLanes][available][ecdsa]`,JSON.stringify(k))}catch{}return D}function Y(t,n){return e(t,{fallback:n,min:1})}function X(e,t){let n=Error(`[SigningEngine] ${t}`);return n.code=e,n}function ot(e,t){let n=e.get(t);if(n)return n;let r={running:!1,items:[]};return e.set(t,r),r}function st(e){e.timeoutHandle&&=(clearTimeout(e.timeoutHandle),null)}async function ct(e,t){let n=e.get(t);if(!(!n||n.running)){n.running=!0;try{for(;n.items.length>0;){let e=n.items.shift();if(e&&!e.isSettled()){if(st(e),e.shouldAbort?.()){e.reject(e.makeCancelledError(`cancelled`));continue}if(Date.now()-e.enqueuedAtMs>e.timeoutMs){e.reject(e.makeTimeoutError(e.timeoutMs));continue}try{await e.run()}catch(t){e.reject(t)}}}}finally{n.running=!1,n.items.length===0&&e.get(t)===n?e.delete(t):n.items.length>0&&ct(e,t)}}}function lt(e){for(let t of e.values()){for(let e of t.items)st(e),e.reject(e.makeCancelledError(`queue_cleared`));t.items.length=0}e.clear()}function ut(e){return[`material`,encodeURIComponent(String(e.materialActivation.materialOwner)),encodeURIComponent(String(e.materialActivation.capability)),encodeURIComponent(String(e.materialActivation.activationId))].join(`:`)}async function dt(e){let{labels:t,owner:n}=e,r=String(e.queueKey||``).trim();if(!r)throw Error(`[SigningEngine] ${t.queue} requires non-empty queueKey`);if(!e.enabled)return await e.task();let i=Y(e.maxQueueLength,8),a=Y(e.queueTimeoutMs,45e3),o=ot(e.queueByKey,r);if(o.items.length+(o.running?1:0)>=i)throw X(`commit_queue_overflow`,`${t.queue} overflow for ${n} (queueKey=${r}, max=${i})`);return await new Promise((i,s)=>{let c=null,l=!1,u=()=>{c&&=(clearTimeout(c),null)},d=e=>{l||(l=!0,u(),s(e))},f=e=>{l||(l=!0,u(),i(e))},p=e=>X(`cancelled`,`${t.queuedOperation} cancelled for ${n} (queueKey=${r}${e===`queue_cleared`?`, queue_cleared`:``})`),m=e=>X(`commit_queue_timeout`,`${t.queue} timeout for ${n} (queueKey=${r}, waited>${e}ms before start)`),h={enqueuedAtMs:Date.now(),timeoutMs:a,shouldAbort:e.shouldAbort,timeoutHandle:null,isSettled:()=>l,reject:d,makeCancelledError:p,makeTimeoutError:m,run:async()=>{if(e.shouldAbort?.())throw p(`cancelled`);f(await e.task())}};c=setTimeout(()=>{if(h.isSettled())return;let t=o.items.indexOf(h);t>=0&&o.items.splice(t,1),d(m(a)),!o.running&&o.items.length===0&&e.queueByKey.get(r)===o&&e.queueByKey.delete(r)},a),h.timeoutHandle=c,o.items.push(h),ct(e.queueByKey,r)})}function Z(e){let t={walletId:p(e.laneIdentity),authMethod:u(e.laneIdentity.auth),laneIdentity:e.laneIdentity};return e.kind===`ecdsa`?{...t,walletSessionId:e.authorization.operationCredential.walletSessionId,quotaId:e.authorization.session.quotaId}:{...t,walletSessionId:e.laneIdentity.walletSessionId,quotaId:e.laneIdentity.quotaId}}function Q(e){return{kind:`invalid`,...Z(e.source)}}function $(e){let t=Number(e);return!Number.isSafeInteger(t)||t<0?null:t}function ft(e){let t=$(e.expiresAtMs),n=$(e.detectedAtMs);if(t===null||t===0)throw Error(`Authoritative expired Wallet Session expiresAtMs is invalid`);if(n===null||n===0)throw Error(`Authoritative expired Wallet Session detectedAtMs is invalid`);if(t>n)throw Error(`Authoritative expired Wallet Session timeline is invalid`);return{kind:`expired`,...Z(e.source),expiresAtMs:t,detectedAtMs:n}}function pt(e){let t=$(e.observation.expiresAtMs);if(t===null||t===0)return Q({source:e.observation.source});let n=Z(e.observation.source);return t<=e.nowMs?{kind:`expired`,...n,expiresAtMs:t,detectedAtMs:e.nowMs}:{kind:`active`,...n,expiresAtMs:t}}function mt(e){let t=$(e.nowMs);if(t===null)return Q({source:e.observation.source});switch(e.observation.kind){case`found`:return pt({observation:e.observation,nowMs:t});case`missing`:return{kind:`missing`,...Z(e.observation.source)};case`unavailable`:return{kind:`unavailable`,...Z(e.observation.source)};case`invalid`:return Q({source:e.observation.source});default:return e.observation}}export{C as _,dt as a,D as c,le as d,ce as f,at as g,A as h,ut as i,fe as l,se as m,ft as n,T as o,M as p,lt as r,E as s,mt as t,de as u,w as v};
|
|
1
|
+
import{P as e,r as t}from"./domainIds-C3fUa33Q.js";import{t as n}from"./accountIds-Cpvlkvbe.js";import{c as r,o as i}from"./ecdsaChainTarget-DkOrgv4y.js";import{Nt as a,T as o,g as s}from"./emailOtpEcdsaDerivationIdentity-CupWCKNg.js";import{r as c}from"./registrationIds-B1OpqRAt.js";import{t as l}from"./signerSlot-FJAGOhmg.js";import{c as u,s as d}from"./types-CQTWmtqu.js";import{a as f,k as p}from"./nearEd25519YaoSigningPreparation-yKDLQXBS.js";function m(e){let t=Math.floor(Number(e));return!Number.isFinite(t)||t<=0?null:t.toString(10).padStart(20,`0`)}function h(e,t){if(e.length===0)return{kind:`no_current_lane`,unusableFacts:[]};let n=_(e,t),r=v(n,t);if(r.length)return{kind:`conflicting_key_material`,conflicts:r};if(n.length!==1)return{kind:`ambiguous_material`,candidates:e};let i=n[0];return i?g(i,t.supersession):{kind:`no_current_lane`,unusableFacts:[]}}function g(e,t){let n=e.facts.filter(t.isOperationUsable);if(n.length===0)return{kind:`no_current_lane`,unusableFacts:e.facts};let r=y(n,t);return r.kind===`ambiguous`?{kind:`ambiguous_material`,candidates:r.candidates}:{kind:`selected`,selectedFact:r.fact,supersededFacts:e.facts.filter(e=>e!==r.fact)}}function _(e,t){let n=new Map;for(let r of e){let e=t.groupKey(r),i=t.groupKeyString(e),a=n.get(i);n.set(i,a?{groupKey:a.groupKey,facts:[...a.facts,r]}:{groupKey:e,facts:[r]})}return[...n.values()]}function v(e,t){return e.flatMap(e=>t.groupConflicts(e.facts))}function y(e,t){let n=e[0];if(n===void 0)return{kind:`ambiguous`,candidates:[]};let r=n;for(let n of e.slice(1)){let e=b(r,n,t);switch(e.kind){case`left`:break;case`right`:r=n;break;case`ambiguous`:return{kind:`ambiguous`,candidates:e.candidates};default:return e}}return{kind:`selected`,fact:r}}function b(e,t,n){let r=x(e,t,n);if(r.kind!==`equal`)return r;let i=S(e,t,n);if(i.kind!==`equal`)return i;let a=n.tieBreak(e,t);switch(a){case 1:return{kind:`left`};case-1:return{kind:`right`};case 0:return{kind:`ambiguous`,candidates:[e,t]};default:return a}}function x(e,t,n){let r=n.generation(e),i=n.generation(t);return!r||!i?{kind:`ambiguous`,candidates:[e,t]}:r>i?{kind:`left`}:i>r?{kind:`right`}:{kind:`equal`}}function S(e,t,n){let r=n.exactness(e);return r===n.exactness(t)?{kind:`equal`}:r===`exact_target`?{kind:`left`}:{kind:`right`}}function C(e){return{kind:`ed25519_durable_material`,authMethod:e.authMethod,materialActivation:e.materialActivation}}function w(e){return[e.activationId,e.capability,e.materialOwner,e.keyBinding,e.lifecycleBinding,e.signingWorker].map(e=>encodeURIComponent(String(e))).join(`:`)}function T(e){let t={source:e.source,runtime:e.runtime,key:e.key,materialActivation:e.materialActivation,publicFacts:e.publicFacts,curve:`ecdsa`,chainTarget:e.chainTarget,state:e.state,authorizationState:e.authorizationState};if(e.auth.kind===`passkey`){if(!e.resolvedKey)throw Error(`active Wallet Authority passkey lane is missing its resolved ECDSA key`);return{...t,auth:e.auth,resolvedKey:e.resolvedKey}}return{...t,auth:e.auth}}function ee(e){let t=e.authorization;return t?e.remainingUses===t.runtime.remainingUses&&e.expiresAtMs===t.runtime.expiresAtMs:!0}function E(e){return u(e.auth)}function D(e){return u(e.auth)}function O(e){let t=e.ed25519Restore;if(e.authMethod===`passkey`){if(!t.credentialIdB64u)return null;try{return{kind:`passkey`,rpId:o(t.rpId),credentialIdB64u:t.credentialIdB64u}}catch{return null}}return t.providerSubjectId?{kind:`email_otp`,providerSubjectId:t.providerSubjectId}:null}function k(e){let{authorization:t}=e;if(String(t.session.walletId)!==e.walletId||t.selectedAuthMethod.kind!==e.auth.kind||t.operationCredential.walletSessionId.length===0||t.session.quotaId.length===0||!f({session:t.session,materialActivation:e.materialActivation}))return!1;if(e.auth.kind===`passkey`){if(t.selectedAuthMethod.kind!==`passkey`||String(t.selectedAuthMethod.rpId)!==String(e.auth.rpId)||t.selectedAuthMethod.credentialIdB64u!==e.auth.credentialIdB64u)return!1}else if(t.selectedAuthMethod.kind!==`email_otp`||t.selectedFactorAuthority.factor.kind!==`email_otp`||t.selectedFactorAuthority.factor.providerUserId!==e.auth.providerSubjectId)return!1;return!!(e.ownerScope&&d(e.auth)===d(e.ownerScope.auth))}function te(e,t,i){if(e.curve!==`ed25519`)return null;let a=String(e.thresholdSessionIds.ed25519||``).trim(),o=String(e.walletId||``).trim(),s=e.ed25519Restore,u=l(s.signerSlot),d=O(e);if(!a||!o||u===null||!d)return null;let f=Math.floor(Number(e.expiresAtMs)||0),p=Math.max(0,Math.floor(Number(e.remainingUses)||0)),m=f>0&&f<=Date.now()?`expired`:p===0?`exhausted`:`restorable`,h=t&&k({authorization:t,auth:d,walletId:o,materialActivation:s.materialActivation,ownerScope:i})?t:null;try{let t={auth:d,curve:`ed25519`,chain:`near`,materialActivation:s.materialActivation,walletId:r(o),nearAccountId:n(s.nearAccountId),nearEd25519SigningKeyId:c(s.nearEd25519SigningKeyId),signerSlot:u,source:`durable_sealed_record`,thresholdSessionId:a,remainingUses:p,...f>0?{expiresAtMs:f}:{},updatedAtMs:Math.floor(Number(e.updatedAtMs)||0),...P(e)?{policyHint:P(e)}:{}};return h?{...t,state:m,authorizationState:`authorized`,authorization:h}:{...t,state:`deferred`,authorizationState:`authorization_required`}}catch{return null}}function ne(e){return e.auth.kind===`email_otp`}function re(e,t,i){let a=String(e.walletId||``).trim(),o=String(e.nearAccountId||``).trim(),s=String(e.thresholdSessionId||``).trim();if(!a||!o||!s)return null;let c=t&&k({authorization:t,auth:e.auth,walletId:a,materialActivation:e.materialActivation,ownerScope:i})?t:null;try{let t={auth:e.auth,curve:`ed25519`,chain:`near`,materialActivation:e.materialActivation,walletId:r(a),nearAccountId:n(o),nearEd25519SigningKeyId:e.nearEd25519SigningKeyId,signerSlot:e.signerSlot,thresholdSessionId:s,source:`public_capability_reference`};if(!c)return{...t,state:`deferred`,authorizationState:`authorization_required`};let i=Math.floor(Number(c.status.expiresAtMs)||0),l=ne(e)?e:null,u=l?Math.min(l.expiresAtMs,i):i,d=u>0&&u<=Date.now()?`expired`:`ready`;return{...t,state:d,authorizationState:`authorized`,authorization:c,remainingUses:c.status.remainingUses,...u>0?{expiresAtMs:u}:{}}}catch{return null}}function A(e){if(e.state===`missing`)return!1;if(e.curve!==`ecdsa`){let t=String(e.thresholdSessionId||``).trim();return e.thresholdSessionId!==t||!t?!1:e.authorizationState===`authorization_required`?e.state===`deferred`:!e.authorization.operationCredential.walletSessionId||!e.authorization.session.quotaId||e.authorization.status.remainingUses<=0||e.authorization.status.expiresAtMs<=Date.now()?!1:e.auth.kind===`email_otp`||e.auth.kind===`passkey`}return e.auth.kind!==`email_otp`&&e.auth.kind!==`passkey`||e.source===`active_wallet_authority`&&(e.state!==`deferred`||e.authorizationState!==`authorization_required`||e.runtime.kind!==`active_wallet_authority_ecdsa_runtime_v1`||String(e.runtime.walletId)!==String(e.key.walletId)||!t(e.runtime.materialActivation,e.materialActivation)||e.runtime.publicFacts!==e.publicFacts)||!(e.key&&String(e.key.walletId||``).trim()&&String(e.key.ecdsaThresholdKeyId||``).trim()&&String(e.key.signingRootId||``).trim()&&String(e.key.signingRootVersion||``).trim()&&Array.isArray(e.key.participantIds)&&e.key.participantIds.length>0&&String(e.key.thresholdOwnerAddress||``).trim()&&`publicFacts`in e&&e.publicFacts&&e.publicFacts.keyHandle&&String(e.publicFacts.publicKeyB64u||``).trim()&&Array.isArray(e.publicFacts.participantIds)&&e.publicFacts.participantIds.length>0&&String(e.publicFacts.thresholdOwnerAddress||``).trim())||e.source===`canonical_capability`&&!ee(e)?!1:u(e.auth)===`passkey`?e.resolvedKey?.kind===`resolved_evm_family_ecdsa_key`&&e.resolvedKey.authBinding.kind===`passkey_ecdsa_auth_binding`&&String(e.resolvedKey.walletId)===String(e.key.walletId)&&e.resolvedKey.publicFacts===e.publicFacts:!(`resolvedKey`in e)}function j(e){return e===`missing`?null:e}function ie(e){return e||`unknown`}function ae(e){let t=Math.floor(Number(e));return Number.isFinite(t)&&t>0?t:null}function oe(e){let t=Math.max(0,Math.floor(Number(e)));return Number.isFinite(t)?t:null}function se(e){if(!A(e.lane)||e.lane.curve!==`ed25519`)return null;let t=j(e.lane.state);if(!t)return null;let n={kind:`lane_candidate`,walletId:e.lane.walletId,nearAccountId:e.lane.nearAccountId,nearEd25519SigningKeyId:e.lane.nearEd25519SigningKeyId,signerSlot:e.lane.signerSlot,materialActivation:e.lane.materialActivation,auth:e.lane.auth,curve:`ed25519`,chain:`near`,thresholdSessionId:e.lane.thresholdSessionId,state:t,remainingUses:oe(e.lane.remainingUses),expiresAtMs:ae(e.lane.expiresAtMs),updatedAtMs:ae(e.lane.updatedAtMs),source:ie(e.lane.source)};return e.lane.authorizationState===`authorization_required`?{...n,authorizationState:`authorization_required`,state:`deferred`}:{...n,authorizationState:`authorized`,authorization:e.lane.authorization}}function ce(e){if(!A(e.lane)||e.lane.curve!==`ecdsa`)return null;let t=j(e.lane.state);if(!t)return null;let n=u(e.lane.auth),i={kind:`lane_candidate`,walletId:r(e.walletId),auth:e.lane.auth,authMethod:n,curve:`ecdsa`,chain:e.lane.chainTarget.kind,key:e.lane.key,materialActivation:e.lane.materialActivation,...n===`passkey`?{resolvedKey:e.lane.resolvedKey}:{},keyHandle:e.lane.publicFacts.keyHandle,chainTarget:e.lane.chainTarget};switch(e.lane.source){case`active_wallet_authority`:return{...i,source:`active_wallet_authority`,runtime:e.lane.runtime,authorizationState:`authorization_required`,state:`deferred`};case`canonical_capability`:return e.lane.authorization?{...i,source:`canonical_capability`,authorizationState:`authorized`,authorization:e.lane.authorization,state:t}:{...i,source:`canonical_capability`,authorizationState:`authorization_required`,state:`deferred`};default:return e.lane}}function le(e){if(!e||e.curve!==`ecdsa`||!e.chainTarget||!(`key`in e)||!e.key||!(`auth`in e)||!e.auth)return null;let t=u(e.auth);try{let n=d(e.auth);return[t,`ecdsa`,i(e.chainTarget),n,ue(e),w(e.materialActivation)].join(`:`)}catch{return null}}function ue(e){return s({walletId:e.key.walletId,publicFacts:e.publicFacts})}function M(e){if(!e||e.curve!==`ed25519`||e.chain!==`near`||e.state===`missing`||!e.auth)return null;let t=u(e.auth),n=String(e.walletId||``).trim(),r=String(e.nearAccountId||``).trim(),i=String(e.nearEd25519SigningKeyId||``).trim(),a=String(e.signerSlot||``).trim(),o=String(e.thresholdSessionId||``).trim(),s=e.materialActivation?w(e.materialActivation):``;return!t||!n||!r||!i||!a||!o||!s?null:[n,r,i,a,t,`ed25519`,`near`,o,s].join(`:`)}function N(e){return{curve:`ecdsa`,chainTarget:e.chainTarget,state:`missing`}}function de(e,t){let n=i(t);return e.ecdsa.lanesByTarget[n]||N({chainTarget:t})}function fe(e,t){let n=i(t);return e.ecdsa.candidatesByTarget[n]||[]}function pe(){return{curve:`ed25519`,chain:`near`,state:`missing`}}function P(e){let t=Math.floor(Number(e.remainingUses)),n=Math.floor(Number(e.expiresAtMs)),r={};return Number.isFinite(t)&&t>=0&&(r.remainingUses=t),Number.isFinite(n)&&n>0&&(r.expiresAtMs=n),Object.keys(r).length?r:void 0}function F(e){return Math.floor(Number(`updatedAtMs`in e?e.updatedAtMs:0)||0)}function I(e){return m(e.expiresAtMs??e.policyHint?.expiresAtMs)}function L(e){switch(e.state){case`ready`:return 5;case`restorable`:return 4;case`deferred`:return 3;case`expired`:case`exhausted`:return 2;case`missing`:return 1}}function R(e){return!A(e)||e.curve===`ecdsa`?0:e.source===`durable_sealed_record`?1:0}function z(e,t){return L(e)-L(t)||R(e)-R(t)||F(e)-F(t)}function me(e,t){return z(e,t)}function he(e,t){return L(e)-L(t)||R(e)-R(t)||F(e)-F(t)}function B(e){let t=d(e.auth),n=String(e.walletId||``).trim(),r=String(e.nearAccountId||``).trim(),i=String(e.nearEd25519SigningKeyId||``).trim(),a=String(e.signerSlot||``).trim(),o=w(e.materialActivation);return!t||!n||!r||!i||!a||!o?null:{walletId:n,authKey:t,nearAccountId:r,nearEd25519SigningKeyId:i,signerSlot:a,materialActivationKey:o}}function V(e){return[e.walletId,e.authKey,e.nearAccountId,e.nearEd25519SigningKeyId,e.signerSlot,e.materialActivationKey].map(e=>encodeURIComponent(e)).join(`|`)}function ge(e){if(!A(e)||e.curve!==`ed25519`)return null;let t=B(e);return t?{groupKey:t,lane:e}:null}function H(e,t){return me(t,e)}function U(e,t){return e>t?1:t>e?-1:0}function W(e,t){let n=e.localeCompare(t);return n>0?1:n<0?-1:0}function G(e){for(let t of e)if(t!==0)return t;return 0}function _e(e){return[]}function ve(e){return!0}function ye(e){return I(e.lane)}function be(){return`exact_target`}function xe(e,t){return G([U(L(e.lane),L(t.lane)),U(R(e.lane),R(t.lane)),W(Se(e.lane),Se(t.lane))])}function Se(e){return[e.thresholdSessionId,e.authorizationState===`authorized`?e.authorization.operationCredential.walletSessionId:``,e.authorizationState===`authorized`?e.authorization.session.quotaId:``,e.source||`durable_sealed_record`].map(e=>String(e)).join(`|`)}const Ce={groupKey:we,groupKeyString:V,groupConflicts:_e,supersession:{isOperationUsable:ve,generation:ye,exactness:be,tieBreak:xe}};function we(e){return e.groupKey}function Te(e){let t=new Map;for(let n of e){let e=V(n.groupKey);t.set(e,[...t.get(e)||[],n])}return t}function Ee(e,t){let n=h(e,Ce);switch(n.kind){case`selected`:return[n.selectedFact.lane];case`no_current_lane`:return[];case`conflicting_key_material`:return t.push({curve:`ed25519`,source:`canonical_lane_inventory`,reason:`conflicting_key_material`,message:`Ed25519 canonical lane inventory has conflicting material facts`}),[];case`ambiguous_material`:return t.push({curve:`ed25519`,source:`canonical_lane_inventory`,reason:`ambiguous_material`,message:`Ed25519 canonical lane inventory has incomparable usable records`}),[];default:return n}}function De(e,t){let n=e.map(ge).filter(e=>e!==null),r=[];for(let e of Te(n).values())r.push(...Ee(e,t));return r.sort(H)}function Oe(e){if(!A(e)||e.curve!==`ed25519`)return null;let t=String(e.thresholdSessionId||``).trim();return e.authorizationState!==`authorized`||!t?null:`${e.authorization.operationCredential.walletSessionId}:${e.authorization.session.quotaId}:${t}`}function ke(e){if(!A(e.primaryLane)||e.primaryLane.curve!==`ed25519`||D(e.primaryLane)!==`passkey`)return e.primaryLane;let t=Oe(e.primaryLane);return t&&e.candidates.find(e=>A(e)&&e.curve===`ed25519`&&D(e)===`email_otp`&&Oe(e)===t)||e.primaryLane}function Ae(){try{return globalThis.localStorage?.getItem(`seams:debug:signing-session`)===`1`}catch{return!1}}function K(e){return e?A(e)?{present:!0,authMethod:u(e.auth),curve:e.curve,keyHandle:e.publicFacts.keyHandle,walletId:e.key.walletId,chainTarget:e.chainTarget,targetKey:i(e.chainTarget),state:e.state,source:e.source,evmFamilyKeyFingerprint:ue(e),ecdsaThresholdKeyId:e.key.ecdsaThresholdKeyId,participantIds:e.publicFacts.participantIds,thresholdOwnerAddress:e.publicFacts.thresholdOwnerAddress,remainingUses:e.remainingUses,expiresAtMs:e.expiresAtMs,updatedAtMs:e.updatedAtMs}:{present:!0,curve:e.curve,chainTarget:e.chainTarget,state:e.state}:{present:!1}}function je(e){switch(e.source){case`canonical_capability`:return`canonical_capability`;case`active_wallet_authority`:return`active_wallet_authority`;default:return e}}function Me(e){let t=d(e.auth);return{walletId:String(e.key.walletId),authKey:t,materialActivationKey:w(e.materialActivation),ecdsaThresholdKeyId:String(e.key.ecdsaThresholdKeyId),signingRootId:String(e.key.signingRootId),signingRootVersion:String(e.key.signingRootVersion||`default`)}}function Ne(e){return[e.walletId,e.authKey,e.materialActivationKey,e.ecdsaThresholdKeyId,e.signingRootId,e.signingRootVersion].map(e=>encodeURIComponent(e)).join(`|`)}function Pe(e){let t=Me(e);return t?{source:je(e),groupKey:t,chainTargetKey:i(e.chainTarget),lane:e}:null}function Fe(e){let t=d(e.auth);return[String(e.key.walletId),t,w(e.materialActivation),String(e.key.signingRootId),String(e.key.signingRootVersion||`default`)].map(e=>encodeURIComponent(e)).join(`|`)}function q(e,t){return[...new Set(e.map(e=>t(e.lane)).filter(Boolean))].sort()}function Ie(e){return[{field:`ecdsaThresholdKeyId`,values:q(e.facts,e=>String(e.key.ecdsaThresholdKeyId||``))},{field:`thresholdOwnerAddress`,values:q(e.facts,e=>String(e.publicFacts.thresholdOwnerAddress||``).toLowerCase())},{field:`keyHandle`,values:q(e.facts,e=>String(e.publicFacts.keyHandle||``))},{field:`publicKeyB64u`,values:q(e.facts,e=>String(e.publicFacts.publicKeyB64u||``))},{field:`participantIds`,values:q(e.facts,e=>e.publicFacts.participantIds.map(e=>Number(e)).join(`,`))}].filter(e=>e.values.length>1).map(t=>({groupKey:e.key,field:t.field,values:t.values}))}function Le(e){let t=new Map;for(let n of e){let e=Fe(n.lane);e&&t.set(e,[...t.get(e)||[],n])}let n=new Map;for(let[e,r]of t){let t=r[0];if(!t)continue;let i=Ie({key:t.groupKey,facts:r});i.length&&n.set(e,i)}return n}function Re(e){let t=Fe(e.fact.lane);return t&&e.conflictsByFamilyGroup.get(t)||[]}function ze(e){return e.filter(e=>A(e)&&e.curve===`ecdsa`).map(Pe).filter(e=>e!==null)}function Be(e){return e.source===`active_wallet_authority`?2:1}function Ve(e){return e.groupKey}function He(e){let t=e[0];return t?Ie({key:t.groupKey,facts:e}):[]}function Ue(e){return e.lane.source===`active_wallet_authority`?!0:e.lane.state!==`deferred`||!e.lane.authorization}function We(e){return I(e.lane)}function Ge(e){return`exact_target`}function J(e){return[w(e.materialActivation),e.source,i(e.chainTarget)].map(e=>String(e)).join(`|`)}function Ke(e,t){return G([U(L(e.lane),L(t.lane)),U(Be(e.lane),Be(t.lane)),W(J(e.lane),J(t.lane))])}const qe={groupKey:Ve,groupKeyString:Ne,groupConflicts:He,supersession:{isOperationUsable:Ue,generation:We,exactness:Ge,tieBreak:Ke}};function Je(e){let t=new Map;for(let n of e)t.set(Ne(n.groupKey),n.groupKey);return[...t.values()]}function Ye(e){let t=h(e,qe);switch(t.kind){case`selected`:return{kind:`selected`,selectedFact:t.selectedFact,supersededFacts:t.supersededFacts};case`no_current_lane`:return{kind:`no_current_lane`,unusableFacts:t.unusableFacts};case`conflicting_key_material`:return{kind:`conflicting_key_material`,conflicts:t.conflicts};case`ambiguous_material`:return{kind:`ambiguous_material`,candidates:Je(t.candidates),candidateFacts:t.candidates};default:return t}}function Xe(e){return A(e)?J(e):null}function Ze(e){let t={},n={},r=Object.fromEntries(Object.entries(e.candidatesByTarget).map(([e,t])=>[e,Qe(t,Xe)])),a=Le(Object.values(r).flatMap(ze));for(let o of e.targets){let s=i(o),c=ze(r[s]||[]),l=c.flatMap(e=>Re({fact:e,conflictsByFamilyGroup:a}));if(l.length){e.invalidLanes.push({curve:`ecdsa`,source:`canonical_lane_inventory`,reason:`conflicting_key_material`,targetKey:s,groupKey:l[0]?.groupKey,conflicts:l}),t[s]=[],n[s]=N({chainTarget:o});continue}let u=Ye(c);switch(u.kind){case`selected`:t[s]=[u.selectedFact.lane],n[s]=u.selectedFact.lane;break;case`no_current_lane`:t[s]=[],n[s]=N({chainTarget:o});break;case`conflicting_key_material`:e.invalidLanes.push({curve:`ecdsa`,source:`canonical_lane_inventory`,reason:`conflicting_key_material`,targetKey:s,groupKey:u.conflicts[0]?.groupKey,conflicts:u.conflicts}),t[s]=[],n[s]=N({chainTarget:o});break;case`ambiguous_material`:e.invalidLanes.push({curve:`ecdsa`,source:`canonical_lane_inventory`,reason:`ambiguous_material`,targetKey:s}),t[s]=[],n[s]=N({chainTarget:o});break}}return{lanesByTarget:n,candidatesByTarget:t}}function Qe(e,t,n=z){let r=new Map,i=[];for(let n of e){let e=t(n);if(!e){i.push(n);continue}r.set(e,[...r.get(e)||[],n])}return[...[...r.values()].map(e=>[...e].sort((e,t)=>n(t,e))[0]),...i]}function $e(e){let t=new Set(e.filter(e=>A(e)&&e.curve===`ed25519`&&e.source===`durable_sealed_record`&&(e.state===`ready`||e.state===`restorable`)).map(B).filter(e=>e!==null).map(V));return t.size?e.filter(e=>{if(!A(e)||e.curve!==`ed25519`||e.source!==`public_capability_reference`)return!0;let n=B(e);return!n||!t.has(V(n))}):[...e]}async function et(e,t){return e.state===`missing`||d(e.auth)!==d(t.auth)||!await rt(e,t)?!1:t.auth.kind===`email_otp`?!0:`keyFamily`in t&&t.keyFamily===`ecdsa`?!1:e.signerSlot===t.signerSlot}function tt(e,t){return e.state===`missing`||d(e.auth)!==d(t.auth)?!1:nt(e,t)}function nt(e,t){let n=t.auth.kind===`email_otp`?t.ownerAuthority:void 0;if(!n)return!0;if(e.curve===`ecdsa`&&e.source===`active_wallet_authority`)return e.runtime.factorAuthorityRef.walletAuthMethodId===n.walletAuthMethodId&&String(e.runtime.factorAuthorityRef.authorityDigest)===String(n.authorityDigest);if(e.curve===`ecdsa`&&e.source===`canonical_capability`){let t=e.capability.manifest.signer.authority;return t.walletAuthMethodId===n.walletAuthMethodId&&String(t.authorityDigest)===String(n.authorityDigest)}return!1}async function rt(e,t){let n=t.auth.kind===`email_otp`?t.ownerAuthority:void 0;if(!n)return!0;if(e.state===`missing`||e.curve!==`ed25519`)return!1;if(e.authorizationState===`authorization_required`)return!0;try{let t=await a({authority:e.authorization.selectedFactorAuthority});return t.walletId===e.walletId&&t.walletAuthMethodId===n.walletAuthMethodId&&t.authorityDigest===n.authorityDigest}catch{return!1}}async function it(e,t){let n=[];for(let r of e)await et(r,t)&&n.push(r);return n}async function at(e,t){let n=r(e.walletId),a=new Map;for(let t of e.ecdsaChainTargets)a.set(i(t),t);let o=[...a.values()],[s,c,l,d]=await Promise.all([t.listSealedRecordsForWallet({walletId:n,filter:{...e.authMethod?{authMethod:e.authMethod}:{},curve:`ed25519`}}),t.listPublicCapabilityReferences?.()??[],t.readActiveWalletSessionAuthorization?.(n)??{kind:`missing`},o.length>0&&t.listCanonicalEcdsaLanesForWallet?t.listCanonicalEcdsaLanesForWallet({walletId:n}):[]]),f=l.kind===`found`?l.authorization:null,p=[...o],m={},h={},g={};for(let e of p){let t=i(e);m[t]=N({chainTarget:e}),h[t]=[],g[t]=0}let _=[],v=0,y=Ae(),b=[],x=[];for(let t of s){let n=te(t,f,e.ownerScope);if(!n)continue;_.push(n);let r=F(n);v=Math.max(v,r)}for(let r of c){if(String(r.walletId)!==String(n))continue;let i=l.kind===`exhausted`||l.kind===`expired`;if(!t.isPublicCapabilityActive?.(r)&&!i)continue;let a=re(r,f,e.ownerScope);a&&(e.authMethod&&u(a.auth)!==e.authMethod||_.push(a))}for(let t of d){let r=u(t.auth);if(e.authMethod&&r!==e.authMethod||String(t.key.walletId)!==String(n))continue;let o=i(t.chainTarget);if(!a.has(o))continue;h[o]||=[],h[o].push(t);let s=F(t);v=Math.max(v,s),b.push({result:`accepted`,targetKey:o,lane:K(t)})}let S=o.length>0&&t.listActiveWalletAuthorityEcdsaLanesForWallet?await t.listActiveWalletAuthorityEcdsaLanesForWallet({walletId:n,chainTargets:o}):[];for(let t of S){let r=u(t.auth);if(e.authMethod&&r!==e.authMethod||String(t.key.walletId)!==String(n))continue;let o=i(t.chainTarget);a.has(o)&&(h[o]||=[],h[o].push(t),b.push({result:`accepted`,targetKey:o,lane:K(t)}))}let C=e.ownerScope,w=C?await it(_,C):_;if(C)for(let e of Object.keys(h))h[e]=(h[e]||[]).filter(e=>tt(e,C));let T=De(Qe($e(w),M,he).sort(H),x),ee=ke({primaryLane:T[0]||pe(),candidates:T}),E=Ze({targets:p,candidatesByTarget:Ze({targets:p,candidatesByTarget:h,invalidLanes:x}).candidatesByTarget,invalidLanes:x}),D={walletId:n,generation:v,ecdsa:{targets:p,lanesByTarget:E.lanesByTarget,candidatesByTarget:E.candidatesByTarget},lanes:{ed25519:{near:ee}},candidates:{ed25519:{near:T}},diagnostics:{invalidLanes:x}},O=p.map(e=>{let t=i(e),n=D.ecdsa.candidatesByTarget[t]||[],r=D.ecdsa.lanesByTarget[t],a=r?.state||`missing`;return n.length>0&&a!==`missing`?null:{chainTarget:e,targetKey:t,candidateCount:n.length,selectedLane:K(r)}}).filter(e=>!!e),k={walletId:n,authMethod:e.authMethod||`any`,requestedTargets:p.map(e=>({chainTarget:e,targetKey:i(e)})),sealedRecordCount:0,runtimeRecordCount:d.length,durableDiscovery:[],runtimeDiscovery:b,resultSelectedLanesByTarget:Object.fromEntries(Object.entries(D.ecdsa.lanesByTarget).map(([e,t])=>[e,K(t)])),resultCandidatesByTarget:Object.fromEntries(Object.entries(D.ecdsa.candidatesByTarget).map(([e,t])=>[e,t.map(e=>K(e))]))};if(y&&O.length>0)try{console.warn(`[SigningLanes][available][ecdsa][missing-candidates]`,JSON.stringify({...k,missingEcdsaTargets:O}))}catch{}if(y)try{console.info(`[SigningLanes][available][ecdsa]`,JSON.stringify(k))}catch{}return D}function Y(t,n){return e(t,{fallback:n,min:1})}function X(e,t){let n=Error(`[SigningEngine] ${t}`);return n.code=e,n}function ot(e,t){let n=e.get(t);if(n)return n;let r={running:!1,items:[]};return e.set(t,r),r}function st(e){e.timeoutHandle&&=(clearTimeout(e.timeoutHandle),null)}async function ct(e,t){let n=e.get(t);if(!(!n||n.running)){n.running=!0;try{for(;n.items.length>0;){let e=n.items.shift();if(e&&!e.isSettled()){if(st(e),e.shouldAbort?.()){e.reject(e.makeCancelledError(`cancelled`));continue}if(Date.now()-e.enqueuedAtMs>e.timeoutMs){e.reject(e.makeTimeoutError(e.timeoutMs));continue}try{await e.run()}catch(t){e.reject(t)}}}}finally{n.running=!1,n.items.length===0&&e.get(t)===n?e.delete(t):n.items.length>0&&ct(e,t)}}}function lt(e){for(let t of e.values()){for(let e of t.items)st(e),e.reject(e.makeCancelledError(`queue_cleared`));t.items.length=0}e.clear()}function ut(e){return[`material`,encodeURIComponent(String(e.materialActivation.materialOwner)),encodeURIComponent(String(e.materialActivation.capability)),encodeURIComponent(String(e.materialActivation.activationId))].join(`:`)}async function dt(e){let{labels:t,owner:n}=e,r=String(e.queueKey||``).trim();if(!r)throw Error(`[SigningEngine] ${t.queue} requires non-empty queueKey`);if(!e.enabled)return await e.task();let i=Y(e.maxQueueLength,8),a=Y(e.queueTimeoutMs,45e3),o=ot(e.queueByKey,r);if(o.items.length+(o.running?1:0)>=i)throw X(`commit_queue_overflow`,`${t.queue} overflow for ${n} (queueKey=${r}, max=${i})`);return await new Promise((i,s)=>{let c=null,l=!1,u=()=>{c&&=(clearTimeout(c),null)},d=e=>{l||(l=!0,u(),s(e))},f=e=>{l||(l=!0,u(),i(e))},p=e=>X(`cancelled`,`${t.queuedOperation} cancelled for ${n} (queueKey=${r}${e===`queue_cleared`?`, queue_cleared`:``})`),m=e=>X(`commit_queue_timeout`,`${t.queue} timeout for ${n} (queueKey=${r}, waited>${e}ms before start)`),h={enqueuedAtMs:Date.now(),timeoutMs:a,shouldAbort:e.shouldAbort,timeoutHandle:null,isSettled:()=>l,reject:d,makeCancelledError:p,makeTimeoutError:m,run:async()=>{if(e.shouldAbort?.())throw p(`cancelled`);f(await e.task())}};c=setTimeout(()=>{if(h.isSettled())return;let t=o.items.indexOf(h);t>=0&&o.items.splice(t,1),d(m(a)),!o.running&&o.items.length===0&&e.queueByKey.get(r)===o&&e.queueByKey.delete(r)},a),h.timeoutHandle=c,o.items.push(h),ct(e.queueByKey,r)})}function Z(e){let t={walletId:p(e.laneIdentity),authMethod:u(e.laneIdentity.auth),laneIdentity:e.laneIdentity};return e.kind===`ecdsa`?{...t,walletSessionId:e.authorization.operationCredential.walletSessionId,quotaId:e.authorization.session.quotaId}:{...t,walletSessionId:e.laneIdentity.walletSessionId,quotaId:e.laneIdentity.quotaId}}function Q(e){return{kind:`invalid`,...Z(e.source)}}function $(e){let t=Number(e);return!Number.isSafeInteger(t)||t<0?null:t}function ft(e){let t=$(e.expiresAtMs),n=$(e.detectedAtMs);if(t===null||t===0)throw Error(`Authoritative expired Wallet Session expiresAtMs is invalid`);if(n===null||n===0)throw Error(`Authoritative expired Wallet Session detectedAtMs is invalid`);if(t>n)throw Error(`Authoritative expired Wallet Session timeline is invalid`);return{kind:`expired`,...Z(e.source),expiresAtMs:t,detectedAtMs:n}}function pt(e){let t=$(e.observation.expiresAtMs);if(t===null||t===0)return Q({source:e.observation.source});let n=Z(e.observation.source);return t<=e.nowMs?{kind:`expired`,...n,expiresAtMs:t,detectedAtMs:e.nowMs}:{kind:`active`,...n,expiresAtMs:t}}function mt(e){let t=$(e.nowMs);if(t===null)return Q({source:e.observation.source});switch(e.observation.kind){case`found`:return pt({observation:e.observation,nowMs:t});case`missing`:return{kind:`missing`,...Z(e.observation.source)};case`unavailable`:return{kind:`unavailable`,...Z(e.observation.source)};case`invalid`:return Q({source:e.observation.source});default:return e.observation}}export{C as _,dt as a,D as c,le as d,ce as f,at as g,A as h,ut as i,fe as l,se as m,ft as n,T as o,M as p,lt as r,E as s,mt as t,de as u,w as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./clientSessionPersistenceState-
|
|
1
|
+
import{a as e}from"./clientSessionPersistenceState-BgO4P6CZ.js";async function t(t){return await e({...t,labels:{queue:`threshold Ed25519 commit queue`,queuedOperation:`threshold Ed25519 queued commit`},owner:String(t.nearAccountId)})}export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return typeof e==`string`&&e.trim().toLowerCase().split(/[-_]/,1)[0]===`ja`?`ja`:`en`}const t={targetDepth:{min:1,max:64},maxRefillInFlight:{min:1,max:8},refillAttemptTimeoutMs:{min:5e3,max:12e4}};export{e as n,t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e}from"./domainIds-C3fUa33Q.js";import{t}from"./theme-
|
|
1
|
+
import{B as e}from"./domainIds-C3fUa33Q.js";import{t}from"./theme-os0Salmo.js";function n(e){if(!e||typeof e!=`object`)return{};let t={};for(let[n,r]of Object.entries(e))typeof r==`string`&&(t[n]=r);return t}function r(t){let n=e(t.value)||t.fallback;if(!n)throw Error(`[configPresets] Invalid config: appearance.theme.id must be non-empty`);return n}function i(e,t){if(!e||typeof e!=`object`)return{};let r=e[t];return!r||typeof r!=`object`?{}:n(r.colors)}function a(e){let a=e.fallback.mode,o=e.fallback.shape,s=t(e.value);if(s)return{id:e.fallback.id,mode:s,colors:{...e.fallback.colors,...i(e.legacyTokens,s)},...o?{shape:o}:{}};if(e.value==null)return{...e.fallback,colors:{...e.fallback.colors,...i(e.legacyTokens,a)}};if(typeof e.value!=`object`||Array.isArray(e.value))throw Error(`[configPresets] Invalid config: appearance.theme must be an object with id, mode, and optional colors`);let c=e.value,l=c.mode,u=l==null?a:t(l);if(!u)throw Error(`[configPresets] Invalid config: appearance.theme.mode must be 'light' or 'dark'`);let d=r({value:c.id,fallback:e.fallback.id}),f=d!==e.fallback.id,p={...f?{}:o||{},...n(c.shape)};return{id:d,mode:u,colors:{...f?{}:e.fallback.colors,...i(e.legacyTokens,u),...n(c.colors)},...Object.keys(p).length>0?{shape:p}:{}}}function o(e){if(e.value==null)return e.fallback;if(e.value!==`default`)throw Error(`[configPresets] Invalid config: appearance.palette must be 'default'`);return`default`}export{o as n,a as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{k as e}from"./domainIds-C3fUa33Q.js";import{i as t,r as n}from"./base64-
|
|
1
|
+
import{k as e}from"./domainIds-C3fUa33Q.js";import{i as t,r as n}from"./base64-BmKR3UqU.js";import{r}from"./canonicalPrimitives-BMP5yILS.js";function i(e,t){if(typeof e!=`string`)throw Error(`EVM-family signing key slot id requires ${t}`);let n=e.trim();if(!n)throw Error(`EVM-family signing key slot id requires ${t}`);return n}function a(e){return encodeURIComponent(i(e,`non-empty components`))}function o(e){let t=e.split(`:`);return t.length===5&&t[0]===`wallet-key`&&t[1]===`evm-family`&&t.slice(2).every(e=>e.length>0)}function s(t){let n=e(t);return n.ok?o(String(n.value))?{ok:!0,value:String(n.value)}:{ok:!1,error:{code:`invalid`,message:`EVM-family signing key slot id must be wallet-key:evm-family:<walletId>:<signingRootId>:<signingRootVersion>`}}:n}function c(e,t=`evmFamilySigningKeySlotId`){let n=s(e);if(n.ok)return n.value;throw n.error.code===`missing`?Error(`${t} is required`):Error(`${t} must be an EVM-family signing key slot id`)}function l(e){return c([`wallet-key`,`evm-family`,a(e.walletId),a(e.signingRootId),a(e.signingRootVersion)].join(`:`))}const u=new TextEncoder;function d(e){let t=0;for(let n of e)t+=n.length;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.length;return n}function f(e,t){if(!Number.isSafeInteger(e)||e<0||e>4294967295)throw Error(`${t} must be a non-negative u32`);return Uint8Array.from([e>>>24&255,e>>>16&255,e>>>8&255,e&255])}function p(e,t){if(!Number.isSafeInteger(e)||e<0)throw Error(`${t} must be a non-negative safe integer`);let n=BigInt(e),r=new Uint8Array(8);for(let e=7;e>=0;--e)r[e]=Number(n&255n),n>>=8n;return r}function m(e,t){return d([f(e.length,`${t}.length`),e])}function h(e,t){if(typeof e!=`string`)throw Error(`${t} must be a string`);return m(u.encode(e),t)}function g(e,t){try{let t=n(r(e));if(t.length!==32)throw Error(`must decode to 32 bytes`);return t}catch(e){throw Error(`${t} ${e instanceof Error?e.message:`is invalid`}`)}}function _(e,r){try{let r=n(e);if(r.length===0||t(r)!==e)throw Error(`must be canonical base64url`);return r}catch(e){throw Error(`${r} ${e instanceof Error?e.message:`is invalid`}`)}}export{h as a,l as c,_ as i,c as l,m as n,f as o,g as r,p as s,d as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e}from"./normalization-C6fQN6mW.js";import{g as t,h as n,m as r,p as i}from"./signingFlow-
|
|
1
|
+
import{n as e}from"./normalization-C6fQN6mW.js";import{g as t,h as n,m as r,p as i}from"./signingFlow-gl85GOW4.js";function a(e){try{return JSON.stringify(e,(e,t)=>typeof t==`bigint`?t.toString():t,2)}catch{return String(e)}}function o(e,t,n){let r=String(t??``).trim();if(r)return{label:e,value:r,...typeof n==`string`&&n.trim()?{copyValue:n}:{}}}function s(t){let n=e(t.input);if(n!==`0x`&&!(!Array.isArray(t.abi)||t.abi.length===0))return{dataHex:n,abi:t.abi}}function c(a){let{rootId:c,call:l,tx:u}=a,d=String(l.to||``).trim(),f=e(String(l.input||`0x`));if(f===`0x`)return;let p=t(f),m=n(p,d)||`contract function`,h=i(u.gasLimit),g=o(`Data`,r(f),f);g&&(g.renderAs=`file-content`,g.hideLabel=!0,g.hideChevron=!0);let _=[g,o(`Value (wei)`,l.value.toString()),o(`Valid Before`,u.validBefore==null?void 0:u.validBefore.toString()),o(`Valid After`,u.validAfter==null?void 0:u.validAfter.toString())].filter(Boolean),v={id:`${c}.call`,kind:`generic.contractCall`,label:`Calling ${m} using ${h} gas`,to:d,value:l.value.toString(),selector:p,fields:_},y=s({input:f,abi:l.abi});return y&&(v.abiDecodeHint=y),v}function l(n){let{call:r,callIndex:i,callCount:a,tx:o}=n,s=`tempo.tx.${i}`,l=String(r.to||``).trim(),u=a>1?`Transaction ${i+1} to contract`:`Transaction to contract`,d=c({rootId:s,call:r,tx:o});return{id:s,kind:`tempo.eip2718`,label:u,txTypeHex:`0x76`,txTypeName:`TempoTransaction`,to:l,selector:t(e(String(r.input||`0x`))),...d?{children:[d]}:{}}}function u(e){if(e.kind!==`tempoTransaction`)return[{id:`tempo.raw`,kind:`raw.fallback`,label:`Unsupported Tempo Payload`,raw:a(e)}];let t=Array.isArray(e.tx.calls)?e.tx.calls:[];return t.length?t.map((n,r)=>l({call:n,callIndex:r,callCount:t.length,tx:e.tx})):[{id:`tempo.raw`,kind:`raw.fallback`,label:`Tempo Payload Missing Calls`,raw:a(e)}]}function d(e){let t=u(e.request),n=BigInt(0);if(e.request.kind===`tempoTransaction`)for(let t of e.request.tx.calls||[])n+=BigInt(t.value||0);return{chain:`tempo`,chainId:e.request.kind===`tempoTransaction`?e.request.tx.chainId:void 0,intentDigest:e.intentDigest,signerAccount:e.signerAccount,title:e.title||`Tempo Transaction`,subtitle:e.subtitle,operations:t,...n>0n?{totals:{nativeValue:n.toString(),nativeSymbol:`wei`}}:{}}}export{d as t};
|