@privy-io/react-auth 1.96.0 → 1.96.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/PhoneCountryDropdown-JNQITU4K.js +1 -0
- package/dist/cjs/WithPrivyStyles-BoJCF7VD.js +1 -0
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/accessToken.js +1 -0
- package/dist/cjs/actions/importWallet.js +1 -0
- package/dist/cjs/auth-flows/authFlowToAuthenticateMethod.js +1 -0
- package/dist/cjs/auth-flows/cross-app.js +1 -0
- package/dist/cjs/auth-flows/custom-jwt-account.js +1 -0
- package/dist/cjs/auth-flows/email.js +1 -0
- package/dist/cjs/auth-flows/farcaster.js +1 -0
- package/dist/cjs/auth-flows/getUiHeader.js +1 -0
- package/dist/cjs/auth-flows/guest.js +1 -0
- package/dist/cjs/auth-flows/oauth/OAuthFlow.js +1 -0
- package/dist/cjs/auth-flows/oauth/detectCompletingOAuthFlow.js +1 -0
- package/dist/cjs/auth-flows/oauth/getDisplayForProvider.js +1 -0
- package/dist/cjs/auth-flows/oauth/getIsHeadlessOAuthFlowInProgress.js +1 -0
- package/dist/cjs/auth-flows/oauth/getOAuthErrorMessage.js +1 -0
- package/dist/cjs/auth-flows/oauth/index.js +1 -0
- package/dist/cjs/auth-flows/oauth/stripUrlOAuthParamsAndRemoveStateCode.js +1 -0
- package/dist/cjs/auth-flows/passkey.js +1 -0
- package/dist/cjs/auth-flows/siwe.js +1 -0
- package/dist/cjs/auth-flows/siws.js +1 -0
- package/dist/cjs/auth-flows/sms.js +1 -0
- package/dist/cjs/auth-flows/telegram.js +1 -0
- package/dist/cjs/auth-flows/types.js +1 -0
- package/dist/cjs/client/user.js +1 -0
- package/dist/cjs/client.js +1 -0
- package/dist/cjs/components/AppLogo.js +1 -0
- package/dist/cjs/components/BaseModal.js +1 -0
- package/dist/cjs/components/Button.js +2 -0
- package/dist/cjs/components/Captcha.js +1 -0
- package/dist/cjs/components/Checkbox.js +1 -0
- package/dist/cjs/components/CircleBackground.js +1 -0
- package/dist/cjs/components/CircleBorder.js +1 -0
- package/dist/cjs/components/ConnectEmailForm.js +1 -0
- package/dist/cjs/components/ConnectPhoneForm.js +1 -0
- package/dist/cjs/components/CopyToClipboard.js +1 -0
- package/dist/cjs/components/CopyableText.js +1 -0
- package/dist/cjs/components/Dialog.js +1 -0
- package/dist/cjs/components/FiatOnrampPrompt.js +1 -0
- package/dist/cjs/components/Layouts.js +1 -0
- package/dist/cjs/components/Loader.js +1 -0
- package/dist/cjs/components/LoginMethodIcon.js +1 -0
- package/dist/cjs/components/LoginModal.js +1 -0
- package/dist/cjs/components/ModalFooter.js +2 -0
- package/dist/cjs/components/ModalHeader.js +1 -0
- package/dist/cjs/components/OpenLink.js +1 -0
- package/dist/cjs/components/PhoneCountryDropdown.js +1 -0
- package/dist/cjs/components/PinInput.js +1 -0
- package/dist/cjs/components/PrefetchedImage.js +1 -0
- package/dist/cjs/components/ProviderAppLogo.js +2 -0
- package/dist/cjs/components/QrCode.js +2 -0
- package/dist/cjs/components/ScreenHeader.js +2 -0
- package/dist/cjs/components/ScreenHelpers.js +1 -0
- package/dist/cjs/components/TelegramLoginButton.js +1 -0
- package/dist/cjs/components/TodoList.js +1 -0
- package/dist/cjs/components/UpdateEmailForm.js +1 -0
- package/dist/cjs/components/WrappedLoader.js +3 -0
- package/dist/cjs/components/embedded-wallets/Details.js +1 -0
- package/dist/cjs/components/embedded-wallets/DisplayInfoItem.js +1 -0
- package/dist/cjs/components/embedded-wallets/FundWalletMethodHeader.js +1 -0
- package/dist/cjs/components/embedded-wallets/PriceDisplay.js +3 -0
- package/dist/cjs/components/embedded-wallets/SetWalletPasswordForm/ConfimWalletPasswordForm.js +2 -0
- package/dist/cjs/components/embedded-wallets/SetWalletPasswordForm/ConfimWalletPasswordSaved.js +1 -0
- package/dist/cjs/components/embedded-wallets/SetWalletPasswordForm/CreateWalletPassword.js +1 -0
- package/dist/cjs/components/embedded-wallets/SetWalletPasswordForm/SaveWalletPassword.js +1 -0
- package/dist/cjs/components/embedded-wallets/SetWalletPasswordForm/SetWalletPasswordComplete.js +1 -0
- package/dist/cjs/components/embedded-wallets/SetWalletPasswordForm/SetWalletPasswordForm.js +1 -0
- package/dist/cjs/components/embedded-wallets/SetWalletPasswordForm/index.js +1 -0
- package/dist/cjs/components/embedded-wallets/SetWalletPasswordForm/setWalletPassword.hooks.js +1 -0
- package/dist/cjs/components/embedded-wallets/SetWalletPasswordForm/shared.js +1 -0
- package/dist/cjs/components/embedded-wallets/SolanaTransactionDetails.js +1 -0
- package/dist/cjs/components/embedded-wallets/StyledLogo.js +1 -0
- package/dist/cjs/components/embedded-wallets/TransactionDetails.js +2 -0
- package/dist/cjs/components/embedded-wallets/TransactionDetailsWrapper.js +1 -0
- package/dist/cjs/components/embedded-wallets/TransactionTotal.js +1 -0
- package/dist/cjs/components/embedded-wallets/WalletLink.js +1 -0
- package/dist/cjs/components/embedded-wallets/index.js +1 -0
- package/dist/cjs/components/external-wallets/InjectedWalletIcon.js +1 -0
- package/dist/cjs/components/layout/StackedContainer.js +1 -0
- package/dist/cjs/components/primitives/Accordion/AccordionContext.js +1 -0
- package/dist/cjs/components/primitives/Accordion/index.js +2 -0
- package/dist/cjs/components/primitives/LoadingSpinner/index.js +1 -0
- package/dist/cjs/components/primitives/NeutralSpinner/index.js +1 -0
- package/dist/cjs/components/ui/animation/LoadingSkeleton.js +1 -0
- package/dist/cjs/components/ui/banners/ErrorBanner.js +1 -0
- package/dist/cjs/components/ui/banners/InfoBanner.js +1 -0
- package/dist/cjs/components/ui/banners/WarningBanner.js +1 -0
- package/dist/cjs/components/ui/chips/Chip.js +1 -0
- package/dist/cjs/components/ui/forms/EmailInputForm.js +1 -0
- package/dist/cjs/components/ui/icons/ApplePay.js +1 -0
- package/dist/cjs/components/ui/icons/Arbitum.js +1 -0
- package/dist/cjs/components/ui/icons/Avalanche.js +1 -0
- package/dist/cjs/components/ui/icons/Base.js +1 -0
- package/dist/cjs/components/ui/icons/Celo.js +1 -0
- package/dist/cjs/components/ui/icons/GooglePay.js +1 -0
- package/dist/cjs/components/ui/icons/Linea.js +1 -0
- package/dist/cjs/components/ui/icons/Mainnnet.js +1 -0
- package/dist/cjs/components/ui/icons/Optimism.js +1 -0
- package/dist/cjs/components/ui/icons/Polygon.js +1 -0
- package/dist/cjs/components/ui/icons/Solana.js +1 -0
- package/dist/cjs/components/ui/icons/WithCircleBorder.js +1 -0
- package/dist/cjs/components/ui/icons/Zora.js +1 -0
- package/dist/cjs/components/ui/layout/Column.js +1 -0
- package/dist/cjs/components/ui/layout/Row.js +1 -0
- package/dist/cjs/components/ui/typography/ErrorMessage.js +1 -0
- package/dist/cjs/components/ui/typography/LabelSm.js +1 -0
- package/dist/cjs/components/ui/typography/LabelXs.js +1 -0
- package/dist/cjs/components/ui/typography/Subtitle.js +1 -0
- package/dist/cjs/components/ui/typography/Title.js +1 -0
- package/dist/cjs/components/ui/typography/Value.js +1 -0
- package/dist/cjs/components/ui/wallet/Address.js +1 -0
- package/dist/cjs/components/ui/wallet/NetworkBalanceCard.js +1 -0
- package/dist/cjs/components/ui/wallet/NetworkBalanceCard.story.js +1 -0
- package/dist/cjs/components/ui/wallet/NetworkIcon.js +1 -0
- package/dist/cjs/components/ui/wallet/NetworkSelectorPanel.js +1 -0
- package/dist/cjs/components/ui/wallet/NetworkSelectorPanel.story.js +1 -0
- package/dist/cjs/components/ui/wallet/WalletInfoCard.js +1 -0
- package/dist/cjs/components/ui/wallet/WalletInfoCard.story.js +1 -0
- package/dist/cjs/components/ui/wallet/shared.js +1 -0
- package/dist/cjs/config.js +1 -0
- package/dist/cjs/configuration/context.js +1 -0
- package/dist/cjs/configuration/defaultClientConfig.js +1 -0
- package/dist/cjs/configuration/login-methods.js +1 -0
- package/dist/cjs/configuration/wallets.js +1 -0
- package/dist/cjs/connectors/NullConnector.js +1 -0
- package/dist/cjs/connectors/areWalletArraysEqual.js +1 -0
- package/dist/cjs/connectors/base.js +1 -0
- package/dist/cjs/connectors/chains/arbitrum.js +1 -0
- package/dist/cjs/connectors/chains/arbitrumGoerli.js +1 -0
- package/dist/cjs/connectors/chains/arbitrumSepolia.js +1 -0
- package/dist/cjs/connectors/chains/avalanche.js +1 -0
- package/dist/cjs/connectors/chains/avalancheFuji.js +1 -0
- package/dist/cjs/connectors/chains/base.js +1 -0
- package/dist/cjs/connectors/chains/baseGoerli.js +1 -0
- package/dist/cjs/connectors/chains/baseSepolia.js +1 -0
- package/dist/cjs/connectors/chains/berachainArtio.js +1 -0
- package/dist/cjs/connectors/chains/celo.js +1 -0
- package/dist/cjs/connectors/chains/celoAlfajores.js +1 -0
- package/dist/cjs/connectors/chains/filecoin.js +1 -0
- package/dist/cjs/connectors/chains/filecoinCalibration.js +1 -0
- package/dist/cjs/connectors/chains/garnetHolesky.js +1 -0
- package/dist/cjs/connectors/chains/goerli.js +1 -0
- package/dist/cjs/connectors/chains/holesky.js +1 -0
- package/dist/cjs/connectors/chains/index.js +1 -0
- package/dist/cjs/connectors/chains/linea.js +1 -0
- package/dist/cjs/connectors/chains/lineaTestnet.js +1 -0
- package/dist/cjs/connectors/chains/lukso.js +1 -0
- package/dist/cjs/connectors/chains/mainnet.js +1 -0
- package/dist/cjs/connectors/chains/optimism.js +1 -0
- package/dist/cjs/connectors/chains/optimismGoerli.js +1 -0
- package/dist/cjs/connectors/chains/optimismSepolia.js +1 -0
- package/dist/cjs/connectors/chains/polygon.js +1 -0
- package/dist/cjs/connectors/chains/polygonAmoy.js +1 -0
- package/dist/cjs/connectors/chains/polygonMumbai.js +1 -0
- package/dist/cjs/connectors/chains/redstone.js +1 -0
- package/dist/cjs/connectors/chains/redstoneHolesky.js +1 -0
- package/dist/cjs/connectors/chains/sepolia.js +1 -0
- package/dist/cjs/connectors/chains/types.js +1 -0
- package/dist/cjs/connectors/chains/utils.js +1 -0
- package/dist/cjs/connectors/chains/zora.js +1 -0
- package/dist/cjs/connectors/chains/zoraSepolia.js +1 -0
- package/dist/cjs/connectors/chains/zoraTestnet.js +1 -0
- package/dist/cjs/connectors/coinbase.js +1 -0
- package/dist/cjs/connectors/embedded.js +1 -0
- package/dist/cjs/connectors/embeddedProvider.js +1 -0
- package/dist/cjs/connectors/errors.js +1 -0
- package/dist/cjs/connectors/ethereum/index.js +1 -0
- package/dist/cjs/connectors/get-legacy-injected-providers.js +1 -0
- package/dist/cjs/connectors/getRpcTimeout.js +1 -0
- package/dist/cjs/connectors/index.js +1 -0
- package/dist/cjs/connectors/injected.js +1 -0
- package/dist/cjs/connectors/is-wallet-installed.js +1 -0
- package/dist/cjs/connectors/isBaseConnectedEthereumWallet.js +1 -0
- package/dist/cjs/connectors/metamask.js +1 -0
- package/dist/cjs/connectors/phantom-redirect.js +1 -0
- package/dist/cjs/connectors/phantom.js +1 -0
- package/dist/cjs/connectors/privyProxyProvider.js +1 -0
- package/dist/cjs/connectors/providerTypes.js +1 -0
- package/dist/cjs/connectors/solana/index.js +1 -0
- package/dist/cjs/connectors/solana/toSolanaWalletConnectors.js +1 -0
- package/dist/cjs/connectors/userAlreadyHasConnectedCoinbaseWallet.js +1 -0
- package/dist/cjs/connectors/walletconnect-client.js +1 -0
- package/dist/cjs/connectors/walletconnect-registry.js +1 -0
- package/dist/cjs/connectors/walletconnect-v2.js +1 -0
- package/dist/cjs/constants.js +1 -0
- package/dist/cjs/cookies.js +1 -0
- package/dist/cjs/crypto.js +1 -0
- package/dist/cjs/crypto.test.js +1 -0
- package/dist/cjs/cssNormalize.js +1 -0
- package/dist/cjs/effect.js +1 -0
- package/dist/cjs/embedded-wallets/EmbeddedWalletIframe.js +2 -0
- package/dist/cjs/embedded-wallets/delegated-actions.js +1 -0
- package/dist/cjs/embedded-wallets/errors.js +1 -0
- package/dist/cjs/embedded-wallets/eventCallbacksQueue.js +1 -0
- package/dist/cjs/embedded-wallets/invokeWithMfa.js +1 -0
- package/dist/cjs/embedded-wallets/rpc/index.js +1 -0
- package/dist/cjs/embedded-wallets/rpc/types.js +1 -0
- package/dist/cjs/embedded-wallets/solana/provider.js +1 -0
- package/dist/cjs/embedded-wallets/solana/transaction.js +1 -0
- package/dist/cjs/embedded-wallets/transactions.js +1 -0
- package/dist/cjs/embedded-wallets/types.js +1 -0
- package/dist/cjs/errors-3fxlG6WB.js +1 -0
- package/dist/cjs/errors.js +1 -0
- package/dist/cjs/ethers-De6TACnn.js +1 -0
- package/dist/cjs/hook-utils/useAsyncValue.js +1 -0
- package/dist/cjs/hook-utils/useInterval.js +1 -0
- package/dist/cjs/hooks/captcha-context.js +1 -0
- package/dist/cjs/hooks/events-context.js +1 -0
- package/dist/cjs/hooks/index.js +1 -0
- package/dist/cjs/hooks/internal-context.js +1 -0
- package/dist/cjs/hooks/modal-context.js +1 -0
- package/dist/cjs/hooks/privy-context.js +1 -0
- package/dist/cjs/hooks/privy-provider.js +1 -0
- package/dist/cjs/hooks/smart-wallets-provider.js +1 -0
- package/dist/cjs/hooks/useConnectCoinbaseSmartWallet.js +1 -0
- package/dist/cjs/hooks/useConnectWallet.js +1 -0
- package/dist/cjs/hooks/useCreateWallet.js +1 -0
- package/dist/cjs/hooks/useCrossAppAccounts.js +1 -0
- package/dist/cjs/hooks/useCustomAuth.js +1 -0
- package/dist/cjs/hooks/useDelegatedActions.js +1 -0
- package/dist/cjs/hooks/useElementHeight.js +1 -0
- package/dist/cjs/hooks/useEmbeddedWalletCreate.js +1 -0
- package/dist/cjs/hooks/useFarcasterSigner.js +1 -0
- package/dist/cjs/hooks/useFormattedBalances.js +1 -0
- package/dist/cjs/hooks/useFundSolanaWallet.js +1 -0
- package/dist/cjs/hooks/useFundWallet.js +1 -0
- package/dist/cjs/hooks/useGetSolPrice.js +1 -0
- package/dist/cjs/hooks/useGetTokenPrice.js +1 -0
- package/dist/cjs/hooks/useGuestAccounts.js +1 -0
- package/dist/cjs/hooks/useImportWallet.js +1 -0
- package/dist/cjs/hooks/useLinkAccount.js +1 -0
- package/dist/cjs/hooks/useLinkWithPasskey.js +1 -0
- package/dist/cjs/hooks/useLinkWithSiwe.js +1 -0
- package/dist/cjs/hooks/useLogin.js +1 -0
- package/dist/cjs/hooks/useLoginWithEmail.js +1 -0
- package/dist/cjs/hooks/useLoginWithOAuth.js +1 -0
- package/dist/cjs/hooks/useLoginWithPasskey.js +1 -0
- package/dist/cjs/hooks/useLoginWithSms.js +1 -0
- package/dist/cjs/hooks/useLogout.js +1 -0
- package/dist/cjs/hooks/useMfa.js +1 -0
- package/dist/cjs/hooks/useMfaEnrollment.js +1 -0
- package/dist/cjs/hooks/useModalStatus.js +1 -0
- package/dist/cjs/hooks/useOAuthTokens.js +1 -0
- package/dist/cjs/hooks/usePrivy.js +1 -0
- package/dist/cjs/hooks/useRegisterMfaListener.js +1 -0
- package/dist/cjs/hooks/useSendSolanaTransaction.js +1 -0
- package/dist/cjs/hooks/useSendTransaction.js +1 -0
- package/dist/cjs/hooks/useSetWalletPassword.js +1 -0
- package/dist/cjs/hooks/useSetWalletRecovery.js +1 -0
- package/dist/cjs/hooks/useSignMessage.js +1 -0
- package/dist/cjs/hooks/useSignTypedData.js +1 -0
- package/dist/cjs/hooks/useSmartWalletChain.js +1 -0
- package/dist/cjs/hooks/useSolanaWallets.js +1 -0
- package/dist/cjs/hooks/useToken.js +1 -0
- package/dist/cjs/hooks/useUpdateAccount.js +1 -0
- package/dist/cjs/hooks/useWalletBalance.js +1 -0
- package/dist/cjs/hooks/useWallets.js +1 -0
- package/dist/cjs/http.js +1 -0
- package/dist/cjs/icons/Apple.js +1 -0
- package/dist/cjs/icons/ArrowLeft.js +1 -0
- package/dist/cjs/icons/Avatar.js +1 -0
- package/dist/cjs/icons/Bot.js +1 -0
- package/dist/cjs/icons/Check.js +1 -0
- package/dist/cjs/icons/Copy.js +1 -0
- package/dist/cjs/icons/DomainsIcon.js +1 -0
- package/dist/cjs/icons/EmptyCheckedCircle.js +1 -0
- package/dist/cjs/icons/KeyRound.js +1 -0
- package/dist/cjs/icons/Login.js +1 -0
- package/dist/cjs/icons/Logout.js +1 -0
- package/dist/cjs/icons/Mail.js +1 -0
- package/dist/cjs/icons/Phone.js +1 -0
- package/dist/cjs/icons/Portal.js +1 -0
- package/dist/cjs/icons/Settings.js +1 -0
- package/dist/cjs/icons/Slack.js +1 -0
- package/dist/cjs/icons/Socials.js +1 -0
- package/dist/cjs/icons/TicketCheck.js +1 -0
- package/dist/cjs/icons/WalletCards.js +1 -0
- package/dist/cjs/icons/Wallets.js +1 -0
- package/dist/cjs/icons/X.js +1 -0
- package/dist/cjs/index-DNFBYH7-.js +1 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/lib/abstract-smart-wallets.js +1 -0
- package/dist/cjs/lib/caip2.js +1 -0
- package/dist/cjs/lib/capitalizeFirstLetter.js +1 -0
- package/dist/cjs/lib/cross-app/authFlow.js +1 -0
- package/dist/cjs/lib/cross-app/index.js +1 -0
- package/dist/cjs/lib/cross-app/popupCrossAppAuthFlow.js +1 -0
- package/dist/cjs/lib/cross-app/sendCrossAppRequest.js +1 -0
- package/dist/cjs/lib/cross-app/types.js +1 -0
- package/dist/cjs/lib/cybr53.js +1 -0
- package/dist/cjs/lib/deployAccount/actions/abis/deployAccount.js +1 -0
- package/dist/cjs/lib/embeddedWalletRecovery.js +1 -0
- package/dist/cjs/lib/erc1155/actions/abis/safeBatchTransferFrom.js +1 -0
- package/dist/cjs/lib/erc1155/actions/abis/safeTransferFrom.js +1 -0
- package/dist/cjs/lib/erc20/actions/abis/approve.js +1 -0
- package/dist/cjs/lib/erc20/actions/abis/transfer.js +1 -0
- package/dist/cjs/lib/erc20/actions/getErc20TokenInfo.js +1 -0
- package/dist/cjs/lib/erc20/formatErc20TokenAmount.js +1 -0
- package/dist/cjs/lib/erc721/actions/abis/mint.js +1 -0
- package/dist/cjs/lib/erc721/actions/abis/safeTransferFrom.js +1 -0
- package/dist/cjs/lib/erc721/actions/abis/setApprovalForAll.js +1 -0
- package/dist/cjs/lib/erc721/actions/abis/transferFrom.js +1 -0
- package/dist/cjs/lib/ethers.js +1 -0
- package/dist/cjs/lib/external-wallets/displayHelpers.js +1 -0
- package/dist/cjs/lib/funding/analytics.js +1 -0
- package/dist/cjs/lib/funding/coinbase/isSupportedChainIdForCoinbaseOnramp.js +1 -0
- package/dist/cjs/lib/funding/coinbase/toCoinbaseBlockchainFromChainId.js +1 -0
- package/dist/cjs/lib/funding/coinbase/triggerCoinbaseFlow.js +1 -0
- package/dist/cjs/lib/funding/coinbase/types.js +1 -0
- package/dist/cjs/lib/funding/externalTransfer.js +1 -0
- package/dist/cjs/lib/funding/filterSupportedOptions.js +1 -0
- package/dist/cjs/lib/funding/index.js +1 -0
- package/dist/cjs/lib/funding/isFundingEnabled.js +1 -0
- package/dist/cjs/lib/funding/moonpay/index.js +1 -0
- package/dist/cjs/lib/funding/moonpay/triggerMoonpayFlow.js +1 -0
- package/dist/cjs/lib/funding/moonpay/types.js +1 -0
- package/dist/cjs/lib/funding/prepareFundingMethods.js +1 -0
- package/dist/cjs/lib/funding/prepareFundingModalData.js +1 -0
- package/dist/cjs/lib/funding/reservoir.js +1 -0
- package/dist/cjs/lib/funding/usdc.js +1 -0
- package/dist/cjs/lib/isEmbeddedWebview.js +1 -0
- package/dist/cjs/lib/pkce.js +1 -0
- package/dist/cjs/lib/polygonGasStation.js +1 -0
- package/dist/cjs/lib/popup/triggerPopup.js +1 -0
- package/dist/cjs/lib/popupOAuthFlow.js +1 -0
- package/dist/cjs/lib/siwe.js +1 -0
- package/dist/cjs/lib/siws.js +1 -0
- package/dist/cjs/lib/smart-wallet-helpers.js +1 -0
- package/dist/cjs/lib/smart-wallets-shared.js +1 -0
- package/dist/cjs/lib/smart-wallets.js +1 -0
- package/dist/cjs/lib/solana/index.js +1 -0
- package/dist/cjs/lib/solana/transaction.js +1 -0
- package/dist/cjs/lib/solana/types.js +1 -0
- package/dist/cjs/lib/toDisplayFromAccountType.js +1 -0
- package/dist/cjs/lib/useHasTabbedAway.js +1 -0
- package/dist/cjs/lib/wallets/actions/getBalanceForChains.js +1 -0
- package/dist/cjs/lib/wallets/actions/getErc20Balance.js +1 -0
- package/dist/cjs/passkeys/transformOptionsToCamelCase.js +1 -0
- package/dist/cjs/passkeys/transformResponseToSnakeCase.js +1 -0
- package/dist/cjs/password.js +1 -0
- package/dist/cjs/paths.js +1 -0
- package/dist/cjs/payment-request/isPaymentRequestAvailable.js +1 -0
- package/dist/cjs/privy-components/shared/PillButton.js +1 -0
- package/dist/cjs/privy-components/shared/X.js +1 -0
- package/dist/cjs/privy-components/user-pill/Account.js +1 -0
- package/dist/cjs/privy-components/user-pill/AddFundsButton.js +1 -0
- package/dist/cjs/privy-components/user-pill/Avatar.js +1 -0
- package/dist/cjs/privy-components/user-pill/BackButton.js +1 -0
- package/dist/cjs/privy-components/user-pill/Menu.js +1 -0
- package/dist/cjs/privy-components/user-pill/MenuProvider.js +1 -0
- package/dist/cjs/privy-components/user-pill/Popover.js +1 -0
- package/dist/cjs/privy-components/user-pill/PrimaryAccount.js +1 -0
- package/dist/cjs/privy-components/user-pill/PrimaryWallet.js +1 -0
- package/dist/cjs/privy-components/user-pill/PrimaryWalletContainer.js +1 -0
- package/dist/cjs/privy-components/user-pill/UserMenu.js +1 -0
- package/dist/cjs/privy-components/user-pill/UserPill.js +2 -0
- package/dist/cjs/privy-components/user-pill/UserPill.test.js +1 -0
- package/dist/cjs/privy-components/user-pill/screens/AccountScreen.js +1 -0
- package/dist/cjs/privy-components/user-pill/screens/LinkedAccountsScreen.js +1 -0
- package/dist/cjs/privy-components/user-pill/screens/MenuScreen.js +1 -0
- package/dist/cjs/privy-components/user-pill/screens/WalletActionsScreen.js +1 -0
- package/dist/cjs/privy-components/wallets-pill/ActiveWalletCard.js +1 -0
- package/dist/cjs/privy-components/wallets-pill/AssetBalance.js +1 -0
- package/dist/cjs/privy-components/wallets-pill/ConnectWalletView.js +1 -0
- package/dist/cjs/privy-components/wallets-pill/NetworkPicker.js +1 -0
- package/dist/cjs/privy-components/wallets-pill/SelectActiveWalletView.js +1 -0
- package/dist/cjs/privy-components/wallets-pill/WalletCardView.js +1 -0
- package/dist/cjs/privy-components/wallets-pill/WalletsDialog.js +1 -0
- package/dist/cjs/privy-components/wallets-pill/data/wcRegistryPatch.js +1 -0
- package/dist/cjs/privy-components/wallets-pill/icons/EVM.js +1 -0
- package/dist/cjs/privy-components/wallets-pill/icons/Solana.js +1 -0
- package/dist/cjs/privy-components/wallets-pill/state.js +1 -0
- package/dist/cjs/privy-components/wallets-pill/styles.js +1 -0
- package/dist/cjs/privy-components/wallets-pill/useActiveWallet.js +1 -0
- package/dist/cjs/privy-provider-DLQmz_VR.js +2 -0
- package/dist/cjs/recent-login/context.js +1 -0
- package/dist/cjs/screens/AccountNotFoundScreen.js +1 -0
- package/dist/cjs/screens/AccountTransferScreen/AccountTransferButton.js +1 -0
- package/dist/cjs/screens/AccountTransferScreen/EmbeddedWalletInfoView.js +1 -0
- package/dist/cjs/screens/AccountTransferScreen/LinkConflictScreen.js +1 -0
- package/dist/cjs/screens/AccountTransferScreen/styled.js +1 -0
- package/dist/cjs/screens/AffirmativeConsentScreen.js +1 -0
- package/dist/cjs/screens/AllowlistRejectionScreen.js +2 -0
- package/dist/cjs/screens/AwaitingPasswordlessCodeScreen.js +2 -0
- package/dist/cjs/screens/CaptchaScreen.js +1 -0
- package/dist/cjs/screens/ConnectOnlyAuthenticatedScreen.js +1 -0
- package/dist/cjs/screens/ConnectOnlyLandingScreen.js +1 -0
- package/dist/cjs/screens/ConnectOnlyStatusScreen.js +1 -0
- package/dist/cjs/screens/ConnectionStatusScreen.js +2 -0
- package/dist/cjs/screens/CrossAppAuthScreen.js +1 -0
- package/dist/cjs/screens/DelegatedActionsConsentScreen.js +1 -0
- package/dist/cjs/screens/DelegatedActionsRevokeScreen.js +1 -0
- package/dist/cjs/screens/EmbeddedWalletConnectingScreen.js +1 -0
- package/dist/cjs/screens/EmbeddedWalletCreatedScreen.js +1 -0
- package/dist/cjs/screens/EmbeddedWalletKeyExportScreen.js +2 -0
- package/dist/cjs/screens/EmbeddedWalletOnAccountCreateScreen.js +1 -0
- package/dist/cjs/screens/EmbeddedWalletPasswordUpdateScreen.js +1 -0
- package/dist/cjs/screens/EmbeddedWalletPasswordUpdateSplashScreen.js +1 -0
- package/dist/cjs/screens/ErrorScreen.js +1 -0
- package/dist/cjs/screens/FarcasterConnectStatusScreen.js +2 -0
- package/dist/cjs/screens/FarcasterSignerStatusScreen.js +2 -0
- package/dist/cjs/screens/Funding/AwaitingEvmToSolBridgingScreen.js +2 -0
- package/dist/cjs/screens/Funding/AwaitingExternalSolanaTransferScreen.js +2 -0
- package/dist/cjs/screens/Funding/AwaitingExternalTransferScreen.js +2 -0
- package/dist/cjs/screens/Funding/AwaitingSolToEvmBridgingScreen.js +2 -0
- package/dist/cjs/screens/Funding/BridgeNetworkSelectionView.js +1 -0
- package/dist/cjs/screens/Funding/CoinbaseOnrampStatusScreen.js +1 -0
- package/dist/cjs/screens/Funding/FundingEditAmountScreen.js +1 -0
- package/dist/cjs/screens/Funding/FundingMethodSelectionScreen.js +1 -0
- package/dist/cjs/screens/Funding/ManualTransferScreen.js +1 -0
- package/dist/cjs/screens/Funding/MoonpayStatusScreen.js +1 -0
- package/dist/cjs/screens/Funding/TransferFromWalletScreen.js +1 -0
- package/dist/cjs/screens/Funding/TransferOrBridgeLoadingScreen.js +1 -0
- package/dist/cjs/screens/Funding/styles.js +1 -0
- package/dist/cjs/screens/InAppBrowserLoginNotPossible.js +1 -0
- package/dist/cjs/screens/InstallPhantomScreen.js +1 -0
- package/dist/cjs/screens/LandingScreen/AppLogoHeader.js +1 -0
- package/dist/cjs/screens/LandingScreen/ConnectOrCreateScreen.js +1 -0
- package/dist/cjs/screens/LandingScreen/CrossAppButton.js +1 -0
- package/dist/cjs/screens/LandingScreen/CustomLandingScreenView.js +1 -0
- package/dist/cjs/screens/LandingScreen/EmailButton.js +1 -0
- package/dist/cjs/screens/LandingScreen/FarcasterButton.js +1 -0
- package/dist/cjs/screens/LandingScreen/LandingScreen.js +1 -0
- package/dist/cjs/screens/LandingScreen/LandingScreenView.js +1 -0
- package/dist/cjs/screens/LandingScreen/PasskeyLink.js +1 -0
- package/dist/cjs/screens/LandingScreen/SmsButton.js +1 -0
- package/dist/cjs/screens/LandingScreen/SocialButton.js +1 -0
- package/dist/cjs/screens/LandingScreen/TelegramButton.js +1 -0
- package/dist/cjs/screens/LandingScreen/WalletButton.js +1 -0
- package/dist/cjs/screens/LandingScreen/WalletButtonList.js +1 -0
- package/dist/cjs/screens/LandingScreen/WalletOverflowButton.js +1 -0
- package/dist/cjs/screens/LandingScreen/Web2OverflowButton.js +1 -0
- package/dist/cjs/screens/LandingScreen/styles.js +1 -0
- package/dist/cjs/screens/LinkEmailScreen.js +1 -0
- package/dist/cjs/screens/LinkPasskeyScreen.js +1 -0
- package/dist/cjs/screens/LinkPhoneScreen.js +1 -0
- package/dist/cjs/screens/LinkWalletScreen.js +1 -0
- package/dist/cjs/screens/LoginFailedScreen.js +1 -0
- package/dist/cjs/screens/MfaScreens/EnrollLandingScreen.js +1 -0
- package/dist/cjs/screens/MfaScreens/EnrollPasskey.js +1 -0
- package/dist/cjs/screens/MfaScreens/EnrollSms.js +1 -0
- package/dist/cjs/screens/MfaScreens/EnrollTotp.js +1 -0
- package/dist/cjs/screens/MfaScreens/MfaEnrollmentFlowScreen.js +1 -0
- package/dist/cjs/screens/MfaScreens/MfaVerifyFlowScreen.js +1 -0
- package/dist/cjs/screens/MfaScreens/StyledComponents.js +1 -0
- package/dist/cjs/screens/MfaScreens/VerifyWithPasskey.js +1 -0
- package/dist/cjs/screens/OAuthStatusScreen.js +1 -0
- package/dist/cjs/screens/PasskeyStatusScreen.js +1 -0
- package/dist/cjs/screens/PhantomInterstitialScreen.js +1 -0
- package/dist/cjs/screens/Recovery/PasswordRecoveryScreen.js +1 -0
- package/dist/cjs/screens/Recovery/RecoveryOAuthStatusScreen.js +1 -0
- package/dist/cjs/screens/Recovery/RecoveryPasswordCreateScreen.js +1 -0
- package/dist/cjs/screens/Recovery/RecoverySelectionScreen.js +1 -0
- package/dist/cjs/screens/Recovery/SetAutomaticRecoveryScreen.js +1 -0
- package/dist/cjs/screens/Recovery/styles.js +1 -0
- package/dist/cjs/screens/SendSolanaTransactionScreen/SendSolanaTransactionScreen.js +1 -0
- package/dist/cjs/screens/SendSolanaTransactionScreen/SolanaTransactionReceiptView.js +1 -0
- package/dist/cjs/screens/SendTransactionScreen/EthersTransactionError.js +1 -0
- package/dist/cjs/screens/SendTransactionScreen/SendTransactionScreen.js +1 -0
- package/dist/cjs/screens/SendTransactionScreen/SendTransactionScreenView.js +1 -0
- package/dist/cjs/screens/SendTransactionScreen/TransactionDetail.js +1 -0
- package/dist/cjs/screens/SendTransactionScreen/TransactionErrorView.js +1 -0
- package/dist/cjs/screens/SendTransactionScreen/TransactionReceiptView.js +1 -0
- package/dist/cjs/screens/SendTransactionScreen/getStaticTransactionMetadata.js +1 -0
- package/dist/cjs/screens/SendTransactionScreen/index.js +1 -0
- package/dist/cjs/screens/SendTransactionScreen/usePrepareTransaction.js +1 -0
- package/dist/cjs/screens/SendTransactionScreen/useTransactionDetails.js +1 -0
- package/dist/cjs/screens/SignRequestScreen.js +1 -0
- package/dist/cjs/screens/TelegramAuthScreen.js +1 -0
- package/dist/cjs/screens/UpdateEmailScreen.js +1 -0
- package/dist/cjs/screens/UpdatePhoneScreen.js +1 -0
- package/dist/cjs/screens/UserLimitReachedScreen.js +1 -0
- package/dist/cjs/screens/index.js +1 -0
- package/dist/cjs/session.js +1 -0
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/storage.js +1 -0
- package/dist/cjs/styles.js +1 -0
- package/dist/cjs/svg/alert-circle.js +1 -0
- package/dist/cjs/svg/apple-icloud.js +1 -0
- package/dist/cjs/svg/apple.js +1 -0
- package/dist/cjs/svg/arrow-cycle.js +1 -0
- package/dist/cjs/svg/black-rounded-square.js +1 -0
- package/dist/cjs/svg/blobby.js +1 -0
- package/dist/cjs/svg/brave-browser-icon.js +1 -0
- package/dist/cjs/svg/browser-extension-wallet-icon.js +1 -0
- package/dist/cjs/svg/bybit.js +1 -0
- package/dist/cjs/svg/chains/base.js +1 -0
- package/dist/cjs/svg/check-badge.js +1 -0
- package/dist/cjs/svg/checkmark.js +1 -0
- package/dist/cjs/svg/coinbase-wallet.js +1 -0
- package/dist/cjs/svg/copy.js +1 -0
- package/dist/cjs/svg/cryptocom.js +1 -0
- package/dist/cjs/svg/discord.js +1 -0
- package/dist/cjs/svg/email-or-phone.js +1 -0
- package/dist/cjs/svg/error-circle.js +1 -0
- package/dist/cjs/svg/face-id.js +1 -0
- package/dist/cjs/svg/farcaster.js +1 -0
- package/dist/cjs/svg/fingerprint.js +1 -0
- package/dist/cjs/svg/github.js +1 -0
- package/dist/cjs/svg/globe.js +1 -0
- package/dist/cjs/svg/google-drive.js +1 -0
- package/dist/cjs/svg/google.js +1 -0
- package/dist/cjs/svg/index.d.js +1 -0
- package/dist/cjs/svg/instagram.js +1 -0
- package/dist/cjs/svg/linkedin.js +1 -0
- package/dist/cjs/svg/lock-closed.js +1 -0
- package/dist/cjs/svg/metamask.js +1 -0
- package/dist/cjs/svg/mfa-shield.js +1 -0
- package/dist/cjs/svg/moonpay.js +1 -0
- package/dist/cjs/svg/phantom.js +1 -0
- package/dist/cjs/svg/protected-by-privy.js +1 -0
- package/dist/cjs/svg/qr-codes.js +1 -0
- package/dist/cjs/svg/rabby.js +1 -0
- package/dist/cjs/svg/rainbow.js +1 -0
- package/dist/cjs/svg/safe.js +1 -0
- package/dist/cjs/svg/spotify.js +1 -0
- package/dist/cjs/svg/telegram.js +1 -0
- package/dist/cjs/svg/tiktok.js +1 -0
- package/dist/cjs/svg/twitter.js +1 -0
- package/dist/cjs/svg/uniswap.js +1 -0
- package/dist/cjs/svg/universal-profile.js +1 -0
- package/dist/cjs/svg/wallet-connect.js +1 -0
- package/dist/cjs/svg/zerion.js +1 -0
- package/dist/cjs/theme.js +1 -0
- package/dist/cjs/token.js +1 -0
- package/dist/cjs/types.js +1 -0
- package/dist/cjs/ui.js +1 -447
- package/dist/cjs/utils/buffer/readBigInt64LE.js +1 -0
- package/dist/cjs/utils/index.js +1 -0
- package/dist/esm/PhoneCountryDropdown-BXDwBRL5.mjs +1 -0
- package/dist/esm/WithPrivyStyles-CGZZDLBI.mjs +1 -0
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/accessToken.mjs +1 -0
- package/dist/esm/actions/importWallet.mjs +1 -0
- package/dist/esm/auth-flows/authFlowToAuthenticateMethod.mjs +1 -0
- package/dist/esm/auth-flows/cross-app.mjs +1 -0
- package/dist/esm/auth-flows/custom-jwt-account.mjs +1 -0
- package/dist/esm/auth-flows/email.mjs +1 -0
- package/dist/esm/auth-flows/farcaster.mjs +1 -0
- package/dist/esm/auth-flows/getUiHeader.mjs +1 -0
- package/dist/esm/auth-flows/guest.mjs +1 -0
- package/dist/esm/auth-flows/oauth/OAuthFlow.mjs +1 -0
- package/dist/esm/auth-flows/oauth/detectCompletingOAuthFlow.mjs +1 -0
- package/dist/esm/auth-flows/oauth/getDisplayForProvider.mjs +1 -0
- package/dist/esm/auth-flows/oauth/getIsHeadlessOAuthFlowInProgress.mjs +1 -0
- package/dist/esm/auth-flows/oauth/getOAuthErrorMessage.mjs +1 -0
- package/dist/esm/auth-flows/oauth/index.mjs +1 -0
- package/dist/esm/auth-flows/oauth/stripUrlOAuthParamsAndRemoveStateCode.mjs +1 -0
- package/dist/esm/auth-flows/passkey.mjs +1 -0
- package/dist/esm/auth-flows/siwe.mjs +1 -0
- package/dist/esm/auth-flows/siws.mjs +1 -0
- package/dist/esm/auth-flows/sms.mjs +1 -0
- package/dist/esm/auth-flows/telegram.mjs +1 -0
- package/dist/esm/auth-flows/types.mjs +1 -0
- package/dist/esm/client/user.mjs +1 -0
- package/dist/esm/client.mjs +1 -0
- package/dist/esm/components/AppLogo.mjs +1 -0
- package/dist/esm/components/BaseModal.mjs +1 -0
- package/dist/esm/components/Button.mjs +2 -0
- package/dist/esm/components/Captcha.mjs +1 -0
- package/dist/esm/components/Checkbox.mjs +1 -0
- package/dist/esm/components/CircleBackground.mjs +1 -0
- package/dist/esm/components/CircleBorder.mjs +1 -0
- package/dist/esm/components/ConnectEmailForm.mjs +1 -0
- package/dist/esm/components/ConnectPhoneForm.mjs +1 -0
- package/dist/esm/components/CopyToClipboard.mjs +1 -0
- package/dist/esm/components/CopyableText.mjs +1 -0
- package/dist/esm/components/Dialog.mjs +1 -0
- package/dist/esm/components/FiatOnrampPrompt.mjs +1 -0
- package/dist/esm/components/Layouts.mjs +1 -0
- package/dist/esm/components/Loader.mjs +1 -0
- package/dist/esm/components/LoginMethodIcon.mjs +1 -0
- package/dist/esm/components/LoginModal.mjs +1 -0
- package/dist/esm/components/ModalFooter.mjs +2 -0
- package/dist/esm/components/ModalHeader.mjs +1 -0
- package/dist/esm/components/OpenLink.mjs +1 -0
- package/dist/esm/components/PhoneCountryDropdown.mjs +1 -0
- package/dist/esm/components/PinInput.mjs +1 -0
- package/dist/esm/components/PrefetchedImage.mjs +1 -0
- package/dist/esm/components/ProviderAppLogo.mjs +2 -0
- package/dist/esm/components/QrCode.mjs +2 -0
- package/dist/esm/components/ScreenHeader.mjs +2 -0
- package/dist/esm/components/ScreenHelpers.mjs +1 -0
- package/dist/esm/components/TelegramLoginButton.mjs +1 -0
- package/dist/esm/components/TodoList.mjs +1 -0
- package/dist/esm/components/UpdateEmailForm.mjs +1 -0
- package/dist/esm/components/WrappedLoader.mjs +3 -0
- package/dist/esm/components/embedded-wallets/Details.mjs +1 -0
- package/dist/esm/components/embedded-wallets/DisplayInfoItem.mjs +1 -0
- package/dist/esm/components/embedded-wallets/FundWalletMethodHeader.mjs +1 -0
- package/dist/esm/components/embedded-wallets/PriceDisplay.mjs +3 -0
- package/dist/esm/components/embedded-wallets/SetWalletPasswordForm/ConfimWalletPasswordForm.mjs +2 -0
- package/dist/esm/components/embedded-wallets/SetWalletPasswordForm/ConfimWalletPasswordSaved.mjs +1 -0
- package/dist/esm/components/embedded-wallets/SetWalletPasswordForm/CreateWalletPassword.mjs +1 -0
- package/dist/esm/components/embedded-wallets/SetWalletPasswordForm/SaveWalletPassword.mjs +1 -0
- package/dist/esm/components/embedded-wallets/SetWalletPasswordForm/SetWalletPasswordComplete.mjs +1 -0
- package/dist/esm/components/embedded-wallets/SetWalletPasswordForm/SetWalletPasswordForm.mjs +1 -0
- package/dist/esm/components/embedded-wallets/SetWalletPasswordForm/index.mjs +1 -0
- package/dist/esm/components/embedded-wallets/SetWalletPasswordForm/setWalletPassword.hooks.mjs +1 -0
- package/dist/esm/components/embedded-wallets/SetWalletPasswordForm/shared.mjs +1 -0
- package/dist/esm/components/embedded-wallets/SolanaTransactionDetails.mjs +1 -0
- package/dist/esm/components/embedded-wallets/StyledLogo.mjs +1 -0
- package/dist/esm/components/embedded-wallets/TransactionDetails.mjs +2 -0
- package/dist/esm/components/embedded-wallets/TransactionDetailsWrapper.mjs +1 -0
- package/dist/esm/components/embedded-wallets/TransactionTotal.mjs +1 -0
- package/dist/esm/components/embedded-wallets/WalletLink.mjs +1 -0
- package/dist/esm/components/embedded-wallets/index.mjs +1 -0
- package/dist/esm/components/external-wallets/InjectedWalletIcon.mjs +1 -0
- package/dist/esm/components/layout/StackedContainer.mjs +1 -0
- package/dist/esm/components/primitives/Accordion/AccordionContext.mjs +1 -0
- package/dist/esm/components/primitives/Accordion/index.mjs +2 -0
- package/dist/esm/components/primitives/LoadingSpinner/index.mjs +1 -0
- package/dist/esm/components/primitives/NeutralSpinner/index.mjs +1 -0
- package/dist/esm/components/ui/animation/LoadingSkeleton.mjs +1 -0
- package/dist/esm/components/ui/banners/ErrorBanner.mjs +1 -0
- package/dist/esm/components/ui/banners/InfoBanner.mjs +1 -0
- package/dist/esm/components/ui/banners/WarningBanner.mjs +1 -0
- package/dist/esm/components/ui/chips/Chip.mjs +1 -0
- package/dist/esm/components/ui/forms/EmailInputForm.mjs +1 -0
- package/dist/esm/components/ui/icons/ApplePay.mjs +1 -0
- package/dist/esm/components/ui/icons/Arbitum.mjs +1 -0
- package/dist/esm/components/ui/icons/Avalanche.mjs +1 -0
- package/dist/esm/components/ui/icons/Base.mjs +1 -0
- package/dist/esm/components/ui/icons/Celo.mjs +1 -0
- package/dist/esm/components/ui/icons/GooglePay.mjs +1 -0
- package/dist/esm/components/ui/icons/Linea.mjs +1 -0
- package/dist/esm/components/ui/icons/Mainnnet.mjs +1 -0
- package/dist/esm/components/ui/icons/Optimism.mjs +1 -0
- package/dist/esm/components/ui/icons/Polygon.mjs +1 -0
- package/dist/esm/components/ui/icons/Solana.mjs +1 -0
- package/dist/esm/components/ui/icons/WithCircleBorder.mjs +1 -0
- package/dist/esm/components/ui/icons/Zora.mjs +1 -0
- package/dist/esm/components/ui/layout/Column.mjs +1 -0
- package/dist/esm/components/ui/layout/Row.mjs +1 -0
- package/dist/esm/components/ui/typography/ErrorMessage.mjs +1 -0
- package/dist/esm/components/ui/typography/LabelSm.mjs +1 -0
- package/dist/esm/components/ui/typography/LabelXs.mjs +1 -0
- package/dist/esm/components/ui/typography/Subtitle.mjs +1 -0
- package/dist/esm/components/ui/typography/Title.mjs +1 -0
- package/dist/esm/components/ui/typography/Value.mjs +1 -0
- package/dist/esm/components/ui/wallet/Address.mjs +1 -0
- package/dist/esm/components/ui/wallet/NetworkBalanceCard.mjs +1 -0
- package/dist/esm/components/ui/wallet/NetworkBalanceCard.story.mjs +1 -0
- package/dist/esm/components/ui/wallet/NetworkIcon.mjs +1 -0
- package/dist/esm/components/ui/wallet/NetworkSelectorPanel.mjs +1 -0
- package/dist/esm/components/ui/wallet/NetworkSelectorPanel.story.mjs +1 -0
- package/dist/esm/components/ui/wallet/WalletInfoCard.mjs +1 -0
- package/dist/esm/components/ui/wallet/WalletInfoCard.story.mjs +1 -0
- package/dist/esm/components/ui/wallet/shared.mjs +1 -0
- package/dist/esm/config.mjs +1 -0
- package/dist/esm/configuration/context.mjs +1 -0
- package/dist/esm/configuration/defaultClientConfig.mjs +1 -0
- package/dist/esm/configuration/login-methods.mjs +1 -0
- package/dist/esm/configuration/wallets.mjs +1 -0
- package/dist/esm/connectors/NullConnector.mjs +1 -0
- package/dist/esm/connectors/areWalletArraysEqual.mjs +1 -0
- package/dist/esm/connectors/base.mjs +1 -0
- package/dist/esm/connectors/chains/arbitrum.mjs +1 -0
- package/dist/esm/connectors/chains/arbitrumGoerli.mjs +1 -0
- package/dist/esm/connectors/chains/arbitrumSepolia.mjs +1 -0
- package/dist/esm/connectors/chains/avalanche.mjs +1 -0
- package/dist/esm/connectors/chains/avalancheFuji.mjs +1 -0
- package/dist/esm/connectors/chains/base.mjs +1 -0
- package/dist/esm/connectors/chains/baseGoerli.mjs +1 -0
- package/dist/esm/connectors/chains/baseSepolia.mjs +1 -0
- package/dist/esm/connectors/chains/berachainArtio.mjs +1 -0
- package/dist/esm/connectors/chains/celo.mjs +1 -0
- package/dist/esm/connectors/chains/celoAlfajores.mjs +1 -0
- package/dist/esm/connectors/chains/filecoin.mjs +1 -0
- package/dist/esm/connectors/chains/filecoinCalibration.mjs +1 -0
- package/dist/esm/connectors/chains/garnetHolesky.mjs +1 -0
- package/dist/esm/connectors/chains/goerli.mjs +1 -0
- package/dist/esm/connectors/chains/holesky.mjs +1 -0
- package/dist/esm/connectors/chains/index.mjs +1 -0
- package/dist/esm/connectors/chains/linea.mjs +1 -0
- package/dist/esm/connectors/chains/lineaTestnet.mjs +1 -0
- package/dist/esm/connectors/chains/lukso.mjs +1 -0
- package/dist/esm/connectors/chains/mainnet.mjs +1 -0
- package/dist/esm/connectors/chains/optimism.mjs +1 -0
- package/dist/esm/connectors/chains/optimismGoerli.mjs +1 -0
- package/dist/esm/connectors/chains/optimismSepolia.mjs +1 -0
- package/dist/esm/connectors/chains/polygon.mjs +1 -0
- package/dist/esm/connectors/chains/polygonAmoy.mjs +1 -0
- package/dist/esm/connectors/chains/polygonMumbai.mjs +1 -0
- package/dist/esm/connectors/chains/redstone.mjs +1 -0
- package/dist/esm/connectors/chains/redstoneHolesky.mjs +1 -0
- package/dist/esm/connectors/chains/sepolia.mjs +1 -0
- package/dist/esm/connectors/chains/types.mjs +1 -0
- package/dist/esm/connectors/chains/utils.mjs +1 -0
- package/dist/esm/connectors/chains/zora.mjs +1 -0
- package/dist/esm/connectors/chains/zoraSepolia.mjs +1 -0
- package/dist/esm/connectors/chains/zoraTestnet.mjs +1 -0
- package/dist/esm/connectors/coinbase.mjs +1 -0
- package/dist/esm/connectors/embedded.mjs +1 -0
- package/dist/esm/connectors/embeddedProvider.mjs +1 -0
- package/dist/esm/connectors/errors.mjs +1 -0
- package/dist/esm/connectors/ethereum/index.mjs +1 -0
- package/dist/esm/connectors/get-legacy-injected-providers.mjs +1 -0
- package/dist/esm/connectors/getRpcTimeout.mjs +1 -0
- package/dist/esm/connectors/index.mjs +1 -0
- package/dist/esm/connectors/injected.mjs +1 -0
- package/dist/esm/connectors/is-wallet-installed.mjs +1 -0
- package/dist/esm/connectors/isBaseConnectedEthereumWallet.mjs +1 -0
- package/dist/esm/connectors/metamask.mjs +1 -0
- package/dist/esm/connectors/phantom-redirect.mjs +1 -0
- package/dist/esm/connectors/phantom.mjs +1 -0
- package/dist/esm/connectors/privyProxyProvider.mjs +1 -0
- package/dist/esm/connectors/providerTypes.mjs +1 -0
- package/dist/esm/connectors/solana/index.mjs +1 -0
- package/dist/esm/connectors/solana/toSolanaWalletConnectors.mjs +1 -0
- package/dist/esm/connectors/userAlreadyHasConnectedCoinbaseWallet.mjs +1 -0
- package/dist/esm/connectors/walletconnect-client.mjs +1 -0
- package/dist/esm/connectors/walletconnect-registry.mjs +1 -0
- package/dist/esm/connectors/walletconnect-v2.mjs +1 -0
- package/dist/esm/constants.mjs +1 -0
- package/dist/esm/cookies.mjs +1 -0
- package/dist/esm/crypto.mjs +1 -0
- package/dist/esm/crypto.test.mjs +1 -0
- package/dist/esm/cssNormalize.mjs +1 -0
- package/dist/esm/effect.mjs +1 -0
- package/dist/esm/embedded-wallets/EmbeddedWalletIframe.mjs +2 -0
- package/dist/esm/embedded-wallets/delegated-actions.mjs +1 -0
- package/dist/esm/embedded-wallets/errors.mjs +1 -0
- package/dist/esm/embedded-wallets/eventCallbacksQueue.mjs +1 -0
- package/dist/esm/embedded-wallets/invokeWithMfa.mjs +1 -0
- package/dist/esm/embedded-wallets/rpc/index.mjs +1 -0
- package/dist/esm/embedded-wallets/rpc/types.mjs +1 -0
- package/dist/esm/embedded-wallets/solana/provider.mjs +1 -0
- package/dist/esm/embedded-wallets/solana/transaction.mjs +1 -0
- package/dist/esm/embedded-wallets/transactions.mjs +1 -0
- package/dist/esm/embedded-wallets/types.mjs +1 -0
- package/dist/esm/errors-9ucGZPEs.mjs +1 -0
- package/dist/esm/errors.mjs +1 -0
- package/dist/esm/ethers-Cz-frLvN.mjs +1 -0
- package/dist/esm/hook-utils/useAsyncValue.mjs +1 -0
- package/dist/esm/hook-utils/useInterval.mjs +1 -0
- package/dist/esm/hooks/captcha-context.mjs +1 -0
- package/dist/esm/hooks/events-context.mjs +1 -0
- package/dist/esm/hooks/index.mjs +1 -0
- package/dist/esm/hooks/internal-context.mjs +1 -0
- package/dist/esm/hooks/modal-context.mjs +1 -0
- package/dist/esm/hooks/privy-context.mjs +1 -0
- package/dist/esm/hooks/privy-provider.mjs +1 -0
- package/dist/esm/hooks/smart-wallets-provider.mjs +1 -0
- package/dist/esm/hooks/useConnectCoinbaseSmartWallet.mjs +1 -0
- package/dist/esm/hooks/useConnectWallet.mjs +1 -0
- package/dist/esm/hooks/useCreateWallet.mjs +1 -0
- package/dist/esm/hooks/useCrossAppAccounts.mjs +1 -0
- package/dist/esm/hooks/useCustomAuth.mjs +1 -0
- package/dist/esm/hooks/useDelegatedActions.mjs +1 -0
- package/dist/esm/hooks/useElementHeight.mjs +1 -0
- package/dist/esm/hooks/useEmbeddedWalletCreate.mjs +1 -0
- package/dist/esm/hooks/useFarcasterSigner.mjs +1 -0
- package/dist/esm/hooks/useFormattedBalances.mjs +1 -0
- package/dist/esm/hooks/useFundSolanaWallet.mjs +1 -0
- package/dist/esm/hooks/useFundWallet.mjs +1 -0
- package/dist/esm/hooks/useGetSolPrice.mjs +1 -0
- package/dist/esm/hooks/useGetTokenPrice.mjs +1 -0
- package/dist/esm/hooks/useGuestAccounts.mjs +1 -0
- package/dist/esm/hooks/useImportWallet.mjs +1 -0
- package/dist/esm/hooks/useLinkAccount.mjs +1 -0
- package/dist/esm/hooks/useLinkWithPasskey.mjs +1 -0
- package/dist/esm/hooks/useLinkWithSiwe.mjs +1 -0
- package/dist/esm/hooks/useLogin.mjs +1 -0
- package/dist/esm/hooks/useLoginWithEmail.mjs +1 -0
- package/dist/esm/hooks/useLoginWithOAuth.mjs +1 -0
- package/dist/esm/hooks/useLoginWithPasskey.mjs +1 -0
- package/dist/esm/hooks/useLoginWithSms.mjs +1 -0
- package/dist/esm/hooks/useLogout.mjs +1 -0
- package/dist/esm/hooks/useMfa.mjs +1 -0
- package/dist/esm/hooks/useMfaEnrollment.mjs +1 -0
- package/dist/esm/hooks/useModalStatus.mjs +1 -0
- package/dist/esm/hooks/useOAuthTokens.mjs +1 -0
- package/dist/esm/hooks/usePrivy.mjs +1 -0
- package/dist/esm/hooks/useRegisterMfaListener.mjs +1 -0
- package/dist/esm/hooks/useSendSolanaTransaction.mjs +1 -0
- package/dist/esm/hooks/useSendTransaction.mjs +1 -0
- package/dist/esm/hooks/useSetWalletPassword.mjs +1 -0
- package/dist/esm/hooks/useSetWalletRecovery.mjs +1 -0
- package/dist/esm/hooks/useSignMessage.mjs +1 -0
- package/dist/esm/hooks/useSignTypedData.mjs +1 -0
- package/dist/esm/hooks/useSmartWalletChain.mjs +1 -0
- package/dist/esm/hooks/useSolanaWallets.mjs +1 -0
- package/dist/esm/hooks/useToken.mjs +1 -0
- package/dist/esm/hooks/useUpdateAccount.mjs +1 -0
- package/dist/esm/hooks/useWalletBalance.mjs +1 -0
- package/dist/esm/hooks/useWallets.mjs +1 -0
- package/dist/esm/http.mjs +1 -0
- package/dist/esm/icons/Apple.mjs +1 -0
- package/dist/esm/icons/ArrowLeft.mjs +1 -0
- package/dist/esm/icons/Avatar.mjs +1 -0
- package/dist/esm/icons/Bot.mjs +1 -0
- package/dist/esm/icons/Check.mjs +1 -0
- package/dist/esm/icons/Copy.mjs +1 -0
- package/dist/esm/icons/DomainsIcon.mjs +1 -0
- package/dist/esm/icons/EmptyCheckedCircle.mjs +1 -0
- package/dist/esm/icons/KeyRound.mjs +1 -0
- package/dist/esm/icons/Login.mjs +1 -0
- package/dist/esm/icons/Logout.mjs +1 -0
- package/dist/esm/icons/Mail.mjs +1 -0
- package/dist/esm/icons/Phone.mjs +1 -0
- package/dist/esm/icons/Portal.mjs +1 -0
- package/dist/esm/icons/Settings.mjs +1 -0
- package/dist/esm/icons/Slack.mjs +1 -0
- package/dist/esm/icons/Socials.mjs +1 -0
- package/dist/esm/icons/TicketCheck.mjs +1 -0
- package/dist/esm/icons/WalletCards.mjs +1 -0
- package/dist/esm/icons/Wallets.mjs +1 -0
- package/dist/esm/icons/X.mjs +1 -0
- package/dist/esm/index-B3QfI7v9.mjs +1 -0
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/lib/abstract-smart-wallets.mjs +1 -0
- package/dist/esm/lib/caip2.mjs +1 -0
- package/dist/esm/lib/capitalizeFirstLetter.mjs +1 -0
- package/dist/esm/lib/cross-app/authFlow.mjs +1 -0
- package/dist/esm/lib/cross-app/index.mjs +1 -0
- package/dist/esm/lib/cross-app/popupCrossAppAuthFlow.mjs +1 -0
- package/dist/esm/lib/cross-app/sendCrossAppRequest.mjs +1 -0
- package/dist/esm/lib/cross-app/types.mjs +1 -0
- package/dist/esm/lib/cybr53.mjs +1 -0
- package/dist/esm/lib/deployAccount/actions/abis/deployAccount.mjs +1 -0
- package/dist/esm/lib/embeddedWalletRecovery.mjs +1 -0
- package/dist/esm/lib/erc1155/actions/abis/safeBatchTransferFrom.mjs +1 -0
- package/dist/esm/lib/erc1155/actions/abis/safeTransferFrom.mjs +1 -0
- package/dist/esm/lib/erc20/actions/abis/approve.mjs +1 -0
- package/dist/esm/lib/erc20/actions/abis/transfer.mjs +1 -0
- package/dist/esm/lib/erc20/actions/getErc20TokenInfo.mjs +1 -0
- package/dist/esm/lib/erc20/formatErc20TokenAmount.mjs +1 -0
- package/dist/esm/lib/erc721/actions/abis/mint.mjs +1 -0
- package/dist/esm/lib/erc721/actions/abis/safeTransferFrom.mjs +1 -0
- package/dist/esm/lib/erc721/actions/abis/setApprovalForAll.mjs +1 -0
- package/dist/esm/lib/erc721/actions/abis/transferFrom.mjs +1 -0
- package/dist/esm/lib/ethers.mjs +1 -0
- package/dist/esm/lib/external-wallets/displayHelpers.mjs +1 -0
- package/dist/esm/lib/funding/analytics.mjs +1 -0
- package/dist/esm/lib/funding/coinbase/isSupportedChainIdForCoinbaseOnramp.mjs +1 -0
- package/dist/esm/lib/funding/coinbase/toCoinbaseBlockchainFromChainId.mjs +1 -0
- package/dist/esm/lib/funding/coinbase/triggerCoinbaseFlow.mjs +1 -0
- package/dist/esm/lib/funding/coinbase/types.mjs +1 -0
- package/dist/esm/lib/funding/externalTransfer.mjs +1 -0
- package/dist/esm/lib/funding/filterSupportedOptions.mjs +1 -0
- package/dist/esm/lib/funding/index.mjs +1 -0
- package/dist/esm/lib/funding/isFundingEnabled.mjs +1 -0
- package/dist/esm/lib/funding/moonpay/index.mjs +1 -0
- package/dist/esm/lib/funding/moonpay/triggerMoonpayFlow.mjs +1 -0
- package/dist/esm/lib/funding/moonpay/types.mjs +1 -0
- package/dist/esm/lib/funding/prepareFundingMethods.mjs +1 -0
- package/dist/esm/lib/funding/prepareFundingModalData.mjs +1 -0
- package/dist/esm/lib/funding/reservoir.mjs +1 -0
- package/dist/esm/lib/funding/usdc.mjs +1 -0
- package/dist/esm/lib/getEmbeddedConnectedWallet.mjs +1 -0
- package/dist/esm/lib/isEmbeddedWebview.mjs +1 -0
- package/dist/esm/lib/pkce.mjs +1 -0
- package/dist/esm/lib/polygonGasStation.mjs +1 -0
- package/dist/esm/lib/popup/triggerPopup.mjs +1 -0
- package/dist/esm/lib/popupOAuthFlow.mjs +1 -0
- package/dist/esm/lib/siwe.mjs +1 -0
- package/dist/esm/lib/siws.mjs +1 -0
- package/dist/esm/lib/smart-wallet-helpers.mjs +1 -0
- package/dist/esm/lib/smart-wallets-shared.mjs +1 -0
- package/dist/esm/lib/smart-wallets.mjs +1 -0
- package/dist/esm/lib/solana/index.mjs +1 -0
- package/dist/esm/lib/solana/transaction.mjs +1 -0
- package/dist/esm/lib/solana/types.mjs +1 -0
- package/dist/esm/lib/toDisplayFromAccountType.mjs +1 -0
- package/dist/esm/lib/useHasTabbedAway.mjs +1 -0
- package/dist/esm/lib/wallets/actions/getBalanceForChains.mjs +1 -0
- package/dist/esm/lib/wallets/actions/getErc20Balance.mjs +1 -0
- package/dist/esm/passkeys/transformOptionsToCamelCase.mjs +1 -0
- package/dist/esm/passkeys/transformResponseToSnakeCase.mjs +1 -0
- package/dist/esm/password.mjs +1 -0
- package/dist/esm/paths.mjs +1 -0
- package/dist/esm/payment-request/isPaymentRequestAvailable.mjs +1 -0
- package/dist/esm/privy-components/shared/PillButton.mjs +1 -0
- package/dist/esm/privy-components/shared/X.mjs +1 -0
- package/dist/esm/privy-components/user-pill/Account.mjs +1 -0
- package/dist/esm/privy-components/user-pill/AddFundsButton.mjs +1 -0
- package/dist/esm/privy-components/user-pill/Avatar.mjs +1 -0
- package/dist/esm/privy-components/user-pill/BackButton.mjs +1 -0
- package/dist/esm/privy-components/user-pill/Menu.mjs +1 -0
- package/dist/esm/privy-components/user-pill/MenuProvider.mjs +1 -0
- package/dist/esm/privy-components/user-pill/Popover.mjs +1 -0
- package/dist/esm/privy-components/user-pill/PrimaryAccount.mjs +1 -0
- package/dist/esm/privy-components/user-pill/PrimaryWallet.mjs +1 -0
- package/dist/esm/privy-components/user-pill/PrimaryWalletContainer.mjs +1 -0
- package/dist/esm/privy-components/user-pill/UserMenu.mjs +1 -0
- package/dist/esm/privy-components/user-pill/UserPill.mjs +2 -0
- package/dist/esm/privy-components/user-pill/UserPill.test.mjs +1 -0
- package/dist/esm/privy-components/user-pill/screens/AccountScreen.mjs +1 -0
- package/dist/esm/privy-components/user-pill/screens/LinkedAccountsScreen.mjs +1 -0
- package/dist/esm/privy-components/user-pill/screens/MenuScreen.mjs +1 -0
- package/dist/esm/privy-components/user-pill/screens/WalletActionsScreen.mjs +1 -0
- package/dist/esm/privy-components/wallets-pill/ActiveWalletCard.mjs +1 -0
- package/dist/esm/privy-components/wallets-pill/AssetBalance.mjs +1 -0
- package/dist/esm/privy-components/wallets-pill/ConnectWalletView.mjs +1 -0
- package/dist/esm/privy-components/wallets-pill/NetworkPicker.mjs +1 -0
- package/dist/esm/privy-components/wallets-pill/SelectActiveWalletView.mjs +1 -0
- package/dist/esm/privy-components/wallets-pill/WalletCardView.mjs +1 -0
- package/dist/esm/privy-components/wallets-pill/WalletsDialog.mjs +1 -0
- package/dist/esm/privy-components/wallets-pill/data/wcRegistryPatch.mjs +1 -0
- package/dist/esm/privy-components/wallets-pill/icons/EVM.mjs +1 -0
- package/dist/esm/privy-components/wallets-pill/icons/Solana.mjs +1 -0
- package/dist/esm/privy-components/wallets-pill/state.mjs +1 -0
- package/dist/esm/privy-components/wallets-pill/styles.mjs +1 -0
- package/dist/esm/privy-components/wallets-pill/useActiveWallet.mjs +1 -0
- package/dist/esm/privy-provider-DovwooOo.mjs +2 -0
- package/dist/esm/recent-login/context.mjs +1 -0
- package/dist/esm/screens/AccountNotFoundScreen.mjs +1 -0
- package/dist/esm/screens/AccountTransferScreen/AccountTransferButton.mjs +1 -0
- package/dist/esm/screens/AccountTransferScreen/EmbeddedWalletInfoView.mjs +1 -0
- package/dist/esm/screens/AccountTransferScreen/LinkConflictScreen.mjs +1 -0
- package/dist/esm/screens/AccountTransferScreen/styled.mjs +1 -0
- package/dist/esm/screens/AffirmativeConsentScreen.mjs +1 -0
- package/dist/esm/screens/AllowlistRejectionScreen.mjs +2 -0
- package/dist/esm/screens/AwaitingPasswordlessCodeScreen.mjs +2 -0
- package/dist/esm/screens/CaptchaScreen.mjs +1 -0
- package/dist/esm/screens/ConnectOnlyAuthenticatedScreen.mjs +1 -0
- package/dist/esm/screens/ConnectOnlyLandingScreen.mjs +1 -0
- package/dist/esm/screens/ConnectOnlyStatusScreen.mjs +1 -0
- package/dist/esm/screens/ConnectionStatusScreen.mjs +2 -0
- package/dist/esm/screens/CrossAppAuthScreen.mjs +1 -0
- package/dist/esm/screens/DelegatedActionsConsentScreen.mjs +1 -0
- package/dist/esm/screens/DelegatedActionsRevokeScreen.mjs +1 -0
- package/dist/esm/screens/EmbeddedWalletConnectingScreen.mjs +1 -0
- package/dist/esm/screens/EmbeddedWalletCreatedScreen.mjs +1 -0
- package/dist/esm/screens/EmbeddedWalletKeyExportScreen.mjs +2 -0
- package/dist/esm/screens/EmbeddedWalletOnAccountCreateScreen.mjs +1 -0
- package/dist/esm/screens/EmbeddedWalletPasswordUpdateScreen.mjs +1 -0
- package/dist/esm/screens/EmbeddedWalletPasswordUpdateSplashScreen.mjs +1 -0
- package/dist/esm/screens/ErrorScreen.mjs +1 -0
- package/dist/esm/screens/FarcasterConnectStatusScreen.mjs +2 -0
- package/dist/esm/screens/FarcasterSignerStatusScreen.mjs +2 -0
- package/dist/esm/screens/Funding/AwaitingEvmToSolBridgingScreen.mjs +2 -0
- package/dist/esm/screens/Funding/AwaitingExternalSolanaTransferScreen.mjs +2 -0
- package/dist/esm/screens/Funding/AwaitingExternalTransferScreen.mjs +2 -0
- package/dist/esm/screens/Funding/AwaitingSolToEvmBridgingScreen.mjs +2 -0
- package/dist/esm/screens/Funding/BridgeNetworkSelectionView.mjs +1 -0
- package/dist/esm/screens/Funding/CoinbaseOnrampStatusScreen.mjs +1 -0
- package/dist/esm/screens/Funding/FundingEditAmountScreen.mjs +1 -0
- package/dist/esm/screens/Funding/FundingMethodSelectionScreen.mjs +1 -0
- package/dist/esm/screens/Funding/ManualTransferScreen.mjs +1 -0
- package/dist/esm/screens/Funding/MoonpayStatusScreen.mjs +1 -0
- package/dist/esm/screens/Funding/TransferFromWalletScreen.mjs +1 -0
- package/dist/esm/screens/Funding/TransferOrBridgeLoadingScreen.mjs +1 -0
- package/dist/esm/screens/Funding/styles.mjs +1 -0
- package/dist/esm/screens/InAppBrowserLoginNotPossible.mjs +1 -0
- package/dist/esm/screens/InstallPhantomScreen.mjs +1 -0
- package/dist/esm/screens/LandingScreen/AppLogoHeader.mjs +1 -0
- package/dist/esm/screens/LandingScreen/ConnectOrCreateScreen.mjs +1 -0
- package/dist/esm/screens/LandingScreen/CrossAppButton.mjs +1 -0
- package/dist/esm/screens/LandingScreen/CustomLandingScreenView.mjs +1 -0
- package/dist/esm/screens/LandingScreen/EmailButton.mjs +1 -0
- package/dist/esm/screens/LandingScreen/FarcasterButton.mjs +1 -0
- package/dist/esm/screens/LandingScreen/LandingScreen.mjs +1 -0
- package/dist/esm/screens/LandingScreen/LandingScreenView.mjs +1 -0
- package/dist/esm/screens/LandingScreen/PasskeyLink.mjs +1 -0
- package/dist/esm/screens/LandingScreen/SmsButton.mjs +1 -0
- package/dist/esm/screens/LandingScreen/SocialButton.mjs +1 -0
- package/dist/esm/screens/LandingScreen/TelegramButton.mjs +1 -0
- package/dist/esm/screens/LandingScreen/WalletButton.mjs +1 -0
- package/dist/esm/screens/LandingScreen/WalletButtonList.mjs +1 -0
- package/dist/esm/screens/LandingScreen/WalletOverflowButton.mjs +1 -0
- package/dist/esm/screens/LandingScreen/Web2OverflowButton.mjs +1 -0
- package/dist/esm/screens/LandingScreen/styles.mjs +1 -0
- package/dist/esm/screens/LinkEmailScreen.mjs +1 -0
- package/dist/esm/screens/LinkPasskeyScreen.mjs +1 -0
- package/dist/esm/screens/LinkPhoneScreen.mjs +1 -0
- package/dist/esm/screens/LinkWalletScreen.mjs +1 -0
- package/dist/esm/screens/LoginFailedScreen.mjs +1 -0
- package/dist/esm/screens/MfaScreens/EnrollLandingScreen.mjs +1 -0
- package/dist/esm/screens/MfaScreens/EnrollPasskey.mjs +1 -0
- package/dist/esm/screens/MfaScreens/EnrollSms.mjs +1 -0
- package/dist/esm/screens/MfaScreens/EnrollTotp.mjs +1 -0
- package/dist/esm/screens/MfaScreens/MfaEnrollmentFlowScreen.mjs +1 -0
- package/dist/esm/screens/MfaScreens/MfaVerifyFlowScreen.mjs +1 -0
- package/dist/esm/screens/MfaScreens/StyledComponents.mjs +1 -0
- package/dist/esm/screens/MfaScreens/VerifyWithPasskey.mjs +1 -0
- package/dist/esm/screens/OAuthStatusScreen.mjs +1 -0
- package/dist/esm/screens/PasskeyStatusScreen.mjs +1 -0
- package/dist/esm/screens/PhantomInterstitialScreen.mjs +1 -0
- package/dist/esm/screens/Recovery/PasswordRecoveryScreen.mjs +1 -0
- package/dist/esm/screens/Recovery/RecoveryOAuthStatusScreen.mjs +1 -0
- package/dist/esm/screens/Recovery/RecoveryPasswordCreateScreen.mjs +1 -0
- package/dist/esm/screens/Recovery/RecoverySelectionScreen.mjs +1 -0
- package/dist/esm/screens/Recovery/SetAutomaticRecoveryScreen.mjs +1 -0
- package/dist/esm/screens/Recovery/styles.mjs +1 -0
- package/dist/esm/screens/SendSolanaTransactionScreen/SendSolanaTransactionScreen.mjs +1 -0
- package/dist/esm/screens/SendSolanaTransactionScreen/SolanaTransactionReceiptView.mjs +1 -0
- package/dist/esm/screens/SendTransactionScreen/EthersTransactionError.mjs +1 -0
- package/dist/esm/screens/SendTransactionScreen/SendTransactionScreen.mjs +1 -0
- package/dist/esm/screens/SendTransactionScreen/SendTransactionScreenView.mjs +1 -0
- package/dist/esm/screens/SendTransactionScreen/TransactionDetail.mjs +1 -0
- package/dist/esm/screens/SendTransactionScreen/TransactionErrorView.mjs +1 -0
- package/dist/esm/screens/SendTransactionScreen/TransactionReceiptView.mjs +1 -0
- package/dist/esm/screens/SendTransactionScreen/getStaticTransactionMetadata.mjs +1 -0
- package/dist/esm/screens/SendTransactionScreen/index.mjs +1 -0
- package/dist/esm/screens/SendTransactionScreen/usePrepareTransaction.mjs +1 -0
- package/dist/esm/screens/SendTransactionScreen/useTransactionDetails.mjs +1 -0
- package/dist/esm/screens/SignRequestScreen.mjs +1 -0
- package/dist/esm/screens/TelegramAuthScreen.mjs +1 -0
- package/dist/esm/screens/UpdateEmailScreen.mjs +1 -0
- package/dist/esm/screens/UpdatePhoneScreen.mjs +1 -0
- package/dist/esm/screens/UserLimitReachedScreen.mjs +1 -0
- package/dist/esm/screens/index.mjs +1 -0
- package/dist/esm/session.mjs +1 -0
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/storage.mjs +1 -0
- package/dist/esm/styles.mjs +1 -0
- package/dist/esm/svg/alert-circle.mjs +1 -0
- package/dist/esm/svg/apple-icloud.mjs +1 -0
- package/dist/esm/svg/apple.mjs +1 -0
- package/dist/esm/svg/arrow-cycle.mjs +1 -0
- package/dist/esm/svg/black-rounded-square.mjs +1 -0
- package/dist/esm/svg/blobby.mjs +1 -0
- package/dist/esm/svg/brave-browser-icon.mjs +1 -0
- package/dist/esm/svg/browser-extension-wallet-icon.mjs +1 -0
- package/dist/esm/svg/bybit.mjs +1 -0
- package/dist/esm/svg/chains/base.mjs +1 -0
- package/dist/esm/svg/check-badge.mjs +1 -0
- package/dist/esm/svg/checkmark.mjs +1 -0
- package/dist/esm/svg/coinbase-wallet.mjs +1 -0
- package/dist/esm/svg/copy.mjs +1 -0
- package/dist/esm/svg/cryptocom.mjs +1 -0
- package/dist/esm/svg/discord.mjs +1 -0
- package/dist/esm/svg/email-or-phone.mjs +1 -0
- package/dist/esm/svg/error-circle.mjs +1 -0
- package/dist/esm/svg/face-id.mjs +1 -0
- package/dist/esm/svg/farcaster.mjs +1 -0
- package/dist/esm/svg/fingerprint.mjs +1 -0
- package/dist/esm/svg/github.mjs +1 -0
- package/dist/esm/svg/globe.mjs +1 -0
- package/dist/esm/svg/google-drive.mjs +1 -0
- package/dist/esm/svg/google.mjs +1 -0
- package/dist/esm/svg/index.d.mjs +1 -0
- package/dist/esm/svg/instagram.mjs +1 -0
- package/dist/esm/svg/linkedin.mjs +1 -0
- package/dist/esm/svg/lock-closed.mjs +1 -0
- package/dist/esm/svg/metamask.mjs +1 -0
- package/dist/esm/svg/mfa-shield.mjs +1 -0
- package/dist/esm/svg/moonpay.mjs +1 -0
- package/dist/esm/svg/phantom.mjs +1 -0
- package/dist/esm/svg/protected-by-privy.mjs +1 -0
- package/dist/esm/svg/qr-codes.mjs +1 -0
- package/dist/esm/svg/rabby.mjs +1 -0
- package/dist/esm/svg/rainbow.mjs +1 -0
- package/dist/esm/svg/safe.mjs +1 -0
- package/dist/esm/svg/spotify.mjs +1 -0
- package/dist/esm/svg/telegram.mjs +1 -0
- package/dist/esm/svg/tiktok.mjs +1 -0
- package/dist/esm/svg/twitter.mjs +1 -0
- package/dist/esm/svg/uniswap.mjs +1 -0
- package/dist/esm/svg/universal-profile.mjs +1 -0
- package/dist/esm/svg/wallet-connect.mjs +1 -0
- package/dist/esm/svg/zerion.mjs +1 -0
- package/dist/esm/theme.mjs +1 -0
- package/dist/esm/token.mjs +1 -0
- package/dist/esm/types.mjs +1 -0
- package/dist/esm/ui.mjs +1 -447
- package/dist/esm/utils/buffer/readBigInt64LE.mjs +1 -0
- package/dist/esm/utils/index.mjs +1 -0
- package/package.json +6 -5
- package/dist/cjs/modal-context-CwkJu5Ic.js +0 -1
- package/dist/cjs/smart-wallets-DzZ1cvop.js +0 -1
- package/dist/cjs/useActiveWallet-CGfP6L7t.js +0 -3154
- package/dist/cjs/useSolanaWallets-DkS992n_.js +0 -1
- package/dist/cjs/useWallets-BygaNfXg.js +0 -1
- package/dist/esm/getEmbeddedConnectedWallet-CSSBWE2p.mjs +0 -1
- package/dist/esm/modal-context-B41efUBc.mjs +0 -1
- package/dist/esm/smart-wallets-CrvHyIhF.mjs +0 -1
- package/dist/esm/useActiveWallet-Bug7ZDKG.mjs +0 -3154
- package/dist/esm/useSolanaWallets-B8adnBQz.mjs +0 -1
- package/dist/esm/useWallets-CsXFMHlw.mjs +0 -1
- /package/dist/cjs/{getEmbeddedConnectedWallet-DTU4T9TJ.js → lib/getEmbeddedConnectedWallet.js} +0 -0
|
@@ -1,3154 +0,0 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as r}from"react/jsx-runtime";import{getAddress as n,isAddress as a}from"@ethersproject/address";import{Web3Provider as i}from"@ethersproject/providers";import{createStore as o}from"mipd";import l,{useRef as s,useState as d,useMemo as c,useContext as u,createContext as h,useEffect as p,useCallback as m,useReducer as f,forwardRef as g}from"react";import*as y from"react-device-detect";import{isMobile as w,isIOS as v,isSafari as C,isAndroid as b}from"react-device-detect";import{a as E,f as $,P as T,e as A,n as x,h as _,i as k,j as N,k as S,l as I,m as O,b as P,u as M,s as R,o as L,c as D,p as F,q as U,r as W,t as B,v as j,w as z,d as G,g as H,x as V,y as q,z as Z,A as K,B as Y,C as Q,U as J,I as X}from"./useWallets-CsXFMHlw.mjs";import*as ee from"jose";import{base64url as te}from"jose";import{g as re,C as ne,H as ae,O as ie,S as oe,p as le,e as se,h as de,i as ce,j as ue,k as he,l as pe,t as me,m as fe,n as ge,o as ye,s as we,q as ve,r as Ce,v as be,w as Ee,x as $e,V as Te,y as Ae,P as xe,R as _e,F as ke,z as Ne,A as Se,B as Ie,E as Oe,G as Pe,I as Me,J as Re,K as Le,L as De,M as Fe,c as Ue,N as We,f as Be,d as je,Q as ze,T as Ge,U as He,W as Ve,X as qe,Y as Ze,Z as Ke,_ as Ye,$ as Qe,a0 as Je,a1 as Xe,a2 as et,a3 as tt,a4 as rt,a5 as nt,a6 as at,a7 as it,a8 as ot,a9 as lt,aa as st,ab as dt,ac as ct,ad as ut,ae as ht,af as pt,ag as mt,ah as ft,ai as gt,aj as yt,ak as wt,al as vt,am as Ct,an as bt,ao as Et,ap as $t,aq as Tt,ar as At,as as xt,at as _t,au as kt,av as Nt,aw as St,u as It,ax as Ot}from"./modal-context-B41efUBc.mjs";import{v4 as Pt}from"uuid";import{isHexString as Mt}from"@ethersproject/bytes";import Rt from"eventemitter3";import{CoinbaseWalletSDK as Lt}from"@coinbase/wallet-sdk";import{R as Dt,f as Ft,c as Ut,W as Wt,U as Bt,d as jt,a as zt,C as Gt,P as Ht,b as Vt,u as qt,e as Zt,n as Kt,p as Yt,g as Qt,h as Jt,i as Xt}from"./useSolanaWallets-B8adnBQz.mjs";import{Turnstile as er}from"@marsidev/react-turnstile";import{styled as tr,css as rr,keyframes as nr,createGlobalStyle as ar}from"styled-components";import ir from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import or from"@heroicons/react/24/outline/ArrowLeftIcon";import lr from"@heroicons/react/24/outline/ArrowRightIcon";import sr from"@heroicons/react/24/outline/XMarkIcon";import dr from"@heroicons/react/24/outline/ExclamationTriangleIcon";import cr from"@heroicons/react/24/outline/WalletIcon";import ur from"@heroicons/react/24/outline/CheckIcon";import hr from"@heroicons/react/24/outline/Square2StackIcon";import pr from"@heroicons/react/24/outline/ExclamationCircleIcon";import mr from"@heroicons/react/24/outline/ArrowTopRightOnSquareIcon";import fr from"@heroicons/react/24/solid/DocumentCheckIcon";import gr from"@heroicons/react/20/solid/CheckIcon";import yr from"@heroicons/react/24/outline/EnvelopeIcon";import wr from"@heroicons/react/24/outline/PhoneIcon";import vr from"@heroicons/react/24/solid/CheckCircleIcon";import Cr from"@heroicons/react/24/solid/XCircleIcon";import{EthereumProvider as br,OPTIONAL_EVENTS as Er,OPTIONAL_METHODS as $r}from"@walletconnect/ethereum-provider";import Tr from"@heroicons/react/24/outline/CheckCircleIcon";import Ar from"fast-password-entropy";import*as xr from"secure-password-utilities";import{DEFAULT_WORDLIST as _r}from"secure-password-utilities/wordlists";import kr from"@heroicons/react/24/outline/ArrowPathIcon";import Nr from"@heroicons/react/24/outline/EyeIcon";import Sr from"@heroicons/react/24/outline/EyeSlashIcon";import Ir from"@heroicons/react/24/outline/KeyIcon";import Or from"@heroicons/react/24/outline/ArrowDownTrayIcon";import Pr from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import Mr from"@heroicons/react/24/outline/DocumentDuplicateIcon";import Rr from"@heroicons/react/24/outline/UserCircleIcon";import Lr from"@heroicons/react/24/solid/LockClosedIcon";import Dr from"qrcode";import{createPublicClient as Fr,http as Ur,createWalletClient as Wr,custom as Br,publicActions as jr,parseEther as zr,encodeFunctionData as Gr,decodeFunctionData as Hr,decodeAbiParameters as Vr,formatEther as qr,toHex as Zr}from"viem";import Kr from"@heroicons/react/24/outline/GlobeAltIcon";import{Menu as Yr,MenuButton as Qr,MenuItems as Jr,MenuItem as Xr,Transition as en,Dialog as tn,TransitionChild as rn,DialogPanel as nn}from"@headlessui/react";import an from"@heroicons/react/24/outline/ChevronDownIcon";import{BigNumber as on}from"@ethersproject/bignumber";import{parseUnits as ln,formatEther as sn,formatUnits as dn}from"@ethersproject/units";import cn from"@heroicons/react/24/outline/ClockIcon";import un from"@heroicons/react/24/outline/TrashIcon";import hn from"@heroicons/react/24/solid/CheckBadgeIcon";import pn from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import mn from"@heroicons/react/24/outline/PencilIcon";import fn from"@heroicons/react/24/outline/CreditCardIcon";import gn from"@heroicons/react/24/outline/QrCodeIcon";import yn from"@heroicons/react/24/outline/InformationCircleIcon";import{ofetch as wn}from"ofetch";import vn from"@heroicons/react/24/outline/ChevronRightIcon";import Cn from"@heroicons/react/24/outline/ShieldCheckIcon";import bn from"@heroicons/react/24/solid/IdentificationIcon";import En from"@heroicons/react/24/outline/DevicePhoneMobileIcon";import $n from"@heroicons/react/24/outline/FingerPrintIcon";import Tn from"@heroicons/react/24/outline/MinusCircleIcon";import An from"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import xn from"@heroicons/react/24/solid/ShieldCheckIcon";import{VoidSigner as _n}from"@ethersproject/abstract-signer";import{Contract as kn}from"@ethersproject/contracts";import{serialize as Nn}from"@ethersproject/transactions";import Sn from"fetch-retry";import In from"@heroicons/react/24/outline/CalendarIcon";import On from"@heroicons/react/24/outline/LockClosedIcon";import Pn from"@heroicons/react/24/outline/PencilSquareIcon";import{ChevronDownIcon as Mn}from"@heroicons/react/24/outline";import Rn from"@heroicons/react/24/outline/ClipboardDocumentIcon";import{ErrorCode as Ln}from"@ethersproject/logger";import{toUtf8String as Dn}from"@ethersproject/strings";import Fn from"js-cookie";import{create as Un}from"zustand";import{shallow as Wn}from"zustand/shallow";import{createWithEqualityFn as Bn}from"zustand/traditional";let jn={id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},zn={id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{default:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0},Gn={id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},Hn={id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}}},Vn={id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0},qn={id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},Zn={id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},Kn={id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.optimism.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0},Yn={id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},Qn={id:137,name:"Polygon Mainnet",network:"polygon",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},Jn={id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0},Xn={id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},ea={id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},ta={id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},ra=e=>on.from(e);function na(e){if("number"==typeof e||"bigint"==typeof e||"string"==typeof e)return e;if("function"==typeof e.toHexString)return e.toHexString();throw Error(`Expected numeric value but received ${e}`)}let aa=e=>[jn.id,zn.id,Gn.id].includes(e),ia=e=>[56,97].includes(e),oa="0x420000000000000000000000000000000000000F",la=["function getL1Fee(bytes memory _data) external view returns (uint256)"],sa=e=>[Hn.id,Vn.id,qn.id,Zn.id,Kn.id,Yn.id,Xn.id,ta.id,ea.id,81457,168587773].includes(e);async function da(e,t){if(!e.chainId||e.chainId&&!sa(e.chainId))return on.from(0);let r=on.from(0);try{let n=new kn(oa,la,t),a=function(e){let t={};return void 0!==e.to&&(t.to=e.to),void 0!==e.data&&(t.data=e.data),void 0!==e.chainId&&(t.chainId=e.chainId),void 0!==e.type&&(t.type=e.type),void 0!==e.accessList&&(t.accessList=e.accessList),void 0!==e.nonce&&(t.nonce=ra(e.nonce).toNumber()),void 0!==e.gasLimit&&(t.gasLimit=ra(e.gasLimit)),void 0!==e.gasPrice&&(t.gasPrice=ra(e.gasPrice)),void 0!==e.value&&(t.value=ra(e.value)),void 0!==e.maxFeePerGas&&(t.maxFeePerGas=ra(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=ra(e.maxPriorityFeePerGas)),t}(e),i=Nn(a);r=await n.getL1Fee(i)}catch(e){}return r}let ca={id:80002,name:"Polygon Amoy",network:"polygon-amoy",nativeCurrency:{name:"POL",symbol:"POL",decimals:18},rpcUrls:{privy:{http:["https://polygon-amoy.rpc.privy.systems"]},infura:{http:["https://polygon-amoy.infura.io/v3"],webSocket:["wss://polygon-amoy.infura.io/ws/v3"]},default:{http:["https://rpc-amoy.polygon.technology"]}},blockExplorers:{default:{name:"OK LINK",url:"https://www.oklink.com/amoy"}},testnet:!0},ua=Sn(fetch,{retries:3,retryDelay:500}),ha=e=>[Qn.id,Jn.id,ca.id].includes(e),pa=e=>({maxPriorityFee:ln(e.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:ln(e.maxFee.toFixed(9),"gwei").toHexString()}),ma=async e=>{let t="";switch(e){case Qn.id:t="https://gasstation.polygon.technology/v2";break;case Jn.id:t="https://gasstation-testnet.polygon.technology/v2";break;case ca.id:t="https://gasstation.polygon.technology/amoy";break;default:throw Error(`chainId ${e} does not support polygon gas stations`)}let r=await ua(t),n=await r.json();if(r.status>399)throw n;return{safeLow:pa(n.safeLow),standard:pa(n.standard),fast:pa(n.fast)}};async function fa(e,t){if(!e.gasLimit)throw new Dt("gasLimit was not successfully set for transaction.");let r=ra(e.gasLimit),n=on.from(0);if(2==e.type){if(!e.maxFeePerGas)throw new Dt("maxFeePerGas was not successfully set for transaction of type 2.");n=ra(e.maxFeePerGas)}else{if(!e.gasPrice)throw new Dt("gasPrice was not successfully set for transaction of type 0 or 1.");n=ra(e.gasPrice)}let a=r.mul(n),i=on.from(0);if(e.chainId&&sa(e.chainId))try{i=await da(e,t),a=a.add(i)}catch(e){}return{totalGasEstimate:a,l1ExecutionFeeEstimate:i}}function ga(e){return/^-?0x[a-f0-9]+$/i.test(e)}async function ya(e,t,r){if(t.chainId=Number(t.chainId),function(e){for(let t of["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"]){let r=e[t];if(void 0!==r&&!function(e){let t="number"==typeof e,r="bigint"==typeof e,n="string"==typeof e&&ga(e);return t||r||n}(r))throw Error(`Transaction request property '${t}' must be a valid number, bigint, or hex string representing a quantity`)}if("number"!=typeof e.chainId)throw Error("Transaction request property 'chainId' must be a number")}(t),t.from||(t.from=e),!t.nonce){let n=new _n(e,r);t.nonce=await n.getTransactionCount("pending")}return t.gasLimit||(t.gas?(t.gasLimit=t.gas,delete t.gas):t.gasLimit=await async function(e,t){try{return(await t.estimateGas(e)).toHexString()}catch(r){let n;if("message"in r&&r.message.includes("insufficient funds")&&(console.warn(`Gas estimation failed with error: ${r}. Retrying gas estimation by omitting the 'value'`),n=await async function({txRequest:e,provider:t}){try{let r={...e,value:void 0};return(await t.estimateGas(r)).toHexString()}catch(e){return console.warn(`Gas estimation failed with error: ${e} when omitting the 'value'`),null}}({txRequest:e,provider:t})),n||(console.warn(`Gas estimation failed with error: ${r}. Retrying gas estimation by omitting the 'from'`),n=await async function({txRequest:e,provider:t}){try{let r={...e,from:void 0};return(await t.estimateGas(r)).toHexString()}catch(e){return console.warn(`Gas estimation failed with error: ${e} when omitting the 'from' address`),null}}({txRequest:e,provider:t})),!n)throw r;return n}}(t,r)),"string"==typeof t.type&&ga(t.type)&&(t.type=Number(t.type)),[23294,23295].includes(t.chainId)&&(t.type=0),0===(t=ha(t.chainId)?await async function(e){if(!ha(e.chainId))throw Error("Invalid chain ID for Polygon gas estimation.");if(void 0===e.type&&(e.type=2),e.maxPriorityFeePerGas&&e.maxFeePerGas)return e;try{let{standard:t}=await ma(e.chainId);e.maxPriorityFeePerGas||(e.maxPriorityFeePerGas=t.maxPriorityFee),e.maxFeePerGas||(e.maxFeePerGas=t.maxFee),e.gasPrice&&(console.warn("`gasPrice` is not supported on this chain and will be ignored. Use `maxPriorityFeePerGas` and/or `maxFeePerGas` instead."),delete e.gasPrice)}catch(e){throw Error(`Failed to set gas prices from Polygon gas station with error: ${e}.`)}return e}(t):aa(t.chainId)?await(async(e,t)=>{if(!aa(e.chainId))throw Error("Invalid chain ID for Arbitrum gas estimation.");if(void 0===e.type&&(e.type=2),e.maxFeePerGas)return e;try{let{lastBaseFeePerGas:r}=await t.getFeeData();if(r){let t=r.mul(on.from(120)).div(on.from(100));e.maxFeePerGas=na(t),e.maxPriorityFeePerGas=na(on.from(0))}}catch(e){throw Error(`Failed to set gas price for Arbitrum transaction: ${e}.`)}return e})(t,r):sa(t.chainId)?await(async(e,t)=>{if(!sa(e.chainId))throw Error("Invalid chain ID for OP Stack gas estimation.");if(void 0===e.type&&(e.type=2),e.gasPrice&&(console.warn("`gasPrice` is not supported on this chain and will be ignored. Use `maxPriorityFeePerGas` and/or `maxFeePerGas` instead."),delete e.gasPrice),e.maxPriorityFeePerGas&&e.maxFeePerGas)return e;try{if(!e.maxPriorityFeePerGas){let r=await t.send("eth_maxPriorityFeePerGas",[]);e.maxPriorityFeePerGas=r}if(e.maxFeePerGas&&(console.warn("maxFeePerGas is specified without maxPriorityFeePerGas - this can result in hung transactions."),e.maxPriorityFeePerGas>=e.maxFeePerGas))throw Error("Overridden maxFeePerGas is less than or equal to the calculated maxPriorityFeePerGas. Please set both values or maxPriorityFeePerGas alone for correct gas estimation.");if(!e.maxFeePerGas){let{lastBaseFeePerGas:r}=await t.getFeeData();if(!r)throw Error("Unable to fetch baseFee for last block.");let n=on.from(r).mul(on.from(126)).div(on.from(100)).add(on.from(e.maxPriorityFeePerGas));e.maxFeePerGas=na(n)}}catch(e){throw Error(`Failed to set gas price for OP stack transaction: ${e}.`)}return e})(t,r):ia(t.chainId)?await(async(e,t)=>{if(!ia(e.chainId))throw Error("Invalid chain ID for BSC gas estimation.");if(void 0===e.type?e.type=0:1!=e.type&&2!=e.type||console.warn("Transaction request type specified is incompatible for chain and will result in undefined behavior. Please use transaction type 0."),!e.gasPrice){let r=await t.getFeeData();e.gasPrice=r.gasPrice?.toHexString()}return e})(t,r):await(async(e,t)=>{if(void 0===e.type&&(e.type=2),2===e.type){if(!e.maxFeePerGas||!e.maxPriorityFeePerGas){let r=await t.getFeeData();e.maxFeePerGas||(e.maxFeePerGas=r.maxFeePerGas?.toHexString()),e.maxPriorityFeePerGas||(e.maxPriorityFeePerGas=r.maxPriorityFeePerGas?.toHexString())}}else if(!e.gasPrice){let r=await t.getFeeData();e.gasPrice=r.gasPrice?.toHexString()}return e})(t,r)).type&&delete t.accessList,2!==t.type&&(delete t.maxPriorityFeePerGas,delete t.maxFeePerGas),t}var wa={AC:"40123",AD:"312345",AE:"501234567",AF:"701234567",AG:"2684641234",AI:"2642351234",AL:"672123456",AM:"77123456",AO:"923123456",AR:"91123456789",AS:"6847331234",AT:"664123456",AU:"412345678",AW:"5601234",AX:"412345678",AZ:"401234567",BA:"61123456",BB:"2462501234",BD:"1812345678",BE:"470123456",BF:"70123456",BG:"43012345",BH:"36001234",BI:"79561234",BJ:"90011234",BL:"690001234",BM:"4413701234",BN:"7123456",BO:"71234567",BQ:"3181234",BR:"11961234567",BS:"2423591234",BT:"17123456",BW:"71123456",BY:"294911911",BZ:"6221234",CA:"5062345678",CC:"412345678",CD:"991234567",CF:"70012345",CG:"061234567",CH:"781234567",CI:"0123456789",CK:"71234",CL:"221234567",CM:"671234567",CN:"13123456789",CO:"3211234567",CR:"83123456",CU:"51234567",CV:"9911234",CW:"95181234",CX:"412345678",CY:"96123456",CZ:"601123456",DE:"15123456789",DJ:"77831001",DK:"32123456",DM:"7672251234",DO:"8092345678",DZ:"551234567",EC:"991234567",EE:"51234567",EG:"1001234567",EH:"650123456",ER:"7123456",ES:"612345678",ET:"911234567",FI:"412345678",FJ:"7012345",FK:"51234",FM:"3501234",FO:"211234",FR:"612345678",GA:"06031234",GB:"7400123456",GD:"4734031234",GE:"555123456",GF:"694201234",GG:"7781123456",GH:"231234567",GI:"57123456",GL:"221234",GM:"3012345",GN:"601123456",GP:"690001234",GQ:"222123456",GR:"6912345678",GT:"51234567",GU:"6713001234",GW:"955012345",GY:"6091234",HK:"51234567",HN:"91234567",HR:"921234567",HT:"34101234",HU:"201234567",ID:"812345678",IE:"850123456",IL:"502345678",IM:"7924123456",IN:"8123456789",IO:"3801234",IQ:"7912345678",IR:"9123456789",IS:"6111234",IT:"3123456789",JE:"7797712345",JM:"8762101234",JO:"790123456",JP:"9012345678",KE:"712123456",KG:"700123456",KH:"91234567",KI:"72001234",KM:"3212345",KN:"8697652917",KP:"1921234567",KR:"1020000000",KW:"50012345",KY:"3453231234",KZ:"7710009998",LA:"2023123456",LB:"71123456",LC:"7582845678",LI:"660234567",LK:"712345678",LR:"770123456",LS:"50123456",LT:"61234567",LU:"628123456",LV:"21234567",LY:"912345678",MA:"650123456",MC:"612345678",MD:"62112345",ME:"67622901",MF:"690001234",MG:"321234567",MH:"2351234",MK:"72345678",ML:"65012345",MM:"92123456",MN:"88123456",MO:"66123456",MP:"6702345678",MQ:"696201234",MR:"22123456",MS:"6644923456",MT:"96961234",MU:"52512345",MV:"7712345",MW:"991234567",MX:"12221234567",MY:"123456789",MZ:"821234567",NA:"811234567",NC:"751234",NE:"93123456",NF:"381234",NG:"8021234567",NI:"81234567",NL:"612345678",NO:"40612345",NP:"9841234567",NR:"5551234",NU:"8884012",NZ:"211234567",OM:"92123456",PA:"61234567",PE:"912345678",PF:"87123456",PG:"70123456",PH:"9051234567",PK:"3012345678",PL:"512345678",PM:"551234",PR:"7872345678",PS:"599123456",PT:"912345678",PW:"6201234",PY:"961456789",QA:"33123456",RE:"692123456",RO:"712034567",RS:"601234567",RU:"9123456789",RW:"720123456",SA:"512345678",SB:"7421234",SC:"2510123",SD:"911231234",SE:"701234567",SG:"81234567",SH:"51234",SI:"31234567",SJ:"41234567",SK:"912123456",SL:"25123456",SM:"66661212",SN:"701234567",SO:"71123456",SR:"7412345",SS:"977123456",ST:"9812345",SV:"70123456",SX:"7215205678",SY:"944567890",SZ:"76123456",TA:"8999",TC:"6492311234",TD:"63012345",TG:"90112345",TH:"812345678",TJ:"917123456",TK:"7290",TL:"77212345",TM:"66123456",TN:"20123456",TO:"7715123",TR:"5012345678",TT:"8682911234",TV:"901234",TW:"912345678",TZ:"621234567",UA:"501234567",UG:"712345678",US:"2015550123",UY:"94231234",UZ:"912345678",VA:"3123456789",VC:"7844301234",VE:"4121234567",VG:"2843001234",VI:"3406421234",VN:"912345678",VU:"5912345",WF:"821234",WS:"7212345",XK:"43201234",YE:"712345678",YT:"639012345",ZA:"711234567",ZM:"955123456",ZW:"712345678"},va={version:4,country_calling_codes:{1:["US","AG","AI","AS","BB","BM","BS","CA","DM","DO","GD","GU","JM","KN","KY","LC","MP","MS","PR","SX","TC","TT","VC","VG","VI"],7:["RU","KZ"],20:["EG"],27:["ZA"],30:["GR"],31:["NL"],32:["BE"],33:["FR"],34:["ES"],36:["HU"],39:["IT","VA"],40:["RO"],41:["CH"],43:["AT"],44:["GB","GG","IM","JE"],45:["DK"],46:["SE"],47:["NO","SJ"],48:["PL"],49:["DE"],51:["PE"],52:["MX"],53:["CU"],54:["AR"],55:["BR"],56:["CL"],57:["CO"],58:["VE"],60:["MY"],61:["AU","CC","CX"],62:["ID"],63:["PH"],64:["NZ"],65:["SG"],66:["TH"],81:["JP"],82:["KR"],84:["VN"],86:["CN"],90:["TR"],91:["IN"],92:["PK"],93:["AF"],94:["LK"],95:["MM"],98:["IR"],211:["SS"],212:["MA","EH"],213:["DZ"],216:["TN"],218:["LY"],220:["GM"],221:["SN"],222:["MR"],223:["ML"],224:["GN"],225:["CI"],226:["BF"],227:["NE"],228:["TG"],229:["BJ"],230:["MU"],231:["LR"],232:["SL"],233:["GH"],234:["NG"],235:["TD"],236:["CF"],237:["CM"],238:["CV"],239:["ST"],240:["GQ"],241:["GA"],242:["CG"],243:["CD"],244:["AO"],245:["GW"],246:["IO"],247:["AC"],248:["SC"],249:["SD"],250:["RW"],251:["ET"],252:["SO"],253:["DJ"],254:["KE"],255:["TZ"],256:["UG"],257:["BI"],258:["MZ"],260:["ZM"],261:["MG"],262:["RE","YT"],263:["ZW"],264:["NA"],265:["MW"],266:["LS"],267:["BW"],268:["SZ"],269:["KM"],290:["SH","TA"],291:["ER"],297:["AW"],298:["FO"],299:["GL"],350:["GI"],351:["PT"],352:["LU"],353:["IE"],354:["IS"],355:["AL"],356:["MT"],357:["CY"],358:["FI","AX"],359:["BG"],370:["LT"],371:["LV"],372:["EE"],373:["MD"],374:["AM"],375:["BY"],376:["AD"],377:["MC"],378:["SM"],380:["UA"],381:["RS"],382:["ME"],383:["XK"],385:["HR"],386:["SI"],387:["BA"],389:["MK"],420:["CZ"],421:["SK"],423:["LI"],500:["FK"],501:["BZ"],502:["GT"],503:["SV"],504:["HN"],505:["NI"],506:["CR"],507:["PA"],508:["PM"],509:["HT"],590:["GP","BL","MF"],591:["BO"],592:["GY"],593:["EC"],594:["GF"],595:["PY"],596:["MQ"],597:["SR"],598:["UY"],599:["CW","BQ"],670:["TL"],672:["NF"],673:["BN"],674:["NR"],675:["PG"],676:["TO"],677:["SB"],678:["VU"],679:["FJ"],680:["PW"],681:["WF"],682:["CK"],683:["NU"],685:["WS"],686:["KI"],687:["NC"],688:["TV"],689:["PF"],690:["TK"],691:["FM"],692:["MH"],850:["KP"],852:["HK"],853:["MO"],855:["KH"],856:["LA"],880:["BD"],886:["TW"],960:["MV"],961:["LB"],962:["JO"],963:["SY"],964:["IQ"],965:["KW"],966:["SA"],967:["YE"],968:["OM"],970:["PS"],971:["AE"],972:["IL"],973:["BH"],974:["QA"],975:["BT"],976:["MN"],977:["NP"],992:["TJ"],993:["TM"],994:["AZ"],995:["GE"],996:["KG"],998:["UZ"]},countries:{AC:["247","00","(?:[01589]\\d|[46])\\d{4}",[5,6]],AD:["376","00","(?:1|6\\d)\\d{7}|[135-9]\\d{5}",[6,8,9],[["(\\d{3})(\\d{3})","$1 $2",["[135-9]"]],["(\\d{4})(\\d{4})","$1 $2",["1"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]]],AE:["971","00","(?:[4-7]\\d|9[0-689])\\d{7}|800\\d{2,9}|[2-4679]\\d{7}",[5,6,7,8,9,10,11,12],[["(\\d{3})(\\d{2,9})","$1 $2",["60|8"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[236]|[479][2-8]"],"0$1"],["(\\d{3})(\\d)(\\d{5})","$1 $2 $3",["[479]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"]],"0"],AF:["93","00","[2-7]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"]],"0"],AG:["1","011","(?:268|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([457]\\d{6})$|1","268$1",0,"268"],AI:["1","011","(?:264|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2457]\\d{6})$|1","264$1",0,"264"],AL:["355","00","(?:700\\d\\d|900)\\d{3}|8\\d{5,7}|(?:[2-5]|6\\d)\\d{7}",[6,7,8,9],[["(\\d{3})(\\d{3,4})","$1 $2",["80|9"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["4[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2358][2-5]|4"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["[23578]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["6"],"0$1"]],"0"],AM:["374","00","(?:[1-489]\\d|55|60|77)\\d{6}",[8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[89]0"],"0 $1"],["(\\d{3})(\\d{5})","$1 $2",["2|3[12]"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["1|47"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[3-9]"],"0$1"]],"0"],AO:["244","00","[29]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[29]"]]]],AR:["54","00","(?:11|[89]\\d\\d)\\d{8}|[2368]\\d{9}",[10,11],[["(\\d{4})(\\d{2})(\\d{4})","$1 $2-$3",["2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9])","2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8]))|2(?:2[24-9]|3[1-59]|47)","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5[56][46]|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|58|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|54(?:4|5[13-7]|6[89])|86[3-6]))|2(?:2[24-9]|3[1-59]|47)|38(?:[58][78]|7[378])|3(?:454|85[56])[46]|3(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["1"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[68]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2-$3",["[23]"],"0$1",1],["(\\d)(\\d{4})(\\d{2})(\\d{4})","$2 15-$3-$4",["9(?:2[2-469]|3[3-578])","9(?:2(?:2[024-9]|3[0-59]|47|6[245]|9[02-8])|3(?:3[28]|4[03-9]|5[2-46-8]|7[1-578]|8[2-9]))","9(?:2(?:[23]02|6(?:[25]|4[6-8])|9(?:[02356]|4[02568]|72|8[23]))|3(?:3[28]|4(?:[04679]|3[5-8]|5[4-68]|8[2379])|5(?:[2467]|3[237]|8[2-5])|7[1-578]|8(?:[2469]|3[2578]|5[4-8]|7[36-8]|8[5-8])))|92(?:2[24-9]|3[1-59]|47)","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3[78]|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8[23])|7[1-578]|8(?:[2469]|3[278]|5(?:[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4[35][56]|58[45]|8(?:[38]5|54|76))[4-6]","9(?:2(?:[23]02|6(?:[25]|4(?:64|[78]))|9(?:[02356]|4(?:[0268]|5[2-6])|72|8[23]))|3(?:3[28]|4(?:[04679]|3(?:5(?:4[0-25689]|[56])|[78])|5(?:4[46]|8)|8[2379])|5(?:[2467]|3[237]|8(?:[23]|4(?:[45]|60)|5(?:4[0-39]|5|64)))|7[1-578]|8(?:[2469]|3[278]|5(?:4(?:4|5[13-7]|6[89])|[56][46]|[78])|7[378]|8(?:6[3-6]|[78]))))|92(?:2[24-9]|3[1-59]|47)|93(?:4(?:36|5[56])|8(?:[38]5|76))[4-6]"],"0$1",0,"$1 $2 $3-$4"],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 15-$3-$4",["91"],"0$1",0,"$1 $2 $3-$4"],["(\\d{3})(\\d{3})(\\d{5})","$1-$2-$3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 15-$3-$4",["9"],"0$1",0,"$1 $2 $3-$4"]],"0",0,"0?(?:(11|2(?:2(?:02?|[13]|2[13-79]|4[1-6]|5[2457]|6[124-8]|7[1-4]|8[13-6]|9[1267])|3(?:02?|1[467]|2[03-6]|3[13-8]|[49][2-6]|5[2-8]|[67])|4(?:7[3-578]|9)|6(?:[0136]|2[24-6]|4[6-8]?|5[15-8])|80|9(?:0[1-3]|[19]|2\\d|3[1-6]|4[02568]?|5[2-4]|6[2-46]|72?|8[23]?))|3(?:3(?:2[79]|6|8[2578])|4(?:0[0-24-9]|[12]|3[5-8]?|4[24-7]|5[4-68]?|6[02-9]|7[126]|8[2379]?|9[1-36-8])|5(?:1|2[1245]|3[237]?|4[1-46-9]|6[2-4]|7[1-6]|8[2-5]?)|6[24]|7(?:[069]|1[1568]|2[15]|3[145]|4[13]|5[14-8]|7[2-57]|8[126])|8(?:[01]|2[15-7]|3[2578]?|4[13-6]|5[4-8]?|6[1-357-9]|7[36-8]?|8[5-8]?|9[124])))15)?","9$1"],AS:["1","011","(?:[58]\\d\\d|684|900)\\d{7}",[10],0,"1",0,"([267]\\d{6})$|1","684$1",0,"684"],AT:["43","00","1\\d{3,12}|2\\d{6,12}|43(?:(?:0\\d|5[02-9])\\d{3,9}|2\\d{4,5}|[3467]\\d{4}|8\\d{4,6}|9\\d{4,7})|5\\d{4,12}|8\\d{7,12}|9\\d{8,12}|(?:[367]\\d|4[0-24-9])\\d{4,11}",[4,5,6,7,8,9,10,11,12,13],[["(\\d)(\\d{3,12})","$1 $2",["1(?:11|[2-9])"],"0$1"],["(\\d{3})(\\d{2})","$1 $2",["517"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["5[079]"],"0$1"],["(\\d{3})(\\d{3,10})","$1 $2",["(?:31|4)6|51|6(?:5[0-3579]|[6-9])|7(?:20|32|8)|[89]"],"0$1"],["(\\d{4})(\\d{3,9})","$1 $2",["[2-467]|5[2-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["5"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,7})","$1 $2 $3",["5"],"0$1"]],"0"],AU:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{7}(?:\\d(?:\\d{2})?)?|8[0-24-9]\\d{7})|[2-478]\\d{8}|1\\d{4,7}",[5,6,7,8,9,10,12],[["(\\d{2})(\\d{3,4})","$1 $2",["16"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,4})","$1 $2 $3",["16"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["14|4"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[2378]"],"(0$1)"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:30|[89])"]]],"0",0,"(183[12])|0",0,0,0,[["(?:(?:2(?:[0-26-9]\\d|3[0-8]|4[02-9]|5[0135-9])|3(?:[0-3589]\\d|4[0-578]|6[1-9]|7[0-35-9])|7(?:[013-57-9]\\d|2[0-8]))\\d{3}|8(?:51(?:0(?:0[03-9]|[12479]\\d|3[2-9]|5[0-8]|6[1-9]|8[0-7])|1(?:[0235689]\\d|1[0-69]|4[0-589]|7[0-47-9])|2(?:0[0-79]|[18][13579]|2[14-9]|3[0-46-9]|[4-6]\\d|7[89]|9[0-4]))|(?:6[0-8]|[78]\\d)\\d{3}|9(?:[02-9]\\d{3}|1(?:(?:[0-58]\\d|6[0135-9])\\d|7(?:0[0-24-9]|[1-9]\\d)|9(?:[0-46-9]\\d|5[0-79])))))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[016-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,["163\\d{2,6}",[5,6,7,8,9]],["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],AW:["297","00","(?:[25-79]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[25-9]"]]]],AX:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","2\\d{4,9}|35\\d{4,5}|(?:60\\d\\d|800)\\d{4,6}|7\\d{5,11}|(?:[14]\\d|3[0-46-9]|50)\\d{4,8}",[5,6,7,8,9,10,11,12],0,"0",0,0,0,0,"18",0,"00"],AZ:["994","00","365\\d{6}|(?:[124579]\\d|60|88)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[28]|2|365|46","1[28]|2|365[45]|46","1[28]|2|365(?:4|5[02])|46"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[13-9]"],"0$1"]],"0"],BA:["387","00","6\\d{8}|(?:[35689]\\d|49|70)\\d{6}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["6[1-3]|[7-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2-$3",["[3-5]|6[56]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["6"],"0$1"]],"0"],BB:["1","011","(?:246|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","246$1",0,"246"],BD:["880","00","[1-469]\\d{9}|8[0-79]\\d{7,8}|[2-79]\\d{8}|[2-9]\\d{7}|[3-9]\\d{6}|[57-9]\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{4,6})","$1-$2",["31[5-8]|[459]1"],"0$1"],["(\\d{3})(\\d{3,7})","$1-$2",["3(?:[67]|8[013-9])|4(?:6[168]|7|[89][18])|5(?:6[128]|9)|6(?:[15]|28|4[14])|7[2-589]|8(?:0[014-9]|[12])|9[358]|(?:3[2-5]|4[235]|5[2-578]|6[0389]|76|8[3-7]|9[24])1|(?:44|66)[01346-9]"],"0$1"],["(\\d{4})(\\d{3,6})","$1-$2",["[13-9]|22"],"0$1"],["(\\d)(\\d{7,8})","$1-$2",["2"],"0$1"]],"0"],BE:["32","00","4\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:80|9)0"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[239]|4[23]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[15-8]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4"],"0$1"]],"0"],BF:["226","00","[025-7]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[025-7]"]]]],BG:["359","00","00800\\d{7}|[2-7]\\d{6,7}|[89]\\d{6,8}|2\\d{5}",[6,7,8,9,12],[["(\\d)(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["43[1-6]|70[1-9]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[356]|4[124-7]|7[1-9]|8[1-6]|9[1-7]"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["(?:70|8)0"],"0$1"],["(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3",["43[1-7]|7"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[48]|9[08]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"]],"0"],BH:["973","00","[136-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[13679]|8[02-4679]"]]]],BI:["257","00","(?:[267]\\d|31)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2367]"]]]],BJ:["229","00","[24-689]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-689]"]]]],BL:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:2[7-9]|3[3-7]|5[12]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:395|76[018])\\d|475[0-5])\\d{4}"]]],BM:["1","011","(?:441|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","441$1",0,"441"],BN:["673","00","[2-578]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-578]"]]]],BO:["591","00(?:1\\d)?","(?:[2-467]\\d\\d|8001)\\d{5}",[8,9],[["(\\d)(\\d{7})","$1 $2",["[23]|4[46]"]],["(\\d{8})","$1",["[67]"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["8"]]],"0",0,"0(1\\d)?"],BQ:["599","00","(?:[34]1|7\\d)\\d{5}",[7],0,0,0,0,0,0,"[347]"],BR:["55","00(?:1[245]|2[1-35]|31|4[13]|[56]5|99)","(?:[1-46-9]\\d\\d|5(?:[0-46-9]\\d|5[0-46-9]))\\d{8}|[1-9]\\d{9}|[3589]\\d{8}|[34]\\d{7}",[8,9,10,11],[["(\\d{4})(\\d{4})","$1-$2",["300|4(?:0[02]|37)","4(?:02|37)0|[34]00"]],["(\\d{3})(\\d{2,3})(\\d{4})","$1 $2 $3",["(?:[358]|90)0"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2-$3",["(?:[14689][1-9]|2[12478]|3[1-578]|5[13-5]|7[13-579])[2-57]"],"($1)"],["(\\d{2})(\\d{5})(\\d{4})","$1 $2-$3",["[16][1-9]|[2-57-9]"],"($1)"]],"0",0,"(?:0|90)(?:(1[245]|2[1-35]|31|4[13]|[56]5|99)(\\d{10,11}))?","$2"],BS:["1","011","(?:242|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([3-8]\\d{6})$|1","242$1",0,"242"],BT:["975","00","[17]\\d{7}|[2-8]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[2-68]|7[246]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[67]|7"]]]],BW:["267","00","(?:0800|(?:[37]|800)\\d)\\d{6}|(?:[2-6]\\d|90)\\d{5}",[7,8,10],[["(\\d{2})(\\d{5})","$1 $2",["90"]],["(\\d{3})(\\d{4})","$1 $2",["[24-6]|3[15-9]"]],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37]"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["8"]]]],BY:["375","810","(?:[12]\\d|33|44|902)\\d{7}|8(?:0[0-79]\\d{5,7}|[1-7]\\d{9})|8(?:1[0-489]|[5-79]\\d)\\d{7}|8[1-79]\\d{6,7}|8[0-79]\\d{5}|8\\d{5}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3})","$1 $2",["800"],"8 $1"],["(\\d{3})(\\d{2})(\\d{2,4})","$1 $2 $3",["800"],"8 $1"],["(\\d{4})(\\d{2})(\\d{3})","$1 $2-$3",["1(?:5[169]|6[3-5]|7[179])|2(?:1[35]|2[34]|3[3-5])","1(?:5[169]|6(?:3[1-3]|4|5[125])|7(?:1[3-9]|7[0-24-6]|9[2-7]))|2(?:1[35]|2[34]|3[3-5])"],"8 0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["1(?:[56]|7[467])|2[1-3]"],"8 0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-4]"],"8 0$1"],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["[89]"],"8 $1"]],"8",0,"0|80?",0,0,0,0,"8~10"],BZ:["501","00","(?:0800\\d|[2-8])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1-$2",["[2-8]"]],["(\\d)(\\d{3})(\\d{4})(\\d{3})","$1-$2-$3-$4",["0"]]]],CA:["1","011","(?:[2-8]\\d|90)\\d{8}|3\\d{6}",[7,10],0,"1",0,0,0,0,0,[["(?:2(?:04|[23]6|[48]9|50|63)|3(?:06|43|54|6[578]|82)|4(?:03|1[68]|[26]8|3[178]|50|74)|5(?:06|1[49]|48|79|8[147])|6(?:04|[18]3|39|47|72)|7(?:0[59]|42|53|78|8[02])|8(?:[06]7|19|25|73)|90[25])[2-9]\\d{6}",[10]],["",[10]],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}",[10]],["900[2-9]\\d{6}",[10]],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|(?:5(?:00|2[125-9]|33|44|66|77|88)|622)[2-9]\\d{6}",[10]],0,["310\\d{4}",[7]],0,["600[2-9]\\d{6}",[10]]]],CC:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:02|31|60|89)|1(?:18|76)|223)|91(?:0(?:1[0-2]|29)|1(?:[28]2|50|79)|2(?:10|64)|3(?:[06]8|22)|4[29]8|62\\d|70[23]|959))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[016-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CD:["243","00","[189]\\d{8}|[1-68]\\d{6}",[7,9],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[1-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]"],"0$1"]],"0"],CF:["236","00","(?:[27]\\d{3}|8776)\\d{4}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[278]"]]]],CG:["242","00","222\\d{6}|(?:0\\d|80)\\d{7}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[02]"]]]],CH:["41","00","8\\d{11}|[2-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8[047]|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]|81"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["8"],"0$1"]],"0"],CI:["225","00","[02]\\d{9}",[10],[["(\\d{2})(\\d{2})(\\d)(\\d{5})","$1 $2 $3 $4",["2"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3 $4",["0"]]]],CK:["682","00","[2-578]\\d{4}",[5],[["(\\d{2})(\\d{3})","$1 $2",["[2-578]"]]]],CL:["56","(?:0|1(?:1[0-69]|2[02-5]|5[13-58]|69|7[0167]|8[018]))0","12300\\d{6}|6\\d{9,10}|[2-9]\\d{8}",[9,10,11],[["(\\d{5})(\\d{4})","$1 $2",["219","2196"],"($1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["44"]],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2[1-36]"],"($1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["9[2-9]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["3[2-5]|[47]|5[1-3578]|6[13-57]|8(?:0[1-9]|[1-9])"],"($1)"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["60|8"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{3})(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3 $4",["60"]]]],CM:["237","00","[26]\\d{8}|88\\d{6,7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["88"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[26]|88"]]]],CN:["86","00|1(?:[12]\\d|79)\\d\\d00","1[127]\\d{8,9}|2\\d{9}(?:\\d{2})?|[12]\\d{6,7}|86\\d{6}|(?:1[03-689]\\d|6)\\d{7,9}|(?:[3-579]\\d|8[0-57-9])\\d{6,9}",[7,8,9,10,11,12],[["(\\d{2})(\\d{5,6})","$1 $2",["(?:10|2[0-57-9])[19]","(?:10|2[0-57-9])(?:10|9[56])","10(?:10|9[56])|2[0-57-9](?:100|9[56])"],"0$1"],["(\\d{3})(\\d{5,6})","$1 $2",["3(?:[157]|35|49|9[1-68])|4(?:[17]|2[179]|6[47-9]|8[23])|5(?:[1357]|2[37]|4[36]|6[1-46]|80)|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]|4[13]|5[1-5])|(?:4[35]|59|85)[1-9]","(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[1-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))[19]","85[23](?:10|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:10|9[56])","85[23](?:100|95)|(?:3(?:[157]\\d|35|49|9[1-68])|4(?:[17]\\d|2[179]|[35][1-9]|6[47-9]|8[23])|5(?:[1357]\\d|2[37]|4[36]|6[1-46]|80|9[1-9])|6(?:3[1-5]|6[0238]|9[12])|7(?:01|[1579]\\d|2[248]|3[014-9]|4[3-6]|6[023689])|8(?:1[236-8]|2[5-7]|[37]\\d|5[14-9]|8[36-8]|9[1-8])|9(?:0[1-3689]|1[1-79]|[379]\\d|4[13]|5[1-5]))(?:100|9[56])"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["(?:4|80)0"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|2(?:[02-57-9]|1[1-9])","10|2(?:[02-57-9]|1[1-9])","10[0-79]|2(?:[02-57-9]|1[1-79])|(?:10|21)8(?:0[1-9]|[1-9])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["3(?:[3-59]|7[02-68])|4(?:[26-8]|3[3-9]|5[2-9])|5(?:3[03-9]|[468]|7[028]|9[2-46-9])|6|7(?:[0-247]|3[04-9]|5[0-4689]|6[2368])|8(?:[1-358]|9[1-7])|9(?:[013479]|5[1-5])|(?:[34]1|55|79|87)[02-9]"],"0$1",1],["(\\d{3})(\\d{7,8})","$1 $2",["9"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["80"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[3-578]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["1[3-9]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["[12]"],"0$1",1]],"0",0,"(1(?:[12]\\d|79)\\d\\d)|0",0,0,0,0,"00"],CO:["57","00(?:4(?:[14]4|56)|[579])","(?:60\\d\\d|9101)\\d{6}|(?:1\\d|3)\\d{9}",[10,11],[["(\\d{3})(\\d{7})","$1 $2",["6"],"($1)"],["(\\d{3})(\\d{7})","$1 $2",["3[0-357]|91"]],["(\\d)(\\d{3})(\\d{7})","$1-$2-$3",["1"],"0$1",0,"$1 $2 $3"]],"0",0,"0(4(?:[14]4|56)|[579])?"],CR:["506","00","(?:8\\d|90)\\d{8}|(?:[24-8]\\d{3}|3005)\\d{4}",[8,10],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[3-9]"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["[89]"]]],0,0,"(19(?:0[0-2468]|1[09]|20|66|77|99))"],CU:["53","119","[27]\\d{6,7}|[34]\\d{5,7}|63\\d{6}|(?:5|8\\d\\d)\\d{7}",[6,7,8,10],[["(\\d{2})(\\d{4,6})","$1 $2",["2[1-4]|[34]"],"(0$1)"],["(\\d)(\\d{6,7})","$1 $2",["7"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["[56]"],"0$1"],["(\\d{3})(\\d{7})","$1 $2",["8"],"0$1"]],"0"],CV:["238","0","(?:[2-59]\\d\\d|800)\\d{4}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2-589]"]]]],CW:["599","00","(?:[34]1|60|(?:7|9\\d)\\d)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[3467]"]],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["9[4-8]"]]],0,0,0,0,0,"[69]"],CX:["61","001[14-689]|14(?:1[14]|34|4[17]|[56]6|7[47]|88)0011","1(?:[0-79]\\d{8}(?:\\d{2})?|8[0-24-9]\\d{7})|[148]\\d{8}|1\\d{5,7}",[6,7,8,9,10,12],0,"0",0,"([59]\\d{7})$|0","8$1",0,0,[["8(?:51(?:0(?:01|30|59|88)|1(?:17|46|75)|2(?:22|35))|91(?:00[6-9]|1(?:[28]1|49|78)|2(?:09|63)|3(?:12|26|75)|4(?:56|97)|64\\d|7(?:0[01]|1[0-2])|958))\\d{3}",[9]],["4(?:(?:79|94)[01]|83[0-389])\\d{5}|4(?:[0-3]\\d|4[047-9]|5[0-25-9]|6[016-9]|7[02-8]|8[0-24-9]|9[0-37-9])\\d{6}",[9]],["180(?:0\\d{3}|2)\\d{3}",[7,10]],["190[0-26]\\d{6}",[10]],0,0,0,0,["14(?:5(?:1[0458]|[23][458])|71\\d)\\d{4}",[9]],["13(?:00\\d{6}(?:\\d{2})?|45[0-4]\\d{3})|13\\d{4}",[6,8,10,12]]],"0011"],CY:["357","00","(?:[279]\\d|[58]0)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[257-9]"]]]],CZ:["420","00","(?:[2-578]\\d|60)\\d{7}|9\\d{8,11}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]|9[015-7]"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{2})","$1 $2 $3 $4",["96"]],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]]],DE:["49","00","[2579]\\d{5,14}|49(?:[34]0|69|8\\d)\\d\\d?|49(?:37|49|60|7[089]|9\\d)\\d{1,3}|49(?:2[024-9]|3[2-689]|7[1-7])\\d{1,8}|(?:1|[368]\\d|4[0-8])\\d{3,13}|49(?:[015]\\d|2[13]|31|[46][1-8])\\d{1,9}",[4,5,6,7,8,9,10,11,12,13,14,15],[["(\\d{2})(\\d{3,13})","$1 $2",["3[02]|40|[68]9"],"0$1"],["(\\d{3})(\\d{3,12})","$1 $2",["2(?:0[1-389]|1[124]|2[18]|3[14])|3(?:[35-9][15]|4[015])|906|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1","2(?:0[1-389]|12[0-8])|3(?:[35-9][15]|4[015])|906|2(?:[13][14]|2[18])|(?:2[4-9]|4[2-9]|[579][1-9]|[68][1-8])1"],"0$1"],["(\\d{4})(\\d{2,11})","$1 $2",["[24-6]|3(?:[3569][02-46-9]|4[2-4679]|7[2-467]|8[2-46-8])|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]","[24-6]|3(?:3(?:0[1-467]|2[127-9]|3[124578]|7[1257-9]|8[1256]|9[145])|4(?:2[135]|4[13578]|9[1346])|5(?:0[14]|2[1-3589]|6[1-4]|7[13468]|8[13568])|6(?:2[1-489]|3[124-6]|6[13]|7[12579]|8[1-356]|9[135])|7(?:2[1-7]|4[145]|6[1-5]|7[1-4])|8(?:21|3[1468]|6|7[1467]|8[136])|9(?:0[12479]|2[1358]|4[134679]|6[1-9]|7[136]|8[147]|9[1468]))|70[2-8]|8(?:0[2-9]|[1-8])|90[7-9]|[79][1-9]|3[68]4[1347]|3(?:47|60)[1356]|3(?:3[46]|46|5[49])[1246]|3[4579]3[1357]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["138"],"0$1"],["(\\d{5})(\\d{2,10})","$1 $2",["3"],"0$1"],["(\\d{3})(\\d{5,11})","$1 $2",["181"],"0$1"],["(\\d{3})(\\d)(\\d{4,10})","$1 $2 $3",["1(?:3|80)|9"],"0$1"],["(\\d{3})(\\d{7,8})","$1 $2",["1[67]"],"0$1"],["(\\d{3})(\\d{7,12})","$1 $2",["8"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["185","1850","18500"],"0$1"],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["18[68]"],"0$1"],["(\\d{5})(\\d{6})","$1 $2",["15[0568]"],"0$1"],["(\\d{4})(\\d{7})","$1 $2",["15[1279]"],"0$1"],["(\\d{3})(\\d{8})","$1 $2",["18"],"0$1"],["(\\d{3})(\\d{2})(\\d{7,8})","$1 $2 $3",["1(?:6[023]|7)"],"0$1"],["(\\d{4})(\\d{2})(\\d{7})","$1 $2 $3",["15[279]"],"0$1"],["(\\d{3})(\\d{2})(\\d{8})","$1 $2 $3",["15"],"0$1"]],"0"],DJ:["253","00","(?:2\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[27]"]]]],DK:["45","00","[2-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-9]"]]]],DM:["1","011","(?:[58]\\d\\d|767|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","767$1",0,"767"],DO:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,0,0,0,"8001|8[024]9"],DZ:["213","00","(?:[1-4]|[5-79]\\d|80)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["9"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-8]"],"0$1"]],"0"],EC:["593","00","1\\d{9,10}|(?:[2-7]|9\\d)\\d{7}",[8,9,10,11],[["(\\d)(\\d{3})(\\d{4})","$1 $2-$3",["[2-7]"],"(0$1)",0,"$1-$2-$3"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{3})(\\d{3,4})","$1 $2 $3",["1"]]],"0"],EE:["372","00","8\\d{9}|[4578]\\d{7}|(?:[3-8]\\d|90)\\d{5}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[369]|4[3-8]|5(?:[0-2]|5[0-478]|6[45])|7[1-9]|88","[369]|4[3-8]|5(?:[02]|1(?:[0-8]|95)|5[0-478]|6(?:4[0-4]|5[1-589]))|7[1-9]|88"]],["(\\d{4})(\\d{3,4})","$1 $2",["[45]|8(?:00|[1-49])","[45]|8(?:00[1-9]|[1-49])"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],EG:["20","00","[189]\\d{8,9}|[24-6]\\d{8}|[135]\\d{7}",[8,9,10],[["(\\d)(\\d{7,8})","$1 $2",["[23]"],"0$1"],["(\\d{2})(\\d{6,7})","$1 $2",["1[35]|[4-6]|8[2468]|9[235-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{8})","$1 $2",["1"],"0$1"]],"0"],EH:["212","00","[5-8]\\d{8}",[9],0,"0",0,0,0,0,"528[89]"],ER:["291","00","[178]\\d{6}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[178]"],"0$1"]],"0"],ES:["34","00","[5-9]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[89]00"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-9]"]]]],ET:["251","00","(?:11|[2-579]\\d)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-579]"],"0$1"]],"0"],FI:["358","00|99(?:[01469]|5(?:[14]1|3[23]|5[59]|77|88|9[09]))","[1-35689]\\d{4}|7\\d{10,11}|(?:[124-7]\\d|3[0-46-9])\\d{8}|[1-9]\\d{5,8}",[5,6,7,8,9,10,11,12],[["(\\d)(\\d{4,9})","$1 $2",["[2568][1-8]|3(?:0[1-9]|[1-9])|9"],"0$1"],["(\\d{3})(\\d{3,7})","$1 $2",["[12]00|[368]|70[07-9]"],"0$1"],["(\\d{2})(\\d{4,8})","$1 $2",["[1245]|7[135]"],"0$1"],["(\\d{2})(\\d{6,10})","$1 $2",["7"],"0$1"]],"0",0,0,0,0,"1[03-79]|[2-9]",0,"00"],FJ:["679","0(?:0|52)","45\\d{5}|(?:0800\\d|[235-9])\\d{6}",[7,11],[["(\\d{3})(\\d{4})","$1 $2",["[235-9]|45"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]]],0,0,0,0,0,0,0,"00"],FK:["500","00","[2-7]\\d{4}",[5]],FM:["691","00","(?:[39]\\d\\d|820)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[389]"]]]],FO:["298","00","[2-9]\\d{5}",[6],[["(\\d{6})","$1",["[2-9]"]]],0,0,"(10(?:01|[12]0|88))"],FR:["33","00","[1-9]\\d{8}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0 $1"],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["[1-79]"],"0$1"]],"0"],GA:["241","00","(?:[067]\\d|11)\\d{6}|[2-7]\\d{6}",[7,8],[["(\\d)(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-7]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["11|[67]"],"0$1"]],0,0,"0(11\\d{6}|60\\d{6}|61\\d{6}|6[256]\\d{6}|7[467]\\d{6})","$1"],GB:["44","00","[1-357-9]\\d{9}|[18]\\d{8}|8\\d{6}",[7,9,10],[["(\\d{3})(\\d{4})","$1 $2",["800","8001","80011","800111","8001111"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["845","8454","84546","845464"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["800"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["1(?:38|5[23]|69|76|94)","1(?:(?:38|69)7|5(?:24|39)|768|946)","1(?:3873|5(?:242|39[4-6])|(?:697|768)[347]|9467)"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["1(?:[2-69][02-9]|[78])"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[25]|7(?:0|6[02-9])","[25]|7(?:0|6(?:[03-9]|2[356]))"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[1389]"],"0$1"]],"0",0,0,0,0,0,[["(?:1(?:1(?:3(?:[0-58]\\d\\d|73[0235])|4(?:[0-5]\\d\\d|69[7-9]|70[0-79])|(?:(?:5[0-26-9]|[78][0-49])\\d|6(?:[0-4]\\d|50))\\d)|(?:2(?:(?:0[024-9]|2[3-9]|3[3-79]|4[1-689]|[58][02-9]|6[0-47-9]|7[013-9]|9\\d)\\d|1(?:[0-7]\\d|8[0-2]))|(?:3(?:0\\d|1[0-8]|[25][02-9]|3[02-579]|[468][0-46-9]|7[1-35-79]|9[2-578])|4(?:0[03-9]|[137]\\d|[28][02-57-9]|4[02-69]|5[0-8]|[69][0-79])|5(?:0[1-35-9]|[16]\\d|2[024-9]|3[015689]|4[02-9]|5[03-9]|7[0-35-9]|8[0-468]|9[0-57-9])|6(?:0[034689]|1\\d|2[0-35689]|[38][013-9]|4[1-467]|5[0-69]|6[13-9]|7[0-8]|9[0-24578])|7(?:0[0246-9]|2\\d|3[0236-8]|4[03-9]|5[0-46-9]|6[013-9]|7[0-35-9]|8[024-9]|9[02-9])|8(?:0[35-9]|2[1-57-9]|3[02-578]|4[0-578]|5[124-9]|6[2-69]|7\\d|8[02-9]|9[02569])|9(?:0[02-589]|[18]\\d|2[02-689]|3[1-57-9]|4[2-9]|5[0-579]|6[2-47-9]|7[0-24578]|9[2-57]))\\d)\\d)|2(?:0[013478]|3[0189]|4[017]|8[0-46-9]|9[0-2])\\d{3})\\d{4}|1(?:2(?:0(?:46[1-4]|87[2-9])|545[1-79]|76(?:2\\d|3[1-8]|6[1-6])|9(?:7(?:2[0-4]|3[2-5])|8(?:2[2-8]|7[0-47-9]|8[3-5])))|3(?:6(?:38[2-5]|47[23])|8(?:47[04-9]|64[0157-9]))|4(?:044[1-7]|20(?:2[23]|8\\d)|6(?:0(?:30|5[2-57]|6[1-8]|7[2-8])|140)|8(?:052|87[1-3]))|5(?:2(?:4(?:3[2-79]|6\\d)|76\\d)|6(?:26[06-9]|686))|6(?:06(?:4\\d|7[4-79])|295[5-7]|35[34]\\d|47(?:24|61)|59(?:5[08]|6[67]|74)|9(?:55[0-4]|77[23]))|7(?:26(?:6[13-9]|7[0-7])|(?:442|688)\\d|50(?:2[0-3]|[3-68]2|76))|8(?:27[56]\\d|37(?:5[2-5]|8[239])|843[2-58])|9(?:0(?:0(?:6[1-8]|85)|52\\d)|3583|4(?:66[1-8]|9(?:2[01]|81))|63(?:23|3[1-4])|9561))\\d{3}",[9,10]],["7(?:457[0-57-9]|700[01]|911[028])\\d{5}|7(?:[1-3]\\d\\d|4(?:[0-46-9]\\d|5[0-689])|5(?:0[0-8]|[13-9]\\d|2[0-35-9])|7(?:0[1-9]|[1-7]\\d|8[02-9]|9[0-689])|8(?:[014-9]\\d|[23][0-8])|9(?:[024-9]\\d|1[02-9]|3[0-689]))\\d{6}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[2-49]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]],0," x"],GD:["1","011","(?:473|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","473$1",0,"473"],GE:["995","00","(?:[3-57]\\d\\d|800)\\d{6}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["32"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[57]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[348]"],"0$1"]],"0"],GF:["594","00","[56]94\\d{6}|(?:80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[56]|9[47]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[89]"],"0$1"]],"0"],GG:["44","00","(?:1481|[357-9]\\d{3})\\d{6}|8\\d{6}(?:\\d{2})?",[7,9,10],0,"0",0,"([25-9]\\d{5})$|0","1481$1",0,0,[["1481[25-9]\\d{5}",[10]],["7(?:(?:781|839)\\d|911[17])\\d{5}",[10]],["80[08]\\d{7}|800\\d{6}|8001111"],["(?:8(?:4[2-5]|7[0-3])|9(?:[01]\\d|8[0-3]))\\d{7}|845464\\d",[7,10]],["70\\d{8}",[10]],0,["(?:3[0347]|55)\\d{8}",[10]],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}",[10]],["56\\d{8}",[10]]]],GH:["233","00","(?:[235]\\d{3}|800)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[235]"],"0$1"]],"0"],GI:["350","00","(?:[25]\\d|60)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["2"]]]],GL:["299","00","(?:19|[2-689]\\d|70)\\d{4}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["19|[2-9]"]]]],GM:["220","00","[2-9]\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],GN:["224","00","722\\d{6}|(?:3|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["3"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[67]"]]]],GP:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0",0,0,0,0,0,[["590(?:0[1-68]|[14][0-24-9]|2[0-68]|3[1-9]|5[3-579]|[68][0-689]|7[08]|9\\d)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:395|76[018])\\d|475[0-5])\\d{4}"]]],GQ:["240","00","222\\d{6}|(?:3\\d|55|[89]0)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235]"]],["(\\d{3})(\\d{6})","$1 $2",["[89]"]]]],GR:["30","00","5005000\\d{3}|8\\d{9,11}|(?:[269]\\d|70)\\d{8}",[10,11,12],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["21|7"]],["(\\d{4})(\\d{6})","$1 $2",["2(?:2|3[2-57-9]|4[2-469]|5[2-59]|6[2-9]|7[2-69]|8[2-49])|5"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2689]"]],["(\\d{3})(\\d{3,4})(\\d{5})","$1 $2 $3",["8"]]]],GT:["502","00","(?:1\\d{3}|[2-7])\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1 $2",["[2-7]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],GU:["1","011","(?:[58]\\d\\d|671|900)\\d{7}",[10],0,"1",0,"([3-9]\\d{6})$|1","671$1",0,"671"],GW:["245","00","[49]\\d{8}|4\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["40"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"]]]],GY:["592","001","9008\\d{3}|(?:[2-467]\\d\\d|510|862)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],HK:["852","00(?:30|5[09]|[126-9]?)","8[0-46-9]\\d{6,7}|9\\d{4,7}|(?:[2-7]|9\\d{3})\\d{7}",[5,6,7,8,9,11],[["(\\d{3})(\\d{2,5})","$1 $2",["900","9003"]],["(\\d{4})(\\d{4})","$1 $2",["[2-7]|8[1-4]|9(?:0[1-9]|[1-8])"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{3})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["9"]]],0,0,0,0,0,0,0,"00"],HN:["504","00","8\\d{10}|[237-9]\\d{7}",[8,11],[["(\\d{4})(\\d{4})","$1-$2",["[237-9]"]]]],HR:["385","00","(?:[24-69]\\d|3[0-79])\\d{7}|80\\d{5,7}|[1-79]\\d{7}|6\\d{5,6}",[6,7,8,9],[["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["6[01]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{4})(\\d{3})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-5]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"]],"0"],HT:["509","00","(?:[2-489]\\d|55)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[2-589]"]]]],HU:["36","00","[235-7]\\d{8}|[1-9]\\d{7}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27][2-9]|3[2-7]|4[24-9]|5[2-79]|6|8[2-57-9]|9[2-69]"],"(06 $1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"06 $1"]],"06"],ID:["62","00[89]","(?:(?:00[1-9]|8\\d)\\d{4}|[1-36])\\d{6}|00\\d{10}|[1-9]\\d{8,10}|[2-9]\\d{7}",[7,8,9,10,11,12,13],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["15"]],["(\\d{2})(\\d{5,9})","$1 $2",["2[124]|[36]1"],"(0$1)"],["(\\d{3})(\\d{5,7})","$1 $2",["800"],"0$1"],["(\\d{3})(\\d{5,8})","$1 $2",["[2-79]"],"(0$1)"],["(\\d{3})(\\d{3,4})(\\d{3})","$1-$2-$3",["8[1-35-9]"],"0$1"],["(\\d{3})(\\d{6,8})","$1 $2",["1"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["804"],"0$1"],["(\\d{3})(\\d)(\\d{3})(\\d{3})","$1 $2 $3 $4",["80"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1-$2-$3",["8"],"0$1"]],"0"],IE:["353","00","(?:1\\d|[2569])\\d{6,8}|4\\d{6,9}|7\\d{8}|8\\d{8,9}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["2[24-9]|47|58|6[237-9]|9[35-9]"],"(0$1)"],["(\\d{3})(\\d{5})","$1 $2",["[45]0"],"(0$1)"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["1"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2569]|4[1-69]|7[14]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["70"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["81"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[78]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["4"],"(0$1)"],["(\\d{2})(\\d)(\\d{3})(\\d{4})","$1 $2 $3 $4",["8"],"0$1"]],"0"],IL:["972","0(?:0|1[2-9])","1\\d{6}(?:\\d{3,5})?|[57]\\d{8}|[1-489]\\d{7}",[7,8,9,10,11,12],[["(\\d{4})(\\d{3})","$1-$2",["125"]],["(\\d{4})(\\d{2})(\\d{2})","$1-$2-$3",["121"]],["(\\d)(\\d{3})(\\d{4})","$1-$2-$3",["[2-489]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1-$2-$3",["12"]],["(\\d{4})(\\d{6})","$1-$2",["159"]],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3-$4",["1[7-9]"]],["(\\d{3})(\\d{1,2})(\\d{3})(\\d{4})","$1-$2 $3-$4",["15"]]],"0"],IM:["44","00","1624\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([25-8]\\d{5})$|0","1624$1",0,"74576|(?:16|7[56])24"],IN:["91","00","(?:000800|[2-9]\\d\\d)\\d{7}|1\\d{7,12}",[8,9,10,11,12,13],[["(\\d{8})","$1",["5(?:0|2[23]|3[03]|[67]1|88)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|888)","5(?:0|2(?:21|3)|3(?:0|3[23])|616|717|8888)"],0,1],["(\\d{4})(\\d{4,5})","$1 $2",["180","1800"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["140"],0,1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["11|2[02]|33|4[04]|79[1-7]|80[2-46]","11|2[02]|33|4[04]|79(?:[1-6]|7[19])|80(?:[2-4]|6[0-589])","11|2[02]|33|4[04]|79(?:[124-6]|3(?:[02-9]|1[0-24-9])|7(?:1|9[1-6]))|80(?:[2-4]|6[0-589])"],"0$1",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1(?:2[0-249]|3[0-25]|4[145]|[68]|7[1257])|2(?:1[257]|3[013]|4[01]|5[0137]|6[0158]|78|8[1568])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|5[12]|[78]1)|6(?:12|[2-4]1|5[17]|6[13]|80)|7(?:12|3[134]|4[47]|61|88)|8(?:16|2[014]|3[126]|6[136]|7[078]|8[34]|91)|(?:43|59|75)[15]|(?:1[59]|29|67|72)[14]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|674|7(?:(?:2[14]|3[34]|5[15])[2-6]|61[346]|88[0-8])|8(?:70[2-6]|84[235-7]|91[3-7])|(?:1(?:29|60|8[06])|261|552|6(?:12|[2-47]1|5[17]|6[13]|80)|7(?:12|31|4[47])|8(?:16|2[014]|3[126]|6[136]|7[78]|83))[2-7]","1(?:2[0-24]|3[0-25]|4[145]|[59][14]|6[1-9]|7[1257]|8[1-57-9])|2(?:1[257]|3[013]|4[01]|5[0137]|6[058]|78|8[1568]|9[14])|3(?:26|4[1-3]|5[34]|6[01489]|7[02-46]|8[159])|4(?:1[36]|2[1-47]|3[15]|5[12]|6[0-26-9]|7[0-24-9]|8[013-57]|9[014-7])|5(?:1[025]|22|[36][25]|4[28]|[578]1|9[15])|6(?:12(?:[2-6]|7[0-8])|74[2-7])|7(?:(?:2[14]|5[15])[2-6]|3171|61[346]|88(?:[2-7]|82))|8(?:70[2-6]|84(?:[2356]|7[19])|91(?:[3-6]|7[19]))|73[134][2-6]|(?:74[47]|8(?:16|2[014]|3[126]|6[136]|7[78]|83))(?:[2-6]|7[19])|(?:1(?:29|60|8[06])|261|552|6(?:[2-4]1|5[17]|6[13]|7(?:1|4[0189])|80)|7(?:12|88[01]))[2-7]"],"0$1",1],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2[2457-9]|3[2-5]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1[013-9]|28|3[129]|4[1-35689]|5[29]|6[02-5]|70)|807","1(?:[2-479]|5[0235-9])|[2-5]|6(?:1[1358]|2(?:[2457]|84|95)|3(?:[2-4]|55)|4[235-7]|5[2-689]|6[24578]|7[235689]|8[1-6])|7(?:1(?:[013-8]|9[6-9])|28[6-8]|3(?:17|2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4|5[0-367])|70[13-7])|807[19]","1(?:[2-479]|5(?:[0236-9]|5[013-9]))|[2-5]|6(?:2(?:84|95)|355|83)|73179|807(?:1|9[1-3])|(?:1552|6(?:1[1358]|2[2457]|3[2-4]|4[235-7]|5[2-689]|6[24578]|7[235689]|8[124-6])\\d|7(?:1(?:[013-8]\\d|9[6-9])|28[6-8]|3(?:2[0-49]|9[2-57])|4(?:1[2-4]|[29][0-7]|3[0-8]|[56]\\d|8[0-24-7])|5(?:2[1-3]|9[0-6])|6(?:0[5689]|2[5-9]|3[02-8]|4\\d|5[0-367])|70[13-7]))[2-7]"],"0$1",1],["(\\d{5})(\\d{5})","$1 $2",["[6-9]"],"0$1",1],["(\\d{4})(\\d{2,4})(\\d{4})","$1 $2 $3",["1(?:6|8[06])","1(?:6|8[06]0)"],0,1],["(\\d{4})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["18"],0,1]],"0"],IO:["246","00","3\\d{6}",[7],[["(\\d{3})(\\d{4})","$1 $2",["3"]]]],IQ:["964","00","(?:1|7\\d\\d)\\d{7}|[2-6]\\d{7,8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-6]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],IR:["98","00","[1-9]\\d{9}|(?:[1-8]\\d\\d|9)\\d{3,4}",[4,5,6,7,10],[["(\\d{4,5})","$1",["96"],"0$1"],["(\\d{2})(\\d{4,5})","$1 $2",["(?:1[137]|2[13-68]|3[1458]|4[145]|5[1468]|6[16]|7[1467]|8[13467])[12689]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["9"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["[1-8]"],"0$1"]],"0"],IS:["354","00|1(?:0(?:01|[12]0)|100)","(?:38\\d|[4-9])\\d{6}",[7,9],[["(\\d{3})(\\d{4})","$1 $2",["[4-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["3"]]],0,0,0,0,0,0,0,"00"],IT:["39","00","0\\d{5,10}|1\\d{8,10}|3(?:[0-8]\\d{7,10}|9\\d{7,8})|(?:55|70)\\d{8}|8\\d{5}(?:\\d{2,4})?",[6,7,8,9,10,11],[["(\\d{2})(\\d{4,6})","$1 $2",["0[26]"]],["(\\d{3})(\\d{3,6})","$1 $2",["0[13-57-9][0159]|8(?:03|4[17]|9[2-5])","0[13-57-9][0159]|8(?:03|4[17]|9(?:2|3[04]|[45][0-4]))"]],["(\\d{4})(\\d{2,6})","$1 $2",["0(?:[13-579][2-46-8]|8[236-8])"]],["(\\d{4})(\\d{4})","$1 $2",["894"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[26]|5"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["1(?:44|[679])|[378]"]],["(\\d{3})(\\d{3,4})(\\d{4})","$1 $2 $3",["0[13-57-9][0159]|14"]],["(\\d{2})(\\d{4})(\\d{5})","$1 $2 $3",["0[26]"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["0"]],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["3"]]],0,0,0,0,0,0,[["0669[0-79]\\d{1,6}|0(?:1(?:[0159]\\d|[27][1-5]|31|4[1-4]|6[1356]|8[2-57])|2\\d\\d|3(?:[0159]\\d|2[1-4]|3[12]|[48][1-6]|6[2-59]|7[1-7])|4(?:[0159]\\d|[23][1-9]|4[245]|6[1-5]|7[1-4]|81)|5(?:[0159]\\d|2[1-5]|3[2-6]|4[1-79]|6[4-6]|7[1-578]|8[3-8])|6(?:[0-57-9]\\d|6[0-8])|7(?:[0159]\\d|2[12]|3[1-7]|4[2-46]|6[13569]|7[13-6]|8[1-59])|8(?:[0159]\\d|2[3-578]|3[1-356]|[6-8][1-5])|9(?:[0159]\\d|[238][1-5]|4[12]|6[1-8]|7[1-6]))\\d{2,7}"],["3[1-9]\\d{8}|3[2-9]\\d{7}",[9,10]],["80(?:0\\d{3}|3)\\d{3}",[6,9]],["(?:0878\\d{3}|89(?:2\\d|3[04]|4(?:[0-4]|[5-9]\\d\\d)|5[0-4]))\\d\\d|(?:1(?:44|6[346])|89(?:38|5[5-9]|9))\\d{6}",[6,8,9,10]],["1(?:78\\d|99)\\d{6}",[9,10]],0,0,0,["55\\d{8}",[10]],["84(?:[08]\\d{3}|[17])\\d{3}",[6,9]]]],JE:["44","00","1534\\d{6}|(?:[3578]\\d|90)\\d{8}",[10],0,"0",0,"([0-24-8]\\d{5})$|0","1534$1",0,0,[["1534[0-24-8]\\d{5}"],["7(?:(?:(?:50|82)9|937)\\d|7(?:00[378]|97[7-9]))\\d{5}"],["80(?:07(?:35|81)|8901)\\d{4}"],["(?:8(?:4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|90(?:066[59]|1810|71(?:07|55)))\\d{4}"],["701511\\d{4}"],0,["(?:3(?:0(?:07(?:35|81)|8901)|3\\d{4}|4(?:4(?:4(?:05|42|69)|703)|5(?:041|800))|7(?:0002|1206))|55\\d{4})\\d{4}"],["76(?:464|652)\\d{5}|76(?:0[0-28]|2[356]|34|4[01347]|5[49]|6[0-369]|77|8[14]|9[139])\\d{6}"],["56\\d{8}"]]],JM:["1","011","(?:[58]\\d\\d|658|900)\\d{7}",[10],0,"1",0,0,0,0,"658|876"],JO:["962","00","(?:(?:[2689]|7\\d)\\d|32|53)\\d{6}",[8,9],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2356]|87"],"(0$1)"],["(\\d{3})(\\d{5,6})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["70"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["7"],"0$1"]],"0"],JP:["81","010","00[1-9]\\d{6,14}|[257-9]\\d{9}|(?:00|[1-9]\\d\\d)\\d{6}",[8,9,10,11,12,13,14,15,16,17],[["(\\d{3})(\\d{3})(\\d{3})","$1-$2-$3",["(?:12|57|99)0"],"0$1"],["(\\d{4})(\\d)(\\d{4})","$1-$2-$3",["1(?:26|3[79]|4[56]|5[4-68]|6[3-5])|499|5(?:76|97)|746|8(?:3[89]|47|51)|9(?:80|9[16])","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:76|97)9|7468|8(?:3(?:8[7-9]|96)|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]","1(?:267|3(?:7[247]|9[278])|466|5(?:47|58|64)|6(?:3[245]|48|5[4-68]))|499[2468]|5(?:769|979[2-69])|7468|8(?:3(?:8[7-9]|96[2457-9])|477|51[2-9])|9(?:802|9(?:1[23]|69))|1(?:45|58)[67]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2-$3",["[36]|4(?:2[09]|7[01])","[36]|4(?:2(?:0|9[02-69])|7(?:0[019]|1))"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["1(?:1|5[45]|77|88|9[69])|2(?:2[1-37]|3[0-269]|4[59]|5|6[24]|7[1-358]|8[1369]|9[0-38])|4(?:[28][1-9]|3[0-57]|[45]|6[248]|7[2-579]|9[29])|5(?:2|3[0459]|4[0-369]|5[29]|8[02389]|9[0-389])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9[2-6])|8(?:2[124589]|3[26-9]|49|51|6|7[0-468]|8[68]|9[019])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9[1-489])","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2(?:[127]|3[014-9])|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9[19])|62|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|8[1-9]|9[29])|5(?:2|3(?:[045]|9[0-8])|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0-2469])|3(?:[29]|60)|49|51|6(?:[0-24]|36|5[0-3589]|7[23]|9[01459])|7[0-468]|8[68])|9(?:[23][1-9]|4[15]|5[138]|6[1-3]|7[156]|8[189]|9(?:[1289]|3[34]|4[0178]))|(?:264|837)[016-9]|2(?:57|93)[015-9]|(?:25[0468]|422|838)[01]|(?:47[59]|59[89]|8(?:6[68]|9))[019]","1(?:1|5(?:4[018]|5[017])|77|88|9[69])|2(?:2[127]|3[0-269]|4[59]|5(?:[1-3]|5[0-69]|9(?:17|99))|6(?:2|4[016-9])|7(?:[1-35]|8[0189])|8(?:[16]|3[0134]|9[0-5])|9(?:[028]|17))|4(?:2(?:[13-79]|8[014-6])|3[0-57]|[45]|6[248]|7[2-47]|9[29])|5(?:2|3(?:[045]|9(?:[0-58]|6[4-9]|7[0-35689]))|4[0-369]|5[29]|8[02389]|9[0-3])|7(?:2[02-46-9]|34|[58]|6[0249]|7[57]|9(?:[23]|4[0-59]|5[01569]|6[0167]))|8(?:2(?:[1258]|4[0-39]|9[0169])|3(?:[29]|60|7(?:[017-9]|6[6-8]))|49|51|6(?:[0-24]|36[2-57-9]|5(?:[0-389]|5[23])|6(?:[01]|9[178])|7(?:2[2-468]|3[78])|9[0145])|7[0-468]|8[68])|9(?:4[15]|5[138]|7[156]|8[189]|9(?:[1289]|3(?:31|4[357])|4[0178]))|(?:8294|96)[1-3]|2(?:57|93)[015-9]|(?:223|8699)[014-9]|(?:25[0468]|422|838)[01]|(?:48|8292|9[23])[1-9]|(?:47[59]|59[89]|8(?:68|9))[019]"],"0$1"],["(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3",["[14]|[289][2-9]|5[3-9]|7[2-4679]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1-$2-$3",["800"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[257-9]"],"0$1"]],"0",0,"(000[259]\\d{6})$|(?:(?:003768)0?)|0","$1"],KE:["254","000","(?:[17]\\d\\d|900)\\d{6}|(?:2|80)0\\d{6,7}|[4-6]\\d{6,8}",[7,8,9,10],[["(\\d{2})(\\d{5,7})","$1 $2",["[24-6]"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[17]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0"],KG:["996","00","8\\d{9}|[235-9]\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["3(?:1[346]|[24-79])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[235-79]|88"],"0$1"],["(\\d{3})(\\d{3})(\\d)(\\d{2,3})","$1 $2 $3 $4",["8"],"0$1"]],"0"],KH:["855","00[14-9]","1\\d{9}|[1-9]\\d{7,8}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],KI:["686","00","(?:[37]\\d|6[0-79])\\d{6}|(?:[2-48]\\d|50)\\d{3}",[5,8],0,"0"],KM:["269","00","[3478]\\d{6}",[7],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[3478]"]]]],KN:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","869$1",0,"869"],KP:["850","00|99","85\\d{6}|(?:19\\d|[2-7])\\d{7}",[8,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2-7]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"]],"0"],KR:["82","00(?:[125689]|3(?:[46]5|91)|7(?:00|27|3|55|6[126]))","00[1-9]\\d{8,11}|(?:[12]|5\\d{3})\\d{7}|[13-6]\\d{9}|(?:[1-6]\\d|80)\\d{7}|[3-6]\\d{4,5}|(?:00|7)0\\d{8}",[5,6,8,9,10,11,12,13,14],[["(\\d{2})(\\d{3,4})","$1-$2",["(?:3[1-3]|[46][1-4]|5[1-5])1"],"0$1"],["(\\d{4})(\\d{4})","$1-$2",["1"]],["(\\d)(\\d{3,4})(\\d{4})","$1-$2-$3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1-$2-$3",["60|8"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1-$2-$3",["[1346]|5[1-5]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2-$3",["[57]"],"0$1"],["(\\d{2})(\\d{5})(\\d{4})","$1-$2-$3",["5"],"0$1"]],"0",0,"0(8(?:[1-46-8]|5\\d\\d))?"],KW:["965","00","18\\d{5}|(?:[2569]\\d|41)\\d{6}",[7,8],[["(\\d{4})(\\d{3,4})","$1 $2",["[169]|2(?:[235]|4[1-35-9])|52"]],["(\\d{3})(\\d{5})","$1 $2",["[245]"]]]],KY:["1","011","(?:345|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","345$1",0,"345"],KZ:["7","810","(?:33622|8\\d{8})\\d{5}|[78]\\d{9}",[10,14],0,"8",0,0,0,0,"33|7",0,"8~10"],LA:["856","00","[23]\\d{9}|3\\d{8}|(?:[235-8]\\d|41)\\d{6}",[8,9,10],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2[13]|3[14]|[4-8]"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["30[013-9]"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[23]"],"0$1"]],"0"],LB:["961","00","[27-9]\\d{7}|[13-9]\\d{6}",[7,8],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[13-69]|7(?:[2-57]|62|8[0-7]|9[04-9])|8[02-9]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[27-9]"]]],"0"],LC:["1","011","(?:[58]\\d\\d|758|900)\\d{7}",[10],0,"1",0,"([2-8]\\d{6})$|1","758$1",0,"758"],LI:["423","00","[68]\\d{8}|(?:[2378]\\d|90)\\d{5}",[7,9],[["(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3",["[2379]|8(?:0[09]|7)","[2379]|8(?:0(?:02|9)|7)"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["69"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]]],"0",0,"(1001)|0"],LK:["94","00","[1-9]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[1-689]"],"0$1"]],"0"],LR:["231","00","(?:[25]\\d|33|77|88)\\d{7}|(?:2\\d|[4-6])\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[4-6]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23578]"],"0$1"]],"0"],LS:["266","00","(?:[256]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2568]"]]]],LT:["370","00","(?:[3469]\\d|52|[78]0)\\d{6}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["52[0-7]"],"(8-$1)",1],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[7-9]"],"8 $1",1],["(\\d{2})(\\d{6})","$1 $2",["37|4(?:[15]|6[1-8])"],"(8-$1)",1],["(\\d{3})(\\d{5})","$1 $2",["[3-6]"],"(8-$1)",1]],"8",0,"[08]"],LU:["352","00","35[013-9]\\d{4,8}|6\\d{8}|35\\d{2,4}|(?:[2457-9]\\d|3[0-46-9])\\d{2,9}",[4,5,6,7,8,9,10,11],[["(\\d{2})(\\d{3})","$1 $2",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["2(?:0[2-689]|[2-9])|[3-57]|8(?:0[2-9]|[13-9])|9(?:0[89]|[2-579])"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["20[2-689]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4",["2(?:[0367]|4[3-8])"]],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["80[01]|90[015]"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3 $4",["20"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})(\\d{1,2})","$1 $2 $3 $4 $5",["2(?:[0367]|4[3-8])"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{1,5})","$1 $2 $3 $4",["[3-57]|8[13-9]|9(?:0[89]|[2-579])|(?:2|80)[2-9]"]]],0,0,"(15(?:0[06]|1[12]|[35]5|4[04]|6[26]|77|88|99)\\d)"],LV:["371","00","(?:[268]\\d|90)\\d{6}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[269]|8[01]"]]]],LY:["218","00","[2-9]\\d{8}",[9],[["(\\d{2})(\\d{7})","$1-$2",["[2-9]"],"0$1"]],"0"],MA:["212","00","[5-8]\\d{8}",[9],[["(\\d{5})(\\d{4})","$1-$2",["5(?:29|38)","5(?:29[1289]|389)","529(?:1[1-46-9]|2[013-8]|90)|5(?:298|389)[0-46-9]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5[45]"],"0$1"],["(\\d{4})(\\d{5})","$1-$2",["5(?:2[2-489]|3[5-9]|9)|892","5(?:2(?:[2-49]|8[235-9])|3[5-9]|9)|892"],"0$1"],["(\\d{2})(\\d{7})","$1-$2",["8"],"0$1"],["(\\d{3})(\\d{6})","$1-$2",["[5-7]"],"0$1"]],"0",0,0,0,0,0,[["5293[01]\\d{4}|5(?:2(?:[0-25-7]\\d|3[1-578]|4[02-46-8]|8[0235-7]|9[0-289])|3(?:[0-47]\\d|5[02-9]|6[02-8]|8[0189]|9[3-9])|(?:4[067]|5[03])\\d)\\d{5}"],["(?:6(?:[0-79]\\d|8[0-247-9])|7(?:[017]\\d|2[0-2]|6[0-8]|8[0-3]))\\d{6}"],["80\\d{7}"],["89\\d{7}"],0,0,0,0,["592(?:4[0-2]|93)\\d{4}"]]],MC:["377","00","(?:[3489]|6\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["4"],"0$1"],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[389]"]],["(\\d)(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4 $5",["6"],"0$1"]],"0"],MD:["373","00","(?:[235-7]\\d|[89]0)\\d{6}",[8],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["22|3"],"0$1"],["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["[25-7]"],"0$1"]],"0"],ME:["382","00","(?:20|[3-79]\\d)\\d{6}|80\\d{6,7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[2-9]"],"0$1"]],"0"],MF:["590","00","590\\d{6}|(?:69|80|9\\d)\\d{7}",[9],0,"0",0,0,0,0,0,[["590(?:0[079]|[14]3|[27][79]|3[03-7]|5[0-268]|87)\\d{4}"],["69(?:0\\d\\d|1(?:2[2-9]|3[0-5]))\\d{4}"],["80[0-5]\\d{6}"],0,0,0,0,0,["9(?:(?:395|76[018])\\d|475[0-5])\\d{4}"]]],MG:["261","00","[23]\\d{8}",[9],[["(\\d{2})(\\d{2})(\\d{3})(\\d{2})","$1 $2 $3 $4",["[23]"],"0$1"]],"0",0,"([24-9]\\d{6})$|0","20$1"],MH:["692","011","329\\d{4}|(?:[256]\\d|45)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1-$2",["[2-6]"]]],"1"],MK:["389","00","[2-578]\\d{7}",[8],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2|34[47]|4(?:[37]7|5[47]|64)"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[347]"],"0$1"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["[58]"],"0$1"]],"0"],ML:["223","00","[24-9]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24-9]"]]]],MM:["95","00","1\\d{5,7}|95\\d{6}|(?:[4-7]|9[0-46-9])\\d{6,8}|(?:2|8\\d)\\d{5,8}",[6,7,8,9,10],[["(\\d)(\\d{2})(\\d{3})","$1 $2 $3",["16|2"],"0$1"],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["[45]|6(?:0[23]|[1-689]|7[235-7])|7(?:[0-4]|5[2-7])|8[1-6]"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[4-7]|8[1-35]"],"0$1"],["(\\d)(\\d{3})(\\d{4,6})","$1 $2 $3",["9(?:2[0-4]|[35-9]|4[137-9])"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["92"],"0$1"],["(\\d)(\\d{5})(\\d{4})","$1 $2 $3",["9"],"0$1"]],"0"],MN:["976","001","[12]\\d{7,9}|[5-9]\\d{7}",[8,9,10],[["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["[12]1"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[5-9]"]],["(\\d{3})(\\d{5,6})","$1 $2",["[12]2[1-3]"],"0$1"],["(\\d{4})(\\d{5,6})","$1 $2",["[12](?:27|3[2-8]|4[2-68]|5[1-4689])","[12](?:27|3[2-8]|4[2-68]|5[1-4689])[0-3]"],"0$1"],["(\\d{5})(\\d{4,5})","$1 $2",["[12]"],"0$1"]],"0"],MO:["853","00","0800\\d{3}|(?:28|[68]\\d)\\d{6}",[7,8],[["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{4})(\\d{4})","$1 $2",["[268]"]]]],MP:["1","011","[58]\\d{9}|(?:67|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","670$1",0,"670"],MQ:["596","00","596\\d{6}|(?:69|80|9\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[569]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],MR:["222","00","(?:[2-4]\\d\\d|800)\\d{5}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-48]"]]]],MS:["1","011","(?:[58]\\d\\d|664|900)\\d{7}",[10],0,"1",0,"([34]\\d{6})$|1","664$1",0,"664"],MT:["356","00","3550\\d{4}|(?:[2579]\\d\\d|800)\\d{5}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[2357-9]"]]]],MU:["230","0(?:0|[24-7]0|3[03])","(?:[57]|8\\d\\d)\\d{7}|[2-468]\\d{6}",[7,8,10],[["(\\d{3})(\\d{4})","$1 $2",["[2-46]|8[013]"]],["(\\d{4})(\\d{4})","$1 $2",["[57]"]],["(\\d{5})(\\d{5})","$1 $2",["8"]]],0,0,0,0,0,0,0,"020"],MV:["960","0(?:0|19)","(?:800|9[0-57-9]\\d)\\d{7}|[34679]\\d{6}",[7,10],[["(\\d{3})(\\d{4})","$1-$2",["[34679]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"]]],0,0,0,0,0,0,0,"00"],MW:["265","00","(?:[1289]\\d|31|77)\\d{7}|1\\d{6}",[7,9],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["1[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"],"0$1"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[137-9]"],"0$1"]],"0"],MX:["52","0[09]","1(?:(?:[27]2|44|99)[1-9]|65[0-689])\\d{7}|(?:1(?:[01]\\d|2[13-9]|[35][1-9]|4[0-35-9]|6[0-46-9]|7[013-9]|8[1-79]|9[1-8])|[2-9]\\d)\\d{8}",[10,11],[["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["33|5[56]|81"],0,1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[2-9]"],0,1],["(\\d)(\\d{2})(\\d{4})(\\d{4})","$2 $3 $4",["1(?:33|5[56]|81)"],0,1],["(\\d)(\\d{3})(\\d{3})(\\d{4})","$2 $3 $4",["1"],0,1]],"01",0,"0(?:[12]|4[45])|1",0,0,0,0,"00"],MY:["60","00","1\\d{8,9}|(?:3\\d|[4-9])\\d{7}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1-$2 $3",["[4-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1-$2 $3",["1(?:[02469]|[378][1-9]|53)|8","1(?:[02469]|[37][1-9]|53|8(?:[1-46-9]|5[7-9]))|8"],"0$1"],["(\\d)(\\d{4})(\\d{4})","$1-$2 $3",["3"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{4})","$1-$2-$3-$4",["1(?:[367]|80)"]],["(\\d{3})(\\d{3})(\\d{4})","$1-$2 $3",["15"],"0$1"],["(\\d{2})(\\d{4})(\\d{4})","$1-$2 $3",["1"],"0$1"]],"0"],MZ:["258","00","(?:2|8\\d)\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2|8[2-79]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["8"]]]],NA:["264","00","[68]\\d{7,8}",[8,9],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["88"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["87"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],NC:["687","00","(?:050|[2-57-9]\\d\\d)\\d{3}",[6],[["(\\d{2})(\\d{2})(\\d{2})","$1.$2.$3",["[02-57-9]"]]]],NE:["227","00","[027-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["08"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[089]|2[013]|7[047]"]]]],NF:["672","00","[13]\\d{5}",[6],[["(\\d{2})(\\d{4})","$1 $2",["1[0-3]"]],["(\\d)(\\d{5})","$1 $2",["[13]"]]],0,0,"([0-258]\\d{4})$","3$1"],NG:["234","009","(?:[124-7]|9\\d{3})\\d{6}|[1-9]\\d{7}|[78]\\d{9,13}",[7,8,10,11,12,13,14],[["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["78"],"0$1"],["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[12]|9(?:0[3-9]|[1-9])"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["[3-7]|8[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[7-9]"],"0$1"],["(\\d{3})(\\d{4})(\\d{4,5})","$1 $2 $3",["[78]"],"0$1"],["(\\d{3})(\\d{5})(\\d{5,6})","$1 $2 $3",["[78]"],"0$1"]],"0"],NI:["505","00","(?:1800|[25-8]\\d{3})\\d{4}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[125-8]"]]]],NL:["31","00","(?:[124-7]\\d\\d|3(?:[02-9]\\d|1[0-8]))\\d{6}|8\\d{6,9}|9\\d{6,10}|1\\d{4,5}",[5,6,7,8,9,10,11],[["(\\d{3})(\\d{4,7})","$1 $2",["[89]0"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["66"],"0$1"],["(\\d)(\\d{8})","$1 $2",["6"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["1[16-8]|2[259]|3[124]|4[17-9]|5[124679]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-578]|91"],"0$1"],["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3",["9"],"0$1"]],"0"],NO:["47","00","(?:0|[2-9]\\d{3})\\d{4}",[5,8],[["(\\d{3})(\\d{2})(\\d{3})","$1 $2 $3",["8"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2-79]"]]],0,0,0,0,0,"[02-689]|7[0-8]"],NP:["977","00","(?:1\\d|9)\\d{9}|[1-9]\\d{7}",[8,10,11],[["(\\d)(\\d{7})","$1-$2",["1[2-6]"],"0$1"],["(\\d{2})(\\d{6})","$1-$2",["1[01]|[2-8]|9(?:[1-59]|[67][2-6])"],"0$1"],["(\\d{3})(\\d{7})","$1-$2",["9"]]],"0"],NR:["674","00","(?:444|(?:55|8\\d)\\d|666)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[4-68]"]]]],NU:["683","00","(?:[47]|888\\d)\\d{3}",[4,7],[["(\\d{3})(\\d{4})","$1 $2",["8"]]]],NZ:["64","0(?:0|161)","[1289]\\d{9}|50\\d{5}(?:\\d{2,3})?|[27-9]\\d{7,8}|(?:[34]\\d|6[0-35-9])\\d{6}|8\\d{4,6}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,8})","$1 $2",["8[1-79]"],"0$1"],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["50[036-8]|8|90","50(?:[0367]|88)|8|90"],"0$1"],["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["24|[346]|7[2-57-9]|9[2-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:10|74)|[589]"],"0$1"],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["1|2[028]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,5})","$1 $2 $3",["2(?:[169]|7[0-35-9])|7"],"0$1"]],"0",0,0,0,0,0,0,"00"],OM:["968","00","(?:1505|[279]\\d{3}|500)\\d{4}|800\\d{5,6}",[7,8,9],[["(\\d{3})(\\d{4,6})","$1 $2",["[58]"]],["(\\d{2})(\\d{6})","$1 $2",["2"]],["(\\d{4})(\\d{4})","$1 $2",["[179]"]]]],PA:["507","00","(?:00800|8\\d{3})\\d{6}|[68]\\d{7}|[1-57-9]\\d{6}",[7,8,10,11],[["(\\d{3})(\\d{4})","$1-$2",["[1-57-9]"]],["(\\d{4})(\\d{4})","$1-$2",["[68]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]]],PE:["51","00|19(?:1[124]|77|90)00","(?:[14-8]|9\\d)\\d{7}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["80"],"(0$1)"],["(\\d)(\\d{7})","$1 $2",["1"],"(0$1)"],["(\\d{2})(\\d{6})","$1 $2",["[4-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"]]],"0",0,0,0,0,0,0,"00"," Anexo "],PF:["689","00","4\\d{5}(?:\\d{2})?|8\\d{7,8}",[6,8,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["44"]],["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["4|8[7-9]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],PG:["675","00|140[1-3]","(?:180|[78]\\d{3})\\d{4}|(?:[2-589]\\d|64)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["18|[2-69]|85"]],["(\\d{4})(\\d{4})","$1 $2",["[78]"]]],0,0,0,0,0,0,0,"00"],PH:["63","00","(?:[2-7]|9\\d)\\d{8}|2\\d{5}|(?:1800|8)\\d{7,9}",[6,8,9,10,11,12,13],[["(\\d)(\\d{5})","$1 $2",["2"],"(0$1)"],["(\\d{4})(\\d{4,6})","$1 $2",["3(?:23|39|46)|4(?:2[3-6]|[35]9|4[26]|76)|544|88[245]|(?:52|64|86)2","3(?:230|397|461)|4(?:2(?:35|[46]4|51)|396|4(?:22|63)|59[347]|76[15])|5(?:221|446)|642[23]|8(?:622|8(?:[24]2|5[13]))"],"(0$1)"],["(\\d{5})(\\d{4})","$1 $2",["346|4(?:27|9[35])|883","3469|4(?:279|9(?:30|56))|8834"],"(0$1)"],["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["2"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|8[2-8]"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]],["(\\d{4})(\\d{1,2})(\\d{3})(\\d{4})","$1 $2 $3 $4",["1"]]],"0"],PK:["92","00","122\\d{6}|[24-8]\\d{10,11}|9(?:[013-9]\\d{8,10}|2(?:[01]\\d\\d|2(?:[06-8]\\d|1[01]))\\d{7})|(?:[2-8]\\d{3}|92(?:[0-7]\\d|8[1-9]))\\d{6}|[24-9]\\d{8}|[89]\\d{7}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,7})","$1 $2 $3",["[89]0"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["1"]],["(\\d{3})(\\d{6,7})","$1 $2",["2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:2[2-8]|3[27-9]|4[2-6]|6[3569]|9[25-8])","9(?:2[3-8]|98)|(?:2(?:3[2358]|4[2-4]|9[2-8])|45[3479]|54[2-467]|60[468]|72[236]|8(?:2[2-689]|3[23578]|4[3478]|5[2356])|9(?:22|3[27-9]|4[2-6]|6[3569]|9[25-7]))[2-9]"],"(0$1)"],["(\\d{2})(\\d{7,8})","$1 $2",["(?:2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91)[2-9]"],"(0$1)"],["(\\d{5})(\\d{5})","$1 $2",["58"],"(0$1)"],["(\\d{3})(\\d{7})","$1 $2",["3"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["2[125]|4[0-246-9]|5[1-35-7]|6[1-8]|7[14]|8[16]|91"],"(0$1)"],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[24-9]"],"(0$1)"]],"0"],PL:["48","00","(?:6|8\\d\\d)\\d{7}|[1-9]\\d{6}(?:\\d{2})?|[26]\\d{5}",[6,7,8,9,10],[["(\\d{5})","$1",["19"]],["(\\d{3})(\\d{3})","$1 $2",["11|20|64"]],["(\\d{2})(\\d{2})(\\d{3})","$1 $2 $3",["(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])1","(?:1[2-8]|2[2-69]|3[2-4]|4[1-468]|5[24-689]|6[1-3578]|7[14-7]|8[1-79]|9[145])19"]],["(\\d{3})(\\d{2})(\\d{2,3})","$1 $2 $3",["64"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["21|39|45|5[0137]|6[0469]|7[02389]|8(?:0[14]|8)"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["1[2-8]|[2-7]|8[1-79]|9[145]"]],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["8"]]]],PM:["508","00","[45]\\d{5}|(?:708|80\\d)\\d{6}",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[45]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"],"0$1"]],"0"],PR:["1","011","(?:[589]\\d\\d|787)\\d{7}",[10],0,"1",0,0,0,0,"787|939"],PS:["970","00","[2489]2\\d{6}|(?:1\\d|5)\\d{8}",[8,9,10],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["[2489]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["5"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],PT:["351","00","1693\\d{5}|(?:[26-9]\\d|30)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["2[12]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["16|[236-9]"]]]],PW:["680","01[12]","(?:[24-8]\\d\\d|345|900)\\d{4}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[2-9]"]]]],PY:["595","00","59\\d{4,6}|9\\d{5,10}|(?:[2-46-8]\\d|5[0-8])\\d{4,7}",[6,7,8,9,10,11],[["(\\d{3})(\\d{3,6})","$1 $2",["[2-9]0"],"0$1"],["(\\d{2})(\\d{5})","$1 $2",["[26]1|3[289]|4[1246-8]|7[1-3]|8[1-36]"],"(0$1)"],["(\\d{3})(\\d{4,5})","$1 $2",["2[279]|3[13-5]|4[359]|5|6(?:[34]|7[1-46-8])|7[46-8]|85"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["2[14-68]|3[26-9]|4[1246-8]|6(?:1|75)|7[1-35]|8[1-36]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["87"]],["(\\d{3})(\\d{6})","$1 $2",["9(?:[5-79]|8[1-6])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[2-8]"],"0$1"],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["9"]]],"0"],QA:["974","00","800\\d{4}|(?:2|800)\\d{6}|(?:0080|[3-7])\\d{7}",[7,8,9,11],[["(\\d{3})(\\d{4})","$1 $2",["2[16]|8"]],["(\\d{4})(\\d{4})","$1 $2",["[3-7]"]]]],RE:["262","00","(?:26|[689]\\d)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2689]"],"0$1"]],"0",0,0,0,0,0,[["26(?:2\\d\\d|3(?:0\\d|1[0-5]))\\d{4}"],["69(?:2\\d\\d|3(?:[06][0-6]|1[013]|2[0-2]|3[0-39]|4\\d|5[0-5]|7[0-27]|8[0-8]|9[0-479]))\\d{4}"],["80\\d{7}"],["89[1-37-9]\\d{6}"],0,0,0,0,["9(?:399[0-3]|479[0-5]|76(?:2[27]|3[0-37]))\\d{4}"],["8(?:1[019]|2[0156]|84|90)\\d{6}"]]],RO:["40","00","(?:[2378]\\d|90)\\d{7}|[23]\\d{5}",[6,9],[["(\\d{3})(\\d{3})","$1 $2",["2[3-6]","2[3-6]\\d9"],"0$1"],["(\\d{2})(\\d{4})","$1 $2",["219|31"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[23]1"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[237-9]"],"0$1"]],"0",0,0,0,0,0,0,0," int "],RS:["381","00","38[02-9]\\d{6,9}|6\\d{7,9}|90\\d{4,8}|38\\d{5,6}|(?:7\\d\\d|800)\\d{3,9}|(?:[12]\\d|3[0-79])\\d{5,10}",[6,7,8,9,10,11,12],[["(\\d{3})(\\d{3,9})","$1 $2",["(?:2[389]|39)0|[7-9]"],"0$1"],["(\\d{2})(\\d{5,10})","$1 $2",["[1-36]"],"0$1"]],"0"],RU:["7","810","8\\d{13}|[347-9]\\d{9}",[10,14],[["(\\d{4})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-8]|2[1-9])","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:1[23]|[2-9]2))","7(?:1(?:[0-356]2|4[29]|7|8[27])|2(?:13[03-69]|62[013-9]))|72[1-57-9]2"],"8 ($1)",1],["(\\d{5})(\\d)(\\d{2})(\\d{2})","$1 $2 $3 $4",["7(?:1[0-68]|2[1-9])","7(?:1(?:[06][3-6]|[18]|2[35]|[3-5][3-5])|2(?:[13][3-5]|[24-689]|7[457]))","7(?:1(?:0(?:[356]|4[023])|[18]|2(?:3[013-9]|5)|3[45]|43[013-79]|5(?:3[1-8]|4[1-7]|5)|6(?:3[0-35-9]|[4-6]))|2(?:1(?:3[178]|[45])|[24-689]|3[35]|7[457]))|7(?:14|23)4[0-8]|71(?:33|45)[1-79]"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"8 ($1)",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2-$3-$4",["[349]|8(?:[02-7]|1[1-8])"],"8 ($1)",1],["(\\d{4})(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3 $4",["8"],"8 ($1)"]],"8",0,0,0,0,"3[04-689]|[489]",0,"8~10"],RW:["250","00","(?:06|[27]\\d\\d|[89]00)\\d{6}",[8,9],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["0"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["2"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[7-9]"],"0$1"]],"0"],SA:["966","00","92\\d{7}|(?:[15]|8\\d)\\d{8}",[9,10],[["(\\d{4})(\\d{5})","$1 $2",["9"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["1"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["5"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["81"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]]],"0"],SB:["677","0[01]","(?:[1-6]|[7-9]\\d\\d)\\d{4}",[5,7],[["(\\d{2})(\\d{5})","$1 $2",["7|8[4-9]|9(?:[1-8]|9[0-8])"]]]],SC:["248","010|0[0-2]","800\\d{4}|(?:[249]\\d|64)\\d{5}",[7],[["(\\d)(\\d{3})(\\d{3})","$1 $2 $3",["[246]|9[57]"]]],0,0,0,0,0,0,0,"00"],SD:["249","00","[19]\\d{8}",[9],[["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[19]"],"0$1"]],"0"],SE:["46","00","(?:[26]\\d\\d|9)\\d{9}|[1-9]\\d{8}|[1-689]\\d{7}|[1-4689]\\d{6}|2\\d{5}",[6,7,8,9,10],[["(\\d{2})(\\d{2,3})(\\d{2})","$1-$2 $3",["20"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{4})","$1-$2",["9(?:00|39|44|9)"],"0$1",0,"$1 $2"],["(\\d{2})(\\d{3})(\\d{2})","$1-$2 $3",["[12][136]|3[356]|4[0246]|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3"],["(\\d)(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2,3})(\\d{2})","$1-$2 $3",["1[2457]|2(?:[247-9]|5[0138])|3[0247-9]|4[1357-9]|5[0-35-9]|6(?:[125689]|4[02-57]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3"],["(\\d{3})(\\d{2,3})(\\d{3})","$1-$2 $3",["9(?:00|39|44)"],"0$1",0,"$1 $2 $3"],["(\\d{2})(\\d{2,3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["1[13689]|2[0136]|3[1356]|4[0246]|54|6[03]|90[1-9]"],"0$1",0,"$1 $2 $3 $4"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4",["10|7"],"0$1",0,"$1 $2 $3 $4"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1-$2 $3 $4",["8"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1-$2 $3 $4",["[13-5]|2(?:[247-9]|5[0138])|6(?:[124-689]|7[0-2])|9(?:[125-8]|3[02-5]|4[0-3])"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{2})(\\d{3})","$1-$2 $3 $4",["9"],"0$1",0,"$1 $2 $3 $4"],["(\\d{3})(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1-$2 $3 $4 $5",["[26]"],"0$1",0,"$1 $2 $3 $4 $5"]],"0"],SG:["65","0[0-3]\\d","(?:(?:1\\d|8)\\d\\d|7000)\\d{7}|[3689]\\d{7}",[8,10,11],[["(\\d{4})(\\d{4})","$1 $2",["[369]|8(?:0[1-8]|[1-9])"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"]],["(\\d{4})(\\d{4})(\\d{3})","$1 $2 $3",["7"]],["(\\d{4})(\\d{3})(\\d{4})","$1 $2 $3",["1"]]]],SH:["290","00","(?:[256]\\d|8)\\d{3}",[4,5],0,0,0,0,0,0,"[256]"],SI:["386","00|10(?:22|66|88|99)","[1-7]\\d{7}|8\\d{4,7}|90\\d{4,6}",[5,6,7,8],[["(\\d{2})(\\d{3,6})","$1 $2",["8[09]|9"],"0$1"],["(\\d{3})(\\d{5})","$1 $2",["59|8"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[37][01]|4[0139]|51|6"],"0$1"],["(\\d)(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[1-57]"],"(0$1)"]],"0",0,0,0,0,0,0,"00"],SJ:["47","00","0\\d{4}|(?:[489]\\d|79)\\d{6}",[5,8],0,0,0,0,0,0,"79"],SK:["421","00","[2-689]\\d{8}|[2-59]\\d{6}|[2-5]\\d{5}",[6,7,9],[["(\\d)(\\d{2})(\\d{3,4})","$1 $2 $3",["21"],"0$1"],["(\\d{2})(\\d{2})(\\d{2,3})","$1 $2 $3",["[3-5][1-8]1","[3-5][1-8]1[67]"],"0$1"],["(\\d)(\\d{3})(\\d{3})(\\d{2})","$1/$2 $3 $4",["2"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[689]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1/$2 $3 $4",["[3-5]"],"0$1"]],"0"],SL:["232","00","(?:[237-9]\\d|66)\\d{6}",[8],[["(\\d{2})(\\d{6})","$1 $2",["[236-9]"],"(0$1)"]],"0"],SM:["378","00","(?:0549|[5-7]\\d)\\d{6}",[8,10],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[5-7]"]],["(\\d{4})(\\d{6})","$1 $2",["0"]]],0,0,"([89]\\d{5})$","0549$1"],SN:["221","00","(?:[378]\\d|93)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[379]"]]]],SO:["252","00","[346-9]\\d{8}|[12679]\\d{7}|[1-5]\\d{6}|[1348]\\d{5}",[6,7,8,9],[["(\\d{2})(\\d{4})","$1 $2",["8[125]"]],["(\\d{6})","$1",["[134]"]],["(\\d)(\\d{6})","$1 $2",["[15]|2[0-79]|3[0-46-8]|4[0-7]"]],["(\\d)(\\d{7})","$1 $2",["(?:2|90)4|[67]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[348]|64|79|90"]],["(\\d{2})(\\d{5,7})","$1 $2",["1|28|6[0-35-9]|77|9[2-9]"]]],"0"],SR:["597","00","(?:[2-5]|68|[78]\\d)\\d{5}",[6,7],[["(\\d{2})(\\d{2})(\\d{2})","$1-$2-$3",["56"]],["(\\d{3})(\\d{3})","$1-$2",["[2-5]"]],["(\\d{3})(\\d{4})","$1-$2",["[6-8]"]]]],SS:["211","00","[19]\\d{8}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[19]"],"0$1"]],"0"],ST:["239","00","(?:22|9\\d)\\d{5}",[7],[["(\\d{3})(\\d{4})","$1 $2",["[29]"]]]],SV:["503","00","[267]\\d{7}|[89]00\\d{4}(?:\\d{4})?",[7,8,11],[["(\\d{3})(\\d{4})","$1 $2",["[89]"]],["(\\d{4})(\\d{4})","$1 $2",["[267]"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["[89]"]]]],SX:["1","011","7215\\d{6}|(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"(5\\d{6})$|1","721$1",0,"721"],SY:["963","00","[1-39]\\d{8}|[1-5]\\d{7}",[8,9],[["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-5]"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1",1]],"0"],SZ:["268","00","0800\\d{4}|(?:[237]\\d|900)\\d{6}",[8,9],[["(\\d{4})(\\d{4})","$1 $2",["[0237]"]],["(\\d{5})(\\d{4})","$1 $2",["9"]]]],TA:["290","00","8\\d{3}",[4],0,0,0,0,0,0,"8"],TC:["1","011","(?:[58]\\d\\d|649|900)\\d{7}",[10],0,"1",0,"([2-479]\\d{6})$|1","649$1",0,"649"],TD:["235","00|16","(?:22|[69]\\d|77)\\d{6}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[2679]"]]],0,0,0,0,0,0,0,"00"],TG:["228","00","[279]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[279]"]]]],TH:["66","00[1-9]","(?:001800|[2-57]|[689]\\d)\\d{7}|1\\d{7,9}",[8,9,10,13],[["(\\d)(\\d{3})(\\d{4})","$1 $2 $3",["2"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[13-9]"],"0$1"],["(\\d{4})(\\d{3})(\\d{3})","$1 $2 $3",["1"]]],"0"],TJ:["992","810","[0-57-9]\\d{8}",[9],[["(\\d{6})(\\d)(\\d{2})","$1 $2 $3",["331","3317"]],["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["44[04]|[34]7"]],["(\\d{4})(\\d)(\\d{4})","$1 $2 $3",["3[1-5]"]],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[0-57-9]"]]],0,0,0,0,0,0,0,"8~10"],TK:["690","00","[2-47]\\d{3,6}",[4,5,6,7]],TL:["670","00","7\\d{7}|(?:[2-47]\\d|[89]0)\\d{5}",[7,8],[["(\\d{3})(\\d{4})","$1 $2",["[2-489]|70"]],["(\\d{4})(\\d{4})","$1 $2",["7"]]]],TM:["993","810","[1-6]\\d{7}",[8],[["(\\d{2})(\\d{2})(\\d{2})(\\d{2})","$1 $2-$3-$4",["12"],"(8 $1)"],["(\\d{3})(\\d)(\\d{2})(\\d{2})","$1 $2-$3-$4",["[1-5]"],"(8 $1)"],["(\\d{2})(\\d{6})","$1 $2",["6"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],TN:["216","00","[2-57-9]\\d{7}",[8],[["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-57-9]"]]]],TO:["676","00","(?:0800|(?:[5-8]\\d\\d|999)\\d)\\d{3}|[2-8]\\d{4}",[5,7],[["(\\d{2})(\\d{3})","$1-$2",["[2-4]|50|6[09]|7[0-24-69]|8[05]"]],["(\\d{4})(\\d{3})","$1 $2",["0"]],["(\\d{3})(\\d{4})","$1 $2",["[5-9]"]]]],TR:["90","00","4\\d{6}|8\\d{11,12}|(?:[2-58]\\d\\d|900)\\d{7}",[7,10,12,13],[["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["512|8[01589]|90"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["5(?:[0-59]|61)","5(?:[0-59]|616)","5(?:[0-59]|6161)"],"0$1",1],["(\\d{3})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[24][1-8]|3[1-9]"],"(0$1)",1],["(\\d{3})(\\d{3})(\\d{6,7})","$1 $2 $3",["80"],"0$1",1]],"0"],TT:["1","011","(?:[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-46-8]\\d{6})$|1","868$1",0,"868"],TV:["688","00","(?:2|7\\d\\d|90)\\d{4}",[5,6,7],[["(\\d{2})(\\d{3})","$1 $2",["2"]],["(\\d{2})(\\d{4})","$1 $2",["90"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],TW:["886","0(?:0[25-79]|19)","[2-689]\\d{8}|7\\d{9,10}|[2-8]\\d{7}|2\\d{6}",[7,8,9,10,11],[["(\\d{2})(\\d)(\\d{4})","$1 $2 $3",["202"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["[258]0"],"0$1"],["(\\d)(\\d{3,4})(\\d{4})","$1 $2 $3",["[23568]|4(?:0[02-48]|[1-47-9])|7[1-9]","[23568]|4(?:0[2-48]|[1-47-9])|(?:400|7)[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[49]"],"0$1"],["(\\d{2})(\\d{4})(\\d{4,5})","$1 $2 $3",["7"],"0$1"]],"0",0,0,0,0,0,0,0,"#"],TZ:["255","00[056]","(?:[25-8]\\d|41|90)\\d{7}",[9],[["(\\d{3})(\\d{2})(\\d{4})","$1 $2 $3",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[24]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["5"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[67]"],"0$1"]],"0"],UA:["380","00","[89]\\d{9}|[3-9]\\d{8}",[9,10],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["6[12][29]|(?:3[1-8]|4[136-8]|5[12457]|6[49])2|(?:56|65)[24]","6[12][29]|(?:35|4[1378]|5[12457]|6[49])2|(?:56|65)[24]|(?:3[1-46-8]|46)2[013-9]"],"0$1"],["(\\d{4})(\\d{5})","$1 $2",["3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6[0135689]|7[4-6])|6(?:[12][3-7]|[459])","3[1-8]|4(?:[1367]|[45][6-9]|8[4-6])|5(?:[1-5]|6(?:[015689]|3[02389])|7[4-6])|6(?:[12][3-7]|[459])"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[3-7]|89|9[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["[89]"],"0$1"]],"0",0,0,0,0,0,0,"0~0"],UG:["256","00[057]","800\\d{6}|(?:[29]0|[347]\\d)\\d{7}",[9],[["(\\d{4})(\\d{5})","$1 $2",["202","2024"],"0$1"],["(\\d{3})(\\d{6})","$1 $2",["[27-9]|4(?:6[45]|[7-9])"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[34]"],"0$1"]],"0"],US:["1","011","[2-9]\\d{9}|3\\d{6}",[10],[["(\\d{3})(\\d{4})","$1-$2",["310"],0,1],["(\\d{3})(\\d{3})(\\d{4})","($1) $2-$3",["[2-9]"],0,1,"$1-$2-$3"]],"1",0,0,0,0,0,[["5056(?:[0-35-9]\\d|4[46])\\d{4}|(?:4722|505[2-57-9]|983[29])\\d{6}|(?:2(?:0[1-35-9]|1[02-9]|2[03-589]|3[149]|4[08]|5[1-46]|6[0279]|7[0269]|8[13])|3(?:0[1-57-9]|1[02-9]|2[01356]|3[0-24679]|4[167]|5[0-2]|6[014]|8[056])|4(?:0[124-9]|1[02-579]|2[3-5]|3[0245]|4[023578]|58|6[349]|7[0589]|8[04])|5(?:0[1-47-9]|1[0235-8]|20|3[0149]|4[01]|5[179]|6[1-47]|7[0-5]|8[0256])|6(?:0[1-35-9]|1[024-9]|2[03689]|[34][016]|5[01679]|6[0-279]|78|8[0-29])|7(?:0[1-46-8]|1[2-9]|2[04-7]|3[1247]|4[037]|5[47]|6[02359]|7[0-59]|8[156])|8(?:0[1-68]|1[02-8]|2[068]|3[0-2589]|4[03578]|5[046-9]|6[02-5]|7[028])|9(?:0[1346-9]|1[02-9]|2[0589]|3[0146-8]|4[01357-9]|5[12469]|7[0-389]|8[04-69]))[2-9]\\d{6}"],[""],["8(?:00|33|44|55|66|77|88)[2-9]\\d{6}"],["900[2-9]\\d{6}"],["52(?:3(?:[2-46-9][02-9]\\d|5(?:[02-46-9]\\d|5[0-46-9]))|4(?:[2-478][02-9]\\d|5(?:[034]\\d|2[024-9]|5[0-46-9])|6(?:0[1-9]|[2-9]\\d)|9(?:[05-9]\\d|2[0-5]|49)))\\d{4}|52[34][2-9]1[02-9]\\d{4}|5(?:00|2[125-9]|33|44|66|77|88)[2-9]\\d{6}"]]],UY:["598","0(?:0|1[3-9]\\d)","(?:0004|4)\\d{9}|[1249]\\d{7}|(?:[49]\\d|80)\\d{5}",[7,8,10,13],[["(\\d{3})(\\d{4})","$1 $2",["405|8|90"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["9"],"0$1"],["(\\d{4})(\\d{4})","$1 $2",["[124]"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["4"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3 $4",["0"]]],"0",0,0,0,0,0,0,"00"," int. "],UZ:["998","810","200\\d{6}|(?:33|[5-79]\\d|88)\\d{7}",[9],[["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["[235-9]"],"8 $1"]],"8",0,0,0,0,0,0,"8~10"],VA:["39","00","0\\d{5,10}|3[0-8]\\d{7,10}|55\\d{8}|8\\d{5}(?:\\d{2,4})?|(?:1\\d|39)\\d{7,8}",[6,7,8,9,10,11],0,0,0,0,0,0,"06698"],VC:["1","011","(?:[58]\\d\\d|784|900)\\d{7}",[10],0,"1",0,"([2-7]\\d{6})$|1","784$1",0,"784"],VE:["58","00","[68]00\\d{7}|(?:[24]\\d|[59]0)\\d{8}",[10],[["(\\d{3})(\\d{7})","$1-$2",["[24-689]"],"0$1"]],"0"],VG:["1","011","(?:284|[58]\\d\\d|900)\\d{7}",[10],0,"1",0,"([2-578]\\d{6})$|1","284$1",0,"284"],VI:["1","011","[58]\\d{9}|(?:34|90)0\\d{7}",[10],0,"1",0,"([2-9]\\d{6})$|1","340$1",0,"340"],VN:["84","00","[12]\\d{9}|[135-9]\\d{8}|[16]\\d{7}|[16-8]\\d{6}",[7,8,9,10],[["(\\d{2})(\\d{5})","$1 $2",["80"],"0$1",1],["(\\d{4})(\\d{4,6})","$1 $2",["1"],0,1],["(\\d{2})(\\d{3})(\\d{2})(\\d{2})","$1 $2 $3 $4",["6"],"0$1",1],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[357-9]"],"0$1",1],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["2[48]"],"0$1",1],["(\\d{3})(\\d{4})(\\d{3})","$1 $2 $3",["2"],"0$1",1]],"0"],VU:["678","00","[57-9]\\d{6}|(?:[238]\\d|48)\\d{3}",[5,7],[["(\\d{3})(\\d{4})","$1 $2",["[57-9]"]]]],WF:["681","00","(?:40|72)\\d{4}|8\\d{5}(?:\\d{3})?",[6,9],[["(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3",["[478]"]],["(\\d{3})(\\d{2})(\\d{2})(\\d{2})","$1 $2 $3 $4",["8"]]]],WS:["685","0","(?:[2-6]|8\\d{5})\\d{4}|[78]\\d{6}|[68]\\d{5}",[5,6,7,10],[["(\\d{5})","$1",["[2-5]|6[1-9]"]],["(\\d{3})(\\d{3,7})","$1 $2",["[68]"]],["(\\d{2})(\\d{5})","$1 $2",["7"]]]],XK:["383","00","[23]\\d{7,8}|(?:4\\d\\d|[89]00)\\d{5}",[8,9],[["(\\d{3})(\\d{5})","$1 $2",["[89]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3})","$1 $2 $3",["[2-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[23]"],"0$1"]],"0"],YE:["967","00","(?:1|7\\d)\\d{7}|[1-7]\\d{6}",[7,8,9],[["(\\d)(\\d{3})(\\d{3,4})","$1 $2 $3",["[1-6]|7(?:[24-6]|8[0-7])"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["7"],"0$1"]],"0"],YT:["262","00","(?:80|9\\d)\\d{7}|(?:26|63)9\\d{6}",[9],0,"0",0,0,0,0,0,[["269(?:0[0-467]|5[0-4]|6\\d|[78]0)\\d{4}"],["639(?:0[0-79]|1[019]|[267]\\d|3[09]|40|5[05-9]|9[04-79])\\d{4}"],["80\\d{7}"],0,0,0,0,0,["9(?:(?:39|47)8[01]|769\\d)\\d{4}"]]],ZA:["27","00","[1-79]\\d{8}|8\\d{4,9}",[5,6,7,8,9,10],[["(\\d{2})(\\d{3,4})","$1 $2",["8[1-4]"],"0$1"],["(\\d{2})(\\d{3})(\\d{2,3})","$1 $2 $3",["8[1-4]"],"0$1"],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["860"],"0$1"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["[1-9]"],"0$1"],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["8"],"0$1"]],"0"],ZM:["260","00","800\\d{6}|(?:21|63|[79]\\d)\\d{7}",[9],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[28]"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["[79]"],"0$1"]],"0"],ZW:["263","00","2(?:[0-57-9]\\d{6,8}|6[0-24-9]\\d{6,7})|[38]\\d{9}|[35-8]\\d{8}|[3-6]\\d{7}|[1-689]\\d{6}|[1-3569]\\d{5}|[1356]\\d{4}",[5,6,7,8,9,10],[["(\\d{3})(\\d{3,5})","$1 $2",["2(?:0[45]|2[278]|[49]8)|3(?:[09]8|17)|6(?:[29]8|37|75)|[23][78]|(?:33|5[15]|6[68])[78]"],"0$1"],["(\\d)(\\d{3})(\\d{2,4})","$1 $2 $3",["[49]"],"0$1"],["(\\d{3})(\\d{4})","$1 $2",["80"],"0$1"],["(\\d{2})(\\d{7})","$1 $2",["24|8[13-59]|(?:2[05-79]|39|5[45]|6[15-8])2","2(?:02[014]|4|[56]20|[79]2)|392|5(?:42|525)|6(?:[16-8]21|52[013])|8[13-59]"],"(0$1)"],["(\\d{2})(\\d{3})(\\d{4})","$1 $2 $3",["7"],"0$1"],["(\\d{3})(\\d{3})(\\d{3,4})","$1 $2 $3",["2(?:1[39]|2[0157]|[378]|[56][14])|3(?:12|29)","2(?:1[39]|2[0157]|[378]|[56][14])|3(?:123|29)"],"0$1"],["(\\d{4})(\\d{6})","$1 $2",["8"],"0$1"],["(\\d{2})(\\d{3,5})","$1 $2",["1|2(?:0[0-36-9]|12|29|[56])|3(?:1[0-689]|[24-6])|5(?:[0236-9]|1[2-4])|6(?:[013-59]|7[0-46-9])|(?:33|55|6[68])[0-69]|(?:29|3[09]|62)[0-79]"],"0$1"],["(\\d{2})(\\d{3})(\\d{3,4})","$1 $2 $3",["29[013-9]|39|54"],"0$1"],["(\\d{4})(\\d{3,5})","$1 $2",["(?:25|54)8","258|5483"],"0$1"]],"0"]},nonGeographic:{800:["800",0,"(?:00|[1-9]\\d)\\d{6}",[8],[["(\\d{4})(\\d{4})","$1 $2",["\\d"]]],0,0,0,0,0,0,[0,0,["(?:00|[1-9]\\d)\\d{6}"]]],808:["808",0,"[1-9]\\d{7}",[8],[["(\\d{4})(\\d{4})","$1 $2",["[1-9]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,0,["[1-9]\\d{7}"]]],870:["870",0,"7\\d{11}|[35-7]\\d{8}",[9,12],[["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["[35-7]"]]],0,0,0,0,0,0,[0,["(?:[356]|774[45])\\d{8}|7[6-8]\\d{7}"]]],878:["878",0,"10\\d{10}",[12],[["(\\d{2})(\\d{5})(\\d{5})","$1 $2 $3",["1"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["10\\d{10}"]]],881:["881",0,"[0-36-9]\\d{8}",[9],[["(\\d)(\\d{3})(\\d{5})","$1 $2 $3",["[0-36-9]"]]],0,0,0,0,0,0,[0,["[0-36-9]\\d{8}"]]],882:["882",0,"[13]\\d{6}(?:\\d{2,5})?|[19]\\d{7}|(?:[25]\\d\\d|4)\\d{7}(?:\\d{2})?",[7,8,9,10,11,12],[["(\\d{2})(\\d{5})","$1 $2",["16|342"]],["(\\d{2})(\\d{6})","$1 $2",["49"]],["(\\d{2})(\\d{2})(\\d{4})","$1 $2 $3",["1[36]|9"]],["(\\d{2})(\\d{4})(\\d{3})","$1 $2 $3",["3[23]"]],["(\\d{2})(\\d{3,4})(\\d{4})","$1 $2 $3",["16"]],["(\\d{2})(\\d{4})(\\d{4})","$1 $2 $3",["10|23|3(?:[15]|4[57])|4|51"]],["(\\d{3})(\\d{4})(\\d{4})","$1 $2 $3",["34"]],["(\\d{2})(\\d{4,5})(\\d{5})","$1 $2 $3",["[1-35]"]]],0,0,0,0,0,0,[0,["342\\d{4}|(?:337|49)\\d{6}|(?:3(?:2|47|7\\d{3})|50\\d{3})\\d{7}",[7,8,9,10,12]],0,0,0,0,0,0,["1(?:3(?:0[0347]|[13][0139]|2[035]|4[013568]|6[0459]|7[06]|8[15-8]|9[0689])\\d{4}|6\\d{5,10})|(?:345\\d|9[89])\\d{6}|(?:10|2(?:3|85\\d)|3(?:[15]|[69]\\d\\d)|4[15-8]|51)\\d{8}"]]],883:["883",0,"(?:[1-4]\\d|51)\\d{6,10}",[8,9,10,11,12],[["(\\d{3})(\\d{3})(\\d{2,8})","$1 $2 $3",["[14]|2[24-689]|3[02-689]|51[24-9]"]],["(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3",["510"]],["(\\d{3})(\\d{3})(\\d{4})","$1 $2 $3",["21"]],["(\\d{4})(\\d{4})(\\d{4})","$1 $2 $3",["51[13]"]],["(\\d{3})(\\d{3})(\\d{3})(\\d{3})","$1 $2 $3 $4",["[235]"]]],0,0,0,0,0,0,[0,0,0,0,0,0,0,0,["(?:2(?:00\\d\\d|10)|(?:370[1-9]|51\\d0)\\d)\\d{7}|51(?:00\\d{5}|[24-9]0\\d{4,7})|(?:1[013-79]|2[24-689]|3[02-689]|4[0-4])0\\d{5,9}"]]],888:["888",0,"\\d{11}",[11],[["(\\d{3})(\\d{3})(\\d{5})","$1 $2 $3"]],0,0,0,0,0,0,[0,0,0,0,0,0,["\\d{11}"]]],979:["979",0,"[1359]\\d{8}",[9],[["(\\d)(\\d{4})(\\d{4})","$1 $2 $3",["[1359]"]]],0,0,0,0,0,0,[0,0,0,["[1359]\\d{8}"]]]}};function Ca(e,t){var r=Array.prototype.slice.call(t);return r.push(va),e.apply(this,r)}function ba(e){return(ba="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ea(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $a(e){var t="function"==typeof Map?new Map:void 0;return($a=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return Ta(e,arguments,_a(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),xa(r,e)})(e)}function Ta(e,t,r){return(Ta=Aa()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var a=new(Function.bind.apply(e,n));return r&&xa(a,r.prototype),a}).apply(null,arguments)}function Aa(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function xa(e,t){return(xa=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _a(e){return(_a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ka=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xa(e,t)}(n,$a(Error));var t,r=(t=Aa(),function(){var e=_a(n);return function(e,t){if(t&&("object"===ba(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return Ea(e)}(this,t?Reflect.construct(e,arguments,_a(this).constructor):e.apply(this,arguments))});function n(e){var t;return function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,n),Object.setPrototypeOf(Ea(t=r.call(this,e)),n.prototype),t.name=t.constructor.name,t}return Object.defineProperty(n,"prototype",{writable:!1}),n}(),Na="0-90-9٠-٩۰-۹",Sa="".concat("-‐-―−ー-").concat("//").concat("..").concat(" ").concat("()()[]\\[\\]").concat("~⁓∼~");function Ia(e,t){e=e.split("-"),t=t.split("-");for(var r=e[0].split("."),n=t[0].split("."),a=0;a<3;a++){var i=Number(r[a]),o=Number(n[a]);if(i>o)return 1;if(o>i)return-1;if(!isNaN(i)&&isNaN(o))return 1;if(isNaN(i)&&!isNaN(o))return-1}return e[1]&&t[1]?e[1]>t[1]?1:e[1]<t[1]?-1:0:!e[1]&&t[1]?1:e[1]&&!t[1]?-1:0}function Oa(e){return(Oa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Pa(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function Ma(e,t,r){return t&&function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}var Ra=" ext. ",La=/^\d+$/,Da=function(){function e(t){Pa(this,e),function(e){if(!e)throw Error("[libphonenumber-js] `metadata` argument not passed. Check your arguments.");if(!za(e)||!za(e.countries))throw Error("[libphonenumber-js] `metadata` argument was passed but it's not a valid metadata. Must be an object having `.countries` child object property. Got ".concat(za(e)?"an object of shape: { "+Object.keys(e).join(", ")+" }":"a "+Ga(e)+": "+e,"."))}(t),this.metadata=t,Va.call(this,t)}return Ma(e,[{key:"getCountries",value:function(){return Object.keys(this.metadata.countries).filter((function(e){return"001"!==e}))}},{key:"getCountryMetadata",value:function(e){return this.metadata.countries[e]}},{key:"nonGeographic",value:function(){if(!(this.v1||this.v2||this.v3))return this.metadata.nonGeographic||this.metadata.nonGeographical}},{key:"hasCountry",value:function(e){return void 0!==this.getCountryMetadata(e)}},{key:"hasCallingCode",value:function(e){if(this.getCountryCodesForCallingCode(e))return!0;if(this.nonGeographic()){if(this.nonGeographic()[e])return!0}else{var t=this.countryCallingCodes()[e];if(t&&1===t.length&&"001"===t[0])return!0}}},{key:"isNonGeographicCallingCode",value:function(e){return this.nonGeographic()?!!this.nonGeographic()[e]:!this.getCountryCodesForCallingCode(e)}},{key:"country",value:function(e){return this.selectNumberingPlan(e)}},{key:"selectNumberingPlan",value:function(e,t){if(e&&La.test(e)&&(t=e,e=null),e&&"001"!==e){if(!this.hasCountry(e))throw Error("Unknown country: ".concat(e));this.numberingPlan=new Fa(this.getCountryMetadata(e),this)}else if(t){if(!this.hasCallingCode(t))throw Error("Unknown calling code: ".concat(t));this.numberingPlan=new Fa(this.getNumberingPlanMetadata(t),this)}else this.numberingPlan=void 0;return this}},{key:"getCountryCodesForCallingCode",value:function(e){var t=this.countryCallingCodes()[e];if(t){if(1===t.length&&3===t[0].length)return;return t}}},{key:"getCountryCodeForCallingCode",value:function(e){var t=this.getCountryCodesForCallingCode(e);if(t)return t[0]}},{key:"getNumberingPlanMetadata",value:function(e){var t=this.getCountryCodeForCallingCode(e);if(t)return this.getCountryMetadata(t);if(this.nonGeographic()){var r=this.nonGeographic()[e];if(r)return r}else{var n=this.countryCallingCodes()[e];if(n&&1===n.length&&"001"===n[0])return this.metadata.countries["001"]}}},{key:"countryCallingCode",value:function(){return this.numberingPlan.callingCode()}},{key:"IDDPrefix",value:function(){return this.numberingPlan.IDDPrefix()}},{key:"defaultIDDPrefix",value:function(){return this.numberingPlan.defaultIDDPrefix()}},{key:"nationalNumberPattern",value:function(){return this.numberingPlan.nationalNumberPattern()}},{key:"possibleLengths",value:function(){return this.numberingPlan.possibleLengths()}},{key:"formats",value:function(){return this.numberingPlan.formats()}},{key:"nationalPrefixForParsing",value:function(){return this.numberingPlan.nationalPrefixForParsing()}},{key:"nationalPrefixTransformRule",value:function(){return this.numberingPlan.nationalPrefixTransformRule()}},{key:"leadingDigits",value:function(){return this.numberingPlan.leadingDigits()}},{key:"hasTypes",value:function(){return this.numberingPlan.hasTypes()}},{key:"type",value:function(e){return this.numberingPlan.type(e)}},{key:"ext",value:function(){return this.numberingPlan.ext()}},{key:"countryCallingCodes",value:function(){return this.v1?this.metadata.country_phone_code_to_countries:this.metadata.country_calling_codes}},{key:"chooseCountryByCountryCallingCode",value:function(e){return this.selectNumberingPlan(e)}},{key:"hasSelectedNumberingPlan",value:function(){return void 0!==this.numberingPlan}}]),e}(),Fa=function(){function e(t,r){Pa(this,e),this.globalMetadataObject=r,this.metadata=t,Va.call(this,r.metadata)}return Ma(e,[{key:"callingCode",value:function(){return this.metadata[0]}},{key:"getDefaultCountryMetadataForRegion",value:function(){return this.globalMetadataObject.getNumberingPlanMetadata(this.callingCode())}},{key:"IDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[1]}},{key:"defaultIDDPrefix",value:function(){if(!this.v1&&!this.v2)return this.metadata[12]}},{key:"nationalNumberPattern",value:function(){return this.v1||this.v2?this.metadata[1]:this.metadata[2]}},{key:"possibleLengths",value:function(){if(!this.v1)return this.metadata[this.v2?2:3]}},{key:"_getFormats",value:function(e){return e[this.v1?2:this.v2?3:4]}},{key:"formats",value:function(){var e=this;return(this._getFormats(this.metadata)||this._getFormats(this.getDefaultCountryMetadataForRegion())||[]).map((function(t){return new Ua(t,e)}))}},{key:"nationalPrefix",value:function(){return this.metadata[this.v1?3:this.v2?4:5]}},{key:"_getNationalPrefixFormattingRule",value:function(e){return e[this.v1?4:this.v2?5:6]}},{key:"nationalPrefixFormattingRule",value:function(){return this._getNationalPrefixFormattingRule(this.metadata)||this._getNationalPrefixFormattingRule(this.getDefaultCountryMetadataForRegion())}},{key:"_nationalPrefixForParsing",value:function(){return this.metadata[this.v1?5:this.v2?6:7]}},{key:"nationalPrefixForParsing",value:function(){return this._nationalPrefixForParsing()||this.nationalPrefix()}},{key:"nationalPrefixTransformRule",value:function(){return this.metadata[this.v1?6:this.v2?7:8]}},{key:"_getNationalPrefixIsOptionalWhenFormatting",value:function(){return!!this.metadata[this.v1?7:this.v2?8:9]}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return this._getNationalPrefixIsOptionalWhenFormatting(this.metadata)||this._getNationalPrefixIsOptionalWhenFormatting(this.getDefaultCountryMetadataForRegion())}},{key:"leadingDigits",value:function(){return this.metadata[this.v1?8:this.v2?9:10]}},{key:"types",value:function(){return this.metadata[this.v1?9:this.v2?10:11]}},{key:"hasTypes",value:function(){return!(this.types()&&0===this.types().length||!this.types())}},{key:"type",value:function(e){if(this.hasTypes()&&ja(this.types(),e))return new Ba(ja(this.types(),e),this)}},{key:"ext",value:function(){return this.v1||this.v2?Ra:this.metadata[13]||Ra}}]),e}(),Ua=function(){function e(t,r){Pa(this,e),this._format=t,this.metadata=r}return Ma(e,[{key:"pattern",value:function(){return this._format[0]}},{key:"format",value:function(){return this._format[1]}},{key:"leadingDigitsPatterns",value:function(){return this._format[2]||[]}},{key:"nationalPrefixFormattingRule",value:function(){return this._format[3]||this.metadata.nationalPrefixFormattingRule()}},{key:"nationalPrefixIsOptionalWhenFormattingInNationalFormat",value:function(){return!!this._format[4]||this.metadata.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"nationalPrefixIsMandatoryWhenFormattingInNationalFormat",value:function(){return this.usesNationalPrefix()&&!this.nationalPrefixIsOptionalWhenFormattingInNationalFormat()}},{key:"usesNationalPrefix",value:function(){return!(!this.nationalPrefixFormattingRule()||Wa.test(this.nationalPrefixFormattingRule()))}},{key:"internationalFormat",value:function(){return this._format[5]||this.format()}}]),e}(),Wa=/^\(?\$1\)?$/,Ba=function(){function e(t,r){Pa(this,e),this.type=t,this.metadata=r}return Ma(e,[{key:"pattern",value:function(){return this.metadata.v1?this.type:this.type[0]}},{key:"possibleLengths",value:function(){if(!this.metadata.v1)return this.type[1]||this.metadata.possibleLengths()}}]),e}();function ja(e,t){switch(t){case"FIXED_LINE":return e[0];case"MOBILE":return e[1];case"TOLL_FREE":return e[2];case"PREMIUM_RATE":return e[3];case"PERSONAL_NUMBER":return e[4];case"VOICEMAIL":return e[5];case"UAN":return e[6];case"PAGER":return e[7];case"VOIP":return e[8];case"SHARED_COST":return e[9]}}var za=function(e){return"object"===Oa(e)},Ga=function(e){return Oa(e)};function Ha(e,t){if((t=new Da(t)).hasCountry(e))return t.country(e).countryCallingCode();throw Error("Unknown country: ".concat(e))}function Va(e){var t=e.version;"number"==typeof t?(this.v1=1===t,this.v2=2===t,this.v3=3===t,this.v4=4===t):t?-1===Ia(t,"1.2.0")?this.v2=!0:-1===Ia(t,"1.7.35")?this.v3=!0:this.v4=!0:this.v1=!0}var qa=function(e){return"([".concat(Na,"]{1,").concat(e,"})")};function Za(e){var t="[ \\t,]*",r="[:\\..]?[ \\t,-]*",n="[ \\t]*";return";ext="+qa("20")+"|"+t+"(?:e?xt(?:ensi(?:ó?|ó))?n?|e?xtn?|доб|anexo)"+r+qa("20")+"#?|"+t+"(?:[xx##~~]|int|int)"+r+qa("9")+"#?|[- ]+"+qa("6")+"#|"+n+"(?:,{2}|;)"+r+qa("15")+"#?|"+n+"(?:,)+"+r+qa("9")+"#?"}var Ka=RegExp("^[++]{0,1}(?:["+Sa+"]*["+Na+"]){1,2}$","i"),Ya="[++]{0,1}(?:["+Sa+"]*["+Na+"]){3,}["+Sa+Na+"]*(?:"+Za()+")?",Qa=RegExp("^["+Na+"]{2}$|^"+Ya+"$","i"),Ja=RegExp("(?:"+Za()+")$","i");function Xa(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var ei={0:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9","0":"0","1":"1","2":"2","3":"3","4":"4","5":"5","6":"6","7":"7","8":"8","9":"9","٠":"0","١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","۰":"0","۱":"1","۲":"2","۳":"3","۴":"4","۵":"5","۶":"6","۷":"7","۸":"8","۹":"9"};function ti(e){for(var t,r="",n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Xa(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xa(e,void 0)}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.split(""));!(t=n()).done;){var a=ei[t.value];a&&(r+=a)}return r}function ri(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function ni(e){for(var t,r="",n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return ri(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return ri(e,void 0)}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.split(""));!(t=n()).done;)r+=function(e,t){if("+"===e){if(t)return;return"+"}return ei[e]}(t.value,r)||"";return r}function ai(e,t){return function(e,t,r){var n=r.type(void 0),a=n&&n.possibleLengths()||r.possibleLengths();if(!a)return"IS_POSSIBLE";var i=e.length,o=a[0];return o===i?"IS_POSSIBLE":o>i?"TOO_SHORT":a[a.length-1]<i?"TOO_LONG":a.indexOf(i,1)>=0?"IS_POSSIBLE":"INVALID_LENGTH"}(e,0,t)}function ii(e,t){return"IS_POSSIBLE"===ai(e,t)}function oi(e,t){return e=e||"",RegExp("^(?:"+t+")$").test(e)}function li(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var si=["MOBILE","PREMIUM_RATE","TOLL_FREE","SHARED_COST","VOIP","PERSONAL_NUMBER","PAGER","UAN","VOICEMAIL"];function di(e,t,r){if(t=t||{},e.country){(r=new Da(r)).selectNumberingPlan(e.country,e.countryCallingCode);var n=t.v2?e.nationalNumber:e.phone;if(oi(n,r.nationalNumberPattern())){if(ci(n,"FIXED_LINE",r))return r.type("MOBILE")&&""===r.type("MOBILE").pattern()?"FIXED_LINE_OR_MOBILE":r.type("MOBILE")?ci(n,"MOBILE",r)?"FIXED_LINE_OR_MOBILE":"FIXED_LINE":"FIXED_LINE_OR_MOBILE";for(var a,i=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return li(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return li(e,void 0)}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(si);!(a=i()).done;){var o=a.value;if(ci(n,o,r))return o}}}}function ci(e,t,r){return!(!(t=r.type(t))||!t.pattern())&&!(t.possibleLengths()&&0>t.possibleLengths().indexOf(e.length))&&oi(e,t.pattern())}function ui(e){return e.replace(RegExp("[".concat(Sa,"]+"),"g")," ").trim()}var hi=/(\$\d)/;function pi(e,t,r){var n=r.useInternationalFormat,a=r.withNationalPrefix;r.carrierCode,r.metadata;var i=e.replace(new RegExp(t.pattern()),n?t.internationalFormat():a&&t.nationalPrefixFormattingRule()?t.format().replace(hi,t.nationalPrefixFormattingRule()):t.format());return n?ui(i):i}var mi=/^[\d]+(?:[~\u2053\u223C\uFF5E][\d]+)?$/;function fi(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function gi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function yi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gi(Object(r),!0).forEach((function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var wi={formatExtension:function(e,t,r){return"".concat(e).concat(r.ext()).concat(t)}};function vi(e,t,r,n,a){var i=function(e,t){for(var r,n=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return fi(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fi(e,void 0)}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e);!(r=n()).done;){var a=r.value;if(a.leadingDigitsPatterns().length>0){var i=a.leadingDigitsPatterns()[a.leadingDigitsPatterns().length-1];if(0!==t.search(i))continue}if(oi(t,a.pattern()))return a}}(n.formats(),e);return i?pi(e,i,{useInternationalFormat:"INTERNATIONAL"===r,withNationalPrefix:!i.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!a||!1!==a.nationalPrefix,carrierCode:t,metadata:n}):e}function Ci(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function bi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Ci(Object(r),!0).forEach((function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Ci(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var Ei=function(){var e;function t(e,r,n){if(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),!e)throw TypeError("`country` or `countryCallingCode` not passed");if(!r)throw TypeError("`nationalNumber` not passed");if(!n)throw TypeError("`metadata` not passed");var a,i,o,l=(o=new Da(n),$i(e)?(a=e,o.selectNumberingPlan(a),i=o.countryCallingCode()):i=e,{country:a,countryCallingCode:i}),s=l.country,d=l.countryCallingCode;this.country=s,this.countryCallingCode=d,this.nationalNumber=r,this.number="+"+this.countryCallingCode+this.nationalNumber,this.getMetadata=function(){return n}}return e=[{key:"setExt",value:function(e){this.ext=e}},{key:"getPossibleCountries",value:function(){var e,t,r,n;return this.country?[this.country]:(e=this.countryCallingCode,t=this.nationalNumber,(n=new Da(r=this.getMetadata()).getCountryCodesForCallingCode(e))?n.filter((function(e){var n;return(n=new Da(r)).selectNumberingPlan(e),n.numberingPlan.possibleLengths().indexOf(t.length)>=0})):[])}},{key:"isPossible",value:function(){return function(e,t,r){if(void 0===t&&(t={}),r=new Da(r),t.v2){if(!e.countryCallingCode)throw Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!r.hasCountry(e.country))throw Error("Unknown country: ".concat(e.country));r.country(e.country)}else{if(!e.countryCallingCode)throw Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}}if(r.possibleLengths())return ii(e.phone||e.nationalNumber,r);if(e.countryCallingCode&&r.isNonGeographicCallingCode(e.countryCallingCode))return!0;throw Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){var e,t;return e={v2:!0},t=this.getMetadata(),e=e||{},(t=new Da(t)).selectNumberingPlan(this.country,this.countryCallingCode),t.hasTypes()?void 0!==di(this,e,t.metadata):oi(e.v2?this.nationalNumber:this.phone,t.nationalNumberPattern())}},{key:"isNonGeographic",value:function(){return new Da(this.getMetadata()).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(e){return this.number===e.number&&this.ext===e.ext}},{key:"getType",value:function(){return di(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(e,t){return function(e,t,r,n){if(r=r?yi(yi({},wi),r):wi,n=new Da(n),e.country&&"001"!==e.country){if(!n.hasCountry(e.country))throw Error("Unknown country: ".concat(e.country));n.country(e.country)}else{if(!e.countryCallingCode)return e.phone||"";n.selectNumberingPlan(e.countryCallingCode)}var a,i,o,l,s,d,c,u,h,p,m,f,g,y=n.countryCallingCode(),w=r.v2?e.nationalNumber:e.phone;switch(t){case"NATIONAL":return w?(a=g=vi(w,e.carrierCode,"NATIONAL",n,r),i=e.ext,o=n,l=r.formatExtension,i?l(a,i,o):a):"";case"INTERNATIONAL":return w?(g=vi(w,null,"INTERNATIONAL",n,r),s=g="+".concat(y," ").concat(g),d=e.ext,c=n,u=r.formatExtension,d?u(s,d,c):s):"+".concat(y);case"E.164":return"+".concat(y).concat(w);case"RFC3966":return function(e){var t=e.number,r=e.ext;if(!t)return"";if("+"!==t[0])throw Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(t).concat(r?";ext="+r:"")}({number:"+".concat(y).concat(w),ext:e.ext});case"IDD":if(!r.fromCountry)return;return h=function(e,t,r,n,a){if(Ha(n,a.metadata)===r){var i,o=vi(e,t,"NATIONAL",a);return"1"===r?r+" "+o:o}var l=(void 0,(i=new Da(a.metadata)).selectNumberingPlan(n,undefined),i.defaultIDDPrefix()?i.defaultIDDPrefix():mi.test(i.IDDPrefix())?i.IDDPrefix():void 0);if(l)return"".concat(l," ").concat(r," ").concat(vi(e,null,"INTERNATIONAL",a))}(w,e.carrierCode,y,r.fromCountry,n),p=e.ext,m=n,f=r.formatExtension,p?f(h,p,m):h;default:throw Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}(this,e,t?bi(bi({},t),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(e){return this.format("NATIONAL",e)}},{key:"formatInternational",value:function(e){return this.format("INTERNATIONAL",e)}},{key:"getURI",value:function(e){return this.format("RFC3966",e)}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(),$i=function(e){return/^[A-Z]{2}$/.test(e)},Ti=RegExp("(["+Na+"])");function Ai(e,t,r,n){if(t){var a=new Da(n);a.selectNumberingPlan(t,r);var i=new RegExp(a.IDDPrefix());if(0===e.search(i)){var o=(e=e.slice(e.match(i)[0].length)).match(Ti);if(!(o&&null!=o[1]&&o[1].length>0&&"0"===o[1]))return e}}}function xi(e,t){if(e&&t.numberingPlan.nationalPrefixForParsing()){var r=RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),n=r.exec(e);if(n){var a,i,o,l=n.length-1,s=l>0&&n[l];if(t.nationalPrefixTransformRule()&&s)a=e.replace(r,t.nationalPrefixTransformRule()),l>1&&(i=n[1]);else{var d=n[0];a=e.slice(d.length),s&&(i=n[1])}if(s){var c=e.indexOf(n[1]);e.slice(0,c)===t.numberingPlan.nationalPrefix()&&(o=t.numberingPlan.nationalPrefix())}else o=n[0];return{nationalNumber:a,nationalPrefix:o,carrierCode:i}}}return{nationalNumber:e}}function _i(e,t){var r=xi(e,t),n=r.carrierCode,a=r.nationalNumber;return a!==e&&(oi(e,t.nationalNumberPattern())&&!oi(a,t.nationalNumberPattern())||t.possibleLengths()&&!function(e,t){switch(ai(e,t)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(a,t))?{nationalNumber:e}:{nationalNumber:a,carrierCode:n}}function ki(e,t,r,n){var a=t?Ha(t,n):r;if(0===e.indexOf(a)){(n=new Da(n)).selectNumberingPlan(t,r);var i=e.slice(a.length),o=_i(i,n).nationalNumber,l=_i(e,n).nationalNumber;if(!oi(l,n.nationalNumberPattern())&&oi(o,n.nationalNumberPattern())||"TOO_LONG"===ai(l,n))return{countryCallingCode:a,number:i}}return{number:e}}function Ni(e,t,r,n){if(!e)return{};if("+"!==e[0]){var a,i=Ai(e,t,r,n);if(!i||i===e){if(t||r){var o=ki(e,t,r,n),l=o.countryCallingCode,s=o.number;if(l)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:l,number:s}}return{number:e}}a=!0,e="+"+i}if("0"===e[1])return{};n=new Da(n);for(var d=2;d-1<=3&&d<=e.length;){var c=e.slice(1,d);if(n.hasCallingCode(c))return n.selectNumberingPlan(c),{countryCallingCodeSource:a?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:c,number:e.slice(d)};d++}return{}}function Si(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Ii(e,t){var r=t.countries,n=t.defaultCountry,a=t.metadata;a=new Da(a);for(var i,o=[],l=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Si(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Si(e,void 0)}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r);!(i=l()).done;){var s=i.value;if(a.country(s),a.leadingDigits()){if(e&&0===e.search(a.leadingDigits()))return s}else if(di({phone:e,country:s},void 0,a.metadata)){if(!n||s===n)return s;o.push(s)}}if(o.length>0)return o[0]}function Oi(e,t){var r=t.nationalNumber,n=t.defaultCountry,a=t.metadata,i=a.getCountryCodesForCallingCode(e);if(i)return 1===i.length?i[0]:Ii(r,{countries:i,defaultCountry:n,metadata:a.metadata})}var Pi="(["+Na+"]|[\\-\\.\\(\\)]?)",Mi=RegExp("^\\+"+Pi+"*["+Na+"]"+Pi+"*$","g"),Ri=RegExp("^(["+Na+"]+((\\-)*["+Na+"])*\\.)*[a-zA-Z]+((\\-)*["+Na+"])*\\.?$","g"),Li="tel:",Di=";phone-context=",Fi=RegExp("[++"+Na+"]"),Ui=RegExp("[^"+Na+"#]+$");function Wi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Bi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Wi(Object(r),!0).forEach((function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Wi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function ji(e){return(ji="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Gi(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function Hi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Vi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Hi(Object(r),!0).forEach((function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Hi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function qi(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Zi(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qi(Object(r),!0).forEach((function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function Ki(){var e=function(e){var t,r,n,a=function(e){if(Array.isArray(e))return e}(t=Array.prototype.slice.call(e))||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],o=!0,l=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(i.push(n.value),4!==i.length);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==r.return||r.return()}finally{if(l)throw a}}return i}}(t)||function(e,t){if(e){if("string"==typeof e)return Gi(e,4);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gi(e,4)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=a[0],o=a[1],l=a[2],s=a[3];if("string"!=typeof i)throw TypeError("A text for parsing must be a string.");if(o&&"string"!=typeof o){if("object"!==ji(o))throw Error("Invalid second argument: ".concat(o));l?(r=o,n=l):n=o}else s?(r=l,n=s):(r=void 0,n=l),o&&(r=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?zi(Object(r),!0).forEach((function(t){var n;n=r[t],t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):zi(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({defaultCountry:o},r));return{text:i,options:r,metadata:n}}(arguments),t=e.text,r=e.options,n=e.metadata,a=function(e,t,r){var n;t&&t.defaultCountry&&(n=t.defaultCountry,!r.countries.hasOwnProperty(n))&&(t=Vi(Vi({},t),{},{defaultCountry:void 0}));try{return function(e,t,r){if(t=t||{},r=new Da(r),t.defaultCountry&&!r.hasCountry(t.defaultCountry)){if(t.v2)throw new ka("INVALID_COUNTRY");throw Error("Unknown country: ".concat(t.defaultCountry))}var n,a=function(e,t,r){var n=function(e,t){var r,n=t.extractFormattedPhoneNumber,a=function(e){var t=e.indexOf(Di);if(t<0)return null;var r=t+15;if(r>=e.length)return"";var n=e.indexOf(";",r);return n>=0?e.substring(r,n):e.substring(r)}(e);if(null!==a&&(0===a.length||!Mi.test(a)&&!Ri.test(a)))throw new ka("NOT_A_NUMBER");if(null===a)r=n(e)||"";else{r="","+"===a.charAt(0)&&(r+=a);var i,o=e.indexOf(Li);i=o>=0?o+4:0;var l=e.indexOf(Di);r+=e.substring(i,l)}var s=r.indexOf(";isub=");if(s>0&&(r=r.substring(0,s)),""!==r)return r}(e,{extractFormattedPhoneNumber:function(e){return function(e,t,r){if(e){if(e.length>250){if(r)throw new ka("TOO_LONG");return}if(!1===t)return e;var n=e.search(Fi);if(!(n<0))return e.slice(n).replace(Ui,"")}}(e,r,t)}});if(!n)return{};if(!(n.length>=2&&Qa.test(n)))return Ka.test(n)?{error:"TOO_SHORT"}:{};var a=function(e){var t=e.search(Ja);if(t<0)return{};for(var r=e.slice(0,t),n=e.match(Ja),a=1;a<n.length;){if(n[a])return{number:r,ext:n[a]};a++}}(n);return a.ext?a:{number:n}}(e,t.v2,t.extract),i=a.number,o=a.ext,l=a.error;if(!i){if(t.v2){if("TOO_SHORT"===l)throw new ka("TOO_SHORT");throw new ka("NOT_A_NUMBER")}return{}}var s=function(e,t,r,n){var a,i=Ni(ni(e),t,r,n.metadata),o=i.countryCallingCodeSource,l=i.countryCallingCode,s=i.number;if(l)n.selectNumberingPlan(l);else{if(!s||!t&&!r)return{};n.selectNumberingPlan(t,r),t&&(a=t),l=r||Ha(t,n.metadata)}if(!s)return{countryCallingCodeSource:o,countryCallingCode:l};var d=_i(ni(s),n),c=d.nationalNumber,u=d.carrierCode,h=Oi(l,{nationalNumber:c,defaultCountry:t,metadata:n});return h&&(a=h,"001"===h||n.country(a)),{country:a,countryCallingCode:l,countryCallingCodeSource:o,nationalNumber:c,carrierCode:u}}(i,t.defaultCountry,t.defaultCallingCode,r),d=s.country,c=s.nationalNumber,u=s.countryCallingCode,h=s.countryCallingCodeSource,p=s.carrierCode;if(!r.hasSelectedNumberingPlan()){if(t.v2)throw new ka("INVALID_COUNTRY");return{}}if(!c||c.length<2){if(t.v2)throw new ka("TOO_SHORT");return{}}if(c.length>17){if(t.v2)throw new ka("TOO_LONG");return{}}if(t.v2){var m=new Ei(u,c,r.metadata);return d&&(m.country=d),p&&(m.carrierCode=p),o&&(m.ext=o),m.__countryCallingCodeSource=h,m}var f=!!(t.extended?r.hasSelectedNumberingPlan():d)&&oi(c,r.nationalNumberPattern());return t.extended?{country:d,countryCallingCode:u,carrierCode:p,valid:f,possible:!!f||!(!0!==t.extended||!r.possibleLengths()||!ii(c,r)),phone:c,ext:o}:f?(n={country:d,phone:c},o&&(n.ext=o),n):{}}(e,Bi(Bi({},t),{},{v2:!0}),r)}catch(e){if(!(e instanceof ka))throw e}}(t,r=Zi(Zi({},r),{},{extract:!1}),n);return a&&a.isPossible()||!1}var Yi=function(){var e;function t(e){var r=e.onCountryChange,n=e.onCallingCodeChange;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),this.onCountryChange=r,this.onCallingCodeChange=n}return e=[{key:"reset",value:function(e){var t=e.country,r=e.callingCode;this.international=!1,this.missingPlus=!1,this.IDDPrefix=void 0,this.callingCode=void 0,this.digits="",this.resetNationalSignificantNumber(),this.initCountryAndCallingCode(t,r)}},{key:"resetNationalSignificantNumber",value:function(){this.nationalSignificantNumber=this.getNationalDigits(),this.nationalSignificantNumberMatchesInput=!0,this.nationalPrefix=void 0,this.carrierCode=void 0,this.complexPrefixBeforeNationalSignificantNumber=void 0}},{key:"update",value:function(e){for(var t=0,r=Object.keys(e);t<r.length;t++){var n=r[t];this[n]=e[n]}}},{key:"initCountryAndCallingCode",value:function(e,t){this.setCountry(e),this.setCallingCode(t)}},{key:"setCountry",value:function(e){this.country=e,this.onCountryChange(e)}},{key:"setCallingCode",value:function(e){this.callingCode=e,this.onCallingCodeChange(e,this.country)}},{key:"startInternationalNumber",value:function(e,t){this.international=!0,this.initCountryAndCallingCode(e,t)}},{key:"appendDigits",value:function(e){this.digits+=e}},{key:"appendNationalSignificantNumberDigits",value:function(e){this.nationalSignificantNumber+=e}},{key:"getNationalDigits",value:function(){return this.international?this.digits.slice((this.IDDPrefix?this.IDDPrefix.length:0)+(this.callingCode?this.callingCode.length:0)):this.digits}},{key:"getDigitsWithoutInternationalPrefix",value:function(){return this.international&&this.IDDPrefix?this.digits.slice(this.IDDPrefix.length):this.digits}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}();function Qi(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var Ji=/x/;function Xi(e,t){if(t<1)return"";for(var r="";t>1;)1&t&&(r+=e),t>>=1,e+=e;return r+e}function eo(e,t){return")"===e[t]&&t++,function(e){for(var t=[],r=0;r<e.length;)"("===e[r]?t.push(r):")"===e[r]&&t.pop(),r++;var n=0,a="";t.push(e.length);for(var i=0;i<t.length;i++){var o=t[i];a+=e.slice(n,o),n=o+1}return a}(e.slice(0,t))}function to(e,t,r){var n=r.metadata,a=r.useNationalPrefixFormattingRule,i=r.getSeparatorAfterNationalPrefix,o=pi(e.nationalSignificantNumber,t,{carrierCode:e.carrierCode,useInternationalFormat:e.international,withNationalPrefix:a,metadata:n});if(a||(e.nationalPrefix?o=e.nationalPrefix+i(t)+o:e.complexPrefixBeforeNationalSignificantNumber&&(o=e.complexPrefixBeforeNationalSignificantNumber+" "+o)),ti(o)===e.getNationalDigits())return o}var ro=function(){var e;function t(){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t)}return e=[{key:"parse",value:function(e){if(this.context=[{or:!0,instructions:[]}],this.parsePattern(e),1!==this.context.length)throw Error("Non-finalized contexts left when pattern parse ended");var t=this.context[0],r=t.branches,n=t.instructions;if(r)return{op:"|",args:r.concat([io(n)])};if(0===n.length)throw Error("Pattern is required");return 1===n.length?n[0]:n}},{key:"startContext",value:function(e){this.context.push(e)}},{key:"endContext",value:function(){this.context.pop()}},{key:"getContext",value:function(){return this.context[this.context.length-1]}},{key:"parsePattern",value:function(e){if(!e)throw Error("Pattern is required");var t=e.match(ao);if(t){var r=t[1],n=e.slice(0,t.index),a=e.slice(t.index+r.length);switch(r){case"(?:":n&&this.parsePattern(n),this.startContext({or:!0,instructions:[],branches:[]});break;case")":if(!this.getContext().or)throw Error('")" operator must be preceded by "(?:" operator');if(n&&this.parsePattern(n),0===this.getContext().instructions.length)throw Error('No instructions found after "|" operator in an "or" group');var i=this.getContext().branches;i.push(io(this.getContext().instructions)),this.endContext(),this.getContext().instructions.push({op:"|",args:i});break;case"|":if(!this.getContext().or)throw Error('"|" operator can only be used inside "or" groups');if(n&&this.parsePattern(n),!this.getContext().branches){if(1!==this.context.length)throw Error('"branches" not found in an "or" group context');this.getContext().branches=[]}this.getContext().branches.push(io(this.getContext().instructions)),this.getContext().instructions=[];break;case"[":n&&this.parsePattern(n),this.startContext({oneOfSet:!0});break;case"]":if(!this.getContext().oneOfSet)throw Error('"]" operator must be preceded by "[" operator');this.endContext(),this.getContext().instructions.push({op:"[]",args:function(e){for(var t=[],r=0;r<e.length;){if("-"===e[r]){if(0===r||r===e.length-1)throw Error("Couldn't parse a one-of set pattern: ".concat(e));for(var n=e[r-1].charCodeAt(0)+1,a=e[r+1].charCodeAt(0)-1,i=n;i<=a;)t.push(String.fromCharCode(i)),i++}else t.push(e[r]);r++}return t}(n)});break;default:throw Error("Unknown operator: ".concat(r))}a&&this.parsePattern(a)}else{if(no.test(e))throw Error("Illegal characters found in a pattern: ".concat(e));this.getContext().instructions=this.getContext().instructions.concat(e.split(""))}}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(),no=/[\(\)\[\]\?\:\|]/,ao=RegExp("(\\||\\(\\?\\:|\\)|\\[|\\])");function io(e){return 1===e.length?e[0]:e}function oo(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return lo(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return lo(e,void 0)}}(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function lo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var so=function(){var e;function t(e){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),this.matchTree=(new ro).parse(e)}return e=[{key:"match",value:function(e){var t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).allowOverflow;if(!e)throw Error("String is required");var r=function e(t,r,n){if("string"==typeof r){var a=t.join("");return 0===r.indexOf(a)?t.length===r.length?{match:!0,matchedChars:t}:{partialMatch:!0}:0===a.indexOf(r)?n&&t.length>r.length?{overflow:!0}:{match:!0,matchedChars:t.slice(0,r.length)}:void 0}if(Array.isArray(r)){for(var i=t.slice(),o=0;o<r.length;){var l=e(i,r[o],n&&o===r.length-1);if(!l)return;if(l.overflow)return l;if(!l.match){if(l.partialMatch)return{partialMatch:!0};throw Error("Unsupported match result:\n".concat(JSON.stringify(l,null,2)))}if(0===(i=i.slice(l.matchedChars.length)).length)return o===r.length-1?{match:!0,matchedChars:t}:{partialMatch:!0};o++}return n?{overflow:!0}:{match:!0,matchedChars:t.slice(0,t.length-i.length)}}switch(r.op){case"|":for(var s,d,c=oo(r.args);!(d=c()).done;){var u=e(t,d.value,n);if(u){if(u.overflow)return u;if(u.match)return{match:!0,matchedChars:u.matchedChars};if(!u.partialMatch)throw Error("Unsupported match result:\n".concat(JSON.stringify(u,null,2)));s=!0}}return s?{partialMatch:!0}:void 0;case"[]":for(var h,p=oo(r.args);!(h=p()).done;){var m=h.value;if(t[0]===m)return 1===t.length?{match:!0,matchedChars:t}:n?{overflow:!0}:{match:!0,matchedChars:[m]}}return;default:throw Error("Unsupported instruction tree: ".concat(r))}}(e.split(""),this.matchTree,!0);if(r&&r.match&&delete r.matchedChars,!r||!r.overflow||t)return r}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}();function co(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return uo(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return uo(e,void 0)}}(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function uo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var ho=Xi("9",15),po=/[- ]/,mo=RegExp("["+Sa+"]*\\$1["+Sa+"]*(\\$\\d["+Sa+"]*)*$"),fo=function(){var e;function t(e){e.state;var r=e.metadata;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),this.metadata=r,this.resetFormat()}return e=[{key:"resetFormat",value:function(){this.chosenFormat=void 0,this.template=void 0,this.nationalNumberTemplate=void 0,this.populatedNationalNumberTemplate=void 0,this.populatedNationalNumberTemplatePosition=-1}},{key:"reset",value:function(e,t){this.resetFormat(),e?(this.isNANP="1"===e.callingCode(),this.matchingFormats=e.formats(),t.nationalSignificantNumber&&this.narrowDownMatchingFormats(t)):(this.isNANP=void 0,this.matchingFormats=[])}},{key:"format",value:function(e,t){var r=this;if("IS_POSSIBLE"===ai(t.nationalSignificantNumber,this.metadata))for(var n,a=co(this.matchingFormats);!(n=a()).done;){var i=n.value,o=function(e,t,r){var n=r.metadata,a=r.shouldTryNationalPrefixFormattingRule,i=r.getSeparatorAfterNationalPrefix;if(new RegExp("^(?:".concat(t.pattern(),")$")).test(e.nationalSignificantNumber))return function(e,t,r){var n=r.metadata,a=r.shouldTryNationalPrefixFormattingRule,i=r.getSeparatorAfterNationalPrefix;if(e.nationalSignificantNumber,e.international,e.nationalPrefix,e.carrierCode,a(t)){var o=to(e,t,{useNationalPrefixFormattingRule:!0,getSeparatorAfterNationalPrefix:i,metadata:n});if(o)return o}return to(e,t,{useNationalPrefixFormattingRule:!1,getSeparatorAfterNationalPrefix:i,metadata:n})}(e,t,{metadata:n,shouldTryNationalPrefixFormattingRule:a,getSeparatorAfterNationalPrefix:i})}(t,i,{metadata:this.metadata,shouldTryNationalPrefixFormattingRule:function(e){return r.shouldTryNationalPrefixFormattingRule(e,{international:t.international,nationalPrefix:t.nationalPrefix})},getSeparatorAfterNationalPrefix:function(e){return r.getSeparatorAfterNationalPrefix(e)}});if(o)return this.resetFormat(),this.chosenFormat=i,this.setNationalNumberTemplate(o.replace(/\d/g,"x"),t),this.populatedNationalNumberTemplate=o,this.populatedNationalNumberTemplatePosition=this.template.lastIndexOf("x"),o}return this.formatNationalNumberWithNextDigits(e,t)}},{key:"formatNationalNumberWithNextDigits",value:function(e,t){var r=this.chosenFormat,n=this.chooseFormat(t);if(n)return n===r?this.formatNextNationalNumberDigits(e):this.formatNextNationalNumberDigits(t.getNationalDigits())}},{key:"narrowDownMatchingFormats",value:function(e){var t=this,r=e.nationalSignificantNumber,n=e.nationalPrefix,a=e.international,i=r.length-3;i<0&&(i=0),this.matchingFormats=this.matchingFormats.filter((function(e){return t.formatSuits(e,a,n)&&t.formatMatches(e,r,i)})),this.chosenFormat&&-1===this.matchingFormats.indexOf(this.chosenFormat)&&this.resetFormat()}},{key:"formatSuits",value:function(e,t,r){return!(r&&!e.usesNationalPrefix()&&!e.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!t&&!r&&e.nationalPrefixIsMandatoryWhenFormattingInNationalFormat())}},{key:"formatMatches",value:function(e,t,r){var n=e.leadingDigitsPatterns().length;if(0===n)return!0;r=Math.min(r,n-1);var a=e.leadingDigitsPatterns()[r];if(t.length<3)try{return void 0!==new so(a).match(t,{allowOverflow:!0})}catch(e){return console.error(e),!0}return new RegExp("^(".concat(a,")")).test(t)}},{key:"getFormatFormat",value:function(e,t){return t?e.internationalFormat():e.format()}},{key:"chooseFormat",value:function(e){for(var t,r,n=co(this.matchingFormats.slice());!(r=n()).done&&"break"!=(t=r.value,this.chosenFormat===t?"break":mo.test(this.getFormatFormat(t,e.international))?this.createTemplateForFormat(t,e)?(this.chosenFormat=t,"break"):(this.matchingFormats=this.matchingFormats.filter((function(e){return e!==t})),"continue"):"continue"););return this.chosenFormat||this.resetFormat(),this.chosenFormat}},{key:"createTemplateForFormat",value:function(e,t){if(!(e.pattern().indexOf("|")>=0)){var r=this.getTemplateForFormat(e,t);return r?(this.setNationalNumberTemplate(r,t),!0):void 0}}},{key:"getSeparatorAfterNationalPrefix",value:function(e){return this.isNANP||e&&e.nationalPrefixFormattingRule()&&po.test(e.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(e,t){var r=e.IDDPrefix,n=e.missingPlus;return r?t&&!1===t.spacing?r:r+" ":n?"":"+"}},{key:"getTemplate",value:function(e){if(this.template){for(var t=-1,r=0,n=e.international?this.getInternationalPrefixBeforeCountryCallingCode(e,{spacing:!1}):"";r<n.length+e.getDigitsWithoutInternationalPrefix().length;)t=this.template.indexOf("x",t+1),r++;return eo(this.template,t+1)}}},{key:"setNationalNumberTemplate",value:function(e,t){this.nationalNumberTemplate=e,this.populatedNationalNumberTemplate=e,this.populatedNationalNumberTemplatePosition=-1,t.international?this.template=this.getInternationalPrefixBeforeCountryCallingCode(t).replace(/[\d\+]/g,"x")+Xi("x",t.callingCode.length)+" "+e:this.template=e}},{key:"getTemplateForFormat",value:function(e,t){var r=t.nationalSignificantNumber,n=t.international,a=t.nationalPrefix,i=t.complexPrefixBeforeNationalSignificantNumber,o=e.pattern();o=o.replace(/\[([^\[\]])*\]/g,"\\d").replace(/\d(?=[^,}][^,}])/g,"\\d");var l=ho.match(o)[0];if(!(r.length>l.length)){var s=RegExp("^"+o+"$"),d=r.replace(/\d/g,"9");s.test(d)&&(l=d);var c,u=this.getFormatFormat(e,n);if(this.shouldTryNationalPrefixFormattingRule(e,{international:n,nationalPrefix:a})){var h=u.replace(hi,e.nationalPrefixFormattingRule());if(ti(e.nationalPrefixFormattingRule())===(a||"")+ti("$1")&&(u=h,c=!0,a))for(var p=a.length;p>0;)u=u.replace(/\d/,"x"),p--}var m=l.replace(new RegExp(o),u).replace(/9/g,"x");return c||(i?m=Xi("x",i.length)+" "+m:a&&(m=Xi("x",a.length)+this.getSeparatorAfterNationalPrefix(e)+m)),n&&(m=ui(m)),m}}},{key:"formatNextNationalNumberDigits",value:function(e){var t=function(e,t,r){for(var n,a=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return Qi(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qi(e,void 0)}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r.split(""));!(n=a()).done;){var i=n.value;if(0>e.slice(t+1).search(Ji))return;t=e.search(Ji),e=e.replace(Ji,i)}return[e,t]}(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,e);if(t)return this.populatedNationalNumberTemplate=t[0],this.populatedNationalNumberTemplatePosition=t[1],eo(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1);this.resetFormat()}},{key:"shouldTryNationalPrefixFormattingRule",value:function(e,t){var r=t.international,n=t.nationalPrefix;if(e.nationalPrefixFormattingRule()){var a=e.usesNationalPrefix();if(a&&n||!a&&!r)return!0}}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}();function go(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],o=!0,l=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(i.push(n.value),!t||i.length!==t);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==r.return||r.return()}finally{if(l)throw a}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return yo(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return yo(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function yo(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var wo=RegExp("^["+Sa+Na+"]+$","i"),vo="(?:[++]["+Sa+Na+"]*|["+Sa+Na+"]+)",Co=RegExp("[^"+Sa+Na+"]+.*$"),bo=/[^\d\[\]]/,Eo=function(){var e;function t(e){var r=e.defaultCountry,n=e.defaultCallingCode,a=e.metadata,i=e.onNationalSignificantNumberChange;!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),this.defaultCountry=r,this.defaultCallingCode=n,this.metadata=a,this.onNationalSignificantNumberChange=i}return e=[{key:"input",value:function(e,t){var r,n,a,i,o,l=(a=(n=go("+"===(r=function(e){var t,r=e.search(vo);if(!(r<0))return"+"===(e=e.slice(r))[0]&&(t=!0,e=e.slice(1)),e=e.replace(Co,""),t&&(e="+"+e),e}(e)||"")[0]?[r.slice(1),!0]:[r],2))[0],i=n[1],wo.test(a)||(a=""),[a,i]),s=go(l,2),d=s[0],c=s[1],u=ti(d);return c&&(t.digits||(t.startInternationalNumber(),u||(o=!0))),u&&this.inputDigits(u,t),{digits:u,justLeadingPlus:o}}},{key:"inputDigits",value:function(e,t){var r=t.digits,n=r.length<3&&r.length+e.length>=3;if(t.appendDigits(e),n&&this.extractIddPrefix(t),this.isWaitingForCountryCallingCode(t)){if(!this.extractCountryCallingCode(t))return}else t.appendNationalSignificantNumberDigits(e);t.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(t.getNationalDigits(),(function(e){return t.update(e)}))}},{key:"isWaitingForCountryCallingCode",value:function(e){var t=e.international,r=e.callingCode;return t&&!r}},{key:"extractCountryCallingCode",value:function(e){var t=Ni("+"+e.getDigitsWithoutInternationalPrefix(),this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),r=t.countryCallingCode,n=t.number;if(r)return e.setCallingCode(r),e.update({nationalSignificantNumber:n}),!0}},{key:"reset",value:function(e){if(e){this.hasSelectedNumberingPlan=!0;var t=e._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=t&&bo.test(t)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(e,t){if(this.hasSelectedNumberingPlan){var r=xi(e,this.metadata),n=r.nationalPrefix,a=r.nationalNumber,i=r.carrierCode;if(a!==e)return this.onExtractedNationalNumber(n,i,a,e,t),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(e,t,r){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(e,r);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var n=xi(e,this.metadata),a=n.nationalPrefix,i=n.nationalNumber,o=n.carrierCode;if(i!==t)return this.onExtractedNationalNumber(a,o,i,e,r),!0}}},{key:"onExtractedNationalNumber",value:function(e,t,r,n,a){var i,o,l=n.lastIndexOf(r);if(l>=0&&l===n.length-r.length){o=!0;var s=n.slice(0,l);s!==e&&(i=s)}a({nationalPrefix:e,carrierCode:t,nationalSignificantNumber:r,nationalSignificantNumberMatchesInput:o,complexPrefixBeforeNationalSignificantNumber:i}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(e){return!!this.extractAnotherNationalSignificantNumber(e.getNationalDigits(),e.nationalSignificantNumber,(function(t){return e.update(t)}))||(this.extractIddPrefix(e)||this.fixMissingPlus(e)?(this.extractCallingCodeAndNationalSignificantNumber(e),!0):void 0)}},{key:"extractIddPrefix",value:function(e){var t=e.international,r=e.IDDPrefix,n=e.digits;if(e.nationalSignificantNumber,!t&&!r){var a=Ai(n,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);return void 0!==a&&a!==n?(e.update({IDDPrefix:n.slice(0,n.length-a.length)}),this.startInternationalNumber(e,{country:void 0,callingCode:void 0}),!0):void 0}}},{key:"fixMissingPlus",value:function(e){if(!e.international){var t=ki(e.digits,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),r=t.countryCallingCode;if(t.number,r)return e.update({missingPlus:!0}),this.startInternationalNumber(e,{country:e.country,callingCode:r}),!0}}},{key:"startInternationalNumber",value:function(e,t){var r=t.country,n=t.callingCode;e.startInternationalNumber(r,n),e.nationalSignificantNumber&&(e.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(e){this.extractCountryCallingCode(e)&&this.extractNationalSignificantNumber(e.getNationalDigits(),(function(t){return e.update(t)}))}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}();function $o(e){return($o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function To(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var Ao=function(){var e;function t(e,r){!function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,t),this.metadata=new Da(r);var n,a=function(e){if(Array.isArray(e))return e}(n=this.getCountryAndCallingCode(e))||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,i=[],o=!0,l=!1;try{for(r=r.call(e);!(o=(n=r.next()).done)&&(i.push(n.value),2!==i.length);o=!0);}catch(e){l=!0,a=e}finally{try{o||null==r.return||r.return()}finally{if(l)throw a}}return i}}(n)||function(e,t){if(e){if("string"==typeof e)return To(e,2);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return To(e,2)}}(n)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),i=a[0],o=a[1];this.defaultCountry=i,this.defaultCallingCode=o,this.reset()}return e=[{key:"getCountryAndCallingCode",value:function(e){var t,r;return e&&("object"===$o(e)?(t=e.defaultCountry,r=e.defaultCallingCode):t=e),t&&!this.metadata.hasCountry(t)&&(t=void 0),[t,r]}},{key:"input",value:function(e){var t,r=this.parser.input(e,this.state),n=r.digits;if(r.justLeadingPlus)this.formattedOutput="+";else if(n){if(this.determineTheCountryIfNeeded(),this.state.nationalSignificantNumber&&this.formatter.narrowDownMatchingFormats(this.state),this.metadata.hasSelectedNumberingPlan()&&(t=this.formatter.format(n,this.state)),void 0===t&&this.parser.reExtractNationalSignificantNumber(this.state)){this.determineTheCountryIfNeeded();var a=this.state.getNationalDigits();a&&(t=this.formatter.format(a,this.state))}this.formattedOutput=t?this.getFullNumber(t):this.getNonFormattedNumber()}return this.formattedOutput}},{key:"reset",value:function(){var e=this;return this.state=new Yi({onCountryChange:function(t){e.country=t},onCallingCodeChange:function(t,r){e.metadata.selectNumberingPlan(r,t),e.formatter.reset(e.metadata.numberingPlan,e.state),e.parser.reset(e.metadata.numberingPlan)}}),this.formatter=new fo({state:this.state,metadata:this.metadata}),this.parser=new Eo({defaultCountry:this.defaultCountry,defaultCallingCode:this.defaultCallingCode,metadata:this.metadata,state:this.state,onNationalSignificantNumberChange:function(){e.determineTheCountryIfNeeded(),e.formatter.reset(e.metadata.numberingPlan,e.state)}}),this.state.reset({country:this.defaultCountry,callingCode:this.defaultCallingCode}),this.formattedOutput="",this}},{key:"isInternational",value:function(){return this.state.international}},{key:"getCallingCode",value:function(){if(this.isInternational())return this.state.callingCode}},{key:"getCountryCallingCode",value:function(){return this.getCallingCode()}},{key:"getCountry",value:function(){if(this.state.digits)return this._getCountry()}},{key:"_getCountry",value:function(){return this.state.country}},{key:"determineTheCountryIfNeeded",value:function(){this.state.country&&!this.isCountryCallingCodeAmbiguous()||this.determineTheCountry()}},{key:"getFullNumber",value:function(e){if(this.isInternational()){var t,r=this.state.callingCode;return t=r?e?"".concat(r," ").concat(e):r:"".concat(this.state.getDigitsWithoutInternationalPrefix()),this.formatter.getInternationalPrefixBeforeCountryCallingCode(this.state,{spacing:!!t})+t}return e}},{key:"getNonFormattedNationalNumberWithPrefix",value:function(){var e=this.state,t=e.nationalSignificantNumber,r=e.complexPrefixBeforeNationalSignificantNumber,n=e.nationalPrefix,a=t,i=r||n;return i&&(a=i+a),a}},{key:"getNonFormattedNumber",value:function(){var e=this.state.nationalSignificantNumberMatchesInput;return this.getFullNumber(e?this.getNonFormattedNationalNumberWithPrefix():this.state.getNationalDigits())}},{key:"getNonFormattedTemplate",value:function(){var e=this.getNonFormattedNumber();if(e)return e.replace(/[\+\d]/g,"x")}},{key:"isCountryCallingCodeAmbiguous",value:function(){var e=this.state.callingCode,t=this.metadata.getCountryCodesForCallingCode(e);return t&&t.length>1}},{key:"determineTheCountry",value:function(){this.state.setCountry(Oi(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,defaultCountry:this.defaultCountry,metadata:this.metadata}))}},{key:"getNumberValue",value:function(){var e=this.state,t=e.digits,r=e.callingCode,n=e.country,a=e.nationalSignificantNumber;if(t)return this.isInternational()?r?"+"+r+a:"+"+t:n||r?"+"+(n?this.metadata.countryCallingCode():r)+a:void 0}},{key:"getNumber",value:function(){var e=this.state,t=e.nationalSignificantNumber,r=e.carrierCode,n=e.callingCode,a=this._getCountry();if(t&&(a||n)){if(a&&a===this.defaultCountry){var i=new Da(this.metadata.metadata);i.selectNumberingPlan(a);var o=i.numberingPlan.callingCode(),l=this.metadata.getCountryCodesForCallingCode(o);if(l.length>1){var s=Ii(t,{countries:l,defaultCountry:this.defaultCountry,metadata:this.metadata.metadata});s&&(a=s)}}var d=new Ei(a||n,t,this.metadata.metadata);return r&&(d.carrierCode=r),d}}},{key:"isPossible",value:function(){var e=this.getNumber();return!!e&&e.isPossible()}},{key:"isValid",value:function(){var e=this.getNumber();return!!e&&e.isValid()}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}],function(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}();function xo(e){return new Da(e).getCountries()}function _o(e,t,r){if(t[e])return new Ei(e,t[e],r)}function ko(e){return Ao.call(this,e,va)}function No(){return Ca(Ha,arguments)}ko.prototype=Object.create(Ao.prototype,{}),ko.prototype.constructor=ko;let So=(e,t)=>function(){return Ca(Ki,arguments)}(String(e),t),Io=(e,t)=>`+${No(t)} ${e}`,Oo=e=>`*${e.replaceAll("-","").slice(-4)}`,Po=function(){return Ca(xo,arguments)}().map((e=>({code:e,callCode:No(e)}))),Mo={buy:"CARD",send:"CRYPTO_ACCOUNT"},Ro={USDC:"2b92315d-eab7-5bef-84fa-089a131333f5",ETH:"d85dce9b-5b73-5c3c-8978-522ce1d1c1b4",BTC:"5b71fc48-3dd3-540c-809b-f8c94d0e68b5",SOL:"4f039497-3af8-5bb3-951c-6df9afa9be1c",POL:"026bcc1e-9163-591c-a709-34dd18b2e7a1"};const Lo="/api/v1/sessions",Do="/api/v1/sessions/logout",Fo="/api/v1/sessions/fork/recover",Uo="/api/v1/oauth/init",Wo="/api/v1/oauth/authenticate",Bo="/api/v1/oauth/link",jo="/api/v1/analytics_events";class zo{async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");try{return await this.api.post("/api/v1/custom_jwt_account/authenticate",{token:this.meta.token})}catch(e){throw $(e)}}async link(){throw Error("Unimplemented")}constructor(e){this.meta={token:e}}}function Go(e){return crypto.getRandomValues(new Uint8Array(e))}class Ho{get(e){let t=localStorage.getItem(e);return null===t?void 0:JSON.parse(t)}put(e,t){void 0!==t?localStorage.setItem(e,JSON.stringify(t)):this.del(e)}del(e){localStorage.removeItem(e)}getKeys(){return Object.entries(localStorage).map((([e])=>e))}}function Vo(){try{let e="privy:__session_storage__test",t=new Ho;return t.put(e,"blobby"),t.del(e),!0}catch(e){return!1}}var qo="undefined"!=typeof window&&window.localStorage?new Ho:new class{get(e){return this._cache[e]}put(e,t){void 0!==t?this._cache[e]=t:this.del(e)}del(e){delete this._cache[e]}getKeys(){return Object.keys(this._cache)}constructor(){this._cache={}}};class Zo{getOrCreateGuestCredential(e){let t=re(e);if(Vo()){if(qo.get(t))return qo.get(t);{let e=te.encode(Go(32));return qo.put(t,e),e}}return te.encode(Go(32))}async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");try{return await this.api.post("/api/v1/guest/authenticate",{guest_credential:this.meta.guestCredential})}catch(e){throw $(e)}}async link(){throw Error("Linking is not supported for the guest flow")}constructor(e){this.meta={guestCredential:this.getOrCreateGuestCredential(e)}}}function Ko(){return te.encode(Go(36))}function Yo(){return Ko()}async function Qo(e,t="S256"){if("S256"!=t)return e;{let t=await async function(e){let t=(new TextEncoder).encode(e);return new Uint8Array(await crypto.subtle.digest("SHA-256",t))}(e);return te.encode(t)}}class Jo{addCaptchaToken(e){this.meta.captchaToken=e}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new E("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if("undefined"===this.meta.authorizationCode)throw new E("User denied confirmation during OAuth flow");let e=function(){let e=qo.get(ne);if(!e)throw new E("Authentication error.");return e}();try{let t=await this.api.post(Wo,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:e,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});return qo.del(ne),qo.del(ae),qo.del(ie),t}catch(e){let t=$(e);if(t.privyErrorCode)throw new E(t.message||"Invalid code during OAuth flow.",void 0,t.privyErrorCode);if("User denied confirmation during OAuth flow"===t.message)throw new E("Invalid code during oauth flow.",void 0,T.OAUTH_USER_DENIED);throw new E("Invalid code during OAuth flow.",void 0,T.UNKNOWN_AUTH_ERROR)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new E("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if("undefined"===this.meta.authorizationCode)throw new E("User denied confirmation during OAuth flow");let e=qo.get(ne);if(!e)throw new E("Authentication error.");try{let t=await this.api.post(Bo,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:e});return qo.del(ne),t}catch(e){throw $(e)}}async getAuthorizationUrl(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.provider)throw new E("Provider must be set when initializing OAuth authentication.");let e=Ko();qo.put(ne,e);let t=Yo();qo.put(oe,t);let r=await Qo(e);this.meta.withPrivyUi||qo.put(ae,!0),this.meta.disableSignup&&qo.put(ie,!0);let n=vl(this.meta.withPrivyUi);try{return await this.api.post(Uo,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:r,state_code:t},{headers:{...n}})}catch(e){throw $(e)}}constructor(e){this.meta=e}}function Xo(e){return e.charAt(0).toUpperCase()+e.slice(1)}const el=({style:r,...n})=>e("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...r},...n,children:[t("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),t("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]}),tl=({style:r,...n})=>e("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...r},...n,children:[t("g",{clipPath:"url(#clip0)",children:t("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),t("defs",{children:t("clipPath",{id:"clip0",children:t("rect",{width:"71",height:"55",fill:"white"})})})]}),rl=({style:e,...r})=>t("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...r,children:t("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})}),nl=({style:e})=>t(Kr,{style:{color:"var(--privy-color-error)",...e}}),al=({style:r,...n})=>e("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...r},...n,children:[t("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),t("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),t("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),t("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});function il(r){return e("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...r,children:[e("defs",{children:[e("linearGradient",{id:"b",children:[t("stop",{offset:"0",stopColor:"#3771c8"}),t("stop",{stopColor:"#3771c8",offset:".128"}),t("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),e("linearGradient",{id:"a",children:[t("stop",{offset:"0",stopColor:"#fd5"}),t("stop",{offset:".1",stopColor:"#fd5"}),t("stop",{offset:".5",stopColor:"#ff543e"}),t("stop",{offset:"1",stopColor:"#c837ab"})]}),t("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),t("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),t("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),t("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),t("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}function ol({style:e,...r}){return t("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...r,children:t("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:t("g",{transform:"scale(5.12,5.12)",children:t("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}function ll(r){return e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...r,children:[t("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),t("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}function sl(r){return e("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...r,children:[t("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),t("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),t("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}const dl=({style:e,...r})=>t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...r,children:t("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})});let cl={google:{name:"Google",component:al},discord:{name:"Discord",component:tl},github:{name:"Github",component:rl},linkedin:{name:"LinkedIn",component:ol},twitter:{name:"Twitter",component:dl},spotify:{name:"Spotify",component:ll},instagram:{name:"Instagram",component:il},tiktok:{name:"Tiktok",component:sl},apple:{name:"Apple",component:el}};const ul=e=>e in cl?cl[e]:{name:"Unknown",component:nl};function hl(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),r=e.get("privy_oauth_state"),n=e.get("privy_oauth_provider");if(!t||!r||!n)return{inProgress:!1};let a=!1;try{a=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:t,stateCode:r,provider:n,withPrivyUi:!qo.get(ae),popupFlow:null!==window.opener&&a,disableSignup:!!qo.get(ie)}}function pl(){let e=new URL(window.location.href);e.searchParams.delete("privy_oauth_code"),e.searchParams.delete("privy_oauth_provider"),e.searchParams.delete("privy_oauth_state"),qo.del(oe),window.history.replaceState({},"",e)}class ml{execute(e){return null===this.promise&&(this.promise=(async()=>{try{return await this.fn(e)}finally{this.promise=null}})()),this.promise}constructor(e){this.promise=null,this.fn=e}}const fl=({address:e,chainId:t,nonce:r})=>`${window.location.host} wants you to sign in with your Ethereum account:\n${e}\n\nBy signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees.\n\nURI: ${window.location.origin}\nVersion: 1\nChain ID: ${t}\nNonce: ${r}\nIssued At: ${(new Date).toISOString()}\nResources:\n- https://privy.io`;class gl{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,chainId:this.wallet.chainId,address:this.wallet.address,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new E("SiweFlow has no client instance");try{let{message:e,signature:t}=await this.sign();return await this.client.authenticateWithSiweInternal({message:e,signature:t,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw $(e)}}async link(){if(!this.client)throw new E("SiweFlow has no client instance");try{let{message:e,signature:t}=await this.sign();return await this.client.linkWithSiweInternal({message:e,signature:t,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw $(e)}}async sign(){if(!this.client)throw new E("SiweFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new E("Could not prepare SIWE message");let e=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:e}}async _getNonceOnce(){if(!this.client)throw new E("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new E("SiweFlow has no client instance");let e=this.wallet.address,t=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=fl({address:e,chainId:t,nonce:this.nonce}),this.preparedMessage}constructor(e,t,r,n=!1){this._meta={disableSignup:!1},this.getNonceOnce=new ml(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=r,this.client=t,this._meta.disableSignup=n}}class yl{async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new E("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post("/api/v1/passwordless_sms/authenticate",{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw $(e)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new E("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post("/api/v1/passwordless_sms/link",{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw $(e)}}async sendSmsCode({phoneNumber:e,captchaToken:t,withPrivyUi:r}){if(!this.api)throw new E("Auth flow has no API instance");if(e&&(this.meta.phoneNumber=e),t&&(this.meta.captchaToken=t),!this.meta.phoneNumber)throw new E("phone nNumber must be set when initialzing authentication.");let n=vl(r);try{return await this.api.post("/api/v1/passwordless_sms/init",{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken},{headers:{...n}})}catch(e){throw $(e)}}constructor({phoneNumber:e,captchaToken:t,disableSignup:r}){this.meta={phoneNumber:e,captchaToken:t,disableSignup:r??!1}}}class wl extends yl{async link(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new E("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post("/api/v1/passwordless_sms/update",{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw $(e)}}constructor(e,t,r){super({phoneNumber:t,captchaToken:r}),this.meta={phoneNumber:t,captchaToken:r,oldPhoneNumber:e,disableSignup:!1}}}function vl(e){return e?{"privy-ui":"t"}:void 0}class Cl{async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new E("Email and email code must be set prior to calling authenticate.");try{return await this.api.post("/api/v1/passwordless/authenticate",{email:this.meta.email,code:this.meta.emailCode,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw $(e)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new E("Email and email code must be set prior to calling authenticate.");try{return await this.api.post("/api/v1/passwordless/link",{email:this.meta.email,code:this.meta.emailCode})}catch(e){throw $(e)}}async sendCodeEmail({email:e,captchaToken:t,withPrivyUi:r}){if(!this.api)throw new E("Auth flow has no API instance");if(e&&(this.meta.email=e),t&&(this.meta.captchaToken=t),!this.meta.email)throw new E("Email must be set when initialzing authentication.");let n=vl(r);try{return await this.api.post("/api/v1/passwordless/init",{email:this.meta.email,token:this.meta.captchaToken},{headers:{...n}})}catch(e){throw $(e)}}constructor({email:e,captchaToken:t,disableSignup:r}){this.meta={email:e,captchaToken:t,disableSignup:r??!1}}}class bl extends Cl{async link(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new E("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post("/api/v1/passwordless/update",{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(e){throw $(e)}}constructor(e,t,r){super({email:t,captchaToken:r}),this.meta={email:t,captchaToken:r,oldAddress:e,disableSignup:!1}}}const El=e=>{let t;try{t=new URL(e).hostname}catch(e){return}for(let[e,r]of Object.entries($l))if(t.includes(r.hostname))return{walletClientType:e,entry:r}},$l={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}},bybit_wallet:{id:"15c8b91ade1a4e58f3ce4e7a0dd7f42b47db0c8df7e0d84f63eb39bcb96c4e0f",displayName:"Bybit Wallet",hostname:"bybit.com",mobile:{}}};function Tl(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}let Al="WALLETCONNECT_DEEPLINK_CHOICE";function xl(e){return e.startsWith("http://")||e.startsWith("https://")}function _l(e,t){if(xl(e))return kl(e,t);let r=e;return r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),{redirect:`${r}wc?uri=${encodeURIComponent(t)}`,href:r}}function kl(e,t){if(!xl(e))return _l(e,t);let r=e;return r.endsWith("/")||(r=`${r}/`),{redirect:`${r}wc?uri=${encodeURIComponent(t)}`,href:r}}function Nl(e,t){window.open(e,t,"noreferrer noopener")}class Sl{get meta(){return this._meta}async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.channelToken)throw new E("Auth flow must be initialized first");try{let e=await this.api.post("/api/v1/farcaster/authenticate",{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"});if(!e)throw new E("No response from authentication");return e}catch(e){throw $(e)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");try{return await this.api.post("/api/v1/farcaster/link",{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(e){throw $(e)}}async _startChannelOnce(){if(!this.api)throw new E("Auth flow has no API instance");let e=await this.api.post("/api/v1/farcaster/init",{token:this.captchaToken});w&&!v&&e.connect_uri&&Nl(e.connect_uri,"_blank"),this._meta={...this._meta,connectUri:e.connect_uri,channelToken:e.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new E("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new E("Auth flow has no API instance");if(!this.meta.channelToken)throw new E("Auth flow must be initialized first");let e=await this.api.get("/api/v1/farcaster/status",{headers:{"farcaster-channel-token":this.meta.channelToken}});return"completed"===e.state&&(this.message=e.message,this.signature=e.signature,this.fid=e.fid,!0)}constructor(e,t=!1){this._meta={disableSignup:!1},this.captchaToken=e,this.startChannelOnce=new ml(this._startChannelOnce.bind(this)),this.pollForReady=new ml(this._pollForReady.bind(this)),this._meta.disableSignup=t}}class Il{async initAuthenticationFlow(e){if(!this.api)throw new E("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute(e)}async initLinkFlow(){if(!this.api)throw new E("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){let e=await import("@simplewebauthn/browser");if(!this.api)throw new E("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new E("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let t=await e.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options));return this.meta.setPasskeyAuthState?.({status:"submitting-response"}),await this.api.post("/api/v1/passkeys/authenticate",{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(t)})}catch(e){if("NotAllowedError"===e.name)throw new E("Passkey request timed out or rejected by user.",void 0,T.PASSKEY_NOT_ALLOWED);throw $(e)}}async link(){let e=await import("@simplewebauthn/browser");if(!this.api)throw new E("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new E("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let t=this.meta.initLinkResponse.options,r=await e.startRegistration(this._transformInitLinkOptionsToCamelCase(t));return this.meta.setPasskeyAuthState?.({status:"submitting-response"}),await this.api.post("/api/v1/passkeys/link",{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(r)})}catch(e){if("NotAllowedError"===e.name)throw new E("Passkey request timed out or rejected by user.",void 0,T.PASSKEY_NOT_ALLOWED);throw $(e)}}async _initAuthenticateOnce(e){if(!this.api)throw new E("Auth flow has no API instance");let t=vl(e);return await this.api.post("/api/v1/passkeys/authenticate/init",{token:this.meta.captchaToken},{headers:{...t}})}async _initLinkOnce(){if(!this.api)throw new E("Auth flow has no API instance");return await this.api.post("/api/v1/passkeys/link/init",{})}_transformInitLinkOptionsToCamelCase(e){return{rp:e.rp,user:{id:e.user.id,name:e.user.name,displayName:e.user.display_name},challenge:e.challenge,pubKeyCredParams:e.pub_key_cred_params.map((e=>({type:e.type,alg:e.alg}))),timeout:e.timeout,excludeCredentials:e.exclude_credentials?.map((e=>({id:e.id,type:e.type,transports:e.transports}))),authenticatorSelection:{authenticatorAttachment:e.authenticator_selection?.authenticator_attachment,requireResidentKey:e.authenticator_selection?.require_resident_key,residentKey:e.authenticator_selection?.resident_key,userVerification:e.authenticator_selection?.user_verification},attestation:e.attestation,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props?.rk,hmacCreateSecret:e.extensions?.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(e){return{id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,attestation_object:e.response.attestationObject,authenticator_data:e.response.authenticatorData},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}_transformInitAuthenticateOptionsToCamelCase(e){return{rpId:e.rp_id,challenge:e.challenge,allowCredentials:e.allow_credentials?.map((e=>({id:e.id,type:e.type,transports:e.transports})))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification}}_transformAuthenticationResponseToSnakeCase(e){return{id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}constructor({captchaToken:e,setPasskeyAuthState:t}){this.initAuthenticateOnce=new ml(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new ml(this._initLinkOnce.bind(this)),this.meta={captchaToken:e,setPasskeyAuthState:t}}}class Ol{get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType,disableSignup:this._meta.disableSignup}}async authenticate(){if(!this.client)throw new E("SiwsFlow has no client instance");try{let{message:e,signature:t}=await this.sign();return await this.client.authenticateWithSiwsInternal({message:e,signature:t,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw $(e)}}async link(){if(!this.client)throw new E("SiwsFlow has no client instance");try{let{message:e,signature:t}=await this.sign();return await this.client.linkWithSiwsInternal({message:e,signature:t,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw $(e)}}async sign(){if(!this.client)throw new E("SiwsFlow has no client instance");if(await this.buildMessage(),!this.preparedMessage)throw new E("Could not prepare SIWS message");if(!this.wallet.signMessage)throw new E("Wallet does not support signMessage");let e=await this.wallet.signMessage(Buffer.from(this.preparedMessage));return{message:this.preparedMessage,signature:Buffer.from(e).toString("base64")}}async _getNonceOnce(){if(!this.client)throw new E("SiwsFlow has no client instance");return await this.client.generateSiwsNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildMessage(){if(!this.client)throw new E("SiwsFlow has no client instance");let e=this.wallet.address;return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=(({address:e,nonce:t})=>`${window.location.host} wants you to sign in with your Solana account:\n${e}\n\nYou are proving you own ${e}.\n\nURI: ${window.location.origin}\nVersion: 1\nChain ID: mainnet\nNonce: ${t}\nIssued At: ${(new Date).toISOString()}\nResources:\n- https://privy.io`)({address:e,nonce:this.nonce}),this.preparedMessage}constructor(e,t,r,n=!1){this._meta={disableSignup:!1},this.getNonceOnce=new ml(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=r,this.client=t,this._meta.disableSignup=n}}const Pl=h({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:x,setError:x,setExecuting:x,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:x,reset:x,execute:x});class Ml extends A{constructor(e,t,r){super(e||"Captcha failed"),this.type="Captcha",t instanceof Error&&(this.cause=t),this.privyErrorCode=r}}const Rl=({children:e,id:r,captchaSiteKey:n,captchaEnabled:a})=>{let i=s(null),[o,l]=d(),[u,h]=d(),[p,m]=d(!1),f=c((()=>a?p||o||u?!p||o||u?o&&!u?{status:"success",token:o}:u?{status:"error",error:u}:{status:"ready"}:{status:"loading"}:{status:"ready"}:{status:"disabled"}),[a,o,u,p]);return t(Pl.Provider,{value:{...f,ref:i,enabled:a,siteKey:n,appId:r,setToken:l,setError:h,setExecuting:m,remove(){a&&(i.current?.remove(),m(!1),h(void 0),l(void 0))},reset(){a&&(i.current?.reset(),m(!1),h(void 0),l(void 0))},execute(){a&&(m(!0),i.current?.execute())},async waitForResult(){if(!a)return"";try{return await le((()=>i.current?.getResponse()),{interval:200,timeout:2e4})}catch(e){throw new Ml("Captcha failed",null,T.CAPTCHA_TIMEOUT)}}},children:e})},Ll=()=>u(Pl);class Dl{async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");try{return await this.api.post("/api/v1/telegram/authenticate",{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData,mode:this.meta.disableSignup?"no-signup":"login-or-sign-up"})}catch(e){throw $(e)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");try{return await this.api.post("/api/v1/telegram/link",{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(e){throw $(e)}}constructor(e,t=!1){this.meta={disableSignup:!1},this.meta={captchaToken:e,disableSignup:!1},this.meta.disableSignup=t}}function Fl(e){let t={detail:"",retryable:!1};return e?.privyErrorCode===T.LINKED_TO_ANOTHER_USER&&(t.detail="This account has already been linked to another user."),e?.privyErrorCode===T.DISALLOWED_LOGIN_METHOD&&(t.detail="Login with Telegram not allowed."),e?.privyErrorCode===T.INVALID_DATA&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode===T.CANNOT_LINK_MORE_OF_TYPE&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode===T.INVALID_CREDENTIALS&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode===T.TOO_MANY_REQUESTS&&(t.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode===T.TOO_MANY_REQUESTS&&e.message.includes("rate limit")&&(t.detail="Request limit reached for Telegram. Please wait a moment and try again."),e instanceof Ml&&(t.retryable=!0,t.detail="Something went wrong. Try again."),t}function Ul(){let e=new URL(window.location.href);e.searchParams.delete("id"),e.searchParams.delete("hash"),e.searchParams.delete("auth_date"),e.searchParams.delete("first_name"),e.searchParams.delete("last_name"),e.searchParams.delete("username"),e.searchParams.delete("photo_url"),e.hash="",window.history.replaceState({},"",e)}class Wl{static parse(e){try{return new Wl(e)}catch(e){return null}}static throwIfNotWellFormedJwt(e){return ee.decodeJwt(e),e}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(e=0){return Date.now()>=1e3*(this.expiration-e)}constructor(e){this.value=e,this._decoded=ee.decodeJwt(e)}}class Bl extends Wl{static parse(e){try{return new Bl(e)}catch(e){return null}}get appId(){return this._decoded.aid?this._decoded.aid:this.audience}}const jl=({style:r,...n})=>e("svg",{viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...r},...n,children:[t("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]});function zl(e){return"ethereum"===e.type}function Gl(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let n=e[r],a=t[r];if(n?.address!==a?.address||n&&a&&zl(n)&&zl(a)&&n?.chainId!==a?.chainId||n?.connectorType!==a?.connectorType||n?.connectedAt!==a?.connectedAt||n?.walletClientType!==a?.walletClientType||n?.isConnected!==a?.isConnected||n?.linked!==a?.linked)return!1}return!0}const Hl=(e,t)=>e.rpcTimeouts&&e.rpcTimeouts[t]||se;class Vl{on(e,t){if(this.walletProvider)return this.walletProvider.on(e,t);this._subscriptions.push({eventName:e,listener:t})}async request(e){if(!this.walletProvider)throw new _(`A wallet request of type ${e.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(e),this.walletTimeout()]).catch((e=>{throw Ft(e)}))}constructor(e,t){this.removeListener=(e,t)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(e,t)}catch(e){console.warn("Unable to remove wallet provider listener")}},this.walletTimeout=(e=new Ut,t=this.rpcTimeoutDuration)=>new Promise(((r,n)=>setTimeout((()=>{n(e)}),t))),this.setWalletProvider=e=>{this.walletProvider&&this._subscriptions.forEach((e=>{this.removeListener(e.eventName,e.listener)})),this.walletProvider=e,this._subscriptions.forEach((e=>{this.walletProvider?.on(e.eventName,e.listener)}))},this.walletProvider=e,this.rpcTimeoutDuration=t||se,this._subscriptions=[]}}class ql extends Vl{constructor(e){super(e,e.rpcTimeoutDuration)}}class Zl extends Vl{sendAsync(e,t){throw Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}constructor(e){super(e,e.rpcTimeoutDuration)}}let Kl;function Yl(e){return"ethereum"===e.chainType}class Ql extends Wt{buildConnectedWallet(e,t,r,a){let o=async()=>!!this.wallets.find((t=>n(t.address)===n(e)));return{type:"ethereum",address:n(e),chainId:t,meta:r,imported:a,switchChain:async r=>{let a,i;if(!o)throw new _("Wallet is not currently connected.");let l=this.wallets.find((t=>n(t.address)===n(e)))?.chainId;if(!l)throw new _("Unable to determine current chainId.");if("number"==typeof r?(a=`0x${r.toString(16)}`,i=r):(a=r,i=Number(r)),l===de(a))return;let s=this.chains.find((e=>e.id===i));if(!s)throw new _(`Unsupported chainId: ${r}`);let d=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:a}]})};try{return await d()}catch(e){if(((e,t)=>"coinbase_wallet"===t?e.message.includes("addEthereumChain"):4902===e.code||e.message?.includes("4902"))(e,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:a,chainName:s.name,nativeCurrency:s.nativeCurrency,rpcUrls:[s.rpcUrls.default?.http[0]??""],blockExplorerUrls:[s.blockExplorers?.default.url??""]}]}),d();if("rainbow"===this.walletClientType&&e.message?.includes("wallet_switchEthereumChain"))throw new _(`Rainbow does not support the chainId ${t}`);throw e}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:o,getEthereumProvider:async()=>{if(!await o())throw new _("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await o())throw new _("Wallet is not currently connected.");return new i(new ql(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await o())throw new _("Wallet is not currently connected.");return new Zl(this.proxyProvider)},sign:async e=>{if(!await o())throw new _("Wallet is not currently connected.");return await this.sign(e)},disconnect:()=>{this.disconnect()}}}async syncAccounts(e){let t,r=e;try{if(void 0===r){let e=await ce((()=>this.proxyProvider.request({method:"eth_accounts"})),{maxAttempts:10,delayMs:500});console.debug(`eth_accounts for ${this.walletClientType}:`,e),Array.isArray(e)&&(r=e)}}catch(e){console.debug("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",e)}if(!r||!Array.isArray(r)||r.length<=0||!r[0])return;let a=r[0],i=n(a),o=[];if("privy"===this.walletClientType){let e=qo.get(ue(i));this.chains.find((t=>t.id===Number(e)))||(qo.del(ue(i)),e=null),t=e||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:t}]})}catch(e){console.warn(`Unable to switch embedded wallet to chain ID ${t} on initialization`)}}else try{let e=await ce((()=>this.proxyProvider.request({method:"eth_chainId"})),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,e),"string"==typeof e)t=e;else{if("number"!=typeof e)throw Error("Invalid chainId returned from provider");t=`0x${e.toString(16)}`}}catch(e){console.warn(`Failed to get chainId from provider, defaulting to ${he}`,e),t=he}let l=de(t);if(!o.find((e=>n(e.address)===i))){let e={name:this.walletBranding.name,icon:"string"==typeof this.walletBranding.icon?this.walletBranding.icon:void 0,id:this.walletBranding.id};o.push(this.buildConnectedWallet(n(a),l,e,"embedded_imported"===this.connectorType))}Gl(o,this.wallets)||(this.wallets=o,this.emit("walletsUpdated"))}async getConnectedWallet(){let e=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort(((e,t)=>t.connectedAt-e.connectedAt)).find((t=>e.find((e=>n(e)===n(t.address)))))||null}async isConnected(){let e=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(e)&&e.length>0}async sign(e){return await this.connect({showPrompt:!1}),new i(new ql(this.proxyProvider)).getSigner().signMessage(e)}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}constructor(e,t,r,n){super(e),this.chainType="ethereum",this.onAccountsChanged=e=>{0===e.length?this.onDisconnect():this.syncAccounts(e)},this.onChainChanged=e=>{this.wallets.forEach((t=>{t.chainId=de(e),"privy"===this.walletClientType&&qo.put(ue(t.address),e)})),this.emit("walletsUpdated")},this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")},this.onConnect=()=>{this.connected=!0,this.syncAccounts()},this.wallets=[],this.walletClientType=e,this.chains=t,this.defaultChain=r,this.rpcConfig=n,this.rpcTimeoutDuration=Hl(n,e),this.connected=!1,this.initialized=!1}}let Jl=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],Xl=(e,t)=>e.makeWeb3Provider({options:t});class es extends Ql{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:"data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PScwIDAgMTAyNCAxMDI0JyBmaWxsPSdub25lJyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHN0eWxlPSdoZWlnaHQ6MjhweDt3aWR0aDoyOHB4Jz48cmVjdCB3aWR0aD0nMTAyNCcgaGVpZ2h0PScxMDI0JyBmaWxsPScjMDA1MkZGJyByeD0nMTAwJyByeT0nMTAwJz48L3JlY3Q+PHBhdGggZmlsbC1ydWxlPSdldmVub2RkJyBjbGlwLXJ1bGU9J2V2ZW5vZGQnIGQ9J00xNTIgNTEyQzE1MiA3MTAuODIzIDMxMy4xNzcgODcyIDUxMiA4NzJDNzEwLjgyMyA4NzIgODcyIDcxMC44MjMgODcyIDUxMkM4NzIgMzEzLjE3NyA3MTAuODIzIDE1MiA1MTIgMTUyQzMxMy4xNzcgMTUyIDE1MiAzMTMuMTc3IDE1MiA1MTJaTTQyMCAzOTZDNDA2Ljc0NSAzOTYgMzk2IDQwNi43NDUgMzk2IDQyMFY2MDRDMzk2IDYxNy4yNTUgNDA2Ljc0NSA2MjggNDIwIDYyOEg2MDRDNjE3LjI1NSA2MjggNjI4IDYxNy4yNTUgNjI4IDYwNFY0MjBDNjI4IDQwNi43NDUgNjE3LjI1NSAzOTYgNjA0IDM5Nkg0MjBaJyBmaWxsPSd3aGl0ZSc+PC9wYXRoPjwvc3ZnPg==",id:"com.coinbase.wallet"}}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||0===e.length||!e[0])throw new _("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([e[0]])}catch(e){throw Ft(e)}}updateConnectionPreference(e){this.connectionOptions=e,this.walletClientType="smartWalletOnly"===e?"coinbase_smart_wallet":"coinbase_wallet",this.proxyProvider.setWalletProvider(Xl(Kl,this.connectionOptions))}constructor(e,t,r,n,a,i){if(super("coinbase_wallet",e,t,r),this.connectorType="coinbase_wallet",this.displayName="Coinbase Wallet",this.proxyProvider=new Vl(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=n.coinbaseWallet.connectionOptions??"all",this.walletClientType="smartWalletOnly"===this.connectionOptions?"coinbase_smart_wallet":"coinbase_wallet","coinbase_smart_wallet"===this.walletClientType&&(this.displayName="Coinbase Smart Wallet"),!Kl){let r=[t.id].concat(e.map((e=>e.id))),n="eoaOnly"!==this.connectionOptions?r.filter((e=>!Jl.includes(e))):[];n.length>0&&!n.every((e=>pe.has(e)))&&console.info(`The configured chains are not supported by Coinbase Smart Wallet: ${n.join(", ")}`),Kl=new Lt({appName:a,appLogoUrl:i,appChainIds:r})}this.proxyProvider.setWalletProvider(Xl(Kl,this.connectionOptions))}}const ts=({...e})=>t("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})});class rs extends Ql{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[me(e?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:ts,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}constructor({provider:e,chains:t,defaultChain:r,rpcConfig:n,imported:a,walletIndex:i}){super("privy",t,r,n),this.connectorType="embedded",this.proxyProvider=e,this.walletIndex=i,a&&(this.connectorType="embedded_imported"),this.subscribeListeners()}}const ns=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4","csw_signUserOperation","secp256k1_sign"];class as extends Error{constructor(e,t,r){super(e),this.code=t,this.data=r}}class is extends Rt{async handleSendTransaction(e){if(!e.params||!Array.isArray(e.params))throw new as(`Invalid params for ${e.method}`,4200);let t=e.params[0];if(!await zC()||!this.address)throw new as("Disconnected",4900);return(await VC(t,void 0,void 0,this.address)).hash}handleSwitchEthereumChain(e){let t;if(!e.params||!Array.isArray(e.params))throw new as(`Invalid params for ${e.method}`,4200);if("string"==typeof e.params[0])t=e.params[0];else{if(!("chainId"in e.params[0])||"string"!=typeof e.params[0].chainId)throw new as(`Invalid params for ${e.method}`,4200);t=e.params[0].chainId}this.chainId=Number(t),this.provider=fe(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",t)}async handlePersonalSign(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for personal_sign");let t=e.params[0],r=e.params[1];return await GC(t,void 0,r)}async handleSignedTypedData(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_signTypedData_v4");let t=e.params[0],r="string"==typeof e.params[1]?JSON.parse(e.params[1]):e.params[1];return await HC(ge(r),void 0,t)}async handleEstimateGas(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_estimateGas");delete e.params[0].gasPrice,delete e.params[0].maxFeePerGas,delete e.params[0].maxPriorityFeePerGas;let t={...e.params[0],chainId:me(this.chainId)};try{return await this.provider.send("eth_estimateGas",[t])}catch(e){console.warn(`Gas estimation failed with error: ${e}. Retrying gas estimation by omitting the 'from' address`);try{return delete t.from,await this.provider.send("eth_estimateGas",[t])}catch(t){throw console.warn(`Gas estimation failed with error: ${t} when omitting the 'from' address`),e}}}async request(e){switch(console.debug("Embedded1193Provider.request() called with args",e),e.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return me(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(e);case"eth_sendTransaction":return this.handleSendTransaction(e);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(e);case"personal_sign":return this.handlePersonalSign(e);case"eth_signTypedData_v4":return this.handleSignedTypedData(e)}if(!(e=>ns.includes(e))(e.method))return this.provider.send(e.method,e.params);{let t=await zC();if(await qC(),!t||!this.address)throw new as("Disconnected",4900);try{return(await this.walletProxy.rpc({accessToken:t,entropyId:this.entropyId,entropyIdVerifier:this.entropyIdVerifier,chainType:"ethereum",hdWalletIndex:this.walletIndex,request:{method:e.method,params:e.params}})).response.data}catch(e){throw console.error(e),new as("Disconnected",4900)}}}constructor({walletProxy:e,address:t,entropyId:r,entropyIdVerifier:n,rpcConfig:a,chains:i,appId:o,chainId:l=1,walletIndex:s}){super(),this.walletProxy=e,this.address=t,this.entropyId=r,this.entropyIdVerifier=n,this.chainId=l,this.rpcConfig=a,this.chains=i,this.provider=fe(l,this.chains,a,{appId:o}),this.rpcTimeoutDuration=Hl(a,"privy"),this.appId=o,this.walletIndex=s}}const os=({style:e,...r})=>t("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...r,children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})}),ls=({style:r,...n})=>e("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...r},...n,children:[t("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),t("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),t("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),t("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),t("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),t("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),t("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),t("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),t("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),t("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),t("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),t("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),t("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]}),ss=({style:r,...n})=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...r},...n,children:[t("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]});function ds(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}var cs=0;class us extends Ql{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn(`Programmatic disconnect with ${this.providerDetail.info.name} is not yet supported.`)}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||0===e.length||!e[0])throw new _("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw Ft(e)}}constructor(e,t,r,n,a){super(a||"unknown",e,t,r),this.connectorType="injected",this.proxyProvider=new Vl(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=n;let i=n.provider;this.proxyProvider.setWalletProvider(i)}}var hs="__private_"+cs+++"__walletBranding";class ps extends Ql{async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return ds(this,hs)[hs]??{name:"Browser Extension",icon:os,id:"extension"}}disconnect(){console.warn("Programmatic disconnect with browser wallets is not yet supported.")}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||0===e.length||!e[0])throw new _("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw Ft(e)}}constructor(e,t,r,n,a){super(a??"unknown",e,t,r),Object.defineProperty(this,hs,{writable:!0,value:void 0}),this.connectorType="injected",this.proxyProvider=new Vl(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(n),"metamask"===a?ds(this,hs)[hs]={name:"MetaMask",icon:ls,id:"io.metamask"}:"phantom"===a&&(ds(this,hs)[hs]={name:"Phantom",icon:ss,id:"phantom"})}}class ms extends us{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{w||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||0===e.length||!e[0])throw new _("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw Ft(e)}}}class fs extends Ql{get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw Error("connect called for an uninstalled wallet via the NullConnector")}disconnect(){throw Error("disconnect called for an uninstalled wallet via the NullConnector")}promptConnection(e){throw Error(`promptConnection called for an uninstalled wallet via the NullConnector for ${e}`)}constructor(e,t){super(e,[],t,{}),this.connectorType="null",this.proxyProvider=new Vl(void 0,se),this.connectorType=e}}class gs extends fs{get walletBranding(){return{name:"Phantom",icon:"data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHdpZHRoPScxMDgnIGhlaWdodD0nMTA4JyB2aWV3Qm94PScwIDAgMTA4IDEwOCcgZmlsbD0nbm9uZScgc3R5bGU9J2hlaWdodDoyOHB4O3dpZHRoOjI4cHgnPjxyZWN0IHdpZHRoPScxMDgnIGhlaWdodD0nMTA4JyByeD0nMjMnIGZpbGw9JyNBQjlGRjInPjwvcmVjdD48cGF0aCBmaWxsLXJ1bGU9J2V2ZW5vZGQnIGNsaXAtcnVsZT0nZXZlbm9kZCcgZD0nTTQ2LjUyNjcgNjkuOTIyOUM0Mi4wMDU0IDc2Ljg1MDkgMzQuNDI5MiA4NS42MTgyIDI0LjM0OCA4NS42MTgyQzE5LjU4MjQgODUuNjE4MiAxNSA4My42NTYzIDE1IDc1LjEzNDJDMTUgNTMuNDMwNSA0NC42MzI2IDE5LjgzMjcgNzIuMTI2OCAxOS44MzI3Qzg3Ljc2OCAxOS44MzI3IDk0IDMwLjY4NDYgOTQgNDMuMDA3OUM5NCA1OC44MjU4IDgzLjczNTUgNzYuOTEyMiA3My41MzIxIDc2LjkxMjJDNzAuMjkzOSA3Ni45MTIyIDY4LjcwNTMgNzUuMTM0MiA2OC43MDUzIDcyLjMxNEM2OC43MDUzIDcxLjU3ODMgNjguODI3NSA3MC43ODEyIDY5LjA3MTkgNjkuOTIyOUM2NS41ODkzIDc1Ljg2OTkgNTguODY4NSA4MS4zODc4IDUyLjU3NTQgODEuMzg3OEM0Ny45OTMgODEuMzg3OCA0NS42NzEzIDc4LjUwNjMgNDUuNjcxMyA3NC40NTk4QzQ1LjY3MTMgNzIuOTg4NCA0NS45NzY4IDcxLjQ1NTYgNDYuNTI2NyA2OS45MjI5Wk04My42NzYxIDQyLjU3OTRDODMuNjc2MSA0Ni4xNzA0IDgxLjU1NzUgNDcuOTY1OCA3OS4xODc1IDQ3Ljk2NThDNzYuNzgxNiA0Ny45NjU4IDc0LjY5ODkgNDYuMTcwNCA3NC42OTg5IDQyLjU3OTRDNzQuNjk4OSAzOC45ODg1IDc2Ljc4MTYgMzcuMTkzMSA3OS4xODc1IDM3LjE5MzFDODEuNTU3NSAzNy4xOTMxIDgzLjY3NjEgMzguOTg4NSA4My42NzYxIDQyLjU3OTRaTTcwLjIxMDMgNDIuNTc5NUM3MC4yMTAzIDQ2LjE3MDQgNjguMDkxNiA0Ny45NjU4IDY1LjcyMTYgNDcuOTY1OEM2My4zMTU3IDQ3Ljk2NTggNjEuMjMzIDQ2LjE3MDQgNjEuMjMzIDQyLjU3OTVDNjEuMjMzIDM4Ljk4ODUgNjMuMzE1NyAzNy4xOTMxIDY1LjcyMTYgMzcuMTkzMUM2OC4wOTE2IDM3LjE5MzEgNzAuMjEwMyAzOC45ODg1IDcwLjIxMDMgNDIuNTc5NVonIGZpbGw9JyNGRkZERjgnPjwvcGF0aD48L3N2Zz4=",id:"phantom"}}constructor(e){super("phantom",e)}}const ys=({style:r,...n})=>{let{app:a}=ye();return e("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...r},...n,children:[t("rect",{width:"28",height:"28",rx:"3",fill:"dark"===a?.appearance.palette.colorScheme?"#3396ff":"#141414"}),t("g",{clipPath:"url(#clip0_1765_9946)",children:t("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),t("defs",{children:t("clipPath",{id:"clip0_1765_9946",children:t("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})};class ws extends Ql{async initialize(){let e=await this.createProvider();if(this.provider=e,this.proxyProvider.setWalletProvider(e),this.subscribeListeners(),e.session){if(this.walletProvider?.session?.peer.metadata.url){let e=El(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=e?.entry,this.walletClientType=e?.walletClientType||"unknown"}this.connected=!0,await this.syncAccounts()}this.initialized=!0,this.emit("initialized");let{WalletConnectModal:t}=await import("@walletconnect/modal");this.modal=new t({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal((e=>{e.open||this.walletProvider?.session||!this.onQrModalClosed||this.onQrModalClosed()}))}async connect(e){return e.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){if("metamask"===this.walletClientType)return{name:"MetaMask",icon:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAHdElNRQfoDAIVMQ8VNW19AAAGKUlEQVRYw+2WTWxcVxXHf+feN98Tf43j2KmduMEibZOilEjNl9KmImrCoipSkSohIQQSQkJhSdmAAEV0ka742CF11WURsEJRHSg4TWooUhPagkgcO/6IY8ffnhk/z8y9h8Wbsd/4AwEbFnCkJ7173zn/c87/nHPfhf91kcbLt892cX9RebrbcOaA4ViPoVyNvvVemfqPwMdfewyAbAI+nPbcGPfcnvYc6hCuDM0CEDSUDeAUkw54wRqW2gvmL+WHvgIwWQdCofeNqX/JaVwKnSZpZ/zTaUtbpaa/FUSbGPjOc3tRFbyyNzC809sifSf77FBvq/zKKb+rOR23ZtNoJ1a2Oq45SAQctMILk8v6heEJd3ZqRe87z4sizKkqb1x/FDGgGlXCCMe9cvj+sqbLVffyyT7z0uMd5l5gZVCVXwPDmTSL6SSUf9TsUBXWKlAOaQdOJAJe9sr5kXl/aHjCm7myIpAR4ThwVUSaSyARwxeAtACPSso7d515Zj8Dx3rMQCrgK6rcdo5rIsxvayaBmqMAfE6Ez4Q1MremPR8+cKzXou9ABriIcJU6nxsBKKSBo3HA0MHwhGO2pJzuM5lCVk54zwnVDcAmBryPEpkvKTfHPaOLHmWb7lGUNBA2BYBoiMpYU1ZRYIzMexbXlFN9hoGCadR3W81rDu7Oe96f8CyWFZHYmG3KmKoPRUwzA0R9cGunzhaBhbIyOBKxcarfUtjTrLO8BjfHHbcfeiq17QzF5FbDOUTTF5ePgPJuQaw7+NOkZ/COI6xG2QkQVmHwjuODSU/F/VPn5bqPRgvUA9Ami9qu5gq5JPS2CFYiEAWsRHu5ZAx5Z6k1NER1swQi2rAL60/LFr+oQmdWeK7fcrBdmrIUgSNdhlxC+MOYY373+jfwN2ja0kpMAbNAl2rk2EiUdXdeONlr2ZuPUtdYplqnor9dyCYsw5OOh0WlXAGv9VJF/maBB02lbby8drYLIKnws8Dw9da0sL9VeLxD6GkRkgg2xnA+C8lE9F6pQrG8CeiAKsqDFWV0QXmwrCyHSs3zc4FLQGXbvwDgVL+pAD/p75CXulukuyUlGAOlMoSV5vJuYyBWLgO0poT9B4TP9sLKuvJwRadH5/XHCJX3x/yG/kYAP7iYwER89AGtjbo7B0urnnBdMUJDh0RgSCejRbWqFIsRqNfoSaeEdNJgDLRlhPaMtD25jz7g44tPWK4MRThNY1g3ftErmUZWxsCenMU7KK55xpYDZouCd2zMofPwqCiMLgcUyx7vIhtjNhnySqaO3SQGYOX1g411AXh+a+vmMlBoS7AY5Hlrro+bqwWsFbTejNYIN1Y7eGuuj4VEnkJbglyGneQc0AkQvt6zWYJa6AhSABwDDm+1MkbJZoVn81UGuqdZWrMYa4CIdmMN5w+FfDFToiPhEB/Z7CCH6z4GS2uxo9iYOv2e5wWycQvntd5knkDgsaxnf6ZKpbo55QmrPNURIgLVWnTarFeis8CaptMgq3DOGgatjTVhzUVjZAwl3RJ4qayU1xxGhEK7pWWPYA0EwWZDBkHU/TUHK0VlftHhVclmLLls83EkQsl7SKdiATRUvOc6sAps/GpSKWEtFJxXqg6KJU86JcyEUK5E0eaS0JVWwnWlWhOcU4wVUilhS0Krqgxta8LC5cnG+hPg73EFa4R8zmINGBFq+QOMdFzg0rUcr75d5dW3q1y6luNexwVq+QMYI1gL+ZzZSj917E8AOi9PbTIQk0XgPeB4fDOVIHRtbQvhk5/fJ33P2kezZSZX32O1GhVyYhVmO0/R8tR5dOKPLv3X38ykKHYQXXLicgNYiG9sDQDg98A3gCXg48hIr7Pv06NLPWe+msR+K591uW9++RV8fajFCLlsmhLpUqXnzE/bFu69ycwHh0DOAKeBI0A78O5WZ7ErmSDRYTsEfAn4GzBG/X5QDfKMTdz/7r7Ozj9bY77/zNHDRzfOZgFBP1peXfnhzPzcL48EeQfcAa4STVU/8EQdu7kp44vJHe70Dbl74jKqSmAtNec+JSKngfow4VT1RmDtSM05RISB4e/tihW/0u9+d9lB3v3Fm6gooruZRbfIc6987d+B/b/8d+UfeVGT8xvC5akAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjQtMTItMDJUMjE6NDk6MTArMDA6MDB60KjYAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDI0LTEyLTAyVDIxOjQ5OjEwKzAwOjAwC40QZAAAACh0RVh0ZGF0ZTp0aW1lc3RhbXAAMjAyNC0xMi0wMlQyMTo0OToxNSswMDowMA6gHhwAAAAASUVORK5CYII=",id:"io.metamask"};let e=this.walletProvider?.session?.peer.metadata.icons?.[0];return{name:we(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:"string"==typeof e?e:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAIGNIUk0AAHomAACAhAAA+gAAAIDoAAB1MAAA6mAAADqYAAAXcJy6UTwAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAHdElNRQfoDAIVODUC+w+GAAAGsUlEQVRYw6WXbYwWVxXHf+fOLAtCXYS2QJdIaClipGCTknXXNqBQMVHbfmhItH4Aral+IAEaG03UxJgYKQJGTUxtDWjaxDSNtcZqIGDwpRuW1oYiVqpdpZSlpC3qysu+PHPP3w/3mXnmeXZbPzjJZO7cefn/z/mfe865xlscq3dGDIguGiHLaMQVLja4s87FShcLo5jtApdddnHexUmHIy475JmdUkPRAQMu7gzT4ljnxJpdk0QPmMFkyAKN2OfOFpc2uuh1J3MZDrjAvXmVEQUuoosRxw642FcEG7IoDxiFxNiu8NYE+vcUYIFYRKKs113bXWx2Z34CoQZsVHOiCZ7mopdzdsFhv8NexEgRDHMxUSNREbh1bwNZwBsFblmfu/a4a6AEENYO5i3AOoEWeEUCF4MOOxBDMQAOk99OJALA2u80sBCwWGBZWG/yRwMaCAbBIAsQTJT3gea1OWfNeaPzvjoHEI85rA8ObtB1v7cIdJkIHgkh9AXpocy0LJjIKvB2wPpZB0v3wkrw5jdNEjeYeMhFX3BAyfn2ke9NUrgB9LrrcZcGJFCld4fWNddXbvbWfWzGR6xJFZsBGh0cBh3bBIxIEGTQ3W0h4NuDaSAzyAxCmGq11Vzf5uaa1aG8p+WFtrEYQGwvjICJkAEqvC+YNmcmMlMNvEaCdrcbyUvQAWDTjVuESHObM6cPGWHmzDwLaEtmzG9Z3qF1zUpXmuuZBb1z4bqeNC6f0WE1NtUTwHzEloiy3BvFisy0sYoLlQtT6XW15md2Qf9SY+2Ngfdca/TMSm/9ewz+/Boc/It45h/i4kSTsKw90SQJsPTvjSZbkWemDW7qTRZ0JEYJWSKxZJ7xmf6M224MzMzbX1s8F1YugjtvMg6eErt/4/z1jUrz1rXUKxnZC2zIg2mdBTK1mFUOKC1fOt/48kdzVixIz86Nij+eEacvpJWyZJ5xy7th8VzjjpuMJfMCW58QL73ekXPVlhsyE+vyzFiplJyauEIyrGIquruMq7qTxk+dcB495rzyTzFepCUWLIFv/kBg081Gd55WUk1IDGFTS89K++TDYxddzKnWcbluHd450xgdh7EGrOo1rr868PMTzqWJRGZ2d8oB/xpL33Xnxl2rjeNn4blXRXduzJ4B5y+28kWscAwXl+yeR654FFZPHoUb710YuPeDOUdPO48di1xptKpeEeHqOcYXNwQKGd88EDk3mqxtxPSfGRlsXRtYt8z4ytPOH/7eqpg1Aso7fYKgK4NPrMpYvsC4/poMA34yVJIQC3sCD9yecdsNyaV5yPj6ryJnR1PAvSNP4J+/1cgDfLbfePaMGGtM7Qdyl12WmKOmXgKKAp54vmBRTxfLrjE+tSYjBPjRM5FrrzIeuD2jf2lLzw8vN4JlfPVp581LsO1DgXv7jSzAiXPw/d+JiYLpjsu26Yfjf5O0rF5WoxsNT9G/bX0XKxakmPjlSee6HlizJJXSX7/oRDc+vjKR+f2wODcKd78/gR8/C9uedF44myJxmhh4OY/ipMQyqaWxmjn95TfEroMFOzbkvG+RceeqViPx1Aln1yEnOow1AnffHCpJAJ5/Vex4UvzptZRdY/O/1dJIS/NkcNmR6MTYah6qzseA4TfFtw4UvHBW1bc/O+7sPhwZHYf/jMODh5yfPudVbXj2TAJ/8XxrOZagNamj4Ei2/GNfuyRxh8t6BG2l15up+MIVODEiFr8rcPS0+O6RBF6mrrEGHHtFzOo2Lo7Dl37hvPQ6mNV6R9JYKgnYWcE37K5HlE2OT/5A0udaPUBHH+BQOMzuNsYLuDyZflTW+fTcmJFDHhJhaZqewMuewXDxcDR9IYyPN6Jj+6K4MF2vV8qBtZJScqVRNi6lpGONVJis5mpKi1WbgwsY+zIsBpcR8mzIZfuTRVZrtdu9odrptR/Xx5XONXJqBmCN0P6YMUQq9WJiwt0Je102WHdbpxSqydMObBWYdwDWLVcqcIMYe3NPjg0Ht84od0Ajju1w2XCr9e6QoqM9V23ZtnmI6cfAMMb9AY0YEHdb6oobEh4y3H3Ize6LsmGvN5IdUnhttdQ9UVrfLk/ljWEZ9wXsqAdQk1EA+O22GcgdZTke/bAs3OPY4HSdcB20HhvVtTMu0jmI8ekAhz2IICj2hKpNqI60NcuIRUHEej1quzubXa2tmZhenrfZmv3YYQ9ipDAIgvHptmblccuDjdRcmjFpWbDi/9ycZjZkRbk5jYztai/AUwiUx+qdEQB/m+25i9lxyvbcjrg45Lmd0uT/3p7/Fw6ODf+WO019AAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDI0LTEyLTAyVDIxOjU2OjQ4KzAwOjAwMVpslgAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyNC0xMi0wMlQyMTo1Njo0OCswMDowMEAH1CoAAAAodEVYdGRhdGU6dGltZXN0YW1wADIwMjQtMTItMDJUMjE6NTY6NTMrMDA6MDDZv6GRAAAAAElFTkSuQmCC",id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(e){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletEntry?.isWalletEntryOverriden||(this.walletEntry=$l[e]),this.walletClientType=e,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,function(){try{localStorage.removeItem(Al)}catch{}}(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise(((e,t)=>{this.onQrModalClosed=()=>{t(new Bt)},(async()=>{let t="",r=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout()]);if(r?.length&&(t=r[0]),!t||""===t)throw new _("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let e=El(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=e?.entry,this.walletClientType=e?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=Hl(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(r),e()})().catch((e=>{t(e?Ft(e):new _("Unknown error during connection"))})).finally((()=>this.modal?.closeModal()))}))}disconnect(){this.walletProvider?.disconnect().then((()=>this.onDisconnect())).catch((()=>console.warn("Unable to disconnect Wallet Connect provider")))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(e){this.proxyProvider.setWalletProvider(e)}async createProvider(){let e={};for(let t of this.chains){let r=ve(t.id,this.chains,this.rpcConfig,this.privyAppId);r&&(e[t.id]=r)}let t=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],r=this.chains.map((e=>e.id)),n=await br.init({projectId:this.walletConnectCloudProjectId,chains:t,optionalChains:r,optionalEvents:Er,optionalMethods:$r,rpcMap:e,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return n.on("display_uri",(e=>{if(n.signer.abortPairingAttempt(),this.walletEntry){let{redirect:t,href:r}=function(e,t){let r=Tl(t);if(r.deepLink)return _l(r.deepLink,e);if(r.universalLink)return kl(r.universalLink,e);throw new E(`Unsupported wallet ${t.id}`)}(e,this.walletEntry);(function({href:e,name:t}){try{localStorage.setItem(Al,JSON.stringify({href:e,name:t}))}catch{}})({href:r,name:this.walletEntry.displayName}),this.redirectUri=t;let n=function(e,t){let r=Tl(t);if(r.universalLink)return kl(r.universalLink,e)}(e,this.walletEntry);n?.redirect&&(this.fallbackUniversalRedirectUri=n.redirect),w&&Nl(t,"_self"),this.showPrivyQrModal?.({native:t,universal:this.fallbackUniversalRedirectUri})}else this.modal?.openModal({uri:e,chains:[this.defaultChain.id]})})),n.on("connect",(()=>{if(this.modal?.closeModal(),n.session?.peer.metadata.url){let e=El(n.session?.peer.metadata.url);this.walletEntry=e?.entry,this.walletClientType=e?.walletClientType||"unknown"}})),n}async enableProvider(){return this.walletProvider?.connected?Promise.resolve(this.walletProvider.accounts):await(this.walletProvider?.enable())}setWalletEntry(e,t){this.walletEntry=e,this.showPrivyQrModal=t}constructor(e,t,r,n,a,i,o,l){super(l||"unknown",r,n,t),this.connectorType="wallet_connect_v2",this.privyAppId=i,this.privyAppName=o,this.walletConnectCloudProjectId=e,this.rpcConfig=t,this.shouldEnforceDefaultChainOnConnect=a,this.proxyProvider=new Vl(void 0,this.rpcTimeoutDuration),l&&(this.walletEntry=$l[l],this.walletClientType=l)}}const vs=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter((e=>Mt(e))).map((e=>n(e)));return!!t?.length&&!!e?.linkedAccounts.filter((e=>"wallet"==e.type&&t.includes(e.address))).length};class Cs extends Rt{get wallets(){let e=new Set,t=this.walletConnectors.flatMap((e=>e.wallets)).sort(((e,t)=>e.connectedAt&&t.connectedAt?t.connectedAt-e.connectedAt:0)).filter((t=>{let r=`${t.address}${t.walletClientType}${t.connectorType}`;return!e.has(r)&&(e.add(r),!0)})),r=t.findIndex((e=>e.address===(this.activeWallet?this.activeWallet:"unknown")));return r>=0&&t.unshift(t.splice(r,1)[0]),t}async initialize(){if(this.initialized)return;qo.get(Ce)&&(qo.getKeys().forEach((e=>{e.startsWith("walletconnect")&&qo.del(e)})),qo.del(Ce));let e=be({store:this.store,walletList:this.walletList,externalWalletConfig:this.externalWalletConfig,walletChainType:this.walletChainType}).then((e=>{e.forEach((({type:e,eip6963InjectedProvider:t,legacyInjectedProvider:r})=>{this.createEthereumWalletConnector("injected",e,{eip6963InjectedProvider:t,legacyInjectedProvider:r})}))}));this.walletList.includes("coinbase_wallet")&&this.createEthereumWalletConnector("coinbase_wallet","coinbase_wallet"),!Ee()&&this.walletList.includes("phantom")&&"solana-only"!==this.walletChainType&&this.createEthereumWalletConnector("phantom","phantom"),this.externalWalletConfig.walletConnect.enabled&&this.createEthereumWalletConnector("wallet_connect_v2","unknown"),this.externalWalletConfig.solana.connectors?.get().forEach(this.addSolanaWalletConnector),this.externalWalletConfig.solana.connectors?._setOnConnectorsUpdated?.((e=>{e?.forEach(this.addSolanaWalletConnector)})),await e,this.initialized=!0}findWalletConnector(e,t){return"wallet_connect_v2"===e?this.walletConnectors.filter(Yl).find((t=>t.connectorType===e))??null:this.walletConnectors.filter(Yl).find((r=>r.connectorType===e&&r.walletClientType===t))??null}findSolanaWalletConnector(e,t){return this.walletConnectors.filter(jt).find((r=>r.connectorType===e&&r.walletClientType===t))??null}findEmbeddedWalletConnectors(){return this.walletConnectors.filter((e=>"embedded"===e.connectorType))}onInitialized(e){e.wallets.forEach((e=>{let t=this.storedConnections.find((t=>t.address===e.address&&t.connectorType===e.connectorType&&t.walletClientType===e.walletClientType));t&&(e.connectedAt=t.connectedAt)})),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(e){e.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnectors({walletProxy:e,rootWallet:t,embeddedWallets:r,defaultChain:n,appId:a}){for(let i of r){let r=this.findEmbeddedWalletConnectors().find((e=>e.walletIndex===i.walletIndex));if(r&&Yl(r))r.proxyProvider.walletProxy=e;else{let{entropyId:r,entropyIdVerifier:o}=k(t),l=new rs({provider:new is({walletProxy:e,address:i.address,entropyId:r,entropyIdVerifier:o,rpcConfig:this.rpcConfig,chains:this.chains,appId:a,chainId:n.id,walletIndex:i.walletIndex}),chains:this.chains,defaultChain:n,rpcConfig:this.rpcConfig,imported:!1,walletIndex:i.walletIndex});this.addWalletConnector(l)}}}addImportedWalletConnector(e,t,r,n){let a=this.findWalletConnector("embedded_imported","privy");if(a&&Yl(a))a.proxyProvider.walletProxy=e;else{let a=new rs({provider:new is({walletProxy:e,address:t,entropyId:t,entropyIdVerifier:"ethereum-address-verifier",walletIndex:0,rpcConfig:this.rpcConfig,chains:this.chains,appId:n,chainId:r.id}),chains:this.chains,walletIndex:0,defaultChain:r,rpcConfig:this.rpcConfig,imported:!0});this.addWalletConnector(a)}}removeEmbeddedWalletConnectors(){this.walletConnectors=this.walletConnectors.filter((e=>"embedded"!==e.connectorType)),this.saveConnectionHistory(),this.storedConnections=bs(),this.emit("walletsUpdated")}removeImportedWalletConnector(){let e=this.findWalletConnector("embedded_imported","privy");if(e){let t=this.walletConnectors.indexOf(e);this.walletConnectors.splice(t,1),this.saveConnectionHistory(),this.storedConnections=bs(),this.emit("walletsUpdated")}}async createEthereumWalletConnector(e,t,r){let n=this.findWalletConnector(e,t);if(n&&Yl(n))return n instanceof ws&&n.resetConnection(t),n;let a=(()=>"injected"!==e?"coinbase_wallet"===e?new es(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):"phantom"===e?new gs(this.defaultChain):new ws(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,t):"metamask"===t&&r?.eip6963InjectedProvider?new ms(this.chains,this.defaultChain,this.rpcConfig,r?.eip6963InjectedProvider,"metamask"):"metamask"===t&&r?.legacyInjectedProvider?new ps(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider,"metamask"):"phantom"===t&&r?.legacyInjectedProvider?new ps(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider,"phantom"):r?.legacyInjectedProvider&&"unknown_browser_extension"===t?new ps(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider):r?.eip6963InjectedProvider?new us(this.chains,this.defaultChain,this.rpcConfig,r?.eip6963InjectedProvider,t):void 0)();return a&&this.addWalletConnector(a),a||null}addWalletConnector(e){this.walletConnectors.push(e),e.on("initialized",(()=>this.onInitialized(e))),e.on("walletsUpdated",(()=>this.onWalletsUpdated(e))),e.initialize().catch((e=>{console.debug("Failed to initialize connector",e)}))}saveConnectionHistory(){let e=this.wallets.map((e=>({address:e.address,connectorType:e.connectorType,walletClientType:e.walletClientType,connectedAt:e.connectedAt})));qo.put($e,e)}async activeWalletSign(e){let t=this.wallets,r=t.length>0?t[0]:null;return r&&zl(r)?r.sign(e):null}setActiveWallet(e){this.activeWallet=n(e),this.emit("walletsUpdated")}constructor(e,t,r,n,a,i,o,l,s,d,c,u){super(),this.addSolanaWalletConnector=async e=>{this.findSolanaWalletConnector("solana_adapter",e.walletClientType)||this.addWalletConnector(e)},this.getEthereumProvider=()=>{let e=this.wallets[0],t=this.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return e&&t?t.proxyProvider:new Vl},this.privyAppId=e,this.walletConnectCloudProjectId=t,this.rpcConfig=r,this.chains=n,this.defaultChain=a,this.walletConnectors=[],this.initialized=!1,this.store=i,this.walletList=o,this.shouldEnforceDefaultChainOnConnect=l,this.externalWalletConfig=s,this.privyAppName=d,this.privyAppLogo=c,this.walletChainType=u||"ethereum-only",this.storedConnections=bs()}}const bs=()=>{let e=qo.get($e);return e&&Array.isArray(e)&&e.map((e=>(e=>e&&"string"==typeof e.address&&"string"==typeof e.connectorType&&"string"==typeof e.walletClientType&&"number"==typeof e.connectedAt)(e))).every(Boolean)?e:[]};let Es=[Lo,Fo,Do,jo];class $s{async get(e,t){try{return await this.baseFetch(e,t)}catch(e){throw $(e)}}async post(e,t,r){try{return await this.baseFetch(e,{method:"POST",...t?{body:t}:{},...r})}catch(e){throw $(e)}}async delete(e,t){try{return await this.baseFetch(e,{method:"DELETE",...t})}catch(e){throw $(e)}}constructor({appId:e,appClientId:t,client:r,defaults:n}){this.appId=e,this.appClientId=t,this.clientAnalyticsId=r.clientAnalyticsId,this.sdkVersion=Te,this.client=r,this.defaults=n,this.fallbackApiUrl=r.fallbackApiUrl,this.baseFetch=wn.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:e,options:t})=>{let r=new Headers(t.headers);r.set("privy-app-id",this.appId),this.appClientId&&r.set("privy-client-id",this.appClientId),r.set("privy-ca-id",this.clientAnalyticsId||""),r.set("privy-client",`react-auth:${this.sdkVersion}`);let n=Es.includes(e.toString());if(!r.has("authorization")){let e=await this.client.getAccessToken({disableAutoRefresh:n});null!==e&&r.set("authorization",`Bearer ${e}`)}t.headers=r,t.retryDelay&&(t.retryDelay=3*t.retryDelay)},onRequestError:({error:e})=>{if(e instanceof DOMException&&"AbortError"===e.name)throw new N}})}}let Ts=/paymaster\.biconomy\.io\/api/i,As={mode:"SPONSORED",calculateGasLimits:!0,expiryDuration:300,sponsorshipInfo:{webhookData:{},smartAccountInfo:{name:"BICONOMY",version:"2.0.0"}}};const xs=(e,t)=>e&&Ts.test(e)?As:t&&t.policy_id?{policyId:t.policy_id}:void 0;function _s(){return!(C&&window.location.origin.startsWith("http://localhost"))}var ks,Ns;(ks=Ns||(Ns={})).PRIVY="privy_access_token",ks.CUSTOMER="customer_access_token";class Ss{get token(){return this.privyAccessToken||this.customerAccessToken}getToken(e){return"privy_access_token"===e?this.privyAccessToken:this.customerAccessToken}get customerAccessToken(){return this._getToken(Ae)}get privyAccessToken(){return this._getToken(xe)}_getToken(e){try{let t=qo.get(e);return"string"==typeof t?Wl.throwIfNotWellFormedJwt(t):null}catch(e){return console.error(e),this.destroyLocalState(),null}}get refreshToken(){try{let e=qo.get(_e);return"string"==typeof e?e:null}catch(e){return console.error(e),this.destroyLocalState(),null}}get forkedToken(){try{let e=qo.get(ke);return"string"==typeof e?e:null}catch(e){return console.error(e),this.destroyLocalState(),null}}getProviderAccessToken(e){try{let t=qo.get(Ne(e));if("string"!=typeof t)return null;{let r=new Wl(t);return r.isExpired()?(qo.del(Ne(e)),null):r.value}}catch(e){return console.error(e),null}}get mightHaveServerCookies(){try{let e=Fn.get(Se);return void 0!==e&&e.length>0}catch(e){console.error(e)}return!1}hasRefreshCredentials(e="privy_access_token"){let t="string"==typeof this.getToken(e),r="string"==typeof this.refreshToken&&this.refreshToken!==Ie;return this.mightHaveServerCookies||t&&r}hasRecoveryCredentials(){return"string"==typeof this.forkedToken}hasActiveAccessToken(e){let t=Wl.parse(this.getToken(e));return null!==t&&!t.isExpired(30)}authenticate(e){return this.authenticateOnce.execute(e)}link(e){return this.linkOnce.execute(e)}refresh(){return this.refreshOnce.execute()}forkSession(){return this.forkSessionOnce.execute()}destroy(){return this.destroyOnce.execute()}storeProviderAccessToken(e,t){"string"==typeof t?qo.put(Ne(e),t):qo.del(Ne(e))}async _authenticate(e){try{let t=await e.authenticate(),{user:r,is_new_user:n,oauth_tokens:a}=t;this.handleTokenResponse(t);let i=a?{provider:a.provider,accessToken:a.access_token,accessTokenExpiresInSeconds:a.access_token_expires_in_seconds,refreshToken:a.refresh_token,refreshTokenExpiresInSeconds:a.refresh_token_expires_in_seconds,scopes:a.scopes}:void 0;return this._trackAuthenticateEvents(e,n),{user:S(r),isNewUser:n,oAuthTokens:i}}catch(e){throw console.warn("Error authenticating session"),I(e)}}_trackAuthenticateEvents(e,t){let r=function(e){return e instanceof Cl?"email":e instanceof yl?"sms":e instanceof gl?"siwe":e instanceof Zo?"guest":e instanceof zo?"custom_auth":e instanceof Jo?e.meta.provider:null}(e);r&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:r,isNewUser:t}}),"siwe"===r&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:e.meta.connectorType,walletClientType:e.meta.walletClientType}})}async _link(e){try{let t=await e.link(),r=t.oauth_tokens,n=r?{provider:r.provider,accessToken:r.access_token,accessTokenExpiresInSeconds:r.access_token_expires_in_seconds,refreshToken:r.refresh_token,refreshTokenExpiresInSeconds:r.refresh_token_expires_in_seconds,scopes:r.scopes}:void 0;return{user:S(t),oAuthTokens:n}}catch(e){throw console.warn("Error linking account"),I(e)}}async _refresh(){if(!this.api)throw new E("Session has no API instance");if(!this.client)throw new E("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let e=this.token,t=this.refreshToken,r=this.forkedToken;if(this.client.useServerCookies&&!this.mightHaveServerCookies&&this.token&&window.location.origin===this.client.apiUrl)return this.destroyLocalState(),null;try{let n;if(e&&t||this.mightHaveServerCookies){let a={};e&&(a.authorization=`Bearer ${e}`),n=await this.api.post(Lo,t?{refresh_token:t}:{},{headers:a}),r&&this.clearForkedToken()}else{if(!r)return null;n=await this.api.post(Fo,{refresh_token:r}),this.clearForkedToken()}return this.handleTokenResponse(n),S(n.user)}catch(e){if(e instanceof O&&e.privyErrorCode===T.MISSING_OR_INVALID_TOKEN)return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw I(e)}}handleTokenResponse(e){e.session_update_action&&"set"!==e.session_update_action?"clear"===e.session_update_action?this.destroyLocalState():"ignore"===e.session_update_action&&(e.token&&(this.storeCustomerAccessToken(e.token),this.storePrivyAccessToken(e.privy_access_token)),e.identity_token&&this.storeIdentityToken(e.identity_token)):this._storeAllTokens(e)}_storeAllTokens(e){this.storeRefreshToken(e.refresh_token),this.storeCustomerAccessToken(e.token),this.storePrivyAccessToken(e.privy_access_token),e.identity_token&&this.storeIdentityToken(e.identity_token)}async _destroy(){try{await(this.api?.post(Do,{refresh_token:this.refreshToken}))}catch(e){console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new E("Session has no API instance");let e=this.refreshToken;try{let t=await this.api.post("/api/v1/sessions/fork",{refresh_token:e});return this.storeRefreshToken(t.refresh_token),this.storeCustomerAccessToken(t.token),t.new_session_refresh_token}catch(e){throw I(e)}}destroyLocalState(){this.storeRefreshToken(null),this.storeCustomerAccessToken(null),this.storePrivyAccessToken(null),this.clearIdentityToken(),this.clearForkedToken()}storeCustomerAccessToken(e){if("string"==typeof e){let t=qo.get(Ae);if(qo.put(Ae,e),!this.client?.useServerCookies){let t=Wl.parse(e)?.expiration;Fn.set(Oe,e,{sameSite:"Strict",secure:_s(),expires:t?new Date(1e3*t):void 0})}t!==e&&this.client?.onStoreCustomerAccessToken?.(e)}else qo.del(Ae),Fn.remove(Oe),this.client?.onDeleteCustomerAccessToken?.()}storeRefreshToken(e){"string"==typeof e?(qo.put(_e,e),this.client?.useServerCookies||Fn.set(Se,"t",{sameSite:"Strict",secure:_s(),expires:30})):(qo.del(_e),Fn.remove(Pe),Fn.remove(Se))}storePrivyAccessToken(e){"string"==typeof e?qo.put(xe,e):qo.del(xe)}storeIdentityToken(e){if(this.client?.useServerCookies)return;qo.put(Me,e);let t=Wl.parse(e)?.expiration;Fn.set(Re,e,{sameSite:"Strict",secure:_s(),expires:t?new Date(1e3*t):void 0})}clearIdentityToken(){qo.del(Me),Fn.remove(Re)}clearForkedToken(){qo.del(ke)}constructor(){this.authenticateOnce=new ml((async e=>this._authenticate(e))),this.linkOnce=new ml((async e=>this._link(e))),this.refreshOnce=new ml(this._refresh.bind(this)),this.destroyOnce=new ml(this._destroy.bind(this)),this.forkSessionOnce=new ml(this._forkSession.bind(this))}}let Is;var Os=0,Ps="__private_"+Os+++"__getOrGenerateClientAnalyticsId";class Ms{initializeConnectorManager({walletConnectCloudProjectId:e,rpcConfig:t,chains:r,defaultChain:n,store:a,walletList:i,shouldEnforceDefaultChainOnConnect:o,externalWalletConfig:l,appName:s,walletChainType:d}){this.connectors||(this.connectors=new Cs(this.appId,e,t,r,n,a,i,o,l,s,void 0,d))}generateApi(){let e=new $s({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=e,e}updateApiUrl(e){this.apiUrl=e||this.fallbackApiUrl,this.api=this.generateApi(),e&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new E("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new E("No auth flow in progress.");let{oAuthTokens:e}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:e}}storeProviderAccessToken(e,t){this.session.storeProviderAccessToken(e,t)}getProviderAccessToken(e){return this.session.getProviderAccessToken(e)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(e){e.linkedAccounts.filter((e=>"cross_app"===e.type)).forEach((e=>{this.storeProviderAccessToken(e.providerApp.id,null)}))}startAuthFlow(e){return e.api=this.api,this.authFlow=e,this.authFlow}async initMfaSmsVerification(){try{await this.api.post("/api/v1/mfa/passwordless_sms/init",{action:"verify"})}catch(e){throw $(e)}}async initMfaPasskeyVerification(){try{return(e=>({rpId:e.rp_id,challenge:e.challenge,allowCredentials:e.allow_credentials?.map((e=>({id:e.id,type:e.type,transports:e.transports})))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification}))((await this.api.post("/api/v1/mfa/passkeys/init",{})).options)}catch(e){throw $(e)}}async getCrossAppProviderDetails(e){try{return this._cachedProviderAppDetails[e]||(this._cachedProviderAppDetails[e]=await this.api.get(`/api/v1/apps/${e}/cross-app/details`)),this._cachedProviderAppDetails[e]}catch(e){console.error("Error fetching cross app provider details",e)}}async acceptTerms(){try{let e=await this.api.post("/api/v1/users/me/accept_terms",{});return S(e)}catch(e){throw I(e)}}async unlinkEmail(e){try{let t=await this.api.post("/api/v1/passwordless/unlink",{address:e});return await this.getAuthenticatedUser()??S(t)}catch(e){throw I(e)}}async unlinkPhone(e){try{let t=await this.api.post("/api/v1/passwordless_sms/unlink",{phoneNumber:e});return await this.getAuthenticatedUser()??S(t)}catch(e){throw I(e)}}async unlinkEthereumWallet(e){try{let t=await this.api.post("/api/v1/siwe/unlink",{address:e});return await this.getAuthenticatedUser()??S(t)}catch(e){throw I(e)}}async unlinkSolanaWallet(e){try{let t=await this.api.post("/api/v1/siws/unlink",{address:e});return await this.getAuthenticatedUser()??S(t)}catch(e){throw I(e)}}async unlinkOAuth(e,t){try{let r=await this.api.post("/api/v1/oauth/unlink",{provider:e,subject:t});return await this.getAuthenticatedUser()??S(r)}catch(e){throw I(e)}}async unlinkFarcaster(e){try{let t=await this.api.post("/api/v1/farcaster/unlink",{fid:e});return await this.getAuthenticatedUser()??S(t)}catch(e){throw I(e)}}async unlinkTelegram(e){try{let t=await this.api.post("/api/v1/telegram/unlink",{telegram_user_id:e});return await this.getAuthenticatedUser()??S(t)}catch(e){throw I(e)}}async unlinkPasskey(e){try{let t=await this.api.post("/api/v1/passkeys/unlink",{credential_id:e});return await this.getAuthenticatedUser()??S(t)}catch(e){throw I(e)}}async revokeDelegatedWallet(){try{await this.api.post("/api/v1/wallets/revoke",{})}catch(e){throw I(e)}}async createAnalyticsEvent({eventName:e,payload:t,timestamp:r,options:n}){if("undefined"!=typeof window)try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(jo,{event_name:e,client_id:this.clientAnalyticsId,payload:{...t||{},clientTimestamp:r?r.toISOString():(new Date).toISOString()}},{retry:-1,keepalive:n?.keepAlive??!1})}catch(e){}}async signMoonpayOnRampUrl(e){try{return this.api.post("/api/v1/plugins/moonpay_on_ramp/sign",e)}catch(e){throw I(e)}}async initCoinbaseOnRamp(e){try{return this.api.post("/api/v1/funding/coinbase_on_ramp/init",e)}catch(e){throw I(e)}}async getCoinbaseOnRampStatus({partnerUserId:e}){try{return this.api.get(`/api/v1/funding/coinbase_on_ramp/status?partnerUserId=${e}`)}catch(e){throw I(e)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(e){return await this.getPrivyAccessToken(e)||await this.getCustomerAccessToken(e)}async getCustomerAccessToken(e){return await this._getToken(Ns.CUSTOMER,e)}async getPrivyAccessToken(e){return await this._getToken(Ns.PRIVY,e)}async _getToken(e,t){return this.session.getToken(e)?this.session.hasActiveAccessToken(e)?this.session.hasRefreshCredentials(e)?Bl.parse(this.session.getToken(e))?.appId!==this.appId?(await this.logout(),null):this.session.getToken(e):(this.session.destroyLocalState(),null):!t?.disableAutoRefresh&&this.session.hasRefreshCredentials(e)?(await this.session.refresh(),this.session.getToken(e)):null:null}async getSmartWalletsConfig(){try{let e={},t=this.session.token;t&&(e.authorization=`Bearer ${t}`);let r=await this.api.get(`/api/v1/apps/${this.appId}/smart_wallets`,{baseURL:this.fallbackApiUrl,headers:e});return r.enabled?{enabled:r.enabled,smartWalletType:r.smart_wallet_type,configuredNetworks:r.configured_networks.map((e=>({chainId:e.chain_id,bundlerUrl:e.bundler_url,paymasterUrl:e.paymaster_url,paymasterContext:xs(e.paymaster_url,e.paymaster_context)})))}:{enabled:r.enabled}}catch(e){throw I(e)}}async getServerConfig(){try{let e={},t=this.session.token;t&&(e.authorization=`Bearer ${t}`);let r=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:e}),n=r.telegram_auth_config?{botId:r.telegram_auth_config.bot_id,botName:r.telegram_auth_config.bot_name,linkEnabled:r.telegram_auth_config.link_enabled,seamlessAuthEnabled:r.telegram_auth_config.seamless_auth_enabled}:void 0,a=r.funding_config?{methods:r.funding_config.methods,options:r.funding_config.options,defaultRecommendedAmount:r.funding_config.default_recommended_amount,defaultRecommendedCurrency:r.funding_config.default_recommended_currency,promptFundingOnWalletCreation:r.funding_config.prompt_funding_on_wallet_creation,crossChainBridgingEnabled:r.funding_config.cross_chain_bridging_enabled}:void 0;return{id:r.id,name:r.name,verificationKey:r.verification_key,logoUrl:r.logo_url||void 0,accentColor:r.accent_color||void 0,showWalletLoginFirst:r.show_wallet_login_first,allowlistConfig:{errorTitle:r.allowlist_config.error_title,errorDetail:r.allowlist_config.error_detail,errorCtaText:r.allowlist_config.cta_text,errorCtaLink:r.allowlist_config.cta_link},walletAuth:r.wallet_auth,solanaWalletAuth:r.solana_wallet_auth,emailAuth:r.email_auth,smsAuth:r.sms_auth,googleOAuth:r.google_oauth,twitterOAuth:r.twitter_oauth,discordOAuth:r.discord_oauth,githubOAuth:r.github_oauth,spotifyOAuth:r.spotify_oauth,instagramOAuth:r.instagram_oauth,tiktokOAuth:r.tiktok_oauth,linkedinOAuth:r.linkedin_oauth,appleOAuth:r.apple_oauth,farcasterAuth:r.farcaster_auth,passkeyAuth:r.passkey_auth,telegramAuth:r.telegram_auth,disablePlusEmails:r.disable_plus_emails,termsAndConditionsUrl:r.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:r.embedded_wallet_config?.create_on_login,userOwnedRecoveryOptions:r.embedded_wallet_config.user_owned_recovery_options,requireUserOwnedRecoveryOnCreate:r.embedded_wallet_config.require_user_owned_recovery_on_create},privacyPolicyUrl:r.privacy_policy_url,requireUsersAcceptTerms:r.require_users_accept_terms,customApiUrl:r.custom_api_url,walletConnectCloudProjectId:r.wallet_connect_cloud_project_id,fiatOnRampEnabled:r.fiat_on_ramp_enabled,captchaEnabled:r.captcha_enabled,captchaSiteKey:r.captcha_site_key,createdAt:new Date(1e3*r.created_at),updatedAt:new Date(1e3*r.updated_at),mfaMethods:r.mfa_methods,enforceWalletUis:r.enforce_wallet_uis,legacyWalletUiConfig:r.legacy_wallet_ui_config,telegramAuthConfiguration:n,fundingConfig:a}}catch(e){throw I(e)}}async getUsdTokenPrice(e){try{return(await this.api.get(`/api/v1/token_price?chainId=${e.id}&tokenSymbol=${e.nativeCurrency.symbol}`)).usd}catch(t){return void console.error(`Unable to fetch token price for chain with id ${e.id}`)}}async getUsdPriceForSol(){try{return(await this.api.get("/api/v1/token_price?chainId=0&tokenSymbol=SOL")).usd}catch(e){return void console.error("Unable to fetch token price for SOL")}}async requestFarcasterSignerStatus(e){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:e})}catch(e){throw console.error("Unable to fetch Farcaster signer status"),e}}async forkSession(){return await this.session.forkSession()}async generateSiweNonce({address:e,captchaToken:t}){try{return(await this.api.post("/api/v1/siwe/init",{address:e,token:t})).nonce}catch(e){throw I(e)}}async authenticateWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:n,connectorType:a,mode:i}){return await this.api.post("/api/v1/siwe/authenticate",{message:e,signature:t,chainId:r,walletClientType:n,connectorType:a,mode:i})}async linkWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:n,connectorType:a}){return await this.api.post("/api/v1/siwe/link",{message:e,signature:t,chainId:r,walletClientType:n,connectorType:a})}async linkSmartWallet({message:e,signature:t,smartWalletType:r}){try{let n=await this.api.post("/api/v1/siwe/link_smart_wallet",{message:e,signature:t,smart_wallet_type:r});return S(n)}catch(e){throw I(e)}}async linkWithSiwe({message:e,signature:t,chainId:r,walletClientType:n,connectorType:a}){try{let i=await this.linkWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:n,connectorType:a});return S(i)}catch(e){throw I(e)}}async generateSiwsNonce({address:e,captchaToken:t}){try{return(await this.api.post("/api/v1/siws/init",{address:e,token:t})).nonce}catch(e){throw I(e)}}async authenticateWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:n,mode:a}){return await this.api.post("/api/v1/siws/authenticate",{message:e,signature:t,walletClientType:r,connectorType:n,mode:a})}async sendAccountTransferRequest({nonce:e,account:t,accountType:r,externalWalletMetadata:n,telegramAuthResult:a,farcasterEmbeddedAddress:i,oAuthUserInfo:o}){try{let l,s;switch(r){case"email":l="/api/v1/passwordless/transfer",s={nonce:e,email:t};break;case"sms":l="/api/v1/passwordless_sms/transfer",s={nonce:e,phoneNumber:t};break;case"siwe":if(l="/api/v1/siwe/transfer",!n)throw Error("Wallet parameters must be defined");s={nonce:e,address:t,...n};break;case"farcaster":l="/api/v1/farcaster/transfer",s={nonce:e,farcaster_id:t,farcaster_embedded_address:i};break;case"telegram":l="/api/v1/telegram/transfer",s={nonce:e,telegram_auth_result:a};break;case"custom":case"guest":case"passkey":throw Error("Invalid transfer account type");default:l="/api/v1/oauth/transfer",s={nonce:e,userInfo:o}}let d=await this.api.post(l,s);return await this.getAuthenticatedUser()??S(d)}catch(e){throw I(e)}}async linkWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:n}){return await this.api.post("/api/v1/siws/link",{message:e,signature:t,walletClientType:r,connectorType:n})}async linkWithSiws({message:e,signature:t,walletClientType:r,connectorType:n}){try{let a=await this.linkWithSiwsInternal({message:e,signature:t,walletClientType:r,connectorType:n});return S(a)}catch(e){throw I(e)}}constructor({apiUrl:e=Le,appId:t,appClientId:r,timeout:n=De}){Object.defineProperty(this,Ps,{value:Rs}),this._cachedProviderAppDetails={},this.apiUrl=e,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=e!==Le&&e.startsWith("https://privy."),this.timeout=n,this.appId=t,this.appClientId=r,this.clientAnalyticsId=function(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw TypeError("attempted to use private field on non-instance");return e}(this,Ps)[Ps](),Is||(Is=new Ss),this.session=Is,this.api=this.generateApi(),this.session.client=this}}function Rs(){if("undefined"==typeof window)return null;try{let e=qo.get(Fe);if("string"==typeof e&&e.length>0)return e}catch(e){}let e=Pt();try{return qo.put(Fe,e),e}catch(t){return e}}const Ls=e=>{let{enabled:r,siteKey:n,appId:a,setError:i,setToken:o,setExecuting:l,ref:s}=Ll(),[,d]=c((()=>n?.split("t:")||[]),[n]);if(p((()=>s.current?.remove),[]),!r)return null;if(!d)throw Error("Unsupported captcha site key");return t("div",{className:"hidden h-0 w-0",children:t(er,{...e,ref:s,siteKey:d,options:{action:a,size:"invisible",...e.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{e.onUnsupported?.(),console.warn("Browser does not support Turnstile.")},onError:()=>{e.onError?.(),i("Captcha failed"),l(!1)},onSuccess:t=>{e.onSuccess?.(t),o(t),l(!1)},onExpire:()=>{e.onExpire?.();try{s.current?.reset(),i(void 0),o(void 0)}catch(e){i("expired_and_failed_reset")}}})})},Ds=e=>{let[t,r]=d("auto");return p((()=>{let t=new ResizeObserver((e=>{r(e[0]?.contentRect.height??"auto")}));return e.current&&t.observe(e.current),()=>{e.current&&t.unobserve(e.current)}}),[e.current]),t};function Fs(e){zt("configureMfa",e)}const Us=({success:n,fail:a})=>e(r,{children:[t(Ws,{className:n?"success":a?"fail":""}),t(Bs,{className:n?"success":a?"fail":""})]}),Ws=tr.span`
|
|
2
|
-
&& {
|
|
3
|
-
width: 82px;
|
|
4
|
-
height: 82px;
|
|
5
|
-
border-width: 4px;
|
|
6
|
-
border-style: solid;
|
|
7
|
-
border-color: ${e=>e.color??"var(--privy-color-accent)"};
|
|
8
|
-
border-bottom-color: transparent;
|
|
9
|
-
border-radius: 50%;
|
|
10
|
-
display: inline-block;
|
|
11
|
-
box-sizing: border-box;
|
|
12
|
-
animation: rotation 1.2s linear infinite;
|
|
13
|
-
transition: border-color 800ms;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@keyframes rotation {
|
|
17
|
-
0% {
|
|
18
|
-
transform: rotate(0deg);
|
|
19
|
-
}
|
|
20
|
-
100% {
|
|
21
|
-
transform: rotate(360deg);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
&&&.success {
|
|
26
|
-
border-color: var(--privy-color-success);
|
|
27
|
-
border-bottom-color: var(--privy-color-success);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
&&&.fail {
|
|
31
|
-
border-color: var(--privy-color-error);
|
|
32
|
-
border-bottom-color: var(--privy-color-error);
|
|
33
|
-
}
|
|
34
|
-
`,Bs=tr(Ws)`
|
|
35
|
-
&& {
|
|
36
|
-
border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"};
|
|
37
|
-
animation: none;
|
|
38
|
-
opacity: 0.5;
|
|
39
|
-
}
|
|
40
|
-
`,js=e=>t(zs,{color:e.color||"var(--privy-color-foreground-3)"});let zs=tr(Ws)`
|
|
41
|
-
&& {
|
|
42
|
-
height: 1rem;
|
|
43
|
-
width: 1rem;
|
|
44
|
-
margin: 2px 0;
|
|
45
|
-
border-width: 1.5px;
|
|
46
|
-
|
|
47
|
-
/* Override default Loader to match button transitions */
|
|
48
|
-
transition: border-color 200ms ease;
|
|
49
|
-
}
|
|
50
|
-
`;const Gs=tr.button`
|
|
51
|
-
display: flex;
|
|
52
|
-
flex-direction: row;
|
|
53
|
-
align-items: center;
|
|
54
|
-
justify-content: center;
|
|
55
|
-
user-select: none;
|
|
56
|
-
|
|
57
|
-
& {
|
|
58
|
-
width: 100%;
|
|
59
|
-
cursor: pointer;
|
|
60
|
-
border-radius: var(--privy-border-radius-md);
|
|
61
|
-
|
|
62
|
-
font-size: 1rem;
|
|
63
|
-
font-style: normal;
|
|
64
|
-
font-weight: 500;
|
|
65
|
-
line-height: 22px; /* 137.5% */
|
|
66
|
-
letter-spacing: -0.016px;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
&& {
|
|
70
|
-
padding: 12px 16px;
|
|
71
|
-
}
|
|
72
|
-
`,Hs=({children:r,loading:n,disabled:a,success:i,loadingText:o="Loading...",...l})=>t(Ks,{disabled:n||a,success:i,...l,children:n?e("span",{children:[t(js,{}),o?t("span",{children:o}):null]}):r}),Vs=({children:e,loading:r,disabled:n,...a})=>t(qs,{disabled:n,...a,children:r?t(js,{color:"var(--privy-color-foreground-accent)"}):e});let qs=tr(Gs)`
|
|
73
|
-
position: relative;
|
|
74
|
-
|
|
75
|
-
&& {
|
|
76
|
-
background-color: var(--privy-color-accent);
|
|
77
|
-
color: var(--privy-color-foreground-accent);
|
|
78
|
-
|
|
79
|
-
transition: background-color 200ms ease;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
&:hover {
|
|
83
|
-
background-color: var(--privy-color-accent-dark);
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
&:active {
|
|
87
|
-
background-color: var(--privy-color-accent-dark);
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
&:disabled,
|
|
91
|
-
&:hover:disabled,
|
|
92
|
-
&:active:disabled {
|
|
93
|
-
cursor: not-allowed;
|
|
94
|
-
pointer-events: none;
|
|
95
|
-
color: var(--privy-color-foreground-accent);
|
|
96
|
-
background-color: var(--privy-color-accent-dark);
|
|
97
|
-
}
|
|
98
|
-
`;const Zs=({children:r,loading:n,disabled:a,loadingText:i="Loading...",...o})=>t(Ks,{as:"a",disabled:n||a,...o,children:n?e("span",{children:[t(js,{}),i?t("span",{children:i}):null]}):r});let Ks=tr(Gs)`
|
|
99
|
-
position: relative;
|
|
100
|
-
|
|
101
|
-
&& {
|
|
102
|
-
background-color: ${e=>e.warn?"var(--privy-color-error)":e.success?"var(--privy-color-success)":"var(--privy-color-accent)"};
|
|
103
|
-
color: var(--privy-color-foreground-accent);
|
|
104
|
-
|
|
105
|
-
transition: background-color 200ms ease;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
&:hover {
|
|
109
|
-
background-color: ${e=>e.warn?"var(--privy-color-error)":e.success?"var(--privy-color-success)":"var(--privy-color-accent-dark)"};
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
&:active {
|
|
113
|
-
background-color: ${e=>e.warn?"var(--privy-color-error)":e.success?"var(--privy-color-success)":"var(--privy-color-accent-dark)"};
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
&:hover:disabled,
|
|
117
|
-
&:active:disabled {
|
|
118
|
-
background-color: var(--privy-color-background-2);
|
|
119
|
-
color: var(--privy-color-foreground-3);
|
|
120
|
-
cursor: not-allowed;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/* If an anchor tag, :disabled isn't a thing, so manually set state */
|
|
124
|
-
${e=>e.disabled?rr`
|
|
125
|
-
&&&,
|
|
126
|
-
&&&:hover,
|
|
127
|
-
&&&:active {
|
|
128
|
-
background-color: var(--privy-color-background-2);
|
|
129
|
-
color: var(--privy-color-foreground-3);
|
|
130
|
-
cursor: not-allowed;
|
|
131
|
-
pointer-events: none;
|
|
132
|
-
}
|
|
133
|
-
`:""}
|
|
134
|
-
|
|
135
|
-
> span {
|
|
136
|
-
display: flex;
|
|
137
|
-
align-items: center;
|
|
138
|
-
gap: 8px;
|
|
139
|
-
|
|
140
|
-
opacity: 1;
|
|
141
|
-
animation: fadein 200ms ease;
|
|
142
|
-
}
|
|
143
|
-
`;const Ys=({children:r,loading:n,disabled:a,loadingText:i="Loading...",...o})=>t(Qs,{disabled:n||a,...o,children:n?e("span",{children:[t(js,{}),i?t("span",{children:i}):null]}):r});let Qs=tr(Gs)`
|
|
144
|
-
&& {
|
|
145
|
-
border-width: 1px;
|
|
146
|
-
border-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)"};
|
|
147
|
-
color: var(--privy-color-foreground);
|
|
148
|
-
|
|
149
|
-
transition: border-color 200ms ease;
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
&:hover,
|
|
153
|
-
&:active {
|
|
154
|
-
border-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
&:hover:disabled,
|
|
158
|
-
&:active:disabled {
|
|
159
|
-
border-color: var(--privy-color-foreground-accent);
|
|
160
|
-
color: var(--privy-color-foreground-3);
|
|
161
|
-
cursor: not-allowed;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
> span {
|
|
165
|
-
display: flex;
|
|
166
|
-
align-items: center;
|
|
167
|
-
gap: 8px;
|
|
168
|
-
|
|
169
|
-
opacity: 1;
|
|
170
|
-
animation: fadein 200ms ease;
|
|
171
|
-
}
|
|
172
|
-
`;const Js=tr.button`
|
|
173
|
-
&& {
|
|
174
|
-
padding: 12px 16px;
|
|
175
|
-
font-weight: 500;
|
|
176
|
-
text-align: center;
|
|
177
|
-
color: var(--privy-color-foreground-accent);
|
|
178
|
-
background-color: var(--privy-color-accent);
|
|
179
|
-
border-radius: var(--privy-border-radius-sm);
|
|
180
|
-
min-width: 144px;
|
|
181
|
-
opacity: ${e=>e.invisible?"0":"1"};
|
|
182
|
-
transition: opacity 200ms ease, background-color 200ms ease, color 200ms ease;
|
|
183
|
-
user-select: none;
|
|
184
|
-
|
|
185
|
-
${e=>e.invisible&&rr`
|
|
186
|
-
pointer-events: none;
|
|
187
|
-
`}
|
|
188
|
-
|
|
189
|
-
&:hover {
|
|
190
|
-
background-color: var(--privy-color-accent-dark);
|
|
191
|
-
}
|
|
192
|
-
&:active {
|
|
193
|
-
background-color: var(--privy-color-accent-dark);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
&:hover:disabled,
|
|
197
|
-
&:active:disabled {
|
|
198
|
-
background-color: var(--privy-color-background-2);
|
|
199
|
-
color: var(--privy-color-foreground-3);
|
|
200
|
-
cursor: not-allowed;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
`;tr.div`
|
|
204
|
-
/* Set to match height of SoftCtaButton to avoid reflow if conditionally rendered */
|
|
205
|
-
height: 44px;
|
|
206
|
-
`;const Xs=({children:r,onClick:n,disabled:a,isSubmitting:i,...o})=>e(ed,{$isSubmitting:i,onClick:n,disabled:a,...o,children:[t("span",{children:r}),t("span",{children:t(js,{})})]});let ed=tr.button`
|
|
207
|
-
&& {
|
|
208
|
-
color: var(--privy-color-accent);
|
|
209
|
-
font-size: 16px;
|
|
210
|
-
font-style: normal;
|
|
211
|
-
font-weight: 500;
|
|
212
|
-
line-height: 24px;
|
|
213
|
-
cursor: pointer;
|
|
214
|
-
border-radius: 0px var(--privy-border-radius-mdlg) var(--privy-border-radius-mdlg) 0px;
|
|
215
|
-
border: none;
|
|
216
|
-
transition: color 200ms ease;
|
|
217
|
-
|
|
218
|
-
/* Tablet and Up */
|
|
219
|
-
@media (min-width: 441px) {
|
|
220
|
-
font-size: 14px;
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
:hover {
|
|
224
|
-
color: var(--privy-color-accent-dark);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
&& > :first-child {
|
|
228
|
-
opacity: ${e=>e.$isSubmitting?0:1};
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
&& > :last-child {
|
|
232
|
-
position: absolute;
|
|
233
|
-
display: flex;
|
|
234
|
-
top: 50%;
|
|
235
|
-
left: 50%;
|
|
236
|
-
transform: translate3d(-50%, -50%, 0);
|
|
237
|
-
|
|
238
|
-
/** Will map to the opposite of first span */
|
|
239
|
-
opacity: ${e=>e.$isSubmitting?1:0};
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
:disabled,
|
|
243
|
-
:hover:disabled {
|
|
244
|
-
color: var(--privy-color-foreground-3);
|
|
245
|
-
cursor: not-allowed;
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
`;const td=tr.span`
|
|
249
|
-
&& {
|
|
250
|
-
width: 82px;
|
|
251
|
-
height: 82px;
|
|
252
|
-
border-width: 4px;
|
|
253
|
-
border-style: solid;
|
|
254
|
-
border-color: ${e=>e.color??"var(--privy-color-accent)"};
|
|
255
|
-
background-color: ${e=>e.color??"var(--privy-color-accent)"};
|
|
256
|
-
border-radius: 50%;
|
|
257
|
-
display: inline-block;
|
|
258
|
-
box-sizing: border-box;
|
|
259
|
-
}
|
|
260
|
-
`,rd=({backFn:e})=>t("div",{children:t(ld,{onClick:e,children:t(or,{height:"16px",width:"16px",strokeWidth:2})})}),nd=({nextFn:e})=>t("div",{children:t(ld,{onClick:e,children:t(lr,{height:"16px",width:"16px",strokeWidth:2})})}),ad=({infoFn:e})=>t("div",{children:t(sd,{"aria-label":"info",onClick:e,children:t(ir,{height:"22px",width:"22px",strokeWidth:2})})}),id=e=>t("div",{children:t(ld,{"aria-label":"close modal",onClick:e.onClose,children:t(sr,{height:"16px",width:"16px",strokeWidth:2})})}),od=({backFn:r,infoFn:n,onClose:a,title:i,closeable:o=!0})=>{let{closePrivyModal:l}=P(),s=Ue();return e(dd,{children:[e(cd,{children:[r&&t(rd,{backFn:r}),n&&t(ad,{infoFn:n})]}),i&&t(hd,{id:"privy-dialog-title",children:i}),t(ud,{children:!s.render.standalone&&o&&t(id,{onClose:a||(()=>l())})})]})};let ld=tr.button`
|
|
261
|
-
&& {
|
|
262
|
-
cursor: pointer;
|
|
263
|
-
display: flex;
|
|
264
|
-
opacity: 0.6;
|
|
265
|
-
|
|
266
|
-
background-color: var(--privy-color-background-2);
|
|
267
|
-
border-radius: var(--privy-border-radius-full);
|
|
268
|
-
padding: 4px;
|
|
269
|
-
|
|
270
|
-
> svg {
|
|
271
|
-
margin: auto;
|
|
272
|
-
color: var(--privy-color-foreground);
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
:hover {
|
|
276
|
-
opacity: 1;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
`,sd=tr(ld)`
|
|
280
|
-
&& {
|
|
281
|
-
background-color: transparent;
|
|
282
|
-
}
|
|
283
|
-
`,dd=tr.div`
|
|
284
|
-
padding: 16px 0;
|
|
285
|
-
display: flex;
|
|
286
|
-
align-items: center;
|
|
287
|
-
justify-content: space-between;
|
|
288
|
-
|
|
289
|
-
h2 {
|
|
290
|
-
font-size: 16px;
|
|
291
|
-
line-height: 24px;
|
|
292
|
-
font-weight: 600;
|
|
293
|
-
color: var(--privy-color-foreground);
|
|
294
|
-
}
|
|
295
|
-
`,cd=tr.div`
|
|
296
|
-
flex: 1;
|
|
297
|
-
align-items: center;
|
|
298
|
-
display: flex;
|
|
299
|
-
gap: 8px;
|
|
300
|
-
`,ud=tr.div`
|
|
301
|
-
flex: 1;
|
|
302
|
-
display: flex;
|
|
303
|
-
justify-content: flex-end;
|
|
304
|
-
`,hd=tr.div`
|
|
305
|
-
overflow: hidden;
|
|
306
|
-
white-space: nowrap;
|
|
307
|
-
max-width: 100%;
|
|
308
|
-
text-overflow: ellipsis;
|
|
309
|
-
text-align: center;
|
|
310
|
-
color: var(--privy-color-foreground-2);
|
|
311
|
-
`,pd=tr.div`
|
|
312
|
-
display: flex;
|
|
313
|
-
flex-direction: column;
|
|
314
|
-
justify-content: center;
|
|
315
|
-
align-items: center;
|
|
316
|
-
width: 100%;
|
|
317
|
-
height: 82px;
|
|
318
|
-
|
|
319
|
-
> div {
|
|
320
|
-
position: relative;
|
|
321
|
-
}
|
|
322
|
-
|
|
323
|
-
> div > span {
|
|
324
|
-
position: absolute;
|
|
325
|
-
left: -41px;
|
|
326
|
-
top: -41px;
|
|
327
|
-
}
|
|
328
|
-
|
|
329
|
-
> div > :last-child {
|
|
330
|
-
position: absolute;
|
|
331
|
-
left: -19px;
|
|
332
|
-
top: -19px;
|
|
333
|
-
}
|
|
334
|
-
`;const md=tr.div`
|
|
335
|
-
text-align: left;
|
|
336
|
-
flex-grow: 1;
|
|
337
|
-
`,fd=tr.div`
|
|
338
|
-
display: flex;
|
|
339
|
-
flex-direction: column;
|
|
340
|
-
justify-content: flex-end;
|
|
341
|
-
flex-grow: 1;
|
|
342
|
-
`,gd=tr.div`
|
|
343
|
-
display: flex;
|
|
344
|
-
flex-direction: column;
|
|
345
|
-
gap: 12px;
|
|
346
|
-
|
|
347
|
-
/* for Internet Explorer, Edge */
|
|
348
|
-
-ms-overflow-style: none;
|
|
349
|
-
|
|
350
|
-
/* for Firefox */
|
|
351
|
-
scrollbar-width: none;
|
|
352
|
-
|
|
353
|
-
/* for Chrome, Safari, and Opera */
|
|
354
|
-
&::-webkit-scrollbar {
|
|
355
|
-
display: none;
|
|
356
|
-
}
|
|
357
|
-
`,yd=tr(gd)`
|
|
358
|
-
${e=>"light"===e.$colorScheme?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;":"dark"===e.$colorScheme?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;":void 0}
|
|
359
|
-
|
|
360
|
-
background-repeat: no-repeat;
|
|
361
|
-
background-size: 100% 32px, 100% 16px;
|
|
362
|
-
background-attachment: local, scroll;
|
|
363
|
-
`;let wd=rr`
|
|
364
|
-
&& {
|
|
365
|
-
width: 100%;
|
|
366
|
-
font-size: 16px;
|
|
367
|
-
line-height: 24px;
|
|
368
|
-
|
|
369
|
-
/* Tablet and Up */
|
|
370
|
-
@media (min-width: 440px) {
|
|
371
|
-
font-size: 14px;
|
|
372
|
-
}
|
|
373
|
-
|
|
374
|
-
display: flex;
|
|
375
|
-
gap: 12px;
|
|
376
|
-
align-items: center;
|
|
377
|
-
|
|
378
|
-
padding: 12px 16px;
|
|
379
|
-
border: 1px solid var(--privy-color-foreground-4) !important;
|
|
380
|
-
border-radius: var(--privy-border-radius-mdlg);
|
|
381
|
-
transition: background-color 200ms ease;
|
|
382
|
-
|
|
383
|
-
cursor: pointer;
|
|
384
|
-
|
|
385
|
-
&:hover {
|
|
386
|
-
background-color: var(--privy-color-background-2);
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
&:disabled {
|
|
390
|
-
cursor: pointer;
|
|
391
|
-
background-color: var(--privy-color-background-2);
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
svg {
|
|
395
|
-
height: 24px;
|
|
396
|
-
max-height: 24px;
|
|
397
|
-
max-width: 24px;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
`;const vd=tr.div`
|
|
401
|
-
text-align: center;
|
|
402
|
-
font-size: 14px;
|
|
403
|
-
margin-bottom: 24px;
|
|
404
|
-
`,Cd=tr.button.attrs({className:"login-method-button"})`
|
|
405
|
-
${wd}
|
|
406
|
-
`,bd=tr.a`
|
|
407
|
-
${wd}
|
|
408
|
-
`,Ed=tr.div`
|
|
409
|
-
width: 100%;
|
|
410
|
-
height: 100%;
|
|
411
|
-
min-height: inherit;
|
|
412
|
-
display: flex;
|
|
413
|
-
flex-direction: column;
|
|
414
|
-
${e=>e.$if?"display: none;":""}
|
|
415
|
-
`;let $d=tr.div`
|
|
416
|
-
display: flex;
|
|
417
|
-
flex-direction: column;
|
|
418
|
-
align-items: center;
|
|
419
|
-
justify-content: center;
|
|
420
|
-
gap: 24px;
|
|
421
|
-
width: 100%;
|
|
422
|
-
padding-bottom: 16px;
|
|
423
|
-
margin-top: 24px;
|
|
424
|
-
`,Td=tr.div`
|
|
425
|
-
display: flex;
|
|
426
|
-
flex-direction: column;
|
|
427
|
-
gap: 8px;
|
|
428
|
-
`;const Ad=tr.span`
|
|
429
|
-
&& {
|
|
430
|
-
width: 82px;
|
|
431
|
-
height: 82px;
|
|
432
|
-
border-width: 4px;
|
|
433
|
-
border-style: solid;
|
|
434
|
-
border-color: ${e=>e.color??"var(--privy-color-accent)"};
|
|
435
|
-
border-bottom-color: transparent;
|
|
436
|
-
border-radius: 50%;
|
|
437
|
-
display: inline-block;
|
|
438
|
-
box-sizing: border-box;
|
|
439
|
-
animation: rotation 1.2s linear infinite;
|
|
440
|
-
transition: border-color 800ms;
|
|
441
|
-
border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"};
|
|
442
|
-
}
|
|
443
|
-
`;function xd(e){return t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 460 40",...e,children:t("g",{fill:e.color||"var(--privy-color-foreground)",children:t("path",{d:"M0 15.4v15.38h4.64V19.96h3.58c2.47 0 3.63-.01 3.77-.02 1-.08 1.49-.15 2.18-.3a9.45 9.45 0 0 0 4.6-2.37c1.66-1.57 2.64-3.87 2.81-6.56.02-.3.02-1.19 0-1.49-.1-1.77-.56-3.35-1.36-4.72A8.84 8.84 0 0 0 15.14.57c-.93-.3-1.75-.43-3.09-.54C11.9.02 10.2 0 5.93 0H0ZM10.85 4c1.85.05 3.1.45 4.16 1.3.22.17.54.49.69.68a5.97 5.97 0 0 1 1.19 3.13c.04.35.04 1.36 0 1.71-.08.68-.23 1.3-.44 1.85a4.8 4.8 0 0 1-1.09 1.68A5.63 5.63 0 0 1 12 15.92c-.6.08-.4.08-4.01.09H4.64V3.98h2.9c1.6 0 3.08 0 3.31.02ZM187.65 5.71v5.72h-.27l-.09-.14a15.9 15.9 0 0 0-1.21-1.73c-.43-.5-1-.95-1.7-1.36-.54-.3-1.05-.5-1.73-.63a8.98 8.98 0 0 0-1.7-.17 8.84 8.84 0 0 0-7.8 4.03 12.95 12.95 0 0 0-2.03 6.39c-.07.98-.06 2.15.02 3.13.2 2.47.87 4.53 2.02 6.25a8.98 8.98 0 0 0 10.22 3.65 6.5 6.5 0 0 0 2.8-1.93c.41-.51.84-1.1 1.1-1.55l.1-.17h.37v3.58h4.38V0h-4.48Zm-5.24 5.54c1.3.14 2.3.6 3.17 1.48.9.9 1.5 2.09 1.85 3.64.36 1.6.39 3.72.06 5.43a8.13 8.13 0 0 1-1.54 3.62 5.1 5.1 0 0 1-3.93 1.96 6.13 6.13 0 0 1-2.32-.31 5.87 5.87 0 0 1-3.33-3.5c-.39-1-.62-2.05-.72-3.32-.03-.32-.04-1.35-.02-1.73.08-1.56.4-2.91.96-4.05a6.2 6.2 0 0 1 1.06-1.58 5.08 5.08 0 0 1 3.6-1.66c.25-.02.9 0 1.16.02ZM210.07 15.39l.01 15.38h4.38l.01-3.57h.37l.09.15c.24.44.84 1.26 1.21 1.7a6.79 6.79 0 0 0 2.57 1.75 9.3 9.3 0 0 0 6.86-.49 9.28 9.28 0 0 0 4.05-4.07A13.05 13.05 0 0 0 231 21.6c.21-1.73.18-3.7-.09-5.32a13.03 13.03 0 0 0-1.5-4.3 9.1 9.1 0 0 0-3.75-3.63 9.15 9.15 0 0 0-4.43-.96 7.46 7.46 0 0 0-2.8.5A7.07 7.07 0 0 0 216 9.7c-.4.52-.82 1.12-1.1 1.59l-.07.14h-.27V0h-4.5Zm11.13-4.14c1.07.1 1.94.44 2.7 1.04a6.1 6.1 0 0 1 1.64 1.98c.43.84.78 2 .94 3.11.15 1.16.16 2.4.02 3.54a9.34 9.34 0 0 1-1.39 4.03 5.33 5.33 0 0 1-2.69 2.15c-.9.3-2.04.38-3.06.2a5.14 5.14 0 0 1-3.45-2.37 6.03 6.03 0 0 1-.45-.8c-.5-1.03-.8-2.2-.92-3.58-.04-.49-.06-.89-.05-1.53.01-.76.05-1.23.13-1.85.38-2.53 1.47-4.38 3.15-5.31a5.46 5.46 0 0 1 2.3-.63 10 10 0 0 1 1.13.02ZM69.05 2.17l-.01 2.77V7.7h-3.36v3.6h3.36v6.8l.01 7.15c.06 1.4.4 2.44 1.1 3.37a5.8 5.8 0 0 0 2.97 2.07c.91.3 1.83.42 2.9.38a8.71 8.71 0 0 0 2.66-.48l-.8-3.7-.38.06a4.96 4.96 0 0 1-2.43-.06c-.33-.1-.56-.25-.8-.49-.4-.41-.6-.88-.7-1.67-.02-.2-.02-.62-.03-6.82v-6.6h4.73V7.7h-4.73V2.16h-4.49ZM133.34 2.17V7.7h-3.39v3.6h3.38v6.9l.01 7.17a5.66 5.66 0 0 0 2.36 4.49c.85.6 2.03 1.03 3.26 1.17.85.1 2.03.05 2.81-.1.3-.06.75-.18 1-.26l.2-.06v-.05l-.81-3.67-.37.06a4.99 4.99 0 0 1-1.8.09c-.85-.13-1.32-.4-1.7-.97a2.63 2.63 0 0 1-.39-1.04c-.06-.4-.06 0-.06-7.1V11.3h4.7V7.7h-4.7l-.01-2.77V2.16h-4.49ZM293.41 2.36a14.56 14.56 0 0 0-13.7 16.07 14.59 14.59 0 0 0 21.86 11.08 14.5 14.5 0 0 0 7.11-14.07 14.61 14.61 0 0 0-6.53-10.73 14.49 14.49 0 0 0-8.74-2.35ZM350.8 2.36a10.17 10.17 0 0 0-7.56 4.2c-.16.2-.45.63-.58.83l-.05.1h-.47l-.01-4.36h-7.36v36.4h7.82V27.27h.49l.05.07a11.3 11.3 0 0 0 7.49 4.15 10.52 10.52 0 0 0 9.38-4.1c1.66-2.1 2.73-4.9 3.07-8.06.1-.87.13-1.4.13-2.37 0-.8 0-1.1-.07-1.76a15.95 15.95 0 0 0-3.23-8.72 12.8 12.8 0 0 0-1.85-1.84 10.49 10.49 0 0 0-7.26-2.28Zm-.94 6.05c1.27.15 2.33.65 3.2 1.5.98.96 1.67 2.31 2.03 4 .34 1.57.38 3.68.12 5.39a9.78 9.78 0 0 1-1.04 3.25c-.14.25-.44.69-.6.89a5.35 5.35 0 0 1-4.31 2.07 5.25 5.25 0 0 1-4.41-1.9 7.35 7.35 0 0 1-1.26-2.32 14.09 14.09 0 0 1-.62-4.83c.05-1.98.38-3.53 1.02-4.85a5.63 5.63 0 0 1 2.5-2.65c.66-.34 1.3-.5 2.14-.58.18-.02 1.04 0 1.23.03ZM363.63 3.1l-.01 3.2v3.16h1.43c1.26.01 1.44.02 1.54.04.42.09.66.28.79.62.08.23.08.08.08 2.96a911.57 911.57 0 0 1 .03 10.18v7.54h7.82v-7.4l.01-7.83c.03-.94.11-1.63.27-2.28.46-1.9 1.54-2.93 3.35-3.23.52-.08.2-.08 5-.08h4.4V3.08h-3.1c-3.48 0-3.91.01-4.67.1-1.83.2-3.04.79-3.96 1.88-.5.6-.9 1.32-1.26 2.26l-.06.17h-.46V3.09h-5.6c-4.46 0-5.6 0-5.6.02ZM390.8 16.95V30.8h3.87l3.86-.01V3.09h-7.73ZM400.6 3.1l-.01.4v.38l4.66 13.4 4.69 13.47.02.05h10.3l.03-.05 4.67-13.45 4.67-13.4V3.1h-7.43l-6.7 19.26h-.5l-3.28-9.5-3.31-9.64-.05-.12h-3.88l-3.88.01ZM430.98 3.1c-.01 0-.02.19-.02.4v.39l5.08 14.59c2.8 8.02 5.08 14.6 5.08 14.61.01.02-.22.02-4.8.02h-4.82v6.42h4.95c5.09 0 5.23 0 5.87-.06 3.15-.28 5.29-1.63 6.63-4.15.28-.55.44-.95.87-2.16L459 6.78l1-2.89v-.8h-7.43l-6.69 19.26h-.5l-3.27-9.46-3.31-9.64-.06-.16h-3.88l-3.88.01ZM36.57 7.36c-1.36.1-2.6.6-3.62 1.45a5.65 5.65 0 0 0-1.67 2.42l-.05.13H31V7.7h-4.35v23.08h4.5v-7.3c0-8 0-7.34.08-7.82a4.89 4.89 0 0 1 2.06-3.18c.83-.58 1.74-.89 2.87-.98a11.87 11.87 0 0 1 2.8.25H39v-4.3l-.21-.02c-.61-.07-1.74-.1-2.22-.07ZM51.08 7.41c-2.33.12-4.3.84-5.95 2.16a9.89 9.89 0 0 0-2.03 2.2 12.5 12.5 0 0 0-2 5.78 18.04 18.04 0 0 0 0 3.65 12.13 12.13 0 0 0 2.26 6.05 9.74 9.74 0 0 0 5 3.52c2.11.64 4.7.64 6.8 0a9.78 9.78 0 0 0 4.88-3.37c1.38-1.78 2.19-4 2.4-6.58.13-1.46.06-3.06-.18-4.42a11.24 11.24 0 0 0-3.58-6.6 10 10 0 0 0-5.75-2.35c-.56-.06-1.31-.07-1.85-.04Zm1.42 3.78c.88.1 1.62.34 2.28.75a6.13 6.13 0 0 1 1.99 2.15 10.31 10.31 0 0 1 1.2 5c.02 1.23-.12 2.44-.42 3.51a7.14 7.14 0 0 1-1.81 3.32c-.61.6-1.2.98-1.95 1.24a6 6 0 0 1-2 .3 5.7 5.7 0 0 1-2.72-.6 5 5 0 0 1-1.28-.94A7.1 7.1 0 0 1 46 22.73c-.57-1.99-.6-4.46-.08-6.5a7.24 7.24 0 0 1 2.03-3.67 5.13 5.13 0 0 1 3.35-1.4 11 11 0 0 1 1.2.03ZM92.05 7.4c-.96.06-1.56.15-2.3.33a9.62 9.62 0 0 0-6.09 4.66 13.5 13.5 0 0 0-1.71 7c0 .83 0 1.04.06 1.6.16 1.77.58 3.32 1.29 4.7A9.72 9.72 0 0 0 90.28 31c1.84.37 4.08.32 5.85-.13a9.07 9.07 0 0 0 5.02-3.1A7.64 7.64 0 0 0 102.5 25l-2.11-.39-2.11-.38-.08.13a4.72 4.72 0 0 1-2.35 2.55 6.3 6.3 0 0 1-2.23.58c-.29.03-1.13.03-1.44 0a6.35 6.35 0 0 1-3.02-1.04 5.93 5.93 0 0 1-2.02-2.43 8.44 8.44 0 0 1-.72-3.18v-.26h16.38v-.81c0-1.83-.06-2.76-.25-3.87-.2-1.22-.53-2.24-1.05-3.28a8.9 8.9 0 0 0-2.66-3.26 10.1 10.1 0 0 0-5.34-1.94 18.3 18.3 0 0 0-1.46-.03Zm1.3 3.75c1.2.13 2.19.55 3.05 1.3a5.8 5.8 0 0 1 1.78 2.96c.13.51.21 1.17.21 1.66v.15H86.43v-.12c.08-.97.3-1.78.72-2.61.5-1 1.2-1.8 2.14-2.42a5.32 5.32 0 0 1 2.9-.95c.2-.01.97 0 1.17.03ZM116.79 7.41c-2 .1-3.73.65-5.22 1.65a10.7 10.7 0 0 0-4.25 6.06 16.1 16.1 0 0 0-.5 5.8c.2 2.17.84 4.13 1.88 5.76.58.9 1.32 1.73 2.15 2.4a9.37 9.37 0 0 0 3.6 1.8 12.06 12.06 0 0 0 3.92.34 10.2 10.2 0 0 0 3.84-.95 8.31 8.31 0 0 0 4.76-6.75l.01-.04h-4.37l-.05.16a4.87 4.87 0 0 1-4.24 3.75c-.59.07-1.32.06-1.93-.05a5.47 5.47 0 0 1-3.5-2.27c-.56-.75-1-1.73-1.26-2.79a13.8 13.8 0 0 1-.16-5.24 7.77 7.77 0 0 1 2.1-4.3 5.48 5.48 0 0 1 2.15-1.3 6.4 6.4 0 0 1 3.89.1c.59.21 1.03.5 1.5.96a5.32 5.32 0 0 1 1.46 2.5l.04.15h4.37v-.06a8.22 8.22 0 0 0-5.31-6.94 10.98 10.98 0 0 0-4.88-.74ZM156.2 7.41a9.87 9.87 0 0 0-6 2.29 11.02 11.02 0 0 0-3.41 5.43c-.52 1.78-.68 3.9-.48 5.97.17 1.8.63 3.38 1.37 4.8a9.68 9.68 0 0 0 5.91 4.86c1.65.48 3.63.61 5.53.36 3.72-.49 6.55-2.62 7.56-5.69.12-.39.13-.42.1-.43-.02 0-4.13-.75-4.19-.75-.03 0-.04 0-.1.16-.18.42-.45.9-.72 1.22-.16.2-.49.53-.7.7-.67.54-1.5.9-2.43 1.08-.48.08-.83.11-1.41.11-.64 0-1.07-.04-1.6-.15a5.76 5.76 0 0 1-3.93-2.83 8 8 0 0 1-.99-3.79v-.16h16.38v-1.11l-.02-1.43c-.1-2.25-.53-4-1.35-5.59a9.24 9.24 0 0 0-6.18-4.75c-1.04-.26-2.2-.36-3.33-.3Zm1.45 3.74a5.35 5.35 0 0 1 3.66 1.94 6.1 6.1 0 0 1 1.38 4.01v.12h-11.97v-.06c0-.02 0-.14.02-.25a6.6 6.6 0 0 1 2.15-4.32 5.73 5.73 0 0 1 3.5-1.46c.25-.02 1 0 1.26.02ZM233.58 7.82l8.37 23.22a49.22 49.22 0 0 1-.67 1.9 5.36 5.36 0 0 1-1.14 1.8c-.41.4-.82.58-1.48.69-.27.04-1.03.03-1.35 0a8.05 8.05 0 0 1-1.1-.23l-1.08 3.67c0 .02.32.14.66.22.83.21 1.57.29 2.56.28.56-.01.8-.03 1.24-.1 2.71-.4 4.66-2.09 5.86-5.08l9.64-26.44c0-.02-4.82-.06-4.83-.05l-2.93 8.96-2.91 8.94h-.24l-.22-.65-2.91-8.95-2.7-8.3H233.53ZM293.05 35.8c-1.18.04-1.93.09-2.8.16-2.52.24-4.53.69-5.43 1.23-.7.41-.76.86-.2 1.28.88.66 3.29 1.19 6.36 1.4a48.55 48.55 0 0 0 5.75.05c3.47-.19 6.24-.78 7.11-1.5.22-.19.3-.34.3-.53 0-.1 0-.12-.04-.22-.35-.69-2.32-1.3-5.25-1.63a41.09 41.09 0 0 0-5.8-.24Zm0 0"})})})}let _d=tr.div`
|
|
444
|
-
margin-top: 16px;
|
|
445
|
-
font-size: 13px;
|
|
446
|
-
text-align: center;
|
|
447
|
-
color: var(--privy-color-foreground-3);
|
|
448
|
-
|
|
449
|
-
&& > a {
|
|
450
|
-
color: var(--privy-color-accent);
|
|
451
|
-
}
|
|
452
|
-
`;function kd(r){let{legal:{privacyPolicyUrl:n,termsAndConditionsUrl:a,requireUsersAcceptTerms:i}}=r.app;if(i&&!r.alwaysShowImplicitConsent||!a&&!n)return t(_d,{});let o=!(!n||!a);return e(_d,{children:["By logging in I agree to the"," ",a&&t("a",{href:a,target:"_blank",children:o?"Terms":"Terms of Service"}),o&&" & ",n&&t("a",{href:n,target:"_blank",children:"Privacy Policy"})]})}const Nd=()=>t(Sd,{children:t("a",{href:"https://www.privy.io/",target:"_blank",children:t(xd,{height:13,width:150})})}),Sd=tr.div`
|
|
453
|
-
display: flex;
|
|
454
|
-
align-items: center;
|
|
455
|
-
justify-content: center;
|
|
456
|
-
padding-top: 8px;
|
|
457
|
-
padding-bottom: 12px;
|
|
458
|
-
gap: 8px;
|
|
459
|
-
|
|
460
|
-
font-size: 13px;
|
|
461
|
-
|
|
462
|
-
&& a {
|
|
463
|
-
padding: 0.5rem 0;
|
|
464
|
-
|
|
465
|
-
&:hover {
|
|
466
|
-
text-decoration: none;
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
@media all and (display-mode: standalone) {
|
|
471
|
-
padding-bottom: 30px;
|
|
472
|
-
}
|
|
473
|
-
`,Id=({address:r,showCopyIcon:n,url:a,className:i})=>{let[o,l]=d(!1);return p((()=>{if(o){let e=setTimeout((()=>l(!1)),2e3);return()=>clearTimeout(e)}}),[o]),a?t("a",{title:r,className:i,href:`${a}/address/${r}`,target:"_blank",children:Be(r)}):e("button",{title:r,className:i,onClick:e=>(e.stopPropagation(),navigator.clipboard.writeText(r).then((()=>l(!0))).catch(console.error)),children:[Be(r),n&&t(o?Pd:Od,{})]})};let Od=tr(hr)`
|
|
474
|
-
&& {
|
|
475
|
-
display: inline;
|
|
476
|
-
}
|
|
477
|
-
stroke-width: 2;
|
|
478
|
-
height: 0.875rem;
|
|
479
|
-
width: 0.875rem;
|
|
480
|
-
margin-left: 0.125rem;
|
|
481
|
-
color: var(--privy-color-foreground-3);
|
|
482
|
-
`,Pd=tr(ur)`
|
|
483
|
-
&& {
|
|
484
|
-
display: inline;
|
|
485
|
-
}
|
|
486
|
-
stroke-width: 2;
|
|
487
|
-
height: 0.875rem;
|
|
488
|
-
width: 0.875rem;
|
|
489
|
-
margin-left: 0.125rem;
|
|
490
|
-
color: var(--privy-color-success);
|
|
491
|
-
`;const Md=({onTransfer:e,isTransferring:r,transferSuccess:n})=>t(Hs,{...n?{success:!0,children:"Success!"}:{warn:!0,loading:r,onClick:e,children:"Transfer and delete account"}}),Rd=tr.div`
|
|
492
|
-
display: flex;
|
|
493
|
-
flex-direction: column;
|
|
494
|
-
align-items: center;
|
|
495
|
-
justify-content: center;
|
|
496
|
-
gap: 8px;
|
|
497
|
-
width: 100%;
|
|
498
|
-
padding-bottom: 16px;
|
|
499
|
-
`,Ld=tr.div`
|
|
500
|
-
display: flex;
|
|
501
|
-
flex-direction: column;
|
|
502
|
-
&& p {
|
|
503
|
-
font-size: 14px;
|
|
504
|
-
}
|
|
505
|
-
width: 100%;
|
|
506
|
-
gap: 16px;
|
|
507
|
-
`,Dd=tr.div`
|
|
508
|
-
display: flex;
|
|
509
|
-
cursor: pointer;
|
|
510
|
-
align-items: center;
|
|
511
|
-
width: 100%;
|
|
512
|
-
border: 1px solid var(--privy-color-foreground-4) !important;
|
|
513
|
-
border-radius: var(--privy-border-radius-md);
|
|
514
|
-
padding: 8px 10px;
|
|
515
|
-
font-size: 14px;
|
|
516
|
-
font-weight: 500;
|
|
517
|
-
gap: 8px;
|
|
518
|
-
`,Fd=tr(pr)`
|
|
519
|
-
position: relative;
|
|
520
|
-
width: ${e=>`${e.iconSize}px`};
|
|
521
|
-
height: ${e=>`${e.iconSize}px`};
|
|
522
|
-
color: var(--privy-color-foreground-3);
|
|
523
|
-
margin-left: auto;
|
|
524
|
-
`,Ud=tr(hr)`
|
|
525
|
-
position: relative;
|
|
526
|
-
width: 15px;
|
|
527
|
-
height: 15px;
|
|
528
|
-
color: var(--privy-color-foreground-3);
|
|
529
|
-
margin-left: auto;
|
|
530
|
-
`,Wd=tr.ol`
|
|
531
|
-
display: flex;
|
|
532
|
-
flex-direction: column;
|
|
533
|
-
font-size: 14px;
|
|
534
|
-
width: 100%;
|
|
535
|
-
text-align: left;
|
|
536
|
-
`,Bd=tr.li`
|
|
537
|
-
font-size: 14px;
|
|
538
|
-
list-style-type: auto;
|
|
539
|
-
list-style-position: outside;
|
|
540
|
-
margin-left: 1rem;
|
|
541
|
-
margin-bottom: 0.5rem; /* Adjust the margin as needed */
|
|
542
|
-
|
|
543
|
-
&:last-child {
|
|
544
|
-
margin-bottom: 0; /* Remove margin from the last item */
|
|
545
|
-
}
|
|
546
|
-
`,jd=tr.div`
|
|
547
|
-
position: relative;
|
|
548
|
-
width: 60px;
|
|
549
|
-
height: 60px;
|
|
550
|
-
margin: 10px;
|
|
551
|
-
display: flex;
|
|
552
|
-
justify-content: center;
|
|
553
|
-
align-items: center;
|
|
554
|
-
`;let zd=()=>t(jd,{children:t(Fd,{iconSize:60})});const Gd=({address:n,onClose:a,onRetry:i,onTransfer:o,isTransferring:l,transferSuccess:s})=>{let{defaultChain:d}=Ue(),c=d.blockExplorers?.default.url??"https://etherscan.io";return e(r,{children:[t(od,{onClose:a,backFn:i}),e(Rd,{children:[t(zd,{}),e(Ld,{children:[t("h3",{children:"Check account assets before transferring"}),t("p",{children:"Before transferring, ensure there are no assets in the other account. Assets in that account will not transfer automatically and may be lost."}),e(Wd,{children:[t("p",{children:" To check your balance, you can:"}),t(Bd,{children:"Log out and log back into the other account, or "}),e(Bd,{children:["Copy your wallet address and use a"," ",t("u",{children:t("a",{target:"_blank",href:c,children:"block explorer"})})," ","to see if the account holds any assets."]})]}),e(Dd,{onClick:()=>navigator.clipboard.writeText(n).catch(console.error),children:[t(cr,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),t(Id,{address:n,showCopyIcon:!1}),t(Ud,{})]}),t(Md,{onTransfer:o,isTransferring:l,transferSuccess:s})]})]}),t(Nd,{})]})},Hd=({onClose:n,onContinue:a,onInfo:i,onTransfer:o,transferSuccess:l,isTransferring:s,data:d})=>{if(!d?.accountTransfer?.linkMethod||!d?.accountTransfer?.displayName)return;let c={method:d?.accountTransfer?.linkMethod,handle:d?.accountTransfer?.displayName,disclosedAccount:d?.accountTransfer?.embeddedWalletAddress?{type:"wallet",handle:d?.accountTransfer?.embeddedWalletAddress}:void 0};return e(r,{children:[t(od,{closeable:!0}),e(Rd,{children:[t(pd,{children:e("div",{children:[t(Ad,{color:"var(--privy-color-error)"}),t(dr,{height:38,width:38,stroke:"var(--privy-color-error)"})]})}),e(Ld,{children:[e("h3",{children:[function(e){switch(e){case"sms":return"Phone number";case"email":return"Email address";case"siwe":return"Wallet address";case"linkedin":return"LinkedIn profile";case"google":case"apple":case"discord":case"github":case"instagram":case"spotify":case"tiktok":case"twitter":case"telegram":case"farcaster":return`${Xo(e.replace("_oauth",""))} profile`;default:return e}}(c.method)," is associated with another account"]}),e("p",{children:["Do you want to transfer",t("b",{children:c.handle?` ${c.handle}`:""})," to this account instead? This will delete your other account."]}),t(Vd,{onClick:i,disclosedAccount:c.disclosedAccount})]}),e(Ld,{style:{gap:12,marginTop:12},children:[d?.accountTransfer?.embeddedWalletAddress?t(Hs,{onClick:a,children:"Continue"}):t(Md,{onTransfer:o,transferSuccess:l,isTransferring:s}),t(Ys,{onClick:n,children:"No thanks"})]})]}),t(Nd,{})]})};function Vd({disclosedAccount:r,onClick:n}){return r?e(Dd,{onClick:n,children:[t(cr,{color:"var(--privy-color-foreground-1)",strokeWidth:2,height:"28px",width:"28px"}),t(Id,{address:r.handle,showCopyIcon:!1}),t(Fd,{iconSize:15})]}):null}const qd=tr.div`
|
|
555
|
-
display: flex;
|
|
556
|
-
flex-direction: column;
|
|
557
|
-
align-items: center;
|
|
558
|
-
padding: 0px 0px 30px;
|
|
559
|
-
@media (max-width: 440px) {
|
|
560
|
-
padding: 10px 10px 20px;
|
|
561
|
-
}
|
|
562
|
-
`,Zd=tr.div`
|
|
563
|
-
font-size: 18px;
|
|
564
|
-
line-height: 30px;
|
|
565
|
-
text-align: center;
|
|
566
|
-
font-weight: 600;
|
|
567
|
-
margin-bottom: 10px;
|
|
568
|
-
`,Kd=tr.div`
|
|
569
|
-
font-size: 0.875rem;
|
|
570
|
-
|
|
571
|
-
text-align: center;
|
|
572
|
-
`,Yd=tr.div`
|
|
573
|
-
display: flex;
|
|
574
|
-
flex-direction: column;
|
|
575
|
-
align-items: center;
|
|
576
|
-
gap: 10px;
|
|
577
|
-
flex-grow: 1;
|
|
578
|
-
padding: 20px 0;
|
|
579
|
-
@media (max-width: 440px) {
|
|
580
|
-
padding: 10px 10px 20px;
|
|
581
|
-
}
|
|
582
|
-
`,Qd=tr.div`
|
|
583
|
-
display: flex;
|
|
584
|
-
flex-direction: column;
|
|
585
|
-
align-items: stretch;
|
|
586
|
-
gap: 0.75rem;
|
|
587
|
-
padding: 1rem 0rem 0rem;
|
|
588
|
-
flex-grow: 1;
|
|
589
|
-
width: 100%;
|
|
590
|
-
`,Jd=tr.div`
|
|
591
|
-
width: 25px;
|
|
592
|
-
display: flex;
|
|
593
|
-
align-items: center;
|
|
594
|
-
justify-content: flex-start;
|
|
595
|
-
|
|
596
|
-
> svg {
|
|
597
|
-
z-index: 2;
|
|
598
|
-
height: 25px !important;
|
|
599
|
-
width: 25px !important;
|
|
600
|
-
color: var(--privy-color-accent);
|
|
601
|
-
}
|
|
602
|
-
`,Xd=tr.div`
|
|
603
|
-
display: flex;
|
|
604
|
-
align-items: center;
|
|
605
|
-
gap: 10px;
|
|
606
|
-
font-size: 0.875rem;
|
|
607
|
-
line-height: 1rem;
|
|
608
|
-
text-align: left;
|
|
609
|
-
`,ec=tr.div`
|
|
610
|
-
display: flex;
|
|
611
|
-
flex-direction: column;
|
|
612
|
-
gap: 10px;
|
|
613
|
-
padding-top: 20px;
|
|
614
|
-
`,tc=tr.div`
|
|
615
|
-
display: flex;
|
|
616
|
-
flex-direction: column;
|
|
617
|
-
align-items: stretch;
|
|
618
|
-
gap: 1rem;
|
|
619
|
-
padding: 1rem 0rem 0rem;
|
|
620
|
-
flex-grow: 1;
|
|
621
|
-
width: 100%;
|
|
622
|
-
`,rc=tr.div`
|
|
623
|
-
display: flex;
|
|
624
|
-
gap: 5px;
|
|
625
|
-
width: 100%;
|
|
626
|
-
position: relative;
|
|
627
|
-
`,nc=tr.button`
|
|
628
|
-
&& {
|
|
629
|
-
background-color: transparent;
|
|
630
|
-
color: var(--privy-color-foreground-3);
|
|
631
|
-
padding: 0 0.75rem;
|
|
632
|
-
display: flex;
|
|
633
|
-
align-items: center;
|
|
634
|
-
height: 100%;
|
|
635
|
-
|
|
636
|
-
> svg {
|
|
637
|
-
z-index: 2;
|
|
638
|
-
height: 20px !important;
|
|
639
|
-
width: 20px !important;
|
|
640
|
-
}
|
|
641
|
-
}
|
|
642
|
-
|
|
643
|
-
&&:hover {
|
|
644
|
-
color: var(--privy-color-error);
|
|
645
|
-
}
|
|
646
|
-
`,ac=tr.div`
|
|
647
|
-
display: flex;
|
|
648
|
-
align-items: center;
|
|
649
|
-
gap: 0.5rem;
|
|
650
|
-
|
|
651
|
-
> svg {
|
|
652
|
-
z-index: 2;
|
|
653
|
-
height: 20px !important;
|
|
654
|
-
width: 20px !important;
|
|
655
|
-
}
|
|
656
|
-
`,ic=tr.div`
|
|
657
|
-
display: flex;
|
|
658
|
-
align-items: center;
|
|
659
|
-
gap: 6px;
|
|
660
|
-
font-weight: 400 !important;
|
|
661
|
-
color: ${e=>e.isAccent?"var(--privy-color-accent)":"var(--privy-color-foreground-3)"};
|
|
662
|
-
|
|
663
|
-
> svg {
|
|
664
|
-
z-index: 2;
|
|
665
|
-
height: 18px !important;
|
|
666
|
-
width: 18px !important;
|
|
667
|
-
display: flex !important;
|
|
668
|
-
align-items: flex-end;
|
|
669
|
-
}
|
|
670
|
-
`,oc=tr.div`
|
|
671
|
-
width: 100%;
|
|
672
|
-
display: flex;
|
|
673
|
-
justify-content: space-between;
|
|
674
|
-
`,lc=tr.p`
|
|
675
|
-
text-align: left;
|
|
676
|
-
width: 100%;
|
|
677
|
-
color: var(--privy-color-foreground-3) !important;
|
|
678
|
-
`,sc=tr.button`
|
|
679
|
-
display: flex;
|
|
680
|
-
flex-direction: row;
|
|
681
|
-
align-items: center;
|
|
682
|
-
justify-content: center;
|
|
683
|
-
user-select: none;
|
|
684
|
-
|
|
685
|
-
& {
|
|
686
|
-
width: 100%;
|
|
687
|
-
cursor: pointer;
|
|
688
|
-
border-radius: var(--privy-border-radius-md);
|
|
689
|
-
|
|
690
|
-
font-size: 0.875rem;
|
|
691
|
-
line-height: 1rem;
|
|
692
|
-
font-style: normal;
|
|
693
|
-
font-weight: 500;
|
|
694
|
-
line-height: 22px; /* 137.5% */
|
|
695
|
-
letter-spacing: -0.016px;
|
|
696
|
-
}
|
|
697
|
-
|
|
698
|
-
&& {
|
|
699
|
-
color: ${e=>"dark"===e.theme?"var(--privy-color-foreground-2)":"var(--privy-color-accent)"};
|
|
700
|
-
background-color: transparent;
|
|
701
|
-
|
|
702
|
-
padding: 0.5rem 0px;
|
|
703
|
-
}
|
|
704
|
-
|
|
705
|
-
&:hover {
|
|
706
|
-
text-decoration: underline;
|
|
707
|
-
}
|
|
708
|
-
`,dc=tr.div`
|
|
709
|
-
display: flex;
|
|
710
|
-
align-items: center;
|
|
711
|
-
justify-content: center;
|
|
712
|
-
color: var(--privy-color-accent);
|
|
713
|
-
width: 100%;
|
|
714
|
-
|
|
715
|
-
> svg {
|
|
716
|
-
z-index: 2;
|
|
717
|
-
width: 3rem;
|
|
718
|
-
height: 3rem;
|
|
719
|
-
}
|
|
720
|
-
`,cc=tr.div`
|
|
721
|
-
color: var(--privy-color-error);
|
|
722
|
-
`,uc=({termsAndConditionsUrl:n,privacyPolicyUrl:a,onAccept:i,onDecline:o})=>e(r,{children:[t(od,{closeable:!1}),t(fr,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),t(Zd,{style:{marginTop:24},children:"One last step"}),t(Kd,{children:"By signing up, you agree to our terms and privacy policy."}),e(gd,{style:{marginTop:24},children:[n&&e(bd,{target:"_blank",href:n,children:["View Terms ",t(mr,{style:{marginLeft:"auto"}})]}),a&&e(bd,{target:"_blank",href:a,children:["View Privacy Policy ",t(mr,{style:{marginLeft:"auto"}})]})]}),e(hc,{style:{marginTop:24},children:[t(Ys,{onClick:o,children:"No thanks"}),t(Hs,{onClick:i,children:"Accept"})]}),t(Nd,{})]});let hc=tr.div`
|
|
723
|
-
display: flex;
|
|
724
|
-
gap: 10px;
|
|
725
|
-
`;const pc=({style:e,...r})=>t("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...r,children:t("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})});let mc=tr.div`
|
|
726
|
-
display: flex;
|
|
727
|
-
flex-direction: column;
|
|
728
|
-
align-items: center;
|
|
729
|
-
justify-content: center;
|
|
730
|
-
gap: 24px;
|
|
731
|
-
width: 100%;
|
|
732
|
-
padding-bottom: 16px;
|
|
733
|
-
`,fc=tr.div`
|
|
734
|
-
display: flex;
|
|
735
|
-
flex-direction: column;
|
|
736
|
-
gap: 8px;
|
|
737
|
-
`;const gc=tr.div`
|
|
738
|
-
display: flex;
|
|
739
|
-
flex-direction: column;
|
|
740
|
-
align-items: flex-start;
|
|
741
|
-
justify-content: flex-end;
|
|
742
|
-
margin-top: auto;
|
|
743
|
-
gap: 16px;
|
|
744
|
-
flex-grow: 100;
|
|
745
|
-
`,yc=tr.div`
|
|
746
|
-
display: flex;
|
|
747
|
-
flex-direction: column;
|
|
748
|
-
align-items: center;
|
|
749
|
-
justify-content: center;
|
|
750
|
-
flex-grow: 1;
|
|
751
|
-
width: 100%;
|
|
752
|
-
`,wc=tr.div`
|
|
753
|
-
display: flex;
|
|
754
|
-
flex-direction: column;
|
|
755
|
-
align-items: center;
|
|
756
|
-
width: 100%;
|
|
757
|
-
`,vc=tr(yc)`
|
|
758
|
-
padding: 20px 0;
|
|
759
|
-
`,Cc=tr(yc)`
|
|
760
|
-
gap: 16px;
|
|
761
|
-
`,bc=tr.div`
|
|
762
|
-
display: flex;
|
|
763
|
-
flex-direction: column;
|
|
764
|
-
width: 100%;
|
|
765
|
-
`,Ec=tr.div`
|
|
766
|
-
display: flex;
|
|
767
|
-
flex-direction: column;
|
|
768
|
-
gap: 8px;
|
|
769
|
-
`;tr.div`
|
|
770
|
-
display: flex;
|
|
771
|
-
flex-direction: column;
|
|
772
|
-
justify-content: space-between;
|
|
773
|
-
height: 100%;
|
|
774
|
-
`;const $c=tr.div`
|
|
775
|
-
display: flex;
|
|
776
|
-
flex-direction: column;
|
|
777
|
-
justify-content: flex-start;
|
|
778
|
-
align-items: flex-start;
|
|
779
|
-
text-align: left;
|
|
780
|
-
gap: 8px;
|
|
781
|
-
padding: 16px;
|
|
782
|
-
margin-top: 16px;
|
|
783
|
-
margin-bottom: 16px;
|
|
784
|
-
width: 100%;
|
|
785
|
-
background: var(--privy-color-background-2);
|
|
786
|
-
border-radius: var(--privy-border-radius-md);
|
|
787
|
-
&& h4 {
|
|
788
|
-
color: var(--privy-color-foreground-3);
|
|
789
|
-
font-size: 14px;
|
|
790
|
-
text-decoration: underline;
|
|
791
|
-
font-weight: medium;
|
|
792
|
-
}
|
|
793
|
-
&& p {
|
|
794
|
-
color: var(--privy-color-foreground-3);
|
|
795
|
-
font-size: 14px;
|
|
796
|
-
}
|
|
797
|
-
`,Tc=tr.div`
|
|
798
|
-
height: 16px;
|
|
799
|
-
`,Ac=tr.div`
|
|
800
|
-
height: 12px;
|
|
801
|
-
`,xc=tr.div`
|
|
802
|
-
position: relative;
|
|
803
|
-
`,_c=tr.div`
|
|
804
|
-
height: ${e=>e.height??"12"}px;
|
|
805
|
-
`,kc=tr.div`
|
|
806
|
-
background-color: var(--privy-color-accent);
|
|
807
|
-
display: flex;
|
|
808
|
-
justify-content: center;
|
|
809
|
-
align-items: center;
|
|
810
|
-
border-radius: 50%;
|
|
811
|
-
border-color: white;
|
|
812
|
-
border-width: 2px !important;
|
|
813
|
-
`,Nc=({title:n,description:a,children:i,...o})=>t(Oc,{...o,children:e(r,{children:[t("h3",{children:n}),"string"==typeof a?t("p",{children:a}):a,i]})}),Sc=tr(Nc)`
|
|
814
|
-
margin-bottom: 24px;
|
|
815
|
-
`,Ic=({title:r,description:n,icon:a,children:i,...o})=>e(Pc,{...o,children:[a||null,t("h3",{children:r}),n&&"string"==typeof n?t("p",{children:n}):n,i]});let Oc=tr.div`
|
|
816
|
-
display: flex;
|
|
817
|
-
flex-direction: column;
|
|
818
|
-
justify-content: flex-start;
|
|
819
|
-
align-items: flex-start;
|
|
820
|
-
text-align: left;
|
|
821
|
-
gap: 8px;
|
|
822
|
-
width: 100%;
|
|
823
|
-
margin-bottom: 24px;
|
|
824
|
-
|
|
825
|
-
&& h3 {
|
|
826
|
-
font-size: 17px;
|
|
827
|
-
color: var(--privy-color-foreground);
|
|
828
|
-
}
|
|
829
|
-
|
|
830
|
-
/* Sugar assuming children are paragraphs. Otherwise, handling styling on your own */
|
|
831
|
-
&& p {
|
|
832
|
-
color: var(--privy-color-foreground-2);
|
|
833
|
-
font-size: 14px;
|
|
834
|
-
}
|
|
835
|
-
`,Pc=tr(Oc)`
|
|
836
|
-
align-items: center;
|
|
837
|
-
text-align: center;
|
|
838
|
-
gap: 16px;
|
|
839
|
-
|
|
840
|
-
h3 {
|
|
841
|
-
margin-bottom: 24px;
|
|
842
|
-
}
|
|
843
|
-
`;var Mc,Rc,Lc,Dc;let Fc=Array(6).fill("");(Lc=Mc||(Mc={}))[Lc.RESET_AFTER_DELAY=0]="RESET_AFTER_DELAY",Lc[Lc.CLEAR_ON_NEXT_VALID_INPUT=1]="CLEAR_ON_NEXT_VALID_INPUT",(Dc=Rc||(Rc={}))[Dc.EMAIL=0]="EMAIL",Dc[Dc.SMS=1]="SMS";let Uc=tr.div`
|
|
844
|
-
display: flex;
|
|
845
|
-
flex-direction: column;
|
|
846
|
-
align-items: flex-start;
|
|
847
|
-
justify-content: center;
|
|
848
|
-
margin: auto;
|
|
849
|
-
gap: 16px;
|
|
850
|
-
flex-grow: 1;
|
|
851
|
-
`,Wc=tr.div`
|
|
852
|
-
display: flex;
|
|
853
|
-
flex-direction: column;
|
|
854
|
-
width: 100%;
|
|
855
|
-
gap: 8px;
|
|
856
|
-
|
|
857
|
-
> div:last-child {
|
|
858
|
-
display: flex;
|
|
859
|
-
justify-content: center;
|
|
860
|
-
gap: 0.5rem;
|
|
861
|
-
width: 100%;
|
|
862
|
-
border-radius: var(--privy-border-radius-md);
|
|
863
|
-
|
|
864
|
-
> input {
|
|
865
|
-
border: 1px solid var(--privy-color-foreground-4);
|
|
866
|
-
background: var(--privy-color-background);
|
|
867
|
-
border-radius: var(--privy-border-radius-md);
|
|
868
|
-
padding: 8px 10px;
|
|
869
|
-
height: 58px;
|
|
870
|
-
width: 46px;
|
|
871
|
-
text-align: center;
|
|
872
|
-
font-size: 18px;
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
> input:focus {
|
|
876
|
-
border: 1px solid var(--privy-color-accent);
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
> input:invalid {
|
|
880
|
-
border: 1px solid var(--privy-color-error);
|
|
881
|
-
}
|
|
882
|
-
|
|
883
|
-
> input.success {
|
|
884
|
-
border: 1px solid var(--privy-color-success);
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
> input.fail {
|
|
888
|
-
border: 1px solid var(--privy-color-error);
|
|
889
|
-
animation: shake 180ms;
|
|
890
|
-
animation-iteration-count: 2;
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
@keyframes shake {
|
|
895
|
-
0% {
|
|
896
|
-
transform: translate(1px, 0px);
|
|
897
|
-
}
|
|
898
|
-
33% {
|
|
899
|
-
transform: translate(-1px, 0px);
|
|
900
|
-
}
|
|
901
|
-
67% {
|
|
902
|
-
transform: translate(-1px, 0px);
|
|
903
|
-
}
|
|
904
|
-
100% {
|
|
905
|
-
transform: translate(1px, 0px);
|
|
906
|
-
}
|
|
907
|
-
}
|
|
908
|
-
`,Bc=tr.div`
|
|
909
|
-
line-height: 20px;
|
|
910
|
-
height: 20px;
|
|
911
|
-
font-size: 13px;
|
|
912
|
-
color: ${e=>e.$success?"var(--privy-color-success)":e.$fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
|
|
913
|
-
display: flex;
|
|
914
|
-
justify-content: flex-end;
|
|
915
|
-
width: 100%;
|
|
916
|
-
`,jc=tr.div`
|
|
917
|
-
font-size: 13px;
|
|
918
|
-
color: var(--privy-color-foreground);
|
|
919
|
-
display: flex;
|
|
920
|
-
gap: 8px;
|
|
921
|
-
align-items: center;
|
|
922
|
-
width: 100%;
|
|
923
|
-
margin-top: 16px;
|
|
924
|
-
// Equal opposing size buffer to account for auto margining when the
|
|
925
|
-
// success/fail text does not show up
|
|
926
|
-
padding-bottom: 32px;
|
|
927
|
-
`,zc=tr.div`
|
|
928
|
-
color: var(--privy-color-accent);
|
|
929
|
-
padding: 2px 0;
|
|
930
|
-
> button {
|
|
931
|
-
text-decoration: underline;
|
|
932
|
-
}
|
|
933
|
-
`,Gc=tr.div`
|
|
934
|
-
display: flex;
|
|
935
|
-
align-items: center;
|
|
936
|
-
justify-content: center;
|
|
937
|
-
border-radius: var(--privy-border-radius-sm);
|
|
938
|
-
padding: 2px 8px;
|
|
939
|
-
gap: 4px;
|
|
940
|
-
background: var(--privy-color-background-2);
|
|
941
|
-
color: var(--privy-color-foreground-2);
|
|
942
|
-
`,Hc=tr.span`
|
|
943
|
-
font-weight: 500;
|
|
944
|
-
word-break: break-all;
|
|
945
|
-
`;const Vc=({icon:n})=>t(r,{children:t(qc,{children:e("div",{children:[t(Us,{}),"string"==typeof n?t("span",{style:{background:`url('${n}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):n?t(n,{style:{width:"38px",height:"38px"}}):t("span",{})]})})});let qc=tr.div`
|
|
946
|
-
display: flex;
|
|
947
|
-
flex-direction: column;
|
|
948
|
-
justify-content: center;
|
|
949
|
-
align-items: center;
|
|
950
|
-
width: 100%;
|
|
951
|
-
height: 82px;
|
|
952
|
-
|
|
953
|
-
> div {
|
|
954
|
-
position: relative;
|
|
955
|
-
}
|
|
956
|
-
|
|
957
|
-
> div > span {
|
|
958
|
-
position: absolute;
|
|
959
|
-
left: -41px;
|
|
960
|
-
top: -41px;
|
|
961
|
-
}
|
|
962
|
-
|
|
963
|
-
> div > :last-child {
|
|
964
|
-
position: absolute;
|
|
965
|
-
left: -19px;
|
|
966
|
-
top: -19px;
|
|
967
|
-
}
|
|
968
|
-
`;let Zc=tr.div`
|
|
969
|
-
display: flex;
|
|
970
|
-
flex-direction: column;
|
|
971
|
-
align-items: center;
|
|
972
|
-
justify-content: center;
|
|
973
|
-
gap: 24px;
|
|
974
|
-
width: 100%;
|
|
975
|
-
`;const Kc=({icon:e,name:r})=>"string"==typeof e?t("img",{alt:`${r||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):e?t(e,{}):null;let Yc=nr`
|
|
976
|
-
from, to {
|
|
977
|
-
background: var(--privy-color-foreground-4);
|
|
978
|
-
color: var(--privy-color-foreground-4);
|
|
979
|
-
}
|
|
980
|
-
|
|
981
|
-
50% {
|
|
982
|
-
background: var(--privy-color-foreground-accent);
|
|
983
|
-
color: var(--privy-color-foreground-accent);
|
|
984
|
-
}
|
|
985
|
-
`;const Qc=rr`
|
|
986
|
-
${e=>e.$isLoading?rr`
|
|
987
|
-
width: 35%;
|
|
988
|
-
animation: ${Yc} 2s linear infinite;
|
|
989
|
-
border-radius: var(--privy-border-radius-sm);
|
|
990
|
-
`:""}
|
|
991
|
-
`,Jc=({children:e,color:r,isLoading:n,isPulsing:a,...i})=>t(Xc,{$color:r,$isLoading:n,$isPulsing:a,...i,children:e});let Xc=tr.span`
|
|
992
|
-
padding: 0.125rem 0.5rem;
|
|
993
|
-
font-size: 0.75rem;
|
|
994
|
-
font-weight: 500;
|
|
995
|
-
line-height: 1.125rem; /* 150% */
|
|
996
|
-
border-radius: var(--privy-border-radius-sm);
|
|
997
|
-
display: flex;
|
|
998
|
-
align-items: center;
|
|
999
|
-
${e=>{let t,r;"green"===e.$color&&(t="var(--privy-color-success-dark)",r="var(--privy-color-success-light)"),"red"===e.$color&&(t="var(--privy-color-error)",r="var(--privy-color-error-light)"),"gray"===e.$color&&(t="var(--privy-color-foreground-2)",r="var(--privy-color-background-2)");let n=nr`
|
|
1000
|
-
from, to {
|
|
1001
|
-
background-color: ${r};
|
|
1002
|
-
}
|
|
1003
|
-
|
|
1004
|
-
50% {
|
|
1005
|
-
background-color: rgba(${r}, 0.8);
|
|
1006
|
-
}
|
|
1007
|
-
`;return rr`
|
|
1008
|
-
color: ${t};
|
|
1009
|
-
background-color: ${r};
|
|
1010
|
-
${e.$isPulsing&&rr`
|
|
1011
|
-
animation: ${n} 3s linear infinite;
|
|
1012
|
-
`};
|
|
1013
|
-
`}}
|
|
1014
|
-
|
|
1015
|
-
${Qc}
|
|
1016
|
-
`;const eu={coinbase_wallet:{logo:jl,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:jl,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:ls,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:ss,displayName:"Phantom"},rainbow:{logo:({style:r,...n})=>e("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...r},...n,children:[t("g",{clipPath:"url(#clip0_5_32)",children:e("g",{clipPath:"url(#clip1_5_32)",children:[t("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:t("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),t("g",{mask:"url(#mask0_5_32)",children:t("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),t("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),t("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),t("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),t("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),t("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),t("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),t("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),t("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),t("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[t("stop",{stopColor:"#174299"}),t("stop",{offset:"1",stopColor:"#001E59"})]}),e("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[t("stop",{offset:"0.770277",stopColor:"#FF4000"}),t("stop",{offset:"1",stopColor:"#8754C9"})]}),e("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[t("stop",{stopColor:"#FF4000"}),t("stop",{offset:"1",stopColor:"#8754C9"})]}),e("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[t("stop",{stopColor:"#8754C9"}),t("stop",{offset:"1",stopColor:"#FF4000"})]}),e("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[t("stop",{offset:"0.723929",stopColor:"#FFF700"}),t("stop",{offset:"1",stopColor:"#FF9901"})]}),e("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[t("stop",{stopColor:"#FFF700"}),t("stop",{offset:"1",stopColor:"#FF9901"})]}),e("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[t("stop",{stopColor:"#FFF700"}),t("stop",{offset:"1",stopColor:"#FF9901"})]}),e("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[t("stop",{offset:"0.59513",stopColor:"#00AAFF"}),t("stop",{offset:"1",stopColor:"#01DA40"})]}),e("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[t("stop",{stopColor:"#00AAFF"}),t("stop",{offset:"1",stopColor:"#01DA40"})]}),e("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[t("stop",{stopColor:"#00AAFF"}),t("stop",{offset:"1",stopColor:"#01DA40"})]}),t("clipPath",{id:"clip0_5_32",children:t("rect",{width:"120",height:"120",fill:"white"})}),t("clipPath",{id:"clip1_5_32",children:t("rect",{width:"120",height:"120",fill:"white"})})]})]}),displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:ys,displayName:"WalletConnect"},zerion:{logo:({style:r,...n})=>e("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...r},...n,children:[e("g",{clipPath:"url(#clip0_1704_1423)",children:[t("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),t("defs",{children:t("clipPath",{id:"clip0_1704_1423",children:t("rect",{width:"176",height:"176",fill:"white"})})})]}),displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:({...r})=>e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...r,children:[t("defs",{children:e("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[t("stop",{offset:"0",stopColor:"#f1562b"}),t("stop",{offset:"0.3",stopColor:"#f1542b"}),t("stop",{offset:"0.41",stopColor:"#f04d2a"}),t("stop",{offset:"0.49",stopColor:"#ef4229"}),t("stop",{offset:"0.5",stopColor:"#ef4029"}),t("stop",{offset:"0.56",stopColor:"#e83e28"}),t("stop",{offset:"0.67",stopColor:"#e13c26"}),t("stop",{offset:"1",stopColor:"#df3c26"})]})}),t("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),t("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]}),displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:({style:r,...n})=>e("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...r},...n,children:[t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),t("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),e("g",{mask:"url(#mask0_16909_31415)",children:[t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L176.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[t("stop",{stopColor:"#002D72"}),t("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),e("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[t("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),t("stop",{offset:"1",stopColor:"#002D72"})]})]})]}),displayName:"Crypto.com Onchain",rdns:"com.crypto.wallet"},uniswap:{logo:({style:r,...n})=>e("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...r},...n,children:[t("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),e("g",{children:[t("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),t("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}),t("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),t("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),t("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),t("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),t("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C15.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]}),displayName:"Uniswap Wallet",rdns:"org.uniswap.app"},okx_wallet:{displayName:"OKX Wallet",rdns:"com.okex.wallet",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJDSURBVHgB7Zq9jtpAEMfHlhEgQLiioXEkoAGECwoKxMcTRHmC5E3IoyRPkPAEkI7unJYmTgEFTYwA8a3NTKScLnCHN6c9r1e3P2llWQy7M/s1Gv1twCP0ej37dDq9x+Zut1t3t9vZjDEHIiSRSPg4ZpDL5fxkMvn1cDh8m0wmfugfO53OoFQq/crn8wxfY9EymQyrVCqMfHvScZx1p9ls3pFxXBy/bKlUipGPrVbLuQqAfsCliq3zl0H84zwtjQrOw4Mt1W63P5LvBm2d+Xz+YzqdgkqUy+WgWCy+Mc/nc282m4FqLBYL+3g8fjDxenq72WxANZbLJeA13zDX67UDioL5ybXwafMYu64Ltn3bdDweQ5R97fd7GyhBQMipx4POeEDHIu2LfDdBIGGz+hJ9CQ1ABjoA2egAZPM6AgiCAEQhsi/C4jHyPA/6/f5NG3Ks2+3CYDC4aTccDrn6ojG54MnEvG00GoVmWLIRNZ7wTCwDHYBsdACy0QHIhiuRETxlICWpMMhGZHmqS8qH6JLyGegAZKMDkI0uKf8X4SWlaZo+Pp1bRrwlJU8ZKLIvUjKh0WiQ3sRUbNVq9c5Ebew7KEo2m/1p4jJ4qAmDaqDQBzj5XyiAT4VCQezJigAU+IDU+z8vJFnGWeC+bKQV/5VZ71FV6L7PA3gg3tXrdQ+DgLhC+75Wq3no69P3MC0NFQpx2lL04Ql9gHK1bRDjsSBIvScBnDTk1WrlGIZBorIDEYJj+rhdgnQ67VmWRe0zlplXl81vcyEt0rSoYDUAAAAASUVORK5CYII="},rabby_wallet:{logo:r=>e("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),t("path",{d:"M43.6781 28.2954C45.1053 25.0988 38.0498 16.168 31.3094 12.4472C27.0608 9.56481 22.6337 9.96081 21.737 11.2264C19.7693 14.0039 28.2527 16.3574 33.9263 19.1037C32.7067 19.6348 31.5574 20.5879 30.8816 21.8067C28.7664 19.4915 24.1239 17.4977 18.6765 19.1037C15.0056 20.186 11.9547 22.7374 10.7756 26.5911C10.4891 26.4635 10.1719 26.3925 9.83814 26.3925C8.56192 26.3925 7.52734 27.4298 7.52734 28.7094C7.52734 29.989 8.56192 31.0263 9.83814 31.0263C10.0747 31.0263 10.8143 30.8672 10.8143 30.8672L22.6337 30.953C17.9068 38.4713 14.1713 39.5704 14.1713 40.8729C14.1713 42.1754 17.7455 41.8224 19.0876 41.3369C25.5121 39.0127 32.4123 31.7692 33.5964 29.6841C38.5688 30.3061 42.7476 30.3796 43.6781 28.2954Z",fill:"url(#paint0_linear_81034_11443)"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.8741 19.076C33.8926 19.084 33.911 19.092 33.9294 19.1001C34.1923 18.9962 34.1498 18.6068 34.0776 18.301C33.9116 17.5981 31.0479 14.7629 28.3588 13.493C24.6934 11.762 21.9946 11.8518 21.5972 12.65C22.3407 14.1849 25.8031 15.6258 29.4193 17.1308C30.9407 17.7639 32.4893 18.4084 33.8741 19.076Z",fill:"url(#paint1_linear_81034_11443)"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.272 34.5374C28.5323 34.2543 27.697 33.9945 26.7477 33.7587C27.7625 31.9382 27.9754 29.2432 27.0171 27.5392C25.6721 25.1478 23.9838 23.875 20.0605 23.875C17.9027 23.875 12.093 24.6037 11.9899 29.4663C11.9791 29.9743 11.9895 30.44 12.026 30.8685L22.6335 30.9456C21.2017 33.2229 19.8609 34.9113 18.6873 36.1947C20.0979 36.5571 21.2615 36.8612 22.3297 37.1404C23.3394 37.4043 24.2638 37.646 25.2309 37.8934C26.6941 36.8249 28.0698 35.6597 29.272 34.5374Z",fill:"url(#paint2_linear_81034_11443)"}),t("path",{d:"M10.6324 30.3712C11.0658 34.065 13.1596 35.5127 17.4381 35.9411C21.7166 36.3695 24.1708 36.0821 27.4381 36.3801C30.167 36.6291 32.6036 38.0233 33.5075 37.5415C34.321 37.1079 33.8659 35.5412 32.7774 34.5361C31.3663 33.2333 29.4135 32.3274 25.9773 32.006C26.6621 30.1261 26.4702 27.4903 25.4067 26.0562C23.8689 23.9827 21.0305 23.0453 17.4381 23.4549C13.6848 23.8828 10.0885 25.7354 10.6324 30.3712Z",fill:"url(#paint3_linear_81034_11443)"}),e("defs",{children:[e("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[t("stop",{stopColor:"white"}),t("stop",{offset:"1",stopColor:"white"})]}),e("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[t("stop",{stopColor:"#8697FF"}),t("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),e("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[t("stop",{stopColor:"#8697FF"}),t("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),e("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[t("stop",{stopColor:"white"}),t("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]}),displayName:"Rabby Wallet",rdns:"io.rabby.wallet"},safe:{displayName:"Safe",logo:({style:r,...n})=>e("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...r},...n,children:[t("rect",{width:"28",height:"28",rx:"3",fill:"#12FF80"}),t("path",{d:"M22.5151 13.9979H20.4244C19.7981 13.9979 19.2945 14.5058 19.2945 15.128V18.163C19.2945 18.7894 18.7866 19.2931 18.1645 19.2931H9.8398C9.21344 19.2931 8.70981 19.8011 8.70981 20.4233V22.5185C8.70981 23.145 9.21767 23.6487 9.8398 23.6487H18.6427C19.2691 23.6487 19.7642 23.1407 19.7642 22.5185V20.8423C19.7642 20.2159 20.2721 19.7757 20.8942 19.7757H22.5151C23.1415 19.7757 23.6451 19.2677 23.6451 18.6455V15.1196C23.6451 14.4889 23.1373 13.9979 22.5151 13.9979Z",fill:"black"}),t("path",{d:"M8.7098 9.84127C8.7098 9.21481 9.21766 8.71111 9.83978 8.71111H18.156C18.7823 8.71111 19.286 8.20317 19.286 7.58095V5.48995C19.286 4.86349 18.7781 4.35979 18.156 4.35979H9.35732C8.73096 4.35979 8.22733 4.86772 8.22733 5.48995V7.10264C8.22733 7.7291 7.71947 8.2328 7.09734 8.2328H5.48912C4.86276 8.2328 4.35913 8.74074 4.35913 9.36296V12.8931C4.35913 13.5196 4.86699 13.9979 5.49335 13.9979H7.58404C8.2104 13.9979 8.71403 13.4899 8.71403 12.8677L8.7098 9.84127Z",fill:"black"}),t("path",{d:"M13.0139 11.8011H15.0242C15.6802 11.8011 16.2092 12.3344 16.2092 12.9862V14.9968C16.2092 15.6529 15.6759 16.182 15.0242 16.182H13.0139C12.3579 16.182 11.8289 15.6487 11.8289 14.9968V12.9862C11.8289 12.3302 12.3621 11.8011 13.0139 11.8011Z",fill:"black"})]})},universal_profile:{displayName:"Universal Profile",logo:({style:r,...n})=>e("svg",{fill:"none",height:"1024",width:"1024",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...r},...n,children:[e("filter",{id:"a","color-interpolation-filters":"sRGB",filterUnits:"userSpaceOnUse",height:"1228",width:"1244",x:"-72",y:"-72",children:[t("feFlood",{"flood-opacity":"0",result:"BackgroundImageFix"}),t("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",mode:"normal",result:"shape"}),t("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),t("feOffset",{dx:"-72",dy:"-72"}),t("feGaussianBlur",{stdDeviation:"54"}),t("feComposite",{in2:"hardAlpha",k2:"-1",k3:"1",operator:"arithmetic"}),t("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"}),t("feBlend",{in2:"shape",mode:"normal",result:"effect1_innerShadow_3981_20791"}),t("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),t("feOffset",{dx:"152",dy:"132"}),t("feGaussianBlur",{stdDeviation:"74"}),t("feComposite",{in2:"hardAlpha",k2:"-1",k3:"1",operator:"arithmetic"}),t("feColorMatrix",{type:"matrix",values:"0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0.15 0"}),t("feBlend",{in2:"effect1_innerShadow_3981_20791",mode:"normal",result:"effect2_innerShadow_3981_20791"}),t("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),t("feOffset",{dx:"32",dy:"20"}),t("feGaussianBlur",{stdDeviation:"50"}),t("feComposite",{in2:"hardAlpha",k2:"-1",k3:"1",operator:"arithmetic"}),t("feColorMatrix",{type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0"}),t("feBlend",{in2:"effect2_innerShadow_3981_20791",mode:"normal",result:"effect3_innerShadow_3981_20791"})]}),e("filter",{id:"b","color-interpolation-filters":"sRGB",filterUnits:"userSpaceOnUse",height:"352",width:"747",x:"142",y:"352",children:[t("feFlood",{"flood-opacity":"0",result:"BackgroundImageFix"}),t("feBlend",{in:"SourceGraphic",in2:"BackgroundImageFix",mode:"normal",result:"shape"}),t("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",type:"matrix",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),t("feOffset",{dx:"8",dy:"12"}),t("feGaussianBlur",{stdDeviation:"5"}),t("feComposite",{in2:"hardAlpha",k2:"-1",k3:"1",operator:"arithmetic"}),t("feColorMatrix",{type:"matrix",values:"0 0 0 0 0.120833 0 0 0 0 0.120833 0 0 0 0 0.120833 0 0 0 0.69 0"}),t("feBlend",{in2:"shape",mode:"normal",result:"effect1_innerShadow_3981_20791"})]}),e("linearGradient",{id:"c",gradientUnits:"userSpaceOnUse",x1:"0",x2:"1024",y1:"0",y2:"1024",children:[t("stop",{offset:"0",stopColor:"#8992d1"}),t("stop",{offset:"1",stopColor:"#646c9f"})]}),t("clipPath",{id:"d",children:t("path",{d:"m0 0h1024v1024h-1024z"})}),e("g",{"clip-path":"url(#d)",children:[t("g",{filter:"url(#a)",children:t("rect",{fill:"url(#c)",height:"1024",rx:"230",width:"1024"})}),e("g",{fill:"#fff",filter:"url(#b)",children:[t("path",{d:"m212.459 354h-54.459c-8.837 0-16 7.163-16 16v203c0 66.826 54.174 121 121 121h44c66.826 0 121-54.174 121-121v-203c0-8.837-7.163-16-16-16h-56.548c-8.837 0-16 7.163-16 16v198.829c0 28.607-23.19 51.797-51.797 51.797-32.693 0-59.196-26.503-59.196-59.196v-191.43c0-8.837-7.163-16-16-16z"}),t("path",{d:"m868.426 352h-68.495c-6.98 0-12.487 5.934-11.967 12.895l14.206 190c.468 6.263 5.686 11.105 11.966 11.105h45.412c6.409 0 11.687-5.037 11.987-11.44l8.878-190c.32-6.84-5.14-12.56-11.987-12.56z"}),t("ellipse",{cx:"834",cy:"649.5",rx:"47",ry:"44.5"}),t("path",{clipRule:"evenodd",d:"m522 687h50c8.837 0 16-7.163 16-16v-80c0-8.837 7.163-16 16-16h33.5c61.58 0 111.5-49.92 111.5-111.5s-49.92-111.5-111.5-111.5h-115.5c-8.837 0-16 7.163-16 16v303c0 8.837 7.163 16 16 16zm70-252v58c0 6.627 5.373 12 12 12h14c20.987 0 38-17.013 38-38v-6c0-20.987-17.013-38-38-38h-14c-6.627 0-12 5.373-12 12z",fillRule:"evenodd"})]})]})]})},bybit_wallet:{displayName:"Bybit Wallet",logo:({style:r,...n})=>e("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...r},...n,children:[t("path",{d:"M0 10.2C0 4.56669 4.5667 0 10.2 0H37.8C43.4333 0 48 4.5667 48 10.2V37.8C48 43.4333 43.4333 48 37.8 48H10.2C4.56669 48 0 43.4333 0 37.8V10.2Z",fill:"#604E93"}),t("path",{d:"M4.13353 14.6218C3.70207 13.1338 4.62517 11.5926 6.14065 11.2707L31.424 5.90036C32.6242 5.64544 33.8434 6.24236 34.3782 7.34668L45.7343 30.7995L13.7343 47.7328L4.13353 14.6218Z",fill:"url(#paint0_linear_362_37285)"}),t("path",{d:"M4.46332 16.4519C4.00953 14.8821 5.06159 13.277 6.68213 13.0669L40.1928 8.72077C41.5851 8.5402 42.879 9.47008 43.1517 10.8473L48.0004 35.333L13.467 47.5999L4.46332 16.4519Z",fill:"white"}),t("path",{d:"M0 18.6666C0 15.7211 2.38781 13.3333 5.33333 13.3333H37.3333C43.2244 13.3333 48 18.1089 48 24V37.3333C48 43.2243 43.2244 48 37.3333 48H10.6667C4.77563 48 0 43.2243 0 37.3333V18.6666Z",fill:"black"}),t("path",{d:"M31.7559 33.3796V23.3867H33.7051V33.3796H31.7559Z",fill:"#F7A600"}),t("path",{d:"M9.51303 36.362H5.33398V26.3691H9.3449C11.2941 26.3691 12.4301 27.4639 12.4301 29.176C12.4301 30.2844 11.7008 31.0006 11.1964 31.2393C11.7996 31.5201 12.5709 32.1511 12.5709 33.4846C12.5709 35.3513 11.2941 36.362 9.51303 36.362ZM9.19043 28.1096H7.28322V30.4117H9.19043C10.0174 30.4117 10.4808 29.9489 10.4808 29.2612C10.4808 28.5723 10.0185 28.1096 9.19043 28.1096ZM9.31653 32.1658H7.28322V34.6215H9.31653C10.2003 34.6215 10.6206 34.0599 10.6206 33.3868C10.6216 32.7127 10.2003 32.1658 9.31653 32.1658Z",fill:"white"}),t("path",{d:"M17.9425 32.2637V36.362H16.007V32.2637L13.0059 26.3691H15.1232L16.9884 30.3969L18.8252 26.3691H20.9426L17.9425 32.2637Z",fill:"white"}),t("path",{d:"M26.4896 36.362H22.3105V26.3691H26.3215C28.2707 26.3691 29.4066 27.4639 29.4066 29.176C29.4066 30.2844 28.6774 31.0006 28.173 31.2393C28.7761 31.5201 29.5474 32.1511 29.5474 33.4846C29.5464 35.3513 28.2696 36.362 26.4896 36.362ZM26.167 28.1096H24.2598V30.4117H26.167C26.994 30.4117 27.4574 29.9489 27.4574 29.2612C27.4563 28.5723 26.994 28.1096 26.167 28.1096ZM26.2931 32.1658H24.2598V34.6215H26.2931C27.1768 34.6215 27.5971 34.0599 27.5971 33.3868C27.5971 32.7127 27.1758 32.1658 26.2931 32.1658Z",fill:"white"}),t("path",{d:"M40.0573 28.1096V36.362H38.1081V28.1096H35.5V26.3691H42.6665V28.1096H40.0573Z",fill:"white"}),t("defs",{children:e("linearGradient",{id:"paint0_linear_362_37285",x1:"4.00094",y1:"13.9604",x2:"46.1673",y2:"11.8482",gradientUnits:"userSpaceOnUse",children:[t("stop",{"stop-color":"#FFD748"}),t("stop",{offset:"1","stop-color":"#F7A600"})]})})]})}},tu=(e,t,r)=>eu[e]?.displayName?"coinbase_wallet"===e?eu[r].displayName:eu[e].displayName:"wallet_connect_v2"===t&&"wallet_connect"===e?"Wallet Connect":void 0,ru=(e,t,r)=>eu[e]?.logo?"coinbase_wallet"===e?eu[r].logo:eu[e].logo:"wallet_connect_v2"===t&&"wallet_connect"===e?ys:void 0;function nu(e){let t=e.toLowerCase();return!!window?.webkit?.messageHandlers?.ReactNativeWebView||!!window?.ReactNativeWebView||["fbav","fban","instagram","snapchat","linkedinapp"].some((e=>t.includes(e)))}let au=h({});const iu=({children:e})=>{let r=Ue(),[n,a]=d({});return zt("login",{onComplete:(e,t,n,i,o)=>{o&&"passkey"!==o.type&&"cross_app"!==o.type&&("wallet"!==o.type||"privy"!==o.walletClientType)&&(qo.put(ou(r.id),o.type),"wallet"===o.type?(qo.put(lu(r.id),o.walletClientType),qo.put(su(r.id),o.chainType),a({accountType:o.type,walletClientType:o.walletClientType,chainType:o.chainType})):(qo.del(lu(r.id)),qo.del(su(r.id)),a({accountType:o.type})))}}),p((()=>{if(!r.id)return;let e=qo.get(ou(r.id)),t=qo.get(lu(r.id)),n=qo.get(su(r.id));e&&a("wallet"===e?{accountType:e,walletClientType:t,chainType:n}:{accountType:e})}),[r.id]),t(au.Provider,{value:n,children:e})};let ou=e=>`privy:${e}:recent-login-method`,lu=e=>`privy:${e}:recent-login-wallet-client`,su=e=>`privy:${e}:recent-login-chain-type`;const du=()=>u(au),cu=({provider:r,displayName:n,logo:a,connectOnly:i,connector:o})=>{let{navigate:l}=ye(),{connectWallet:s}=P(),d=du(),c="wallet_connect_v2"===o.connectorType?r:o.walletClientType,u=window.matchMedia("(display-mode: standalone)").matches;return e(uu,{onClick:"phantom"===o.connectorType||"solana_adapter"===o.connectorType&&"phantom"===o.walletClientType?()=>{Ee()||"solana"===o.chainType&&"isInstalled"in o&&o.isInstalled?(s(o,c),l(i?We.AWAITING_CONNECT_ONLY_CONNECTION:We.AWAITING_CONNECTION)):l(w?We.PHANTOM_INTERSTITIAL_SCREEN:We.INSTALL_PHANTOM_SCREEN)}:"coinbase_wallet"!==o.connectorType||"eoaOnly"!==o.connectionOptions||!w||u||ze()?()=>{(!nu(window.navigator.userAgent)||event?.isTrusted)&&(s(o,c),l(i?We.AWAITING_CONNECT_ONLY_CONNECTION:We.AWAITING_CONNECTION))}:()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`},children:[t(Kc,{icon:ru(r,o.connectorType,o.walletClientType)??a,name:o.walletClientType}),t("span",{children:tu(r,o.connectorType,o.walletClientType)||n||o.walletClientType}),e(pu,{id:"chip-container",children:[d?.walletClientType===c&&d?.chainType===o.chainType?t(hu,{color:"gray",children:"Recent"}):t("span",{id:"connect-text",children:"Connect"}),"solana_adapter"===o.connectorType&&t(hu,{color:"gray",children:"Solana"})]})]})};let uu=tr(Cd)`
|
|
1017
|
-
/* Show "Connect" on hover */
|
|
1018
|
-
> #chip-container > #connect-text {
|
|
1019
|
-
font-weight: 500;
|
|
1020
|
-
color: var(--privy-color-accent);
|
|
1021
|
-
opacity: 0;
|
|
1022
|
-
transition: opacity 0.1s ease-out;
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
:hover > #chip-container > #connect-text {
|
|
1026
|
-
opacity: 1;
|
|
1027
|
-
}
|
|
1028
|
-
|
|
1029
|
-
@media (max-width: 440px) {
|
|
1030
|
-
> #chip-container > #connect-text {
|
|
1031
|
-
display: none;
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
`,hu=tr(Jc)`
|
|
1035
|
-
margin-left: auto;
|
|
1036
|
-
`,pu=tr.div`
|
|
1037
|
-
display: flex;
|
|
1038
|
-
flex-wrap: wrap;
|
|
1039
|
-
gap: 8px;
|
|
1040
|
-
margin-left: auto;
|
|
1041
|
-
`;const mu=["coinbase_wallet"];let fu=["metamask","okx_wallet","rainbow","uniswap","bybit_wallet","uniswap_extension","zerion","rabby_wallet","cryptocom"];const gu=["safe"],yu=["phantom","universal_profile"],wu=({connectOnly:e})=>{let{connectors:n}=P(),{app:a,data:i}=ye();return t(r,{children:vu({walletList:i?.externalConnectWallet?.walletList??a.appearance.walletList,walletChainType:a.appearance.walletChainType,connectors:n,connectOnly:e,ignore:a.appearance.walletList,walletConnectEnabled:a.externalWallets.walletConnect.enabled})})},vu=({walletList:e,walletChainType:r,connectors:n,connectOnly:a,ignore:i,recentlyUsedWallet:o,walletConnectEnabled:l,forceWallet:s})=>{let d=[],c=[],u=[],h=n.filter((e=>"ethereum-only"===r?"ethereum"===e.chainType:"solana-only"!==r||"solana"===e.chainType)),p=h.find((e=>"wallet_connect_v2"===e.connectorType));for(let[n,o]of(s?[s.wallet]:e).entries()){if("detected_ethereum_wallets"===o||"detected_wallets"===o)for(let[e,r]of h.filter((({chainType:e,connectorType:t,walletClientType:r})=>"solana"!==e&&("uniswap_wallet_extension"===r||"uniswap_extension"===r?!i.includes("uniswap"):"crypto.com_wallet_extension"===r||"crypto.com_onchain"===r?!i.includes("cryptocom"):"injected"===t&&!i.includes(r)))).entries()){let{walletClientType:i,walletBranding:l,chainType:s}=r;("unknown"===i?c:d).push(t(cu,{connectOnly:a,provider:i,logo:l.icon,displayName:l.name,connector:r},`${n}-${o}-${i}-${s}-${e}`))}if("detected_solana_wallets"===o||"detected_wallets"===o)for(let[e,l]of h.filter((({chainType:e,walletClientType:t})=>{if("solana"===e)return"ethereum-only"!==r&&!i.includes(t)})).entries()){let{walletClientType:r,walletBranding:i,chainType:s}=l;("unknown"===r?c:d).push(t(cu,{connectOnly:a,provider:r,logo:i.icon,displayName:i.name,connector:l},`${n}-${o}-${r}-${s}-${e}`))}if(yu.includes(o)){let e=h.find((e=>"injected"===e.connectorType&&e.walletClientType===o||e.connectorType===o));if(e&&d.push(t(cu,{connectOnly:a,provider:o,connector:e},`${n}-${o}`)),"solana-only"===r||"ethereum-and-solana"===r){let e=h.find((({chainType:e,connectorType:t,walletClientType:r})=>"solana"===e&&"solana_adapter"===t&&r===o));e&&d.push(t(cu,{connectOnly:a,provider:o,connector:e},`${o}-solana`))}}else if(fu.includes(o)){let e=h.find((e=>"uniswap"===o?"uniswap_wallet_extension"===e.walletClientType||"uniswap_extension"===e.walletClientType:"cryptocom"===o?"crypto.com_wallet_extension"===e.walletClientType||"crypto.com_onchain"===e.walletClientType:"injected"===e.connectorType&&e.walletClientType===o));l&&!e&&(e=p),e&&d.push(t(cu,{connectOnly:a,provider:o,connector:e,logo:"injected"===e.connectorType?e.walletBranding.icon:void 0,displayName:"injected"===e.connectorType?e.walletBranding.name:void 0},`${n}-${o}`))}else if(mu.includes(o)){let e=h.find((({connectorType:e})=>e===o));e&&d.push(t(cu,{connectOnly:a,provider:o,connector:e},`${n}-${o}`))}else if(gu.includes(o))p&&u.push(t(cu,{connectOnly:a,provider:o,connector:p},`${n}-${o}`));else if("wallet_connect"===o)p&&u.push(t(cu,{connectOnly:a,provider:o,connector:p},`${n}-${o}`));else if(o===s?.wallet){let r="ethereum"===s.chainType&&e.includes("detected_ethereum_wallets"),i="solana"===s.chainType&&e.includes("detected_solana_wallets");if(e.includes("detected_wallets")||r||i){let e=h.find((({walletClientType:e})=>e===o));e&&d.push(t(cu,{connectOnly:a,provider:o,displayName:e.walletBranding?.name,logo:e.walletBranding?.icon,connector:e},`${n}-${o}`))}}}return 0===d.length&&0===c.length&&("solana-only"===r||"ethereum-and-solana"===r)&&"phantom"!==o&&d.push(t(cu,{connectOnly:a,provider:"phantom",connector:{connectorType:"solana_adapter",walletClientType:"phantom"}},"phantom-solana")),[...c,...d,...u]};const Cu=e=>e?.privyErrorCode===T.LINKED_TO_ANOTHER_USER?Gt.ERROR_USER_EXISTS:e instanceof Ht&&!e.details.default?e.details:e instanceof Ut?Gt.ERROR_TIMED_OUT:e instanceof Bt?Gt.ERROR_USER_REJECTED_CONNECTION:e?.privyErrorCode===T.CANNOT_LINK_MORE_OF_TYPE?Gt.ERROR_USER_LIMIT_REACHED:Gt.ERROR_WALLET_CONNECTION;let bu=tr.div`
|
|
1042
|
-
display: flex;
|
|
1043
|
-
flex-direction: column;
|
|
1044
|
-
align-items: center;
|
|
1045
|
-
justify-content: center;
|
|
1046
|
-
gap: 24px;
|
|
1047
|
-
width: 100%;
|
|
1048
|
-
`,Eu=tr.div`
|
|
1049
|
-
display: flex;
|
|
1050
|
-
flex-direction: column;
|
|
1051
|
-
justify-content: center;
|
|
1052
|
-
align-items: center;
|
|
1053
|
-
width: 100%;
|
|
1054
|
-
height: 82px;
|
|
1055
|
-
|
|
1056
|
-
> div {
|
|
1057
|
-
position: relative;
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
> div > span {
|
|
1061
|
-
position: absolute;
|
|
1062
|
-
left: -41px;
|
|
1063
|
-
top: -41px;
|
|
1064
|
-
}
|
|
1065
|
-
|
|
1066
|
-
> div > :last-child {
|
|
1067
|
-
position: absolute;
|
|
1068
|
-
left: -19px;
|
|
1069
|
-
top: -19px;
|
|
1070
|
-
}
|
|
1071
|
-
`;const $u=n=>{let a=n.walletLogo;return t(r,{children:t(Eu,{children:e("div",{children:[t(Us,{success:n.success,fail:n.fail}),"string"==typeof a?t("span",{style:{background:`url('${a}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):t(a,{style:{width:"38px",height:"38px"}})]})})})};let Tu=tr.div`
|
|
1072
|
-
display: flex;
|
|
1073
|
-
flex-direction: column;
|
|
1074
|
-
align-items: center;
|
|
1075
|
-
justify-content: center;
|
|
1076
|
-
gap: 24px;
|
|
1077
|
-
width: 100%;
|
|
1078
|
-
`;const Au=({name:e,logoUrl:r,size:n="38px"})=>"string"==typeof r?t("img",{src:r,alt:`${e??"Provider app"} logo`,style:{width:n,height:n,maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):t("span",{});function xu(e){let{logout:t}=u(D);return zt("logout",e),{logout:t}}let _u=tr.div`
|
|
1079
|
-
display: flex;
|
|
1080
|
-
flex-direction: column;
|
|
1081
|
-
align-items: center;
|
|
1082
|
-
justify-content: center;
|
|
1083
|
-
margin-left: 27px;
|
|
1084
|
-
margin-right: 27px;
|
|
1085
|
-
gap: 24px;
|
|
1086
|
-
`;const ku=tr.div`
|
|
1087
|
-
display: flex;
|
|
1088
|
-
flex-direction: column;
|
|
1089
|
-
`,Nu=tr.span`
|
|
1090
|
-
text-align: left;
|
|
1091
|
-
font-size: 0.75rem;
|
|
1092
|
-
font-weight: 500;
|
|
1093
|
-
line-height: 1.125rem; /* 150% */
|
|
1094
|
-
|
|
1095
|
-
color: var(--privy-color-error);
|
|
1096
|
-
`,Su=tr.span`
|
|
1097
|
-
color: var(--privy-color-foreground-3);
|
|
1098
|
-
font-size: 0.75rem;
|
|
1099
|
-
font-weight: 500;
|
|
1100
|
-
line-height: 1.125rem; /* 150% */
|
|
1101
|
-
`,Iu=rr`
|
|
1102
|
-
&& {
|
|
1103
|
-
border-width: 1px;
|
|
1104
|
-
padding: 0.5rem 1rem;
|
|
1105
|
-
}
|
|
1106
|
-
|
|
1107
|
-
width: 100%;
|
|
1108
|
-
text-align: left;
|
|
1109
|
-
border: solid 1px var(--privy-color-foreground-4);
|
|
1110
|
-
border-radius: var(--privy-border-radius-md);
|
|
1111
|
-
display: flex;
|
|
1112
|
-
justify-content: space-between;
|
|
1113
|
-
align-items: center;
|
|
1114
|
-
|
|
1115
|
-
${e=>"error"===e.$state?"border-color: var(--privy-color-error);":""}
|
|
1116
|
-
`,Ou=tr.div`
|
|
1117
|
-
${Iu}
|
|
1118
|
-
`,Pu=({errMsg:n,balance:a,address:i,isLoading:o,className:l,title:s,isPulsing:d,showIcon:c,statusColor:u="green"})=>{let h;return h=u||(n?"red":"green"),e(r,{children:[e(Ou,{className:l,$state:n?"error":void 0,children:[e(ku,{children:[t(Su,{children:s||"Pay with"}),t(Id,{address:i,showCopyIcon:c||!!n})]}),void 0!==a&&t(Jc,{isLoading:o,isPulsing:d,color:h,children:a})]}),n&&t(Nu,{style:{marginTop:"0.25rem"},children:n})]})};function Mu({...e}){return t("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:t("path",{d:"M12 7C13.1046 7 14 6.10457 14 5C14 3.89543 13.1046 3 12 3C10.8954 3 10 3.89543 10 5C10 6.10457 10.8954 7 12 7ZM12 7V11M5 11H19C20.1046 11 21 11.8954 21 13V19C21 20.1046 20.1046 21 19 21H5C3.89543 21 3 20.1046 3 19V13C3 11.8954 3.89543 11 5 11Z",stroke:"#110F2A",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}let Ru=tr.div`
|
|
1119
|
-
display: flex;
|
|
1120
|
-
gap: 10px;
|
|
1121
|
-
`,Lu=tr(Pu)`
|
|
1122
|
-
margin-top: 1.5rem;
|
|
1123
|
-
`;let Du=tr.div`
|
|
1124
|
-
display: flex;
|
|
1125
|
-
gap: 10px;
|
|
1126
|
-
`;const Fu=()=>t(Uu,{children:e(Wu,{children:[t(Bu,{}),t(ju,{})]})});let Uu=tr.div`
|
|
1127
|
-
display: flex;
|
|
1128
|
-
justify-content: center;
|
|
1129
|
-
align-items: center;
|
|
1130
|
-
flex-grow: 1;
|
|
1131
|
-
|
|
1132
|
-
margin: 12px;
|
|
1133
|
-
padding: 16px;
|
|
1134
|
-
|
|
1135
|
-
@media all and (display-mode: standalone) {
|
|
1136
|
-
margin-bottom: 30px;
|
|
1137
|
-
}
|
|
1138
|
-
`,Wu=tr.div`
|
|
1139
|
-
position: relative;
|
|
1140
|
-
height: 140px;
|
|
1141
|
-
width: 140px;
|
|
1142
|
-
|
|
1143
|
-
opacity: 1;
|
|
1144
|
-
animation: fadein 200ms ease;
|
|
1145
|
-
`,Bu=tr.div`
|
|
1146
|
-
position: absolute;
|
|
1147
|
-
top: 0;
|
|
1148
|
-
right: 0;
|
|
1149
|
-
bottom: 0;
|
|
1150
|
-
left: 0;
|
|
1151
|
-
width: 140px;
|
|
1152
|
-
height: 140px;
|
|
1153
|
-
|
|
1154
|
-
&& {
|
|
1155
|
-
border: 4px solid var(--privy-color-accent-light);
|
|
1156
|
-
border-radius: 50%;
|
|
1157
|
-
}
|
|
1158
|
-
`,ju=tr.div`
|
|
1159
|
-
position: absolute;
|
|
1160
|
-
top: 0;
|
|
1161
|
-
right: 0;
|
|
1162
|
-
bottom: 0;
|
|
1163
|
-
left: 0;
|
|
1164
|
-
width: 140px;
|
|
1165
|
-
height: 140px;
|
|
1166
|
-
animation: spin 1200ms linear infinite;
|
|
1167
|
-
|
|
1168
|
-
&& {
|
|
1169
|
-
border: 4px solid;
|
|
1170
|
-
border-color: var(--privy-color-accent) transparent transparent transparent;
|
|
1171
|
-
border-radius: 50%;
|
|
1172
|
-
}
|
|
1173
|
-
|
|
1174
|
-
@keyframes spin {
|
|
1175
|
-
from {
|
|
1176
|
-
transform: rotate(0deg);
|
|
1177
|
-
}
|
|
1178
|
-
to {
|
|
1179
|
-
transform: rotate(360deg);
|
|
1180
|
-
}
|
|
1181
|
-
}
|
|
1182
|
-
`;const zu=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","missing_or_invalid_mfa","mfa_verification_max_attempts_reached","mfa_timeout","twilio_verification_failed"];class Gu extends Error{constructor(e,t){super(t),this.type=e}}function Hu(e){let t=e.type;return"string"==typeof t&&zu.includes(t)}function Vu(e){return Hu(e)&&"wallet_not_on_device"===e.type}function qu(e){return!!Hu(e)&&"mfa_timeout"===e.type}function Zu(e){return!!Hu(e)&&"missing_or_invalid_mfa"===e.type}function Ku(e){return!!Hu(e)&&"mfa_verification_max_attempts_reached"===e.type}function Yu(e){return!(!Hu(e)||!e.message.includes("code 429"))}function Qu(e){return!!function(e){let t=e.type;return"string"==typeof t&&"client_error"===t}(e)&&"MFA canceled"===e.message}function Ju({isCreatingWallet:e,skipSplashScreen:t}){return e?We.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN:t?We.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN:We.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN}function Xu({walletAction:e,availableRecoveryMethods:t,legacySetWalletPasswordFlow:r,isResettingPassword:n,showAutomaticRecovery:a}){return a?We.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN:r||1===t.length?Ju({isCreatingWallet:"create"===e,skipSplashScreen:n}):We.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN}function eh(e){switch(e){case"user-passcode":return We.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN;case"google-drive":case"icloud":return We.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN;default:throw Error("Recovery method not supported")}}async function th({api:e,provider:t}){let r=Ko(),n=Yo(),a=await Qo(r);try{return"icloud"===t?{url:(await e.post("/api/v1/recovery/oauth/init_icloud",{client_type:"web"})).url}:{url:(await e.post("/api/v1/recovery/oauth/init",{redirect_to:window.location.href,code_challenge:a,state_code:n})).url,codeVerifier:r,stateCode:n,provider:t}}catch(e){throw $(e)}}async function rh({api:e,provider:t,stateCode:r,codeVerifier:n,authorizationCode:a}){if(!a||!r)throw new E("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if("undefined"===a)throw new E("User denied confirmation during OAuth flow");try{return(await e.post("/api/v1/recovery/oauth/authenticate",{authorization_code:a,state_code:r,code_verifier:n,provider:t})).access_token}catch(e){let t=$(e);if(t.privyErrorCode)throw new E(t.message||"Invalid code during OAuth flow.",void 0,t.privyErrorCode);if("User denied confirmation during OAuth flow"===t.message)throw new E("Invalid code during oauth flow.",void 0,T.OAUTH_USER_DENIED);throw new E("Invalid code during OAuth flow.",void 0,T.UNKNOWN_AUTH_ERROR)}}let nh=tr.div`
|
|
1183
|
-
height: 44px;
|
|
1184
|
-
`;const ah=({children:r,theme:n})=>e(ih,{$theme:n,children:[t(dr,{width:"1.25rem",color:"dark"===n?"#FDE68A":"var(--privy-color-warn)"}),r]});let ih=tr.div`
|
|
1185
|
-
display: flex;
|
|
1186
|
-
gap: 0.5rem;
|
|
1187
|
-
background-color: ${e=>"dark"===e.$theme?"var(--privy-color-background-2)":"var(--privy-color-warn-light)"};
|
|
1188
|
-
|
|
1189
|
-
${e=>"dark"===e.$theme?"color: #FDE68A;":""}
|
|
1190
|
-
|
|
1191
|
-
align-items: flex-start;
|
|
1192
|
-
text-align: left;
|
|
1193
|
-
padding: 0.5rem 0.75rem;
|
|
1194
|
-
|
|
1195
|
-
font-size: 0.8125rem;
|
|
1196
|
-
font-weight: 400;
|
|
1197
|
-
line-height: 1.125rem; /* 150% */
|
|
1198
|
-
|
|
1199
|
-
padding: 0.75rem;
|
|
1200
|
-
|
|
1201
|
-
&& {
|
|
1202
|
-
border-radius: var(--privy-border-radius-sm);
|
|
1203
|
-
}
|
|
1204
|
-
`;const oh=tr.span`
|
|
1205
|
-
margin-top: 4px;
|
|
1206
|
-
color: var(--privy-color-foreground);
|
|
1207
|
-
text-align: center;
|
|
1208
|
-
|
|
1209
|
-
font-size: 0.875rem;
|
|
1210
|
-
font-weight: 400;
|
|
1211
|
-
line-height: 1.375rem; /* 157.143% */
|
|
1212
|
-
|
|
1213
|
-
&& a {
|
|
1214
|
-
color: var(--privy-color-accent);
|
|
1215
|
-
}
|
|
1216
|
-
`,lh=tr.span`
|
|
1217
|
-
color: var(--privy-color-foreground);
|
|
1218
|
-
font-size: 1.125rem;
|
|
1219
|
-
font-weight: 600;
|
|
1220
|
-
line-height: 1.875rem; /* 166.667% */
|
|
1221
|
-
text-align: center;
|
|
1222
|
-
`;function sh(r){let[n,a]=d(r.dimensions.width),[i,o]=d(void 0),l=s(null);p((()=>{if(l.current&&void 0===n){let{width:e}=l.current.getBoundingClientRect();a(e)}let e=getComputedStyle(document.documentElement);o({background:e.getPropertyValue("--privy-color-background"),background2:e.getPropertyValue("--privy-color-background-2"),foreground3:e.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:e.getPropertyValue("--privy-color-foreground-accent"),accent:e.getPropertyValue("--privy-color-accent"),accentDark:e.getPropertyValue("--privy-color-accent-dark"),success:e.getPropertyValue("--privy-color-success")})}),[]);let c="ethereum"===r.walletToExport.chainType&&!r.walletToExport.imported;return t("div",{ref:l,children:n&&e(ch,{children:[t("iframe",{style:{position:"absolute",zIndex:1},width:n,height:r.dimensions.height,allow:"clipboard-write self *",src:Ve(r.origin,`/apps/${r.appId}/embedded-wallets/export`,{client_id:r.appClientId,primaryAddress:r.primaryWallet.address,address:r.walletToExport.address,walletIndex:r.walletToExport.walletIndex,width:`${n}px`,caid:r.clientAnalyticsId,phrase_export:c,...i},{token:r.accessToken})}),t(uh,{children:"Loading..."}),c&&t(uh,{children:"Loading..."})]})})}let dh=tr.div`
|
|
1223
|
-
display: flex;
|
|
1224
|
-
flex-direction: column;
|
|
1225
|
-
gap: 1.25rem;
|
|
1226
|
-
text-align: left;
|
|
1227
|
-
`,ch=tr.div`
|
|
1228
|
-
overflow: visible;
|
|
1229
|
-
position: relative;
|
|
1230
|
-
overflow: none;
|
|
1231
|
-
height: 44px;
|
|
1232
|
-
display: flex;
|
|
1233
|
-
gap: 12px;
|
|
1234
|
-
`,uh=tr.div`
|
|
1235
|
-
display: flex;
|
|
1236
|
-
align-items: center;
|
|
1237
|
-
justify-content: center;
|
|
1238
|
-
width: 100%;
|
|
1239
|
-
height: 100%;
|
|
1240
|
-
font-size: 16px;
|
|
1241
|
-
font-weight: 500;
|
|
1242
|
-
border-radius: var(--privy-border-radius-md);
|
|
1243
|
-
background-color: var(--privy-color-background-2);
|
|
1244
|
-
color: var(--privy-color-foreground-3);
|
|
1245
|
-
`;function hh(){let{getAccessToken:e}=M(),{refreshUser:t,createAnalyticsEvent:r,initializeWalletProxy:n}=P(),a=s(!1);return{createWallet:m((async({user:i,recoveryPassword:o})=>{let l=await e();if(!l)throw r({eventName:"embedded_wallet_creation_failed",payload:{error:"Missing access token for user."}}),Error("An error has occured, please login again.");try{r({eventName:"embedded_wallet_creation_started"});let e=await n(qe);if(!e)throw Error("walletProxy does not exist.");let s=new Promise(((e,t)=>{setTimeout((()=>{t(Error("walletProxy.create timed out."))}),2e4)})),d=W(i);if(!await Promise.race([e.create({accessToken:l,recoveryPassword:o,recoveryMethod:o?"user-passcode":void 0,solanaAddress:d?.address}),s]))throw Error("walletProxy.create did not send a response.");let c=await t();if(!c)throw Error("Failed to refresh user.");let u=U(c);if(!u)throw Error("Updated user is missing embedded wallet.");return r({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:u.address}}),a.current=!0,u}catch(i){if(a.current)return;throw r({eventName:"embedded_wallet_creation_failed",payload:{error:i.toString()}}),console.warn(i),i}}),[])}}let ph=tr.div`
|
|
1246
|
-
height: 44px;
|
|
1247
|
-
`,mh=rr`
|
|
1248
|
-
font-size: 14px;
|
|
1249
|
-
font-style: normal;
|
|
1250
|
-
font-weight: 400;
|
|
1251
|
-
line-height: 20px;
|
|
1252
|
-
letter-spacing: -0.008px;
|
|
1253
|
-
text-align: left;
|
|
1254
|
-
transition: color 0.1s ease-in;
|
|
1255
|
-
`;const fh=tr.span`
|
|
1256
|
-
${mh}
|
|
1257
|
-
transition: color 0.1s ease-in;
|
|
1258
|
-
color: ${({error:e})=>e?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
|
|
1259
|
-
text-transform: ${({error:e})=>e?"":"capitalize"};
|
|
1260
|
-
|
|
1261
|
-
&[aria-hidden='true'] {
|
|
1262
|
-
visibility: hidden;
|
|
1263
|
-
}
|
|
1264
|
-
`,gh=tr.div`
|
|
1265
|
-
display: flex;
|
|
1266
|
-
flex-direction: column;
|
|
1267
|
-
justify-content: center;
|
|
1268
|
-
flex-grow: 1;
|
|
1269
|
-
`,yh=tr(Hs)`
|
|
1270
|
-
${e=>e.hideAnimations&&rr`
|
|
1271
|
-
&& {
|
|
1272
|
-
transition: none;
|
|
1273
|
-
}
|
|
1274
|
-
`}
|
|
1275
|
-
`;let wh=rr`
|
|
1276
|
-
&& {
|
|
1277
|
-
width: 100%;
|
|
1278
|
-
border-width: 1px;
|
|
1279
|
-
border-radius: var(--privy-border-radius-md);
|
|
1280
|
-
border-color: var(--privy-color-foreground-3);
|
|
1281
|
-
background: var(--privy-color-background);
|
|
1282
|
-
color: var(--privy-color-foreground);
|
|
1283
|
-
|
|
1284
|
-
padding: 12px;
|
|
1285
|
-
font-size: 16px;
|
|
1286
|
-
font-style: normal;
|
|
1287
|
-
font-weight: 300;
|
|
1288
|
-
line-height: 22px; /* 137.5% */
|
|
1289
|
-
}
|
|
1290
|
-
`;const vh=tr.input`
|
|
1291
|
-
${wh}
|
|
1292
|
-
|
|
1293
|
-
&::placeholder {
|
|
1294
|
-
color: var(--privy-color-foreground-3);
|
|
1295
|
-
font-style: italic;
|
|
1296
|
-
font-size: 14px;
|
|
1297
|
-
}
|
|
1298
|
-
|
|
1299
|
-
overflow: hidden;
|
|
1300
|
-
text-overflow: ellipsis;
|
|
1301
|
-
white-space: nowrap;
|
|
1302
|
-
`,Ch=tr.div`
|
|
1303
|
-
${wh}
|
|
1304
|
-
`,bh=tr.div`
|
|
1305
|
-
position: relative;
|
|
1306
|
-
width: 100%;
|
|
1307
|
-
display: flex;
|
|
1308
|
-
align-items: center;
|
|
1309
|
-
justify-content: ${({centered:e})=>e?"center":"space-between"};
|
|
1310
|
-
`,Eh=tr.div`
|
|
1311
|
-
display: flex;
|
|
1312
|
-
flex-direction: column;
|
|
1313
|
-
align-items: center;
|
|
1314
|
-
justify-content: center;
|
|
1315
|
-
margin: 32px 0;
|
|
1316
|
-
gap: 4px;
|
|
1317
|
-
|
|
1318
|
-
& h3 {
|
|
1319
|
-
font-size: 18px;
|
|
1320
|
-
font-style: normal;
|
|
1321
|
-
font-weight: 600;
|
|
1322
|
-
line-height: 24px;
|
|
1323
|
-
}
|
|
1324
|
-
|
|
1325
|
-
& p {
|
|
1326
|
-
max-width: 300px;
|
|
1327
|
-
font-size: 14px;
|
|
1328
|
-
font-style: normal;
|
|
1329
|
-
font-weight: 400;
|
|
1330
|
-
line-height: 20px;
|
|
1331
|
-
}
|
|
1332
|
-
`,$h=tr.div`
|
|
1333
|
-
display: flex;
|
|
1334
|
-
flex-direction: column;
|
|
1335
|
-
gap: 10px;
|
|
1336
|
-
padding-bottom: 1rem;
|
|
1337
|
-
`,Th=tr.div`
|
|
1338
|
-
display: flex;
|
|
1339
|
-
text-align: left;
|
|
1340
|
-
align-items: center;
|
|
1341
|
-
|
|
1342
|
-
gap: 8px;
|
|
1343
|
-
max-width: 300px;
|
|
1344
|
-
|
|
1345
|
-
font-size: 14px;
|
|
1346
|
-
font-style: normal;
|
|
1347
|
-
font-weight: 400;
|
|
1348
|
-
line-height: 20px;
|
|
1349
|
-
letter-spacing: -0.008px;
|
|
1350
|
-
|
|
1351
|
-
margin: 0 8px;
|
|
1352
|
-
color: var(--privy-color-foreground-2);
|
|
1353
|
-
|
|
1354
|
-
> :first-child {
|
|
1355
|
-
min-width: 24px;
|
|
1356
|
-
}
|
|
1357
|
-
`;tr.div`
|
|
1358
|
-
height: var(--privy-height-modal-full);
|
|
1359
|
-
|
|
1360
|
-
@media (max-width: 440px) {
|
|
1361
|
-
height: var(--privy-height-modal-compact);
|
|
1362
|
-
}
|
|
1363
|
-
`;const Ah=tr(Gs)`
|
|
1364
|
-
display: flex;
|
|
1365
|
-
flex: 1;
|
|
1366
|
-
gap: 4px;
|
|
1367
|
-
justify-content: center;
|
|
1368
|
-
|
|
1369
|
-
&& {
|
|
1370
|
-
background: var(--privy-color-background);
|
|
1371
|
-
border-radius: var(--privy-border-radius-md);
|
|
1372
|
-
border-color: var(--privy-color-foreground-3);
|
|
1373
|
-
border-width: 1px;
|
|
1374
|
-
}
|
|
1375
|
-
`,xh=tr.div`
|
|
1376
|
-
position: absolute;
|
|
1377
|
-
right: 0.5rem;
|
|
1378
|
-
|
|
1379
|
-
display: flex;
|
|
1380
|
-
flex-direction: row;
|
|
1381
|
-
justify-content: space-around;
|
|
1382
|
-
align-items: center;
|
|
1383
|
-
`,_h=tr(kr)`
|
|
1384
|
-
height: 1.25rem;
|
|
1385
|
-
width: 1.25rem;
|
|
1386
|
-
stroke: var(--privy-color-accent);
|
|
1387
|
-
cursor: pointer;
|
|
1388
|
-
|
|
1389
|
-
:active {
|
|
1390
|
-
stroke: var(--privy-color-accent-light);
|
|
1391
|
-
}
|
|
1392
|
-
`,kh=tr(Sr)`
|
|
1393
|
-
height: 1.25rem;
|
|
1394
|
-
width: 1.25rem;
|
|
1395
|
-
stroke: var(--privy-color-accent);
|
|
1396
|
-
cursor: pointer;
|
|
1397
|
-
|
|
1398
|
-
:active {
|
|
1399
|
-
stroke: var(--privy-color-accent-light);
|
|
1400
|
-
}
|
|
1401
|
-
`,Nh=tr(Nr)`
|
|
1402
|
-
height: 1.25rem;
|
|
1403
|
-
width: 1.25rem;
|
|
1404
|
-
stroke: var(--privy-color-accent);
|
|
1405
|
-
cursor: pointer;
|
|
1406
|
-
|
|
1407
|
-
:active {
|
|
1408
|
-
stroke: var(--privy-color-accent-light);
|
|
1409
|
-
}
|
|
1410
|
-
`,Sh=tr.progress`
|
|
1411
|
-
height: 4px;
|
|
1412
|
-
width: 100%;
|
|
1413
|
-
margin: 8px 0;
|
|
1414
|
-
|
|
1415
|
-
/* border-radius: 9999px; */
|
|
1416
|
-
::-webkit-progress-bar {
|
|
1417
|
-
border-radius: 8px;
|
|
1418
|
-
background: var(--privy-color-foreground-4);
|
|
1419
|
-
}
|
|
1420
|
-
|
|
1421
|
-
::-webkit-progress-value {
|
|
1422
|
-
border-radius: 8px;
|
|
1423
|
-
transition: all 0.1s ease-out;
|
|
1424
|
-
background: ${({label:e})=>("Strong"===e?"#78dca6":"Medium"===e&&"var(--privy-color-warn)")||"var(--privy-color-error)"};
|
|
1425
|
-
}
|
|
1426
|
-
`,Ih=({buttonHideAnimations:n,buttonLoading:a,password:i,onSubmit:o,onBack:l})=>{let[s,c]=d(!0),[u,h]=d(!1),[m,f]=d(""),g=i===m;return p((()=>{m&&!u&&h(!0)}),[m]),e(r,{children:[t(od,{closeable:!1,backFn:l}),t(Tc,{}),e(gh,{children:[e(Eh,{children:[t(dr,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),t("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),t("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),e(bh,{children:[t(vh,{value:m,onChange:e=>f(e.target.value),onKeyUp:e=>{"Enter"===e.key&&o()},onBlur:()=>h(!0),placeholder:"confirm your password",type:s?"password":"text",style:{paddingRight:"2.3rem"}}),t(xh,{style:{right:"0.75rem"},children:s?t(kh,{onClick:()=>c(!1)}):t(Nh,{onClick:()=>c(!0)})})]}),t(fh,{"aria-hidden":!u||g,error:!0,children:"Passwords do not match"})]}),t(yh,{onClick:o,loading:a,disabled:!g,hideAnimations:n,children:"Continue"}),t(Ac,{}),t(Nd,{})]})},Oh=({className:r,checked:n,color:a="var(--privy-color-accent)",...i})=>t("label",{children:e(Ph,{className:r,children:[t(Rh,{checked:n,...i}),t(Lh,{color:a,checked:n,children:t(Mh,{viewBox:"0 0 24 24",children:t("polyline",{points:"20 6 9 17 4 12"})})})]})});tr.label`
|
|
1427
|
-
&& {
|
|
1428
|
-
cursor: pointer;
|
|
1429
|
-
display: flex;
|
|
1430
|
-
align-items: center;
|
|
1431
|
-
gap: 0.75rem;
|
|
1432
|
-
padding: 0.75rem 1rem;
|
|
1433
|
-
text-align: left;
|
|
1434
|
-
border-radius: 0.5rem;
|
|
1435
|
-
border: 1px solid var(--privy-color-foreground-4);
|
|
1436
|
-
width: 100%;
|
|
1437
|
-
}
|
|
1438
|
-
`;let Ph=tr.div`
|
|
1439
|
-
display: inline-block;
|
|
1440
|
-
vertical-align: middle;
|
|
1441
|
-
`,Mh=tr.svg`
|
|
1442
|
-
fill: none;
|
|
1443
|
-
stroke: white;
|
|
1444
|
-
stroke-width: 3px;
|
|
1445
|
-
`,Rh=tr.input.attrs({type:"checkbox"})`
|
|
1446
|
-
border: 0;
|
|
1447
|
-
clip: rect(0 0 0 0);
|
|
1448
|
-
clippath: inset(50%);
|
|
1449
|
-
height: 1px;
|
|
1450
|
-
margin: -1px;
|
|
1451
|
-
overflow: hidden;
|
|
1452
|
-
padding: 0;
|
|
1453
|
-
position: absolute;
|
|
1454
|
-
white-space: nowrap;
|
|
1455
|
-
width: 1px;
|
|
1456
|
-
`,Lh=tr.div`
|
|
1457
|
-
display: inline-block;
|
|
1458
|
-
width: 18px;
|
|
1459
|
-
height: 18px;
|
|
1460
|
-
transition: all 150ms;
|
|
1461
|
-
cursor: pointer;
|
|
1462
|
-
border-color: ${e=>e.color};
|
|
1463
|
-
border-radius: 3px;
|
|
1464
|
-
background: ${e=>e.checked?e.color:"var(--privy-color-background)"};
|
|
1465
|
-
|
|
1466
|
-
&& {
|
|
1467
|
-
/* This is necessary to override css reset for border width */
|
|
1468
|
-
border-width: 1px;
|
|
1469
|
-
}
|
|
1470
|
-
|
|
1471
|
-
${Rh}:focus + & {
|
|
1472
|
-
box-shadow: 0 0 0 1px ${e=>e.color};
|
|
1473
|
-
}
|
|
1474
|
-
|
|
1475
|
-
${Mh} {
|
|
1476
|
-
visibility: ${e=>e.checked?"visible":"hidden"};
|
|
1477
|
-
}
|
|
1478
|
-
`;const Dh=({buttonHideAnimations:n,buttonLoading:a,onSubmit:i,onBack:o,config:l})=>{let[s,c]=d(!1);return e(r,{children:[t(od,{closeable:!1,backFn:o}),t(Tc,{}),e(gh,{children:[e(Eh,{children:[t(dr,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),t("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),t("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),t($h,{children:e(Th,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:e=>{e.preventDefault(),c((e=>!e))},children:[t(Oh,{color:"var(--privy-color-error)",readOnly:!0,checked:s}),t(r,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),e(Fh,{children:["user"===l.initiatedBy&&t(Ys,{onClick:l.onCancel,disabled:a,children:"Cancel"}),t(yh,{onClick:i,loading:a,hideAnimations:n,disabled:!s,children:"Set Password"})]}),t(Ac,{}),t(Nd,{})]})};let Fh=tr.div`
|
|
1479
|
-
display: flex;
|
|
1480
|
-
gap: 10px;
|
|
1481
|
-
`,Uh=/[a-z]/,Wh=/[A-Z]/,Bh=/[0-9]/,jh="!@#$%^&*()\\-_+.",zh=`a-zA-Z0-9${jh}`,Gh=RegExp(`[${jh}]`),Hh=RegExp(`[${zh}]`);const Vh=RegExp(`^[${zh}]{6,}$`),qh=()=>xr.generatePassphrase(4,_r);function Zh(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function Kh(e=""){return(.3*function(e){if(e.length<8)return 0;let t=0;return Uh.test(e)&&(t+=1),Wh.test(e)&&(t+=1),Bh.test(e)&&(t+=1),Gh.test(e)&&(t+=1),Math.max(0,Math.min(1,t/3))}(e)+Ar(e)/95)/2}const Yh=({buttonHideAnimations:n,buttonLoading:a,password:i="",config:o,isResettingPassword:l,onSubmit:s,onClose:u,onBack:h,onPasswordChange:m,onPasswordGenerate:f})=>{let[g,y]=d(!1),[w,v]=d(!1);p((()=>{i&&!w&&v(!0)}),[i]);let C=c((()=>w?6>(i?.length||0)?"Password must be at least 6 characters":Vh.test(i||"")?null:`Invalid characters used ( ${((e="")=>[...new Set(e.split("").filter((e=>!Hh.test(e))).map((e=>e.replace(" ","SPACE"))))])(i).join(" ")} )`:null),[i,w]),b=c((()=>C?{value:0,label:"Weak"}:function(e=""){let t=Kh(e);return{value:t,label:Zh(t)}}(i)),[i,C]),E=c((()=>!i?.length||!!C),[C,i]);return e(r,{children:[t(od,{onClose:u,closeable:"user"===o.initiatedBy,backFn:h}),t(Tc,{}),e(gh,{children:[e(Eh,{children:[t(Ir,{height:48,width:48,stroke:"var(--privy-color-accent)"}),e("h3",{style:{color:"var(--privy-color-foreground)"},children:[l?"Reset":"Set"," your password"]}),t("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),e(bh,{children:[t(vh,{value:i,onChange:e=>m(e.target.value),onKeyUp:e=>{"Enter"===e.key&&s()},placeholder:"enter or generate a strong password",type:g?"password":"text",style:{paddingRight:"3.8rem"}}),e(xh,{style:{width:"3.5rem"},children:[g?t(kh,{onClick:()=>y(!1)}):t(Nh,{onClick:()=>y(!0)}),t(_h,{onClick:f})]})]}),t(Sh,{value:0===b.value?.01:b.value,label:b.label}),t(fh,{error:!!C,children:C||`Password Strength: ${w?b.label:"--"}`}),e(Jh,{children:[t(Qh,{children:e($h,{children:[e(Th,{children:[t(vr,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),e(Th,{children:[t(vr,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),t(yh,{onClick:s,loading:a,disabled:E,hideAnimations:n,children:"Continue"})]})]}),t(Ac,{}),t(Nd,{})]})};let Qh=tr($h)`
|
|
1482
|
-
flex: 1;
|
|
1483
|
-
padding-top: 1rem;
|
|
1484
|
-
`,Jh=tr.div`
|
|
1485
|
-
display: flex;
|
|
1486
|
-
flex-direction: column;
|
|
1487
|
-
height: 100%;
|
|
1488
|
-
`;const Xh=({buttonHideAnimations:n,buttonLoading:a,appName:i,password:o,onSubmit:l,onBack:s})=>{let[c,u]=d(!1),h=m((()=>{u(!0),o&&navigator.clipboard.writeText(o)}),[o]),p=m((()=>{let e=document.createElement("a"),t=i.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),r=new Blob([ep(i,o)],{type:"text/plain"}),n=URL.createObjectURL(r);e.href=n,e.target="_blank",e.download=`${t}-privy-wallet-recovery.txt`,document.body.appendChild(e),e.click(),setTimeout((()=>{e.remove(),URL.revokeObjectURL(n)}),5e3)}),[o]);return e(r,{children:[t(od,{backFn:s,closeable:!1}),t(Tc,{}),e(gh,{children:[e(Eh,{children:[t(dr,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),t("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),t("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),t(bh,{centered:!0,children:t(Ch,{children:o})}),e("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[t(Ah,{onClick:h,children:e(r,c?{children:[t(Pr,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}:{children:[t(Mr,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),e(Ah,{onClick:p,children:[t(Or,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),t(yh,{onClick:l,loading:a,hideAnimations:n,children:"Continue"}),t(Ac,{}),t(Nd,{})]})};let ep=(e,t)=>`Your wallet recovery password for ${e} is\n\n${t}\n\nYou will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;const tp=({error:n,onClose:a})=>e(r,{children:[t(od,{closeable:!1}),t(Tc,{}),e(Cc,n?{children:[t(Cr,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),t(Ic,{title:"Something went wrong",description:n})]}:{children:[t(vr,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),t(Ic,{title:"Success"})]}),t(Hs,{onClick:a,children:"Close"}),t(Ac,{}),t(Nd,{})]});let rp=(e,t)=>{switch(e){case"creating":return"back"===t?e:"saving";case"saving":return"back"===t?"creating":"confirming";case"confirming":return"back"===t?"saving":"finalizing";case"finalizing":return"back"===t?"confirming":"done";default:return e}};const np=({onSubmit:e,...r})=>{let{lastScreen:n,navigate:a}=ye(),{send:i,state:o}=(()=>{let[e,t]=f(rp,"creating");return{send:t,state:e}})(),l=m((async()=>{"finalizing"===o&&await e(),i("next")}),[o,i,e]);p((()=>{let e;return"done"===o&&"automatic"===r.config.initiatedBy&&(e=setTimeout((()=>r.onClose?.()),je)),()=>{e&&clearTimeout(e)}}),[o,r.config.initiatedBy,r.onClose]);let s=m((()=>{i("back")}),[i]),d=m((()=>{a(We.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN)}),[n,a]);return"creating"===o?t(Yh,{...r,onSubmit:l,onBack:n===We.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN?d:void 0}):"saving"===o?t(Xh,{...r,onSubmit:l,onBack:s}):"confirming"===o?t(Ih,{...r,onSubmit:l,onBack:s}):"finalizing"===o?t(Dh,{...r,onSubmit:l,onBack:s}):"done"===o?t(tp,{...r,onSubmit:l}):null};const ap=({error:n,backFn:a,onClick:i})=>{let{reset:o}=Ll(),{app:l}=ye(),s=((e,r)=>{let n=t(dr,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof E)switch(e.privyErrorCode){case T.CLIENT_REQUEST_TIMEOUT:return{title:"Timed out",detail:e.message,ctaText:"Try again",icon:n};case T.INSUFFICIENT_BALANCE:return{title:"Insufficient balance",detail:e.message,ctaText:"Try again",icon:n};case T.TRANSACTION_FAILURE:return{title:"Transaction failure",detail:e.message,ctaText:"Try again",icon:n};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:n}}else{if(e instanceof Gu&&"twilio_verification_failed"===e.type)return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:t(wr,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(!(e instanceof A))return e instanceof O&&e.status&&[400,422].includes(e.status)?{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:n}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:n};switch(e.privyErrorCode){case T.INVALID_CAPTCHA:return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:n};case T.DISALLOWED_LOGIN_METHOD:return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:n};case T.ALLOWLIST_REJECTED:return{title:r.errorTitle||"You don't have access to this app",detail:r.errorDetail||"Have you been invited?",ctaText:r.errorCtaText||"Try another account",icon:t(pc,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case T.CAPTCHA_FAILURE:return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:t("span",{})};case T.CAPTCHA_TIMEOUT:return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:t("span",{})};case T.LINKED_TO_ANOTHER_USER:return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:n};case T.NOT_SUPPORTED:return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:n};case T.TOO_MANY_REQUESTS:return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:n};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:n}}}})(n,l.allowlistConfig);return e(r,{children:[t(od,{backFn:a}),e(ip,{children:[t(pd,{children:e("div",{children:[t(Ad,{color:"var(--privy-color-error)"}),s.icon]})}),e(op,{children:[t("h3",{children:s.title}),t("p",{children:s.detail})]}),t(Hs,{color:"var(--privy-color-error)",onClick:()=>{n instanceof A&&(n.privyErrorCode===T.INVALID_CAPTCHA&&o(),n.privyErrorCode===T.ALLOWLIST_REJECTED&&l.allowlistConfig.errorCtaLink)?window.location.href=l.allowlistConfig.errorCtaLink:i?.()},children:s.ctaText})]})]})};let ip=tr.div`
|
|
1489
|
-
display: flex;
|
|
1490
|
-
flex-direction: column;
|
|
1491
|
-
align-items: center;
|
|
1492
|
-
justify-content: center;
|
|
1493
|
-
gap: 24px;
|
|
1494
|
-
width: 100%;
|
|
1495
|
-
padding-bottom: 16px;
|
|
1496
|
-
`,op=tr.div`
|
|
1497
|
-
display: flex;
|
|
1498
|
-
flex-direction: column;
|
|
1499
|
-
gap: 8px;
|
|
1500
|
-
`;const lp=({style:e,color:r,...n})=>t("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:r||"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...n,children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),sp=({color:e,...r})=>t("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...r,children:t("g",{children:t("path",{fill:e||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})}),dp=r=>{let[n,a]=d(!1);return e(cp,{color:r.color,onClick:()=>{a(!0),navigator.clipboard.writeText(r.text),setTimeout((()=>a(!1)),1500)},justCopied:n,children:[n?t(lp,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):t(sp,{style:{height:"14px",width:"14px"}}),n?"Copied":"Copy"," ",r.itemName?r.itemName:"to Clipboard"]})};let cp=tr.button`
|
|
1501
|
-
display: flex;
|
|
1502
|
-
align-items: center;
|
|
1503
|
-
gap: 6px;
|
|
1504
|
-
|
|
1505
|
-
&& {
|
|
1506
|
-
margin: 8px 2px;
|
|
1507
|
-
font-size: 14px;
|
|
1508
|
-
color: ${e=>e.justCopied?"var(--privy-color-foreground)":e.color||"var(--privy-color-foreground-3)"};
|
|
1509
|
-
font-weight: ${e=>e.justCopied?"medium":"normal"};
|
|
1510
|
-
transition: color 350ms ease;
|
|
1511
|
-
|
|
1512
|
-
:focus,
|
|
1513
|
-
:active {
|
|
1514
|
-
background-color: transparent;
|
|
1515
|
-
border: none;
|
|
1516
|
-
outline: none;
|
|
1517
|
-
box-shadow: none;
|
|
1518
|
-
}
|
|
1519
|
-
|
|
1520
|
-
:hover {
|
|
1521
|
-
color: ${e=>e.justCopied?"var(--privy-color-foreground)":"var(--privy-color-foreground-2)"};
|
|
1522
|
-
}
|
|
1523
|
-
|
|
1524
|
-
:active {
|
|
1525
|
-
color: 'var(--privy-color-foreground)';
|
|
1526
|
-
font-weight: medium;
|
|
1527
|
-
}
|
|
1528
|
-
|
|
1529
|
-
@media (max-width: 440px) {
|
|
1530
|
-
margin: 12px 2px;
|
|
1531
|
-
}
|
|
1532
|
-
}
|
|
1533
|
-
|
|
1534
|
-
svg {
|
|
1535
|
-
width: 14px;
|
|
1536
|
-
height: 14px;
|
|
1537
|
-
}
|
|
1538
|
-
`;const up=e=>{let[r,n]=d(!1);return t(hp,{color:e.color,href:e.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{n(!0),setTimeout((()=>n(!1)),1500)},justOpened:r,children:e.text})};let hp=tr.a`
|
|
1539
|
-
display: flex;
|
|
1540
|
-
align-items: center;
|
|
1541
|
-
gap: 6px;
|
|
1542
|
-
|
|
1543
|
-
&& {
|
|
1544
|
-
margin: 8px 2px;
|
|
1545
|
-
font-size: 14px;
|
|
1546
|
-
color: ${e=>e.justOpened?"var(--privy-color-foreground)":e.color||"var(--privy-color-foreground-3)"};
|
|
1547
|
-
font-weight: ${e=>e.justOpened?"medium":"normal"};
|
|
1548
|
-
transition: color 350ms ease;
|
|
1549
|
-
|
|
1550
|
-
:focus,
|
|
1551
|
-
:active {
|
|
1552
|
-
background-color: transparent;
|
|
1553
|
-
border: none;
|
|
1554
|
-
outline: none;
|
|
1555
|
-
box-shadow: none;
|
|
1556
|
-
}
|
|
1557
|
-
|
|
1558
|
-
:hover {
|
|
1559
|
-
color: ${e=>e.justOpened?"var(--privy-color-foreground)":"var(--privy-color-foreground-2)"};
|
|
1560
|
-
}
|
|
1561
|
-
|
|
1562
|
-
:active {
|
|
1563
|
-
color: 'var(--privy-color-foreground)';
|
|
1564
|
-
font-weight: medium;
|
|
1565
|
-
}
|
|
1566
|
-
|
|
1567
|
-
@media (max-width: 440px) {
|
|
1568
|
-
margin: 12px 2px;
|
|
1569
|
-
}
|
|
1570
|
-
}
|
|
1571
|
-
|
|
1572
|
-
svg {
|
|
1573
|
-
width: 14px;
|
|
1574
|
-
height: 14px;
|
|
1575
|
-
}
|
|
1576
|
-
`;const pp=()=>t("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:t("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})});let mp=(e,t,r,n,a)=>{for(let i=t;i<t+n;i++)for(let t=r;t<r+a;t++){let r=e?.[t];r&&r[i]&&(r[i]=0)}return e},fp=({x:e,y:n,cellSize:a,bgColor:i,fgColor:o})=>t(r,{children:[0,1,2].map((r=>t("circle",{r:a*(7-2*r)/2,cx:e+7*a/2,cy:n+7*a/2,fill:r%2!=0?i:o},`finder-${e}-${n}-${r}`)))}),gp=({cellSize:e,matrixSize:n,bgColor:a,fgColor:i})=>t(r,{children:[[0,0],[(n-7)*e,0],[0,(n-7)*e]].map((([r,n])=>t(fp,{x:r,y:n,cellSize:e,bgColor:a,fgColor:i},`finder-${r}-${n}`)))}),yp=({matrix:e,cellSize:n,color:a})=>t(r,{children:e.map(((e,r)=>e.map(((e,i)=>e?t("rect",{height:n-.4,width:n-.4,x:r*n+.1*n,y:i*n+.1*n,rx:.5*n,ry:.5*n,fill:a},`cell-${r}-${i}`):t(l.Fragment,{},`circle-${r}-${i}`)))))}),wp=({cellSize:n,matrixSize:a,element:i,sizePercentage:o,bgColor:l})=>{if(!i)return t(r,{});let s=a*(o||.14),d=Math.floor(a/2-s/2),c=Math.floor(a/2+s/2);(c-d)%2!=a%2&&(c+=1);let u=(c-d)*n,h=u-.2*u,p=d*n;return e(r,{children:[t("rect",{x:d*n,y:d*n,width:u,height:u,fill:l}),t(i,{x:p+.1*u,y:p+.1*u,height:h,width:h})]})},vp=r=>{let n=r.outputSize,a=((e,t)=>{let r=Dr.create(e,{errorCorrectionLevel:t}).modules,n=Ze(Array.from(r.data),r.size);return n=mp(n,0,0,7,7),n=mp(n,n.length-7,0,7,7),mp(n,0,n.length-7,7,7)})(r.url,r.errorCorrectionLevel),i=n/a.length,o=Ke(2*i,{min:.025*n,max:.036*n});return e("svg",{height:r.outputSize,width:r.outputSize,viewBox:`0 0 ${r.outputSize} ${r.outputSize}`,style:{height:"100%",width:"100%",padding:`${o}px`},children:[t(yp,{matrix:a,cellSize:i,color:r.fgColor}),t(gp,{cellSize:i,matrixSize:a.length,fgColor:r.fgColor,bgColor:r.bgColor}),t(wp,{cellSize:i,element:r.logo?.element,bgColor:r.bgColor,matrixSize:a.length})]})},Cp=tr.div`
|
|
1577
|
-
display: flex;
|
|
1578
|
-
justify-content: center;
|
|
1579
|
-
align-items: center;
|
|
1580
|
-
height: ${e=>`${e.$size}px`};
|
|
1581
|
-
width: ${e=>`${e.$size}px`};
|
|
1582
|
-
margin: auto;
|
|
1583
|
-
background-color: ${e=>e.$bgColor};
|
|
1584
|
-
|
|
1585
|
-
&& {
|
|
1586
|
-
border-width: 2px;
|
|
1587
|
-
border-color: ${e=>e.$borderColor};
|
|
1588
|
-
border-radius: var(--privy-border-radius-md);
|
|
1589
|
-
}
|
|
1590
|
-
`;const bp=e=>{let{appearance:r}=Ue(),n=e.bgColor||"#FFFFFF",a=e.fgColor||"#000000",i=e.size||160,o="dark"===r.palette.colorScheme?n:a;return t(Cp,{$size:i,$bgColor:n,$fgColor:a,$borderColor:o,children:t(vp,{url:e.url,logo:{element:e.squareLogoElement??pp},outputSize:i,bgColor:n,fgColor:a,errorCorrectionLevel:e.errorCorrectionLevel||"Q"})})},Ep=({style:r,...n})=>e("svg",{width:"1000",height:"1000",viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...r},...n,children:[t("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),t("path",{d:"M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z",fill:"white"}),t("path",{d:"M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z",fill:"white"}),t("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]});let $p="#8a63d2";let Tp=tr.div`
|
|
1591
|
-
display: flex;
|
|
1592
|
-
flex-direction: column;
|
|
1593
|
-
align-items: center;
|
|
1594
|
-
justify-content: center;
|
|
1595
|
-
margin-left: 27px;
|
|
1596
|
-
margin-right: 27px;
|
|
1597
|
-
gap: 24px;
|
|
1598
|
-
`,Ap=tr.div`
|
|
1599
|
-
display: flex;
|
|
1600
|
-
flex-direction: column;
|
|
1601
|
-
align-items: center;
|
|
1602
|
-
justify-content: center;
|
|
1603
|
-
gap: 24px;
|
|
1604
|
-
width: 100%;
|
|
1605
|
-
`,xp="#8a63d2";let _p=tr.div`
|
|
1606
|
-
display: flex;
|
|
1607
|
-
flex-direction: column;
|
|
1608
|
-
align-items: center;
|
|
1609
|
-
justify-content: center;
|
|
1610
|
-
margin-left: 27px;
|
|
1611
|
-
margin-right: 27px;
|
|
1612
|
-
gap: 24px;
|
|
1613
|
-
`,kp=tr.div`
|
|
1614
|
-
display: flex;
|
|
1615
|
-
flex-direction: column;
|
|
1616
|
-
align-items: center;
|
|
1617
|
-
justify-content: center;
|
|
1618
|
-
gap: 24px;
|
|
1619
|
-
width: 100%;
|
|
1620
|
-
`;function Np({title:e}){let{currentScreen:r,navigateBack:n,navigate:a,data:i,setModalData:o}=ye();return t(od,{title:e,backFn:r===We.FUNDING_MANUAL_TRANSFER_SCREEN?n:r===i?.funding?.methodScreen?i.funding.comingFromSendTransactionScreen?()=>a(We.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN):void 0:i?.funding?.methodScreen?()=>{let e=i.funding;e.usingDefaultFundingMethod&&(e.usingDefaultFundingMethod=!1),o({funding:e}),a(e.methodScreen)}:void 0})}const Sp=({size:r})=>t(Ip,{$size:r,children:e(Op,{children:[t(Pp,{}),t(Mp,{})]})});let Ip=tr.div`
|
|
1621
|
-
--spinner-size: ${e=>e.$size?e.$size:"96px"};
|
|
1622
|
-
|
|
1623
|
-
display: flex;
|
|
1624
|
-
justify-content: center;
|
|
1625
|
-
align-items: center;
|
|
1626
|
-
flex-grow: 1;
|
|
1627
|
-
|
|
1628
|
-
@media all and (display-mode: standalone) {
|
|
1629
|
-
margin-bottom: 30px;
|
|
1630
|
-
}
|
|
1631
|
-
`,Op=tr.div`
|
|
1632
|
-
position: relative;
|
|
1633
|
-
height: var(--spinner-size);
|
|
1634
|
-
width: var(--spinner-size);
|
|
1635
|
-
|
|
1636
|
-
opacity: 1;
|
|
1637
|
-
animation: fadein 200ms ease;
|
|
1638
|
-
`,Pp=tr.div`
|
|
1639
|
-
position: absolute;
|
|
1640
|
-
top: 0;
|
|
1641
|
-
right: 0;
|
|
1642
|
-
bottom: 0;
|
|
1643
|
-
left: 0;
|
|
1644
|
-
width: var(--spinner-size);
|
|
1645
|
-
height: var(--spinner-size);
|
|
1646
|
-
|
|
1647
|
-
&& {
|
|
1648
|
-
border: 4px solid #f1f2f9;
|
|
1649
|
-
border-radius: 50%;
|
|
1650
|
-
}
|
|
1651
|
-
`,Mp=tr.div`
|
|
1652
|
-
position: absolute;
|
|
1653
|
-
top: 0;
|
|
1654
|
-
right: 0;
|
|
1655
|
-
bottom: 0;
|
|
1656
|
-
left: 0;
|
|
1657
|
-
width: var(--spinner-size);
|
|
1658
|
-
height: var(--spinner-size);
|
|
1659
|
-
animation: spin 1200ms linear infinite;
|
|
1660
|
-
|
|
1661
|
-
&& {
|
|
1662
|
-
border: 4px solid;
|
|
1663
|
-
border-color: #cbcde1 transparent transparent transparent;
|
|
1664
|
-
border-radius: 50%;
|
|
1665
|
-
}
|
|
1666
|
-
|
|
1667
|
-
@keyframes spin {
|
|
1668
|
-
from {
|
|
1669
|
-
transform: rotate(0deg);
|
|
1670
|
-
}
|
|
1671
|
-
to {
|
|
1672
|
-
transform: rotate(360deg);
|
|
1673
|
-
}
|
|
1674
|
-
}
|
|
1675
|
-
`;const Rp=({enabled:e=!0}={})=>{let{showFiatPrices:t,getUsdPriceForSol:r}=P(),[n,a]=d(!0),[i,o]=d(void 0),[l,s]=d(void 0);return p((()=>{(async()=>{if(t&&e)try{a(!0);let e=await r();e?s(e):o(Error("Unable to fetch SOL price"))}catch(e){o(e)}finally{a(!1)}else a(!1)})()}),[]),{solPrice:l,isSolPriceLoading:n,solPriceError:i}};function Lp(e){let{tokenPrice:t,isTokenPriceLoading:r,tokenPriceError:n}=(e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:n}=P(),[a,i]=d(!0),[o,l]=d(void 0),[s,c]=d(void 0);return p((()=>{e||=Qe;let a=Ye(n).find((t=>t.id===Number(e)));(async()=>{if(t){if(!a)return i(!1),void l(Error(`Unable to fetch token price on chain id ${e}`));try{i(!0);let e=await r(a);e?c(e):l(Error(`Unable to fetch token price on chain id ${a.id}`))}catch(e){l(e)}finally{i(!1)}}else i(!1)})()}),[e]),{tokenPrice:s,isTokenPriceLoading:a,tokenPriceError:o}})("solana"===e?-1:e),{solPrice:a,isSolPriceLoading:i,solPriceError:o}=Rp({enabled:"solana"===e});return"solana"===e?{tokenPrice:a,isTokenPriceLoading:i,tokenPriceError:o}:{tokenPrice:t,isTokenPriceLoading:r,tokenPriceError:n}}const Dp="sdk_fiat_on_ramp_completed_with_status";let Fp="0x0000000000000000000000000000000000000000";const Up=({destinationCurrency:e,...t})=>({tradeType:"EXACT_OUTPUT",originCurrency:Fp,destinationCurrency:e??Fp,...t}),Wp=async({input:e,isTestnet:t})=>{let r=await fetch(t?"https://api.testnets.relay.link/execute/swap":"https://api.relay.link/execute/swap",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),n=await r.json();if(!(r.ok||"string"==typeof n.message&&n.message.startsWith("Invalid address")))throw console.error("Relay error:",n),Error(n.message??"Error fetching quote from relay");return n},Bp=e=>{let t=e.steps[0]?.items?.[0];if(t)return{from:t.data.from,to:t.data.to,value:Number(t.data.value),chainId:Number(t.data.chainId),data:t.data.data}},jp=(e,t=0)=>{let r=e[t],n=e[t+7];if(!r||!n)throw Error(`Buffer offset out of range: first: ${r}, last: ${n}.`);return(BigInt(e[t+4]+256*e[t+5]+65536*e[t+6]+(n<<24))<<32n)+BigInt(r+256*e[++t]+65536*e[++t]+16777216*e[++t])};let zp=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2});function Gp(e,t=6,r=!1,n=!1){let a=(parseFloat(e.toString())/1e9).toFixed(t).replace(/0+$/,"").replace(/\.$/,""),i=n?"":" SOL";return r?`${a}${i}`:`${"0"===a?"<0.001":a}${i}`}function Hp(e,t){let r=parseFloat(e.toString())/1e9,n=zp.format(t*r);return"$0.00"===n?"<$0.01":n}function Vp({amount:e,fee:t,tokenPrice:r}){let n=BigInt(1e9*parseFloat(e)),a=n+t;return{fundingAmountInBaseUnit:n,fundingAmountInUsd:r?Hp(n,r):void 0,totalPriceInUsd:r?Hp(a,r):void 0,totalPriceInNativeCurrency:Gp(a),feePriceInNativeCurrency:Gp(t),feePriceInUsd:r?Hp(t,r):void 0}}function qp(e){return"version"in e}function Zp(e,t,r=0){let n="from"===t?0:"to"===t?1:2;if(qp(e)){let t=e.message.getAccountKeys(),a=e.message.compiledInstructions.at(r)?.accountKeyIndexes[n];return a&&t.get(a)||null}let a=e.instructions.at(r)?.keys.at(n)?.pubkey;if(null==a)throw Error(`Transaction does not contain a "${t}" public key`);return a}function Kp(e,t=!1,r=0){let n=t?1:4;if(qp(e)){let t=e.message.compiledInstructions.at(r)?.data;if(!t)return 0n;try{return jp(Buffer.from(t),n)}catch(e){return 0n}}let a=e.instructions.at(r)?.data.readBigInt64LE(n);return null==a?0n:a}function Yp(e,t=0){let r;if(qp(e)){let n=e.message.compiledInstructions.at(t)?.programIdIndex;if(null==n)throw Error("Transaction does not contain a Program ID");r=e.message.getAccountKeys().get(n)?.toBase58()}else r=e.instructions.at(t)?.programId.toBase58();if(!r)throw Error("Transaction does not contain a Program ID");return"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"===r?"approve":"11111111111111111111111111111111"===r?"transfer":"instruction"}function Qp(e,t){return{signature:e,parsedTransaction:t,fees:BigInt(t?.meta?.fee||0)}}async function Jp(e,t){let r=[],n=qp(e)?e.message.compiledInstructions.length:e.instructions.length,a={},i=BigInt(await async function(e,t){return qp(e)?(await t.getFeeForMessage(e.message)).value:await e.getEstimatedFee(t)}(e,t)||0);for(let i=0;i<n;i++){let n=Yp(e,i),o=Zp(e,"from",i),l=Zp(e,"to",i),s=Kp(e,"approve"===n,i),d="transfer"===n?null:Zp(e,"owner",i),c=0n;o&&(a[o.toBase58()]||(a[o.toBase58()]=BigInt(await t.getBalance(o))),c=a[o.toBase58()]||0n),r.push({from:o,to:l,spender:d,action:n,amount:s,balance:c,hasFunds:c>=s})}return{fees:i,instructions:r}}const Xp=({chains:e,appId:t,address:r,rpcConfig:n})=>Promise.all(e.map((async e=>{let a=Fr({chain:e,transport:Ur(Je(e,n,t))});return{balance:await a.getBalance({address:r}).catch((()=>0n)),chain:e}}))),em=tr.span`
|
|
1676
|
-
display: flex;
|
|
1677
|
-
flex-direction: column;
|
|
1678
|
-
gap: 0.35rem;
|
|
1679
|
-
width: 100%;
|
|
1680
|
-
`,tm=tr.span`
|
|
1681
|
-
display: flex;
|
|
1682
|
-
width: 100%;
|
|
1683
|
-
justify-content: space-between;
|
|
1684
|
-
gap: 0.5rem;
|
|
1685
|
-
`,rm=tr.span`
|
|
1686
|
-
color: var(--privy-color-foreground-3);
|
|
1687
|
-
font-size: 0.875rem;
|
|
1688
|
-
font-weight: 400;
|
|
1689
|
-
line-height: 1.375rem; /* 157.143% */
|
|
1690
|
-
`,nm=tr(rm)`
|
|
1691
|
-
color: var(--privy-color-accent);
|
|
1692
|
-
`,am=tr.span`
|
|
1693
|
-
color: var(--privy-color-foreground);
|
|
1694
|
-
font-size: 0.875rem;
|
|
1695
|
-
font-weight: 500;
|
|
1696
|
-
line-height: 1.375rem; /* 157.143% */
|
|
1697
|
-
word-break: break-all;
|
|
1698
|
-
text-align: right;
|
|
1699
|
-
|
|
1700
|
-
${Qc}
|
|
1701
|
-
`,im=r=>e("svg",{xmlns:"http://www.w3.org/2000/svg",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 397.7 311.7",enableBackground:"new 0 0 397.7 311.7",xmlSpace:"preserve",...r,children:[e("linearGradient",{id:"SVGID_1_",gradientUnits:"userSpaceOnUse",x1:"360.8791",y1:"351.4553",x2:"141.213",y2:"-69.2936",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[t("stop",{offset:"0",stopColor:"#00FFA3"}),t("stop",{offset:"1",stopColor:"#DC1FFF"})]}),t("path",{d:"M64.6,237.9c2.4-2.4,5.7-3.8,9.2-3.8h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5 c-5.8,0-8.7-7-4.6-11.1L64.6,237.9z",fill:"url(#SVGID_1_)"}),e("linearGradient",{id:"SVGID_2_",gradientUnits:"userSpaceOnUse",x1:"264.8291",y1:"401.6014",x2:"45.163",y2:"-19.1475",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[t("stop",{offset:"0",stopColor:"#00FFA3"}),t("stop",{offset:"1",stopColor:"#DC1FFF"})]}),t("path",{d:"M64.6,3.8C67.1,1.4,70.4,0,73.8,0h317.4c5.8,0,8.7,7,4.6,11.1l-62.7,62.7c-2.4,2.4-5.7,3.8-9.2,3.8H6.5 c-5.8,0-8.7-7-4.6-11.1L64.6,3.8z",fill:"url(#SVGID_2_)"}),e("linearGradient",{id:"SVGID_3_",gradientUnits:"userSpaceOnUse",x1:"312.5484",y1:"376.688",x2:"92.8822",y2:"-44.061",gradientTransform:"matrix(1 0 0 -1 0 314)",children:[t("stop",{offset:"0",stopColor:"#00FFA3"}),t("stop",{offset:"1",stopColor:"#DC1FFF"})]}),t("path",{d:"M333.1,120.1c-2.4-2.4-5.7-3.8-9.2-3.8H6.5c-5.8,0-8.7,7-4.6,11.1l62.7,62.7c2.4,2.4,5.7,3.8,9.2,3.8h317.4 c5.8,0,8.7-7,4.6-11.1L333.1,120.1z",fill:"url(#SVGID_3_)"})]});let om={[Xe.id]:r=>t("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",version:"1.1",id:"Layer_1",x:"0px",y:"0px",viewBox:"0 0 2500 2500",xmlSpace:"preserve",...r,children:t("g",{id:"Layer_x0020_1",children:e("g",{id:"_2405588477232",children:[t("rect",{fill:"none",width:"2500",height:"2500"}),t("g",{children:e("g",{children:[t("path",{fill:"#213147",d:"M226,760v980c0,63,33,120,88,152l849,490c54,31,121,31,175,0l849-490c54-31,88-89,88-152V760 c0-63-33-120-88-152l-849-490c-54-31-121-31-175,0L314,608c-54,31-87,89-87,152H226z"}),t("g",{children:e("g",{children:[t("g",{children:t("path",{fill:"#12AAFF",d:"M1435,1440l-121,332c-3,9-3,19,0,29l208,571l241-139l-289-793C1467,1422,1442,1422,1435,1440z"})}),t("g",{children:t("path",{fill:"#12AAFF",d:"M1678,882c-7-18-32-18-39,0l-121,332c-3,9-3,19,0,29l341,935l241-139L1678,883V882z"})})]})}),t("g",{children:t("path",{fill:"#9DCCED",d:"M1250,155c6,0,12,2,17,5l918,530c11,6,17,18,17,30v1060c0,12-7,24-17,30l-918,530c-5,3-11,5-17,5 s-12-2-17-5l-918-530c-11-6-17-18-17-30V719c0-12,7-24,17-30l918-530c5-3,11-5,17-5l0,0V155z M1250,0c-33,0-65,8-95,25L237,555 c-59,34-95,96-95,164v1060c0,68,36,130,95,164l918,530c29,17,62,25,95,25s65-8,95-25l918-530c59-34,95-96,95-164V719 c0-68-36-130-95-164L1344,25c-29-17-62-25-95-25l0,0H1250z"})}),t("polygon",{fill:"#213147",points:"642,2179 727,1947 897,2088 738,2234 "}),e("g",{children:[t("path",{fill:"#FFFFFF",d:"M1172,644H939c-17,0-33,11-39,27L401,2039l241,139l550-1507c5-14-5-28-19-28L1172,644z"}),t("path",{fill:"#FFFFFF",d:"M1580,644h-233c-17,0-33,11-39,27L738,2233l241,139l620-1701c5-14-5-28-19-28V644z"})]})]})})]})})}),[et.id]:r=>e("svg",{width:"1503",height:"1504",viewBox:"0 0 1503 1504",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("rect",{x:"287",y:"258",width:"928",height:"844",fill:"white"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M1502.5 752C1502.5 1166.77 1166.27 1503 751.5 1503C336.734 1503 0.5 1166.77 0.5 752C0.5 337.234 336.734 1 751.5 1C1166.27 1 1502.5 337.234 1502.5 752ZM538.688 1050.86H392.94C362.314 1050.86 347.186 1050.86 337.962 1044.96C327.999 1038.5 321.911 1027.8 321.173 1015.99C320.619 1005.11 328.184 991.822 343.312 965.255L703.182 330.935C718.495 303.999 726.243 290.531 736.021 285.55C746.537 280.2 759.083 280.2 769.599 285.55C779.377 290.531 787.126 303.999 802.438 330.935L876.42 460.079L876.797 460.738C893.336 489.635 901.723 504.289 905.385 519.669C909.443 536.458 909.443 554.169 905.385 570.958C901.695 586.455 893.393 601.215 876.604 630.549L687.573 964.702L687.084 965.558C670.436 994.693 661.999 1009.46 650.306 1020.6C637.576 1032.78 622.263 1041.63 605.474 1046.62C590.161 1050.86 573.004 1050.86 538.688 1050.86ZM906.75 1050.86H1115.59C1146.4 1050.86 1161.9 1050.86 1171.13 1044.78C1181.09 1038.32 1187.36 1027.43 1187.92 1015.63C1188.45 1005.1 1181.05 992.33 1166.55 967.307C1166.05 966.455 1165.55 965.588 1165.04 964.706L1060.43 785.75L1059.24 783.735C1044.54 758.877 1037.12 746.324 1027.59 741.472C1017.08 736.121 1004.71 736.121 994.199 741.472C984.605 746.453 976.857 759.552 961.544 785.934L857.306 964.891L856.949 965.507C841.69 991.847 834.064 1005.01 834.614 1015.81C835.352 1027.62 841.44 1038.5 851.402 1044.96C860.443 1050.86 875.94 1050.86 906.75 1050.86Z",fill:"#E84142"})]}),[tt.id]:r=>e("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),t("path",{d:"M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.343 101.617 21.4463 73.323 21.4463C46.4795 21.4463 24.4581 42.0558 22.271 68.2887H89.9859V76.8864H22.271C24.4581 103.119 46.4795 123.729 73.323 123.729Z",fill:"white"})]}),[rt.id]:r=>e("svg",{fill:"none",height:"400",viewBox:"0 0 400 400",width:"400",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("path",{d:"m0 0h400v400h-400z",fill:"#fcff52"}),t("path",{d:"m300 100h-200v200h199.996v-69.813h-33.191c-11.442 25.468-37.194 43.206-66.665 43.206-40.63 0-73.533-33.187-73.533-73.533s32.903-73.249 73.533-73.249c30.043 0 55.795 18.313 67.24 44.349h32.62z",fill:"#000"})]}),[nt.id]:r=>e("svg",{width:"200",height:"208",viewBox:"0 0 200 208",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("rect",{width:"199.4",height:"207.623",fill:"#121212"}),e("g",{"clip-path":"url(#clip0_2303_643)",children:[t("path",{d:"M132.369 155.99H49.7001V68.8854H68.6148V139.109H132.369V155.981V155.99Z",fill:"white"}),t("path",{d:"M132.369 85.7575C141.687 85.7575 149.241 78.2036 149.241 68.8855C149.241 59.5673 141.687 52.0134 132.369 52.0134C123.05 52.0134 115.497 59.5673 115.497 68.8855C115.497 78.2036 123.05 85.7575 132.369 85.7575Z",fill:"white"})]}),t("defs",{children:t("clipPath",{id:"clip0_2303_643",children:t("rect",{width:"99.5407",height:"103.977",fill:"white",transform:"translate(49.7001 52.0134)"})})})]}),[at.id]:r=>e("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 327.5 533.3",enableBackground:"new 0 0 327.5 533.3;",xmlSpace:"preserve",...r,children:[t("path",{fill:"#8492B2",d:"M163.7,197.2V0L0,271.6L163.7,197.2z"}),t("path",{fill:"#62688F",d:"M163.7,368.4V197.2L0,271.6L163.7,368.4z M163.7,197.2l163.7,74.4L163.7,0V197.2z"}),t("path",{fill:"#454A75",d:"M163.7,197.2v171.2l163.7-96.8L163.7,197.2z"}),t("path",{fill:"#8492B2",d:"M163.7,399.4L0,302.7l163.7,230.7V399.4z"}),t("path",{fill:"#62688F",d:"M327.5,302.7l-163.8,96.7v134L327.5,302.7z"})]}),[it.id]:r=>e("svg",{width:"500",height:"500",viewBox:"0 0 500 500",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("circle",{cx:"250",cy:"250",r:"250",fill:"#FF0420"}),t("path",{d:"M177.133 316.446C162.247 316.446 150.051 312.943 140.544 305.938C131.162 298.808 126.471 288.676 126.471 275.541C126.471 272.789 126.784 269.411 127.409 265.408C129.036 256.402 131.35 245.581 134.352 232.947C142.858 198.547 164.812 181.347 200.213 181.347C209.845 181.347 218.476 182.973 226.107 186.225C233.738 189.352 239.742 194.106 244.12 200.486C248.498 206.74 250.688 214.246 250.688 223.002C250.688 225.629 250.375 228.944 249.749 232.947C247.873 244.08 245.621 254.901 242.994 265.408C238.616 282.546 231.048 295.368 220.29 303.874C209.532 312.255 195.147 316.446 177.133 316.446ZM179.76 289.426C186.766 289.426 192.707 287.362 197.586 283.234C202.59 279.106 206.155 272.789 208.281 264.283C211.158 252.524 213.348 242.266 214.849 233.51C215.349 230.883 215.599 228.194 215.599 225.441C215.599 214.058 209.657 208.366 197.774 208.366C190.768 208.366 184.764 210.43 179.76 214.558C174.882 218.687 171.379 225.004 169.253 233.51C167.001 241.891 164.749 252.149 162.498 264.283C161.997 266.784 161.747 269.411 161.747 272.163C161.747 283.672 167.752 289.426 179.76 289.426Z",fill:"white"}),t("path",{d:"M259.303 314.57C257.927 314.57 256.863 314.132 256.113 313.256C255.487 312.255 255.3 311.13 255.55 309.879L281.444 187.914C281.694 186.538 282.382 185.412 283.508 184.536C284.634 183.661 285.822 183.223 287.073 183.223H336.985C350.87 183.223 362.003 186.1 370.384 191.854C378.891 197.609 383.144 205.927 383.144 216.81C383.144 219.937 382.769 223.19 382.018 226.567C378.891 240.953 372.574 251.586 363.067 258.466C353.685 265.346 340.8 268.786 324.413 268.786H299.082L290.451 309.879C290.2 311.255 289.512 312.38 288.387 313.256C287.261 314.132 286.072 314.57 284.822 314.57H259.303ZM325.727 242.892C330.98 242.892 335.546 241.453 339.424 238.576C343.427 235.699 346.054 231.571 347.305 226.192C347.68 224.065 347.868 222.189 347.868 220.563C347.868 216.935 346.805 214.183 344.678 212.307C342.551 210.305 338.924 209.305 333.795 209.305H311.278L304.148 242.892H325.727Z",fill:"white"})]}),[ot.id]:r=>e("svg",{width:"360",height:"360",viewBox:"0 0 360 360",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r,children:[t("rect",{width:"360",height:"360",rx:"180",fill:"#6C00F6"}),t("path",{d:"M157.743 154.241L141.052 144.58L90.9766 173.561V231.519L141.052 260.5L191.13 231.519V141.359L218.948 125.26L246.77 141.359V173.561L218.948 189.66L202.257 180.002V205.759L218.948 215.42L269.024 186.439V128.481L218.948 99.5L168.873 128.481V218.641L141.052 234.74L113.233 218.641V186.439L141.052 170.34L157.743 179.998V154.241Z",fill:"white"})]}),[lt.id]:r=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",fill:"none",...r,children:[t("g",{clipPath:"url(#clip0)",children:t("g",{clipPath:"url(#clip1)",children:t("path",{d:"M14.9188 29.8373C6.67944 29.8373 0.00012207 23.1581 0.00012207 14.9187C0.00012207 6.67931 6.67944 0 14.9188 0C23.1581 0 29.8373 6.67931 29.8373 14.9187C29.8373 23.1581 23.1581 29.8373 14.9188 29.8373Z",fill:"url(#paint0)"})})}),e("defs",{children:[e("radialGradient",{id:"paint0",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(21.6921 8.02215) rotate(180) scale(25.2008)",children:[t("stop",{offset:"0.00682297",stopColor:"#F2CEFE"}),t("stop",{offset:"0.1913",stopColor:"#AFBAF1"}),t("stop",{offset:"0.4982",stopColor:"#4281D3"}),t("stop",{offset:"0.666667",stopColor:"#2E427D"}),t("stop",{offset:"0.822917",stopColor:"#230101"}),t("stop",{offset:"1",stopColor:"#8F6B40"})]}),t("clipPath",{id:"clip0",children:t("rect",{width:"30",height:"30",fill:"white"})}),t("clipPath",{id:"clip1",children:t("rect",{width:"30",height:"30",fill:"white"})})]})]})};const lm=({chainId:e,...r})=>{if("solana"===e)return t(im,{...r});let n=om[e];return t(n||Kr,{...r})},sm=({balance:e,className:r,chain:n})=>t(Ou,{className:r,$state:void 0,children:t(dm,{balance:e,chain:n})}),dm=({balance:n,chain:a})=>e(r,{children:[e(cm,{children:[t(hm,{chainId:"id"in a?a.id:"solana"}),t(am,{children:a.name})]}),e(Jc,{isLoading:!1,isPulsing:!1,color:"gray",children:[t(um,{children:t(cr,{})}),n]})]});let cm=tr.div`
|
|
1702
|
-
display: flex;
|
|
1703
|
-
align-items: center;
|
|
1704
|
-
`,um=tr.div`
|
|
1705
|
-
height: 0.75rem;
|
|
1706
|
-
width: 0.75rem;
|
|
1707
|
-
margin-right: 0.2rem;
|
|
1708
|
-
`,hm=tr(lm)`
|
|
1709
|
-
height: 1.25rem;
|
|
1710
|
-
width: 1.25rem;
|
|
1711
|
-
display: inline-block;
|
|
1712
|
-
margin-right: 0.5rem;
|
|
1713
|
-
border-radius: 4px;
|
|
1714
|
-
`;const pm=({options:r,onSelect:n,selected:a,className:i})=>e(Yr,{as:mm,children:[e(Qr,{as:wm,children:[t(dm,{balance:a.balance,chain:a.chain}),t(ym,{height:16})]}),t(Jr,{as:fm,className:i,children:r.map(((e,r)=>t(Xr,{as:gm,onClick:()=>n(r),children:t(dm,{balance:e.balance,chain:e.chain})},r)))})]});let mm=tr.div`
|
|
1715
|
-
width: 100%;
|
|
1716
|
-
position: relative;
|
|
1717
|
-
`,fm=tr.div`
|
|
1718
|
-
width: 100%;
|
|
1719
|
-
margin-top: 0.5rem;
|
|
1720
|
-
position: absolute;
|
|
1721
|
-
background-color: var(--privy-color-background);
|
|
1722
|
-
border-radius: var(--privy-border-radius-md);
|
|
1723
|
-
overflow-x: hidden;
|
|
1724
|
-
overflow-y: auto;
|
|
1725
|
-
box-shadow: 0px 1px 2px 0px rgba(16, 24, 40, 0.05);
|
|
1726
|
-
max-height: 11.75rem;
|
|
1727
|
-
|
|
1728
|
-
&& {
|
|
1729
|
-
border: solid 1px var(--privy-color-foreground-4);
|
|
1730
|
-
}
|
|
1731
|
-
|
|
1732
|
-
z-index: 1;
|
|
1733
|
-
`,gm=tr.button`
|
|
1734
|
-
width: 100%;
|
|
1735
|
-
display: flex;
|
|
1736
|
-
justify-content: space-between;
|
|
1737
|
-
|
|
1738
|
-
&& {
|
|
1739
|
-
padding: 1rem;
|
|
1740
|
-
}
|
|
1741
|
-
|
|
1742
|
-
:not(:last-child) {
|
|
1743
|
-
border-bottom: solid 1px var(--privy-color-foreground-4);
|
|
1744
|
-
}
|
|
1745
|
-
|
|
1746
|
-
:hover {
|
|
1747
|
-
background: var(--privy-color-background-2);
|
|
1748
|
-
}
|
|
1749
|
-
`,ym=tr(an)`
|
|
1750
|
-
height: 1rem;
|
|
1751
|
-
margin-left: 0.5rem;
|
|
1752
|
-
`,wm=tr.button`
|
|
1753
|
-
${Iu}
|
|
1754
|
-
|
|
1755
|
-
/* Push the chip all the way to the right */
|
|
1756
|
-
span {
|
|
1757
|
-
margin-left: auto;
|
|
1758
|
-
}
|
|
1759
|
-
|
|
1760
|
-
${ym} {
|
|
1761
|
-
transition: rotate 100ms ease-in;
|
|
1762
|
-
}
|
|
1763
|
-
|
|
1764
|
-
&[aria-expanded='true'] {
|
|
1765
|
-
${ym} {
|
|
1766
|
-
rotate: -180deg;
|
|
1767
|
-
}
|
|
1768
|
-
}
|
|
1769
|
-
`,vm=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),Cm=e=>vm.format(e);const bm=(e,t)=>{let r=Cm(t*parseFloat(e));return"$0.00"!==r?r:"<$0.01"},Em=(e,t)=>{let r=Cm(t*parseFloat(sn(e)));return"$0.00"===r?"<$0.01":r},$m=(e,t,r=6,n=!1)=>{let a=parseFloat(sn(e)).toFixed(r).replace(/0+$/,"").replace(/\.$/,"");return n?`${a} ${t}`:`${"0"===a?"<0.001":a} ${t}`},Tm=e=>e.map(ra).reduce(((e,t)=>e.add(t)),on.from(0)).toHexString(),Am=(e,t)=>{let{chains:r}=P(),n=`https://etherscan.io/address/${t}`,a=`${st(e,r)}/address/${t}`;if(!a)return n;try{new URL(a)}catch{return n}return a},xm=({style:e,...r})=>t("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...r,children:t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})}),_m=({style:r,...n})=>e("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...r},xmlns:"http://www.w3.org/2000/svg",...n,children:[e("g",{clipPath:"url(#clip0_113_33841)",children:[t("path",{d:"M39.1193 0.943398C34.636 -0.174912 29.9185 -0.334713 25.328 0.656273C24.9732 0.732859 24.7477 1.08253 24.8243 1.43729C24.9009 1.79205 25.2506 2.01756 25.6053 1.94097C30.0015 0.991934 34.53 1.14842 38.8375 2.22802C49.1385 4.80983 57.7129 12.5548 60.9786 22.6718C62.2416 26.5843 62.7781 30.7505 62.8855 35.1167C62.8945 35.4795 63.1958 35.7664 63.5586 35.7575C63.9215 35.7485 64.2083 35.4472 64.1994 35.0843C64.0905 30.6582 63.5477 26.3849 62.2536 22.3432C58.8621 11.7515 49.9005 3.63265 39.1193 0.943398Z"}),t("path",{d:"M21.9931 2.93163C22.343 2.83511 22.5484 2.47325 22.4518 2.12339C22.3553 1.77352 21.9935 1.56815 21.6436 1.66466C16.8429 2.98903 10.0898 7.56519 5.91628 13.6786C5.91465 13.681 5.91304 13.6834 5.91145 13.6858C2.24684 19.2083 -0.0503572 26.1484 0.591012 32.8828C0.591623 32.8892 0.592328 32.8956 0.593127 32.902C0.746837 34.1317 1.00488 35.3591 1.26323 36.5879C1.80735 39.1761 2.35282 41.7706 1.92765 44.4064C1.86986 44.7647 2.11347 45.102 2.47177 45.1598C2.83007 45.2176 3.16738 44.974 3.22518 44.6157C3.66961 41.8605 3.11776 39.173 2.56581 36.4851C2.31054 35.2419 2.05525 33.9987 1.89847 32.7486C1.29525 26.3851 3.46802 19.7466 7.00418 14.416C11.0189 8.5373 17.5201 4.16562 21.9931 2.93163Z"}),t("path",{d:"M30.6166 4.39985C38.8671 3.89603 47.1159 7.26314 52.6556 13.7139C52.8921 13.9893 52.8605 14.4042 52.5852 14.6406C52.3099 14.8771 51.895 14.8455 51.6585 14.5702C46.3904 8.43576 38.541 5.23144 30.6927 5.71195C30.6899 5.71212 30.6871 5.71227 30.6843 5.71241C20.7592 6.19265 11.4643 12.9257 8.04547 22.3603C7.92183 22.7016 7.54498 22.8779 7.20375 22.7543C6.86253 22.6306 6.68616 22.2538 6.80981 21.9126C10.4114 11.9735 20.1717 4.90702 30.6166 4.39985Z"}),t("path",{d:"M54.6576 16.5848C54.4553 16.2836 54.047 16.2033 53.7457 16.4057C53.4444 16.608 53.3642 17.0163 53.5665 17.3176C56.6376 21.8904 57.9074 26.8665 58.4094 32.7717C58.4401 33.1333 58.7582 33.4016 59.1199 33.3708C59.4815 33.3401 59.7497 33.022 59.719 32.6604C59.206 26.6261 57.8965 21.4076 54.6576 16.5848Z"}),t("path",{d:"M59.2796 35.4504C59.6419 35.4277 59.9539 35.703 59.9765 36.0653C60.2242 40.0279 60.2265 44.5112 59.7881 47.8243C59.7405 48.1841 59.4102 48.4372 59.0504 48.3896C58.6906 48.342 58.4376 48.0117 58.4852 47.6519C58.9077 44.4586 58.91 40.0704 58.6648 36.1473C58.6421 35.785 58.9174 35.473 59.2796 35.4504Z"}),t("path",{d:"M7.05311 25.5432C7.13829 25.1904 6.92135 24.8354 6.56855 24.7502C6.21576 24.665 5.86071 24.882 5.77553 25.2348C5.2932 27.2325 5.0428 29.2847 5.03288 31.3388C5.02266 33.4559 5.41742 35.5225 5.81234 37.5899C6.1354 39.2811 6.45855 40.9728 6.5602 42.6932C6.69373 44.9531 6.21839 47.2163 5.39698 49.3703C5.26766 49.7094 5.43774 50.0891 5.77685 50.2184C6.11596 50.3477 6.4957 50.1777 6.62502 49.8386C7.49325 47.5617 8.01954 45.1092 7.87221 42.6157C7.77126 40.9071 7.44813 39.2252 7.12512 37.5439C6.73099 35.4925 6.33704 33.442 6.34716 31.3451C6.35659 29.3933 6.59455 27.4425 7.05311 25.5432Z"}),t("path",{d:"M24.2964 10.94C24.4317 11.2768 24.2683 11.6595 23.9315 11.7947C17.1187 14.5307 12.0027 20.7047 10.959 27.9852C10.523 31.0269 10.9941 34.0398 11.465 37.052C11.7303 38.7483 11.9954 40.4443 12.0985 42.1451C12.3221 45.833 11.902 49.8839 9.50192 53.5696C9.30387 53.8737 8.89677 53.9597 8.59264 53.7617C8.28851 53.5636 8.20251 53.1565 8.40056 52.8524C10.5873 49.4944 11.0012 45.7644 10.7867 42.2246C10.6821 40.499 10.4185 38.7833 10.1552 37.0686C9.68265 33.9923 9.21067 30.9195 9.65804 27.7987C10.7724 20.025 16.221 13.4748 23.4417 10.5751C23.7785 10.4399 24.1612 10.6032 24.2964 10.94Z"}),t("path",{d:"M47.3662 14.6814C41.9915 9.64741 34.2017 7.89046 27.122 9.4433C26.7675 9.52105 26.5432 9.87147 26.6209 10.226C26.6987 10.5805 27.0491 10.8048 27.4036 10.7271C34.1075 9.25665 41.4426 10.934 46.4677 15.6406C50.7033 19.6077 53.1628 25.38 53.8066 31.6779C53.8435 32.0389 54.1661 32.3017 54.5272 32.2648C54.8883 32.2279 55.151 31.9053 55.1141 31.5442C54.4456 25.0047 51.8822 18.9111 47.3662 14.6814Z"}),t("path",{d:"M54.9766 34.6738C55.3376 34.6368 55.6604 34.8994 55.6975 35.2604C56.3216 41.337 56.0526 47.9003 55.1104 54.2496C55.0571 54.6086 54.7229 54.8565 54.3639 54.8032C54.0049 54.7499 53.7571 54.4157 53.8103 54.0567C54.7394 47.7957 55.001 41.3439 54.39 35.3947C54.353 35.0336 54.6156 34.7109 54.9766 34.6738Z"}),t("path",{d:"M32.0659 13.3553C21.9959 13.3553 13.814 21.3892 13.814 31.3219C13.814 32.3829 13.9081 33.4225 14.0876 34.4334C14.1511 34.7907 14.4922 35.029 14.8495 34.9655C15.2069 34.9021 15.4451 34.561 15.3817 34.2036C15.2155 33.2677 15.1283 32.305 15.1283 31.3219C15.1283 22.1352 22.7014 14.6696 32.0659 14.6696C36.2978 14.6696 40.1642 16.1949 43.1319 18.7152C43.4086 18.9501 43.8233 18.9163 44.0582 18.6396C44.2931 18.363 44.2593 17.9483 43.9827 17.7134C40.7847 14.9975 36.6188 13.3553 32.0659 13.3553Z"}),t("path",{d:"M45.455 20.1635C45.717 19.9123 46.133 19.921 46.3842 20.183C49.2843 23.2072 50.2126 27.9605 50.8269 31.9494C51.5188 36.4426 51.6244 40.826 51.6244 42.8585C51.6244 43.2214 51.3302 43.5156 50.9673 43.5156C50.6044 43.5156 50.3101 43.2214 50.3101 42.8585C50.3101 40.8589 50.2055 36.5497 49.5279 32.1494C48.9577 28.4462 48.1356 23.9082 45.4356 21.0927C45.1844 20.8307 45.1931 20.4147 45.455 20.1635Z"}),t("path",{d:"M51.4576 46.6219C51.4864 46.2601 51.2165 45.9435 50.8547 45.9146C50.493 45.8858 50.1763 46.1557 50.1474 46.5175C49.8247 50.5654 49.403 54.6088 48.5474 58.3439C48.4663 58.6977 48.6874 59.0502 49.0412 59.1312C49.3949 59.2123 49.7474 58.9912 49.8285 58.6374C50.7067 54.8039 51.134 50.6806 51.4576 46.6219Z"}),t("path",{d:"M15.1454 36.852C15.5015 36.7819 15.847 37.0137 15.9171 37.3698C17.3066 44.4257 16.3467 50.8355 12.6672 56.4502C12.4682 56.7537 12.0609 56.8385 11.7573 56.6396C11.4538 56.4407 11.369 56.0333 11.5679 55.7298C15.0299 50.4469 15.9617 44.3985 14.6276 37.6238C14.5575 37.2677 14.7893 36.9221 15.1454 36.852Z"}),t("path",{d:"M32.0659 17.631C25.5291 17.631 19.1165 22.691 18.462 29.0504C18.1754 31.8345 18.578 34.5769 18.9807 37.3204C19.3323 39.7159 19.684 42.1124 19.5772 44.5381C19.3328 50.0898 17.7039 54.6726 14.905 58.4471C14.6888 58.7386 14.7499 59.1502 15.0414 59.3663C15.333 59.5825 15.7445 59.5214 15.9607 59.2299C18.9293 55.2266 20.6354 50.386 20.8903 44.5959C20.9966 42.1811 20.6438 39.7923 20.2912 37.4051C19.888 34.6752 19.4851 31.9473 19.7694 29.1849C20.3444 23.5983 26.0946 18.9453 32.0659 18.9453C34.851 18.9453 42.057 20.4534 44.3492 27.9205C45.7856 32.5998 46.1774 38.9326 45.8295 45.0849C45.4816 51.2364 44.3994 57.12 42.9442 60.8928C42.8136 61.2314 42.9822 61.6118 43.3208 61.7424C43.6594 61.873 44.0398 61.7044 44.1704 61.3658C45.6929 57.4186 46.7895 51.386 47.1417 45.1591C47.4938 38.9329 47.1068 32.4249 45.6056 27.5348C43.0612 19.2461 35.0851 17.631 32.0659 17.631Z"}),t("path",{d:"M21.9529 56.4512C22.2569 56.6494 22.3426 57.0566 22.1444 57.3606C21.7369 57.9854 21.3784 58.6391 21.0199 59.2928C20.6614 59.9465 20.3028 60.6004 19.8953 61.2253C19.697 61.5293 19.2898 61.615 18.9858 61.4167C18.6819 61.2184 18.5962 60.8113 18.7944 60.5073C19.2019 59.8825 19.5604 59.2288 19.9189 58.5751C20.2774 57.9213 20.636 57.2675 21.0435 56.6426C21.2418 56.3386 21.649 56.2529 21.9529 56.4512Z"}),t("path",{d:"M27.5799 24.4525C27.8816 24.2508 27.9625 23.8426 27.7608 23.541C27.559 23.2393 27.1509 23.1583 26.8492 23.3601C24.247 25.1006 22.6505 27.494 22.6505 31.0002C22.6505 33.088 23.0203 34.7946 23.3997 36.5449C23.9674 39.1641 24.3524 41.7777 24.2832 44.468C24.1992 47.7349 23.56 50.7201 22.3313 53.564C22.1873 53.8971 22.3407 54.2839 22.6739 54.4278C23.0071 54.5718 23.3938 54.4184 23.5378 54.0852C24.8369 51.0784 25.509 47.9266 25.5971 44.5018C25.6689 41.7062 25.2732 38.9892 24.6845 36.267C24.3042 34.509 23.9648 32.9394 23.9648 31.0002C23.9648 27.9961 25.2863 25.9866 27.5799 24.4525Z"}),t("path",{d:"M30.1447 22.1436C32.8717 21.5877 35.8061 22.2746 37.966 24.0228C41.8241 27.1455 42.3372 32.8403 42.753 37.4549L42.7742 37.69C43.3115 43.6385 42.6964 49.4163 41.4575 55.2186C41.3817 55.5736 41.0326 55.7999 40.6776 55.7241C40.3227 55.6483 40.0964 55.2991 40.1722 54.9442C41.3926 49.2288 41.9873 43.5885 41.4652 37.8082C41.4479 37.6169 41.4307 37.4228 41.4133 37.2264L41.4131 37.2235C41.0438 33.0534 40.5812 27.8304 37.1392 25.0444C35.2926 23.5498 32.7599 22.9518 30.4073 23.4314C30.0517 23.5039 29.7046 23.2744 29.6321 22.9188C29.5596 22.5632 29.7891 22.2161 30.1447 22.1436Z"}),t("path",{d:"M40.5287 58.4885C40.6183 58.1368 40.4057 57.7791 40.054 57.6896C39.7023 57.6 39.3446 57.8126 39.2551 58.1643C38.8578 59.7247 38.2456 61.1333 37.4695 62.4301C37.2831 62.7415 37.3844 63.145 37.6958 63.3314C38.0072 63.5178 38.4108 63.4165 38.5972 63.1051C39.4336 61.7075 40.0977 60.1816 40.5287 58.4885Z"}),t("path",{d:"M37.3152 48.9521C37.6756 48.9948 37.9332 49.3215 37.8906 49.682C37.2699 54.9267 35.8688 59.6042 33.6205 63.6613C33.4446 63.9787 33.0446 64.0934 32.7272 63.9175C32.4097 63.7416 32.295 63.3417 32.4709 63.0242C34.6226 59.1416 35.9811 54.6339 36.5854 49.5275C36.6281 49.1671 36.9548 48.9095 37.3152 48.9521Z"}),t("path",{d:"M37.1798 30.6556C36.7242 28.2212 34.6349 26.3591 32.0985 26.3591C28.6638 26.3591 26.254 29.8212 27.1032 33.0422C28.54 38.7279 28.7759 44.2077 27.8032 49.4855L27.8025 49.4893C26.9584 54.228 25.3374 58.4908 23.1263 62.1031C22.9368 62.4127 23.0342 62.8172 23.3437 63.0067C23.6533 63.1962 24.0578 63.0988 24.2473 62.7893C26.5488 59.0292 28.2249 54.6109 29.0961 49.7218C30.106 44.2403 29.8558 38.5684 28.3765 32.7168L28.3748 32.7099C27.7378 30.3005 29.5133 27.6734 32.0985 27.6734C33.9641 27.6734 35.5393 29.0459 35.8871 30.8929C36.8436 36.4411 37.3418 41.5862 36.9871 46.016C36.9581 46.3778 37.2279 46.6945 37.5897 46.7235C37.9515 46.7525 38.2682 46.4827 38.2972 46.1209C38.6649 41.5294 38.1459 36.2576 37.1815 30.6648C37.1809 30.6617 37.1804 30.6586 37.1798 30.6556Z"}),t("path",{d:"M30.1376 59.1171C30.4604 59.283 30.5876 59.6792 30.4217 60.002L28.6804 63.3906C28.5145 63.7134 28.1184 63.8406 27.7956 63.6747C27.4728 63.5088 27.3456 63.1127 27.5114 62.7899L29.2527 59.4013C29.4186 59.0785 29.8147 58.9513 30.1376 59.1171Z"}),t("path",{d:"M32.5872 31.2892C32.5042 30.9359 32.1505 30.7168 31.7972 30.7998C31.4439 30.8828 31.2247 31.2365 31.3077 31.5898C33.5238 41.0232 33.2194 49.3066 30.5201 56.363C30.3905 56.702 30.5602 57.0819 30.8991 57.2115C31.2381 57.3412 31.618 57.1715 31.7477 56.8326C34.5622 49.475 34.8483 40.9141 32.5872 31.2892Z"})]}),t("defs",{children:t("clipPath",{id:"clip0_113_33841",children:t("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]});let km=({passkeys:r,expanded:n,onUnlink:a,onExpand:i})=>{let[o,l]=d([]),s=n?r.length:2,c=e=>e.authenticatorName?e.createdWithBrowser?`${e.authenticatorName} on ${e.createdWithBrowser}`:e.authenticatorName:e.createdWithBrowser?e.createdWithOs?`${e.createdWithBrowser} on ${e.createdWithOs}`:`${e.createdWithBrowser}`:"Unknown device";return e("div",{children:[t(Fm,{children:"Your passkeys"}),e(Mm,{children:[r.slice(0,s).map((r=>e(Bm,{children:[e("div",{children:[t(Um,{children:c(r)}),e(Wm,{children:["Last used: ",(r.latestVerifiedAt??r.verifiedAt).toLocaleString()]})]}),t(zm,{disabled:o.includes(r.credentialId),onClick:()=>(async e=>{l((t=>t.concat([e]))),await a(e),l((t=>t.filter((t=>t!==e))))})(r.credentialId),children:o.includes(r.credentialId)?t(js,{}):t(un,{height:"1.6em"})})]},r.credentialId))),r.length>2&&!n&&t(Pm,{onClick:i,children:"View all"})]})]})},Nm=()=>e(Mm,{children:[e(Xd,{children:[t(Jd,{children:t(hn,{})}),"Log in with Touch ID, Face ID, or a security key."]}),e(Xd,{children:[t(Jd,{children:t(Lr,{})}),"More secure than a password."]}),e(Xd,{children:[t(Jd,{children:t(cn,{})}),"Takes seconds to set up and use."]})]});const Sm=tr.div`
|
|
1770
|
-
display: flex;
|
|
1771
|
-
align-items: center;
|
|
1772
|
-
justify-content: center;
|
|
1773
|
-
width: 180px;
|
|
1774
|
-
height: 90px;
|
|
1775
|
-
border-radius: 50%;
|
|
1776
|
-
svg + svg {
|
|
1777
|
-
margin-left: 12px;
|
|
1778
|
-
}
|
|
1779
|
-
> svg {
|
|
1780
|
-
z-index: 2;
|
|
1781
|
-
color: var(--privy-color-accent) !important;
|
|
1782
|
-
stroke: var(--privy-color-accent) !important;
|
|
1783
|
-
fill: var(--privy-color-accent) !important;
|
|
1784
|
-
}
|
|
1785
|
-
`;let Im=tr.div`
|
|
1786
|
-
line-height: 20px;
|
|
1787
|
-
height: 20px;
|
|
1788
|
-
font-size: 13px;
|
|
1789
|
-
color: ${e=>e.$fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
|
|
1790
|
-
display: flex;
|
|
1791
|
-
justify-content: flex-beginngin;
|
|
1792
|
-
width: 100%;
|
|
1793
|
-
`,Om=rr`
|
|
1794
|
-
&& {
|
|
1795
|
-
width: 100%;
|
|
1796
|
-
font-size: 0.875rem;
|
|
1797
|
-
line-height: 1rem;
|
|
1798
|
-
|
|
1799
|
-
/* Tablet and Up */
|
|
1800
|
-
@media (min-width: 440px) {
|
|
1801
|
-
font-size: 14px;
|
|
1802
|
-
}
|
|
1803
|
-
|
|
1804
|
-
display: flex;
|
|
1805
|
-
gap: 12px;
|
|
1806
|
-
justify-content: center;
|
|
1807
|
-
|
|
1808
|
-
padding: 6px 8px;
|
|
1809
|
-
background-color: var(--privy-color-background);
|
|
1810
|
-
transition: background-color 200ms ease;
|
|
1811
|
-
color: var(--privy-color-accent) !important;
|
|
1812
|
-
|
|
1813
|
-
:focus {
|
|
1814
|
-
outline: none;
|
|
1815
|
-
box-shadow: none;
|
|
1816
|
-
}
|
|
1817
|
-
}
|
|
1818
|
-
`;const Pm=tr.button`
|
|
1819
|
-
${Om}
|
|
1820
|
-
`;let Mm=tr.div`
|
|
1821
|
-
display: flex;
|
|
1822
|
-
flex-direction: column;
|
|
1823
|
-
align-items: stretch;
|
|
1824
|
-
gap: 0.8rem;
|
|
1825
|
-
padding: 0.5rem 0rem 0rem;
|
|
1826
|
-
flex-grow: 1;
|
|
1827
|
-
width: 100%;
|
|
1828
|
-
`,Rm=tr.div`
|
|
1829
|
-
font-size: 18px;
|
|
1830
|
-
line-height: 18px;
|
|
1831
|
-
text-align: center;
|
|
1832
|
-
font-weight: 600;
|
|
1833
|
-
`,Lm=tr.div`
|
|
1834
|
-
font-size: 0.875rem;
|
|
1835
|
-
text-align: center;
|
|
1836
|
-
margin-top: 10px;
|
|
1837
|
-
`,Dm=tr.div`
|
|
1838
|
-
height: 32px;
|
|
1839
|
-
`,Fm=tr.div`
|
|
1840
|
-
line-height: 20px;
|
|
1841
|
-
height: 20px;
|
|
1842
|
-
font-size: 1em;
|
|
1843
|
-
font-weight: 450;
|
|
1844
|
-
display: flex;
|
|
1845
|
-
justify-content: flex-beginning;
|
|
1846
|
-
width: 100%;
|
|
1847
|
-
`,Um=tr.div`
|
|
1848
|
-
font-size: 1em;
|
|
1849
|
-
line-height: 1.3em;
|
|
1850
|
-
font-weight: 500;
|
|
1851
|
-
color: var(--privy-color-foreground-2);
|
|
1852
|
-
padding: 0.2em 0;
|
|
1853
|
-
`,Wm=tr.div`
|
|
1854
|
-
font-size: 0.875rem;
|
|
1855
|
-
line-height: 1rem;
|
|
1856
|
-
color: #64668b;
|
|
1857
|
-
padding: 0.2em 0;
|
|
1858
|
-
`,Bm=tr.div`
|
|
1859
|
-
display: flex;
|
|
1860
|
-
align-items: center;
|
|
1861
|
-
justify-content: space-between;
|
|
1862
|
-
padding: 1em;
|
|
1863
|
-
gap: 10px;
|
|
1864
|
-
font-size: 0.875rem;
|
|
1865
|
-
line-height: 1rem;
|
|
1866
|
-
text-align: left;
|
|
1867
|
-
border-radius: 8px;
|
|
1868
|
-
border: 1px solid #e2e3f0 !important;
|
|
1869
|
-
width: 100%;
|
|
1870
|
-
height: 5em;
|
|
1871
|
-
`,jm=rr`
|
|
1872
|
-
:focus,
|
|
1873
|
-
:hover,
|
|
1874
|
-
:active {
|
|
1875
|
-
outline: none;
|
|
1876
|
-
}
|
|
1877
|
-
display: flex;
|
|
1878
|
-
width: 2em;
|
|
1879
|
-
height: 2em;
|
|
1880
|
-
justify-content: center;
|
|
1881
|
-
align-items: center;
|
|
1882
|
-
svg {
|
|
1883
|
-
color: var(--privy-color-error);
|
|
1884
|
-
}
|
|
1885
|
-
svg:hover {
|
|
1886
|
-
color: var(--privy-color-foreground-3);
|
|
1887
|
-
}
|
|
1888
|
-
`,zm=tr.button`
|
|
1889
|
-
${jm}
|
|
1890
|
-
`;const Gm=tr.div`
|
|
1891
|
-
display: flex;
|
|
1892
|
-
flex-direction: column;
|
|
1893
|
-
gap: 12px;
|
|
1894
|
-
padding-top: 24px;
|
|
1895
|
-
padding-bottom: 24px;
|
|
1896
|
-
`,Hm=tr.div`
|
|
1897
|
-
width: 24px;
|
|
1898
|
-
height: 24px;
|
|
1899
|
-
display: flex;
|
|
1900
|
-
justify-content: center;
|
|
1901
|
-
align-items: center;
|
|
1902
|
-
|
|
1903
|
-
svg {
|
|
1904
|
-
border-radius: var(--privy-border-radius-sm);
|
|
1905
|
-
}
|
|
1906
|
-
`,Vm=tr.div`
|
|
1907
|
-
display: flex;
|
|
1908
|
-
flex-direction: column;
|
|
1909
|
-
justify-content: center;
|
|
1910
|
-
align-items: center;
|
|
1911
|
-
gap: 8px;
|
|
1912
|
-
`,qm=tr.div`
|
|
1913
|
-
display: flex;
|
|
1914
|
-
align-items: baseline;
|
|
1915
|
-
gap: 4px;
|
|
1916
|
-
`,Zm=tr.div`
|
|
1917
|
-
font-size: 42px !important;
|
|
1918
|
-
`,Km=tr.input`
|
|
1919
|
-
font-size: 42px !important;
|
|
1920
|
-
text-align: right;
|
|
1921
|
-
background-color: var(--privy-color-background);
|
|
1922
|
-
|
|
1923
|
-
// HACK: The only way this is centerable is to set a content-based width.
|
|
1924
|
-
// The --funding-input-length is updated via the component.
|
|
1925
|
-
// Note that 'ch' has 98.25% global browser adoption
|
|
1926
|
-
width: calc(1ch * var(--funding-input-length));
|
|
1927
|
-
|
|
1928
|
-
&:focus {
|
|
1929
|
-
outline: none !important;
|
|
1930
|
-
border: none !important;
|
|
1931
|
-
box-shadow: none !important;
|
|
1932
|
-
}
|
|
1933
|
-
`,Ym=tr.button`
|
|
1934
|
-
cursor: pointer;
|
|
1935
|
-
padding-left: 4px;
|
|
1936
|
-
`,Qm=tr.div`
|
|
1937
|
-
font-size: 18px;
|
|
1938
|
-
`,Jm=tr.div`
|
|
1939
|
-
font-size: 12px;
|
|
1940
|
-
color: var(--privy-color-foreground-3);
|
|
1941
|
-
// we need this container to maintain a static height if there's no content
|
|
1942
|
-
height: 20px;
|
|
1943
|
-
`;tr.div`
|
|
1944
|
-
display: flex;
|
|
1945
|
-
flex-direction: row;
|
|
1946
|
-
line-height: 22px;
|
|
1947
|
-
font-size: 16px;
|
|
1948
|
-
text-align: center;
|
|
1949
|
-
svg {
|
|
1950
|
-
margin-right: 6px;
|
|
1951
|
-
margin: auto;
|
|
1952
|
-
}
|
|
1953
|
-
`,tr(Pm)`
|
|
1954
|
-
margin-top: 16px;
|
|
1955
|
-
`;let Xm=nr`
|
|
1956
|
-
from {
|
|
1957
|
-
opacity: 0;
|
|
1958
|
-
}
|
|
1959
|
-
to {
|
|
1960
|
-
opacity: 1;
|
|
1961
|
-
}
|
|
1962
|
-
`;tr(Js)`
|
|
1963
|
-
border-radius: var(--privy-border-radius-md) !important;
|
|
1964
|
-
animation: ${Xm} 0.3s ease-in-out;
|
|
1965
|
-
`;const ef=tr.div``,tf=tr.a`
|
|
1966
|
-
&& {
|
|
1967
|
-
color: var(--privy-color-accent);
|
|
1968
|
-
}
|
|
1969
|
-
|
|
1970
|
-
cursor: pointer;
|
|
1971
|
-
`,rf=({displayName:n,errorMessage:a,configuredFundingChain:i,formattedBalance:o,fundingAmount:l,fundingCurrency:s,fundingAmountInUsd:d,options:c,selectedOption:u,isPreparing:h,isSubmitting:p,onSubmit:m,onSelect:f})=>e(r,{children:[t(Np,{}),t(Tc,{}),t(lh,{children:"Transfer from another network"}),e(oh,{children:["You need more funds on the ",i.name," network. Bridge from another blockchain network."]}),e(Vm,{style:{marginTop:"2rem"},children:[e(qm,{children:[t(Zm,{children:l}),t(Qm,{children:s})]}),d&&t(Jm,{children:d})]}),t(tm,{style:{marginTop:"1.5rem"},children:t(rm,{children:"From"})}),t(pm,{selected:{chain:u.chain,balance:$m(u.balance,u.chain.nativeCurrency.symbol,3,!0)},options:c.map((({chain:e,balance:t})=>({chain:e,balance:$m(t,e.nativeCurrency.symbol,3,!0)}))),onSelect:f}),t(tm,{children:t(rm,{style:{marginTop:"1.5rem"},children:"To"})}),t(sm,{chain:i,balance:o}),t(Nu,{style:{marginTop:"1rem"},children:a}),e(Vs,{style:{marginTop:"1rem"},loading:p||h,disabled:h||p,onClick:m,children:["Confirm with ",n]}),t(Ac,{}),t(Nd,{})]}),nf=({wallet:n,displayName:a,addressToFund:i,chainId:o,chainName:l,isBridging:s,isErc20Flow:d,totalPriceInNativeCurrency:c,totalPriceInUsd:u,gasPriceInNativeCurrency:h,gasPriceInUsd:p})=>e(r,{children:[t(Np,{}),t(Sp,{}),t(yc,{style:{marginTop:"16px"},children:t(Kc,{icon:ru(n.walletClientType,n.connectorType,n.walletClientType),name:n.walletClientType})}),t(Ic,{style:{marginTop:"8px",marginBottom:"12px"},title:`${s?"Bridging":"Confirming"} with ${a}`}),!s&&!d&&e(em,{children:[e(tm,{children:[t(rm,{children:"Total"}),t(am,{children:u||c})]}),e(tm,{children:[t(rm,{children:"To"}),t(am,{children:t(Id,{address:i,showCopyIcon:!1})})]}),e(tm,{children:[t(rm,{children:"Network"}),t(am,{children:e(af,{children:[t(lm,{chainId:o,height:16,width:16})," ",l]})})]}),h&&e(tm,{children:[t(rm,{children:"Estimated fee"}),t(am,{children:p||h})]})]}),t(_c,{height:24}),t(Nd,{})]});let af=tr.div`
|
|
1972
|
-
display: flex;
|
|
1973
|
-
flex-direction: row;
|
|
1974
|
-
align-items: center;
|
|
1975
|
-
gap: 4px;
|
|
1976
|
-
`;const of=[{constant:!1,inputs:[{name:"_to",type:"address"},{name:"_value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}];let lf=2n**256n-1n;const sf=({amount:e,decimals:t})=>e===lf?"Maximum":Intl.NumberFormat(void 0,{maximumFractionDigits:t}).format(Number(e)/10**t),df=async({chain:e,address:t,appId:r,rpcConfig:n,erc20Address:a})=>{let i=Fr({chain:e,transport:Ur(Je(e,n,r))});return{balance:await i.readContract({address:a,abi:cf,functionName:"balanceOf",args:[t]}).catch((()=>0n)),chain:e}};let cf=[{constant:!0,inputs:[{name:"_owner",type:"address"}],name:"balanceOf",outputs:[{name:"balance",type:"uint256"}],payable:!1,stateMutability:"view",type:"function"}];let uf=({status:n,onClickCta:a})=>{let{title:i,body:o,cta:l}=c((()=>(e=>{switch(e){case"success":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"pending-after-flow":return{title:"In Progress",body:"Almost done. Retrieving transaction status from Coinbase",cta:""};case"error":case"pending-in-flow":return{title:"In Progress",body:"Go back to Coinbase Onramp to finish funding your account.",cta:""}}})(n)),[n]);return e(r,{children:[e(mf,{children:[t(hf,{isSucccess:"success"===n}),e(Ec,{children:[t("h3",{children:i}),t(pf,{children:o})]})]}),l&&t(Hs,{onClick:a,children:l})]})},hf=({isSucccess:r})=>{if(!r){let r="var(--privy-color-foreground-4)";return e("div",{style:{position:"relative"},children:[t(Ws,{color:r,style:{position:"absolute"}}),t(Bs,{color:r}),t(jl,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let n=(e=>e?vr:()=>t(pn,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}))(r),a=(e=>e?"var(--privy-color-success)":"var(--privy-color-foreground-4)")(r);return t("div",{style:{borderColor:a,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:n&&t(n,{width:"4rem",height:"4rem",color:a})})},pf=tr.p`
|
|
1977
|
-
font-size: 1rem;
|
|
1978
|
-
color: var(--privy-color-foreground-3);
|
|
1979
|
-
margin-bottom: 1rem;
|
|
1980
|
-
display: flex;
|
|
1981
|
-
flex-direction: column;
|
|
1982
|
-
gap: 1rem;
|
|
1983
|
-
`,mf=tr.div`
|
|
1984
|
-
display: flex;
|
|
1985
|
-
flex-direction: column;
|
|
1986
|
-
align-items: center;
|
|
1987
|
-
justify-content: center;
|
|
1988
|
-
margin-left: 1.75rem;
|
|
1989
|
-
margin-right: 1.75rem;
|
|
1990
|
-
padding: 2rem 0;
|
|
1991
|
-
`;const ff=({children:r,theme:n})=>e(gf,{$theme:n,children:[t(dr,{width:"3rem",color:"var(--privy-color-error)"}),r]});let gf=tr.div`
|
|
1992
|
-
display: flex;
|
|
1993
|
-
gap: 0.5rem;
|
|
1994
|
-
|
|
1995
|
-
${e=>"dark"===e.$theme?"color: var(--privy-color-error);":"background-color: var(--privy-color-error-light);"}
|
|
1996
|
-
|
|
1997
|
-
align-items: flex-start;
|
|
1998
|
-
text-align: left;
|
|
1999
|
-
padding: 0.5rem 0.75rem;
|
|
2000
|
-
|
|
2001
|
-
font-size: 0.75rem;
|
|
2002
|
-
font-weight: 400;
|
|
2003
|
-
line-height: 1.125rem; /* 150% */
|
|
2004
|
-
|
|
2005
|
-
padding: 0.5rem 0.75rem;
|
|
2006
|
-
|
|
2007
|
-
&& {
|
|
2008
|
-
border: 1px solid var(--privy-color-error);
|
|
2009
|
-
border-radius: var(--privy-border-radius-sm);
|
|
2010
|
-
}
|
|
2011
|
-
`;const yf=({children:r,theme:n})=>e(wf,{$theme:n,children:[t(yn,{width:"1.25rem",color:"dark"===n?"var(--privy-color-accent-light)":"var(--privy-color-accent-dark)",style:{minWidth:"1.25rem"}}),r]});let wf=tr.div`
|
|
2012
|
-
display: flex;
|
|
2013
|
-
gap: 0.5rem;
|
|
2014
|
-
background-color: ${e=>"dark"===e.$theme?"var(--privy-color-accent-darkest)":"var(--privy-color-accent-lightest)"};
|
|
2015
|
-
|
|
2016
|
-
color: var(--privy-color-foreground);
|
|
2017
|
-
|
|
2018
|
-
align-items: flex-start;
|
|
2019
|
-
text-align: left;
|
|
2020
|
-
|
|
2021
|
-
font-size: 0.8125rem;
|
|
2022
|
-
font-weight: 400;
|
|
2023
|
-
line-height: 1.125rem; /* 150% */
|
|
2024
|
-
|
|
2025
|
-
padding: 0.75rem;
|
|
2026
|
-
|
|
2027
|
-
&& {
|
|
2028
|
-
border-radius: var(--privy-border-radius-sm);
|
|
2029
|
-
border: 1px solid var(--privy-color-accent);
|
|
2030
|
-
}
|
|
2031
|
-
`;const vf=e=>t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 210.2",xmlSpace:"preserve",...e,children:t("path",{d:"M93.6,27.1C87.6,34.2,78,39.8,68.4,39c-1.2-9.6,3.5-19.8,9-26.1c6-7.3,16.5-12.5,25-12.9 C103.4,10,99.5,19.8,93.6,27.1 M102.3,40.9c-13.9-0.8-25.8,7.9-32.4,7.9c-6.7,0-16.8-7.5-27.8-7.3c-14.3,0.2-27.6,8.3-34.9,21.2 c-15,25.8-3.9,64,10.6,85c7.1,10.4,15.6,21.8,26.8,21.4c10.6-0.4,14.8-6.9,27.6-6.9c12.9,0,16.6,6.9,27.8,6.7 c11.6-0.2,18.9-10.4,26-20.8c8.1-11.8,11.4-23.3,11.6-23.9c-0.2-0.2-22.4-8.7-22.6-34.3c-0.2-21.4,17.5-31.6,18.3-32.2 C123.3,42.9,107.7,41.3,102.3,40.9 M182.6,11.9v155.9h24.2v-53.3h33.5c30.6,0,52.1-21,52.1-51.4c0-30.4-21.1-51.2-51.3-51.2H182.6z M206.8,32.3h27.9c21,0,33,11.2,33,30.9c0,19.7-12,31-33.1,31h-27.8V32.3z M336.6,169c15.2,0,29.3-7.7,35.7-19.9h0.5v18.7h22.4V90.2 c0-22.5-18-37-45.7-37c-25.7,0-44.7,14.7-45.4,34.9h21.8c1.8-9.6,10.7-15.9,22.9-15.9c14.8,0,23.1,6.9,23.1,19.6v8.6l-30.2,1.8 c-28.1,1.7-43.3,13.2-43.3,33.2C298.4,155.6,314.1,169,336.6,169z M343.1,150.5c-12.9,0-21.1-6.2-21.1-15.7c0-9.8,7.9-15.5,23-16.4 l26.9-1.7v8.8C371.9,140.1,359.5,150.5,343.1,150.5z M425.1,210.2c23.6,0,34.7-9,44.4-36.3L512,54.7h-24.6l-28.5,92.1h-0.5 l-28.5-92.1h-25.3l41,113.5l-2.2,6.9c-3.7,11.7-9.7,16.2-20.4,16.2c-1.9,0-5.6-0.2-7.1-0.4v18.7C417.3,210,423.3,210.2,425.1,210.2z"})}),Cf=r=>e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 80 38.1",xmlSpace:"preserve",...r,children:[t("path",{style:{fill:"#5F6368"},d:"M37.8,19.7V29h-3V6h7.8c1.9,0,3.7,0.7,5.1,2c1.4,1.2,2.1,3,2.1,4.9c0,1.9-0.7,3.6-2.1,4.9c-1.4,1.3-3.1,2-5.1,2 L37.8,19.7L37.8,19.7z M37.8,8.8v8h5c1.1,0,2.2-0.4,2.9-1.2c1.6-1.5,1.6-4,0.1-5.5c0,0-0.1-0.1-0.1-0.1c-0.8-0.8-1.8-1.3-2.9-1.2 L37.8,8.8L37.8,8.8z"}),t("path",{style:{fill:"#5F6368"},d:"M56.7,12.8c2.2,0,3.9,0.6,5.2,1.8s1.9,2.8,1.9,4.8V29H61v-2.2h-0.1c-1.2,1.8-2.9,2.7-4.9,2.7 c-1.7,0-3.2-0.5-4.4-1.5c-1.1-1-1.8-2.4-1.8-3.9c0-1.6,0.6-2.9,1.8-3.9c1.2-1,2.9-1.4,4.9-1.4c1.8,0,3.2,0.3,4.3,1v-0.7 c0-1-0.4-2-1.2-2.6c-0.8-0.7-1.8-1.1-2.9-1.1c-1.7,0-3,0.7-3.9,2.1l-2.6-1.6C51.8,13.8,53.9,12.8,56.7,12.8z M52.9,24.2 c0,0.8,0.4,1.5,1,1.9c0.7,0.5,1.5,0.8,2.3,0.8c1.2,0,2.4-0.5,3.3-1.4c1-0.9,1.5-2,1.5-3.2c-0.9-0.7-2.2-1.1-3.9-1.1 c-1.2,0-2.2,0.3-3,0.9C53.3,22.6,52.9,23.3,52.9,24.2z"}),t("path",{style:{fill:"#5F6368"},d:"M80,13.3l-9.9,22.7h-3l3.7-7.9l-6.5-14.7h3.2l4.7,11.3h0.1l4.6-11.3H80z"}),t("path",{style:{fill:"#4285F4"},d:"M25.9,17.7c0-0.9-0.1-1.8-0.2-2.7H13.2v5.1h7.1c-0.3,1.6-1.2,3.1-2.6,4v3.3H22C24.5,25.1,25.9,21.7,25.9,17.7z"}),t("path",{style:{fill:"#34A853"},d:"M13.2,30.6c3.6,0,6.6-1.2,8.8-3.2l-4.3-3.3c-1.2,0.8-2.7,1.3-4.5,1.3c-3.4,0-6.4-2.3-7.4-5.5H1.4v3.4 C3.7,27.8,8.2,30.6,13.2,30.6z"}),t("path",{style:{fill:"#FBBC04"},d:"M5.8,19.9c-0.6-1.6-0.6-3.4,0-5.1v-3.4H1.4c-1.9,3.7-1.9,8.1,0,11.9L5.8,19.9z"}),t("path",{style:{fill:"#EA4335"},d:"M13.2,9.4c1.9,0,3.7,0.7,5.1,2l0,0l3.8-3.8c-2.4-2.2-5.6-3.5-8.8-3.4c-5,0-9.6,2.8-11.8,7.3l4.4,3.4 C6.8,11.7,9.8,9.4,13.2,9.4z"})]}),bf=e=>{let[t,r]=d();return p((()=>{e().then((e=>{r(e)})).catch((()=>{}))}),[]),t},Ef=({...r})=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...r,children:[t("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),t("path",{d:"M3 9a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2"}),t("path",{d:"M3 11h3c.8 0 1.6.3 2.1.9l1.1.9c1.6 1.6 4.1 1.6 5.7 0l1.1-.9c.5-.5 1.3-.9 2.1-.9H21"})]}),$f=async({address:e,chain:t,rpcConfig:r,privyAppId:n})=>{try{let a=Fr({chain:t,transport:Ur(Je(t,r,n))}),[i,o]=await Promise.all([a.readContract({abi:Tf,address:e,functionName:"symbol"}),a.readContract({abi:Tf,address:e,functionName:"decimals"})]);return{decimals:o,symbol:i}}catch(e){return console.log(e),null}};let Tf=[{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}],Af=new Set([at.id,tt.id,it.id,ot.id,Xe.id]),xf=new Set([at.id,tt.id,ot.id,it.id]);const _f=()=>window.open(void 0,void 0,kf({w:440,h:680}));let kf=({w:e,h:t})=>{let r=void 0!==window.screenLeft?window.screenLeft:window.screenX,n=void 0!==window.screenTop?window.screenTop:window.screenY,a=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,i=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height;return`toolbar=0,location=0,menubar=0,height=${t},width=${e},popup=1,left=${(a-e)/2/(a/window.screen.availWidth)+r},top=${(i-t)/2/(i/window.screen.availHeight)+n}`};let Nf={[at.id]:"ethereum",[tt.id]:"base",[it.id]:"optimism",[ot.id]:"polygon",[Xe.id]:"arbitrum"};const Sf=(e,t,r,n,a,i)=>new Promise((async(o,l)=>{let s=_f();if(!s)return void l(Error("Unable to initialize flow"));let d="ethereum"===t.chainType?function(e){let t=Nf[e];if(!t)throw new E(`Unsupported chainId: ${e} for Coinbase Onramp`);return t}(t.chain.id):"solana",c=t.isUSDC?"USDC":"ethereum"===t.chainType?"ETH":"SOL",u=await e.initCoinbaseOnRamp({addresses:[{address:t.address,blockchains:[d]}],assets:[c]}),{url:h}=function({input:e,amount:t,blockchain:r,asset:n,experience:a}){let i=new URL("https://pay.coinbase.com/buy/select-asset");return i.searchParams.set("appId",e.app_id),i.searchParams.set("sessionToken",e.session_token),i.searchParams.set("defaultExperience",a),i.searchParams.set("presetCryptoAmount",t.startsWith(".")?`0${t}`:t),i.searchParams.set("defaultNetwork",r),i.searchParams.set("defaultPaymentMethod",Mo[a]),i.searchParams.set("defaultAsset",Ro[n]),i.searchParams.set("partnerUserId",e.partner_user_id),{url:i}}({input:u,amount:t.amount,blockchain:d,asset:c,experience:i});s.location=h.toString();let p={...a?.funding,showAlternateFundingMethod:!0};t.usingDefaultFundingMethod&&(p.usingDefaultFundingMethod=!1),r({funding:p,coinbaseOnrampStatus:{popup:s}}),n(We.COINBASE_ONRAMP_STATUS_SCREEN),e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp",value:t.amount,chainType:t.chainType,chainId:"ethereum"===t.chainType?t.chain.id:t.cluster.name}}),setTimeout((()=>{r({funding:p,coinbaseOnrampStatus:{partnerUserId:u.partner_user_id,popup:s}})}),5e3),o()})),If="moonpay";let Of=new Set([at.id,Xe.id,tt.id,ot.id]),Pf=new Set([at.id,Xe.id,it.id,tt.id,ot.id]);function Mf(e){return parseFloat(e)}function Rf(e){return!!e&&void 0!==e.config&&void 0!==e.provider}function Lf(e){return!!e&&(void 0!==e.chain||void 0!==e.amount)}function Df(e,t=!1){let[r,n]=d(null),{createAnalyticsEvent:a}=P(),{data:i,navigate:o,setModalData:l}=ye(),c=i?.funding,u=s(0);return p((()=>{let r=setInterval((async()=>{if(e)try{let[i]=await async function(e,t){return wn(`${t?ft:gt}/transactions/ext/${e}`,{query:{apiKey:t?yt:wt}})}(e,t),s="waitingAuthorization"===i.status&&"credit_debit_card"===i.paymentMethod?"pending":i.status;if(["failed","completed","awaitingAuthorization"].includes(s)&&(a({eventName:Dp,payload:{status:s,provider:If,paymentMethod:i.paymentMethod,cardPaymentType:i.cardPaymentType,currency:i.currency?.code,baseCurrencyAmount:i.baseCurrencyAmount,quoteCurrencyAmount:i.quoteCurrencyAmount,feeAmount:i.feeAmount,extraFeeAmount:i.extraFeeAmount,networkFeeAmount:i.networkFeeAmount,isSandbox:t}}),clearInterval(r)),"failed"===s||"serviceFailure"===s)return l({funding:{...c,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),void o(We.FUNDING_METHOD_SELECTION_SCREEN);n(s)}catch(e){404!==e.response?.status&&(u.current+=1),u.current>=3&&(a({eventName:Dp,payload:{status:"serviceFailure",provider:If}}),clearInterval(r),l({funding:{...c,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),o(We.FUNDING_METHOD_SELECTION_SCREEN))}}),3e3);return()=>clearInterval(r)}),[e,u]),r}const Ff=async(e,t,r,n,a,i,o,l)=>{let s=_f();if(!s)throw Error("Unable to initialize flow");let d="ethereum"===t.chainType?t.moonpayConfigOverride?.currencyCode??function(e,t){switch(e){case Xe.id:return"native-currency"===t?"ETH_ARBITRUM":"USDC_ARBITRUM";case 43114:return"AVAX_CCHAIN";case tt.id:return"native-currency"===t?"ETH_BASE":"USDC_BASE";case rt.id:return"CELO_CELO";case ot.id:return"native-currency"===t?"MATIC_POLYGON":"USDC_POLYGON";case at.id:return"native-currency"===t?"ETH_ETHEREUM":"USDC_ETHEREUM";default:return console.warn(`Chain ${e} not supported by Moonpay, defaulting to Ethereum mainnet`),"ETH_ETHEREUM"}}(t.chain.id,n):"SOL",{signedUrl:c,externalTransactionId:u}=await e.signMoonpayOnRampUrl({address:t.address,useSandbox:r.fundingMethodConfig.moonpay.useSandbox??!1,config:{uiConfig:{accentColor:r.appearance.palette.accent,theme:r.appearance.palette.colorScheme},...t.moonpayConfigOverride,paymentMethod:l,currencyCode:d,quoteCurrencyAmount:t.moonpayConfigOverride?.quoteCurrencyAmount??Mf(t.amount)}});e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"moonpay",value:t.amount,chainType:t.chainType,chainId:"ethereum"===t.chainType?t.chain.id:t.cluster.name}}),s.location=c;let h={...o?.funding,showAlternateFundingMethod:!0};t.usingDefaultFundingMethod&&(h.usingDefaultFundingMethod=!1),a({moonpayStatus:{},funding:h}),i(We.MOONPAY_STATUS_SCREEN),setTimeout((()=>{a({moonpayStatus:{externalTransactionId:u},funding:h})}),8e3)},Uf=(e,t,r,n,a,i)=>{let o,l,s="solana"===r.chainType,d=s?void 0:r,c=r.isUSDC?"USDC":d?.erc20Address?void 0:"native-currency",u=!!s||c&&((e,t)=>{switch(t){case"native-currency":return Of.has(e);case"USDC":return Pf.has(e);default:return console.warn("Unknown asset passed to MoonPay Onramp"),!1}})(Number(r.chain.id),c),h=!!s||c&&((e,t)=>{switch(t){case"native-currency":return Af.has(e);case"USDC":return xf.has(e);default:return console.warn("Unknown asset passed to Coinbase Onramp"),!1}})(Number(r.chain.id),c),p=[];for(let o of(r.preferredCardProvider&&r.supportedOptions.sort((e=>e.provider===r.preferredCardProvider?-1:1)),r.supportedOptions))"card"===o.method&&"coinbase"===o.provider&&h&&p.push((()=>Sf(t,r,n,a,i,"buy"))),"card"===o.method&&"moonpay"===o.provider&&u&&c&&p.push((()=>Ff(t,r,e,c,n,a,i,"credit_debit_card")));for(let e of r.supportedOptions)"exchange"===e.method&&"coinbase"===e.provider&&h&&(o=()=>Sf(t,r,n,a,i,"buy"));for(let e of i?.funding?.supportedOptions??[])"wallets"===e.method&&(l=()=>a(We.FUNDING_TRANSFER_FROM_WALLET_SCREEN));return{onFundWithCard:p,onFundWithExchange:o,onFundWithWallet:l}};let Wf=async e=>"undefined"!=typeof window&&"PaymentRequest"in window&&await new window.PaymentRequest([{supportedMethods:e}],{id:"0",total:{label:"Item",amount:{currency:"USD",value:"1.00"}}}).canMakePayment();const Bf=()=>Wf("https://apple.com/apple-pay"),jf=()=>Wf("https://google.com/pay");function zf({rpcConfig:e,appId:t,address:r,chain:n}){let{chains:a}=P(),[i,o]=d(0n),[l,s]=d(!1),u=c((()=>{let r=n||a[0];if(r)return Fr({chain:n,transport:Ur(Je(r,e,t))})}),[n,e,t]),h=m((async()=>{if(!r||!u)return;s(!0);let e=await u.getBalance({address:r}).catch(console.error);return e?(o(e),s(!1),e):void 0}),[u,r,o]);return p((()=>{h().catch(console.error)}),[]),{balance:i,isLoading:l,reloadBalance:h}}let Gf=({...e})=>t(ts,{color:"black",...e}),Hf={devnet:"Devnet","mainnet-beta":"Solana",testnet:"Testnet"};const Vf=({size:r=61,...n})=>t("svg",{width:r,height:r,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:e("g",{id:"moonpay_symbol_wht 2",children:[t("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),t("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});let qf=({status:n,onClickCta:a})=>{let{title:i,body:o,cta:l}=c((()=>(e=>{switch(e){case"completed":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"waitingAuthorization":return{title:"Processing payment",body:"This may take up to a few hours. You will receive an email when the purchase is complete.",cta:"Continue"};default:return{title:"In Progress",body:"Go back to MoonPay to finish funding your account.",cta:""}}})(n)),[n]);return e(r,{children:[e(Yf,{children:[t(Zf,{status:n}),e(Ec,{children:[t("h3",{children:i}),t(Kf,{children:o})]})]}),l&&t(Hs,{onClick:a,children:l})]})},Zf=({status:r})=>{if(!r||"pending"===r){let r="var(--privy-color-foreground-4)";return e("div",{style:{position:"relative"},children:[t(Ws,{color:r,style:{position:"absolute"}}),t(Bs,{color:r}),t(Vf,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let n=(e=>{switch(e){case"completed":return vr;case"waitingAuthorization":return()=>t(pn,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}});default:return}})(r),a=(e=>e?{completed:"var(--privy-color-success)",failed:"var(--privy-color-error)",serviceFailure:"var(--privy-color-error)",waitingAuthorization:"var(--privy-color-accent)",pending:"var(--privy-color-foreground-4)"}[e]:"var(--privy-color-foreground-4)")(r);return t("div",{style:{borderColor:a,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:n&&t(n,{width:"4rem",height:"4rem",color:a})})},Kf=tr.p`
|
|
2032
|
-
font-size: 1rem;
|
|
2033
|
-
color: var(--privy-color-foreground-3);
|
|
2034
|
-
margin-bottom: 1rem;
|
|
2035
|
-
display: flex;
|
|
2036
|
-
flex-direction: column;
|
|
2037
|
-
gap: 1rem;
|
|
2038
|
-
`,Yf=tr.div`
|
|
2039
|
-
display: flex;
|
|
2040
|
-
flex-direction: column;
|
|
2041
|
-
align-items: center;
|
|
2042
|
-
justify-content: center;
|
|
2043
|
-
margin-left: 1.75rem;
|
|
2044
|
-
margin-right: 1.75rem;
|
|
2045
|
-
padding: 2rem 0;
|
|
2046
|
-
`;const Qf=({onClick:r,text:n})=>e(Cd,{onClick:r,children:[t(cr,{}),t(md,{children:n}),t(vn,{})]});let Jf=({onClick:r,icon:n,name:a})=>e(Cd,{onClick:r,children:[t(Hm,{style:{width:20},children:t("img",{src:n})}),a,t(Jc,{color:"gray",style:{marginLeft:"auto"},children:"Connected"})]});let Xf=tr.div`
|
|
2047
|
-
border-radius: 50%;
|
|
2048
|
-
height: 68px;
|
|
2049
|
-
width: 68px;
|
|
2050
|
-
display: flex;
|
|
2051
|
-
align-items: center;
|
|
2052
|
-
justify-content: center;
|
|
2053
|
-
background-color: var(--privy-color-accent);
|
|
2054
|
-
color: white;
|
|
2055
|
-
margin: 0 auto 24px auto;
|
|
2056
|
-
`;const eg=({style:e,...r})=>t("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"17",height:"17",viewBox:"0 0 17 17",style:{height:"1.25rem",width:"1.25rem",...e},...r,children:t("path",{strokeLinecap:"round",strokeLinejoin:"round",fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 8.67993C16.5 9.82986 15.853 10.8287 14.9032 11.3322C15.2188 12.3599 14.97 13.5237 14.1569 14.3368C13.3437 15.1499 12.18 15.3987 11.1523 15.0831C10.6488 16.0329 9.64993 16.6799 8.5 16.6799C7.35007 16.6799 6.35126 16.0329 5.84771 15.0831C4.82003 15.3987 3.65627 15.1499 2.84314 14.3368C2.03001 13.5237 1.78124 12.3599 2.09681 11.3322C1.14699 10.8287 0.5 9.82986 0.5 8.67993C0.5 7.53 1.14699 6.53119 2.0968 6.02764C1.78125 4.99996 2.03003 3.83621 2.84315 3.02309C3.65627 2.20997 4.82002 1.96119 5.8477 2.27675C6.35125 1.32692 7.35007 0.679932 8.5 0.679932C9.64992 0.679932 10.6487 1.32691 11.1523 2.27672C12.18 1.96115 13.3437 2.20993 14.1569 3.02305C14.97 3.83618 15.2188 4.99996 14.9032 6.02764C15.853 6.53119 16.5 7.53 16.5 8.67993ZM12.2659 6.68856C12.5654 6.40238 12.5761 5.92763 12.29 5.62818C12.0038 5.32873 11.529 5.31797 11.2296 5.60416C9.73022 7.03711 8.40877 8.65489 7.3018 10.4211L5.78033 8.89963C5.48744 8.60673 5.01256 8.60673 4.71967 8.89963C4.42678 9.19252 4.42678 9.66739 4.71967 9.96029L6.92031 12.1609C7.08544 12.3261 7.31807 12.4048 7.54957 12.374C7.78106 12.3432 7.98499 12.2064 8.1012 12.0038C9.23027 10.0356 10.6362 8.24613 12.2659 6.68856Z",fill:"var(--privy-color-accent)"})}),tg=tr.div`
|
|
2057
|
-
display: flex;
|
|
2058
|
-
flex-direction: column;
|
|
2059
|
-
justify-content: flex-start;
|
|
2060
|
-
gap: 4px;
|
|
2061
|
-
`,rg=tr.div`
|
|
2062
|
-
&&& {
|
|
2063
|
-
margin-left: 7px; /* TODO: This is a total hack */
|
|
2064
|
-
border-left: 2px solid var(--privy-color-foreground-4);
|
|
2065
|
-
height: 12px;
|
|
2066
|
-
}
|
|
2067
|
-
`,ng=({children:r})=>e(ag,{children:[t(eg,{style:{width:"16px",height:"16px"}}),r]});let ag=tr.div`
|
|
2068
|
-
display: flex;
|
|
2069
|
-
justify-content: flex-start;
|
|
2070
|
-
justify-items: center;
|
|
2071
|
-
text-align: left;
|
|
2072
|
-
gap: 8px;
|
|
2073
|
-
|
|
2074
|
-
&& {
|
|
2075
|
-
a {
|
|
2076
|
-
text-decoration: underline;
|
|
2077
|
-
color: var(--privy-color-accent);
|
|
2078
|
-
}
|
|
2079
|
-
|
|
2080
|
-
svg {
|
|
2081
|
-
margin-top: auto;
|
|
2082
|
-
margin-bottom: auto;
|
|
2083
|
-
}
|
|
2084
|
-
}
|
|
2085
|
-
`,ig=()=>{let r=y.isFirefox?"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/":"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en";return e(og,{children:[t(Nc,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),t(yc,{children:t(ss,{style:{width:"152px",height:"152px"}})}),e(tg,{children:[t(ng,{children:e("div",{children:[t("span",{children:"Install the "}),t("a",{href:r,target:"_blank",children:"Phantom browser extension"})]})}),t(rg,{}),t(ng,{children:"Set up your first wallet"}),t(rg,{}),t(ng,{children:"Store your recovery phrase in a safe place!"})]}),t(Js,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]})};let og=tr(yc)`
|
|
2086
|
-
gap: 30px;
|
|
2087
|
-
|
|
2088
|
-
> :first-child > svg {
|
|
2089
|
-
margin-top: 20px;
|
|
2090
|
-
}
|
|
2091
|
-
`,lg={apple_oauth:"apple",custom_auth:"custom",discord_oauth:"discord",email:"email",farcaster:"farcaster",github_oauth:"github",google_oauth:"google",instagram_oauth:"instagram",linkedin_oauth:"linkedin",passkey:"passkey",phone:"sms",spotify_oauth:"spotify",telegram:"telegram",tiktok_oauth:"tiktok",twitter_oauth:"twitter",wallet:"siwe",smart_wallet:"siwe",cross_app:"privy:",guest:"guest"};const sg=e=>{let t=lg[e];return"wallet"===e||"phone"===e?{displayName:e,loginMethod:t}:{displayName:t,loginMethod:t}},dg=()=>{let{app:e}=ye(),r=e?.appearance?.logo,n=`${e?.name} logo`,a={maxHeight:"90px",maxWidth:"180px"};return r?"string"==typeof r?t("img",{src:r,alt:n,style:a}):"svg"===r.type||"img"===r.type?l.cloneElement(r,{alt:n,style:a}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null},cg=e=>{let{app:r}=ye();return r?.appearance.logo?t(ug,{...e,children:t(dg,{})}):null},ug=tr.div`
|
|
2092
|
-
display: flex;
|
|
2093
|
-
flex-direction: column;
|
|
2094
|
-
align-items: center;
|
|
2095
|
-
padding: 24px 0;
|
|
2096
|
-
flex-grow: 1;
|
|
2097
|
-
justify-content: center;
|
|
2098
|
-
`,hg=({appId:n})=>{let[a,i]=d(void 0),{startCrossAppAuthFlow:o,authenticated:l}=M(),{client:s}=P();return p((()=>{(async()=>{s&&i(await s.getCrossAppProviderDetails(n))})()}),[s]),t(Cd,{onClick:()=>o({appId:n,action:l?"link":"login"}),disabled:!a,children:a?e(r,{children:[t(Au,{name:a.name,logoUrl:a.icon_url||void 0,size:"24px"})," ",a.name]}):t(js,{})})};let pg=tr.label`
|
|
2099
|
-
display: block;
|
|
2100
|
-
position: relative;
|
|
2101
|
-
width: 100%;
|
|
2102
|
-
|
|
2103
|
-
> svg {
|
|
2104
|
-
position: absolute;
|
|
2105
|
-
margin: 13px 17px;
|
|
2106
|
-
height: 24px;
|
|
2107
|
-
width: 24px;
|
|
2108
|
-
color: var(--privy-color-foreground-3);
|
|
2109
|
-
}
|
|
2110
|
-
|
|
2111
|
-
&& > input {
|
|
2112
|
-
background-color: #f00;
|
|
2113
|
-
font-size: 16px;
|
|
2114
|
-
line-height: 24px;
|
|
2115
|
-
|
|
2116
|
-
padding: 12px 88px 12px 52px;
|
|
2117
|
-
flex-grow: 1;
|
|
2118
|
-
background: var(--privy-color-background);
|
|
2119
|
-
border: 1px solid
|
|
2120
|
-
${({$error:e})=>e?"var(--privy-color-error) !important":"var(--privy-color-foreground-4)"};
|
|
2121
|
-
border-radius: var(--privy-border-radius-mdlg);
|
|
2122
|
-
width: 100%;
|
|
2123
|
-
|
|
2124
|
-
/* Tablet and Up */
|
|
2125
|
-
@media (min-width: 441px) {
|
|
2126
|
-
font-size: 14px;
|
|
2127
|
-
padding-right: 78px;
|
|
2128
|
-
}
|
|
2129
|
-
|
|
2130
|
-
:focus {
|
|
2131
|
-
outline: none;
|
|
2132
|
-
border-color: ${({$error:e})=>e?"var(--privy-color-error) !important":"var(--privy-color-accent-light)"};
|
|
2133
|
-
box-shadow: ${({$error:e})=>e?"none":"0 0 0 1px var(--privy-color-accent-light)"};
|
|
2134
|
-
}
|
|
2135
|
-
|
|
2136
|
-
:autofill,
|
|
2137
|
-
:-webkit-autofill {
|
|
2138
|
-
background: var(--privy-color-background);
|
|
2139
|
-
}
|
|
2140
|
-
|
|
2141
|
-
&& > input::placeholder {
|
|
2142
|
-
color: var(--privy-color-foreground-3);
|
|
2143
|
-
}
|
|
2144
|
-
&:disabled {
|
|
2145
|
-
opacity: 0.4; /* Make it visually appear disabled */
|
|
2146
|
-
cursor: not-allowed; /* Change cursor to not-allowed */
|
|
2147
|
-
}
|
|
2148
|
-
&:disabled,
|
|
2149
|
-
&:disabled:hover,
|
|
2150
|
-
&:disabled > span {
|
|
2151
|
-
color: var(--privy-color-foreground-3); /* Change text color to grey */
|
|
2152
|
-
}
|
|
2153
|
-
}
|
|
2154
|
-
|
|
2155
|
-
&& > button:last-child {
|
|
2156
|
-
right: 0px;
|
|
2157
|
-
line-height: 24px;
|
|
2158
|
-
padding: 13px 17px;
|
|
2159
|
-
:focus {
|
|
2160
|
-
outline: none;
|
|
2161
|
-
}
|
|
2162
|
-
&:disabled {
|
|
2163
|
-
opacity: 0.4; /* Make it visually appear disabled */
|
|
2164
|
-
cursor: not-allowed; /* Change cursor to not-allowed */
|
|
2165
|
-
}
|
|
2166
|
-
&:disabled,
|
|
2167
|
-
&:disabled:hover,
|
|
2168
|
-
&:disabled > span {
|
|
2169
|
-
color: var(--privy-color-foreground-3); /* Change text color to grey */
|
|
2170
|
-
}
|
|
2171
|
-
}
|
|
2172
|
-
`;const mg=tr(pg)`
|
|
2173
|
-
background-color: var(--privy-color-background);
|
|
2174
|
-
transition: background-color 200ms ease;
|
|
2175
|
-
|
|
2176
|
-
&& > button {
|
|
2177
|
-
right: 0;
|
|
2178
|
-
line-height: 24px;
|
|
2179
|
-
position: absolute;
|
|
2180
|
-
padding: 13px 17px;
|
|
2181
|
-
background-color: #090;
|
|
2182
|
-
|
|
2183
|
-
:focus {
|
|
2184
|
-
outline: none;
|
|
2185
|
-
border-color: var(--privy-color-accent);
|
|
2186
|
-
}
|
|
2187
|
-
}
|
|
2188
|
-
`,fg=tr(pg)`
|
|
2189
|
-
&& > input {
|
|
2190
|
-
overflow: hidden;
|
|
2191
|
-
white-space: nowrap;
|
|
2192
|
-
text-overflow: ellipsis;
|
|
2193
|
-
|
|
2194
|
-
padding-right: ${e=>e.stacked?"16px":"88px"};
|
|
2195
|
-
|
|
2196
|
-
border: 1px solid
|
|
2197
|
-
${({$error:e})=>e?"var(--privy-color-error) !important":"var(--privy-color-foreground-4)"};
|
|
2198
|
-
|
|
2199
|
-
&& > input::placeholder {
|
|
2200
|
-
color: var(--privy-color-foreground-3);
|
|
2201
|
-
}
|
|
2202
|
-
}
|
|
2203
|
-
|
|
2204
|
-
&& > :last-child {
|
|
2205
|
-
right: 16px;
|
|
2206
|
-
position: absolute;
|
|
2207
|
-
top: 50%;
|
|
2208
|
-
transform: translate(0, -50%);
|
|
2209
|
-
}
|
|
2210
|
-
|
|
2211
|
-
&& > button:last-child {
|
|
2212
|
-
right: 0px;
|
|
2213
|
-
line-height: 24px;
|
|
2214
|
-
padding: 13px 17px;
|
|
2215
|
-
|
|
2216
|
-
:focus {
|
|
2217
|
-
outline: none;
|
|
2218
|
-
}
|
|
2219
|
-
}
|
|
2220
|
-
`,gg=tr.div`
|
|
2221
|
-
width: 100%;
|
|
2222
|
-
|
|
2223
|
-
/* Add styling for the ErrorMessage within EmailInput */
|
|
2224
|
-
&& > ${Nu} {
|
|
2225
|
-
display: block;
|
|
2226
|
-
text-align: left;
|
|
2227
|
-
padding-left: var(--privy-border-radius-mdlg);
|
|
2228
|
-
padding-bottom: 5px;
|
|
2229
|
-
}
|
|
2230
|
-
`,yg=g(((n,a)=>{let[i,o]=d(n.defaultValue||""),[l,s]=d(""),[c,u]=d(!1),{authenticated:h}=M(),{initLoginWithEmail:m}=P(),{navigate:f,setModalData:g,currentScreen:y,data:w}=ye(),{enabled:v,token:C}=Ll(),[b,E]=d(!1),{accountType:$}=du(),x=Ue();p((()=>{!i&&x.disablePlusEmails&&w?.inlineError?.error instanceof A&&w?.inlineError?.error.privyErrorCode===T.DISALLOWED_PLUS_EMAIL&&!l&&s("Please enter a valid email address without a '+'."),l&&s("")}),[i]);let _=vt(i),k=c||!_,N=()=>{g({inlineError:void 0}),!v||C||h?(e=>{u(!0),m({email:i,captchaToken:e,disableSignup:w?.login?.disableSignup,withPrivyUi:!0}).then((()=>{f(We.AWAITING_PASSWORDLESS_CODE)})).catch((e=>{g({errorModalData:{error:e,previousScreen:y||We.LANDING}}),f(We.ERROR_SCREEN)})).finally((()=>{u(!1)}))})(C):(g({captchaModalData:{callback:e=>m({email:i,captchaToken:e,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:We.AWAITING_PASSWORDLESS_CODE,onErrorNavigateTo:We.ERROR_SCREEN}}),f(We.CAPTCHA_SCREEN))};return e(r,{children:[e(wg,{children:[t(Nu,l?{style:{marginTop:"0.25rem",textAlign:"left"},children:l}:{style:{marginTop:"0.25rem",textAlign:"left",visibility:"hidden"},children:" "}),e(vg,{stacked:n.stacked,$error:!!l,children:[t(yr,{}),t("input",{ref:a,id:"email-input",className:"login-method-button",type:"email",placeholder:"your@email.com",onFocus:()=>E(!0),onChange:e=>o(e.target.value),onKeyUp:e=>{"Enter"===e.key&&N()},value:i,autoComplete:"email"}),"email"!==$||b?n.stacked?t("span",{}):t(Xs,{isSubmitting:c,onClick:N,disabled:k,children:"Submit"}):t(Jc,{color:"gray",children:"Recent"})]})]}),n.stacked?t(Hs,{loadingText:null,loading:c,disabled:k,onClick:N,children:"Submit"}):null]})}));let wg=gg,vg=fg;const Cg=({isEditable:n,setIsEditable:a,defaultValue:i})=>{let o=s(null);return e(r,{children:[t(Ed,{$if:!n,children:t(yg,{ref:o,defaultValue:i})}),t(Ed,{$if:n,children:e(Cd,{onClick:()=>{a(),setTimeout((()=>{o.current?.focus()}),0)},children:[t(yr,{})," Continue with Email"]})})]})},bg=()=>{let[r,n]=d(!1),{currentScreen:a,navigate:i,setModalData:o,data:l}=ye(),{enabled:s,token:c}=Ll(),{initLoginWithFarcaster:u}=P(),{accountType:h}=du();return e(Cd,{onClick:async()=>{n(!0);try{s&&!c?(o({captchaModalData:{callback:e=>u(e,l?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:We.AWAITING_FARCASTER_CONNECTION,onErrorNavigateTo:We.ERROR_SCREEN}}),i(We.CAPTCHA_SCREEN)):(await u(c,l?.login?.disableSignup),i(We.AWAITING_FARCASTER_CONNECTION))}catch(e){o({errorModalData:{error:e,previousScreen:a||We.LANDING}}),i(We.ERROR_SCREEN)}finally{n(!1)}},disabled:!1,children:[t(Ep,{})," Farcaster",r&&t(js,{}),"farcaster"===h&&t(Eg,{color:"gray",children:"Recent"})]})};let Eg=tr(Jc)`
|
|
2231
|
-
margin-left: auto;
|
|
2232
|
-
`;const $g=()=>{let{enabled:e,token:r}=Ll(),{navigate:n,setModalData:a}=ye(),{initLoginWithPasskey:i}=P();return t(Ag,{onClick:async()=>{e&&!r?(a({captchaModalData:{callback:e=>i({captchaToken:e,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:We.AWAITING_PASSKEY_SYSTEM_DIALOGUE,onErrorNavigateTo:We.ERROR_SCREEN}}),n(We.CAPTCHA_SCREEN)):(await i({withPrivyUi:!0}),n(We.AWAITING_PASSKEY_SYSTEM_DIALOGUE))},children:"I have a passkey"})};let Tg=rr`
|
|
2233
|
-
&& {
|
|
2234
|
-
width: 100%;
|
|
2235
|
-
font-size: 0.875rem;
|
|
2236
|
-
line-height: 1rem;
|
|
2237
|
-
|
|
2238
|
-
display: flex;
|
|
2239
|
-
gap: 0.5rem;
|
|
2240
|
-
justify-content: center;
|
|
2241
|
-
align-items: center;
|
|
2242
|
-
|
|
2243
|
-
padding: 6px 8px;
|
|
2244
|
-
background-color: var(--privy-color-background);
|
|
2245
|
-
transition: background-color 200ms ease;
|
|
2246
|
-
color: var(--privy-color-accent) !important;
|
|
2247
|
-
|
|
2248
|
-
:focus {
|
|
2249
|
-
outline: none;
|
|
2250
|
-
box-shadow: none;
|
|
2251
|
-
}
|
|
2252
|
-
}
|
|
2253
|
-
`;const Ag=tr.button`
|
|
2254
|
-
${Tg}
|
|
2255
|
-
`,xg=({value:r,onChange:n})=>t("select",{value:r,onChange:n,children:Po.map((t=>e("option",{value:t.code,children:[t.code," +",t.callCode]},t.code)))}),_g=g(((n,a)=>{let{app:i}=ye(),[o,l]=d(!1),{accountType:s}=du(),[c,u]=d(""),[h,m]=d(i?.intl.defaultCountry??"US"),f=So(c,h),g=(e=>new ko(e))(h),y=(e=>{let t=function(){return Ca(_o,arguments)}(e,wa)?.formatInternational();return t?.substring(t.indexOf(" ")+1)})(h),w=No(h),v=!f,[C,b]=d(!1),E=w.length,$=e=>{let t=e.target.value;m(t),u(""),n.onChange&&n.onChange({rawPhoneNumber:c,qualifiedPhoneNumber:Io(c,t),countryCode:t,isValid:So(c,h)})},T=(e,t)=>{try{let r=e.replace(/\D/g,"")===c.replace(/\D/g,"")?e:g.input(e);u(r),n.onChange&&n.onChange({rawPhoneNumber:r,qualifiedPhoneNumber:Io(e,t),countryCode:t,isValid:So(e,t)})}catch(e){console.error("Error processing phone number:",e)}},A=()=>{b(!0);let e=Io(c,h);n.onSubmit({rawPhoneNumber:c,qualifiedPhoneNumber:e,countryCode:h,isValid:So(c,h)}).finally((()=>b(!1)))};return p((()=>{if(n.defaultValue){let e=(e=>{let t=new ko;t.input(e);let r=t.getCountry()||"US",n=t.getCallingCode()||"1";return{countryCode:r,phone:e.replace("+"+n,"")}})(n.defaultValue);g.reset(),$({target:{value:e.countryCode}}),T(e.phone,e.countryCode)}}),[n.defaultValue]),e(r,{children:[t(kg,{children:e(Ng,{$callingCodeLength:E,$stacked:n.stacked,children:[t(xg,{value:h,onChange:$}),t("input",{ref:a,id:"phone-number-input",className:"login-method-button",type:"tel",placeholder:y,onFocus:()=>l(!0),onChange:e=>{T(e.target.value,h)},onKeyUp:e=>{"Enter"===e.key&&A()},value:c,autoComplete:"tel"}),"phone"!==s||o||n.hideRecent?n.stacked||n.noIncludeSubmitButton?t("span",{}):t(Xs,{isSubmitting:C,onClick:A,disabled:v,children:"Submit"}):t(Jc,{color:"gray",children:"Recent"})]})}),n.stacked&&!n.noIncludeSubmitButton?t(Hs,{loading:C,loadingText:null,onClick:A,disabled:v,children:"Submit"}):null]})}));let kg=tr.div`
|
|
2256
|
-
width: 100%;
|
|
2257
|
-
`,Ng=tr.label`
|
|
2258
|
-
--country-code-dropdown-width: calc(54px + calc(12 * ${e=>e.$callingCodeLength}px));
|
|
2259
|
-
--phone-input-extra-padding-left: calc(12px + calc(3 * ${e=>e.$callingCodeLength}px));
|
|
2260
|
-
display: block;
|
|
2261
|
-
position: relative;
|
|
2262
|
-
width: 100%;
|
|
2263
|
-
|
|
2264
|
-
/* Tablet and Up */
|
|
2265
|
-
@media (min-width: 441px) {
|
|
2266
|
-
--country-code-dropdown-width: calc(52px + calc(10 * ${e=>e.$callingCodeLength}px));
|
|
2267
|
-
}
|
|
2268
|
-
|
|
2269
|
-
&& > select {
|
|
2270
|
-
font-size: 16px;
|
|
2271
|
-
height: 24px;
|
|
2272
|
-
position: absolute;
|
|
2273
|
-
margin: 13px calc(var(--country-code-dropdown-width) / 4);
|
|
2274
|
-
line-height: 24px;
|
|
2275
|
-
width: var(--country-code-dropdown-width);
|
|
2276
|
-
background-color: var(--privy-color-background);
|
|
2277
|
-
background-size: auto;
|
|
2278
|
-
background-position-x: right;
|
|
2279
|
-
cursor: pointer;
|
|
2280
|
-
|
|
2281
|
-
/* Tablet and Up */
|
|
2282
|
-
@media (min-width: 441px) {
|
|
2283
|
-
font-size: 14px;
|
|
2284
|
-
width: var(--country-code-dropdown-width);
|
|
2285
|
-
}
|
|
2286
|
-
|
|
2287
|
-
:focus {
|
|
2288
|
-
outline: none;
|
|
2289
|
-
box-shadow: none;
|
|
2290
|
-
}
|
|
2291
|
-
}
|
|
2292
|
-
|
|
2293
|
-
&& > input {
|
|
2294
|
-
font-size: 16px;
|
|
2295
|
-
line-height: 24px;
|
|
2296
|
-
|
|
2297
|
-
overflow: hidden;
|
|
2298
|
-
white-space: nowrap;
|
|
2299
|
-
text-overflow: ellipsis;
|
|
2300
|
-
|
|
2301
|
-
width: calc(100% - var(--country-code-dropdown-width));
|
|
2302
|
-
|
|
2303
|
-
padding: 12px 88px 12px
|
|
2304
|
-
calc(var(--country-code-dropdown-width) + var(--phone-input-extra-padding-left));
|
|
2305
|
-
padding-right: ${e=>e.$stacked?"16px":"88px"};
|
|
2306
|
-
flex-grow: 1;
|
|
2307
|
-
background: var(--privy-color-background);
|
|
2308
|
-
border: 1px solid var(--privy-color-foreground-4);
|
|
2309
|
-
border-radius: var(--privy-border-radius-mdlg);
|
|
2310
|
-
width: 100%;
|
|
2311
|
-
|
|
2312
|
-
:focus {
|
|
2313
|
-
outline: none;
|
|
2314
|
-
border-color: var(--privy-color-accent);
|
|
2315
|
-
}
|
|
2316
|
-
|
|
2317
|
-
:autofill,
|
|
2318
|
-
:-webkit-autofill {
|
|
2319
|
-
background: var(--privy-color-background);
|
|
2320
|
-
}
|
|
2321
|
-
|
|
2322
|
-
/* Tablet and Up */
|
|
2323
|
-
@media (min-width: 441px) {
|
|
2324
|
-
font-size: 14px;
|
|
2325
|
-
padding-right: 78px;
|
|
2326
|
-
}
|
|
2327
|
-
}
|
|
2328
|
-
|
|
2329
|
-
&& > :last-child {
|
|
2330
|
-
right: 16px;
|
|
2331
|
-
position: absolute;
|
|
2332
|
-
top: 50%;
|
|
2333
|
-
transform: translate(0, -50%);
|
|
2334
|
-
}
|
|
2335
|
-
|
|
2336
|
-
&& > button:last-child {
|
|
2337
|
-
right: 0px;
|
|
2338
|
-
line-height: 24px;
|
|
2339
|
-
padding: 13px 17px;
|
|
2340
|
-
|
|
2341
|
-
:focus {
|
|
2342
|
-
outline: none;
|
|
2343
|
-
border-color: var(--privy-color-accent);
|
|
2344
|
-
}
|
|
2345
|
-
}
|
|
2346
|
-
|
|
2347
|
-
&& > input::placeholder {
|
|
2348
|
-
color: var(--privy-color-foreground-3);
|
|
2349
|
-
}
|
|
2350
|
-
`;const Sg=({isEditable:n,setIsEditable:a,defaultValue:i})=>{let o=s(null),{authenticated:l}=M(),{navigate:d,setModalData:c,currentScreen:u,data:h}=ye(),{initLoginWithSms:p}=P(),{enabled:m,token:f}=Ll();return e(r,{children:[t(Ed,{$if:!n,children:t(_g,{ref:o,onSubmit:async function({qualifiedPhoneNumber:e}){if(!m||f||l)try{await p({phoneNumber:e,captchaToken:f,withPrivyUi:!0,disableSignup:h?.login?.disableSignup}),d(We.AWAITING_PASSWORDLESS_CODE)}catch(e){c({errorModalData:{error:e,previousScreen:u||We.LANDING}}),d(We.ERROR_SCREEN)}else c({captchaModalData:{callback:t=>p({phoneNumber:e,captchaToken:t,withPrivyUi:!0,disableSignup:h?.login?.disableSignup}),userIntentRequired:!1,onSuccessNavigateTo:We.AWAITING_PASSWORDLESS_CODE,onErrorNavigateTo:We.ERROR_SCREEN}}),d(We.CAPTCHA_SCREEN)},defaultValue:i})}),t(Ed,{$if:n,children:e(Cd,{onClick:()=>{a(),setTimeout((()=>{o.current?.focus()}),0)},children:[t(wr,{})," Continue with SMS"]})})]})};let Ig={apple:{logo:t(el,{}),displayName:"Apple"},discord:{logo:t(tl,{}),displayName:"Discord"},github:{logo:t(rl,{}),displayName:"GitHub"},google:{logo:t(al,{}),displayName:"Google"},linkedin:{logo:t(ol,{}),displayName:"LinkedIn"},spotify:{logo:t(ll,{}),displayName:"Spotify"},instagram:{logo:t(il,{}),displayName:"Instagram"},twitter:{logo:t(dl,{}),displayName:"Twitter"},tiktok:{logo:t(sl,{}),displayName:"TikTok"}};const Og=({provider:r})=>{let{enabled:n,token:a}=Ll(),{navigate:i,setModalData:o,data:l}=ye(),[s,c]=d(!1),{initLoginWithOAuth:u}=P(),{accountType:h}=du(),p=h?sg(h):null,{displayName:m,logo:f}=Ig[r];return e(Cd,{onClick:()=>{c(!0),n&&!a?(o({captchaModalData:{callback:e=>u(r,e,l?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:We.ERROR_SCREEN}}),i(We.CAPTCHA_SCREEN)):u(r,void 0,l?.login?.disableSignup)},disabled:s,children:[f," ",m,p?.loginMethod===r&&t(Pg,{color:"gray",children:"Recent"})]})};let Pg=tr(Jc)`
|
|
2351
|
-
margin-left: auto;
|
|
2352
|
-
`;function Mg(r){return e("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 240 240",...r,children:[t("defs",{children:e("linearGradient",{x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",id:"telegram-linear-gradient",children:[t("stop",{offset:"0",stopColor:"#1d93d2"}),t("stop",{offset:"1",stopColor:"#38b0e3"})]})}),t("title",{children:"Telegram_logo"}),t("circle",{cx:"120",cy:"120",r:"120",fill:"url(#telegram-linear-gradient)"}),t("path",{d:"M81.229,128.772l14.237,39.406s1.78,3.687,3.686,3.687,30.255-29.492,30.255-29.492l31.525-60.89L81.737,118.6Z",fill:"#c8daea"}),t("path",{d:"M100.106,138.878l-2.733,29.046s-1.144,8.9,7.754,0,17.415-15.763,17.415-15.763",fill:"#a9c6d8"}),t("path",{d:"M81.486,130.178,52.2,120.636s-3.5-1.42-2.373-4.64c.232-.664.7-1.229,2.1-2.2,6.489-4.523,120.106-45.36,120.106-45.36s3.208-1.081,5.1-.362a2.766,2.766,0,0,1,1.885,2.055,9.357,9.357,0,0,1,.254,2.585c-.009.752-.1,1.449-.169,2.542-.692,11.165-21.4,94.493-21.4,94.493s-1.239,4.876-5.678,5.043A8.13,8.13,0,0,1,146.1,172.5c-8.711-7.493-38.819-27.727-45.472-32.177a1.27,1.27,0,0,1-.546-.9c-.093-.469.417-1.05.417-1.05s52.426-46.6,53.821-51.492c.108-.379-.3-.566-.848-.4-3.482,1.281-63.844,39.4-70.506,43.607A3.21,3.21,0,0,1,81.486,130.178Z",fill:"#fff"})]})}const Rg=()=>{let{enabled:r,token:n}=Ll(),{navigate:a,setModalData:i,data:o}=ye(),[l,s]=d(!1),{initLoginWithTelegram:c}=P(),{accountType:u}=du();async function h(e){try{await c(e,o?.login?.disableSignup),i({telegramAuthModalData:{seamlessAuth:!1}}),a(We.TELEGRAM_AUTH_SCREEN)}catch(e){console.error(e),s(!1)}}return e(Cd,{onClick:async function(){if(s(!0),r&&!n)return i({captchaModalData:{callback:h,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:We.ERROR_SCREEN}}),void a(We.CAPTCHA_SCREEN);await h(n)},disabled:l,children:[t(Mg,{}),"Telegram","telegram"===u&&t(Lg,{color:"gray",children:"Recent"})]})};let Lg=tr(Jc)`
|
|
2353
|
-
margin-left: auto;
|
|
2354
|
-
`;const Dg=({onClick:r,text:n,icon:a})=>e(Cd,{onClick:r,children:[a,t(md,{children:n}),t(vn,{})]}),Fg=({connectOnly:n})=>{let{closePrivyModal:a,connectors:i}=P(),{app:o,onUserCloseViaDialogOrKeybindRef:l,data:s}=ye(),{appearance:{palette:{colorScheme:c}}}=Ue(),{accountType:u,walletClientType:h,chainType:m}=du(),f=u?sg(u):null,g=o.loginMethodsAndOrder?.primary??[],y=o.loginMethodsAndOrder?.overflow??[],w=[...g,...y],v=o.loginMethods.passkey,C=s?.login,b=[];h&&w.includes(h)?b.push(h):u&&w.includes(f?.loginMethod)&&b.push(f?.loginMethod);let[E,$]=d("default"),[T,A]=d("phone"===u?"sms":"email");p((()=>{"phone"===u&&A("sms");let e=w.indexOf("sms"),t=w.indexOf("email");e>-1&&e<t&&A("sms")}),[u,g,y]);let x=()=>{a({shouldCallAuthOnSuccess:!0}),setTimeout((()=>{$("default")}),150)};l.current=x;let _=e=>"email"===e?t(Cg,{isEditable:"email"===T,setIsEditable:()=>{A("email")},defaultValue:"email"===C?.prefill?.type?C.prefill.value:void 0},e):"sms"===e?t(Sg,{isEditable:"sms"===T,setIsEditable:()=>{A("sms")},defaultValue:"phone"===C?.prefill?.type?C.prefill.value:void 0},e):"apple"===e?t(Og,{provider:"apple"},e):"discord"===e?t(Og,{provider:"discord"},e):"farcaster"===e?t(bg,{},e):"github"===e?t(Og,{provider:"github"},e):"google"===e?t(Og,{provider:"google"},e):"linkedin"===e?t(Og,{provider:"linkedin"},e):"spotify"===e?t(Og,{provider:"spotify"},e):"instagram"===e?t(Og,{provider:"instagram"},e):"tiktok"===e?t(Og,{provider:"tiktok"},e):"twitter"===e?t(Og,{provider:"twitter"},e):"telegram"===e?t(Rg,{},e):e.startsWith("privy:")?t(hg,{appId:e.replace("privy:","")},e):vu({walletList:o.appearance.walletList,walletChainType:o.appearance.walletChainType,connectors:i,connectOnly:n,ignore:w,walletConnectEnabled:o.externalWallets.walletConnect.enabled,forceWallet:{wallet:e,chainType:m??"ethereum"}}),k=b.flatMap(_),N=g.filter((e=>e!==h&&e!==f?.loginMethod)).flatMap(_),S=y.filter((e=>e!==h&&e!==f?.loginMethod)).flatMap(_),[I,O]=Ct([...k,...N,...S],Ug({primary:N.length+k.length,overflow:S.length}));return e(r,{children:[t(od,{title:o.appearance.landingHeader,onClose:x,backFn:"default"===E?void 0:()=>{$("default")}}),"default"===E&&t(Wg,{}),"default"===E&&("string"==typeof o.appearance.loginMessage?t(vd,{children:o.appearance.loginMessage}):o.appearance.loginMessage),t(fd,{style:{overflow:"hidden"},children:e(yd,{$colorScheme:c,style:{maxHeight:400,overflowY:"scroll",padding:2},children:["default"===E&&e(r,{children:[I,O.length>0&&t(Dg,{text:"More options",icon:t(Rr,{}),onClick:()=>$("overflow")})]}),"overflow"===E&&t(r,{children:O}),v&&"default"===E&&t($g,{})]})}),o&&t(kd,{app:o}),t(Nd,{})]})};let Ug=({primary:e,overflow:t})=>e<5?e:5===e&&0===t?5:4,Wg=tr(cg)`
|
|
2355
|
-
margin-bottom: 16px;
|
|
2356
|
-
`;const Bg=({...r})=>e("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...r,children:[e("g",{clipPath:"url(#clip0_2856_1743)",children:[t("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),t("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),t("defs",{children:t("clipPath",{id:"clip0_2856_1743",children:t("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]}),jg=({connectOnly:n})=>{let{closePrivyModal:a,connectors:i}=P(),{data:o,onUserCloseViaDialogOrKeybindRef:l}=ye(),s=Ue(),{accountType:u,walletClientType:h,chainType:m}=du(),f=u?sg(u):null,g=o?.login,{email:y,sms:w,google:v,twitter:C,discord:b,github:E,spotify:$,instagram:T,tiktok:A,linkedin:x,apple:_,wallet:k,farcaster:N,telegram:S}=c((()=>g?.loginMethods?((e,t=!0)=>e.reduce(((e,r)=>({...e,[r]:t})),{}))(g.loginMethods,!0):null),[g])??s.loginMethods,{passkey:I}=s.loginMethods,O=[y&&"email",w&&"sms",v&&"google",C&&"twitter",b&&"discord",E&&"github",$&&"spotify",T&&"instagram",A&&"tiktok",x&&"linkedin",_&&"apple",N&&"farcaster",S&&"telegram"].filter((e=>!!e)),M=O.length>0,R=c((()=>k&&!M?"web3-first":k&&s?.appearance.loginGroupPriority||"web2-first"),[k,M,s?.appearance.loginGroupPriority]),L=s?.appearance.hideDirectWeb2Inputs,[D,F]=d("default"),[U,W]=d(qg({mostRecentlyUsedAccountType:u,smsAvailable:w,emailAvailable:y,prefilledType:g?.prefill?.type}));p((()=>{W(qg({mostRecentlyUsedAccountType:u,smsAvailable:w,emailAvailable:y,prefilledType:g?.prefill?.type}))}),[y,w,u]);let B=()=>{a({shouldCallAuthOnSuccess:!0}),setTimeout((()=>{F("default")}),150)};l.current=B;let j=[];h&&k?j.push(h):f?.loginMethod&&O.includes(f.loginMethod)&&j.push(f.loginMethod);let z=e=>"email"===e?t(Cg,{isEditable:"email"===U,setIsEditable:()=>{W("email")},defaultValue:"email"===g?.prefill?.type?g.prefill.value:void 0},e):"sms"===e?t(Sg,{isEditable:"sms"===U,setIsEditable:()=>{W("sms")},defaultValue:"phone"===g?.prefill?.type?g.prefill.value:void 0},e):"apple"===e?t(Og,{provider:"apple"},e):"discord"===e?t(Og,{provider:"discord"},e):"farcaster"===e?t(bg,{},e):"github"===e?t(Og,{provider:"github"},e):"google"===e?t(Og,{provider:"google"},e):"linkedin"===e?t(Og,{provider:"linkedin"},e):"tiktok"===e?t(Og,{provider:"tiktok"},e):"spotify"===e?t(Og,{provider:"spotify"},e):"instagram"===e?t(Og,{provider:"instagram"},e):"twitter"===e?t(Og,{provider:"twitter"},e):"telegram"===e?t(Rg,{},e):vu({walletList:s.appearance.walletList,walletChainType:s.appearance.walletChainType,connectors:i,connectOnly:n,ignore:[],walletConnectEnabled:s.externalWallets.walletConnect.enabled,forceWallet:{wallet:e,chainType:m??"ethereum"}}),G=vu({walletList:s.appearance.walletList.filter((e=>e!==h)),walletChainType:s.appearance.walletChainType,connectors:i,connectOnly:n,ignore:[...s.appearance.walletList,h],recentlyUsedWallet:h,walletConnectEnabled:s.externalWallets.walletConnect.enabled}),H=O.filter((e=>e!==f?.loginMethod)).flatMap(z),V=j.flatMap(z);"web3-first"===R&&"default"===D?G.unshift(...V):"web2-first"===R&&H.unshift(...V);let q=O.filter((e=>"email"!==e&&"sms"!==e)),Z=Gg({priority:R,email:y,sms:w,social:q}),K=Hg({priority:R,email:y,sms:w,social:q}),Y=t(Qf,{text:Vg({priority:R}),onClick:()=>F("web3-overflow")}),Q=t(Dg,{text:Z,icon:K,onClick:()=>F("web2-overflow")}),J=L?0:1,X=5-(k&&G.length>0?1:0);return e(r,{children:[t(od,{title:s.appearance.landingHeader,onClose:B,backFn:"default"===D?void 0:()=>{F("default")}}),"default"===D&&t(zg,{}),"default"===D&&("string"==typeof s.appearance.loginMessage?t(vd,{children:s.appearance.loginMessage}):s.appearance.loginMessage),t(fd,{style:{overflow:"hidden",padding:2},children:e(gd,{children:["default"===D&&"web2-first"===R&&e(r,{children:[H.length>X?H.slice(0,X-1):H,H.length>X&&Q,k&&G.length>0&&Y]}),"default"===D&&"web3-first"===R&&e(r,{children:[k&&e(r,{children:[G.length>X?G.slice(0,X-1):G,G.length>X&&Y]}),H.length>J&&Q,H.length===J&&H[0]]}),"web2-overflow"===D&&t(r,{children:"web3-first"===R?H:H.slice(3)}),"web3-overflow"===D?G:[],I&&"default"===D&&t($g,{})]})}),s&&t(kd,{app:s}),t(Nd,{})]})};let zg=tr(cg)`
|
|
2357
|
-
margin-bottom: 16px;
|
|
2358
|
-
`,Gg=({priority:e,email:t,sms:r,social:n})=>"web2-first"===e?"Other socials":t&&r&&n.length>0||t&&n.length>0?"Log in with email or socials":r&&n.length>0?"Log in with sms or socials":t&&r?"Continue with email or sms":t?"Continue with email":r?"Continue with sms":"Log in with a social account",Hg=({priority:e,email:r,sms:n,social:a})=>"web2-first"===e||a.length>0?t(Rr,{}):r&&n?t(Bg,{}):r?t(yr,{}):n?t(wr,{}):null,Vg=({priority:e})=>"web2-first"===e?"Continue with a wallet":"Other wallets",qg=({mostRecentlyUsedAccountType:e,smsAvailable:t,emailAvailable:r,prefilledType:n})=>r&&("email"===e&&"phone"!==n||"email"===n)||!t||"phone"!==e&&"phone"!==n?"email":"sms";const Zg=({style:r,...n})=>e("svg",{width:"164",height:"164",viewBox:"0 0 164 164",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...r},...n,children:[t("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]});function Kg(){let{promptMfa:e,init:t,submit:r,cancel:n,mfaMethods:a}=u(D);return{promptMfa:e,init:t,submit:r,cancel:n,mfaMethods:a}}function Yg(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:n,submitEnrollmentWithTotp:a,submitEnrollmentWithPasskey:i,unenroll:o,enrollInMfa:l}=u(D);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:n,submitEnrollmentWithTotp:a,submitEnrollmentWithPasskey:i,unenrollWithSms:()=>o("sms"),unenrollWithTotp:()=>o("totp"),unenrollWithPasskey:()=>o("passkey"),showMfaEnrollmentModal:()=>l(!0),closeMfaEnrollmentModal:()=>l(!1)}}const Qg=r=>e(Jg,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...r,children:[t("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),t("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]});let Jg=tr.svg`
|
|
2359
|
-
height: 90px;
|
|
2360
|
-
width: 90px;
|
|
2361
|
-
|
|
2362
|
-
> rect {
|
|
2363
|
-
${e=>"success"===e.color?"fill: var(--privy-color-success);":"fill: var(--privy-color-accent);"}
|
|
2364
|
-
}
|
|
2365
|
-
|
|
2366
|
-
> path {
|
|
2367
|
-
fill: white;
|
|
2368
|
-
}
|
|
2369
|
-
`;const Xg=({showIntro:n,userMfaMethods:a,appMfaMethods:i,userHasAuthSms:o,isTotpLoading:l,isPasskeyLoading:s,error:d,onClose:c,onBackToIntro:u,handleSelectMethod:h,setRemovingMfaMethod:p})=>{let m=a.reduce(((e,t)=>({...e,[t]:!0})),{}),f=i.reduce(((e,t)=>({...e,[t]:!0})),{});return e(r,{children:[t(od,{backFn:n?u:void 0,onClose:c},"header"),t(dc,{style:{marginBottom:"1.5rem"},children:t(Cn,{})}),t(Zd,{children:"Choose a verification method"}),a.length>0?t(Kd,{children:"To add or delete verification methods, verification is required."}):t(Kd,{children:"How would you like to verify your identity? You can change this later."}),d&&t(cc,{style:{marginTop:"1.25rem"},children:d.message}),e(tc,{children:[(f.totp||m.totp)&&e(rc,{children:[t(Cd,{style:{justifyContent:"center"},disabled:m.totp||l,onClick:()=>h("totp"),children:l?t(Ws,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):e(oc,{children:[e(ac,{children:[t(En,{}),"Authenticator app"]}),m.totp?t(ey,{color:"green",children:"Enabled"}):t(ic,{children:"Recommended"})]})}),m.totp&&t(nc,{style:{position:"absolute",right:0},onClick:()=>p("totp"),children:t(Tn,{})})]},"totp"),(f.sms||m.sms)&&e(rc,{children:[t(Cd,{disabled:m.sms||o,onClick:()=>h("sms"),children:e(oc,{children:[e(ac,{children:[t(wr,{}),"SMS"]}),m.sms&&t(ey,{color:"green",children:"Enabled"}),o&&t(ic,{children:"Disabled"})]})}),m.sms&&t(nc,{style:{position:"absolute",right:0},onClick:()=>p("sms"),children:t(Tn,{})})]},"sms"),(f.passkey||m.passkey)&&e(rc,{children:[t(Cd,{style:{justifyContent:"center"},onClick:()=>h("passkey"),disabled:m.passkey||s,children:s?t(Ws,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):e(oc,{children:[e(ac,{children:[t($n,{}),"Passkey"]}),m.passkey?t(ey,{color:"green",children:"Enabled"}):t(ic,{isAccent:!0,children:t(vn,{})})]})}),m.passkey&&t(nc,{style:{position:"absolute",right:0},onClick:()=>p("passkey"),children:t(Tn,{})})]},"passkey")]}),t(Sd,{})]})};let ey=tr(Jc)`
|
|
2370
|
-
margin-right: 1.5rem;
|
|
2371
|
-
`;const ty=({onComplete:e,onClose:r,onReset:n})=>{let{user:a}=M(),{data:i}=ye(),{initLinkWithPasskey:o,linkWithPasskey:l}=P(),{initEnrollmentWithPasskey:s,submitEnrollmentWithPasskey:u}=Yg(),[h,p]=d(!1),[m,f]=d(!1),[g,y]=d(!1),[w,v]=d(null),C=c((()=>a?.linkedAccounts.filter((e=>"passkey"===e.type))??[]),[a]),b=()=>{i?.mfaEnrollmentFlow?.onSuccess(),e()},E=async e=>{p(!0);try{await s(),await u({credentialIds:e}),y(!0)}catch(e){v(e)}finally{p(!1)}},$=async()=>{f(!0),v(null);try{await o();let e=await l(),t=e?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];await E(t)}catch(e){v(e)}finally{f(!1)}};return 0===C.length||m?t(ry,{onReset:n,onClose:r,onClick:$,isCreating:m}):g?t(ay,{onClick:b,onClose:b}):w?t(ap,{error:w,backFn:()=>v(null),onClick:()=>v(null)}):t(ny,{passkeys:C,isSubmitting:h,isCreating:m,onReset:n,onClose:r,onSubmitEnrollment:()=>E(C.map((e=>e.credentialId))),onAddPasskey:$})};let ry=({onReset:n,onClose:a,onClick:i,isCreating:o})=>e(r,{children:[t(od,{backFn:n,onClose:a},"header"),t(qd,{children:e(Sm,{children:[t(xm,{}),t(_m,{})]})}),t(Zd,{children:"Set up passkey verification"}),e(Qd,{children:[e(Xd,{children:[t(Jd,{children:t(Cn,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),e(Xd,{children:[t(Jd,{children:t(cn,{})}),"Takes seconds to set up and use"]}),e(Xd,{children:[t(Jd,{children:t(An,{})}),"Use your passkey to verify transactions and login to your account"]})]}),t(Hs,{style:{marginTop:"2.25rem"},onClick:i,loading:o,children:"Add a new passkey"}),t(Sd,{})]}),ny=({onReset:n,onClose:a,onAddPasskey:i,onSubmitEnrollment:o,passkeys:l,isSubmitting:s,isCreating:c})=>{let[u,h]=d(!1),p=u?l.length:l.length>3?2:3;return e(r,{children:[t(od,{backFn:u?()=>h(!1):n,onClose:a},"header"),!u&&t(qd,{children:e(Sm,{children:[t(xm,{}),t(_m,{})]})}),t(Zd,{children:"Enable your passkeys for verification"}),e(Qd,{children:[l.slice(0,p).map((r=>e(iy,{children:[t(oy,{children:sy(r)}),e(ly,{children:["Last used: ",r.latestVerifiedAt?.toLocaleString()]})]},r.credentialId))),!u&&l.length>3&&t(dy,{onClick:()=>h(!0),children:"View All"})]}),t(Hs,{style:{marginTop:"1.5rem"},onClick:o,loading:s,children:"Enable passkeys"}),l.length<5&&t(dy,{style:{marginTop:"0.5rem"},onClick:i,disabled:c,children:c?t(Ws,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),t(Sd,{})]})},ay=({onClick:n,onClose:a})=>e(r,{children:[t(od,{onClose:a},"header"),t(dc,{style:{marginBottom:"1.5rem"},children:t(Tr,{})}),t(Zd,{children:"Passkey verification added"}),t(Kd,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),t(ec,{children:t(Hs,{onClick:n,children:"Done"})}),t(Sd,{})]}),iy=tr.div`
|
|
2372
|
-
&& {
|
|
2373
|
-
padding: 0.75rem 1rem;
|
|
2374
|
-
text-align: left;
|
|
2375
|
-
border-radius: 0.5rem;
|
|
2376
|
-
border: 1px solid var(--privy-color-foreground-4);
|
|
2377
|
-
width: 100%;
|
|
2378
|
-
}
|
|
2379
|
-
`,oy=tr.div`
|
|
2380
|
-
font-size: 0.875rem;
|
|
2381
|
-
line-height: 1.375rem;
|
|
2382
|
-
font-weight: 500;
|
|
2383
|
-
|
|
2384
|
-
color: var(--privy-color-foreground-1);
|
|
2385
|
-
`,ly=tr.div`
|
|
2386
|
-
font-size: 0.75rem;
|
|
2387
|
-
font-weight: 400;
|
|
2388
|
-
line-height: 1.125rem;
|
|
2389
|
-
|
|
2390
|
-
color: var(--privy-color-foreground-2);
|
|
2391
|
-
`,sy=e=>e.authenticatorName?e.createdWithBrowser?`${e.authenticatorName} on ${e.createdWithBrowser}`:e.authenticatorName:e.createdWithBrowser?e.createdWithOs?`${e.createdWithBrowser} on ${e.createdWithOs}`:`${e.createdWithBrowser}`:"Unknown device";const dy=tr.button`
|
|
2392
|
-
&& {
|
|
2393
|
-
width: 100%;
|
|
2394
|
-
font-size: 0.875rem;
|
|
2395
|
-
line-height: 1rem;
|
|
2396
|
-
|
|
2397
|
-
/* Tablet and Up */
|
|
2398
|
-
@media (min-width: 440px) {
|
|
2399
|
-
font-size: 14px;
|
|
2400
|
-
}
|
|
2401
|
-
|
|
2402
|
-
display: flex;
|
|
2403
|
-
gap: 12px;
|
|
2404
|
-
justify-content: center;
|
|
2405
|
-
|
|
2406
|
-
padding: 0.75rem 1rem;
|
|
2407
|
-
background-color: var(--privy-color-background);
|
|
2408
|
-
transition: background-color 200ms ease;
|
|
2409
|
-
color: var(--privy-color-accent);
|
|
2410
|
-
|
|
2411
|
-
:focus {
|
|
2412
|
-
outline: none;
|
|
2413
|
-
box-shadow: none;
|
|
2414
|
-
}
|
|
2415
|
-
}
|
|
2416
|
-
`;var cy,uy;let hy=Array(6).fill("");function py(e){return/^[0-9]{1}$/.test(e)}function my(e){return 6===e.length&&e.every(py)}(uy=cy||(cy={}))[uy.RESET_AFTER_DELAY=0]="RESET_AFTER_DELAY",uy[uy.CLEAR_ON_NEXT_VALID_INPUT=1]="CLEAR_ON_NEXT_VALID_INPUT";const fy=({onChange:n,disabled:a,errorReasonOverride:i,success:o})=>{let[l,s]=d(hy),[c,u]=d(null),[h,p]=d(null),m=async e=>{e.preventDefault();let t=e.currentTarget.value.replace(/\s+/g,"");if(""===t)return;let r=l.reduce(((e,t)=>e+Number(py(t))),0),a=t.split(""),i=!a.every(py),o=a.length+r>6;if(i)return u("Passcode can only be numbers"),void p(1);if(o)return u("Passcode must be exactly 6 numbers"),void p(1);u(null),p(null);let d=Number(e.currentTarget.name?.charAt(4)),c=[...t||[""]].slice(0,6-d),h=[...l.slice(0,d),...c,...l.slice(d+c.length)];s(h);let m=Math.min(Math.max(d+c.length,0),5),f=document.querySelector(`input[name=pin-${m}]`);if(f?.focus(),my(h))try{await n(h.join(""));let e=document.querySelector(`input[name=pin-${m}]`);e?.blur()}catch(e){p(1),u(e.message)}else try{await n(null)}catch(e){p(1),u(e.message)}},f=e=>{1===h&&(u(null),p(null));let t=[...l.slice(0,e),"",...l.slice(e+1)];if(s(t),e>0){let t=document.querySelector(`input[name=pin-${e-1}]`);t?.focus()}my(t)?n(t.join("")):n(null)},g=o?"success":!(!i&&!c)?"fail":"";return t(r,{children:e(gy,{children:[t("div",{children:l.map(((e,r)=>t("input",{name:`pin-${r}`,type:"text",value:l[r],onChange:m,onKeyUp:e=>{"Backspace"===e.key&&f(r)},inputMode:"numeric",autoFocus:0===r,pattern:"[0-9]",className:g,autoComplete:w?"one-time-code":"off",disabled:a},r)))}),t("div",{children:t(yy,{$fail:!!i||!!c,children:i||c})})]})})};let gy=tr.div`
|
|
2417
|
-
display: flex;
|
|
2418
|
-
flex-direction: column;
|
|
2419
|
-
width: 100%;
|
|
2420
|
-
gap: 8px;
|
|
2421
|
-
|
|
2422
|
-
@media (max-width: 440px) {
|
|
2423
|
-
margin-top: 8px;
|
|
2424
|
-
margin-bottom: 8px;
|
|
2425
|
-
}
|
|
2426
|
-
|
|
2427
|
-
> div:nth-child(1) {
|
|
2428
|
-
display: flex;
|
|
2429
|
-
justify-content: center;
|
|
2430
|
-
gap: 0.5rem;
|
|
2431
|
-
width: 100%;
|
|
2432
|
-
border-radius: var(--privy-border-radius-md);
|
|
2433
|
-
|
|
2434
|
-
> input {
|
|
2435
|
-
border: 1px solid var(--privy-color-foreground-4);
|
|
2436
|
-
background: var(--privy-color-background);
|
|
2437
|
-
border-radius: var(--privy-border-radius-md);
|
|
2438
|
-
padding: 8px 10px;
|
|
2439
|
-
height: 58px;
|
|
2440
|
-
width: 46px;
|
|
2441
|
-
text-align: center;
|
|
2442
|
-
font-size: 18px;
|
|
2443
|
-
}
|
|
2444
|
-
|
|
2445
|
-
> input:disabled {
|
|
2446
|
-
/* Use light-theme-bg-2 instead of disabled-bg for consistency with
|
|
2447
|
-
the callout bubble */
|
|
2448
|
-
background: var(--privy-color-background-2);
|
|
2449
|
-
}
|
|
2450
|
-
|
|
2451
|
-
> input:focus {
|
|
2452
|
-
border: 1px solid var(--privy-color-accent);
|
|
2453
|
-
}
|
|
2454
|
-
|
|
2455
|
-
> input:invalid {
|
|
2456
|
-
border: 1px solid var(--privy-color-error);
|
|
2457
|
-
}
|
|
2458
|
-
|
|
2459
|
-
> input.success {
|
|
2460
|
-
border: 1px solid var(--privy-color-success);
|
|
2461
|
-
}
|
|
2462
|
-
|
|
2463
|
-
> input.fail {
|
|
2464
|
-
border: 1px solid var(--privy-color-error);
|
|
2465
|
-
animation: shake 180ms;
|
|
2466
|
-
animation-iteration-count: 2;
|
|
2467
|
-
}
|
|
2468
|
-
}
|
|
2469
|
-
|
|
2470
|
-
@keyframes shake {
|
|
2471
|
-
0% {
|
|
2472
|
-
transform: translate(1px, 0px);
|
|
2473
|
-
}
|
|
2474
|
-
33% {
|
|
2475
|
-
transform: translate(-1px, 0px);
|
|
2476
|
-
}
|
|
2477
|
-
67% {
|
|
2478
|
-
transform: translate(-1px, 0px);
|
|
2479
|
-
}
|
|
2480
|
-
100% {
|
|
2481
|
-
transform: translate(1px, 0px);
|
|
2482
|
-
}
|
|
2483
|
-
}
|
|
2484
|
-
`,yy=tr.div`
|
|
2485
|
-
line-height: 20px;
|
|
2486
|
-
font-size: 13px;
|
|
2487
|
-
display: flex;
|
|
2488
|
-
justify-content: flex-start;
|
|
2489
|
-
width: 100%;
|
|
2490
|
-
|
|
2491
|
-
color: ${e=>e.$fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
|
|
2492
|
-
`;const wy=({onComplete:n,onReset:a,onClose:i})=>{let[o,l]=d(""),[s,c]=d(!1),[u,h]=d(null),[p,m]=d("enroll"),{initEnrollmentWithSms:f,submitEnrollmentWithSms:g}=Yg(),{app:y,data:w}=ye();function v(){w?.mfaEnrollmentFlow?.onSuccess(),n()}return u?t(ap,{error:u,backFn:()=>h(null),onClick:()=>h(null)}):e(r,"enroll"===p?{children:[t(od,{backFn:a,onClose:i},"header"),t(dc,{style:{marginBottom:"1.5rem"},children:t(wr,{})}),t(Zd,{children:"Set up SMS verification"}),t(Kd,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),e(Yd,{children:[t(_g,{onSubmit:async function({qualifiedPhoneNumber:e}){try{await f({phoneNumber:e}),l(e),m("verify")}catch(e){h(e)}},hideRecent:!0}),e(lc,{children:["By providing your mobile number, you agree to receive text messages from ",y?.name,". Some carrier charges may apply"]})]}),t(Sd,{})]}:s?{children:[t(od,{onClose:v},"header"),t(dc,{style:{marginBottom:"1.5rem"},children:t(Tr,{})}),t(Zd,{children:"SMS verification added"}),t(Kd,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),t(ec,{children:t(Hs,{onClick:v,children:"Done"})}),t(Sd,{})]}:{children:[t(od,{backFn:function(){"verify"===p?m("enroll"):a()},onClose:i},"header"),t(dc,{style:{marginBottom:"1.5rem"},children:t(wr,{})}),t(Zd,{children:"Enter enrollment code"}),e(Yd,{children:[t(fy,{onChange:async function(e){try{if(!e)return;await g({phoneNumber:o,mfaCode:e}),c(!0)}catch(e){if(Yu(e))throw Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.");if(Zu(e))throw Error("The code you entered is not valid");if(qu(e))throw Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.");throw Qu(e)?Error("Verification canceled"):Error("Unknown error")}}}),e(Kd,{children:["To continue, enter the 6-digit code sent to ",t("strong",{children:Oo(o)})]})]}),t(Sd,{})]})},vy=({size:e,authUrl:r})=>t(bp,{url:r,squareLogoElement:xn,size:e,fgColor:"#1F1F1F"}),Cy=({onComplete:n,onClose:a,onReset:i,totpInfo:o})=>{let[l,s]=d("enroll"),[c,u]=d(!1),{submitEnrollmentWithTotp:h}=Yg(),{data:p}=ye();function m(){p?.mfaEnrollmentFlow?.onSuccess(),n()}return e(r,"enroll"===l?{children:[t(od,{backFn:i,onClose:a},"header"),t(Zd,{children:"Scan QR code"}),t(Kd,{children:"Open your authenticator app and scan the QR code to continue."}),t(vc,{children:t(vy,{authUrl:o.authUrl,size:200})}),e(ec,{children:[t(yc,{children:t(dp,{itemName:"secret",text:o.secret})}),t(Hs,{onClick:function(){s("verify")},children:"Continue"})]}),t(Sd,{})]}:c?{children:[t(od,{onClose:m},"header"),t(dc,{style:{marginBottom:"1.5rem"},children:t(Tr,{})}),t(Zd,{children:"Authenticator app verification added"}),t(Kd,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),t(ec,{children:t(Hs,{onClick:m,children:"Done"})}),t(Sd,{})]}:{children:[t(od,{backFn:function(){"verify"===l?s("enroll"):i()},onClose:a},"header"),t(dc,{style:{marginBottom:"1.5rem"},children:t(En,{})}),t(Zd,{children:"Enter enrollment code"}),t(Yd,{children:t(fy,{onChange:async function(e){try{if(!e)return;await h({mfaCode:e}),u(!0)}catch(e){if(Yu(e))throw Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.");if(Zu(e))throw Error("The code you entered is not valid");if(qu(e))throw Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.");throw Qu(e)?Error("Verification canceled"):Error("Unknown error")}}})}),e(Kd,{children:["To continue, enter the 6-digit code generated from your ",t("strong",{children:"authenticator app"})]}),t(Sd,{})]})},by=({label:r,children:n,valueStyles:a})=>e(Ey,{children:[t("div",{children:r}),t($y,{style:{...a},children:n})]});let Ey=tr.div`
|
|
2493
|
-
display: flex;
|
|
2494
|
-
align-items: center;
|
|
2495
|
-
justify-content: space-between;
|
|
2496
|
-
width: 100%;
|
|
2497
|
-
|
|
2498
|
-
> :first-child {
|
|
2499
|
-
color: var(--privy-color-foreground-3);
|
|
2500
|
-
text-align: left;
|
|
2501
|
-
}
|
|
2502
|
-
|
|
2503
|
-
> :last-child {
|
|
2504
|
-
color: var(--privy-color-foreground-2);
|
|
2505
|
-
text-align: right;
|
|
2506
|
-
}
|
|
2507
|
-
`,$y=tr.div`
|
|
2508
|
-
font-size: 14px;
|
|
2509
|
-
line-height: 100%;
|
|
2510
|
-
display: flex;
|
|
2511
|
-
align-items: center;
|
|
2512
|
-
justify-content: center;
|
|
2513
|
-
border-radius: var(--privy-border-radius-full);
|
|
2514
|
-
background-color: var(--privy-color-background-2);
|
|
2515
|
-
padding: 4px 8px;
|
|
2516
|
-
`;const Ty=({weiQuantities:e,tokenPrice:r,tokenSymbol:n})=>{let a=Tm(e),i=r?Em(a,r):void 0,o=$m(a,n);return t(_y,{children:i||o})},Ay=({weiQuantities:n,tokenPrice:a,tokenSymbol:i})=>{let o=Tm(n),l=a?Em(o,a):void 0,s=$m(o,i);return t(_y,{children:l?e(r,{children:[t(ky,{children:"USD"}),"<$0.01"===l?e(Sy,{children:[t(Ny,{children:"<"}),"$0.01"]}):l]}):s})},xy=({quantities:n,tokenPrice:a})=>{let i=n.reduce(((e,t)=>e+t),0n),o=a?Hp(i,a):void 0,l=Gp(i);return t(_y,{children:o?t(r,{children:"<$0.01"===o?e(Sy,{children:[t(Ny,{children:"<"}),"$0.01"]}):o}):l})};let _y=tr.span`
|
|
2517
|
-
font-size: 14px;
|
|
2518
|
-
line-height: 140%;
|
|
2519
|
-
display: flex;
|
|
2520
|
-
gap: 4px;
|
|
2521
|
-
align-items: center;
|
|
2522
|
-
`,ky=tr.span`
|
|
2523
|
-
font-size: 12px;
|
|
2524
|
-
line-height: 12px;
|
|
2525
|
-
color: var(--privy-color-foreground-3);
|
|
2526
|
-
`,Ny=tr.span`
|
|
2527
|
-
font-size: 10px;
|
|
2528
|
-
`,Sy=tr.span`
|
|
2529
|
-
display: flex;
|
|
2530
|
-
align-items: center;
|
|
2531
|
-
`;const Iy=({gas:r,tokenPrice:n,tokenSymbol:a})=>e(bc,{style:{paddingBottom:"12px"},children:[e(Py,{children:[t(Ry,{children:"Est. Fees"}),t("div",{children:t(Ay,{weiQuantities:[r],tokenPrice:n,tokenSymbol:a})})]}),n&&t(My,{children:`${$m(r,a)}`})]}),Oy=({transactionData:r,gas:n,tokenPrice:a,tokenSymbol:i})=>{let o=ra(r.value||0).add(ra(n)).toHexString();return e(bc,{children:[e(Py,{children:[t(Ry,{children:"Total (including fees)"}),t("div",{children:t(Ay,{weiQuantities:[r.value||0,n],tokenPrice:a,tokenSymbol:i})})]}),a&&t(My,{children:$m(o,i)})]})};let Py=tr.div`
|
|
2532
|
-
display: flex;
|
|
2533
|
-
flex-direction: row;
|
|
2534
|
-
justify-content: space-between;
|
|
2535
|
-
align-items: center;
|
|
2536
|
-
padding-top: 4px;
|
|
2537
|
-
`,My=tr.div`
|
|
2538
|
-
display: flex;
|
|
2539
|
-
flex-direction: row;
|
|
2540
|
-
height: 12px;
|
|
2541
|
-
|
|
2542
|
-
font-size: 12px;
|
|
2543
|
-
line-height: 12px;
|
|
2544
|
-
color: var(--privy-color-foreground-3);
|
|
2545
|
-
font-weight: 400;
|
|
2546
|
-
`,Ry=tr.div`
|
|
2547
|
-
font-size: 14px;
|
|
2548
|
-
line-height: 22.4px;
|
|
2549
|
-
font-weight: 400;
|
|
2550
|
-
`;const Ly=h(void 0),Dy=h(void 0),Fy=({defaultValue:e,children:r})=>{let[n,a]=d(e||null);return t(Ly.Provider,{value:{activePanel:n,togglePanel:e=>{a(n===e?null:e)}},children:t(zy,{children:r})})},Uy=({value:e,children:r})=>{let{activePanel:n,togglePanel:a}=u(Ly),i=n===e;return t(Dy.Provider,{value:{onToggle:()=>a(e),value:e},children:t(qy,{isActive:i,"data-open":i,children:r})})},Wy=({children:n})=>{let{activePanel:a}=u(Ly),{onToggle:i,value:o}=u(Dy),l=a===o;return e(r,{children:[e(Gy,{onClick:i,"data-open":l,children:[t(Vy,{children:n}),t(Yy,{isactive:l,children:t(an,{height:"16px",width:"16px",strokeWidth:"2"})})]}),t(Hy,{})]})},By=({children:e})=>{let{activePanel:r}=u(Ly),{value:n}=u(Dy);return t(Zy,{"data-open":r===n,children:t(Ky,{children:e})})},jy=({children:e})=>{let{activePanel:r}=u(Ly),{value:n}=u(Dy);return t(Ky,{children:"function"==typeof e?e({isActive:r===n}):e})};let zy=tr.div`
|
|
2551
|
-
display: flex;
|
|
2552
|
-
flex-direction: column;
|
|
2553
|
-
width: 100%;
|
|
2554
|
-
gap: 8px;
|
|
2555
|
-
`,Gy=tr.div`
|
|
2556
|
-
display: flex;
|
|
2557
|
-
justify-content: space-between;
|
|
2558
|
-
align-items: center;
|
|
2559
|
-
width: 100%;
|
|
2560
|
-
cursor: pointer;
|
|
2561
|
-
padding-bottom: 8px;
|
|
2562
|
-
`,Hy=tr.div`
|
|
2563
|
-
width: 100%;
|
|
2564
|
-
|
|
2565
|
-
&& {
|
|
2566
|
-
border-top: 1px solid;
|
|
2567
|
-
border-color: var(--privy-color-foreground-4);
|
|
2568
|
-
}
|
|
2569
|
-
padding-bottom: 12px;
|
|
2570
|
-
`,Vy=tr.div`
|
|
2571
|
-
font-size: 14px;
|
|
2572
|
-
font-weight: 500;
|
|
2573
|
-
line-height: 19.6px;
|
|
2574
|
-
width: 100%;
|
|
2575
|
-
padding-right: 8px;
|
|
2576
|
-
`,qy=tr.div`
|
|
2577
|
-
display: flex;
|
|
2578
|
-
flex-direction: column;
|
|
2579
|
-
width: 100%;
|
|
2580
|
-
overflow: hidden;
|
|
2581
|
-
padding: 12px;
|
|
2582
|
-
|
|
2583
|
-
&& {
|
|
2584
|
-
border: 1px solid;
|
|
2585
|
-
border-color: var(--privy-color-foreground-4);
|
|
2586
|
-
border-radius: var(--privy-border-radius-md);
|
|
2587
|
-
}
|
|
2588
|
-
`,Zy=tr.div`
|
|
2589
|
-
position: relative;
|
|
2590
|
-
overflow: hidden;
|
|
2591
|
-
transition: max-height 25ms ease-out;
|
|
2592
|
-
|
|
2593
|
-
&[data-open='true'] {
|
|
2594
|
-
max-height: 700px;
|
|
2595
|
-
}
|
|
2596
|
-
|
|
2597
|
-
&[data-open='false'] {
|
|
2598
|
-
max-height: 0;
|
|
2599
|
-
}
|
|
2600
|
-
`,Ky=tr.div`
|
|
2601
|
-
display: flex;
|
|
2602
|
-
flex-direction: column;
|
|
2603
|
-
gap: 12px;
|
|
2604
|
-
flex: 1 1 auto;
|
|
2605
|
-
min-height: 1px;
|
|
2606
|
-
`,Yy=tr.div`
|
|
2607
|
-
transform: ${e=>e.isactive?"rotate(180deg)":"rotate(0deg)"};
|
|
2608
|
-
`;const Qy=({walletAddress:e,chainId:r=Qe,network:n,rpcEndpoint:a})=>t(Jy,{href:"ethereum"===n?Am(r,e):bt(e,Et(a||"")),target:"_blank",children:Be(e)});let Jy=tr.a`
|
|
2609
|
-
&:hover {
|
|
2610
|
-
text-decoration: underline;
|
|
2611
|
-
}
|
|
2612
|
-
`;const Xy=({from:r,to:n,txn:a,transactionInfo:i,tokenPrice:o,gas:l,tokenSymbol:s})=>{let d=a?.value||0;return t(Fy,{...Ue().render.standalone?{defaultValue:"details"}:{},children:e(Uy,{value:"details",children:[t(Wy,{children:e(ew,{children:[t("div",{children:i?.title||i?.actionDescription||"Details"}),t(tw,{children:t(Ty,{weiQuantities:[d],tokenPrice:o,tokenSymbol:s})})]})}),e(By,{children:[t(by,{label:"From",children:t(Qy,{walletAddress:r,chainId:a.chainId||Qe,network:"ethereum"})}),t(by,{label:"To",children:t(Qy,{walletAddress:n,chainId:a.chainId||Qe,network:"ethereum"})}),i&&i.action&&t(by,{label:"Action",children:i.action}),l&&t(Iy,{transactionData:a,gas:l,tokenPrice:o,tokenSymbol:s})]}),t(jy,{children:({isActive:e})=>t(Oy,{transactionData:a,displayFee:e,gas:l||"0x0",tokenPrice:o,tokenSymbol:s})})]})})};let ew=tr.div`
|
|
2613
|
-
display: flex;
|
|
2614
|
-
flex-direction: row;
|
|
2615
|
-
justify-content: space-between;
|
|
2616
|
-
`,tw=tr.div`
|
|
2617
|
-
flex-shrink: 0;
|
|
2618
|
-
padding-left: 8px;
|
|
2619
|
-
`;const rw=({pendingTransaction:e})=>{let{getAccessToken:r}=M(),{wallets:n}=G(),{walletProxy:a,rpcConfig:i,chains:o,appId:l,nativeTokenSymbolForChainId:s}=P(),[u,h]=d(null),[m,f]=d(e),{tokenPrice:g}=Lp(m.chainId),y=s(e.chainId)||"ETH",w=c((()=>n.find((e=>"privy"===e.walletClientType))),[n]);return p((()=>{(async function(){if(!await r()||!a||!w)return m;let e=fe(m.chainId,o,i,{appId:l}),t=await ya(w.address,m,e),{totalGasEstimate:n}=await fa(t,e);return h(n.toHexString()),t})().then(f).catch(console.error)}),[a]),w?t(nw,{children:t(Xy,{from:w.address,to:m.to,txn:m,gas:u??void 0,tokenPrice:g,tokenSymbol:y})}):null};let nw=tr.div`
|
|
2620
|
-
width: 100%;
|
|
2621
|
-
padding: 1rem 0;
|
|
2622
|
-
`;const aw=({hasBlockingError:n,error:a,onClose:i,onBack:o,handleSubmit:l,account:s,submitSuccess:d})=>{let{pendingTransaction:c}=P();return e(r,{children:[t(od,{onClose:i},"header"),t(pd,{children:e("div",{children:[t(Us,{success:d,fail:!!a}),t(a?dr:xm,{style:{width:"38px",height:"38px"}})]})}),t(Zd,{style:{marginTop:"1rem"},children:"Verifying with passkey"}),e(Qd,{children:[e(Xd,{children:[t(Jd,{children:t(Cn,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),e(Xd,{children:[t(Jd,{children:t(In,{})}),"You last added a passkey on"," ",s?.firstVerifiedAt?.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),"."]})]}),c&&t(Yd,{children:t(rw,{pendingTransaction:c})}),a&&e(r,{children:[t(cc,{style:{marginTop:"1.25rem"},children:a.message}),t(Hs,{disabled:n,onClick:l,style:{marginTop:"1.25rem"},children:"Try again"})]}),o&&t(sc,{style:{marginTop:"1rem"},onClick:o,children:"Choose another method"}),t(Sd,{})]})},iw=({open:n,onClose:a})=>{let{user:i}=M(),[o,l]=d(i?.mfaMethods[0]??null),{init:c,cancel:u,submit:h}=Kg(),[m,f]=d(!1),[g,y]=d(!1),[w,v]=d(null),[C,b]=d(null);p((()=>{l(i?.mfaMethods[0]??null)}),[i?.mfaMethods]);let E=s(!1);p((()=>{!E.current&&o&&n&&(E.current=!0,A(o).finally((()=>{E.current=!1})))}),[n]);let $=e=>Ku(e)?(f(!0),Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):Zu(e)?(f(!1),Error("The code you entered is not valid")):qu(e)?(f(!0),Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(console.error(e),f(!1),Error("Something went wrong."));async function T(e){b(null);try{if(!e||!o)return;await h(o,e),y(!0),f(!1),a()}catch(e){throw $(e)}}async function A(e){if("passkey"!==e)try{l(e),await c(e)}catch(e){console.error(e)}else try{l(e);let t=await c(e);if(!t)throw Error("something went wrong");v(t),await h(e,t),y(!0),f(!1),a()}catch(e){b($(e))}}let x=()=>{l(null),b(null),u(),a()};return n&&i?"passkey"===o?t(aw,{account:i.linkedAccounts.filter((e=>"passkey"===e.type&&e.enrolledInMfa)).sort(((e,t)=>t.firstVerifiedAt.valueOf()-e.firstVerifiedAt.valueOf()))[0],selectedMethod:o,submitSuccess:g,hasBlockingError:m,error:C,onClose:x,onBack:()=>{l(null),b(null)},handleSubmit:()=>T(w).catch(b)}):o?t(ow,{submitSuccess:g,hasBlockingError:m,handleSubmitCode:T,selectedMethod:o,onClose:x,onBack:i.mfaMethods.length>1?()=>l(null):void 0}):e(r,{children:[t(od,{onClose:x},"header"),t(dc,{style:{marginBottom:"1.5rem"},children:t(Cn,{})}),t(Zd,{children:"Verify your identity"}),t(Kd,{children:"Choose a verification method"}),e(tc,{children:[i.mfaMethods.includes("totp")&&e(Cd,{onClick:()=>A("totp"),children:[t(En,{}),"Authenticator App"]},"totp"),i.mfaMethods.includes("sms")&&e(Cd,{onClick:()=>A("sms"),children:[t(wr,{}),"SMS"]},"sms"),i.mfaMethods.includes("passkey")&&e(Cd,{onClick:()=>A("passkey"),children:[t($n,{}),"Passkey"]},"passkey")]}),t(Sd,{})]}):null};let ow=({selectedMethod:n,submitSuccess:a,hasBlockingError:i,onClose:o,onBack:l,handleSubmitCode:s})=>{let{app:d}=ye(),{pendingTransaction:c}=P();switch(n){case"sms":return e(r,{children:[t(od,{onClose:o},"header"),t(dc,{style:{marginBottom:"1.5rem"},children:t(wr,{})}),t(Zd,{children:"Enter verification code"}),e(Yd,{children:[t(fy,{success:a,disabled:i,onChange:s}),e(Kd,{children:["To continue, please enter the 6-digit code sent to your ",t("strong",{children:"mobile device"})]}),c&&t(rw,{pendingTransaction:c})]}),l&&t(sc,{theme:d?.appearance.palette.colorScheme,onClick:l,children:"Choose another method"}),t(Ys,{onClick:o,children:"Not now"}),t(Sd,{})]});case"totp":return e(r,{children:[t(od,{onClose:o},"header"),t(dc,{style:{marginBottom:"1.5rem"},children:t(En,{})}),t(Zd,{children:"Enter verification code"}),e(Yd,{children:[t(fy,{success:a,disabled:i,onChange:s}),e(Kd,{children:["To continue, please enter the 6-digit code generated from your"," ",t("strong",{children:"authenticator app"})]}),c&&t(rw,{pendingTransaction:c})]}),l&&t(sc,{theme:d?.appearance.palette.colorScheme,onClick:l,children:"Choose another method"}),t(Ys,{onClick:o,children:"Not now"}),t(Sd,{})]});default:return null}};let lw=tr.div`
|
|
2623
|
-
display: flex;
|
|
2624
|
-
flex-direction: column;
|
|
2625
|
-
align-items: center;
|
|
2626
|
-
justify-content: center;
|
|
2627
|
-
margin-left: 27px;
|
|
2628
|
-
margin-right: 27px;
|
|
2629
|
-
gap: 24px;
|
|
2630
|
-
`;let sw=tr.div`
|
|
2631
|
-
display: flex;
|
|
2632
|
-
flex-direction: column;
|
|
2633
|
-
align-items: center;
|
|
2634
|
-
justify-content: center;
|
|
2635
|
-
gap: 24px;
|
|
2636
|
-
width: 100%;
|
|
2637
|
-
`;tr.div`
|
|
2638
|
-
display: flex;
|
|
2639
|
-
align-items: center;
|
|
2640
|
-
justify-content: center;
|
|
2641
|
-
width: 180px;
|
|
2642
|
-
height: 90px;
|
|
2643
|
-
border-radius: 50%;
|
|
2644
|
-
svg + svg {
|
|
2645
|
-
margin-left: 12px;
|
|
2646
|
-
}
|
|
2647
|
-
> svg {
|
|
2648
|
-
z-index: 2;
|
|
2649
|
-
color: var(--privy-color-accent) !important;
|
|
2650
|
-
stroke: var(--privy-color-accent) !important;
|
|
2651
|
-
fill: var(--privy-color-accent) !important;
|
|
2652
|
-
}
|
|
2653
|
-
`;let dw=tr(yc)`
|
|
2654
|
-
margin: 16px auto;
|
|
2655
|
-
`;const cw=tr.div`
|
|
2656
|
-
display: flex;
|
|
2657
|
-
flex-direction: column;
|
|
2658
|
-
align-items: center;
|
|
2659
|
-
justify-content: center;
|
|
2660
|
-
margin: 20px 0;
|
|
2661
|
-
gap: 4px;
|
|
2662
|
-
|
|
2663
|
-
& h3 {
|
|
2664
|
-
font-size: 18px;
|
|
2665
|
-
font-style: normal;
|
|
2666
|
-
font-weight: 600;
|
|
2667
|
-
line-height: 24px;
|
|
2668
|
-
}
|
|
2669
|
-
|
|
2670
|
-
& p {
|
|
2671
|
-
max-width: 300px;
|
|
2672
|
-
font-size: 14px;
|
|
2673
|
-
font-style: normal;
|
|
2674
|
-
font-weight: 400;
|
|
2675
|
-
line-height: 20px;
|
|
2676
|
-
}
|
|
2677
|
-
`;let uw=tr.div`
|
|
2678
|
-
display: flex;
|
|
2679
|
-
flex-direction: column;
|
|
2680
|
-
justify-content: space-between;
|
|
2681
|
-
`,hw=tr.div`
|
|
2682
|
-
line-height: 20px;
|
|
2683
|
-
height: 20px;
|
|
2684
|
-
font-size: 13px;
|
|
2685
|
-
color: var(--privy-color-error);
|
|
2686
|
-
text-align: left;
|
|
2687
|
-
margin-top: 0.5rem;
|
|
2688
|
-
`,pw=tr(Hs)`
|
|
2689
|
-
${e=>e.hideAnimations&&rr`
|
|
2690
|
-
&& {
|
|
2691
|
-
// Remove animations because the recoverWallet task on the iframe partially
|
|
2692
|
-
// blocks the renderer, so the animation stutters and doesn't look good
|
|
2693
|
-
transition: none;
|
|
2694
|
-
}
|
|
2695
|
-
`}
|
|
2696
|
-
`;const mw=r=>e("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...r,children:[t("path",{fill:"url(#icloud-gradient)",d:"M12.34 7.315a4.26 4.26 0 0 0-3.707 2.18 2.336 2.336 0 0 0-1.02-.236 2.336 2.336 0 0 0-2.3 1.963 3.217 3.217 0 0 0 1.244 6.181c.135-.001.27-.01.404-.029h8.943c.047.004.094.006.141.007.045-.001.09-.004.135-.007h.214v-.016a2.99 2.99 0 0 0 1.887-.988c.487-.55.757-1.261.757-1.998v-.006a3.017 3.017 0 0 0-.69-1.915 2.992 2.992 0 0 0-1.748-1.034 4.26 4.26 0 0 0-4.26-4.102Z"}),t("defs",{children:e("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[t("stop",{stopColor:"#3E82F4"}),t("stop",{offset:1,stopColor:"#93DCF7"})]})})]}),fw=({style:r,...n})=>e("svg",{width:"16",height:"14",style:r,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:[e("g",{clipPath:"url(#clip0_2115_829)",children:[t("path",{d:"M2.34709 12.9404L2.3471 12.9404L2.34565 12.938L1.64031 11.7448L1.64004 11.7444L0.651257 10.0677C0.640723 10.0496 0.630746 10.0314 0.621325 10.0129H4.16461L2.39424 13.0139C2.3775 12.9901 2.36178 12.9656 2.34709 12.9404Z",fill:"#0066DA",stroke:"#6366F1"}),t("path",{d:"M8 4.48713L5.47995 0.215332C5.23253 0.358922 5.02176 0.556358 4.87514 0.80764L0.219931 8.70508C0.076007 8.95094 0.000191627 9.22937 0 9.51277H5.04009L8 4.48713Z",fill:"#00AC47"}),t("path",{d:"M13.48 13.7847C13.7274 13.6411 13.9382 13.4437 14.0848 13.1924L14.3781 12.6988L15.7801 10.3206C15.9267 10.0693 16.0001 9.79114 16.0001 9.51294H10.9596L12.0321 11.577L13.48 13.7847Z",fill:"#EA4335"}),t("path",{d:"M8.00003 4.48718L10.5201 0.215385C10.2726 0.0717949 9.98857 0 9.69533 0H6.30472C6.01148 0 5.7274 0.0807692 5.47998 0.215385L8.00003 4.48718Z",fill:"#00832D"}),t("path",{d:"M10.9599 9.51294H5.04007L2.52002 13.7847C2.76744 13.9283 3.05152 14.0001 3.34476 14.0001H12.6552C12.9484 14.0001 13.2325 13.9194 13.4799 13.7847L10.9599 9.51294Z",fill:"#2684FC"}),t("path",{d:"M13.4525 4.75636L11.1249 0.80764C10.9782 0.556358 10.7675 0.358922 10.52 0.215332L8 4.48713L10.9599 9.51277H15.9908C15.9908 9.23456 15.9175 8.95636 15.7709 8.70508L13.4525 4.75636Z",fill:"#FFBA00"})]}),t("defs",{children:t("clipPath",{id:"clip0_2115_829",children:t("rect",{width:"16",height:"14",fill:"white"})})})]}),gw=tr.div`
|
|
2697
|
-
display: flex;
|
|
2698
|
-
flex-direction: column;
|
|
2699
|
-
gap: 12px;
|
|
2700
|
-
padding-top: 24px;
|
|
2701
|
-
padding-bottom: 24px;
|
|
2702
|
-
`,yw=tr.div`
|
|
2703
|
-
padding-bottom: 24px;
|
|
2704
|
-
`;let ww={"google-drive":{name:"Google Drive",component:fw},icloud:{name:"iCloud",component:mw}};let vw=tr.div`
|
|
2705
|
-
width: 24px;
|
|
2706
|
-
height: 24px;
|
|
2707
|
-
display: flex;
|
|
2708
|
-
justify-content: center;
|
|
2709
|
-
align-items: center;
|
|
2710
|
-
`,Cw={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy"},bw=({onClose:n})=>e(yw,{children:[t(Ic,{title:"Why do I need to secure my account?",icon:t(ir,{width:48}),description:e(r,{children:[t("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),t("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. It’s important you don’t lose access to the method you choose."})]})}),t(Hs,{onClick:n,children:"Select backup method"})]});const Ew=tr.div`
|
|
2711
|
-
&& {
|
|
2712
|
-
border-width: 4px;
|
|
2713
|
-
}
|
|
2714
|
-
|
|
2715
|
-
display: flex;
|
|
2716
|
-
justify-content: center;
|
|
2717
|
-
align-items: center;
|
|
2718
|
-
padding: 1rem;
|
|
2719
|
-
aspect-ratio: 1;
|
|
2720
|
-
border-style: solid;
|
|
2721
|
-
border-color: ${e=>e.$color??"var(--privy-color-accent)"};
|
|
2722
|
-
border-radius: 50%;
|
|
2723
|
-
`;async function $w({tx:e,accessToken:t,walletProxy:r,entropyId:n,entropyIdVerifier:a,transactingWalletAddress:i,transactingWalletIndex:o}){let l=function(e,t){if(qp(e)){let r=e.message.staticAccountKeys.find((e=>e.toBase58()===t));if(!r)throw Error(`Transaction does not contain public key ${t}`);return r}let r=e.compileMessage().accountKeys.find((e=>e.toBase58()===t));if(!r)throw Error(`Transaction does not contain public key ${t}`);return r}(e,i),s=qp(e)?Buffer.from(e.message.serialize()):e.serializeMessage(),{response:d}=await r.rpc({accessToken:t,entropyId:n,entropyIdVerifier:a,chainType:"solana",hdWalletIndex:o,request:{method:"signMessage",params:{message:s.toString("base64")}}}),c=d.data.signature;e.addSignature(l,Buffer.from(c,"base64"))}async function Tw({tx:e,connection:t,accessToken:r,walletProxy:n,entropyId:a,entropyIdVerifier:i,transactingWalletAddress:o,transactingWalletIndex:l,transactionOptions:s}){let d;try{await $w({tx:e,accessToken:r,walletProxy:n,entropyId:a,entropyIdVerifier:i,transactingWalletAddress:o,transactingWalletIndex:l});let c=e.serialize();d=await t.sendRawTransaction(c,s);let u=await t.confirmTransaction(d);if(u.value.err||u.value.err){let e=u.value.err||u.value.err;if("string"==typeof e)throw Error(e);throw e}return{signature:d,receipt:await t.getParsedTransaction(d,{maxSupportedTransactionVersion:0})}}catch(e){throw e.txSignature=d,e}}const Aw=n=>{let{chain:i,transactionDetails:o,isTokenContractInfoLoading:l,symbol:s}=n,{action:d,functionName:c}=o;return t(Ou,{children:e(em,{children:["transaction"!==d&&e(tm,{children:[t(rm,{children:"Action"}),t(am,{children:c})]}),"mint"===c&&"args"in o&&o.args.filter((e=>e)).map(((r,n)=>e(tm,{children:[t(rm,{children:`Param ${n}`}),t(am,{children:"string"==typeof r&&a(r)?t(Id,{address:r,url:i?.blockExplorers?.default?.url,showCopyIcon:!1}):r?.toString()})]},n))),"setApprovalForAll"===c&&o.operator&&e(tm,{children:[t(rm,{children:"Operator"}),t(am,{children:t(Id,{address:o.operator,url:i?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),"setApprovalForAll"===c&&void 0!==o.approved&&e(tm,{children:[t(rm,{children:"Set approval to"}),t(am,{children:o.approved?"true":"false"})]}),"transfer"===c||"transferFrom"===c||"safeTransferFrom"===c||"approve"===c?e(r,{children:["formattedAmount"in o&&o.formattedAmount&&e(tm,{children:[t(rm,{children:"Amount"}),e(am,{$isLoading:l,children:[o.formattedAmount," ",s]})]}),"tokenId"in o&&o.tokenId&&e(tm,{children:[t(rm,{children:"Token ID"}),t(am,{children:o.tokenId.toString()})]})]}):null,"safeBatchTransferFrom"===c&&e(r,{children:["amounts"in o&&o.amounts&&e(tm,{children:[t(rm,{children:"Amounts"}),t(am,{children:o.amounts.join(", ")})]}),"tokenIds"in o&&o.tokenIds&&e(tm,{children:[t(rm,{children:"Token IDs"}),t(am,{children:o.tokenIds.join(", ")})]})]}),"approve"===c&&o.spender&&e(tm,{children:[t(rm,{children:"Spender"}),t(am,{children:t(Id,{address:o.spender,url:i?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===c||"safeTransferFrom"===c||"safeBatchTransferFrom"===c)&&o.transferFrom&&e(tm,{children:[t(rm,{children:"Transferring from"}),t(am,{children:t(Id,{address:o.transferFrom,url:i?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===c||"safeTransferFrom"===c||"safeBatchTransferFrom"===c)&&o.transferTo&&e(tm,{children:[t(rm,{children:"Transferring to"}),t(am,{children:t(Id,{address:o.transferTo,url:i?.blockExplorers?.default?.url,showCopyIcon:!1})})]})]})})},xw=({transactionIndex:e,maxIndex:t})=>"number"!=typeof e||0===t?"":` (${e+1} / ${t+1})`,_w=({img:n,submitError:a,prepareError:i,onClose:o,action:l,title:s,subtitle:c,total:u,txValue:h,to:p,network:m,missingFunds:f,fee:g,from:y,cta:w,disabled:v,chain:C,isSubmitting:b,isPreparing:E,isTokenPriceLoading:$,isTokenContractInfoLoading:T,isSponsored:A,symbol:x,balance:_,onClick:k,transactionDetails:N,transactionIndex:S,maxIndex:I,onBack:O,chainName:P})=>{let{showTransactionDetails:M,setShowTransactionDetails:R,hasMoreDetails:L,isErc20Ish:D}=(e=>{let[t,r]=d(!1),n=!0,a=!1;return(!e||e.isErc20Ish||"transaction"===e.action)&&(n=!1),n&&(a=Object.entries(e||{}).some((([e,t])=>t&&!["action","isErc20Ish","isNFTIsh"].includes(e)))),{showTransactionDetails:t,setShowTransactionDetails:r,hasMoreDetails:n&&a,isErc20Ish:e?.isErc20Ish}})(N);return e(r,{children:[t(od,{onClose:o,backFn:O}),n&&t(Sw,{children:n}),e(lh,{style:{marginTop:n?"1.5rem":0},children:[s,t(xw,{maxIndex:I,transactionIndex:S})]}),t(oh,{children:c}),e(em,{style:{marginTop:"2rem"},children:[D&&e(r,{children:["approve"===l&&e(tm,{children:[t(rm,{children:"Action"}),t(am,{children:N?.action})]}),e(tm,{children:[t(rm,{children:"Amount"}),e(am,{$isLoading:D&&T,children:[N?.formattedAmount," ",x]})]})]}),u&&e(tm,{children:[t(rm,{children:"Total"}),t(am,{$isLoading:E||$,children:u})]}),N&&"spender"in N&&N?.spender?e(tm,{children:[t(rm,{children:"Spender"}),t(am,{children:t(Id,{address:N.spender,url:C?.blockExplorers?.default?.url,showCopyIcon:!1})})]}):null,p&&e(tm,{children:[t(rm,{children:"To"}),t(am,{children:t(Id,{address:p,url:C?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),e(tm,{children:[t(rm,{children:"Network"}),t(am,{children:m})]}),e(tm,{children:[t(rm,{children:"Estimated fee"}),t(am,{$isLoading:E||$||void 0===A,children:A?"Sponsored":g})]}),L&&e(r,{children:[t(tm,{className:"cursor-pointer",onClick:()=>R(!M),children:e(nm,{className:"flex items-center gap-x-1",children:["Details"," ",t(Mn,{style:{width:"0.75rem",marginLeft:"0.25rem",transform:M?"rotate(180deg)":void 0}})]})}),M&&N&&t(Aw,{action:l,chain:C,transactionDetails:N,isTokenContractInfoLoading:T,symbol:x})]})]}),t(md,{}),a?t(Nu,{style:{marginTop:"2rem"},children:a.message}):i?t(Nu,{style:{marginTop:"2rem"},children:Nw}):null,t(kw,{$useSmallMargins:!(!i&&!a),title:Number(h)>0?void 0:!1!==A?"Your wallet":void 0,address:y,balance:_,isLoading:E||$,errMsg:E||i||a||!f?void 0:`Add funds on ${C?.name??P} to complete transaction.`}),t(Hs,{style:{marginTop:"1rem"},loading:b,disabled:v||E,onClick:k,children:w}),t(Nd,{})]})};let kw=tr(Pu)`
|
|
2724
|
-
${e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;"}
|
|
2725
|
-
`,Nw="There was an error preparing your transaction. Your transaction request will likely fail.",Sw=tr.div`
|
|
2726
|
-
display: flex;
|
|
2727
|
-
width: 100%;
|
|
2728
|
-
justify-content: center;
|
|
2729
|
-
max-height: 40px;
|
|
2730
|
-
|
|
2731
|
-
> img {
|
|
2732
|
-
object-fit: contain;
|
|
2733
|
-
border-radius: var(--privy-border-radius-sm);
|
|
2734
|
-
}
|
|
2735
|
-
`,Iw=new Set([Ln.CALL_EXCEPTION,Ln.NONCE_EXPIRED,Ln.REPLACEMENT_UNDERPRICED,Ln.TRANSACTION_REPLACED]);const Ow=e=>{let t;return e.code&&-32e3!==e.code&&Iw.has(e.code)&&(t=e.transactionHash),t},Pw=e=>"SERVER_ERROR"===e.code?e.error?.message??e.reason??e.message??"unknown error":"SERVER_ERROR"===e.error?.code?e.error?.error?.message??e.reason??e.message??"unknown error":e.reason??e.message??"unknown error";let Mw=()=>e(Uw,{children:[t(Bw,{}),t(Ww,{})]});const Rw=({transactionError:n,chainId:a,onClose:i,onRetry:o,network:l,connection:s})=>{let{chains:c}=P(),[u,h]=d(!1),{errorCode:p,transactionHash:m,errorMessage:f}=((e,t)=>{if("ethereum"===t)return{errorCode:e.code?e.code?.toString().charAt(0)+e.code?.toString().slice(1).replace("_"," ").toLowerCase():"Something went wrong.",transactionHash:Ow(e),errorMessage:Pw(e)};let r=e.txSignature,n=e?.transactionMessage||"Something went wrong.";if(Array.isArray(e.logs)){let t=e.logs.find((e=>/insufficient (lamports|funds)/gi.test(e)));t&&(n=t)}return{transactionHash:r,errorMessage:n}})(n,l),g=(({chains:e,chainId:t,network:r,connection:n,transactionHash:a})=>"ethereum"===r?e.find((e=>e.id===t))?.blockExplorers?.default.url??"https://etherscan.io":$t(a||"",Et(n?.rpcEndpoint||"")))({chains:c,chainId:a,network:l,connection:s,transactionHash:m});return e(r,{children:[t(od,{onClose:i}),e(Lw,{children:[t(Mw,{}),t(Dw,{children:p}),t(Fw,{children:"Please try again."}),e(Gw,{children:[t(zw,{children:"Error message"}),t(Vw,{$clickable:!1,children:f})]}),m&&e(Gw,{children:[t(zw,{children:"Transaction hash"}),e(Hw,{children:["Copy this hash to view details about the transaction on a"," ",t("u",{children:t("a",{href:g,children:"block explorer"})}),"."]}),e(Vw,{$clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(m),h(!0)},children:[m,t(Kw,{clicked:u})]})]}),t(jw,{onClick:()=>o({resetNonce:!!m}),children:"Retry transaction"})]}),t(Sd,{})]})};let Lw=tr.div`
|
|
2736
|
-
display: flex;
|
|
2737
|
-
flex-direction: column;
|
|
2738
|
-
align-items: center;
|
|
2739
|
-
justify-content: center;
|
|
2740
|
-
`,Dw=tr.span`
|
|
2741
|
-
color: var(--privy-color-foreground);
|
|
2742
|
-
text-align: center;
|
|
2743
|
-
font-size: 1.125rem;
|
|
2744
|
-
font-weight: 500;
|
|
2745
|
-
line-height: 1.25rem; /* 111.111% */
|
|
2746
|
-
text-align: center;
|
|
2747
|
-
margin: 10px;
|
|
2748
|
-
`,Fw=tr.span`
|
|
2749
|
-
margin-top: 4px;
|
|
2750
|
-
margin-bottom: 10px;
|
|
2751
|
-
color: var(--privy-color-foreground-3);
|
|
2752
|
-
text-align: center;
|
|
2753
|
-
|
|
2754
|
-
font-size: 0.875rem;
|
|
2755
|
-
font-style: normal;
|
|
2756
|
-
font-weight: 400;
|
|
2757
|
-
line-height: 20px; /* 142.857% */
|
|
2758
|
-
letter-spacing: -0.008px;
|
|
2759
|
-
`,Uw=tr.div`
|
|
2760
|
-
position: relative;
|
|
2761
|
-
width: 60px;
|
|
2762
|
-
height: 60px;
|
|
2763
|
-
margin: 10px;
|
|
2764
|
-
display: flex;
|
|
2765
|
-
justify-content: center;
|
|
2766
|
-
align-items: center;
|
|
2767
|
-
`,Ww=tr(pr)`
|
|
2768
|
-
position: absolute;
|
|
2769
|
-
width: 35px;
|
|
2770
|
-
height: 35px;
|
|
2771
|
-
color: var(--privy-color-error);
|
|
2772
|
-
`,Bw=tr.div`
|
|
2773
|
-
position: absolute;
|
|
2774
|
-
width: 60px;
|
|
2775
|
-
height: 60px;
|
|
2776
|
-
border-radius: 50%;
|
|
2777
|
-
background-color: var(--privy-color-error);
|
|
2778
|
-
opacity: 0.1;
|
|
2779
|
-
`,jw=tr(Hs)`
|
|
2780
|
-
&& {
|
|
2781
|
-
margin-top: 24px;
|
|
2782
|
-
}
|
|
2783
|
-
transition: color 350ms ease, background-color 350ms ease;
|
|
2784
|
-
`,zw=tr.span`
|
|
2785
|
-
width: 100%;
|
|
2786
|
-
text-align: left;
|
|
2787
|
-
font-size: 0.825rem;
|
|
2788
|
-
color: var(--privy-color-foreground);
|
|
2789
|
-
padding: 4px;
|
|
2790
|
-
`,Gw=tr.div`
|
|
2791
|
-
width: 100%;
|
|
2792
|
-
margin: 5px;
|
|
2793
|
-
display: flex;
|
|
2794
|
-
flex-direction: column;
|
|
2795
|
-
justify-content: center;
|
|
2796
|
-
align-items: center;
|
|
2797
|
-
`,Hw=tr.text`
|
|
2798
|
-
position: relative;
|
|
2799
|
-
width: 100%;
|
|
2800
|
-
padding: 5px;
|
|
2801
|
-
font-size: 0.8rem;
|
|
2802
|
-
color: var(--privy-color-foreground-3);
|
|
2803
|
-
text-align: left;
|
|
2804
|
-
word-wrap: break-word;
|
|
2805
|
-
`,Vw=tr.span`
|
|
2806
|
-
position: relative;
|
|
2807
|
-
width: 100%;
|
|
2808
|
-
background-color: var(--privy-color-background-2);
|
|
2809
|
-
padding: 8px 12px;
|
|
2810
|
-
border-radius: 10px;
|
|
2811
|
-
margin-top: 5px;
|
|
2812
|
-
font-size: 14px;
|
|
2813
|
-
color: var(--privy-color-foreground-3);
|
|
2814
|
-
text-align: left;
|
|
2815
|
-
word-wrap: break-word;
|
|
2816
|
-
${e=>e.$clickable&&"cursor: pointer;\n transition: background-color 0.3s;\n padding-right: 45px;\n\n &:hover {\n background-color: var(--privy-color-foreground-4);\n }"}
|
|
2817
|
-
`,qw=tr(Rn)`
|
|
2818
|
-
position: absolute;
|
|
2819
|
-
top: 13px;
|
|
2820
|
-
right: 13px;
|
|
2821
|
-
width: 24px;
|
|
2822
|
-
height: 24px;
|
|
2823
|
-
`,Zw=tr(Pr)`
|
|
2824
|
-
position: absolute;
|
|
2825
|
-
top: 13px;
|
|
2826
|
-
right: 13px;
|
|
2827
|
-
width: 24px;
|
|
2828
|
-
height: 24px;
|
|
2829
|
-
`,Kw=({clicked:e})=>t(e?Zw:qw,{});const Yw=({instructions:n,fees:a,transactionInfo:i,solPrice:o,rpcEndpoint:l})=>{let s=n.reduce(((e,{amount:t})=>t?e+t:e),0n),[c,u]=d(0),[h,m]=d(!1),f=n[c];return p((()=>{u(0)}),[n]),e(em,{children:[e(tm,{children:[t(rm,{children:"Total"}),t(am,{children:t(xy,{quantities:[s,a],tokenPrice:o})})]}),i&&i.action&&e(tm,{children:[t(rm,{children:"Action"}),t(am,{children:i.action})]}),e(tm,{children:[t(rm,{children:"Fees"}),t(am,{children:t(xy,{quantities:[a||0n],tokenPrice:o})})]}),n.length>1?e(r,{children:[t(tm,{children:e(nv,{onClick:()=>m((e=>!e)),children:[t("span",{children:"Details"}),t(an,{height:"16px",width:"16px",strokeWidth:"2",style:{transition:"all 300ms",transform:h?"rotate(180deg)":void 0}})]})}),h&&t(tm,{children:e(Jw,{children:[e(Xw,{children:[e(ev,{children:[c+1," of ",n.length," instructions"]}),e(rv,{children:[c>0&&t(rd,{backFn:()=>u((e=>e-1))}),c<n.length-1&&t(nd,{nextFn:()=>u((e=>e+1))})]})]}),t(tv,{children:t(Qw,{instruction:f,rpcEndpoint:l,solPrice:o})})]})})]}):t(Qw,{instruction:f,rpcEndpoint:l,solPrice:o,hideAmount:!0})]})};function Qw({instruction:r,rpcEndpoint:n,solPrice:a,hideAmount:i}){return r?e(em,{children:[!i&&!!r.amount&&e(tm,{children:[t(rm,{children:"Amount"}),t(am,{children:t(xy,{quantities:[r.amount],tokenPrice:a})})]}),r.to&&e(tm,{children:[t(rm,{children:"To"}),t(am,{children:t(Qy,{walletAddress:r.to,rpcEndpoint:n,network:"solana"})})]}),r.from&&e(tm,{children:[t(rm,{children:"From"}),t(am,{children:t(Qy,{walletAddress:r.from,rpcEndpoint:n,network:"solana"})})]})]}):null}let Jw=tr.div`
|
|
2830
|
-
display: flex;
|
|
2831
|
-
flex-direction: column;
|
|
2832
|
-
width: 100%;
|
|
2833
|
-
overflow: hidden;
|
|
2834
|
-
|
|
2835
|
-
&& {
|
|
2836
|
-
border: 1px solid;
|
|
2837
|
-
border-color: var(--privy-color-foreground-4);
|
|
2838
|
-
border-radius: var(--privy-border-radius-md);
|
|
2839
|
-
}
|
|
2840
|
-
`,Xw=tr.header`
|
|
2841
|
-
display: flex;
|
|
2842
|
-
justify-content: space-between;
|
|
2843
|
-
align-items: center;
|
|
2844
|
-
padding: 12px;
|
|
2845
|
-
background-color: var(--privy-color-background-2);
|
|
2846
|
-
`,ev=tr.h4`
|
|
2847
|
-
font-size: 14px;
|
|
2848
|
-
font-weight: 500;
|
|
2849
|
-
line-height: 19.6px;
|
|
2850
|
-
`,tv=tr.div`
|
|
2851
|
-
padding: 12px;
|
|
2852
|
-
`,rv=tr.div`
|
|
2853
|
-
display: flex;
|
|
2854
|
-
gap: 8px;
|
|
2855
|
-
align-items: center;
|
|
2856
|
-
`,nv=tr(rm)`
|
|
2857
|
-
cursor: pointer;
|
|
2858
|
-
display: inline-flex;
|
|
2859
|
-
gap: 8px;
|
|
2860
|
-
align-items: center;
|
|
2861
|
-
`;const av=({instructions:n,fees:a,onClose:i,receiptHeader:o,receiptDescription:l,transactionInfo:s,solPrice:d,rpcEndpoint:c})=>e(r,{children:[t(od,{onClose:i}),t(pd,{style:{marginBottom:"16px"},children:e("div",{children:[t(td,{color:"var(--privy-color-success-light)"}),t(Tr,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),t(Ic,{title:o??"Transaction completed successfully.",description:l??""}),t(Yw,{solPrice:d,instructions:n,fees:a,transactionInfo:s,rpcEndpoint:c}),t(md,{}),t(iv,{loading:!1,onClick:i,children:"Close"}),t(Ac,{}),t(Nd,{})]});let iv=tr(Hs)`
|
|
2862
|
-
&& {
|
|
2863
|
-
margin-top: 24px;
|
|
2864
|
-
}
|
|
2865
|
-
transition: color 350ms ease, background-color 350ms ease;
|
|
2866
|
-
`;async function ov({accessToken:e,entropyId:t,entropyIdVerifier:r,transactingWallet:n,walletProxy:a,transactionRequest:i,provider:o,requesterAppId:l}){!function(e){for(let t of["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"]){let r=e[t];if(void 0!==r&&!function(e){let t="number"==typeof e,r="bigint"==typeof e,n="string"==typeof e&&/^-?0x[a-f0-9]+$/i.test(e);return t||r||n}(r))throw Error(`Transaction request property '${t}' must be a valid number, bigint, or hex string representing a quantity`)}if("number"!=typeof e.chainId)throw Error("Transaction request property 'chainId' must be a number")}(i=Object.assign({chainId:Qe},i));let s=(await a.rpc({entropyId:t,entropyIdVerifier:r,hdWalletIndex:n.walletIndex??0,chainType:"ethereum",accessToken:e,requesterAppId:l,request:{method:"eth_signTransaction",params:[i]}})).response.data;return await o.sendTransaction(s)}async function lv(e,t,r,n){let a=await n.getBalance(e),i=t.value||0,o=!a.sub(ra(i)).sub(r).isNegative();return{balance:a,hasSufficientFunds:o}}function sv(e){return{to:e.to,from:e.from,contractAddress:e.contractAddress,transactionIndex:e.transactionIndex,root:e.root,logsBloom:e.logsBloom,blockHash:e.blockHash,transactionHash:e.transactionHash,logs:e.logs,blockNumber:e.blockNumber,confirmations:e.confirmations,byzantium:e.byzantium,type:e.type,status:e.status,gasUsed:e.gasUsed.toHexString(),cumulativeGasUsed:e.cumulativeGasUsed.toHexString(),effectiveGasPrice:e.effectiveGasPrice?e.effectiveGasPrice.toHexString():void 0}}let dv=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=on.from(e.gasUsed),n=on.from(e.effectiveGasPrice),a=r.mul(n);if(t){let e=on.from(t);a=a.add(e)}return a.toString()}catch(e){return}};const cv=({txn:n,receipt:a,transactionInfo:i,onClose:o,tokenPrice:l,tokenSymbol:s,l1GasEstimate:d,receiptHeader:c,receiptDescription:u})=>e(r,{children:[t(od,{onClose:o}),t(Nc,{title:c??"Transaction complete!",description:u??"You're all set."}),t(Xy,{tokenPrice:l,from:a.from,to:a.to,gas:dv(a,d),txn:n,transactionInfo:i,tokenSymbol:s}),t(md,{}),t(uv,{loading:!1,onClick:o,children:"All Done"}),t(Ac,{}),t(Nd,{})]});let uv=tr(Hs)`
|
|
2867
|
-
&& {
|
|
2868
|
-
margin-top: 24px;
|
|
2869
|
-
}
|
|
2870
|
-
transition: color 350ms ease, background-color 350ms ease;
|
|
2871
|
-
`;const hv=[{constant:!1,inputs:[{name:"_salt",type:"bytes32"},{name:"_initializer",type:"bytes"}],name:"deployAccount",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],pv=[{name:"from",type:"address"},{name:"param2",type:"address"},{name:"param3",type:"bytes"},{name:"param4",type:"tuple",components:[]},{type:"tuple",components:[{name:"param5",type:"address"},{name:"param6",type:"uint256"},{name:"param7",type:"uint256"},{name:"encodedInitData",type:"bytes"}]}],mv=[{constant:!1,inputs:[{name:"spender",type:"address"},{name:"value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],fv=[{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"mint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"quantity",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"quantity",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"},{internalType:"uint256[]",name:"quantities",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mintBatch",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"},{internalType:"uint256[]",name:"quantities",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"mintBatch",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"uint256",name:"quantity",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"quantity",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"safeMint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"string",name:"uri",type:"string"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"string",name:"uri",type:"string"}],name:"safeMint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeMint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"string",name:"uri",type:"string"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"string",name:"uri",type:"string"}],name:"safeMint",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"batchMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"batchMint",outputs:[],stateMutability:"payable",type:"function"}],gv=[{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],yv=[{constant:!1,inputs:[{name:"_operator",type:"address"},{name:"_approved",type:"bool"}],name:"setApprovalForAll",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],wv=[{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenId",type:"uint256"}],name:"transferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],vv=[{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenIds",type:"uint256[]"},{name:"_amounts",type:"uint256[]"},{name:"_data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],Cv=[{constant:!1,inputs:[{name:"_from",type:"address"},{name:"_to",type:"address"},{name:"_tokenId",type:"uint256"},{name:"_amount",type:"uint256"},{name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],bv=(e,t)=>{let r=Ev(mv,e);if(r)return{action:"approve",functionName:"approve",isErc20Ish:!0,isNFTIsh:!1,spender:r.args[0],amount:r.args[1]};let n=Ev(of,e);if(n)return{action:"transfer",functionName:"transfer",isErc20Ish:!0,isNFTIsh:!1,amount:n.args[1]};if(!t)return{action:"transaction",functionName:"",isErc20Ish:!1,isNFTIsh:!1};let a=Ev(hv,e);if(a&&"string"==typeof a.args[1]){let e=$v(a.args[1]);if(e&&e[4].encodedInitData)return bv(e[4].encodedInitData,t)}let i=Ev(yv,e);if(i)return{action:"approve",functionName:"setApprovalForAll",isNFTIsh:!0,isErc20Ish:!1,operator:i.args[0],approved:i.args[1]};let o=Ev(wv,e);if(o)return{action:"transfer",functionName:"transferFrom",isNFTIsh:!0,isErc20Ish:!1,transferFrom:o.args[0],transferTo:o.args[1],tokenId:o.args[2]};let l=Ev(gv,e);if(l)return{action:"transfer",functionName:"safeTransferFrom",isNFTIsh:!0,isErc20Ish:!1,transferFrom:l.args[0],transferTo:l.args[1],tokenId:l.args[2]};let s=Ev(Cv,e);if(s)return{action:"transfer",functionName:"safeTransferFrom",isNFTIsh:!0,isErc20Ish:!1,transferFrom:s.args[0],transferTo:s.args[1],tokenId:s.args[2],amount:s.args[3]};let d=Ev(vv,e);if(d)return{action:"batch transfer",functionName:"safeBatchTransferFrom",isNFTIsh:!0,isErc20Ish:!1,transferFrom:d.args[0],transferTo:d.args[1],tokenIds:d.args[2],amounts:d.args[3]};let c=Ev(fv,e);return c?{action:"mint",functionName:c.functionName,isNFTIsh:!0,isErc20Ish:!1,args:c.args}:{action:"transaction",isErc20Ish:!1,isNFTIsh:!1}};let Ev=(e,t)=>{try{let r=Hr({abi:e,data:t});return{functionName:r.functionName,args:r.args||[]}}catch(e){return null}},$v=e=>{try{if("string"==typeof e)return Vr(pv,`0x${e.slice(10)}`)}catch(e){return null}};const Tv=(e,t,r)=>{let[n,a]=d(null),{getAccessToken:i}=M(),{walletProxy:o}=P();return p((()=>{n&&a(null),(async()=>{if(!await i()||!o||!t)return null;let n=[],a=await ya(t.address,e,r).catch((t=>(n.push(t),e))),{totalGasEstimate:l,l1ExecutionFeeEstimate:s}=await fa(a,r).catch((e=>(n.push(e),{totalGasEstimate:null,l1ExecutionFeeEstimate:null}))),{balance:d,hasSufficientFunds:c}=await lv(t.address,a,l??on.from(0),r).catch((e=>(n.push(e),{balance:null,hasSufficientFunds:!1})));return{tx:a,totalGasEstimate:l,l1ExecutionFeeEstimate:s,balance:d,hasFunds:c,errors:n}})().then(a)}),[e]),n};let Av=new Ht(new Zt("There was an issue preparing your transaction",Kt.E32603_DEFAULT_INTERNAL_ERROR.eipCode)),xv=(e,t)=>e?.sendTransaction?"transactionRequest"in e.sendTransaction?e.sendTransaction.transactionRequest:e.sendTransaction.transactionRequests[t]:void 0;const _v=tr.img`
|
|
2872
|
-
&& {
|
|
2873
|
-
height: ${e=>"sm"===e.size?"65px":"140px"};
|
|
2874
|
-
width: ${e=>"sm"===e.size?"65px":"140px"};
|
|
2875
|
-
border-radius: 16px;
|
|
2876
|
-
margin-bottom: 12px;
|
|
2877
|
-
}
|
|
2878
|
-
`;let kv=e=>{if(!Mt(e))return e;try{return Dn(e)}catch{return e}},Nv=e=>JSON.stringify(e,null,2),Sv=({data:r})=>{let n=r=>"object"==typeof r&&null!==r?t(Pv,{children:Object.entries(r).map((([t,r])=>e("li",{children:[e("strong",{children:[t,":"]})," ",n(r)]},t)))}):t("span",{children:String(r)});return t("div",{children:n(r)})},Iv=n=>{let{types:a,primaryType:i,...o}=n.typedData;return e(r,{children:[t(Ov,{children:t(Sv,{data:o})}),t(dp,{text:Nv(n.typedData),itemName:"full payload to clipboard"})," "]})};let Ov=tr.div`
|
|
2879
|
-
margin-top: 1.5rem;
|
|
2880
|
-
background-color: var(--privy-color-background-2);
|
|
2881
|
-
border-radius: var(--privy-border-radius-md);
|
|
2882
|
-
padding: 12px;
|
|
2883
|
-
text-align: left;
|
|
2884
|
-
max-height: 310px;
|
|
2885
|
-
overflow: scroll;
|
|
2886
|
-
white-space: pre-wrap;
|
|
2887
|
-
width: 100%;
|
|
2888
|
-
|
|
2889
|
-
// hide the scrollbars
|
|
2890
|
-
-ms-overflow-style: none; /* Internet Explorer 10+ */
|
|
2891
|
-
scrollbar-width: none; /* Firefox */
|
|
2892
|
-
|
|
2893
|
-
&::-webkit-scrollbar {
|
|
2894
|
-
display: none; /* Safari and Chrome */
|
|
2895
|
-
}
|
|
2896
|
-
}
|
|
2897
|
-
`,Pv=tr.ul`
|
|
2898
|
-
margin-left: 12px !important;
|
|
2899
|
-
white-space: nowrap;
|
|
2900
|
-
|
|
2901
|
-
&:first-child {
|
|
2902
|
-
margin-left: 0 !important;
|
|
2903
|
-
}
|
|
2904
|
-
|
|
2905
|
-
strong {
|
|
2906
|
-
font-weight: 500 !important;
|
|
2907
|
-
}
|
|
2908
|
-
}
|
|
2909
|
-
`,Mv=tr.div`
|
|
2910
|
-
line-height: 20px;
|
|
2911
|
-
height: 20px;
|
|
2912
|
-
font-size: 13px;
|
|
2913
|
-
color: ${e=>e.$fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"};
|
|
2914
|
-
display: flex;
|
|
2915
|
-
justify-content: flex-start;
|
|
2916
|
-
width: 100%;
|
|
2917
|
-
margin-top: 16px;
|
|
2918
|
-
margin-bottom: 4px;
|
|
2919
|
-
`,Rv=tr.span`
|
|
2920
|
-
display: flex;
|
|
2921
|
-
align-items: center;
|
|
2922
|
-
gap: 8px;
|
|
2923
|
-
`,Lv=tr.div`
|
|
2924
|
-
display: flex;
|
|
2925
|
-
flex-direction: column;
|
|
2926
|
-
justify-content: center;
|
|
2927
|
-
align-items: center;
|
|
2928
|
-
width: 100%;
|
|
2929
|
-
height: 82px;
|
|
2930
|
-
`,Dv=tr.div`
|
|
2931
|
-
flex-grow: 1;
|
|
2932
|
-
`;let Fv=tr.div`
|
|
2933
|
-
display: flex;
|
|
2934
|
-
flex-direction: column;
|
|
2935
|
-
align-items: center;
|
|
2936
|
-
justify-content: center;
|
|
2937
|
-
margin-left: 27px;
|
|
2938
|
-
margin-right: 27px;
|
|
2939
|
-
gap: 24px;
|
|
2940
|
-
`;const Uv=g(((n,a)=>{let[i,o]=d(""),[l,s]=d(""),[c,u]=d(!1),{authenticated:h,user:p}=M(),{initUpdateEmail:m}=P(),{navigate:f,setModalData:g,currentScreen:y}=ye(),{enabled:w,token:v}=Ll(),C=Ue(),b=vt(i)&&(C.disablePlusEmails&&i.includes("+")?(l||s("Please enter a valid email address without a '+'."),!1):(l&&s(""),!0)),E=c||!b,$=()=>{!w||v||h?(async e=>{if(!p?.email)throw Error("User is required to have an email address to update it.");u(!0);try{await m(p.email.address,i,e),f(We.AWAITING_PASSWORDLESS_CODE)}catch(e){g({errorModalData:{error:e,previousScreen:y||We.LANDING}})}u(!1)})(v):(g({captchaModalData:{callback:e=>{if(!p?.email)throw Error("User is required to have an email address to update it.");return m(p.email.address,i,e)},userIntentRequired:!1,onSuccessNavigateTo:We.AWAITING_PASSWORDLESS_CODE,onErrorNavigateTo:We.ERROR_SCREEN}}),f(We.CAPTCHA_SCREEN))};return e(r,{children:[e(Wv,{children:[t(Nu,l?{style:{marginTop:"0.25rem",textAlign:"left"},children:l}:{style:{marginTop:"0.25rem",textAlign:"left",visibility:"hidden"},children:" "}),e(Bv,{$error:!!l,children:[t(yr,{}),t("input",{ref:a,id:"email-input",type:"email",placeholder:"your@email.com",onChange:e=>o(e.target.value),onKeyUp:e=>{"Enter"===e.key&&$()},value:i,autoComplete:"email"}),n.stacked?null:t(Xs,{isSubmitting:c,onClick:$,disabled:E,children:"Submit"})]})]}),n.stacked?t(Hs,{loadingText:null,loading:c,disabled:E,onClick:$,children:"Submit"}):null]})}));let Wv=gg,Bv=mg;const jv=({style:e,...r})=>t("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...e},...r,children:t("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})});let zv=tr.div`
|
|
2941
|
-
display: flex;
|
|
2942
|
-
flex-direction: column;
|
|
2943
|
-
align-items: center;
|
|
2944
|
-
justify-content: center;
|
|
2945
|
-
gap: 24px;
|
|
2946
|
-
width: 100%;
|
|
2947
|
-
padding-top: 8px;
|
|
2948
|
-
padding-bottom: 32px;
|
|
2949
|
-
`,Gv=tr.div`
|
|
2950
|
-
display: flex;
|
|
2951
|
-
align-items: center;
|
|
2952
|
-
justify-content: center;
|
|
2953
|
-
height: 72px;
|
|
2954
|
-
aspect-ratio: 1;
|
|
2955
|
-
color: var(--privy-color-error);
|
|
2956
|
-
background-color: var(--privy-color-error-light);
|
|
2957
|
-
border-radius: 50%;
|
|
2958
|
-
`,Hv=tr.div`
|
|
2959
|
-
display: flex;
|
|
2960
|
-
flex-direction: column;
|
|
2961
|
-
gap: 8px;
|
|
2962
|
-
`;const Vv=ar`
|
|
2963
|
-
:root {
|
|
2964
|
-
// Borders
|
|
2965
|
-
--privy-border-radius-sm: 6px;
|
|
2966
|
-
--privy-border-radius-md: 12px;
|
|
2967
|
-
--privy-border-radius-mdlg: 16px;
|
|
2968
|
-
--privy-border-radius-lg: 24px;
|
|
2969
|
-
--privy-border-radius-full: 9999px;
|
|
2970
|
-
|
|
2971
|
-
// Colors
|
|
2972
|
-
--privy-color-background: ${e=>e.theme.background};
|
|
2973
|
-
--privy-color-background-2: ${e=>e.theme.background2};
|
|
2974
|
-
--privy-color-background-3: ${e=>e.theme.background3};
|
|
2975
|
-
|
|
2976
|
-
--privy-color-foreground: ${e=>e.theme.foreground};
|
|
2977
|
-
--privy-color-foreground-2: ${e=>e.theme.foreground2};
|
|
2978
|
-
--privy-color-foreground-3: ${e=>e.theme.foreground3};
|
|
2979
|
-
--privy-color-foreground-4: ${e=>e.theme.foreground4};
|
|
2980
|
-
--privy-color-foreground-accent: ${e=>e.theme.foregroundAccent};
|
|
2981
|
-
|
|
2982
|
-
--privy-color-accent: ${e=>e.theme.accent};
|
|
2983
|
-
--privy-color-accent-light: ${e=>e.theme.accentLight};
|
|
2984
|
-
--privy-color-accent-lightest: ${e=>e.theme.accentLightest};
|
|
2985
|
-
--privy-color-accent-dark: ${e=>e.theme.accentDark};
|
|
2986
|
-
--privy-color-accent-darkest: ${e=>e.theme.accentDarkest};
|
|
2987
|
-
|
|
2988
|
-
--privy-color-success: ${e=>e.theme.success};
|
|
2989
|
-
--privy-color-success-dark: ${e=>e.theme.successDark};
|
|
2990
|
-
--privy-color-success-light: ${e=>e.theme.successLight};
|
|
2991
|
-
--privy-color-error: ${e=>e.theme.error};
|
|
2992
|
-
--privy-color-error-light: ${e=>e.theme.errorLight};
|
|
2993
|
-
--privy-color-warn: ${e=>e.theme.warn};
|
|
2994
|
-
--privy-color-warn-light: ${e=>e.theme.warnLight};
|
|
2995
|
-
|
|
2996
|
-
// Space
|
|
2997
|
-
--privy-height-modal-full: 620px;
|
|
2998
|
-
--privy-height-modal-compact: 480px;
|
|
2999
|
-
};
|
|
3000
|
-
`,qv=tr.div`
|
|
3001
|
-
// css normalize only the privy application to avoid conflicts
|
|
3002
|
-
// with consuming application
|
|
3003
|
-
${"\n *,\n ::before,\n ::after {\n box-sizing: border-box;\n border-width: 0;\n border-style: solid;\n }\n\n line-height: 1.15;\n -webkit-text-size-adjust: 100%;\n -moz-tab-size: 4;\n tab-size: 4;\n font-feature-settings: normal;\n\n margin: 0;\n font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif,\n 'Apple Color Emoji', 'Segoe UI Emoji';\n\n hr {\n height: 0;\n color: inherit;\n border-top-width: 1px;\n }\n\n abbr:where([title]) {\n text-decoration: underline dotted;\n }\n\n h1,\n h2,\n h3,\n h4,\n h5,\n h6 {\n font-size: inherit;\n font-weight: inherit;\n font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif,\n 'Apple Color Emoji', 'Segoe UI Emoji';\n display: inline;\n }\n\n a {\n color: inherit;\n text-decoration: inherit;\n }\n\n b,\n strong {\n font-weight: bolder;\n }\n\n code,\n kbd,\n samp,\n pre {\n font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace;\n font-size: 1em;\n }\n\n small {\n font-size: 80%;\n }\n\n sub,\n sup {\n font-size: 75%;\n line-height: 0;\n position: relative;\n vertical-align: baseline;\n }\n\n sub {\n bottom: -0.25em;\n }\n\n sup {\n top: -0.5em;\n }\n\n table {\n text-indent: 0;\n border-color: inherit;\n border-collapse: collapse;\n }\n\n button,\n input,\n optgroup,\n select,\n textarea {\n font-family: inherit;\n font-size: 100%;\n font-weight: inherit;\n line-height: inherit;\n color: inherit;\n margin: 0;\n padding: 0;\n }\n\n button,\n select {\n text-transform: none;\n }\n\n button,\n [type='button'],\n [type='reset'],\n [type='submit'] {\n -webkit-appearance: button;\n background-color: transparent;\n background-image: none;\n }\n\n ::-moz-focus-inner {\n border-style: none;\n padding: 0;\n }\n\n :-moz-focusring {\n outline: 1px dotted ButtonText;\n }\n\n :-moz-ui-invalid {\n box-shadow: none;\n }\n\n legend {\n padding: 0;\n }\n\n progress {\n vertical-align: baseline;\n }\n\n ::-webkit-inner-spin-button,\n ::-webkit-outer-spin-button {\n height: auto;\n }\n\n [type='search'] {\n -webkit-appearance: textfield;\n outline-offset: -2px;\n }\n\n ::-webkit-search-decoration {\n -webkit-appearance: none;\n }\n\n ::-webkit-file-upload-button {\n -webkit-appearance: button;\n font: inherit;\n }\n\n summary {\n display: list-item;\n }\n\n blockquote,\n dl,\n dd,\n h1,\n h2,\n h3,\n h4,\n h5,\n h6,\n hr,\n figure,\n p,\n pre {\n margin: 0;\n }\n\n fieldset {\n margin: 0;\n padding: 0;\n }\n\n legend {\n padding: 0;\n }\n\n ol,\n ul,\n menu {\n list-style: none;\n margin: 0;\n padding: 0;\n }\n\n textarea {\n resize: vertical;\n }\n\n input::placeholder,\n textarea::placeholder {\n opacity: 1;\n color: #9ca3af;\n }\n\n button,\n [role='button'] {\n cursor: pointer;\n }\n\n :disabled {\n cursor: default;\n }\n\n img,\n svg,\n video,\n canvas,\n audio,\n iframe,\n embed,\n object {\n display: block;\n }\n\n img,\n video {\n max-width: 100%;\n height: auto;\n }\n\n [hidden] {\n display: none;\n }\n"}
|
|
3004
|
-
|
|
3005
|
-
// Privy styles
|
|
3006
|
-
color: var(--privy-color-foreground-2);
|
|
3007
|
-
|
|
3008
|
-
h3 {
|
|
3009
|
-
font-size: 16px;
|
|
3010
|
-
line-height: 24px;
|
|
3011
|
-
font-weight: 500;
|
|
3012
|
-
color: var(--privy-color-foreground-2);
|
|
3013
|
-
}
|
|
3014
|
-
|
|
3015
|
-
h4 {
|
|
3016
|
-
font-size: 14px;
|
|
3017
|
-
line-height: 20px;
|
|
3018
|
-
font-weight: 500;
|
|
3019
|
-
color: var(--privy-color-foreground);
|
|
3020
|
-
}
|
|
3021
|
-
|
|
3022
|
-
p {
|
|
3023
|
-
font-size: 13px;
|
|
3024
|
-
line-height: 20px;
|
|
3025
|
-
color: var(--privy-color-foreground-2);
|
|
3026
|
-
}
|
|
3027
|
-
|
|
3028
|
-
button:focus,
|
|
3029
|
-
input:focus,
|
|
3030
|
-
optgroup:focus,
|
|
3031
|
-
select:focus,
|
|
3032
|
-
textarea:focus {
|
|
3033
|
-
outline: none;
|
|
3034
|
-
border-color: var(--privy-color-accent-light);
|
|
3035
|
-
box-shadow: 0 0 0 1px var(--privy-color-accent-light);
|
|
3036
|
-
}
|
|
3037
|
-
|
|
3038
|
-
.mobile-only {
|
|
3039
|
-
@media (min-width: 441px) {
|
|
3040
|
-
display: none;
|
|
3041
|
-
}
|
|
3042
|
-
}
|
|
3043
|
-
|
|
3044
|
-
/* Animations */
|
|
3045
|
-
|
|
3046
|
-
@keyframes fadein {
|
|
3047
|
-
0% {
|
|
3048
|
-
opacity: 0;
|
|
3049
|
-
}
|
|
3050
|
-
100% {
|
|
3051
|
-
opacity: 1;
|
|
3052
|
-
}
|
|
3053
|
-
}
|
|
3054
|
-
`,Zv=({children:r,open:n,onClick:a,...i})=>t(en,{show:n,as:l.Fragment,children:e(tn,{onClose:a,...i,as:Yv,children:[t(rn,{as:l.Fragment,enterFrom:"entering",leaveTo:"leaving",children:t(Kv,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),t(Qv,{children:t(rn,{as:l.Fragment,enterFrom:"entering",leaveTo:"leaving",children:t(nn,{as:Jv,children:r})})})]})});let Kv=tr.div`
|
|
3055
|
-
position: fixed;
|
|
3056
|
-
inset: 0;
|
|
3057
|
-
|
|
3058
|
-
transition: backdrop-filter 100ms ease;
|
|
3059
|
-
backdrop-filter: blur(3px);
|
|
3060
|
-
-webkit-backdrop-filter: blur(3px);
|
|
3061
|
-
|
|
3062
|
-
&.entering,
|
|
3063
|
-
&.leaving {
|
|
3064
|
-
backdrop-filter: unset;
|
|
3065
|
-
-webkit-backdrop-filter: unset;
|
|
3066
|
-
}
|
|
3067
|
-
`,Yv=tr.div`
|
|
3068
|
-
position: relative;
|
|
3069
|
-
z-index: 999999;
|
|
3070
|
-
`,Qv=tr.div`
|
|
3071
|
-
position: fixed;
|
|
3072
|
-
inset: 0;
|
|
3073
|
-
display: flex;
|
|
3074
|
-
align-items: center;
|
|
3075
|
-
justify-content: center;
|
|
3076
|
-
width: 100vw;
|
|
3077
|
-
min-height: 100vh;
|
|
3078
|
-
`;const Jv=tr.div`
|
|
3079
|
-
// reset some default dialog styles
|
|
3080
|
-
padding: 0;
|
|
3081
|
-
background: transparent;
|
|
3082
|
-
border: none;
|
|
3083
|
-
width: 100%;
|
|
3084
|
-
pointer-events: auto;
|
|
3085
|
-
|
|
3086
|
-
outline: none;
|
|
3087
|
-
display: block;
|
|
3088
|
-
|
|
3089
|
-
/*
|
|
3090
|
-
* Normally it is bad to mix media queries like this We are doing
|
|
3091
|
-
* this here specifically for animations to avoid weird jank.
|
|
3092
|
-
*/
|
|
3093
|
-
/* Mobile animation is a bottom drawer */
|
|
3094
|
-
@media (max-width: 440px) {
|
|
3095
|
-
opacity: 1;
|
|
3096
|
-
transform: translate3d(0, 0, 0);
|
|
3097
|
-
transition: transform 200ms ease-in;
|
|
3098
|
-
position: fixed;
|
|
3099
|
-
bottom: 0;
|
|
3100
|
-
|
|
3101
|
-
&.entering,
|
|
3102
|
-
&.leaving {
|
|
3103
|
-
opacity: 0;
|
|
3104
|
-
transform: translate3d(0, 100%, 0);
|
|
3105
|
-
transition: transform 150ms ease-in 0ms, opacity 0ms ease 150ms;
|
|
3106
|
-
}
|
|
3107
|
-
}
|
|
3108
|
-
|
|
3109
|
-
/* Tablet/Desktop animation is a fade in */
|
|
3110
|
-
@media (min-width: 441px) {
|
|
3111
|
-
opacity: 1;
|
|
3112
|
-
transition: opacity 100ms ease-in;
|
|
3113
|
-
|
|
3114
|
-
&.entering,
|
|
3115
|
-
&.leaving {
|
|
3116
|
-
opacity: 0;
|
|
3117
|
-
transition-delay: 5ms;
|
|
3118
|
-
}
|
|
3119
|
-
|
|
3120
|
-
margin: auto;
|
|
3121
|
-
width: 360px;
|
|
3122
|
-
box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
|
|
3123
|
-
border-radius: var(--privy-border-radius-lg);
|
|
3124
|
-
}
|
|
3125
|
-
`,Xv=tr.div`
|
|
3126
|
-
display: flex;
|
|
3127
|
-
flex-direction: column;
|
|
3128
|
-
align-items: center;
|
|
3129
|
-
justify-content: center;
|
|
3130
|
-
height: 100%;
|
|
3131
|
-
`;let eC={[We.LANDING]:()=>{let{app:e}=ye();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?t(Fg,{connectOnly:!1}):t(jg,{connectOnly:!1})},[We.CONNECT_OR_CREATE]:()=>{let{app:e}=ye();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?t(Fg,{connectOnly:!0}):t(jg,{connectOnly:!0})},[We.AWAITING_PASSWORDLESS_CODE]:()=>{let{app:n,navigate:a,lastScreen:i,navigateBack:o,setModalData:l,onUserCloseViaDialogOrKeybindRef:s}=ye(),{closePrivyModal:c,resendEmailCode:u,resendSmsCode:h,getAuthMeta:m,loginWithCode:f,updateWallets:g,createAnalyticsEvent:y}=P(),{authenticated:v,logout:C,user:b}=M(),[E,$]=d(Fc),[A,x]=d(!1),[_,k]=d(null),[N,S]=d(null),[I,D]=d(0);s.current=()=>null;let F=m()?.email?0:1,U=je-500;p((()=>{if(I){let e=setTimeout((()=>{D(I-1)}),1e3);return()=>clearTimeout(e)}}),[I]),p((()=>{if(v&&A&&b){if(n?.legal.requireUsersAcceptTerms&&!b.hasAcceptedTerms){let e=setTimeout((()=>{a(We.AFFIRMATIVE_CONSENT_SCREEN)}),U);return()=>clearTimeout(e)}if(R(b,n?.embeddedWallets?.createOnLogin)){let e=setTimeout((()=>{l({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),y({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"AwaitingPasswordlessCodeScreen"}}),C()},callAuthOnSuccessOnClose:!0}}),a(We.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),U);return()=>clearTimeout(e)}{g();let e=setTimeout((()=>c({shouldCallAuthOnSuccess:!0,isSuccess:!0})),je);return()=>clearTimeout(e)}}}),[v,A,b]),p((()=>{if(_&&0===N){let e=setTimeout((()=>{$(Fc),k(null);let e=document.querySelector("input[name=code-0]");e?.focus()}),1400);return()=>clearTimeout(e)}}),[_]);let W=e=>{e.preventDefault();let t=e.currentTarget.value.replace(" ","");if(""===t)return;if(isNaN(Number(t)))return k("Code should be numeric"),void S(1);k(null),S(null);let r=Number(e.currentTarget.name?.charAt(5)),n=[...t||[""]].slice(0,6-r),o=[...E.slice(0,r),...n,...E.slice(r+n.length)];$(o);let s=Math.min(Math.max(r+n.length,0),5);if(!isNaN(Number(e.currentTarget.value))){let e=document.querySelector(`input[name=code-${s}]`);e?.focus()}if(o.every((e=>e&&!isNaN(+e)))){let e=document.querySelector(`input[name=code-${s}]`);e?.blur(),f(o.join("")).then((()=>x(!0))).catch((e=>{if(e instanceof O&&e.privyErrorCode===T.INVALID_CREDENTIALS)k("Invalid or expired verification code");else if(e instanceof O&&e.privyErrorCode===T.CANNOT_LINK_MORE_OF_TYPE)k(e.message);else{if(e instanceof O&&e.privyErrorCode===T.USER_LIMIT_REACHED)return console.error(new L(e).toString()),void a(We.USER_LIMIT_REACHED_SCREEN);if(e instanceof O&&e.privyErrorCode===T.USER_DOES_NOT_EXIST)return void a(We.ACCOUNT_NOT_FOUND_SCREEN);if(e instanceof O&&e.privyErrorCode===T.LINKED_TO_ANOTHER_USER)return l({errorModalData:{error:e,previousScreen:i??We.AWAITING_PASSWORDLESS_CODE}}),void a(We.ERROR_SCREEN,!1);if(e instanceof O&&e.privyErrorCode===T.DISALLOWED_PLUS_EMAIL)return l({inlineError:{error:e}}),void a(We.CONNECT_OR_CREATE,!1);if(e instanceof O&&e.privyErrorCode===T.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return l({accountTransfer:{nonce:e.data?.data?.nonce,account:0===F?m()?.email:m()?.phoneNumber,displayName:e.data?.data?.account?.displayName,linkMethod:0===F?"email":"sms",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void a(We.LINK_CONFLICT_SCREEN);k("Issue verifying code")}S(0)}))}},B=0==F?t(yr,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):t(wr,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),j=e("p",0==F?{children:["Please check ",t(Hc,{children:m()?.email})," for an email from privy.io and enter your code below."]}:{children:["Please check ",t(Hc,{children:m()?.phoneNumber})," for a message from ",n?.name||"Privy"," and enter your code below."]});return e(r,{children:[t(od,{backFn:()=>o()},"header"),e(Uc,{children:[t(Ic,{title:"Enter confirmation code",description:j,icon:B}),e(wc,{children:[e(Wc,{children:[t(Bc,{$fail:!!_,$success:A,children:t("span",{children:_||(A?"Success!":"")})}),t("div",{children:E.map(((e,r)=>t("input",{name:`code-${r}`,type:"text",value:E[r],onChange:W,onKeyUp:e=>{"Backspace"===e.key&&(e=>{if(1===N&&(k(null),S(null)),$([...E.slice(0,e),"",...E.slice(e+1)]),e>0){let t=document.querySelector(`input[name=code-${e-1}]`);t?.focus()}})(r)},inputMode:"numeric",autoFocus:0===r,pattern:"[0-9]",className:`${A?"success":""} ${_?"fail":""}`,autoComplete:w?"one-time-code":"off"},r)))})]}),e(jc,{children:[e("span",{children:["Didn't get ",0==F?"an email":"a message","?"]}),I?e(Gc,{children:[t(gr,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),t("span",{children:"Code sent"})]}):t(zc,{children:t("button",{onClick:async()=>{D(30),0==F?await u():await h()},children:"Resend code"})})]})]})]}),t(Nd,{})]})},[We.AWAITING_CONNECTION]:()=>{let n,[a,i]=d(!1),[o,l]=d(!1),[c,u]=d(void 0),{authenticated:h,logout:f}=M(),{app:g,navigate:y,navigateBack:v,lastScreen:C,currentScreen:b,setModalData:E,data:$}=ye(),{getAuthFlow:A,walletConnectionStatus:x,closePrivyModal:_,initLoginWithWallet:k,loginWithWallet:N,updateWallets:S,createAnalyticsEvent:I}=P(),{walletConnectors:O}=M(),[D,F]=d(0),{user:U}=M(),[W]=d(U?.linkedAccounts.length||0),[B,j]=d(""),[z,G]=d(""),[H,V]=d(!1),{hasTabbedAway:q}=function(){let[e,t]=d(!1),r=m((()=>{document.hidden&&t(!0)}),[]);return p((()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r))),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}(),{enabled:Z,token:K}=Ll(),Y=w&&"wallet_connect_v2"===x?.connector?.connectorType||w&&"coinbase_wallet"===x?.connector?.connectorType||w&&"injected"===x?.connector?.connectorType&&"phantom"===x?.connector?.walletClientType,Q="connected"===x?.status,J="switching_to_supported_chain"===x?.status;p((()=>{let e=A(),t=e instanceof gl||e instanceof Ol?e:void 0;Q&&!t&&(!Z||K||h?k(x.connectedWallet,K,$?.login?.disableSignup).then((()=>{V(!0)})):(E({captchaModalData:{callback:e=>k(x.connectedWallet,e,$?.login?.disableSignup).then((()=>{V(!0)})),userIntentRequired:!1,onSuccessNavigateTo:We.AWAITING_CONNECTION,onErrorNavigateTo:We.ERROR_SCREEN}}),y(We.CAPTCHA_SCREEN,!1))),t&&Y&&Q&&!t.preparedMessage?t.buildMessage():t&&!Y&&Q&&(o||(async()=>{l(!0),u(void 0);try{"wallet_connect_v2"===x?.connector?.connectorType&&"metamask"===x?.connector?.walletClientType&&await Ge(2500),await ee()}catch(e){console.warn("Auto-prompted signature failed",e)}finally{l(!1)}})())}),[D,Q,H]),p((()=>{if(U&&a){let e=je-500;if(g?.legal.requireUsersAcceptTerms&&!U.hasAcceptedTerms){let t=setTimeout((()=>{y(We.AFFIRMATIVE_CONSENT_SCREEN)}),e);return()=>clearTimeout(t)}if(R(U,g?.embeddedWallets?.createOnLogin)){let t=setTimeout((()=>{E({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),I({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"ConnectionStatusScreen"}}),f()},callAuthOnSuccessOnClose:!0}}),y(We.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),e);return()=>clearTimeout(t)}S();let t=setTimeout((()=>_({shouldCallAuthOnSuccess:!0,isSuccess:!0})),je);return()=>clearTimeout(t)}}),[U,a]);let X=e=>{if(e?.privyErrorCode!==T.ALLOWLIST_REJECTED){if(e?.privyErrorCode===T.USER_LIMIT_REACHED)return console.error(new L(e).toString()),void y(We.USER_LIMIT_REACHED_SCREEN);if(e?.privyErrorCode!==T.USER_DOES_NOT_EXIST)return e?.privyErrorCode===T.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce?(E({accountTransfer:{nonce:e.data?.data?.nonce,account:A()?.meta.address,displayName:e.data?.data?.account?.displayName,externalWalletMetadata:{walletClientType:A()?.meta.walletClientType,chainId:A()?.meta.chainId,connectorType:A()?.meta.connectorType},linkMethod:"siwe",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void y(We.LINK_CONFLICT_SCREEN)):void u(Cu(e));y(We.ACCOUNT_NOT_FOUND_SCREEN)}else y(We.ALLOWLIST_REJECTION_SCREEN)};async function ee(){try{await N(),i(!0)}catch(e){X(e)}finally{l(!1)}}p((()=>{x?.connectError&&X(x?.connectError)}),[x]),((e,t)=>{let r=s((()=>{}));p((()=>{r.current=e})),p((()=>{if(null!==t){let e=setInterval((()=>r.current()),t||0);return()=>clearInterval(e)}}),[t])})((()=>{let e="wallet_connect_v2"===te&&x?.connector instanceof ws?x.connector.redirectUri:void 0;e&&j(e);let t="wallet_connect_v2"===te&&x?.connector instanceof ws?x.connector.fallbackUniversalRedirectUri:void 0;t&&G(t)}),x?.connector instanceof ws&&!B?500:null);let te=x?.connector?.connectorType||"injected",re=x?.connector?.walletClientType||"unknown",ne=eu[re]?.displayName||x?.connector?.walletBranding.name||"Browser Extension",ae=eu[re]?.logo||x?.connector?.walletBranding.icon||(e=>t(os,{...e})),ie="Browser Extension"===ne?ne.toLowerCase():ne;n=a?`Successfully connected with ${ie}`:c?c.message:J?"Switching networks":Q?o&&Y?"Signing":"Sign to verify":`Waiting for ${ie}`;let oe="Don’t see your wallet? Check your other browser windows.";a?oe=W===(U?.linkedAccounts.length||0)?"Wallet was already linked.":"You’re good to go!":D>=2&&c?oe="Unable to connect wallet":c?oe=c.detail:J?oe="Switch your wallet to the requested network.":Q&&Y?oe="Sign the message in your wallet to verify it belongs to you.":"metamask"===re&&w?oe="Click continue to open and connect MetaMask.":"metamask"===re?oe="For the best experience, connect only one wallet at a time.":"wallet_connect"===te?oe="Open your mobile wallet app to continue":"coinbase_wallet"!==te||ze()||(oe=vs(U)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Open the Coinbase app on your phone to continue.");let le=O?.walletConnectors?.find((e=>"coinbase_wallet"===e.walletClientType)),se="coinbase_wallet"===re&&(vs(U)||c===Gt.ERROR_USER_EXISTS);return e(r,{children:[t(od,{backFn:C&&b!==C?v:void 0}),e(bu,{children:[t($u,{walletLogo:ae,success:a,fail:!!c}),e(Ec,{children:[t("h3",{children:n}),t("p",{children:oe}),Q||!B||q?null:e("p",{children:["Still here?"," ",t("a",{href:B,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),z&&e(r,{children:[" ","or"," ",t("a",{href:z,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]})]}),se?t(Hs,{onClick:()=>le&&le?.disconnect(),disabled:a,children:"Use a different wallet"}):c==Gt.ERROR_USER_EXISTS&&b!==C?t(Hs,{onClick:v,children:"Use a different wallet"}):Q&&!a&&Y?t(Hs,{onClick:()=>{l(!0),ee()},disabled:o,children:o?"Signing":"Sign with your wallet"}):!a&&c?.retryable&&D<2?t(Hs,{onClick:()=>{F(D+1),u(void 0),Q?(l(!0),ee()):x?.connectRetry()},disabled:!a&&(!c?.retryable||D>=2),children:"Retry"}):a||c?null:t(Hs,{onClick:()=>{},disabled:!0,children:"Connecting"})]}),t(Sd,{})]})},[We.AWAITING_CONNECT_ONLY_CONNECTION]:()=>{let n,{navigateBack:a,navigate:i,lastScreen:o,currentScreen:l,data:s,setModalData:c}=ye(),{walletConnectionStatus:u,closePrivyModal:h}=P(),[m,f]=d(void 0),[g,y]=d(0),v="connected"===u?.status,C="switching_to_supported_chain"===u?.status;p((()=>{if(v){let e;if(s?.externalConnectWallet?.onCompleteNavigateTo){let t=s.externalConnectWallet.onCompleteNavigateTo,r=u.connectedWallet?.address;e=setTimeout((()=>{s.funding&&c({...s,funding:{...s.funding,connectedWalletAddress:r}}),i(t({walletChainType:u.connector?.chainType}))}),je)}else e=setTimeout(h,je);return()=>clearTimeout(e)}}),[v]);p((()=>{u?.connectError&&(e=>{f(Cu(e))})(u?.connectError)}),[u]);let b=u?.connector?.connectorType||"injected",E=u?.connector?.walletClientType||"unknown",$=eu[E]?.displayName||u?.connector?.walletBranding.name||"Browser Extension",T=eu[E]?.logo||u?.connector?.walletBranding.icon||(e=>t(os,{...e})),A="Browser Extension"===$?$.toLowerCase():$;n=v?`Successfully connected with ${A}`:m?m.message:C?"Switching networks":`Waiting for ${A}`;let x="Don’t see your wallet? Check your other browser windows.";return v?x="You’re good to go!":g>=2&&m?x="Unable to connect wallet":m?x=m.detail:C?x="Switch your wallet to the requested network.":"metamask"===E&&w?x="Click to continue to open and connect MetaMask.":"metamask"===E?x="For the best experience, connect only one wallet at a time.":"wallet_connect_v2"===b?x="Open your mobile wallet app to continue":"coinbase_wallet"===b&&(x="Open the Coinbase app on your phone to continue."),e(r,{children:[t(od,{backFn:l===o?void 0:a}),e(Tu,{children:[t($u,{walletLogo:T,success:v,fail:!!m}),e(Ec,{children:[t("h3",{children:n}),t("p",{children:x})]}),m==Gt.ERROR_USER_EXISTS?t(Hs,{onClick:a,children:"Use a different wallet"}):!v&&m?.retryable&&g<2?t(Hs,{onClick:()=>{y(g+1),f(void 0),u?.connectRetry()},disabled:!v&&(!m?.retryable||g>=2),children:"Retry"}):!v&&m&&g>=2?t(Hs,{onClick:a,children:"Use a different wallet"}):null]}),t(Sd,{})]})},[We.AWAITING_FARCASTER_CONNECTION]:()=>{let{authenticated:n,logout:a,ready:i,user:o}=M(),{lastScreen:l,navigate:c,navigateBack:u,setModalData:h,app:m}=ye(),{getAuthFlow:f,loginWithFarcaster:g,closePrivyModal:y,createAnalyticsEvent:C}=P(),[b,E]=d(void 0),[$,A]=d(!1),[x,_]=d(!1),k=s([]),N=f(),S=N?.meta.connectUri;return p((()=>{let e=Date.now(),t=setInterval((async()=>{let r=await N.pollForReady.execute(),n=Date.now()-e;if(r){clearInterval(t),A(!0);try{await g(),_(!0)}catch(e){let t={retryable:!1,message:"Authentication failed"};if(e?.privyErrorCode===T.ALLOWLIST_REJECTED)return void c(We.ALLOWLIST_REJECTION_SCREEN);if(e?.privyErrorCode===T.USER_LIMIT_REACHED)return console.error(new L(e).toString()),void c(We.USER_LIMIT_REACHED_SCREEN);if(e?.privyErrorCode===T.USER_DOES_NOT_EXIST)return void c(We.ACCOUNT_NOT_FOUND_SCREEN);if(e?.privyErrorCode===T.LINKED_TO_ANOTHER_USER)t.detail=e.message??"This account has already been linked to another user.";else{if(e?.privyErrorCode===T.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return h({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:"farcaster",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,farcasterEmbeddedAddress:e.data?.data?.otherUser?.farcasterEmbeddedAddress}}),void c(We.LINK_CONFLICT_SCREEN);e?.privyErrorCode===T.INVALID_CREDENTIALS?(t.retryable=!0,t.detail="Something went wrong. Try again."):e?.privyErrorCode===T.TOO_MANY_REQUESTS&&(t.detail="Too many requests. Please wait before trying again.")}E(t)}}else n>12e4&&(clearInterval(t),E({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))}),2e3);return()=>{clearInterval(t),k.current.forEach((e=>clearTimeout(e)))}}),[]),p((()=>{if(i&&n&&x&&o){if(m?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let e=setTimeout((()=>{c(We.AFFIRMATIVE_CONSENT_SCREEN)}),je);return()=>clearTimeout(e)}x&&(R(o,m?.embeddedWallets.createOnLogin)?k.current.push(setTimeout((()=>{h({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),C({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"FarcasterConnectStatusScreen"}}),a()},callAuthOnSuccessOnClose:!0}}),c(We.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),je)):k.current.push(setTimeout((()=>y({shouldCallAuthOnSuccess:!0,isSuccess:!0})),je)))}}),[x,i,n,o]),e(r,w||$?{children:[t(od,{backFn:l?u:void 0,onClose:y},"header"),t(Tc,{}),t(r,v?{children:e(Ap,{children:[t(pd,{children:e("div",{children:[t(Us,{success:x,fail:!!b}),t(Ep,{style:{width:"38px",height:"38px"}})]})}),e(Ec,{children:[t(Zd,{children:b?b.message:"Sign in with Farcaster"}),t(Kd,{children:b?b.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),S&&t(Hs,{onClick:e=>{e.preventDefault(),window.location.href=S},children:"Open Warpcast app"})]})}:{children:e(Tp,{children:[t(pd,{children:e("div",{children:[t(Us,{success:x,fail:!!b}),t(Ep,{style:{width:"38px",height:"38px"}})]})}),e(Ec,{children:[t(Zd,{children:b?b.message:"Signing in with Farcaster"}),t(Kd,{children:b?b.detail:"This should only take a moment"}),t(yc,{children:S&&w&&t(up,{text:"Take me to Warpcast",url:S,color:$p})})]})]})}),t(Sd,{})]}:{children:[t(od,{backFn:l?u:void 0,onClose:y},"header"),t(Tc,{}),t(Tp,{children:e("div",{children:[t(Zd,{children:"Sign in with Farcaster"}),t(Kd,{children:"Scan with your phone's camera to continue."}),t(vc,{children:S?t(bp,{url:S,size:275,squareLogoElement:Ep}):t(Ws,{})}),e(yc,{children:[t(Kd,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),S&&t(dp,{text:S,itemName:"link",color:$p})]})]})}),t(Sd,{})]})},[We.AWAITING_FARCASTER_SIGNER]:()=>{let{lastScreen:n,navigateBack:a,data:i,app:o}=ye(),{requestFarcasterSignerStatus:l,closePrivyModal:c}=P(),[u,h]=d(void 0),[m,f]=d(!1),[g,y]=d(!1),C=s([]),b=i?.farcasterSigner;p((()=>{let e=Date.now(),t=setInterval((async()=>{if(!b?.public_key)return clearInterval(t),void h({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});"approved"===b.status&&(clearInterval(t),f(!1),y(!0),C.current.push(setTimeout((()=>c({shouldCallAuthOnSuccess:!1,isSuccess:!0})),je)));let r=await l(b?.public_key),n=Date.now()-e;"approved"===r.status?(clearInterval(t),f(!1),y(!0),C.current.push(setTimeout((()=>c({shouldCallAuthOnSuccess:!1,isSuccess:!0})),je))):n>3e5?(clearInterval(t),h({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):"revoked"===r.status&&(clearInterval(t),h({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))}),2e3);return()=>{clearInterval(t),C.current.forEach((e=>clearTimeout(e)))}}),[]);let E="pending_approval"===b?.status?b.signer_approval_url:void 0;return e(r,w||m?{children:[t(od,{backFn:n?a:void 0,onClose:c},"header"),t(Tc,{}),t(r,v?{children:e(kp,{children:[t(pd,{children:e("div",{children:[t(Us,{success:g,fail:!!u}),t(Ep,{style:{width:"38px",height:"38px"}})]})}),e(Ec,{children:[t(Zd,{children:u?u.message:"Add a signer to Farcaster"}),t(Kd,{children:u?u.detail:"This will allow "+o.name+" to add casts, likes, follows, and more on your behalf."})]}),E&&t(Hs,{onClick:e=>{e.preventDefault(),window.location.href=E},children:"Open Warpcast app"})]})}:{children:e(_p,{children:[t(pd,{children:e("div",{children:[t(Us,{success:g,fail:!!u}),t(Ep,{style:{width:"38px",height:"38px"}})]})}),e(Ec,{children:[t(Zd,{children:u?u.message:"Requesting signer from Farcaster"}),t(Kd,{children:u?u.detail:"This should only take a moment"}),t(yc,{children:E&&w&&t(up,{text:"Take me to Warpcast",url:E,color:xp})})]})]})}),t(Sd,{})]}:{children:[t(od,{backFn:n?a:void 0,onClose:c},"header"),t(Tc,{}),t(_p,{children:e("div",{children:[t(Zd,{children:"Add a signer to Farcaster"}),e(Kd,{children:["This will allow ",o.name," to add casts, likes, follows, and more on your behalf."]}),t(vc,{children:"pending_approval"===b?.status?t(bp,{url:b.signer_approval_url,size:275,squareLogoElement:Ep}):t(Ws,{})}),e(yc,{children:[t(Kd,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),"pending_approval"===b?.status&&t(dp,{text:b.signer_approval_url,itemName:"link",color:xp})]})]})}),t(Sd,{})]})},[We.AWAITING_PASSKEY_SYSTEM_DIALOGUE]:()=>{let{lastScreen:n,currentScreen:a,navigateBack:i}=ye(),{loginWithPasskey:o,closePrivyModal:l}=P(),[c,u]=d("loading"),[h,m]=d(null),f=s([]);p((()=>()=>{f.current.forEach((e=>clearTimeout(e))),f.current=[]}),[]);let g=async()=>{u("loading");try{await o(),u("success")}catch(e){m(e),u("error")}};return p((()=>{"success"===c&&(e=>{f.current=[e,...f.current]})(setTimeout((()=>{l({shouldCallAuthOnSuccess:!0,isSuccess:!0})}),je))}),[c]),p((()=>{g()}),[]),e(r,{children:[t(od,{backFn:n&&a!==n?i:void 0}),e(sw,{children:[t(pd,{children:e("div",{children:[t(Us,{success:"success"===c,fail:"error"===c}),t(_m,{style:{width:"38px",height:"38px"}})]})}),e(Ec,{children:[t("h3",{children:(()=>{switch(c){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}})()}),t("p",{style:{whiteSpace:"pre-wrap"},children:(()=>{switch(c){case"loading":return"Please follow prompts to verify your passkey.\nYou will have to sign up with another method first to register a passkey for your account.";case"success":return"You've successfully logged in with your passkey.";case"error":if(h instanceof A){if(h.privyErrorCode===T.CANNOT_LINK_MORE_OF_TYPE)return"Cannot link more passkeys to account.";if(h.privyErrorCode===T.PASSKEY_NOT_ALLOWED)return"Passkey request timed out or rejected by user.\nYou will have to sign up with another method first to register a passkey for your account."}return"An unknown error occurred.\nYou will have to sign up with another method first to register a passkey for your account."}})()})]}),(()=>{switch(c){case"loading":case"success":return t(Hs,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return t(Hs,{onClick:g,disabled:!1,children:"Retry"})}})()]}),t(Sd,{})]})},[We.PHANTOM_INTERSTITIAL_SCREEN]:()=>{let{forkSession:n,ready:a,authenticated:i}=M(),{walletConnectionStatus:o}=P(),[l,s]=d(""),[c,u]=d(!1);p((()=>{a&&i&&n().then(s)}),[a,i]);let h=((e,t,r)=>{let n=encodeURIComponent(new URL(window.location.href).href.replace(/\/$/g,"")+`?privy_token=${e}&privy_connector=${r?"solana_adapter":"injected"}&privy_wallet_client=${r?"phantom_solana":"phantom"}`);if(!Ee()&&w)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${n}?ref=${n}`})(l,!c,"solana"===o?.connector?.chainType),m={title:"Redirecting to Phantom Mobile Wallet",description:"We'll take you to the Phantom Mobile Wallet app to continue your login experience.",footnote:""};return a&&(m.description="For the best experience, we'll automatically log you into the Phantom Mobile Wallet in-app browser.",m.footnote="Once you're done, you can always return here and refresh to view your updated account."),c&&(m.title="Still here?",m.description="You may need to install the Phantom mobile app.",m.footnote="Once you're done, you can return here or connect via Phantom's in-app browser."),e(r,{children:[t(od,{},"header"),t(Tc,{}),t(Sc,{title:m.title,description:m.description}),e(gc,{children:[t(dw,{children:t(ss,{style:{width:"72px",height:"72px"}})}),t(Zs,{href:h,onClick:()=>{setTimeout((()=>u(!0)),1e3)},loading:a&&!h,children:c?"Go to App Store":"Continue"}),m.footnote?t("p",{children:m.footnote}):null]}),t(Ac,{}),t(Nd,{})]})},[We.LOGIN_FAILED_SCREEN]:()=>{let{closePrivyModal:n}=P(),{navigate:a}=ye();return e(r,{children:[t(od,{},"header"),t(Tc,{}),t(Zg,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),t(Sc,{title:"Could not connect with wallet",description:"Please check that Phantom multichain is enabled and try again.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),e(gc,{children:[t(Hs,{onClick:()=>a(We.LANDING),children:"Try again"}),t(Ys,{onClick:()=>n(),children:"Cancel"})]}),t(Ac,{}),t(Nd,{})]})},[We.AWAITING_OAUTH_SCREEN]:()=>{let{authenticated:n,logout:a,ready:i,user:o}=M(),{app:l,setModalData:s,navigate:c,resetNavigation:u}=ye(),{getAuthMeta:h,initLoginWithOAuth:m,loginWithOAuth:f,updateWallets:g,setReadyToTrue:y,closePrivyModal:w,createAnalyticsEvent:v}=P(),[C,b]=d(!1),[E,$]=d(void 0),A=h()?.provider||"google",{name:x,component:_}=ul(A),k=qt();p((()=>{f(A).then((e=>{b(!0),y(!0),e&&k("login","onOAuthLoginComplete",e)})).catch((e=>{if(y(!1),e?.privyErrorCode===T.ALLOWLIST_REJECTED)return $(void 0),u(),void c(We.ALLOWLIST_REJECTION_SCREEN);if(e?.privyErrorCode===T.USER_LIMIT_REACHED)return console.error(new L(e).toString()),$(void 0),u(),void c(We.USER_LIMIT_REACHED_SCREEN);if(e?.privyErrorCode===T.USER_DOES_NOT_EXIST)return $(void 0),u(),void c(We.ACCOUNT_NOT_FOUND_SCREEN);if(e?.privyErrorCode===T.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return $(void 0),u(),s({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:h()?.provider,embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,oAuthUserInfo:e.data?.data?.otherUser?.oAuthUserInfo}}),void c(We.LINK_CONFLICT_SCREEN);let{retryable:t,detail:r}=function(e,t){let r={detail:"",retryable:!1},n=Xo(t);if(e?.privyErrorCode===T.LINKED_TO_ANOTHER_USER&&(r.detail="This account has already been linked to another user."),e?.privyErrorCode===T.INVALID_CREDENTIALS&&(r.retryable=!0,r.detail="Something went wrong. Try again."),e.privyErrorCode===T.OAUTH_USER_DENIED&&(r.detail=`Retry and check ${n} to finish connecting your account.`,r.retryable=!0),e?.privyErrorCode===T.TOO_MANY_REQUESTS&&(r.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode===T.TOO_MANY_REQUESTS&&e.message.includes("provider rate limit")){let e=ul(t).name;r.detail=`Request limit reached for ${e}. Please wait a moment and try again.`}if(e?.privyErrorCode===T.OAUTH_ACCOUNT_SUSPENDED){let e=ul(t).name;r.detail=`Your ${e} account is suspended. Please try another login method.`}return e?.privyErrorCode===T.CANNOT_LINK_MORE_OF_TYPE&&(r.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode===T.OAUTH_UNEXPECTED&&t.startsWith("privy:")&&(r.detail="Something went wrong. Please try again."),r}(e,A);$({retryable:t,detail:r,message:"Authentication failed"})})).finally((()=>{pl()}))}),[x,A]),p((()=>{if(i&&n&&C&&o){if(l?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let e=setTimeout((()=>{c(We.AFFIRMATIVE_CONSENT_SCREEN)}),je);return()=>clearTimeout(e)}if(R(o,l?.embeddedWallets?.createOnLogin)){let e=setTimeout((()=>{s({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:A,screen:"OAuthStatusScreen"}}),a()},callAuthOnSuccessOnClose:!0}}),c(We.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),je);return()=>clearTimeout(e)}{let e=setTimeout((()=>w({shouldCallAuthOnSuccess:!0,isSuccess:!0})),je);return g(),()=>clearTimeout(e)}}}),[i,n,C,o]);let N=C?`Successfully connected with ${x}`:E?E.message:`Verifying connection to ${x}`,S="";return S=C?"You’re good to go!":E?E.detail:"Just a few moments more",e(r,{children:[t(od,{}),t(Tc,{}),e(lw,{children:[t(pd,{children:e("div",{children:[t(Us,{success:C,fail:!!E}),t(_,{style:{width:"38px",height:"38px"}})]})}),e(Ec,{children:[t("h3",{children:N}),t("p",{children:S})]}),E&&E?.retryable?t(Js,{onClick:()=>{pl(),m(A),$(void 0)},disabled:!C&&!E?.retryable,children:"Retry"}):null]}),t(Ac,{}),t(Sd,{})]})},[We.CROSS_APP_AUTH_SCREEN]:()=>{let n=Ue(),{data:a,navigate:i,setModalData:o,onUserCloseViaDialogOrKeybindRef:l}=ye(),{crossAppAuthFlow:s,updateWallets:u,closePrivyModal:h,createAnalyticsEvent:m}=P(),{logout:f}=xu(),[g,y]=d({}),w=a?.crossAppAuth,v={id:w.appId,name:w.name,logoUrl:w.logoUrl},C=new E(`There was an issue connecting your ${v.name} account. Please try again.`),b=new ml((async e=>{if(w.popup)try{let t=await s({appId:e,popup:w.popup,action:w.action});y({data:t})}catch(e){e instanceof E?y({error:e}):(e instanceof O&&w.popup&&w.popup.close(),y({error:C}))}else y({error:C})})),$=()=>{g.data&&(u(),w.onSuccess(g.data),h({shouldCallAuthOnSuccess:!0,isSuccess:!0})),w.onError(g.error??new E("User canceled flow")),h({shouldCallAuthOnSuccess:!1,isSuccess:!1})};l.current=$,p((()=>{v.id.length&&b.execute(v.id)}),[v.id]),p((()=>{if(!g.data)return;let e=g.data;if(n.legal.requireUsersAcceptTerms&&!e.hasAcceptedTerms){let e=setTimeout((()=>{i(We.AFFIRMATIVE_CONSENT_SCREEN)}),je);return()=>clearTimeout(e)}if(R(e,n.embeddedWallets?.createOnLogin)){let e=setTimeout((()=>{o({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),m({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:`privy:${v.id}`,screen:"CrossAppAuthScreen"}}),f()},callAuthOnSuccessOnClose:!0}}),i(We.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),je);return()=>clearTimeout(e)}let t=setTimeout($,je);return()=>clearTimeout(t)}),[g.data]);let{title:T,subtitle:A}=c((()=>g.data?{title:`Successfully connected with ${v.name}`,subtitle:"You're good to go!"}:g.error?{title:"Authentication failed",subtitle:g.error.message}:{title:`Connecting to ${v.name}`,subtitle:`Please check the pop-up from ${v.name} to continue`}),[g,v.name]);return e(r,{children:[t(od,{onClose:$}),t(Tc,{}),e(_u,{children:[t(pd,{children:e("div",{children:[t(Us,{success:!!g.data,fail:!!g.error}),t(Au,{name:v.name,logoUrl:v.logoUrl})]})}),e(Ec,{children:[t("h3",{children:T}),t("p",{children:A})]})]}),t(Ac,{}),t(Sd,{})]})},[We.ALLOWLIST_REJECTION_SCREEN]:()=>{let{navigate:n,app:a}=ye(),i=a?.allowlistConfig.errorTitle||"You don't have access to this app",o=a?.allowlistConfig.errorDetail||"Have you been invited?",l=a?.allowlistConfig.errorCtaText||"Try another account";return e(r,{children:[t(od,{}),e(mc,{children:[t(pd,{children:e("div",{children:[t(Ad,{}),t(pc,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),e(fc,{children:[t("string"==typeof i?"h3":r,{children:i}),t("string"==typeof o?"p":r,{children:o})]}),a?.allowlistConfig.errorCtaLink?t(Hs,{as:"a",href:a.allowlistConfig.errorCtaLink,children:l}):t(Hs,{onClick:()=>{n(We.LANDING)},children:l})]})]})},[We.ACCOUNT_NOT_FOUND_SCREEN]:()=>{let{navigate:n,app:a}=ye();return e(r,{children:[t(od,{}),e($d,{children:[t(pd,{children:e("div",{children:[t(td,{color:"var(--privy-color-warn-light)"}),t(ir,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),e(Td,{children:[t("h3",{children:"Account not found"}),e("p",{children:["Please try logging in again or go to ",a.name," to create an account."]})]}),t(md,{}),t(Hs,{onClick:()=>n(We.LANDING),children:"Try logging in again"})]})]})},[We.USER_LIMIT_REACHED_SCREEN]:()=>{let{navigate:n}=ye();return e(r,{children:[t(od,{}),e(zv,{children:[t(Gv,{children:t(jv,{})}),e(Hv,{children:[t("h3",{children:"Unable to sign in"}),t("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),t(Hs,{onClick:()=>{n(We.LANDING)},children:"Go back"})]}),t(Nd,{})]})},[We.INSTALL_PHANTOM_SCREEN]:()=>{let{navigateBack:n}=ye();return e(r,{children:[t(od,{backFn:n},"header"),t(Tc,{}),t(ig,{}),t(Ac,{}),e(Sd,{children:[t("span",{children:"Still not sure? "}),t("a",{target:"_blank",href:"https://solana.com/docs/intro/wallets",children:"Learn more"})]})]})},[We.LINK_EMAIL_SCREEN]:()=>{let{app:n}=ye();return e(r,{children:[t(od,{},"header"),t(Tc,{}),t(Ic,{title:"Connect your email",description:`Add your email to your ${n?.name} account`,icon:t(yr,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),t(gc,{children:t(yg,{stacked:!0})}),t(Ac,{}),t(Nd,{})]})},[We.LINK_PHONE_SCREEN]:()=>{let{app:n,currentScreen:a,data:i,navigate:o,setModalData:l}=ye(),{initLoginWithSms:s}=P();return e(r,{children:[t(od,{},"header"),t(Tc,{}),t(Ic,{title:"Connect your phone",description:`Add your number to your ${n?.name} account`,icon:t(wr,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),t(gc,{children:t(_g,{stacked:!0,onSubmit:async function({qualifiedPhoneNumber:e}){try{await s({phoneNumber:e,withPrivyUi:!0}),o(We.AWAITING_PASSWORDLESS_CODE)}catch(e){l({errorModalData:{error:e,previousScreen:i?.errorModalData?.previousScreen||a||We.LINK_PHONE_SCREEN}}),o(We.ERROR_SCREEN)}},hideRecent:!0})}),t(Ac,{}),t(Nd,{})]})},[We.LINK_WALLET_SCREEN]:()=>{let{app:n,data:a}=ye(),i=a?.externalConnectWallet?.suggestedAddress,o=i?e("span",{children:["Link the wallet with address ",t(Id,{showCopyIcon:!1,address:i})," ",n?.name?`to ${n.name}.`:"."]}):`Link a wallet to your ${n?.name} account`;return e(r,{children:[t(od,{},"header"),t(Sc,{title:"Link your wallet",description:o}),t(gd,{children:t(wu,{connectOnly:!1})}),t(Nd,{})]})},[We.LINK_PASSKEY_SCREEN]:()=>{let{user:n,unlinkPasskey:a}=M(),{linkWithPasskey:i,closePrivyModal:o}=P(),l=n?.linkedAccounts.filter((e=>"passkey"===e.type)),[s,c]=d(!1),[u,h]=d(""),[m,f]=d(!1),[g,y]=d(!1);p((()=>{0===l.length&&y(!1)}),[l.length]);let w=async e=>(c(!0),await a(e).then((()=>f(!0))).catch((e=>{e instanceof A&&e.privyErrorCode===T.MISSING_MFA_CREDENTIALS?h("Cannot unlink a passkey enrolled in MFA"):h("Unknown error occurred.")})).finally((()=>{c(!1)})));return e(r,m?{children:[t(od,{onClose:()=>o()},"header"),t(dc,{style:{marginBottom:"1.5rem"},children:t(Tr,{})}),t(Rm,{style:{marginBottom:"1.5rem"},children:"Passkeys updated"}),t(Lm,{children:" "}),t(ec,{children:t(Hs,{onClick:()=>o(),children:"Done"})}),t(Sd,{})]}:g?{children:[t(od,{backFn:()=>y(!1),onClose:()=>o()},"header"),t(km,{passkeys:l,expanded:g,onUnlink:w,onExpand:()=>y(!0)}),t(Sd,{})]}:{children:[t(od,{onClose:()=>o()},"header"),t(qd,{children:e(Sm,{children:[t(xm,{}),t(_m,{})]})}),t(Rm,{children:"Secure your account with a passkey"}),t(Dm,{}),0===l.length?t(Nm,{}):t(km,{passkeys:l,expanded:g,onUnlink:w,onExpand:()=>y(!0)}),e(ec,{style:{marginTop:"12px"},children:[u&&t(Im,{$fail:!0,children:u}),t(Hs,{onClick:()=>{c(!0),i().then((()=>f(!0))).catch((e=>{if(e instanceof A){if(e.privyErrorCode===T.CANNOT_LINK_MORE_OF_TYPE)return void h("Cannot link more passkeys to account.");if(e.privyErrorCode===T.PASSKEY_NOT_ALLOWED)return void h("Passkey request timed out or rejected by user.")}h("Unknown error occurred.")})).finally((()=>{c(!1)}))},loading:s,children:"Add new passkey"})]}),t(Sd,{})]})},[We.UPDATE_EMAIL_SCREEN]:()=>e(r,{children:[t(od,{},"header"),t(Tc,{}),t(Ic,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:t(yr,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),t(gc,{children:t(Uv,{stacked:!0})}),t(Ac,{}),t(Nd,{})]}),[We.UPDATE_PHONE_SCREEN]:()=>{let{currentScreen:n,data:a,navigate:i,setModalData:o}=ye(),{user:l}=M(),{initUpdatePhone:s}=P();return e(r,{children:[t(od,{},"header"),t(Tc,{}),t(Ic,{title:"Update your phone number",description:"Add the phone number you'd like to use going forward. We'll send you a confirmation code",icon:t(wr,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),t(gc,{children:t(_g,{stacked:!0,onSubmit:async function({qualifiedPhoneNumber:e}){try{if(!l?.phone?.number)throw Error("User is required to have an phone number to update it.");await s(l?.phone?.number,e),i(We.AWAITING_PASSWORDLESS_CODE)}catch(e){o({errorModalData:{error:e,previousScreen:a?.errorModalData?.previousScreen||n||We.LINK_PHONE_SCREEN}}),i(We.ERROR_SCREEN)}},hideRecent:!0})}),t(Ac,{}),t(Nd,{})]})},[We.CONNECT_ONLY_LANDING_SCREEN]:()=>{let{app:n,data:a}=ye(),i=a?.externalConnectWallet?.suggestedAddress,o=i?e("span",{children:["Connect the wallet with address ",t(Id,{showCopyIcon:!1,address:i})," ",n?.name?`to ${n.name}.`:"."]}):`Connect a wallet to your ${n?.name} account`;return e(r,{children:[t(od,{},"header"),t(Nc,{title:"Connect your wallet",description:o}),t(gd,{children:t(wu,{connectOnly:!0})}),n&&t(kd,{app:n,alwaysShowImplicitConsent:!0}),t(Nd,{})]})},[We.CONNECT_ONLY_AUTHENTICATED_SCREEN]:()=>{let{app:n,data:a}=ye(),i=a?.externalConnectWallet?.suggestedAddress,o=i?`Connect the wallet with address ${Be(i)} ${n?.name?`to ${n.name}.`:"."}`:`Connect a wallet to ${n?.name}`;return e(r,{children:[t(od,{},"header"),t(Sc,{title:"Connect your wallet",description:o}),t(gd,{children:t(wu,{connectOnly:!0})}),t(Nd,{})]})},[We.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN]:()=>{let{app:n,setModalData:a,navigate:i,data:o,onUserCloseViaDialogOrKeybindRef:l}=ye(),[s,c]=d(""),{embeddedWallets:u}=Ue(),{authenticated:h,user:m}=M(),{closePrivyModal:f}=P(),{onSuccess:g,onFailure:y,callAuthOnSuccessOnClose:w}=o.createWallet,v=!0===n?.embeddedWallets.requireUserOwnedRecoveryOnCreate,{createWallet:C}=hh(),[b,E]=d(null),$=new ml((async()=>{try{let e=await C({user:m});if(!e)return;E(e),i(We.EMBEDDED_WALLET_CREATED_SCREEN)}catch(e){c(e.message)}}));return p((()=>h&&m?v?(a({...o,recoverySelection:{...o?.recoverySelection,isInAccountCreateFlow:!0}}),i(Xu({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:u.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void $.execute():(i(We.LANDING),void y(Error("User must be authenticated before creating a Privy wallet")))),[v,h]),l.current=()=>null,s?e(r,{children:[t(od,{closeable:!1}),e(Cc,{children:[t(Cr,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),t(Ic,{title:"Something went wrong",description:s})]}),t(Hs,{onClick:()=>{b?(g(b),f({shouldCallAuthOnSuccess:w})):(y(new B("User wallet creation failed")),f({shouldCallAuthOnSuccess:!1}))},children:"Close"}),t(ph,{})]}):t(Fu,{})},[We.EMBEDDED_WALLET_CREATED_SCREEN]:()=>{let{user:n}=M(),{closePrivyModal:a,isNewUserThisSession:i,updateWallets:o}=P(),{app:l,data:s,onUserCloseViaDialogOrKeybindRef:d}=ye(),{onSuccess:c,onFailure:u,callAuthOnSuccessOnClose:h}=s.createWallet,m=()=>{let e=U(n);e?(o(),c(e)):u(Error("Failed to create wallet")),a({shouldCallAuthOnSuccess:h})};return p((()=>{let e=setTimeout(m,He);return()=>clearTimeout(e)}),[]),d.current=m,e(r,{children:[t(od,{onClose:m}),t(Tc,{}),e(Cc,{children:[t(vr,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),t(Ic,{title:i?"Welcome"+(l?.name?` to ${l?.name}`:""):"All set!",description:i?"You’ve successfully created an account.":"Your account is secured."})]}),t(Ac,{}),t(Nd,{})]})},[We.EMBEDDED_WALLET_CONNECTING_SCREEN]:()=>{let{authenticated:n,user:a,getAccessToken:i}=M(),{closePrivyModal:o,createAnalyticsEvent:l,walletProxy:s}=P(),{navigate:u,data:h,setModalData:m,onUserCloseViaDialogOrKeybindRef:f}=ye(),g=c((()=>Date.now()),[]),[y,w]=d(!1),{onCompleteNavigateTo:v,onFailure:C,shouldForceMFA:b,entropyId:E,entropyIdVerifier:$}=h?.connectWallet,T=e=>{y||(w(!0),C("string"==typeof e?Error(e):e))};p((()=>{let e,t=F(a,E);return n&&t?s?((async()=>{let r=await i();if(!r)return T("User must be authenticated and have a Privy wallet before it can be connected");try{await s.connect({accessToken:r,entropyId:E,entropyIdVerifier:$}),b&&await s.verifyMfa({accessToken:r});let t=(Date.now()-g)/1e3;v===We.EMBEDDED_WALLET_KEY_EXPORT_SCREEN&&t<1?e=setTimeout((()=>{u(v,!1)}),1e3*(1-t)):u(v,!1)}catch(e){if(Vu(e)&&"privy"===t.recoveryMethod){let e=await i();if(!e)return T("User must be authenticated and have a Privy wallet before it can be recovered");try{l({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:t.address}});let r=await(s?.recover({accessToken:e,entropyId:E,entropyIdVerifier:$}));r?.entropyId||T(Error("Unable to recover wallet")),v?u(v):o({shouldCallAuthOnSuccess:!1}),l({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:t.address}}),u(v)}catch(e){T("An error has occurred, please try again.")}}else Vu(e)&&"privy"!==t.recoveryMethod?(m({...h,recoverWallet:{entropyId:E,entropyIdVerifier:$,onCompleteNavigateTo:v,onFailure:C},recoveryOAuthStatus:{provider:t.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}}),u(eh(t.recoveryMethod))):T(e)}})(),()=>clearTimeout(e)):void 0:T("User must be authenticated and have a Privy wallet before it can be connected")}),[n,a,s]);let A=()=>{T("User exited before wallet could be connected"),o({shouldCallAuthOnSuccess:!1})};return f.current=A,e(r,{children:[t(od,{onClose:A}),y?e(r,{children:[e(Cc,{children:[t(Cr,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),t(Ic,{title:"Something went wrong",description:"We’re on it. Please try again later."})]}),t(Hs,{onClick:()=>o({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):t(Fu,{}),t(nh,{})]})},[We.EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN]:()=>{let[n,a]=d(!0),{authenticated:i,getAccessToken:o,user:l}=M(),{walletProxy:s,closePrivyModal:c,createAnalyticsEvent:u}=P(),{navigate:h,data:m,onUserCloseViaDialogOrKeybindRef:f}=ye(),[g,y]=d(void 0),[w,v]=d(""),[C,b]=d(!1),{entropyId:E,entropyIdVerifier:$,onCompleteNavigateTo:T,onSuccess:A,onFailure:x}=m.recoverWallet,_=(e="User exited before their wallet could be recovered")=>{c({shouldCallAuthOnSuccess:!1}),x("string"==typeof e?new B(e):e)};f.current=_,p((()=>{if(!i)return _("User must be authenticated and have a Privy wallet before it can be recovered")}),[i]);return e(r,{children:[t(od,{onClose:_}),t(Tc,{}),e(uw,{children:[e(cw,{children:[t(Cn,{height:48,width:48,stroke:"var(--privy-color-accent)"}),t("h3",{style:{color:"var(--privy-color-foreground)"},children:"Enter your password"}),t("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),e("div",{children:[e(bh,{children:[t(vh,{type:n?"password":"text",onChange:e=>(e=>{e&&y(e)})(e.target.value),disabled:C,style:{paddingRight:"2.3rem"}}),t(xh,{style:{right:"0.75rem"},children:n?t(kh,{onClick:()=>a(!1)}):t(Nh,{onClick:()=>a(!0)})})]}),!!w&&t(hw,{children:w})]}),e("div",{children:[e($c,{children:[t("h4",{children:"Why is this necessary?"}),t("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),t(pw,{loading:C||!s,disabled:!g,onClick:async()=>{b(!0);let e=await o(),t=F(l,E);if(!e||!t||null===g)return _("User must be authenticated and have a Privy wallet before it can be recovered");try{u({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:t.address}}),await(s?.recover({accessToken:e,entropyId:E,entropyIdVerifier:$,recoveryPassword:g})),v(""),T?h(T):c({shouldCallAuthOnSuccess:!1}),A?.(t),u({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:t.address}})}catch(e){!function(e){return Hu(e)&&("invalid_recovery_pin"===e.type||"invalid_request_arguments"===e.type)}(e)?v("An error has occurred, please try again."):v("Invalid recovery password, please try again.")}finally{b(!1)}},warn:!1,hideAnimations:!E&&C,children:"Recover your account"})]})]}),t(Ac,{}),t(Nd,{})]})},[We.EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN]:()=>{let[n,a]=d(!1),{navigate:i,lastScreen:o,navigateBack:l,setModalData:s,data:c,onUserCloseViaDialogOrKeybindRef:u}=ye(),{user:h}=M(),{embeddedWallets:p}=Ue(),{closePrivyModal:m}=P(),f=j(h),g=null===f,{isInAccountCreateFlow:y,isResettingPassword:w}=c.recoverySelection,v=f&&"privy"!==f.recoveryMethod,C=v?e("span",{children:["Your account is currently secured using"," ",t("strong",{children:Cw[f?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function b(e){s({recoveryOAuthStatus:{provider:e,action:g?"create-wallet":"set-recovery",isInAccountCreateFlow:y}}),i(We.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN)}function E(){c?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),m({shouldCallAuthOnSuccess:c?.setWalletPassword?.callAuthOnSuccessOnClose??!1})}return u.current=E,e(r,{children:[t(od,{onClose:E,backFn:n?()=>a(!1):o?l:void 0,infoFn:o||n?void 0:()=>a(!0)},"header"),n?t(bw,{onClose:()=>a(!1)}):e(r,{children:[t(Ic,{title:v?"Update backup method":"Secure your account",icon:t(On,{width:48}),description:C}),t(gw,{children:p.userOwnedRecoveryOptions.filter((e=>!["icloud","google-drive"].includes(f?.recoveryMethod||"")||e!==f?.recoveryMethod)).sort().map((r=>{switch(r){case"google-drive":return e(Cd,{onClick:()=>b("google-drive"),children:[t(vw,{children:t(fw,{style:{width:18}})}),"Back up to Google Drive"]},r);case"icloud":return e(Cd,{onClick:()=>b("icloud"),children:[t(vw,{children:t(mw,{style:{width:24}})}),"Back up to Apple iCloud"]},r);case"user-passcode":return e(Cd,{onClick:()=>{i(Ju({isCreatingWallet:g,skipSplashScreen:!0}))},children:[t(vw,{children:t(Pn,{style:{width:18}})}),w?"Reset your":"Set a"," password"]},r);default:return null}}))})]}),t(Nd,{})]})},[We.EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN]:()=>{let{user:n,getAccessToken:a}=M(),{walletProxy:i,refreshUser:o,closePrivyModal:l}=P(),s=ye(),{entropyId:c,entropyIdVerifier:u}=s.data?.recoverWallet,[h,p]=d(!1),[m,f]=d(null),[g,y]=d(null);function w(){if(!h){if(g)return s.data?.setWalletPassword?.onFailure(g),void l();if(!m)return s.data?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),void l()}}s.onUserCloseViaDialogOrKeybindRef.current=w;let v=!(!h&&!m);return e(r,g?{children:[t(od,{onClose:w},"header"),t(Ew,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:t(dr,{height:38,width:38,stroke:"var(--privy-color-error)"})}),t(lh,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),t(md,{style:{minHeight:"2rem"}}),t(Vs,{onClick:()=>y(null),children:"Try again"}),t(Nd,{})]}:{children:[t(od,{onClose:w},"header"),t(On,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),t(lh,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),t(oh,{style:{marginTop:"1rem"},children:"When you log into a new device, you’ll only need to authenticate to access your account. Never get logged out if you forget your password."}),t(md,{style:{minHeight:"2rem"}}),t(Vs,{loading:h,disabled:v,onClick:()=>async function(){p(!0);try{let e=await a(),t=F(n,c);if(!e||!i||!t)return;if(!(await i.setRecovery({accessToken:e,entropyId:c,entropyIdVerifier:u,existingRecoveryMethod:t.recoveryMethod,recoveryMethod:"privy"})).entropyId)throw Error("Unable to set recovery on wallet");let r=await o();if(!r)throw Error("Unable to set recovery on wallet");let d=F(r,t.address);if(!d)throw Error("Unabled to set recovery on wallet");f(!!r),setTimeout((()=>{s.data?.setWalletPassword?.onSuccess(d),l()}),je)}catch(e){y(e)}finally{p(!1)}}(),children:m?"Success":"Confirm"}),t(Nd,{})]})},[We.EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN]:()=>{let{logout:n}=M(),{navigate:a,setModalData:i,data:o}=ye(),{recoveryOAuthFlow:l,closePrivyModal:s,createAnalyticsEvent:c}=P(),[u,h]=d(!1),{provider:f,action:g,isInAccountCreateFlow:y}=o?.recoveryOAuthStatus,[w,v]=d(void 0),[C,b]=d("create-wallet"===g);if("user-passcode"===f)throw Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let E=ww[f].name,$=ww[f].component,T=o?.recoverWallet?.onCompleteNavigateTo,A=new ml((async(e="create-wallet")=>(b(!0),new Promise(((t,r)=>{setTimeout((async()=>{try{let r=window.open();await l(f,e,r),h(!0),t()}catch(t){v({message:`${"recover"===e?"Recovery":"Back up"} with ${E} unsuccessful`,detail:"recover"===g?`Please verify that you are selecting the ${E} account associated with your backup.`:"",retryable:!0}),r()}}),0)})))));p((()=>{"recover"!==g&&A.execute(y?"create-wallet":"set-recovery")}),[]),p((()=>{if(!u)return;let e=setTimeout((()=>{y?(i({createWallet:{onSuccess:()=>{},onFailure:e=>{c({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"RecoveryOAuthScreen"}}),n()},callAuthOnSuccessOnClose:!0}}),a(We.EMBEDDED_WALLET_CREATED_SCREEN)):s({shouldCallAuthOnSuccess:!1})}),je);return()=>clearTimeout(e)}),[u]);let x=m((async()=>{await A.execute("recover"),T?a(T):h(!0)}),[]),_="google-drive"===f?"Google Drive":"Apple iCloud",k=u&&`Successfully ${"recover"===g?"recovered":"backed up"} with ${_}.`||w&&w.message||`${"recover"===g?"Recovering":"Backing up"} with ${_}...`,N=w?w.detail:"";return e(r,{children:[t(od,{}),C?t(r,{children:e(gw,{children:[t(Ic,{title:k,icon:t($,{style:{width:"38px",height:"38px"}}),description:N}),w&&w?.retryable?t(Hs,{onClick:()=>{pl(),v(void 0),"create-wallet"===g?A.execute("create-wallet"):x()},disabled:!u&&!w?.retryable,children:"Try again"}):null]})}):e(gw,{children:[t(Ic,{title:"Confirm it's really you",icon:t($,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${_} where your account is backed up.`}),e(Hs,{onClick:x,children:["Confirm with ",_]})]}),t(Nd,{})]})},[We.EMBEDDED_WALLET_KEY_EXPORT_SCREEN]:()=>{let[n,a]=d(null),{authenticated:i,user:o,getAccessToken:l}=M(),{closePrivyModal:s,createAnalyticsEvent:c,clientAnalyticsId:u}=P(),h=Ue(),{data:m,onUserCloseViaDialogOrKeybindRef:f}=ye(),{onFailure:g,onSuccess:y,origin:w,appId:v,appClientId:C,walletToExport:b,primaryWallet:E}=m.keyExport,$=e=>{s({shouldCallAuthOnSuccess:!1}),g("string"==typeof e?Error(e):e)},T=()=>{s({shouldCallAuthOnSuccess:!1}),y(),c({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:b.address}})};return p((()=>{if(!i||!b)return $("User must be authenticated before exporting their wallet");l().then(a,$)}),[i,o]),f.current=T,e(r,{children:[t(od,{onClose:T}),e(dh,{children:[t(lh,{children:"Transfer wallet"}),e(oh,{children:["Either copy your private key or seed phrase to transfer your wallet."," ",t("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),t(ah,{theme:h.appearance.palette.colorScheme,children:"Never share your private key or seed phrase with anyone."}),t(Pu,{isLoading:!1,isPulsing:!1,title:"Your wallet",address:b.address,showIcon:!0}),t("div",{style:{width:"100%"},children:n&&t(sh,{origin:w,appId:v,appClientId:C,accessToken:n,clientAnalyticsId:u,walletToExport:b,primaryWallet:E,dimensions:{height:"44px"}})})]}),t(Nd,{})]})},[We.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN]:()=>{let{authenticated:n}=M(),{initializeWalletProxy:a,closePrivyModal:i}=P(),{navigate:o,data:l,onUserCloseViaDialogOrKeybindRef:s}=ye(),[c,u]=d(!0),[h,m]=d(""),[f,g]=d(),[y,w]=d(null),[v,C]=d(!1),b=null!==y;p((()=>{n||o(We.LANDING)}),[n]),p((()=>{a(qe).then((e=>{u(!1),e||(m("An error has occurred, please try again."),g(new Ht(new Zt(h,Kt.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))}))}),[]);let{method:E,data:$,confirmAndSign:T,onSuccess:A,onFailure:x,uiOptions:_}=l.signMessage,k={title:_.title||"Sign message",description:_.description||"Signing this message will not cost you any fees.",buttonText:_.buttonText||"Sign and continue"},N=e=>{e?A(e):x(f||new Ht(new Zt("The user rejected the request.",Kt.E4001_USER_REJECTED_REQUEST.eipCode))),i({shouldCallAuthOnSuccess:!1}),setTimeout((()=>{w(null),m(""),g(void 0)}),200)};return s.current=()=>{N(y)},e(r,{children:[t(od,{onClose:()=>N(y)}),t(Tc,{}),_.iconUrl&&"string"==typeof _.iconUrl?t(Lv,{children:t(_v,{size:"sm",src:_.iconUrl,alt:"app image"})}):null,t(lh,{children:k.title}),t(oh,{children:k.description}),"personal_sign"===E&&t(Ov,{children:kv($)}),"eth_signTypedData_v4"===E&&t(Iv,{typedData:$}),"solana_signMessage"===E&&t(Ov,{children:$}),t(Dv,{}),t(Mv,{$fail:!0,children:h}),t(Vs,{disabled:v||b||c,loading:v,onClick:async()=>{C(!0),m("");try{let e=await T();w(e),C(!1),setTimeout((()=>{N(e)}),je)}catch(e){console.error(e),m("An error has occurred, please try again."),g(new Ht(new Zt(h,Kt.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),C(!1)}},children:v?"Signing...":b?e(Rv,{children:[t(lp,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",t("span",{children:"Success"})]}):k.buttonText}),t(Ac,{}),t(Nd,{})]})},[We.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN]:()=>{let e,{data:r,onUserCloseViaDialogOrKeybindRef:n,setModalData:a,navigate:i}=ye(),{rpcConfig:o,chains:l,closePrivyModal:s,walletProxy:u}=P(),{getAccessToken:h,user:m}=M(),f=Ue(),[g,y]=d(0),w=(e=>e?.sendTransaction?"transactionRequest"in e.sendTransaction?0:e.sendTransaction.transactionRequests.length-1:0)(r),[v,C]=d(xv(r,g)),[b,E]=d(null),[$,T]=d(),[A,x]=d(!1),[_,k]=d(null),[N,S]=d(null);if(!v||!r?.sendTransaction||!r?.sendTransaction.transactingWallet)return t(ap,{error:Error("Invalid transaction request"),onClick:()=>{r?.sendTransaction?.onFailure(Av),s({shouldCallAuthOnSuccess:!1})}});let{entropyId:I,entropyIdVerifier:O,transactingWallet:R}=r.sendTransaction,L=c((()=>l.find((e=>Number(e.id)===Number(v.chainId)))),[v.chainId]),D=L?.nativeCurrency.symbol??"ETH",F=c((()=>bv(v.data,!!f.embeddedWallets.extendedCalldataDecoding)),[v.data]),{action:U,isErc20Ish:W,isNFTIsh:B}=F;p((()=>{v.to&&L&&W&&$f({address:v.to,chain:L,rpcConfig:f.rpcConfig,privyAppId:f.id}).then(E).catch(console.error)}),[v.to,L]);let{tokenPrice:j,isTokenPriceLoading:z}=Lp(v.chainId),G=c((()=>fe(Number(v.chainId),l,o,{appId:f.id})),[v.chainId,o]),H=Tv(v,R,G);p((()=>{C(xv(r,g))}),[g]),p((()=>{r.sendTransaction?.getIsSponsored?r.sendTransaction.getIsSponsored().then(T).catch(console.error):T(!1)}),[r.sendTransaction.getIsSponsored]);let V=()=>{if(!A)return _?r?.sendTransaction?.onSuccess(_.response):N||H?.errors[0]?r?.sendTransaction?.onFailure(N??H?.errors[0]??Av):r?.sendTransaction?.onFailure(new Ht(new Zt("The user rejected the request",Kt.E4001_USER_REJECTED_REQUEST.eipCode))),s({shouldCallAuthOnSuccess:!1})};n.current=V;let q=!!(r.funding&&r.funding.supportedOptions.length>0),Z="fiat-currency"===f.embeddedWallets.priceDisplay.primary,K=ra(H?.tx.value??0).add(ra(H?.totalGasEstimate?.toBigInt()??0)).toHexString(),Y=$m(K,D),Q=Z&&j?Em(K,j):void 0,J=$m(H?.totalGasEstimate?.toString()??0,D),X=Z&&j?Em(H?.totalGasEstimate?.toString()??0,j):void 0,ee=$m(H?.balance?.toString()??0,D,void 0,!0),te=Z&&j?Em(H?.balance?.toString()??0,j):void 0,re=r.sendTransaction?.uiOptions?.transactionInfo?.title;re||(re="approve"===U?W?"Confirm address":"Confirm action":`Approve ${U}`);let ne=r.sendTransaction?.uiOptions?.description||`${f.name} wants your permission to approve the following transaction.`,ae=r.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?t("img",{src:r.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:r.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,ie=!(!H||H.errors[0]||H.hasFunds||!1!==$),oe=ie&&q,le=oe?"Add funds":r.sendTransaction?.uiOptions?.buttonText||(g<w?"Continue":"Approve");if(_?.receipt)return t(cv,{txn:H?.tx??v,onClose:V,receipt:_.receipt,transactionInfo:r.sendTransaction?.uiOptions.transactionInfo,tokenPrice:j,tokenSymbol:D,l1GasEstimate:H?.l1ExecutionFeeEstimate?.toString(),receiptHeader:r.sendTransaction?.uiOptions.successHeader,receiptDescription:r.sendTransaction?.uiOptions.successDescription});if(N)return t(Rw,{transactionError:N,network:"ethereum",chainId:H?.tx.chainId??v.chainId,onClose:V,onRetry:({resetNonce:e})=>{S(null);let t={...H?.tx??v};e&&(t.nonce=void 0),C(t)}});let se=0!==w&&"number"==typeof g&&0!==g?()=>{y(g-1)}:void 0;return"amount"in F&&F.amount&&(F.isNFTIsh?e=F.amount.toString():b&&(e=sf({amount:F.amount,decimals:b.decimals}))),t(_w,{transactionIndex:g,onBack:se,maxIndex:w,disabled:ie&&!q,isSubmitting:A,submitError:N,isPreparing:!H,isTokenPriceLoading:z,isTokenContractInfoLoading:!B&&!b,prepareError:H?.errors[0],symbol:b?.symbol,chain:L,img:ae,title:re,subtitle:ne,total:v.value?Q??Y:void 0,txValue:v.value,fee:X??J,isSponsored:$,from:R?.address??"",to:v.to,network:f.chains.find((e=>e.id===v.chainId))?.name??"",transactionDetails:{...F,formattedAmount:e},cta:le,missingFunds:ie,action:U,balance:te??ee,onClose:V,onClick:oe?async()=>{if(!R)return;if(!q)throw Error("Funding wallet is not enabled");let e=We.FUNDING_METHOD_SELECTION_SCREEN;a({...r,funding:{...r.funding,methodScreen:e,chainType:"ethereum",amount:qr(BigInt(H?.tx.value??0)+BigInt(H?.totalGasEstimate?.toString()??0)),chain:L}}),i(e)}:async()=>{if(g<w)y(g+1);else{x(!0);try{let e=await h();if(A||!e||!R||!u||!m)return;let t=r?.sendTransaction?.onConfirm?await r.sendTransaction.onConfirm().then((e=>G.getTransaction(e))):await ov({accessToken:e,transactingWallet:R,entropyId:I,entropyIdVerifier:O,walletProxy:u,transactionRequest:H?.tx??v,provider:G,requesterAppId:r.sendTransaction?.requesterAppId}),n=await t.wait();k({receipt:sv(n),response:t})}catch(e){console.warn({transaction:H?.tx??v,error:e}),S(e)}finally{x(!1)}}}})},[We.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN]:()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:r,setModalData:n,navigate:a}=ye(),{closePrivyModal:i,walletProxy:o}=P(),l=Ue(),{user:s,getAccessToken:c}=M(),[u,h]=d(e?.sendSolanaTransaction?.transactionRequest),[m,f]=d(),[g,y]=d(),[w,v]=d(0),[C,b]=d(!1),[E,$]=d(),[T,A]=d(null),x=e?.sendSolanaTransaction?.connection,_=e?.sendSolanaTransaction?.transactingWallet,N=m?.instructions.at(w),S=m?.instructions.length??1,I=Et(x?.rpcEndpoint||""),O=j(s);if(p((()=>{!async function(){if(u&&x)try{y(void 0);let e=await Jp(u,x);f(e),v(0)}catch(e){console.warn("Failed to prepare transaction",e),y(e)}}()}),[u,x]),!(u&&e?.sendSolanaTransaction&&_&&x)){let r=Error("Invalid transaction request");return t(ap,{error:r,onClick:()=>{e?.sendSolanaTransaction?.onFailure(r),i({shouldCallAuthOnSuccess:!1})}})}let{solPrice:R,isSolPriceLoading:L}=Rp(),D=()=>{if(!C)return E?e?.sendSolanaTransaction?.onSuccess(E):(e?.sendSolanaTransaction?.onFailure(T??g??Error("User exited the modal before submitting the transaction")),v(0)),i({shouldCallAuthOnSuccess:!1})};r.current=D;let F="fiat-currency"===l.embeddedWallets.priceDisplay.primary,U=e.sendTransaction?.uiOptions?.transactionInfo?.title||("approve"===N?.action?"Confirm address":"Approve transaction"),W=e.sendTransaction?.uiOptions?.description||`${l.name} wants your permission to approve the following transaction.`,B=e.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?t("img",{src:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,z=N?.amount||0n,G=0===w&&m?.fees||0n,H=N?.balance||0n,V=N?.from,q=N?.to,Z=z+G,K=Gp(Z),Y=F&&R?Hp(Z,R):void 0,Q=G?Gp(G):void 0,J=F&&R?Hp(G,R):void 0,X=H?Gp(H):void 0,ee=F&&R?Hp(H,R):void 0,te=!g&&!N?.hasFunds,re=!!(e.funding&&e.funding.supportedOptions.length>0),ne=te&&re,ae=ne?"Add funds":e.sendTransaction?.uiOptions?.buttonText||"Approve";return E?t(av,{instructions:m?.instructions.map((({from:e,to:t,amount:r})=>({from:e?.toBase58(),to:t?.toBase58(),amount:r})))??[],fees:0===w?E.fees:0n,onClose:D,transactionInfo:e.sendTransaction?.uiOptions.transactionInfo,solPrice:R,receiptHeader:e.sendTransaction?.uiOptions.successHeader,receiptDescription:e.sendTransaction?.uiOptions.successDescription,rpcEndpoint:x.rpcEndpoint}):T?t(Rw,{transactionError:T,connection:x,onClose:D,network:"solana",onRetry:async()=>{A(null);let{blockhash:e}=await x.getLatestBlockhash();qp(u)?u.message.recentBlockhash=e:u.recentBlockhash=e,h(u)}}):t(_w,{isSubmitting:C,submitError:T,isPreparing:!m,isTokenPriceLoading:L,isTokenContractInfoLoading:!1,symbol:"SOL",chain:void 0,img:B,title:U,subtitle:W,from:V?.toBase58()||"",to:q?.toBase58(),fee:J??Q,total:null!=z?Y??K:void 0,txValue:z,spender:N?.spender?.toBase58(),network:I,cta:ae,missingFunds:te,action:N?.action,balance:ee??X,prepareError:g,chainName:"Solana",onClose:D,onClick:ne?async()=>{if(!_)return;if(!re)throw Error("Funding wallet is not enabled");let t=We.FUNDING_METHOD_SELECTION_SCREEN;n({...e,funding:{...e.funding,methodScreen:t}}),a(t)}:async()=>{if(w<(m?.instructions.length??1)-1)v(w+1);else try{b(!0);let t=await c();if(C||!t||!_||!o||!s||!O)return;let{entropyId:r,entropyIdVerifier:n}=k(O),{signature:a,receipt:i}=await Tw({tx:u,accessToken:t,connection:x,walletProxy:o,entropyId:r,entropyIdVerifier:n,transactingWalletAddress:_.address,transactingWalletIndex:_.walletIndex??0,transactionOptions:e.sendSolanaTransaction?.transactionOptions});$(Qp(a,i))}catch(e){console.warn({transaction:u,error:e}),A(e)}finally{b(!1)}},isSponsored:!1,transactionIndex:w,maxIndex:S-1,disabled:te&&!re,onBack:w>0&&S>1?()=>v(w-1):void 0})},[We.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN]:()=>{let{app:n,data:a}=ye(),{closePrivyModal:i}=P(),[o,l]=d(!1),[s,c]=d(),{address:u,onDelegate:h,onSuccess:m,onError:f}=a.delegatedActions.consent,g=async()=>{o?m():f(s??new E("User declined delegating actions.")),i({shouldCallAuthOnSuccess:!1})};return p((()=>{if(!o&&!s)return;let e=setTimeout(g,He);return()=>clearTimeout(e)}),[o,s]),e(r,o||s?{children:[t(od,{onClose:g}),t(Tc,{}),e(wc,{children:[s?t(pr,{stroke:"var(--privy-color-error)",width:"64px",height:"64px"}):t(Tr,{stroke:"var(--privy-color-success)",width:"64px",height:"64px"}),t(_c,{height:20}),t(Ic,{title:s?"Something went wrong":"Success!",description:s?"Please try again.":`You’ve successfully granted delegated action permissions to ${n.name}.`})]}),t(Ac,{}),t(Nd,{})]}:{children:[t(od,{closeable:!0,onClose:g}),t(Mu,{width:56,height:56,style:{margin:"auto"}}),t(Zd,{style:{marginTop:24,color:"var(--privy-color-foreground)"},children:"Enable delegated actions"}),e(Kd,{style:{marginBottom:24,textWrap:"pretty"},children:["Give ",n.name," permissions to transact on your behalf. You can revoke this later."," ",t("a",{style:{color:"var(--privy-color-accent-dark)"},href:"https://www.privy.io/using-privy",target:"_blank",children:"Learn more"})]}),t(Lu,{showIcon:!0,address:u,title:"Wallet",isLoading:!1}),e(Ru,{style:{marginTop:24},children:[t(Ys,{onClick:g,children:"Not now"}),t(Hs,{onClick:async()=>{try{await h(),l(!0)}catch(e){c(e)}},children:"Accept"})]}),t(Nd,{})]})},[We.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN]:()=>{let{app:n,data:a}=ye(),{closePrivyModal:i}=P(),[o,l]=d(!1),[s,c]=d(),{onRevoke:u,onSuccess:h,onError:m}=a.delegatedActions.revoke,f=async()=>{o?h():m(s??new E("User declined revoking access to their delegated wallet.")),i({shouldCallAuthOnSuccess:!1})};return p((()=>{if(!o&&!s)return;let e=setTimeout(f,He);return()=>clearTimeout(e)}),[o,s]),e(r,o||s?{children:[t(od,{onClose:f}),t(Tc,{}),e(wc,{children:[s?t(pr,{stroke:"var(--privy-color-error)",width:"64px",height:"64px"}):t(Tr,{stroke:"var(--privy-color-success)",width:"64px",height:"64px"}),t(_c,{height:20}),t(Ic,{title:s?"Something went wrong":"Success!",description:s?"Please try again.":"You've successfully revoked permissions."})]}),t(Ac,{}),t(Nd,{})]}:{children:[t(od,{closeable:!0,onClose:f}),t(Mu,{width:56,height:56,style:{margin:"auto"}}),t(Zd,{style:{marginTop:24},children:"Revoke permission"}),e(Kd,{children:["Revoke permission for ",n.name," to transact on your behalf."]}),e(Du,{style:{marginTop:24},children:[t(Ys,{onClick:f,children:"Deny"}),t(Hs,{onClick:async()=>{try{await u(),l(!0)}catch(e){c(e)}},children:"Confirm"})]}),t(Nd,{})]})},[We.FUNDING_METHOD_SELECTION_SCREEN]:()=>{let{wallets:a}=G(),{wallets:i}=Vt(),{navigate:o,data:l,setModalData:s}=ye(),{client:d}=P(),u=Ue(),h=l?.funding,m=bf(Bf),f=bf(jf),g="solana"===h.chainType,y=g?void 0:h,w=c((()=>Uf(u,d,h,s,o,l)),[u,d,h,l,s,o]);p((()=>{if(h?.defaultFundingMethod&&h.usingDefaultFundingMethod)switch(s({funding:{...h,usingDefaultFundingMethod:!1}}),h?.defaultFundingMethod){case"card":w.onFundWithCard[0]&&w.onFundWithCard[0]();break;case"exchange":w.onFundWithExchange&&w.onFundWithExchange();break;case"wallet":w.onFundWithWallet&&w.onFundWithWallet();break;case"manual":o(We.FUNDING_MANUAL_TRANSFER_SCREEN)}}),[]),p((()=>{y?.erc20Address&&!y.erc20ContractInfo&&$f({address:y.erc20Address,chain:y.chain,rpcConfig:u.rpcConfig,privyAppId:u.id}).then((e=>{s({...l,funding:{...y,erc20ContractInfo:e?{symbol:e.symbol,decimals:e.decimals}:void 0}})})).catch(console.error)}),[y?.erc20Address,y?.chain]);let v=g?i.find((({address:e})=>e===h.address)):a.find((({address:e})=>n(e)===n(h.address))),C=v&&"privy"!==v.walletClientType?tu(v.walletClientType,v.connectorType,v.walletClientType):u.name,b=!(!y?.erc20Address||y?.erc20ContractInfo);return e(r,{children:[t(Np,{}),e("h3",{children:["Add funds to your"," ",C?.toLowerCase().endsWith("wallet")?C:C+" wallet"]}),e(Gm,{children:[h.errorMessage&&t(ff,{theme:u.appearance.palette.colorScheme,children:h.errorMessage}),w.onFundWithCard?.[0]&&e(Cd,{disabled:b,onClick:w.onFundWithCard[0],children:[t(Hm,{children:t(fn,{style:{width:24}})}),"Pay with card",m?t(vf,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):f?t(Cf,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):null]}),w.onFundWithExchange&&e(Cd,{disabled:b,onClick:w.onFundWithExchange,children:[t(Hm,{children:t(pn,{style:{width:24}})}),"Transfer from an exchange"]}),w.onFundWithWallet&&e(Cd,{disabled:b,onClick:w.onFundWithWallet,children:[t(Hm,{children:t(Ef,{style:{width:24}})}),"Transfer from wallet"]}),e(Cd,{disabled:b,onClick:()=>o(We.FUNDING_MANUAL_TRANSFER_SCREEN),children:[t(Hm,{children:t(gn,{style:{width:24}})}),"Receive funds"]}),h?.showAlternateFundingMethod&&w.onFundWithCard?.[1]&&t(yf,{theme:u.appearance.palette.colorScheme,children:e(ef,{children:["Having trouble or facing location restrictions?"," ",t(tf,{onClick:w.onFundWithCard[1],children:"Try a different provider."})]})})]}),t(Nd,{})]})},[We.MOONPAY_STATUS_SCREEN]:()=>{let{app:n,data:a,setModalData:i,navigateBack:o}=ye(),{closePrivyModal:l}=P(),{externalTransactionId:s}=a?.moonpayStatus,d=Df(s||null,n.fundingMethodConfig.moonpay.useSandbox??!1);return e(r,{children:[t(od,{title:"Fund account",backFn:()=>{let e={...a?.funding,showAlternateFundingMethod:!0};e.usingDefaultFundingMethod&&(e.usingDefaultFundingMethod=!1),i({funding:e}),o()}}),t(qf,{status:d,onClickCta:l}),t(Nd,{})]})},[We.COINBASE_ONRAMP_STATUS_SCREEN]:()=>{let{data:n,setModalData:a,navigate:i,navigateBack:o}=ye(),{closePrivyModal:l,createAnalyticsEvent:c,client:u}=P(),[h,m]=d("pending-in-flow"),f=s(0),g={...n?.funding,showAlternateFundingMethod:!0};g.usingDefaultFundingMethod&&(g.usingDefaultFundingMethod=!1);let{partnerUserId:y,popup:w}=n?.coinbaseOnrampStatus??{};return p((()=>{if("pending-in-flow"===h||"pending-after-flow"===h){let e=setInterval((async()=>{if(y)try{let{status:e}=await u.getCoinbaseOnRampStatus({partnerUserId:y});if("success"===e)return void m("success");if("failure"===e)throw Error("There was an error completing Coinbase Onramp flow.");if(f.current>=3)return a({funding:g}),void i(We.FUNDING_METHOD_SELECTION_SCREEN);w?.closed&&(f.current=f.current+1,m("pending-after-flow"))}catch(e){console.error(e),m("error"),c({eventName:Dp,payload:{status:"failure",provider:"coinbase-onramp",error:e.message}}),a({funding:{...g,errorMessage:"Something went wrong adding funds. Please try again or use another method."}}),i(We.FUNDING_METHOD_SELECTION_SCREEN)}}),1500);return()=>clearInterval(e)}}),[y,w,h]),e(r,{children:[t(od,{title:"Fund account",backFn:()=>{a({funding:g}),o()}},"header"),t(uf,{status:h,onClickCta:l}),t(Nd,{})]})},[We.FUNDING_TRANSFER_FROM_WALLET_SCREEN]:()=>{let n,{connectors:a}=P(),{app:i,setModalData:o,data:l,navigate:s}=ye(),{wallets:c}=G(),{wallets:u}=Vt(),[h,m]=d("default"),f="solana"===l?.funding?.chainType,g=!!l?.funding?.crossChainBridgingEnabled;n="ethereum"===l?.funding?.chainType?l.funding.erc20Address&&!l.funding.isUSDC?"ethereum-only":g&&!l.funding.chain.testnet?"ethereum-and-solana":"ethereum-only":g?"ethereum-and-solana":"solana-only";let y=c.filter((e=>"privy"!==e.walletClientType)),w=y.map((e=>e.walletClientType)),v=u.filter((e=>"privy"!==e.walletClientType)),C=v.map((e=>e.walletClientType)),b=[],E={...l.funding};E.usingDefaultFundingMethod&&(E.usingDefaultFundingMethod=!1);let $=({address:e,walletChainType:t})=>{o({...l,funding:{...E,connectedWalletAddress:e,onContinueWithExternalWallet:()=>s(A({destChainType:f?"solana":"ethereum",sourceChainType:t}))}}),s(We.FUNDING_EDIT_AMOUNT_SCREEN)};"solana-only"!==n&&b.push(...y.map(((e,r)=>t(Jf,{onClick:()=>$({address:e.address,walletChainType:"ethereum"}),icon:e.meta.icon,name:e.meta.name},r)))),"ethereum-only"!==n&&b.push(...v.map(((e,r)=>t(Jf,{onClick:()=>$({address:e.address,walletChainType:"solana"}),icon:e.meta.icon,name:e.meta.name},r)))),b.push(...vu({walletList:i.appearance.walletList.filter((e=>!y.some((t=>t.walletClientType===e))&&!v.some((t=>t.walletClientType===e)))),walletChainType:n,connectors:a,connectOnly:!0,ignore:[...i.appearance.walletList,...w,...C],walletConnectEnabled:i.externalWallets.walletConnect.enabled}));let T=t(Qf,{text:"More wallets",onClick:()=>m("overflow")}),A=({sourceChainType:e,destChainType:t})=>"ethereum"===e&&"solana"===t?We.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN:"ethereum"===e&&"ethereum"===t?We.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN:"solana"===e&&"ethereum"===t?We.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN:We.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN;return p((()=>{o({...l,externalConnectWallet:{onCompleteNavigateTo:({walletChainType:e})=>(o({...l,funding:{...E,onContinueWithExternalWallet:()=>{s(A({destChainType:f?"solana":"ethereum",sourceChainType:e??"ethereum"}))}}}),We.FUNDING_EDIT_AMOUNT_SCREEN)}})}),[]),e(r,"overflow"===h?{children:[t(od,{backFn:()=>m("default")},"header"),e(gd,{children:[t(oh,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),b]}),t(Nd,{})]}:{children:[t(Np,{}),t(Ic,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),e(gd,{children:[b.length>4?b.slice(0,3):b,b.length>4&&T]}),t(Nd,{})]})},[We.FUNDING_EDIT_AMOUNT_SCREEN]:()=>{let{data:n,setModalData:a}=ye(),i=n?.funding,o="solana"===i.chainType,l=s(null),[c,u]=d(!1),{tokenPrice:h}=Lp(o?"solana":i.chain.id);p((()=>{l.current&&l.current.style.setProperty("--funding-input-length",Math.max(i.amount.length,1).toString())}),[i.amount,l.current]);let m=o?void 0:i,f=!(!m?.erc20Address||m?.erc20ContractInfo),g=o?"SOL":i.erc20Address?i.erc20ContractInfo?.symbol:i.chain.nativeCurrency.symbol||"ETH",y=parseFloat(i.amount),w=!isNaN(y)&&y>0,v=h?bm(i.amount,h):void 0;return e(r,{children:[t(Np,{}),t(lh,{children:"Confirm or edit amount"}),e(bc,{style:{marginTop:"32px"},children:[t(Vm,{children:f?t(Sp,{size:"50px"}):e(r,{children:[e(qm,{onClick:()=>l.current?.focus(),children:[t(Km,{ref:l,value:i.amount,onFocus:()=>u(!0),onBlur:()=>u(!1),onChange:e=>{let t=e.target.value;/^[0-9.]*$/.test(t)&&t.split(".").length-1<=1&&a({...n,funding:{...i,amount:t}})}}),t(Qm,{children:g}),!c&&t(Ym,{children:t(mn,{width:12,height:12})})]}),!m?.erc20Address&&t(Jm,{children:v&&w?v:""})]})}),t(Pm,{onClick:()=>{l.current?.focus()},children:"Edit amount"}),t(Vs,{style:{marginTop:"1rem"},disabled:!w,onClick:i.onContinueWithExternalWallet,children:"Continue"})]}),t(Nd,{})]})},[We.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN]:()=>{let{rpcConfig:n,appId:a,closePrivyModal:i,createAnalyticsEvent:o}=P(),{navigate:l,setModalData:s,app:c,data:u}=ye(),{wallets:h}=G(),[m,f]=d(!1),[g,y]=d(0n),[w,v]=d(!1),[C,b]=d(null),[$,A]=d(null),[x,_]=d([]),[k,N]=d(0),[S,I]=d(!1),[O,M]=d(!1),[R,L]=d(!1),[D,F]=d(!1);if(!u?.funding||"ethereum"!==u.funding.chainType)throw Error("Invalid funding data");let{erc20ContractInfo:U,chain:W,amount:B,connectedWalletAddress:j}=u.funding,z=u.funding.address,H=u.funding.erc20Address;p((()=>{H&&!U&&b(Error("Unable to fetch token details"))}),[]);let V=!!H&&!!U,q=V?BigInt(parseFloat(B)*10**U.decimals):zr(B),Z=j?h.find((({address:e})=>e===j)):h[0],[K,Y]=d(null);p((()=>{(async()=>{if(!Z)return;let e=await Z.getEthereumProvider();Y(Wr({account:Z.address,transport:Br(e)}).extend(jr))})().catch(console.error)}),[Z]);let[Q,J]=d(0n);p((()=>{Fr({chain:W,transport:Ur(Je(W,n,a))}).getBalance({address:z}).then(J).catch(console.error)}),[]);let[X,ee]=d(0n);p((()=>{V&&df({chain:W,address:z,appId:a,rpcConfig:n,erc20Address:H}).then((e=>ee(e.balance))).catch(console.error)}),[]);let{tokenPrice:te}=Lp(W.id),[re,ne]=d({to:z,chain:W,value:q,data:void 0});p((()=>{(async()=>{let e,t;if(!K||!Z||S||R)return;I(!0);let r=Fr({chain:re.chain,transport:Ur(Je(re.chain,n,a))});if(V&&!re.data)return await r.simulateContract({address:H,chain:re.chain,abi:of,functionName:"transfer",args:[z,q],account:Z.address}).catch((e=>{console.warn("Simulated token transfer failed with error, fetching bridge options.",e)}))?(I(!1),void ne({to:H,chain:re.chain,data:Gr({abi:of,functionName:"transfer",args:[z,q]}),value:"0x0"})):(I(!1),void v(!0));try{e=await r.prepareTransactionRequest({account:Z.address,to:re.to,chain:re.chain,data:re.data,value:BigInt(re.value??0)})}catch(e){if(console.error(e),x.length>1)A(e.shortMessage??"Something went wrong");else if(O&&0===x.length)return void b(new E(`Wallet ${Be(Z.address)} does not have enough funds.`,void 0,T.INSUFFICIENT_BALANCE))}if(!e)return I(!1),void v(!0);I(!1),L(!0),f(!0),y(e.gas);try{await K.switchChain({id:re.chain.id})}catch(e){await K.addChain({chain:re.chain}),await K.switchChain({id:re.chain.id})}try{t=await K.sendTransaction(e),o({eventName:Dp,payload:{provider:"external",status:"success",address:Z.address,chainId:re.chain.id,value:re.value?.toString(),txHash:t}})}catch(e){if(console.error(e),"TransactionExecutionError"===e.name)if(x.length<1){let t=e.shortMessage;(e.shortMessage.includes("rejected the request")||e.details.includes("rejected the request"))&&(t="User rejected the request."),b(new E(t,void 0,T.TRANSACTION_FAILURE))}else A(e.shortMessage??"Something went wrong")}t?(await K.waitForTransactionReceipt({hash:t}),L(!1),F(!0)):L(!1)})().catch(console.error)}),[K,re]),p((()=>{(async()=>{if(!w||!K||!Z)return;let e=Ye(c.chains).filter((e=>e.id!==W.id&&!!e.testnet==!!W.testnet));V&&e.unshift(W);let t=await Xp({chains:e,address:Z.address,appId:a,rpcConfig:n}),r=V?t.filter((e=>e.balance>0n)):t.filter((e=>e.balance>q));if(r.length<1)return void b(new E(`Wallet ${Be(Z.address)} does not have enough funds.`,void 0,T.INSUFFICIENT_BALANCE));r.sort(((e,t)=>Number(t.balance-e.balance)));let i=(await Promise.allSettled(r.map((async e=>({quote:await Wp({isTestnet:!!W.testnet,input:Up({amount:q.toString(),user:Z.address,recipient:z,destinationChainId:W.id,destinationCurrency:H,originChainId:e.chain.id})}),...e}))))).filter((e=>"fulfilled"===e.status)).map((e=>e.value));if(i.length<1)return void b(new E(`Wallet ${Be(Z.address)} does not have enough funds.`,void 0,T.INSUFFICIENT_BALANCE));let o=i.map((e=>({bridgeTx:Bp(e.quote),balance:e.balance,chain:e.chain}))).filter((e=>!!e.bridgeTx));if(o.length>1)return void _(o);let l=o[0];l?(M(!0),ne({data:l.bridgeTx.data,to:l.bridgeTx.to,value:l.bridgeTx.value,chain:l.chain})):b(new E(`Wallet ${Be(Z.address)} does not have enough funds.`,void 0,T.INSUFFICIENT_BALANCE))})().catch(console.error)}),[w]),p((()=>{if(!C)return;let e={error:C,previousScreen:We.FUNDING_TRANSFER_FROM_WALLET_SCREEN};s({funding:u?.funding,sendTransaction:u?.sendTransaction,errorModalData:e}),l(We.ERROR_SCREEN,!1)}),[C]);let ae=Z?tu(Z.walletClientType,Z.connectorType,Z.walletClientType)||"wallet":null,ie=!V&&te?bm(u?.funding?.amount??"0",te):void 0,oe=V?g:Tm([g,q]),le=oe&&te?Em(oe,te):void 0,se=oe?$m(oe,"ETH"):void 0,de=g&&te?Em(g,te):void 0,ce=g?$m(g,"ETH"):void 0;if(p((()=>{if(!D)return;let e=setTimeout(i,ht);return()=>clearTimeout(e)}),[D]),D)return e(r,{children:[t(Np,{}),t(Tc,{}),e(Cc,{children:[t(Tr,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),t(Ic,{title:"Success!",description:`You’ve successfully added ${B} ${V?U.symbol:W.nativeCurrency.symbol} to your ${c.name} wallet. It may take a minute before the funds are available to use.`})]}),t(Ac,{}),t(Nd,{})]});let ue=V?`${sf({amount:X,decimals:U.decimals})} ${U.symbol}`:$m(Q,W.nativeCurrency.symbol,3,!0),he=x[k];return x.length>1&&he?t(rf,{displayName:ae,configuredFundingChain:W,formattedBalance:ue,fundingAmount:B,fundingCurrency:V?U.symbol:W.nativeCurrency.symbol,fundingAmountInUsd:ie,options:x,selectedOption:he,isPreparing:S,isSubmitting:R,errorMessage:$,onSubmit:()=>{ne({to:he.bridgeTx.to,data:he.bridgeTx.data,value:he.bridgeTx.value,chain:he.chain})},onSelect:e=>{e!==k&&(A(null),N(e))}}):m&&g&&Z&&u?.funding?t(nf,{wallet:Z,displayName:ae,addressToFund:z,isBridging:O,isErc20Flow:V,totalPriceInUsd:le,totalPriceInNativeCurrency:se,gasPriceInUsd:de,gasPriceInNativeCurrency:ce,chainId:W.id,chainName:W.name}):e(r,{children:[t(Np,{}),t(Sp,{}),t("div",{style:{marginTop:"1rem"}}),t(Nd,{})]})},[We.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN]:()=>{let{closePrivyModal:n,createAnalyticsEvent:a}=P(),{navigate:i,setModalData:o,app:l,data:c}=ye(),{wallets:u}=Vt(),[h,m]=d(0n),[f,g]=d(null),[y,w]=d(!1),[v,C]=d(!1),b=s(!1);if(!c?.funding||"solana"!==c.funding.chainType)throw Error("Invalid funding data");let{address:$,amount:A,cluster:x,connectedWalletAddress:_}=c.funding,k=dt(x),{tokenPrice:N}=Lp("solana"),{fundingAmountInBaseUnit:S,totalPriceInUsd:I,totalPriceInNativeCurrency:O,feePriceInNativeCurrency:M,feePriceInUsd:R}=Vp({amount:A,fee:h,tokenPrice:N}),L=_?u.find((({address:e})=>e===_)):u[0];if(p((()=>{(async()=>{if("solana"!==L?.type||!L.sendTransaction||y||b.current)return;b.current=!0;let{Connection:e,PublicKey:t,SystemProgram:r,Transaction:n}=await import("@solana/web3.js"),i=new t(L.address),o=new n;o.add(r.transfer({fromPubkey:i,toPubkey:new t($),lamports:S}));let l=new e(k),s=await l.getLatestBlockhash();o.recentBlockhash=s.blockhash,o.feePayer=i;let d=await o.getEstimatedFee(l);null!=d&&m(BigInt(d)),w(!0);try{let e=await l.simulateTransaction(o);if(e.value.err)return e.value.logs?.find((e=>/insufficient (lamports|funds)/gi.test(e)))?void g(new E(`Wallet ${Be(L.address,void 0,void 0,"solana")} does not have enough funds.`,void 0,T.INSUFFICIENT_BALANCE)):(console.error("Transaction failed:",e.value.err),void g(new E("Something went wrong",void 0,T.TRANSACTION_FAILURE)));let t=await L.sendTransaction(o,l);a({eventName:Dp,payload:{provider:"external",status:"success",address:L.address,value:S.toString(),txHash:t,chainType:"solana",rpcEndpoint:k}}),w(!1),C(!0)}catch(e){if(console.error(e),w(!1),/user rejected the request/gi.test(e.message||""))return void g(new E("Transaction was rejected by the user",void 0,T.TRANSACTION_FAILURE));g(new E("Something went wrong",void 0,T.TRANSACTION_FAILURE))}})().catch(console.error).finally((()=>b.current=!1))}),[]),p((()=>{if(!f)return;let e={error:f,previousScreen:We.FUNDING_TRANSFER_FROM_WALLET_SCREEN};o({funding:c?.funding,sendTransaction:c?.sendTransaction,errorModalData:e}),i(We.ERROR_SCREEN,!1)}),[f]),p((()=>{if(!v)return;let e=setTimeout(n,ht);return()=>clearTimeout(e)}),[v]),v)return e(r,{children:[t(Np,{}),t(Tc,{}),e(Cc,{children:[t(Tr,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),t(Ic,{title:"Success!",description:`You’ve successfully added ${A} SOL to your ${l.name} wallet. It may take a minute before the funds are available to use.`})]}),t(Ac,{}),t(Nd,{})]});let D=L?tu(L.walletClientType,L.connectorType,L.walletClientType)||"wallet":null;return L&&y?t(nf,{wallet:L,displayName:D,addressToFund:$,isBridging:!1,isErc20Flow:!1,totalPriceInUsd:I,totalPriceInNativeCurrency:O,gasPriceInUsd:R,gasPriceInNativeCurrency:M,chainId:"solana",chainName:x.name}):e(r,{children:[t(Np,{}),t(Sp,{}),t("div",{style:{marginTop:"1rem"}}),t(Nd,{})]})},[We.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN]:()=>{let{rpcConfig:n,appId:a,closePrivyModal:i,createAnalyticsEvent:o}=P(),{navigate:l,setModalData:s,app:c,data:u}=ye(),{wallets:h}=G(),[m,f]=d(null),[g,y]=d(null),[w,v]=d([]),[C,b]=d(0),[$,A]=d(!1),[x,_]=d(!1),[k,N]=d(!1),[S,I]=d(!1);if(!u?.funding||"solana"!==u.funding.chainType)throw Error("Invalid funding data");let{address:O,cluster:M,amount:R,connectedWalletAddress:L}=u.funding,D=L?h.find((({address:e})=>e===L)):h[0],[F,U]=d(null);p((()=>{(async()=>{if(!D)return;let e=await D.getEthereumProvider();U(Wr({account:D.address,transport:Br(e)}).extend(jr))})().catch(console.error)}),[D]);let[W,B]=d(0n),j=Gp(W);p((()=>{(async()=>{let{Connection:e,PublicKey:t}=await import("@solana/web3.js");new e(dt(M)).getBalance(new t(O)).then((e=>B(BigInt(e))))})()}),[]);let[z,H]=d(),{tokenPrice:V}=Lp("solana"),{fundingAmountInBaseUnit:q,fundingAmountInUsd:Z}=Vp({amount:R,fee:0n,tokenPrice:V});p((()=>{(async()=>{if(!F||!D)return;let e=["testnet","devnet"].includes(M.name);e&&console.warn("Solana testnets are not supported for bridging");let t=Ye(c.chains).filter((({testnet:t})=>!!t===e)),r=(await Xp({chains:t,address:D.address,appId:a,rpcConfig:n})).filter((e=>e.balance>0n));if(r.length<1)return void f(new E(`Wallet ${Be(D.address)} does not have enough funds.`,void 0,T.INSUFFICIENT_BALANCE));r.sort(((e,t)=>Number(t.balance-e.balance)));let i=(await Promise.allSettled(r.map((async e=>({...e,quote:await Wp({isTestnet:!1,input:Up({amount:q.toString(),user:D.address,recipient:O,destinationChainId:ct,destinationCurrency:ut,originChainId:e.chain.id})})}))))).filter((e=>"fulfilled"===e.status)).map((e=>e.value));if(i.length<1)return void f(new E(`Unable to fetch quotes for bridging. Wallet ${Be(D.address)} does not have enough funds.`,void 0,T.INSUFFICIENT_BALANCE));let o=i.map((({quote:e,balance:t,chain:r})=>({bridgeTx:Bp(e),balance:t,chain:r}))).filter((({bridgeTx:e})=>!!e));if(o.length>1)return void v(o);let l=o.at(0);l?(_(!0),H({data:l.bridgeTx.data,to:l.bridgeTx.to,value:l.bridgeTx.value,chain:l.chain})):f(new E(`Unable to select bridge option from quotes. Wallet ${Be(D.address)} does not have enough funds.`,void 0,T.INSUFFICIENT_BALANCE))})().catch(console.error)}),[F]),p((()=>{(async()=>{let e,t;if(!F||!D||$||k||!z)return;A(!0);let r=Fr({chain:z.chain,transport:Ur(Je(z.chain,n,a))});try{e=await r.prepareTransactionRequest({account:D.address,to:z.to,chain:z.chain,data:z.data,value:BigInt(z.value??0)})}catch(e){console.error(e),w.length>1&&y(e.shortMessage??"Something went wrong")}if(e){A(!1),N(!0);try{await F.switchChain({id:z.chain.id})}catch(e){await F.addChain({chain:z.chain}),await F.switchChain({id:z.chain.id})}try{t=await F.sendTransaction(e),o({eventName:Dp,payload:{provider:"external",status:"success",address:D.address,chainId:z.chain.id,value:z.value?.toString(),txHash:t}})}catch(e){console.error(e),"TransactionExecutionError"===e.name&&(w.length<1?f(new E(e.shortMessage,void 0,T.TRANSACTION_FAILURE)):y(e.shortMessage??"Something went wrong"))}t?(await F.waitForTransactionReceipt({hash:t}),N(!1),I(!0)):N(!1)}else A(!1)})().catch(console.error)}),[F,z]),p((()=>{if(!m)return;let e={error:m,previousScreen:We.FUNDING_TRANSFER_FROM_WALLET_SCREEN};s({funding:u?.funding,sendTransaction:u?.sendTransaction,errorModalData:e}),l(We.ERROR_SCREEN,!1)}),[m]);let K=D?tu(D.walletClientType,D.connectorType,D.walletClientType)||"wallet":null;if(p((()=>{if(!S)return;let e=setTimeout(i,ht);return()=>clearTimeout(e)}),[S]),S)return e(r,{children:[t(Np,{}),t(Tc,{}),e(Cc,{children:[t(Tr,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),t(Ic,{title:"Success!",description:`You’ve successfully added ${R} SOL to your ${c.name} wallet. It may take a minute before the funds are available to use.`})]}),t(Ac,{}),t(Nd,{})]});let Y=w[C];return w.length>1&&Y?t(rf,{displayName:K,configuredFundingChain:M,formattedBalance:j,fundingAmount:R,fundingCurrency:"SOL",fundingAmountInUsd:Z,options:w,selectedOption:Y,isPreparing:$,isSubmitting:k,errorMessage:g,onSubmit:()=>{H({to:Y.bridgeTx.to,data:Y.bridgeTx.data,value:Y.bridgeTx.value,chain:Y.chain})},onSelect:e=>{e!==C&&(y(null),b(e))}}):k&&D?t(nf,{wallet:D,displayName:K,addressToFund:O,isBridging:x,isErc20Flow:!1,chainId:"solana",chainName:M.name,totalPriceInUsd:void 0,totalPriceInNativeCurrency:void 0,gasPriceInUsd:void 0,gasPriceInNativeCurrency:void 0}):e(r,{children:[t(Np,{}),t(Sp,{}),t("div",{style:{marginTop:"1rem"}}),t(Nd,{})]})},[We.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN]:function(){let{closePrivyModal:n,createAnalyticsEvent:a}=P(),{navigate:i,setModalData:o,app:l,data:c}=ye(),{wallets:u}=Vt(),h=s(!1),[m,f]=d(!1),[g,y]=d(!1),[w,v]=d(null);if(!c?.funding||"ethereum"!==c.funding.chainType)throw Error("Invalid funding data");let{amount:C,connectedWalletAddress:b,chain:$,cluster:A,isUSDC:x}=c.funding,_=c.funding.address,k=c.funding.erc20Address,N=c.funding.isUSDC?"USDC":$.nativeCurrency.symbol,S=A??{name:"mainnet-beta"},I=b?u.find((({address:e})=>e===b)):u[0];if(p((()=>{(async function(){if(!I||!$||h.current)return;h.current=!0,$?.testnet&&console.warn("Solana testnets are not supported for bridging");let e=x?1e6*parseFloat(C):zr(C),t=await Wp({isTestnet:!!$.testnet,input:Up({amount:e.toString(),user:I.address,recipient:_,destinationChainId:$.id,originChainId:ct,originCurrency:x?pt:ut,destinationCurrency:x?k:void 0})}).catch(console.error);if(!t)return void v(new E(`Unable to fetch quotes for bridging. Wallet ${mt(I.address)} does not have enough funds.`,void 0,T.INSUFFICIENT_BALANCE));let r=await(async e=>{let t=e.steps[0]?.items?.[0];if(!t)return;let{PublicKey:r,TransactionInstruction:n}=await import("@solana/web3.js");return{instructions:t.data.instructions.map((({keys:e,programId:t,data:a})=>new n({keys:e.map((({pubkey:e,isSigner:t,isWritable:n})=>({pubkey:new r(e),isSigner:t,isWritable:n}))),programId:new r(t),data:Buffer.from(a,"hex")}))),addressLookupTableAddresses:t.data.addressLookupTableAddresses?.map((e=>new r(e)))}})(t);if(r)try{let{Connection:n,PublicKey:i,TransactionMessage:o,VersionedTransaction:l}=await import("@solana/web3.js"),s=new n(dt(S)),d=await Promise.all((r.addressLookupTableAddresses??[]).map((async e=>s.getAddressLookupTable(e).then((e=>e.value))))),{blockhash:c}=await s.getLatestBlockhash(),u=new l(new o({payerKey:new i(I.address),instructions:r.instructions,recentBlockhash:c}).compileToV0Message(d));f(!0);let h=await s.simulateTransaction(u);if(h.value.err)return h.value.logs?.find((e=>/insufficient (lamports|funds)/gi.test(e)))?void v(new E(`Wallet ${mt(I?.address)} does not have enough funds. ${t.details.currencyIn.amountFormatted} ${N} are needed to complete the transaction.`,void 0,T.INSUFFICIENT_BALANCE)):(console.error("Transaction failed:",h.value.err),void v(new E("Something went wrong",void 0,T.TRANSACTION_FAILURE)));let p=await I.sendTransaction(u,s),m=await s.confirmTransaction(p);if(m.value.err)return console.error("Transaction failed:",m.value.err),void v(new E("Something went wrong",void 0,T.TRANSACTION_FAILURE));a({eventName:Dp,payload:{provider:"external",status:"success",address:I.address,chainId:$.id,value:e.toString(),txHash:p}}),y(!0)}catch(e){if(console.error(e),/user rejected the request/gi.test(e.message||""))return void v(new E("Transaction was rejected by the user",void 0,T.TRANSACTION_FAILURE));v(new E("Something went wrong",void 0,T.TRANSACTION_FAILURE))}else v(new E(`Unable to select bridge option from quotes. Wallet ${mt(I.address)} does not have enough funds.`,void 0,T.INSUFFICIENT_BALANCE))})().catch(console.error)}),[]),p((()=>{if(!g)return;let e=setTimeout(n,ht);return()=>clearTimeout(e)}),[g]),p((()=>{if(!w)return;let e={error:w,previousScreen:We.FUNDING_TRANSFER_FROM_WALLET_SCREEN};o({funding:c?.funding,sendTransaction:c?.sendTransaction,errorModalData:e}),i(We.ERROR_SCREEN,!1)}),[w]),g)return e(r,{children:[t(Np,{}),t(Tc,{}),e(Cc,{children:[t(Tr,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),t(Ic,{title:"Success!",description:`You’ve successfully added ${C} ${N} to your ${l.name} wallet. It may take a minute before the funds are available to use.`})]}),t(Ac,{}),t(Nd,{})]});if(m&&I){let e=I?tu(I.walletClientType,I.connectorType,I.walletClientType)||"wallet":null;return t(nf,{wallet:I,displayName:e,addressToFund:_,isBridging:m,isErc20Flow:!1,chainId:$.id,chainName:$.name,totalPriceInUsd:void 0,totalPriceInNativeCurrency:void 0,gasPriceInUsd:void 0,gasPriceInNativeCurrency:void 0})}return e(r,{children:[t(Np,{}),t(Sp,{}),t("div",{style:{marginTop:"1rem"}}),t(Nd,{})]})},[We.FUNDING_MANUAL_TRANSFER_SCREEN]:()=>{let{wallets:n}=G(),{wallets:a}=Vt(),{data:i,setModalData:o,navigate:l,lastScreen:s}=ye(),{rpcConfig:u,appId:h,createAnalyticsEvent:m,closePrivyModal:f}=P(),g=Ue(),[y,w]=d(void 0),[v,C]=d(!1),b=i?.funding,{reloadBalance:E}=zf({rpcConfig:u,appId:h,address:"ethereum"===b.chainType?b.address:void 0,chain:"ethereum"===b.chainType?b.chain:void 0}),$="solana"===b.chainType,T=$?"SOL":b.erc20Address?b.erc20ContractInfo?.symbol:b.chain.nativeCurrency.symbol,A=$?a.find((({address:e})=>e===b.address)):n.find((({address:e})=>Be(e)===Be(b.address)));if(!b)return o({errorModalData:{error:Error("Couldn't find funding config"),previousScreen:s||We.FUNDING_METHOD_SELECTION_SCREEN},funding:i?.funding,sendTransaction:i?.sendTransaction}),l(We.ERROR_SCREEN),t(r,{});p((()=>{let e=$?async function(){if("solana"!==b.chainType)return;let{Connection:e,PublicKey:t}=await import("@solana/web3.js");new e(dt(b.cluster)).getBalance(new t(b.address)).then((e=>{y&&e>y&&(C(!0),m({eventName:Dp,payload:{provider:"manual",status:"success",chainType:"solana",address:A?.address,value:(e-y).toString()}})),w(e)}))}:async function(){"ethereum"===b.chainType&&(async()=>{if(!b.erc20Address)return await E()??BigInt(0);{let{balance:e}=await df({chain:b.chain,address:b.address,erc20Address:b.erc20Address,rpcConfig:u,appId:h});return e}})().then((e=>{let t=parseFloat(dn(e,"ether"));y&&t>y&&(C(!0),m({eventName:Dp,payload:{provider:"manual",status:"success",chainType:"ethereum",address:A?.address,value:(t-y).toString()}})),w(t)})).catch((()=>w(void 0)))},t=setInterval(e,2e3);return e(),()=>clearInterval(t)}),[y]);let x=c((()=>void 0!==y&&y>=parseFloat(b.amount)),[y,b.amount]),_=null!=y?$?Gp(BigInt(y),2,!0,!0):y.toPrecision(2):"",k="ethereum"===b.chainType?b.chain.name:Hf[b.cluster.name];return e(r,{children:[t(Np,{}),e(lh,{children:["Receive ",b.amount," ",T]}),e(oh,{children:["Scan this code or copy your wallet address to receive funds on ",k,"."]}),e(bc,{style:{gap:"1rem",margin:"1rem 0"},children:[t(bp,{url:b.address,size:200,squareLogoElement:Gf}),e(yf,{theme:g.appearance.palette.colorScheme,children:["Make sure to send funds on ",k,"."]}),t(Pu,{title:"Your wallet",errMsg:void 0,showIcon:!0,isLoading:!b||void 0===y,isPulsing:!x,balance:`${_} ${T}`,address:b.address,statusColor:x?"green":"gray"}),v&&t(Hs,{onClick:()=>f({shouldCallAuthOnSuccess:!1,isSuccess:!0}),children:"Continue"})]}),t(Nd,{})]})},[We.EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN]:()=>{let{closePrivyModal:n}=P(),{data:a,setModalData:i,navigate:o,onUserCloseViaDialogOrKeybindRef:l}=ye(),{onSuccess:s,onFailure:d}=a.setWalletPassword,c=()=>{d(new B("Exited before password was added to wallet")),n({shouldCallAuthOnSuccess:!1})};return l.current=c,e(r,{children:[t(od,{onClose:c}),t(Tc,{}),e(Cc,{children:[e(xc,{children:[t(Rr,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),t(kc,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:t(Lr,{width:"12px",height:"12px",fill:"white"})})]}),e(Ic,{title:"Secure Your Account",children:["Please set a password to secure your account.",t("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),t(Hs,{onClick:()=>{i({createWallet:{onFailure:d,onSuccess:s,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),o(We.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN)},children:"Add password"}),t(Ac,{}),t(Nd,{})]})},[We.EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN]:()=>{let[e,r]=d(null),[n,a]=d(!1),[i,o]=d(null),[l,s]=d(""),{authenticated:c,getAccessToken:u,user:h}=M(),{walletProxy:m,refreshUser:f,closePrivyModal:g,createAnalyticsEvent:y}=P(),{app:w,navigate:v,data:C,onUserCloseViaDialogOrKeybindRef:b}=ye(),{onSuccess:E,onFailure:$}=C.createWallet,T=j(h),A="user-passcode"===e?.recoveryMethod,x="user-passcode"===T?.recoveryMethod;p((()=>{c||(v(We.LANDING),$(new z("User must be authenticated before setting a password on a Privy wallet")))}),[c]);let _=()=>i?($(i),void g({shouldCallAuthOnSuccess:!1})):A?(E(e),void g({shouldCallAuthOnSuccess:!1})):($(new B("Exited before password was added to wallet")),void g({shouldCallAuthOnSuccess:!1}));b.current=_;return t(np,{appName:w?.name||"privy",config:{initiatedBy:"user",onCancel:_},error:i?"An error has occurred, please try again.":void 0,buttonLoading:n,buttonHideAnimations:!1,password:l,isResettingPassword:x,onPasswordGenerate:()=>s(qh()),onPasswordChange:s,onSubmit:async()=>{A?(E(e),g({shouldCallAuthOnSuccess:!1})):(a(!0),o(null),await(async()=>{let e=await u();if(e&&T?.address&&l&&m)try{y({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:T.address,existingRecoveryMethod:T.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:x}});let{entropyId:t,entropyIdVerifier:n}=k(T);if(!(await m.setRecovery({accessToken:e,entropyId:t,entropyIdVerifier:n,recoveryPassword:l,recoveryMethod:"user-passcode"})).entropyId)return o(new B("Error setting password on privy wallet")),void y({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:T.address,existingRecoveryMethod:T.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:x,reason:"error setting password"}});let a=await f(),i=j(a);if(!i)return o(new B("Error setting password on privy wallet")),void y({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:T.address,existingRecoveryMethod:T.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:x,reason:"wallet disconnected"}});r(i),y({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:T.address,existingRecoveryMethod:T.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:x}})}catch(e){console.warn(e),o(e instanceof Error?e:Error("Error setting password on privy wallet")),y({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:T.address,reason:e}})}})(),a(!1))},onClose:_})},[We.EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN]:()=>{let{app:e,navigate:r,data:n,onUserCloseViaDialogOrKeybindRef:a}=ye(),[i,o]=d(""),[l,s]=d(!1),[c,u]=d(),[h,m]=d(null),{authenticated:f,user:g}=M(),{closePrivyModal:y,isNewUserThisSession:w,initializeWalletProxy:v}=P(),{onSuccess:C,onFailure:b,callAuthOnSuccessOnClose:E}=n.createWallet,{createWallet:$}=hh(),[T,A]=d(null),x=new ml((async()=>{try{let e=await $({recoveryPassword:c,user:g});if(!e)return;A(e),w?r(We.EMBEDDED_WALLET_CREATED_SCREEN):(C(e),y({shouldCallAuthOnSuccess:E}))}catch(e){o(e.message)}}));p((()=>{h||v(3e4).then((e=>m(e)))}),[h]),p((()=>{if(!f||!g)return r(We.LANDING),void b(Error("User must be authenticated before creating a Privy wallet"))}),[f]),a.current=()=>null;return t(np,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:!h,buttonLoading:l,buttonHideAnimations:!T&&l,isResettingPassword:!1,error:i,password:c||"",onClose:()=>{T&&"user-passcode"!==T?.recoveryMethod?(b(new B("User created a wallet but failed to set a password for it")),y({shouldCallAuthOnSuccess:!1})):T?(C(T),y({shouldCallAuthOnSuccess:E})):(b(new B("User wallet creation failed")),y({shouldCallAuthOnSuccess:!1}))},onPasswordChange:u,onPasswordGenerate:()=>u(qh()),onSubmit:async()=>(s(!0),x.execute().then((()=>new Promise((e=>setTimeout(e,250))))).finally((()=>s(!1))))})},[We.MFA_ENROLLMENT_FLOW_SCREEN]:()=>{let{user:n,enrollInMfa:a}=M(),[i,o]=d(null),{unenrollWithSms:l,unenrollWithTotp:s,unenrollWithPasskey:c}=Yg(),{app:u,ready:h,data:m,onUserCloseViaDialogOrKeybindRef:f}=ye(),{closePrivyModal:g}=P(),{promptMfa:y}=Kg(),{initEnrollmentWithTotp:w}=Yg(),[v,C]=d(!1),[b,E]=d(null),[$,T]=d(null),A=()=>{g({shouldCallAuthOnSuccess:!0}),a(!1),setTimeout((()=>{o(null),E(null)}),500)},{initEnrollmentWithPasskey:x,submitEnrollmentWithPasskey:_}=Yg(),[k,N]=d(!1),[S,I]=d(null);f.current=A;let O=n?.mfaMethods.includes("sms"),R=!!n?.phone,L=n?.mfaMethods.includes("totp"),D=n?.mfaMethods.includes("passkey"),F=O||L||D,U=n?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function W(){o(null),E(null)}if(p((()=>{F&&C(!0)}),[F]),!h||!n||!u)return e(r,{children:[t(od,{onClose:A},"header"),t(qd,{children:t(Qg,{})}),t(Yd,{children:t(Ws,{})}),t(Sd,{})]});if("sms"===i)return e(r,{children:[t(od,{backFn:W,onClose:A},"header"),t(dc,{style:{marginBottom:"1.5rem"},children:t(ir,{})}),t(Zd,{children:"Remove SMS verification?"}),e(Kd,{children:["MFA adds an extra layer of security to your ",u?.name," account. Make sure you have other methods to secure your account."]}),t(ec,{children:t(Hs,{warn:!0,onClick:async function(){o(null);try{await l()}catch(e){o(null)}},children:"Remove SMS for MFA"})}),t(Sd,{})]});if("totp"===i)return e(r,{children:[t(od,{backFn:W,onClose:A},"header"),t(dc,{style:{marginBottom:"1.5rem"},children:t(ir,{})}),t(Zd,{children:"Remove Authenticator App verification?"}),e(Kd,{children:["MFA adds an extra layer of security to your ",u?.name," account. Make sure you have other methods to secure your account."]}),t(ec,{children:t(Hs,{warn:!0,onClick:async function(){o(null);try{await s()}catch(e){o(null)}},children:"Remove Authenticator App for MFA"})}),t(Sd,{})]});if("passkey"===i)return e(r,{children:[t(od,{backFn:W,onClose:A},"header"),t(dc,{style:{marginBottom:"1.5rem"},children:t(ir,{})}),t(Zd,{children:"Are you sure you want to remove passkey verification?"}),t(Kd,{children:"This will disable any passkeys you have set up for verification. You’ll still be able to login with your passkeys if you’ve set up passkey login."}),t(ec,{children:t(Hs,{warn:!0,onClick:async function(){o(null);try{await y(),await c()}catch(e){o(null)}},children:"Yes, remove"})}),t(Sd,{})]});if(0===m.mfaEnrollmentFlow.mfaMethods.length&&!F)return e(r,{children:[t(od,{onClose:A},"header"),t(dc,{style:{marginBottom:"1.5rem"},children:t(Cn,{})}),t(Zd,{children:"Add more security"}),e(Kd,{children:[u?.name," does not have any verification methods enabled."]}),t(ec,{children:t(Hs,{onClick:A,children:"Close"})}),t(Sd,{})]});let B=!F&&!v;return B?e(r,{children:[t(od,{onClose:A},"header"),t(dc,{style:{marginBottom:"1.5rem"},children:t(Cn,{})}),t(Zd,{children:"Transaction Protection"}),t(Kd,{children:"Set up transaction protection to add an extra layer of security to your account"}),e(Qd,{children:[e(Xd,{children:[t(Jd,{children:t(hn,{})}),"Enable 2-Step verification for your ",u?.name," wallet."]}),e(Xd,{children:[t(Jd,{children:t(bn,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),e(ec,{children:[t(Hs,{onClick:()=>C(!0),children:"Continue"}),t(Ys,{onClick:A,children:"Not now"})]}),t(Sd,{})]}):"sms"===b?t(wy,{onComplete:A,onReset:W,onClose:A}):"totp"===b&&$?t(Cy,{onComplete:A,onClose:A,onReset:W,totpInfo:$}):"passkey"===b?t(ty,{onComplete:A,onReset:W,onClose:A}):t(Xg,{showIntro:B,userMfaMethods:n.mfaMethods,appMfaMethods:u.mfa.methods,userHasAuthSms:R,onBackToIntro:function(){C(!1)},handleSelectMethod:async function(e){return await y().catch(I),"totp"===e?(E(e),T(null),void w().then((e=>{T(e)})).catch((()=>{T(null),W()}))):"passkey"===e&&1===U.length?await async function(){N(!0);try{await x(),await _({credentialIds:U})}catch(e){I(e)}finally{N(!1)}}():void E(e)},isTotpLoading:"totp"===b&&!$,isPasskeyLoading:k,error:S,onClose:A,setRemovingMfaMethod:o})},[We.CAPTCHA_SCREEN]:()=>{let{lastScreen:n,currentScreen:a,data:i,navigateBack:o,navigate:l,setModalData:c}=ye(),{status:u,token:h,waitForResult:m,reset:f,execute:g}=Ll(),y=s([]),w=e=>{y.current=[e,...y.current]},[v,C]=d(!0);p((()=>(w(setTimeout(C,1e3,!1)),()=>{y.current.forEach((e=>clearTimeout(e))),y.current=[]})),[]);let[b,E]=d(""),[$,T]=d("Checking that you are a human..."),[A,x]=d(t(Hs,{onClick:()=>{},disabled:!0,children:"Continue"})),[_,k]=d(!1),[N,S]=d(3),I=i?.captchaModalData,O=async e=>{try{await(I?.callback(e)),I?.onSuccessNavigateTo&&l(I?.onSuccessNavigateTo,!1)}catch(e){if(e instanceof Ml)return;c({errorModalData:{error:e,previousScreen:n||We.LANDING}}),l(I?.onErrorNavigateTo||We.ERROR_SCREEN,!1)}};p((()=>{"success"===u?w(setTimeout((async()=>{let e=await m();!e||I?.userIntentRequired||O(e)}),1e3)):"ready"===u&&w(setTimeout((()=>{"ready"===u&&g()}),500))}),[u]),p((()=>{if(!v)switch(u){case"success":E("Success!"),T("CAPTCHA passed successfully."),x(t(Hs,{onClick:()=>{k(!0),O(h)},disabled:!I?.userIntentRequired,loading:_,children:I?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":E(""),T("Checking that you are a human..."),x(t(Hs,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":E("Something went wrong"),N<=0?(T("If you use an adblocker or VPN, try disabling and re-attempting."),x(null)):(T("You did not pass CAPTCHA. Please try again."),x(t(Hs,{onClick:P,children:"Retry"})))}}),[u,v,_]);let P=async()=>{if(N<=0)return;S((e=>e-1)),f(),g();let e=await m();!e||I?.userIntentRequired||O(e)};return e(r,{children:[t(od,{backFn:n&&a!==n?o:void 0}),e(Zc,{children:["success"===u?t(vr,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):"error"===u?t(Cr,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):t(Vc,{}),e(Ec,{children:[b?t("h3",{children:b}):null,t("p",{children:$})]}),A]}),t(Sd,{})]})},[We.ERROR_SCREEN]:()=>{let{navigate:e,navigateBack:r,data:n,lastScreen:a,currentScreen:i}=ye(),o=n?.errorModalData?.previousScreen||(a===i?void 0:a);return t(ap,{error:n?.errorModalData?.error||Error(),backFn:()=>o?e(o,!1):r(),onClick:()=>e(o||We.LANDING,!1)})},[We.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE]:()=>{let{closePrivyModal:n}=P();return e(r,{children:[t(od,{},"header"),t(Xf,{children:t(mr,{style:{width:32,height:32}})}),t(Sc,{title:"Could not log in with provider",description:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),t(gc,{children:t(Hs,{onClick:()=>n(),children:"Close"})}),t(Ac,{}),t(Nd,{})]})},[We.AFFIRMATIVE_CONSENT_SCREEN]:()=>{let{user:e,logout:r}=M(),{app:n,onUserCloseViaDialogOrKeybindRef:a,setModalData:i,navigate:o}=ye(),{acceptTerms:l,closePrivyModal:s,createAnalyticsEvent:d}=P(),c=e=>{e?.preventDefault(),s({shouldCallAuthOnSuccess:!1}),r()};a.current=c;return t(uc,{termsAndConditionsUrl:n?.legal.termsAndConditionsUrl,privacyPolicyUrl:n?.legal.privacyPolicyUrl,onAccept:async t=>{t.preventDefault(),await l(),e&&R(e,n?.embeddedWallets?.createOnLogin)?(i({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),d({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"AffirmativeConsentScreen"}}),r()},callAuthOnSuccessOnClose:!0}}),o(We.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)):s()},onDecline:c})},[We.TELEGRAM_AUTH_SCREEN]:()=>{let{authenticated:n,logout:a,ready:i,user:o}=M(),{app:l,setModalData:s,navigate:c,resetNavigation:u,data:h}=ye(),{initLoginWithTelegram:m,loginWithTelegram:f,updateWallets:g,setReadyToTrue:y,closePrivyModal:w,createAnalyticsEvent:v,getAuthMeta:C}=P(),[b,E]=d(!1),[$,A]=d(void 0),x=Ll();async function _(){try{let e=await async function(){let e;if(x.enabled&&"error"===x.status)throw new Ml(x.error,null,T.CAPTCHA_FAILURE);return x.enabled&&"success"!==x.status&&(x.execute(),e=await x.waitForResult()),e}();await f(e),E(!0),y(!0)}catch(e){if(e?.privyErrorCode===T.ALLOWLIST_REJECTED)return A(void 0),u(),void c(We.ALLOWLIST_REJECTION_SCREEN);if(e?.privyErrorCode===T.USER_LIMIT_REACHED)return console.error(new L(e).toString()),A(void 0),u(),void c(We.USER_LIMIT_REACHED_SCREEN);if(e?.privyErrorCode===T.USER_DOES_NOT_EXIST)return A(void 0),u(),void c(We.ACCOUNT_NOT_FOUND_SCREEN);if(e?.privyErrorCode===T.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return A(void 0),u(),s({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,telegramAuthResult:C()?.telegramAuthResult,displayName:e.data?.data?.account?.displayName,linkMethod:"telegram",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void c(We.LINK_CONFLICT_SCREEN);let{retryable:t,detail:r}=Fl(e);A({retryable:t,detail:r,message:"Authentication failed"})}}p((()=>{_()}),[]),p((()=>{if(!(i&&n&&b&&o))return;if(l?.legal.requireUsersAcceptTerms&&!o.hasAcceptedTerms){let e=setTimeout((()=>{c(We.AFFIRMATIVE_CONSENT_SCREEN)}),je);return()=>clearTimeout(e)}if(R(o,l?.embeddedWallets?.createOnLogin)){let e=setTimeout((()=>{s({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:"telegram",screen:"TelegramAuthScreen"}}),a()},callAuthOnSuccessOnClose:!0}}),c(We.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)}),je);return()=>clearTimeout(e)}g();let e=setTimeout((()=>w({shouldCallAuthOnSuccess:!0,isSuccess:!0})),je);return()=>clearTimeout(e)}),[i,n,b,o]);let k=b?"Successfully connected with Telegram":$?$.message:"Verifying connection to Telegram",N="";return N=b?"You’re good to go!":$?$.detail:"Just a few moments more",e(r,{children:[t(od,{}),t(Tc,{}),e(Fv,{children:[t(pd,{children:e("div",{children:[t(Us,{success:b,fail:!!$}),t(Mg,{style:{width:"38px",height:"38px"}})]})}),e(Ec,{children:[t("h3",{children:k}),t("p",{children:N})]}),$&&$?.retryable?t(Js,{onClick:async()=>{try{A(void 0),h?.telegramAuthModalData?.seamlessAuth||await m(void 0,h?.login?.disableSignup),await _()}catch(e){let{retryable:t,detail:r}=Fl(e);A({retryable:t,detail:r,message:"Authentication failed"})}},disabled:!b&&!$?.retryable,children:"Retry"}):null]}),t(Ac,{}),t(Sd,{})]})},[We.LINK_CONFLICT_SCREEN]:()=>{let{initiateAccountTransfer:e,closePrivyModal:r}=P(),{data:n,navigate:a,lastScreen:i,setModalData:o}=ye(),[l,s]=d(void 0),[c,u]=d(!1),[h,p]=d(!1),m=async()=>{try{if(!n?.accountTransfer?.nonce||!n?.accountTransfer?.account)throw Error("missing account transfer inputs");p(!0),await e({nonce:n?.accountTransfer?.nonce,account:n?.accountTransfer?.account,accountType:n?.accountTransfer?.linkMethod,externalWalletMetadata:n?.accountTransfer?.externalWalletMetadata,telegramAuthResult:n?.accountTransfer?.telegramAuthResult,farcasterEmbeddedAddress:n?.accountTransfer?.farcasterEmbeddedAddress,oAuthUserInfo:n?.accountTransfer?.oAuthUserInfo}),u(!0),p(!1),setTimeout(r,1e3)}catch(e){o({errorModalData:{error:e,previousScreen:i||We.LINK_CONFLICT_SCREEN}}),a(We.ERROR_SCREEN,!0)}};return l?t(Gd,{address:l,onClose:r,onRetry:()=>s(void 0),onTransfer:m,isTransferring:h,transferSuccess:c}):t(Hd,{onClose:r,onInfo:()=>s(n?.accountTransfer?.embeddedWalletAddress),onContinue:()=>s(n?.accountTransfer?.embeddedWalletAddress),onTransfer:m,isTransferring:h,transferSuccess:c,data:n})}},tC=[We.LANDING,We.AWAITING_CONNECTION],rC=({isMfaVerifying:n,onMfaVerificationComplete:a})=>{let{ready:i,isModalOpen:o}=M(),{headless:l}=Ue(),{ready:s,currentScreen:d}=ye(),{status:c,execute:u,reset:h,enabled:m}=Ll(),f=o&&d&&tC.includes(d)&&!l&&"ready"===c;return p((()=>{f&&u()}),[f]),p((()=>{!o&&m&&h()}),[o,m]),i&&s||d===We.AWAITING_OAUTH_SCREEN||d===We.CROSS_APP_AUTH_SCREEN||d===We.TELEGRAM_AUTH_SCREEN?!d&&n?t(iw,{open:n,onClose:a}):d?e(r,{children:[t(Ed,{$if:!!n,children:t(eC[d],{})}),t(Ed,{$if:!n,children:t(iw,{open:n,onClose:a})})]}):null:e(r,{children:[t(od,{}),t(Tc,{}),t(Xv,{children:t(Ws,{})}),t(Ac,{}),t(Sd,{})]})},nC=({isMfaVerifying:e,onMfaVerificationComplete:r})=>{let n=s(null);return t(oC,{style:{height:Ds(n)},id:"privy-modal-content",children:t("div",{ref:n,children:t(rC,{isMfaVerifying:e,onMfaVerificationComplete:r})})})};const aC=({open:e})=>{let{app:r}=ye(),{gracefulClosePrivyModal:n}=(()=>{let{closePrivyModal:e}=P(),{onUserCloseViaDialogOrKeybindRef:t}=ye();return{gracefulClosePrivyModal:m((()=>{if(!t?.current)return e({shouldCallAuthOnSuccess:!1});t.current()}),[e])}})(),[a,i]=d(!1);Fs({onMfaRequired:()=>{r?.mfa.noPromptOnMfaRequired||i(!0)}});let o=e||a;return r.render.standalone?t(qv,{children:t(iC,{id:"privy-modal-content",children:t(rC,{isMfaVerifying:a,onMfaVerificationComplete:()=>i(!1)})})}):t(Zv,{open:o,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>n(),children:t(qv,{children:t(nC,{isMfaVerifying:a,onMfaVerificationComplete:()=>i(!1)})})})};let iC=tr.div`
|
|
3132
|
-
display: flex;
|
|
3133
|
-
flex-direction: column;
|
|
3134
|
-
text-align: center;
|
|
3135
|
-
font-size: 14px;
|
|
3136
|
-
line-height: 20px;
|
|
3137
|
-
width: 100%;
|
|
3138
|
-
background: var(--privy-color-background);
|
|
3139
|
-
padding: 0 16px;
|
|
3140
|
-
`,oC=tr(iC)`
|
|
3141
|
-
transition: height 150ms ease-out;
|
|
3142
|
-
overflow: hidden;
|
|
3143
|
-
|
|
3144
|
-
// Ensure the modal gets pinned to the top if it ever gets too tall
|
|
3145
|
-
max-height: calc(100svh - 32px);
|
|
3146
|
-
|
|
3147
|
-
border-radius: var(--privy-border-radius-lg) var(--privy-border-radius-lg) 0 0;
|
|
3148
|
-
box-shadow: 0px 0px 36px rgba(55, 65, 81, 0.15);
|
|
3149
|
-
|
|
3150
|
-
@media (min-width: 441px) {
|
|
3151
|
-
box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15);
|
|
3152
|
-
border-radius: var(--privy-border-radius-lg);
|
|
3153
|
-
}
|
|
3154
|
-
`;function lC(e){let r=s(null),n=s();return p((()=>{n.current?.remove(),n.current=function({botUsername:e,scriptHost:t}){let r=document.createElement("script"),{origin:n}=new URL(t);return r.async=!0,r.src=`${n}/js/telegram-login.js`,r.setAttribute("data-telegram-login",e),r.setAttribute("data-request-access","write"),r.setAttribute("data-lang","en"),r}(e),r.current?.after(n.current)}),[e]),t("div",{ref:r,hidden:!0})}async function sC(e,t,r,n,a,i=!1){let o=i,l=async l=>{if(o&&t&&t.length>0){l===(i?0:1)?a("configureMfa","onMfaRequired",t):n.current?.reject(new Gu("missing_or_invalid_mfa","MFA verification failed, retry."));let o=await new Promise(((e,t)=>{r.current={resolve:e,reject:t},setTimeout((()=>{let e=new Gu("mfa_timeout","Timed out waiting for MFA code");n.current?.reject(e),t(e)}),3e5)}));return await e(o)}return await e()},s=null;for(let e=0;e<4;e++)try{s=await l(e),n.current?.resolve(void 0);break}catch(e){if("missing_or_invalid_mfa"!==e.type)throw n.current?.resolve(void 0),e;o=!0}if(null===s){let e=new Gu("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw n.current?.reject(e),e}return s}var dC;let cC=(dC=0,()=>"id-"+dC++);function uC(e){return void 0!==e.error}let hC=new class{enqueue(e,t){this.callbacks[e]=t}dequeue(e,t){let r=this.callbacks[t];if(!r)throw Error(`cannot dequeue ${e} event: no event found for id ${t}`);switch(delete this.callbacks[t],e){case"privy:iframe:ready":case"privy:wallets:create":case"privy:wallets:add":case"privy:wallets:set-recovery":case"privy:wallets:connect":case"privy:wallets:recover":case"privy:wallets:rpc":case"privy:wallet:create":case"privy:wallet:import":case"privy:mfa:verify":case"privy:mfa:init-enrollment":case"privy:mfa:submit-enrollment":case"privy:mfa:unenroll":case"privy:mfa:clear":case"privy:farcaster:init-signer":case"privy:farcaster:sign":case"privy:solana-wallet:create":case"privy:delegated-actions:consent":return r;default:throw Error(`invalid wallet event type ${e}`)}}constructor(){this.callbacks={}}},pC=new Map,mC=(e,t)=>"bigint"==typeof t?t.toString():t,fC=(e,t)=>`${e}${JSON.stringify(t,mC)}`;function gC(e,t,r,n){let a=r.contentWindow;if(!a)throw Error("iframe not initialized");let i=fC(e,t);if("privy:wallet:create"===e){let e=pC.get(i);if(e)return e}let o=new Promise(((r,i)=>{let o=cC();hC.enqueue(o,{resolve:r,reject:i}),a.postMessage({id:o,event:e,data:t},n)})).finally((()=>{pC.delete(i)}));return pC.set(i,o),o}function yC(e){let r=s(null),n=s(e.mfaMethods),a=qt(),[i,o]=d(!1);return p((()=>{n.current=e.mfaMethods}),[e.mfaMethods]),p((()=>{if(!i)return;let t=r.current;if(!t)return;function o(t){var r;t&&t.origin===e.origin&&"string"==typeof(r=t.data).event&&/^privy:.+/.test(r.event)&&function(e){switch(e.event){case"privy:iframe:ready":let t=hC.dequeue(e.event,e.id);return uC(e)?t.reject(new Gu(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallets:create":{let t=hC.dequeue(e.event,e.id);return uC(e)?t.reject(new Gu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:wallets:add":{let t=hC.dequeue(e.event,e.id);return uC(e)?t.reject(new Gu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:wallets:set-recovery":{let t=hC.dequeue(e.event,e.id);return uC(e)?t.reject(new Gu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:wallets:connect":{let t=hC.dequeue(e.event,e.id);return uC(e)?t.reject(new Gu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:wallets:recover":{let t=hC.dequeue(e.event,e.id);return uC(e)?t.reject(new Gu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:wallets:rpc":{let t=hC.dequeue(e.event,e.id);return uC(e)?t.reject(new Gu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:wallet:create":let r=hC.dequeue(e.event,e.id);return uC(e)?r.reject(new Gu(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:import":let n=hC.dequeue(e.event,e.id);return uC(e)?n.reject(new Gu(e.error.type,e.error.message)):n.resolve(e.data);case"privy:mfa:verify":let a=hC.dequeue(e.event,e.id);return uC(e)?a.reject(new Gu(e.error.type,e.error.message)):a.resolve(e.data);case"privy:mfa:init-enrollment":{let t=hC.dequeue(e.event,e.id);return uC(e)?t.reject(new Gu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:mfa:submit-enrollment":{let t=hC.dequeue(e.event,e.id);return uC(e)?t.reject(new Gu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:mfa:unenroll":{let t=hC.dequeue(e.event,e.id);return uC(e)?t.reject(new Gu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:mfa:clear":{let t=hC.dequeue(e.event,e.id);return uC(e)?t.reject(new Gu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:solana-wallet:create":let i=hC.dequeue(e.event,e.id);return uC(e)?i.reject(new Gu(e.error.type,e.error.message)):i.resolve(e.data);case"privy:farcaster:init-signer":{let t=hC.dequeue(e.event,e.id);return uC(e)?t.reject(new Gu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:farcaster:sign":{let t=hC.dequeue(e.event,e.id);return uC(e)?t.reject(new Gu(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:delegated-actions:consent":{let t=hC.dequeue(e.event,e.id);return uC(e)?t.reject(new Gu(e.error.type,e.error.message)):t.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}(t.data)}let l={createWallet:r=>sC((n=>gC("privy:wallets:create",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,a),addWallet:r=>gC("privy:wallets:add",r,t,e.origin),setRecovery:r=>sC((n=>gC("privy:wallets:set-recovery",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,a),connect:r=>sC((n=>gC("privy:wallets:connect",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,a),recover:r=>sC((n=>gC("privy:wallets:recover",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,a,!r.recoveryAccessToken&&!r.recoveryPassword&&!r.recoverySecretOverride),rpc:r=>sC((n=>gC("privy:wallets:rpc",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,a),create:r=>gC("privy:wallet:create",r,t,e.origin),import:r=>gC("privy:wallet:import",r,t,e.origin),createSolana:r=>sC((n=>gC("privy:solana-wallet:create",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,a),createDelegatedAction:r=>gC("privy:delegated-actions:consent",r,t,e.origin),verifyMfa:r=>sC((n=>gC("privy:mfa:verify",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,a,!0),initEnrollMfa:r=>sC((n=>gC("privy:mfa:init-enrollment",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,a),submitEnrollMfa:r=>sC((n=>gC("privy:mfa:submit-enrollment",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,a),unenrollMfa:r=>sC((n=>gC("privy:mfa:unenroll",{...r,...n},t,e.origin)),n.current,e.mfaPromise,e.mfaSubmitPromise,a,!0),clearMfa:r=>gC("privy:mfa:clear",r,t,e.origin),initFarcasterSigner:r=>gC("privy:farcaster:init-signer",r,t,e.origin),signFarcasterMessage:r=>gC("privy:farcaster:sign",r,t,e.origin)};window.addEventListener("message",o);let s=new AbortController;return ce((()=>gC("privy:iframe:ready",{},t,e.origin)),{abortSignal:s.signal}).then((()=>e.onLoad(l)),((...t)=>{console.warn("Privy iframe failed to load: ",...t),e.onLoadFailed()})),()=>{window.removeEventListener("message",o),s.abort()}}),[i]),t("iframe",{ref:r,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>o(!0),src:Ve(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}const wC=e=>e.linkedAccounts.filter((e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.delegated));class vC{async handleSignMessage(e){if(!e.params||"string"!=typeof e.params.message)throw Error("Message must be provided as a string for Solana signMessage RPC");return await KC({message:e.params.message})}async request(e){if(console.debug("EmbeddedSolanaProvider.request() called with args",e),!await zC())throw Error("User must be authenticated to use embedded Solana wallet");if(!await ZC())throw new E("Unable to connect to Solana embedded wallet");if("signMessage"===e.method)return await this.handleSignMessage(e);throw Error("Embedded Solana provider does not yet support this RPC method.")}constructor(e,t){this.walletProxy=e,this.address=t}}function CC(e){let t=new RegExp(RegExp("^eip155:(?<chainId>\\d+)$","gm")),r=t.exec(e)?.groups?.chainId;if(r)return parseInt(r);throw Error("Chain ID not compatible with CAIP-2 format.")}const bC="popup-privy-oauth",EC="PRIVY_OAUTH_USE_BROADCAST_CHANNEL";class $C{async authenticate(){if(!this.api)throw new E("Auth flow has no API instance");try{return await this.api.post(Wo,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(e){throw $(e)}}async link(){if(!this.api)throw new E("Auth flow has no API instance");try{return await this.api.post(Bo,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:this.meta.codeVerifier,provider:this.meta.provider})}catch(e){throw $(e)}}constructor({authorizationCode:e,stateCode:t,codeVerifier:r,provider:n}){this.meta={authorizationCode:e,stateCode:t,codeVerifier:r,provider:n}}}async function TC({api:e,requesterAppId:t,providerAppId:r}){let n=(await e.get(`/api/v1/apps/${t}/cross-app/connections`)).connections.find((e=>e.provider_app_id===r));if(!n)throw new E("Invalid connected app");return{name:n.provider_app_name,logoUrl:n.provider_app_icon_url||void 0,apiUrl:n.provider_app_custom_api_url,readOnly:n.read_only}}const AC=async({user:e,address:t,client:r,request:n,requesterAppId:a,reconnect:i})=>{r.createAnalyticsEvent({eventName:"cross_app_request_started",payload:{address:t,method:n.method}});let o=e?.linkedAccounts.find((e=>"cross_app"===e.type&&(e.embeddedWallets.some((e=>e.address===t))||e.smartWallets.some((e=>e.address===t)))));if(!e||!o)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Cannot request a signature with this wallet address",address:t}}),new E("Cannot request a signature with this wallet address");let l=r.getProviderAccessToken(o.providerApp.id),s=await TC({api:r.api,requesterAppId:a,providerAppId:o.providerApp.id});if(!l){if(s.readOnly)throw console.error("cannot transact against a read-only provider app"),new E("Cannot transact against a read-only provider app");await i({appId:o.providerApp.id,action:"link"})&&(l=r.getProviderAccessToken(o.providerApp.id))}if(!l)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Transactions require a valid token",address:t}}),new E("Transactions require a valid token");let d=_f();if(!d)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Missing token",address:t}}),new E("Failed to initialize signature request");let c=new URL(`${s.apiUrl}/oauth/transact`);return c.searchParams.set("token",l||""),c.searchParams.set("request",xC(n)),d.location=c.href,new Promise(((e,a)=>{let i=setTimeout((()=>{c(),a(new E("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:t}})}),12e4),l=setInterval((()=>{d.closed&&(c(),a(new E("User rejected request")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:t}}))}),300),s=i=>{i.data&&("set"===i.data.token?.action&&void 0!==i.data.token?.value?r.storeProviderAccessToken(o.providerApp.id,i.data.token.value):"clear"===i.data.token?.action&&r.storeProviderAccessToken(o.providerApp.id,null),"PRIVY_CROSS_APP_ACTION_RESPONSE"===i.data.type&&i.data.result&&(c(),e(i.data.result),r.createAnalyticsEvent({eventName:"cross_app_request_success",payload:{address:t,method:n.method}})),"PRIVY_CROSS_APP_ACTION_ERROR"===i.data.type&&i.data.error&&(c(),a(i.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:i.data.error,address:t}})))};window.addEventListener("message",s);let c=()=>{d.close(),clearInterval(l),clearTimeout(i),window.removeEventListener("message",s)}}))};let xC=e=>JSON.stringify({content:{request:{request:_C(e,Zr)}},timestamp:Date.now(),callbackUrl:window.origin});const _C=(e,t)=>"bigint"==typeof e?t(e):Array.isArray(e)?e.map((e=>_C(e,t))):e&&"object"==typeof e?Object.fromEntries(Object.entries(e).map((([e,r])=>[e,_C(r,t)]))):e,kC=e=>e.filter((e=>"wallets"===e.method||("exchange"===e.method?"coinbase"===e.provider:"card"===e.method||"payment-request"===e.method?"coinbase"===e.provider||"moonpay"===e.provider:(e.method,!1)))),NC={[at.id]:"0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",[Tt.id]:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",[it.id]:"0x0b2c639c533813f4aa9d7837caf62653d097ff85",[At.id]:"0x5fd84259d66Cd46123540766Be93DFE6D43130D7",[ot.id]:"0x3c499c542cef5e3811e1192ce70d8cc03d5c3359",[xt.id]:"0x41e94eb019c0762f9bfcf9fb1e58725bfb0e7582",[tt.id]:"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",[_t.id]:"0x036CbD53842c5426634e7929541eC2318f3dCF7e",[et.id]:"0xB97EF9Ef8734C71904D8002F8b6Bc66Dd9c48a6E",[kt.id]:"0x5425890298aed601595a70ab815c96711a31bc65",[Xe.id]:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",[Nt.id]:"0x75faf114eafb1BDbe2F0316DF893fd58CE46AA4d"},SC=({address:e,appConfig:t,fundWalletConfig:r,methodScreen:n,chainIdOverride:a,comingFromSendTransactionScreen:i=!1})=>{let o,l;if(!t.fundingConfig)throw Error("Wallet funding is not enabled");let s=kC(t.fundingConfig.options);if(s.length<1)throw Error("Wallet funding is not enabled");o=a||(Lf(r)&&r.chain?r.chain.id:CC(t.fundingConfig.defaultRecommendedCurrency.chain));let d=t.chains.find((e=>e.id===o));if(!d)throw new E(`Funding chain ${o} is not in PrivyProvider chains list`);let c=Lf(r)&&r.amount?r.amount:t.fundingConfig.defaultRecommendedAmount,u=!1;function h(){if(!o)return;let e=NC[o];s.find((e=>"wallets"===e.method))&&!e&&console.warn("Attempting to fund with USDC on chain where USDC address is not known. Funding via external wallet will be disabled."),l=e,u=!0}Lf(r)&&"asset"in r?"USDC"===r.asset?h():"string"!=typeof r.asset&&"erc20"in r.asset&&(u=((e,t)=>e===NC[t.id])(l=r.asset.erc20,d)):"USDC"===t.fundingConfig.defaultRecommendedCurrency.asset&&h();let p=r.defaultFundingMethod;return{chainType:"ethereum",address:e,amount:c,chain:d,erc20Address:l,erc20ContractInfo:u?{symbol:"USDC",decimals:6}:void 0,isUSDC:u,methodScreen:n,supportedOptions:s,comingFromSendTransactionScreen:i,defaultFundingMethod:p,usingDefaultFundingMethod:!!p,preferredCardProvider:r.card?.preferredProvider,crossChainBridgingEnabled:t.fundingConfig.crossChainBridgingEnabled??!1,cluster:{name:"mainnet-beta",rpcUrl:t.solanaClusters["mainnet-beta"]},...Rf(r)?{moonpayConfigOverride:r.config}:{}}};function IC({address:e,fundWalletConfig:t,appConfig:r,comingFromSendTransactionScreen:n,methodScreen:a}){if(!r.fundingConfig)throw Error("Wallet funding is not enabled");let i=kC(r.fundingConfig.options);if(i.length<1)throw Error("Wallet funding is not enabled");let o=t?.amount??r.fundingConfig.defaultRecommendedAmount,l=t.defaultFundingMethod;return{chainType:"solana",address:e,supportedOptions:i,amount:o,isUSDC:!1,methodScreen:a,comingFromSendTransactionScreen:n,cluster:t?.cluster??{name:"mainnet-beta",rpcUrl:r.solanaClusters["mainnet-beta"]},crossChainBridgingEnabled:r.fundingConfig.crossChainBridgingEnabled??!1,defaultFundingMethod:l,preferredCardProvider:t.card?.preferredProvider,usingDefaultFundingMethod:!!l}}const OC=[We.FUNDING_METHOD_SELECTION_SCREEN,We.FUNDING_TRANSFER_FROM_WALLET_SCREEN,We.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN,We.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN,We.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN,We.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN,We.FUNDING_MANUAL_TRANSFER_SCREEN,We.MOONPAY_STATUS_SCREEN],PC={[We.FUNDING_METHOD_SELECTION_SCREEN]:null,[We.FUNDING_TRANSFER_FROM_WALLET_SCREEN]:"external",[We.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN]:"external",[We.FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_SOLANA_WALLET_SCREEN]:"external",[We.FUNDING_AWAITING_EVM_TO_SOL_BRIDGING_SCREEN]:"external",[We.FUNDING_AWAITING_SOL_TO_EVM_BRIDGING_SCREEN]:"external",[We.FUNDING_MANUAL_TRANSFER_SCREEN]:"manual",[We.MOONPAY_STATUS_SCREEN]:"moonpay"};async function MC({url:e,popup:t,provider:r}){return t.location=e,new Promise(((e,r)=>{function n(){t?.close(),window.removeEventListener("message",a)}function a(t){t.data&&("PRIVY_OAUTH_RESPONSE"===t.data.type&&t.data.stateCode&&t.data.authorizationCode&&(e(t.data),n()),"https://cdn.apple-cloudkit.com"===t.origin&&t.data.ckSession&&(e({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:t.data.ckSession}),n()),"PRIVY_OAUTH_ERROR"===t.data.type&&(r(t.data.error),n()))}window.addEventListener("message",a)}))}let RC,LC,DC,FC,UC,WC,BC;function jC(){return RC?RC.getCustomerAccessToken():Promise.resolve(qo.get(Ae)||null)}async function zC(){return RC?RC.getAccessToken():Promise.resolve(qo.get(xe)||qo.get(Ae)||null)}const GC=(e,t,r)=>LC(e,t,r),HC=(e,t,r)=>DC(e,t,r),VC=(e,t,r,n)=>FC(e,t,r,n),qC=()=>UC(),ZC=()=>WC(),KC=({message:e})=>BC({message:e});const YC=({config:e,...r})=>{var n;if("undefined"!=typeof window&&0>["localhost","127.0.0.1"].indexOf(window.location.hostname)&&"https:"!==window.location.protocol)throw new E("Embedded wallet is only available over HTTPS");if("string"!=typeof(n=r.appId)||25!==n.length)throw new E("Cannot initialize the Privy provider with an invalid Privy app ID");RC||(RC=new Ms({appId:r.appId,appClientId:r.clientId,apiUrl:r.apiUrl}));let a=Object.assign({},e);return void 0!==r.createPrivyWalletOnLogin&&void 0===a.embeddedWallets?.createOnLogin&&(a.embeddedWallets||(a.embeddedWallets={}),a.embeddedWallets.createOnLogin=r.createPrivyWalletOnLogin?"users-without-wallets":"off"),void 0!==r.createPrivyWalletOnLogin&&e?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),t(St,{client:RC,clientConfig:a,legacyCreateEmbeddedWalletFlag:r.createPrivyWalletOnLogin,children:t(QC,{...r,client:RC})})};let QC=r=>{let a=r.client,[l,u]=d(!1),[h,m]=d(!1),[f,g]=d(!1),[y,w]=d(null),[v,C]=d([]),[N,S]=d([]),[I,O]=d(null),P=s(v),[M,L]=d(!1),[F,B]=d(null),[z,G]=d(!1),[ee,te]=d({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:x}),[ne,le]=d({status:"initial"}),[se,ce]=d({status:"initial"}),[ue,he]=d({status:"initial"}),[pe,ye]=d({status:"initial"}),[we,ve]=d({status:"initial"}),[Ce,be]=d(null),$e=Ue(),Te=It(),[Ae,xe]=d(!0),[_e,Ne]=d({}),[Se,Ie]=d(null),[Oe,Pe]=d(null),[Me,Re]=d(!1),[De,Be]=d(!1),[je,ze]=d($e.customAuth?.enabled?{status:"initial"}:{status:"not-enabled"}),Ge=s(null),He=s(null),Ve=s(Yt),[Ze,Ke]=d(!1);a.onStoreCustomerAccessToken=e=>{e&&Qt(Ve,"accessToken","onAccessTokenGranted",e)},a.onDeleteCustomerAccessToken=()=>{w(null),g(!1),Qt(Ve,"accessToken","onAccessTokenRemoved")};let Ye=s(null),Qe=s(null),Je=s(!1),Xe=({showWalletUIs:e,typedData:t})=>Je.current?Je.current:void 0!==e?!e:void 0!==$e.embeddedWallets.showWalletUIs?!$e.embeddedWallets.showWalletUIs:t?$e.embeddedWallets.noPromptOnSignature||($e.legacyWalletUiConfig??!1):!!$e.embeddedWallets.noPromptOnSignature,et=e=>{B(e),setTimeout((()=>{u(!0)}),15),a.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:e}})},tt=e=>{"off"!==$e.embeddedWallets.createOnLogin&&xe(!0),et(e)};p((()=>{let e=W(y);if(!e||!Ce)return void O(null);let t={type:"solana",imported:!1,address:e.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",walletIndex:e.walletIndex??void 0,meta:{name:"Privy Wallet",icon:void 0,id:"io.privy.solana.wallet"},linked:!0,fund(){throw new E("'fund' is deprecated for Solana wallets - use 'fundWallet' instead")},unlink:()=>{throw new E("Cannot unlink an embedded Solana wallet")},getProvider:async()=>new vC(Ce,e.address),async signMessage(e){let t=await zC(),r=j(y);if(!t||!Ce||!r)throw new E("Must have valid access token and Privy wallet to send transaction",T.MUST_BE_AUTHENTICATED);if(!await kt.recoverPrimaryWallet().catch((()=>!1)))throw new E("Wallet couldn't be connected",T.UNKNOWN_CONNECT_WALLET_ERROR);let{entropyId:n,entropyIdVerifier:a}=k(r),{response:i}=await Ce.rpc({accessToken:t,entropyId:n,entropyIdVerifier:a,chainType:"solana",hdWalletIndex:this.walletIndex??0,request:{method:"signMessage",params:{message:Buffer.from(e).toString("base64")}}});return Buffer.from(i.data.signature,"base64")},async sendTransaction(e,t,r){let{signature:n}=await bt({transaction:e,connection:t,transactionOptions:r,wallet:this});return n},async signTransaction(e){let t=await zC();if(!t||!Ce)throw new E("Must have valid access token and Privy wallet to send transaction",T.MUST_BE_AUTHENTICATED);if(!await kt.recoverPrimaryWallet().catch((()=>!1)))throw new E("Wallet couldn't be connected",T.UNKNOWN_CONNECT_WALLET_ERROR);let{entropyId:r,entropyIdVerifier:n}=V(y);return await $w({tx:e,accessToken:t,walletProxy:Ce,entropyId:r,entropyIdVerifier:n,transactingWalletAddress:this.address,transactingWalletIndex:this.walletIndex??0}),e},loginOrLink:async()=>{throw new E("Cannot login or link with an embedded Solana wallet")},disconnect:()=>{O(null)},isConnected:async()=>!0};O(t)}),[Ce,y]),p((()=>{if(!y)return void a.connectors?.removeEmbeddedWalletConnectors();let e=U(y),t=q(y),n=H(y);e&&t.length||a.connectors?.removeEmbeddedWalletConnectors(),n||a.connectors?.removeImportedWalletConnector(),a.connectors?Ce?(e&&a.connectors.addEmbeddedWalletConnectors({walletProxy:Ce,rootWallet:e,embeddedWallets:t,defaultChain:$e.defaultChain,appId:r.appId}),n&&a.connectors.addImportedWalletConnector(Ce,n.address,$e.defaultChain,r.appId)):console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized"):console.debug("Failed to add embedded wallet connector: Client connectors not initialized")}),[Ce,y]),p((()=>{Ce&&Oe?.(Ce)}),[Ce]);let rt=s();p((()=>{(async()=>{if(!$e.customAuth?.enabled)return void ze({status:"not-enabled"});xe(!0);let{getCustomAccessToken:e,isLoading:t}=$e.customAuth;if(h&&!t&&"loading"!==je.status){ze({status:"loading"});try{let t=await e();if(t===rt.current)return void ze({status:"done"});if(!t&&f)return rt.current=t,await _t.logout(),ze({status:"done"}),void Qt(Ve,"customAuth","onUnauthenticated");if(!t)return rt.current=t,void ze({status:"done"});a.startAuthFlow(new zo(t));let{user:r,isNewUser:n}=await a.authenticate();if(!r)return await _t.logout(),ze({status:"error",error:new E("Failed to sync with custom auth provider")}),void Qt(Ve,"customAuth","onUnauthenticated");void 0!==n&&Qt(Ve,"login","onComplete",r,n,!1,"custom",null),rt.current=t,Qt(Ve,"customAuth","onAuthenticated",{user:r}),ze({status:"done"}),w(r||null),L(n||!1),g(!0),Be(!0)}catch(e){if(console.warn(e),await _t.logout(),Qt(Ve,"customAuth","onUnauthenticated"),"User already exists with provided custom JWT account."===e.message)return void ze({status:"initial"});Qt(Ve,"login","onError",e.privyErrorCode||T.UNKNOWN_AUTH_ERROR),ze({status:"error",error:e})}}})()}),["initial"===je.status,$e.customAuth?.enabled,$e.customAuth?.getCustomAccessToken,$e.customAuth?.isLoading,h,f]),p((()=>{De&&Ce&&y&&R(y,$e.embeddedWallets.createOnLogin)&&(Be(!1),gt(y,qe).catch(console.error))}),[De&&Ce&&y]),p((()=>{if($e.externalWallets.solana.connectors)return $e.externalWallets.solana.connectors.onMount(),()=>$e.externalWallets.solana.connectors?.onUnmount()}),[$e.externalWallets.solana.connectors]),p((()=>{!h&&Te&&async function(){let e,t=nt(),r=at();(()=>{let e=new URLSearchParams(window.location.search).get("privy_token");if(!e)return;qo.put(ke,e);let t=new URL(window.location.href);t.searchParams.delete("privy_token"),window.history.pushState({},"",t)})();let n=o();a.initializeConnectorManager({walletConnectCloudProjectId:$e.walletConnectCloudProjectId,rpcConfig:$e.rpcConfig,chains:$e.chains,defaultChain:$e.defaultChain,store:n,walletList:$e.appearance.walletList,shouldEnforceDefaultChainOnConnect:$e.shouldEnforceDefaultChainOnConnect,externalWalletConfig:$e.externalWallets,appName:$e.name??"Privy",walletChainType:$e.appearance.walletChainType}),a.connectors?.on("connectorInitialized",(()=>{e&&clearTimeout(e);let t=a.connectors.walletConnectors.length,r=a.connectors.walletConnectors.reduce(((e,t)=>e+(t.initialized?1:0)),0);r===t?Ke(!0):e=setTimeout((()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:r,expected:t}),Ke(!0)}),1500)})),a.connectors?.initialize().then((()=>{ct()}));let i=await a.getAuthenticatedUser(),l=!!i;$e.legal.requireUsersAcceptTerms&&i&&!i.hasAcceptedTerms?(await a.logout(),kt.setReadyToTrue(!0),Qt(Ve,"logout","onSuccess")):($e.customAuth?.enabled||(g(!!i),i&&Qt(Ve,"login","onComplete",i,!1,!0,null,null),w(i)),t?Qe.current=l?"link":"login":r&&!l?(Qe.current="login",Ne({telegramAuthModalData:{seamlessAuth:!0}}),tt(We.TELEGRAM_AUTH_SCREEN)):kt.setReadyToTrue(!!i))}()}),[a,Se,h,Te]),p((()=>{if(h){if(!y||!y.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType)))return void Re(!0);Re(!!v.find((e=>"privy"===e.walletClientType)))}}),[h,y,v]);let nt=()=>{let e=hl();return e.inProgress&&e.popupFlow?window.opener.location.origin!==window.location.origin?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."}):"error"===e.authorizationCode?void window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."}):void window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:e.stateCode,authorizationCode:e.authorizationCode}):(e.inProgress&&function(e){return e.startsWith("privy:")}(e.provider)&&!e.popupFlow&&(new BroadcastChannel(bC).postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:e.stateCode,authorizationCode:e.authorizationCode}),window.close()),!!e.inProgress&&!!e.withPrivyUi&&(a.startAuthFlow(new Jo(e)),tt(We.AWAITING_OAUTH_SCREEN),!0))},at=()=>{let e=function(){let e;return(e=function(){let e=new URLSearchParams(window.location.search),t=Number(e.get("id")||""),r=e.get("hash"),n=Number(e.get("auth_date")||""),a=e.get("first_name");if(t&&a&&n&&r)return Object.fromEntries(e.entries())}())?(Ul(),{flowType:"login-url",authData:e}):(e=function(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("user"),n=Number(t.get("auth_date")||""),a=t.get("hash");return r&&n&&a?Object.fromEntries(t.entries()):void 0}())?(Ul(),{flowType:"web-app",authData:e}):void 0}();if(!e||!$e.loginMethods.telegram||!$e.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let t=new Dl;return a.startAuthFlow(t),"login-url"===e.flowType&&(t.meta.telegramWebAppData=void 0,t.meta.telegramAuthResult=e.authData),"web-app"===e.flowType&&(t.meta.telegramAuthResult=void 0,t.meta.telegramWebAppData=e.authData),!0},it=async(e,t,r,n)=>{ot(await(a.connectors?.createEthereumWalletConnector(e,t))||null,t,r,n)};async function ot(e,t,r,n){if(!e)return te({status:"disconnected",connectedWallet:null,connectError:new _("Unable to connect to wallet."),connector:null,connectRetry:x}),n?.(null,r);te({status:"disconnected",connectedWallet:null,connectError:null,connector:e,connectRetry:x}),e instanceof ws&&t&&await e.resetConnection(t),te({connector:e,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>ot(e,t,r,n)});try{let t=await e.connect({showPrompt:!0});if((!t||zl(t))&&$e.shouldEnforceDefaultChainOnConnect&&!$e.chains.find((e=>e.id===Number(t?.chainId.replace("eip155:",""))))&&("wallet_connect_v2"!==t?.connectorType||"metamask"!==t?.walletClientType)){te((t=>({...t,connector:e,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:x})));try{await(t?.switchChain($e.defaultChain.id)),t&&(t.chainId=de(me($e.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${$e.defaultChain.id}`)}}return te((e=>({...e,status:"connected",connectedWallet:t,connectError:null,connectRetry:x}))),t&&Qt(Ve,"connectWallet","onSuccess",(e.chainType,t)),n?.(t,r)}catch(e){return e instanceof A?(console.warn(e.cause?e.cause:e.message),Qt(Ve,"connectWallet","onError",e.privyErrorCode||T.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(e),Qt(Ve,"connectWallet","onError",T.UNKNOWN_CONNECT_WALLET_ERROR)),te((t=>({...t,status:"disconnected",connectedWallet:null,connectError:e}))),n?.(null,r)}}let lt=async(e,t,r)=>{if(null===e||!zl(e))return;let n=new gl(e,a,t,r);a.startAuthFlow(n)},st=async(e,t)=>{if(null===e||!Xt(e))return;let r=new Ol(e,a,t);a.startAuthFlow(r)},ct=()=>{let e=new URLSearchParams(window.location.search),t=e.get("privy_connector"),r=e.get("privy_wallet_client");if(!t||!r)return;if("phantom"!==r||Ee()||tt(We.LOGIN_FAILED_SCREEN),!a.connectors)throw new E("Connector not initialized");et(We.AWAITING_CONNECTION);let n=new URL(window.location.href);n.searchParams.delete("privy_connector"),n.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",n),it(t,r,void 0,lt)};p((()=>{h&&f&&null===y&&a.getAuthenticatedUser().then(w)}),[h,f,y,a]);let ut=e=>{if(!f)throw Qt(Ve,"linkAccount","onError",T.MUST_BE_AUTHENTICATED,{linkMethod:e}),new E("User must be authenticated before linking an account.")},ht=()=>{ut("siwe"),Ye.current="siwe",Qe.current="link",et(We.LINK_WALLET_SCREEN)},pt=e=>{if(!f||!y)return!1;if("privy"===e.walletClientType)return!0;for(let t of y.linkedAccounts)if("wallet"===t.type&&t.address===e.address&&"privy"!==t.walletClientType)return!0;return!1},mt=async e=>{let t;if(!a.connectors)throw new E("Connector not initialized");t="ethereum"===e.type?a.connectors.findWalletConnector(e.connectorType,e.walletClientType)||null:a.connectors.findSolanaWalletConnector(e.connectorType,e.walletClientType)||null,te((r=>({...r,connector:t,status:"connected",connectedWallet:e,connectError:null,connectRetry:x}))),$e.captchaEnabled&&!f?(Ne({captchaModalData:{callback:t=>zl(e)?lt(e,t):st(e,t),userIntentRequired:!1,onSuccessNavigateTo:We.AWAITING_CONNECTION,onErrorNavigateTo:We.ERROR_SCREEN}}),tt(We.CAPTCHA_SCREEN)):(zl(e)?await lt(e):await st(e),tt(We.AWAITING_CONNECTION))},ft=()=>{C((e=>{let t=a.connectors?.wallets.filter(zl).map((e=>({...e,linked:pt(e),loginOrLink:async()=>{if(!await e.isConnected())throw new E("Wallet is not connected");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new E("Cannot link or login with embedded wallet");mt(e)},fund:async t=>{await kt.fundWallet(e.address,t)},unlink:async()=>{if(!f)throw new E("User is not authenticated.");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new E("Cannot unlink an embedded wallet");w(await a.unlinkEthereumWallet(e.address))}})))||[];return Gl(e,t)?e:t})),S((e=>{let t=a.connectors?.wallets.filter(Xt).map((e=>({...e,linked:pt(e),loginOrLink:async()=>{if(!await e.isConnected())throw new E("Wallet is not connected");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new E("Cannot link or login with embedded wallet");mt(e)},fund:async()=>{throw new E("'fund' is deprecated for Solana wallets - use 'fundWallet' instead")},unlink:async()=>{if(!f)throw new E("User is not authenticated.");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new E("Cannot unlink an embedded wallet");w(await a.unlinkSolanaWallet(e.address))}})))||[];return Gl(e,t)?e:t}))};p((()=>{ft()}),[y?.linkedAccounts,f,h]),p((()=>{if(h){if(!a.connectors)throw new E("Connector not initialized");ft(),a.connectors.on("walletsUpdated",ft)}}),[h]),p((()=>{[...$e.loginMethodsAndOrder?.primary??[],...$e.loginMethodsAndOrder?.overflow??[]].filter((e=>e.startsWith("privy:"))).forEach((e=>a.getCrossAppProviderDetails(e.replace("privy:",""))))}),[!!a]),p((()=>{let e;if(!v[0])return;let t=v[0],r=P.current.find((e=>e.address===t.address));if(e="privy"===t.walletClientType?y?.linkedAccounts.find((e=>"wallet"===e.type&&e.address===t.address&&"privy"===e.walletClientType)):y?.linkedAccounts.find((e=>"wallet"===e.type&&e.address===t.address&&"privy"!==e.walletClientType)),!r&&e){let t=Object.assign({},y);t.wallet=e&&{address:e.address,chainType:e.chainType,chainId:e.chainId,walletClient:e.walletClient,walletClientType:e.walletClientType,connectorType:e.connectorType,imported:e.imported,delegated:e.delegated,walletIndex:e.walletIndex},w(t)}P.current=v}),[v]);let gt=async(e,t,r)=>{let n=U(e),a=W(e);if(r&&"walletIndex"in r)return wt(e,t,r.walletIndex,n,a);let i=r&&"createAdditional"in r&&r.createAdditional;if(n&&!i)throw Qt(Ve,"createWallet","onError",T.EMBEDDED_WALLET_ALREADY_EXISTS),Error("User already has an embedded wallet.");let[o,l]=await Promise.all([kt.initializeWalletProxy(t),zC()]);if(!o&&$e.customAuth?.enabled)throw Qt(Ve,"createWallet","onError",T.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(!o||!l||$e.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return yt();if(!n)return console.log("solanaWallet",a),await o.create({accessToken:l,solanaAddress:a?.address}),vt(0);{let t=(Z(e)?.walletIndex??0)+1,{entropyId:r,entropyIdVerifier:n}=k(j(e));return await kt.recoverPrimaryWallet(),await o.addWallet({accessToken:l,entropyId:r,entropyIdVerifier:n,chainType:"ethereum",hdWalletIndex:t}),vt(t)}},yt=async()=>new Promise(((e,t)=>{xe(!0),Ne({createWallet:{onSuccess:t=>{Qt(Ve,"createWallet","onSuccess",t),e(t)},onFailure:e=>{Qt(Ve,"createWallet","onError",T.UNKNOWN_EMBEDDED_WALLET_ERROR),t(e)},callAuthOnSuccessOnClose:!1}}),et(We.EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN)})),wt=async(e,t,r,n,a)=>{if(r<0)throw Qt(Ve,"createWallet","onError",T.EMBEDDED_WALLET_CREATE_ERROR),Error(`A negative walletIndex (${r}) is invalid.`);let[i,o]=await Promise.all([kt.initializeWalletProxy(t),zC()]);if(!i&&$e.customAuth?.enabled)throw Qt(Ve,"createWallet","onError",T.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to connect to wallet proxy");if(!i||!o||$e.embeddedWallets?.requireUserOwnedRecoveryOnCreate){if(0==r)return yt();throw Qt(Ve,"createWallet","onError",T.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Create wallet UI can only be displayed when walletIndex is 0.")}if(0==r){if(n)return n;await i.create({accessToken:o,solanaAddress:a?.address})}else{if(!n)throw Qt(Ve,"createWallet","onError",T.EMBEDDED_WALLET_CREATE_ERROR),Error("A user must have a wallet at HD index 0 before creating a wallet at greater HD indices.");let t=q(e).find((e=>e.walletIndex===r));if(t)return t;let{entropyId:a,entropyIdVerifier:l}=k(j(e));await kt.recoverPrimaryWallet(),await i.addWallet({accessToken:o,entropyId:a,entropyIdVerifier:l,chainType:"ethereum",hdWalletIndex:r})}return vt(r)},vt=async e=>{let t=q(await kt.refreshUser()).find((t=>t.walletIndex===e));if(!t)throw Qt(Ve,"createWallet","onError",T.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");return Qt(Ve,"createWallet","onSuccess",t),t},Ct=(e,t,a,i)=>new Promise((async(o,l)=>{let{requesterAppId:s}=t||{};if(!f||!y)return Qt(Ve,"sendTransaction","onError",T.MUST_BE_AUTHENTICATED),void l(Error("User must be authenticated before signing with a Privy wallet"));let d=i??U(y)?.address;if(!d)throw new E("User must have an embedded wallet to send a transaction.");let{signingWallet:c,rootWallet:u}=K(y,d);if(!u||!c)return Qt(Ve,"sendTransaction","onError",T.EMBEDDED_WALLET_NOT_FOUND),void l(Error("Must have a Privy wallet before signing"));xe(!0);let h=Nt.wallets.find((e=>"privy"===e.walletClientType&&n(e.address)===n(c.address))),p=await(h?.getEthereumProvider());if(!h||!p)throw new E(`Cannot sendTransaction before embedded wallet ${c.address} is connected`);let m=e.chainId?Number(e.chainId):CC(h.chainId);(e=>{if(!$e.chains.map((e=>e.id)).includes(e))throw new _(`Chain ID ${e} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,T.UNSUPPORTED_CHAIN_ID)})(m);let g=Object.assign({},e,{chainId:m});if(Xe({showWalletUIs:t?.showWalletUIs}))(async()=>{let e=await zC();if(!e||!Ce)return Qt(Ve,"sendTransaction","onError",T.EMBEDDED_WALLET_NOT_FOUND),void l(Error("Must have valid access token and Privy wallet to send transaction"));try{if(!await kt.recoverPrimaryWallet())return Qt(Ve,"sendTransaction","onError",T.UNKNOWN_CONNECT_WALLET_ERROR),void l(Error("Unable to connect to wallet"));let n=fe(g.chainId,$e.chains,$e.rpcConfig,{appId:r.appId}),a=await ya(c.address,g,n);if(Xe({showWalletUIs:t?.showWalletUIs})){let{totalGasEstimate:e}=await fa(a,n),{hasSufficientFunds:t}=await lv(c.address,a,e,n);if(!t)throw new Ht(new Zt("Wallet has insufficient funds for this transaction.",Kt.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let{entropyId:i,entropyIdVerifier:d}=k(u),h=await ov({accessToken:e,entropyId:i,entropyIdVerifier:d,transactingWallet:c,walletProxy:Ce,transactionRequest:a,provider:n,requesterAppId:s});Qt(Ve,"sendTransaction","onSuccess",h),o(h)}catch(e){Qt(Ve,"sendTransaction","onError",T.TRANSACTION_FAILURE),l(e)}})();else{let{entropyId:e,entropyIdVerifier:r}=k(u),n={entropyId:e,entropyIdVerifier:r,onCompleteNavigateTo:We.EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN,onFailure:e=>{Qt(Ve,"sendTransaction","onError",T.UNKNOWN_CONNECT_WALLET_ERROR),l(e)}},i=(e=>!!e.fundingConfig&&kC(e.fundingConfig.options).length>=1)($e)?SC({address:c.address,appConfig:$e,fundWalletConfig:a,methodScreen:We.FUNDING_METHOD_SELECTION_SCREEN,chainIdOverride:g.chainId,comingFromSendTransactionScreen:!0}):void 0;Ne({connectWallet:n,sendTransaction:{transactionRequest:g,transactingWallet:c,entropyId:e,entropyIdVerifier:r,onSuccess:e=>{Qt(Ve,"sendTransaction","onSuccess",e),o(e)},onFailure:e=>{Qt(Ve,"sendTransaction","onError",T.TRANSACTION_FAILURE),l(e)},uiOptions:t||{},fundWalletConfig:a,requesterAppId:s},funding:i}),et(We.EMBEDDED_WALLET_CONNECTING_SCREEN)}})),bt=({transaction:e,connection:t,transactionOptions:r,fundWalletConfig:n,uiOptions:a,wallet:i})=>new Promise((async(o,l)=>{let{requesterAppId:s}=a||{};if(!f||!y)return Qt(Ve,"sendSolanaTransaction","onError",T.MUST_BE_AUTHENTICATED),void l(new E("User must be authenticated before signing with a Privy wallet",T.MUST_BE_AUTHENTICATED));let d=i?y.linkedAccounts.find((e=>"wallet"===e.type&&e.address===i.address)):W(y);if(!d)return Qt(Ve,"sendSolanaTransaction","onError",T.EMBEDDED_WALLET_NOT_FOUND),void l(new E("Must have a Privy wallet before signing",T.EMBEDDED_WALLET_NOT_FOUND));xe(!0);let c=i??I,u=await(c?.isConnected());if(!c||!u)throw Qt(Ve,"sendSolanaTransaction","onError",T.EMBEDDED_WALLET_NOT_FOUND),new E(`Cannot sendSolanaTransaction before embedded wallet ${d.address} is connected`,T.EMBEDDED_WALLET_NOT_FOUND);if(Xe({showWalletUIs:a?.showWalletUIs}))(async()=>{let n=await zC();if(!n||!Ce)return Qt(Ve,"sendSolanaTransaction","onError",T.EMBEDDED_WALLET_NOT_FOUND),void l(new E("Must have valid access token and Privy wallet to send transaction",T.EMBEDDED_WALLET_NOT_FOUND));try{if(!await kt.recoverPrimaryWallet())return Qt(Ve,"sendSolanaTransaction","onError",T.UNKNOWN_CONNECT_WALLET_ERROR),void l(new E("Unable to connect to wallet",T.UNKNOWN_CONNECT_WALLET_ERROR));if(Xe({showWalletUIs:a?.showWalletUIs})){let{instructions:r}=await Jp(e,t);r.every((e=>e.hasFunds))||(Qt(Ve,"sendSolanaTransaction","onError",T.INSUFFICIENT_BALANCE),l(new E("Solana wallet has insufficient funds for this transaction.",T.INSUFFICIENT_BALANCE)))}let{entropyId:i,entropyIdVerifier:s}=V(y),{signature:c,receipt:u}=await Tw({accessToken:n,tx:e,connection:t,walletProxy:Ce,transactionOptions:r,entropyId:i,entropyIdVerifier:s,transactingWalletAddress:d.address,transactingWalletIndex:d.walletIndex??0}),h=Qp(c,u);Qt(Ve,"sendSolanaTransaction","onSuccess",h),o(h)}catch(e){Qt(Ve,"sendSolanaTransaction","onError",T.TRANSACTION_FAILURE),l(e)}})();else{let{entropyId:i,entropyIdVerifier:c}=k(d),u={entropyId:i,entropyIdVerifier:c,onCompleteNavigateTo:We.EMBEDDED_WALLET_SEND_SOLANA_TRANSACTION_SCREEN,onFailure:e=>{Qt(Ve,"sendSolanaTransaction","onError",T.UNKNOWN_CONNECT_WALLET_ERROR),l(e)}},h=IC({address:d.address,appConfig:$e,methodScreen:We.FUNDING_METHOD_SELECTION_SCREEN,fundWalletConfig:n,comingFromSendTransactionScreen:!0});Ne({connectWallet:u,sendSolanaTransaction:{transactionRequest:e,connection:t,transactionOptions:r,transactingWallet:d,onSuccess:e=>{Qt(Ve,"sendSolanaTransaction","onSuccess",e),o(e)},onFailure:e=>{Qt(Ve,"sendSolanaTransaction","onError",T.TRANSACTION_FAILURE),l(e)},uiOptions:a||{},requesterAppId:s},funding:h}),et(We.EMBEDDED_WALLET_CONNECTING_SCREEN)}}));function Et(){return new Promise((async(e,t)=>{let r=await zC();if(!r||!Ce)throw Error("Must have valid access token to enroll in MFA");try{await Ce.verifyMfa({accessToken:r}),e()}catch(e){t(e)}}))}let $t=e=>e?.linkedAccounts.filter((e=>null!==e.latestVerifiedAt&&!("wallet"===e.type&&"privy"===e.walletClientType))).sort(((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime()))[0],Tt=e=>{let t=y?.linkedAccounts.filter((t=>t.type===e)).length??0,{displayName:r,loginMethod:n}=sg(e);if("passkey"===e&&t>=5||"passkey"!==e&&t>=1)throw Qt(Ve,"linkAccount","onError",T.CANNOT_LINK_MORE_OF_TYPE,{linkMethod:n}),new E(`User already has an account of type ${r} linked.`)};async function At({showAutomaticRecovery:e=!1,legacySetWalletPasswordFlow:t=!1}){B(null);let r=t?"setWalletPassword":"setWalletRecovery";if(!f||!y)throw Qt(Ve,r,"onError",T.MUST_BE_AUTHENTICATED),Error("User must be authenticated before adding recovery method to Privy wallet");let n=j(y);if(!n||!Ce)throw Qt(Ve,r,"onError",T.EMBEDDED_WALLET_NOT_FOUND),Error("Must have a Privy wallet to add a recovery method");try{await Et()}catch(e){throw Qt(Ve,r,"onError",T.MISSING_MFA_CREDENTIALS),e}return new Promise(((a,i)=>{xe(!0);let o={onSuccess:e=>{Qt(Ve,r,"onSuccess","user-passcode",e),a(e)},onFailure:e=>{Qt(Ve,r,"onError",T.USER_EXITED_SET_PASSWORD_FLOW),i(e)},callAuthOnSuccessOnClose:!1},l="user-passcode"===n.recoveryMethod,s=Xu({walletAction:"update",availableRecoveryMethods:$e.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:t,isResettingPassword:l,showAutomaticRecovery:e}),{entropyId:d,entropyIdVerifier:c}=k(n);Ne({setWalletPassword:o,recoverWallet:{entropyId:d,entropyIdVerifier:c,onFailure:i},createWallet:o,connectWallet:{onCompleteNavigateTo:s,shouldForceMFA:!1,entropyId:d,entropyIdVerifier:c,onFailure:e=>{Qt(Ve,r,"onError",T.UNKNOWN_CONNECT_WALLET_ERROR),i(e)}},recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:l}}),et(We.EMBEDDED_WALLET_CONNECTING_SCREEN)}))}async function xt({appId:e,action:t}){let r=await zC();if("link"===t&&!r)throw Qt(Ve,"linkAccount","onError",T.MUST_BE_AUTHENTICATED,{linkMethod:`privy:${e}`}),new E("User must be authenticated before linking an account.");if("login"===t&&r)throw Qt(Ve,"login","onError",T.UNKNOWN_AUTH_ERROR),new E("Attempted to log in, but user is already logged in. Use a `link` helper instead.");Ye.current=`privy:${e}`,Qe.current=t;let n=_f();return a.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{providerAppId:e}}),new Promise((async(r,i)=>{let{name:o,logoUrl:l}=await TC({api:a.api,providerAppId:e,requesterAppId:$e.id});Ne({crossAppAuth:{appId:e,name:o,logoUrl:l,action:t,popup:n,onSuccess:r,onError:i}}),tt(We.CROSS_APP_AUTH_SCREEN)}))}let _t={ready:h,authenticated:f,user:y,walletConnectors:a.connectors||null,connectWallet:e=>{e&&"target"in e&&e&&(e=void 0),Ne({externalConnectWallet:{walletList:e?.walletList&&e?.walletList.length>0?e.walletList:void 0,suggestedAddress:e?.suggestedAddress}}),et(f?We.CONNECT_ONLY_AUTHENTICATED_SCREEN:We.CONNECT_ONLY_LANDING_SCREEN)},linkWallet:ht,startCrossAppAuthFlow:xt,linkEmail:()=>{ut("email"),Tt("email"),Ye.current="email",Qe.current="link",et(We.LINK_EMAIL_SCREEN)},linkPhone:()=>{ut("sms"),Tt("phone"),Ye.current="sms",Qe.current="link",et(We.LINK_PHONE_SCREEN)},linkGoogle:async()=>{ut("google"),Tt("google_oauth"),Qe.current="link",await kt.initLoginWithOAuth("google")},linkTwitter:async()=>{ut("twitter"),Tt("twitter_oauth"),Qe.current="link",await kt.initLoginWithOAuth("twitter")},linkDiscord:async()=>{ut("discord"),Tt("discord_oauth"),Qe.current="link",await kt.initLoginWithOAuth("discord")},linkGithub:async()=>{ut("github"),Tt("github_oauth"),Qe.current="link",await kt.initLoginWithOAuth("github")},linkSpotify:async()=>{ut("spotify"),Tt("spotify_oauth"),Qe.current="link",await kt.initLoginWithOAuth("spotify")},linkInstagram:async()=>{ut("instagram"),Tt("instagram_oauth"),Qe.current="link",await kt.initLoginWithOAuth("instagram")},linkTiktok:async()=>{ut("tiktok"),Tt("tiktok_oauth"),Qe.current="link",await kt.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{ut("linkedin"),Tt("linkedin_oauth"),Qe.current="link",await kt.initLoginWithOAuth("linkedin")},linkApple:async()=>{ut("apple"),Tt("apple_oauth"),Qe.current="link",await kt.initLoginWithOAuth("apple")},linkPasskey:async()=>{ut("passkey"),Tt("passkey"),await kt.initLinkWithPasskey(),et(We.LINK_PASSKEY_SCREEN)},linkTelegram:async()=>{ut("telegram"),Tt("telegram"),Qe.current="link",Ye.current="telegram",await kt.initLoginWithTelegram(),et(We.TELEGRAM_AUTH_SCREEN)},linkFarcaster:async()=>{ut("farcaster"),Tt("farcaster"),await kt.initLoginWithFarcaster(),Qe.current="link",Ye.current="farcaster",et(We.AWAITING_FARCASTER_CONNECTION)},updateEmail:()=>{if(ut("email"),!y?.email)throw new E("User does not have an email linked to their account.");Qe.current="update",Ye.current="email",et(We.UPDATE_EMAIL_SCREEN)},updatePhone:()=>{if(ut("sms"),!y?.phone)throw new E("User does not have a phone number linked to their account.");Qe.current="update",Ye.current="sms",et(We.UPDATE_PHONE_SCREEN)},login:async e=>{e&&"target"in e&&e&&(e=void 0);let t="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!h){let e=await new Promise((e=>{Ie((t=>e.bind(t)))}));if(Ie(null),e)return void console.warn(t)}!y||y.isGuest?(Qe.current="login",Ne({login:e}),tt(We.LANDING)):console.warn(t)},connectOrCreateWallet:async()=>{h||(await new Promise((e=>{Ie((()=>e))})),Ie(null)),f?console.warn("User must be unauthenticated to `connectOrCreateWallet`"):(Qe.current="login",tt(We.CONNECT_OR_CREATE))},logout:async()=>{if(Qe.current=null,Ye.current=null,y&&a.clearProviderAcccessTokens(y),B(null),await a.logout(),y&&Ce)try{await Ce.clearMfa({userId:y.id})}catch(e){}w(null),g(!1),Qt(Ve,"logout","onSuccess"),u(!1),qo.del(Fe),qo.del(re($e.id))},getAccessToken:()=>a.getCustomerAccessToken(),getEthereumProvider:()=>{if(!y||!y.wallet)return new Vl;let e=v.find((e=>y.wallet&&e.address===y.wallet.address)),t=a.connectors?.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return e&&t?t.proxyProvider:new Vl},getEthersProvider:()=>{if(!y||!y.wallet)return new i(new ql(new Vl));let e=v.find((e=>y.wallet&&e.address===y.wallet.address)),t=a.connectors?.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return new i(new ql(e&&t?t.proxyProvider:new Vl))},getWeb3jsProvider:()=>{if(!y||!y.wallet)return new Zl(new Vl);let e=v.find((e=>y.wallet&&e.address===y.wallet.address)),t=a.connectors?.walletConnectors.find((t=>t.wallets.find((t=>t.address===e?.address))));return new Zl(e&&t?t.proxyProvider:new Vl)},unlinkWallet:async e=>{let t;return w(t=e.startsWith("0x")?await a.unlinkEthereumWallet(e):await a.unlinkSolanaWallet(e)),t},unlinkEmail:async e=>{let t=await a.unlinkEmail(e);return w(t),t},unlinkPhone:async e=>{let t=await a.unlinkPhone(e);return w(t),t},unlinkGoogle:async e=>{let t=await a.unlinkOAuth("google",e);return w(t),t},unlinkTwitter:async e=>{let t=await a.unlinkOAuth("twitter",e);return w(t),t},unlinkDiscord:async e=>{let t=await a.unlinkOAuth("discord",e);return w(t),t},unlinkGithub:async e=>{let t=await a.unlinkOAuth("github",e);return w(t),t},unlinkSpotify:async e=>{let t=await a.unlinkOAuth("spotify",e);return w(t),t},unlinkInstagram:async e=>{let t=await a.unlinkOAuth("instagram",e);return w(t),t},unlinkTiktok:async e=>{let t=await a.unlinkOAuth("tiktok",e);return w(t),t},unlinkLinkedIn:async e=>{let t=await a.unlinkOAuth("linkedin",e);return w(t),t},unlinkApple:async e=>{let t=await a.unlinkOAuth("apple",e);return w(t),t},unlinkFarcaster:async e=>{let t=await a.unlinkFarcaster(e);return w(t),t},unlinkTelegram:async e=>{let t=await a.unlinkTelegram(e);return w(t),t},unlinkPasskey:async e=>{let t=await a.unlinkPasskey(e);return w(t),t},unlinkCrossAppAccount:async({subject:e})=>{let t=y?.linkedAccounts.find((t=>"cross_app"===t.type&&t.subject===e))?.providerApp;if(!t)throw new E("Invalid subject");a.storeProviderAccessToken(t.id,null);let r=await a.unlinkOAuth(`privy:${t.id}`,e);return w(r),r},setActiveWallet:async e=>{let t=v.find((t=>n(t.address)===n(e))),r=y?.linkedAccounts.find((t=>"wallet"===t.type&&n(t.address)===n(e)));if(t&&await t.isConnected())if(t.linked){let e=Object.assign({},y);e.wallet=r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,imported:r.imported,delegated:r.delegated,walletIndex:r.walletIndex},w(e)}else t.loginOrLink();else Ne({externalConnectWallet:{suggestedAddress:e}}),ht()},forkSession:()=>a.forkSession(),createWallet:async e=>{if(e&&"target"in e&&e&&(e=void 0),!f||!y)throw Qt(Ve,"createWallet","onError",T.MUST_BE_AUTHENTICATED),Error("User must be authenticated before creating a Privy wallet");return gt(y,15e3,e)},setWalletRecovery:async e=>At({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:e?.showAutomaticRecovery??!1}),setWalletPassword:async()=>At({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(e,t,r)=>new Promise((async(n,i)=>{let{requesterAppId:o}=t||{};if(!f||!y)return Qt(Ve,"signMessage","onError",T.MUST_BE_AUTHENTICATED),void i(Error("User must be authenticated before signing with a Privy wallet"));let l=r??U(y)?.address;if(!l)throw new E("User must have an embedded wallet to sign a message.");let{signingWallet:s,rootWallet:d}=K(y,l);if(!s||!d)return Qt(Ve,"signMessage","onError",T.EMBEDDED_WALLET_NOT_FOUND),void i(Error("Must have a Privy wallet before signing"));if("string"!=typeof e||e.length<1)return Qt(Ve,"signMessage","onError",T.INVALID_MESSAGE),void i(Error("Message must be a non-empty string"));xe(!0);let c=async()=>{if(!f)throw Error("User must be authenticated before signing with a Privy wallet");let t=await zC();if(!Ce||!t||!await kt.recoverPrimaryWallet())throw Error("Unable to connect to wallet");a.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:s.address,requesterAppId:o}});let{entropyId:r,entropyIdVerifier:n}=k(d),{response:i}=await Ce.rpc({accessToken:t,entropyId:r,entropyIdVerifier:n,chainType:"ethereum",hdWalletIndex:s.walletIndex??0,requesterAppId:o,request:{method:"personal_sign",params:[e,s.address]}}),l=i.data;return a.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:s.address,requesterAppId:o}}),l};if(Xe({showWalletUIs:t?.showWalletUIs}))try{let e=await c();Qt(Ve,"signMessage","onSuccess",e),n(e)}catch(e){Qt(Ve,"signMessage","onError",T.UNABLE_TO_SIGN),i(e??new Ht("Unable to sign message"))}else{let{entropyId:r,entropyIdVerifier:a}=k(d);Ne({signMessage:{method:"personal_sign",data:e,confirmAndSign:c,onSuccess:e=>{Qt(Ve,"signMessage","onSuccess",e),n(e)},onFailure:e=>{Qt(Ve,"signMessage","onError",T.UNABLE_TO_SIGN),i(e)},uiOptions:t||{}},connectWallet:{entropyId:r,entropyIdVerifier:a,onCompleteNavigateTo:We.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:e=>{Qt(Ve,"signMessage","onError",T.UNKNOWN_CONNECT_WALLET_ERROR),i(e)}}}),et(We.EMBEDDED_WALLET_CONNECTING_SCREEN)}})),signTypedData:(e,t,r)=>new Promise((async(n,i)=>{let{requesterAppId:o}=t||{};if(!f||!y)return Qt(Ve,"signTypedData","onError",T.MUST_BE_AUTHENTICATED),void i(Error("User must be authenticated before signing with a Privy wallet"));let l=r??U(y)?.address;if(!l)throw new E("User must have an embedded wallet to sign a message.");let{signingWallet:s,rootWallet:d}=K(y,l);if(!d||!s)return Qt(Ve,"signTypedData","onError",T.EMBEDDED_WALLET_NOT_FOUND),void i(Error("Must have a Privy wallet before signing"));xe(!0);let c=ge(e),u=async()=>{if(!f)throw Error("User must be authenticated before signing with a Privy wallet");let e=await zC();if(!Ce||!e||!await kt.recoverPrimaryWallet())throw Error("Unable to connect to wallet");a.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:s.address,requesterAppId:o}});let{entropyId:t,entropyIdVerifier:r}=k(d),{response:n}=await Ce.rpc({accessToken:e,entropyId:t,entropyIdVerifier:r,chainType:"ethereum",hdWalletIndex:s.walletIndex??0,requesterAppId:o,request:{method:"eth_signTypedData_v4",params:[s.address,c]}}),i=n.data;return a.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:s.address,requesterAppId:o}}),i};if(Xe({showWalletUIs:t?.showWalletUIs,typedData:!0}))try{let e=await u();Qt(Ve,"signTypedData","onSuccess",e),n(e)}catch(e){Qt(Ve,"signTypedData","onError",T.UNABLE_TO_SIGN),i(e??new Ht("Unable to sign message"))}else{let{entropyId:e,entropyIdVerifier:r}=k(d);Ne({signMessage:{method:"eth_signTypedData_v4",data:c,confirmAndSign:u,onSuccess:e=>{Qt(Ve,"signTypedData","onSuccess",e),n(e)},onFailure:e=>{Qt(Ve,"signTypedData","onError",T.UNABLE_TO_SIGN),i(e)},uiOptions:t||{}},connectWallet:{entropyId:e,entropyIdVerifier:r,onCompleteNavigateTo:We.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN,onFailure:e=>{Qt(Ve,"signMessage","onError",T.UNKNOWN_CONNECT_WALLET_ERROR),i(e)}}}),et(We.EMBEDDED_WALLET_CONNECTING_SCREEN)}})),sendTransaction:async(e,t,r,n)=>{let a=await Ct(e,t,r,n);return sv(await a.wait())},sendSolanaTransaction:async(e,t,r,n,a)=>await bt({transaction:e,connection:t,transactionOptions:n,uiOptions:r,fundWalletConfig:a,wallet:I??void 0}),exportWallet:e=>new Promise((async(t,n)=>{if(!f||!y)return void n(Error("User must be authenticated before exporting their Privy wallet"));e&&"target"in e&&e&&(e=void 0);let i=e?.address??U(y)?.address;if(!i)return void n(Error("User does not have an HD Ethereum wallet. To export an imported wallet, pass the `address` of the wallet to `exportWallet`."));let{signingWallet:o,rootWallet:l}=K(y,i);if(!o||!l)return void n(Error("Must have a Privy wallet before exporting"));xe(!0);let{entropyId:s,entropyIdVerifier:d}=k(l),c={entropyId:s,entropyIdVerifier:d,onCompleteNavigateTo:We.EMBEDDED_WALLET_KEY_EXPORT_SCREEN,onFailure:n,shouldForceMFA:!0};Ne(_e),await zC()&&Ce?Ce?(Ne({keyExport:{appId:r.appId,appClientId:r.clientId,origin:a.apiUrl,walletToExport:o,primaryWallet:l,onSuccess:t,onFailure:n},connectWallet:c}),et(We.EMBEDDED_WALLET_CONNECTING_SCREEN)):n(Error("Must have a Privy wallet before exporting")):n(Error("Must have valid access token to enroll in MFA"))})),promptMfa:Et,async init(e){switch(e){case"sms":return void await a.initMfaSmsVerification();case"passkey":return await a.initMfaPasskeyVerification();case"totp":return;default:throw Error(`Unsupported MFA method: ${e}`)}},async submit(e,t){switch(e){case"totp":case"sms":if("string"!=typeof t)throw new E("Invalid MFA code");Ge.current?.resolve({mfaMethod:e,mfaCode:t,relyingParty:window.origin}),await new Promise(((e,t)=>{He.current={resolve:e,reject:t}}));break;case"passkey":if("string"==typeof t)throw new E("Invalid authenticator response");let r=await import("@simplewebauthn/browser"),n=(e=>({id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}))(await r.startAuthentication(t));Ge.current?.resolve({mfaMethod:e,mfaCode:n,relyingParty:window.origin}),await new Promise(((e,t)=>{He.current={resolve:e,reject:t}}));break;default:throw Ge.current?.reject(new E("Unsupported MFA method")),new E(`Unsupported MFA method: ${e}`)}},cancel(){Ge.current?.reject(new E("MFA canceled"))},async initEnrollmentWithSms(e){let t=await zC();if(!t||!Ce)throw Error("Must have valid access token to enroll in MFA");await Ce.initEnrollMfa({method:"sms",accessToken:t,phoneNumber:e.phoneNumber})},enrollInMfa:e=>new Promise(((t,r)=>{if(!e)return kt.closePrivyModal(),void t();$e.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),Ne({mfaEnrollmentFlow:{mfaMethods:$e.mfa.methods,onSuccess:t,onFailure:r}}),et(We.MFA_ENROLLMENT_FLOW_SCREEN)})),async initEnrollmentWithTotp(){let e=await zC();if(!e||!Ce)throw Error("Must have valid access token to enroll in MFA");let t=await Ce.initEnrollMfa({method:"totp",accessToken:e});return{secret:t.secret,authUrl:t.authUrl}},async submitEnrollmentWithSms(e){let t=await zC();if(!t||!Ce)throw Error("Must have valid access token to enroll in MFA");await Ce.submitEnrollMfa({method:"sms",accessToken:t,phoneNumber:e.phoneNumber,code:e.mfaCode}),w(await a.getAuthenticatedUser())},async submitEnrollmentWithTotp(e){let t=await zC();if(!t||!Ce)throw Error("Must have valid access token to enroll in MFA");await Ce.submitEnrollMfa({method:"totp",accessToken:t,code:e.mfaCode}),w(await a.getAuthenticatedUser())},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:e}){let t=await zC();if(!t||!Ce)throw Error("Must have valid access token to enroll in MFA");await Ce.submitEnrollMfa({method:"passkey",accessToken:t,credentialIds:e}),w(await a.getAuthenticatedUser())},async unenroll(e){let t=await zC();if(!t||!Ce)throw Error("Must have valid access token to remove MFA");"passkey"===e?await Ce.submitEnrollMfa({method:"passkey",accessToken:t,credentialIds:[]}):await Ce.unenrollMfa({method:e,accessToken:t}),w(await a.getAuthenticatedUser())},requestFarcasterSignerFromWarpcast:async()=>{let e=await zC(),t=y?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!e)throw Error("Must have valid access token to connect with Farcaster");if(!Ce||!t)throw Error("Must have an embedded wallet to use Farcaster signers");if(!y?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await kt.recoverPrimaryWallet())throw Error("Unable to connect to wallet");let r=await Ce.initFarcasterSigner({address:t.address,hdWalletIndex:null,accessToken:e,mfaCode:null,mfaMethod:null,relyingParty:window.origin});"approved"===r.status&&w(await a.getAuthenticatedUser()||y||null),Ne({farcasterSigner:r}),et(We.AWAITING_FARCASTER_SIGNER)},getFarcasterSignerPublicKey:async()=>{let e,t=await zC(),r=y?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!t)throw Error("Must have valid access token to connect with Farcaster");if(!Ce||!r)throw Error("Must have an embedded wallet to use Farcaster signers");if(!y?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await kt.recoverPrimaryWallet())throw Error("Unable to connect to wallet");if(!y.farcaster?.signerPublicKey)throw Error("Must have a Farcaster signer public key to sign");return e=y.farcaster.signerPublicKey.slice(2),Uint8Array.from(e.match(/.{1,2}/g).map((e=>parseInt(e,16))))},signFarcasterMessage:async e=>{let t=await zC(),r=y?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!t)throw Error("Must have valid access token to connect with Farcaster");if(!Ce||!r)throw Error("Must have an embedded wallet to use Farcaster signers");if(!y?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await kt.recoverPrimaryWallet())throw Error("Unable to connect to wallet");if(!y.farcaster?.signerPublicKey)throw Error("Must have a Farcaster signer public key to sign");let n=await import("@simplewebauthn/browser"),a=await Ce.signFarcasterMessage({address:r.address,hdWalletIndex:null,accessToken:t,mfaCode:null,mfaMethod:null,payload:{hash:n.bufferToBase64URLString(e)},fid:BigInt(y.farcaster.fid),relyingParty:window.origin});return new Uint8Array(n.base64URLStringToBuffer(a.signature))},createGuestAccount:async()=>{if(y&&!y.isGuest)throw Error("User cannot already be authenticated to create a guest account");return y?.isGuest?y:kt.loginWithGuestAccountFlow()},signMessageWithCrossAppWallet(e,{address:t}){let r=y?.linkedAccounts.some((e=>"cross_app"===e.type&&e.smartWallets.some((e=>e.address===t))));return AC({user:y,client:a,address:t,requesterAppId:$e.id,request:{method:r?"privy_signSmartWalletMessage":"personal_sign",params:[e,t]},reconnect:xt})},signTypedDataWithCrossAppWallet(e,{address:t}){let r=y?.linkedAccounts.some((e=>"cross_app"===e.type&&e.smartWallets.some((e=>e.address===t)))),n=ge(e);return AC({user:y,client:a,address:t,requesterAppId:$e.id,request:{method:r?"privy_signSmartWalletTypedData":"eth_signTypedData_v4",params:[t,n]},reconnect:xt})},sendTransactionWithCrossAppWallet(e,{address:t}){let r=y?.linkedAccounts.some((e=>"cross_app"===e.type&&e.smartWallets.some((e=>e.address===t))));return AC({user:y,client:a,address:t,requesterAppId:$e.id,request:{method:r?"privy_sendSmartWalletTx":"eth_sendTransaction",params:[e]},reconnect:xt})},isModalOpen:l,mfaMethods:$e.mfa.methods};LC=_t.signMessage,DC=_t.signTypedData,FC=async(...e)=>{let t=await Ct(...e);return $e.embeddedWallets.waitForTransactionConfirmation&&await t.wait(),t};let kt={isNewUserThisSession:M,pendingTransaction:null,walletConnectionStatus:ee,connectors:a.connectors?.walletConnectors??[],solanaWallets:N,rpcConfig:$e.rpcConfig,chains:$e.chains,appId:r.appId,showFiatPrices:"native-token"!==$e.embeddedWallets.priceDisplay.primary,clientAnalyticsId:a.clientAnalyticsId,customAuthStatus:je,noPromptOnSignature:Je,emailOtpState:se,setEmailOtpState:ce,smsOtpState:ue,setSmsOtpState:he,oAuthState:we,setOAuthState:ve,siweState:pe,setSiweState:ye,isHeadlessOAuthLoading:z,nativeTokenSymbolForChainId:e=>$e.chains.find((t=>t.id===Number(e)))?.nativeCurrency.symbol,initializeWalletProxy:async e=>{if(Ce)return Ce;let t=new Promise((e=>{Pe((()=>t=>e(t)))})),r=new Promise((t=>setTimeout((()=>t(null)),e))),n=await Promise.race([t,r]);return Pe(null),n},getAuthFlow:()=>a.authFlow,getAuthMeta:()=>a.authFlow?.meta,client:a,closePrivyModal:async(e={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let t,n=h&&f&&y;n&&Ye.current&&(t=$t(y)),"login"===Qe.current?e.shouldCallAuthOnSuccess&&n&&Ye.current?(Qt(Ve,"login","onComplete",y,M,!1,Ye.current,t??null),r.onSuccess?.(y,M)):Qt(Ve,"login","onError",T.USER_EXITED_AUTH_FLOW):"link"===Qe.current&&t?e.isSuccess&&n&&Ye.current?Qt(Ve,"linkAccount","onSuccess",y,Ye.current,t):Ye.current&&Qt(Ve,"linkAccount","onError",T.USER_EXITED_LINK_FLOW,{linkMethod:Ye.current}):"update"===Qe.current&&t&&(e.isSuccess&&n&&Ye.current?Qt(Ve,"update","onSuccess",y,Ye.current,t):Ye.current&&Qt(Ve,"update","onError",T.USER_EXITED_UPDATE_FLOW,{linkMethod:Ye.current}));let i=F&&OC.includes(F),o=F===We.ERROR_SCREEN&&_e.errorModalData&&OC.includes(_e.errorModalData.previousScreen);if((i||o)&&_e.funding){let e,t=PC[F]??null;if("solana"===_e.funding.chainType){let{Connection:r,PublicKey:n}=await import("@solana/web3.js");try{e=await new r(dt(_e.funding.cluster)).getBalance(new n(_e.funding.address)).then((e=>BigInt(e)))}catch{console.error("Unable to pull wallet balance")}Qt(Ve,"fundSolanaWallet","onUserExited",{address:_e.funding.address,cluster:_e.funding.cluster,fundingMethod:t,balance:e})}else{let n=fe(_e.funding.chain.id,$e.chains,$e.rpcConfig,{appId:r.appId});try{e=(await n.getBalance(_e.funding.address)).toBigInt()}catch{console.error("Unable to pull wallet balance")}Qt(Ve,"fundWallet","onUserExited",{address:_e.funding.address,chain:_e.funding.chain,fundingMethod:t,balance:e})}}Ne({..._e,externalConnectWallet:{suggestedAddress:void 0}}),Qe.current=null,Ye.current=null,L(!1),u(!1),setTimeout((()=>{a.authFlow=void 0}),200),a.createAnalyticsEvent({eventName:"modal_closed"})},solanaSignMessage:async({message:e})=>new Promise((async(t,r)=>{let n=async()=>{let t=await a.getAccessToken();if(!t)throw Error("User must be authenticated to use their embedded wallet.");if(!I)throw Error("User must have an embedded Solana wallet to sign messages for Solana.");let r=kt.walletProxy??await kt.initializeWalletProxy(15e3);if(!r)throw Error("Failed to initialize embedded wallet proxy.");let{entropyId:n,entropyIdVerifier:i}=V(y),{response:o}=await r.rpc({accessToken:t,entropyId:n,entropyIdVerifier:i,chainType:"solana",hdWalletIndex:I.walletIndex??0,request:{method:"signMessage",params:{message:e}}});return o.data.signature};if(Xe({showWalletUIs:void 0}))try{let e=await n();t({signature:e})}catch(e){r(e)}else Ne({signMessage:{method:"solana_signMessage",data:e,confirmAndSign:n,onSuccess:e=>{t({signature:e})},onFailure:e=>{r(e)},uiOptions:{}}}),tt(We.EMBEDDED_WALLET_SIGN_REQUEST_SCREEN)})),openPrivyModal:et,connectWallet:ot,initLoginWithWallet:async(e,t,r)=>{zl(e)?(Ye.current="siwe",lt(e,t,r)):(Ye.current="siws",st(e,t))},loginWithWallet:async()=>{let e,t,r;if(!h)throw new Y;if(a.authFlow instanceof gl?e="siwe":a.authFlow instanceof Ol&&(e="siws"),!e)throw new E("Must initialize SIWE/SIWS flow first.");if(null!==await a.getAccessToken())try{({user:t}=await a.link()),Ye.current=e}catch(t){throw Qt(Ve,"linkAccount","onError",t.privyErrorCode||T.FAILED_TO_LINK_ACCOUNT,{linkMethod:e}),t}else try{({user:t,isNewUser:r}=await a.authenticate()),Ye.current=e}catch(e){throw Qt(Ve,"login","onError",e.privyErrorCode||T.GENERIC_CONNECT_WALLET_ERROR),e}w(t||y||null),L(r||!1),g(!0)},delegateWallet:async({address:e,chainType:t})=>new Promise((async(r,n)=>{let a=await zC();if(!f||!y||!a)throw new E("User must be authenticated and have an embedded wallet to delegate actions.");if("solana"!==t&&"ethereum"!==t)throw new E("Only Solana and Ethereum embedded wallets are supported for delegation and revocation.");let i=kt.walletProxy??await kt.initializeWalletProxy(15e3);if(!i)throw new E("Wallet proxy not initialized.");if((({address:e,chainType:t,user:r})=>!!wC(r).find((r=>r.address===e&&r.chainType===t)))({address:e,chainType:t,user:y}))throw new E(`Wallet with address ${e} is already delegated.`);let o=(({address:e,user:t})=>{let r=t.linkedAccounts.find((t=>"wallet"===t.type&&"privy"===t.walletClientType&&t.address===e));if(!r)throw new E("Address to delegate is not associated with current user.");return{address:r.address,chainType:r.chainType,walletIndex:r.walletIndex??0}})({address:e,user:y}),l=(({address:e,user:t})=>{let r,n=t.linkedAccounts.find((t=>"wallet"===t.type&&"privy"===t.walletClientType&&t.address===e));if(!n)throw new E("Address to delegate is not associated with current user.");if(!(r="ethereum"===n.chainType?n.imported?H(t):U(t):n))throw new E("Unable to determine root address for delegated address.");return{address:r.address,chainType:r.chainType,imported:r.imported}})({address:e,user:y});await kt.recoverPrimaryWallet(),Ne({delegatedActions:{consent:{address:e,onDelegate:async()=>{await i.createDelegatedAction({accessToken:a,rootWallet:l,delegatedWallets:[o]}),await kt.refreshUser()},onSuccess:async()=>{r()},onError:async e=>{n(e)}}}}),et(We.EMBEDDED_WALLET_DELEGATED_ACTIONS_CONSENT_SCREEN)})),revokeDelegatedWallets:async()=>new Promise((async(e,t)=>{if(!f||!y)throw new E("User must be authenticated and have an embedded wallet to revoke a delegated wallet.");if(0===wC(y).length)throw new E("User has no delegated wallets to revoke.");Ne({delegatedActions:{revoke:{onRevoke:async()=>{await a.revokeDelegatedWallet(),await kt.refreshUser()},onSuccess:async()=>{e()},onError:async e=>{t(e)}}}}),et(We.EMBEDDED_WALLET_DELEGATED_ACTIONS_REVOKE_SCREEN)})),initLoginWithFarcaster:async(e,t)=>{let r=new Sl(e,t);a.startAuthFlow(r);try{Ye.current="farcaster",await r.initializeFarcasterConnect()}catch(e){throw"login"===Qe.current?Qt(Ve,"login","onError",e.privyErrorCode||T.UNKNOWN_AUTH_ERROR):"link"===Qe.current&&Qt(Ve,"linkAccount","onError",e.privyErrorCode||T.UNKNOWN_AUTH_ERROR,{linkMethod:"farcaster"}),e}},loginWithFarcaster:async()=>{let e,t;if(!h)throw new Y;if(!(a.authFlow instanceof Sl))throw new E("Must initialize Farcaster flow first.");if(null!==await a.getAccessToken())try{({user:e}=await a.link()),Ye.current="farcaster"}catch(e){throw Qt(Ve,"linkAccount","onError",e.privyErrorCode||T.FAILED_TO_LINK_ACCOUNT,{linkMethod:"farcaster"}),e}else try{({user:e,isNewUser:t}=await a.authenticate()),Ye.current="farcaster"}catch(e){throw Qt(Ve,"login","onError",e.privyErrorCode||T.UNKNOWN_AUTH_ERROR),e}w(e||null),L(t||!1),g(!0)},async loginWithGuestAccountFlow(){let e=new Zo(this.appId);a.startAuthFlow(e);try{Qe.current="login",Ye.current="guest";let{user:e,isNewUser:t}=await a.authenticate();if(t=t||!1,!e)throw new E("Unable to authenticate guest account");if(R(e,$e.embeddedWallets.createOnLogin))try{await gt(e,15e3),e=await kt.refreshUser()}catch(t){w(e),console.warn("Unable to create embedded wallet for guest account")}else w(e);return L(t),g(!0),Qt(Ve,"login","onComplete",e,t,!1,"guest",null),e}catch(e){throw Qt(Ve,"login","onError",e.privyErrorCode||T.UNKNOWN_AUTH_ERROR),e}},async crossAppAuthFlow({appId:e,popup:t,action:r}){let n=`privy:${e}`;Ye.current=n;let{url:i,stateCode:o,codeVerifier:l}=await async function({api:e,appId:t}){let r=Ko(),n=Yo(),a=await Qo(r);try{let{url:i}=await e.post(Uo,{provider:`privy:${t}`,redirect_to:window.location.href,code_challenge:a,state_code:n});return{url:i,stateCode:n,codeVerifier:r}}catch(e){throw $(e)}}({api:a.api,appId:e});if(!i)throw a.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:e}}),new E("No authorization URL returned for cross-app auth.");try{let s=await async function({url:e,popup:t}){return t.location=e,new Promise(((e,r)=>{let n,a=setTimeout((()=>{r(new E("Authorization request timed out after 2 minutes.")),i()}),12e4);function i(){t?.close(),window.removeEventListener("message",l)}let o=setInterval((()=>{t?.closed&&!n&&(i(),clearInterval(o),clearTimeout(a),r(new E("User rejected request")))}),300);function l(t){t.data&&("PRIVY_OAUTH_RESPONSE"===t.data.type&&t.data.stateCode&&t.data.authorizationCode&&(clearTimeout(a),e(t.data),i()),"PRIVY_OAUTH_ERROR"===t.data.type&&(clearTimeout(a),r(new E(t.data.error)),i()),t.data.type===EC&&((n=new BroadcastChannel(bC)).onmessage=l))}window.addEventListener("message",l)}))}({url:i,popup:t,provider:n}),d=s.stateCode,c=s.authorizationCode;if(d!==o)throw a.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:n,storedStateCode:o??"",returnedStateCode:d??""}}),new E("Unexpected auth flow. This may be a phishing attempt.",void 0,T.OAUTH_UNEXPECTED);let u=await async function({appId:e,stateCode:t,codeVerifier:r,authorizationCode:n,action:a,client:i}){if(!n||!t)throw new E("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if("undefined"===n)throw new E("User denied confirmation during cross-app auth flow");try{let o=new $C({authorizationCode:n,stateCode:t,codeVerifier:r,provider:`privy:${e}`});i.startAuthFlow(o);let l="link"===a?await i.link():await i.authenticate(),s=l.oAuthTokens?.accessToken;return console.debug(),s}catch(e){let t=$(e);if(t.privyErrorCode)throw new E(t.message||"Invalid code during cross-app auth flow.",void 0,t.privyErrorCode);if("User denied confirmation during cross-app auth flow"===t.message)throw new E("Invalid code during cross-app auth flow.",void 0,T.OAUTH_USER_DENIED);throw new E("Invalid code during cross-app auth flow.",void 0,T.UNKNOWN_AUTH_ERROR)}}({appId:e,codeVerifier:l,stateCode:d,authorizationCode:c,action:r,client:a});u&&a.storeProviderAccessToken(e,u);let h=await kt.refreshUser();if(!h)throw new E("Unable to update user");return a.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{providerAppId:e}}),h}catch(e){throw a.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:e.toString(),provider:n}}),e}},async initLoginWithOAuth(e,t,r){if(Ye.current=e,!Vo())return void tt(We.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE);if("google"===e&&nu(window.navigator.userAgent))return void tt(We.IN_APP_BROWSER_LOGIN_NOT_POSSIBLE);"twitter"===e&&window.opener&&window.opener.postMessage({type:EC},"*"),qo.del(ae),qo.del(ie);let n=new Jo({provider:e,disableSignup:!!r,withPrivyUi:!0});t&&n.addCaptchaToken(t),a.startAuthFlow(n);let i=await a.authFlow.getAuthorizationUrl();i&&i.url&&("twitter"===e&&b&&(i.url=i.url.replace("x.com","twitter.com")),window.location.assign(i.url))},async initLoginWithTelegram(e,t){if(!h)throw new Y;Ye.current="telegram";let r=new Dl(e,t);a.startAuthFlow(r),r.meta.telegramWebAppData=void 0,r.meta.telegramAuthResult=await new Promise(((e,t)=>$e.loginConfig.telegramAuthConfiguration?window.Telegram?void window.Telegram.Login.auth({bot_id:$e.loginConfig.telegramAuthConfiguration.botId,request_access:!0},(r=>r?e(r):t(new E("Telegram auth failed or was canceled by the client")))):t(new E("Telegram was not initialized")):t(new E("Telegram Auth configuration is not loaded"))))},async loginWithTelegram(e){let t,r;if(!(a.authFlow instanceof Dl))throw new E("Must initialize Telegram flow before calling loginWithTelegram");if(a.authFlow.meta.captchaToken||=e,"login"===Qe.current)try{let e=await a.authenticate();t=e.user,r=e.isNewUser,Ye.current="telegram"}catch(e){throw Qt(Ve,"login","onError",e.privyErrorCode||T.UNKNOWN_AUTH_ERROR),e}else{if("link"!==Qe.current)throw new E("Unknown auth intent");try{t=(await a.link()).user,Ye.current="telegram"}catch(e){throw Qt(Ve,"linkAccount","onError",e.privyErrorCode||T.FAILED_TO_LINK_ACCOUNT,{linkMethod:"telegram"}),e}}w(t),L(r||!1),g(!0)},async recoveryOAuthFlow(e,t,r){let n,i;function o(t){if(!t)throw a.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:e}}),new E("Recovery OAuth failed")}switch(e){case"google-drive":{let t,l,{url:s,codeVerifier:d,stateCode:c}=await th({api:RC.api,provider:e});o(s);try{let n=await MC({url:s,popup:r,provider:e});if(t=n.stateCode,l=n.authorizationCode,t!==c)throw a.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e,storedStateCode:c??"",returnedStateCode:t??""}}),new E("Unexpected auth flow. This may be a phishing attempt.",void 0,T.OAUTH_UNEXPECTED)}catch(t){throw a.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:t.toString(),provider:e}}),new E("Recovery OAuth failed")}[n,i]=await Promise.all([zC(),rh({api:RC.api,provider:e,codeVerifier:d,stateCode:t,authorizationCode:l})]);break}case"icloud":{let{url:t}=await th({api:RC.api,provider:e});o(t);let{ckWebAuthToken:a}=await MC({url:t,popup:r,provider:e});i=a,n=await zC()}}if(!Ce)throw new E("Cannot connect to wallet proxy");if(!n)throw new E("Unable to authorize user");switch(t){case"recover":{let t=_e.recoverWallet?.entropyId,r=_e.recoverWallet?.entropyIdVerifier;if(!t||!r)throw new E("Recovery OAuth failed");a.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:t,recoveryMethod:e}}),await Ce.recover({accessToken:n,entropyId:t,entropyIdVerifier:r,recoveryAccessToken:i}),a.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:t,recoveryMethod:e}});break}case"create-wallet":{a.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await Ce.create({accessToken:n,recoveryAccessToken:i,recoveryMethod:e});let t=U(await kt.refreshUser());if(!t)throw Qt(Ve,"createWallet","onError",T.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");a.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:t.address}}),Qt(Ve,"createWallet","onSuccess",t);break}case"set-recovery":{let t=j(y);if(!t)throw Qt(Ve,"setWalletRecovery","onError",T.EMBEDDED_WALLET_NOT_FOUND),Error("Embedded wallet not found");a.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:t.address,existingRecoveryMethod:t.recoveryMethod,targetRecoveryMethod:e}});let{entropyId:r,entropyIdVerifier:o}=k(t);await Ce.setRecovery({accessToken:n,entropyId:r,entropyIdVerifier:o,recoveryMethod:e,recoveryAccessToken:i});let l=j(await kt.refreshUser());if(!l)throw Qt(Ve,"createWallet","onError",T.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to set recovery on wallet");a.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:t.address,existingRecoveryMethod:t.recoveryMethod,targetRecoveryMethod:e}}),Qt(Ve,"setWalletRecovery","onSuccess",e,l);break}default:throw new E("Unsupported recovery action")}},async loginWithOAuth(e){let t,r,n;if(!(a.authFlow instanceof Jo))throw new E("Must initialize OAuth flow before calling loginWithOAuth");let i=qo.get(oe),o=a.authFlow.meta.stateCode;if(i!==o)throw a.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e,storedStateCode:i??"",returnedStateCode:o??""}}),new E("Unexpected auth flow. This may be a phishing attempt.",void 0,T.OAUTH_UNEXPECTED);if(null!==await a.getAccessToken())try{let r=await a.link();t=r.user,n=r.oAuthTokens,Ye.current=e}catch(t){throw Qt(Ve,"linkAccount","onError",t.privyErrorCode||T.FAILED_TO_LINK_ACCOUNT,{linkMethod:e}),t}else try{let i=await a.authenticate();t=i.user,r=i.isNewUser,n=i.oAuthTokens,Ye.current=e}catch(t){throw"login"===Qe.current?Qt(Ve,"login","onError",t.privyErrorCode||T.UNKNOWN_AUTH_ERROR):"link"===Qe.current&&Qt(Ve,"linkAccount","onError",t.privyErrorCode||T.FAILED_TO_LINK_ACCOUNT,{linkMethod:e}),t}return w(t),L(r||!1),g(!0),n&&t&&Qt(Ve,"oAuthAuthorization","onOAuthTokenGrant",n,{user:t}),n},passkeyAuthState:ne,setPasskeyAuthState:le,async initLoginWithPasskey({captchaToken:e,withPrivyUi:t}){let r=new Il({captchaToken:e,setPasskeyAuthState:le});a.startAuthFlow(r),Qe.current="login";try{Ye.current="passkey",le({status:"generating-challenge"}),await r.initAuthenticationFlow(t),le({status:"awaiting-passkey"})}catch(e){throw le({status:"error",error:e}),Qt(Ve,"login","onError",e.privyErrorCode||T.UNKNOWN_AUTH_ERROR),e}},async loginWithPasskey(){let e,t;if(!h)throw new Y;if(!(a.authFlow instanceof Il))throw new E("Must initialize Passkey flow first.");if("passkey"!==Ye.current){let e=new E("Must init login with Passkey flow first.");throw le({status:"error",error:e}),e}let r=await zC();try{Ye.current="passkey",le({status:"awaiting-passkey"}),({user:e,isNewUser:t}=await a.authenticate())}catch(e){throw le({status:"error",error:e}),Qt(Ve,"login","onError",e.privyErrorCode||T.UNKNOWN_AUTH_ERROR),e}w(e),L(t||!1),g(!0),le({status:"done"});let n=e?.linkedAccounts.find((({type:e})=>"passkey"===e))||null;return{user:e,isNewUser:t||!1,wasAlreadyAuthenticated:!!r,loginAccount:n}},async initLinkWithPasskey(e){let t=new Il({captchaToken:e});a.startAuthFlow(t),Qe.current="link",Ye.current="passkey",le({status:"generating-challenge"});try{await t.initLinkFlow(),le({status:"awaiting-passkey"})}catch(e){throw Qt(Ve,"linkAccount","onError",e.privyErrorCode||T.UNKNOWN_AUTH_ERROR,{linkMethod:"passkey"}),le({status:"error",error:e}),e}},async linkWithPasskey(){let e;if(!h)throw new Y;if(!(a.authFlow instanceof Il))throw new E("Must initialize Passkey flow first.");if("passkey"!==Ye.current)throw new E("Must init login with Passkey flow first.");try{Ye.current="passkey",({user:e}=await a.link())}catch(e){throw Qt(Ve,"linkAccount","onError",e.privyErrorCode||T.FAILED_TO_LINK_ACCOUNT,{linkMethod:"passkey"}),e}return w(e||y||null),le({status:"done"}),e},async initLoginWithHeadlessOAuth(e,t,r){if(!Vo())throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");if("google"===e&&nu(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let n=new Jo({provider:e,withPrivyUi:!1,disableSignup:r??!1});t&&n.addCaptchaToken(t),ve({status:"loading"});let i=await a.startAuthFlow(n).getAuthorizationUrl();i?.url&&window.location.assign(i.url)},async loginWithHeadlessOAuth(e){let t,r,n;G(!0),ve({status:"loading"}),a.startAuthFlow(new Jo(e));let i=qo.get(oe),o=e.stateCode;if(i!==o)throw a.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e.provider,storedStateCode:i??"",returnedStateCode:o??""}}),G(!1),new E("Unexpected auth flow. This may be a phishing attempt.",void 0,T.OAUTH_UNEXPECTED);if(null!==await a.getAccessToken())try{({user:t,oAuthTokens:n}=await a.link()),Ye.current=e.provider;let r=$t(t);t&&r&&Qt(Ve,"linkAccount","onSuccess",t,Ye.current,r)}catch(t){throw G(!1),Qt(Ve,"linkAccount","onError",t.privyErrorCode||T.FAILED_TO_LINK_ACCOUNT,{linkMethod:e.provider}),t}else try{({user:t,isNewUser:r,oAuthTokens:n}=await a.authenticate()),Ye.current=e.provider;let i=$t(t);t&&i&&void 0!==r&&Qt(Ve,"login","onComplete",t,r,!1,Ye.current,i)}catch(e){throw G(!1),ve({status:"error",error:e}),Qt(Ve,"login","onError",e.privyErrorCode||T.UNKNOWN_AUTH_ERROR),e}return w(t),L(r||!1),g(!0),G(!1),ve({status:"done"}),n&&t&&Qt(Ve,"oAuthAuthorization","onOAuthTokenGrant",n,{user:t}),t??void 0},initLoginWithEmail:async({email:e,captchaToken:t,disableSignup:r,withPrivyUi:n})=>{let i=new Cl({email:e,captchaToken:t,disableSignup:r});a.startAuthFlow(i);try{Ye.current="email",ce({status:"sending-code"}),await i.sendCodeEmail({withPrivyUi:n}),ce({status:"awaiting-code-input"})}catch(e){throw ce({status:"error",error:e}),"login"===Qe.current?Qt(Ve,"login","onError",e.privyErrorCode||T.UNKNOWN_AUTH_ERROR):"link"===Qe.current&&Qt(Ve,"linkAccount","onError",e.privyErrorCode||T.FAILED_TO_LINK_ACCOUNT,{linkMethod:"email"}),e}},initUpdateEmail:async(e,t,r)=>{let n=new bl(e,t,r);a.startAuthFlow(n);try{await n.sendCodeEmail({withPrivyUi:!0})}catch(e){Qt(Ve,"update","onError",e.privyErrorCode||T.UNKNOWN_AUTH_ERROR,{linkMethod:Ye.current})}},initUpdatePhone:async(e,t,r)=>{let n=new wl(e,t,r);a.startAuthFlow(n);try{await n.sendSmsCode({withPrivyUi:!0})}catch(e){Qt(Ve,"update","onError",e.privyErrorCode||T.UNKNOWN_AUTH_ERROR,{linkMethod:Ye.current})}},initLoginWithSms:async({phoneNumber:e,captchaToken:t,disableSignup:r,withPrivyUi:n})=>{he({status:"sending-code"});let i=new yl({phoneNumber:e,captchaToken:t,disableSignup:r});a.startAuthFlow(i);try{Ye.current="sms",await i.sendSmsCode({withPrivyUi:n}),he({status:"awaiting-code-input"})}catch(e){throw he({status:"error",error:e}),"login"===Qe.current?Qt(Ve,"login","onError",e.privyErrorCode||T.UNKNOWN_AUTH_ERROR):"link"===Qe.current&&Qt(Ve,"linkAccount","onError",e.privyErrorCode||T.FAILED_TO_LINK_ACCOUNT,{linkMethod:"sms"}),e}},resendEmailCode:async()=>{await(a.authFlow?.sendCodeEmail({withPrivyUi:!0}))},resendSmsCode:async()=>{await(a.authFlow?.sendSmsCode({withPrivyUi:!0}))},loginWithCode:async e=>{let t,r;function n(e){a.authFlow instanceof Cl?ce(e):a.authFlow instanceof yl&&he(e)}if(n({status:"submitting-code"}),!h){let e=new Y;throw n({status:"error",error:e}),e}if(a.authFlow instanceof Cl)a.authFlow.meta.emailCode=e.trim();else{if(!(a.authFlow instanceof yl)){let e=new E("Must initialize a passwordless code flow first");throw n({status:"error",error:e}),e}a.authFlow.meta.smsCode=e.trim()}let i=await zC();if("link"===Qe.current)try{({user:t}=await a.link())}catch(e){throw n({status:"error",error:e}),Qt(Ve,"linkAccount","onError",e.privyErrorCode||T.FAILED_TO_LINK_ACCOUNT,{linkMethod:Ye.current}),e}else if("update"===Qe.current)try{({user:t}=await a.link())}catch(e){throw n({status:"error",error:e}),Qt(Ve,"update","onError",e.privyErrorCode||T.FAILED_TO_UPDATE_ACCOUNT,{linkMethod:Ye.current}),e}else try{({user:t,isNewUser:r}=await a.authenticate())}catch(e){throw n({status:"error",error:e}),Qt(Ve,"login","onError",e.privyErrorCode||T.UNKNOWN_AUTH_ERROR),e}let o=t||y;w(o||null),L(r||!1),g(!0),n({status:"done"});let l=null;return a.authFlow instanceof Cl?l=o?.linkedAccounts.find((({type:e})=>"email"===e))||null:a.authFlow instanceof yl&&(l=o?.linkedAccounts.find((({type:e})=>"phone"===e))||null),{user:o,isNewUser:r||!1,wasAlreadyAuthenticated:!!i,linkedAccount:l}},generateSiweMessage:async({address:e,chainId:t,captchaToken:r})=>{Qe.current="link",Ye.current="siwe",ye({status:"generating-message"});let n=await a.generateSiweNonce({address:e,captchaToken:r});return ye({status:"awaiting-signature"}),fl({address:e,chainId:t.replace("eip155:",""),nonce:n})},generateSiweMessageForSmartWallet:async({address:e,chainId:t})=>{let r=await a.generateSiweNonce({address:e});return fl({address:e,chainId:t.replace("eip155:",""),nonce:r})},linkSmartWallet:async({message:e,signature:t,smartWalletType:r})=>{let n;try{n=await a.linkSmartWallet({message:e,signature:t,smartWalletType:r}),n=await kt.refreshUser()??n}catch(e){throw e}w(n||y||null)},linkWithSiwe:async({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i})=>{let o;ut("siwe");let l=null;try{ye({status:"submitting-signature"}),o=await a.linkWithSiwe({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i}),o=await kt.refreshUser()??o,ye({status:"done"}),(l=$t(o)||null)&&Qt(Ve,"linkAccount","onSuccess",o,"siwe",l)}catch(e){throw Qt(Ve,"linkAccount","onError",e.privyErrorCode||T.FAILED_TO_LINK_ACCOUNT,{linkMethod:"siwe"}),Qe.current=null,Ye.current=null,ye({status:"error",error:e}),e}let s=o||y;return w(s||null),Qe.current=null,Ye.current=null,{user:s,linkedAccount:l}},refreshUser:async()=>{let e=await a.getAuthenticatedUser();return g(!!e),w(e),e},walletProxy:Ce,createAnalyticsEvent:({eventName:e,payload:t,timestamp:r})=>a.createAnalyticsEvent({eventName:e,payload:t,timestamp:r}),acceptTerms:async()=>{let e=await a.acceptTerms();return w(e),e},getUsdTokenPrice:e=>a.getUsdTokenPrice(e),getUsdPriceForSol:()=>a.getUsdPriceForSol(),recoverPrimaryWallet:async e=>new Promise((async(t,r)=>{let n=j(e?.user??y)||H(e?.user??y),i=await zC();if(!i||!Ce||!n)return void r(Error("Must have valid access token and Privy wallet to recover wallet"));xe(!0);let{entropyId:o,entropyIdVerifier:l}=k(n);try{await Ce.connect({accessToken:i,entropyId:o,entropyIdVerifier:l}),t(!0)}catch(e){Vu(e)&&"privy"===n.recoveryMethod?(a.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:n.address}}),(await Ce.recover({entropyId:o,entropyIdVerifier:l,accessToken:i})).entropyId||r(Error("Unable to recover wallet")),a.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:n.address}}),t(!0)):Vu(e)&&"privy"!==n.recoveryMethod?(Ne({recoverWallet:{entropyId:o,entropyIdVerifier:l,onFailure:r,onSuccess:()=>t(!0)},recoveryOAuthStatus:{provider:n.recoveryMethod,action:"recover"}}),et(eh(n.recoveryMethod))):r(e)}})),embeddedSolanaWallet:I,createEmbeddedSolanaWallet:async()=>{xe(!0);let e=await zC(),t=await kt.refreshUser(),r=W(t),n=U(t);if(!t||!e)throw new E("User must be logged in to create a Solana wallet");if(r)throw new E("User already has an embedded Solana wallet.");n&&await kt.recoverPrimaryWallet({user:t});let i=await kt.initializeWalletProxy(15e3);if(!i)throw new E("Unable to initialize wallet proxy");a.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_started"});try{await i.createSolana({accessToken:e,ethereumAddress:n?.address});let t=await kt.refreshUser(),r=W(t);if(!r)throw new E("Could not get Solana wallet for user");return a.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_completed",payload:{walletAddress:r.address}}),r}catch(e){throw a.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_failed"}),new E("Failed to create Solana embedded wallet with error ",e)}},exportSolanaWallet:e=>new Promise((async(t,n)=>{if(!f||!y)return void n(Error("User must be authenticated before exporting their Privy wallet"));let i=e?.address??W(y)?.address;if(!i)return void n(Error("User does not have an HD Solana wallet."));let{signingWallet:o,rootWallet:l}=Q(y,i);if(!o||!l)return void n(Error("Must have a Privy wallet before exporting"));if(xe(!0),!await zC()||!Ce)return void n(Error("Must have valid access token to enroll in MFA"));if(!Ce)return void n(Error("Must have a Privy wallet before exporting"));let{entropyId:s,entropyIdVerifier:d}=k(l);Ne({connectWallet:{entropyId:s,entropyIdVerifier:d,onCompleteNavigateTo:We.EMBEDDED_WALLET_KEY_EXPORT_SCREEN,onFailure:n,shouldForceMFA:!0},keyExport:{appId:r.appId,appClientId:r.clientId,origin:a.apiUrl,walletToExport:o,primaryWallet:l,onSuccess:t,onFailure:n}}),et(We.EMBEDDED_WALLET_CONNECTING_SCREEN)})),setReadyToTrue:e=>{m(!0),Se?.(e)},updateWallets:()=>ft(),fundWallet:async(e,t)=>{let r=We.FUNDING_METHOD_SELECTION_SCREEN;Ne({funding:SC({address:e,appConfig:$e,fundWalletConfig:t,methodScreen:r})}),et(r)},fundSolanaWallet:async(e,t)=>{let r=We.FUNDING_METHOD_SELECTION_SCREEN;Ne({funding:IC({address:e,appConfig:$e,fundWalletConfig:t,methodScreen:r})}),et(r)},requestFarcasterSignerStatus:async e=>{let t=await zC(),r=y?.linkedAccounts.find((e=>"wallet"===e.type&&"privy"===e.walletClientType));if(!t)throw Error("Must have valid access token to connect with Farcaster");if(!Ce||!r)throw Error("Must have an embedded wallet to use Farcaster signers");if(!y?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");let n=await a.requestFarcasterSignerStatus(e);return"approved"===n.status&&w(await a.getAuthenticatedUser()||y||null),n},connectCoinbaseSmartWallet:async()=>{$e.externalWallets.coinbaseWallet.connectionOptions="smartWalletOnly";let e=a.connectors?.findWalletConnector("coinbase_wallet","coinbase_smart_wallet")||a.connectors?.findWalletConnector("coinbase_wallet","coinbase_wallet");if(e)return e.updateConnectionPreference("smartWalletOnly"),ot(e);await it("coinbase_wallet","coinbase_smart_wallet")},initiateAccountTransfer:async({nonce:e,account:t,accountType:r,externalWalletMetadata:n,telegramAuthResult:i,farcasterEmbeddedAddress:o,oAuthUserInfo:l})=>{try{let s=await a.sendAccountTransferRequest({nonce:e,account:t,accountType:r,externalWalletMetadata:n,telegramAuthResult:i,farcasterEmbeddedAddress:o,oAuthUserInfo:l});return w(s),s}catch(e){throw e}}};UC=kt.recoverPrimaryWallet,WC=kt.recoverPrimaryWallet,BC=kt.solanaSignMessage;let Nt=c((()=>({wallets:v,ready:Me&&Ze})),[v,Me,Ze]),St=a.authFlow instanceof Dl,Pt=!$e.headless&&$e.captchaEnabled&&!f&&(h||St);return t(D.Provider,{value:_t,children:t(Jt.Provider,{value:Ve,children:t(J.Provider,{value:Nt,children:t(Rl,{...$e,children:e(X.Provider,{value:kt,children:[t(iu,{children:e(Ot,{data:_e,setModalData:Ne,setInitialScreen:B,initialScreen:F,authenticated:f,open:l,children:[r.children,Pt&&t(Ls,{delayedExecution:!1}),t(Vv,{theme:{...$e.appearance.palette||{}}}),!$e.render.standalone&&t(aC,{open:l})]})}),Ae&&Te?t(yC,{appId:r.appId,appClientId:r.clientId,clientAnalyticsId:a.clientAnalyticsId,origin:a.apiUrl,mfaMethods:y?.mfaMethods,mfaPromise:Ge,mfaSubmitPromise:He,onLoad:be,onLoadFailed:()=>null}):null,$e.loginConfig.telegramAuthConfiguration&&t(Ed,{$if:!0,children:t(lC,{scriptHost:r.apiUrl||Le,botUsername:$e.loginConfig.telegramAuthConfiguration.botName})})]})})})})})};function JC(e){let{login:t}=u(D);return zt("login",e),{login:t}}function XC(e){let{connectWallet:t}=u(D);return zt("connectWallet",e),{connectWallet:t}}const eb=e=>{zt("fundWallet",e);let{fundWallet:t}=P();return{fundWallet:t}},tb=Un((()=>({isModalOpen:!1,resolvers:null})));let rb=Bn((()=>({})),Wn);const nb=(e,t)=>rb((r=>r[e]?.[t])),ab=(e,t,r)=>{rb.setState((n=>({...n,[e]:{...n[e],[t]:r}})))},ib=()=>{let e=tb.getState().resolvers;e||console.warn("useActiveWalletStore: Called close while modal was not open"),tb.setState({isModalOpen:!1}),e?.resolve({wallet:tb.getState().wallet})},ob=({address:e,client:t,appId:r})=>{let n=`${t}:${e}`;r&&qo.put(sb(r),n),tb.setState({wallet:n})},lb=()=>tb((e=>e.isModalOpen)),sb=e=>`privy:${e}:active-wallet-connection`,db=()=>{let e=Ue(),{wallets:t}=G(),{wallets:r}=Vt(),n=tb((e=>e.wallet));p((()=>{if(!e.id)return;let t=qo.get(sb(e.id));tb.setState({wallet:t})}),[e.id]);let a=c((()=>{if(!n)return;let[,e]=n.split(":");return t.find((t=>t.address===e))||r.find((t=>t.address===e))}),[n,t,r]),i=c((()=>a?"ethereum"===a.type?a.chainId:"solana":void 0),[a]);return{connect:async n=>{n?.reset&&(qo.del(sb(e.id)),tb.setState({wallet:void 0}));let{wallet:a}=await(async()=>{let e,t,r=new Promise(((r,n)=>{e=r,t=n}));return rb.setState({}),tb.setState({isModalOpen:!0,resolvers:{resolve:e,reject:t}}),await r})();if(!a)return{};let[,i]=a.split(":"),o=t.find((e=>e.address===i));if(o)return{wallet:o,network:o.chainId};let l=r.find((e=>e.address===i));return l?{wallet:l,network:"solana"}:{}},wallet:a,network:i}};export{lb as $,ql as A,Nd as B,Ml as C,mg as D,Ql as E,$u as F,ys as G,Hs as H,ob as I,nb as J,zl as K,aC as L,ab as M,CC as N,$f as O,YC as P,bp as Q,df as R,oh as S,lh as T,sf as U,ku as V,Ef as W,tm as X,lm as Y,Id as Z,em as _,Vl as a,ib as a0,Ls as b,Cs as c,hl as d,Kg as e,Yg as f,jC as g,Zu as h,Ku as i,qu as j,Ms as k,JC as l,xu as m,Fs as n,XC as o,eb as p,db as q,sp as r,pl as s,du as t,Ll as u,zf as v,Pu as w,$m as x,Ds as y,js as z};
|