@privy-io/react-auth 3.8.0 → 3.8.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/{AccountNotFoundScreen-jSbfPu_e.js → AccountNotFoundScreen-Cu7enz9o.js} +1 -1
- package/dist/cjs/{Address-CZQd_MIA.js → Address-DYZ3IQKV.js} +1 -1
- package/dist/cjs/AffirmativeConsentScreen-Cl_SWg16.js +1 -0
- package/dist/cjs/{AllowlistRejectionScreen-B6roj0JU.js → AllowlistRejectionScreen-D5b9mnX_.js} +1 -1
- package/dist/cjs/{AuthenticateWithWalletScreen-BcBapHrq.js → AuthenticateWithWalletScreen-CfFbXvGY.js} +1 -1
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-CCdsJbKx.js +2 -0
- package/dist/cjs/AwaitingExternalEthereumTransferScreen-CTI3rpHf.js +2 -0
- package/dist/cjs/AwaitingPasswordlessCodeScreen-ftedBDSO.js +1 -0
- package/dist/cjs/{AwaitingSolToEvmBridgingScreen-DYS3lDs0.js → AwaitingSolToEvmBridgingScreen-CaKyEgGQ.js} +1 -1
- package/dist/cjs/{BridgeNetworkSelectionView-uivzU_Y9.js → BridgeNetworkSelectionView-ekW1jVoZ.js} +1 -1
- package/dist/cjs/{Button-nXApC2Jy.js → Button-BpQ22RCK.js} +1 -1
- package/dist/cjs/CaptchaScreen-aaD10pK6.js +1 -0
- package/dist/cjs/CoinbaseOnrampStatusScreen-DXk7YS8-.js +1 -0
- package/dist/cjs/{ConnectEmailForm-BEv-7qU9.js → ConnectEmailForm-uUuYB04I.js} +1 -1
- package/dist/cjs/ConnectLedgerScreen-BsZYPosO.js +1 -0
- package/dist/cjs/{ConnectOnlyLandingScreen-bOhkl0xJ.js → ConnectOnlyLandingScreen-DDCcNqF9.js} +1 -1
- package/dist/cjs/ConnectOnlyStatusScreen-DyJB2X3z.js +1 -0
- package/dist/cjs/ConnectOrCreateScreen-Dfoq-0pD.js +1 -0
- package/dist/cjs/{ConnectPhoneForm-DK-bg2D5.js → ConnectPhoneForm-tjeQd9v8.js} +1 -1
- package/dist/cjs/{ConnectWalletView-4vj7Sq7-.js → ConnectWalletView-CxfQTEJ2.js} +1 -1
- package/dist/cjs/ConnectionStatusScreen-iMAYJhVc.js +1 -0
- package/dist/cjs/CrossAppAuthScreen-CsZ_rLLg.js +1 -0
- package/dist/cjs/{CustomLandingScreenView-tt_NEfU6.js → CustomLandingScreenView-B0bNrKZn.js} +2 -2
- package/dist/cjs/{DelegatedActionsConsentScreen-B5WlYn7z.js → DelegatedActionsConsentScreen-CyITZiB7.js} +1 -1
- package/dist/cjs/DelegatedActionsRevokeScreen-vQnlP7qN.js +1 -0
- package/dist/cjs/EmbeddedWalletConnectingScreen-D5yc0IhZ.js +1 -0
- package/dist/cjs/{EmbeddedWalletCreatedScreen-PycFyIz6.js → EmbeddedWalletCreatedScreen-BFJ6BKQ4.js} +1 -1
- package/dist/cjs/{EmbeddedWalletKeyExportScreen-BDTDQY1f.js → EmbeddedWalletKeyExportScreen-Cz3cpL6Q.js} +2 -2
- package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-L4tUdjxn.js +1 -0
- package/dist/cjs/{EmbeddedWalletPasswordUpdateScreen-ZfgU86hx.js → EmbeddedWalletPasswordUpdateScreen-n5Z982kO.js} +1 -1
- package/dist/cjs/{EmbeddedWalletPasswordUpdateSplashScreen-tP8rSVUL.js → EmbeddedWalletPasswordUpdateSplashScreen-BJQXfJ5I.js} +1 -1
- package/dist/cjs/{EnrollTotp-DZ5fIrXr.js → EnrollTotp-Bo2kHSAy.js} +1 -1
- package/dist/cjs/ErrorScreen-BGI-4cUT.js +1 -0
- package/dist/cjs/FarcasterConnectStatusScreen-BKcQ6ZMu.js +2 -0
- package/dist/cjs/{FarcasterSignerStatusScreen-CDYkqsxz.js → FarcasterSignerStatusScreen-BB63F9MZ.js} +2 -2
- package/dist/cjs/{FundSolWalletWithExternalSolanaWallet-DC_xoE6W.js → FundSolWalletWithExternalSolanaWallet-DFQlLB8a.js} +1 -1
- package/dist/cjs/{FundWalletMethodHeader-zYWhBIiS.js → FundWalletMethodHeader-CZ9E9Pcd.js} +1 -1
- package/dist/cjs/{FundingEditAmountScreen-BB7-k00c.js → FundingEditAmountScreen-C8OzBV96.js} +1 -1
- package/dist/cjs/{FundingMethodSelectionScreen-BrV94GD2.js → FundingMethodSelectionScreen-GE2W8CGa.js} +1 -1
- package/dist/cjs/HCaptchaWrapper-DMLxURsO.js +1 -0
- package/dist/cjs/{InAppBrowserLoginNotPossible-y8g07-kU.js → InAppBrowserLoginNotPossible-BDJuZ0-D.js} +1 -1
- package/dist/cjs/{InstallWalletScreen-CmGi6mS1.js → InstallWalletScreen-tcaVKdvZ.js} +1 -1
- package/dist/cjs/LandingScreen-BIRSSuAB.js +1 -0
- package/dist/cjs/{LinkConflictScreen-BJXyOu2J.js → LinkConflictScreen-D6812iEs.js} +1 -1
- package/dist/cjs/LinkEmailScreen-D-kZRiYu.js +1 -0
- package/dist/cjs/{LinkPasskeyScreen-Bw7Xs741.js → LinkPasskeyScreen-Dn0beRU9.js} +1 -1
- package/dist/cjs/{LinkPhoneScreen-C4JQblY3.js → LinkPhoneScreen-D2wD2X6_.js} +1 -1
- package/dist/cjs/{LoginFailedScreen-CGT-2B2h.js → LoginFailedScreen-JL8lSBDT.js} +1 -1
- package/dist/cjs/ManualTransferScreen-rVVbGuHO.js +1 -0
- package/dist/cjs/MfaAuthEnrollmentFlowScreen-7wF7sedZ.js +1 -0
- package/dist/cjs/MfaAuthVerifyFlowScreen-DXT_z8L7.js +1 -0
- package/dist/cjs/MfaEnrollmentFlowScreen-DJWHdMZL.js +1 -0
- package/dist/cjs/MfaVerifyFlowScreen-BC3Vuttf.js +1 -0
- package/dist/cjs/{ModalHeader-DbV81e3m.js → ModalHeader-BmFtLkWJ.js} +1 -1
- package/dist/cjs/{MoonpayStatusScreen-yghPhz7v.js → MoonpayStatusScreen-DyW9zeoT.js} +1 -1
- package/dist/cjs/OAuthStatusScreen-FjNrpKlb.js +1 -0
- package/dist/cjs/PasskeySelectSignupOrLogin-DyHtky_y.js +1 -0
- package/dist/cjs/PasskeyStatusScreen-Q0ag_5Jx.js +1 -0
- package/dist/cjs/PasswordRecoveryScreen-D6vuUKqB.js +1 -0
- package/dist/cjs/{QrCode-Ua_0cVUP.js → QrCode-qgAdMqWi.js} +1 -1
- package/dist/cjs/RecoveryOAuthStatusScreen-D1xbanmh.js +1 -0
- package/dist/cjs/RecoveryPasswordCreateScreen-DW-I4Bjp.js +1 -0
- package/dist/cjs/RecoverySelectionScreen-CSsw-SMB.js +1 -0
- package/dist/cjs/{Screen-65eQbiHD.js → Screen-BAXdSOJk.js} +1 -1
- package/dist/cjs/{ScreenLayout-B_60rKhZ.js → ScreenLayout-95K6C4n8.js} +1 -1
- package/dist/cjs/{SetAutomaticRecoveryScreen-DQolobOz.js → SetAutomaticRecoveryScreen-DdYvhBam.js} +1 -1
- package/dist/cjs/{SetWalletPasswordForm-8g-lawop.js → SetWalletPasswordForm-D7TN70-K.js} +2 -2
- package/dist/cjs/{SignRequestScreen-BAgmmVVW.js → SignRequestScreen-B6DzD2bf.js} +1 -1
- package/dist/cjs/StandardSignAndSendTransactionScreen-Cl_1GhiF.js +1 -0
- package/dist/cjs/TelegramAuthScreen-D32WGqrh.js +1 -0
- package/dist/cjs/{TransactionDetails-BefABtVQ.js → TransactionDetails-B4mP9iqk.js} +1 -1
- package/dist/cjs/{TransactionErrorView-QKWh4urc.js → TransactionErrorView-BPMOzuyp.js} +2 -2
- package/dist/cjs/TransferFromWalletScreen-BbJ3ISYt.js +1 -0
- package/dist/cjs/{TransferOrBridgeLoadingScreen-C6t1_cTP.js → TransferOrBridgeLoadingScreen-DsBPxxqR.js} +1 -1
- package/dist/cjs/TurnstileWrapper-qLN0G5m7.js +1 -0
- package/dist/cjs/UpdateEmailScreen-fqqg8VfP.js +1 -0
- package/dist/cjs/{UpdatePhoneScreen-DefnuTEZ.js → UpdatePhoneScreen-BJDovBOR.js} +1 -1
- package/dist/cjs/{UserLimitReachedScreen-B76r_-LC.js → UserLimitReachedScreen-CSkM5uLj.js} +1 -1
- package/dist/cjs/WalletButtonList-jzt0Egd8.js +1 -0
- package/dist/cjs/{WalletInfoCard-CscdnrUV.js → WalletInfoCard-bdaI4ebq.js} +1 -1
- package/dist/cjs/{WalletInterstitialScreen-CG1k3EvV.js → WalletInterstitialScreen-BzSNp3dA.js} +1 -1
- package/dist/cjs/{WalletLink-DF6dDjkz.js → WalletLink-2kOfC5R5.js} +1 -1
- package/dist/cjs/abstract-smart-wallets.js +1 -1
- package/dist/cjs/context-CToLw7Dr.js +1 -0
- package/dist/cjs/{ethers-uj8IknV_.js → ethers-Djy--MKt.js} +1 -1
- package/dist/cjs/extended-chains.js +1 -1
- package/dist/cjs/farcaster.js +1 -1
- package/dist/cjs/{frame-bPqBJ8fS.js → frame-BSQIYvLs.js} +1 -1
- package/dist/cjs/{get-is-unified-wallet-DmiciSes.js → get-is-unified-wallet-CAK7Zx3C.js} +1 -1
- package/dist/cjs/{getErc20Balance-BZ5-OGfD.js → getErc20Balance-BiXU_58s.js} +1 -1
- package/dist/cjs/{getErc20TokenInfo-HX7DgcWx.js → getErc20TokenInfo-B78AxnZ3.js} +1 -1
- package/dist/cjs/{getPublicClient-EjAv8R2z.js → getPublicClient-d-gCTRgH.js} +1 -1
- package/dist/cjs/index-BqAmClyL.js +1 -0
- package/dist/cjs/{index-Cuv6j_Y0.js → index-CBf8l7UH.js} +1 -1
- package/dist/cjs/index-DKxtLOTJ.js +5 -0
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/internal-context-D80qA_jS.js +1 -0
- package/dist/cjs/internal.js +1 -1
- package/dist/cjs/{prepareFundingModalData-BVlyr8l5.js → prepareFundingModalData-BhY38T4k.js} +1 -1
- package/dist/cjs/{reservoir-3I-Vkf2B.js → reservoir-DLqCfAka.js} +1 -1
- package/dist/cjs/{shared-CT5ocsPG.js → shared-LnNw37YZ.js} +1 -1
- package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-DcjqezwI.js → shouldProceedtoEmbeddedWalletCreationFlow-D8TmPfTs.js} +1 -1
- package/dist/cjs/{smart-wallets-B7vHjGAW.js → smart-wallets-BxBo7Rwr.js} +1 -1
- package/dist/cjs/smart-wallets.js +1 -1
- package/dist/cjs/solana.js +1 -1
- package/dist/cjs/{to-ui-error-a-xwbRKZ.js → to-ui-error-DQR0PH1r.js} +1 -1
- package/dist/cjs/ui.js +1 -1
- package/dist/cjs/{use-create-wallet-without-fallback-DSOJS4h0.js → use-create-wallet-without-fallback-DVsaEUAi.js} +1 -1
- package/dist/cjs/{use-export-wallet-BRFTskbr.js → use-export-wallet-Bp3Q263k.js} +1 -1
- package/dist/cjs/{use-sign-with-user-signer-On9f1Fag.js → use-sign-with-user-signer-H6aAias8.js} +1 -1
- package/dist/cjs/{useActiveWallet-DcxqWAsq.js → useActiveWallet-rCbIz7HK.js} +1 -1
- package/dist/cjs/{useGetSolPrice-eOpcFeNE.js → useGetSolPrice-mb9rbK56.js} +1 -1
- package/dist/cjs/{useGetTokenPrice-EcT0H5rf.js → useGetTokenPrice-BXSjabMV.js} +1 -1
- package/dist/cjs/{useI18n-hYSvbQCq.js → useI18n-DnOEBAdg.js} +1 -1
- package/dist/cjs/{usePrivy-CXPeoT5g.js → usePrivy-fmKLKsT3.js} +1 -1
- package/dist/cjs/{useSolanaRpcClient-mfV88iJm.js → useSolanaRpcClient-BSb_hq8i.js} +1 -1
- package/dist/cjs/{useWalletBalance-CQAgfkRc.js → useWalletBalance-9yRQYIAe.js} +1 -1
- package/dist/cjs/{useWallets-h2xCj02C.js → useWallets-D6t7Ii2K.js} +1 -1
- package/dist/cjs/{useWallets-TxPVNWGS.js → useWallets-dr024nCy.js} +1 -1
- package/dist/dts/{events-context-CkFXl3uc.d.mts → events-context-Bt8hY3AJ.d.mts} +1 -1
- package/dist/dts/{events-context-CkFXl3uc.d.ts → events-context-Bt8hY3AJ.d.ts} +1 -1
- package/dist/dts/extended-chains.d.mts +1 -1
- package/dist/dts/extended-chains.d.ts +1 -1
- package/dist/dts/farcaster.d.mts +1 -1
- package/dist/dts/farcaster.d.ts +1 -1
- package/dist/dts/index.d.mts +17 -10
- package/dist/dts/index.d.ts +17 -10
- package/dist/dts/internal.d.mts +1 -1
- package/dist/dts/internal.d.ts +1 -1
- package/dist/dts/smart-wallets.d.mts +1 -1
- package/dist/dts/smart-wallets.d.ts +1 -1
- package/dist/dts/solana.d.mts +3 -3
- package/dist/dts/solana.d.ts +3 -3
- package/dist/dts/{types-BkkvIRg5.d.mts → types-Dx2VbdX1.d.mts} +52 -7
- package/dist/dts/{types-BkkvIRg5.d.ts → types-Dx2VbdX1.d.ts} +52 -7
- package/dist/dts/ui.d.mts +1 -1
- package/dist/dts/ui.d.ts +1 -1
- package/dist/esm/AccountNotFoundScreen-DQR0FatT.mjs +1 -0
- package/dist/esm/{Address-DtXA0OPS.mjs → Address-C1iw9r70.mjs} +1 -1
- package/dist/esm/AffirmativeConsentScreen-BU4I5ISJ.mjs +1 -0
- package/dist/esm/{AllowlistRejectionScreen-BuH5iBJ3.mjs → AllowlistRejectionScreen-WgcCN6CH.mjs} +1 -1
- package/dist/esm/{AuthenticateWithWalletScreen-CKJqrLEm.mjs → AuthenticateWithWalletScreen-D6Zy69An.mjs} +1 -1
- package/dist/esm/AwaitingEvmToSolBridgingScreen-ByIVuwRF.mjs +2 -0
- package/dist/esm/AwaitingExternalEthereumTransferScreen-Bq0rCErj.mjs +2 -0
- package/dist/esm/AwaitingPasswordlessCodeScreen-itJ4854u.mjs +1 -0
- package/dist/esm/{AwaitingSolToEvmBridgingScreen-YsM6M4T9.mjs → AwaitingSolToEvmBridgingScreen-BSxfnQcf.mjs} +1 -1
- package/dist/esm/{BridgeNetworkSelectionView-Bu0vi9_a.mjs → BridgeNetworkSelectionView-DXjTVIcQ.mjs} +1 -1
- package/dist/esm/{Button-DJ-mtuuD.mjs → Button-OlK_6fKk.mjs} +1 -1
- package/dist/esm/CaptchaScreen-BBjPbV4B.mjs +1 -0
- package/dist/esm/CoinbaseOnrampStatusScreen-CZpfBNiz.mjs +1 -0
- package/dist/esm/{ConnectEmailForm-DUgOCS2V.mjs → ConnectEmailForm-C2TJPUYV.mjs} +1 -1
- package/dist/esm/ConnectLedgerScreen-TCVn5s4x.mjs +1 -0
- package/dist/esm/{ConnectOnlyLandingScreen-BVkcUaO6.mjs → ConnectOnlyLandingScreen-CjVJO9uh.mjs} +1 -1
- package/dist/esm/ConnectOnlyStatusScreen-BGJ4l52n.mjs +1 -0
- package/dist/esm/ConnectOrCreateScreen-CZDi1Oaj.mjs +1 -0
- package/dist/esm/{ConnectPhoneForm-CbuSfwAI.mjs → ConnectPhoneForm-kW8tUq0-.mjs} +1 -1
- package/dist/esm/{ConnectWalletView-DVDOSzi0.mjs → ConnectWalletView-tpdAD3K7.mjs} +1 -1
- package/dist/esm/ConnectionStatusScreen-B3NfUQx_.mjs +1 -0
- package/dist/esm/CrossAppAuthScreen-CnvB1lhx.mjs +1 -0
- package/dist/esm/{CustomLandingScreenView-DWt9lv8W.mjs → CustomLandingScreenView-DZTOg8z4.mjs} +2 -2
- package/dist/esm/DelegatedActionsConsentScreen-DeBkGN9b.mjs +1 -0
- package/dist/esm/{DelegatedActionsRevokeScreen-B-xLCB1j.mjs → DelegatedActionsRevokeScreen-CTgPXrqu.mjs} +1 -1
- package/dist/esm/EmbeddedWalletConnectingScreen-Qu9cmWzJ.mjs +1 -0
- package/dist/esm/EmbeddedWalletCreatedScreen-DFciR3k8.mjs +1 -0
- package/dist/esm/{EmbeddedWalletKeyExportScreen-DX22sVNh.mjs → EmbeddedWalletKeyExportScreen-CEo3FI_N.mjs} +2 -2
- package/dist/esm/EmbeddedWalletOnAccountCreateScreen-C7cawTmQ.mjs +1 -0
- package/dist/esm/{EmbeddedWalletPasswordUpdateScreen-CezgHp88.mjs → EmbeddedWalletPasswordUpdateScreen-GdNNmtZR.mjs} +1 -1
- package/dist/esm/{EmbeddedWalletPasswordUpdateSplashScreen-BFamfPb_.mjs → EmbeddedWalletPasswordUpdateSplashScreen-BNOCuoES.mjs} +1 -1
- package/dist/esm/{EnrollTotp-BzAm1Ya4.mjs → EnrollTotp-CtNw20-I.mjs} +1 -1
- package/dist/esm/ErrorScreen-NoHFWbKU.mjs +1 -0
- package/dist/esm/FarcasterConnectStatusScreen-CiN00CmD.mjs +1 -0
- package/dist/esm/{FarcasterSignerStatusScreen-DIfmv7Ft.mjs → FarcasterSignerStatusScreen-MQ2QrijY.mjs} +1 -1
- package/dist/esm/{FundSolWalletWithExternalSolanaWallet-CkEgl8wO.mjs → FundSolWalletWithExternalSolanaWallet-DVaHCgDh.mjs} +1 -1
- package/dist/esm/{FundWalletMethodHeader-CbTaIDLQ.mjs → FundWalletMethodHeader-RY6-H-Ry.mjs} +1 -1
- package/dist/esm/FundingEditAmountScreen-DiZ2-4XS.mjs +1 -0
- package/dist/esm/{FundingMethodSelectionScreen-fBauGI0K.mjs → FundingMethodSelectionScreen-yZenKs6o.mjs} +1 -1
- package/dist/esm/HCaptchaWrapper-Dl2Jt_Df.mjs +1 -0
- package/dist/esm/{InAppBrowserLoginNotPossible-DBhsoAkw.mjs → InAppBrowserLoginNotPossible-CTnPeOBa.mjs} +1 -1
- package/dist/esm/{InstallWalletScreen-CEcl2LHj.mjs → InstallWalletScreen-CBxWJiQf.mjs} +1 -1
- package/dist/esm/LandingScreen-CzhCoUSE.mjs +1 -0
- package/dist/esm/{LinkConflictScreen-Bg9QTrJX.mjs → LinkConflictScreen-BnoDRUE0.mjs} +1 -1
- package/dist/esm/LinkEmailScreen-x_TPODcx.mjs +1 -0
- package/dist/esm/{LinkPasskeyScreen-CNFL2N09.mjs → LinkPasskeyScreen-D9IfHaec.mjs} +1 -1
- package/dist/esm/{LinkPhoneScreen-DnPAvact.mjs → LinkPhoneScreen-DaK-7otl.mjs} +1 -1
- package/dist/esm/{LoginFailedScreen-CkxfR75o.mjs → LoginFailedScreen-CoukYLVP.mjs} +1 -1
- package/dist/esm/ManualTransferScreen-DdumQnbt.mjs +1 -0
- package/dist/esm/MfaAuthEnrollmentFlowScreen-BsRpCR72.mjs +1 -0
- package/dist/esm/MfaAuthVerifyFlowScreen-Cr92F0yT.mjs +1 -0
- package/dist/esm/MfaEnrollmentFlowScreen-CXyaDU1D.mjs +1 -0
- package/dist/esm/MfaVerifyFlowScreen-ghKHn2BT.mjs +1 -0
- package/dist/esm/{ModalHeader-D7WajfD8.mjs → ModalHeader-CxHK1IKF.mjs} +1 -1
- package/dist/esm/{MoonpayStatusScreen-CBc4DLDR.mjs → MoonpayStatusScreen-DhMZLroP.mjs} +1 -1
- package/dist/esm/OAuthStatusScreen-BFVDc4G4.mjs +1 -0
- package/dist/esm/PasskeySelectSignupOrLogin-Dvxli58H.mjs +1 -0
- package/dist/esm/PasskeyStatusScreen-c9nu4s_d.mjs +1 -0
- package/dist/esm/PasswordRecoveryScreen-CsdO4G6h.mjs +1 -0
- package/dist/esm/{QrCode-zzqjquVm.mjs → QrCode-BI2LxLLg.mjs} +1 -1
- package/dist/esm/RecoveryOAuthStatusScreen-Dp7fnj5t.mjs +1 -0
- package/dist/esm/RecoveryPasswordCreateScreen-DdzD09T3.mjs +1 -0
- package/dist/esm/RecoverySelectionScreen-D2nDGt4R.mjs +1 -0
- package/dist/esm/{Screen-dwi2CitY.mjs → Screen-Dzz_AFFs.mjs} +1 -1
- package/dist/esm/{ScreenLayout-Dmrhdwtt.mjs → ScreenLayout-pthdsODa.mjs} +1 -1
- package/dist/esm/{SetAutomaticRecoveryScreen-Db5Xg_sQ.mjs → SetAutomaticRecoveryScreen-g1kDOe61.mjs} +1 -1
- package/dist/esm/{SetWalletPasswordForm-ZtRqoZYj.mjs → SetWalletPasswordForm-DUTEhc4R.mjs} +2 -2
- package/dist/esm/{SignRequestScreen-DdAK4SlJ.mjs → SignRequestScreen-DjLHkDxK.mjs} +1 -1
- package/dist/esm/StandardSignAndSendTransactionScreen-CFqthHKF.mjs +1 -0
- package/dist/esm/TelegramAuthScreen-B5uYbdxP.mjs +1 -0
- package/dist/esm/{TransactionDetails-fgHkAnf9.mjs → TransactionDetails-DITlhQNk.mjs} +3 -3
- package/dist/esm/{TransactionErrorView-Dgp1KSy5.mjs → TransactionErrorView-DmFbjQHi.mjs} +2 -2
- package/dist/esm/TransferFromWalletScreen-Dvp-YNqS.mjs +1 -0
- package/dist/esm/{TransferOrBridgeLoadingScreen-D3vBwM_o.mjs → TransferOrBridgeLoadingScreen-CFRKffkj.mjs} +1 -1
- package/dist/esm/TurnstileWrapper-Co-t5mTh.mjs +1 -0
- package/dist/esm/UpdateEmailScreen-DoDVvVCw.mjs +1 -0
- package/dist/esm/{UpdatePhoneScreen-Byn7UW7u.mjs → UpdatePhoneScreen-BoEnTnCl.mjs} +1 -1
- package/dist/esm/{UserLimitReachedScreen-DXDqdBpt.mjs → UserLimitReachedScreen-68Vv3bFU.mjs} +1 -1
- package/dist/esm/WalletButtonList-C1OqZHCA.mjs +1 -0
- package/dist/esm/{WalletInfoCard-DAv0WFcc.mjs → WalletInfoCard-DmIqX_B8.mjs} +1 -1
- package/dist/esm/{WalletInterstitialScreen-CKiSWjpa.mjs → WalletInterstitialScreen-Du_L0CK7.mjs} +1 -1
- package/dist/esm/{WalletLink-CjuEskpb.mjs → WalletLink-D2x4SkPO.mjs} +2 -2
- package/dist/esm/abstract-smart-wallets.mjs +1 -1
- package/dist/esm/context-B4VZqX5H.mjs +1 -0
- package/dist/esm/{ethers-CpMSCMOg.mjs → ethers-oRuqwv5W.mjs} +1 -1
- package/dist/esm/extended-chains.mjs +1 -1
- package/dist/esm/farcaster.mjs +1 -1
- package/dist/esm/{frame-BMa3kyjk.mjs → frame-BMn1PaPp.mjs} +1 -1
- package/dist/esm/{get-is-unified-wallet-DymQMSJy.mjs → get-is-unified-wallet-DXko-EzF.mjs} +1 -1
- package/dist/esm/{getErc20Balance-Dtau1386.mjs → getErc20Balance-Cl5jZN3g.mjs} +1 -1
- package/dist/esm/getErc20TokenInfo-wBcf5dYY.mjs +1 -0
- package/dist/esm/{getPublicClient-IxRndou_.mjs → getPublicClient-C_l_ocJu.mjs} +1 -1
- package/dist/esm/{index-DdlRJsoj.mjs → index-BctMJtH0.mjs} +1 -1
- package/dist/esm/index-CCrVHfyv.mjs +5 -0
- package/dist/esm/index-Ce4cEnEO.mjs +1 -0
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/{internal-context-Cvo1WmWN.mjs → internal-context-DLZicboG.mjs} +1 -1
- package/dist/esm/internal.mjs +1 -1
- package/dist/esm/{prepareFundingModalData-BUyu5Vhr.mjs → prepareFundingModalData-CndHQFiM.mjs} +1 -1
- package/dist/esm/{reservoir-B0V48m2I.mjs → reservoir-DRNnyqld.mjs} +1 -1
- package/dist/esm/{shared-DsP7M4P5.mjs → shared-BMOp6N9y.mjs} +1 -1
- package/dist/esm/shouldProceedtoEmbeddedWalletCreationFlow-DVwf2mAj.mjs +1 -0
- package/dist/esm/{smart-wallets-Cbhn7qlU.mjs → smart-wallets-B3-1-dnO.mjs} +1 -1
- package/dist/esm/smart-wallets.mjs +1 -1
- package/dist/esm/solana.mjs +1 -1
- package/dist/esm/{to-ui-error-B3m2hl6e.mjs → to-ui-error-B8DSJO-0.mjs} +1 -1
- package/dist/esm/ui.mjs +2 -2
- package/dist/esm/{use-create-wallet-without-fallback-DodUf3VP.mjs → use-create-wallet-without-fallback-COqi_EHH.mjs} +1 -1
- package/dist/esm/{use-export-wallet-CWslDKqf.mjs → use-export-wallet-CRKJ4-yx.mjs} +1 -1
- package/dist/esm/{use-sign-with-user-signer-LJ6ROduD.mjs → use-sign-with-user-signer-J1po7l19.mjs} +1 -1
- package/dist/esm/useActiveWallet-Bj-s666H.mjs +1 -0
- package/dist/esm/{useGetSolPrice-Bi0pPiUW.mjs → useGetSolPrice-fF6UX0Cj.mjs} +1 -1
- package/dist/esm/{useGetTokenPrice-B4XVfxeD.mjs → useGetTokenPrice-CnQZmfvQ.mjs} +1 -1
- package/dist/esm/{useI18n-ByKvnaXP.mjs → useI18n-DIAzggWr.mjs} +1 -1
- package/dist/esm/{usePrivy-D3OPY7tm.mjs → usePrivy-BSIhOAz8.mjs} +1 -1
- package/dist/esm/{useSolanaRpcClient-DjD2ma5c.mjs → useSolanaRpcClient-Be5Dd6m5.mjs} +1 -1
- package/dist/esm/{useWalletBalance-Xca4-c_r.mjs → useWalletBalance-BuMx9pCk.mjs} +1 -1
- package/dist/esm/{useWallets-CQMJYOF9.mjs → useWallets-Cc1ILfGS.mjs} +1 -1
- package/dist/esm/{useWallets-BplPx0Pz.mjs → useWallets-DuxHKVvE.mjs} +1 -1
- package/package.json +7 -6
- package/dist/cjs/AffirmativeConsentScreen-7a4hl59A.js +0 -1
- package/dist/cjs/AwaitingEvmToSolBridgingScreen-D1Xd83Hp.js +0 -2
- package/dist/cjs/AwaitingExternalEthereumTransferScreen-COL0WYkT.js +0 -2
- package/dist/cjs/AwaitingPasswordlessCodeScreen-Cx5fqGf6.js +0 -1
- package/dist/cjs/CaptchaScreen-025syTLo.js +0 -1
- package/dist/cjs/CoinbaseOnrampStatusScreen-ORl8wt4H.js +0 -1
- package/dist/cjs/ConnectLedgerScreen-DBYExlWR.js +0 -1
- package/dist/cjs/ConnectOnlyStatusScreen-DvTrLHyY.js +0 -1
- package/dist/cjs/ConnectOrCreateScreen-Dh4EFU5N.js +0 -1
- package/dist/cjs/ConnectionStatusScreen-Ct-KTCXS.js +0 -1
- package/dist/cjs/CrossAppAuthScreen-B-DtA7IH.js +0 -1
- package/dist/cjs/DelegatedActionsRevokeScreen-2g_ydX-Y.js +0 -1
- package/dist/cjs/EmbeddedWalletConnectingScreen-9seYvsTF.js +0 -1
- package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-B0tXEtG9.js +0 -1
- package/dist/cjs/ErrorScreen-Cob9AO30.js +0 -1
- package/dist/cjs/FarcasterConnectStatusScreen-C5FoWA6N.js +0 -2
- package/dist/cjs/LandingScreen-B9jb8n_d.js +0 -1
- package/dist/cjs/LinkEmailScreen-zyJFrvy-.js +0 -1
- package/dist/cjs/ManualTransferScreen-DPz98CSt.js +0 -1
- package/dist/cjs/MfaAuthEnrollmentFlowScreen-BBKMKDGR.js +0 -1
- package/dist/cjs/MfaAuthVerifyFlowScreen-3LKUo_xV.js +0 -1
- package/dist/cjs/MfaEnrollmentFlowScreen-B2YgNRCC.js +0 -1
- package/dist/cjs/MfaVerifyFlowScreen-BhVqkM2f.js +0 -1
- package/dist/cjs/OAuthStatusScreen-q9MFItPT.js +0 -1
- package/dist/cjs/PasskeySelectSignupOrLogin-BKBH0QxK.js +0 -1
- package/dist/cjs/PasskeyStatusScreen-DVx4lzwq.js +0 -1
- package/dist/cjs/PasswordRecoveryScreen-BmGdXVfh.js +0 -1
- package/dist/cjs/RecoveryOAuthStatusScreen-DUobwBXF.js +0 -1
- package/dist/cjs/RecoveryPasswordCreateScreen-vQG4ErlF.js +0 -1
- package/dist/cjs/RecoverySelectionScreen-E2l_NO8y.js +0 -1
- package/dist/cjs/StandardSignAndSendTransactionScreen-BUB57iWU.js +0 -1
- package/dist/cjs/TelegramAuthScreen-D5uhx6WN.js +0 -1
- package/dist/cjs/TransferFromWalletScreen-C_0IpL-A.js +0 -1
- package/dist/cjs/UpdateEmailScreen-BUAgWudx.js +0 -1
- package/dist/cjs/WalletButtonList-bICzXZXM.js +0 -1
- package/dist/cjs/context-JUEgi5-6.js +0 -1
- package/dist/cjs/index-BNNk54gK.js +0 -1
- package/dist/cjs/index-DvDeCr_m.js +0 -5
- package/dist/cjs/internal-context-VDPFkIXN.js +0 -1
- package/dist/esm/AccountNotFoundScreen-CmhSsknC.mjs +0 -1
- package/dist/esm/AffirmativeConsentScreen-C6AcYU94.mjs +0 -1
- package/dist/esm/AwaitingEvmToSolBridgingScreen-DuO5iRV2.mjs +0 -2
- package/dist/esm/AwaitingExternalEthereumTransferScreen-C50_Dj-N.mjs +0 -2
- package/dist/esm/AwaitingPasswordlessCodeScreen-Bb0UxW46.mjs +0 -1
- package/dist/esm/CaptchaScreen-CWQAXaCK.mjs +0 -1
- package/dist/esm/CoinbaseOnrampStatusScreen-NdySyA5D.mjs +0 -1
- package/dist/esm/ConnectLedgerScreen-3wp1wuP2.mjs +0 -1
- package/dist/esm/ConnectOnlyStatusScreen-CyT_IEgy.mjs +0 -1
- package/dist/esm/ConnectOrCreateScreen-BlIxCxVJ.mjs +0 -1
- package/dist/esm/ConnectionStatusScreen-DNdZyKcL.mjs +0 -1
- package/dist/esm/CrossAppAuthScreen-DEF_slEx.mjs +0 -1
- package/dist/esm/DelegatedActionsConsentScreen-DqeBCJkz.mjs +0 -1
- package/dist/esm/EmbeddedWalletConnectingScreen-BCg7qeI6.mjs +0 -1
- package/dist/esm/EmbeddedWalletCreatedScreen-jGepSDyo.mjs +0 -1
- package/dist/esm/EmbeddedWalletOnAccountCreateScreen-hkifQ988.mjs +0 -1
- package/dist/esm/ErrorScreen-DFAo4S7A.mjs +0 -1
- package/dist/esm/FarcasterConnectStatusScreen-Ys1uAk-s.mjs +0 -1
- package/dist/esm/FundingEditAmountScreen-Cz4tmsMX.mjs +0 -1
- package/dist/esm/LandingScreen-BvRIrtFN.mjs +0 -1
- package/dist/esm/LinkEmailScreen-SlCMvM43.mjs +0 -1
- package/dist/esm/ManualTransferScreen-px_MUbVh.mjs +0 -1
- package/dist/esm/MfaAuthEnrollmentFlowScreen-RbHifi_a.mjs +0 -1
- package/dist/esm/MfaAuthVerifyFlowScreen-B3SIiFnH.mjs +0 -1
- package/dist/esm/MfaEnrollmentFlowScreen-LgmZFVEZ.mjs +0 -1
- package/dist/esm/MfaVerifyFlowScreen-DZkVptvz.mjs +0 -1
- package/dist/esm/OAuthStatusScreen-DvD84FHd.mjs +0 -1
- package/dist/esm/PasskeySelectSignupOrLogin-DZP4Hj5r.mjs +0 -1
- package/dist/esm/PasskeyStatusScreen-bP3yfXNt.mjs +0 -1
- package/dist/esm/PasswordRecoveryScreen-Bt_Cf8-l.mjs +0 -1
- package/dist/esm/RecoveryOAuthStatusScreen-y6_gmb9s.mjs +0 -1
- package/dist/esm/RecoveryPasswordCreateScreen-CloUjFKm.mjs +0 -1
- package/dist/esm/RecoverySelectionScreen-FxCwz-PR.mjs +0 -1
- package/dist/esm/StandardSignAndSendTransactionScreen-C0IrbkCx.mjs +0 -1
- package/dist/esm/TelegramAuthScreen-vp2lrJFZ.mjs +0 -1
- package/dist/esm/TransferFromWalletScreen-CTAGaF9C.mjs +0 -1
- package/dist/esm/UpdateEmailScreen-BBtChP9Q.mjs +0 -1
- package/dist/esm/WalletButtonList-CGloXTN0.mjs +0 -1
- package/dist/esm/context-Cb5MFcME.mjs +0 -1
- package/dist/esm/getErc20TokenInfo-CKA_MDcy.mjs +0 -1
- package/dist/esm/index-B_e8abKi.mjs +0 -1
- package/dist/esm/index-CI666IP9.mjs +0 -5
- package/dist/esm/shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs +0 -1
- package/dist/esm/useActiveWallet-hrZcON-K.mjs +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import r from"@heroicons/react/24/outline/CheckCircleIcon";import{useRef as o,useState as a,useMemo as i,useEffect as s}from"react";import{parseEther as
|
|
1
|
+
import{jsxs as e,jsx as t,Fragment as n}from"react/jsx-runtime";import r from"@heroicons/react/24/outline/CheckCircleIcon";import{useRef as o,useState as a,useMemo as i,useEffect as s}from"react";import{parseEther as l}from"viem";import{ConnectedStandardSolanaWallet as d}from"@privy-io/js-sdk-core";import{b as c,c as m,R as u}from"./Layouts-Bmf8DxNP.mjs";import{B as p}from"./ModalHeader-CxHK1IKF.mjs";import{C as f}from"./ScreenHeader-Biz1wq02.mjs";import{t as h}from"./FundWalletMethodHeader-RY6-H-Ry.mjs";import{N as g}from"./index-CJMgUOnw.mjs";import{u as v,t as w}from"./context-B4VZqX5H.mjs";import{u as I,a as C,b as y}from"./internal-context-DLZicboG.mjs";import{Q as T,a6 as S}from"./useActiveWallet-Bj-s666H.mjs";import{a as j}from"./get-is-unified-wallet-DXko-EzF.mjs";import{O as A}from"./analytics-mkkvFRju.mjs";import{g as b,t as N,d as F,a as U,b as E,u as x}from"./reservoir-DRNnyqld.mjs";import{a as W,S as k}from"./usePrivy-BSIhOAz8.mjs";import{T as R}from"./TransferOrBridgeLoadingScreen-CFRKffkj.mjs";import{t as L}from"./prepareFundingModalData-CndHQFiM.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"tinycolor2";import"ofetch";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"@heroicons/react/24/outline/WalletIcon";import"./Row-CG0lSY5Z.mjs";import"./Value-B4M62ove.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"./Address-C1iw9r70.mjs";import"lucide-react";import"./Button-OlK_6fKk.mjs";import"./NetworkIcon-B48ilzF8.mjs";import"@heroicons/react/24/outline/GlobeAltIcon";import"eventemitter3";const B={component:function(){let B=v(),{closePrivyModal:D,createAnalyticsEvent:M,connectors:P}=I(),{navigate:$,setModalData:H,data:O}=j(),_=v(),q=o(!1),Q=W(),[V,z]=a(!1),[G,X]=a(!1),[Y,J]=a(null),[K,Z]=a(),[ee,te]=a();if(!O?.funding||"ethereum"!==O.funding.chainType)throw Error("Invalid funding data");let{amount:ne,connectedWallet:re,chain:oe,solanaChain:ae,isUSDC:ie}=O.funding,se=O.funding.address,le=O.funding.erc20Address,de=O.funding.isUSDC?"USDC":oe.nativeCurrency.symbol,ce=i((()=>"solana"===re?.type?re.provider:function({connectors:e,connectedWalletAddress:t}){let n=e.find((e=>"solana"===e.chainType&&e.wallets.some((e=>e.address===t)))),r=n?.wallet.accounts.find((e=>e.address===t));if(!n||!r)throw new C("Unable to find source wallet connector");return new d({wallet:n.wallet,account:r})}({connectors:P,connectedWalletAddress:re?.address||""})),[re,P]),me=i((()=>{let e=Q(k);if(!e)throw new C("Unable to load solana plugin");let t=B.solanaRpcs["solana:mainnet"];if(!t)throw new C("Unable to load mainnet RPC");return e.getSolanaRpcClient({rpc:t.rpc,rpcSubscriptions:t.rpcSubscriptions,chain:"solana:mainnet",blockExplorerUrl:t.blockExplorerUrl??"https://explorer.solana.com"})}),[]),ue=T(L(ce?.standardWallet.name||"unknown")),pe=ue?.name||"wallet";return s((()=>{(async function(){if(!ce||!oe||q.current)return;let e=Q(k);if(!e)return void J(new C("Unable to solana plugin"));q.current=!0,oe?.testnet&&console.warn("Solana testnets are not supported for bridging");let t=ie?1e6*parseFloat(ne):l(ne),n=await b({isTestnet:!!oe.testnet,input:N({appId:_.id,amount:t.toString(),user:ce.address,recipient:se,destinationChainId:oe.id,originChainId:E,originCurrency:ie?F:U,destinationCurrency:ie?le:void 0})}).catch(console.error);if(!n)return void J(new C(`Unable to fetch quotes for bridging. Wallet ${S(ce.address)} does not have enough funds.`,void 0,y.INSUFFICIENT_BALANCE));let r=await e.createTransactionFromRelayQuote({quote:n,source:ce.address,solanaClient:me});if(r)try{z(!0);let t=await e.simulateTransaction({solanaClient:me,tx:r});if(t.hasError)return t.hasFunds?(console.error("Transaction failed:",t.error),void J(new C("Something went wrong",void 0,y.TRANSACTION_FAILURE))):void J(new C(`Wallet ${S(ce?.address)} does not have enough funds. ${n.details.currencyIn.amountFormatted} ${de} are needed to complete the transaction.`,void 0,y.INSUFFICIENT_BALANCE));let{signature:o}=await ce.signAndSendTransaction({chain:"solana:mainnet",transaction:r}),a=e.getAddressFromBuffer(o);Z(a),te("pending")}catch(e){if(console.error(e),/user rejected the request/gi.test(e.message||""))return void J(new C("Transaction was rejected by the user",void 0,y.TRANSACTION_FAILURE));J(new C("Something went wrong",void 0,y.TRANSACTION_FAILURE))}else J(new C(`Unable to select bridge option from quotes. Wallet ${S(ce.address)} does not have enough funds.`,void 0,y.INSUFFICIENT_BALANCE))})().catch(console.error)}),[]),x({transactionHash:K,isTestnet:!1,bridgingStatus:ee,setBridgingStatus:te,onSuccess({transactionHash:e}){z(!1),X(!0),M({eventName:A,payload:{provider:"external",status:"success",txHash:e,address:ce.address,chainType:"solana",clusterName:ae,token:"SOL",destinationAddress:se,destinationChainId:oe.id,destinationChainType:"ethereum",destinationValue:ne,destinationToken:ie?"USDC":"ETH"}})},onFailure({error:e}){z(!1),J(e)}}),s((()=>{if(!G)return;let e=setTimeout(D,w);return()=>clearTimeout(e)}),[G]),s((()=>{Y&&(H({funding:O?.funding,solanaFundingData:O?.solanaFundingData,sendTransaction:O?.sendTransaction,errorModalData:{error:Y,previousScreen:"TransferFromWalletScreen"}}),$("ErrorScreen",!1))}),[Y]),G?/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(h,{}),/*#__PURE__*/t(c,{}),/*#__PURE__*/e(m,{children:[/*#__PURE__*/t(r,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/t(f,{title:"Success!",description:`You’ve successfully added ${ne} ${de} to your ${_.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/t(u,{}),/*#__PURE__*/t(p,{})]}):V&&ce?/*#__PURE__*/t(R,{walletClientType:L(ce?.standardWallet.name||"unknown"),displayName:pe,addressToFund:se,isBridging:V,isErc20Flow:!1,chainId:oe.id,chainName:oe.name,totalPriceInUsd:void 0,totalPriceInNativeCurrency:void 0,gasPriceInUsd:void 0,gasPriceInNativeCurrency:void 0}):
|
|
2
2
|
/*#__PURE__*/e(n,{children:[/*#__PURE__*/t(h,{}),/*#__PURE__*/t(g,{}),/*#__PURE__*/t("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/t(p,{})]})}};export{B as AwaitingSolToEvmBridgingScreen,B as default};
|
package/dist/esm/{BridgeNetworkSelectionView-Bu0vi9_a.mjs → BridgeNetworkSelectionView-DXjTVIcQ.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createPublicClient as e,http as r}from"viem";import{UsdcAddressMap as o,formatWalletAddress as a}from"@privy-io/js-sdk-core";import{a as n}from"./getPublicClient-
|
|
1
|
+
import{createPublicClient as e,http as r}from"viem";import{UsdcAddressMap as o,formatWalletAddress as a}from"@privy-io/js-sdk-core";import{a as n}from"./getPublicClient-C_l_ocJu.mjs";import{g as i}from"./getErc20Balance-Cl5jZN3g.mjs";import{jsx as t,jsxs as s,Fragment as c}from"react/jsx-runtime";import{useRef as m}from"react";import{a as l}from"./Button-OlK_6fKk.mjs";import{b as d,R as p}from"./Layouts-Bmf8DxNP.mjs";import{B as h}from"./ModalHeader-CxHK1IKF.mjs";import{t as f}from"./FundWalletMethodHeader-RY6-H-Ry.mjs";import{R as g}from"./Row-CG0lSY5Z.mjs";import{E as u}from"./ErrorMessage-Cx8GKGhL.mjs";import{V as b,L as y}from"./Value-B4M62ove.mjs";import{S as v}from"./Subtitle-DkvfP2Ev.mjs";import{T as C}from"./Title-D0pfZff-.mjs";import w from"@heroicons/react/24/outline/WalletIcon";import{styled as j}from"styled-components";import{g as N}from"./getChainName-DjpPdUSc.mjs";import{C as I}from"./Chip-Bsgj4Yc-.mjs";import{N as k}from"./NetworkIcon-B48ilzF8.mjs";import{B as x,a as B}from"./shared-CtYf3O54.mjs";import{Menu as S,MenuButton as T,MenuItems as A,MenuItem as E}from"@headlessui/react";import $ from"@heroicons/react/24/outline/ChevronDownIcon";import{f as F}from"./formatErc20TokenAmount-BuPk9xcy.mjs";import{g as M}from"./ethers-oRuqwv5W.mjs";import{F as P,a as W,b as L,c as R,d as z}from"./styles-DY17fuAX.mjs";const H=({chains:a,appId:t,address:s,rpcConfig:c,includeUsdc:m})=>Promise.all(a.map((async a=>{let l=e({chain:a,transport:r(n(a,c,t))}),d=await l.getBalance({address:s}).catch((()=>0n)),p=null,h=o[a.id];if(m&&h){let{balance:e}=await i({address:s,chain:a,rpcConfig:c,appId:t,erc20Address:h});p=e}return{balance:d,erc20Balance:p,erc20Address:h,chain:a}}))),Q=({balance:e,className:r,chain:o})=>/*#__PURE__*/t(x,{className:r,$state:void 0,children:/*#__PURE__*/t(U,{balance:e,chain:o})}),U=({balance:e,chain:r})=>/*#__PURE__*/s(c,{children:[/*#__PURE__*/s(V,{children:[/*#__PURE__*/t(D,{chainId:"object"==typeof r?r.id:"solana"}),/*#__PURE__*/t(b,{children:"object"==typeof r?r.name:N(r)})]}),/*#__PURE__*/s(I,{isLoading:!1,isPulsing:!1,color:"gray",children:[/*#__PURE__*/t(q,{children:/*#__PURE__*/t(w,{})}),e]})]});let V=/*#__PURE__*/j.div.withConfig({displayName:"Container",componentId:"sc-63f80cee-0"})(["display:flex;align-items:center;"]),q=/*#__PURE__*/j.div.withConfig({displayName:"IconContainer",componentId:"sc-63f80cee-1"})(["height:0.75rem;width:0.75rem;margin-right:0.2rem;"]),D=/*#__PURE__*/j(k).withConfig({displayName:"StyledNetworkIcon",componentId:"sc-63f80cee-2"})(["height:1.25rem;width:1.25rem;display:inline-block;margin-right:0.5rem;border-radius:4px;"]);const O=({options:e,onSelect:r,selected:o,className:a})=>/*#__PURE__*/s(S,{as:Y,children:[/*#__PURE__*/s(T,{as:X,children:[/*#__PURE__*/t(U,{balance:o.balance,chain:o.chain}),/*#__PURE__*/t(K,{height:16})]}),/*#__PURE__*/t(A,{as:G,className:a,children:e.map(((e,o)=>/*#__PURE__*/t(E,{as:J,onClick:()=>r(o),children:/*#__PURE__*/t(U,{balance:e.balance,chain:e.chain})},o)))})]});let Y=/*#__PURE__*/j.div.withConfig({displayName:"Wrapper",componentId:"sc-31c00f79-0"})(["width:100%;position:relative;"]),G=/*#__PURE__*/j.div.withConfig({displayName:"Popover",componentId:"sc-31c00f79-1"})(["width:100%;margin-top:0.5rem;position:absolute;background-color:var(--privy-color-background);border-radius:var(--privy-border-radius-md);overflow-x:hidden;overflow-y:auto;box-shadow:0px 1px 2px 0px rgba(16,24,40,0.05);max-height:11.75rem;&&{border:solid 1px var(--privy-color-foreground-4);}z-index:1;"]),J=/*#__PURE__*/j.button.withConfig({displayName:"Button",componentId:"sc-31c00f79-2"})(["width:100%;display:flex;justify-content:space-between;&&{padding:1rem;}:not(:last-child){border-bottom:solid 1px var(--privy-color-foreground-4);}:hover{background:var(--privy-color-background-2);}"]),K=/*#__PURE__*/j($).withConfig({displayName:"StyledChevronIcon",componentId:"sc-31c00f79-3"})(["height:1rem;margin-left:0.5rem;"]),X=/*#__PURE__*/j.button.withConfig({displayName:"StyledMenuButton",componentId:"sc-31c00f79-4"})([""," span{margin-left:auto;}","{transition:rotate 100ms ease-in;}&[aria-expanded='true']{","{rotate:-180deg;}}"],B,K,K);const Z=({displayName:e,errorMessage:r,configuredFundingChain:o,formattedBalance:n,fundingAmount:i,fundingCurrency:b,fundingAmountInUsd:w,options:j,selectedOption:I,isPreparing:k,isSubmitting:x,addressToFund:B,fundingWalletAddress:S,onSubmit:T,onSelect:A,onAmountChange:E,erc20ContractInfo:$})=>{let H=m(null);/*#__PURE__*/return s(c,{children:[/*#__PURE__*/t(f,{}),/*#__PURE__*/t(d,{}),/*#__PURE__*/t(C,{children:"Transfer from another network"}),/*#__PURE__*/s(v,{children:["You need more funds on the"," ","object"==typeof o?o.name:N(o)," ","network. Bridge from another blockchain network."]}),/*#__PURE__*/s(P,{style:{marginTop:"2rem"},children:[/*#__PURE__*/s(W,{onClick:()=>H.current?.focus(),children:[/*#__PURE__*/t(L,{ref:H,value:i,onChange:e=>{let r=e.target.value;if(/^[0-9.]*$/.test(r)&&r.split(".").length-1<=1){let e=/\.$/.test(r)?".":"",o=Number(r.replace(/\.$/,"")||"0");if(Number.isNaN(o))return void E("0");E(o.toString()+e)}}}),/*#__PURE__*/t(R,{children:b})]}),w&&/*#__PURE__*/t(z,{children:w})]}),/*#__PURE__*/s(g,{style:{marginTop:"1.5rem"},children:[/*#__PURE__*/t(y,{children:"From"}),/*#__PURE__*/t(y,{children:a(S)})]}),/*#__PURE__*/t(O,{selected:{chain:I.chain,balance:I.isErc20Quote?F({amount:I.erc20Balance??0n,decimals:$?.decimals??6})+` ${$?.symbol||""}`:M(I.balance,I.chain.nativeCurrency.symbol,3,!0)},options:j.map((({chain:e,balance:r,isErc20Quote:o,erc20Balance:a})=>({chain:e,balance:o?F({amount:a??0n,decimals:$?.decimals??6})+` ${$?.symbol||""}`:M(r,e.nativeCurrency.symbol,3,!0)}))),onSelect:A}),/*#__PURE__*/s(g,{style:{marginTop:"1.5rem"},children:[/*#__PURE__*/t(y,{children:"To"}),/*#__PURE__*/t(y,{children:a(B)})]}),/*#__PURE__*/t(Q,{chain:o,balance:n}),/*#__PURE__*/t(u,{style:{marginTop:"1rem"},children:r}),/*#__PURE__*/s(l,{style:{marginTop:"1rem"},loading:x||k,disabled:k||x,onClick:T,children:["Confirm with ",e]}),/*#__PURE__*/t(p,{}),/*#__PURE__*/t(h,{})]})};export{Z as B,H as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as r,jsxs as o,Fragment as e}from"react/jsx-runtime";import{styled as a,css as l}from"styled-components";import{G as d}from"./useActiveWallet-
|
|
1
|
+
import{jsx as r,jsxs as o,Fragment as e}from"react/jsx-runtime";import{styled as a,css as l}from"styled-components";import{G as d}from"./useActiveWallet-Bj-s666H.mjs";const c=({variant:o="primary",size:e="lg",children:a,success:l,...d})=>{switch(o){case"secondary":/*#__PURE__*/return r(b,{size:e,...d,children:a});case"error":/*#__PURE__*/return r(b,{$warn:!0,size:e,...d,children:a});case"muted":/*#__PURE__*/return r(p,{size:e,...d,children:a});default:/*#__PURE__*/return r(n,{size:e,success:l,...d,children:a})}},i=/*#__PURE__*/a.button.withConfig({displayName:"BaseButton",componentId:"sc-e537b447-0"})(["display:flex;flex-direction:row;align-items:center;justify-content:center;user-select:none;&{width:auto;cursor:pointer;border-radius:",";font-size:14px;font-style:normal;font-weight:500;line-height:22px;letter-spacing:-0.016px;}&&{height:",";padding:0 ",";}"],(({$size:r})=>"sm"===r?"6px":"var(--privy-border-radius-sm)"),(({$size:r})=>"sm"===r?"28px":"48px"),(({$size:r})=>"sm"===r?"10px":"16px")),n=({children:a,loading:l,disabled:c,success:i,size:n="lg",loadingText:t="Loading...",as:s,onClick:b,...p})=>{let u="a"===s,y=!(!l&&!c);/*#__PURE__*/return r(v,{as:s,disabled:u?void 0:y,"aria-disabled":u?y:void 0,$success:i,$size:n,onClick:r=>{u&&y?r.preventDefault():b?.(r)},...p,children:l?/*#__PURE__*/o(e,{children:[/*#__PURE__*/r(d,{}),t?/*#__PURE__*/r("span",{style:{marginLeft:"8px"},children:t}):null]}):a})},t=({children:o,loading:e,disabled:a,...l})=>/*#__PURE__*/r(s,{disabled:a,...l,children:e?/*#__PURE__*/r(d,{color:"var(--privy-color-foreground-accent)"}):o});let s=/*#__PURE__*/a(i).withConfig({displayName:"StyledPrimaryButtonWithoutGray",componentId:"sc-e537b447-1"})(["position:relative;&&{background-color:var(--privy-color-accent);color:var(--privy-color-foreground-accent);transition:background-color 200ms ease;}&:hover{background-color:var(--privy-color-accent-dark);}&:active{background-color:var(--privy-color-accent-dark);}&:disabled,&:hover:disabled,&:active:disabled{cursor:not-allowed;color:var(--privy-color-foreground-disabled);background-color:var(--privy-color-accent-dark);}"]),v=/*#__PURE__*/a(i).withConfig({displayName:"StyledPrimaryButton",componentId:"sc-e537b447-2"})(["position:relative;&&{background-color:",";color:var(--privy-color-foreground-accent);transition:background-color 200ms ease;}&:hover{background-color:",";}&:active{background-color:",";}&:focus{outline:none;box-shadow:0 0 0 3px #949df9;}&:disabled{background-color:var(--privy-color-background-2);border:1px solid var(--privy-color-border-default);color:var(--privy-color-foreground-disabled);cursor:not-allowed;}&:hover:disabled,&:active:disabled{background-color:var(--privy-color-background-2);border:1px solid var(--privy-color-border-default);color:var(--privy-color-foreground-disabled);cursor:not-allowed;}",""],(r=>r.$warn?"var(--privy-color-error-dark)":"var(--privy-color-accent)"),(r=>r.$warn?"var(--privy-color-error-dark)":"var(--privy-color-accent-dark)"),(r=>r.$warn?"var(--privy-color-error-dark)":"var(--privy-color-accent-dark)"),(r=>r.disabled&&/*#__PURE__*/l(["&&&,&&&:hover,&&&:active{background-color:var(--privy-color-background-2);border:1px solid var(--privy-color-border-default);color:var(--privy-color-foreground-disabled);cursor:not-allowed;}"])));const b=({children:a,loading:l,disabled:c,size:i="lg",loadingText:n="Loading...",as:t,onClick:s,...v})=>{let b="a"===t,p=!(!l&&!c);/*#__PURE__*/return r(u,{as:t,disabled:b?void 0:p,"aria-disabled":b?p:void 0,$size:i,onClick:r=>{b&&p?r.preventDefault():s?.(r)},...v,children:l?/*#__PURE__*/o(e,{children:[/*#__PURE__*/r(d,{}),n?/*#__PURE__*/r("span",{style:{marginLeft:"8px"},children:n}):null]}):a})},p=({children:a,loading:l,disabled:c,size:i="lg",loadingText:n="Loading...",as:t,onClick:s,...v})=>{let b="a"===t,p=!(!l&&!c);/*#__PURE__*/return r(y,{as:t,disabled:b?void 0:p,"aria-disabled":b?p:void 0,$size:i,onClick:r=>{b&&p?r.preventDefault():s?.(r)},...v,children:l?/*#__PURE__*/o(e,{children:[/*#__PURE__*/r(d,{}),n?/*#__PURE__*/r("span",{style:{marginLeft:"8px"},children:n}):null]}):a})};let u=/*#__PURE__*/a(i).withConfig({displayName:"StyledSecondaryButton",componentId:"sc-e537b447-3"})(["&&{border-width:1px;border-style:solid;border-color:",";background-color:var(--privy-color-background);color:",";transition:border-color 200ms ease,color 200ms ease,background-color 200ms ease;}&:hover{border-color:",";background-color:",";color:",";}&:active{border-color:",";background-color:",";color:",";}&:disabled{border-color:var(--privy-color-border-default);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-disabled);cursor:not-allowed;}&:hover:disabled,&:active:disabled{border-color:var(--privy-color-border-default);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-disabled);cursor:not-allowed;}",""],(r=>r.$warn?"var(--privy-color-border-error)":"var(--privy-color-accent)"),(r=>r.$warn?"var(--privy-color-error-dark)":"var(--privy-color-accent)"),(r=>r.$warn?"var(--privy-color-border-error)":"var(--privy-color-border-interactive-hover)"),(r=>r.$warn?"var(--privy-color-error-light)":"var(--privy-color-info-bg-hover)"),(r=>r.$warn?"var(--privy-color-error-dark)":"var(--privy-color-accent)"),(r=>r.$warn?"var(--privy-color-border-error)":"var(--privy-color-border-interactive)"),(r=>r.$warn?"var(--privy-color-error-bg-hover)":"var(--privy-color-info-bg)"),(r=>r.$warn?"var(--privy-color-error-dark)":"var(--privy-color-accent)"),(r=>r.disabled&&/*#__PURE__*/l(["&&&,&&&:hover,&&&:active{border-color:var(--privy-color-border-default);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-disabled);cursor:not-allowed;}"]))),y=/*#__PURE__*/a(i).withConfig({displayName:"StyledMutedButton",componentId:"sc-e537b447-4"})(["&&{border-width:1px;border-style:solid;border-color:var(--privy-color-border-default);background-color:transparent;color:var(--privy-color-text-muted);transition:border-color 200ms ease,color 200ms ease,background-color 200ms ease;}&:hover{border-color:var(--privy-color-border-default);background-color:var(--privy-color-info-bg-hover);color:var(--privy-color-foreground-2);}&:active{border-color:var(--privy-color-border-default);background-color:var(--privy-color-info-bg);color:var(--privy-color-foreground-2);}&:focus{outline:none;box-shadow:0 0 0 3px #949df9;}&:disabled{border-color:var(--privy-color-border-default);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-disabled);cursor:not-allowed;}&:hover:disabled,&:active:disabled{border-color:var(--privy-color-border-default);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-disabled);cursor:not-allowed;}",""],(r=>r.disabled&&/*#__PURE__*/l(["&&&,&&&:hover,&&&:active{border-color:var(--privy-color-border-default);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-disabled);cursor:not-allowed;}"])));const g=({children:e,onClick:a,disabled:l,isSubmitting:c,...i})=>/*#__PURE__*/o(f,{$isSubmitting:c,onClick:a,disabled:l,...i,children:[/*#__PURE__*/r("span",{children:e}),
|
|
2
2
|
/*#__PURE__*/r("span",{children:/*#__PURE__*/r(d,{})})]});let f=/*#__PURE__*/a.button.withConfig({displayName:"StyledEmbeddedButton",componentId:"sc-e537b447-7"})(["&&{color:var(--privy-color-accent);font-size:16px;font-style:normal;font-weight:500;line-height:24px;cursor:pointer;border-radius:0px var(--privy-border-radius-mdlg) var(--privy-border-radius-mdlg) 0px;border:none;transition:color 200ms ease;@media (min-width:441px){font-size:14px;}:hover{color:var(--privy-color-accent-dark);}&& > :first-child{opacity:",";}&& > :last-child{position:absolute;display:flex;top:50%;left:50%;transform:translate3d(-50%,-50%,0);opacity:",";}:disabled,:hover:disabled{color:var(--privy-color-foreground-disabled);cursor:not-allowed;}}"],(r=>r.$isSubmitting?0:1),(r=>r.$isSubmitting?1:0));export{c as B,g as E,n as P,b as S,t as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{CheckCircle as t,XCircle as r}from"lucide-react";import{useMemo as i,useRef as o,useState as a,useEffect as s}from"react";import{a as n,C as c}from"./index-CCrVHfyv.mjs";import{a as m}from"./get-is-unified-wallet-DXko-EzF.mjs";import{S as u}from"./ScreenLayout-pthdsODa.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-Bj-s666H.mjs";import"zustand";import"./context-B4VZqX5H.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"./internal-context-DLZicboG.mjs";import"ofetch";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-BSIhOAz8.mjs";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMn1PaPp.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-J1po7l19.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-OlK_6fKk.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const p=({status:o,title:a,description:s,userIntentRequired:n,retriesRemaining:c,hasSelectedCta:m,onContinue:p,onRetry:l})=>{let d=i((()=>{switch(o){case"loading":default:return;case"success":return n?{label:m?"Continuing...":"Continue",onClick:p,disabled:m,loading:m}:void 0;case"error":return c>0?{label:"Retry",onClick:l}:void 0}}),[o,m,p,l]),g=i((()=>({loading:"loading",ready:"subtle",disabled:"subtle",success:"success",error:"error"}[o]||"loading")),[o]);/*#__PURE__*/return e(u,{icon:"loading"===o||"ready"===o?void 0:"success"===o?t:r,iconVariant:g,title:a,subtitle:s,primaryCta:d,watermark:!0})},l={component:()=>{let{lastScreen:t,data:r,navigate:i,setModalData:u}=m(),{status:l,token:d,waitForResult:g,reset:y,execute:h}=n(),v=o([]),j=e=>{v.current=[e,...v.current]},[C,f]=a(!0);s((()=>(j(setTimeout(f,1e3,!1)),()=>{v.current.forEach((e=>clearTimeout(e))),v.current=[]})),[]);let[b,k]=a(""),[w,R]=a("Checking that you are a human..."),[S,I]=a(!1),[T,x]=a(3),A=r?.captchaModalData,M=async e=>{try{await(A?.callback(e)),A?.onSuccessNavigateTo&&i(A?.onSuccessNavigateTo,!1)}catch(e){if(e instanceof c)return;u({errorModalData:{error:e,previousScreen:t||"LandingScreen"}}),i(A?.onErrorNavigateTo||"ErrorScreen",!1)}};s((()=>{"success"===l?j(setTimeout((async()=>{let e=await g();!e||A?.userIntentRequired||M(e)}),1e3)):"ready"===l&&j(setTimeout((()=>{"ready"===l&&h()}),500))}),[l]),s((()=>{if(!C)switch(l){case"success":k("Success!"),R("CAPTCHA passed successfully."),A?.userIntentRequired||setTimeout((()=>{I(!0),M(d)}),2e3);break;case"loading":k(""),R("Checking that you are a human...");break;case"error":k("Something went wrong"),R(T<=0?"If you use an adblocker or VPN, try disabling and re-attempting.":"You did not pass CAPTCHA. Please try again.")}}),[l,C,S]);/*#__PURE__*/return e(p,{status:l,title:b,description:w,userIntentRequired:A?.userIntentRequired,retriesRemaining:T,hasSelectedCta:S,onContinue:()=>{I(!0),M(d)},onRetry:async()=>{if(T<=0)return;x((e=>e-1)),y(),h();let e=await g();!e||A?.userIntentRequired||M(e)}})}};export{l as CaptchaScreen,p as CaptchaScreenView,l as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import o from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import i from"@heroicons/react/24/solid/CheckCircleIcon";import{useState as n,useRef as a,useEffect as s,useMemo as c}from"react";import{styled as m}from"styled-components";import{P as l}from"./Button-OlK_6fKk.mjs";import{a as d}from"./Layouts-Bmf8DxNP.mjs";import{L as p,a7 as u}from"./useActiveWallet-Bj-s666H.mjs";import{M as f,B as g}from"./ModalHeader-CxHK1IKF.mjs";import{u as h}from"./internal-context-DLZicboG.mjs";import{a as v}from"./get-is-unified-wallet-DXko-EzF.mjs";import{O as y}from"./analytics-mkkvFRju.mjs";import{G as b}from"./index-CCrVHfyv.mjs";import"zustand";import"./context-B4VZqX5H.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"ofetch";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-BSIhOAz8.mjs";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMn1PaPp.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-J1po7l19.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";const w={component:()=>{let{data:o,setModalData:i,navigate:c,navigateBack:m}=v(),{closePrivyModal:l,createAnalyticsEvent:d,client:p}=h(),[u,b]=n("pending-in-flow"),w=a(0),C={...o?.funding,showAlternateFundingMethod:!0};C.usingDefaultFundingMethod&&(C.usingDefaultFundingMethod=!1);let{partnerUserId:I,popup:k}=o?.coinbaseOnrampStatus??{};return s((()=>{if("pending-in-flow"===u||"pending-after-flow"===u){let e=setInterval((async()=>{if(I)try{let{status:e}=await p.getCoinbaseOnRampStatus({partnerUserId:I});if("success"===e)return void b("success");if("failure"===e)throw Error("There was an error completing Coinbase Onramp flow.");if(w.current>=3)return i({funding:C,solanaFundingData:o?.solanaFundingData}),void c("FundingMethodSelectionScreen");k?.closed&&(w.current=w.current+1,b("pending-after-flow"))}catch(e){console.error(e),b("error"),d({eventName:y,payload:{status:"failure",provider:"coinbase-onramp",error:e.message}}),i({funding:{...C,errorMessage:"Something went wrong adding funds. Please try again or use another method."},solanaFundingData:o?.solanaFundingData}),c("FundingMethodSelectionScreen")}}),1500);return()=>clearInterval(e)}}),[I,k,u]),/*#__PURE__*/e(r,{children:[/*#__PURE__*/t(f,{title:"Fund account",backFn:()=>{i({funding:C,solanaFundingData:o?.solanaFundingData}),m()}},"header"),/*#__PURE__*/t(j,{status:u,onClickCta:l}),/*#__PURE__*/t(g,{})]})}};let j=({status:o,onClickCta:i})=>{let{title:n,body:a,cta:s}=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:""}}})(o)),[o]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(k,{children:[/*#__PURE__*/t(C,{isSucccess:"success"===o}),/*#__PURE__*/e(d,{children:[/*#__PURE__*/t("h3",{children:n}),/*#__PURE__*/t(I,{children:a})]})]}),s&&/*#__PURE__*/t(l,{onClick:i,children:s})]})},C=({isSucccess:r})=>{if(!r){let r="var(--privy-color-foreground-4)";/*#__PURE__*/return e("div",{style:{position:"relative"},children:[/*#__PURE__*/t(p,{color:r,style:{position:"absolute"}}),/*#__PURE__*/t(u,{color:r}),/*#__PURE__*/t(b,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let n=r?i:()=>/*#__PURE__*/t(o,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),a=r?"var(--privy-color-success)":"var(--privy-color-foreground-4)";/*#__PURE__*/return t("div",{style:{borderColor:a,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:n&&/*#__PURE__*/t(n,{width:"4rem",height:"4rem",color:a})})},I=/*#__PURE__*/m.p.withConfig({displayName:"StatusBody",componentId:"sc-e4350fdc-0"})(["font-size:1rem;color:var(--privy-color-foreground-3);margin-bottom:1rem;display:flex;flex-direction:column;gap:1rem;"]),k=/*#__PURE__*/m.div.withConfig({displayName:"ConnectContainer",componentId:"sc-e4350fdc-1"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;margin-left:1.75rem;margin-right:1.75rem;padding:2rem 0;"]);export{w as CoinbaseOnrampStatusScreen,w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,Fragment as a,jsx as r}from"react/jsx-runtime";import{Mail as i}from"lucide-react";import{forwardRef as t,useState as o,useEffect as n}from"react";import{styled as l}from"styled-components";import{u as s}from"./context-
|
|
1
|
+
import{jsxs as e,Fragment as a,jsx as r}from"react/jsx-runtime";import{Mail as i}from"lucide-react";import{forwardRef as t,useState as o,useEffect as n}from"react";import{styled as l}from"styled-components";import{u as s}from"./context-B4VZqX5H.mjs";import{u as c,c as m,b as d}from"./internal-context-DLZicboG.mjs";import{a as p}from"./index-CCrVHfyv.mjs";import{u,a as h}from"./get-is-unified-wallet-DXko-EzF.mjs";import{F as g,a1 as f,V as y}from"./useActiveWallet-Bj-s666H.mjs";import{E as S,P as E}from"./Button-OlK_6fKk.mjs";import{C as b}from"./Chip-Bsgj4Yc-.mjs";import{I as v,a as k}from"./EmailInputForm-B4hjCxRU.mjs";import{E as C}from"./ErrorMessage-Cx8GKGhL.mjs";const j=/*#__PURE__*/t(((t,l)=>{let[y,v]=o(t.defaultValue||""),[k,j]=o(""),[I,L]=o(!1),{authenticated:T}=u(),{initLoginWithEmail:A}=c(),{navigate:M,setModalData:D,currentScreen:N,data:U}=h(),{enabled:W,token:F}=p(),[R,V]=o(!1),{accountType:$}=g(),_=s();n((()=>{!y&&_.disablePlusEmails&&U?.inlineError?.error instanceof m&&U?.inlineError?.error.privyErrorCode===d.DISALLOWED_PLUS_EMAIL&&!k&&j("Please enter a valid email address without a '+'."),k&&j("")}),[y]);let q=f(y),z=I||!q,B=()=>{var e;D({login:U?.login,inlineError:void 0}),!W||F||T?(e=F,L(!0),A({email:y,captchaToken:e,disableSignup:U?.login?.disableSignup,withPrivyUi:!0}).then((()=>{M("AwaitingPasswordlessCodeScreen")})).catch((e=>{D({errorModalData:{error:e,previousScreen:N||"LandingScreen"}}),M("ErrorScreen")})).finally((()=>{L(!1)}))):(D({captchaModalData:{callback:e=>A({email:y,captchaToken:e,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),M("CaptchaScreen"))};/*#__PURE__*/return e(a,{children:[/*#__PURE__*/e(w,{children:[k&&/*#__PURE__*/r(C,{style:{display:"block",marginTop:"0.25rem",textAlign:"left"},children:k}),/*#__PURE__*/e(x,{stacked:t.stacked,$error:!!k,children:[/*#__PURE__*/r(P,{children:/*#__PURE__*/r(i,{})}),/*#__PURE__*/r("input",{ref:l,id:"email-input",className:"login-method-button",type:"email",placeholder:"your@email.com",onFocus:()=>V(!0),onChange:e=>v(e.target.value),onKeyUp:e=>{"Enter"===e.key&&B()},value:y,autoComplete:"email"}),"email"!==$||R?t.stacked?/*#__PURE__*/r("span",{}):/*#__PURE__*/r(S,{isSubmitting:I,onClick:B,disabled:z,children:"Submit"}):/*#__PURE__*/r(b,{color:"gray",children:"Recent"})]})]}),t.stacked?/*#__PURE__*/r(E,{loadingText:null,loading:I,disabled:z,onClick:B,style:{width:"100%"},children:"Submit"}):null]})}));let w=v,x=k,P=/*#__PURE__*/l(y).withConfig({displayName:"StyledLoginMethodIconWrapper",componentId:"sc-30d3bab7-0"})(["display:inline-flex;"]);export{j as C};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t,jsxs as e}from"react/jsx-runtime";import{ArrowRightLeft as i}from"lucide-react";import{styled as o}from"styled-components";import{a as r}from"./get-is-unified-wallet-DXko-EzF.mjs";import{S as n}from"./ScreenLayout-pthdsODa.mjs";import{F as m}from"./index-CCrVHfyv.mjs";import"viem";import"react";import"./context-B4VZqX5H.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-DLZicboG.mjs";import"ofetch";import"./Button-OlK_6fKk.mjs";import"./useActiveWallet-Bj-s666H.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-BSIhOAz8.mjs";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMn1PaPp.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-J1po7l19.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";const p=e=>/*#__PURE__*/t("svg",{id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",viewBox:"-0.625 12.48 397.647 399.546",width:"2500",height:"674",preserveAspectRatio:"none",...e,children:/*#__PURE__*/t("g",{children:/*#__PURE__*/t("path",{fill:"#333745",d:"M 333.9 12.8 L 150.9 12.8 L 150.9 258.4 L 396.5 258.4 L 396.5 76.7 C 396.6 42.2 368.4 12.8 333.9 12.8 Z M 94.7 12.8 L 64 12.8 C 29.5 12.8 0 40.9 0 76.8 L 0 107.5 L 94.7 107.5 L 94.7 12.8 Z M 0 165 L 94.7 165 L 94.7 259.7 L 0 259.7 L 0 165 Z M 301.9 410.6 L 332.6 410.6 C 367.1 410.6 396.6 382.5 396.6 346.6 L 396.6 316 L 301.9 316 L 301.9 410.6 Z M 150.9 316 L 245.6 316 L 245.6 410.7 L 150.9 410.7 L 150.9 316 Z M 0 316 L 0 346.7 C 0 381.2 28.1 410.7 64 410.7 L 94.7 410.7 L 94.7 316 L 0 316 Z"})})}),s=({onContinueWithLedger:o,onContinueWithoutLedger:r,title:s="Phantom supports Ledger",subtitle:a="Are you using a Ledger hardware wallet?\nContinue to sign with Ledger"})=>/*#__PURE__*/t(n,{title:s,subtitle:/*#__PURE__*/t(d,{children:a}),primaryCta:{label:"Continue with Ledger",onClick:o},secondaryCta:{label:"Continue without Ledger",onClick:r},watermark:!0,children:/*#__PURE__*/e(l,{children:[/*#__PURE__*/t(m,{style:{width:"48px",height:"48px"}}),/*#__PURE__*/t(i,{strokeWidth:2,color:"var(--privy-color-icon-subtle)",width:22,height:22}),/*#__PURE__*/t(p,{style:{width:"48px",height:"48px"}})]})});function a(){let{data:e,setModalData:i,navigate:o}=r();/*#__PURE__*/return t(s,{onContinueWithLedger:function(){i({...e,login:{...e?.login,isSigningInWithLedgerSolana:!0}}),o("ConnectionStatusScreen")},onContinueWithoutLedger:function(){i({...e,login:{...e?.login,isSigningInWithLedgerSolana:!1}}),o("ConnectionStatusScreen")}})}const c={component:a};let l=/*#__PURE__*/o.div.withConfig({displayName:"IconContainer",componentId:"sc-54536274-0"})(["display:flex;align-items:center;justify-content:center;gap:8px;margin-bottom:var(--screen-space);"]),d=/*#__PURE__*/o.span.withConfig({displayName:"SubtitleText",componentId:"sc-54536274-1"})(["white-space:pre-wrap;"]);export{c as ConnectLedgerScreen,a as ConnectLedgerScreenComponent,s as ConnectLedgerScreenView,c as default};
|
package/dist/esm/{ConnectOnlyLandingScreen-BVkcUaO6.mjs → ConnectOnlyLandingScreen-CjVJO9uh.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as e}from"react/jsx-runtime";import{useRef as t}from"react";import{u as o}from"./context-
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useRef as t}from"react";import{u as o}from"./context-B4VZqX5H.mjs";import{u as r,c as n,b as a}from"./internal-context-DLZicboG.mjs";import{a as i}from"./events-context-CI0iqAXA.mjs";import{a as l}from"./get-is-unified-wallet-DXko-EzF.mjs";import{i as c}from"./ConnectWalletView-tpdAD3K7.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"react-device-detect";import"styled-components";import"./Button-OlK_6fKk.mjs";import"./useActiveWallet-Bj-s666H.mjs";import"zustand";import"./prepareFundingModalData-CndHQFiM.mjs";import"eventemitter3";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"@heroicons/react/24/outline/CheckIcon";import"./copy-Bx2Jwc5_.mjs";import"./ModalHeader-CxHK1IKF.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./QrCode-BI2LxLLg.mjs";import"qrcode";import"./EmailInputForm-B4hjCxRU.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./useI18n-DIAzggWr.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-Dzz_AFFs.mjs";import"./index-CJMgUOnw.mjs";const m={component:()=>{let{closePrivyModal:m}=r(),{data:s,navigate:p}=l(),d=o(),u=i(),C=s?.externalConnectWallet?.description,j=t(s?.externalConnectWallet?.walletList??d.appearance.walletList),E=t(s?.externalConnectWallet?.walletChainType??d.appearance.walletChainType);/*#__PURE__*/return e(c,{walletList:j.current,walletChainType:E.current,preSelectedWalletId:s?.externalConnectWallet?.preSelectedWalletId,hideHeader:s?.externalConnectWallet?.hideHeader,onBack:s?.funding?()=>p("FundingMethodSelectionScreen"):void 0,onClose:()=>{u("connectWallet","onError",a.GENERIC_CONNECT_WALLET_ERROR),m()},onConnect:({connector:e,wallet:t})=>{u("connectWallet","onSuccess",{wallet:t});let o=s?.externalConnectWallet?.onCompleteNavigateTo;o?p(o({address:t.address,walletClientType:e?.walletClientType,walletChainType:e?.chainType})):m()},onConnectError:e=>{e instanceof n?(console.warn(e.cause?e.cause:e.message),u("connectWallet","onError",e.privyErrorCode||a.GENERIC_CONNECT_WALLET_ERROR)):(console.warn(e),u("connectWallet","onError",a.UNKNOWN_CONNECT_WALLET_ERROR))},customDescription:C,app:d,connectOnly:!0})},isUnauthenticatedScreem:!0};export{m as ConnectOnlyLandingScreen,m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as o}from"react";import{isMobile as r}from"react-device-detect";import{C as n}from"./prepareFundingModalData-CndHQFiM.mjs";import{q as i}from"./context-B4VZqX5H.mjs";import{Q as a}from"./useActiveWallet-Bj-s666H.mjs";import{u as s}from"./internal-context-DLZicboG.mjs";import{a as l}from"./get-is-unified-wallet-DXko-EzF.mjs";import{S as c}from"./ScreenLayout-pthdsODa.mjs";import{B as m}from"./index-CCrVHfyv.mjs";import{getErrorDetails as p}from"./ConnectionStatusScreen-B3NfUQx_.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"tinycolor2";import"zustand";import"styled-components";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"ofetch";import"./Button-OlK_6fKk.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-BSIhOAz8.mjs";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMn1PaPp.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-J1po7l19.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Link-DwjLfHwW.mjs";import"./useI18n-DIAzggWr.mjs";import"./shouldProceedtoEmbeddedWalletCreationFlow-DVwf2mAj.mjs";const u=({walletLogo:t,success:o,errorMessage:r,title:i,subtitle:a,onRetry:s,onUseDifferentWallet:l,onBack:m,numRetries:p,maxRetries:u})=>/*#__PURE__*/e(c,{title:i,subtitle:a,icon:t,iconVariant:"loading",iconLoadingStatus:{success:o,fail:!!r},primaryCta:r===n.ERROR_USER_EXISTS?{label:"Use a different wallet",onClick:l}:!o&&r?.retryable&&p<u?{label:"Retry",onClick:s,disabled:!r?.retryable||p>=u}:!o&&r&&p>=u?{label:"Use a different wallet",onClick:l}:void 0,onBack:m,watermark:!0}),d={component:()=>{let n,{navigateBack:c,navigate:d,lastScreen:w,currentScreen:f,data:y,setModalData:g}=l(),{walletConnectionStatus:j,closePrivyModal:v}=s(),[h,C]=t(void 0),[k,b]=t(0),x=a(j?.connector?.walletClientType||"unknown"),S="connected"===j?.status,T="switching_to_supported_chain"===j?.status;o((()=>{if(S){let e;if(y?.externalConnectWallet?.onCompleteNavigateTo){let t=y.externalConnectWallet.onCompleteNavigateTo,o=j.connectedWallet?.address;e=setTimeout((()=>{if(y.funding&&j.connector){let e=j.connector.wallets.find((e=>e.address===o));g({...y,funding:{...y.funding,connectedWallet:e}})}d(t({address:o,walletClientType:j.connector?.walletClientType,walletChainType:j.connector?.chainType}))}),i)}else e=setTimeout(v,i);return()=>clearTimeout(e)}}),[S]);o((()=>{var e;j?.connectError&&(e=j?.connectError,C(p(e)))}),[j]);let R=j?.connector?.connectorType||"injected",B=j?.connector?.walletClientType||"unknown",W=x?.metadata?.shortName||x?.name||j?.connector?.walletBranding.name||"Browser Extension",M=x?.image_url?.md||j?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(m,{...t})),E="Browser Extension"===W?W.toLowerCase():W;n=S?`Successfully connected with ${E}`:h?h.message:T?"Switching networks":`Waiting for ${E}`;let _="Don’t see your wallet? Check your other browser windows.";return S?_="You’re good to go!":k>=2&&h?_="Unable to connect wallet":h?_=h.detail:T?_="Switch your wallet to the requested network.":"metamask"===B&&r?_="Click to continue to open and connect MetaMask.":"metamask"===B?_="For the best experience, connect only one wallet at a time.":"wallet_connect_v2"===R?_="Open your mobile wallet app to continue":"coinbase_wallet"===R&&(_="Confirm in the Coinbase app/popup to continue."),/*#__PURE__*/e(u,{walletName:W,walletLogo:M,success:S,errorMessage:h,title:n,subtitle:_,onRetry:()=>{b(k+1),C(void 0),j?.connectRetry()},onUseDifferentWallet:c,onBack:f===w?void 0:c,numRetries:k,maxRetries:2})}};export{d as ConnectOnlyStatusScreen,u as ConnectOnlyStatusScreenView,d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as t}from"react/jsx-runtime";import{u as o}from"./context-B4VZqX5H.mjs";import{C as r,L as i}from"./CustomLandingScreenView-DZTOg8z4.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"./ModalHeader-CxHK1IKF.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./internal-context-DLZicboG.mjs";import"ofetch";import"./get-is-unified-wallet-DXko-EzF.mjs";import"viem";import"./index-CCrVHfyv.mjs";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-Bj-s666H.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-BSIhOAz8.mjs";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMn1PaPp.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-J1po7l19.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"lucide-react";import"./ConnectEmailForm-C2TJPUYV.mjs";import"./Button-OlK_6fKk.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"./EmailInputForm-B4hjCxRU.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./farcaster-DPlSjvF5.mjs";import"./ConnectWalletView-tpdAD3K7.mjs";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"./copy-Bx2Jwc5_.mjs";import"./QrCode-BI2LxLLg.mjs";import"qrcode";import"./useI18n-DIAzggWr.mjs";import"./WalletCards-DH1rqayz.mjs";import"./Screen-Dzz_AFFs.mjs";import"./index-CJMgUOnw.mjs";import"@heroicons/react/24/outline/FingerPrintIcon";import"./Link-DwjLfHwW.mjs";import"./ConnectPhoneForm-kW8tUq0-.mjs";import"./twitter-6jomarO4.mjs";import"./twitch-5IOe4sIQ.mjs";import"./telegram-B-JqnkqZ.mjs";import"./WalletButtonList-C1OqZHCA.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"@heroicons/react/24/outline/WalletIcon";import"./ScreenLayout-pthdsODa.mjs";const e={component:()=>{let e=o();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?/*#__PURE__*/t(r,{connectOnly:!0}):/*#__PURE__*/t(i,{connectOnly:!0})}};export{e as ConnectOrCreateScreen,e as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsx as o,jsxs as e,Fragment as n}from"react/jsx-runtime";import{forwardRef as
|
|
1
|
+
import{jsx as o,jsxs as e,Fragment as n}from"react/jsx-runtime";import{forwardRef as r,useState as t,useEffect as i}from"react";import{styled as a}from"styled-components";import{countryCodesAndNumbers as d,validatePhoneNumber as l,phoneNumberTypingFormatter as c,getPlaceholderPhoneNumber as p,getCountryCallingCode as u,getPhoneCountryCodeAndNumber as h,formatPhoneNumber as s}from"@privy-io/js-sdk-core";import{u as g}from"./context-B4VZqX5H.mjs";import{F as m}from"./useActiveWallet-Bj-s666H.mjs";import{E as v,P as x}from"./Button-OlK_6fKk.mjs";import{C as b}from"./Chip-Bsgj4Yc-.mjs";const f=({value:n,onChange:r})=>/*#__PURE__*/o("select",{value:n,onChange:r,children:d.map((o=>/*#__PURE__*/e("option",{value:o.code,children:[o.code," +",o.callCode]},o.code)))}),w=/*#__PURE__*/r(((r,a)=>{let d=g(),[w,k]=t(!1),{accountType:N}=m(),[P,S]=t(""),[$,j]=t(d?.intl.defaultCountry??"US"),I=l(P,$),V=c($),z=p($),L=u($),q=!I,[B,E]=t(!1),D=L.length,F=o=>{let e=o.target.value;j(e),S(""),r.onChange&&r.onChange({rawPhoneNumber:P,qualifiedPhoneNumber:s(P,e),countryCode:e,isValid:l(P,$)})},R=(o,e)=>{try{let n=o.replace(/\D/g,"")===P.replace(/\D/g,"")?o:V.input(o);S(n),r.onChange&&r.onChange({rawPhoneNumber:n,qualifiedPhoneNumber:s(o,e),countryCode:e,isValid:l(o,e)})}catch(o){console.error("Error processing phone number:",o)}},T=()=>{E(!0);let o=s(P,$);r.onSubmit({rawPhoneNumber:P,qualifiedPhoneNumber:o,countryCode:$,isValid:l(P,$)}).finally((()=>E(!1)))};return i((()=>{if(r.defaultValue){let o=h(r.defaultValue);V.reset(),F({target:{value:o.countryCode}}),R(o.phone,o.countryCode)}}),[r.defaultValue]),/*#__PURE__*/e(n,{children:[/*#__PURE__*/o(y,{children:/*#__PURE__*/e(C,{$callingCodeLength:D,$stacked:r.stacked,children:[/*#__PURE__*/o(f,{value:$,onChange:F}),/*#__PURE__*/o("input",{ref:a,id:"phone-number-input",className:"login-method-button",type:"tel",placeholder:z,onFocus:()=>k(!0),onChange:o=>{R(o.target.value,$)},onKeyUp:o=>{"Enter"===o.key&&T()},value:P,autoComplete:"tel"}),"phone"!==N||w||r.hideRecent?r.stacked||r.noIncludeSubmitButton?/*#__PURE__*/o("span",{}):/*#__PURE__*/o(v,{isSubmitting:B,onClick:T,disabled:q,children:"Submit"}):/*#__PURE__*/o(b,{color:"gray",children:"Recent"})]})}),r.stacked&&!r.noIncludeSubmitButton?/*#__PURE__*/o(x,{loading:B,loadingText:null,onClick:T,disabled:q,children:"Submit"}):null]})}));let y=/*#__PURE__*/a.div.withConfig({displayName:"InputContainer",componentId:"sc-545daacd-0"})(["width:100%;"]),C=/*#__PURE__*/a.label.withConfig({displayName:"PhoneNumberInput",componentId:"sc-545daacd-1"})(["--country-code-dropdown-width:calc(54px + calc(12 * ","px));--phone-input-extra-padding-left:calc(12px + calc(3 * ","px));display:block;position:relative;width:100%;@media (min-width:441px){--country-code-dropdown-width:calc(52px + calc(10 * ","px));}&& > select{font-size:16px;height:24px;position:absolute;margin:13px calc(var(--country-code-dropdown-width) / 4);line-height:24px;width:var(--country-code-dropdown-width);background-color:var(--privy-color-background);background-size:auto;background-position-x:right;cursor:pointer;@media (min-width:441px){font-size:14px;width:var(--country-code-dropdown-width);}:focus{outline:none;box-shadow:none;}}&& > input{font-size:16px;line-height:24px;color:var(--privy-color-foreground);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;width:calc(100% - var(--country-code-dropdown-width));padding:12px 88px 12px calc(var(--country-code-dropdown-width) + var(--phone-input-extra-padding-left));padding-right:",";flex-grow:1;background:var(--privy-color-background);border:1px solid var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);width:100%;:focus{outline:none;border-color:var(--privy-color-accent);}:autofill,:-webkit-autofill{background:var(--privy-color-background);}@media (min-width:441px){font-size:14px;padding-right:78px;}}&& > :last-child{right:16px;position:absolute;top:50%;transform:translate(0,-50%);}&& > button:last-child{right:0px;line-height:24px;padding:13px 17px;:focus{outline:none;border-color:var(--privy-color-accent);}}&& > input::placeholder{color:var(--privy-color-foreground-3);}"],(o=>o.$callingCodeLength),(o=>o.$callingCodeLength),(o=>o.$callingCodeLength),(o=>o.$stacked?"16px":"88px"));export{w as C};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{MagnifyingGlassIcon as i}from"@heroicons/react/24/outline";import{useVirtualizer as l}from"@tanstack/react-virtual";import{useState as a,useMemo as o,useCallback as r,useRef as c,useEffect as s}from"react";import{isMobile as d}from"react-device-detect";import{styled as h}from"styled-components";import{B as m}from"./Button-DJ-mtuuD.mjs";import p from"@heroicons/react/24/outline/CheckIcon";import{C as u}from"./copy-Bx2Jwc5_.mjs";import{T as g}from"./ModalHeader-D7WajfD8.mjs";import{Q as w}from"./QrCode-zzqjquVm.mjs";import{E as f}from"./EmailInputForm-B4hjCxRU.mjs";import{u as y,q as v}from"./context-Cb5MFcME.mjs";import{u as b}from"./useI18n-ByKvnaXP.mjs";import{M as C,q as x,d as W,e as k,K as T,V as _,w as z,S}from"./useActiveWallet-hrZcON-K.mjs";import{u as L,P as I}from"./internal-context-Cvo1WmWN.mjs";import{W as N}from"./WalletCards-DH1rqayz.mjs";import{W as A,h as B}from"./prepareFundingModalData-BUyu5Vhr.mjs";import{S as E}from"./Screen-dwi2CitY.mjs";let j=/*#__PURE__*/h.button.withConfig({displayName:"CopyTextButton",componentId:"sc-4b0620dc-0"})(["display:flex;align-items:center;gap:0.5rem;&:hover{text-decoration:underline;}svg{width:0.875rem;height:0.875rem;}"]),q=/*#__PURE__*/h.span.withConfig({displayName:"CopiedText",componentId:"sc-4b0620dc-1"})(["display:flex;align-items:center;gap:0.25rem;font-size:0.875rem;color:var(--privy-color-foreground-2);"]),O=/*#__PURE__*/h(p).withConfig({displayName:"GreenCheck",componentId:"sc-4b0620dc-2"})(["color:var(--privy-color-success);"]),U=/*#__PURE__*/h(u).withConfig({displayName:"StyledCopy",componentId:"sc-4b0620dc-3"})(["color:var(--privy-color-foreground-3);opactiy:0.5;"]);function F({children:t,iconOnly:i,value:l,hideCopyIcon:o,...r}){let[c,s]=a(!1);/*#__PURE__*/return e(j,{...r,onClick:()=>{navigator.clipboard.writeText(l||t).catch(console.error),s(!0),setTimeout((()=>s(!1)),1500)},children:[t," ",c?/*#__PURE__*/e(q,{children:[/*#__PURE__*/n(O,{})," ",!i&&"Copied"]}):!o&&/*#__PURE__*/n(U,{})]})}const M={phantom:{mobile:{native:"phantom://",universal:"https://phantom.app/ul/"}},solflare:{mobile:{native:void 0,universal:"https://solflare.com/ul/v1/"}},metamask:{image_url:{sm:C,md:C}}};class Q{static normalize(e){return e.replace(/[-_]wallet$/,"").replace(/[-_]extension$/,"").toLowerCase()}isEth(e){return e.chains.some((e=>e.startsWith("eip155:")))}isSol(e){return e.chains.some((e=>e.startsWith("solana:")))}inAllowList(e,n){if(!this.normalizedAllowList||0===this.normalizedAllowList.length||"listing"===n&&this.includeWalletConnect)return!0;let t=Q.normalize(e);return this.normalizedAllowList.some((e=>t===Q.normalize(e)))}inDenyList(e,n){return"listing"===n&&"rabby"===e}chainMatches(e){return"ethereum-only"===this.chainFilter?"ethereum"===e:"solana-only"!==this.chainFilter||"solana"===e}connectorOk(e){return!!("null"!==e.connectorType&&"walletconnect_solana"!==e.walletBranding.id&&this.chainMatches(e.chainType)&&(this.inAllowList(e.walletClientType,"connector")||("injected"===e.connectorType||"solana_adapter"===e.connectorType)&&("ethereum"===e.chainType&&this.detectedEth||"solana"===e.chainType&&this.detectedSol)))}listingOk(e){if(e.slug.includes("coinbase"))return!1;if("ethereum-only"===this.chainFilter){if(!this.isEth(e))return!1}else if("solana-only"===this.chainFilter&&!this.isSol(e))return!1;return!(!this.inAllowList(e.slug,"listing")||this.inDenyList(e.slug,"listing"))}getWallets(e,n){let t=new Map,i=e=>{let n=t.get(e.id);if(n){n.chainType!==e.chainType&&(n.chainType="multi");let t=new Set(n.chains);e.chains.forEach((e=>t.add(e))),n.chains=Array.from(t),!n.icon&&e.icon&&(n.icon=e.icon),!n.url&&e.url&&(n.url=e.url),!n.listing&&e.listing&&(n.listing=e.listing)}else t.set(e.id,e)};e.filter((e=>this.connectorOk(e))).forEach((e=>{let n=Q.normalize(e.walletClientType);i({id:n,label:e.walletBranding?.name??n,source:"connector",connector:e,chainType:e.chainType,icon:e.walletBranding?.icon,url:void 0,chains:["ethereum"===e.chainType?"eip155":"solana"]})}));let l=e.find((e=>"wallet_connect_v2"===e.connectorType)),a=e.find((e=>"walletconnect_solana"===e.walletBranding.id));n.filter((e=>this.listingOk(e))).forEach((n=>{let t=[...n.chains].filter((e=>e.startsWith("eip155")||e.startsWith("solana")));if(e.some((e=>Q.normalize(e.walletClientType)===Q.normalize(n.slug)&&"ethereum"===e.chainType&&"null"!==e.connectorType))||l||n.mobile.native||n.mobile.universal||x[n.slug]?.chainTypes.includes("ethereum")||(t=t.filter((e=>!e.startsWith("eip155")))),e.some((e=>Q.normalize(e.walletClientType)===Q.normalize(n.slug)&&"solana"===e.chainType&&"null"!==e.connectorType))||a||n.mobile.native||n.mobile.universal||x[n.slug]?.chainTypes.includes("solana")||(t=t.filter((e=>!e.startsWith("solana")))),!t.length)return;let o=Q.normalize(n.slug),r=M[n.slug],c=r?.image_url?.sm||n.image_url?.sm;t.some((e=>e.startsWith("eip155")))&&i({id:o,label:n.name||o,source:"listing",listing:n,chainType:"ethereum",icon:c,url:n.homepage,chains:t}),t.some((e=>e.startsWith("solana")))&&i({id:o,label:n.name||o,source:"listing",listing:n,chainType:"solana",icon:c,url:n.homepage,chains:t})})),this.includeWalletConnectQr&&l&&i({id:"wallet_connect_qr",label:"WalletConnect",source:"connector",connector:l,chainType:"ethereum",icon:A,url:void 0,chains:["eip155"]}),this.includeWalletConnectQrSolana&&a&&i({id:"wallet_connect_qr_solana",label:"WalletConnect",source:"connector",connector:a,chainType:"solana",icon:A,url:void 0,chains:["solana"]});let o=Array.from(t.values());o.forEach((e=>{let n=M[e.listing?.slug||e.id];n?.image_url?.sm&&(e.icon=n.image_url.sm)}));let r=new Map;return this.normalizedAllowList?.forEach(((e,n)=>{r.set(Q.normalize(e),n)})),{wallets:o.slice().sort(((e,n)=>{let t=Q.normalize(e.id),i=Q.normalize(n.id);"binance-defi"===t?t="binance":"universalprofiles"===t?t="universal_profile":"cryptocom-defi"===t?t="cryptocom":"bitkeep"===t&&(t="bitget_wallet"),"binance-defi"===i?i="binance":"universalprofiles"===i?i="universal_profile":"cryptocom-defi"===i?i="cryptocom":"bitkeep"===i&&(i="bitget_wallet");let l=r.has(t),a=r.has(i);return l&&a?r.get(t)-r.get(i):l?-1:a?1:"connector"===e.source&&"listing"===n.source?-1:"listing"===e.source&&"connector"===n.source?1:e.label.toLowerCase().localeCompare(n.label.toLowerCase())})),walletCount:o.length}}constructor(e,n){this.chainFilter=e,n&&n.length>0&&(this.normalizedAllowList=n.map(String),this.normalizedAllowList.includes("binance")&&this.normalizedAllowList.push("binance-defi-wallet"),this.normalizedAllowList.includes("bitget_wallet")&&this.normalizedAllowList.push("bitkeep")),this.detectedEth=this.normalizedAllowList?.includes("detected_ethereum_wallets")??!1,this.detectedSol=this.normalizedAllowList?.includes("detected_solana_wallets")??!1,this.includeWalletConnect=this.normalizedAllowList?.includes("wallet_connect")??!1,this.includeWalletConnectQr=this.normalizedAllowList?.includes("wallet_connect_qr")??!1,this.includeWalletConnectQrSolana=this.normalizedAllowList?.includes("wallet_connect_qr_solana")??!1}}var $=t=>/*#__PURE__*/e("svg",{viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",...t,children:[/*#__PURE__*/n("path",{d:"m0 0h32v32h-32z",fill:"#5469d4"}),/*#__PURE__*/n("path",{d:"m15.997 5.333-.143.486v14.106l.143.143 6.548-3.87z",fill:"#c2ccf4"}),/*#__PURE__*/n("path",{d:"m15.996 5.333-6.548 10.865 6.548 3.87z",fill:"#fff"}),/*#__PURE__*/n("path",{d:"m15.997 21.306-.08.098v5.025l.08.236 6.552-9.227z",fill:"#c2ccf4"}),/*#__PURE__*/n("path",{d:"m15.996 26.665v-5.36l-6.548-3.867z",fill:"#fff"}),/*#__PURE__*/n("path",{d:"m15.995 20.07 6.548-3.87-6.548-2.976v6.847z",fill:"#8698e8"}),/*#__PURE__*/n("path",{d:"m9.448 16.2 6.548 3.87v-6.846z",fill:"#c2ccf4"})]}),P=t=>/*#__PURE__*/e("svg",{viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",...t,children:[/*#__PURE__*/e("linearGradient",{id:"a",gradientUnits:"userSpaceOnUse",x1:"7.233",x2:"24.766",y1:"24.766",y2:"7.234",children:[/*#__PURE__*/n("stop",{offset:"0",stopColor:"#9945ff"}),/*#__PURE__*/n("stop",{offset:".2",stopColor:"#7962e7"}),/*#__PURE__*/n("stop",{offset:"1",stopColor:"#00d18c"})]}),/*#__PURE__*/n("path",{d:"m0 0h32v32h-32z",fill:"#10111a"}),/*#__PURE__*/n("path",{clipRule:"evenodd",d:"m9.873 20.41a.645.645 0 0 1 .476-.21l14.662.012a.323.323 0 0 1 .238.54l-3.123 3.438a.643.643 0 0 1 -.475.21l-14.662-.012a.323.323 0 0 1 -.238-.54zm15.376-2.862a.322.322 0 0 1 -.238.54l-14.662.012a.642.642 0 0 1 -.476-.21l-3.122-3.44a.323.323 0 0 1 .238-.54l14.662-.012a.644.644 0 0 1 .475.21zm-15.376-9.738a.644.644 0 0 1 .476-.21l14.662.012a.322.322 0 0 1 .238.54l-3.123 3.438a.643.643 0 0 1 -.475.21l-14.662-.012a.323.323 0 0 1 -.238-.54z",fill:"url(#a)",fillRule:"evenodd"})]});const D=/*#__PURE__*/h.div.withConfig({displayName:"Header",componentId:"sc-9b65f2b6-0"})(["display:flex;justify-content:space-between;align-items:center;"]),H=/*#__PURE__*/h.button.withConfig({displayName:"CloseButton",componentId:"sc-9b65f2b6-1"})(["padding:0.25rem;height:30px;width:30px;display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-full);background:var(--privy-color-background-2);"]),R=/*#__PURE__*/h.div.withConfig({displayName:"WalletIconWithActiveIndicator",componentId:"sc-9b65f2b6-2"})(["position:relative;display:inline-flex;align-items:center;&::after{content:' ';border-radius:var(--privy-border-radius-full);height:6px;width:6px;background-color:var(--privy-color-icon-success);position:absolute;right:-3px;top:-3px;}"]),V=/*#__PURE__*/h.img.withConfig({displayName:"WalletIcon",componentId:"sc-9b65f2b6-3"})(["width:32px;height:32px;border-radius:0.25rem;object-fit:contain;"]),G=/*#__PURE__*/h.span.withConfig({displayName:"Chip",componentId:"sc-9b65f2b6-4"})(["display:flex;gap:0.25rem;align-items:center;padding:0.25rem 0.5rem;font-size:0.75rem;font-weight:500;line-height:1.125rem;border-radius:var(--privy-border-radius-sm);background-color:var(--privy-color-background-2);svg{width:100%;max-width:1rem;max-height:1rem;stroke-width:2;}"]),Y=/*#__PURE__*/h.div.withConfig({displayName:"ScrollContainer",componentId:"sc-9b65f2b6-5"})(["display:flex;flex-direction:column;gap:0.5rem;max-height:24rem;overflow-y:scroll;&::-webkit-scrollbar{display:none;}scrollbar-gutter:stable both-edges;scrollbar-width:none;-ms-overflow-style:none;"," background-repeat:no-repeat;background-size:100% 32px,100% 16px;background-attachment:local,scroll;"],(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));function K({enabled:e=!0,walletList:n,walletChainType:t}){let i=y(),{connectors:l}=L(),{listings:r,loading:c}=W(e),s=t??i.appearance.walletChainType,d=n??i.appearance?.walletList,h=o((()=>new Q(s,d)),[s,d]),{wallets:m,walletCount:p}=o((()=>h.getWallets(l,r)),[h,l,r]),[u,g]=a(""),w=o((()=>u?m.filter((e=>e.label.toLowerCase().includes(u.toLowerCase()))):m),[u,m]),[f,v]=a();return{selected:f,setSelected:v,search:u,setSearch:g,loadingListings:c,wallets:w,walletCount:p}}let J=e=>!e||"string"!=typeof e&&(e instanceof z||e instanceof S);const X=({index:i,style:l,data:a,recent:o})=>{let r=a.wallets[i],{walletChainType:c,handleWalletClick:s}=a,{t:d}=b(),h={...l,boxSizing:"border-box"};return r?/*#__PURE__*/e(te,{style:h,onClick:()=>s(r),children:[r.icon&&(r.connector&&!J(r.connector)?/*#__PURE__*/n(R,{children:"string"==typeof r.icon?/*#__PURE__*/n(V,{src:r.icon}):/*#__PURE__*/n(r.icon,{style:{width:"32px",height:"32px"}})}):"string"==typeof r.icon?/*#__PURE__*/n(V,{src:r.icon}):/*#__PURE__*/n(r.icon,{style:{width:"32px",height:"32px"}})),/*#__PURE__*/n(ae,{children:r.label}),o?/*#__PURE__*/e(t,{children:[/*#__PURE__*/n(G,{children:d("connectWallet.lastUsed")}),/*#__PURE__*/n(ie,{children:/*#__PURE__*/e(t,{children:["ethereum-only"===c&&/*#__PURE__*/n($,{}),"solana-only"===c&&/*#__PURE__*/n(P,{})]})})]}):/*#__PURE__*/n(ie,{children:!("ethereum-only"===c||"solana-only"===c)&&/*#__PURE__*/e(t,{children:[r.chains?.some((e=>e.startsWith("eip155")))&&/*#__PURE__*/n($,{}),r.chains?.some((e=>e.startsWith("solana")))&&/*#__PURE__*/n(P,{})]})})]}):null};var Z=({className:h,customDescription:p,connectOnly:u,preSelectedWalletId:C,hideHeader:W,...A})=>{let j=y(),{t:q}=b(),{connectors:O}=L(),U=A.walletChainType||j.appearance.walletChainType,F=A.walletList||j.appearance?.walletList,{onBack:D,onClose:H,app:R}=A,{selected:G,setSelected:Y,qrUrl:Z,setQrUrl:re,connecting:ce,uiState:se,wallets:de,walletCount:he,handleConnect:me,handleBack:pe,showSearchBar:ue,isInitialConnectView:ge,title:we,search:fe,setSearch:ye}=function({onConnect:e,onBack:n,onClose:t,onConnectError:i,walletList:l,walletChainType:c,app:s}){let h=y(),{connectors:m}=L(),{t:p}=b(),{wallets:u,walletCount:g,search:w,setSearch:f,selected:C,setSelected:x}=K({enabled:k(l??[]),walletList:l,walletChainType:c}),[W,_]=a(),[z,S]=a(),[N,A]=a(),B=!C&&!z&&!N,E=B&&(g>6||w.length>0),j=m.find((e=>"wallet_connect_v2"===e.connectorType)),q=r((async(n,t)=>{if(n){if(N?.connector===n&&"loading"===W)return void console.log("Already connecting to this wallet, skipping duplicate attempt");if(_("loading"),"string"==typeof n)return A({connector:n,name:t?.name??"Wallet",icon:t?.icon}),void window.open(n,"_blank");A({connector:n,name:t?.name??n.walletBranding.name??"Wallet",icon:t?.icon??n.walletBranding.icon});try{let t=await n.connect({showPrompt:!0});if(!t)return _("error"),void i?.(new I("Unable to connect wallet"));_("success"),T({address:t.address,client:t.walletClientType,appId:h.id}),setTimeout((()=>{e({connector:n,wallet:t})}),v)}catch(n){if(console.error("ERROR: ",{e:n}),n?.message?.includes("already pending for origin")||n?.message?.includes("wallet_requestPermissions"))return void console.log("Connection request already pending, maintaining loading state");_("error"),i?.(new I("Unable to connect wallet"))}}}),[h.id,e,N]),O=r((()=>z?(_(void 0),A(void 0),void S(void 0)):N?(_(void 0),void A(void 0)):C?(_(void 0),A(void 0),void x(void 0)):"error"===W||"loading"===W?(_(void 0),void A(void 0)):void n?.()),[z,N,C,W,n]),U=o((()=>N?.connector===j&&z&&d&&N?.name?p("connectWallet.goToWallet",{walletName:N.name}):N?.connector===j&&z&&N?.name?p("connectWallet.scanToConnect",{walletName:N.name}):z&&N?.name?p(d?"connectWallet.goToWallet":"connectWallet.scanToConnect",{walletName:N.name}):"string"==typeof N?.connector?p("connectWallet.openOrInstall",{walletName:N.name}):C&&!N?p("connectWallet.selectNetwork"):N?null:p("connectWallet.selectYourWallet")),[N,z,C,j,p]);return{selected:C,setSelected:x,qrUrl:z,setQrUrl:S,connecting:N,uiState:W,search:w,setSearch:f,wallets:u,walletCount:g,wc:j,isInitialConnectView:B,showSearchBar:E,title:U,handleConnect:q,handleBack:O,onClose:t,onConnect:e,app:s}}({...A,walletList:F,walletChainType:U}),ve=O.find((e=>"wallet_connect_v2"===e.connectorType)),be=O.find((e=>"walletconnect_solana"===e.walletBranding.id)),Ce=c(null),xe=l({count:de.length,getScrollElement:()=>Ce.current,estimateSize:()=>56,overscan:6,gap:5}),We=r((async e=>{let n="solana-only"!==U&&e.chains?.some((e=>e.startsWith("eip155"))),t="ethereum-only"!==U&&e.chains?.some((e=>e.startsWith("solana"))),i=n=>{let t=Q.normalize(e.id);return O.find((e=>Q.normalize(e.walletClientType)===t&&e.chainType===n&&!("ethereum"===e.chainType&&e instanceof z||"solana"===e.chainType&&e instanceof S)))},l=async()=>{if(!ve||!e.listing)return!1;let n=M[e.listing.slug]?{...e.listing,...M[e.listing.slug]}:e.listing;return ve.setWalletEntry(n,re),await ve.resetConnection(e.id),await me(ve,{name:e.label,icon:e.icon}),!0},a=async()=>!!be&&!!e.listing&&(await be.disconnect(),be.wallet.setWalletEntry(e.listing,re),await new Promise((e=>setTimeout(e,100))),await me(be,{name:e.label,icon:e.icon}),!0),o=async n=>{let t=(n=>{let t=x[e.id];if(t)return t.getMobileRedirect({isSolana:n,connectOnly:!!u,useUniversalLink:!1});let i=e.listing?.mobile?.native;return e.listing?.mobile?.universal||i||e.url})(n);return!!t&&(await me(t,{name:e.label,icon:e.icon}),!0)};if(n&&t)Y(e);else{if(n&&!t){let n=i("ethereum");if(n&&!J(n))return void await me(n,{name:e.label,icon:e.icon});if(d&&"phantom"===e.id){if(await o(!1)||await l())return}else if(await l()||await o(!1))return}if(t&&!n){let n=i("solana");if(n&&!J(n))return void await me(n,{name:e.label,icon:e.icon});if(d){if(await o(!0)||await a())return}else if(await a()||await o(!0))return}if(!J(e.connector)){if(ve&&"wallet_connect_v2"===e.connector?.connectorType)if(await ve.resetConnection(e.id),"wallet_connect_qr"!==e.id&&e.listing){let n=M[e.listing.slug]?{...e.listing,...M[e.listing.slug]}:e.listing;ve.setWalletEntry(n,re)}else ve.setWalletEntry({id:"wallet_connect_qr",name:"WalletConnect",rdns:"",slug:"wallet-connect",homepage:"",chains:["eip155"],mobile:{native:"",universal:void 0}},re);return be&&"walletconnect_solana"===e.connector?.walletBranding.id&&(await be.disconnect(),"wallet_connect_qr_solana"!==e.id&&e.listing?be.wallet.setWalletEntry(e.listing,re):be.wallet.setWalletEntry({id:"wallet_connect_solana_qr",name:"WalletConnect",rdns:"",slug:"wallet-connect-solana",homepage:"",chains:["solana"],mobile:{native:"",universal:void 0}},re),await new Promise((e=>setTimeout(e,100)))),void await me(e.connector,{name:e.label,icon:e.icon})}e.url&&await me(e.url,{name:e.label,icon:e.icon})}}),[ve,be,me,Y,re,U,u,O]);return s((()=>{if(!C)return;let e=de.find((({id:e})=>e===C));e&&We(e).catch(console.error)}),[C]),/*#__PURE__*/e(E,{className:h,children:[/*#__PURE__*/n(E.Header,{icon:W&&ge?void 0:ce&&!Z||Z&&d&&ce?.icon?ce.icon:ce?void 0:N,iconVariant:ce&&!Z||Z&&d?"loading":void 0,iconLoadingStatus:ce&&!Z||Z&&d?{success:"success"===se,fail:"error"===se}:void 0,title:W&&ge?void 0:ce&&!Z?q("connectWallet.waitingForWallet",{walletName:ce.name}):Z&&d?q("connectWallet.waitingForWallet",{walletName:ce?.name??"connection"}):we,subtitle:W&&ge?void 0:ce&&!Z&&"string"==typeof ce.connector?q("connectWallet.installAndConnect",{walletName:ce.name}):ce&&!Z&&"string"!=typeof ce.connector?q("error"===se?"connectWallet.tryConnectingAgain":"connectionStatus.connectOneWallet"):ge?p??(R?q("connectWallet.connectToAccount",{appName:R.name}):null):null,showBack:!!D||!ge,showClose:!0,onBack:D||pe,onClose:H}),/*#__PURE__*/e(E.Body,{ref:Ce,$colorScheme:j.appearance.palette.colorScheme,style:{marginBottom:Z?"0.5rem":void 0},children:[ue&&/*#__PURE__*/n(ee,{children:/*#__PURE__*/e(f,{style:{background:"transparent"},children:[/*#__PURE__*/n(_,{children:/*#__PURE__*/n(i,{})}),/*#__PURE__*/n("input",{className:"login-method-button",type:"text",placeholder:q("connectWallet.searchPlaceholder",{count:String(he)}),onChange:e=>ye(e.target.value),value:fe})]})}),Z&&d&&"loading"===se&&/*#__PURE__*/e("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem"},children:[/*#__PURE__*/n(m,{variant:"primary",onClick:()=>window.open(Z.universal??Z.native,"_blank"),style:{width:"100%"},children:q("connectWallet.openInApp")}),/*#__PURE__*/n(oe,{value:Z.universal??Z.native,iconOnly:!0,children:"Copy link"})]}),Z&&!d&&"loading"===se&&/*#__PURE__*/n("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem"},children:/*#__PURE__*/n(oe,{value:Z.universal??Z.native,iconOnly:!0,children:q("connectWallet.copyLink")})}),Z&&!d&&/*#__PURE__*/n(w,{size:280,url:Z.universal??Z.native,squareLogoElement:ce?.icon?"string"==typeof ce.icon?e=>/*#__PURE__*/n("svg",{...e,children:/*#__PURE__*/n("image",{href:ce.icon,height:e.height,width:e.width})}):ce.icon:B}),/*#__PURE__*/e(ne,{children:[ce&&!Z&&"string"==typeof ce.connector&&/*#__PURE__*/e(te,{onClick:()=>window.open(ce.connector,"_blank"),children:[ce.icon&&("string"==typeof ce.icon?/*#__PURE__*/n(V,{src:ce.icon}):/*#__PURE__*/n(ce.icon,{})),/*#__PURE__*/n(ae,{children:ce.name})]}),G?.chains.some((e=>e.startsWith("eip155")))&&!ce&&/*#__PURE__*/e(te,{onClick:()=>We({...G,chains:G.chains.filter((e=>e.startsWith("eip155")))}),children:[G.icon&&("string"==typeof G.icon?/*#__PURE__*/n(V,{src:G.icon}):/*#__PURE__*/n(G.icon,{})),/*#__PURE__*/n(ae,{children:G.label}),/*#__PURE__*/n(ie,{children:/*#__PURE__*/n($,{})})]}),G?.chains.some((e=>e.startsWith("solana")))&&!ce&&/*#__PURE__*/e(te,{onClick:()=>We({...G,chains:G.chains.filter((e=>e.startsWith("solana")))}),children:[G.icon&&("string"==typeof G.icon?/*#__PURE__*/n(V,{src:G.icon}):/*#__PURE__*/n(G.icon,{})),/*#__PURE__*/n(ae,{children:G.label}),/*#__PURE__*/n(ie,{children:/*#__PURE__*/n(P,{})})]}),ge&&/*#__PURE__*/e(t,{children:[!(he>0)&&/*#__PURE__*/n(le,{children:q("connectWallet.noWalletsFound")}),he>0&&!Z&&/*#__PURE__*/n("div",{style:{maxHeight:56*Math.min(de.length,5)+5,width:"100%"},children:/*#__PURE__*/n("div",{style:{height:`${xe.getTotalSize()}px`,width:"100%",position:"relative"},children:xe.getVirtualItems().map((e=>/*#__PURE__*/n(X,{index:e.index,style:{position:"absolute",top:0,left:0,height:`${e.size}px`,transform:`translateY(${e.start}px)`},data:{wallets:de,walletChainType:U,handleWalletClick:We}},e.key)))})})]})]})]}),/*#__PURE__*/e(E.Footer,{children:[ce&&!Z&&"string"!=typeof ce.connector&&"error"===se&&/*#__PURE__*/n(E.Actions,{children:/*#__PURE__*/n(m,{style:{width:"100%",alignItems:"center"},variant:"error",onClick:()=>me(ce.connector,{name:ce.name,icon:ce.icon}),children:q("connectWallet.retry")})}),!!(R&&R.legal.privacyPolicyUrl&&R.legal.termsAndConditionsUrl)&&/*#__PURE__*/n(g,{app:R,alwaysShowImplicitConsent:!0}),/*#__PURE__*/n(E.Watermark,{})]})]})};let ee=/*#__PURE__*/h.div.withConfig({displayName:"StickySearchContainer",componentId:"sc-3f4ad407-0"})(["position:sticky;margin-top:-3px;padding-top:3px;top:-3px;z-index:1;background:var(--privy-color-background);padding-bottom:calc(var(--screen-space) / 2);"]),ne=/*#__PURE__*/h.div.withConfig({displayName:"WalletListContainer",componentId:"sc-3f4ad407-1"})(["display:flex;flex-direction:column;gap:","px;"],5),te=/*#__PURE__*/h.button.withConfig({displayName:"Button",componentId:"sc-3f4ad407-2"})(["&&{gap:0.5rem;align-items:center;display:flex;position:relative;text-align:left;font-weight:500;transition:background 200ms ease-in;width:calc(100% - 4px);border-radius:var(--privy-border-radius-md);padding:0.75em;border:1px solid var(--privy-color-foreground-4);justify-content:space-between;}&:hover{background:var(--privy-color-background-2);}"]),ie=/*#__PURE__*/h.span.withConfig({displayName:"ButtonBadge",componentId:"sc-3f4ad407-3"})(["display:flex;align-items:center;justify-content:end;position:relative;& > svg{border-radius:var(--privy-border-radius-full);stroke-width:2.5;width:100%;max-height:1rem;max-width:1rem;flex-shrink:0;}& > svg:not(:last-child){border-radius:var(--privy-border-radius-full);margin-right:-0.375rem;}"]),le=/*#__PURE__*/h.div.withConfig({displayName:"EmptyContainer",componentId:"sc-3f4ad407-4"})(["height:60px;display:flex;align-items:center;justify-content:center;text-align:center;"]),ae=/*#__PURE__*/h.span.withConfig({displayName:"WalletName",componentId:"sc-3f4ad407-5"})(["text-overflow:ellipsis;white-space:nowrap;color:var(--privy-color-foreground);font-weight:400;flex:1;"]),oe=/*#__PURE__*/h(F).withConfig({displayName:"StyledCopyableText",componentId:"sc-3f4ad407-6"})(["&&{margin:0.5rem auto 0 auto;}"]);export{F as C,D as H,Y as S,V as W,G as a,H as b,Q as c,X as d,Z as i,K as u};
|
|
1
|
+
import{jsxs as e,jsx as n,Fragment as t}from"react/jsx-runtime";import{MagnifyingGlassIcon as i}from"@heroicons/react/24/outline";import{useVirtualizer as l}from"@tanstack/react-virtual";import{useState as a,useMemo as o,useCallback as r,useRef as c,useEffect as s}from"react";import{isMobile as d}from"react-device-detect";import{styled as h}from"styled-components";import{B as m}from"./Button-OlK_6fKk.mjs";import p from"@heroicons/react/24/outline/CheckIcon";import{C as u}from"./copy-Bx2Jwc5_.mjs";import{T as g}from"./ModalHeader-CxHK1IKF.mjs";import{Q as w}from"./QrCode-BI2LxLLg.mjs";import{E as f}from"./EmailInputForm-B4hjCxRU.mjs";import{u as y,q as v}from"./context-B4VZqX5H.mjs";import{u as b}from"./useI18n-DIAzggWr.mjs";import{M as C,q as x,d as W,e as k,K as T,V as _,w as z,S}from"./useActiveWallet-Bj-s666H.mjs";import{u as L,P as I}from"./internal-context-DLZicboG.mjs";import{W as N}from"./WalletCards-DH1rqayz.mjs";import{W as A,h as B}from"./prepareFundingModalData-CndHQFiM.mjs";import{S as E}from"./Screen-Dzz_AFFs.mjs";let j=/*#__PURE__*/h.button.withConfig({displayName:"CopyTextButton",componentId:"sc-4b0620dc-0"})(["display:flex;align-items:center;gap:0.5rem;&:hover{text-decoration:underline;}svg{width:0.875rem;height:0.875rem;}"]),q=/*#__PURE__*/h.span.withConfig({displayName:"CopiedText",componentId:"sc-4b0620dc-1"})(["display:flex;align-items:center;gap:0.25rem;font-size:0.875rem;color:var(--privy-color-foreground-2);"]),O=/*#__PURE__*/h(p).withConfig({displayName:"GreenCheck",componentId:"sc-4b0620dc-2"})(["color:var(--privy-color-success);"]),U=/*#__PURE__*/h(u).withConfig({displayName:"StyledCopy",componentId:"sc-4b0620dc-3"})(["color:var(--privy-color-foreground-3);opactiy:0.5;"]);function F({children:t,iconOnly:i,value:l,hideCopyIcon:o,...r}){let[c,s]=a(!1);/*#__PURE__*/return e(j,{...r,onClick:()=>{navigator.clipboard.writeText(l||t).catch(console.error),s(!0),setTimeout((()=>s(!1)),1500)},children:[t," ",c?/*#__PURE__*/e(q,{children:[/*#__PURE__*/n(O,{})," ",!i&&"Copied"]}):!o&&/*#__PURE__*/n(U,{})]})}const M={phantom:{mobile:{native:"phantom://",universal:"https://phantom.app/ul/"}},solflare:{mobile:{native:void 0,universal:"https://solflare.com/ul/v1/"}},metamask:{image_url:{sm:C,md:C}}};class Q{static normalize(e){return e.replace(/[-_]wallet$/,"").replace(/[-_]extension$/,"").toLowerCase()}isEth(e){return e.chains.some((e=>e.startsWith("eip155:")))}isSol(e){return e.chains.some((e=>e.startsWith("solana:")))}inAllowList(e,n){if(!this.normalizedAllowList||0===this.normalizedAllowList.length||"listing"===n&&this.includeWalletConnect)return!0;let t=Q.normalize(e);return this.normalizedAllowList.some((e=>t===Q.normalize(e)))}inDenyList(e,n){return"listing"===n&&"rabby"===e}chainMatches(e){return"ethereum-only"===this.chainFilter?"ethereum"===e:"solana-only"!==this.chainFilter||"solana"===e}connectorOk(e){return!!("null"!==e.connectorType&&"walletconnect_solana"!==e.walletBranding.id&&this.chainMatches(e.chainType)&&(this.inAllowList(e.walletClientType,"connector")||("injected"===e.connectorType||"solana_adapter"===e.connectorType)&&("ethereum"===e.chainType&&this.detectedEth||"solana"===e.chainType&&this.detectedSol)))}listingOk(e){if(e.slug.includes("coinbase"))return!1;if("ethereum-only"===this.chainFilter){if(!this.isEth(e))return!1}else if("solana-only"===this.chainFilter&&!this.isSol(e))return!1;return!(!this.inAllowList(e.slug,"listing")||this.inDenyList(e.slug,"listing"))}getWallets(e,n){let t=new Map,i=e=>{let n=t.get(e.id);if(n){n.chainType!==e.chainType&&(n.chainType="multi");let t=new Set(n.chains);e.chains.forEach((e=>t.add(e))),n.chains=Array.from(t),!n.icon&&e.icon&&(n.icon=e.icon),!n.url&&e.url&&(n.url=e.url),!n.listing&&e.listing&&(n.listing=e.listing)}else t.set(e.id,e)};e.filter((e=>this.connectorOk(e))).forEach((e=>{let n=Q.normalize(e.walletClientType);i({id:n,label:e.walletBranding?.name??n,source:"connector",connector:e,chainType:e.chainType,icon:e.walletBranding?.icon,url:void 0,chains:["ethereum"===e.chainType?"eip155":"solana"]})}));let l=e.find((e=>"wallet_connect_v2"===e.connectorType)),a=e.find((e=>"walletconnect_solana"===e.walletBranding.id));n.filter((e=>this.listingOk(e))).forEach((n=>{let t=[...n.chains].filter((e=>e.startsWith("eip155")||e.startsWith("solana")));if(e.some((e=>Q.normalize(e.walletClientType)===Q.normalize(n.slug)&&"ethereum"===e.chainType&&"null"!==e.connectorType))||l||n.mobile.native||n.mobile.universal||x[n.slug]?.chainTypes.includes("ethereum")||(t=t.filter((e=>!e.startsWith("eip155")))),e.some((e=>Q.normalize(e.walletClientType)===Q.normalize(n.slug)&&"solana"===e.chainType&&"null"!==e.connectorType))||a||n.mobile.native||n.mobile.universal||x[n.slug]?.chainTypes.includes("solana")||(t=t.filter((e=>!e.startsWith("solana")))),!t.length)return;let o=Q.normalize(n.slug),r=M[n.slug],c=r?.image_url?.sm||n.image_url?.sm;t.some((e=>e.startsWith("eip155")))&&i({id:o,label:n.name||o,source:"listing",listing:n,chainType:"ethereum",icon:c,url:n.homepage,chains:t}),t.some((e=>e.startsWith("solana")))&&i({id:o,label:n.name||o,source:"listing",listing:n,chainType:"solana",icon:c,url:n.homepage,chains:t})})),this.includeWalletConnectQr&&l&&i({id:"wallet_connect_qr",label:"WalletConnect",source:"connector",connector:l,chainType:"ethereum",icon:A,url:void 0,chains:["eip155"]}),this.includeWalletConnectQrSolana&&a&&i({id:"wallet_connect_qr_solana",label:"WalletConnect",source:"connector",connector:a,chainType:"solana",icon:A,url:void 0,chains:["solana"]});let o=Array.from(t.values());o.forEach((e=>{let n=M[e.listing?.slug||e.id];n?.image_url?.sm&&(e.icon=n.image_url.sm)}));let r=new Map;return this.normalizedAllowList?.forEach(((e,n)=>{r.set(Q.normalize(e),n)})),{wallets:o.slice().sort(((e,n)=>{let t=Q.normalize(e.id),i=Q.normalize(n.id);"binance-defi"===t?t="binance":"universalprofiles"===t?t="universal_profile":"cryptocom-defi"===t?t="cryptocom":"bitkeep"===t&&(t="bitget_wallet"),"binance-defi"===i?i="binance":"universalprofiles"===i?i="universal_profile":"cryptocom-defi"===i?i="cryptocom":"bitkeep"===i&&(i="bitget_wallet");let l=r.has(t),a=r.has(i);return l&&a?r.get(t)-r.get(i):l?-1:a?1:"connector"===e.source&&"listing"===n.source?-1:"listing"===e.source&&"connector"===n.source?1:e.label.toLowerCase().localeCompare(n.label.toLowerCase())})),walletCount:o.length}}constructor(e,n){this.chainFilter=e,n&&n.length>0&&(this.normalizedAllowList=n.map(String),this.normalizedAllowList.includes("binance")&&this.normalizedAllowList.push("binance-defi-wallet"),this.normalizedAllowList.includes("bitget_wallet")&&this.normalizedAllowList.push("bitkeep")),this.detectedEth=this.normalizedAllowList?.includes("detected_ethereum_wallets")??!1,this.detectedSol=this.normalizedAllowList?.includes("detected_solana_wallets")??!1,this.includeWalletConnect=this.normalizedAllowList?.includes("wallet_connect")??!1,this.includeWalletConnectQr=this.normalizedAllowList?.includes("wallet_connect_qr")??!1,this.includeWalletConnectQrSolana=this.normalizedAllowList?.includes("wallet_connect_qr_solana")??!1}}var $=t=>/*#__PURE__*/e("svg",{viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",...t,children:[/*#__PURE__*/n("path",{d:"m0 0h32v32h-32z",fill:"#5469d4"}),/*#__PURE__*/n("path",{d:"m15.997 5.333-.143.486v14.106l.143.143 6.548-3.87z",fill:"#c2ccf4"}),/*#__PURE__*/n("path",{d:"m15.996 5.333-6.548 10.865 6.548 3.87z",fill:"#fff"}),/*#__PURE__*/n("path",{d:"m15.997 21.306-.08.098v5.025l.08.236 6.552-9.227z",fill:"#c2ccf4"}),/*#__PURE__*/n("path",{d:"m15.996 26.665v-5.36l-6.548-3.867z",fill:"#fff"}),/*#__PURE__*/n("path",{d:"m15.995 20.07 6.548-3.87-6.548-2.976v6.847z",fill:"#8698e8"}),/*#__PURE__*/n("path",{d:"m9.448 16.2 6.548 3.87v-6.846z",fill:"#c2ccf4"})]}),P=t=>/*#__PURE__*/e("svg",{viewBox:"0 0 32 32",xmlns:"http://www.w3.org/2000/svg",...t,children:[/*#__PURE__*/e("linearGradient",{id:"a",gradientUnits:"userSpaceOnUse",x1:"7.233",x2:"24.766",y1:"24.766",y2:"7.234",children:[/*#__PURE__*/n("stop",{offset:"0",stopColor:"#9945ff"}),/*#__PURE__*/n("stop",{offset:".2",stopColor:"#7962e7"}),/*#__PURE__*/n("stop",{offset:"1",stopColor:"#00d18c"})]}),/*#__PURE__*/n("path",{d:"m0 0h32v32h-32z",fill:"#10111a"}),/*#__PURE__*/n("path",{clipRule:"evenodd",d:"m9.873 20.41a.645.645 0 0 1 .476-.21l14.662.012a.323.323 0 0 1 .238.54l-3.123 3.438a.643.643 0 0 1 -.475.21l-14.662-.012a.323.323 0 0 1 -.238-.54zm15.376-2.862a.322.322 0 0 1 -.238.54l-14.662.012a.642.642 0 0 1 -.476-.21l-3.122-3.44a.323.323 0 0 1 .238-.54l14.662-.012a.644.644 0 0 1 .475.21zm-15.376-9.738a.644.644 0 0 1 .476-.21l14.662.012a.322.322 0 0 1 .238.54l-3.123 3.438a.643.643 0 0 1 -.475.21l-14.662-.012a.323.323 0 0 1 -.238-.54z",fill:"url(#a)",fillRule:"evenodd"})]});const D=/*#__PURE__*/h.div.withConfig({displayName:"Header",componentId:"sc-9b65f2b6-0"})(["display:flex;justify-content:space-between;align-items:center;"]),H=/*#__PURE__*/h.button.withConfig({displayName:"CloseButton",componentId:"sc-9b65f2b6-1"})(["padding:0.25rem;height:30px;width:30px;display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-full);background:var(--privy-color-background-2);"]),R=/*#__PURE__*/h.div.withConfig({displayName:"WalletIconWithActiveIndicator",componentId:"sc-9b65f2b6-2"})(["position:relative;display:inline-flex;align-items:center;&::after{content:' ';border-radius:var(--privy-border-radius-full);height:6px;width:6px;background-color:var(--privy-color-icon-success);position:absolute;right:-3px;top:-3px;}"]),V=/*#__PURE__*/h.img.withConfig({displayName:"WalletIcon",componentId:"sc-9b65f2b6-3"})(["width:32px;height:32px;border-radius:0.25rem;object-fit:contain;"]),G=/*#__PURE__*/h.span.withConfig({displayName:"Chip",componentId:"sc-9b65f2b6-4"})(["display:flex;gap:0.25rem;align-items:center;padding:0.25rem 0.5rem;font-size:0.75rem;font-weight:500;line-height:1.125rem;border-radius:var(--privy-border-radius-sm);background-color:var(--privy-color-background-2);svg{width:100%;max-width:1rem;max-height:1rem;stroke-width:2;}"]),Y=/*#__PURE__*/h.div.withConfig({displayName:"ScrollContainer",componentId:"sc-9b65f2b6-5"})(["display:flex;flex-direction:column;gap:0.5rem;max-height:24rem;overflow-y:scroll;&::-webkit-scrollbar{display:none;}scrollbar-gutter:stable both-edges;scrollbar-width:none;-ms-overflow-style:none;"," background-repeat:no-repeat;background-size:100% 32px,100% 16px;background-attachment:local,scroll;"],(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));function K({enabled:e=!0,walletList:n,walletChainType:t}){let i=y(),{connectors:l}=L(),{listings:r,loading:c}=W(e),s=t??i.appearance.walletChainType,d=n??i.appearance?.walletList,h=o((()=>new Q(s,d)),[s,d]),{wallets:m,walletCount:p}=o((()=>h.getWallets(l,r)),[h,l,r]),[u,g]=a(""),w=o((()=>u?m.filter((e=>e.label.toLowerCase().includes(u.toLowerCase()))):m),[u,m]),[f,v]=a();return{selected:f,setSelected:v,search:u,setSearch:g,loadingListings:c,wallets:w,walletCount:p}}let J=e=>!e||"string"!=typeof e&&(e instanceof z||e instanceof S);const X=({index:i,style:l,data:a,recent:o})=>{let r=a.wallets[i],{walletChainType:c,handleWalletClick:s}=a,{t:d}=b(),h={...l,boxSizing:"border-box"};return r?/*#__PURE__*/e(te,{style:h,onClick:()=>s(r),children:[r.icon&&(r.connector&&!J(r.connector)?/*#__PURE__*/n(R,{children:"string"==typeof r.icon?/*#__PURE__*/n(V,{src:r.icon}):/*#__PURE__*/n(r.icon,{style:{width:"32px",height:"32px"}})}):"string"==typeof r.icon?/*#__PURE__*/n(V,{src:r.icon}):/*#__PURE__*/n(r.icon,{style:{width:"32px",height:"32px"}})),/*#__PURE__*/n(ae,{children:r.label}),o?/*#__PURE__*/e(t,{children:[/*#__PURE__*/n(G,{children:d("connectWallet.lastUsed")}),/*#__PURE__*/n(ie,{children:/*#__PURE__*/e(t,{children:["ethereum-only"===c&&/*#__PURE__*/n($,{}),"solana-only"===c&&/*#__PURE__*/n(P,{})]})})]}):/*#__PURE__*/n(ie,{children:!("ethereum-only"===c||"solana-only"===c)&&/*#__PURE__*/e(t,{children:[r.chains?.some((e=>e.startsWith("eip155")))&&/*#__PURE__*/n($,{}),r.chains?.some((e=>e.startsWith("solana")))&&/*#__PURE__*/n(P,{})]})})]}):null};var Z=({className:h,customDescription:p,connectOnly:u,preSelectedWalletId:C,hideHeader:W,...A})=>{let j=y(),{t:q}=b(),{connectors:O}=L(),U=A.walletChainType||j.appearance.walletChainType,F=A.walletList||j.appearance?.walletList,{onBack:D,onClose:H,app:R}=A,{selected:G,setSelected:Y,qrUrl:Z,setQrUrl:re,connecting:ce,uiState:se,wallets:de,walletCount:he,handleConnect:me,handleBack:pe,showSearchBar:ue,isInitialConnectView:ge,title:we,search:fe,setSearch:ye}=function({onConnect:e,onBack:n,onClose:t,onConnectError:i,walletList:l,walletChainType:c,app:s}){let h=y(),{connectors:m}=L(),{t:p}=b(),{wallets:u,walletCount:g,search:w,setSearch:f,selected:C,setSelected:x}=K({enabled:k(l??[]),walletList:l,walletChainType:c}),[W,_]=a(),[z,S]=a(),[N,A]=a(),B=!C&&!z&&!N,E=B&&(g>6||w.length>0),j=m.find((e=>"wallet_connect_v2"===e.connectorType)),q=r((async(n,t)=>{if(n){if(N?.connector===n&&"loading"===W)return void console.log("Already connecting to this wallet, skipping duplicate attempt");if(_("loading"),"string"==typeof n)return A({connector:n,name:t?.name??"Wallet",icon:t?.icon}),void window.open(n,"_blank");A({connector:n,name:t?.name??n.walletBranding.name??"Wallet",icon:t?.icon??n.walletBranding.icon});try{let t=await n.connect({showPrompt:!0});if(!t)return _("error"),void i?.(new I("Unable to connect wallet"));_("success"),T({address:t.address,client:t.walletClientType,appId:h.id}),setTimeout((()=>{e({connector:n,wallet:t})}),v)}catch(n){if(console.error("ERROR: ",{e:n}),n?.message?.includes("already pending for origin")||n?.message?.includes("wallet_requestPermissions"))return void console.log("Connection request already pending, maintaining loading state");_("error"),i?.(new I("Unable to connect wallet"))}}}),[h.id,e,N]),O=r((()=>z?(_(void 0),A(void 0),void S(void 0)):N?(_(void 0),void A(void 0)):C?(_(void 0),A(void 0),void x(void 0)):"error"===W||"loading"===W?(_(void 0),void A(void 0)):void n?.()),[z,N,C,W,n]),U=o((()=>N?.connector===j&&z&&d&&N?.name?p("connectWallet.goToWallet",{walletName:N.name}):N?.connector===j&&z&&N?.name?p("connectWallet.scanToConnect",{walletName:N.name}):z&&N?.name?p(d?"connectWallet.goToWallet":"connectWallet.scanToConnect",{walletName:N.name}):"string"==typeof N?.connector?p("connectWallet.openOrInstall",{walletName:N.name}):C&&!N?p("connectWallet.selectNetwork"):N?null:p("connectWallet.selectYourWallet")),[N,z,C,j,p]);return{selected:C,setSelected:x,qrUrl:z,setQrUrl:S,connecting:N,uiState:W,search:w,setSearch:f,wallets:u,walletCount:g,wc:j,isInitialConnectView:B,showSearchBar:E,title:U,handleConnect:q,handleBack:O,onClose:t,onConnect:e,app:s}}({...A,walletList:F,walletChainType:U}),ve=O.find((e=>"wallet_connect_v2"===e.connectorType)),be=O.find((e=>"walletconnect_solana"===e.walletBranding.id)),Ce=c(null),xe=l({count:de.length,getScrollElement:()=>Ce.current,estimateSize:()=>56,overscan:6,gap:5}),We=r((async e=>{let n="solana-only"!==U&&e.chains?.some((e=>e.startsWith("eip155"))),t="ethereum-only"!==U&&e.chains?.some((e=>e.startsWith("solana"))),i=n=>{let t=Q.normalize(e.id);return O.find((e=>Q.normalize(e.walletClientType)===t&&e.chainType===n&&!("ethereum"===e.chainType&&e instanceof z||"solana"===e.chainType&&e instanceof S)))},l=async()=>{if(!ve||!e.listing)return!1;let n=M[e.listing.slug]?{...e.listing,...M[e.listing.slug]}:e.listing;return ve.setWalletEntry(n,re),await ve.resetConnection(e.id),await me(ve,{name:e.label,icon:e.icon}),!0},a=async()=>!!be&&!!e.listing&&(await be.disconnect(),be.wallet.setWalletEntry(e.listing,re),await new Promise((e=>setTimeout(e,100))),await me(be,{name:e.label,icon:e.icon}),!0),o=async n=>{let t=(n=>{let t=x[e.id];if(t)return t.getMobileRedirect({isSolana:n,connectOnly:!!u,useUniversalLink:!1});let i=e.listing?.mobile?.native;return e.listing?.mobile?.universal||i||e.url})(n);return!!t&&(await me(t,{name:e.label,icon:e.icon}),!0)};if(n&&t)Y(e);else{if(n&&!t){let n=i("ethereum");if(n&&!J(n))return void await me(n,{name:e.label,icon:e.icon});if(d&&"phantom"===e.id){if(await o(!1)||await l())return}else if(await l()||await o(!1))return}if(t&&!n){let n=i("solana");if(n&&!J(n))return void await me(n,{name:e.label,icon:e.icon});if(d){if(await o(!0)||await a())return}else if(await a()||await o(!0))return}if(!J(e.connector)){if(ve&&"wallet_connect_v2"===e.connector?.connectorType)if(await ve.resetConnection(e.id),"wallet_connect_qr"!==e.id&&e.listing){let n=M[e.listing.slug]?{...e.listing,...M[e.listing.slug]}:e.listing;ve.setWalletEntry(n,re)}else ve.setWalletEntry({id:"wallet_connect_qr",name:"WalletConnect",rdns:"",slug:"wallet-connect",homepage:"",chains:["eip155"],mobile:{native:"",universal:void 0}},re);return be&&"walletconnect_solana"===e.connector?.walletBranding.id&&(await be.disconnect(),"wallet_connect_qr_solana"!==e.id&&e.listing?be.wallet.setWalletEntry(e.listing,re):be.wallet.setWalletEntry({id:"wallet_connect_solana_qr",name:"WalletConnect",rdns:"",slug:"wallet-connect-solana",homepage:"",chains:["solana"],mobile:{native:"",universal:void 0}},re),await new Promise((e=>setTimeout(e,100)))),void await me(e.connector,{name:e.label,icon:e.icon})}e.url&&await me(e.url,{name:e.label,icon:e.icon})}}),[ve,be,me,Y,re,U,u,O]);return s((()=>{if(!C)return;let e=de.find((({id:e})=>e===C));e&&We(e).catch(console.error)}),[C]),/*#__PURE__*/e(E,{className:h,children:[/*#__PURE__*/n(E.Header,{icon:W&&ge?void 0:ce&&!Z||Z&&d&&ce?.icon?ce.icon:ce?void 0:N,iconVariant:ce&&!Z||Z&&d?"loading":void 0,iconLoadingStatus:ce&&!Z||Z&&d?{success:"success"===se,fail:"error"===se}:void 0,title:W&&ge?void 0:ce&&!Z?q("connectWallet.waitingForWallet",{walletName:ce.name}):Z&&d?q("connectWallet.waitingForWallet",{walletName:ce?.name??"connection"}):we,subtitle:W&&ge?void 0:ce&&!Z&&"string"==typeof ce.connector?q("connectWallet.installAndConnect",{walletName:ce.name}):ce&&!Z&&"string"!=typeof ce.connector?q("error"===se?"connectWallet.tryConnectingAgain":"connectionStatus.connectOneWallet"):ge?p??(R?q("connectWallet.connectToAccount",{appName:R.name}):null):null,showBack:!!D||!ge,showClose:!0,onBack:D||pe,onClose:H}),/*#__PURE__*/e(E.Body,{ref:Ce,$colorScheme:j.appearance.palette.colorScheme,style:{marginBottom:Z?"0.5rem":void 0},children:[ue&&/*#__PURE__*/n(ee,{children:/*#__PURE__*/e(f,{style:{background:"transparent"},children:[/*#__PURE__*/n(_,{children:/*#__PURE__*/n(i,{})}),/*#__PURE__*/n("input",{className:"login-method-button",type:"text",placeholder:q("connectWallet.searchPlaceholder",{count:String(he)}),onChange:e=>ye(e.target.value),value:fe})]})}),Z&&d&&"loading"===se&&/*#__PURE__*/e("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem"},children:[/*#__PURE__*/n(m,{variant:"primary",onClick:()=>window.open(Z.universal??Z.native,"_blank"),style:{width:"100%"},children:q("connectWallet.openInApp")}),/*#__PURE__*/n(oe,{value:Z.universal??Z.native,iconOnly:!0,children:"Copy link"})]}),Z&&!d&&"loading"===se&&/*#__PURE__*/n("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem"},children:/*#__PURE__*/n(oe,{value:Z.universal??Z.native,iconOnly:!0,children:q("connectWallet.copyLink")})}),Z&&!d&&/*#__PURE__*/n(w,{size:280,url:Z.universal??Z.native,squareLogoElement:ce?.icon?"string"==typeof ce.icon?e=>/*#__PURE__*/n("svg",{...e,children:/*#__PURE__*/n("image",{href:ce.icon,height:e.height,width:e.width})}):ce.icon:B}),/*#__PURE__*/e(ne,{children:[ce&&!Z&&"string"==typeof ce.connector&&/*#__PURE__*/e(te,{onClick:()=>window.open(ce.connector,"_blank"),children:[ce.icon&&("string"==typeof ce.icon?/*#__PURE__*/n(V,{src:ce.icon}):/*#__PURE__*/n(ce.icon,{})),/*#__PURE__*/n(ae,{children:ce.name})]}),G?.chains.some((e=>e.startsWith("eip155")))&&!ce&&/*#__PURE__*/e(te,{onClick:()=>We({...G,chains:G.chains.filter((e=>e.startsWith("eip155")))}),children:[G.icon&&("string"==typeof G.icon?/*#__PURE__*/n(V,{src:G.icon}):/*#__PURE__*/n(G.icon,{})),/*#__PURE__*/n(ae,{children:G.label}),/*#__PURE__*/n(ie,{children:/*#__PURE__*/n($,{})})]}),G?.chains.some((e=>e.startsWith("solana")))&&!ce&&/*#__PURE__*/e(te,{onClick:()=>We({...G,chains:G.chains.filter((e=>e.startsWith("solana")))}),children:[G.icon&&("string"==typeof G.icon?/*#__PURE__*/n(V,{src:G.icon}):/*#__PURE__*/n(G.icon,{})),/*#__PURE__*/n(ae,{children:G.label}),/*#__PURE__*/n(ie,{children:/*#__PURE__*/n(P,{})})]}),ge&&/*#__PURE__*/e(t,{children:[!(he>0)&&/*#__PURE__*/n(le,{children:q("connectWallet.noWalletsFound")}),he>0&&!Z&&/*#__PURE__*/n("div",{style:{maxHeight:56*Math.min(de.length,5)+5,width:"100%"},children:/*#__PURE__*/n("div",{style:{height:`${xe.getTotalSize()}px`,width:"100%",position:"relative"},children:xe.getVirtualItems().map((e=>/*#__PURE__*/n(X,{index:e.index,style:{position:"absolute",top:0,left:0,height:`${e.size}px`,transform:`translateY(${e.start}px)`},data:{wallets:de,walletChainType:U,handleWalletClick:We}},e.key)))})})]})]})]}),/*#__PURE__*/e(E.Footer,{children:[ce&&!Z&&"string"!=typeof ce.connector&&"error"===se&&/*#__PURE__*/n(E.Actions,{children:/*#__PURE__*/n(m,{style:{width:"100%",alignItems:"center"},variant:"error",onClick:()=>me(ce.connector,{name:ce.name,icon:ce.icon}),children:q("connectWallet.retry")})}),!!(R&&R.legal.privacyPolicyUrl&&R.legal.termsAndConditionsUrl)&&/*#__PURE__*/n(g,{app:R,alwaysShowImplicitConsent:!0}),/*#__PURE__*/n(E.Watermark,{})]})]})};let ee=/*#__PURE__*/h.div.withConfig({displayName:"StickySearchContainer",componentId:"sc-3f4ad407-0"})(["position:sticky;margin-top:-3px;padding-top:3px;top:-3px;z-index:1;background:var(--privy-color-background);padding-bottom:calc(var(--screen-space) / 2);"]),ne=/*#__PURE__*/h.div.withConfig({displayName:"WalletListContainer",componentId:"sc-3f4ad407-1"})(["display:flex;flex-direction:column;gap:","px;"],5),te=/*#__PURE__*/h.button.withConfig({displayName:"Button",componentId:"sc-3f4ad407-2"})(["&&{gap:0.5rem;align-items:center;display:flex;position:relative;text-align:left;font-weight:500;transition:background 200ms ease-in;width:calc(100% - 4px);border-radius:var(--privy-border-radius-md);padding:0.75em;border:1px solid var(--privy-color-foreground-4);justify-content:space-between;}&:hover{background:var(--privy-color-background-2);}"]),ie=/*#__PURE__*/h.span.withConfig({displayName:"ButtonBadge",componentId:"sc-3f4ad407-3"})(["display:flex;align-items:center;justify-content:end;position:relative;& > svg{border-radius:var(--privy-border-radius-full);stroke-width:2.5;width:100%;max-height:1rem;max-width:1rem;flex-shrink:0;}& > svg:not(:last-child){border-radius:var(--privy-border-radius-full);margin-right:-0.375rem;}"]),le=/*#__PURE__*/h.div.withConfig({displayName:"EmptyContainer",componentId:"sc-3f4ad407-4"})(["height:60px;display:flex;align-items:center;justify-content:center;text-align:center;"]),ae=/*#__PURE__*/h.span.withConfig({displayName:"WalletName",componentId:"sc-3f4ad407-5"})(["text-overflow:ellipsis;white-space:nowrap;color:var(--privy-color-foreground);font-weight:400;flex:1;"]),oe=/*#__PURE__*/h(F).withConfig({displayName:"StyledCopyableText",componentId:"sc-3f4ad407-6"})(["&&{margin:0.5rem auto 0 auto;}"]);export{F as C,D as H,Y as S,V as W,G as a,H as b,Q as c,X as d,Z as i,K as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useRef as o,useEffect as i,useState as a,useCallback as r}from"react";import{isMobile as c}from"react-device-detect";import{styled as l}from"styled-components";import{a as s,S as d,W as m,B as u,b as p}from"./index-CCrVHfyv.mjs";import{L as g}from"./Link-DwjLfHwW.mjs";import{u as w,q as h}from"./context-B4VZqX5H.mjs";import{u as S}from"./useI18n-DIAzggWr.mjs";import{C as y,P as f,d as C}from"./prepareFundingModalData-CndHQFiM.mjs";import{Q as b,k as v,T}from"./useActiveWallet-Bj-s666H.mjs";import{isHex as _,getAddress as E}from"viem";import{b as R,u as k,j as A}from"./internal-context-DLZicboG.mjs";import{u as W,a as I}from"./get-is-unified-wallet-DXko-EzF.mjs";import{s as L}from"./shouldProceedtoEmbeddedWalletCreationFlow-DVwf2mAj.mjs";import{a as j,b as U}from"./usePrivy-BSIhOAz8.mjs";import{S as O}from"./ScreenLayout-pthdsODa.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useWallets-DuxHKVvE.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./events-context-CI0iqAXA.mjs";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./getPublicClient-C_l_ocJu.mjs";import"ofetch";import"js-cookie";import"./frame-BMn1PaPp.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-J1po7l19.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"tinycolor2";import"./Button-OlK_6fKk.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const N=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter((e=>_(e,{strict:!0}))).map((e=>E(e)));return!!t?.length&&!!e?.linkedAccounts.filter((e=>"wallet"==e.type&&t.includes(e.address))).length};const M=e=>e?.privyErrorCode===R.LINKED_TO_ANOTHER_USER?y.ERROR_USER_EXISTS:e instanceof f&&!e.details.default?e.details:e instanceof C?y.ERROR_TIMED_OUT:e?.privyErrorCode===R.CANNOT_LINK_MORE_OF_TYPE?y.ERROR_USER_LIMIT_REACHED:y.ERROR_WALLET_CONNECTION,x=({walletLogo:o,title:i,subtitle:a,signSuccess:r,errorMessage:c,connectSuccess:l,separateConnectAndSign:s,signing:d,walletConnectRedirectUri:m,walletConnectFallbackUniversalUri:u,hasTabbedAway:p,showCoinbaseWalletResetCta:w,numRetries:h,onBack:f,onSign:C,onRetry:b,onCoinbaseReset:v,onDifferentWallet:T})=>{let{t:_}=S(),E=w?{label:"Use a different wallet",onClick:v,disabled:r}:c===y.ERROR_USER_EXISTS&&f?{label:"Use a different wallet",onClick:T}:l&&!r&&s?{label:d?"Signing":"Sign with your wallet",onClick:C,disabled:d}:!r&&c?.retryable&&h<2?{label:"Retry",onClick:b,disabled:!1}:r||c?void 0:{label:_("connectionStatus.connecting"),onClick:()=>{},disabled:!0};/*#__PURE__*/return e(O,{title:i,subtitle:a,icon:o,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!c},primaryCta:E,onBack:f,watermark:!0,children:!l&&m&&!p&&/*#__PURE__*/t(B,{children:[_("connectionStatus.stillHere")," ",/*#__PURE__*/e(g,{href:m,target:"_blank",variant:"underlined",size:"sm",children:_("connectionStatus.tryConnectingAgain")}),u&&/*#__PURE__*/t(n,{children:[" ",_("connectionStatus.or")," ",/*#__PURE__*/e(g,{href:u,target:"_blank",variant:"underlined",size:"sm",children:_("connectionStatus.useDifferentLink")})]})]})})},D={component:()=>{let t,[n,l]=a(!1),[g,f]=a(!1),[C,_]=a(void 0),{authenticated:E,logout:O}=W(),{navigate:D,navigateBack:B,lastScreen:F,currentScreen:P,setModalData:q,data:H}=I(),X=w(),{t:z}=S(),{getAuthFlow:Q,walletConnectionStatus:Y,closePrivyModal:J,initLoginWithWallet:K,loginWithWallet:V,updateWallets:$,createAnalyticsEvent:G}=k(),{walletConnectors:Z}=W(),[ee,te]=a(0),{user:ne}=W(),oe=j(),[ie]=a(ne?.linkedAccounts.length||0),[ae,re]=a(""),[ce,le]=a(""),[se,de]=a(!1),{hasTabbedAway:me}=function(){let[e,t]=a(!1),n=r((()=>{document.hidden&&t(!0)}),[]);return i((()=>(document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n))),[n]),{hasTabbedAway:e,reset:()=>t(!1)}}(),{enabled:ue,token:pe}=s(),ge=b(Y?.connector?.walletClientType||"unknown"),we=c&&"wallet_connect_v2"===Y?.connector?.connectorType||c&&"coinbase_wallet"===Y?.connector?.connectorType||c&&"base_account"===Y?.connector?.connectorType||c&&"injected"===Y?.connector?.connectorType&&"phantom"===Y?.connector?.walletClientType||c&&"solana_adapter"===Y?.connector?.connectorType&&"mobile_wallet_adapter"===Y.connector.walletClientType,he="connected"===Y?.status,Se="switching_to_supported_chain"===Y?.status;i((()=>{let e=Q(),t=e instanceof p||e instanceof d?e:void 0;he&&"solana"===Y.connector?.chainType&&"phantom"===Y.connector?.walletClientType&&oe(U)&&void 0===H?.login?.isSigningInWithLedgerSolana?D("ConnectLedgerScreen",!1):(he&&!t&&(!ue||pe||E?K(Y.connectedWallet,pe,H?.login?.disableSignup,H?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})):(q({captchaModalData:{callback:e=>K(Y.connectedWallet,e,H?.login?.disableSignup,H?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})),userIntentRequired:!1,onSuccessNavigateTo:"ConnectionStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),D("CaptchaScreen",!1))),t instanceof d&&H?.login?.isSigningInWithLedgerSolana&&(t.messageType="transaction"),t&&we&&he&&!t.preparedMessage?t.buildMessage():t&&!we&&he&&(g||(async()=>{f(!0),_(void 0);try{"wallet_connect_v2"===Y?.connector?.connectorType&&"metamask"===Y?.connector?.walletClientType&&await v(2500),await fe()}catch(e){console.warn("Auto-prompted signature failed",e)}finally{f(!1)}})()))}),[ee,he,se]),i((()=>{if(ne&&n){let e=h-500;if(X?.legal.requireUsersAcceptTerms&&!ne.hasAcceptedTerms){let t=setTimeout((()=>{D("AffirmativeConsentScreen")}),e);return()=>clearTimeout(t)}if(L(ne,X.embeddedWallets)){let t=setTimeout((()=>{q({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),G({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"ConnectionStatusScreen"}}),O()},callAuthOnSuccessOnClose:!0}}),D("EmbeddedWalletOnAccountCreateScreen")}),e);return()=>clearTimeout(t)}$();let t=setTimeout((()=>J({shouldCallAuthOnSuccess:!0,isSuccess:!0})),h);return()=>clearTimeout(t)}}),[ne,n]);let ye=e=>{if(e?.privyErrorCode!==R.ALLOWLIST_REJECTED){if(e?.privyErrorCode===R.USER_LIMIT_REACHED)return console.error(new A(e).toString()),void D("UserLimitReachedScreen");if(e?.privyErrorCode!==R.USER_DOES_NOT_EXIST)return e?.privyErrorCode===R.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce?(q({accountTransfer:{nonce:e.data?.data?.nonce,account:Q()?.meta.address,displayName:e.data?.data?.account?.displayName,externalWalletMetadata:{walletClientType:Q()?.meta.walletClientType,chainId:Q()?.meta.chainId,connectorType:Q()?.meta.connectorType},linkMethod:Q()instanceof p?"siwe":"siws",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void D("LinkConflictScreen")):void _(M(e));D("AccountNotFoundScreen")}else D("AllowlistRejectionScreen")};async function fe(){try{await V(),l(!0)}catch(e){ye(e)}finally{f(!1)}}i((()=>{Y?.connectError&&ye(Y?.connectError)}),[Y]),((e,t)=>{let n=o((()=>{}));i((()=>{n.current=e})),i((()=>{if(null!==t){let e=setInterval((()=>n.current()),t||0);return()=>clearInterval(e)}}),[t])})((()=>{let e="wallet_connect_v2"===Ce&&Y?.connector instanceof m?Y.connector.redirectUri:void 0;e&&re(e);let t="wallet_connect_v2"===Ce&&Y?.connector instanceof m?Y.connector.fallbackUniversalRedirectUri:void 0;t&&le(t)}),Y?.connector instanceof m&&!ae?500:null);let Ce=Y?.connector?.connectorType||"injected",be=Y?.connector?.walletClientType||"unknown",ve=ge?.metadata?.shortName||ge?.name||Y?.connector?.walletBranding.name||"Browser Extension",Te=ge?.image_url?.md||Y?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(u,{...t})),_e="Browser Extension"===ve?ve.toLowerCase():ve;t=n?z("connectionStatus.successfullyConnected",{walletName:_e}):C?z("connectionStatus.errorTitle",{errorMessage:C.message}):Se?"Switching networks":he?g&&we?"Signing":"Sign to verify":`Waiting for ${_e}`;let Ee=z("connectionStatus.checkOtherWindows");n?Ee=ie===(ne?.linkedAccounts.length||0)?"Wallet was already linked.":"You're good to go!":ee>=2&&C?Ee="Unable to connect wallet":C?Ee=C.detail:Se?Ee="Switch your wallet to the requested network.":he&&we?Ee="Sign the message in your wallet to verify it belongs to you.":"metamask"===be&&c?Ee="Click continue to open and connect MetaMask.":"metamask"===be?Ee="For the best experience, connect only one wallet at a time.":"wallet_connect"===Ce?Ee="Open your mobile wallet app to continue":"coinbase_wallet"===Ce?T()||(Ee=N(ne)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Confirm in the Coinbase app/popup to continue."):H?.login?.isSigningInWithLedgerSolana&&(Ee="Ledger requires a transaction to verify your identity. You'll sign a transaction that performs no onchain action.");let Re=Z?.walletConnectors?.find((e=>"coinbase_wallet"===e.walletClientType)),ke="coinbase_wallet"===be&&(N(ne)||C===y.ERROR_USER_EXISTS);/*#__PURE__*/return e(x,{walletLogo:Te,title:t,subtitle:Ee,signSuccess:n,errorMessage:C,connectSuccess:he,separateConnectAndSign:we,signing:g,walletConnectRedirectUri:ae,walletConnectFallbackUniversalUri:ce,hasTabbedAway:me,showCoinbaseWalletResetCta:ke,numRetries:ee,onBack:F&&P!==F?B:void 0,onSign:()=>{f(!0),fe()},onRetry:()=>{te(ee+1),_(void 0),he?(f(!0),fe()):Y?.connectRetry()},onCoinbaseReset:()=>{Re&&Re?.disconnect()},onDifferentWallet:B})}};let B=/*#__PURE__*/l.p.withConfig({displayName:"RedirectLinksContainer",componentId:"sc-2a867557-0"})(["text-align:center;color:var(--privy-color-foreground-2);font-size:14px;line-height:22px;margin:16px 0;"]);export{D as ConnectionStatusScreen,x as ConnectionStatusView,D as default,M as getErrorDetails};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{jsx as e}from"react/jsx-runtime";import{useMemo as t,useState as o,useEffect as r}from"react";import{u as i,q as a}from"./context-B4VZqX5H.mjs";import{R as s}from"./index-CCrVHfyv.mjs";import{u as n,a as c,e as m,b as l}from"./internal-context-DLZicboG.mjs";import{a as p}from"./get-is-unified-wallet-DXko-EzF.mjs";import{z as d}from"./useActiveWallet-Bj-s666H.mjs";import{s as u}from"./shouldProceedtoEmbeddedWalletCreationFlow-DVwf2mAj.mjs";import{S as f}from"./ScreenLayout-pthdsODa.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-DuxHKVvE.mjs";import"./prepareFundingModalData-CndHQFiM.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-BSIhOAz8.mjs";import"./events-context-CI0iqAXA.mjs";import"styled-components";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"viem";import"./getPublicClient-C_l_ocJu.mjs";import"ofetch";import"js-cookie";import"./frame-BMn1PaPp.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-J1po7l19.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-OlK_6fKk.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const h=({providerApp:o,success:r,error:i,onClose:a})=>{let{title:s,subtitle:n}=t((()=>r?{title:`Successfully connected with ${o.name}`,subtitle:"You're good to go!"}:i?{title:"Authentication failed",subtitle:i.message}:{title:`Connecting to ${o.name}`,subtitle:`Please check the pop-up from ${o.name} to continue`}),[r,i,o.name]);/*#__PURE__*/return e(f,{title:s,subtitle:n,icon:o.logoUrl,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!i},onBack:a,watermark:!0})},v={component:()=>{let t=i(),{data:f,navigate:v,setModalData:A,onUserCloseViaDialogOrKeybindRef:j}=p(),{crossAppAuthFlow:y,updateWallets:g,closePrivyModal:b,createAnalyticsEvent:C}=n(),{logout:w}=d(),[S,U]=o({}),T=f?.crossAppAuth,k={id:T.appId,name:T.name,logoUrl:T.logoUrl},W=new c(`There was an issue connecting your ${k.name} account. Please try again.`),x=new s((async e=>{if(T.popup)try{let t=await y({appId:e,popup:T.popup,action:T.action});U({data:t})}catch(e){if(e instanceof c)U({error:e});else if(e instanceof m){if(e.privyErrorCode===l.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return A({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:`privy:${k.id}`,embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,oAuthUserInfo:e.data?.data?.otherUser?.oAuthUserInfo}}),void v("LinkConflictScreen");T.popup&&T.popup.close(),U({error:W})}else U({error:W})}else U({error:W})})),E=()=>{S.data&&(g(),T.onSuccess(S.data),b({shouldCallAuthOnSuccess:!0,isSuccess:!0})),T.onError(S.error??new c("User canceled flow")),b({shouldCallAuthOnSuccess:!1,isSuccess:!1})};return j.current=E,r((()=>{k.id.length&&x.execute(k.id)}),[k.id]),r((()=>{if(!S.data)return;let e=S.data;if(t.legal.requireUsersAcceptTerms&&!e.hasAcceptedTerms){let e=setTimeout((()=>{v("AffirmativeConsentScreen")}),a);return()=>clearTimeout(e)}if(u(e,t.embeddedWallets)){let e=setTimeout((()=>{A({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),C({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:`privy:${k.id}`,screen:"CrossAppAuthScreen"}}),w()},callAuthOnSuccessOnClose:!0}}),v("EmbeddedWalletOnAccountCreateScreen")}),a);return()=>clearTimeout(e)}let o=setTimeout(E,a);return()=>clearTimeout(o)}),[S.data]),/*#__PURE__*/e(h,{providerApp:k,success:!!S.data,error:S.error,onClose:E})},isShownBeforeReady:!0};export{v as CrossAppAuthScreen,h as CrossAppAuthScreenView,v as default};
|
package/dist/esm/{CustomLandingScreenView-DWt9lv8W.mjs → CustomLandingScreenView-DZTOg8z4.mjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import i from"@heroicons/react/24/outline/UserCircleIcon";import l,{useState as n,useEffect as r,useRef as o,useMemo as s}from"react";import{styled as c}from"styled-components";import{T as d,M as p,B as h}from"./ModalHeader-
|
|
2
|
-
/*#__PURE__*/e("span",{}),he=({appId:i})=>{let[l,o]=n(void 0),{startCrossAppAuthFlow:s,authenticated:c}=g(),{client:d}=m();return r((()=>{(async()=>{d&&o(await d.getCrossAppProviderDetails(i))})()}),[d]),/*#__PURE__*/e(C,{onClick:()=>s({appId:i,action:c?"link":"login"}),disabled:!l,children:l?/*#__PURE__*/t(a,{children:[/*#__PURE__*/e(pe,{name:l.name,logoUrl:l.icon_url||void 0,size:"24px"})," ",l.name]}):/*#__PURE__*/e(b,{})})},ue=({isEditable:i,setIsEditable:l,defaultValue:n})=>{let r=o(null);/*#__PURE__*/return t(a,{children:[/*#__PURE__*/e(k,{$if:!i,children:/*#__PURE__*/e(O,{ref:r,defaultValue:n})}),/*#__PURE__*/e(k,{$if:i,children:/*#__PURE__*/t(C,{onClick:()=>{l(),setTimeout((()=>{r.current?.focus()}),0)},children:[/*#__PURE__*/e(S,{children:/*#__PURE__*/e(P,{})}),"Continue with Email"]})})]})},me=()=>{let[a,i]=n(!1),{currentScreen:l,navigate:r,setModalData:o,data:s}=f(),{enabled:c,token:d}=w(),{initLoginWithFarcaster:p}=m(),{accountType:h}=T();/*#__PURE__*/return t(C,{onClick:async()=>{i(!0);try{c&&!d?(o({captchaModalData:{callback:e=>p(e,s?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:"FarcasterConnectStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),r("CaptchaScreen")):(await p(d,s?.login?.disableSignup),r("FarcasterConnectStatusScreen"))}catch(e){o({errorModalData:{error:e,previousScreen:l||"LandingScreen"}}),r("ErrorScreen")}finally{i(!1)}},disabled:!1,children:[/*#__PURE__*/e(V,{width:32,height:32})," Farcaster",a&&/*#__PURE__*/e(b,{}),"farcaster"===h&&/*#__PURE__*/e(ge,{color:"gray",children:"Recent"})]})};let ge=/*#__PURE__*/c(R).withConfig({displayName:"StyledChip",componentId:"sc-2f1c7323-0"})(["margin-left:auto;"]);const fe=({...a})=>/*#__PURE__*/t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...a,children:[/*#__PURE__*/t("g",{clipPath:"url(#clip0_2856_1743)",children:[/*#__PURE__*/e("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"}),/*#__PURE__*/e("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"})]}),/*#__PURE__*/e("defs",{children:/*#__PURE__*/e("clipPath",{id:"clip0_2856_1743",children:/*#__PURE__*/e("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]}),ye=({chainType:a,withPadding:i})=>{let l="";return l="ethereum-only"===a||"ethereum-and-solana"===a?"Rainbow, Phantom, or Coinbase Wallet":"Phantom or Solflare",/*#__PURE__*/e(M,{$withPadding:i,children:/*#__PURE__*/t(x,{children:[/*#__PURE__*/e(H,{style:{color:"var(--privy-color-warn)",height:48,width:48}}),/*#__PURE__*/e("h3",{children:"No wallets available"}),/*#__PURE__*/t("p",{children:["Please download an external wallet provider, like ",l,"."]})]})},"empty-wallet-state")},we=()=>{let{enabled:a,token:i}=w(),{navigate:l,setModalData:n,data:r}=f(),o=u(),{initLoginWithPasskey:c}=m(),d=()=>{o.loginConfig.passkeysForSignupEnabled?l("PasskeySelectSignupOrLogin"):(async()=>{a&&!i?(n({passkeyAuthModalData:{passkeySignupFlow:!1},captchaModalData:{callback:e=>c({captchaToken:e,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"PasskeyStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),l("CaptchaScreen")):(await c({withPrivyUi:!0,captchaToken:i}),n({passkeyAuthModalData:{passkeySignupFlow:!1}}),l("PasskeyStatusScreen"))})()};return 0===s((()=>{let e=r?.login?.loginMethods;return e?e.filter((e=>"passkey"!==e)).length:Object.entries(o.loginMethods).filter((([e,t])=>t)).filter((([e])=>"passkey"!==e)).length}),[o.loginMethods,r?.login])?/*#__PURE__*/t(C,{onClick:d,children:[/*#__PURE__*/e(z,{})," Continue with passkey"]}):/*#__PURE__*/e(G,{as:"button",onClick:d,size:"sm",variant:"navigation",style:{width:"100%",justifyContent:"center"},children:"I have a passkey"})},ve=({isEditable:i,setIsEditable:l,defaultValue:n})=>{let r=o(null),{authenticated:s}=g(),{navigate:c,setModalData:d,currentScreen:p,data:h}=f(),{initLoginWithSms:y}=m(),{enabled:v,token:b}=w(),{whatsAppEnabled:T}=u();/*#__PURE__*/return t(a,{children:[/*#__PURE__*/e(k,{$if:!i,children:/*#__PURE__*/e(q,{ref:r,onSubmit:async function({qualifiedPhoneNumber:e}){if(!v||b||s)try{await y({phoneNumber:e,captchaToken:b,withPrivyUi:!0,disableSignup:h?.login?.disableSignup}),c("AwaitingPasswordlessCodeScreen")}catch(e){d({errorModalData:{error:e,previousScreen:p||"LandingScreen"}}),c("ErrorScreen")}else d({captchaModalData:{callback:t=>y({phoneNumber:e,captchaToken:t,withPrivyUi:!0,disableSignup:h?.login?.disableSignup}),userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),c("CaptchaScreen")},defaultValue:n})}),/*#__PURE__*/e(k,{$if:i,children:/*#__PURE__*/t(C,{onClick:()=>{l(),setTimeout((()=>{r.current?.focus()}),0)},children:[/*#__PURE__*/e(S,{children:/*#__PURE__*/e(j,{})}),"Continue with ",T?"WhatsApp":"SMS"]})})]})};let Ce={apple:{logo:te,displayName:"Apple"},discord:{logo:ee,displayName:"Discord"},github:{logo:J,displayName:"GitHub"},google:{logo:X,displayName:"Google"},linkedin:{logo:Q,displayName:"LinkedIn"},spotify:{logo:Y,displayName:"Spotify"},instagram:{logo:K,displayName:"Instagram"},twitter:{logo:Z,displayName:"Twitter"},tiktok:{logo:B,displayName:"TikTok"},line:{logo:ie,displayName:"LINE"},twitch:{logo:ae,displayName:"Twitch"}};const be=({provider:a})=>{let{enabled:i,token:l}=w(),{navigate:r,setModalData:o,data:c}=f(),[d,p]=n(!1),h=u(),{initLoginWithOAuth:g}=m(),{accountType:b}=T(),k=s((()=>b&&"guest"!==b&&"authorization_key"!==b&&"cross_app"!==b?v(b):null),[b]),{displayName:M,logo:x}=s((()=>{if(y(a)){let t=h.customOAuthProviders.find((e=>e.provider===a)),i=t.provider_icon_url,l=t.provider_display_name;return{displayName:l,logo:({style:t})=>/*#__PURE__*/e("img",{alt:`${l} logo`,src:i,style:t})}}return Ce[a]}),[a,h.customOAuthProviders]);/*#__PURE__*/return t(C,{onClick:()=>{p(!0),setTimeout((()=>{p(!1)}),2e3),i&&!l?(o({captchaModalData:{callback:e=>g(a,e,c?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ErrorScreen"}}),r("CaptchaScreen")):g(a,void 0,c?.login?.disableSignup)},disabled:d,children:[/*#__PURE__*/e(S,{$fullSize:!0,children:/*#__PURE__*/e(x,{style:{width:"32px",height:"32px"}})}),M,k?.loginMethod===a&&/*#__PURE__*/e(ke,{color:"gray",children:"Recent"})]})};let ke=/*#__PURE__*/c(R).withConfig({displayName:"StyledChip",componentId:"sc-e74c7091-0"})(["margin-left:auto;"]);const Se=()=>{let{enabled:a,token:i}=w(),{navigate:l,setModalData:r,data:o}=f(),[s,c]=n(!1),{initLoginWithTelegram:d}=m(),{accountType:p}=T();async function h(e){try{await d(e,o?.login?.disableSignup),r({telegramAuthModalData:{seamlessAuth:!1}}),l("TelegramAuthScreen")}catch(e){console.error(e),c(!1)}}/*#__PURE__*/return t(C,{onClick:async function(){if(c(!0),a&&!i)return r({captchaModalData:{callback:h,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ErrorScreen"}}),void l("CaptchaScreen");await h(i)},disabled:s,children:[/*#__PURE__*/e(le,{width:32,height:32}),"Telegram","telegram"===p&&/*#__PURE__*/e(Te,{color:"gray",children:"Recent"})]})};let Te=/*#__PURE__*/c(R).withConfig({displayName:"StyledChip",componentId:"sc-639dd483-0"})(["margin-left:auto;"]);const Me=({onClick:a,text:i,icon:l})=>/*#__PURE__*/t(C,{onClick:a,children:[/*#__PURE__*/e(S,{children:l}),/*#__PURE__*/e(L,{children:i})]}),xe=({connectOnly:i})=>{let{closePrivyModal:l}=m(),{data:o,setModalData:c,onUserCloseViaDialogOrKeybindRef:p,navigate:h}=f(),g=u(),w=o?.login,C=g.appearance.walletList,b=w?.walletChainType??g.appearance.walletChainType,{accountType:k,walletClientType:S,chainType:M}=T(),x=s((()=>k&&"guest"!==k&&"authorization_key"!==k&&"cross_app"!==k?v(k):null),[k]),{email:L,sms:I,google:W,twitter:E,discord:P,github:j,spotify:D,instagram:O,tiktok:R,line:V,twitch:H,linkedin:z,apple:G,wallet:q,farcaster:B,telegram:Z}=s((()=>w?.loginMethods?_(w.loginMethods,!0):null),[w])??g.loginMethods,{wallets:K}=U({enabled:A(q?C:[]),walletList:C,walletChainType:b}),Y=g.customOAuthProviders,{passkey:Q}=g.loginMethods,X=[L&&"email",I&&"sms",W&&"google",E&&"twitter",P&&"discord",j&&"github",D&&"spotify",O&&"instagram",R&&"tiktok",V&&"line",H&&"twitch",z&&"linkedin",G&&"apple",B&&"farcaster",Z&&"telegram",...Y.map((e=>e.provider))].filter((e=>!!e)),J=X.length>0,ee=s((()=>q&&!J?"web3-first":q&&g?.appearance.loginGroupPriority||"web2-first"),[q,J,g?.appearance.loginGroupPriority]),te=g?.appearance.hideDirectWeb2Inputs,[ae,ie]=n("default"),[le,re]=n(Ee({mostRecentlyUsedAccountType:k,smsAvailable:I,emailAvailable:L,prefilledType:w?.prefill?.type}));r((()=>{re(Ee({mostRecentlyUsedAccountType:k,smsAvailable:I,emailAvailable:L,prefilledType:w?.prefill?.type}))}),[L,I,k]);let ce=()=>{l({shouldCallAuthOnSuccess:!0}),setTimeout((()=>{ie("default")}),150)};p.current=ce;let de=[];S&&q?de.push(S):x?.loginMethod&&X.includes(x.loginMethod)&&de.push(x.loginMethod);let pe=t=>{if("email"===t)/*#__PURE__*/return e(ue,{isEditable:"email"===le,setIsEditable:()=>{re("email")},defaultValue:"email"===w?.prefill?.type?w.prefill.value:void 0},t);if("sms"===t)/*#__PURE__*/return e(ve,{isEditable:"sms"===le,setIsEditable:()=>{re("sms")},defaultValue:"phone"===w?.prefill?.type?w.prefill.value:void 0},t);if("apple"===t)/*#__PURE__*/return e(be,{provider:"apple"},t);if("discord"===t)/*#__PURE__*/return e(be,{provider:"discord"},t);if("farcaster"===t)/*#__PURE__*/return e(me,{},t);if("github"===t)/*#__PURE__*/return e(be,{provider:"github"},t);if("google"===t)/*#__PURE__*/return e(be,{provider:"google"},t);if("linkedin"===t)/*#__PURE__*/return e(be,{provider:"linkedin"},t);if("tiktok"===t)/*#__PURE__*/return e(be,{provider:"tiktok"},t);if("line"===t)/*#__PURE__*/return e(be,{provider:"line"},t);if("twitch"===t)/*#__PURE__*/return e(be,{provider:"twitch"},t);if("spotify"===t)/*#__PURE__*/return e(be,{provider:"spotify"},t);if("instagram"===t)/*#__PURE__*/return e(be,{provider:"instagram"},t);if("twitter"===t)/*#__PURE__*/return e(be,{provider:"twitter"},t);if("telegram"===t)/*#__PURE__*/return e(Se,{},t);if(y(t))/*#__PURE__*/return e(be,{provider:t},t);let a=K.findIndex((({id:e})=>e===F.normalize(t))),l="solana"===M?"solana-only":"ethereum-only";/*#__PURE__*/return e($,{recent:!0,index:a,data:{wallets:K,walletChainType:l,handleWalletClick(e){c((t=>({...t,externalConnectWallet:{walletList:C,walletChainType:l,preSelectedWalletId:e.id}}))),h(i?"ConnectOnlyLandingScreen":"AuthenticateWithWalletScreen")}}})},he=K.filter((e=>e.id!==F.normalize(S||""))),ge=he.map(((t,a)=>/*#__PURE__*/e($,{index:a,data:{walletChainType:b,wallets:he,handleWalletClick(e){c((t=>({...t,externalConnectWallet:{walletList:C,walletChainType:b,preSelectedWalletId:e.id}}))),h(i?"ConnectOnlyLandingScreen":"AuthenticateWithWalletScreen")}}},t.id))),fe=X.filter((e=>e!==x?.loginMethod)).flatMap(pe),Ce=de.flatMap(pe);"web3-first"===ee&&"default"===ae?ge.unshift(...Ce):"web2-first"===ee&&fe.unshift(...Ce);let ke="web2-overflow"===ae?()=>ie("default"):void 0,Te=X.filter((e=>"email"!==e&&"sms"!==e)),xe=Ne({priority:ee,email:L,sms:I,social:Te}),Pe=Ie({priority:ee,email:L,sms:I,social:Te}),je=/*#__PURE__*/e(ne,{text:We({priority:ee}),onClick:()=>{c({...o,externalConnectWallet:{walletChainType:w?.walletChainType??g.appearance.walletChainType}}),h(i?"ConnectOnlyLandingScreen":"AuthenticateWithWalletScreen")}}),De=/*#__PURE__*/e(Me,{text:xe,icon:Pe,onClick:()=>ie("web2-overflow")}),Oe=te?0:1,Re=q&&ge.length>0,Ve=0===fe.length&&q&&0===ge.length,_e=5-(Re?1:0),Ue="default"===ae&&g?.appearance.logo,Fe="default"===ae&&g.appearance.loginMessage;/*#__PURE__*/return t(oe,{title:g.appearance.landingHeader,icon:Ue?/*#__PURE__*/e(se,{}):void 0,iconVariant:Ue?"logo":void 0,onClose:ce,showClose:!0,onBack:ke,showBack:!!ke,helpText:g||Q&&"default"===ae?/*#__PURE__*/t(a,{children:[Q&&"default"===ae&&/*#__PURE__*/e(we,{}),g&&/*#__PURE__*/e(d,{app:g})]}):void 0,watermark:!0,children:[Fe&&("string"==typeof g.appearance.loginMessage?/*#__PURE__*/e(Le,{children:g.appearance.loginMessage}):/*#__PURE__*/e(Ae,{children:g.appearance.loginMessage})),/*#__PURE__*/e(N,{$colorScheme:g.appearance.palette.colorScheme,children:"default"===ae&&"web2-first"===ee?/*#__PURE__*/t(a,{children:[fe.length>_e?fe.slice(0,_e-1):fe,fe.length>_e&&De,Re&&je,Ve&&/*#__PURE__*/e(ye,{chainType:g.appearance.walletChainType})]}):"default"===ae&&"web3-first"===ee?/*#__PURE__*/t(a,{children:[q&&/*#__PURE__*/t(a,{children:[ge.length>_e?ge.slice(0,_e-1):ge,ge.length>_e&&je]}),fe.length>Oe&&De,fe.length===Oe&&fe[0],Ve&&/*#__PURE__*/e(ye,{chainType:g.appearance.walletChainType})]}):"web2-overflow"===ae?/*#__PURE__*/e(a,{children:"web3-first"===ee?fe:fe.slice(3)}):null})]})};let Le=/*#__PURE__*/c.div.withConfig({displayName:"StyledSubtitle",componentId:"sc-b318685a-0"})(["text-align:center;font-size:14px;margin-bottom:24px;"]),Ae=/*#__PURE__*/c.div.withConfig({displayName:"MessageContainer",componentId:"sc-b318685a-1"})(["margin-bottom:24px;"]),Ne=({priority:e,email:t,sms:a,social:i})=>"web2-first"===e?"Other socials":t&&a&&i.length>0||t&&i.length>0?"Log in with email or socials":a&&i.length>0?"Log in with sms or socials":t&&a?"Continue with email or sms":t?"Continue with email":a?"Continue with sms":"Log in with a social account",Ie=({priority:t,email:a,sms:i,social:l})=>"web2-first"===t||l.length>0?/*#__PURE__*/e(D,{}):a&&i?/*#__PURE__*/e(fe,{}):a?/*#__PURE__*/e(P,{}):i?/*#__PURE__*/e(j,{}):null,We=({priority:e})=>"web2-first"===e?"Continue with a wallet":"Other wallets";const Ee=({mostRecentlyUsedAccountType:e,smsAvailable:t,emailAvailable:a,prefilledType:i})=>a&&("email"===e&&"phone"!==i||"email"===i)||!t||"phone"!==e&&"phone"!==i?"email":"sms",Pe=({connectOnly:l})=>{let{closePrivyModal:o,connectors:c}=m(),{onUserCloseViaDialogOrKeybindRef:g,data:y}=f(),w=u(),{appearance:{palette:{colorScheme:C}}}=u(),{accountType:b,walletClientType:k,chainType:S}=T(),M=s((()=>b&&"guest"!==b&&"authorization_key"!==b&&"cross_app"!==b?v(b):null),[b]),x=w.loginMethodsAndOrder?.primary??[],L=w.loginMethodsAndOrder?.overflow??[],A=s((()=>[...x,...L]),[x,L]),P=w.loginMethods.passkey,j=y?.login,D=[];k&&A.includes(k)?D.push(k):b&&A.includes(M?.loginMethod)&&D.push(M?.loginMethod);let[O,R]=n("default"),[V,_]=n(Ee({mostRecentlyUsedAccountType:b,smsAvailable:A.includes("sms"),emailAvailable:A.includes("email"),prefilledType:j?.prefill?.type}));r((()=>{_(Ee({mostRecentlyUsedAccountType:b,smsAvailable:A.includes("sms"),emailAvailable:A.includes("email"),prefilledType:j?.prefill?.type}))}),[A,b]),r((()=>{"phone"===b&&_("sms");let e=A.indexOf("sms"),t=A.indexOf("email");e>-1&&e<t&&_("sms")}),[b,x,L]);let U=()=>{o({shouldCallAuthOnSuccess:!0}),setTimeout((()=>{R("default")}),150)};g.current=U;let F=t=>"email"===t?/*#__PURE__*/e(ue,{isEditable:"email"===V,setIsEditable:()=>{_("email")},defaultValue:"email"===j?.prefill?.type?j.prefill.value:void 0},t):"sms"===t?/*#__PURE__*/e(ve,{isEditable:"sms"===V,setIsEditable:()=>{_("sms")},defaultValue:"phone"===j?.prefill?.type?j.prefill.value:void 0},t):"apple"===t?/*#__PURE__*/e(be,{provider:"apple"},t):"discord"===t?/*#__PURE__*/e(be,{provider:"discord"},t):"farcaster"===t?/*#__PURE__*/e(me,{},t):"github"===t?/*#__PURE__*/e(be,{provider:"github"},t):"google"===t?/*#__PURE__*/e(be,{provider:"google"},t):"linkedin"===t?/*#__PURE__*/e(be,{provider:"linkedin"},t):"spotify"===t?/*#__PURE__*/e(be,{provider:"spotify"},t):"instagram"===t?/*#__PURE__*/e(be,{provider:"instagram"},t):"tiktok"===t?/*#__PURE__*/e(be,{provider:"tiktok"},t):"line"===t?/*#__PURE__*/e(be,{provider:"line"},t):"twitch"===t?/*#__PURE__*/e(be,{provider:"twitch"},t):"twitter"===t?/*#__PURE__*/e(be,{provider:"twitter"},t):"telegram"===t?/*#__PURE__*/e(Se,{},t):t.startsWith("privy:")?/*#__PURE__*/e(he,{appId:t.replace("privy:","")},t):re({walletList:w.appearance.walletList,walletChainType:j?.walletChainType??w.appearance.walletChainType,connectors:c,connectOnly:l,ignore:A,walletConnectEnabled:w.externalWallets.walletConnect.enabled,forceWallet:{wallet:t,chainType:S??"ethereum"}}),$=D.flatMap(F),H=x.filter((e=>e!==k&&e!==M?.loginMethod)).flatMap(F),z=L.filter((e=>e!==k&&e!==M?.loginMethod)).flatMap(F),[G,q]=I([...$,...H,...z],je({primary:H.length+$.length,overflow:z.length}));/*#__PURE__*/return t(a,{children:[/*#__PURE__*/e(p,{title:w.appearance.landingHeader,onClose:U,backFn:"default"===O?void 0:()=>{R("default")}}),"default"===O&&/*#__PURE__*/e(De,{}),"default"===O&&("string"==typeof w.appearance.loginMessage?/*#__PURE__*/e(W,{children:w.appearance.loginMessage}):w.appearance.loginMessage),/*#__PURE__*/e(E,{style:{overflow:"hidden"},children:/*#__PURE__*/t(N,{$colorScheme:C,children:["default"===O&&/*#__PURE__*/t(a,{children:[G,q.length>0&&/*#__PURE__*/e(Me,{text:"More options",icon:/*#__PURE__*/e(i,{}),onClick:()=>R("overflow")})]}),"overflow"===O&&/*#__PURE__*/e(a,{children:q}),P&&"default"===O&&/*#__PURE__*/e(we,{})]})}),w&&/*#__PURE__*/e(d,{app:w}),/*#__PURE__*/e(h,{})]})};let je=({primary:e,overflow:t})=>e<5?e:5===e&&0===t?5:4,De=/*#__PURE__*/c(ce).withConfig({displayName:"StyledAppLogoHeader",componentId:"sc-7cdadd41-0"})(["margin-bottom:16px;"]);export{Pe as C,xe as L};
|
|
1
|
+
import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import i from"@heroicons/react/24/outline/UserCircleIcon";import l,{useState as n,useEffect as r,useRef as o,useMemo as s}from"react";import{styled as c}from"styled-components";import{T as d,M as p,B as h}from"./ModalHeader-CxHK1IKF.mjs";import{u}from"./context-B4VZqX5H.mjs";import{u as m}from"./internal-context-DLZicboG.mjs";import{u as g,a as f,i as y}from"./get-is-unified-wallet-DXko-EzF.mjs";import{a as w,t as v}from"./index-CCrVHfyv.mjs";import{U as C,G as b,H as k,V as S,F as T,W as M,X as x,Y as L,e as A,Z as N,_ as I,$ as W,a0 as E}from"./useActiveWallet-Bj-s666H.mjs";import{Mail as P,Smartphone as j,UserCircle as D}from"lucide-react";import{C as O}from"./ConnectEmailForm-C2TJPUYV.mjs";import{C as R}from"./Chip-Bsgj4Yc-.mjs";import{F as _}from"./farcaster-DPlSjvF5.mjs";import{toObjectKeys as V}from"@privy-io/js-sdk-core";import{u as U,c as F,d as $}from"./ConnectWalletView-tpdAD3K7.mjs";import z from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import H from"@heroicons/react/24/outline/FingerPrintIcon";import{L as G}from"./Link-DwjLfHwW.mjs";import{C as q}from"./ConnectPhoneForm-kW8tUq0-.mjs";import{T as B,a as K,I as X,S as Z,L as J,G as Q,b as Y,D as ee,A as te}from"./twitter-6jomarO4.mjs";import{T as ae,L as ie}from"./twitch-5IOe4sIQ.mjs";import{T as le}from"./telegram-B-JqnkqZ.mjs";import{W as ne,t as re}from"./WalletButtonList-C1OqZHCA.mjs";import{S as oe}from"./ScreenLayout-pthdsODa.mjs";const se=()=>{let t=u(),a=t?.appearance?.logo,i=`${t?.name} logo`,n={maxHeight:"90px",maxWidth:"180px"};return a?"string"==typeof a?/*#__PURE__*/e("img",{src:a,alt:i,style:n}):"svg"===a.type||"img"===a.type?/*#__PURE__*/l.cloneElement(a,{alt:i,style:n}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null},ce=t=>{let a=u();return a?.appearance.logo?/*#__PURE__*/e(de,{...t,children:/*#__PURE__*/e(se,{})}):null},de=/*#__PURE__*/c.div.withConfig({displayName:"AppLogoContainer",componentId:"sc-b210074-0"})(["display:flex;flex-direction:column;align-items:center;padding:24px 0;flex-grow:1;justify-content:center;"]),pe=({name:t,logoUrl:a,size:i="38px"})=>"string"==typeof a?/*#__PURE__*/e("img",{src:a,alt:`${t??"Provider app"} logo`,style:{width:i,height:i,maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):
|
|
2
|
+
/*#__PURE__*/e("span",{}),he=({appId:i})=>{let[l,o]=n(void 0),{startCrossAppAuthFlow:s,authenticated:c}=g(),{client:d}=m();return r((()=>{(async()=>{d&&o(await d.getCrossAppProviderDetails(i))})()}),[d]),/*#__PURE__*/e(C,{onClick:()=>s({appId:i,action:c?"link":"login"}),disabled:!l,children:l?/*#__PURE__*/t(a,{children:[/*#__PURE__*/e(pe,{name:l.name,logoUrl:l.icon_url||void 0,size:"24px"})," ",l.name]}):/*#__PURE__*/e(b,{})})},ue=({isEditable:i,setIsEditable:l,defaultValue:n})=>{let r=o(null);/*#__PURE__*/return t(a,{children:[/*#__PURE__*/e(k,{$if:!i,children:/*#__PURE__*/e(O,{ref:r,defaultValue:n})}),/*#__PURE__*/e(k,{$if:i,children:/*#__PURE__*/t(C,{onClick:()=>{l(),setTimeout((()=>{r.current?.focus()}),0)},children:[/*#__PURE__*/e(S,{children:/*#__PURE__*/e(P,{})}),"Continue with Email"]})})]})},me=()=>{let[a,i]=n(!1),{currentScreen:l,navigate:r,setModalData:o,data:s}=f(),{enabled:c,token:d}=w(),{initLoginWithFarcaster:p}=m(),{accountType:h}=T();/*#__PURE__*/return t(C,{onClick:async()=>{i(!0);try{c&&!d?(o({captchaModalData:{callback:e=>p(e,s?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:"FarcasterConnectStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),r("CaptchaScreen")):(await p(d,s?.login?.disableSignup),r("FarcasterConnectStatusScreen"))}catch(e){o({errorModalData:{error:e,previousScreen:l||"LandingScreen"}}),r("ErrorScreen")}finally{i(!1)}},disabled:!1,children:[/*#__PURE__*/e(_,{width:32,height:32})," Farcaster",a&&/*#__PURE__*/e(b,{}),"farcaster"===h&&/*#__PURE__*/e(ge,{color:"gray",children:"Recent"})]})};let ge=/*#__PURE__*/c(R).withConfig({displayName:"StyledChip",componentId:"sc-2f1c7323-0"})(["margin-left:auto;"]);const fe=({...a})=>/*#__PURE__*/t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...a,children:[/*#__PURE__*/t("g",{clipPath:"url(#clip0_2856_1743)",children:[/*#__PURE__*/e("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"}),/*#__PURE__*/e("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"})]}),/*#__PURE__*/e("defs",{children:/*#__PURE__*/e("clipPath",{id:"clip0_2856_1743",children:/*#__PURE__*/e("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]}),ye=({chainType:a,withPadding:i})=>{let l="";return l="ethereum-only"===a||"ethereum-and-solana"===a?"Rainbow, Phantom, or Coinbase Wallet":"Phantom or Solflare",/*#__PURE__*/e(M,{$withPadding:i,children:/*#__PURE__*/t(x,{children:[/*#__PURE__*/e(z,{style:{color:"var(--privy-color-warn)",height:48,width:48}}),/*#__PURE__*/e("h3",{children:"No wallets available"}),/*#__PURE__*/t("p",{children:["Please download an external wallet provider, like ",l,"."]})]})},"empty-wallet-state")},we=()=>{let{enabled:a,token:i}=w(),{navigate:l,setModalData:n,data:r}=f(),o=u(),{initLoginWithPasskey:c}=m(),d=()=>{o.loginConfig.passkeysForSignupEnabled?l("PasskeySelectSignupOrLogin"):(async()=>{a&&!i?(n({passkeyAuthModalData:{passkeySignupFlow:!1},captchaModalData:{callback:e=>c({captchaToken:e,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"PasskeyStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),l("CaptchaScreen")):(await c({withPrivyUi:!0,captchaToken:i}),n({passkeyAuthModalData:{passkeySignupFlow:!1}}),l("PasskeyStatusScreen"))})()};return 0===s((()=>{let e=r?.login?.loginMethods;return e?e.filter((e=>"passkey"!==e)).length:Object.entries(o.loginMethods).filter((([e,t])=>t)).filter((([e])=>"passkey"!==e)).length}),[o.loginMethods,r?.login])?/*#__PURE__*/t(C,{onClick:d,children:[/*#__PURE__*/e(H,{})," Continue with passkey"]}):/*#__PURE__*/e(G,{as:"button",onClick:d,size:"sm",variant:"navigation",style:{width:"100%",justifyContent:"center"},children:"I have a passkey"})},ve=({isEditable:i,setIsEditable:l,defaultValue:n})=>{let r=o(null),{authenticated:s}=g(),{navigate:c,setModalData:d,currentScreen:p,data:h}=f(),{initLoginWithSms:y}=m(),{enabled:v,token:b}=w(),{whatsAppEnabled:T}=u();/*#__PURE__*/return t(a,{children:[/*#__PURE__*/e(k,{$if:!i,children:/*#__PURE__*/e(q,{ref:r,onSubmit:async function({qualifiedPhoneNumber:e}){if(!v||b||s)try{await y({phoneNumber:e,captchaToken:b,withPrivyUi:!0,disableSignup:h?.login?.disableSignup}),c("AwaitingPasswordlessCodeScreen")}catch(e){d({errorModalData:{error:e,previousScreen:p||"LandingScreen"}}),c("ErrorScreen")}else d({captchaModalData:{callback:t=>y({phoneNumber:e,captchaToken:t,withPrivyUi:!0,disableSignup:h?.login?.disableSignup}),userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),c("CaptchaScreen")},defaultValue:n})}),/*#__PURE__*/e(k,{$if:i,children:/*#__PURE__*/t(C,{onClick:()=>{l(),setTimeout((()=>{r.current?.focus()}),0)},children:[/*#__PURE__*/e(S,{children:/*#__PURE__*/e(j,{})}),"Continue with ",T?"WhatsApp":"SMS"]})})]})};let Ce={apple:{logo:te,displayName:"Apple"},discord:{logo:ee,displayName:"Discord"},github:{logo:Y,displayName:"GitHub"},google:{logo:Q,displayName:"Google"},linkedin:{logo:J,displayName:"LinkedIn"},spotify:{logo:Z,displayName:"Spotify"},instagram:{logo:X,displayName:"Instagram"},twitter:{logo:K,displayName:"Twitter"},tiktok:{logo:B,displayName:"TikTok"},line:{logo:ie,displayName:"LINE"},twitch:{logo:ae,displayName:"Twitch"}};const be=({provider:a})=>{let{enabled:i,token:l}=w(),{navigate:r,setModalData:o,data:c}=f(),[d,p]=n(!1),h=u(),{initLoginWithOAuth:g}=m(),{accountType:b}=T(),k=s((()=>b&&"guest"!==b&&"authorization_key"!==b&&"cross_app"!==b?v(b):null),[b]),{displayName:M,logo:x}=s((()=>{if(y(a)){let t=h.customOAuthProviders.find((e=>e.provider===a)),i=t.provider_icon_url,l=t.provider_display_name;return{displayName:l,logo:({style:t})=>/*#__PURE__*/e("img",{alt:`${l} logo`,src:i,style:t})}}return Ce[a]}),[a,h.customOAuthProviders]);/*#__PURE__*/return t(C,{onClick:()=>{p(!0),setTimeout((()=>{p(!1)}),2e3),i&&!l?(o({captchaModalData:{callback:e=>g(a,e,c?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ErrorScreen"}}),r("CaptchaScreen")):g(a,void 0,c?.login?.disableSignup)},disabled:d,children:[/*#__PURE__*/e(S,{$fullSize:!0,children:/*#__PURE__*/e(x,{style:{width:"32px",height:"32px"}})}),M,k?.loginMethod===a&&/*#__PURE__*/e(ke,{color:"gray",children:"Recent"})]})};let ke=/*#__PURE__*/c(R).withConfig({displayName:"StyledChip",componentId:"sc-e74c7091-0"})(["margin-left:auto;"]);const Se=()=>{let{enabled:a,token:i}=w(),{navigate:l,setModalData:r,data:o}=f(),[s,c]=n(!1),{initLoginWithTelegram:d}=m(),{accountType:p}=T();async function h(e){try{await d(e,o?.login?.disableSignup),r({telegramAuthModalData:{seamlessAuth:!1}}),l("TelegramAuthScreen")}catch(e){console.error(e),c(!1)}}/*#__PURE__*/return t(C,{onClick:async function(){if(c(!0),a&&!i)return r({captchaModalData:{callback:h,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ErrorScreen"}}),void l("CaptchaScreen");await h(i)},disabled:s,children:[/*#__PURE__*/e(le,{width:32,height:32}),"Telegram","telegram"===p&&/*#__PURE__*/e(Te,{color:"gray",children:"Recent"})]})};let Te=/*#__PURE__*/c(R).withConfig({displayName:"StyledChip",componentId:"sc-639dd483-0"})(["margin-left:auto;"]);const Me=({onClick:a,text:i,icon:l})=>/*#__PURE__*/t(C,{onClick:a,children:[/*#__PURE__*/e(S,{children:l}),/*#__PURE__*/e(L,{children:i})]}),xe=({connectOnly:i})=>{let{closePrivyModal:l}=m(),{data:o,setModalData:c,onUserCloseViaDialogOrKeybindRef:p,navigate:h}=f(),g=u(),w=o?.login,C=g.appearance.walletList,b=w?.walletChainType??g.appearance.walletChainType,{accountType:k,walletClientType:S,chainType:M}=T(),x=s((()=>k&&"guest"!==k&&"authorization_key"!==k&&"cross_app"!==k?v(k):null),[k]),{email:L,sms:I,google:W,twitter:E,discord:P,github:j,spotify:D,instagram:O,tiktok:R,line:_,twitch:z,linkedin:H,apple:G,wallet:q,farcaster:B,telegram:K}=s((()=>w?.loginMethods?V(w.loginMethods,!0):null),[w])??g.loginMethods,{wallets:X}=U({enabled:A(q?C:[]),walletList:C,walletChainType:b}),Z=g.customOAuthProviders,{passkey:J}=g.loginMethods,Q=[L&&"email",I&&"sms",W&&"google",E&&"twitter",P&&"discord",j&&"github",D&&"spotify",O&&"instagram",R&&"tiktok",_&&"line",z&&"twitch",H&&"linkedin",G&&"apple",B&&"farcaster",K&&"telegram",...Z.map((e=>e.provider))].filter((e=>!!e)),Y=Q.length>0,ee=s((()=>q&&!Y?"web3-first":q&&g?.appearance.loginGroupPriority||"web2-first"),[q,Y,g?.appearance.loginGroupPriority]),te=g?.appearance.hideDirectWeb2Inputs,[ae,ie]=n("default"),[le,re]=n(Ee({mostRecentlyUsedAccountType:k,smsAvailable:I,emailAvailable:L,prefilledType:w?.prefill?.type}));r((()=>{re(Ee({mostRecentlyUsedAccountType:k,smsAvailable:I,emailAvailable:L,prefilledType:w?.prefill?.type}))}),[L,I,k]);let ce=()=>{l({shouldCallAuthOnSuccess:!0}),setTimeout((()=>{ie("default")}),150)};p.current=ce;let de=[];S&&q?de.push(S):x?.loginMethod&&Q.includes(x.loginMethod)&&de.push(x.loginMethod);let pe=t=>{if("email"===t)/*#__PURE__*/return e(ue,{isEditable:"email"===le,setIsEditable:()=>{re("email")},defaultValue:"email"===w?.prefill?.type?w.prefill.value:void 0},t);if("sms"===t)/*#__PURE__*/return e(ve,{isEditable:"sms"===le,setIsEditable:()=>{re("sms")},defaultValue:"phone"===w?.prefill?.type?w.prefill.value:void 0},t);if("apple"===t)/*#__PURE__*/return e(be,{provider:"apple"},t);if("discord"===t)/*#__PURE__*/return e(be,{provider:"discord"},t);if("farcaster"===t)/*#__PURE__*/return e(me,{},t);if("github"===t)/*#__PURE__*/return e(be,{provider:"github"},t);if("google"===t)/*#__PURE__*/return e(be,{provider:"google"},t);if("linkedin"===t)/*#__PURE__*/return e(be,{provider:"linkedin"},t);if("tiktok"===t)/*#__PURE__*/return e(be,{provider:"tiktok"},t);if("line"===t)/*#__PURE__*/return e(be,{provider:"line"},t);if("twitch"===t)/*#__PURE__*/return e(be,{provider:"twitch"},t);if("spotify"===t)/*#__PURE__*/return e(be,{provider:"spotify"},t);if("instagram"===t)/*#__PURE__*/return e(be,{provider:"instagram"},t);if("twitter"===t)/*#__PURE__*/return e(be,{provider:"twitter"},t);if("telegram"===t)/*#__PURE__*/return e(Se,{},t);if(y(t))/*#__PURE__*/return e(be,{provider:t},t);let a=X.findIndex((({id:e})=>e===F.normalize(t))),l="solana"===M?"solana-only":"ethereum-only";/*#__PURE__*/return e($,{recent:!0,index:a,data:{wallets:X,walletChainType:l,handleWalletClick(e){c((t=>({...t,externalConnectWallet:{walletList:C,walletChainType:l,preSelectedWalletId:e.id}}))),h(i?"ConnectOnlyLandingScreen":"AuthenticateWithWalletScreen")}}})},he=X.filter((e=>e.id!==F.normalize(S||""))),ge=he.map(((t,a)=>/*#__PURE__*/e($,{index:a,data:{walletChainType:b,wallets:he,handleWalletClick(e){c((t=>({...t,externalConnectWallet:{walletList:C,walletChainType:b,preSelectedWalletId:e.id}}))),h(i?"ConnectOnlyLandingScreen":"AuthenticateWithWalletScreen")}}},t.id))),fe=Q.filter((e=>e!==x?.loginMethod)).flatMap(pe),Ce=de.flatMap(pe);"web3-first"===ee&&"default"===ae?ge.unshift(...Ce):"web2-first"===ee&&fe.unshift(...Ce);let ke="web2-overflow"===ae?()=>ie("default"):void 0,Te=Q.filter((e=>"email"!==e&&"sms"!==e)),xe=Ne({priority:ee,email:L,sms:I,social:Te}),Pe=Ie({priority:ee,email:L,sms:I,social:Te}),je=/*#__PURE__*/e(ne,{text:We({priority:ee}),onClick:()=>{c({...o,externalConnectWallet:{walletChainType:w?.walletChainType??g.appearance.walletChainType}}),h(i?"ConnectOnlyLandingScreen":"AuthenticateWithWalletScreen")}}),De=/*#__PURE__*/e(Me,{text:xe,icon:Pe,onClick:()=>ie("web2-overflow")}),Oe=te?0:1,Re=q&&ge.length>0,_e=0===fe.length&&q&&0===ge.length,Ve=5-(Re?1:0),Ue="default"===ae&&g?.appearance.logo,Fe="default"===ae&&g.appearance.loginMessage;/*#__PURE__*/return t(oe,{title:g.appearance.landingHeader,icon:Ue?/*#__PURE__*/e(se,{}):void 0,iconVariant:Ue?"logo":void 0,onClose:ce,showClose:!0,onBack:ke,showBack:!!ke,helpText:g||J&&"default"===ae?/*#__PURE__*/t(a,{children:[J&&"default"===ae&&/*#__PURE__*/e(we,{}),g&&/*#__PURE__*/e(d,{app:g})]}):void 0,watermark:!0,children:[Fe&&("string"==typeof g.appearance.loginMessage?/*#__PURE__*/e(Le,{children:g.appearance.loginMessage}):/*#__PURE__*/e(Ae,{children:g.appearance.loginMessage})),/*#__PURE__*/e(N,{$colorScheme:g.appearance.palette.colorScheme,children:"default"===ae&&"web2-first"===ee?/*#__PURE__*/t(a,{children:[fe.length>Ve?fe.slice(0,Ve-1):fe,fe.length>Ve&&De,Re&&je,_e&&/*#__PURE__*/e(ye,{chainType:g.appearance.walletChainType})]}):"default"===ae&&"web3-first"===ee?/*#__PURE__*/t(a,{children:[q&&/*#__PURE__*/t(a,{children:[ge.length>Ve?ge.slice(0,Ve-1):ge,ge.length>Ve&&je]}),fe.length>Oe&&De,fe.length===Oe&&fe[0],_e&&/*#__PURE__*/e(ye,{chainType:g.appearance.walletChainType})]}):"web2-overflow"===ae?/*#__PURE__*/e(a,{children:"web3-first"===ee?fe:fe.slice(3)}):null})]})};let Le=/*#__PURE__*/c.div.withConfig({displayName:"StyledSubtitle",componentId:"sc-b318685a-0"})(["text-align:center;font-size:14px;margin-bottom:24px;"]),Ae=/*#__PURE__*/c.div.withConfig({displayName:"MessageContainer",componentId:"sc-b318685a-1"})(["margin-bottom:24px;"]),Ne=({priority:e,email:t,sms:a,social:i})=>"web2-first"===e?"Other socials":t&&a&&i.length>0||t&&i.length>0?"Log in with email or socials":a&&i.length>0?"Log in with sms or socials":t&&a?"Continue with email or sms":t?"Continue with email":a?"Continue with sms":"Log in with a social account",Ie=({priority:t,email:a,sms:i,social:l})=>"web2-first"===t||l.length>0?/*#__PURE__*/e(D,{}):a&&i?/*#__PURE__*/e(fe,{}):a?/*#__PURE__*/e(P,{}):i?/*#__PURE__*/e(j,{}):null,We=({priority:e})=>"web2-first"===e?"Continue with a wallet":"Other wallets";const Ee=({mostRecentlyUsedAccountType:e,smsAvailable:t,emailAvailable:a,prefilledType:i})=>a&&("email"===e&&"phone"!==i||"email"===i)||!t||"phone"!==e&&"phone"!==i?"email":"sms",Pe=({connectOnly:l})=>{let{closePrivyModal:o,connectors:c}=m(),{onUserCloseViaDialogOrKeybindRef:g,data:y}=f(),w=u(),{appearance:{palette:{colorScheme:C}}}=u(),{accountType:b,walletClientType:k,chainType:S}=T(),M=s((()=>b&&"guest"!==b&&"authorization_key"!==b&&"cross_app"!==b?v(b):null),[b]),x=w.loginMethodsAndOrder?.primary??[],L=w.loginMethodsAndOrder?.overflow??[],A=s((()=>[...x,...L]),[x,L]),P=w.loginMethods.passkey,j=y?.login,D=[];k&&A.includes(k)?D.push(k):b&&A.includes(M?.loginMethod)&&D.push(M?.loginMethod);let[O,R]=n("default"),[_,V]=n(Ee({mostRecentlyUsedAccountType:b,smsAvailable:A.includes("sms"),emailAvailable:A.includes("email"),prefilledType:j?.prefill?.type}));r((()=>{V(Ee({mostRecentlyUsedAccountType:b,smsAvailable:A.includes("sms"),emailAvailable:A.includes("email"),prefilledType:j?.prefill?.type}))}),[A,b]),r((()=>{"phone"===b&&V("sms");let e=A.indexOf("sms"),t=A.indexOf("email");e>-1&&e<t&&V("sms")}),[b,x,L]);let U=()=>{o({shouldCallAuthOnSuccess:!0}),setTimeout((()=>{R("default")}),150)};g.current=U;let F=t=>"email"===t?/*#__PURE__*/e(ue,{isEditable:"email"===_,setIsEditable:()=>{V("email")},defaultValue:"email"===j?.prefill?.type?j.prefill.value:void 0},t):"sms"===t?/*#__PURE__*/e(ve,{isEditable:"sms"===_,setIsEditable:()=>{V("sms")},defaultValue:"phone"===j?.prefill?.type?j.prefill.value:void 0},t):"apple"===t?/*#__PURE__*/e(be,{provider:"apple"},t):"discord"===t?/*#__PURE__*/e(be,{provider:"discord"},t):"farcaster"===t?/*#__PURE__*/e(me,{},t):"github"===t?/*#__PURE__*/e(be,{provider:"github"},t):"google"===t?/*#__PURE__*/e(be,{provider:"google"},t):"linkedin"===t?/*#__PURE__*/e(be,{provider:"linkedin"},t):"spotify"===t?/*#__PURE__*/e(be,{provider:"spotify"},t):"instagram"===t?/*#__PURE__*/e(be,{provider:"instagram"},t):"tiktok"===t?/*#__PURE__*/e(be,{provider:"tiktok"},t):"line"===t?/*#__PURE__*/e(be,{provider:"line"},t):"twitch"===t?/*#__PURE__*/e(be,{provider:"twitch"},t):"twitter"===t?/*#__PURE__*/e(be,{provider:"twitter"},t):"telegram"===t?/*#__PURE__*/e(Se,{},t):t.startsWith("privy:")?/*#__PURE__*/e(he,{appId:t.replace("privy:","")},t):re({walletList:w.appearance.walletList,walletChainType:j?.walletChainType??w.appearance.walletChainType,connectors:c,connectOnly:l,ignore:A,walletConnectEnabled:w.externalWallets.walletConnect.enabled,forceWallet:{wallet:t,chainType:S??"ethereum"}}),$=D.flatMap(F),z=x.filter((e=>e!==k&&e!==M?.loginMethod)).flatMap(F),H=L.filter((e=>e!==k&&e!==M?.loginMethod)).flatMap(F),[G,q]=I([...$,...z,...H],je({primary:z.length+$.length,overflow:H.length}));/*#__PURE__*/return t(a,{children:[/*#__PURE__*/e(p,{title:w.appearance.landingHeader,onClose:U,backFn:"default"===O?void 0:()=>{R("default")}}),"default"===O&&/*#__PURE__*/e(De,{}),"default"===O&&("string"==typeof w.appearance.loginMessage?/*#__PURE__*/e(W,{children:w.appearance.loginMessage}):w.appearance.loginMessage),/*#__PURE__*/e(E,{style:{overflow:"hidden"},children:/*#__PURE__*/t(N,{$colorScheme:C,children:["default"===O&&/*#__PURE__*/t(a,{children:[G,q.length>0&&/*#__PURE__*/e(Me,{text:"More options",icon:/*#__PURE__*/e(i,{}),onClick:()=>R("overflow")})]}),"overflow"===O&&/*#__PURE__*/e(a,{children:q}),P&&"default"===O&&/*#__PURE__*/e(we,{})]})}),w&&/*#__PURE__*/e(d,{app:w}),/*#__PURE__*/e(h,{})]})};let je=({primary:e,overflow:t})=>e<5?e:5===e&&0===t?5:4,De=/*#__PURE__*/c(ce).withConfig({displayName:"StyledAppLogoHeader",componentId:"sc-7cdadd41-0"})(["margin-bottom:16px;"]);export{Pe as C,xe as L};
|