@privy-io/react-auth 3.11.1-beta-20260122161812 → 3.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (416) hide show
  1. package/dist/cjs/AccountNotFoundScreen-BBWWze9O.js +1 -0
  2. package/dist/cjs/{Address-BJFF-dMG.js → Address-6qDWL5TN.js} +4 -4
  3. package/dist/cjs/AffirmativeConsentScreen-CCwAwjH1.js +6 -0
  4. package/dist/cjs/AllowlistRejectionScreen-DEMYbzGA.js +1 -0
  5. package/dist/cjs/AuthenticateWithWalletScreen-dBvBC7MB.js +1 -0
  6. package/dist/cjs/AwaitingEvmToSolBridgingScreen-D9NwI47L.js +2 -0
  7. package/dist/cjs/AwaitingExternalEthereumTransferScreen-D_0NulpI.js +2 -0
  8. package/dist/cjs/AwaitingPasswordlessCodeScreen-B4HAKL4-.js +103 -0
  9. package/dist/cjs/AwaitingSolToEvmBridgingScreen-CnuLLTC0.js +2 -0
  10. package/dist/cjs/{BridgeNetworkSelectionView-BNv-V9G2.js → BridgeNetworkSelectionView-DKA06V8u.js} +11 -11
  11. package/dist/cjs/CaptchaScreen-N-ueJQF3.js +1 -0
  12. package/dist/cjs/CoinbaseOnrampStatusScreen-06yaO6r4.js +16 -0
  13. package/dist/cjs/ConnectEmailForm-DZrCSv9t.js +3 -0
  14. package/dist/cjs/ConnectLedgerScreen-C7vGQocf.js +9 -0
  15. package/dist/cjs/ConnectOnlyLandingScreen-_9y9kOsT.js +1 -0
  16. package/dist/cjs/ConnectOnlyStatusScreen-mZHx4a7S.js +1 -0
  17. package/dist/cjs/ConnectOrCreateScreen-Cp4uExOd.js +1 -0
  18. package/dist/cjs/{ConnectPhoneForm-C8JEoPHB.js → ConnectPhoneForm-BWSmRonl.js} +1 -1
  19. package/dist/cjs/{ConnectWalletView-bug4GgVZ.js → ConnectWalletView-Bh1DK9t5.js} +6 -6
  20. package/dist/cjs/ConnectionStatusScreen-B27DUsGt.js +7 -0
  21. package/dist/cjs/CrossAppAuthScreen-BbLFbCdU.js +1 -0
  22. package/dist/cjs/CustomLandingScreenView-DP1fJrBU.js +23 -0
  23. package/dist/cjs/DelegatedActionsConsentScreen-DzWruJOn.js +1 -0
  24. package/dist/cjs/DelegatedActionsRevokeScreen-D-TwUXyj.js +1 -0
  25. package/dist/cjs/EmbeddedWalletConnectingScreen-CYav4Mjb.js +1 -0
  26. package/dist/cjs/EmbeddedWalletCreatedScreen-m0t_c_AA.js +1 -0
  27. package/dist/cjs/EmbeddedWalletKeyExportScreen-_4GMdJuo.js +40 -0
  28. package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-B5-JBZRJ.js +1 -0
  29. package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-CITAy3i6.js +1 -0
  30. package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-DG5LKyjo.js +1 -0
  31. package/dist/cjs/{EnrollTotp-BpzRLjKc.js → EnrollTotp-leOB_B4o.js} +8 -8
  32. package/dist/cjs/ErrorScreen-xNDIVXx8.js +4 -0
  33. package/dist/cjs/{FarcasterConnectStatusScreen-DuOFuio7.js → FarcasterConnectStatusScreen-Bzmd4izn.js} +9 -9
  34. package/dist/cjs/FarcasterSignerStatusScreen-Cxoi54pp.js +29 -0
  35. package/dist/cjs/FundSolWalletWithExternalSolanaWallet-BCyBv_xe.js +2 -0
  36. package/dist/cjs/{FundWalletMethodHeader-Dn7FrcOp.js → FundWalletMethodHeader-YwNCXAU_.js} +1 -1
  37. package/dist/cjs/FundingEditAmountScreen-CDlb4Acx.js +1 -0
  38. package/dist/cjs/FundingMethodSelectionScreen-DlPxjsJq.js +1 -0
  39. package/dist/cjs/InAppBrowserLoginNotPossible-Bdx0vKyA.js +1 -0
  40. package/dist/cjs/InstallWalletScreen-Cshn01eK.js +1 -0
  41. package/dist/cjs/LandingScreen-0FdwpJ9w.js +1 -0
  42. package/dist/cjs/{LinkConflictScreen-8h7pmzsL.js → LinkConflictScreen-BCzS7Szr.js} +7 -7
  43. package/dist/cjs/LinkEmailScreen-B7rxdQso.js +1 -0
  44. package/dist/cjs/{LinkPasskeyScreen-cUu7WCqn.js → LinkPasskeyScreen-o4qdrAL3.js} +10 -10
  45. package/dist/cjs/LinkPhoneScreen-DweFqlM1.js +1 -0
  46. package/dist/cjs/LoginFailedScreen-mHcvCBEz.js +1 -0
  47. package/dist/cjs/ManualTransferScreen-CfYgtyLD.js +1 -0
  48. package/dist/cjs/MfaAuthEnrollmentFlowScreen-D631h0XW.js +1 -0
  49. package/dist/cjs/MfaAuthVerifyFlowScreen-BZ3IyqAd.js +1 -0
  50. package/dist/cjs/MfaEnrollmentFlowScreen-_tNeX5lT.js +1 -0
  51. package/dist/cjs/MfaVerifyFlowScreen-D_7nkuBq.js +1 -0
  52. package/dist/cjs/{ModalHeader-7knkCFjH.js → ModalHeader-C5O9gNUP.js} +1 -1
  53. package/dist/cjs/{MoonpayStatusScreen-BWA_sZnz.js → MoonpayStatusScreen-DoFbZ_0d.js} +3 -3
  54. package/dist/cjs/OAuthStatusScreen-BZY7BiP5.js +1 -0
  55. package/dist/cjs/PasskeySelectSignupOrLogin-C3k_ixTz.js +1 -0
  56. package/dist/cjs/PasskeyStatusScreen-BX-SOBDr.js +3 -0
  57. package/dist/cjs/PasswordRecoveryScreen-VZQDtt5v.js +20 -0
  58. package/dist/cjs/{QrCode-DPcePk5I.js → QrCode-CLd3Ytk7.js} +3 -3
  59. package/dist/cjs/RecoveryOAuthStatusScreen-DKYx6ECd.js +1 -0
  60. package/dist/cjs/RecoveryPasswordCreateScreen-DP0xOBMA.js +1 -0
  61. package/dist/cjs/RecoverySelectionScreen-Bw9_M6y0.js +7 -0
  62. package/dist/cjs/{Screen-uapp8UP4.js → Screen-BSwlHqPg.js} +4 -4
  63. package/dist/cjs/{ScreenLayout-BENEZm1m.js → ScreenLayout-BtVIYAso.js} +1 -1
  64. package/dist/cjs/SetAutomaticRecoveryScreen-SUOUjBk4.js +14 -0
  65. package/dist/cjs/{SetWalletPasswordForm-NMSn8MW-.js → SetWalletPasswordForm-Gkq-DskE.js} +3 -3
  66. package/dist/cjs/SignRequestScreen-BNcy6yU_.js +26 -0
  67. package/dist/cjs/{StandardSignAndSendTransactionScreen-C0Af9uPz.js → StandardSignAndSendTransactionScreen-z_EUNaeD.js} +3 -3
  68. package/dist/cjs/TelegramAuthScreen-DV8KYJMX.js +1 -0
  69. package/dist/cjs/{TransactionDetails-BCQvuSov.js → TransactionDetails-DYow9ihU.js} +4 -4
  70. package/dist/cjs/{TransactionErrorView-DhdW4Ka8.js → TransactionErrorView-yUMJqqF2.js} +4 -4
  71. package/dist/cjs/TransferFromWalletScreen-Duk7CEcq.js +31 -0
  72. package/dist/cjs/TransferOrBridgeLoadingScreen-DuBLyfE1.js +6 -0
  73. package/dist/cjs/UpdateEmailScreen-DRJv5CZs.js +1 -0
  74. package/dist/cjs/UpdatePhoneScreen-C3myqOv0.js +1 -0
  75. package/dist/cjs/UserLimitReachedScreen-l_e6Vhr0.js +1 -0
  76. package/dist/cjs/{WalletInfoCard-DLnujds6.js → WalletInfoCard-CHEynRZS.js} +4 -4
  77. package/dist/cjs/{WalletInterstitialScreen-CMMSgAk9.js → WalletInterstitialScreen-BgoDwKIp.js} +1 -1
  78. package/dist/cjs/WalletLink-CZLtiI7E.js +22 -0
  79. package/dist/cjs/WalletOverflowButton-FlgoA77a.js +1 -0
  80. package/dist/cjs/abstract-smart-wallets.js +1 -1
  81. package/dist/cjs/{context-P14IM76D.js → context-BeSQM-Ma.js} +1 -1
  82. package/dist/cjs/ethers-XrYC9HG-.js +1 -0
  83. package/dist/cjs/extended-chains.js +1 -1
  84. package/dist/cjs/farcaster.js +1 -1
  85. package/dist/cjs/frame-Oz7volks.js +1 -0
  86. package/dist/cjs/{get-is-unified-wallet-DL_nMXp5.js → get-is-unified-wallet-BwdzQwn_.js} +1 -1
  87. package/dist/cjs/getErc20Balance-CN3JMVjF.js +1 -0
  88. package/dist/cjs/getErc20TokenInfo-DxDd_HN6.js +1 -0
  89. package/dist/cjs/getPublicClient-BsmZyCGX.js +1 -0
  90. package/dist/cjs/index-0-2WrPDo.js +12 -0
  91. package/dist/cjs/index-CzmnSRoa.js +174 -0
  92. package/dist/cjs/{index-BypMyGGH.js → index-W2ZSukRW.js} +1 -1
  93. package/dist/cjs/index.js +1 -1
  94. package/dist/cjs/{internal-context-NWsAL807.js → internal-context-BJv4f_bO.js} +1 -1
  95. package/dist/cjs/internal.js +1 -1
  96. package/dist/cjs/prepareFundingModalData-DDf6xLze.js +1 -0
  97. package/dist/cjs/{reservoir-CQGyEBb7.js → reservoir-Bx0HQwbb.js} +1 -1
  98. package/dist/cjs/{shared-CoZLntA9.js → shared-BcueHfN-.js} +6 -6
  99. package/dist/cjs/shouldProceedtoEmbeddedWalletCreationFlow-j6p9PEm-.js +1 -0
  100. package/dist/cjs/smart-wallets-BBh3vgRq.js +1 -0
  101. package/dist/cjs/smart-wallets.js +1 -1
  102. package/dist/cjs/solana.js +1 -1
  103. package/dist/cjs/{styles-DtykMHfN.js → styles-Csarwypj.js} +1 -1
  104. package/dist/cjs/to-ui-error-C4aac_aM.js +4 -0
  105. package/dist/cjs/ui.js +37 -37
  106. package/dist/cjs/use-export-wallet-C9HWu0Dq.js +1 -0
  107. package/dist/cjs/{use-sign-with-user-signer-BcAsQTGF.js → use-sign-with-user-signer-Cu_6Bx7m.js} +1 -1
  108. package/dist/cjs/useActiveWallet-vlXeDPzp.js +185 -0
  109. package/dist/cjs/{useGetSolPrice-C986iVoO.js → useGetSolPrice-Ca32VAbF.js} +1 -1
  110. package/dist/cjs/{useGetTokenPrice-cA2TnAzD.js → useGetTokenPrice-DJpJnTij.js} +1 -1
  111. package/dist/cjs/{useI18n-D4jKEXmt.js → useI18n-CnsBjm9v.js} +1 -1
  112. package/dist/cjs/usePrivy-Bx2PKTrU.js +1 -0
  113. package/dist/cjs/{useSolanaRpcClient-hHdPoMRE.js → useSolanaRpcClient-CYMWkK7E.js} +1 -1
  114. package/dist/cjs/useWalletBalance-DI8AY31i.js +1 -0
  115. package/dist/cjs/useWallets-BwB7ALB8.js +1 -0
  116. package/dist/cjs/useWallets-DMyuB5aJ.js +1 -0
  117. package/dist/dts/{events-context-vKnpI7Js.d.mts → events-context-DeukTtar.d.mts} +1 -1
  118. package/dist/dts/{events-context-vKnpI7Js.d.ts → events-context-DeukTtar.d.ts} +1 -1
  119. package/dist/dts/extended-chains.d.mts +1 -1
  120. package/dist/dts/extended-chains.d.ts +1 -1
  121. package/dist/dts/farcaster.d.mts +1 -1
  122. package/dist/dts/farcaster.d.ts +1 -1
  123. package/dist/dts/index.d.mts +40 -4
  124. package/dist/dts/index.d.ts +40 -4
  125. package/dist/dts/internal.d.mts +1 -1
  126. package/dist/dts/internal.d.ts +1 -1
  127. package/dist/dts/smart-wallets.d.mts +1 -1
  128. package/dist/dts/smart-wallets.d.ts +1 -1
  129. package/dist/dts/solana.d.mts +3 -3
  130. package/dist/dts/solana.d.ts +3 -3
  131. package/dist/dts/{types-DAzgcrBH.d.mts → types-FifkyCQc.d.mts} +2 -1
  132. package/dist/dts/{types-DAzgcrBH.d.ts → types-FifkyCQc.d.ts} +2 -1
  133. package/dist/dts/ui.d.mts +1 -1
  134. package/dist/dts/ui.d.ts +1 -1
  135. package/dist/esm/AccountNotFoundScreen-C6S8_GyN.mjs +1 -0
  136. package/dist/esm/Address-QmAVCQtO.mjs +17 -0
  137. package/dist/esm/AffirmativeConsentScreen-QfJBfI_f.mjs +6 -0
  138. package/dist/esm/AllowlistRejectionScreen-CX57yv4U.mjs +1 -0
  139. package/dist/esm/AuthenticateWithWalletScreen-CZJ-aWhZ.mjs +1 -0
  140. package/dist/esm/AwaitingEvmToSolBridgingScreen-C1CMtT4Y.mjs +2 -0
  141. package/dist/esm/AwaitingExternalEthereumTransferScreen-DX91STcF.mjs +2 -0
  142. package/dist/esm/AwaitingPasswordlessCodeScreen-BuExr50N.mjs +103 -0
  143. package/dist/esm/AwaitingSolToEvmBridgingScreen-Bm1i_2qW.mjs +2 -0
  144. package/dist/esm/BridgeNetworkSelectionView-DQGcampg.mjs +69 -0
  145. package/dist/esm/CaptchaScreen-B-hFDb5f.mjs +1 -0
  146. package/dist/esm/CoinbaseOnrampStatusScreen-OHm2RUBv.mjs +16 -0
  147. package/dist/esm/ConnectEmailForm-Df5OtmDR.mjs +3 -0
  148. package/dist/esm/ConnectLedgerScreen-BHLYW-F3.mjs +9 -0
  149. package/dist/esm/ConnectOnlyLandingScreen-C6nzEwpN.mjs +1 -0
  150. package/dist/esm/ConnectOnlyStatusScreen-CremlXDY.mjs +1 -0
  151. package/dist/esm/ConnectOrCreateScreen-262UvCdD.mjs +1 -0
  152. package/dist/esm/{ConnectPhoneForm-C1eL0VZH.mjs → ConnectPhoneForm-BMtTIItD.mjs} +1 -1
  153. package/dist/esm/{ConnectWalletView-BtuPwm-c.mjs → ConnectWalletView-BMjEKo1_.mjs} +6 -6
  154. package/dist/esm/ConnectionStatusScreen-mk5beBL7.mjs +7 -0
  155. package/dist/esm/CrossAppAuthScreen-BXjEJQv6.mjs +1 -0
  156. package/dist/esm/CustomLandingScreenView-BlDfJaDr.mjs +23 -0
  157. package/dist/esm/DelegatedActionsConsentScreen-ANmQe-9G.mjs +1 -0
  158. package/dist/esm/DelegatedActionsRevokeScreen-D9X7mWmI.mjs +1 -0
  159. package/dist/esm/EmbeddedWalletConnectingScreen-2g-RrIvW.mjs +1 -0
  160. package/dist/esm/EmbeddedWalletCreatedScreen-BXTAv4_-.mjs +1 -0
  161. package/dist/esm/EmbeddedWalletKeyExportScreen-DYVHVHOj.mjs +40 -0
  162. package/dist/esm/EmbeddedWalletOnAccountCreateScreen-CYyMoMFF.mjs +1 -0
  163. package/dist/esm/EmbeddedWalletPasswordUpdateScreen-oT5ZcPQV.mjs +1 -0
  164. package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-BQcHDyuV.mjs +1 -0
  165. package/dist/esm/{EnrollTotp-Bk2mWeF6.mjs → EnrollTotp-DVLg14UT.mjs} +8 -8
  166. package/dist/esm/ErrorScreen-CLfeO5pd.mjs +4 -0
  167. package/dist/esm/{FarcasterConnectStatusScreen-CHItJej_.mjs → FarcasterConnectStatusScreen-CUO9DKCJ.mjs} +7 -7
  168. package/dist/esm/FarcasterSignerStatusScreen-B135UOnV.mjs +28 -0
  169. package/dist/esm/FundSolWalletWithExternalSolanaWallet-DO3ttgom.mjs +1 -0
  170. package/dist/esm/{FundWalletMethodHeader-B3nAPYAR.mjs → FundWalletMethodHeader-PIxwFzzh.mjs} +1 -1
  171. package/dist/esm/FundingEditAmountScreen-BRQb2ffL.mjs +1 -0
  172. package/dist/esm/FundingMethodSelectionScreen-DTt1Z5RI.mjs +1 -0
  173. package/dist/esm/InAppBrowserLoginNotPossible-DH96QD2c.mjs +1 -0
  174. package/dist/esm/InstallWalletScreen-PnK6VfrP.mjs +1 -0
  175. package/dist/esm/LandingScreen-D_EvjOHf.mjs +1 -0
  176. package/dist/esm/{LinkConflictScreen-DmFrdpwb.mjs → LinkConflictScreen-B94e_-2N.mjs} +7 -7
  177. package/dist/esm/LinkEmailScreen-CT8gAQr3.mjs +1 -0
  178. package/dist/esm/LinkPasskeyScreen-DYfWSjKR.mjs +105 -0
  179. package/dist/esm/LinkPhoneScreen-ccrKA6tf.mjs +1 -0
  180. package/dist/esm/LoginFailedScreen-BwgxhbMf.mjs +1 -0
  181. package/dist/esm/ManualTransferScreen-DgCG2P3B.mjs +1 -0
  182. package/dist/esm/MfaAuthEnrollmentFlowScreen-CNVUTOnE.mjs +1 -0
  183. package/dist/esm/MfaAuthVerifyFlowScreen-2nvvFipu.mjs +1 -0
  184. package/dist/esm/MfaEnrollmentFlowScreen-DfnIqNNU.mjs +1 -0
  185. package/dist/esm/MfaVerifyFlowScreen-BwerwBz5.mjs +1 -0
  186. package/dist/esm/{ModalHeader-cnW8OaHH.mjs → ModalHeader-rCMpqA2a.mjs} +4 -4
  187. package/dist/esm/MoonpayStatusScreen-D5fRCEb3.mjs +16 -0
  188. package/dist/esm/OAuthStatusScreen-DtLgYw89.mjs +1 -0
  189. package/dist/esm/PasskeySelectSignupOrLogin-QoPhmagh.mjs +1 -0
  190. package/dist/esm/PasskeyStatusScreen-DzjU3ZVT.mjs +3 -0
  191. package/dist/esm/PasswordRecoveryScreen-LZYGRBkP.mjs +20 -0
  192. package/dist/esm/{QrCode-BVe4kf2z.mjs → QrCode-DjnQgnaZ.mjs} +3 -3
  193. package/dist/esm/RecoveryOAuthStatusScreen-DKfp8Udh.mjs +1 -0
  194. package/dist/esm/RecoveryPasswordCreateScreen-D4DI5Bom.mjs +1 -0
  195. package/dist/esm/RecoverySelectionScreen-B2V3518x.mjs +7 -0
  196. package/dist/esm/{Screen-DgjLPjok.mjs → Screen-CV2tt2Ap.mjs} +11 -11
  197. package/dist/esm/{ScreenLayout-x3-Xgy2E.mjs → ScreenLayout-DF3DCKOK.mjs} +1 -1
  198. package/dist/esm/SetAutomaticRecoveryScreen-C6cFVbSx.mjs +14 -0
  199. package/dist/esm/{SetWalletPasswordForm-Deqef3mc.mjs → SetWalletPasswordForm-ChA4tW4Y.mjs} +4 -4
  200. package/dist/esm/SignRequestScreen-BslfKJ1N.mjs +26 -0
  201. package/dist/esm/{StandardSignAndSendTransactionScreen-BGAjDFes.mjs → StandardSignAndSendTransactionScreen-D4OBsj5k.mjs} +3 -3
  202. package/dist/esm/TelegramAuthScreen-BJq5f_Rq.mjs +1 -0
  203. package/dist/esm/{TransactionDetails-8R96szrm.mjs → TransactionDetails-BP142O9n.mjs} +4 -4
  204. package/dist/esm/TransactionErrorView-BwwGMqSj.mjs +166 -0
  205. package/dist/esm/TransferFromWalletScreen-BHH0YcI4.mjs +31 -0
  206. package/dist/esm/TransferOrBridgeLoadingScreen-VLQTcf_6.mjs +6 -0
  207. package/dist/esm/UpdateEmailScreen-CMFBvYz5.mjs +1 -0
  208. package/dist/esm/UpdatePhoneScreen-DmhHcNq3.mjs +1 -0
  209. package/dist/esm/UserLimitReachedScreen-DNqgCf3B.mjs +1 -0
  210. package/dist/esm/{WalletInfoCard-CR6-S95l.mjs → WalletInfoCard-ChBHG5L5.mjs} +3 -3
  211. package/dist/esm/WalletInterstitialScreen-RS89fm6t.mjs +1 -0
  212. package/dist/esm/WalletLink-CN4enmsE.mjs +22 -0
  213. package/dist/esm/WalletOverflowButton-B-nEN4GW.mjs +1 -0
  214. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  215. package/dist/esm/context-LVpDfP2H.mjs +1 -0
  216. package/dist/esm/ethers-BQ45eiVv.mjs +1 -0
  217. package/dist/esm/extended-chains.mjs +1 -1
  218. package/dist/esm/farcaster.mjs +1 -1
  219. package/dist/esm/{frame-cjQkGswH.mjs → frame-uzTmvtww.mjs} +1 -1
  220. package/dist/esm/get-is-unified-wallet-CNcx75Dp.mjs +1 -0
  221. package/dist/esm/getErc20Balance-DA4dGV9O.mjs +1 -0
  222. package/dist/esm/getErc20TokenInfo-CxatSwzi.mjs +1 -0
  223. package/dist/esm/getPublicClient-B4uPLKn-.mjs +1 -0
  224. package/dist/esm/{index-0TRQs0PD.mjs → index-2knYP69D.mjs} +3 -3
  225. package/dist/esm/index-DNz_w3-G.mjs +174 -0
  226. package/dist/esm/{index-Cp1MRWbr.mjs → index-DoasOxbi.mjs} +1 -1
  227. package/dist/esm/index.mjs +1 -1
  228. package/dist/esm/{internal-context-D4S2Sfvt.mjs → internal-context-Z-fyxadS.mjs} +1 -1
  229. package/dist/esm/internal.mjs +1 -1
  230. package/dist/esm/{paths-BzM95ysC.mjs → paths-3HW55qZg.mjs} +1 -1
  231. package/dist/esm/prepareFundingModalData-DjTxAoJ1.mjs +1 -0
  232. package/dist/esm/reservoir-0wfhnc0j.mjs +1 -0
  233. package/dist/esm/{shared-C0CllI3K.mjs → shared-DwO5pr5t.mjs} +1 -1
  234. package/dist/esm/shouldProceedtoEmbeddedWalletCreationFlow-Cv_C9s3_.mjs +1 -0
  235. package/dist/esm/smart-wallets-9LKzbfWj.mjs +1 -0
  236. package/dist/esm/smart-wallets.mjs +1 -1
  237. package/dist/esm/solana.mjs +1 -1
  238. package/dist/esm/{styles-Fji1ReGu.mjs → styles-BNn7MnP1.mjs} +1 -1
  239. package/dist/esm/to-ui-error-CCqAdorW.mjs +4 -0
  240. package/dist/esm/ui.mjs +37 -37
  241. package/dist/esm/use-export-wallet-DllHf-2F.mjs +1 -0
  242. package/dist/esm/{use-sign-with-user-signer--95w9BaG.mjs → use-sign-with-user-signer-Do5Oi_rb.mjs} +1 -1
  243. package/dist/esm/useActiveWallet-RZ4w-uGq.mjs +185 -0
  244. package/dist/esm/{useGetSolPrice-usp7QcwI.mjs → useGetSolPrice-DwwjjGbd.mjs} +1 -1
  245. package/dist/esm/{useGetTokenPrice-DgKSvh6T.mjs → useGetTokenPrice-DERdsrmf.mjs} +1 -1
  246. package/dist/esm/{useI18n-DleS41MU.mjs → useI18n-Dk9y58cU.mjs} +1 -1
  247. package/dist/esm/usePrivy-Dj52a5sp.mjs +1 -0
  248. package/dist/esm/useSolanaRpcClient-B7UDPdLi.mjs +1 -0
  249. package/dist/esm/useWalletBalance-CRXiZUj2.mjs +1 -0
  250. package/dist/esm/useWallets-DlGuNtGR.mjs +1 -0
  251. package/dist/esm/useWallets-cSQYA-Jk.mjs +1 -0
  252. package/package.json +6 -6
  253. package/dist/cjs/AccountNotFoundScreen-Clo67iWH.js +0 -1
  254. package/dist/cjs/AffirmativeConsentScreen-2FGovWDj.js +0 -6
  255. package/dist/cjs/AllowlistRejectionScreen-BLcPF2_b.js +0 -1
  256. package/dist/cjs/AuthenticateWithWalletScreen-ByOwd0gq.js +0 -1
  257. package/dist/cjs/AwaitingEvmToSolBridgingScreen-D_dh3tgw.js +0 -2
  258. package/dist/cjs/AwaitingExternalEthereumTransferScreen-CB4SnTRS.js +0 -2
  259. package/dist/cjs/AwaitingPasswordlessCodeScreen-D43lCvaw.js +0 -103
  260. package/dist/cjs/AwaitingSolToEvmBridgingScreen-ppOL2XCp.js +0 -2
  261. package/dist/cjs/CaptchaScreen-oTaZlLej.js +0 -1
  262. package/dist/cjs/CoinbaseOnrampStatusScreen-CO97CoDr.js +0 -16
  263. package/dist/cjs/ConnectEmailForm-DAA-nxD6.js +0 -3
  264. package/dist/cjs/ConnectLedgerScreen-3SrqHJBl.js +0 -9
  265. package/dist/cjs/ConnectOnlyLandingScreen-DkR-VnS2.js +0 -1
  266. package/dist/cjs/ConnectOnlyStatusScreen-Cafk-5gS.js +0 -1
  267. package/dist/cjs/ConnectOrCreateScreen-DttF-fCs.js +0 -1
  268. package/dist/cjs/ConnectionStatusScreen-BfU_d8ZK.js +0 -7
  269. package/dist/cjs/CrossAppAuthScreen-Bs_x-Isw.js +0 -1
  270. package/dist/cjs/CustomLandingScreenView-B93ZDqp2.js +0 -23
  271. package/dist/cjs/DelegatedActionsConsentScreen-Cx5lj2BJ.js +0 -1
  272. package/dist/cjs/DelegatedActionsRevokeScreen-BEucV6g6.js +0 -1
  273. package/dist/cjs/EmbeddedWalletConnectingScreen-BjZ_7QsX.js +0 -1
  274. package/dist/cjs/EmbeddedWalletCreatedScreen-CbmJzZZL.js +0 -1
  275. package/dist/cjs/EmbeddedWalletKeyExportScreen-CdMuowdD.js +0 -40
  276. package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-C_EBP_oR.js +0 -1
  277. package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-DQhHO_tI.js +0 -1
  278. package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-C1dTDHuI.js +0 -1
  279. package/dist/cjs/ErrorScreen-CPDISQKp.js +0 -4
  280. package/dist/cjs/FarcasterSignerStatusScreen-BYnokloK.js +0 -29
  281. package/dist/cjs/FundSolWalletWithExternalSolanaWallet-D-pMJTgQ.js +0 -2
  282. package/dist/cjs/FundingEditAmountScreen-CGYBcgzY.js +0 -1
  283. package/dist/cjs/FundingMethodSelectionScreen-32rXIiuR.js +0 -1
  284. package/dist/cjs/InAppBrowserLoginNotPossible-Wz6tWwN4.js +0 -1
  285. package/dist/cjs/InstallWalletScreen-C6na1HMV.js +0 -1
  286. package/dist/cjs/LandingScreen-GYoGjPT7.js +0 -1
  287. package/dist/cjs/LinkEmailScreen-Bz6DBn1S.js +0 -1
  288. package/dist/cjs/LinkPhoneScreen-BFB7atSV.js +0 -1
  289. package/dist/cjs/LoginFailedScreen-C3X4o4W8.js +0 -1
  290. package/dist/cjs/ManualTransferScreen-Bx5GRcIk.js +0 -1
  291. package/dist/cjs/MfaAuthEnrollmentFlowScreen-D8DE5e8S.js +0 -1
  292. package/dist/cjs/MfaAuthVerifyFlowScreen-BeJSdbHB.js +0 -1
  293. package/dist/cjs/MfaEnrollmentFlowScreen-0X-6htEq.js +0 -1
  294. package/dist/cjs/MfaVerifyFlowScreen-BgdY97r7.js +0 -1
  295. package/dist/cjs/OAuthStatusScreen-DZbrwgcX.js +0 -1
  296. package/dist/cjs/PasskeySelectSignupOrLogin-DWW-VE2d.js +0 -1
  297. package/dist/cjs/PasskeyStatusScreen-DiieGaFn.js +0 -3
  298. package/dist/cjs/PasswordRecoveryScreen-OhRzyQhB.js +0 -20
  299. package/dist/cjs/RecoveryOAuthStatusScreen-DPPwIU7C.js +0 -1
  300. package/dist/cjs/RecoveryPasswordCreateScreen-Bg-E6CB6.js +0 -1
  301. package/dist/cjs/RecoverySelectionScreen-CauE_byN.js +0 -7
  302. package/dist/cjs/SetAutomaticRecoveryScreen-59UByZZC.js +0 -14
  303. package/dist/cjs/SignRequestScreen-CYQvIjLY.js +0 -26
  304. package/dist/cjs/TelegramAuthScreen-DxghStcs.js +0 -1
  305. package/dist/cjs/TransferFromWalletScreen-DSMlo8kv.js +0 -31
  306. package/dist/cjs/TransferOrBridgeLoadingScreen-D9t_WQ5r.js +0 -6
  307. package/dist/cjs/UpdateEmailScreen-CrTIJ16u.js +0 -1
  308. package/dist/cjs/UpdatePhoneScreen-DQzmlkOL.js +0 -1
  309. package/dist/cjs/UserLimitReachedScreen-BQxNahAD.js +0 -1
  310. package/dist/cjs/WalletLink-Bg4We2eg.js +0 -22
  311. package/dist/cjs/WalletOverflowButton-aYewWDKS.js +0 -1
  312. package/dist/cjs/ethers-BlKEtatO.js +0 -1
  313. package/dist/cjs/frame-BmNfc9mp.js +0 -1
  314. package/dist/cjs/getErc20Balance-CP3UfGGz.js +0 -1
  315. package/dist/cjs/getErc20TokenInfo-CVfH_czS.js +0 -1
  316. package/dist/cjs/index-LczlN1Dt.js +0 -12
  317. package/dist/cjs/private-privy-provider-hH9v0z7o.js +0 -358
  318. package/dist/cjs/shouldProceedtoEmbeddedWalletCreationFlow-Cp0BucAr.js +0 -1
  319. package/dist/cjs/smart-wallets-DUl8PaqV.js +0 -1
  320. package/dist/cjs/state-DMsGOICm.js +0 -1
  321. package/dist/cjs/stripUrlOAuthParamsAndRemoveStateCode-2iUOCDfo.js +0 -1
  322. package/dist/cjs/to-ui-error-caFMQ6I1.js +0 -4
  323. package/dist/cjs/use-create-wallet-without-fallback-CrxEFfhb.js +0 -1
  324. package/dist/cjs/use-export-wallet-DeI8q3KQ.js +0 -1
  325. package/dist/cjs/useActiveWallet-BySNV0ev.js +0 -1
  326. package/dist/cjs/useLogout-zT9OSxoO.js +0 -1
  327. package/dist/cjs/useMfa-KC6CWm9H.js +0 -1
  328. package/dist/cjs/useMfaEnrollment-DA9sTwf_.js +0 -1
  329. package/dist/cjs/useWalletBalance-8waYUAmD.js +0 -1
  330. package/dist/cjs/useWallets-2ejSMVGq.js +0 -1
  331. package/dist/esm/AccountNotFoundScreen-Cn6aKFIC.mjs +0 -1
  332. package/dist/esm/Address-CDF4d_Ha.mjs +0 -17
  333. package/dist/esm/AffirmativeConsentScreen-DwMHTAWp.mjs +0 -6
  334. package/dist/esm/AllowlistRejectionScreen-CtVeBy5G.mjs +0 -1
  335. package/dist/esm/AuthenticateWithWalletScreen-CqqsqfqZ.mjs +0 -1
  336. package/dist/esm/AwaitingEvmToSolBridgingScreen-CLkDS6o-.mjs +0 -2
  337. package/dist/esm/AwaitingExternalEthereumTransferScreen-Is2FdGJS.mjs +0 -2
  338. package/dist/esm/AwaitingPasswordlessCodeScreen-CAwXjOBS.mjs +0 -103
  339. package/dist/esm/AwaitingSolToEvmBridgingScreen-BDhpWAv1.mjs +0 -2
  340. package/dist/esm/BridgeNetworkSelectionView-C5xaiL3n.mjs +0 -69
  341. package/dist/esm/CaptchaScreen-CZCosLCJ.mjs +0 -1
  342. package/dist/esm/CoinbaseOnrampStatusScreen-DxbYHDRy.mjs +0 -16
  343. package/dist/esm/ConnectEmailForm-c2xnQzqc.mjs +0 -3
  344. package/dist/esm/ConnectLedgerScreen-CmspFZG8.mjs +0 -9
  345. package/dist/esm/ConnectOnlyLandingScreen-JXhxU6Je.mjs +0 -1
  346. package/dist/esm/ConnectOnlyStatusScreen-CZO6dxUB.mjs +0 -1
  347. package/dist/esm/ConnectOrCreateScreen-DHwSpwLa.mjs +0 -1
  348. package/dist/esm/ConnectionStatusScreen-d8tOwFAz.mjs +0 -7
  349. package/dist/esm/CrossAppAuthScreen-CNvQYKBN.mjs +0 -1
  350. package/dist/esm/CustomLandingScreenView-82pnUZOi.mjs +0 -23
  351. package/dist/esm/DelegatedActionsConsentScreen-D2cB2Jqt.mjs +0 -1
  352. package/dist/esm/DelegatedActionsRevokeScreen-DIdnDrIo.mjs +0 -1
  353. package/dist/esm/EmbeddedWalletConnectingScreen-DNDkMjZg.mjs +0 -1
  354. package/dist/esm/EmbeddedWalletCreatedScreen-6rmCkBPR.mjs +0 -1
  355. package/dist/esm/EmbeddedWalletKeyExportScreen-CrrImf0B.mjs +0 -40
  356. package/dist/esm/EmbeddedWalletOnAccountCreateScreen-MTCypdEY.mjs +0 -1
  357. package/dist/esm/EmbeddedWalletPasswordUpdateScreen-o-ONaPrc.mjs +0 -1
  358. package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-BpRZwJZg.mjs +0 -1
  359. package/dist/esm/ErrorScreen-C891Rurl.mjs +0 -4
  360. package/dist/esm/FarcasterSignerStatusScreen-P3NEju7D.mjs +0 -28
  361. package/dist/esm/FundSolWalletWithExternalSolanaWallet-CGZdr_3E.mjs +0 -1
  362. package/dist/esm/FundingEditAmountScreen-B0MYigL_.mjs +0 -1
  363. package/dist/esm/FundingMethodSelectionScreen-CNJYvozR.mjs +0 -1
  364. package/dist/esm/InAppBrowserLoginNotPossible-CVyW-cIh.mjs +0 -1
  365. package/dist/esm/InstallWalletScreen-Bfo00Txs.mjs +0 -1
  366. package/dist/esm/LandingScreen-tAGl1tss.mjs +0 -1
  367. package/dist/esm/LinkEmailScreen-C_G_4bbm.mjs +0 -1
  368. package/dist/esm/LinkPasskeyScreen-DhD51WvM.mjs +0 -105
  369. package/dist/esm/LinkPhoneScreen-Bi5gcAMm.mjs +0 -1
  370. package/dist/esm/LoginFailedScreen-DbAdNYji.mjs +0 -1
  371. package/dist/esm/ManualTransferScreen-CR2QvdVh.mjs +0 -1
  372. package/dist/esm/MfaAuthEnrollmentFlowScreen-BEotfobF.mjs +0 -1
  373. package/dist/esm/MfaAuthVerifyFlowScreen-Cygjr5sH.mjs +0 -1
  374. package/dist/esm/MfaEnrollmentFlowScreen-jupYBcsQ.mjs +0 -1
  375. package/dist/esm/MfaVerifyFlowScreen-B8ONcY5T.mjs +0 -1
  376. package/dist/esm/MoonpayStatusScreen-BjmXS-jc.mjs +0 -16
  377. package/dist/esm/OAuthStatusScreen-YcgvWTtC.mjs +0 -1
  378. package/dist/esm/PasskeySelectSignupOrLogin-Db4EFSYE.mjs +0 -1
  379. package/dist/esm/PasskeyStatusScreen-CR-3RNXX.mjs +0 -3
  380. package/dist/esm/PasswordRecoveryScreen-BnD1OdcX.mjs +0 -20
  381. package/dist/esm/RecoveryOAuthStatusScreen-DhLx5fOQ.mjs +0 -1
  382. package/dist/esm/RecoveryPasswordCreateScreen-BHOh-fE-.mjs +0 -1
  383. package/dist/esm/RecoverySelectionScreen-1seYQLsM.mjs +0 -7
  384. package/dist/esm/SetAutomaticRecoveryScreen-CZLgLNlt.mjs +0 -14
  385. package/dist/esm/SignRequestScreen-EwmYkZZk.mjs +0 -26
  386. package/dist/esm/TelegramAuthScreen-BMWr2M6a.mjs +0 -1
  387. package/dist/esm/TransactionErrorView-CcY_O062.mjs +0 -166
  388. package/dist/esm/TransferFromWalletScreen-BTsyTZMc.mjs +0 -31
  389. package/dist/esm/TransferOrBridgeLoadingScreen-DZ1diPi7.mjs +0 -6
  390. package/dist/esm/UpdateEmailScreen-DyXsKvGA.mjs +0 -1
  391. package/dist/esm/UpdatePhoneScreen-erzZ8qOI.mjs +0 -1
  392. package/dist/esm/UserLimitReachedScreen-CfiHSh4t.mjs +0 -1
  393. package/dist/esm/WalletInterstitialScreen-DCg6fl5S.mjs +0 -1
  394. package/dist/esm/WalletLink-CTp4jR2d.mjs +0 -22
  395. package/dist/esm/WalletOverflowButton-i2nGLvV0.mjs +0 -1
  396. package/dist/esm/context-i_OKSUqt.mjs +0 -1
  397. package/dist/esm/ethers-Cr0T35kS.mjs +0 -1
  398. package/dist/esm/get-is-unified-wallet-Bon2jknh.mjs +0 -1
  399. package/dist/esm/getErc20Balance-BDNkB-EL.mjs +0 -1
  400. package/dist/esm/getErc20TokenInfo-79BQbhYn.mjs +0 -1
  401. package/dist/esm/private-privy-provider-B2_rZ8aq.mjs +0 -358
  402. package/dist/esm/reservoir-DNdkSA7R.mjs +0 -1
  403. package/dist/esm/shouldProceedtoEmbeddedWalletCreationFlow-CDHNJbN9.mjs +0 -1
  404. package/dist/esm/smart-wallets-BNt96zAq.mjs +0 -1
  405. package/dist/esm/state-BG13el3v.mjs +0 -1
  406. package/dist/esm/stripUrlOAuthParamsAndRemoveStateCode-9jsyCRfN.mjs +0 -1
  407. package/dist/esm/to-ui-error-C46oK5ox.mjs +0 -4
  408. package/dist/esm/use-create-wallet-without-fallback-CY32SGw2.mjs +0 -1
  409. package/dist/esm/use-export-wallet-CWry8VMl.mjs +0 -1
  410. package/dist/esm/useActiveWallet-D-T43q8N.mjs +0 -1
  411. package/dist/esm/useLogout-CHtNPDaK.mjs +0 -1
  412. package/dist/esm/useMfa-D20h0FBp.mjs +0 -1
  413. package/dist/esm/useMfaEnrollment-BOyHpB2c.mjs +0 -1
  414. package/dist/esm/useSolanaRpcClient-O9yIYVIZ.mjs +0 -1
  415. package/dist/esm/useWalletBalance-CMO_I7jz.mjs +0 -1
  416. package/dist/esm/useWallets-B3ZcS4km.mjs +0 -1
@@ -1,7 +0,0 @@
1
- import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useRef as o,useEffect as a,useState as i,useCallback as r}from"react";import{isMobile as c}from"react-device-detect";import{styled as l}from"styled-components";import{aa as s,ad as d,ae as u,af as m,f as p,ab as g,a7 as w,ag as h,ah as S,ai as y,ac as f,aj as C,ak as v}from"./private-privy-provider-B2_rZ8aq.mjs";import{L as b}from"./Link-DJ5gq9Di.mjs";import{a as T,q as _}from"./context-i_OKSUqt.mjs";import{u as E}from"./useI18n-DleS41MU.mjs";import{isHex as R,getAddress as k}from"viem";import{a as A,u as I,k as L}from"./internal-context-D4S2Sfvt.mjs";import{u as W,a as U}from"./get-is-unified-wallet-Bon2jknh.mjs";import{s as O}from"./shouldProceedtoEmbeddedWalletCreationFlow-CDHNJbN9.mjs";import{S as j}from"./ScreenLayout-x3-Xgy2E.mjs";import"mipd";import"viem/utils";import"@privy-io/js-sdk-core";import"@privy-io/popup";import"./paths-BzM95ysC.mjs";import"@scure/base";import"uuid";import"jose";import"eventemitter3";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"ofetch";import"js-cookie";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";import"tinycolor2";import"./ModalHeader-cnW8OaHH.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"./Screen-DgjLPjok.mjs";import"./index-Dq_xe9dz.mjs";const N=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter((e=>R(e,{strict:!0}))).map((e=>k(e)));return!!t?.length&&!!e?.linkedAccounts.filter((e=>"wallet"==e.type&&t.includes(e.address))).length};const M=e=>e?.privyErrorCode===A.LINKED_TO_ANOTHER_USER?s.ERROR_USER_EXISTS:e instanceof d&&!e.details.default?e.details:e instanceof u?s.ERROR_TIMED_OUT:e?.privyErrorCode===A.CANNOT_LINK_MORE_OF_TYPE?s.ERROR_USER_LIMIT_REACHED:s.ERROR_WALLET_CONNECTION,x=({walletLogo:o,title:a,subtitle:i,signSuccess:r,errorMessage:c,connectSuccess:l,separateConnectAndSign:d,signing:u,walletConnectRedirectUri:m,walletConnectFallbackUniversalUri:p,hasTabbedAway:g,showCoinbaseWalletResetCta:w,numRetries:h,onBack:S,onSign:y,onRetry:f,onCoinbaseReset:C,onDifferentWallet:v})=>{let{t:T}=E(),_=w?{label:"Use a different wallet",onClick:C,disabled:r}:c===s.ERROR_USER_EXISTS&&S?{label:"Use a different wallet",onClick:v}:l&&!r&&d?{label:u?"Signing":"Sign with your wallet",onClick:y,disabled:u}:!r&&c?.retryable&&h<2?{label:"Retry",onClick:f,disabled:!1}:r||c?void 0:{label:T("connectionStatus.connecting"),onClick:()=>{},disabled:!0};/*#__PURE__*/return e(j,{title:a,subtitle:i,icon:o,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!c},primaryCta:_,onBack:S,watermark:!0,children:!l&&m&&!g&&/*#__PURE__*/t(F,{children:[T("connectionStatus.stillHere")," ",/*#__PURE__*/e(b,{href:m,target:"_blank",variant:"underlined",size:"sm",children:T("connectionStatus.tryConnectingAgain")}),p&&/*#__PURE__*/t(n,{children:[" ",T("connectionStatus.or")," ",/*#__PURE__*/e(b,{href:p,target:"_blank",variant:"underlined",size:"sm",children:T("connectionStatus.useDifferentLink")})]})]})})},D={component:()=>{let t,[n,l]=i(!1),[d,u]=i(!1),[b,R]=i(void 0),{authenticated:k,logout:j}=W(),{navigate:D,navigateBack:F,lastScreen:B,currentScreen:q,setModalData:H,data:X}=U(),z=T(),{t:K}=E(),{getAuthFlow:P,walletConnectionStatus:Y,closePrivyModal:Q,initLoginWithWallet:J,loginWithWallet:V,updateWallets:$,createAnalyticsEvent:G}=I(),{walletConnectors:Z}=W(),[ee,te]=i(0),{user:ne}=W(),oe=m(),[ae]=i(ne?.linkedAccounts.length||0),[ie,re]=i(""),[ce,le]=i(""),[se,de]=i(!1),{hasTabbedAway:ue}=function(){let[e,t]=i(!1),n=r((()=>{document.hidden&&t(!0)}),[]);return a((()=>(document.addEventListener("visibilitychange",n),()=>document.removeEventListener("visibilitychange",n))),[n]),{hasTabbedAway:e,reset:()=>t(!1)}}(),{enabled:me,token:pe}=p(),ge=g(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;a((()=>{let e=P(),t=e instanceof v||e instanceof h?e:void 0;he&&"solana"===Y.connector?.chainType&&"phantom"===Y.connector?.walletClientType&&oe(w)&&void 0===X?.login?.isSigningInWithLedgerSolana?D("ConnectLedgerScreen",!1):(he&&!t&&(!me||pe||k?J(Y.connectedWallet,pe,X?.login?.disableSignup,X?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})):(H({captchaModalData:{callback:e=>J(Y.connectedWallet,e,X?.login?.disableSignup,X?.login?.isSigningInWithLedgerSolana?"transaction":"plain").then((()=>{de(!0)})),userIntentRequired:!1,onSuccessNavigateTo:"ConnectionStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),D("CaptchaScreen",!1))),t instanceof h&&X?.login?.isSigningInWithLedgerSolana&&(t.messageType="transaction"),t&&we&&he&&!t.preparedMessage?t.buildMessage():t&&!we&&he&&(d||(async()=>{u(!0),R(void 0);try{"wallet_connect_v2"===Y?.connector?.connectorType&&"metamask"===Y?.connector?.walletClientType&&await S(2500),await fe()}catch(e){console.warn("Auto-prompted signature failed",e)}finally{u(!1)}})()))}),[ee,he,se]),a((()=>{if(ne&&n){let e=_-500;if(z?.legal.requireUsersAcceptTerms&&!ne.hasAcceptedTerms){let t=setTimeout((()=>{D("AffirmativeConsentScreen")}),e);return()=>clearTimeout(t)}if(O(ne,z.embeddedWallets)){let t=setTimeout((()=>{H({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),G({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"ConnectionStatusScreen"}}),j()},callAuthOnSuccessOnClose:!0}}),D("EmbeddedWalletOnAccountCreateScreen")}),e);return()=>clearTimeout(t)}$();let t=setTimeout((()=>Q({shouldCallAuthOnSuccess:!0,isSuccess:!0})),_);return()=>clearTimeout(t)}}),[ne,n]);let ye=e=>{if(e?.privyErrorCode!==A.ALLOWLIST_REJECTED){if(e?.privyErrorCode===A.USER_LIMIT_REACHED)return console.error(new L(e).toString()),void D("UserLimitReachedScreen");if(e?.privyErrorCode!==A.USER_DOES_NOT_EXIST)return e?.privyErrorCode===A.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce?(H({accountTransfer:{nonce:e.data?.data?.nonce,account:P()?.meta.address,displayName:e.data?.data?.account?.displayName,externalWalletMetadata:{walletClientType:P()?.meta.walletClientType,chainId:P()?.meta.chainId,connectorType:P()?.meta.connectorType},linkMethod:P()instanceof v?"siwe":"siws",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void D("LinkConflictScreen")):void R(M(e));D("AccountNotFoundScreen")}else D("AllowlistRejectionScreen")};async function fe(){try{await V(),l(!0)}catch(e){ye(e)}finally{u(!1)}}a((()=>{Y?.connectError&&ye(Y?.connectError)}),[Y]),((e,t)=>{let n=o((()=>{}));a((()=>{n.current=e})),a((()=>{if(null!==t){let e=setInterval((()=>n.current()),t||0);return()=>clearInterval(e)}}),[t])})((()=>{let e="wallet_connect_v2"===Ce&&Y?.connector instanceof y?Y.connector.redirectUri:void 0;e&&re(e);let t="wallet_connect_v2"===Ce&&Y?.connector instanceof y?Y.connector.fallbackUniversalRedirectUri:void 0;t&&le(t)}),Y?.connector instanceof y&&!ie?500:null);let Ce=Y?.connector?.connectorType||"injected",ve=Y?.connector?.walletClientType||"unknown",be=ge?.metadata?.shortName||ge?.name||Y?.connector?.walletBranding.name||"Browser Extension",Te=ge?.image_url?.md||Y?.connector?.walletBranding.icon||(t=>/*#__PURE__*/e(f,{...t})),_e="Browser Extension"===be?be.toLowerCase():be;t=n?K("connectionStatus.successfullyConnected",{walletName:_e}):b?K("connectionStatus.errorTitle",{errorMessage:b.message}):Se?"Switching networks":he?d&&we?"Signing":"Sign to verify":`Waiting for ${_e}`;let Ee=K("connectionStatus.checkOtherWindows");n?Ee=ae===(ne?.linkedAccounts.length||0)?"Wallet was already linked.":"You're good to go!":ee>=2&&b?Ee="Unable to connect wallet":b?Ee=b.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"===ve&&c?Ee="Click continue to open and connect MetaMask.":"metamask"===ve?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?C()||(Ee=N(ne)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Confirm in the Coinbase app/popup to continue."):X?.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"===ve&&(N(ne)||b===s.ERROR_USER_EXISTS);/*#__PURE__*/return e(x,{walletLogo:Te,title:t,subtitle:Ee,signSuccess:n,errorMessage:b,connectSuccess:he,separateConnectAndSign:we,signing:d,walletConnectRedirectUri:ie,walletConnectFallbackUniversalUri:ce,hasTabbedAway:ue,showCoinbaseWalletResetCta:ke,numRetries:ee,onBack:B&&q!==B?F:void 0,onSign:()=>{u(!0),fe()},onRetry:()=>{te(ee+1),R(void 0),he?(u(!0),fe()):Y?.connectRetry()},onCoinbaseReset:()=>{Re&&Re?.disconnect()},onDifferentWallet:F})}};let F=l.p`
2
- text-align: center;
3
- color: var(--privy-color-foreground-2);
4
- font-size: 14px;
5
- line-height: 22px;
6
- margin: 16px 0;
7
- `;export{D as ConnectionStatusScreen,x as ConnectionStatusView,D as default,M as getErrorDetails};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useMemo as t,useState as o,useEffect as r}from"react";import{a,q as i}from"./context-i_OKSUqt.mjs";import{al as s}from"./private-privy-provider-B2_rZ8aq.mjs";import{u as n,P as c,h as l,a as p}from"./internal-context-D4S2Sfvt.mjs";import{a as m}from"./get-is-unified-wallet-Bon2jknh.mjs";import{u as d}from"./useLogout-CHtNPDaK.mjs";import{s as u}from"./shouldProceedtoEmbeddedWalletCreationFlow-CDHNJbN9.mjs";import{S as f}from"./ScreenLayout-x3-Xgy2E.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-BzM95ysC.mjs";import"@scure/base";import"viem";import"uuid";import"jose";import"eventemitter3";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"ofetch";import"js-cookie";import"styled-components";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";import"./ModalHeader-cnW8OaHH.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"./Screen-DgjLPjok.mjs";import"./index-Dq_xe9dz.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:y,updateWallets:S,closePrivyModal:j,createAnalyticsEvent:w}=n(),{logout:b}=d(),[C,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 y({appId:e,popup:U.popup,action:U.action,disableSignup:U.disableSignup});I({data:t})}catch(e){if(e instanceof c)I({error:e});else if(e instanceof l){if(e.privyErrorCode===p.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})})),E=()=>{C.data&&(S(),U?.onSuccess(C.data),j({shouldCallAuthOnSuccess:!0,isSuccess:!0})),U?.onError(C.error??new c("User canceled flow")),j({shouldCallAuthOnSuccess:!1,isSuccess:!1})};return g.current=E,r((()=>{U?.appId?.length&&k.execute(U.appId)}),[U?.appId]),r((()=>{if(!C.data)return;let e=C.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"}}),b()},callAuthOnSuccessOnClose:!0}}),v("EmbeddedWalletOnAccountCreateScreen")}),i);return()=>clearTimeout(e)}let o=setTimeout(E,i);return()=>clearTimeout(o)}),[C.data]),U?.appId?/*#__PURE__*/e(h,{providerApp:{id:U?.appId,logoUrl:U?.logoUrl,name:U?.name},success:!!C.data,error:C.error,onClose:E}):(console.warn("Missing data for Screen"),null)},isShownBeforeReady:!0};export{v as CrossAppAuthScreen,h as CrossAppAuthScreenView,v as default};
@@ -1,23 +0,0 @@
1
- import{jsx as e,jsxs as t,Fragment as a}from"react/jsx-runtime";import i from"@heroicons/react/24/outline/UserCircleIcon";import l,{useState as 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-cnW8OaHH.mjs";import{a as u}from"./context-i_OKSUqt.mjs";import{ap as g,Y as m,aq as f,ar as y,f as w,V as v,as as C,at as b,au as k,av as S,aw as T,ax as M,ay as x,az as A,aA as L,aB as W}from"./private-privy-provider-B2_rZ8aq.mjs";import{u as E}from"./internal-context-D4S2Sfvt.mjs";import{u as I,a as P,i as N}from"./get-is-unified-wallet-Bon2jknh.mjs";import{u as j,c as D,d as O}from"./ConnectWalletView-BtuPwm-c.mjs";import{Mail as R,Smartphone as V,UserCircle as _}from"lucide-react";import{C as U}from"./ConnectEmailForm-c2xnQzqc.mjs";import{C as F}from"./Chip-D2-wZOHJ.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 q from"@heroicons/react/24/outline/FingerPrintIcon";import{L as G}from"./Link-DJ5gq9Di.mjs";import{C as B}from"./ConnectPhoneForm-C1eL0VZH.mjs";import{T as K,a as Q,I as X,S as Y,L as Z,G as J,b as ee,D as te,A as ae}from"./twitter-BoAxhlj6.mjs";import{T as ie,L as le}from"./twitch-5IOe4sIQ.mjs";import{T as re}from"./telegram-B-JqnkqZ.mjs";import{W as ne}from"./WalletOverflowButton-i2nGLvV0.mjs";import{S as oe}from"./ScreenLayout-x3-Xgy2E.mjs";const se=()=>{let t=u(),a=t?.appearance?.logo,i=`${t?.name} logo`,r={maxHeight:"90px",maxWidth:"180px"};return a?"string"==typeof a?/*#__PURE__*/e("img",{src:a,alt:i,style:r}):"svg"===a.type||"img"===a.type?/*#__PURE__*/l.cloneElement(a,{alt:i,style:r}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null},ce=c.div`
2
- display: flex;
3
- flex-direction: column;
4
- align-items: center;
5
- padding: 24px 0;
6
- flex-grow: 1;
7
- justify-content: center;
8
- `,de=({name:t,logoUrl:a,size:i="38px"})=>"string"==typeof a?/*#__PURE__*/e("img",{src:a,alt:`${t??"Provider app"} logo`,style:{width:i,height:i,maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):
9
- /*#__PURE__*/e("span",{}),pe=({appId:i})=>{let[l,o]=r(void 0),{startCrossAppAuthFlow:s,authenticated:c}=I(),{data:d}=P(),{client:p}=E();return n((()=>{(async()=>{p&&o(await p.getCrossAppProviderDetails(i))})()}),[p]),/*#__PURE__*/e(g,{onClick:()=>s({appId:i,action:c?"link":"login",disableSignup:d?.login?.disableSignup}),disabled:!l,children:l?/*#__PURE__*/t(a,{children:[/*#__PURE__*/e(de,{name:l.name,logoUrl:l.icon_url||void 0,size:"24px"})," ",l.name]}):/*#__PURE__*/e(m,{})})},he=({isEditable:i,setIsEditable:l,defaultValue:r})=>{let n=o(null);/*#__PURE__*/return t(a,{children:[/*#__PURE__*/e(f,{$if:!i,children:/*#__PURE__*/e(U,{ref:n,defaultValue:r})}),/*#__PURE__*/e(f,{$if:i,children:/*#__PURE__*/t(g,{onClick:()=>{l(),setTimeout((()=>{n.current?.focus()}),0)},children:[/*#__PURE__*/e(y,{children:/*#__PURE__*/e(R,{})}),"Continue with Email"]})})]})},ue=()=>{let[a,i]=r(!1),{currentScreen:l,navigate:n,setModalData:o,data:s}=P(),{enabled:c,token:d}=w(),{initLoginWithFarcaster:p}=E(),{accountType:h}=v();/*#__PURE__*/return t(g,{onClick:async()=>{i(!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{i(!1)}},disabled:!1,children:[/*#__PURE__*/e($,{width:32,height:32})," Farcaster",a&&/*#__PURE__*/e(m,{}),"farcaster"===h&&/*#__PURE__*/e(ge,{color:"gray",children:"Recent"})]})};let ge=c(F)`
10
- margin-left: auto;
11
- `;const me=({...a})=>/*#__PURE__*/t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...a,children:[/*#__PURE__*/t("g",{clipPath:"url(#clip0_2856_1743)",children:[/*#__PURE__*/e("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),/*#__PURE__*/e("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),/*#__PURE__*/e("defs",{children:/*#__PURE__*/e("clipPath",{id:"clip0_2856_1743",children:/*#__PURE__*/e("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]}),fe=({chainType:a,withPadding:i})=>{let l="";return l="ethereum-only"===a||"ethereum-and-solana"===a?"Rainbow, Phantom, or Coinbase Wallet":"Phantom or Solflare",/*#__PURE__*/e(C,{$withPadding:i,children:/*#__PURE__*/t(b,{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")},ye=()=>{let{enabled:a,token:i}=w(),{navigate:l,setModalData:r,data:n}=P(),o=u(),{initLoginWithPasskey:c}=E(),d=()=>{o.loginConfig.passkeysForSignupEnabled?l("PasskeySelectSignupOrLogin"):(async()=>{a&&!i?(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:i}),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(q,{})," Continue with passkey"]}):/*#__PURE__*/e(G,{as:"button",onClick:d,size:"sm",variant:"navigation",style:{width:"100%",justifyContent:"center"},children:"I have a passkey"})},we=({isEditable:i,setIsEditable:l,defaultValue:r})=>{let n=o(null),{authenticated:s}=I(),{navigate:c,setModalData:d,currentScreen:p,data:h}=P(),{initLoginWithSms:m}=E(),{enabled:v,token:C}=w(),{whatsAppEnabled:b}=u();/*#__PURE__*/return t(a,{children:[/*#__PURE__*/e(f,{$if:!i,children:/*#__PURE__*/e(B,{ref:n,onSubmit:async function({qualifiedPhoneNumber:e}){if(!v||C||s)try{await m({phoneNumber:e,captchaToken:C,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:i,children:/*#__PURE__*/t(g,{onClick:()=>{l(),setTimeout((()=>{n.current?.focus()}),0)},children:[/*#__PURE__*/e(y,{children:/*#__PURE__*/e(V,{})}),"Continue with ",b?"WhatsApp":"SMS"]})})]})};let ve={apple:{logo:ae,displayName:"Apple"},discord:{logo:te,displayName:"Discord"},github:{logo:ee,displayName:"GitHub"},google:{logo:J,displayName:"Google"},linkedin:{logo:Z,displayName:"LinkedIn"},spotify:{logo:Y,displayName:"Spotify"},instagram:{logo:X,displayName:"Instagram"},twitter:{logo:Q,displayName:"Twitter"},tiktok:{logo:K,displayName:"TikTok"},line:{logo:le,displayName:"LINE"},twitch:{logo:ie,displayName:"Twitch"}};const Ce=({provider:a})=>{let{enabled:i,token:l}=w(),{navigate:n,setModalData:o,data:c}=P(),[d,p]=r(!1),h=u(),{initLoginWithOAuth:m}=E(),{accountType:f}=v(),C=s((()=>f&&"guest"!==f&&"authorization_key"!==f&&"cross_app"!==f?k(f):null),[f]),{displayName:b,logo:S}=s((()=>{if(N(a)){let t=h.customOAuthProviders.find((e=>e.provider===a)),i=t.provider_icon_url,l=t.provider_display_name;return{displayName:l,logo:({style:t})=>/*#__PURE__*/e("img",{alt:`${l} logo`,src:i,style:t})}}return ve[a]}),[a,h.customOAuthProviders]);/*#__PURE__*/return t(g,{onClick:()=>{p(!0),setTimeout((()=>{p(!1)}),2e3),i&&!l?(o({captchaModalData:{callback:e=>m(a,e,c?.login?.disableSignup),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ErrorScreen"}}),n("CaptchaScreen")):m(a,void 0,c?.login?.disableSignup)},disabled:d,children:[/*#__PURE__*/e(y,{$fullSize:!0,children:/*#__PURE__*/e(S,{style:{width:"32px",height:"32px"}})}),b,C?.loginMethod===a&&/*#__PURE__*/e(be,{color:"gray",children:"Recent"})]})};let be=c(F)`
12
- margin-left: auto;
13
- `;const ke=()=>{let{enabled:a,token:i}=w(),{navigate:l,setModalData:n,data:o}=P(),[s,c]=r(!1),{initLoginWithTelegram:d}=E(),{accountType:p}=v();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),a&&!i)return n({captchaModalData:{callback:h,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ErrorScreen"}}),void l("CaptchaScreen");await h(i)},disabled:s,children:[/*#__PURE__*/e(re,{width:32,height:32}),"Telegram","telegram"===p&&/*#__PURE__*/e(Se,{color:"gray",children:"Recent"})]})};let Se=c(F)`
14
- margin-left: auto;
15
- `;const Te=({onClick:a,text:i,icon:l})=>/*#__PURE__*/t(g,{onClick:a,children:[/*#__PURE__*/e(y,{children:l}),/*#__PURE__*/e(S,{children:i})]}),Me=({connectOnly:i})=>{let{closePrivyModal:l}=E(),{data:o,setModalData:c,onUserCloseViaDialogOrKeybindRef:p,navigate:h}=P(),g=u(),m=o?.login,f=g.appearance.walletList,y=m?.walletChainType??g.appearance.walletChainType,{accountType:w,walletClientType:C,chainType:b}=v(),S=s((()=>w&&"guest"!==w&&"authorization_key"!==w&&"cross_app"!==w?k(w):null),[w]),{email:x,sms:A,google:L,twitter:W,discord:I,github:R,spotify:V,instagram:_,tiktok:U,line:F,twitch:$,linkedin:H,apple:q,wallet:G,farcaster:B,telegram:K}=s((()=>m?.loginMethods?z(m.loginMethods,!0):null),[m])??g.loginMethods,{wallets:Q}=j({enabled:T(G?f:[]),walletList:f,walletChainType:y}),X=g.customOAuthProviders,Y=g.crossAppProviders,{passkey:Z}=g.loginMethods,J=[x&&"email",A&&"sms",L&&"google",W&&"twitter",I&&"discord",R&&"github",V&&"spotify",_&&"instagram",U&&"tiktok",F&&"line",$&&"twitch",H&&"linkedin",q&&"apple",B&&"farcaster",K&&"telegram",...X.map((e=>e.provider)),...Y].filter((e=>!!e)),ee=J.length>0,te=s((()=>G&&!ee?"web3-first":G&&g?.appearance.loginGroupPriority||"web2-first"),[G,ee,g?.appearance.loginGroupPriority]),ae=g?.appearance.hideDirectWeb2Inputs,[ie,le]=r("default"),[re,ce]=r(Ie({mostRecentlyUsedAccountType:w,smsAvailable:A,emailAvailable:x,prefilledType:m?.prefill?.type}));n((()=>{ce(Ie({mostRecentlyUsedAccountType:w,smsAvailable:A,emailAvailable:x,prefilledType:m?.prefill?.type}))}),[x,A,w]);let de=()=>{l({shouldCallAuthOnSuccess:!0}),setTimeout((()=>{le("default")}),150)};p.current=de;let ge=[];C&&G?ge.push(C):S?.loginMethod&&J.includes(S.loginMethod)&&ge.push(S.loginMethod);let me=t=>{if("email"===t)/*#__PURE__*/return e(he,{isEditable:"email"===re,setIsEditable:()=>{ce("email")},defaultValue:"email"===m?.prefill?.type?m.prefill.value:void 0},t);if("sms"===t)/*#__PURE__*/return e(we,{isEditable:"sms"===re,setIsEditable:()=>{ce("sms")},defaultValue:"phone"===m?.prefill?.type?m.prefill.value:void 0},t);if("apple"===t)/*#__PURE__*/return e(Ce,{provider:"apple"},t);if("discord"===t)/*#__PURE__*/return e(Ce,{provider:"discord"},t);if("farcaster"===t)/*#__PURE__*/return e(ue,{},t);if("github"===t)/*#__PURE__*/return e(Ce,{provider:"github"},t);if("google"===t)/*#__PURE__*/return e(Ce,{provider:"google"},t);if("linkedin"===t)/*#__PURE__*/return e(Ce,{provider:"linkedin"},t);if("tiktok"===t)/*#__PURE__*/return e(Ce,{provider:"tiktok"},t);if("line"===t)/*#__PURE__*/return e(Ce,{provider:"line"},t);if("twitch"===t)/*#__PURE__*/return e(Ce,{provider:"twitch"},t);if("spotify"===t)/*#__PURE__*/return e(Ce,{provider:"spotify"},t);if("instagram"===t)/*#__PURE__*/return e(Ce,{provider:"instagram"},t);if("twitter"===t)/*#__PURE__*/return e(Ce,{provider:"twitter"},t);if("telegram"===t)/*#__PURE__*/return e(ke,{},t);if(N(t))/*#__PURE__*/return e(Ce,{provider:t},t);if(t.startsWith("privy:")){let a=t.split(":")[1];if(!a)throw Error("Invalid cross-app provider format. App ID missing.");/*#__PURE__*/return e(pe,{appId:a},t)}let a=Q.findIndex((({id:e})=>e===D.normalize(t))),l="solana"===b?"solana-only":"ethereum-only";/*#__PURE__*/return e(O,{recent:!0,index:a,data:{wallets:Q,walletChainType:l,handleWalletClick(e){c((t=>({...t,externalConnectWallet:{walletList:f,walletChainType:l,preSelectedWalletId:e.id}}))),h(i?"ConnectOnlyLandingScreen":"AuthenticateWithWalletScreen")}}})},ve=Q.filter((e=>e.id!==D.normalize(C||""))),be=ve.map(((t,a)=>/*#__PURE__*/e(O,{index:a,data:{walletChainType:y,wallets:ve,handleWalletClick(e){c((t=>({...t,externalConnectWallet:{walletList:f,walletChainType:y,preSelectedWalletId:e.id}}))),h(i?"ConnectOnlyLandingScreen":"AuthenticateWithWalletScreen")}}},t.id))),Se=J.filter((e=>e!==S?.loginMethod)).flatMap(me),Me=ge.flatMap(me);"web3-first"===te&&"default"===ie?be.unshift(...Me):"web2-first"===te&&Se.unshift(...Me);let Pe="web2-overflow"===ie?()=>le("default"):void 0,Ne=J.filter((e=>"email"!==e&&"sms"!==e)),je=Le({priority:te,email:x,sms:A,social:Ne}),De=We({priority:te,email:x,sms:A,social:Ne}),Oe=/*#__PURE__*/e(ne,{text:Ee({priority:te}),onClick:()=>{c({...o,externalConnectWallet:{walletChainType:m?.walletChainType??g.appearance.walletChainType}}),h(i?"ConnectOnlyLandingScreen":"AuthenticateWithWalletScreen")}}),Re=/*#__PURE__*/e(Te,{text:je,icon:De,onClick:()=>le("web2-overflow")}),Ve=ae?0:1,_e=G&&be.length>0,Ue=0===Se.length&&G&&0===be.length,Fe=5-(_e?1:0),$e="default"===ie&&g?.appearance.logo,ze="default"===ie&&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:Pe,showBack:!!Pe,helpText:g||Z&&"default"===ie?/*#__PURE__*/t(a,{children:[Z&&"default"===ie&&/*#__PURE__*/e(ye,{}),g&&/*#__PURE__*/e(d,{app:g})]}):void 0,watermark:!0,children:[ze&&("string"==typeof g.appearance.loginMessage?/*#__PURE__*/e(xe,{children:g.appearance.loginMessage}):/*#__PURE__*/e(Ae,{children:g.appearance.loginMessage})),/*#__PURE__*/e(M,{$colorScheme:g.appearance.palette.colorScheme,children:"default"===ie&&"web2-first"===te?/*#__PURE__*/t(a,{children:[Se.length>Fe?Se.slice(0,Fe-1):Se,Se.length>Fe&&Re,_e&&Oe,Ue&&/*#__PURE__*/e(fe,{chainType:g.appearance.walletChainType})]}):"default"===ie&&"web3-first"===te?/*#__PURE__*/t(a,{children:[G&&/*#__PURE__*/t(a,{children:[be.length>Fe?be.slice(0,Fe-1):be,be.length>Fe&&Oe]}),Se.length>Ve&&Re,Se.length===Ve&&Se[0],Ue&&/*#__PURE__*/e(fe,{chainType:g.appearance.walletChainType})]}):"web2-overflow"===ie?/*#__PURE__*/e(a,{children:"web3-first"===te?Se:Se.slice(3)}):null})]})};let xe=c.div`
16
- text-align: center;
17
- font-size: 14px;
18
- margin-bottom: 24px;
19
- `,Ae=c.div`
20
- margin-bottom: 24px;
21
- `,Le=({priority:e,email:t,sms:a,social:i})=>"web2-first"===e?"Other socials":t&&a&&i.length>0||t&&i.length>0?"Log in with email or socials":a&&i.length>0?"Log in with sms or socials":t&&a?"Continue with email or sms":t?"Continue with email":a?"Continue with sms":"Log in with a social account",We=({priority:t,email:a,sms:i,social:l})=>"web2-first"===t||l.length>0?/*#__PURE__*/e(_,{}):a&&i?/*#__PURE__*/e(me,{}):a?/*#__PURE__*/e(R,{}):i?/*#__PURE__*/e(V,{}):null,Ee=({priority:e})=>"web2-first"===e?"Continue with a wallet":"Other wallets";const Ie=({mostRecentlyUsedAccountType:e,smsAvailable:t,emailAvailable:a,prefilledType:i})=>a&&("email"===e&&"phone"!==i||"email"===i)||!t||"phone"!==e&&"phone"!==i?"email":"sms",Pe=({connectOnly:l})=>{let{closePrivyModal:o,connectors:c}=E(),{data:g,setModalData:m,onUserCloseViaDialogOrKeybindRef:f,navigate:y}=P(),w=u(),C=w.appearance.palette.colorScheme,{accountType:b,walletClientType:S}=v(),T=s((()=>b&&"guest"!==b&&"authorization_key"!==b&&"cross_app"!==b?k(b):null),[b]),I=w.loginMethodsAndOrder?.primary??[],N=w.loginMethodsAndOrder?.overflow??[],j=s((()=>[...I,...N]),[I,N]),R=w.loginMethods.passkey,V=g?.login,_=[];S&&j.includes(S)?_.push(S):b&&j.includes(T?.loginMethod)&&_.push(T?.loginMethod);let[U,F]=r("default"),[$,z]=r(Ie({mostRecentlyUsedAccountType:b,smsAvailable:j.includes("sms"),emailAvailable:j.includes("email"),prefilledType:V?.prefill?.type}));n((()=>{z(Ie({mostRecentlyUsedAccountType:b,smsAvailable:j.includes("sms"),emailAvailable:j.includes("email"),prefilledType:V?.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,I,N]);let H=()=>{o({shouldCallAuthOnSuccess:!0}),setTimeout((()=>{F("default")}),150)};f.current=H;let{listings:q}=x(),G=t=>{if("email"===t)/*#__PURE__*/return e(he,{isEditable:"email"===$,setIsEditable:()=>{z("email")},defaultValue:"email"===V?.prefill?.type?V.prefill.value:void 0},t);if("sms"===t)/*#__PURE__*/return e(we,{isEditable:"sms"===$,setIsEditable:()=>{z("sms")},defaultValue:"phone"===V?.prefill?.type?V.prefill.value:void 0},t);if("apple"===t)/*#__PURE__*/return e(Ce,{provider:"apple"},t);if("discord"===t)/*#__PURE__*/return e(Ce,{provider:"discord"},t);if("farcaster"===t)/*#__PURE__*/return e(ue,{},t);if("github"===t)/*#__PURE__*/return e(Ce,{provider:"github"},t);if("google"===t)/*#__PURE__*/return e(Ce,{provider:"google"},t);if("linkedin"===t)/*#__PURE__*/return e(Ce,{provider:"linkedin"},t);if("spotify"===t)/*#__PURE__*/return e(Ce,{provider:"spotify"},t);if("instagram"===t)/*#__PURE__*/return e(Ce,{provider:"instagram"},t);if("tiktok"===t)/*#__PURE__*/return e(Ce,{provider:"tiktok"},t);if("line"===t)/*#__PURE__*/return e(Ce,{provider:"line"},t);if("twitch"===t)/*#__PURE__*/return e(Ce,{provider:"twitch"},t);if("twitter"===t)/*#__PURE__*/return e(Ce,{provider:"twitter"},t);if("telegram"===t)/*#__PURE__*/return e(ke,{},t);if(t.startsWith("privy:"))/*#__PURE__*/return e(pe,{appId:t.replace("privy:","")},t);let a=w.appearance.walletChainType,i=new D(a,[t]).getWallets(c,q);return i.wallets.map(((t,r)=>/*#__PURE__*/e(O,{index:r,data:{wallets:i.wallets,walletChainType:a,handleWalletClick(e){m((t=>({...t,externalConnectWallet:{walletList:j,walletChainType:a,preSelectedWalletId:e.id}}))),y(l?"ConnectOnlyLandingScreen":"AuthenticateWithWalletScreen")}}},t.id+r)))},B=_.flatMap(G),K=I.filter((e=>e!==S&&e!==T?.loginMethod)).flatMap(G),Q=N.filter((e=>e!==S&&e!==T?.loginMethod)).flatMap(G),[X,Y]=A([...B,...K,...Q],Ne({primary:K.length+B.length,overflow:Q.length}));/*#__PURE__*/return t(a,{children:[/*#__PURE__*/e(p,{title:w.appearance.landingHeader,onClose:H,backFn:"default"===U?void 0:()=>{F("default")}}),"default"===U&&/*#__PURE__*/e(je,{}),"default"===U&&("string"==typeof w.appearance.loginMessage?/*#__PURE__*/e(L,{children:w.appearance.loginMessage}):w.appearance.loginMessage),/*#__PURE__*/e(W,{style:{overflow:"hidden"},children:/*#__PURE__*/t(M,{$colorScheme:C,children:["default"===U&&/*#__PURE__*/t(a,{children:[X,Y.length>0&&/*#__PURE__*/e(Te,{text:"More options",icon:/*#__PURE__*/e(i,{}),onClick:()=>F("overflow")})]}),"overflow"===U&&/*#__PURE__*/e(a,{children:Y}),R&&"default"===U&&/*#__PURE__*/e(ye,{})]})}),w&&/*#__PURE__*/e(d,{app:w}),/*#__PURE__*/e(h,{})]})};let Ne=({primary:e,overflow:t})=>e<5?e:5===e&&0===t?5:4,je=c((t=>{let a=u();return a?.appearance.logo?/*#__PURE__*/e(ce,{...t,children:/*#__PURE__*/e(se,{})}):null}))`
22
- margin-bottom: 16px;
23
- `;export{Pe as C,Me as L};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{AlertCircle as o,CheckCircle as r,CloudUpload as t}from"lucide-react";import{useState as i,useEffect as s}from"react";import{W as a}from"./WalletInfoCard-CR6-S95l.mjs";import{a as n,r as m}from"./context-i_OKSUqt.mjs";import{u as c,P as p}from"./internal-context-D4S2Sfvt.mjs";import{a as l}from"./get-is-unified-wallet-Bon2jknh.mjs";import{S as u}from"./ScreenLayout-x3-Xgy2E.mjs";import"styled-components";import"./ModalHeader-cnW8OaHH.mjs";import"./private-privy-provider-B2_rZ8aq.mjs";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/js-sdk-core";import"@privy-io/popup";import"./paths-BzM95ysC.mjs";import"@scure/base";import"viem";import"uuid";import"jose";import"eventemitter3";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"ofetch";import"js-cookie";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";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"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-CDF4d_Ha.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"./Screen-DgjLPjok.mjs";import"./index-Dq_xe9dz.mjs";const d=({appName:i,address:s,success:n,error:m,onAccept:c,onDecline:p,onClose:l})=>/*#__PURE__*/e(u,n||m?{title:m?"Something went wrong":"Success!",subtitle:m?"Please try again.":`You've successfully granted delegated action permissions to ${i}.`,icon:m?o:r,iconVariant:m?"error":"success",onBack:l,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:t,primaryCta:{label:"Accept",onClick:c},secondaryCta:{label:"Not now",onClick:p},onBack:l,watermark:!0,children:/*#__PURE__*/e(a,{address:s,title:"Wallet"})}),j={component:()=>{let{data:o}=l(),r=n(),{closePrivyModal:t}=c(),[a,u]=i(!1),[j,y]=i(),{address:f,onDelegate:h,onSuccess:v,onError:w}=o.delegatedActions.consent,g=async()=>{a?v():w(j??new p("User declined delegating actions.")),t({shouldCallAuthOnSuccess:!1})};return s((()=>{if(!a&&!j)return;let e=setTimeout(g,m);return()=>clearTimeout(e)}),[a,j]),/*#__PURE__*/e(d,{appName:r.name,address:f,success:a,error:j,onAccept:async()=>{try{await h(),u(!0)}catch(e){y(e)}},onDecline:()=>{g()},onClose:g})}};export{j as DelegatedActionsConsentScreen,d as DelegatedActionsConsentScreenView,j as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{AlertCircle as o,CheckCircle as r,Ban as t}from"lucide-react";import{useState as i,useEffect as n}from"react";import{a as s,r as a}from"./context-i_OKSUqt.mjs";import{u as m,P as c}from"./internal-context-D4S2Sfvt.mjs";import{a as l}from"./get-is-unified-wallet-Bon2jknh.mjs";import{S as p}from"./ScreenLayout-x3-Xgy2E.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"./ModalHeader-cnW8OaHH.mjs";import"styled-components";import"./private-privy-provider-B2_rZ8aq.mjs";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-BzM95ysC.mjs";import"@scure/base";import"uuid";import"jose";import"eventemitter3";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"js-cookie";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";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"./Screen-DgjLPjok.mjs";import"./index-Dq_xe9dz.mjs";const u=({appName:i,success:n,error:s,onRevoke:a,onDeny:m,onClose:c})=>/*#__PURE__*/e(p,n||s?{title:s?"Something went wrong":"Success!",subtitle:s?"Please try again.":"You've successfully revoked permissions.",icon:s?o:r,iconVariant:s?"error":"success",onBack:c,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:t,primaryCta:{label:"Confirm",onClick:a},secondaryCta:{label:"Deny",onClick:m},onBack:c,watermark:!0}),d={component:()=>{let{data:o}=l(),r=s(),{closePrivyModal:t}=m(),[p,d]=i(!1),[v,y]=i(),{onRevoke:f,onSuccess:h,onError:k}=o.delegatedActions.revoke,w=async()=>{p?h():k(v??new c("User declined revoking access to their delegated wallet.")),t({shouldCallAuthOnSuccess:!1})};return n((()=>{if(!p&&!v)return;let e=setTimeout(w,a);return()=>clearTimeout(e)}),[p,v]),/*#__PURE__*/e(u,{appName:r.name,success:p,error:v,onRevoke:async()=>{try{await f(),d(!0)}catch(e){y(e)}},onDeny:()=>{w()},onClose:w})}};export{d as DelegatedActionsRevokeScreen,u as DelegatedActionsRevokeScreenView,d as default};
@@ -1 +0,0 @@
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{am as a,an as n}from"./private-privy-provider-B2_rZ8aq.mjs";import{u as c}from"./internal-context-D4S2Sfvt.mjs";import{u as l,a as s}from"./get-is-unified-wallet-Bon2jknh.mjs";import{S as d}from"./ScreenLayout-x3-Xgy2E.mjs";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/js-sdk-core";import"@privy-io/popup";import"./paths-BzM95ysC.mjs";import"@scure/base";import"viem";import"uuid";import"jose";import"eventemitter3";import"zustand";import"./context-i_OKSUqt.mjs";import"tinycolor2";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"ofetch";import"js-cookie";import"styled-components";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";import"./ModalHeader-cnW8OaHH.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"./Screen-DgjLPjok.mjs";import"./index-Dq_xe9dz.mjs";const m=({connectionFailed:r,onClose:o})=>/*#__PURE__*/e(d,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}),p={component:()=>{let{authenticated:t,user:d}=l(),{client:p,closePrivyModal:u,createAnalyticsEvent:y,walletProxy:v}=c(),{navigate:h,data:f,setModalData:w,onUserCloseViaDialogOrKeybindRef:b}=s(),C=r((()=>Date.now()),[]),[g,I]=o(!1),{onCompleteNavigateTo:j,onFailure:A,shouldForceMFA:k,entropyId:S,entropyIdVerifier:x,recoveryMethod:T,connectingWalletAddress:F,isUnifiedWallet:M=!1}=f?.connectWallet,V=e=>{g||(I(!0),A("string"==typeof e?Error(e):e))};return i((()=>{let e;return t?v?((async()=>{let t=await p.getAccessToken();if(!t)return V("User must be authenticated and have a Privy wallet before it can be connected");try{if(!M){if(!S||!x)return V("For on-device first-class chain wallets, entropyId and entropyIdVerifier are required");await v.connect({accessToken:t,entropyId:S,entropyIdVerifier:x})}k&&await v.verifyMfa({accessToken:t});let r=(Date.now()-C)/1e3;"EmbeddedWalletKeyExportScreen"===j&&r<1?e=setTimeout((()=>{h(j,!1)}),1e3*(1-r)):h(j,!1)}catch(e){if(a(e)&&"privy"===T){let e=await p.getAccessToken();if(!e)return V("User must be authenticated and have a Privy wallet before it can be recovered");try{y({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:F}});let t=await(v?.recover({accessToken:e,entropyId:S,entropyIdVerifier:x}));t?.entropyId||V(Error("Unable to recover wallet")),j?h(j):u({shouldCallAuthOnSuccess:!1}),y({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:F}}),h(j)}catch(e){V("An error has occurred, please try again.")}}else a(e)&&"privy"!==T&&"privy-v2"!==T?(w({...f,recoverWallet:{entropyId:S,entropyIdVerifier:x,onCompleteNavigateTo:j,onFailure:A},recoveryOAuthStatus:{provider:T,action:"recover",isInAccountCreateFlow:!1,shouldCreateEth:!1,shouldCreateSol:!1}}),h(n(T))):V(e)}})(),()=>clearTimeout(e)):void 0:V("User must be authenticated and have a Privy wallet before it can be connected")}),[t,d,v]),b.current=()=>{V("User exited before wallet could be connected"),u({shouldCallAuthOnSuccess:!1})},/*#__PURE__*/e(m,{connectionFailed:g,onClose:()=>u({shouldCallAuthOnSuccess:!1})})}};export{p as EmbeddedWalletConnectingScreen,m as EmbeddedWalletConnectingView,p as default};
@@ -1 +0,0 @@
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,g as s,e as m}from"./get-is-unified-wallet-Bon2jknh.mjs";import{a as c,r as a}from"./context-i_OKSUqt.mjs";import{u as n}from"./internal-context-D4S2Sfvt.mjs";import{S as p}from"./ScreenLayout-x3-Xgy2E.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./ModalHeader-cnW8OaHH.mjs";import"styled-components";import"./private-privy-provider-B2_rZ8aq.mjs";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-BzM95ysC.mjs";import"@scure/base";import"uuid";import"jose";import"eventemitter3";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"js-cookie";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";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"./Screen-DgjLPjok.mjs";import"./index-Dq_xe9dz.mjs";const l=({title:o,description:r,onClose:i})=>/*#__PURE__*/e(p,{title:o,subtitle:r,icon:t,iconVariant:"success",watermark:!0,onBack:i}),u={component:()=>{let{user:t}=r(),{closePrivyModal:p,isNewUserThisSession:u,updateWallets:d}=n(),{data:j,onUserCloseViaDialogOrKeybindRef:v}=i(),h=c(),{onSuccess:f,onFailure:y,callAuthOnSuccessOnClose:w}=j.createWallet,k=()=>{let e=s(t)??m(t);t&&e?(d(),f({user:t,account:e})):y(Error("Failed to create wallet")),p({shouldCallAuthOnSuccess:w})};return o((()=>{let e=setTimeout(k,a);return()=>clearTimeout(e)}),[]),v.current=k,/*#__PURE__*/e(l,{title:u?"Welcome"+(h?.name?` to ${h?.name}`:""):"All set!",description:u?"You've successfully created an account.":"Your account is secured.",onClose:k})}};export{u as EmbeddedWalletCreatedScreen,l as EmbeddedWalletCreatedScreenView,u as default};
@@ -1,40 +0,0 @@
1
- import{jsx as e,jsxs as r,Fragment as t}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 p}from"./WarningBanner-c8L53pJ2.mjs";import{W as d}from"./WalletInfoCard-CR6-S95l.mjs";import{a as c}from"./context-i_OKSUqt.mjs";import{u as s}from"./internal-context-D4S2Sfvt.mjs";import{u as m,a as u}from"./get-is-unified-wallet-Bon2jknh.mjs";import{S as h}from"./ScreenLayout-x3-Xgy2E.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"lucide-react";import"./ModalHeader-cnW8OaHH.mjs";import"./private-privy-provider-B2_rZ8aq.mjs";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/js-sdk-core";import"@privy-io/popup";import"./paths-BzM95ysC.mjs";import"@scure/base";import"viem";import"uuid";import"jose";import"eventemitter3";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"ofetch";import"js-cookie";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";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"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-CDF4d_Ha.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"./Screen-DgjLPjok.mjs";import"./index-Dq_xe9dz.mjs";const y=({address:o,accessToken:i,appConfigTheme:n,onClose:a,isLoading:l=!1,exportButtonProps:c})=>/*#__PURE__*/e(h,{title:"Export wallet",subtitle:/*#__PURE__*/r(t,{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__*/r(f,{children:[/*#__PURE__*/e(p,{theme:n,children:"Never share your private key or seed phrase with anyone."}),/*#__PURE__*/e(d,{title:"Your wallet",address:o,showCopyButton:!0}),/*#__PURE__*/e("div",{style:{width:"100%"},children:l?/*#__PURE__*/e(g,{}):i&&c&&/*#__PURE__*/e(w,{accessToken:i,dimensions:{height:"44px"},...c})})]})});let f=a.div`
2
- display: flex;
3
- flex-direction: column;
4
- gap: 1.25rem;
5
- text-align: left;
6
- `,g=()=>/*#__PURE__*/e(v,{children:/*#__PURE__*/e(x,{children:"Loading..."})}),v=a.div`
7
- display: flex;
8
- gap: 12px;
9
- height: 44px;
10
- `,x=a.div`
11
- display: flex;
12
- align-items: center;
13
- justify-content: center;
14
- width: 100%;
15
- height: 100%;
16
- font-size: 16px;
17
- font-weight: 500;
18
- border-radius: var(--privy-border-radius-md);
19
- background-color: var(--privy-color-background-2);
20
- color: var(--privy-color-foreground-3);
21
- `;function w(t){let[a,p]=o(t.dimensions.width),[d,c]=o(void 0),s=n(null);i((()=>{if(s.current&&void 0===a){let{width:e}=s.current.getBoundingClientRect();p(e)}let e=getComputedStyle(document.documentElement);c({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"===t.chainType&&!t.imported&&!t.isUnifiedWallet;/*#__PURE__*/return e("div",{ref:s,children:a&&
22
- /*#__PURE__*/r(b,{children:[/*#__PURE__*/e("iframe",{style:{position:"absolute",zIndex:1},width:a,height:t.dimensions.height,allow:"clipboard-write self *",src:l({origin:t.origin,path:`/apps/${t.appId}/embedded-wallets/export`,query:t.isUnifiedWallet?{v:"1-unified",wallet_id:t.walletId,client_id:t.appClientId,width:`${a}px`,caid:t.clientAnalyticsId,phrase_export:m,...d}:{v:"1",entropy_id:t.entropyId,entropy_id_verifier:t.entropyIdVerifier,hd_wallet_index:t.hdWalletIndex,chain_type:t.chainType,client_id:t.appClientId,width:`${a}px`,caid:t.clientAnalyticsId,phrase_export:m,...d},hash:{token:t.accessToken}})}),/*#__PURE__*/e(k,{children:"Loading..."}),m&&/*#__PURE__*/e(k,{children:"Loading..."})]})})}const I={component:()=>{let[r,t]=o(null),{authenticated:n,user:a}=m(),{closePrivyModal:l,createAnalyticsEvent:p,clientAnalyticsId:d,client:h}=s(),f=c(),{data:g,onUserCloseViaDialogOrKeybindRef:v}=u(),{onFailure:x,onSuccess:w,origin:I,appId:b,appClientId:k,entropyId:j,entropyIdVerifier:C,walletId:_,hdWalletIndex:A,chainType:T,address:V,isUnifiedWallet:P,imported:W}=g.keyExport,L=e=>{l({shouldCallAuthOnSuccess:!1}),x("string"==typeof e?Error(e):e)},S=()=>{l({shouldCallAuthOnSuccess:!1}),w(),p({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:V}})};return i((()=>{if(!n)return L("User must be authenticated before exporting their wallet");h.getAccessToken().then(t).catch(L)}),[n,a]),v.current=S,/*#__PURE__*/e(y,{address:V,accessToken:r,appConfigTheme:f.appearance.palette.colorScheme,onClose:S,isLoading:!r,exportButtonProps:r?{origin:I,appId:b,appClientId:k,clientAnalyticsId:d,entropyId:j,entropyIdVerifier:C,walletId:_,hdWalletIndex:A,isUnifiedWallet:P,imported:W,chainType:T}:void 0})}};let b=a.div`
23
- overflow: visible;
24
- position: relative;
25
- overflow: none;
26
- height: 44px;
27
- display: flex;
28
- gap: 12px;
29
- `,k=a.div`
30
- display: flex;
31
- align-items: center;
32
- justify-content: center;
33
- width: 100%;
34
- height: 100%;
35
- font-size: 16px;
36
- font-weight: 500;
37
- border-radius: var(--privy-border-radius-md);
38
- background-color: var(--privy-color-background-2);
39
- color: var(--privy-color-foreground-3);
40
- `;export{I as EmbeddedWalletKeyExportScreen,y as EmbeddedWalletKeyExportView,I as default};
@@ -1 +0,0 @@
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{a}from"./context-i_OKSUqt.mjs";import{s as i,n as l,b8 as s,al as n}from"./private-privy-provider-B2_rZ8aq.mjs";import{u as c,m}from"./internal-context-D4S2Sfvt.mjs";import{u as d}from"./use-create-wallet-without-fallback-CY32SGw2.mjs";import{a as u,u as p}from"./get-is-unified-wallet-Bon2jknh.mjs";import{S as h}from"./ScreenLayout-x3-Xgy2E.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-BzM95ysC.mjs";import"@scure/base";import"viem";import"uuid";import"jose";import"eventemitter3";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"ofetch";import"js-cookie";import"styled-components";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";import"./ModalHeader-cnW8OaHH.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"./Screen-DgjLPjok.mjs";import"./index-Dq_xe9dz.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(),f=a(),[C,g]=r(""),{embeddedWallets:b}=a(),{authenticated:S,user:j}=p(),{closePrivyModal:x,walletProxy:O,client:k}=c(),{onSuccess:A,onFailure:W,callAuthOnSuccessOnClose:I,shouldCreateEth:M,shouldCreateSol:U}=y.createWallet,R="legacy-embedded-wallets-only"===f.embeddedWallets.mode&&!0===f?.embeddedWallets.requireUserOwnedRecoveryOnCreate,[E,P]=r(null),{create:L}=d(),T=M??(!!j&&i(j,f.embeddedWallets.ethereum.createOnLogin)),D=U??(!!j&&l(j,f.embeddedWallets.solana.createOnLogin)),F=new n((async()=>{let e=await k.getAccessToken();if(j&&e&&O)try{let e;if(T&&D)e=await L({chainType:"ethereum",walletIndex:0,latestUser:j}),e=await L({chainType:"solana",walletIndex:0,latestUser:e.user});else if(D)e=await L({chainType:"solana",walletIndex:0,latestUser:j});else{if(!T)return void x({shouldCallAuthOnSuccess:I});e=await L({chainType:"ethereum",walletIndex:0,latestUser:j})}P(e),h("EmbeddedWalletCreatedScreen")}catch(e){g(e.message)}}));return o((()=>S&&j?R?(t({...y,createWallet:{...y.createWallet,shouldCreateEth:T,shouldCreateSol:D},recoverySelection:{...y?.recoverySelection,isInAccountCreateFlow:!0,shouldCreateEth:T,shouldCreateSol:D}}),h(s({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:b.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}))):void F.execute():(h("LandingScreen"),void W(Error("User must be authenticated before creating a Privy wallet")))),[R,S]),v.current=()=>null/*#__PURE__*/,e(w,{errorMessage:C||void 0,onClose:()=>{E?(A(E),x({shouldCallAuthOnSuccess:I})):(W(new m("User wallet creation failed")),x({shouldCallAuthOnSuccess:!1}))}})}};export{y as EmbeddedWalletOnAccountCreateScreen,w as EmbeddedWalletOnAccountCreateView,y as default};
@@ -1 +0,0 @@
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,j as i}from"./get-is-unified-wallet-Bon2jknh.mjs";import{a}from"./context-i_OKSUqt.mjs";import{u as n,o as d,m as c}from"./internal-context-D4S2Sfvt.mjs";import{d as l}from"./private-privy-provider-B2_rZ8aq.mjs";import{S as p,g as m}from"./SetWalletPasswordForm-Deqef3mc.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-BzM95ysC.mjs";import"@scure/base";import"uuid";import"jose";import"eventemitter3";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"js-cookie";import"styled-components";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./Layouts-BlFm53ED.mjs";import"./ModalHeader-cnW8OaHH.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-C0CllI3K.mjs";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"./Checkbox-BhNoOKjX.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-CHmc4-Lu.mjs";const u={component:()=>{let[u,y]=o(null),[w,h]=o(!1),[v,g]=o(null),[f,_]=o(""),{authenticated:j,user:I}=t(),{client:M,walletProxy:A,refreshSessionAndUser:b,closePrivyModal:R,createAnalyticsEvent:C}=n(),{navigate:P,data:x,onUserCloseViaDialogOrKeybindRef:S}=s(),k=a(),{onSuccess:E,onFailure:N}=x.setWalletPassword,D=i(I),O="user-passcode"===u?.recoveryMethod,T="user-passcode"===D?.recoveryMethod;r((()=>{j||(P("LandingScreen"),N(new d("User must be authenticated before setting a password on a Privy wallet")))}),[j]);let L=()=>v?(N(v),void R({shouldCallAuthOnSuccess:!1})):O?(E(u),void R({shouldCallAuthOnSuccess:!1})):(N(new c("Exited before password was added to wallet")),void R({shouldCallAuthOnSuccess:!1}));S.current=L;/*#__PURE__*/return e(p,{appName:k?.name||"privy",config:{initiatedBy:"user",onCancel:L},error:v?"An error has occurred, please try again.":void 0,buttonLoading:w,buttonHideAnimations:!1,password:f,isResettingPassword:T,onPasswordGenerate:()=>_(m()),onPasswordChange:_,onSubmit:async()=>{O?(E(u),R({shouldCallAuthOnSuccess:!1})):(h(!0),g(null),await(async()=>{let e=await M.getAccessToken();if(e&&I&&D?.address&&f&&A)try{C({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:T}});let{entropyId:o,entropyIdVerifier:r}=l(I);if(!(await A.setRecovery({accessToken:e,entropyId:o,entropyIdVerifier:r,recoveryPassword:f,recoveryMethod:"user-passcode"})).entropyId)return g(new c("Error setting password on privy wallet")),void C({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:T,reason:"error setting password"}});let t=await b(),s=i(t);if(!s)return g(new c("Error setting password on privy wallet")),void C({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:T,reason:"wallet disconnected"}});y(s),C({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:D.address,existingRecoveryMethod:D.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:T}})}catch(e){console.warn(e),g(e instanceof Error?e:Error("Error setting password on privy wallet")),C({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:D.address,reason:e}})}})(),h(!1))},onClose:L})}};export{u as EmbeddedWalletPasswordUpdateScreen,u as default};
@@ -1 +0,0 @@
1
- import{jsx as e,jsxs as o,Fragment as r}from"react/jsx-runtime";import{Lock as t}from"lucide-react";import{u as i,m as s}from"./internal-context-D4S2Sfvt.mjs";import{a}from"./get-is-unified-wallet-Bon2jknh.mjs";import{S as m}from"./ScreenLayout-x3-Xgy2E.mjs";import"ofetch";import"react";import"viem";import"./context-i_OKSUqt.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./ModalHeader-cnW8OaHH.mjs";import"styled-components";import"./private-privy-provider-B2_rZ8aq.mjs";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-BzM95ysC.mjs";import"@scure/base";import"uuid";import"jose";import"eventemitter3";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"js-cookie";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";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"./Screen-DgjLPjok.mjs";import"./index-Dq_xe9dz.mjs";const c=({onClose:i,onProceed:s})=>/*#__PURE__*/e(m,{title:"Secure Your Account",subtitle:/*#__PURE__*/o(r,{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:t,primaryCta:{label:"Add password",onClick:s},onClose:i,watermark:!0}),p={component:()=>{let{closePrivyModal:o}=i(),{data:r,navigate:t,onUserCloseViaDialogOrKeybindRef:m}=a(),{onFailure:p}=r.setWalletPassword,n=()=>{p(new s("Exited before password was added to wallet")),o({shouldCallAuthOnSuccess:!1})};return m.current=n,/*#__PURE__*/e(c,{onClose:n,onProceed:()=>{t("EmbeddedWalletPasswordUpdateScreen")}})}};export{p as EmbeddedWalletPasswordUpdateSplashScreen,c as EmbeddedWalletPasswordUpdateSplashView,p as default};
@@ -1,4 +0,0 @@
1
- import{jsx as t,jsxs as e,Fragment as r}from"react/jsx-runtime";import{AlertTriangle as i,Phone as a,Lock as o}from"lucide-react";import{styled as n}from"styled-components";import{a as c}from"./context-i_OKSUqt.mjs";import{f as s,aQ as l}from"./private-privy-provider-B2_rZ8aq.mjs";import{c as m,a as p,P as T,h as d}from"./internal-context-D4S2Sfvt.mjs";import{a as u}from"./get-is-unified-wallet-Bon2jknh.mjs";import{R as g}from"./reservoir-DNdkSA7R.mjs";import{S as h}from"./ScreenLayout-x3-Xgy2E.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-BzM95ysC.mjs";import"@scure/base";import"viem";import"uuid";import"jose";import"eventemitter3";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"ofetch";import"js-cookie";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";import"./ModalHeader-cnW8OaHH.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"./Screen-DgjLPjok.mjs";import"./index-Dq_xe9dz.mjs";const y=({error:n,allowlistConfig:c,onRetry:s,onCaptchaReset:u,onBack:y})=>{let f=((n,c)=>{if(n instanceof g)return{title:"Transaction failed",detail:/*#__PURE__*/e(r,{children:[/*#__PURE__*/t("span",{children:n.message}),/*#__PURE__*/e("span",{children:[" ","Check the"," ",/*#__PURE__*/t(w,{href:n.relayLink,target:"_blank",children:"refund status"}),"."]})]}),ctaText:"Try again",icon:i};if(n instanceof T)switch(n.privyErrorCode){case p.CLIENT_REQUEST_TIMEOUT:return{title:"Timed out",detail:n.message,ctaText:"Try again",icon:i};case p.INSUFFICIENT_BALANCE:return{title:"Insufficient balance",detail:n.message,ctaText:"Try again",icon:i};case p.TRANSACTION_FAILURE:return{title:"Transaction failure",detail:n.message,ctaText:"Try again",icon:i};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:i}}else{if(n instanceof l&&"twilio_verification_failed"===n.type)return{title:"Something went wrong",detail:n.message,ctaText:"Try again",icon:a};if(!(n instanceof m))return n instanceof d&&n.status&&[400,422].includes(n.status)?{title:"Something went wrong",detail:n.message,ctaText:"Try again",icon:i}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:i};switch(n.privyErrorCode){case p.INVALID_CAPTCHA:return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:i};case p.DISALLOWED_LOGIN_METHOD:return{title:"Not allowed",detail:n.message,ctaText:"Try another method",icon:i};case p.ALLOWLIST_REJECTED:return{title:c.errorTitle||"You don't have access to this app",detail:c.errorDetail||"Have you been invited?",ctaText:c.errorCtaText||"Try another account",icon:o};case p.CAPTCHA_FAILURE:return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:null};case p.CAPTCHA_TIMEOUT:return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:null};case p.LINKED_TO_ANOTHER_USER:return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:i};case p.NOT_SUPPORTED:return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:i};case p.TOO_MANY_REQUESTS:return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:i};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:i}}}})(n,c);/*#__PURE__*/return t(h,{title:f.title,subtitle:f.detail,icon:f.icon,onBack:y,iconVariant:"error",primaryCta:{label:f.ctaText,onClick:()=>{n instanceof m&&(n.privyErrorCode===p.INVALID_CAPTCHA&&u?.(),n.privyErrorCode===p.ALLOWLIST_REJECTED&&c.errorCtaLink)?window.location.href=c.errorCtaLink:s?.()},variant:"error"},watermark:!0})},f={component:()=>{let{navigate:e,data:r,lastScreen:i,currentScreen:a}=u(),o=c(),{reset:n}=s(),l=r?.errorModalData?.previousScreen||(i===a?void 0:i);/*#__PURE__*/return t(y,{error:r?.errorModalData?.error||Error(),allowlistConfig:o.allowlistConfig,onRetry:()=>{e(l||"LandingScreen",!1)},onCaptchaReset:n})}};let w=n.a`
2
- color: var(--privy-color-accent) !important;
3
- font-weight: 600;
4
- `;export{f as ErrorScreen,y as ErrorScreenView,f as default};
@@ -1,28 +0,0 @@
1
- import{jsx as e,jsxs as t}from"react/jsx-runtime";import{useState as r,useRef as o,useEffect as i}from"react";import{isMobile as a,isIOS as s}from"react-device-detect";import{styled as n}from"styled-components";import{C as l}from"./CopyToClipboard-BGTSFnT3.mjs";import{ao as c}from"./private-privy-provider-B2_rZ8aq.mjs";import{O as m}from"./OpenLink-DZHy38vr.mjs";import{Q as p}from"./QrCode-BVe4kf2z.mjs";import{a as d,q as u}from"./context-i_OKSUqt.mjs";import{u as h}from"./internal-context-D4S2Sfvt.mjs";import{a as v}from"./get-is-unified-wallet-Bon2jknh.mjs";import{S as g}from"./ScreenLayout-x3-Xgy2E.mjs";import{F as f}from"./farcaster-DPlSjvF5.mjs";import"./copy-Bx2Jwc5_.mjs";import"mipd";import"viem/utils";import"@privy-io/js-sdk-core";import"@privy-io/popup";import"./paths-BzM95ysC.mjs";import"@scure/base";import"viem";import"uuid";import"jose";import"eventemitter3";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"ofetch";import"js-cookie";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";import"qrcode";import"tinycolor2";import"./ModalHeader-cnW8OaHH.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"./Screen-DgjLPjok.mjs";import"./index-Dq_xe9dz.mjs";let y="#8a63d2";const k=({appName:r,loading:o,success:i,errorMessage:n,connectUri:d,onBack:u,onClose:h,onOpenFarcaster:v})=>/*#__PURE__*/e(g,a||o?s?{title:n?n.message:"Add a signer to Farcaster",subtitle:n?n.detail:`This will allow ${r} to add casts, likes, follows, and more on your behalf.`,icon:f,iconVariant:"loading",iconLoadingStatus:{success:i,fail:!!n},primaryCta:d&&v?{label:"Open Farcaster app",onClick:v}:void 0,onBack:u,onClose:h,watermark:!0}:{title:n?n.message:"Requesting signer from Farcaster",subtitle:n?n.detail:"This should only take a moment",icon:f,iconVariant:"loading",iconLoadingStatus:{success:i,fail:!!n},onBack:u,onClose:h,watermark:!0,children:d&&a&&/*#__PURE__*/e(w,{children:/*#__PURE__*/e(m,{text:"Take me to Farcaster",url:d,color:y})})}:{title:"Add a signer to Farcaster",subtitle:`This will allow ${r} to add casts, likes, follows, and more on your behalf.`,onBack:u,onClose:h,watermark:!0,children:/*#__PURE__*/t(j,{children:[/*#__PURE__*/e(x,{children:d?/*#__PURE__*/e(p,{url:d,size:275,squareLogoElement:f}):/*#__PURE__*/e(S,{children:/*#__PURE__*/e(c,{})})}),/*#__PURE__*/t(C,{children:[/*#__PURE__*/e(b,{children:"Or copy this link and paste it into a phone browser to open the Farcaster app."}),d&&/*#__PURE__*/e(l,{text:d,itemName:"link",color:y})]})]})});let w=n.div`
2
- margin-top: 24px;
3
- `,j=n.div`
4
- display: flex;
5
- flex-direction: column;
6
- align-items: center;
7
- gap: 24px;
8
- `,x=n.div`
9
- padding: 24px;
10
- position: relative;
11
- display: flex;
12
- align-items: center;
13
- justify-content: center;
14
- min-height: 275px;
15
- `,C=n.div`
16
- display: flex;
17
- flex-direction: column;
18
- align-items: center;
19
- gap: 16px;
20
- `,b=n.div`
21
- font-size: 0.875rem;
22
- text-align: center;
23
- color: var(--privy-color-foreground-2);
24
- `,S=n.div`
25
- position: relative;
26
- width: 82px;
27
- height: 82px;
28
- `;const I={component:()=>{let{lastScreen:t,navigateBack:a,data:s}=v(),n=d(),{requestFarcasterSignerStatus:l,closePrivyModal:c}=h(),[m,p]=r(void 0),[g,f]=r(!1),[y,w]=r(!1),j=o([]),x=s?.farcasterSigner;i((()=>{let e=Date.now(),t=setInterval((async()=>{if(!x?.public_key)return clearInterval(t),void p({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});"approved"===x.status&&(clearInterval(t),f(!1),w(!0),j.current.push(setTimeout((()=>c({shouldCallAuthOnSuccess:!1,isSuccess:!0})),u)));let r=await l(x?.public_key),o=Date.now()-e;"approved"===r.status?(clearInterval(t),f(!1),w(!0),j.current.push(setTimeout((()=>c({shouldCallAuthOnSuccess:!1,isSuccess:!0})),u))):o>3e5?(clearInterval(t),p({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):"revoked"===r.status&&(clearInterval(t),p({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))}),2e3);return()=>{clearInterval(t),j.current.forEach((e=>clearTimeout(e)))}}),[]);let C="pending_approval"===x?.status?x.signer_approval_url:void 0;/*#__PURE__*/return e(k,{appName:n.name,loading:g,success:y,errorMessage:m,connectUri:C,onBack:t?a:void 0,onClose:c,onOpenFarcaster:()=>{C&&(window.location.href=C)}})}};export{I as FarcasterSignerStatusScreen,k as FarcasterSignerStatusView,I as default};
@@ -1 +0,0 @@
1
- import{jsx as t,jsxs as e,Fragment as a}from"react/jsx-runtime";import n from"@heroicons/react/24/outline/CheckCircleIcon";import{useState as o,useEffect as r}from"react";import{formatWalletAddress as i}from"@privy-io/js-sdk-core";import{B as s,P as l}from"./ModalHeader-cnW8OaHH.mjs";import{b as m,c,R as d,e as u}from"./Layouts-BlFm53ED.mjs";import{C as p}from"./ScreenHeader-CHmc4-Lu.mjs";import{t as f}from"./FundWalletMethodHeader-B3nAPYAR.mjs";import{I as g}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{N as h}from"./index-Dq_xe9dz.mjs";import{L as v,V as I}from"./Value-tcJV9e0L.mjs";import{a as w,R as S}from"./Row-C9vrS4Zi.mjs";import{a as j,t as y}from"./context-i_OKSUqt.mjs";import{u as C,P as L,a as k}from"./internal-context-D4S2Sfvt.mjs";import{a as x}from"./get-is-unified-wallet-Bon2jknh.mjs";import{u as F,g as U}from"./useWallets-B3ZcS4km.mjs";import{u as T}from"./useGetTokenPrice-DgKSvh6T.mjs";import{O as b}from"./analytics-mkkvFRju.mjs";import{getTransferSolInstruction as A}from"@solana-program/system";import{pipe as W,createTransactionMessage as P,setTransactionMessageFeePayerSigner as D,setTransactionMessageLifetimeUsingBlockhash as N,appendTransactionMessageInstruction as O,compileTransaction as E,getTransactionEncoder as M}from"@solana/kit";import{findAssociatedTokenPda as $,getCreateAssociatedTokenIdempotentInstruction as B,getTransferInstruction as R}from"@solana-program/token";import{T as H,L as V,g as G}from"./getFormattedUsdFromLamports-B6EqSEho.mjs";import{g as _}from"./getUsdcMintAddress-DFI1hv05.mjs";import{u as q,f as z,s as Q,w as X}from"./useSolanaRpcClient-O9yIYVIZ.mjs";import{g as Y}from"./getChainName-DjpPdUSc.mjs";import{a$ as J}from"./private-privy-provider-B2_rZ8aq.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/WalletIcon";import"./LoadingSkeleton-U6-3yFwI.mjs";import"tinycolor2";import"ofetch";import"viem";import"eventemitter3";import"@scure/base";import"./use-sign-with-user-signer--95w9BaG.mjs";import"./useGetSolPrice-usp7QcwI.mjs";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-BzM95ysC.mjs";import"uuid";import"jose";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"js-cookie";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";function K({rows:a}){/*#__PURE__*/return t(w,{children:a.filter((t=>!!t)).map(((a,n)=>null!=a.value||a.isLoading?/*#__PURE__*/e(S,{children:[/*#__PURE__*/t(v,{children:a.label}),/*#__PURE__*/t(I,{$isLoading:a.isLoading,children:a.value})]},n):null))})}function Z(t){return BigInt(Math.floor(1e9*parseFloat(t)))}function tt(t){return+et.format(parseFloat(t.toString())/1e9)}let et=Intl.NumberFormat(void 0,{maximumFractionDigits:8});async function at({tx:t,solanaClient:e,amount:a,asset:n,tokenPrice:o}){if(!t)return null;if("SOL"===n&&o){let n=Z(a),r=G(n,o),i=await z({solanaClient:e,tx:t});return{amountInUsd:r,feeInUsd:o?G(i,o):void 0,totalInUsd:G(n+i,o)}}if("USDC"===n&&o){let n="$"+a,r=await z({solanaClient:e,tx:t}),i=function(t,e){let a=parseFloat(t.toString())/V*e;return a<.01?0:a}(r,o);return{amountInUsd:n,feeInUsd:G(r,o),totalInUsd:"$"+(parseFloat(a)+i).toFixed(2)}}if("SOL"===n){let n=Z(a),o=await z({solanaClient:e,tx:t});return{amountInSol:a+" SOL",feeInSol:tt(o)+" SOL",totalInSol:tt(n+o)+" SOL"}}return{amountInUsdc:a+" USDC",feeInSol:tt(await z({solanaClient:e,tx:t}))+" SOL"}}const nt={component:function(){let v=j(),{closePrivyModal:I,createAnalyticsEvent:w}=C(),{data:S,setModalData:V,navigate:z}=x(),{wallets:tt}=F(),[et,nt]=o("preparing"),[ot,rt]=o(),[it,st]=o(),[lt,mt]=o();if(!S?.solanaFundingData)throw Error("Funding config is missing");if(!S.solanaFundingData.sourceWalletData)throw Error("Funding config is missing source wallet data");let{amount:ct,asset:dt,chain:ut,sourceWalletData:pt,destinationAddress:ft,afterSuccessScreen:gt}=S.solanaFundingData,ht=tt.find((t=>t.address===pt.address&&J(pt.walletClientType)===J(t.standardWallet.name))),vt=q()(ut),{tokenPrice:It,isTokenPriceLoading:wt}=T("solana");return r((()=>{if("preparing"!==et||wt||!ht)return;let t="SOL"===dt?Z(ct):function(t){return BigInt(Math.floor(1e6*parseFloat(t)))}(ct);st({amount:("SOL"===dt&&It?G(t,It):ct)??ct}),("SOL"===dt?async function({solanaClient:t,source:e,destination:a,amountInLamports:n}){let{value:o}=await t.rpc.getLatestBlockhash().send(),r={address:e},i=W(P({version:0}),(t=>D(r,t)),(t=>N(o,t)),(t=>O(A({amount:n,source:r,destination:a}),t)),(t=>E(t)));return new Uint8Array(M().encode(i))}({solanaClient:vt,source:ht.address,destination:ft,amountInLamports:t}):async function({solanaClient:t,source:e,destination:a,amountInBaseUnits:n}){let o=_(t.chain),{value:r}=await t.rpc.getLatestBlockhash().send(),i={address:e},[s]=await $({mint:o,owner:e,tokenProgram:H}),[l]=await $({mint:o,owner:a,tokenProgram:H}),[m,c]=await Promise.all([t.rpc.getAccountInfo(s,{commitment:"confirmed",encoding:"jsonParsed"}).send().catch((()=>null)),t.rpc.getAccountInfo(l,{commitment:"confirmed",encoding:"jsonParsed"}).send().catch((()=>null))]);if(!m?.value)throw Error(`Source token account does not exist for address: ${e}`);let d=B({payer:i,ata:l,owner:a,mint:o}),u=W(P({version:0}),(t=>D(i,t)),(t=>N(r,t)),(t=>c?.value?t:O(d,t)),(t=>O(R({source:s,destination:l,authority:i,amount:n}),t)),(t=>E(t)));return new Uint8Array(M().encode(u))}({solanaClient:vt,source:ht.address,destination:ft,amountInBaseUnits:t})).then(rt).catch((t=>{nt("error"),mt(t)}))}),[et,ct,dt,ut,ht,ft,wt,It]),r((()=>{"preparing"===et&&ot&&at({tx:ot,solanaClient:vt,amount:ct,asset:dt,tokenPrice:It}).then((t=>{nt("loaded"),st({amount:t?.amountInUsd??t?.amountInUsdc??t?.amountInSol??ct,fee:t?.feeInUsd??t?.feeInSol,total:t?.totalInUsd??t?.totalInSol})})).catch((t=>{nt("error"),mt(t)}))}),[ot,ct,dt,et,It]),r((()=>{"error"===et&&lt&&(V({errorModalData:{error:lt,previousScreen:"FundSolWalletWithExternalSolanaWallet"},solanaFundingData:S.solanaFundingData}),z("ErrorScreen",!1))}),[et,z]),r((()=>{if("success"!==et)return;let t=setTimeout(gt?()=>z(gt):I,y);return()=>clearTimeout(t)}),[et]),/*#__PURE__*/e(a,"success"===et?{children:[/*#__PURE__*/t(f,{}),/*#__PURE__*/t(m,{}),/*#__PURE__*/e(c,{children:[/*#__PURE__*/t(n,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/t(p,{title:"Success!",description:`You’ve successfully added ${ct} ${dt} to your ${v.name} wallet. It may take a minute before the funds are available to use.`})]}),/*#__PURE__*/t(d,{}),/*#__PURE__*/t(s,{})]}:"preparing"===et||"loaded"===et||"sending"===et?{children:[/*#__PURE__*/t(f,{}),/*#__PURE__*/t(u,{style:{marginTop:"16px"},children:/*#__PURE__*/t(g,{icon:ht?.standardWallet.icon,name:ht?.standardWallet.name})}),/*#__PURE__*/t(p,{style:{marginTop:"8px",marginBottom:"12px"},title:"sending"===et&&ht?`Confirming with ${ht.standardWallet.name}`:"Confirm transaction"}),/*#__PURE__*/t(K,{rows:[{label:"Source",value:i(pt.address)},{label:"Destination",value:i(ft)},{label:"Network",value:Y(ut)},{label:"Amount",value:it?.amount,isLoading:"preparing"===et},{label:"Estimated fee",value:it?.fee,isLoading:"preparing"===et},{label:"Total",value:it?.total,isLoading:"preparing"===et}]}),/*#__PURE__*/t(l,{style:{marginTop:"1rem"},loading:"preparing"===et||"sending"===et,onClick:function(){"loaded"===et&&ot&&ht&&(nt("sending"),async function({transaction:t,chain:e,sourceWallet:a,solanaClient:n}){let{hasFunds:o}=await Q({solanaClient:n,tx:t});if(!o)throw new L(`Wallet ${i(a.address)} does not have enough funds.`,void 0,k.INSUFFICIENT_BALANCE);let r=U((await a.signAndSendTransaction({transaction:t,chain:e}).catch((t=>{throw new L("Transaction was rejected by the user",t,k.TRANSACTION_FAILURE)}))).signature);return await X({rpcSubscriptions:n.rpcSubscriptions,signature:r,timeout:2e4}),r}({solanaClient:vt,transaction:ot,chain:ut,sourceWallet:ht}).then((t=>{nt("success"),w({eventName:b,payload:{provider:"external",status:"success",txHash:t,address:ht.address,value:ct,chainType:"solana",clusterName:ut,token:dt,destinationAddress:ft,destinationValue:ct,destinationChainType:"solana",destinationClusterName:ut,destinationToken:dt}})})).catch((t=>{nt("error"),mt(t)})))},children:"Confirm"}),/*#__PURE__*/t(s,{})]}:{children:[/*#__PURE__*/t(f,{}),/*#__PURE__*/t(h,{}),/*#__PURE__*/t("div",{style:{marginTop:"1rem"}}),/*#__PURE__*/t(s,{})]})}};export{nt as FundSolWalletWithExternalSolanaWallet,nt as default};
@@ -1 +0,0 @@
1
- import{jsxs as o,Fragment as t,jsx as r}from"react/jsx-runtime";import{useRef as e}from"react";import{c as i,B as m}from"./ModalHeader-cnW8OaHH.mjs";import{F as n}from"./Layouts-BlFm53ED.mjs";import{t as s}from"./FundWalletMethodHeader-B3nAPYAR.mjs";import{N as a}from"./index-Dq_xe9dz.mjs";import{T as p}from"./Title-BnzYV3Is.mjs";import{a as c}from"./get-is-unified-wallet-Bon2jknh.mjs";import{u as l}from"./useGetTokenPrice-DgKSvh6T.mjs";import{c as d}from"./ethers-Cr0T35kS.mjs";import{F as u,a as h,h as j,c as f,d as v}from"./styles-Fji1ReGu.mjs";import"styled-components";import"./context-i_OKSUqt.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./private-privy-provider-B2_rZ8aq.mjs";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./internal-context-D4S2Sfvt.mjs";import"ofetch";import"./paths-BzM95ysC.mjs";import"@scure/base";import"viem";import"uuid";import"jose";import"eventemitter3";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"js-cookie";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";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"./useGetSolPrice-usp7QcwI.mjs";import"./LinkPasskeyScreen-DhD51WvM.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-x3-Xgy2E.mjs";import"./Screen-DgjLPjok.mjs";const y={component:()=>{let{data:y,setModalData:C}=c(),g=y?.funding,k="solana"===g.chainType,x=e(null),{tokenPrice:D}=l(k?"solana":g.chain.id),S=k?void 0:g,T=!(!S?.erc20Address||S?.erc20ContractInfo),F=k?g.isUSDC?"USDC":"SOL":g.erc20Address?g.erc20ContractInfo?.symbol:g.chain.nativeCurrency.symbol||"ETH",I=parseFloat(g.amount),L=!isNaN(I)&&I>0,b=D?d(g.amount,D):void 0;/*#__PURE__*/return o(t,{children:[/*#__PURE__*/r(s,{}),/*#__PURE__*/r(p,{children:"Confirm or edit amount"}),/*#__PURE__*/o(n,{style:{marginTop:"32px"},children:[/*#__PURE__*/r(u,{children:T?/*#__PURE__*/r(a,{size:"50px"}):/*#__PURE__*/o(t,{children:[/*#__PURE__*/o(h,{onClick:()=>x.current?.focus(),children:[/*#__PURE__*/r(j,{ref:x,value:g.amount,onChange:o=>{let t=o.target.value;/^[0-9.]*$/.test(t)&&t.split(".").length-1<=1&&C({...y,funding:{...g,amount:t},solanaFundingData:y?.solanaFundingData?{...y.solanaFundingData,amount:t}:void 0})}}),/*#__PURE__*/r(f,{children:F})]}),!S?.erc20Address&&!(k&&g.isUSDC)&&/*#__PURE__*/r(v,{children:b&&L?`${b} USD`:""})]})}),/*#__PURE__*/r(i,{style:{marginTop:"1rem"},disabled:!L,onClick:g.onContinueWithExternalWallet,children:"Continue"})]}),/*#__PURE__*/r(m,{})]})}};export{y as FundingAmountEditScreen,y as default};
@@ -1 +0,0 @@
1
- import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import a from"@heroicons/react/24/outline/CreditCardIcon";import i from"@heroicons/react/24/outline/QrCodeIcon";import o from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import{useState as r,useEffect as c,useMemo as d}from"react";import{getAddress as s}from"viem/utils";import{B as l}from"./ModalHeader-cnW8OaHH.mjs";import{t as p}from"./FundWalletMethodHeader-B3nAPYAR.mjs";import{E as m}from"./ErrorBanner-CQERa7bL.mjs";import{I as h}from"./InfoBanner-Dk1KghcK.mjs";import{a as u}from"./context-i_OKSUqt.mjs";import{o as f,a0 as g,ab as y,ap as v}from"./private-privy-provider-B2_rZ8aq.mjs";import{P as C,u as w}from"./internal-context-D4S2Sfvt.mjs";import{a as F}from"./get-is-unified-wallet-Bon2jknh.mjs";import{W as M}from"./WalletCards-DH1rqayz.mjs";import{g as b}from"./getErc20TokenInfo-79BQbhYn.mjs";import{avalanche as S,arbitrum as x,polygon as W,optimism as I,base as j,mainnet as D,toCoinbaseAssetId as T,getCoinbaseOnRampUrl as k,chainToMoonpayCurrency as A,isSupportedChainIdForMoonpay as z,isSupportedChainIdForCoinbaseOnramp as L}from"@privy-io/js-sdk-core";import{trigger as E}from"@privy-io/popup";import{a as O}from"./index-Cp1MRWbr.mjs";import{e as U,I as _,f as H,g as P}from"./styles-Fji1ReGu.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"tinycolor2";import"mipd";import"react-device-detect";import"./paths-BzM95ysC.mjs";import"@scure/base";import"viem";import"uuid";import"jose";import"eventemitter3";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"ofetch";import"js-cookie";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";import"./analytics-mkkvFRju.mjs";import"./LinkPasskeyScreen-DhD51WvM.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-x3-Xgy2E.mjs";import"./Screen-DgjLPjok.mjs";import"./index-Dq_xe9dz.mjs";const B=t=>/*#__PURE__*/e("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 210.2",xmlSpace:"preserve",...t,children:/*#__PURE__*/e("path",{d:"M93.6,27.1C87.6,34.2,78,39.8,68.4,39c-1.2-9.6,3.5-19.8,9-26.1c6-7.3,16.5-12.5,25-12.9 C103.4,10,99.5,19.8,93.6,27.1 M102.3,40.9c-13.9-0.8-25.8,7.9-32.4,7.9c-6.7,0-16.8-7.5-27.8-7.3c-14.3,0.2-27.6,8.3-34.9,21.2 c-15,25.8-3.9,64,10.6,85c7.1,10.4,15.6,21.8,26.8,21.4c10.6-0.4,14.8-6.9,27.6-6.9c12.9,0,16.6,6.9,27.8,6.7 c11.6-0.2,18.9-10.4,26-20.8c8.1-11.8,11.4-23.3,11.6-23.9c-0.2-0.2-22.4-8.7-22.6-34.3c-0.2-21.4,17.5-31.6,18.3-32.2 C123.3,42.9,107.7,41.3,102.3,40.9 M182.6,11.9v155.9h24.2v-53.3h33.5c30.6,0,52.1-21,52.1-51.4c0-30.4-21.1-51.2-51.3-51.2H182.6z M206.8,32.3h27.9c21,0,33,11.2,33,30.9c0,19.7-12,31-33.1,31h-27.8V32.3z M336.6,169c15.2,0,29.3-7.7,35.7-19.9h0.5v18.7h22.4V90.2 c0-22.5-18-37-45.7-37c-25.7,0-44.7,14.7-45.4,34.9h21.8c1.8-9.6,10.7-15.9,22.9-15.9c14.8,0,23.1,6.9,23.1,19.6v8.6l-30.2,1.8 c-28.1,1.7-43.3,13.2-43.3,33.2C298.4,155.6,314.1,169,336.6,169z M343.1,150.5c-12.9,0-21.1-6.2-21.1-15.7c0-9.8,7.9-15.5,23-16.4 l26.9-1.7v8.8C371.9,140.1,359.5,150.5,343.1,150.5z M425.1,210.2c23.6,0,34.7-9,44.4-36.3L512,54.7h-24.6l-28.5,92.1h-0.5 l-28.5-92.1h-25.3l41,113.5l-2.2,6.9c-3.7,11.7-9.7,16.2-20.4,16.2c-1.9,0-5.6-0.2-7.1-0.4v18.7C417.3,210,423.3,210.2,425.1,210.2z"})}),R=n=>/*#__PURE__*/t("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 80 38.1",xmlSpace:"preserve",...n,children:[/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M37.8,19.7V29h-3V6h7.8c1.9,0,3.7,0.7,5.1,2c1.4,1.2,2.1,3,2.1,4.9c0,1.9-0.7,3.6-2.1,4.9c-1.4,1.3-3.1,2-5.1,2 L37.8,19.7L37.8,19.7z M37.8,8.8v8h5c1.1,0,2.2-0.4,2.9-1.2c1.6-1.5,1.6-4,0.1-5.5c0,0-0.1-0.1-0.1-0.1c-0.8-0.8-1.8-1.3-2.9-1.2 L37.8,8.8L37.8,8.8z"}),/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M56.7,12.8c2.2,0,3.9,0.6,5.2,1.8s1.9,2.8,1.9,4.8V29H61v-2.2h-0.1c-1.2,1.8-2.9,2.7-4.9,2.7 c-1.7,0-3.2-0.5-4.4-1.5c-1.1-1-1.8-2.4-1.8-3.9c0-1.6,0.6-2.9,1.8-3.9c1.2-1,2.9-1.4,4.9-1.4c1.8,0,3.2,0.3,4.3,1v-0.7 c0-1-0.4-2-1.2-2.6c-0.8-0.7-1.8-1.1-2.9-1.1c-1.7,0-3,0.7-3.9,2.1l-2.6-1.6C51.8,13.8,53.9,12.8,56.7,12.8z M52.9,24.2 c0,0.8,0.4,1.5,1,1.9c0.7,0.5,1.5,0.8,2.3,0.8c1.2,0,2.4-0.5,3.3-1.4c1-0.9,1.5-2,1.5-3.2c-0.9-0.7-2.2-1.1-3.9-1.1 c-1.2,0-2.2,0.3-3,0.9C53.3,22.6,52.9,23.3,52.9,24.2z"}),/*#__PURE__*/e("path",{style:{fill:"#5F6368"},d:"M80,13.3l-9.9,22.7h-3l3.7-7.9l-6.5-14.7h3.2l4.7,11.3h0.1l4.6-11.3H80z"}),/*#__PURE__*/e("path",{style:{fill:"#4285F4"},d:"M25.9,17.7c0-0.9-0.1-1.8-0.2-2.7H13.2v5.1h7.1c-0.3,1.6-1.2,3.1-2.6,4v3.3H22C24.5,25.1,25.9,21.7,25.9,17.7z"}),/*#__PURE__*/e("path",{style:{fill:"#34A853"},d:"M13.2,30.6c3.6,0,6.6-1.2,8.8-3.2l-4.3-3.3c-1.2,0.8-2.7,1.3-4.5,1.3c-3.4,0-6.4-2.3-7.4-5.5H1.4v3.4 C3.7,27.8,8.2,30.6,13.2,30.6z"}),/*#__PURE__*/e("path",{style:{fill:"#FBBC04"},d:"M5.8,19.9c-0.6-1.6-0.6-3.4,0-5.1v-3.4H1.4c-1.9,3.7-1.9,8.1,0,11.9L5.8,19.9z"}),/*#__PURE__*/e("path",{style:{fill:"#EA4335"},d:"M13.2,9.4c1.9,0,3.7,0.7,5.1,2l0,0l3.8-3.8c-2.4-2.2-5.6-3.5-8.8-3.4c-5,0-9.6,2.8-11.8,7.3l4.4,3.4 C6.8,11.7,9.8,9.4,13.2,9.4z"})]}),V=e=>{let[t,n]=r();return c((()=>{e().then((e=>{n(e)})).catch((()=>{}))}),[]),t};function N(e){let t=q[e];if(!t)throw new C(`Unsupported chainId: ${e} for Coinbase Onramp`);return t}let q={[D.id]:"ethereum",[j.id]:"base",[I.id]:"optimism",[W.id]:"polygon",[x.id]:"arbitrum",[S.id]:"avacchain"};const Q=(e,t,n,a,i,o)=>new Promise((async(r,c)=>{let d=E();if(!d)return void c(Error("Unable to initialize flow"));let s="ethereum"===t.chainType?N(t.chain.id):"solana",l=t.isUSDC?"USDC":"ethereum"===t.chainType?T(t.chain.id,"native-currency"):"SOL",p=await e.initCoinbaseOnRamp({addresses:[{address:t.address,blockchains:[s]}],assets:[l]}),{url:m}=k({appId:e.getAppId(),input:p,amount:t.amount,blockchain:s,asset:l,experience:o});d.location=m.toString();let h={...i?.funding,showAlternateFundingMethod:!0};t.usingDefaultFundingMethod&&(h.usingDefaultFundingMethod=!1),n({funding:h,solanaFundingData:i?.solanaFundingData,coinbaseOnrampStatus:{popup:d}}),a("CoinbaseOnrampStatusScreen"),e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp",value:t.amount,chainType:t.chainType,chainId:"ethereum"===t.chainType?t.chain.id:t.chain}}),setTimeout((()=>{n({funding:h,solanaFundingData:i?.solanaFundingData,coinbaseOnrampStatus:{partnerUserId:p.partner_user_id,popup:d}})}),5e3),r()})),$=async(e,t,n,a,i,o,r,c)=>{let d=E();if(!d)throw Error("Unable to initialize flow");let s="ethereum"===t.chainType?A(t.chain.id,a):t.isUSDC?"USDC_SOL":"SOL",{signedUrl:l,externalTransactionId:p}=await e.signMoonpayOnRampUrl({address:t.address,useSandbox:n.fundingMethodConfig.moonpay.useSandbox??!1,config:{uiConfig:{accentColor:n.appearance.palette.accent,theme:n.appearance.palette.colorScheme},paymentMethod:c,currencyCode:s,quoteCurrencyAmount:O(t.amount)}});e.createAnalyticsEvent({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"moonpay",value:t.amount,chainType:t.chainType,chainId:"ethereum"===t.chainType?t.chain.id:t.chain}}),d.location=l;let m={...r?.funding,showAlternateFundingMethod:!0};t.usingDefaultFundingMethod&&(m.usingDefaultFundingMethod=!1),i({moonpayStatus:{},funding:m,solanaFundingData:r?.solanaFundingData}),o("MoonpayStatusScreen"),setTimeout((()=>{i({moonpayStatus:{externalTransactionId:p},funding:m,solanaFundingData:r?.solanaFundingData})}),8e3)};let K=async e=>"undefined"!=typeof window&&"PaymentRequest"in window&&await new window.PaymentRequest([{supportedMethods:e}],{id:"0",total:{label:"Item",amount:{currency:"USD",value:"1.00"}}}).canMakePayment();const X=()=>K("https://apple.com/apple-pay"),G=()=>K("https://google.com/pay"),J={component:()=>{let{wallets:r}=f(),{connectors:C}=w(),S=C.filter(g).flatMap((e=>e.wallets)),{navigate:x,data:W,setModalData:I}=F(),{client:j}=w(),D=u(),T=W?.funding,k=V(X),A=V(G),E="solana"===T.chainType,O=E?void 0:T,N=d((()=>((e,t,n,a,i,o)=>{let r,c,d="solana"===n.chainType,s=d?void 0:n,l=n.isUSDC?"USDC":s?.erc20Address?void 0:"native-currency",p=!!d||l&&z(Number(n.chain.id),l),m=!!d||l&&L(Number(n.chain.id),l),h=[];for(let r of(n.preferredCardProvider&&n.supportedOptions.sort((e=>e.provider===n.preferredCardProvider?-1:1)),n.supportedOptions))"card"===r.method&&"coinbase"===r.provider&&m&&h.push((()=>Q(t,n,a,i,o,"buy"))),"card"===r.method&&"moonpay"===r.provider&&p&&l&&h.push((()=>$(t,n,e,l,a,i,o,"credit_debit_card")));for(let e of n.supportedOptions)"exchange"===e.method&&"coinbase"===e.provider&&m&&(r=()=>Q(t,n,a,i,o,"buy"));for(let e of o?.funding?.supportedOptions??[])"wallets"===e.method&&(c=()=>i("TransferFromWalletScreen"));return{onFundWithCard:h,onFundWithExchange:r,onFundWithWallet:c}})(D,j,T,I,x,W)),[D,j,T,W,I,x]),q=E?S.find((({address:e})=>e===T.address)):r.find((({address:e})=>s(e)===s(T.address))),K=y(q?.walletClientType||"unknown"),J=K?.name||"wallet",Y=q&&"privy"!==q.walletClientType?J:D.name,Z=d((()=>T.uiConfig?.landing?.title?T.uiConfig?.landing?.title:`Add funds to your ${Y?.toLowerCase().endsWith("wallet")?Y:Y+" wallet"}`),[T.uiConfig?.landing?.title,Y]);c((()=>{if(T?.defaultFundingMethod&&T.usingDefaultFundingMethod)switch(I({funding:{...T,usingDefaultFundingMethod:!1},solanaFundingData:W?.solanaFundingData}),T?.defaultFundingMethod){case"card":N.onFundWithCard[0]&&N.onFundWithCard[0]();break;case"exchange":N.onFundWithExchange&&N.onFundWithExchange();break;case"wallet":N.onFundWithWallet&&N.onFundWithWallet();break;case"manual":x("ManualTransferScreen")}}),[]),c((()=>{O?.erc20Address&&!O.erc20ContractInfo&&b({address:O.erc20Address,chain:O.chain,rpcConfig:D.rpcConfig,privyAppId:D.id}).then((e=>{I({...W,funding:{...O,erc20ContractInfo:e?{symbol:e.symbol,decimals:e.decimals}:void 0}})})).catch(console.error)}),[O?.erc20Address,O?.chain]);let ee=!(!O?.erc20Address||O?.erc20ContractInfo);/*#__PURE__*/return t(n,{children:[/*#__PURE__*/e(p,{}),/*#__PURE__*/e("h3",{children:Z}),/*#__PURE__*/t(U,{children:[T.errorMessage&&/*#__PURE__*/e(m,{theme:D.appearance.palette.colorScheme,children:T.errorMessage}),N.onFundWithCard?.[0]&&/*#__PURE__*/t(v,{disabled:ee,onClick:N.onFundWithCard[0],children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(a,{style:{width:24}})}),"Pay with card",k?/*#__PURE__*/e(B,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):A?/*#__PURE__*/e(R,{style:{marginLeft:"auto",maxWidth:"100%",width:"auto",height:"0.875rem"}}):null]}),N.onFundWithExchange&&/*#__PURE__*/t(v,{disabled:ee,onClick:N.onFundWithExchange,children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(o,{style:{width:24}})}),"Transfer from an exchange"]}),N.onFundWithWallet&&/*#__PURE__*/t(v,{disabled:ee,onClick:N.onFundWithWallet,children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(M,{style:{width:24}})}),"Transfer from wallet"]}),/*#__PURE__*/t(v,{disabled:ee,onClick:()=>x("ManualTransferScreen"),children:[/*#__PURE__*/e(_,{children:/*#__PURE__*/e(i,{style:{width:24}})}),"Receive funds"]}),T?.showAlternateFundingMethod&&N.onFundWithCard?.[1]&&/*#__PURE__*/e(h,{theme:D.appearance.palette.colorScheme,children:/*#__PURE__*/t(H,{children:["Having trouble or facing location restrictions?"," ",/*#__PURE__*/e(P,{onClick:N.onFundWithCard[1],children:"Try a different provider."})]})})]}),/*#__PURE__*/e(l,{})]})}};export{J as FundingMethodSelectionScreen,J as default};
@@ -1 +0,0 @@
1
- import{jsx as o}from"react/jsx-runtime";import{ExternalLink as r}from"lucide-react";import{u as t}from"./internal-context-D4S2Sfvt.mjs";import{S as e}from"./ScreenLayout-x3-Xgy2E.mjs";import"ofetch";import"react";import"./ModalHeader-cnW8OaHH.mjs";import"styled-components";import"./context-i_OKSUqt.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./private-privy-provider-B2_rZ8aq.mjs";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-BzM95ysC.mjs";import"@scure/base";import"viem";import"uuid";import"jose";import"./get-is-unified-wallet-Bon2jknh.mjs";import"eventemitter3";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"js-cookie";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";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"./Screen-DgjLPjok.mjs";import"./index-Dq_xe9dz.mjs";const i=({onClose:t})=>/*#__PURE__*/o(e,{title:"Could not log in with provider",subtitle:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",icon:r,primaryCta:{label:"Close",onClick:t},watermark:!0}),m={component:()=>{let{closePrivyModal:r}=t();/*#__PURE__*/return o(i,{onClose:()=>r()})}};export{m as InAppBrowserLoginNotPossible,i as InAppBrowserLoginNotPossibleView,m as default};
@@ -1 +0,0 @@
1
- import{jsx as t,jsxs as e,Fragment as r}from"react/jsx-runtime";import{L as o}from"./Link-DJ5gq9Di.mjs";import{T as i,a}from"./TodoList-CgrU7uwu.mjs";import{a as l}from"./get-is-unified-wallet-Bon2jknh.mjs";import{S as n}from"./ScreenLayout-x3-Xgy2E.mjs";import"styled-components";import"lucide-react";import"react";import"viem";import"./context-i_OKSUqt.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-D4S2Sfvt.mjs";import"ofetch";import"./ModalHeader-cnW8OaHH.mjs";import"./private-privy-provider-B2_rZ8aq.mjs";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-BzM95ysC.mjs";import"@scure/base";import"uuid";import"jose";import"eventemitter3";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"js-cookie";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";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"./Screen-DgjLPjok.mjs";import"./index-Dq_xe9dz.mjs";const m=({walletName:l,installLink:m,title:s,subtitle:p="Follow the instructions below to get started.",onReload:c,onBack:d})=>{let h=s||`Create a ${l} wallet`.replace(/wallet wallet/gi,"wallet");/*#__PURE__*/return t(n,{title:h,subtitle:p,onBack:d,showBack:!0,primaryCta:{label:"Reload the page to use your wallet",onClick:c},helpText:/*#__PURE__*/e(r,{children:[/*#__PURE__*/t("span",{children:"Still not sure? "}),/*#__PURE__*/t(o,{size:"sm",target:"_blank",href:"https://solana.com/docs/intro/wallets",children:"Learn more"})]}),watermark:!0,children:/*#__PURE__*/e(i,{children:[/*#__PURE__*/t(a,{children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/t("span",{children:"Install the "})," ",/*#__PURE__*/e(o,{href:m,target:"_blank",children:[l," browser extension"]})]})}),/*#__PURE__*/t(a,{children:"Set up your first wallet"}),/*#__PURE__*/t(a,{children:"Store your recovery phrase in a safe place!"})]})})},s={component:()=>{let{navigateBack:e,data:r}=l();if(!r?.installWalletModalData)throw Error("Wallet data is missing");let{walletConfig:o}=r.installWalletModalData;/*#__PURE__*/return t(m,{walletName:o.name,installLink:o.installLink,onReload:()=>{window.location.reload()},onBack:e})}};export{s as InstallWalletScreen,m as InstallWalletScreenView,s as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{a as o}from"./context-i_OKSUqt.mjs";import{C as r,L as i}from"./CustomLandingScreenView-82pnUZOi.mjs";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"./ModalHeader-cnW8OaHH.mjs";import"./private-privy-provider-B2_rZ8aq.mjs";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./internal-context-D4S2Sfvt.mjs";import"ofetch";import"./paths-BzM95ysC.mjs";import"@scure/base";import"viem";import"uuid";import"jose";import"./get-is-unified-wallet-Bon2jknh.mjs";import"eventemitter3";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"js-cookie";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";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"./ConnectWalletView-BtuPwm-c.mjs";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"./copy-Bx2Jwc5_.mjs";import"./Link-DJ5gq9Di.mjs";import"./QrCode-BVe4kf2z.mjs";import"qrcode";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"./useI18n-DleS41MU.mjs";import"./WalletCards-DH1rqayz.mjs";import"./state-BG13el3v.mjs";import"./Screen-DgjLPjok.mjs";import"./index-Dq_xe9dz.mjs";import"lucide-react";import"./ConnectEmailForm-c2xnQzqc.mjs";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./farcaster-DPlSjvF5.mjs";import"@heroicons/react/24/outline/FingerPrintIcon";import"./ConnectPhoneForm-C1eL0VZH.mjs";import"./twitter-BoAxhlj6.mjs";import"./twitch-5IOe4sIQ.mjs";import"./telegram-B-JqnkqZ.mjs";import"./WalletOverflowButton-i2nGLvV0.mjs";import"./ScreenLayout-x3-Xgy2E.mjs";const e={component:()=>{let e=o();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?/*#__PURE__*/t(r,{connectOnly:!1}):/*#__PURE__*/t(i,{connectOnly:!1})},isCaptchaRequired:!0,isUnauthenticatedScreem:!0};export{e as LandingScreen,e as default};
@@ -1 +0,0 @@
1
- import{jsx as o}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/EnvelopeIcon";import{C as r}from"./ConnectEmailForm-c2xnQzqc.mjs";import{B as i}from"./Layouts-BlFm53ED.mjs";import{a as e}from"./context-i_OKSUqt.mjs";import{S as m}from"./ScreenLayout-x3-Xgy2E.mjs";import"lucide-react";import"react";import"styled-components";import"./internal-context-D4S2Sfvt.mjs";import"ofetch";import"./private-privy-provider-B2_rZ8aq.mjs";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/js-sdk-core";import"@privy-io/popup";import"./paths-BzM95ysC.mjs";import"@scure/base";import"viem";import"uuid";import"jose";import"./get-is-unified-wallet-Bon2jknh.mjs";import"eventemitter3";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"js-cookie";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";import"./ModalHeader-cnW8OaHH.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"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"./EmailInputForm-Dgoii4vf.mjs";import"./ErrorMessage-D8VaAP5m.mjs";import"tinycolor2";import"./Screen-DgjLPjok.mjs";import"./index-Dq_xe9dz.mjs";const p=({title:e="Connect your email",subtitle:p="Add your email to your account"})=>/*#__PURE__*/o(m,{title:e,subtitle:p,icon:t,watermark:!0,children:/*#__PURE__*/o(i,{children:/*#__PURE__*/o(r,{stacked:!0})})}),s={component:()=>{let t=e();/*#__PURE__*/return o(p,{subtitle:`Add your email to your ${t?.name} account`})}};export{s as LinkEmailScreen,p as LinkEmailScreenView,s as default};
@@ -1,105 +0,0 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import{CheckCircle as o,FingerprintIcon as i,Trash2 as t}from"lucide-react";import{useState as n,useEffect as a}from"react";import{styled as s,css as c}from"styled-components";import{Y as l}from"./private-privy-provider-B2_rZ8aq.mjs";import{T as d,a as p}from"./TodoList-CgrU7uwu.mjs";import{u as m,c as h,a as u}from"./internal-context-D4S2Sfvt.mjs";import{u as y}from"./get-is-unified-wallet-Bon2jknh.mjs";import{S as f}from"./ScreenLayout-x3-Xgy2E.mjs";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/js-sdk-core";import"@privy-io/popup";import"./paths-BzM95ysC.mjs";import"@scure/base";import"viem";import"uuid";import"jose";import"eventemitter3";import"zustand";import"./context-i_OKSUqt.mjs";import"tinycolor2";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"ofetch";import"js-cookie";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";import"./ModalHeader-cnW8OaHH.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"./Screen-DgjLPjok.mjs";import"./index-Dq_xe9dz.mjs";const v=({passkeys:r,isLoading:t,errorReason:n,success:a,expanded:s,onLinkPasskey:c,onUnlinkPasskey:l,onExpand:d,onBack:p,onClose:m})=>/*#__PURE__*/e(f,a?{title:"Passkeys updated",icon:o,iconVariant:"success",primaryCta:{label:"Done",onClick:m},onClose:m,watermark:!0}:s?{icon:i,title:"Your passkeys",onBack:p,onClose:m,watermark:!0,children:/*#__PURE__*/e(g,{passkeys:r,expanded:s,onUnlink:l,onExpand:d})}:{icon:i,title:"Set up passkey verification",subtitle:"Verify with passkey",primaryCta:{label:"Add new passkey",onClick:c,loading:t},onClose:m,watermark:!0,helpText:n||void 0,children:0===r.length?/*#__PURE__*/e(x,{}):/*#__PURE__*/e(k,{children:/*#__PURE__*/e(g,{passkeys:r,expanded:s,onUnlink:l,onExpand:d})})});let k=s.div`
2
- margin-bottom: 12px;
3
- `,g=({passkeys:o,expanded:i,onUnlink:a,onExpand:s})=>{let[c,d]=n([]),p=i?o.length:2;/*#__PURE__*/return r("div",{children:[/*#__PURE__*/e(I,{children:"Your passkeys"}),/*#__PURE__*/r(E,{children:[o.slice(0,p).map((o=>{/*#__PURE__*/return r(P,{children:[/*#__PURE__*/r("div",{children:[/*#__PURE__*/e(A,{children:(i=o,i.authenticatorName?i.createdWithBrowser?`${i.authenticatorName} on ${i.createdWithBrowser}`:i.authenticatorName:i.createdWithBrowser?i.createdWithOs?`${i.createdWithBrowser} on ${i.createdWithOs}`:`${i.createdWithBrowser}`:"Unknown device")}),/*#__PURE__*/r(L,{children:["Last used:"," ",(o.latestVerifiedAt??o.firstVerifiedAt)?.toLocaleString()??"N/A"]})]}),/*#__PURE__*/e(S,{disabled:c.includes(o.credentialId),onClick:()=>(async e=>{d((r=>r.concat([e]))),await a(e),d((r=>r.filter((r=>r!==e))))})(o.credentialId),children:c.includes(o.credentialId)?/*#__PURE__*/e(l,{}):/*#__PURE__*/e(t,{size:16})})]},o.credentialId);var i})),o.length>2&&!i&&/*#__PURE__*/e(C,{onClick:s,children:"View all"})]})]})},x=()=>/*#__PURE__*/r(d,{style:{color:"var(--privy-color-foreground)"},children:[/*#__PURE__*/e(p,{children:"Verify with Touch ID, Face ID, PIN, or hardware key"}),/*#__PURE__*/e(p,{children:"Takes seconds to set up and use"}),/*#__PURE__*/e(p,{children:"Use your passkey to verify transactions and login to your account"})]});const w={component:()=>{let{user:r,unlinkPasskey:o}=y(),{linkWithPasskey:i,closePrivyModal:t}=m(),s=r?.linkedAccounts.filter((e=>"passkey"===e.type)),[c,l]=n(!1),[d,p]=n(""),[f,k]=n(!1),[g,x]=n(!1);return a((()=>{0===s.length&&x(!1)}),[s.length]),/*#__PURE__*/e(v,{passkeys:s,isLoading:c,errorReason:d,success:f,expanded:g,onLinkPasskey:()=>{l(!0),i().then((()=>k(!0))).catch((e=>{if(e instanceof h){if(e.privyErrorCode===u.CANNOT_LINK_MORE_OF_TYPE)return void p("Cannot link more passkeys to account.");if(e.privyErrorCode===u.PASSKEY_NOT_ALLOWED)return void p("Passkey request timed out or rejected by user.")}p("Unknown error occurred.")})).finally((()=>{l(!1)}))},onUnlinkPasskey:async e=>(l(!0),await o(e).then((()=>k(!0))).catch((e=>{e instanceof h&&e.privyErrorCode===u.MISSING_MFA_CREDENTIALS?p("Cannot unlink a passkey enrolled in MFA"):p("Unknown error occurred.")})).finally((()=>{l(!1)}))),onExpand:()=>x(!0),onBack:()=>x(!1),onClose:()=>t()})}},j=s.div`
4
- display: flex;
5
- align-items: center;
6
- justify-content: center;
7
- width: 180px;
8
- height: 90px;
9
- border-radius: 50%;
10
- svg + svg {
11
- margin-left: 12px;
12
- }
13
- > svg {
14
- z-index: 2;
15
- color: var(--privy-color-accent) !important;
16
- stroke: var(--privy-color-accent) !important;
17
- fill: var(--privy-color-accent) !important;
18
- }
19
- `;let b=c`
20
- && {
21
- width: 100%;
22
- font-size: 0.875rem;
23
- line-height: 1rem;
24
-
25
- /* Tablet and Up */
26
- @media (min-width: 440px) {
27
- font-size: 14px;
28
- }
29
-
30
- display: flex;
31
- gap: 12px;
32
- justify-content: center;
33
-
34
- padding: 6px 8px;
35
- background-color: var(--privy-color-background);
36
- transition: background-color 200ms ease;
37
- color: var(--privy-color-accent) !important;
38
-
39
- :focus {
40
- outline: none;
41
- box-shadow: none;
42
- }
43
- }
44
- `;const C=s.button`
45
- ${b}
46
- `;let E=s.div`
47
- display: flex;
48
- flex-direction: column;
49
- align-items: stretch;
50
- gap: 0.8rem;
51
- padding: 0.5rem 0rem 0rem;
52
- flex-grow: 1;
53
- width: 100%;
54
- `,I=s.div`
55
- line-height: 20px;
56
- height: 20px;
57
- font-size: 1em;
58
- font-weight: 450;
59
- display: flex;
60
- justify-content: flex-beginning;
61
- width: 100%;
62
- `,A=s.div`
63
- font-size: 1em;
64
- line-height: 1.3em;
65
- font-weight: 500;
66
- color: var(--privy-color-foreground-2);
67
- padding: 0.2em 0;
68
- `,L=s.div`
69
- font-size: 0.875rem;
70
- line-height: 1rem;
71
- color: #64668b;
72
- padding: 0.2em 0;
73
- `,P=s.div`
74
- display: flex;
75
- align-items: center;
76
- justify-content: space-between;
77
- padding: 1em;
78
- gap: 10px;
79
- font-size: 0.875rem;
80
- line-height: 1rem;
81
- text-align: left;
82
- border-radius: 8px;
83
- border: 1px solid #e2e3f0 !important;
84
- width: 100%;
85
- height: 5em;
86
- `,N=c`
87
- :focus,
88
- :hover,
89
- :active {
90
- outline: none;
91
- }
92
- display: flex;
93
- width: 2em;
94
- height: 2em;
95
- justify-content: center;
96
- align-items: center;
97
- svg {
98
- color: var(--privy-color-error);
99
- }
100
- svg:hover {
101
- color: var(--privy-color-foreground-3);
102
- }
103
- `,S=s.button`
104
- ${N}
105
- `;export{j as DoubleIconWrapper,C as LinkButton,w as LinkPasskeyScreen,v as LinkPasskeyView,w as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import o from"@heroicons/react/24/outline/PhoneIcon";import{useState as r}from"react";import{C as e}from"./ConnectPhoneForm-C1eL0VZH.mjs";import{a as i}from"./context-i_OKSUqt.mjs";import{u as n}from"./internal-context-D4S2Sfvt.mjs";import{a as m}from"./get-is-unified-wallet-Bon2jknh.mjs";import{S as a}from"./ScreenLayout-x3-Xgy2E.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"./private-privy-provider-B2_rZ8aq.mjs";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-BzM95ysC.mjs";import"@scure/base";import"viem";import"uuid";import"jose";import"eventemitter3";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"ofetch";import"js-cookie";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";import"./ModalHeader-cnW8OaHH.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"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"tinycolor2";import"./Screen-DgjLPjok.mjs";import"./index-Dq_xe9dz.mjs";const p=({title:i="Connect your phone",subtitle:n="Add your number to your account",onSubmit:m,isSubmitting:p=!1})=>{let[s,c]=r(null),u=async()=>{s?.qualifiedPhoneNumber&&await m(s)};/*#__PURE__*/return t(a,{title:i,subtitle:n,icon:o,primaryCta:{label:p?"Submitting":"Submit",onClick:u,disabled:!s?.isValid||p},watermark:!0,children:/*#__PURE__*/t(e,{onChange:t=>{c(t)},onSubmit:u,noIncludeSubmitButton:!0,hideRecent:!0})})},s={component:()=>{let{currentScreen:o,data:e,navigate:a,setModalData:s}=m(),c=i(),{initLoginWithSms:u}=n(),[l,d]=r(!1);/*#__PURE__*/return t(p,{subtitle:`Add your number to your ${c?.name} account`,onSubmit:async t=>{d(!0);try{await u({phoneNumber:t.qualifiedPhoneNumber,withPrivyUi:!0}),a("AwaitingPasswordlessCodeScreen")}catch(t){s({errorModalData:{error:t,previousScreen:e?.errorModalData?.previousScreen||o||"LinkPhoneScreen"}}),a("ErrorScreen")}finally{d(!1)}},isSubmitting:l})}};export{s as LinkPhoneScreen,p as LinkPhoneScreenView,s as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{XCircle as o}from"lucide-react";import{u as r}from"./internal-context-D4S2Sfvt.mjs";import{a as e}from"./get-is-unified-wallet-Bon2jknh.mjs";import{S as i}from"./ScreenLayout-x3-Xgy2E.mjs";import"ofetch";import"react";import"viem";import"./context-i_OKSUqt.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./ModalHeader-cnW8OaHH.mjs";import"styled-components";import"./private-privy-provider-B2_rZ8aq.mjs";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-BzM95ysC.mjs";import"@scure/base";import"uuid";import"jose";import"eventemitter3";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"js-cookie";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";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"./Screen-DgjLPjok.mjs";import"./index-Dq_xe9dz.mjs";const a=({title:r="Could not connect with wallet",subtitle:e="Please check that Phantom multichain is enabled and try again.",primaryCtaText:a="Try again",secondaryCtaText:m="Cancel",onTryAgain:n,onCancel:p})=>/*#__PURE__*/t(i,{title:r,subtitle:e,icon:o,iconVariant:"error",primaryCta:{label:a,onClick:n},secondaryCta:{label:m,onClick:p},watermark:!0}),m={component:()=>{let{closePrivyModal:o}=r(),{navigate:i}=e();/*#__PURE__*/return t(a,{onTryAgain:()=>{i("LandingScreen")},onCancel:async()=>{await o()}})}};export{m as LoginFailedScreen,a as LoginFailedScreenView,m as default};
@@ -1 +0,0 @@
1
- import{jsx as e,Fragment as r,jsxs as t}from"react/jsx-runtime";import{useState as o,useEffect as a,useMemo as i}from"react";import{formatUnits as n}from"viem";import{formatTokenAmount as s,formatWeiAmount as c}from"@privy-io/js-sdk-core";import{P as m,B as d}from"./ModalHeader-cnW8OaHH.mjs";import{F as l}from"./Layouts-BlFm53ED.mjs";import{Q as p}from"./QrCode-BVe4kf2z.mjs";import{t as u}from"./FundWalletMethodHeader-B3nAPYAR.mjs";import{I as f}from"./InfoBanner-Dk1KghcK.mjs";import{S as h}from"./Subtitle-CV-2yKE4.mjs";import{T as v}from"./Title-BnzYV3Is.mjs";import{W as g}from"./WalletInfoCard-CR6-S95l.mjs";import{a as y}from"./context-i_OKSUqt.mjs";import{o as C,a0 as j,S,aZ as I,b1 as T}from"./private-privy-provider-B2_rZ8aq.mjs";import{u as w}from"./internal-context-D4S2Sfvt.mjs";import{a as b}from"./get-is-unified-wallet-Bon2jknh.mjs";import{u as k}from"./useWalletBalance-CMO_I7jz.mjs";import{O as A}from"./analytics-mkkvFRju.mjs";import{g as F}from"./getChainName-DjpPdUSc.mjs";import{g as M}from"./getUsdcMintAddress-DFI1hv05.mjs";import{g as D}from"./transaction-CnfuREWo.mjs";import{g as B}from"./getErc20Balance-BDNkB-EL.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"qrcode";import"@heroicons/react/24/outline/InformationCircleIcon";import"lucide-react";import"./ErrorMessage-D8VaAP5m.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Address-CDF4d_Ha.mjs";import"./shared-FM0rljBt.mjs";import"tinycolor2";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-BzM95ysC.mjs";import"@scure/base";import"uuid";import"jose";import"eventemitter3";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"ofetch";import"js-cookie";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";const U={component:()=>{let{wallets:T}=C(),{connectors:U}=w(),E=U.filter(j).flatMap((e=>e.wallets)),{data:L,setModalData:x,navigate:O,lastScreen:R}=b(),{rpcConfig:W,appId:z,createAnalyticsEvent:H,closePrivyModal:N}=w(),P=y(),[Q,q]=o(void 0),[X,G]=o(!1),Y=L?.funding,{reloadBalance:Z}=k({rpcConfig:W,appId:z,address:"ethereum"===Y.chainType?Y.address:void 0,chain:"ethereum"===Y.chainType?Y.chain:void 0}),J="solana"===Y.chainType,K=J?Y.isUSDC?"USDC":"SOL":Y.erc20Address?Y.erc20ContractInfo?.symbol:Y.chain.nativeCurrency.symbol,V=J?E.find((({address:e})=>e===Y.address)):T.find((({address:e})=>S(e)===S(Y.address)));if(!Y)return x({errorModalData:{error:Error("Couldn't find funding config"),previousScreen:R||"FundingMethodSelectionScreen"},funding:L?.funding,solanaFundingData:L?.solanaFundingData,sendTransaction:L?.sendTransaction}),O("ErrorScreen"),/*#__PURE__*/e(r,{});a((()=>{let e=J?async function(){if("solana"!==Y.chainType)return;let e=P.solanaRpcs[Y.chain];e?(Y.isUSDC?async function({rpc:e,address:r,mintAddress:t}){let o=await e.getTokenAccountsByOwner(r,{mint:t},{encoding:"jsonParsed",commitment:"confirmed"}).send(),a=o.value[0]?.account;return a?BigInt(a.data.parsed.info.tokenAmount.amount):0n}({rpc:e.rpc,address:Y.address,mintAddress:M(Y.chain)}):I({rpc:e.rpc,address:Y.address})).then((e=>{let r=BigInt(e);Q&&r>Q&&(G(!0),H({eventName:A,payload:{provider:"manual",status:"success",chainType:"solana",address:V?.address,value:Y.isUSDC?n(r-Q,6):n(r-Q,9),token:Y.isUSDC?"USDC":"SOL"}})),q(r)})):console.warn("Unable to load solana rpc, skipping balance")}:async function(){"ethereum"===Y.chainType&&(async()=>{if(!Y.erc20Address)return await Z()??BigInt(0);{let{balance:e}=await B({chain:Y.chain,address:Y.address,erc20Address:Y.erc20Address,rpcConfig:W,appId:z});return e}})().then((e=>{Q&&e>Q&&(G(!0),H({eventName:A,payload:{provider:"manual",status:"success",chainType:"ethereum",address:V?.address,chainId:Y.chain.id,value:n(e-Q,Y.erc20ContractInfo?.decimals??18),token:Y.erc20ContractInfo?.symbol??Y.erc20Address??"ETH"}})),q(e)})).catch((()=>q(void 0)))},r=setInterval(e,2e3);return e(),()=>clearInterval(r)}),[Q]);let _=i((()=>null==Q?"":Y.isUSDC?s({amount:Q,decimals:6}):J?D(Q,3,!0,!0):null!=Y.erc20ContractInfo?.decimals?s({amount:Q,decimals:Y.erc20ContractInfo.decimals}):c({wei:Q})),[Q,J,Y]),ee="ethereum"===Y.chainType?Y.chain.name:F(Y.chain),re=i((()=>""===Y.uiConfig?.receiveFundsTitle?null:/*#__PURE__*/e(v,{children:Y.uiConfig?.receiveFundsTitle??`Receive ${Y.amount} ${K??""}`.trim()})),[Y.uiConfig?.receiveFundsTitle,Y.amount,K]),te=i((()=>""===Y.uiConfig?.receiveFundsSubtitle?null:/*#__PURE__*/e(h,{children:Y.uiConfig?.receiveFundsSubtitle??`Scan this code or copy your wallet address to receive funds on ${ee}.`})),[Y.uiConfig?.receiveFundsSubtitle,ee]),oe="solana"===Y.chainType&&Y.isUSDC&&M(Y.chain)?`?spl-token=${M(Y.chain)}`:"";/*#__PURE__*/return t(r,{children:[/*#__PURE__*/e(u,{}),re,te,/*#__PURE__*/t(l,{style:{gap:"1rem",margin:re||te?"1rem 0":"0"},children:[/*#__PURE__*/e(p,{url:`${Y.chainType}:${Y.address}${oe}`,size:200,squareLogoElement:$}),/*#__PURE__*/t(f,{theme:P.appearance.palette.colorScheme,children:["Make sure to send funds on ",ee,"."]}),/*#__PURE__*/e(g,{title:"Your wallet",errMsg:void 0,showCopyButton:!0,balance:`${_} ${K}`,address:Y.address}),X&&/*#__PURE__*/e(m,{onClick:()=>N({shouldCallAuthOnSuccess:!1,isSuccess:!0}),children:"Continue"})]}),/*#__PURE__*/e(d,{})]})}};let $=({...r})=>/*#__PURE__*/e(T,{color:"black",...r});export{U as ManualTransferScreen,U as default};
@@ -1 +0,0 @@
1
- import{jsxs as e,Fragment as o,jsx as t}from"react/jsx-runtime";import r from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import i from"@heroicons/react/24/outline/ShieldCheckIcon";import{useState as n}from"react";import{M as a,b as s,P as l}from"./ModalHeader-cnW8OaHH.mjs";import{ao as m}from"./private-privy-provider-B2_rZ8aq.mjs";import{a as c}from"./context-i_OKSUqt.mjs";import{u as p,a as u}from"./get-is-unified-wallet-Bon2jknh.mjs";import{M as d,E as h,a as y,b as f}from"./EnrollTotp-Bk2mWeF6.mjs";import{A as v,C as k,I as j,T as g,S as M,B as w}from"./PinInput-3SLvbnQa.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./internal-context-D4S2Sfvt.mjs";import"ofetch";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/js-sdk-core";import"@privy-io/popup";import"./paths-BzM95ysC.mjs";import"@scure/base";import"viem";import"uuid";import"jose";import"eventemitter3";import"zustand";import"@coinbase/wallet-sdk";import"@walletconnect/ethereum-provider";import"js-cookie";import"./events-context-CI0iqAXA.mjs";import"@headlessui/react";import"@privy-io/ethereum";import"@privy-io/urls";import"tinycolor2";import"@heroicons/react/24/outline/ChevronRightIcon";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/MinusCircleIcon";import"@heroicons/react/24/outline/PhoneIcon";import"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";import"./ErrorScreen-C891Rurl.mjs";import"lucide-react";import"./reservoir-DNdkSA7R.mjs";import"./ScreenLayout-x3-Xgy2E.mjs";import"./Screen-DgjLPjok.mjs";import"./index-Dq_xe9dz.mjs";import"./LinkPasskeyScreen-DhD51WvM.mjs";import"./TodoList-CgrU7uwu.mjs";import"./CopyToClipboard-BGTSFnT3.mjs";import"./copy-Bx2Jwc5_.mjs";import"./Layouts-BlFm53ED.mjs";import"./Column-C2X2MHYX.mjs";import"./LabelXs-oqZNqbm_.mjs";import"./Subtitle-CV-2yKE4.mjs";import"./Title-BnzYV3Is.mjs";import"./shared-FM0rljBt.mjs";import"@heroicons/react/24/solid/ShieldCheckIcon";import"./QrCode-BVe4kf2z.mjs";import"qrcode";const C={component:()=>{let{user:C,ready:b}=p(),{data:I,onUserCloseViaDialogOrKeybindRef:S}=u(),R=c(),[A,E]=n(null),[T,F]=n(null),[L,P]=n(null),[x,B]=n(!1),[U,D]=n(!1),[O,W]=n(),$=async()=>{O?q(O):C?await z({user:C}):q(Error("Must be logged in to manage MFA")),setTimeout((()=>{E(null),F(null)}),500)};if(S.current=$,!I?.mfaEnroll)throw Error("Missing modal data for MFA enrollment screen.");let{onFailure:q,onSuccess:z,onBack:H,mfaMethods:K,verify:Q,generateTotpSecret:X,enrollTotp:G,unenrollTotp:N,enrollPasskey:V}=I.mfaEnroll,Y=C?.mfaMethods.includes("sms"),J=C?.mfaMethods.includes("totp"),Z=C?.mfaMethods.includes("passkey"),_=!!C?.phone,ee=C?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function oe(){E(null),F(null),W(void 0)}async function te(e=ee){try{W(void 0),D(!0);let o=await V(e);return await z({user:o})}catch(e){W(e)}finally{D(!1),B(!1)}}if(!b||!C||!R)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(a,{onClose:$,backFn:H},"header"),/*#__PURE__*/t(v,{children:/*#__PURE__*/t(d,{})}),/*#__PURE__*/t(k,{children:/*#__PURE__*/t(m,{})}),/*#__PURE__*/t(s,{})]});if("sms"===A)return null;if("totp"===A)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(a,{backFn:oe,onClose:$},"header"),/*#__PURE__*/t(j,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(r,{})}),/*#__PURE__*/t(g,{children:"Remove authenticator app verification?"}),/*#__PURE__*/e(M,{children:["MFA adds an extra layer of security to your ",R?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/t(w,{children:/*#__PURE__*/t(l,{$warn:!0,onClick:async function(){try{W(void 0),D(!0);let e=await N();return await z({user:e})}catch(e){W(e)}finally{D(!1),E(null)}},loading:U,children:"Remove"})}),/*#__PURE__*/t(s,{})]});if("passkey"===A){let i=I.mfaEnroll.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(a,{backFn:oe,onClose:$},"header"),/*#__PURE__*/t(j,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(r,{})}),/*#__PURE__*/t(g,{children:"Are you sure you want to remove this passkey?"}),/*#__PURE__*/t(M,{children:i?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),/*#__PURE__*/t(w,{children:/*#__PURE__*/t(l,{$warn:!0,onClick:async function(){try{W(void 0),D(!0);let e=await V([]);return await z({user:e})}catch(e){W(e)}finally{D(!1),E(null)}},loading:U,children:"Remove"})}),/*#__PURE__*/t(s,{})]})}return 0!==K.length||Y||J||Z?"sms"===T?null:"totp"===T&&L?/*#__PURE__*/t(h,{onClose:$,onReset:oe,submitEnrollmentWithTotp:e=>async function(e){try{W(void 0),D(!0);let o=await G(e);return await z({user:o})}catch(e){W(e)}finally{D(!1),E(null)}}(e.mfaCode),error:O,totpInfo:{...L,appName:R?.name||"Privy"}}):"passkey"===T?/*#__PURE__*/t(y,{onReset:oe,onClose:$,submitEnrollmentWithPasskey:te}):/*#__PURE__*/t(f,{showIntro:!0,userMfaMethods:C.mfaMethods,appMfaMethods:R.mfa.methods,userHasAuthSms:_,backFn:H,handleSelectMethod:async function(e){W(void 0);try{await Q()}catch(e){return void W(e)}return"totp"===e?(F(e),P(null),void X().then((({totpSecret:e,totpAuthUrl:o})=>{P({authUrl:o,secret:e})})).catch((()=>{P(null),oe()}))):"passkey"===e&&1===ee.length?await te():void F(e)},isTotpLoading:"totp"===T&&!L,isPasskeyLoading:x,error:O,onClose:$,setRemovingMfaMethod:async function(e){W(void 0);try{await Q()}catch(e){return void W(e)}E(e)}}):/*#__PURE__*/e(o,{children:[/*#__PURE__*/t(a,{onClose:$,backFn:H},"header"),/*#__PURE__*/t(j,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(i,{})}),/*#__PURE__*/t(g,{children:"Add more security"}),/*#__PURE__*/e(M,{children:[R?.name," does not have any verification methods enabled."]}),/*#__PURE__*/t(w,{children:/*#__PURE__*/t(l,{onClick:$,children:"Close"})}),/*#__PURE__*/t(s,{})]})}};export{C as MfaAuthEnrollmentFlowScreen,C as default};