@privy-io/react-auth 3.9.1 → 3.9.2-beta-20251223003741

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.
Files changed (220) hide show
  1. package/dist/cjs/{AccountNotFoundScreen-BjG_YLcK.js → AccountNotFoundScreen-pvTKM6jW.js} +1 -1
  2. package/dist/cjs/{Address-5znFAhQw.js → Address-BtgyqKMF.js} +1 -1
  3. package/dist/cjs/{AffirmativeConsentScreen-BiwTOLaX.js → AffirmativeConsentScreen-BPpA9jVM.js} +1 -1
  4. package/dist/cjs/{AllowlistRejectionScreen-DOZr-QmF.js → AllowlistRejectionScreen-B4e_PoyI.js} +1 -1
  5. package/dist/cjs/{AuthenticateWithWalletScreen-BO4ml_zL.js → AuthenticateWithWalletScreen-D1JtJDqa.js} +1 -1
  6. package/dist/cjs/{AwaitingEvmToSolBridgingScreen-DCvvtPfy.js → AwaitingEvmToSolBridgingScreen-Cr1we24w.js} +1 -1
  7. package/dist/cjs/{AwaitingExternalEthereumTransferScreen-DXSQjzHX.js → AwaitingExternalEthereumTransferScreen-BOBG2s_w.js} +1 -1
  8. package/dist/cjs/{AwaitingPasswordlessCodeScreen-COP_Jshz.js → AwaitingPasswordlessCodeScreen-m2Q2kFnz.js} +1 -1
  9. package/dist/cjs/{AwaitingSolToEvmBridgingScreen-tGqHxf1K.js → AwaitingSolToEvmBridgingScreen-D4yOYsBZ.js} +1 -1
  10. package/dist/cjs/{BridgeNetworkSelectionView-DgFjMLY3.js → BridgeNetworkSelectionView-BQoGlOui.js} +1 -1
  11. package/dist/cjs/{Button-Bm_Ft0Dw.js → Button-qMhxXDF2.js} +1 -1
  12. package/dist/cjs/{CaptchaScreen-BvyOQUvH.js → CaptchaScreen-BB2pGTKI.js} +1 -1
  13. package/dist/cjs/{CoinbaseOnrampStatusScreen-9G_2yIQ-.js → CoinbaseOnrampStatusScreen-1OAPK24q.js} +1 -1
  14. package/dist/cjs/{ConnectEmailForm-D0Xd9Tnw.js → ConnectEmailForm-1TjSZcyQ.js} +1 -1
  15. package/dist/cjs/{ConnectLedgerScreen-COTQ1lqK.js → ConnectLedgerScreen-BzBnLkUb.js} +1 -1
  16. package/dist/cjs/{ConnectOnlyLandingScreen-DErN9BXL.js → ConnectOnlyLandingScreen-DEyg_Bwe.js} +1 -1
  17. package/dist/cjs/{ConnectOnlyStatusScreen-DKhKRV2M.js → ConnectOnlyStatusScreen-rCYgKGxJ.js} +1 -1
  18. package/dist/cjs/{ConnectOrCreateScreen-54nvcrr7.js → ConnectOrCreateScreen-DK-XBRb0.js} +1 -1
  19. package/dist/cjs/{ConnectPhoneForm-WT8rso3i.js → ConnectPhoneForm-CKxdc5tC.js} +1 -1
  20. package/dist/cjs/{ConnectWalletView-DsOX-lHz.js → ConnectWalletView-D8TEW3RH.js} +1 -1
  21. package/dist/cjs/{ConnectionStatusScreen-C1nqbW_A.js → ConnectionStatusScreen-KsrxglVc.js} +1 -1
  22. package/dist/cjs/CrossAppAuthScreen-B4jkE91a.js +1 -0
  23. package/dist/cjs/{CustomLandingScreenView-DQLDU2GD.js → CustomLandingScreenView-4ZTZs-jc.js} +1 -1
  24. package/dist/cjs/{DelegatedActionsConsentScreen-C_-0aHwH.js → DelegatedActionsConsentScreen-B6jgxNhU.js} +1 -1
  25. package/dist/cjs/{DelegatedActionsRevokeScreen-SZkD3b1o.js → DelegatedActionsRevokeScreen-7Md2U13x.js} +1 -1
  26. package/dist/cjs/{EmbeddedWalletConnectingScreen-VdpmfKNX.js → EmbeddedWalletConnectingScreen-BwBSOT3D.js} +1 -1
  27. package/dist/cjs/{EmbeddedWalletCreatedScreen-CfEf4KkH.js → EmbeddedWalletCreatedScreen-DE2lu2X1.js} +1 -1
  28. package/dist/cjs/{EmbeddedWalletKeyExportScreen-D0NE_HvJ.js → EmbeddedWalletKeyExportScreen-B1r4JB0q.js} +1 -1
  29. package/dist/cjs/{EmbeddedWalletOnAccountCreateScreen-CrJFTRI0.js → EmbeddedWalletOnAccountCreateScreen-Zod2_iWk.js} +1 -1
  30. package/dist/cjs/{EmbeddedWalletPasswordUpdateScreen-CjVK53bu.js → EmbeddedWalletPasswordUpdateScreen-S3oOUSQV.js} +1 -1
  31. package/dist/cjs/{EmbeddedWalletPasswordUpdateSplashScreen-CVldlThA.js → EmbeddedWalletPasswordUpdateSplashScreen-Dkpwl0iU.js} +1 -1
  32. package/dist/cjs/{EnrollTotp-BVeDTQ5J.js → EnrollTotp-DNT9b4SA.js} +1 -1
  33. package/dist/cjs/{ErrorScreen-BSjRGrRR.js → ErrorScreen-DzwPxgDV.js} +1 -1
  34. package/dist/cjs/{FarcasterConnectStatusScreen-B7Ab3ddi.js → FarcasterConnectStatusScreen-BT-Kdg1-.js} +1 -1
  35. package/dist/cjs/{FarcasterSignerStatusScreen-Bf--BYd8.js → FarcasterSignerStatusScreen-BvZ0VR9y.js} +1 -1
  36. package/dist/cjs/{FundSolWalletWithExternalSolanaWallet-DcRxhkRg.js → FundSolWalletWithExternalSolanaWallet-ca2tyOfk.js} +1 -1
  37. package/dist/cjs/{FundWalletMethodHeader-BKgYjMau.js → FundWalletMethodHeader-CD-1e4xu.js} +1 -1
  38. package/dist/cjs/{FundingEditAmountScreen-Bs3_avzr.js → FundingEditAmountScreen-C0u8coHj.js} +1 -1
  39. package/dist/cjs/{FundingMethodSelectionScreen-C_cbW1TC.js → FundingMethodSelectionScreen-C175OddP.js} +1 -1
  40. package/dist/cjs/{InAppBrowserLoginNotPossible-CySpQd3Y.js → InAppBrowserLoginNotPossible-DdADV9Uk.js} +1 -1
  41. package/dist/cjs/{InstallWalletScreen-rFpE2-7H.js → InstallWalletScreen-CAUVkOGF.js} +1 -1
  42. package/dist/cjs/{LandingScreen-BmZWpgb3.js → LandingScreen-4qcGVBLC.js} +1 -1
  43. package/dist/cjs/{LinkConflictScreen-DSIPReKB.js → LinkConflictScreen-Dd5XBXn4.js} +1 -1
  44. package/dist/cjs/{LinkEmailScreen-Dc8QC15P.js → LinkEmailScreen-l7Q0gpAd.js} +1 -1
  45. package/dist/cjs/{LinkPasskeyScreen-CUMuhJ2Q.js → LinkPasskeyScreen-_6DwQNTt.js} +1 -1
  46. package/dist/cjs/{LinkPhoneScreen-bozyY6A1.js → LinkPhoneScreen-i5AQ_Fj-.js} +1 -1
  47. package/dist/cjs/{LoginFailedScreen-C4gl1Ezs.js → LoginFailedScreen-C9eVVvxm.js} +1 -1
  48. package/dist/cjs/{ManualTransferScreen-BTj8KQgY.js → ManualTransferScreen-nU5zgK2s.js} +1 -1
  49. package/dist/cjs/{MfaAuthEnrollmentFlowScreen-cmFsgDp4.js → MfaAuthEnrollmentFlowScreen-DOCQ1Pb0.js} +1 -1
  50. package/dist/cjs/{MfaAuthVerifyFlowScreen-DEC3hYOD.js → MfaAuthVerifyFlowScreen-BKn_BpFW.js} +1 -1
  51. package/dist/cjs/{MfaEnrollmentFlowScreen-3lOG0uKv.js → MfaEnrollmentFlowScreen-DP0yjSxE.js} +1 -1
  52. package/dist/cjs/{MfaVerifyFlowScreen-aRH0rn8s.js → MfaVerifyFlowScreen-I5yHfOpE.js} +1 -1
  53. package/dist/cjs/{ModalHeader-DB7Tbjwz.js → ModalHeader-B6JgNz0C.js} +1 -1
  54. package/dist/cjs/{MoonpayStatusScreen-DANoQOd5.js → MoonpayStatusScreen-8-ogCtvb.js} +1 -1
  55. package/dist/cjs/{OAuthStatusScreen-DsGkPiMe.js → OAuthStatusScreen-DN9A-_2E.js} +1 -1
  56. package/dist/cjs/{PasskeySelectSignupOrLogin-D9Wfb44J.js → PasskeySelectSignupOrLogin-BxOQpO_r.js} +1 -1
  57. package/dist/cjs/{PasskeyStatusScreen-DAxg2zUJ.js → PasskeyStatusScreen-D-eTGH5_.js} +1 -1
  58. package/dist/cjs/{PasswordRecoveryScreen-CJfW4kpk.js → PasswordRecoveryScreen-Bq6l9LCs.js} +1 -1
  59. package/dist/cjs/{QrCode-DsQD8cG6.js → QrCode-BG3PA0JO.js} +1 -1
  60. package/dist/cjs/{RecoveryOAuthStatusScreen-_R1gExdU.js → RecoveryOAuthStatusScreen-Jha_m8qM.js} +1 -1
  61. package/dist/cjs/{RecoveryPasswordCreateScreen-Cb-gcVc8.js → RecoveryPasswordCreateScreen-DxV5XHvW.js} +1 -1
  62. package/dist/cjs/{RecoverySelectionScreen-CZOXXRGl.js → RecoverySelectionScreen-D_3aMm2t.js} +1 -1
  63. package/dist/cjs/{Screen-D9Tvi297.js → Screen-Dx7UDdIv.js} +1 -1
  64. package/dist/cjs/{ScreenLayout-BeH-Q6N2.js → ScreenLayout-CHOoAPoW.js} +1 -1
  65. package/dist/cjs/{SetAutomaticRecoveryScreen-BSDQb_dJ.js → SetAutomaticRecoveryScreen-CjgdJQIZ.js} +1 -1
  66. package/dist/cjs/{SetWalletPasswordForm-C3YB2v_1.js → SetWalletPasswordForm-Cd5XNvnW.js} +1 -1
  67. package/dist/cjs/{SignRequestScreen-DW3SnJi5.js → SignRequestScreen-wMd9qbqQ.js} +1 -1
  68. package/dist/cjs/{StandardSignAndSendTransactionScreen-Cima1YEn.js → StandardSignAndSendTransactionScreen-DpSJnnMg.js} +1 -1
  69. package/dist/cjs/{TelegramAuthScreen-pfwAx0uQ.js → TelegramAuthScreen-DUHStGrc.js} +1 -1
  70. package/dist/cjs/{TransactionDetails-KB5Wyu1l.js → TransactionDetails-B5jZi5GT.js} +1 -1
  71. package/dist/cjs/{TransactionErrorView-SaY08uTA.js → TransactionErrorView-DQzm62WW.js} +1 -1
  72. package/dist/cjs/{TransferFromWalletScreen-DVzjB3Gc.js → TransferFromWalletScreen-CHO1X-wB.js} +1 -1
  73. package/dist/cjs/{TransferOrBridgeLoadingScreen-B3zo8l43.js → TransferOrBridgeLoadingScreen-DzIpCUyz.js} +1 -1
  74. package/dist/cjs/{UpdateEmailScreen-CwWKZeJR.js → UpdateEmailScreen-Bz_Io_Kl.js} +1 -1
  75. package/dist/cjs/{UpdatePhoneScreen-B84E2DOe.js → UpdatePhoneScreen-CrXNng5l.js} +1 -1
  76. package/dist/cjs/{UserLimitReachedScreen-CQMqK5QW.js → UserLimitReachedScreen-DFDwkpya.js} +1 -1
  77. package/dist/cjs/{WalletInfoCard-DKVdH9iF.js → WalletInfoCard-6sOdeFZH.js} +1 -1
  78. package/dist/cjs/{WalletInterstitialScreen-0cBKaDQ1.js → WalletInterstitialScreen-5MeXSMng.js} +1 -1
  79. package/dist/cjs/{WalletLink-GY0_Tmtg.js → WalletLink-Bp0DvScB.js} +1 -1
  80. package/dist/cjs/{WalletOverflowButton-iCeXR9aA.js → WalletOverflowButton-B6LMjjAb.js} +1 -1
  81. package/dist/cjs/abstract-smart-wallets.js +1 -1
  82. package/dist/cjs/{context-DFq1obBO.js → context-DaKbPn6_.js} +1 -1
  83. package/dist/cjs/{ethers-DZGJ4Y5i.js → ethers-DAdWQnD2.js} +1 -1
  84. package/dist/cjs/extended-chains.js +1 -1
  85. package/dist/cjs/{get-is-unified-wallet-D4ouXJpi.js → get-is-unified-wallet-ByeBDUpK.js} +1 -1
  86. package/dist/cjs/{index-BQai4Vqd.js → index-BNUOhplc.js} +1 -1
  87. package/dist/cjs/{index-NJrQkxJ7.js → index-Cff_Z5bL.js} +4 -4
  88. package/dist/cjs/{index-CKB4VKFb.js → index-Dluh_t49.js} +1 -1
  89. package/dist/cjs/index.js +1 -1
  90. package/dist/cjs/internal.js +1 -1
  91. package/dist/cjs/{prepareFundingModalData-Cnd6rhhJ.js → prepareFundingModalData-fmqCpBnO.js} +1 -1
  92. package/dist/cjs/{shared-CCAyvw5i.js → shared-B42V9AMm.js} +1 -1
  93. package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-DZvEYqlO.js → shouldProceedtoEmbeddedWalletCreationFlow-4V5MP5Af.js} +1 -1
  94. package/dist/cjs/{smart-wallets-CV78p-ta.js → smart-wallets-Dd_mK26S.js} +1 -1
  95. package/dist/cjs/smart-wallets.js +1 -1
  96. package/dist/cjs/solana.js +1 -1
  97. package/dist/cjs/{to-ui-error-ER-8XlJF.js → to-ui-error-D0aXeI-Q.js} +1 -1
  98. package/dist/cjs/ui.js +1 -1
  99. package/dist/cjs/{use-create-wallet-without-fallback-q0_yd_V9.js → use-create-wallet-without-fallback-CG8ZolJb.js} +1 -1
  100. package/dist/cjs/{use-export-wallet-DKaavHqM.js → use-export-wallet-BDeigOZI.js} +1 -1
  101. package/dist/cjs/{useActiveWallet-BOX8xCn9.js → useActiveWallet-DM59-fQI.js} +1 -1
  102. package/dist/cjs/{useGetTokenPrice-BHq-guWz.js → useGetTokenPrice-DX51yEiv.js} +1 -1
  103. package/dist/cjs/{useI18n-CY6Et_lH.js → useI18n-XplMSUpJ.js} +1 -1
  104. package/dist/cjs/{usePrivy-CcfSRv1R.js → usePrivy-Cd78mGql.js} +1 -1
  105. package/dist/cjs/{useSolanaRpcClient-TQdbjNyx.js → useSolanaRpcClient-CcNbI3HP.js} +1 -1
  106. package/dist/cjs/{useWallets-BLFNjTwC.js → useWallets-B4uWX5Dm.js} +1 -1
  107. package/dist/cjs/{useWallets-oPpMUdRR.js → useWallets-BBn476yx.js} +1 -1
  108. package/dist/dts/index.d.mts +0 -1
  109. package/dist/dts/index.d.ts +0 -1
  110. package/dist/esm/{AccountNotFoundScreen-Bk2ZDlxR.mjs → AccountNotFoundScreen-D8-bxvxq.mjs} +1 -1
  111. package/dist/esm/{Address-BsvZLUXE.mjs → Address-C4HUUkkd.mjs} +1 -1
  112. package/dist/esm/{AffirmativeConsentScreen-CMcGT-7c.mjs → AffirmativeConsentScreen-DWdIJcdf.mjs} +1 -1
  113. package/dist/esm/{AllowlistRejectionScreen-CgdkdFzy.mjs → AllowlistRejectionScreen-DtnCZtGJ.mjs} +1 -1
  114. package/dist/esm/{AuthenticateWithWalletScreen-fhyjSxI8.mjs → AuthenticateWithWalletScreen-BZbG1QNH.mjs} +1 -1
  115. package/dist/esm/{AwaitingEvmToSolBridgingScreen-DbNP1yPY.mjs → AwaitingEvmToSolBridgingScreen-Buqtr-1v.mjs} +1 -1
  116. package/dist/esm/{AwaitingExternalEthereumTransferScreen-COnzLcDW.mjs → AwaitingExternalEthereumTransferScreen-DgS3k9KL.mjs} +1 -1
  117. package/dist/esm/{AwaitingPasswordlessCodeScreen-D9BoqETu.mjs → AwaitingPasswordlessCodeScreen-D3FeWRi7.mjs} +1 -1
  118. package/dist/esm/{AwaitingSolToEvmBridgingScreen-JY-d6qlj.mjs → AwaitingSolToEvmBridgingScreen-Ca8b_Cny.mjs} +1 -1
  119. package/dist/esm/{BridgeNetworkSelectionView-Dn5uqa3q.mjs → BridgeNetworkSelectionView-H_FX-0QY.mjs} +1 -1
  120. package/dist/esm/{Button-B8mqatRx.mjs → Button-4Bq0SnG7.mjs} +1 -1
  121. package/dist/esm/{CaptchaScreen-D3uGo3qJ.mjs → CaptchaScreen-CG83_QV2.mjs} +1 -1
  122. package/dist/esm/{CoinbaseOnrampStatusScreen-Ce2Z_vJB.mjs → CoinbaseOnrampStatusScreen-DQh1WV80.mjs} +1 -1
  123. package/dist/esm/{ConnectEmailForm--PZXgvw4.mjs → ConnectEmailForm-B1MnFVdm.mjs} +1 -1
  124. package/dist/esm/{ConnectLedgerScreen-CRDZ_shP.mjs → ConnectLedgerScreen-C6GUzfCD.mjs} +1 -1
  125. package/dist/esm/{ConnectOnlyLandingScreen-NSgaj_D4.mjs → ConnectOnlyLandingScreen-Br-WWtqQ.mjs} +1 -1
  126. package/dist/esm/{ConnectOnlyStatusScreen-DAGVWgFv.mjs → ConnectOnlyStatusScreen-xR5eSEZp.mjs} +1 -1
  127. package/dist/esm/{ConnectOrCreateScreen-CuVcGxrh.mjs → ConnectOrCreateScreen-Dg2_6BHq.mjs} +1 -1
  128. package/dist/esm/{ConnectPhoneForm-DoYmHBv3.mjs → ConnectPhoneForm-BPiamI5P.mjs} +1 -1
  129. package/dist/esm/{ConnectWalletView-eQbJO3Pg.mjs → ConnectWalletView-Dp8IEFY-.mjs} +1 -1
  130. package/dist/esm/{ConnectionStatusScreen-DVtobAVi.mjs → ConnectionStatusScreen-CYiLSnLN.mjs} +1 -1
  131. package/dist/esm/CrossAppAuthScreen-CmJaaD4x.mjs +1 -0
  132. package/dist/esm/{CustomLandingScreenView-DNbO8W7v.mjs → CustomLandingScreenView-USKBwUKl.mjs} +1 -1
  133. package/dist/esm/{DelegatedActionsConsentScreen-Cm3QtgBC.mjs → DelegatedActionsConsentScreen-kGhhWo9i.mjs} +1 -1
  134. package/dist/esm/{DelegatedActionsRevokeScreen-C2WBGR2c.mjs → DelegatedActionsRevokeScreen-F_Utkmcx.mjs} +1 -1
  135. package/dist/esm/{EmbeddedWalletConnectingScreen-CpKPkmKa.mjs → EmbeddedWalletConnectingScreen-DWig0DQc.mjs} +1 -1
  136. package/dist/esm/{EmbeddedWalletCreatedScreen-CMyRcNaG.mjs → EmbeddedWalletCreatedScreen-dBAcS_3f.mjs} +1 -1
  137. package/dist/esm/{EmbeddedWalletKeyExportScreen-nkSO3O1P.mjs → EmbeddedWalletKeyExportScreen-JmDvEOxp.mjs} +1 -1
  138. package/dist/esm/{EmbeddedWalletOnAccountCreateScreen-rwdmo9iN.mjs → EmbeddedWalletOnAccountCreateScreen-0hjsIRB4.mjs} +1 -1
  139. package/dist/esm/{EmbeddedWalletPasswordUpdateScreen-Tcp68U7U.mjs → EmbeddedWalletPasswordUpdateScreen-BdZ4iii2.mjs} +1 -1
  140. package/dist/esm/{EmbeddedWalletPasswordUpdateSplashScreen-5PH-3FQ3.mjs → EmbeddedWalletPasswordUpdateSplashScreen-BrRn1Igv.mjs} +1 -1
  141. package/dist/esm/{EnrollTotp-ULLNt8tl.mjs → EnrollTotp-Du8PYpCS.mjs} +1 -1
  142. package/dist/esm/{ErrorScreen-BdxNEgU1.mjs → ErrorScreen-BbpcnN47.mjs} +1 -1
  143. package/dist/esm/{FarcasterConnectStatusScreen-CruCPzPD.mjs → FarcasterConnectStatusScreen-bFnV9Q-F.mjs} +1 -1
  144. package/dist/esm/{FarcasterSignerStatusScreen-DBAyc7bd.mjs → FarcasterSignerStatusScreen-C_cOnZqS.mjs} +1 -1
  145. package/dist/esm/{FundSolWalletWithExternalSolanaWallet-Fxpj9pEN.mjs → FundSolWalletWithExternalSolanaWallet-NroaHumk.mjs} +1 -1
  146. package/dist/esm/{FundWalletMethodHeader-I8a6Y30s.mjs → FundWalletMethodHeader-Ct0-BSHQ.mjs} +1 -1
  147. package/dist/esm/{FundingEditAmountScreen-yKYKiyG9.mjs → FundingEditAmountScreen-CIfLNCY4.mjs} +1 -1
  148. package/dist/esm/{FundingMethodSelectionScreen-Dr-QG6BQ.mjs → FundingMethodSelectionScreen-6r-GtWAw.mjs} +1 -1
  149. package/dist/esm/{InAppBrowserLoginNotPossible-BYO_nlWy.mjs → InAppBrowserLoginNotPossible-DGquKyY5.mjs} +1 -1
  150. package/dist/esm/{InstallWalletScreen-Cma1GXX4.mjs → InstallWalletScreen-C3fhspKv.mjs} +1 -1
  151. package/dist/esm/{LandingScreen-DCR5C-gA.mjs → LandingScreen-B5fQK5aJ.mjs} +1 -1
  152. package/dist/esm/{LinkConflictScreen-C8kM_4ZL.mjs → LinkConflictScreen-DhOlAVqb.mjs} +1 -1
  153. package/dist/esm/{LinkEmailScreen-DsrprT7p.mjs → LinkEmailScreen-kfYqx5q5.mjs} +1 -1
  154. package/dist/esm/{LinkPasskeyScreen-yKY5ebtx.mjs → LinkPasskeyScreen-ByP_xkNH.mjs} +1 -1
  155. package/dist/esm/{LinkPhoneScreen-BklMbJs1.mjs → LinkPhoneScreen-CpfYyId1.mjs} +1 -1
  156. package/dist/esm/{LoginFailedScreen-CVGjcD9g.mjs → LoginFailedScreen-DXflJucn.mjs} +1 -1
  157. package/dist/esm/{ManualTransferScreen-C6MTkQcg.mjs → ManualTransferScreen-BbBEMQqz.mjs} +1 -1
  158. package/dist/esm/{MfaAuthEnrollmentFlowScreen-BrEYUoOi.mjs → MfaAuthEnrollmentFlowScreen-BEhy0bjM.mjs} +1 -1
  159. package/dist/esm/{MfaAuthVerifyFlowScreen-D_LbAt1N.mjs → MfaAuthVerifyFlowScreen-DyQj9WEt.mjs} +1 -1
  160. package/dist/esm/{MfaEnrollmentFlowScreen-BseHvqlH.mjs → MfaEnrollmentFlowScreen-DFr1AMSi.mjs} +1 -1
  161. package/dist/esm/{MfaVerifyFlowScreen-DB8BFfTJ.mjs → MfaVerifyFlowScreen-CWTrvbbI.mjs} +1 -1
  162. package/dist/esm/{ModalHeader-BLGC-7ev.mjs → ModalHeader-C6mIKC4v.mjs} +1 -1
  163. package/dist/esm/{MoonpayStatusScreen-D-Qnyxst.mjs → MoonpayStatusScreen-CzQ3_NpM.mjs} +1 -1
  164. package/dist/esm/{OAuthStatusScreen-pEjYhAdx.mjs → OAuthStatusScreen-CtFgPvUp.mjs} +1 -1
  165. package/dist/esm/{PasskeySelectSignupOrLogin-CmmjfwZM.mjs → PasskeySelectSignupOrLogin-p6UZH0Z0.mjs} +1 -1
  166. package/dist/esm/{PasskeyStatusScreen-AiT-3Rq0.mjs → PasskeyStatusScreen-DHE4YWW_.mjs} +1 -1
  167. package/dist/esm/{PasswordRecoveryScreen-BW7BBSLI.mjs → PasswordRecoveryScreen-CDOSxiaG.mjs} +1 -1
  168. package/dist/esm/{QrCode-DR5LogOp.mjs → QrCode-DHDf_g6F.mjs} +1 -1
  169. package/dist/esm/{RecoveryOAuthStatusScreen-BGxGq84t.mjs → RecoveryOAuthStatusScreen-CizAbiYe.mjs} +1 -1
  170. package/dist/esm/{RecoveryPasswordCreateScreen-Brv0MUPN.mjs → RecoveryPasswordCreateScreen-DJLO8oWR.mjs} +1 -1
  171. package/dist/esm/{RecoverySelectionScreen-CluXGpRG.mjs → RecoverySelectionScreen-Dzwn1_nk.mjs} +1 -1
  172. package/dist/esm/{Screen-BTyXgDrd.mjs → Screen-bEIBY18A.mjs} +1 -1
  173. package/dist/esm/{ScreenLayout-CddsD3Of.mjs → ScreenLayout-BxqiFpIo.mjs} +1 -1
  174. package/dist/esm/{SetAutomaticRecoveryScreen-nXcm7pIi.mjs → SetAutomaticRecoveryScreen-BcSSOXFV.mjs} +1 -1
  175. package/dist/esm/{SetWalletPasswordForm-DvgKP4Ez.mjs → SetWalletPasswordForm-CjWJB429.mjs} +1 -1
  176. package/dist/esm/{SignRequestScreen-Cp5zIIZ3.mjs → SignRequestScreen-Bqd0wHqK.mjs} +1 -1
  177. package/dist/esm/{StandardSignAndSendTransactionScreen-bbPFP1pO.mjs → StandardSignAndSendTransactionScreen-D-tBXzuh.mjs} +1 -1
  178. package/dist/esm/{TelegramAuthScreen-DorSPB8G.mjs → TelegramAuthScreen-CUPKf38d.mjs} +1 -1
  179. package/dist/esm/{TransactionDetails-Bb1NEpUH.mjs → TransactionDetails-b_wizlde.mjs} +1 -1
  180. package/dist/esm/{TransactionErrorView-CfyBAYzV.mjs → TransactionErrorView-DnMMuxIA.mjs} +1 -1
  181. package/dist/esm/{TransferFromWalletScreen-BeSvua3b.mjs → TransferFromWalletScreen-BFMaPOBF.mjs} +1 -1
  182. package/dist/esm/{TransferOrBridgeLoadingScreen-D5Y_FQAB.mjs → TransferOrBridgeLoadingScreen-9_7-Mb5-.mjs} +1 -1
  183. package/dist/esm/{UpdateEmailScreen-BolXWblK.mjs → UpdateEmailScreen-BahNM-kj.mjs} +1 -1
  184. package/dist/esm/{UpdatePhoneScreen-G2aRPp1w.mjs → UpdatePhoneScreen-DeS3W5eF.mjs} +1 -1
  185. package/dist/esm/{UserLimitReachedScreen-BUXcfdpd.mjs → UserLimitReachedScreen-R047J3fL.mjs} +1 -1
  186. package/dist/esm/{WalletInfoCard-YE5P6CSV.mjs → WalletInfoCard-6gQNu7Zz.mjs} +1 -1
  187. package/dist/esm/{WalletInterstitialScreen-6lMKxpAk.mjs → WalletInterstitialScreen-OdyTrsT9.mjs} +1 -1
  188. package/dist/esm/{WalletLink-C9CSqqVy.mjs → WalletLink-CwHMA2xr.mjs} +1 -1
  189. package/dist/esm/{WalletOverflowButton-DV9Pe-aq.mjs → WalletOverflowButton-CpHsxy0L.mjs} +1 -1
  190. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  191. package/dist/esm/context-CA-h9Vvv.mjs +1 -0
  192. package/dist/esm/{ethers-C3Y94dat.mjs → ethers-CuplD6TN.mjs} +1 -1
  193. package/dist/esm/extended-chains.mjs +1 -1
  194. package/dist/esm/{get-is-unified-wallet-DvKS5IUO.mjs → get-is-unified-wallet-BS6IT5u_.mjs} +1 -1
  195. package/dist/esm/{index-C9_VQk69.mjs → index-Cg9hpx5Z.mjs} +1 -1
  196. package/dist/esm/{index-CCyaupaz.mjs → index-Cq5UTy5I.mjs} +4 -4
  197. package/dist/esm/{index-DeGXWdV3.mjs → index-Yyr_6Jcd.mjs} +1 -1
  198. package/dist/esm/index.mjs +1 -1
  199. package/dist/esm/internal.mjs +1 -1
  200. package/dist/esm/{prepareFundingModalData-CIgFwA7s.mjs → prepareFundingModalData-Dh2gc0UP.mjs} +1 -1
  201. package/dist/esm/{shared-rucIJmk0.mjs → shared-CnrDwY6g.mjs} +1 -1
  202. package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-Djgu4xiS.mjs → shouldProceedtoEmbeddedWalletCreationFlow-7c-Jh9LP.mjs} +1 -1
  203. package/dist/esm/{smart-wallets-B-nGTJog.mjs → smart-wallets-DsQZ_UYt.mjs} +1 -1
  204. package/dist/esm/smart-wallets.mjs +1 -1
  205. package/dist/esm/solana.mjs +1 -1
  206. package/dist/esm/{to-ui-error-3mK4-1VA.mjs → to-ui-error-CepgBtTe.mjs} +1 -1
  207. package/dist/esm/ui.mjs +1 -1
  208. package/dist/esm/{use-create-wallet-without-fallback-cSYr4rn8.mjs → use-create-wallet-without-fallback-DMlUsZUX.mjs} +1 -1
  209. package/dist/esm/{use-export-wallet-ntS-M0Jk.mjs → use-export-wallet-Bm17XHzg.mjs} +1 -1
  210. package/dist/esm/{useActiveWallet-Bsy5GTCV.mjs → useActiveWallet-DbOGftJH.mjs} +1 -1
  211. package/dist/esm/{useGetTokenPrice-0Bn0Y88A.mjs → useGetTokenPrice-CnclQxlG.mjs} +1 -1
  212. package/dist/esm/{useI18n-BtdAZuQ8.mjs → useI18n-Dtdu9d5P.mjs} +1 -1
  213. package/dist/esm/{usePrivy-BaiIHGte.mjs → usePrivy-1ClOITL9.mjs} +1 -1
  214. package/dist/esm/{useSolanaRpcClient-DW9Xaoo_.mjs → useSolanaRpcClient-B3TM7f1n.mjs} +1 -1
  215. package/dist/esm/{useWallets-D0lpBS44.mjs → useWallets-8CFi1gij.mjs} +1 -1
  216. package/dist/esm/{useWallets-NhjmJtNE.mjs → useWallets-Dblj1VRU.mjs} +1 -1
  217. package/package.json +4 -4
  218. package/dist/cjs/CrossAppAuthScreen-weeiAu3O.js +0 -1
  219. package/dist/esm/CrossAppAuthScreen-B0633bnY.mjs +0 -1
  220. package/dist/esm/context-Bycd1SKV.mjs +0 -1
@@ -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-B8mqatRx.mjs";import p from"@heroicons/react/24/outline/CheckIcon";import{C as u}from"./copy-Bx2Jwc5_.mjs";import{T as g}from"./ModalHeader-BLGC-7ev.mjs";import{Q as w}from"./QrCode-DR5LogOp.mjs";import{E as f}from"./EmailInputForm-B4hjCxRU.mjs";import{u as y,q as v}from"./context-Bycd1SKV.mjs";import{u as b}from"./useI18n-BtdAZuQ8.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-Bsy5GTCV.mjs";import{u as L,P as I,b as N}from"./internal-context-e-Eni5bG.mjs";import{W as A}from"./WalletCards-DH1rqayz.mjs";import{W as B,h as E}from"./prepareFundingModalData-CIgFwA7s.mjs";import{S as j}from"./Screen-BTyXgDrd.mjs";let O=/*#__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);"]),U=/*#__PURE__*/h(p).withConfig({displayName:"GreenCheck",componentId:"sc-4b0620dc-2"})(["color:var(--privy-color-success);"]),F=/*#__PURE__*/h(u).withConfig({displayName:"StyledCopy",componentId:"sc-4b0620dc-3"})(["color:var(--privy-color-foreground-3);opactiy:0.5;"]);function M({children:t,iconOnly:i,value:l,hideCopyIcon:o,...r}){let[c,s]=a(!1);/*#__PURE__*/return e(O,{...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(U,{})," ",!i&&"Copied"]}):!o&&/*#__PURE__*/n(F,{})]})}const $={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 P{static normalize(e){return e.replace(/[-_]wallet$/,"").replace(/[-_]extension$/,"").toLowerCase()}isEth(e){return e.chains.some((e=>e.includes("eip155:")))}isSol(e){return e.chains.some((e=>e.includes("solana:")))}inAllowList(e,n){if(!this.normalizedAllowList||0===this.normalizedAllowList.length||"listing"===n&&this.includeWalletConnect)return!0;let t=P.normalize(e);return this.normalizedAllowList.some((e=>t===P.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=P.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.includes("eip155:")||e.includes("solana:")));if(e.some((e=>P.normalize(e.walletClientType)===P.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.includes("eip155:")))),e.some((e=>P.normalize(e.walletClientType)===P.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.includes("solana:")))),!t.length)return;let o=P.normalize(n.slug),r=$[n.slug],c=r?.image_url?.sm||n.image_url?.sm;t.some((e=>e.includes("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.includes("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:B,url:void 0,chains:["eip155"]}),this.includeWalletConnectQrSolana&&a&&i({id:"wallet_connect_qr_solana",label:"WalletConnect",source:"connector",connector:a,chainType:"solana",icon:B,url:void 0,chains:["solana"]});let o=Array.from(t.values());o.forEach((e=>{let n=$[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(P.normalize(e),n)})),{wallets:o.slice().sort(((e,n)=>{let t=P.normalize(e.id),i=P.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 Q=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"})]}),D=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 H=/*#__PURE__*/h.div.withConfig({displayName:"Header",componentId:"sc-9b65f2b6-0"})(["display:flex;justify-content:space-between;align-items:center;"]),R=/*#__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);"]),V=/*#__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;}"]),G=/*#__PURE__*/h.img.withConfig({displayName:"WalletIcon",componentId:"sc-9b65f2b6-3"})(["width:32px;height:32px;border-radius:0.25rem;object-fit:contain;"]),Y=/*#__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;}"]),K=/*#__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 J({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 P(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 X=e=>!e||"string"!=typeof e&&(e instanceof z||e instanceof S);const Z=({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(ie,{style:h,onClick:()=>s(r),children:[r.icon&&(r.connector&&!X(r.connector)?/*#__PURE__*/n(V,{children:"string"==typeof r.icon?/*#__PURE__*/n(G,{src:r.icon}):/*#__PURE__*/n(r.icon,{style:{width:"32px",height:"32px"}})}):"string"==typeof r.icon?/*#__PURE__*/n(G,{src:r.icon}):/*#__PURE__*/n(r.icon,{style:{width:"32px",height:"32px"}})),/*#__PURE__*/n(oe,{children:r.label}),o?/*#__PURE__*/e(t,{children:[/*#__PURE__*/n(Y,{children:d("connectWallet.lastUsed")}),/*#__PURE__*/n(le,{children:/*#__PURE__*/e(t,{children:["ethereum-only"===c&&/*#__PURE__*/n(Q,{}),"solana-only"===c&&/*#__PURE__*/n(D,{})]})})]}):/*#__PURE__*/n(le,{children:!("ethereum-only"===c||"solana-only"===c)&&/*#__PURE__*/e(t,{children:[r.chains?.some((e=>e.startsWith("eip155")))&&/*#__PURE__*/n(Q,{}),r.chains?.some((e=>e.startsWith("solana")))&&/*#__PURE__*/n(D,{})]})})]}):null};var ee=({className:h,customDescription:p,connectOnly:u,preSelectedWalletId:C,hideHeader:W,...B})=>{let O=y(),{t:q}=b(),{connectors:U}=L(),F=B.walletChainType||O.appearance.walletChainType,M=B.walletList||O.appearance?.walletList,{onBack:H,onClose:R,app:V}=B,{selected:Y,setSelected:K,qrUrl:ee,setQrUrl:ce,connecting:se,uiState:de,errorCode:he,wallets:me,walletCount:pe,handleConnect:ue,handleBack:ge,showSearchBar:we,isInitialConnectView:fe,title:ye,search:ve,setSearch:be}=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}=J({enabled:k(l??[]),walletList:l,walletChainType:c}),[W,_]=a(),[z,S]=a(),[N,A]=a(),[B,E]=a(),j=!C&&!N&&!B,O=j&&(g>6||w.length>0),q=m.find((e=>"wallet_connect_v2"===e.connectorType)),U=r((async(n,t)=>{if(n){if(B?.connector===n&&"loading"===W)return void console.log("Already connecting to this wallet, skipping duplicate attempt");if(_("loading"),"string"==typeof n)return E({connector:n,name:t?.name??"Wallet",icon:t?.icon}),void window.open(n,"_blank");E({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"),S(void 0),void i?.(new I("Unable to connect wallet"));_("success"),S(void 0),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"),S(n?.privyErrorCode),i?.(n instanceof Error?n:new I(n?.message||"Unable to connect wallet"))}}}),[h.id,e,B,W]),F=r((()=>N?(_(void 0),S(void 0),E(void 0),void A(void 0)):B?(_(void 0),S(void 0),void E(void 0)):C?(_(void 0),S(void 0),E(void 0),void x(void 0)):"error"===W||"loading"===W?(_(void 0),S(void 0),void E(void 0)):void n?.()),[N,B,C,W,n]),M=o((()=>B?.connector===q&&N&&d&&B?.name?p("connectWallet.goToWallet",{walletName:B.name}):B?.connector===q&&N&&B?.name?p("connectWallet.scanToConnect",{walletName:B.name}):N&&B?.name?p(d?"connectWallet.goToWallet":"connectWallet.scanToConnect",{walletName:B.name}):"string"==typeof B?.connector?p("connectWallet.openOrInstall",{walletName:B.name}):C&&!B?p("connectWallet.selectNetwork"):B?null:p("connectWallet.selectYourWallet")),[B,N,C,q,p]);return{selected:C,setSelected:x,qrUrl:N,setQrUrl:A,connecting:B,uiState:W,errorCode:z,search:w,setSearch:f,wallets:u,walletCount:g,wc:q,isInitialConnectView:j,showSearchBar:O,title:M,handleConnect:U,handleBack:F,onClose:t,onConnect:e,app:s}}({...B,walletList:M,walletChainType:F}),Ce=U.find((e=>"wallet_connect_v2"===e.connectorType)),xe=U.find((e=>"walletconnect_solana"===e.walletBranding.id)),We=c(null),ke=l({count:me.length,getScrollElement:()=>We.current,estimateSize:()=>56,overscan:6,gap:5}),Te=r((async e=>{let n="solana-only"!==F&&e.chains?.some((e=>e.startsWith("eip155"))),t="ethereum-only"!==F&&e.chains?.some((e=>e.startsWith("solana"))),i=n=>{let t=P.normalize(e.id);return U.find((e=>P.normalize(e.walletClientType)===t&&e.chainType===n&&!("ethereum"===e.chainType&&e instanceof z||"solana"===e.chainType&&e instanceof S)))},l=async()=>{if(!Ce||!e.listing)return!1;let n=$[e.listing.slug]?{...e.listing,...$[e.listing.slug]}:e.listing;return Ce.setWalletEntry(n,ce),await Ce.resetConnection(e.id),await ue(Ce,{name:e.label,icon:e.icon}),!0},a=async()=>!!xe&&!!e.listing&&(await xe.disconnect(),xe.wallet.setWalletEntry(e.listing,ce),await new Promise((e=>setTimeout(e,100))),await ue(xe,{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})})(n);return!!t&&(await ue(t,{name:e.label,icon:e.icon}),!0)};if(n&&t)K(e);else{if(n&&!t){let n=i("ethereum");if(n&&!X(n))return void await ue(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&&!X(n))return void await ue(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(!X(e.connector)){if(Ce&&"wallet_connect_v2"===e.connector?.connectorType)if(await Ce.resetConnection(e.id),"wallet_connect_qr"!==e.id&&e.listing){let n=$[e.listing.slug]?{...e.listing,...$[e.listing.slug]}:e.listing;Ce.setWalletEntry(n,ce)}else Ce.setWalletEntry({id:"wallet_connect_qr",name:"WalletConnect",rdns:"",slug:"wallet-connect",homepage:"",chains:["eip155"],mobile:{native:"",universal:void 0}},ce);return xe&&"walletconnect_solana"===e.connector?.walletBranding.id&&(await xe.disconnect(),"wallet_connect_qr_solana"!==e.id&&e.listing?xe.wallet.setWalletEntry(e.listing,ce):xe.wallet.setWalletEntry({id:"wallet_connect_solana_qr",name:"WalletConnect",rdns:"",slug:"wallet-connect-solana",homepage:"",chains:["solana"],mobile:{native:"",universal:void 0}},ce),await new Promise((e=>setTimeout(e,100)))),void await ue(e.connector,{name:e.label,icon:e.icon})}e.url&&await ue(e.url,{name:e.label,icon:e.icon})}}),[Ce,xe,ue,K,ce,F,u,U]);return s((()=>{if(!C)return;let e=me.find((({id:e})=>e===C));e&&Te(e).catch(console.error)}),[C]),/*#__PURE__*/e(j,{className:h,children:[/*#__PURE__*/n(j.Header,{icon:W&&fe?void 0:se&&!ee||ee&&d&&se?.icon?se.icon:se?void 0:A,iconVariant:se&&!ee||ee&&d?"loading":void 0,iconLoadingStatus:se&&!ee||ee&&d?{success:"success"===de,fail:"error"===de}:void 0,title:W&&fe?void 0:se&&!ee?q("connectWallet.waitingForWallet",{walletName:se.name}):ee&&d?q("connectWallet.waitingForWallet",{walletName:se?.name??"connection"}):ye,subtitle:W&&fe?void 0:se&&!ee&&"string"==typeof se.connector?q("connectWallet.installAndConnect",{walletName:se.name}):se&&!ee&&"string"!=typeof se.connector?"error"===de?he===N.NO_SOLANA_ACCOUNTS?`The connected wallet has no Solana accounts. Please add a Solana account in ${se.name} and try again.`:q("connectWallet.tryConnectingAgain"):q("connectionStatus.connectOneWallet"):fe?p??(V?q("connectWallet.connectToAccount",{appName:V.name}):null):null,showBack:!!H||!fe,showClose:!0,onBack:H||ge,onClose:R}),/*#__PURE__*/e(j.Body,{ref:We,$colorScheme:O.appearance.palette.colorScheme,style:{marginBottom:ee?"0.5rem":void 0},children:[we&&/*#__PURE__*/n(ne,{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(pe)}),onChange:e=>be(e.target.value),value:ve})]})}),ee&&d&&"loading"===de&&/*#__PURE__*/e("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem"},children:[/*#__PURE__*/n(m,{variant:"primary",onClick:()=>window.open(ee.universal??ee.native,"_blank"),style:{width:"100%"},children:q("connectWallet.openInApp")}),/*#__PURE__*/n(re,{value:ee.universal??ee.native,iconOnly:!0,children:"Copy link"})]}),ee&&!d&&"loading"===de&&/*#__PURE__*/n("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem"},children:/*#__PURE__*/n(re,{value:ee.universal??ee.native,iconOnly:!0,children:q("connectWallet.copyLink")})}),ee&&!d&&/*#__PURE__*/n(w,{size:280,url:ee.universal??ee.native,squareLogoElement:se?.icon?"string"==typeof se.icon?e=>/*#__PURE__*/n("svg",{...e,children:/*#__PURE__*/n("image",{href:se.icon,height:e.height,width:e.width})}):se.icon:E}),/*#__PURE__*/e(te,{children:[se&&!ee&&"string"==typeof se.connector&&/*#__PURE__*/e(ie,{onClick:()=>window.open(se.connector,"_blank"),children:[se.icon&&("string"==typeof se.icon?/*#__PURE__*/n(G,{src:se.icon}):/*#__PURE__*/n(se.icon,{})),/*#__PURE__*/n(oe,{children:se.name})]}),Y?.chains.some((e=>e.startsWith("eip155")))&&!se&&/*#__PURE__*/e(ie,{onClick:()=>Te({...Y,chains:Y.chains.filter((e=>e.startsWith("eip155")))}),children:[Y.icon&&("string"==typeof Y.icon?/*#__PURE__*/n(G,{src:Y.icon}):/*#__PURE__*/n(Y.icon,{})),/*#__PURE__*/n(oe,{children:Y.label}),/*#__PURE__*/n(le,{children:/*#__PURE__*/n(Q,{})})]}),Y?.chains.some((e=>e.startsWith("solana")))&&!se&&/*#__PURE__*/e(ie,{onClick:()=>Te({...Y,chains:Y.chains.filter((e=>e.startsWith("solana")))}),children:[Y.icon&&("string"==typeof Y.icon?/*#__PURE__*/n(G,{src:Y.icon}):/*#__PURE__*/n(Y.icon,{})),/*#__PURE__*/n(oe,{children:Y.label}),/*#__PURE__*/n(le,{children:/*#__PURE__*/n(D,{})})]}),fe&&/*#__PURE__*/e(t,{children:[!(pe>0)&&/*#__PURE__*/n(ae,{children:q("connectWallet.noWalletsFound")}),pe>0&&!ee&&/*#__PURE__*/n("div",{style:{maxHeight:56*Math.min(me.length,5)+5,width:"100%"},children:/*#__PURE__*/n("div",{style:{height:`${ke.getTotalSize()}px`,width:"100%",position:"relative"},children:ke.getVirtualItems().map((e=>/*#__PURE__*/n(Z,{index:e.index,style:{position:"absolute",top:0,left:0,height:`${e.size}px`,transform:`translateY(${e.start}px)`},data:{wallets:me,walletChainType:F,handleWalletClick:Te}},e.key)))})})]})]})]}),/*#__PURE__*/e(j.Footer,{children:[se&&!ee&&"string"!=typeof se.connector&&"error"===de&&/*#__PURE__*/n(j.Actions,{children:/*#__PURE__*/n(m,{style:{width:"100%",alignItems:"center"},variant:"error",onClick:()=>ue(se.connector,{name:se.name,icon:se.icon}),children:q("connectWallet.retry")})}),!!(V&&V.legal.privacyPolicyUrl&&V.legal.termsAndConditionsUrl)&&/*#__PURE__*/n(g,{app:V,alwaysShowImplicitConsent:!0}),/*#__PURE__*/n(j.Watermark,{})]})]})};let ne=/*#__PURE__*/h.div.withConfig({displayName:"StickySearchContainer",componentId:"sc-34a6bff4-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);"]),te=/*#__PURE__*/h.div.withConfig({displayName:"WalletListContainer",componentId:"sc-34a6bff4-1"})(["display:flex;flex-direction:column;gap:","px;"],5),ie=/*#__PURE__*/h.button.withConfig({displayName:"Button",componentId:"sc-34a6bff4-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);}"]),le=/*#__PURE__*/h.span.withConfig({displayName:"ButtonBadge",componentId:"sc-34a6bff4-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;}"]),ae=/*#__PURE__*/h.div.withConfig({displayName:"EmptyContainer",componentId:"sc-34a6bff4-4"})(["height:60px;display:flex;align-items:center;justify-content:center;text-align:center;"]),oe=/*#__PURE__*/h.span.withConfig({displayName:"WalletName",componentId:"sc-34a6bff4-5"})(["text-overflow:ellipsis;white-space:nowrap;color:var(--privy-color-foreground);font-weight:400;flex:1;"]),re=/*#__PURE__*/h(M).withConfig({displayName:"StyledCopyableText",componentId:"sc-34a6bff4-6"})(["&&{margin:0.5rem auto 0 auto;}"]);export{M as C,H,K as S,G as W,Y as a,R as b,P as c,Z as d,ee as i,J 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-4Bq0SnG7.mjs";import p from"@heroicons/react/24/outline/CheckIcon";import{C as u}from"./copy-Bx2Jwc5_.mjs";import{T as g}from"./ModalHeader-C6mIKC4v.mjs";import{Q as w}from"./QrCode-DHDf_g6F.mjs";import{E as f}from"./EmailInputForm-B4hjCxRU.mjs";import{u as y,q as v}from"./context-CA-h9Vvv.mjs";import{u as b}from"./useI18n-Dtdu9d5P.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-DbOGftJH.mjs";import{u as L,P as I,b as N}from"./internal-context-e-Eni5bG.mjs";import{W as A}from"./WalletCards-DH1rqayz.mjs";import{W as B,h as E}from"./prepareFundingModalData-Dh2gc0UP.mjs";import{S as j}from"./Screen-bEIBY18A.mjs";let O=/*#__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);"]),U=/*#__PURE__*/h(p).withConfig({displayName:"GreenCheck",componentId:"sc-4b0620dc-2"})(["color:var(--privy-color-success);"]),F=/*#__PURE__*/h(u).withConfig({displayName:"StyledCopy",componentId:"sc-4b0620dc-3"})(["color:var(--privy-color-foreground-3);opactiy:0.5;"]);function M({children:t,iconOnly:i,value:l,hideCopyIcon:o,...r}){let[c,s]=a(!1);/*#__PURE__*/return e(O,{...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(U,{})," ",!i&&"Copied"]}):!o&&/*#__PURE__*/n(F,{})]})}const $={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 P{static normalize(e){return e.replace(/[-_]wallet$/,"").replace(/[-_]extension$/,"").toLowerCase()}isEth(e){return e.chains.some((e=>e.includes("eip155:")))}isSol(e){return e.chains.some((e=>e.includes("solana:")))}inAllowList(e,n){if(!this.normalizedAllowList||0===this.normalizedAllowList.length||"listing"===n&&this.includeWalletConnect)return!0;let t=P.normalize(e);return this.normalizedAllowList.some((e=>t===P.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=P.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.includes("eip155:")||e.includes("solana:")));if(e.some((e=>P.normalize(e.walletClientType)===P.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.includes("eip155:")))),e.some((e=>P.normalize(e.walletClientType)===P.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.includes("solana:")))),!t.length)return;let o=P.normalize(n.slug),r=$[n.slug],c=r?.image_url?.sm||n.image_url?.sm;t.some((e=>e.includes("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.includes("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:B,url:void 0,chains:["eip155"]}),this.includeWalletConnectQrSolana&&a&&i({id:"wallet_connect_qr_solana",label:"WalletConnect",source:"connector",connector:a,chainType:"solana",icon:B,url:void 0,chains:["solana"]});let o=Array.from(t.values());o.forEach((e=>{let n=$[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(P.normalize(e),n)})),{wallets:o.slice().sort(((e,n)=>{let t=P.normalize(e.id),i=P.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 Q=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"})]}),D=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 H=/*#__PURE__*/h.div.withConfig({displayName:"Header",componentId:"sc-9b65f2b6-0"})(["display:flex;justify-content:space-between;align-items:center;"]),R=/*#__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);"]),V=/*#__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;}"]),G=/*#__PURE__*/h.img.withConfig({displayName:"WalletIcon",componentId:"sc-9b65f2b6-3"})(["width:32px;height:32px;border-radius:0.25rem;object-fit:contain;"]),Y=/*#__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;}"]),K=/*#__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 J({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 P(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 X=e=>!e||"string"!=typeof e&&(e instanceof z||e instanceof S);const Z=({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(ie,{style:h,onClick:()=>s(r),children:[r.icon&&(r.connector&&!X(r.connector)?/*#__PURE__*/n(V,{children:"string"==typeof r.icon?/*#__PURE__*/n(G,{src:r.icon}):/*#__PURE__*/n(r.icon,{style:{width:"32px",height:"32px"}})}):"string"==typeof r.icon?/*#__PURE__*/n(G,{src:r.icon}):/*#__PURE__*/n(r.icon,{style:{width:"32px",height:"32px"}})),/*#__PURE__*/n(oe,{children:r.label}),o?/*#__PURE__*/e(t,{children:[/*#__PURE__*/n(Y,{children:d("connectWallet.lastUsed")}),/*#__PURE__*/n(le,{children:/*#__PURE__*/e(t,{children:["ethereum-only"===c&&/*#__PURE__*/n(Q,{}),"solana-only"===c&&/*#__PURE__*/n(D,{})]})})]}):/*#__PURE__*/n(le,{children:!("ethereum-only"===c||"solana-only"===c)&&/*#__PURE__*/e(t,{children:[r.chains?.some((e=>e.startsWith("eip155")))&&/*#__PURE__*/n(Q,{}),r.chains?.some((e=>e.startsWith("solana")))&&/*#__PURE__*/n(D,{})]})})]}):null};var ee=({className:h,customDescription:p,connectOnly:u,preSelectedWalletId:C,hideHeader:W,...B})=>{let O=y(),{t:q}=b(),{connectors:U}=L(),F=B.walletChainType||O.appearance.walletChainType,M=B.walletList||O.appearance?.walletList,{onBack:H,onClose:R,app:V}=B,{selected:Y,setSelected:K,qrUrl:ee,setQrUrl:ce,connecting:se,uiState:de,errorCode:he,wallets:me,walletCount:pe,handleConnect:ue,handleBack:ge,showSearchBar:we,isInitialConnectView:fe,title:ye,search:ve,setSearch:be}=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}=J({enabled:k(l??[]),walletList:l,walletChainType:c}),[W,_]=a(),[z,S]=a(),[N,A]=a(),[B,E]=a(),j=!C&&!N&&!B,O=j&&(g>6||w.length>0),q=m.find((e=>"wallet_connect_v2"===e.connectorType)),U=r((async(n,t)=>{if(n){if(B?.connector===n&&"loading"===W)return void console.log("Already connecting to this wallet, skipping duplicate attempt");if(_("loading"),"string"==typeof n)return E({connector:n,name:t?.name??"Wallet",icon:t?.icon}),void window.open(n,"_blank");E({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"),S(void 0),void i?.(new I("Unable to connect wallet"));_("success"),S(void 0),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"),S(n?.privyErrorCode),i?.(n instanceof Error?n:new I(n?.message||"Unable to connect wallet"))}}}),[h.id,e,B,W]),F=r((()=>N?(_(void 0),S(void 0),E(void 0),void A(void 0)):B?(_(void 0),S(void 0),void E(void 0)):C?(_(void 0),S(void 0),E(void 0),void x(void 0)):"error"===W||"loading"===W?(_(void 0),S(void 0),void E(void 0)):void n?.()),[N,B,C,W,n]),M=o((()=>B?.connector===q&&N&&d&&B?.name?p("connectWallet.goToWallet",{walletName:B.name}):B?.connector===q&&N&&B?.name?p("connectWallet.scanToConnect",{walletName:B.name}):N&&B?.name?p(d?"connectWallet.goToWallet":"connectWallet.scanToConnect",{walletName:B.name}):"string"==typeof B?.connector?p("connectWallet.openOrInstall",{walletName:B.name}):C&&!B?p("connectWallet.selectNetwork"):B?null:p("connectWallet.selectYourWallet")),[B,N,C,q,p]);return{selected:C,setSelected:x,qrUrl:N,setQrUrl:A,connecting:B,uiState:W,errorCode:z,search:w,setSearch:f,wallets:u,walletCount:g,wc:q,isInitialConnectView:j,showSearchBar:O,title:M,handleConnect:U,handleBack:F,onClose:t,onConnect:e,app:s}}({...B,walletList:M,walletChainType:F}),Ce=U.find((e=>"wallet_connect_v2"===e.connectorType)),xe=U.find((e=>"walletconnect_solana"===e.walletBranding.id)),We=c(null),ke=l({count:me.length,getScrollElement:()=>We.current,estimateSize:()=>56,overscan:6,gap:5}),Te=r((async e=>{let n="solana-only"!==F&&e.chains?.some((e=>e.startsWith("eip155"))),t="ethereum-only"!==F&&e.chains?.some((e=>e.startsWith("solana"))),i=n=>{let t=P.normalize(e.id);return U.find((e=>P.normalize(e.walletClientType)===t&&e.chainType===n&&!("ethereum"===e.chainType&&e instanceof z||"solana"===e.chainType&&e instanceof S)))},l=async()=>{if(!Ce||!e.listing)return!1;let n=$[e.listing.slug]?{...e.listing,...$[e.listing.slug]}:e.listing;return Ce.setWalletEntry(n,ce),await Ce.resetConnection(e.id),await ue(Ce,{name:e.label,icon:e.icon}),!0},a=async()=>!!xe&&!!e.listing&&(await xe.disconnect(),xe.wallet.setWalletEntry(e.listing,ce),await new Promise((e=>setTimeout(e,100))),await ue(xe,{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})})(n);return!!t&&(await ue(t,{name:e.label,icon:e.icon}),!0)};if(n&&t)K(e);else{if(n&&!t){let n=i("ethereum");if(n&&!X(n))return void await ue(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&&!X(n))return void await ue(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(!X(e.connector)){if(Ce&&"wallet_connect_v2"===e.connector?.connectorType)if(await Ce.resetConnection(e.id),"wallet_connect_qr"!==e.id&&e.listing){let n=$[e.listing.slug]?{...e.listing,...$[e.listing.slug]}:e.listing;Ce.setWalletEntry(n,ce)}else Ce.setWalletEntry({id:"wallet_connect_qr",name:"WalletConnect",rdns:"",slug:"wallet-connect",homepage:"",chains:["eip155"],mobile:{native:"",universal:void 0}},ce);return xe&&"walletconnect_solana"===e.connector?.walletBranding.id&&(await xe.disconnect(),"wallet_connect_qr_solana"!==e.id&&e.listing?xe.wallet.setWalletEntry(e.listing,ce):xe.wallet.setWalletEntry({id:"wallet_connect_solana_qr",name:"WalletConnect",rdns:"",slug:"wallet-connect-solana",homepage:"",chains:["solana"],mobile:{native:"",universal:void 0}},ce),await new Promise((e=>setTimeout(e,100)))),void await ue(e.connector,{name:e.label,icon:e.icon})}e.url&&await ue(e.url,{name:e.label,icon:e.icon})}}),[Ce,xe,ue,K,ce,F,u,U]);return s((()=>{if(!C)return;let e=me.find((({id:e})=>e===C));e&&Te(e).catch(console.error)}),[C]),/*#__PURE__*/e(j,{className:h,children:[/*#__PURE__*/n(j.Header,{icon:W&&fe?void 0:se&&!ee||ee&&d&&se?.icon?se.icon:se?void 0:A,iconVariant:se&&!ee||ee&&d?"loading":void 0,iconLoadingStatus:se&&!ee||ee&&d?{success:"success"===de,fail:"error"===de}:void 0,title:W&&fe?void 0:se&&!ee?q("connectWallet.waitingForWallet",{walletName:se.name}):ee&&d?q("connectWallet.waitingForWallet",{walletName:se?.name??"connection"}):ye,subtitle:W&&fe?void 0:se&&!ee&&"string"==typeof se.connector?q("connectWallet.installAndConnect",{walletName:se.name}):se&&!ee&&"string"!=typeof se.connector?"error"===de?he===N.NO_SOLANA_ACCOUNTS?`The connected wallet has no Solana accounts. Please add a Solana account in ${se.name} and try again.`:q("connectWallet.tryConnectingAgain"):q("connectionStatus.connectOneWallet"):fe?p??(V?q("connectWallet.connectToAccount",{appName:V.name}):null):null,showBack:!!H||!fe,showClose:!0,onBack:H||ge,onClose:R}),/*#__PURE__*/e(j.Body,{ref:We,$colorScheme:O.appearance.palette.colorScheme,style:{marginBottom:ee?"0.5rem":void 0},children:[we&&/*#__PURE__*/n(ne,{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(pe)}),onChange:e=>be(e.target.value),value:ve})]})}),ee&&d&&"loading"===de&&/*#__PURE__*/e("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem"},children:[/*#__PURE__*/n(m,{variant:"primary",onClick:()=>window.open(ee.universal??ee.native,"_blank"),style:{width:"100%"},children:q("connectWallet.openInApp")}),/*#__PURE__*/n(re,{value:ee.universal??ee.native,iconOnly:!0,children:"Copy link"})]}),ee&&!d&&"loading"===de&&/*#__PURE__*/n("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"1rem"},children:/*#__PURE__*/n(re,{value:ee.universal??ee.native,iconOnly:!0,children:q("connectWallet.copyLink")})}),ee&&!d&&/*#__PURE__*/n(w,{size:280,url:ee.universal??ee.native,squareLogoElement:se?.icon?"string"==typeof se.icon?e=>/*#__PURE__*/n("svg",{...e,children:/*#__PURE__*/n("image",{href:se.icon,height:e.height,width:e.width})}):se.icon:E}),/*#__PURE__*/e(te,{children:[se&&!ee&&"string"==typeof se.connector&&/*#__PURE__*/e(ie,{onClick:()=>window.open(se.connector,"_blank"),children:[se.icon&&("string"==typeof se.icon?/*#__PURE__*/n(G,{src:se.icon}):/*#__PURE__*/n(se.icon,{})),/*#__PURE__*/n(oe,{children:se.name})]}),Y?.chains.some((e=>e.startsWith("eip155")))&&!se&&/*#__PURE__*/e(ie,{onClick:()=>Te({...Y,chains:Y.chains.filter((e=>e.startsWith("eip155")))}),children:[Y.icon&&("string"==typeof Y.icon?/*#__PURE__*/n(G,{src:Y.icon}):/*#__PURE__*/n(Y.icon,{})),/*#__PURE__*/n(oe,{children:Y.label}),/*#__PURE__*/n(le,{children:/*#__PURE__*/n(Q,{})})]}),Y?.chains.some((e=>e.startsWith("solana")))&&!se&&/*#__PURE__*/e(ie,{onClick:()=>Te({...Y,chains:Y.chains.filter((e=>e.startsWith("solana")))}),children:[Y.icon&&("string"==typeof Y.icon?/*#__PURE__*/n(G,{src:Y.icon}):/*#__PURE__*/n(Y.icon,{})),/*#__PURE__*/n(oe,{children:Y.label}),/*#__PURE__*/n(le,{children:/*#__PURE__*/n(D,{})})]}),fe&&/*#__PURE__*/e(t,{children:[!(pe>0)&&/*#__PURE__*/n(ae,{children:q("connectWallet.noWalletsFound")}),pe>0&&!ee&&/*#__PURE__*/n("div",{style:{maxHeight:56*Math.min(me.length,5)+5,width:"100%"},children:/*#__PURE__*/n("div",{style:{height:`${ke.getTotalSize()}px`,width:"100%",position:"relative"},children:ke.getVirtualItems().map((e=>/*#__PURE__*/n(Z,{index:e.index,style:{position:"absolute",top:0,left:0,height:`${e.size}px`,transform:`translateY(${e.start}px)`},data:{wallets:me,walletChainType:F,handleWalletClick:Te}},e.key)))})})]})]})]}),/*#__PURE__*/e(j.Footer,{children:[se&&!ee&&"string"!=typeof se.connector&&"error"===de&&/*#__PURE__*/n(j.Actions,{children:/*#__PURE__*/n(m,{style:{width:"100%",alignItems:"center"},variant:"error",onClick:()=>ue(se.connector,{name:se.name,icon:se.icon}),children:q("connectWallet.retry")})}),!!(V&&V.legal.privacyPolicyUrl&&V.legal.termsAndConditionsUrl)&&/*#__PURE__*/n(g,{app:V,alwaysShowImplicitConsent:!0}),/*#__PURE__*/n(j.Watermark,{})]})]})};let ne=/*#__PURE__*/h.div.withConfig({displayName:"StickySearchContainer",componentId:"sc-34a6bff4-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);"]),te=/*#__PURE__*/h.div.withConfig({displayName:"WalletListContainer",componentId:"sc-34a6bff4-1"})(["display:flex;flex-direction:column;gap:","px;"],5),ie=/*#__PURE__*/h.button.withConfig({displayName:"Button",componentId:"sc-34a6bff4-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);}"]),le=/*#__PURE__*/h.span.withConfig({displayName:"ButtonBadge",componentId:"sc-34a6bff4-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;}"]),ae=/*#__PURE__*/h.div.withConfig({displayName:"EmptyContainer",componentId:"sc-34a6bff4-4"})(["height:60px;display:flex;align-items:center;justify-content:center;text-align:center;"]),oe=/*#__PURE__*/h.span.withConfig({displayName:"WalletName",componentId:"sc-34a6bff4-5"})(["text-overflow:ellipsis;white-space:nowrap;color:var(--privy-color-foreground);font-weight:400;flex:1;"]),re=/*#__PURE__*/h(M).withConfig({displayName:"StyledCopyableText",componentId:"sc-34a6bff4-6"})(["&&{margin:0.5rem auto 0 auto;}"]);export{M as C,H,K as S,G as W,Y as a,R as b,P as c,Z as d,ee as i,J as u};
@@ -1 +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-CCyaupaz.mjs";import{L as g}from"./Link-DwjLfHwW.mjs";import{u as w,q as h}from"./context-Bycd1SKV.mjs";import{u as S}from"./useI18n-BtdAZuQ8.mjs";import{C as y,P as f,d as C}from"./prepareFundingModalData-CIgFwA7s.mjs";import{Q as b,k as v,T}from"./useActiveWallet-Bsy5GTCV.mjs";import{isHex as _,getAddress as E}from"viem";import{b as R,u as k,k as A}from"./internal-context-e-Eni5bG.mjs";import{u as W,a as I}from"./get-is-unified-wallet-DvKS5IUO.mjs";import{s as L}from"./shouldProceedtoEmbeddedWalletCreationFlow-Djgu4xiS.mjs";import{c as j,e as U}from"./usePrivy-BaiIHGte.mjs";import{S as O}from"./ScreenLayout-CddsD3Of.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useWallets-D0lpBS44.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-A9RSftUZ.mjs";import"ofetch";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"tinycolor2";import"./Button-B8mqatRx.mjs";import"./Screen-BTyXgDrd.mjs";import"./ModalHeader-BLGC-7ev.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};
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-Cq5UTy5I.mjs";import{L as g}from"./Link-DwjLfHwW.mjs";import{u as w,q as h}from"./context-CA-h9Vvv.mjs";import{u as S}from"./useI18n-Dtdu9d5P.mjs";import{C as y,P as f,d as C}from"./prepareFundingModalData-Dh2gc0UP.mjs";import{Q as b,k as v,T}from"./useActiveWallet-DbOGftJH.mjs";import{isHex as _,getAddress as E}from"viem";import{b as R,u as k,k as A}from"./internal-context-e-Eni5bG.mjs";import{u as W,a as I}from"./get-is-unified-wallet-BS6IT5u_.mjs";import{s as L}from"./shouldProceedtoEmbeddedWalletCreationFlow-7c-Jh9LP.mjs";import{c as j,e as U}from"./usePrivy-1ClOITL9.mjs";import{S as O}from"./ScreenLayout-BxqiFpIo.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useWallets-8CFi1gij.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-A9RSftUZ.mjs";import"ofetch";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"tinycolor2";import"./Button-4Bq0SnG7.mjs";import"./Screen-bEIBY18A.mjs";import"./ModalHeader-C6mIKC4v.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 a,q as i}from"./context-CA-h9Vvv.mjs";import{R as s}from"./index-Cq5UTy5I.mjs";import{u as n,a as c,e as p,b as l}from"./internal-context-e-Eni5bG.mjs";import{a as m}from"./get-is-unified-wallet-BS6IT5u_.mjs";import{z as d}from"./useActiveWallet-DbOGftJH.mjs";import{s as u}from"./shouldProceedtoEmbeddedWalletCreationFlow-7c-Jh9LP.mjs";import{S as f}from"./ScreenLayout-BxqiFpIo.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-8CFi1gij.mjs";import"./prepareFundingModalData-Dh2gc0UP.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"./usePrivy-1ClOITL9.mjs";import"./events-context-CI0iqAXA.mjs";import"@scure/base";import"styled-components";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"viem";import"./getPublicClient-A9RSftUZ.mjs";import"ofetch";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-4Bq0SnG7.mjs";import"./Screen-bEIBY18A.mjs";import"./ModalHeader-C6mIKC4v.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:a,onClose:i})=>{let{title:s,subtitle:n}=t((()=>r?{title:`Successfully connected with ${o.name}`,subtitle:"You're good to go!"}:a?{title:"Authentication failed",subtitle:a.message}:{title:`Connecting to ${o.name}`,subtitle:`Please check the pop-up from ${o.name} to continue`}),[r,a,o.name]);/*#__PURE__*/return e(f,{title:s,subtitle:n,icon:o.logoUrl,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!a},onBack:i,watermark:!0})},v={component:()=>{let t=a(),{data:f,navigate:v,setModalData:A,onUserCloseViaDialogOrKeybindRef:g}=m(),{crossAppAuthFlow:j,updateWallets:y,closePrivyModal:b,createAnalyticsEvent:w}=n(),{logout:C}=d(),[S,I]=o({}),U=f?.crossAppAuth,T=new c(`There was an issue connecting your ${U?.name} account. Please try again.`),k=new s((async e=>{if(U?.popup)try{let t=await j({appId:e,popup:U.popup,action:U.action});I({data:t})}catch(e){if(e instanceof c)I({error:e});else if(e instanceof p){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:${U.appId}`,embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,oAuthUserInfo:e.data?.data?.otherUser?.oAuthUserInfo}}),void v("LinkConflictScreen");U.popup&&U.popup.close(),I({error:T})}else I({error:T})}else I({error:T})})),W=()=>{S.data&&(y(),U?.onSuccess(S.data),b({shouldCallAuthOnSuccess:!0,isSuccess:!0})),U?.onError(S.error??new c("User canceled flow")),b({shouldCallAuthOnSuccess:!1,isSuccess:!1})};return g.current=W,r((()=>{U?.appId?.length&&k.execute(U.appId)}),[U?.appId]),r((()=>{if(!S.data)return;let e=S.data;if(t.legal.requireUsersAcceptTerms&&!e.hasAcceptedTerms){let e=setTimeout((()=>{v("AffirmativeConsentScreen")}),i);return()=>clearTimeout(e)}if(u(e,t.embeddedWallets)){let e=setTimeout((()=>{A({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),w({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:`privy:${U?.appId}`,screen:"CrossAppAuthScreen"}}),C()},callAuthOnSuccessOnClose:!0}}),v("EmbeddedWalletOnAccountCreateScreen")}),i);return()=>clearTimeout(e)}let o=setTimeout(W,i);return()=>clearTimeout(o)}),[S.data]),U?.appId?/*#__PURE__*/e(h,{providerApp:{id:U?.appId,logoUrl:U?.logoUrl,name:U?.name},success:!!S.data,error:S.error,onClose:W}):(console.warn("Missing data for Screen"),null)},isShownBeforeReady:!0};export{v as CrossAppAuthScreen,h as CrossAppAuthScreenView,v as default};
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import a from"@heroicons/react/24/outline/UserCircleIcon";import l,{useState as r,useEffect as n,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-BLGC-7ev.mjs";import{u}from"./context-Bycd1SKV.mjs";import{U as g,G as m,H as f,V as y,F as w,W as v,X as C,Y as b,e as k,Z as S,d as T,_ as M,$ as x,a0 as A}from"./useActiveWallet-Bsy5GTCV.mjs";import{u as L}from"./internal-context-e-Eni5bG.mjs";import{u as I,a as W,i as N}from"./get-is-unified-wallet-DvKS5IUO.mjs";import{a as E,t as P}from"./index-CCyaupaz.mjs";import{u as j,c as D,d as O}from"./ConnectWalletView-eQbJO3Pg.mjs";import{Mail as R,Smartphone as _,UserCircle as V}from"lucide-react";import{C as U}from"./ConnectEmailForm--PZXgvw4.mjs";import{C as F}from"./Chip-Bsgj4Yc-.mjs";import{F as $}from"./farcaster-DPlSjvF5.mjs";import{toObjectKeys as z}from"@privy-io/js-sdk-core";import H from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import G from"@heroicons/react/24/outline/FingerPrintIcon";import{L as q}from"./Link-DwjLfHwW.mjs";import{C as B}from"./ConnectPhoneForm-DoYmHBv3.mjs";import{T as K,a as X,I as Z,S as J,L as Q,G as Y,b as ee,D as te,A as ie}from"./twitter-6jomarO4.mjs";import{T as ae,L as le}from"./twitch-5IOe4sIQ.mjs";import{T as re}from"./telegram-B-JqnkqZ.mjs";import{W as ne}from"./WalletOverflowButton-DV9Pe-aq.mjs";import{S as oe}from"./ScreenLayout-CddsD3Of.mjs";const se=()=>{let t=u(),i=t?.appearance?.logo,a=`${t?.name} logo`,r={maxHeight:"90px",maxWidth:"180px"};return i?"string"==typeof i?/*#__PURE__*/e("img",{src:i,alt:a,style:r}):"svg"===i.type||"img"===i.type?/*#__PURE__*/l.cloneElement(i,{alt:a,style:r}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null},ce=t=>{let i=u();return i?.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:i,size:a="38px"})=>"string"==typeof i?/*#__PURE__*/e("img",{src:i,alt:`${t??"Provider app"} logo`,style:{width:a,height:a,maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):
1
+ import{jsx as e,jsxs as t,Fragment as i}from"react/jsx-runtime";import a from"@heroicons/react/24/outline/UserCircleIcon";import l,{useState as r,useEffect as n,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-C6mIKC4v.mjs";import{u}from"./context-CA-h9Vvv.mjs";import{U as g,G as m,H as f,V as y,F as w,W as v,X as C,Y as b,e as k,Z as S,d as T,_ as M,$ as x,a0 as A}from"./useActiveWallet-DbOGftJH.mjs";import{u as L}from"./internal-context-e-Eni5bG.mjs";import{u as I,a as W,i as N}from"./get-is-unified-wallet-BS6IT5u_.mjs";import{a as E,t as P}from"./index-Cq5UTy5I.mjs";import{u as j,c as D,d as O}from"./ConnectWalletView-Dp8IEFY-.mjs";import{Mail as R,Smartphone as _,UserCircle as V}from"lucide-react";import{C as U}from"./ConnectEmailForm-B1MnFVdm.mjs";import{C as F}from"./Chip-Bsgj4Yc-.mjs";import{F as $}from"./farcaster-DPlSjvF5.mjs";import{toObjectKeys as z}from"@privy-io/js-sdk-core";import H from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import G from"@heroicons/react/24/outline/FingerPrintIcon";import{L as q}from"./Link-DwjLfHwW.mjs";import{C as B}from"./ConnectPhoneForm-BPiamI5P.mjs";import{T as K,a as X,I as Z,S as J,L as Q,G as Y,b as ee,D as te,A as ie}from"./twitter-6jomarO4.mjs";import{T as ae,L as le}from"./twitch-5IOe4sIQ.mjs";import{T as re}from"./telegram-B-JqnkqZ.mjs";import{W as ne}from"./WalletOverflowButton-CpHsxy0L.mjs";import{S as oe}from"./ScreenLayout-BxqiFpIo.mjs";const se=()=>{let t=u(),i=t?.appearance?.logo,a=`${t?.name} logo`,r={maxHeight:"90px",maxWidth:"180px"};return i?"string"==typeof i?/*#__PURE__*/e("img",{src:i,alt:a,style:r}):"svg"===i.type||"img"===i.type?/*#__PURE__*/l.cloneElement(i,{alt:a,style:r}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null},ce=t=>{let i=u();return i?.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:i,size:a="38px"})=>"string"==typeof i?/*#__PURE__*/e("img",{src:i,alt:`${t??"Provider app"} logo`,style:{width:a,height:a,maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):
2
2
  /*#__PURE__*/e("span",{}),he=({appId:a})=>{let[l,o]=r(void 0),{startCrossAppAuthFlow:s,authenticated:c}=I(),{client:d}=L();return n((()=>{(async()=>{d&&o(await d.getCrossAppProviderDetails(a))})()}),[d]),/*#__PURE__*/e(g,{onClick:()=>s({appId:a,action:c?"link":"login"}),disabled:!l,children:l?/*#__PURE__*/t(i,{children:[/*#__PURE__*/e(pe,{name:l.name,logoUrl:l.icon_url||void 0,size:"24px"})," ",l.name]}):/*#__PURE__*/e(m,{})})},ue=({isEditable:a,setIsEditable:l,defaultValue:r})=>{let n=o(null);/*#__PURE__*/return t(i,{children:[/*#__PURE__*/e(f,{$if:!a,children:/*#__PURE__*/e(U,{ref:n,defaultValue:r})}),/*#__PURE__*/e(f,{$if:a,children:/*#__PURE__*/t(g,{onClick:()=>{l(),setTimeout((()=>{n.current?.focus()}),0)},children:[/*#__PURE__*/e(y,{children:/*#__PURE__*/e(R,{})}),"Continue with Email"]})})]})},ge=()=>{let[i,a]=r(!1),{currentScreen:l,navigate:n,setModalData:o,data:s}=W(),{enabled:c,token:d}=E(),{initLoginWithFarcaster:p}=L(),{accountType:h}=w();/*#__PURE__*/return t(g,{onClick:async()=>{a(!0);try{c&&!d?(o({captchaModalData:{callback:e=>p(e,s?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:"FarcasterConnectStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),n("CaptchaScreen")):(await p(d,s?.login?.disableSignup),n("FarcasterConnectStatusScreen"))}catch(e){o({errorModalData:{error:e,previousScreen:l||"LandingScreen"}}),n("ErrorScreen")}finally{a(!1)}},disabled:!1,children:[/*#__PURE__*/e($,{width:32,height:32})," Farcaster",i&&/*#__PURE__*/e(m,{}),"farcaster"===h&&/*#__PURE__*/e(me,{color:"gray",children:"Recent"})]})};let me=/*#__PURE__*/c(F).withConfig({displayName:"StyledChip",componentId:"sc-2f1c7323-0"})(["margin-left:auto;"]);const fe=({...i})=>/*#__PURE__*/t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...i,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:i,withPadding:a})=>{let l="";return l="ethereum-only"===i||"ethereum-and-solana"===i?"Rainbow, Phantom, or Coinbase Wallet":"Phantom or Solflare",/*#__PURE__*/e(v,{$withPadding:a,children:/*#__PURE__*/t(C,{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:i,token:a}=E(),{navigate:l,setModalData:r,data:n}=W(),o=u(),{initLoginWithPasskey:c}=L(),d=()=>{o.loginConfig.passkeysForSignupEnabled?l("PasskeySelectSignupOrLogin"):(async()=>{i&&!a?(r({passkeyAuthModalData:{passkeySignupFlow:!1},captchaModalData:{callback:e=>c({captchaToken:e,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"PasskeyStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),l("CaptchaScreen")):(await c({withPrivyUi:!0,captchaToken:a}),r({passkeyAuthModalData:{passkeySignupFlow:!1}}),l("PasskeyStatusScreen"))})()};return 0===s((()=>{let e=n?.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,n?.login])?/*#__PURE__*/t(g,{onClick:d,children:[/*#__PURE__*/e(G,{})," Continue with passkey"]}):/*#__PURE__*/e(q,{as:"button",onClick:d,size:"sm",variant:"navigation",style:{width:"100%",justifyContent:"center"},children:"I have a passkey"})},ve=({isEditable:a,setIsEditable:l,defaultValue:r})=>{let n=o(null),{authenticated:s}=I(),{navigate:c,setModalData:d,currentScreen:p,data:h}=W(),{initLoginWithSms:m}=L(),{enabled:w,token:v}=E(),{whatsAppEnabled:C}=u();/*#__PURE__*/return t(i,{children:[/*#__PURE__*/e(f,{$if:!a,children:/*#__PURE__*/e(B,{ref:n,onSubmit:async function({qualifiedPhoneNumber:e}){if(!w||v||s)try{await m({phoneNumber:e,captchaToken:v,withPrivyUi:!0,disableSignup:h?.login?.disableSignup}),c("AwaitingPasswordlessCodeScreen")}catch(e){d({errorModalData:{error:e,previousScreen:p||"LandingScreen"}}),c("ErrorScreen")}else d({captchaModalData:{callback:t=>m({phoneNumber:e,captchaToken:t,withPrivyUi:!0,disableSignup:h?.login?.disableSignup}),userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),c("CaptchaScreen")},defaultValue:r})}),/*#__PURE__*/e(f,{$if:a,children:/*#__PURE__*/t(g,{onClick:()=>{l(),setTimeout((()=>{n.current?.focus()}),0)},children:[/*#__PURE__*/e(y,{children:/*#__PURE__*/e(_,{})}),"Continue with ",C?"WhatsApp":"SMS"]})})]})};let Ce={apple:{logo:ie,displayName:"Apple"},discord:{logo:te,displayName:"Discord"},github:{logo:ee,displayName:"GitHub"},google:{logo:Y,displayName:"Google"},linkedin:{logo:Q,displayName:"LinkedIn"},spotify:{logo:J,displayName:"Spotify"},instagram:{logo:Z,displayName:"Instagram"},twitter:{logo:X,displayName:"Twitter"},tiktok:{logo:K,displayName:"TikTok"},line:{logo:le,displayName:"LINE"},twitch:{logo:ae,displayName:"Twitch"}};const be=({provider:i})=>{let{enabled:a,token:l}=E(),{navigate:n,setModalData:o,data:c}=W(),[d,p]=r(!1),h=u(),{initLoginWithOAuth:m}=L(),{accountType:f}=w(),v=s((()=>f&&"guest"!==f&&"authorization_key"!==f&&"cross_app"!==f?P(f):null),[f]),{displayName:C,logo:b}=s((()=>{if(N(i)){let t=h.customOAuthProviders.find((e=>e.provider===i)),a=t.provider_icon_url,l=t.provider_display_name;return{displayName:l,logo:({style:t})=>/*#__PURE__*/e("img",{alt:`${l} logo`,src:a,style:t})}}return Ce[i]}),[i,h.customOAuthProviders]);/*#__PURE__*/return t(g,{onClick:()=>{p(!0),setTimeout((()=>{p(!1)}),2e3),a&&!l?(o({captchaModalData:{callback:e=>m(i,e,c?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ErrorScreen"}}),n("CaptchaScreen")):m(i,void 0,c?.login?.disableSignup)},disabled:d,children:[/*#__PURE__*/e(y,{$fullSize:!0,children:/*#__PURE__*/e(b,{style:{width:"32px",height:"32px"}})}),C,v?.loginMethod===i&&/*#__PURE__*/e(ke,{color:"gray",children:"Recent"})]})};let ke=/*#__PURE__*/c(F).withConfig({displayName:"StyledChip",componentId:"sc-e74c7091-0"})(["margin-left:auto;"]);const Se=()=>{let{enabled:i,token:a}=E(),{navigate:l,setModalData:n,data:o}=W(),[s,c]=r(!1),{initLoginWithTelegram:d}=L(),{accountType:p}=w();async function h(e){try{await d(e,o?.login?.disableSignup),n({telegramAuthModalData:{seamlessAuth:!1}}),l("TelegramAuthScreen")}catch(e){console.error(e),c(!1)}}/*#__PURE__*/return t(g,{onClick:async function(){if(c(!0),i&&!a)return n({captchaModalData:{callback:h,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ErrorScreen"}}),void l("CaptchaScreen");await h(a)},disabled:s,children:[/*#__PURE__*/e(re,{width:32,height:32}),"Telegram","telegram"===p&&/*#__PURE__*/e(Te,{color:"gray",children:"Recent"})]})};let Te=/*#__PURE__*/c(F).withConfig({displayName:"StyledChip",componentId:"sc-639dd483-0"})(["margin-left:auto;"]);const Me=({onClick:i,text:a,icon:l})=>/*#__PURE__*/t(g,{onClick:i,children:[/*#__PURE__*/e(y,{children:l}),/*#__PURE__*/e(b,{children:a})]}),xe=({connectOnly:a})=>{let{closePrivyModal:l}=L(),{data:o,setModalData:c,onUserCloseViaDialogOrKeybindRef:p,navigate:h}=W(),g=u(),m=o?.login,f=g.appearance.walletList,y=m?.walletChainType??g.appearance.walletChainType,{accountType:v,walletClientType:C,chainType:b}=w(),T=s((()=>v&&"guest"!==v&&"authorization_key"!==v&&"cross_app"!==v?P(v):null),[v]),{email:M,sms:x,google:A,twitter:I,discord:E,github:R,spotify:_,instagram:V,tiktok:U,line:F,twitch:$,linkedin:H,apple:G,wallet:q,farcaster:B,telegram:K}=s((()=>m?.loginMethods?z(m.loginMethods,!0):null),[m])??g.loginMethods,{wallets:X}=j({enabled:k(q?f:[]),walletList:f,walletChainType:y}),Z=g.customOAuthProviders,J=g.crossAppProviders,{passkey:Q}=g.loginMethods,Y=[M&&"email",x&&"sms",A&&"google",I&&"twitter",E&&"discord",R&&"github",_&&"spotify",V&&"instagram",U&&"tiktok",F&&"line",$&&"twitch",H&&"linkedin",G&&"apple",B&&"farcaster",K&&"telegram",...Z.map((e=>e.provider)),...J].filter((e=>!!e)),ee=Y.length>0,te=s((()=>q&&!ee?"web3-first":q&&g?.appearance.loginGroupPriority||"web2-first"),[q,ee,g?.appearance.loginGroupPriority]),ie=g?.appearance.hideDirectWeb2Inputs,[ae,le]=r("default"),[re,ce]=r(Ee({mostRecentlyUsedAccountType:v,smsAvailable:x,emailAvailable:M,prefilledType:m?.prefill?.type}));n((()=>{ce(Ee({mostRecentlyUsedAccountType:v,smsAvailable:x,emailAvailable:M,prefilledType:m?.prefill?.type}))}),[M,x,v]);let de=()=>{l({shouldCallAuthOnSuccess:!0}),setTimeout((()=>{le("default")}),150)};p.current=de;let pe=[];C&&q?pe.push(C):T?.loginMethod&&Y.includes(T.loginMethod)&&pe.push(T.loginMethod);let me=t=>{if("email"===t)/*#__PURE__*/return e(ue,{isEditable:"email"===re,setIsEditable:()=>{ce("email")},defaultValue:"email"===m?.prefill?.type?m.prefill.value:void 0},t);if("sms"===t)/*#__PURE__*/return e(ve,{isEditable:"sms"===re,setIsEditable:()=>{ce("sms")},defaultValue:"phone"===m?.prefill?.type?m.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(ge,{},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(N(t))/*#__PURE__*/return e(be,{provider:t},t);if(t.startsWith("privy:")){let i=t.split(":")[1];if(!i)throw Error("Invalid cross-app provider format. App ID missing.");/*#__PURE__*/return e(he,{appId:i},t)}let i=X.findIndex((({id:e})=>e===D.normalize(t))),l="solana"===b?"solana-only":"ethereum-only";/*#__PURE__*/return e(O,{recent:!0,index:i,data:{wallets:X,walletChainType:l,handleWalletClick(e){c((t=>({...t,externalConnectWallet:{walletList:f,walletChainType:l,preSelectedWalletId:e.id}}))),h(a?"ConnectOnlyLandingScreen":"AuthenticateWithWalletScreen")}}})},fe=X.filter((e=>e.id!==D.normalize(C||""))),Ce=fe.map(((t,i)=>/*#__PURE__*/e(O,{index:i,data:{walletChainType:y,wallets:fe,handleWalletClick(e){c((t=>({...t,externalConnectWallet:{walletList:f,walletChainType:y,preSelectedWalletId:e.id}}))),h(a?"ConnectOnlyLandingScreen":"AuthenticateWithWalletScreen")}}},t.id))),ke=Y.filter((e=>e!==T?.loginMethod)).flatMap(me),Te=pe.flatMap(me);"web3-first"===te&&"default"===ae?Ce.unshift(...Te):"web2-first"===te&&ke.unshift(...Te);let xe="web2-overflow"===ae?()=>le("default"):void 0,Pe=Y.filter((e=>"email"!==e&&"sms"!==e)),je=Ie({priority:te,email:M,sms:x,social:Pe}),De=We({priority:te,email:M,sms:x,social:Pe}),Oe=/*#__PURE__*/e(ne,{text:Ne({priority:te}),onClick:()=>{c({...o,externalConnectWallet:{walletChainType:m?.walletChainType??g.appearance.walletChainType}}),h(a?"ConnectOnlyLandingScreen":"AuthenticateWithWalletScreen")}}),Re=/*#__PURE__*/e(Me,{text:je,icon:De,onClick:()=>le("web2-overflow")}),_e=ie?0:1,Ve=q&&Ce.length>0,Ue=0===ke.length&&q&&0===Ce.length,Fe=5-(Ve?1:0),$e="default"===ae&&g?.appearance.logo,ze="default"===ae&&g.appearance.loginMessage;/*#__PURE__*/return t(oe,{title:g.appearance.landingHeader,icon:$e?/*#__PURE__*/e(se,{}):void 0,iconVariant:$e?"logo":void 0,onClose:de,showClose:!0,onBack:xe,showBack:!!xe,helpText:g||Q&&"default"===ae?/*#__PURE__*/t(i,{children:[Q&&"default"===ae&&/*#__PURE__*/e(we,{}),g&&/*#__PURE__*/e(d,{app:g})]}):void 0,watermark:!0,children:[ze&&("string"==typeof g.appearance.loginMessage?/*#__PURE__*/e(Ae,{children:g.appearance.loginMessage}):/*#__PURE__*/e(Le,{children:g.appearance.loginMessage})),/*#__PURE__*/e(S,{$colorScheme:g.appearance.palette.colorScheme,children:"default"===ae&&"web2-first"===te?/*#__PURE__*/t(i,{children:[ke.length>Fe?ke.slice(0,Fe-1):ke,ke.length>Fe&&Re,Ve&&Oe,Ue&&/*#__PURE__*/e(ye,{chainType:g.appearance.walletChainType})]}):"default"===ae&&"web3-first"===te?/*#__PURE__*/t(i,{children:[q&&/*#__PURE__*/t(i,{children:[Ce.length>Fe?Ce.slice(0,Fe-1):Ce,Ce.length>Fe&&Oe]}),ke.length>_e&&Re,ke.length===_e&&ke[0],Ue&&/*#__PURE__*/e(ye,{chainType:g.appearance.walletChainType})]}):"web2-overflow"===ae?/*#__PURE__*/e(i,{children:"web3-first"===te?ke:ke.slice(3)}):null})]})};let Ae=/*#__PURE__*/c.div.withConfig({displayName:"StyledSubtitle",componentId:"sc-c85d71fe-0"})(["text-align:center;font-size:14px;margin-bottom:24px;"]),Le=/*#__PURE__*/c.div.withConfig({displayName:"MessageContainer",componentId:"sc-c85d71fe-1"})(["margin-bottom:24px;"]),Ie=({priority:e,email:t,sms:i,social:a})=>"web2-first"===e?"Other socials":t&&i&&a.length>0||t&&a.length>0?"Log in with email or socials":i&&a.length>0?"Log in with sms or socials":t&&i?"Continue with email or sms":t?"Continue with email":i?"Continue with sms":"Log in with a social account",We=({priority:t,email:i,sms:a,social:l})=>"web2-first"===t||l.length>0?/*#__PURE__*/e(V,{}):i&&a?/*#__PURE__*/e(fe,{}):i?/*#__PURE__*/e(R,{}):a?/*#__PURE__*/e(_,{}):null,Ne=({priority:e})=>"web2-first"===e?"Continue with a wallet":"Other wallets";const Ee=({mostRecentlyUsedAccountType:e,smsAvailable:t,emailAvailable:i,prefilledType:a})=>i&&("email"===e&&"phone"!==a||"email"===a)||!t||"phone"!==e&&"phone"!==a?"email":"sms",Pe=({connectOnly:l})=>{let{closePrivyModal:o,connectors:c}=L(),{data:g,setModalData:m,onUserCloseViaDialogOrKeybindRef:f,navigate:y}=W(),v=u(),C=v.appearance.palette.colorScheme,{accountType:b,walletClientType:k}=w(),I=s((()=>b&&"guest"!==b&&"authorization_key"!==b&&"cross_app"!==b?P(b):null),[b]),N=v.loginMethodsAndOrder?.primary??[],E=v.loginMethodsAndOrder?.overflow??[],j=s((()=>[...N,...E]),[N,E]),R=v.loginMethods.passkey,_=g?.login,V=[];k&&j.includes(k)?V.push(k):b&&j.includes(I?.loginMethod)&&V.push(I?.loginMethod);let[U,F]=r("default"),[$,z]=r(Ee({mostRecentlyUsedAccountType:b,smsAvailable:j.includes("sms"),emailAvailable:j.includes("email"),prefilledType:_?.prefill?.type}));n((()=>{z(Ee({mostRecentlyUsedAccountType:b,smsAvailable:j.includes("sms"),emailAvailable:j.includes("email"),prefilledType:_?.prefill?.type}))}),[j,b]),n((()=>{"phone"===b&&z("sms");let e=j.indexOf("sms"),t=j.indexOf("email");e>-1&&e<t&&z("sms")}),[b,N,E]);let H=()=>{o({shouldCallAuthOnSuccess:!0}),setTimeout((()=>{F("default")}),150)};f.current=H;let{listings:G}=T(),q=t=>{if("email"===t)/*#__PURE__*/return e(ue,{isEditable:"email"===$,setIsEditable:()=>{z("email")},defaultValue:"email"===_?.prefill?.type?_.prefill.value:void 0},t);if("sms"===t)/*#__PURE__*/return e(ve,{isEditable:"sms"===$,setIsEditable:()=>{z("sms")},defaultValue:"phone"===_?.prefill?.type?_.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(ge,{},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("spotify"===t)/*#__PURE__*/return e(be,{provider:"spotify"},t);if("instagram"===t)/*#__PURE__*/return e(be,{provider:"instagram"},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("twitter"===t)/*#__PURE__*/return e(be,{provider:"twitter"},t);if("telegram"===t)/*#__PURE__*/return e(Se,{},t);if(t.startsWith("privy:"))/*#__PURE__*/return e(he,{appId:t.replace("privy:","")},t);let i=v.appearance.walletChainType,a=new D(i,[t]).getWallets(c,G);return a.wallets.map(((t,r)=>/*#__PURE__*/e(O,{index:r,data:{wallets:a.wallets,walletChainType:i,handleWalletClick(e){m((t=>({...t,externalConnectWallet:{walletList:j,walletChainType:i,preSelectedWalletId:e.id}}))),y(l?"ConnectOnlyLandingScreen":"AuthenticateWithWalletScreen")}}},t.id+r)))},B=V.flatMap(q),K=N.filter((e=>e!==k&&e!==I?.loginMethod)).flatMap(q),X=E.filter((e=>e!==k&&e!==I?.loginMethod)).flatMap(q),[Z,J]=M([...B,...K,...X],je({primary:K.length+B.length,overflow:X.length}));/*#__PURE__*/return t(i,{children:[/*#__PURE__*/e(p,{title:v.appearance.landingHeader,onClose:H,backFn:"default"===U?void 0:()=>{F("default")}}),"default"===U&&/*#__PURE__*/e(De,{}),"default"===U&&("string"==typeof v.appearance.loginMessage?/*#__PURE__*/e(x,{children:v.appearance.loginMessage}):v.appearance.loginMessage),/*#__PURE__*/e(A,{style:{overflow:"hidden"},children:/*#__PURE__*/t(S,{$colorScheme:C,children:["default"===U&&/*#__PURE__*/t(i,{children:[Z,J.length>0&&/*#__PURE__*/e(Me,{text:"More options",icon:/*#__PURE__*/e(a,{}),onClick:()=>F("overflow")})]}),"overflow"===U&&/*#__PURE__*/e(i,{children:J}),R&&"default"===U&&/*#__PURE__*/e(we,{})]})}),v&&/*#__PURE__*/e(d,{app:v}),/*#__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-ead54d53-0"})(["margin-bottom:16px;"]);export{Pe as C,xe as L};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{AlertCircle as t,CheckCircle as o,CloudUpload as r}from"lucide-react";import{useState as i,useEffect as s}from"react";import{W as a}from"./WalletInfoCard-YE5P6CSV.mjs";import{u as n,r as c}from"./context-Bycd1SKV.mjs";import{u as m,a as l}from"./internal-context-e-Eni5bG.mjs";import{a as p}from"./get-is-unified-wallet-DvKS5IUO.mjs";import{S as u}from"./ScreenLayout-CddsD3Of.mjs";import"styled-components";import"./Button-B8mqatRx.mjs";import"./useActiveWallet-Bsy5GTCV.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CIgFwA7s.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-D0lpBS44.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Address-BsvZLUXE.mjs";import"./shared-CtYf3O54.mjs";import"tinycolor2";import"ofetch";import"./Screen-BTyXgDrd.mjs";import"./ModalHeader-BLGC-7ev.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 d=({appName:i,address:s,success:n,error:c,onAccept:m,onDecline:l,onClose:p})=>/*#__PURE__*/e(u,n||c?{title:c?"Something went wrong":"Success!",subtitle:c?"Please try again.":`You've successfully granted delegated action permissions to ${i}.`,icon:c?t:o,iconVariant:c?"error":"success",onBack:p,watermark:!0}:{title:"Enable offline access",subtitle:`By confirming, ${i} will be able to use your wallet for you even when you're not around. You can revoke this later.`,icon:r,primaryCta:{label:"Accept",onClick:m},secondaryCta:{label:"Not now",onClick:l},onBack:p,watermark:!0,children:/*#__PURE__*/e(a,{address:s,title:"Wallet"})}),j={component:()=>{let{data:t}=p(),o=n(),{closePrivyModal:r}=m(),[a,u]=i(!1),[j,f]=i(),{address:y,onDelegate:g,onSuccess:h,onError:w}=t.delegatedActions.consent,v=async()=>{a?h():w(j??new l("User declined delegating actions.")),r({shouldCallAuthOnSuccess:!1})};return s((()=>{if(!a&&!j)return;let e=setTimeout(v,c);return()=>clearTimeout(e)}),[a,j]),/*#__PURE__*/e(d,{appName:o.name,address:y,success:a,error:j,onAccept:async()=>{try{await g(),u(!0)}catch(e){f(e)}},onDecline:()=>{v()},onClose:v})}};export{j as DelegatedActionsConsentScreen,d as DelegatedActionsConsentScreenView,j as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{AlertCircle as t,CheckCircle as o,CloudUpload as r}from"lucide-react";import{useState as i,useEffect as s}from"react";import{W as a}from"./WalletInfoCard-6gQNu7Zz.mjs";import{u as n,r as c}from"./context-CA-h9Vvv.mjs";import{u as m,a as l}from"./internal-context-e-Eni5bG.mjs";import{a as p}from"./get-is-unified-wallet-BS6IT5u_.mjs";import{S as u}from"./ScreenLayout-BxqiFpIo.mjs";import"styled-components";import"./Button-4Bq0SnG7.mjs";import"./useActiveWallet-DbOGftJH.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-Dh2gc0UP.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-8CFi1gij.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Address-C4HUUkkd.mjs";import"./shared-CtYf3O54.mjs";import"tinycolor2";import"ofetch";import"./Screen-bEIBY18A.mjs";import"./ModalHeader-C6mIKC4v.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 d=({appName:i,address:s,success:n,error:c,onAccept:m,onDecline:l,onClose:p})=>/*#__PURE__*/e(u,n||c?{title:c?"Something went wrong":"Success!",subtitle:c?"Please try again.":`You've successfully granted delegated action permissions to ${i}.`,icon:c?t:o,iconVariant:c?"error":"success",onBack:p,watermark:!0}:{title:"Enable offline access",subtitle:`By confirming, ${i} will be able to use your wallet for you even when you're not around. You can revoke this later.`,icon:r,primaryCta:{label:"Accept",onClick:m},secondaryCta:{label:"Not now",onClick:l},onBack:p,watermark:!0,children:/*#__PURE__*/e(a,{address:s,title:"Wallet"})}),j={component:()=>{let{data:t}=p(),o=n(),{closePrivyModal:r}=m(),[a,u]=i(!1),[j,f]=i(),{address:y,onDelegate:g,onSuccess:h,onError:w}=t.delegatedActions.consent,v=async()=>{a?h():w(j??new l("User declined delegating actions.")),r({shouldCallAuthOnSuccess:!1})};return s((()=>{if(!a&&!j)return;let e=setTimeout(v,c);return()=>clearTimeout(e)}),[a,j]),/*#__PURE__*/e(d,{appName:o.name,address:y,success:a,error:j,onAccept:async()=>{try{await g(),u(!0)}catch(e){f(e)}},onDecline:()=>{v()},onClose:v})}};export{j as DelegatedActionsConsentScreen,d as DelegatedActionsConsentScreenView,j as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{AlertCircle as o,CheckCircle as t,Ban as r}from"lucide-react";import{useState as i,useEffect as n}from"react";import{u as s,r as a}from"./context-Bycd1SKV.mjs";import{u as c,a as m}from"./internal-context-e-Eni5bG.mjs";import{a as l}from"./get-is-unified-wallet-DvKS5IUO.mjs";import{S as p}from"./ScreenLayout-CddsD3Of.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"./Button-B8mqatRx.mjs";import"styled-components";import"./useActiveWallet-Bsy5GTCV.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CIgFwA7s.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-D0lpBS44.mjs";import"./Screen-BTyXgDrd.mjs";import"./ModalHeader-BLGC-7ev.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 u=({appName:i,success:n,error:s,onRevoke:a,onDeny:c,onClose:m})=>/*#__PURE__*/e(p,n||s?{title:s?"Something went wrong":"Success!",subtitle:s?"Please try again.":"You've successfully revoked permissions.",icon:s?o:t,iconVariant:s?"error":"success",onBack:m,watermark:!0}:{title:"Revoke offline access to wallet",subtitle:`By confirming, ${i} will no longer be able to use this wallet on your behalf when you are not online.`,icon:r,primaryCta:{label:"Confirm",onClick:a},secondaryCta:{label:"Deny",onClick:c},onBack:m,watermark:!0}),d={component:()=>{let{data:o}=l(),t=s(),{closePrivyModal:r}=c(),[p,d]=i(!1),[f,y]=i(),{onRevoke:v,onSuccess:k,onError:h}=o.delegatedActions.revoke,j=async()=>{p?k():h(f??new m("User declined revoking access to their delegated wallet.")),r({shouldCallAuthOnSuccess:!1})};return n((()=>{if(!p&&!f)return;let e=setTimeout(j,a);return()=>clearTimeout(e)}),[p,f]),/*#__PURE__*/e(u,{appName:t.name,success:p,error:f,onRevoke:async()=>{try{await v(),d(!0)}catch(e){y(e)}},onDeny:()=>{j()},onClose:j})}};export{d as DelegatedActionsRevokeScreen,u as DelegatedActionsRevokeScreenView,d as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{AlertCircle as o,CheckCircle as t,Ban as r}from"lucide-react";import{useState as i,useEffect as n}from"react";import{u as s,r as a}from"./context-CA-h9Vvv.mjs";import{u as c,a as m}from"./internal-context-e-Eni5bG.mjs";import{a as l}from"./get-is-unified-wallet-BS6IT5u_.mjs";import{S as p}from"./ScreenLayout-BxqiFpIo.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"./Button-4Bq0SnG7.mjs";import"styled-components";import"./useActiveWallet-DbOGftJH.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-Dh2gc0UP.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-8CFi1gij.mjs";import"./Screen-bEIBY18A.mjs";import"./ModalHeader-C6mIKC4v.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 u=({appName:i,success:n,error:s,onRevoke:a,onDeny:c,onClose:m})=>/*#__PURE__*/e(p,n||s?{title:s?"Something went wrong":"Success!",subtitle:s?"Please try again.":"You've successfully revoked permissions.",icon:s?o:t,iconVariant:s?"error":"success",onBack:m,watermark:!0}:{title:"Revoke offline access to wallet",subtitle:`By confirming, ${i} will no longer be able to use this wallet on your behalf when you are not online.`,icon:r,primaryCta:{label:"Confirm",onClick:a},secondaryCta:{label:"Deny",onClick:c},onBack:m,watermark:!0}),d={component:()=>{let{data:o}=l(),t=s(),{closePrivyModal:r}=c(),[p,d]=i(!1),[f,y]=i(),{onRevoke:v,onSuccess:k,onError:h}=o.delegatedActions.revoke,j=async()=>{p?k():h(f??new m("User declined revoking access to their delegated wallet.")),r({shouldCallAuthOnSuccess:!1})};return n((()=>{if(!p&&!f)return;let e=setTimeout(j,a);return()=>clearTimeout(e)}),[p,f]),/*#__PURE__*/e(u,{appName:t.name,success:p,error:f,onRevoke:async()=>{try{await v(),d(!0)}catch(e){y(e)}},onDeny:()=>{j()},onClose:j})}};export{d as DelegatedActionsRevokeScreen,u as DelegatedActionsRevokeScreenView,d as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{XCircle as t}from"lucide-react";import{useMemo as r,useState as o,useEffect as i}from"react";import{e as a,c as n}from"./index-CCyaupaz.mjs";import{u as s}from"./internal-context-e-Eni5bG.mjs";import{u as l,a as c}from"./get-is-unified-wallet-DvKS5IUO.mjs";import{S as m}from"./ScreenLayout-CddsD3Of.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-Bsy5GTCV.mjs";import"zustand";import"./context-Bycd1SKV.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-CIgFwA7s.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-D0lpBS44.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-BaiIHGte.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-B8mqatRx.mjs";import"./Screen-BTyXgDrd.mjs";import"./ModalHeader-BLGC-7ev.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=({connectionFailed:r,onClose:o})=>/*#__PURE__*/e(m,r?{title:"Something went wrong",subtitle:"We're on it. Please try again later.",icon:t,iconVariant:"error",primaryCta:{label:"Close",onClick:o},watermark:!0}:{title:"Connecting to your wallet",subtitle:"Please wait...",iconVariant:"loading",showClose:!0,onClose:o,watermark:!1}),d={component:()=>{let{authenticated:t,user:m}=l(),{client:d,closePrivyModal:u,createAnalyticsEvent:y,walletProxy:v}=s(),{navigate:h,data:f,setModalData:w,onUserCloseViaDialogOrKeybindRef:b}=c(),j=r((()=>Date.now()),[]),[g,C]=o(!1),{onCompleteNavigateTo:A,onFailure:I,shouldForceMFA:k,entropyId:x,entropyIdVerifier:S,recoveryMethod:F,connectingWalletAddress:M,isUnifiedWallet:P=!1}=f?.connectWallet,T=e=>{g||(C(!0),I("string"==typeof e?Error(e):e))};return i((()=>{let e;return t?v?((async()=>{let t=await d.getAccessToken();if(!t)return T("User must be authenticated and have a Privy wallet before it can be connected");try{if(!P){if(!x||!S)return T("For on-device first-class chain wallets, entropyId and entropyIdVerifier are required");await v.connect({accessToken:t,entropyId:x,entropyIdVerifier:S})}k&&await v.verifyMfa({accessToken:t});let r=(Date.now()-j)/1e3;"EmbeddedWalletKeyExportScreen"===A&&r<1?e=setTimeout((()=>{h(A,!1)}),1e3*(1-r)):h(A,!1)}catch(e){if(a(e)&&"privy"===F){let e=await d.getAccessToken();if(!e)return T("User must be authenticated and have a Privy wallet before it can be recovered");try{y({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:M}});let t=await(v?.recover({accessToken:e,entropyId:x,entropyIdVerifier:S}));t?.entropyId||T(Error("Unable to recover wallet")),A?h(A):u({shouldCallAuthOnSuccess:!1}),y({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:M}}),h(A)}catch(e){T("An error has occurred, please try again.")}}else a(e)&&"privy"!==F&&"privy-v2"!==F?(w({...f,recoverWallet:{entropyId:x,entropyIdVerifier:S,onCompleteNavigateTo:A,onFailure:I},recoveryOAuthStatus:{provider:F,action:"recover",isInAccountCreateFlow:!1,shouldCreateEth:!1,shouldCreateSol:!1}}),h(n(F))):T(e)}})(),()=>clearTimeout(e)):void 0:T("User must be authenticated and have a Privy wallet before it can be connected")}),[t,m,v]),b.current=()=>{T("User exited before wallet could be connected"),u({shouldCallAuthOnSuccess:!1})},/*#__PURE__*/e(p,{connectionFailed:g,onClose:()=>u({shouldCallAuthOnSuccess:!1})})}};export{d as EmbeddedWalletConnectingScreen,p as EmbeddedWalletConnectingView,d as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{XCircle as t}from"lucide-react";import{useMemo as r,useState as o,useEffect as i}from"react";import{e as a,c as n}from"./index-Cq5UTy5I.mjs";import{u as s}from"./internal-context-e-Eni5bG.mjs";import{u as l,a as c}from"./get-is-unified-wallet-BS6IT5u_.mjs";import{S as m}from"./ScreenLayout-BxqiFpIo.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-DbOGftJH.mjs";import"zustand";import"./context-CA-h9Vvv.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-Dh2gc0UP.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-8CFi1gij.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-1ClOITL9.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-4Bq0SnG7.mjs";import"./Screen-bEIBY18A.mjs";import"./ModalHeader-C6mIKC4v.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=({connectionFailed:r,onClose:o})=>/*#__PURE__*/e(m,r?{title:"Something went wrong",subtitle:"We're on it. Please try again later.",icon:t,iconVariant:"error",primaryCta:{label:"Close",onClick:o},watermark:!0}:{title:"Connecting to your wallet",subtitle:"Please wait...",iconVariant:"loading",showClose:!0,onClose:o,watermark:!1}),d={component:()=>{let{authenticated:t,user:m}=l(),{client:d,closePrivyModal:u,createAnalyticsEvent:y,walletProxy:v}=s(),{navigate:h,data:f,setModalData:w,onUserCloseViaDialogOrKeybindRef:b}=c(),j=r((()=>Date.now()),[]),[g,C]=o(!1),{onCompleteNavigateTo:A,onFailure:I,shouldForceMFA:k,entropyId:x,entropyIdVerifier:S,recoveryMethod:F,connectingWalletAddress:M,isUnifiedWallet:P=!1}=f?.connectWallet,T=e=>{g||(C(!0),I("string"==typeof e?Error(e):e))};return i((()=>{let e;return t?v?((async()=>{let t=await d.getAccessToken();if(!t)return T("User must be authenticated and have a Privy wallet before it can be connected");try{if(!P){if(!x||!S)return T("For on-device first-class chain wallets, entropyId and entropyIdVerifier are required");await v.connect({accessToken:t,entropyId:x,entropyIdVerifier:S})}k&&await v.verifyMfa({accessToken:t});let r=(Date.now()-j)/1e3;"EmbeddedWalletKeyExportScreen"===A&&r<1?e=setTimeout((()=>{h(A,!1)}),1e3*(1-r)):h(A,!1)}catch(e){if(a(e)&&"privy"===F){let e=await d.getAccessToken();if(!e)return T("User must be authenticated and have a Privy wallet before it can be recovered");try{y({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:M}});let t=await(v?.recover({accessToken:e,entropyId:x,entropyIdVerifier:S}));t?.entropyId||T(Error("Unable to recover wallet")),A?h(A):u({shouldCallAuthOnSuccess:!1}),y({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:M}}),h(A)}catch(e){T("An error has occurred, please try again.")}}else a(e)&&"privy"!==F&&"privy-v2"!==F?(w({...f,recoverWallet:{entropyId:x,entropyIdVerifier:S,onCompleteNavigateTo:A,onFailure:I},recoveryOAuthStatus:{provider:F,action:"recover",isInAccountCreateFlow:!1,shouldCreateEth:!1,shouldCreateSol:!1}}),h(n(F))):T(e)}})(),()=>clearTimeout(e)):void 0:T("User must be authenticated and have a Privy wallet before it can be connected")}),[t,m,v]),b.current=()=>{T("User exited before wallet could be connected"),u({shouldCallAuthOnSuccess:!1})},/*#__PURE__*/e(p,{connectionFailed:g,onClose:()=>u({shouldCallAuthOnSuccess:!1})})}};export{d as EmbeddedWalletConnectingScreen,p as EmbeddedWalletConnectingView,d as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{CheckCircle as t}from"lucide-react";import{useEffect as o}from"react";import{u as r,a as i,b as s,c}from"./get-is-unified-wallet-DvKS5IUO.mjs";import{u as a,r as m}from"./context-Bycd1SKV.mjs";import{u as n}from"./internal-context-e-Eni5bG.mjs";import{S as l}from"./ScreenLayout-CddsD3Of.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./Button-B8mqatRx.mjs";import"styled-components";import"./useActiveWallet-Bsy5GTCV.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CIgFwA7s.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-D0lpBS44.mjs";import"./Screen-BTyXgDrd.mjs";import"./ModalHeader-BLGC-7ev.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 u=({title:o,description:r,onClose:i})=>/*#__PURE__*/e(l,{title:o,subtitle:r,icon:t,iconVariant:"success",watermark:!0,onBack:i}),p={component:()=>{let{user:t}=r(),{closePrivyModal:l,isNewUserThisSession:p,updateWallets:d}=n(),{data:j,onUserCloseViaDialogOrKeybindRef:f}=i(),h=a(),{onSuccess:v,onFailure:C,callAuthOnSuccessOnClose:y}=j.createWallet,S=()=>{let e=s(t)??c(t);t&&e?(d(),v({user:t,account:e})):C(Error("Failed to create wallet")),l({shouldCallAuthOnSuccess:y})};return o((()=>{let e=setTimeout(S,m);return()=>clearTimeout(e)}),[]),f.current=S,/*#__PURE__*/e(u,{title:p?"Welcome"+(h?.name?` to ${h?.name}`:""):"All set!",description:p?"You've successfully created an account.":"Your account is secured.",onClose:S})}};export{p as EmbeddedWalletCreatedScreen,u as EmbeddedWalletCreatedScreenView,p as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{CheckCircle as t}from"lucide-react";import{useEffect as o}from"react";import{u as r,a as i,b as s,c}from"./get-is-unified-wallet-BS6IT5u_.mjs";import{u as a,r as m}from"./context-CA-h9Vvv.mjs";import{u as n}from"./internal-context-e-Eni5bG.mjs";import{S as l}from"./ScreenLayout-BxqiFpIo.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./Button-4Bq0SnG7.mjs";import"styled-components";import"./useActiveWallet-DbOGftJH.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-Dh2gc0UP.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-8CFi1gij.mjs";import"./Screen-bEIBY18A.mjs";import"./ModalHeader-C6mIKC4v.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 u=({title:o,description:r,onClose:i})=>/*#__PURE__*/e(l,{title:o,subtitle:r,icon:t,iconVariant:"success",watermark:!0,onBack:i}),p={component:()=>{let{user:t}=r(),{closePrivyModal:l,isNewUserThisSession:p,updateWallets:d}=n(),{data:j,onUserCloseViaDialogOrKeybindRef:f}=i(),h=a(),{onSuccess:v,onFailure:C,callAuthOnSuccessOnClose:y}=j.createWallet,S=()=>{let e=s(t)??c(t);t&&e?(d(),v({user:t,account:e})):C(Error("Failed to create wallet")),l({shouldCallAuthOnSuccess:y})};return o((()=>{let e=setTimeout(S,m);return()=>clearTimeout(e)}),[]),f.current=S,/*#__PURE__*/e(u,{title:p?"Welcome"+(h?.name?` to ${h?.name}`:""):"All set!",description:p?"You've successfully created an account.":"Your account is secured.",onClose:S})}};export{p as EmbeddedWalletCreatedScreen,u as EmbeddedWalletCreatedScreenView,p as default};
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useState as o,useEffect as i,useRef as n}from"react";import{styled as a}from"styled-components";import{constructURL as l}from"@privy-io/urls";import{W as d}from"./WarningBanner-BDp-QC9i.mjs";import{W as c}from"./WalletInfoCard-YE5P6CSV.mjs";import{u as s}from"./context-Bycd1SKV.mjs";import{u as p}from"./internal-context-e-Eni5bG.mjs";import{u as m,a as u}from"./get-is-unified-wallet-DvKS5IUO.mjs";import{S as h}from"./ScreenLayout-CddsD3Of.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"lucide-react";import"./Button-B8mqatRx.mjs";import"./useActiveWallet-Bsy5GTCV.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CIgFwA7s.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-D0lpBS44.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Address-BsvZLUXE.mjs";import"./shared-CtYf3O54.mjs";import"tinycolor2";import"ofetch";import"./Screen-BTyXgDrd.mjs";import"./ModalHeader-BLGC-7ev.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 y=({address:o,accessToken:i,appConfigTheme:n,onClose:a,isLoading:l=!1,exportButtonProps:s})=>/*#__PURE__*/e(h,{title:"Export wallet",subtitle:/*#__PURE__*/t(r,{children:["Copy either your private key or seed phrase to export your wallet."," ",/*#__PURE__*/e("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),onClose:a,watermark:!0,children:/*#__PURE__*/t(f,{children:[/*#__PURE__*/e(d,{theme:n,children:"Never share your private key or seed phrase with anyone."}),/*#__PURE__*/e(c,{title:"Your wallet",address:o,showCopyButton:!0}),/*#__PURE__*/e("div",{style:{width:"100%"},children:l?/*#__PURE__*/e(g,{}):i&&s&&/*#__PURE__*/e(w,{accessToken:i,dimensions:{height:"44px"},...s})})]})});let f=/*#__PURE__*/a.div.withConfig({displayName:"ContentContainer",componentId:"sc-b9fde557-0"})(["display:flex;flex-direction:column;gap:1.25rem;text-align:left;"]),g=()=>/*#__PURE__*/e(v,{children:/*#__PURE__*/e(x,{children:"Loading..."})}),v=/*#__PURE__*/a.div.withConfig({displayName:"PlaceholderContainer",componentId:"sc-b9fde557-1"})(["display:flex;gap:12px;height:44px;"]),x=/*#__PURE__*/a.div.withConfig({displayName:"PlaceholderButton",componentId:"sc-b9fde557-2"})(["display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:16px;font-weight:500;border-radius:var(--privy-border-radius-md);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);"]);function w(r){let[a,d]=o(r.dimensions.width),[c,s]=o(void 0),p=n(null);i((()=>{if(p.current&&void 0===a){let{width:e}=p.current.getBoundingClientRect();d(e)}let e=getComputedStyle(document.documentElement);s({background:e.getPropertyValue("--privy-color-background"),background2:e.getPropertyValue("--privy-color-background-2"),foreground3:e.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:e.getPropertyValue("--privy-color-foreground-accent"),accent:e.getPropertyValue("--privy-color-accent"),accentDark:e.getPropertyValue("--privy-color-accent-dark"),success:e.getPropertyValue("--privy-color-success"),colorScheme:e.getPropertyValue("color-scheme")})}),[]);let m="ethereum"===r.chainType&&!r.imported&&!r.isUnifiedWallet;/*#__PURE__*/return e("div",{ref:p,children:a&&
1
+ import{jsx as e,jsxs as t,Fragment as r}from"react/jsx-runtime";import{useState as o,useEffect as i,useRef as n}from"react";import{styled as a}from"styled-components";import{constructURL as l}from"@privy-io/urls";import{W as d}from"./WarningBanner-BDp-QC9i.mjs";import{W as c}from"./WalletInfoCard-6gQNu7Zz.mjs";import{u as s}from"./context-CA-h9Vvv.mjs";import{u as p}from"./internal-context-e-Eni5bG.mjs";import{u as m,a as u}from"./get-is-unified-wallet-BS6IT5u_.mjs";import{S as h}from"./ScreenLayout-BxqiFpIo.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"lucide-react";import"./Button-4Bq0SnG7.mjs";import"./useActiveWallet-DbOGftJH.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-Dh2gc0UP.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-8CFi1gij.mjs";import"./ErrorMessage-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Address-C4HUUkkd.mjs";import"./shared-CtYf3O54.mjs";import"tinycolor2";import"ofetch";import"./Screen-bEIBY18A.mjs";import"./ModalHeader-C6mIKC4v.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 y=({address:o,accessToken:i,appConfigTheme:n,onClose:a,isLoading:l=!1,exportButtonProps:s})=>/*#__PURE__*/e(h,{title:"Export wallet",subtitle:/*#__PURE__*/t(r,{children:["Copy either your private key or seed phrase to export your wallet."," ",/*#__PURE__*/e("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]}),onClose:a,watermark:!0,children:/*#__PURE__*/t(f,{children:[/*#__PURE__*/e(d,{theme:n,children:"Never share your private key or seed phrase with anyone."}),/*#__PURE__*/e(c,{title:"Your wallet",address:o,showCopyButton:!0}),/*#__PURE__*/e("div",{style:{width:"100%"},children:l?/*#__PURE__*/e(g,{}):i&&s&&/*#__PURE__*/e(w,{accessToken:i,dimensions:{height:"44px"},...s})})]})});let f=/*#__PURE__*/a.div.withConfig({displayName:"ContentContainer",componentId:"sc-b9fde557-0"})(["display:flex;flex-direction:column;gap:1.25rem;text-align:left;"]),g=()=>/*#__PURE__*/e(v,{children:/*#__PURE__*/e(x,{children:"Loading..."})}),v=/*#__PURE__*/a.div.withConfig({displayName:"PlaceholderContainer",componentId:"sc-b9fde557-1"})(["display:flex;gap:12px;height:44px;"]),x=/*#__PURE__*/a.div.withConfig({displayName:"PlaceholderButton",componentId:"sc-b9fde557-2"})(["display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:16px;font-weight:500;border-radius:var(--privy-border-radius-md);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);"]);function w(r){let[a,d]=o(r.dimensions.width),[c,s]=o(void 0),p=n(null);i((()=>{if(p.current&&void 0===a){let{width:e}=p.current.getBoundingClientRect();d(e)}let e=getComputedStyle(document.documentElement);s({background:e.getPropertyValue("--privy-color-background"),background2:e.getPropertyValue("--privy-color-background-2"),foreground3:e.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:e.getPropertyValue("--privy-color-foreground-accent"),accent:e.getPropertyValue("--privy-color-accent"),accentDark:e.getPropertyValue("--privy-color-accent-dark"),success:e.getPropertyValue("--privy-color-success"),colorScheme:e.getPropertyValue("color-scheme")})}),[]);let m="ethereum"===r.chainType&&!r.imported&&!r.isUnifiedWallet;/*#__PURE__*/return e("div",{ref:p,children:a&&
2
2
  /*#__PURE__*/t(b,{children:[/*#__PURE__*/e("iframe",{style:{position:"absolute",zIndex:1},width:a,height:r.dimensions.height,allow:"clipboard-write self *",src:l({origin:r.origin,path:`/apps/${r.appId}/embedded-wallets/export`,query:r.isUnifiedWallet?{v:"1-unified",wallet_id:r.walletId,client_id:r.appClientId,width:`${a}px`,caid:r.clientAnalyticsId,phrase_export:m,...c}:{v:"1",entropy_id:r.entropyId,entropy_id_verifier:r.entropyIdVerifier,hd_wallet_index:r.hdWalletIndex,chain_type:r.chainType,client_id:r.appClientId,width:`${a}px`,caid:r.clientAnalyticsId,phrase_export:m,...c},hash:{token:r.accessToken}})}),/*#__PURE__*/e(C,{children:"Loading..."}),m&&/*#__PURE__*/e(C,{children:"Loading..."})]})})}const I={component:()=>{let[t,r]=o(null),{authenticated:n,user:a}=m(),{closePrivyModal:l,createAnalyticsEvent:d,clientAnalyticsId:c,client:h}=p(),f=s(),{data:g,onUserCloseViaDialogOrKeybindRef:v}=u(),{onFailure:x,onSuccess:w,origin:I,appId:b,appClientId:C,entropyId:k,entropyIdVerifier:j,walletId:_,hdWalletIndex:A,chainType:P,address:T,isUnifiedWallet:V,imported:W}=g.keyExport,B=e=>{l({shouldCallAuthOnSuccess:!1}),x("string"==typeof e?Error(e):e)},L=()=>{l({shouldCallAuthOnSuccess:!1}),w(),d({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:T}})};return i((()=>{if(!n)return B("User must be authenticated before exporting their wallet");h.getAccessToken().then(r).catch(B)}),[n,a]),v.current=L,/*#__PURE__*/e(y,{address:T,accessToken:t,appConfigTheme:f.appearance.palette.colorScheme,onClose:L,isLoading:!t,exportButtonProps:t?{origin:I,appId:b,appClientId:C,clientAnalyticsId:c,entropyId:k,entropyIdVerifier:j,walletId:_,hdWalletIndex:A,isUnifiedWallet:V,imported:W,chainType:P}:void 0})}};let b=/*#__PURE__*/a.div.withConfig({displayName:"ButtonContainer",componentId:"sc-b9fde557-3"})(["overflow:visible;position:relative;overflow:none;height:44px;display:flex;gap:12px;"]),C=/*#__PURE__*/a.div.withConfig({displayName:"LoadingButton",componentId:"sc-b9fde557-4"})(["display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:16px;font-weight:500;border-radius:var(--privy-border-radius-md);background-color:var(--privy-color-background-2);color:var(--privy-color-foreground-3);"]);export{I as EmbeddedWalletKeyExportScreen,y as EmbeddedWalletKeyExportView,I as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{XCircle as t}from"lucide-react";import{useState as r,useEffect as o}from"react";import{u as a}from"./context-Bycd1SKV.mjs";import{s as i,k as s,E as l,R as n}from"./index-CCyaupaz.mjs";import{u as m,m as c}from"./internal-context-e-Eni5bG.mjs";import{u as d}from"./use-create-wallet-without-fallback-cSYr4rn8.mjs";import{a as u,u as p}from"./get-is-unified-wallet-DvKS5IUO.mjs";import{S as h}from"./ScreenLayout-CddsD3Of.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-Bsy5GTCV.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-CIgFwA7s.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-D0lpBS44.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-BaiIHGte.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-B8mqatRx.mjs";import"./Screen-BTyXgDrd.mjs";import"./ModalHeader-BLGC-7ev.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 w=({errorMessage:r,onClose:o})=>/*#__PURE__*/e(h,r?{title:"Something went wrong",subtitle:r,icon:t,iconVariant:"error",primaryCta:{label:"Close",onClick:o},watermark:!0}:{title:"Creating your wallet",subtitle:"Please wait...",iconVariant:"loading",watermark:!1}),y={component:()=>{let{setModalData:t,navigate:h,data:y,onUserCloseViaDialogOrKeybindRef:v}=u(),g=a(),[j,C]=r(""),{embeddedWallets:f}=a(),{authenticated:b,user:S}=p(),{closePrivyModal:x,walletProxy:W,client:O}=m(),{onSuccess:k,onFailure:A,callAuthOnSuccessOnClose:I,shouldCreateEth:M,shouldCreateSol:P}=y.createWallet,R="legacy-embedded-wallets-only"===g.embeddedWallets.mode&&!0===g?.embeddedWallets.requireUserOwnedRecoveryOnCreate,[U,E]=r(null),{create:L}=d(),T=M??(!!S&&i(S,g.embeddedWallets.ethereum.createOnLogin)),F=P??(!!S&&s(S,g.embeddedWallets.solana.createOnLogin)),D=new n((async()=>{let e=await O.getAccessToken();if(S&&e&&W)try{let e;if(T&&F)e=await L({chainType:"ethereum",walletIndex:0,latestUser:S}),e=await L({chainType:"solana",walletIndex:0,latestUser:e.user});else if(F)e=await L({chainType:"solana",walletIndex:0,latestUser:S});else{if(!T)return void x({shouldCallAuthOnSuccess:I});e=await L({chainType:"ethereum",walletIndex:0,latestUser:S})}E(e),h("EmbeddedWalletCreatedScreen")}catch(e){C(e.message)}}));return o((()=>b&&S?R?(t({...y,createWallet:{...y.createWallet,shouldCreateEth:T,shouldCreateSol:F},recoverySelection:{...y?.recoverySelection,isInAccountCreateFlow:!0,shouldCreateEth:T,shouldCreateSol:F}}),h(l({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:f.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void D.execute():(h("LandingScreen"),void A(Error("User must be authenticated before creating a Privy wallet")))),[R,b]),v.current=()=>null/*#__PURE__*/,e(w,{errorMessage:j||void 0,onClose:()=>{U?(k(U),x({shouldCallAuthOnSuccess:I})):(A(new c("User wallet creation failed")),x({shouldCallAuthOnSuccess:!1}))}})}};export{y as EmbeddedWalletOnAccountCreateScreen,w as EmbeddedWalletOnAccountCreateView,y as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{XCircle as t}from"lucide-react";import{useState as r,useEffect as o}from"react";import{u as a}from"./context-CA-h9Vvv.mjs";import{s as i,k as s,E as l,R as n}from"./index-Cq5UTy5I.mjs";import{u as m,m as c}from"./internal-context-e-Eni5bG.mjs";import{u as d}from"./use-create-wallet-without-fallback-DMlUsZUX.mjs";import{a as u,u as p}from"./get-is-unified-wallet-BS6IT5u_.mjs";import{S as h}from"./ScreenLayout-BxqiFpIo.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-DbOGftJH.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-Dh2gc0UP.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-8CFi1gij.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-1ClOITL9.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Button-4Bq0SnG7.mjs";import"./Screen-bEIBY18A.mjs";import"./ModalHeader-C6mIKC4v.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 w=({errorMessage:r,onClose:o})=>/*#__PURE__*/e(h,r?{title:"Something went wrong",subtitle:r,icon:t,iconVariant:"error",primaryCta:{label:"Close",onClick:o},watermark:!0}:{title:"Creating your wallet",subtitle:"Please wait...",iconVariant:"loading",watermark:!1}),y={component:()=>{let{setModalData:t,navigate:h,data:y,onUserCloseViaDialogOrKeybindRef:v}=u(),g=a(),[j,C]=r(""),{embeddedWallets:f}=a(),{authenticated:b,user:S}=p(),{closePrivyModal:x,walletProxy:W,client:O}=m(),{onSuccess:k,onFailure:A,callAuthOnSuccessOnClose:I,shouldCreateEth:M,shouldCreateSol:P}=y.createWallet,R="legacy-embedded-wallets-only"===g.embeddedWallets.mode&&!0===g?.embeddedWallets.requireUserOwnedRecoveryOnCreate,[U,E]=r(null),{create:L}=d(),T=M??(!!S&&i(S,g.embeddedWallets.ethereum.createOnLogin)),F=P??(!!S&&s(S,g.embeddedWallets.solana.createOnLogin)),D=new n((async()=>{let e=await O.getAccessToken();if(S&&e&&W)try{let e;if(T&&F)e=await L({chainType:"ethereum",walletIndex:0,latestUser:S}),e=await L({chainType:"solana",walletIndex:0,latestUser:e.user});else if(F)e=await L({chainType:"solana",walletIndex:0,latestUser:S});else{if(!T)return void x({shouldCallAuthOnSuccess:I});e=await L({chainType:"ethereum",walletIndex:0,latestUser:S})}E(e),h("EmbeddedWalletCreatedScreen")}catch(e){C(e.message)}}));return o((()=>b&&S?R?(t({...y,createWallet:{...y.createWallet,shouldCreateEth:T,shouldCreateSol:F},recoverySelection:{...y?.recoverySelection,isInAccountCreateFlow:!0,shouldCreateEth:T,shouldCreateSol:F}}),h(l({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:f.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void D.execute():(h("LandingScreen"),void A(Error("User must be authenticated before creating a Privy wallet")))),[R,b]),v.current=()=>null/*#__PURE__*/,e(w,{errorMessage:j||void 0,onClose:()=>{U?(k(U),x({shouldCallAuthOnSuccess:I})):(A(new c("User wallet creation failed")),x({shouldCallAuthOnSuccess:!1}))}})}};export{y as EmbeddedWalletOnAccountCreateScreen,w as EmbeddedWalletOnAccountCreateView,y as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as o,useEffect as r}from"react";import{u as t,a as s,g as a}from"./get-is-unified-wallet-DvKS5IUO.mjs";import{u as i}from"./context-Bycd1SKV.mjs";import{u as n,o as d,m as c}from"./internal-context-e-Eni5bG.mjs";import{g as l}from"./useWallets-D0lpBS44.mjs";import{S as m,g as p}from"./SetWalletPasswordForm-DvgKP4Ez.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./Layouts-Bmf8DxNP.mjs";import"styled-components";import"./ModalHeader-BLGC-7ev.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"./shared-rucIJmk0.mjs";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"./Button-B8mqatRx.mjs";import"./useActiveWallet-Bsy5GTCV.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CIgFwA7s.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./Checkbox-NmGCZeKL.mjs";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/solid/CheckCircleIcon";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/XCircleIcon";import"./ScreenHeader-Biz1wq02.mjs";const u={component:()=>{let[u,w]=o(null),[y,h]=o(!1),[v,g]=o(null),[f,M]=o(""),{authenticated:_,user:A}=t(),{client:I,walletProxy:j,refreshSessionAndUser:b,closePrivyModal:C,createAnalyticsEvent:R}=n(),{navigate:P,data:x,onUserCloseViaDialogOrKeybindRef:S}=s(),E=i(),{onSuccess:k,onFailure:D}=x.setWalletPassword,N=a(A),O="user-passcode"===u?.recoveryMethod,L="user-passcode"===N?.recoveryMethod;r((()=>{_||(P("LandingScreen"),D(new d("User must be authenticated before setting a password on a Privy wallet")))}),[_]);let T=()=>v?(D(v),void C({shouldCallAuthOnSuccess:!1})):O?(k(u),void C({shouldCallAuthOnSuccess:!1})):(D(new c("Exited before password was added to wallet")),void C({shouldCallAuthOnSuccess:!1}));S.current=T;/*#__PURE__*/return e(m,{appName:E?.name||"privy",config:{initiatedBy:"user",onCancel:T},error:v?"An error has occurred, please try again.":void 0,buttonLoading:y,buttonHideAnimations:!1,password:f,isResettingPassword:L,onPasswordGenerate:()=>M(p()),onPasswordChange:M,onSubmit:async()=>{O?(k(u),C({shouldCallAuthOnSuccess:!1})):(h(!0),g(null),await(async()=>{let e=await I.getAccessToken();if(e&&A&&N?.address&&f&&j)try{R({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:N.address,existingRecoveryMethod:N.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L}});let{entropyId:o,entropyIdVerifier:r}=l(A);if(!(await j.setRecovery({accessToken:e,entropyId:o,entropyIdVerifier:r,recoveryPassword:f,recoveryMethod:"user-passcode"})).entropyId)return g(new c("Error setting password on privy wallet")),void R({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:N.address,existingRecoveryMethod:N.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L,reason:"error setting password"}});let t=await b(),s=a(t);if(!s)return g(new c("Error setting password on privy wallet")),void R({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:N.address,existingRecoveryMethod:N.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L,reason:"wallet disconnected"}});w(s),R({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:N.address,existingRecoveryMethod:N.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L}})}catch(e){console.warn(e),g(e instanceof Error?e:Error("Error setting password on privy wallet")),R({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:N.address,reason:e}})}})(),h(!1))},onClose:T})}};export{u as EmbeddedWalletPasswordUpdateScreen,u as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{useState as o,useEffect as r}from"react";import{u as t,a as s,g as a}from"./get-is-unified-wallet-BS6IT5u_.mjs";import{u as i}from"./context-CA-h9Vvv.mjs";import{u as n,o as d,m as c}from"./internal-context-e-Eni5bG.mjs";import{g as l}from"./useWallets-8CFi1gij.mjs";import{S as m,g as p}from"./SetWalletPasswordForm-CjWJB429.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./Layouts-Bmf8DxNP.mjs";import"styled-components";import"./ModalHeader-C6mIKC4v.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"./shared-CnrDwY6g.mjs";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"./Button-4Bq0SnG7.mjs";import"./useActiveWallet-DbOGftJH.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-Dh2gc0UP.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./Checkbox-NmGCZeKL.mjs";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/solid/CheckCircleIcon";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/XCircleIcon";import"./ScreenHeader-Biz1wq02.mjs";const u={component:()=>{let[u,w]=o(null),[y,h]=o(!1),[v,g]=o(null),[f,M]=o(""),{authenticated:_,user:A}=t(),{client:I,walletProxy:j,refreshSessionAndUser:b,closePrivyModal:C,createAnalyticsEvent:R}=n(),{navigate:P,data:x,onUserCloseViaDialogOrKeybindRef:S}=s(),E=i(),{onSuccess:k,onFailure:D}=x.setWalletPassword,N=a(A),O="user-passcode"===u?.recoveryMethod,L="user-passcode"===N?.recoveryMethod;r((()=>{_||(P("LandingScreen"),D(new d("User must be authenticated before setting a password on a Privy wallet")))}),[_]);let T=()=>v?(D(v),void C({shouldCallAuthOnSuccess:!1})):O?(k(u),void C({shouldCallAuthOnSuccess:!1})):(D(new c("Exited before password was added to wallet")),void C({shouldCallAuthOnSuccess:!1}));S.current=T;/*#__PURE__*/return e(m,{appName:E?.name||"privy",config:{initiatedBy:"user",onCancel:T},error:v?"An error has occurred, please try again.":void 0,buttonLoading:y,buttonHideAnimations:!1,password:f,isResettingPassword:L,onPasswordGenerate:()=>M(p()),onPasswordChange:M,onSubmit:async()=>{O?(k(u),C({shouldCallAuthOnSuccess:!1})):(h(!0),g(null),await(async()=>{let e=await I.getAccessToken();if(e&&A&&N?.address&&f&&j)try{R({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:N.address,existingRecoveryMethod:N.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L}});let{entropyId:o,entropyIdVerifier:r}=l(A);if(!(await j.setRecovery({accessToken:e,entropyId:o,entropyIdVerifier:r,recoveryPassword:f,recoveryMethod:"user-passcode"})).entropyId)return g(new c("Error setting password on privy wallet")),void R({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:N.address,existingRecoveryMethod:N.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L,reason:"error setting password"}});let t=await b(),s=a(t);if(!s)return g(new c("Error setting password on privy wallet")),void R({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:N.address,existingRecoveryMethod:N.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L,reason:"wallet disconnected"}});w(s),R({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:N.address,existingRecoveryMethod:N.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:L}})}catch(e){console.warn(e),g(e instanceof Error?e:Error("Error setting password on privy wallet")),R({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:N.address,reason:e}})}})(),h(!1))},onClose:T})}};export{u as EmbeddedWalletPasswordUpdateScreen,u as default};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{Lock as r}from"lucide-react";import{u as i,m as s}from"./internal-context-e-Eni5bG.mjs";import{a}from"./get-is-unified-wallet-DvKS5IUO.mjs";import{S as n}from"./ScreenLayout-CddsD3Of.mjs";import"ofetch";import"react";import"viem";import"./context-Bycd1SKV.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./Button-B8mqatRx.mjs";import"styled-components";import"./useActiveWallet-Bsy5GTCV.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CIgFwA7s.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-D0lpBS44.mjs";import"./Screen-BTyXgDrd.mjs";import"./ModalHeader-BLGC-7ev.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 m=({onClose:i,onProceed:s})=>/*#__PURE__*/e(n,{title:"Secure Your Account",subtitle:/*#__PURE__*/o(t,{children:["Please set a password to secure your account.",/*#__PURE__*/e("br",{}),"Losing access to this password and this device will make your account inaccessible."]}),icon:r,primaryCta:{label:"Add password",onClick:s},onClose:i,watermark:!0}),c={component:()=>{let{closePrivyModal:o}=i(),{data:t,navigate:r,onUserCloseViaDialogOrKeybindRef:n}=a(),{onFailure:c}=t.setWalletPassword,l=()=>{c(new s("Exited before password was added to wallet")),o({shouldCallAuthOnSuccess:!1})};return n.current=l,/*#__PURE__*/e(m,{onClose:l,onProceed:()=>{r("EmbeddedWalletPasswordUpdateScreen")}})}};export{c as EmbeddedWalletPasswordUpdateSplashScreen,m as EmbeddedWalletPasswordUpdateSplashView,c as default};
1
+ import{jsx as e,jsxs as o,Fragment as t}from"react/jsx-runtime";import{Lock as r}from"lucide-react";import{u as i,m as s}from"./internal-context-e-Eni5bG.mjs";import{a}from"./get-is-unified-wallet-BS6IT5u_.mjs";import{S as n}from"./ScreenLayout-BxqiFpIo.mjs";import"ofetch";import"react";import"viem";import"./context-CA-h9Vvv.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./Button-4Bq0SnG7.mjs";import"styled-components";import"./useActiveWallet-DbOGftJH.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-Dh2gc0UP.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-8CFi1gij.mjs";import"./Screen-bEIBY18A.mjs";import"./ModalHeader-C6mIKC4v.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 m=({onClose:i,onProceed:s})=>/*#__PURE__*/e(n,{title:"Secure Your Account",subtitle:/*#__PURE__*/o(t,{children:["Please set a password to secure your account.",/*#__PURE__*/e("br",{}),"Losing access to this password and this device will make your account inaccessible."]}),icon:r,primaryCta:{label:"Add password",onClick:s},onClose:i,watermark:!0}),c={component:()=>{let{closePrivyModal:o}=i(),{data:t,navigate:r,onUserCloseViaDialogOrKeybindRef:n}=a(),{onFailure:c}=t.setWalletPassword,l=()=>{c(new s("Exited before password was added to wallet")),o({shouldCallAuthOnSuccess:!1})};return n.current=l,/*#__PURE__*/e(m,{onClose:l,onProceed:()=>{r("EmbeddedWalletPasswordUpdateScreen")}})}};export{c as EmbeddedWalletPasswordUpdateSplashScreen,m as EmbeddedWalletPasswordUpdateSplashView,c as default};