@privy-io/react-auth 3.13.0 → 3.13.1-beta-20260202140759

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 (363) hide show
  1. package/dist/cjs/AccountNotFoundScreen-DopQJydk.js +1 -0
  2. package/dist/cjs/{Address-aEAhUJFV.js → Address-C0i_Lgxz.js} +1 -1
  3. package/dist/cjs/AffirmativeConsentScreen-DrfsiAOF.js +6 -0
  4. package/dist/cjs/AllowlistRejectionScreen-B4F7MdmW.js +1 -0
  5. package/dist/cjs/AuthenticateWithWalletScreen-BImVaE8G.js +1 -0
  6. package/dist/cjs/AwaitingEvmToSolBridgingScreen-Bld2VoQo.js +2 -0
  7. package/dist/cjs/AwaitingExternalEthereumTransferScreen-CK2PMVQH.js +2 -0
  8. package/dist/cjs/AwaitingPasswordlessCodeScreen-mc4TfLdK.js +103 -0
  9. package/dist/cjs/AwaitingSolToEvmBridgingScreen-BHTmPSzt.js +2 -0
  10. package/dist/cjs/{BridgeNetworkSelectionView-CE2o-1QO.js → BridgeNetworkSelectionView-BTW55LDI.js} +1 -1
  11. package/dist/cjs/CaptchaScreen-C4OKrOJj.js +1 -0
  12. package/dist/cjs/CoinbaseOnrampStatusScreen-DuBusEzK.js +16 -0
  13. package/dist/cjs/{ConnectEmailForm-D-TxBaE5.js → ConnectEmailForm-BAtI_Su2.js} +1 -1
  14. package/dist/cjs/ConnectLedgerScreen-Cxy5kYQy.js +9 -0
  15. package/dist/cjs/ConnectOnlyLandingScreen-UHxAPPxv.js +1 -0
  16. package/dist/cjs/ConnectOnlyStatusScreen-D7hEyOkF.js +1 -0
  17. package/dist/cjs/ConnectOrCreateScreen-DCXEsisd.js +1 -0
  18. package/dist/cjs/{ConnectPhoneForm-DK6jm19G.js → ConnectPhoneForm-IaeAlSaT.js} +1 -1
  19. package/dist/cjs/{ConnectWalletView-1cBOsYe3.js → ConnectWalletView-I7l3i_Tn.js} +1 -1
  20. package/dist/cjs/ConnectionStatusScreen-B5eG6O0t.js +7 -0
  21. package/dist/cjs/CrossAppAuthScreen-BHfk_dqk.js +1 -0
  22. package/dist/cjs/{CustomLandingScreenView-C879x5ia.js → CustomLandingScreenView-ZdAEwrj3.js} +1 -1
  23. package/dist/cjs/DelegatedActionsConsentScreen-LeQ6Lxpc.js +1 -0
  24. package/dist/cjs/DelegatedActionsRevokeScreen-C8v4E_cj.js +1 -0
  25. package/dist/cjs/EmbeddedWalletConnectingScreen-B1rrh4GO.js +1 -0
  26. package/dist/cjs/EmbeddedWalletCreatedScreen-Cem5Ix9r.js +1 -0
  27. package/dist/cjs/{EmbeddedWalletKeyExportScreen-BpjA7HGz.js → EmbeddedWalletKeyExportScreen-C9Et_UFA.js} +3 -3
  28. package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-tJoXkQEs.js +1 -0
  29. package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-C2wVljgA.js +1 -0
  30. package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-CG1oHF6a.js +1 -0
  31. package/dist/cjs/{EnrollTotp-D1jQjLxQ.js → EnrollTotp-BveYXBKW.js} +1 -1
  32. package/dist/cjs/ErrorScreen-Ckke6sz3.js +4 -0
  33. package/dist/cjs/{FarcasterConnectStatusScreen-JBJeeu9F.js → FarcasterConnectStatusScreen-D5ziktAq.js} +3 -3
  34. package/dist/cjs/{FarcasterSignerStatusScreen-8DplKa45.js → FarcasterSignerStatusScreen-8edRjO2Y.js} +6 -6
  35. package/dist/cjs/FundSolWalletWithExternalSolanaWallet-DJEyYpCy.js +2 -0
  36. package/dist/cjs/{FundWalletMethodHeader-CW2KubxL.js → FundWalletMethodHeader-Dyg72x32.js} +1 -1
  37. package/dist/cjs/FundingEditAmountScreen-2vgGeOzZ.js +1 -0
  38. package/dist/cjs/FundingMethodSelectionScreen-D6K2RTnb.js +1 -0
  39. package/dist/cjs/InAppBrowserLoginNotPossible-DlH26fht.js +1 -0
  40. package/dist/cjs/InstallWalletScreen-D-aty_-m.js +1 -0
  41. package/dist/cjs/LandingScreen-C3ycf-sm.js +1 -0
  42. package/dist/cjs/{LinkConflictScreen-DKkFMAqc.js → LinkConflictScreen-tpqlaHKl.js} +2 -2
  43. package/dist/cjs/LinkEmailScreen-CVJ8MM6X.js +1 -0
  44. package/dist/cjs/{LinkPasskeyScreen-D-5RrGXJ.js → LinkPasskeyScreen-BVI23any.js} +1 -1
  45. package/dist/cjs/LinkPhoneScreen-COZH83MT.js +1 -0
  46. package/dist/cjs/LoginFailedScreen-B_f3bRu3.js +1 -0
  47. package/dist/cjs/ManualTransferScreen-DCjvNWqd.js +1 -0
  48. package/dist/cjs/MfaAuthEnrollmentFlowScreen-DN4ce0UG.js +1 -0
  49. package/dist/cjs/MfaAuthVerifyFlowScreen-c-lQ_fEz.js +1 -0
  50. package/dist/cjs/MfaEnrollmentFlowScreen-B6-EB6WE.js +1 -0
  51. package/dist/cjs/MfaVerifyFlowScreen-zbdZQoq2.js +1 -0
  52. package/dist/cjs/{ModalHeader-DmWqn83H.js → ModalHeader-Cy6QK4_e.js} +1 -1
  53. package/dist/cjs/MoonpayStatusScreen-BEtRocSA.js +16 -0
  54. package/dist/cjs/OAuthStatusScreen-FvgZmHXu.js +1 -0
  55. package/dist/cjs/PasskeySelectSignupOrLogin-DqSfSR6i.js +1 -0
  56. package/dist/cjs/PasskeyStatusScreen-DvA6G4hk.js +3 -0
  57. package/dist/cjs/PasswordRecoveryScreen-Befeqrad.js +20 -0
  58. package/dist/cjs/{QrCode-BG2PX4HL.js → QrCode-DuBadwvo.js} +1 -1
  59. package/dist/cjs/RecoveryOAuthStatusScreen-C6mVwtQH.js +1 -0
  60. package/dist/cjs/RecoveryPasswordCreateScreen-DzNiXRjH.js +1 -0
  61. package/dist/cjs/{RecoverySelectionScreen-qP99_3WR.js → RecoverySelectionScreen-CjnlE9el.js} +2 -2
  62. package/dist/cjs/{Screen-BnWlRqz4.js → Screen-edUQX_SB.js} +1 -1
  63. package/dist/cjs/{ScreenLayout-8Ho-PwHJ.js → ScreenLayout-DGTvokS8.js} +1 -1
  64. package/dist/cjs/{SetAutomaticRecoveryScreen-Dw8eXtFM.js → SetAutomaticRecoveryScreen-CrRjNWxq.js} +2 -2
  65. package/dist/cjs/{SetWalletPasswordForm-BtxQiQCF.js → SetWalletPasswordForm-DJeemCn9.js} +1 -1
  66. package/dist/cjs/SignRequestScreen-DHoZ6sz5.js +26 -0
  67. package/dist/cjs/{StandardSignAndSendTransactionScreen-BRCG_Otm.js → StandardSignAndSendTransactionScreen-CBLYn4pf.js} +1 -1
  68. package/dist/cjs/TelegramAuthScreen-D7mlDw-E.js +1 -0
  69. package/dist/cjs/{TransactionDetails-CB_SFjYb.js → TransactionDetails-CXgPk3J1.js} +1 -1
  70. package/dist/cjs/{TransactionErrorView-C6AwpMpC.js → TransactionErrorView-Deibl2Uf.js} +1 -1
  71. package/dist/cjs/{TransferFromWalletScreen-DDbM2aZ-.js → TransferFromWalletScreen-DSItFmOL.js} +2 -2
  72. package/dist/cjs/{TransferOrBridgeLoadingScreen-BdFZ-kHB.js → TransferOrBridgeLoadingScreen-CZY4tSPW.js} +1 -1
  73. package/dist/cjs/UpdateEmailScreen-Bcbi12kY.js +1 -0
  74. package/dist/cjs/UpdatePhoneScreen-lJE1r_mk.js +1 -0
  75. package/dist/cjs/UserLimitReachedScreen-CKsbmhwX.js +1 -0
  76. package/dist/cjs/{WalletInfoCard-BP4plvST.js → WalletInfoCard-BPFjUGT5.js} +1 -1
  77. package/dist/cjs/WalletInterstitialScreen-C-wi9rZH.js +1 -0
  78. package/dist/cjs/{WalletLink-Be-wt7BS.js → WalletLink-DQka9Syl.js} +1 -1
  79. package/dist/cjs/{WalletOverflowButton-DNXb1rWu.js → WalletOverflowButton-CT3ToLGt.js} +1 -1
  80. package/dist/cjs/abstract-smart-wallets.js +1 -1
  81. package/dist/cjs/{context-B5x3dsBc.js → context-BgcJR59W.js} +1 -1
  82. package/dist/cjs/{ethers-CcPcMmj-.js → ethers-CUHJ8mll.js} +1 -1
  83. package/dist/cjs/extended-chains.js +1 -1
  84. package/dist/cjs/get-entropy-details-for-user-Bh25VOwU.js +1 -0
  85. package/dist/cjs/{get-is-unified-wallet-huyBqM6I.js → get-is-unified-wallet-pvisKZtt.js} +1 -1
  86. package/dist/cjs/{index-C9h5dbsX.js → index-BgLmUrL3.js} +1 -1
  87. package/dist/cjs/index-C40Nmmja.js +174 -0
  88. package/dist/cjs/{index-Ddh08VH6.js → index-Y7m6JUJT.js} +1 -1
  89. package/dist/cjs/index.js +1 -1
  90. package/dist/cjs/internal.js +1 -1
  91. package/dist/cjs/{shared-B4PQQyG9.js → shared-BrkTXSb9.js} +1 -1
  92. package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-Cwmd9p6v.js → shouldProceedtoEmbeddedWalletCreationFlow-ClGopOFu.js} +1 -1
  93. package/dist/cjs/smart-wallets-DhMgsCrP.js +1 -0
  94. package/dist/cjs/smart-wallets.js +1 -1
  95. package/dist/cjs/solana.js +1 -1
  96. package/dist/cjs/{styles-BYA0sdA8.js → styles-Dg1gwPet.js} +1 -1
  97. package/dist/cjs/{to-ui-error-kjcnhSmN.js → to-ui-error-Cj4nmAIy.js} +1 -1
  98. package/dist/cjs/ui.js +1 -1
  99. package/dist/cjs/use-export-wallet-BHqL5lkN.js +1 -0
  100. package/dist/cjs/use-export-wallet-CHdfox2p.js +1 -0
  101. package/dist/cjs/useActiveWallet-DQaSSN2M.js +185 -0
  102. package/dist/cjs/{useGetTokenPrice-XbJ2xnl_.js → useGetTokenPrice-Q-LRDLGC.js} +1 -1
  103. package/dist/cjs/{useI18n-CJec5B3S.js → useI18n-C-2tQwPP.js} +1 -1
  104. package/dist/cjs/usePrivy-DN8Ajdzm.js +1 -0
  105. package/dist/cjs/{useSolanaRpcClient-CN7MyWq4.js → useSolanaRpcClient-DAhvriV9.js} +1 -1
  106. package/dist/cjs/useWallets-DOb8xzgz.js +1 -0
  107. package/dist/dts/{events-context-CV9PiG6M.d.ts → events-context-uQF86xPo.d.mts} +1 -1
  108. package/dist/dts/{events-context-CV9PiG6M.d.mts → events-context-uQF86xPo.d.ts} +1 -1
  109. package/dist/dts/extended-chains.d.mts +1 -1
  110. package/dist/dts/extended-chains.d.ts +1 -1
  111. package/dist/dts/farcaster.d.mts +1 -1
  112. package/dist/dts/farcaster.d.ts +1 -1
  113. package/dist/dts/index.d.mts +4 -38
  114. package/dist/dts/index.d.ts +4 -38
  115. package/dist/dts/internal.d.mts +1 -1
  116. package/dist/dts/internal.d.ts +1 -1
  117. package/dist/dts/smart-wallets.d.mts +1 -1
  118. package/dist/dts/smart-wallets.d.ts +1 -1
  119. package/dist/dts/solana.d.mts +3 -3
  120. package/dist/dts/solana.d.ts +3 -3
  121. package/dist/dts/{types-xIUh0rN4.d.mts → types-DLEfLPEB.d.mts} +1 -1
  122. package/dist/dts/{types-xIUh0rN4.d.ts → types-DLEfLPEB.d.ts} +1 -1
  123. package/dist/dts/ui.d.mts +1 -1
  124. package/dist/dts/ui.d.ts +1 -1
  125. package/dist/esm/AccountNotFoundScreen-CVBAv1Mv.mjs +1 -0
  126. package/dist/esm/{Address-BuCMjci7.mjs → Address-BupZf8Rc.mjs} +1 -1
  127. package/dist/esm/AffirmativeConsentScreen-CFSY5nE4.mjs +6 -0
  128. package/dist/esm/AllowlistRejectionScreen-0Z0EYviP.mjs +1 -0
  129. package/dist/esm/AuthenticateWithWalletScreen-BdJYQ2JJ.mjs +1 -0
  130. package/dist/esm/AwaitingEvmToSolBridgingScreen-D9Ef3Dnt.mjs +2 -0
  131. package/dist/esm/AwaitingExternalEthereumTransferScreen-mj07gSaD.mjs +2 -0
  132. package/dist/esm/AwaitingPasswordlessCodeScreen-DE3g9VwQ.mjs +103 -0
  133. package/dist/esm/AwaitingSolToEvmBridgingScreen-CUKh2oVG.mjs +2 -0
  134. package/dist/esm/{BridgeNetworkSelectionView-0VRZoDMv.mjs → BridgeNetworkSelectionView-D8aRUIg2.mjs} +1 -1
  135. package/dist/esm/CaptchaScreen-Co8CjcuQ.mjs +1 -0
  136. package/dist/esm/CoinbaseOnrampStatusScreen-Da7VjKBi.mjs +16 -0
  137. package/dist/esm/ConnectEmailForm-D5UhENmm.mjs +3 -0
  138. package/dist/esm/ConnectLedgerScreen-JDfzYq9M.mjs +9 -0
  139. package/dist/esm/ConnectOnlyLandingScreen-C0j3-tOW.mjs +1 -0
  140. package/dist/esm/ConnectOnlyStatusScreen-D-gYePr8.mjs +1 -0
  141. package/dist/esm/ConnectOrCreateScreen-CqLbK7av.mjs +1 -0
  142. package/dist/esm/{ConnectPhoneForm-DMcfvHG9.mjs → ConnectPhoneForm-CQJPasTi.mjs} +1 -1
  143. package/dist/esm/{ConnectWalletView-rtAY2uds.mjs → ConnectWalletView-mIrd9fmT.mjs} +3 -3
  144. package/dist/esm/ConnectionStatusScreen-D8G_flGR.mjs +7 -0
  145. package/dist/esm/CrossAppAuthScreen-Btm1d-iO.mjs +1 -0
  146. package/dist/esm/{CustomLandingScreenView-Dt4TEi0A.mjs → CustomLandingScreenView-C2TNxHAb.mjs} +1 -1
  147. package/dist/esm/DelegatedActionsConsentScreen-DXwSOiLw.mjs +1 -0
  148. package/dist/esm/DelegatedActionsRevokeScreen-B7uTGw9J.mjs +1 -0
  149. package/dist/esm/EmbeddedWalletConnectingScreen-BioR068C.mjs +1 -0
  150. package/dist/esm/EmbeddedWalletCreatedScreen-Cq1thot_.mjs +1 -0
  151. package/dist/esm/{EmbeddedWalletKeyExportScreen-sjrAvCm3.mjs → EmbeddedWalletKeyExportScreen-CtEY8G7E.mjs} +2 -2
  152. package/dist/esm/EmbeddedWalletOnAccountCreateScreen-ShyQ92Jq.mjs +1 -0
  153. package/dist/esm/EmbeddedWalletPasswordUpdateScreen-qoWRlbPz.mjs +1 -0
  154. package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-BeN-dpqi.mjs +1 -0
  155. package/dist/esm/{EnrollTotp-DlnMoeNk.mjs → EnrollTotp-3j3Uj3wv.mjs} +1 -1
  156. package/dist/esm/ErrorScreen-BpG9IyOu.mjs +4 -0
  157. package/dist/esm/{FarcasterConnectStatusScreen-BLgCDUxR.mjs → FarcasterConnectStatusScreen-DadPWt5w.mjs} +4 -4
  158. package/dist/esm/FarcasterSignerStatusScreen-DyJNx88F.mjs +28 -0
  159. package/dist/esm/FundSolWalletWithExternalSolanaWallet-Dhp2jhkc.mjs +1 -0
  160. package/dist/esm/{FundWalletMethodHeader-Dujd1j7J.mjs → FundWalletMethodHeader-Cyn7MCWO.mjs} +1 -1
  161. package/dist/esm/FundingEditAmountScreen-D0KCT7EC.mjs +1 -0
  162. package/dist/esm/FundingMethodSelectionScreen-CrHLwmNP.mjs +1 -0
  163. package/dist/esm/InAppBrowserLoginNotPossible-CcbdJWpW.mjs +1 -0
  164. package/dist/esm/InstallWalletScreen-0udkV09c.mjs +1 -0
  165. package/dist/esm/LandingScreen-C7xCusAZ.mjs +1 -0
  166. package/dist/esm/{LinkConflictScreen-DOsLOvpT.mjs → LinkConflictScreen-B31exGN7.mjs} +4 -4
  167. package/dist/esm/LinkEmailScreen-DZf6HS1n.mjs +1 -0
  168. package/dist/esm/{LinkPasskeyScreen-jzRj6Yq0.mjs → LinkPasskeyScreen-Bl7uzJ8Q.mjs} +7 -7
  169. package/dist/esm/LinkPhoneScreen-DUIIaqp0.mjs +1 -0
  170. package/dist/esm/LoginFailedScreen-DsSbXSXA.mjs +1 -0
  171. package/dist/esm/ManualTransferScreen-B-Kkarxd.mjs +1 -0
  172. package/dist/esm/MfaAuthEnrollmentFlowScreen-D82inQR9.mjs +1 -0
  173. package/dist/esm/MfaAuthVerifyFlowScreen-Cw5rWozq.mjs +1 -0
  174. package/dist/esm/MfaEnrollmentFlowScreen-B3F6HEAl.mjs +1 -0
  175. package/dist/esm/MfaVerifyFlowScreen-DYuvXWXh.mjs +1 -0
  176. package/dist/esm/{ModalHeader-CSfzkWxZ.mjs → ModalHeader-Byy3j4Lh.mjs} +1 -1
  177. package/dist/esm/MoonpayStatusScreen-CBtEX6lf.mjs +16 -0
  178. package/dist/esm/OAuthStatusScreen-YCUnttYA.mjs +1 -0
  179. package/dist/esm/PasskeySelectSignupOrLogin-DuXG4uXH.mjs +1 -0
  180. package/dist/esm/PasskeyStatusScreen-DPvVVoC2.mjs +3 -0
  181. package/dist/esm/PasswordRecoveryScreen-IS0ckI65.mjs +20 -0
  182. package/dist/esm/{QrCode-BkoTqsec.mjs → QrCode-lPYtXNC_.mjs} +1 -1
  183. package/dist/esm/RecoveryOAuthStatusScreen-CJO3irqx.mjs +1 -0
  184. package/dist/esm/RecoveryPasswordCreateScreen-DZb7gDAd.mjs +1 -0
  185. package/dist/esm/{RecoverySelectionScreen-0YIfrkiv.mjs → RecoverySelectionScreen-CThvVB-J.mjs} +2 -2
  186. package/dist/esm/{Screen-5StC6JLQ.mjs → Screen-Ct4Lyoaf.mjs} +1 -1
  187. package/dist/esm/{ScreenLayout-C2Le_YIv.mjs → ScreenLayout-DOt2sB2J.mjs} +1 -1
  188. package/dist/esm/{SetAutomaticRecoveryScreen-BAAv--Sk.mjs → SetAutomaticRecoveryScreen-D1IKpF6a.mjs} +2 -2
  189. package/dist/esm/{SetWalletPasswordForm-lzuYpBex.mjs → SetWalletPasswordForm-CiQmt-HX.mjs} +1 -1
  190. package/dist/esm/{SignRequestScreen-YrG-iwWX.mjs → SignRequestScreen-DKJky_Un.mjs} +2 -2
  191. package/dist/esm/{StandardSignAndSendTransactionScreen-Csw3bRQ4.mjs → StandardSignAndSendTransactionScreen-CPKZQMPj.mjs} +2 -2
  192. package/dist/esm/TelegramAuthScreen-bIm5jFOU.mjs +1 -0
  193. package/dist/esm/{TransactionDetails-BMVu0qlz.mjs → TransactionDetails-DLLlKhs7.mjs} +1 -1
  194. package/dist/esm/{TransactionErrorView-C6AZ1RC0.mjs → TransactionErrorView-CSRxuGt5.mjs} +1 -1
  195. package/dist/esm/{TransferFromWalletScreen-BOOq-OqM.mjs → TransferFromWalletScreen-ClNSdttH.mjs} +4 -4
  196. package/dist/esm/{TransferOrBridgeLoadingScreen-gM_oel5i.mjs → TransferOrBridgeLoadingScreen-rWz1yK-a.mjs} +1 -1
  197. package/dist/esm/UpdateEmailScreen-mog8U9Vt.mjs +1 -0
  198. package/dist/esm/UpdatePhoneScreen-CLLjzpN7.mjs +1 -0
  199. package/dist/esm/UserLimitReachedScreen-Baf8QzFD.mjs +1 -0
  200. package/dist/esm/{WalletInfoCard-TfOxho0A.mjs → WalletInfoCard-BWAC4Crm.mjs} +1 -1
  201. package/dist/esm/WalletInterstitialScreen-chmHYyvD.mjs +1 -0
  202. package/dist/esm/{WalletLink-CZTmkBKu.mjs → WalletLink-cm_UqBHl.mjs} +1 -1
  203. package/dist/esm/{WalletOverflowButton-C0Ysaik4.mjs → WalletOverflowButton-CoHTrzr-.mjs} +1 -1
  204. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  205. package/dist/esm/context-BEE1GR3p.mjs +1 -0
  206. package/dist/esm/{ethers-DrSqg5wi.mjs → ethers-CzVYf1X2.mjs} +1 -1
  207. package/dist/esm/extended-chains.mjs +1 -1
  208. package/dist/esm/farcaster.mjs +1 -1
  209. package/dist/esm/{frame-uzTmvtww.mjs → frame-CjhCpycO.mjs} +1 -1
  210. package/dist/esm/get-entropy-details-for-user-DXl-F6zT.mjs +1 -0
  211. package/dist/esm/{get-is-unified-wallet-GcvxyU9r.mjs → get-is-unified-wallet-szLxUazm.mjs} +1 -1
  212. package/dist/esm/{getErc20Balance-D0MGUaOw.mjs → getErc20Balance-Bs6MYMo9.mjs} +1 -1
  213. package/dist/esm/{getErc20TokenInfo-CZJTqd4c.mjs → getErc20TokenInfo-Cymy79Tp.mjs} +1 -1
  214. package/dist/esm/{getPublicClient-B4uPLKn-.mjs → getPublicClient-BltMpU4i.mjs} +1 -1
  215. package/dist/esm/{index-BXKPenEy.mjs → index-21Khs68W.mjs} +1 -1
  216. package/dist/esm/index-BXdEd5-h.mjs +174 -0
  217. package/dist/esm/{index-tsoVOGEt.mjs → index-CXuTLe54.mjs} +1 -1
  218. package/dist/esm/index.mjs +1 -1
  219. package/dist/esm/{internal-context-Z-fyxadS.mjs → internal-context-C4ZqP8IF.mjs} +1 -1
  220. package/dist/esm/internal.mjs +1 -1
  221. package/dist/esm/{paths-3HW55qZg.mjs → paths-BzM95ysC.mjs} +1 -1
  222. package/dist/esm/reservoir-CB32KXxK.mjs +1 -0
  223. package/dist/esm/{shared-CQ6jg1BO.mjs → shared-CcT7geMr.mjs} +1 -1
  224. package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-BfZwb-3N.mjs → shouldProceedtoEmbeddedWalletCreationFlow-eeAK_6M1.mjs} +1 -1
  225. package/dist/esm/smart-wallets-CHETrkmZ.mjs +1 -0
  226. package/dist/esm/smart-wallets.mjs +1 -1
  227. package/dist/esm/solana.mjs +1 -1
  228. package/dist/esm/{styles-C3H3yhVT.mjs → styles-CVcwbZBK.mjs} +1 -1
  229. package/dist/esm/{to-ui-error-fYkDcQhz.mjs → to-ui-error-CymSkIi1.mjs} +2 -2
  230. package/dist/esm/ui.mjs +1 -1
  231. package/dist/esm/use-export-wallet-BghmI1bY.mjs +1 -0
  232. package/dist/esm/use-export-wallet-DmJRcrg3.mjs +1 -0
  233. package/dist/esm/{use-sign-with-user-signer-Do5Oi_rb.mjs → use-sign-with-user-signer-BYctG7hm.mjs} +1 -1
  234. package/dist/esm/useActiveWallet-CeJ_zia0.mjs +185 -0
  235. package/dist/esm/{useGetSolPrice-DwwjjGbd.mjs → useGetSolPrice-DaxM-vxD.mjs} +1 -1
  236. package/dist/esm/{useGetTokenPrice-YObgUU6L.mjs → useGetTokenPrice-BS8CeRfC.mjs} +1 -1
  237. package/dist/esm/{useI18n-VPW2SjZN.mjs → useI18n-BWqAKjsd.mjs} +1 -1
  238. package/dist/esm/usePrivy-DZkUhG2n.mjs +1 -0
  239. package/dist/esm/{useSolanaRpcClient-BTAchFxj.mjs → useSolanaRpcClient-D-Ekw787.mjs} +1 -1
  240. package/dist/esm/{useWalletBalance-BDrbQBDX.mjs → useWalletBalance-CCG99ZD8.mjs} +1 -1
  241. package/dist/esm/useWallets-CaOutpwQ.mjs +1 -0
  242. package/package.json +1 -1
  243. package/dist/cjs/AccountNotFoundScreen-DxO5LvIc.js +0 -1
  244. package/dist/cjs/AffirmativeConsentScreen-DfJW4zFz.js +0 -6
  245. package/dist/cjs/AllowlistRejectionScreen-CP01TiLV.js +0 -1
  246. package/dist/cjs/AuthenticateWithWalletScreen-CQw1iHsK.js +0 -1
  247. package/dist/cjs/AwaitingEvmToSolBridgingScreen-BzcvlEoa.js +0 -2
  248. package/dist/cjs/AwaitingExternalEthereumTransferScreen-CF8PGODY.js +0 -2
  249. package/dist/cjs/AwaitingPasswordlessCodeScreen-BByZHkHQ.js +0 -103
  250. package/dist/cjs/AwaitingSolToEvmBridgingScreen-DcalXeu-.js +0 -2
  251. package/dist/cjs/CaptchaScreen-anNodbfx.js +0 -1
  252. package/dist/cjs/CoinbaseOnrampStatusScreen-JGw8hfLn.js +0 -16
  253. package/dist/cjs/ConnectLedgerScreen-CwS0odD_.js +0 -9
  254. package/dist/cjs/ConnectOnlyLandingScreen-fpFbLO8Y.js +0 -1
  255. package/dist/cjs/ConnectOnlyStatusScreen-DziODgdH.js +0 -1
  256. package/dist/cjs/ConnectOrCreateScreen-D-V8KzJp.js +0 -1
  257. package/dist/cjs/ConnectionStatusScreen-D4NtHDFM.js +0 -7
  258. package/dist/cjs/CrossAppAuthScreen-BtEXDc88.js +0 -1
  259. package/dist/cjs/DelegatedActionsConsentScreen-CGnSYhkE.js +0 -1
  260. package/dist/cjs/DelegatedActionsRevokeScreen-Dd8u3U62.js +0 -1
  261. package/dist/cjs/EmbeddedWalletConnectingScreen-yIHjjIR2.js +0 -1
  262. package/dist/cjs/EmbeddedWalletCreatedScreen-CouqreWe.js +0 -1
  263. package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-Cv8bAxPB.js +0 -1
  264. package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-roXY9Gv8.js +0 -1
  265. package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-9I5OZ38V.js +0 -1
  266. package/dist/cjs/ErrorScreen-DbETfzK4.js +0 -4
  267. package/dist/cjs/FundSolWalletWithExternalSolanaWallet-CE1VdpiY.js +0 -2
  268. package/dist/cjs/FundingEditAmountScreen-Cjzgv7Q-.js +0 -1
  269. package/dist/cjs/FundingMethodSelectionScreen-Bje3JXwS.js +0 -1
  270. package/dist/cjs/InAppBrowserLoginNotPossible-DpFXJi29.js +0 -1
  271. package/dist/cjs/InstallWalletScreen-DP80Lixb.js +0 -1
  272. package/dist/cjs/LandingScreen-B_s7VUcj.js +0 -1
  273. package/dist/cjs/LinkEmailScreen-POTKFhXp.js +0 -1
  274. package/dist/cjs/LinkPhoneScreen-RWN6_lR0.js +0 -1
  275. package/dist/cjs/LoginFailedScreen-BGq1l-h2.js +0 -1
  276. package/dist/cjs/ManualTransferScreen-S07FPGso.js +0 -1
  277. package/dist/cjs/MfaAuthEnrollmentFlowScreen-Bnb9xLgu.js +0 -1
  278. package/dist/cjs/MfaAuthVerifyFlowScreen-Bn7NxwbP.js +0 -1
  279. package/dist/cjs/MfaEnrollmentFlowScreen-DixH-nyJ.js +0 -1
  280. package/dist/cjs/MfaVerifyFlowScreen-BtjZAo_J.js +0 -1
  281. package/dist/cjs/MoonpayStatusScreen-BAgiyXOW.js +0 -16
  282. package/dist/cjs/OAuthStatusScreen-RWYIpAEG.js +0 -1
  283. package/dist/cjs/PasskeySelectSignupOrLogin-DvUcmWfj.js +0 -1
  284. package/dist/cjs/PasskeyStatusScreen-CpL_C3--.js +0 -3
  285. package/dist/cjs/PasswordRecoveryScreen-FcFRBHq1.js +0 -20
  286. package/dist/cjs/RecoveryOAuthStatusScreen-AV5BAFgZ.js +0 -1
  287. package/dist/cjs/RecoveryPasswordCreateScreen-CvtuH2mp.js +0 -1
  288. package/dist/cjs/SignRequestScreen-B5xPIK1u.js +0 -26
  289. package/dist/cjs/TelegramAuthScreen-CjTMUNYb.js +0 -1
  290. package/dist/cjs/UpdateEmailScreen-BvzkGAlB.js +0 -1
  291. package/dist/cjs/UpdatePhoneScreen-e8rAhVvP.js +0 -1
  292. package/dist/cjs/UserLimitReachedScreen-x5P5FX13.js +0 -1
  293. package/dist/cjs/WalletInterstitialScreen-DrApzB6o.js +0 -1
  294. package/dist/cjs/index-BZqehL-Z.js +0 -174
  295. package/dist/cjs/smart-wallets-xoXme78U.js +0 -1
  296. package/dist/cjs/use-export-wallet-1gw5h-6F.js +0 -1
  297. package/dist/cjs/use-export-wallet-CedJPqOx.js +0 -1
  298. package/dist/cjs/useActiveWallet-4V55N-5C.js +0 -185
  299. package/dist/cjs/usePrivy-Tr-VZh0x.js +0 -1
  300. package/dist/cjs/useWallets-By_aiK-e.js +0 -1
  301. package/dist/cjs/useWallets-Ds2FjLWj.js +0 -1
  302. package/dist/esm/AccountNotFoundScreen-DvDKQEeR.mjs +0 -1
  303. package/dist/esm/AffirmativeConsentScreen-DmjKmR3p.mjs +0 -6
  304. package/dist/esm/AllowlistRejectionScreen-Dzgqqss9.mjs +0 -1
  305. package/dist/esm/AuthenticateWithWalletScreen-DqEYmKRq.mjs +0 -1
  306. package/dist/esm/AwaitingEvmToSolBridgingScreen-mM0yFabb.mjs +0 -2
  307. package/dist/esm/AwaitingExternalEthereumTransferScreen-B8RwfC4k.mjs +0 -2
  308. package/dist/esm/AwaitingPasswordlessCodeScreen-DiwMdkl1.mjs +0 -103
  309. package/dist/esm/AwaitingSolToEvmBridgingScreen-DDjqJpxK.mjs +0 -2
  310. package/dist/esm/CaptchaScreen-DRpV5XFL.mjs +0 -1
  311. package/dist/esm/CoinbaseOnrampStatusScreen-B5SpiCFR.mjs +0 -16
  312. package/dist/esm/ConnectEmailForm-CUfcb4US.mjs +0 -3
  313. package/dist/esm/ConnectLedgerScreen-D54DrxnP.mjs +0 -9
  314. package/dist/esm/ConnectOnlyLandingScreen-Cm10LiWd.mjs +0 -1
  315. package/dist/esm/ConnectOnlyStatusScreen-Bz7rafsR.mjs +0 -1
  316. package/dist/esm/ConnectOrCreateScreen-aeQK2RJ_.mjs +0 -1
  317. package/dist/esm/ConnectionStatusScreen-_g1A1Dg2.mjs +0 -7
  318. package/dist/esm/CrossAppAuthScreen-4oQDzYzy.mjs +0 -1
  319. package/dist/esm/DelegatedActionsConsentScreen-Cj9bU7Q1.mjs +0 -1
  320. package/dist/esm/DelegatedActionsRevokeScreen-DGFRARuM.mjs +0 -1
  321. package/dist/esm/EmbeddedWalletConnectingScreen-Cmt8I8TX.mjs +0 -1
  322. package/dist/esm/EmbeddedWalletCreatedScreen-Dj_JuLO5.mjs +0 -1
  323. package/dist/esm/EmbeddedWalletOnAccountCreateScreen-BOS_pyDI.mjs +0 -1
  324. package/dist/esm/EmbeddedWalletPasswordUpdateScreen-DulDjFpp.mjs +0 -1
  325. package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-BkwyRHPS.mjs +0 -1
  326. package/dist/esm/ErrorScreen-8UMMZ6is.mjs +0 -4
  327. package/dist/esm/FarcasterSignerStatusScreen-RHH68QtJ.mjs +0 -28
  328. package/dist/esm/FundSolWalletWithExternalSolanaWallet-DVgX3EaM.mjs +0 -1
  329. package/dist/esm/FundingEditAmountScreen-D10JPLdP.mjs +0 -1
  330. package/dist/esm/FundingMethodSelectionScreen-BuWGEgge.mjs +0 -1
  331. package/dist/esm/InAppBrowserLoginNotPossible-TigdvlfS.mjs +0 -1
  332. package/dist/esm/InstallWalletScreen-DgyXxk_4.mjs +0 -1
  333. package/dist/esm/LandingScreen-C6rQCvI5.mjs +0 -1
  334. package/dist/esm/LinkEmailScreen-C7CpFuoA.mjs +0 -1
  335. package/dist/esm/LinkPhoneScreen-BKHv_Kdp.mjs +0 -1
  336. package/dist/esm/LoginFailedScreen-CJgWFc1S.mjs +0 -1
  337. package/dist/esm/ManualTransferScreen-CFNzuajf.mjs +0 -1
  338. package/dist/esm/MfaAuthEnrollmentFlowScreen-DflCQFD5.mjs +0 -1
  339. package/dist/esm/MfaAuthVerifyFlowScreen-D0KWDrSF.mjs +0 -1
  340. package/dist/esm/MfaEnrollmentFlowScreen-B5CTxsyW.mjs +0 -1
  341. package/dist/esm/MfaVerifyFlowScreen-Bds0d6wr.mjs +0 -1
  342. package/dist/esm/MoonpayStatusScreen-BgCvITlM.mjs +0 -16
  343. package/dist/esm/OAuthStatusScreen-B9LjQopq.mjs +0 -1
  344. package/dist/esm/PasskeySelectSignupOrLogin-BH-9DnYX.mjs +0 -1
  345. package/dist/esm/PasskeyStatusScreen-B0BMf34N.mjs +0 -3
  346. package/dist/esm/PasswordRecoveryScreen-BGO3xmU6.mjs +0 -20
  347. package/dist/esm/RecoveryOAuthStatusScreen-9ngTLe_q.mjs +0 -1
  348. package/dist/esm/RecoveryPasswordCreateScreen-BDCDfQzo.mjs +0 -1
  349. package/dist/esm/TelegramAuthScreen-CXnXpJTY.mjs +0 -1
  350. package/dist/esm/UpdateEmailScreen-B4u7SqtR.mjs +0 -1
  351. package/dist/esm/UpdatePhoneScreen-Dz75pT5l.mjs +0 -1
  352. package/dist/esm/UserLimitReachedScreen-BEQAxJvA.mjs +0 -1
  353. package/dist/esm/WalletInterstitialScreen-jHLFeLvC.mjs +0 -1
  354. package/dist/esm/context-bWeWAiND.mjs +0 -1
  355. package/dist/esm/index-DEtvMjrv.mjs +0 -174
  356. package/dist/esm/reservoir-0wfhnc0j.mjs +0 -1
  357. package/dist/esm/smart-wallets-wzmiQDh1.mjs +0 -1
  358. package/dist/esm/use-export-wallet-8amsQKG9.mjs +0 -1
  359. package/dist/esm/use-export-wallet-DyNNbsJn.mjs +0 -1
  360. package/dist/esm/useActiveWallet-CSq3KvGj.mjs +0 -185
  361. package/dist/esm/usePrivy-CvOp4eQ7.mjs +0 -1
  362. package/dist/esm/useWallets-izyyA2re.mjs +0 -1
  363. package/dist/esm/useWallets-yDa5ACXD.mjs +0 -1
@@ -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 s,b as a,P as m}from"./ModalHeader-CSfzkWxZ.mjs";import{L as l}from"./useActiveWallet-CSq3KvGj.mjs";import{u as c}from"./context-bWeWAiND.mjs";import{u as p,a as u}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{M as d,E as h,a as y,b as f}from"./EnrollTotp-DlnMoeNk.mjs";import{A as v,C as j,I as k,T as g,S as C,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-Z-fyxadS.mjs";import"ofetch";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";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-8UMMZ6is.mjs";import"lucide-react";import"./index-DEtvMjrv.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./reservoir-0wfhnc0j.mjs";import"./ScreenLayout-C2Le_YIv.mjs";import"./Screen-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";import"./LinkPasskeyScreen-jzRj6Yq0.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-BkoTqsec.mjs";import"qrcode";const M={component:()=>{let{user:M,ready:b}=p(),{data:I,onUserCloseViaDialogOrKeybindRef:P}=u(),S=c(),[A,E]=n(null),[R,T]=n(null),[x,F]=n(null),[L,B]=n(!1),[U,W]=n(!1),[D,O]=n(),$=async()=>{D?H(D):M?await K({user:M}):H(Error("Must be logged in to manage MFA")),setTimeout((()=>{E(null),T(null)}),500)};if(P.current=$,!I?.mfaEnroll)throw Error("Missing modal data for MFA enrollment screen.");let{onFailure:H,onSuccess:K,onBack:Q,mfaMethods:X,verify:q,generateTotpSecret:z,enrollTotp:N,unenrollTotp:V,enrollPasskey:Y}=I.mfaEnroll,G=M?.mfaMethods.includes("sms"),J=M?.mfaMethods.includes("totp"),Z=M?.mfaMethods.includes("passkey"),_=!!M?.phone,ee=M?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function oe(){E(null),T(null),O(void 0)}async function te(e=ee){try{O(void 0),W(!0);let o=await Y(e);return await K({user:o})}catch(e){O(e)}finally{W(!1),B(!1)}}if(!b||!M||!S)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(s,{onClose:$,backFn:Q},"header"),/*#__PURE__*/t(v,{children:/*#__PURE__*/t(d,{})}),/*#__PURE__*/t(j,{children:/*#__PURE__*/t(l,{})}),/*#__PURE__*/t(a,{})]});if("sms"===A)return null;if("totp"===A)/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(s,{backFn:oe,onClose:$},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(r,{})}),/*#__PURE__*/t(g,{children:"Remove authenticator app verification?"}),/*#__PURE__*/e(C,{children:["MFA adds an extra layer of security to your ",S?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/t(w,{children:/*#__PURE__*/t(m,{$warn:!0,onClick:async function(){try{O(void 0),W(!0);let e=await V();return await K({user:e})}catch(e){O(e)}finally{W(!1),E(null)}},loading:U,children:"Remove"})}),/*#__PURE__*/t(a,{})]});if("passkey"===A){let i=I.mfaEnroll.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return e(o,{children:[/*#__PURE__*/t(s,{backFn:oe,onClose:$},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(r,{})}),/*#__PURE__*/t(g,{children:"Are you sure you want to remove this passkey?"}),/*#__PURE__*/t(C,{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(m,{$warn:!0,onClick:async function(){try{O(void 0),W(!0);let e=await Y([]);return await K({user:e})}catch(e){O(e)}finally{W(!1),E(null)}},loading:U,children:"Remove"})}),/*#__PURE__*/t(a,{})]})}return 0!==X.length||G||J||Z?"sms"===R?null:"totp"===R&&x?/*#__PURE__*/t(h,{onClose:$,onReset:oe,submitEnrollmentWithTotp:e=>async function(e){try{O(void 0),W(!0);let o=await N(e);return await K({user:o})}catch(e){O(e)}finally{W(!1),E(null)}}(e.mfaCode),error:D,totpInfo:{...x,appName:S?.name||"Privy"}}):"passkey"===R?/*#__PURE__*/t(y,{onReset:oe,onClose:$,submitEnrollmentWithPasskey:te}):/*#__PURE__*/t(f,{showIntro:!0,userMfaMethods:M.mfaMethods,appMfaMethods:S.mfa.methods,userHasAuthSms:_,backFn:Q,handleSelectMethod:async function(e){O(void 0);try{await q()}catch(e){return void O(e)}return"totp"===e?(T(e),F(null),void z().then((({totpSecret:e,totpAuthUrl:o})=>{F({authUrl:o,secret:e})})).catch((()=>{F(null),oe()}))):"passkey"===e&&1===ee.length?await te():void T(e)},isTotpLoading:"totp"===R&&!x,isPasskeyLoading:L,error:D,onClose:$,setRemovingMfaMethod:async function(e){O(void 0);try{await q()}catch(e){return void O(e)}E(e)}}):/*#__PURE__*/e(o,{children:[/*#__PURE__*/t(s,{onClose:$,backFn:Q},"header"),/*#__PURE__*/t(k,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/t(i,{})}),/*#__PURE__*/t(g,{children:"Add more security"}),/*#__PURE__*/e(C,{children:[S?.name," does not have any verification methods enabled."]}),/*#__PURE__*/t(w,{children:/*#__PURE__*/t(m,{onClick:$,children:"Close"})}),/*#__PURE__*/t(a,{})]})}};export{M as MfaAuthEnrollmentFlowScreen,M as default};
@@ -1 +0,0 @@
1
- import{jsx as o}from"react/jsx-runtime";import{useMemo as e,useState as t,useEffect as r,useRef as i}from"react";import{u as s}from"./context-bWeWAiND.mjs";import{u as m,a as n}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{V as a,a as c,b as p,t as l}from"./to-ui-error-fYkDcQhz.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"viem";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"./ModalHeader-CSfzkWxZ.mjs";import"styled-components";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.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"./ScreenLayout-C2Le_YIv.mjs";import"./Screen-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";import"./PinInput-3SLvbnQa.mjs";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./StackedContainer-B2vaEl56.mjs";import"./useGetTokenPrice-YObgUU6L.mjs";import"./useGetSolPrice-DwwjjGbd.mjs";import"./index-DEtvMjrv.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./TransactionDetails-BMVu0qlz.mjs";import"./WalletLink-CZTmkBKu.mjs";import"./ethers-DrSqg5wi.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./transaction-CnfuREWo.mjs";import"./Layouts-BlFm53ED.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";const u={component:()=>{let{user:u}=m(),d=s(),h=e((()=>u?.mfaMethods.filter((o=>"passkey"!==o||!d.globalDisablePasskeys))??[]),[u?.mfaMethods,d.globalDisablePasskeys]),{data:f}=n(),[j,y]=t(h[0]),[v,k]=t(!1),[g,w]=t(),[C,b]=t();if(r((()=>{y(h[0])}),[h]),!f?.mfaVerify)throw Error("Missing modal data for MFA verification screen.");let{onFailure:M,onSuccess:P,generateOptions:S,verifyTotpCode:I,verifyPasskey:x,verifySmsCode:A,sendSmsCode:E}=f.mfaVerify,B=async o=>{if("passkey"!==o)try{y(o),"sms"===o&&(y(o),await E()),"totp"===o&&y(o)}catch(o){console.error(o)}else try{y(o);let e=await S();if(!e)throw Error("something went wrong");w(e),await x(e),k(!0),b(void 0),P()}catch(o){b(l(o))}},D=async o=>{b(void 0);try{if(!o||!j)return;if("passkey"===j){if(!g)throw Error("Missing passkey challenge");await x(g)}else"sms"===j?await A(o):"totp"===j&&await I(o);b(void 0),k(!0),P()}catch(o){throw l(o).error}},F=()=>{C||!v?M(C?.error??Error("Canceled MFA verification.")):P()},L=i(!1);return r((()=>{!L.current&&j&&(L.current=!0,B(j).finally((()=>{L.current=!1})))}),[open]),u?"passkey"===j?/*#__PURE__*/o(a,{account:u.linkedAccounts.filter((o=>"passkey"===o.type&&o.enrolledInMfa)).sort(((o,e)=>e.firstVerifiedAt.valueOf()-o.firstVerifiedAt.valueOf()))[0],submitSuccess:v,hasBlockingError:C?.isBlocking??!1,error:C?.error,onClose:F,onBack:()=>{y(void 0),b(void 0)},handleSubmit:()=>D(g).catch(b)}):"sms"===j||"totp"===j?/*#__PURE__*/o(c,{selectedMethod:j,submitSuccess:v,hasBlockingError:C?.isBlocking??!1,handleSubmitCode:D,onClose:F,onBack:h.length>1?()=>y(void 0):void 0}):/*#__PURE__*/o(p,{mfaMethods:h,onSelect:B,handleClose:F}):null}};export{u as MfaAuthVerifyFlowScreen,u as default};
@@ -1 +0,0 @@
1
- import{jsx as e,jsxs as o,Fragment as r}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/QuestionMarkCircleIcon";import n from"@heroicons/react/24/outline/ShieldCheckIcon";import i from"@heroicons/react/24/solid/CheckBadgeIcon";import l from"@heroicons/react/24/solid/IdentificationIcon";import{useState as a,useEffect as s}from"react";import{M as c,b as m,P as d,S as h}from"./ModalHeader-CSfzkWxZ.mjs";import{L as u}from"./useActiveWallet-CSq3KvGj.mjs";import{u as p}from"./context-bWeWAiND.mjs";import{u as y}from"./internal-context-Z-fyxadS.mjs";import{a as f,u as v}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{d as C,f as w,g as k,h as g,i as j,u as b}from"./index-DEtvMjrv.mjs";import{M,E as S,a as E,b as I}from"./EnrollTotp-DlnMoeNk.mjs";import P from"@heroicons/react/24/outline/CheckCircleIcon";import F from"@heroicons/react/24/outline/PhoneIcon";import{lastFourDigits as R}from"@privy-io/js-sdk-core";import{C as x}from"./ConnectPhoneForm-DMcfvHG9.mjs";import{I as T,T as W,S as L,C as A,a as B,B as N,N as U,A as O,L as D,b as Y,c as $}from"./PinInput-3SLvbnQa.mjs";import{ErrorScreenView as q}from"./ErrorScreen-8UMMZ6is.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/XMarkIcon";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"tinycolor2";import"ofetch";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";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"./Chip-D2-wZOHJ.mjs";import"./LoadingSkeleton-U6-3yFwI.mjs";import"@heroicons/react/24/outline/ArrowRightEndOnRectangleIcon";import"@heroicons/react/24/outline/ClockIcon";import"./LinkPasskeyScreen-jzRj6Yq0.mjs";import"lucide-react";import"./TodoList-CgrU7uwu.mjs";import"./ScreenLayout-C2Le_YIv.mjs";import"./Screen-5StC6JLQ.mjs";import"./index-Dq_xe9dz.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-BkoTqsec.mjs";import"qrcode";import"./reservoir-0wfhnc0j.mjs";const H=({appName:t,onComplete:n,onReset:i,onClose:l})=>{let[s,h]=a(""),[u,y]=a(!1),[v,b]=a(null),[M,S]=a("enroll"),{initEnrollmentWithSms:E,submitEnrollmentWithSms:I}=C(),{data:O}=f(),D=p();function Y(){O?.mfaEnrollmentFlow?.onSuccess(),n()}return v?/*#__PURE__*/e(q,{allowlistConfig:D.allowlistConfig,error:v,onBack:()=>b(null),onRetry:()=>b(null)}):/*#__PURE__*/o(r,"enroll"===M?{children:[/*#__PURE__*/e(c,{backFn:i,onClose:l},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(F,{})}),/*#__PURE__*/e(W,{children:"Set up SMS verification"}),/*#__PURE__*/o(L,{children:["We'll text a verification code to this mobile device whenever you use your ",t," ","wallet."]}),/*#__PURE__*/o(A,{children:[/*#__PURE__*/e(x,{onSubmit:async function({qualifiedPhoneNumber:e}){try{await E({phoneNumber:e}),h(e),S("verify")}catch(e){b(e)}},hideRecent:!0}),/*#__PURE__*/o(B,{children:["By providing your mobile number, you agree to receive text messages from ",D?.name,". Some carrier charges may apply"]})]}),/*#__PURE__*/e(m,{})]}:u?{children:[/*#__PURE__*/e(c,{onClose:Y},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(P,{})}),/*#__PURE__*/e(W,{children:"SMS verification added"}),/*#__PURE__*/o(L,{children:["From now on, you'll enter the verification code sent to your mobile device whenever you use your ",t," wallet."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(d,{onClick:Y,children:"Done"})}),/*#__PURE__*/e(m,{})]}:{children:[/*#__PURE__*/e(c,{backFn:function(){"verify"===M?S("enroll"):i()},onClose:l},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(F,{})}),/*#__PURE__*/e(W,{children:"Enter enrollment code"}),/*#__PURE__*/o(A,{children:[/*#__PURE__*/e(U,{onChange:async function(e){try{if(!e)return;await I({phoneNumber:s,mfaCode:e}),y(!0)}catch(e){if(w(e))throw Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.");if(k(e))throw Error("The code you entered is not valid");if(g(e))throw Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.");throw j(e)?Error("Verification canceled"):Error("Unknown error")}}}),/*#__PURE__*/o(L,{children:["To continue, enter the 6-digit code sent to ",/*#__PURE__*/e("strong",{children:R(s)})]})]}),/*#__PURE__*/e(m,{})]})},K={component:()=>{let{user:w,enrollInMfa:k,ready:g}=v(),[j,P]=a(null),{unenrollWithSms:F,unenrollWithTotp:R,unenrollWithPasskey:x,submitEnrollmentWithTotp:B,initEnrollmentWithPasskey:U,submitEnrollmentWithPasskey:q,initEnrollmentWithTotp:K}=C(),{data:Q,onUserCloseViaDialogOrKeybindRef:V}=f(),X=p(),{closePrivyModal:z}=y(),{promptMfa:G}=b(),[J,Z]=a(!1),[_,ee]=a(null),[oe,re]=a(null),te=()=>{z({shouldCallAuthOnSuccess:!0}),k(!1),setTimeout((()=>{P(null),ee(null)}),500)},[ne,ie]=a(!1),[le,ae]=a();V.current=te;let se=w?.mfaMethods.includes("sms"),ce=!!w?.phone,me=w?.mfaMethods.includes("totp"),de=w?.mfaMethods.includes("passkey"),he=se||me||de,ue=w?.linkedAccounts.filter((e=>"passkey"===e.type)).map((e=>e.credentialId))??[];function pe(){P(null),ee(null)}async function ye(e=ue){ie(!0);try{return await U(),await q({credentialIds:e},{removeForLogin:Q?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa}),Q?.mfaEnrollmentFlow?.onSuccess(),te()}catch(e){ae(e)}finally{ie(!1)}}if(s((()=>{he&&Z(!0)}),[he]),!g||!w||!X/*#__PURE__*/)return o(r,{children:[/*#__PURE__*/e(c,{onClose:te},"header"),/*#__PURE__*/e(O,{children:/*#__PURE__*/e(M,{})}),/*#__PURE__*/e(A,{children:/*#__PURE__*/e(u,{})}),/*#__PURE__*/e(m,{})]});if("sms"===j)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(c,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(W,{children:"Remove SMS verification?"}),/*#__PURE__*/o(L,{children:["MFA adds an extra layer of security to your ",X?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(d,{$warn:!0,onClick:async function(){P(null);try{await F()}catch(e){P(null)}},children:"Remove"})}),/*#__PURE__*/e(m,{})]});if("totp"===j)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(c,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(W,{children:"Remove authenticator app verification?"}),/*#__PURE__*/o(L,{children:["MFA adds an extra layer of security to your ",X?.name," account. Make sure you have other methods to secure your account."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(d,{$warn:!0,onClick:async function(){P(null);try{await R()}catch(e){P(null)}},children:"Remove"})}),/*#__PURE__*/e(m,{})]});if("passkey"===j){let n=Q?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa??!0;/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(c,{backFn:pe,onClose:te},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(t,{})}),/*#__PURE__*/e(W,{children:"Are you sure you want to remove this passkey?"}),/*#__PURE__*/e(L,{children:n?"Removing your passkey will remove as both a verification method and a login method.":"Removing your passkey will remove as a verification method."}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(d,{$warn:!0,onClick:async function(){P(null);try{await x({removeForLogin:Q?.mfaEnrollmentFlow?.shouldUnlinkOnUnenrollMfa})}catch(e){P(null)}},children:"Remove"})}),/*#__PURE__*/e(m,{})]})}if(0===Q.mfaEnrollmentFlow.mfaMethods.length&&!he)/*#__PURE__*/return o(r,{children:[/*#__PURE__*/e(c,{onClose:te},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(n,{})}),/*#__PURE__*/e(W,{children:"Add more security"}),/*#__PURE__*/o(L,{children:[X?.name," does not have any verification methods enabled."]}),/*#__PURE__*/e(N,{children:/*#__PURE__*/e(d,{onClick:te,children:"Close"})}),/*#__PURE__*/e(m,{})]});let fe=!he&&!J;return fe?/*#__PURE__*/o(r,{children:[/*#__PURE__*/e(c,{onClose:te},"header"),/*#__PURE__*/e(T,{style:{marginBottom:"1.5rem"},children:/*#__PURE__*/e(n,{})}),/*#__PURE__*/e(W,{children:"Transaction Protection"}),/*#__PURE__*/e(L,{children:"Set up transaction protection to add an extra layer of security to your account"}),/*#__PURE__*/o(D,{children:[/*#__PURE__*/o(Y,{children:[/*#__PURE__*/e($,{children:/*#__PURE__*/e(i,{})}),"Enable 2-Step verification for your ",X?.name," wallet."]}),/*#__PURE__*/o(Y,{children:[/*#__PURE__*/e($,{children:/*#__PURE__*/e(l,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),/*#__PURE__*/o(N,{children:[/*#__PURE__*/e(d,{onClick:()=>Z(!0),children:"Continue"}),/*#__PURE__*/e(h,{onClick:te,children:"Not now"})]}),/*#__PURE__*/e(m,{})]}):"sms"===_?/*#__PURE__*/e(H,{appName:X?.name||"Privy",onComplete:te,onReset:pe,onClose:te}):"totp"===_&&oe?/*#__PURE__*/e(S,{onClose:te,onReset:pe,submitEnrollmentWithTotp:({mfaCode:e})=>async function(e){try{return ae(void 0),await B({mfaCode:e}),Q?.mfaEnrollmentFlow?.onSuccess(),te()}catch(e){ae(e)}finally{P(null)}}(e),totpInfo:{...oe,appName:X?.name||"Privy"}}):"passkey"===_?/*#__PURE__*/e(E,{onReset:pe,onClose:te,submitEnrollmentWithPasskey:ye}):/*#__PURE__*/e(I,{showIntro:fe,userMfaMethods:w.mfaMethods,appMfaMethods:X.mfa.methods,userHasAuthSms:ce,backFn:function(){Z(!1)},handleSelectMethod:async function(e){try{await G()}catch(e){return void ae(e)}return"totp"===e?(ee(e),re(null),void K().then((e=>{re(e)})).catch((()=>{re(null),pe()}))):"passkey"===e&&1===ue.length?await ye():void ee(e)},isTotpLoading:"totp"===_&&!oe,isPasskeyLoading:ne,error:le,onClose:te,setRemovingMfaMethod:async e=>{try{await G()}catch(e){return void ae(e)}P(e)}})}};export{K as MfaEnrollmentFlowScreen,K as default};
@@ -1 +0,0 @@
1
- import{jsx as o}from"react/jsx-runtime";import{useMemo as t,useState as e,useEffect as r,useRef as i}from"react";import{u as s}from"./context-bWeWAiND.mjs";import{u as m}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{u as n}from"./index-DEtvMjrv.mjs";import{V as a,a as c,b as l,t as p}from"./to-ui-error-fYkDcQhz.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"viem";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"@heroicons/react/24/outline/DevicePhoneMobileIcon";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/PhoneIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"./ModalHeader-CSfzkWxZ.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"./ScreenLayout-C2Le_YIv.mjs";import"./Screen-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";import"./PinInput-3SLvbnQa.mjs";import"@heroicons/react/24/outline/CalendarIcon";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./StackedContainer-B2vaEl56.mjs";import"./useGetTokenPrice-YObgUU6L.mjs";import"./useGetSolPrice-DwwjjGbd.mjs";import"./TransactionDetails-BMVu0qlz.mjs";import"./WalletLink-CZTmkBKu.mjs";import"./ethers-DrSqg5wi.mjs";import"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"./transaction-CnfuREWo.mjs";import"./Layouts-BlFm53ED.mjs";import"@heroicons/react/24/outline/ChevronDownIcon";const u=({onClose:u})=>{let{user:d}=m(),h=s(),j=t((()=>d?.mfaMethods.filter((o=>"passkey"!==o||!h.globalDisablePasskeys))??[]),[d?.mfaMethods,h.globalDisablePasskeys]),[f,v]=e(j[0]??null),{init:y,cancel:k,submit:g}=n(),[b,w]=e(!1),[C,I]=e(null),[P,x]=e();r((()=>{v(j[0]??null)}),[j]);let S=i(!1);async function M(o){x(void 0);try{if(!o||!f)return;await g(f,o),w(!0),x(void 0),u()}catch(o){throw p(o).error}}async function A(o){if("passkey"!==o)try{v(o),await y(o)}catch(o){console.error(o)}else try{v(o);let t=await y(o);if(!t)throw Error("something went wrong");I(t),await g(o,t),w(!0),x(void 0),u()}catch(o){x(p(o))}}r((()=>{!S.current&&f&&(S.current=!0,A(f).finally((()=>{S.current=!1})))}),[]);let B=()=>{v(null),x(void 0),k(),u()};return d?"passkey"===f?/*#__PURE__*/o(a,{account:d.linkedAccounts.filter((o=>"passkey"===o.type&&o.enrolledInMfa)).sort(((o,t)=>t.firstVerifiedAt.valueOf()-o.firstVerifiedAt.valueOf()))[0],submitSuccess:b,hasBlockingError:P?.isBlocking??!1,error:P?.error,onClose:B,onBack:()=>{v(null),x(void 0)},handleSubmit:()=>M(C).catch(x)}):f?/*#__PURE__*/o(c,{submitSuccess:b,hasBlockingError:P?.isBlocking??!1,handleSubmitCode:M,selectedMethod:f,onClose:B,onBack:j.length>1?()=>v(null):void 0}):/*#__PURE__*/o(l,{mfaMethods:j,onSelect:A,handleClose:B}):null};export{u as MfaVerifyFlowScreen,u as default};
@@ -1,16 +0,0 @@
1
- import{jsx as t,jsxs as e,Fragment as r}from"react/jsx-runtime";import o from"@heroicons/react/24/solid/ArrowsRightLeftIcon";import i from"@heroicons/react/24/solid/CheckCircleIcon";import{useMemo as n}from"react";import{styled as a}from"styled-components";import{M as l,B as s,P as c}from"./ModalHeader-CSfzkWxZ.mjs";import{a as m}from"./Layouts-BlFm53ED.mjs";import{L as d,a7 as u}from"./useActiveWallet-CSq3KvGj.mjs";import{u as p}from"./context-bWeWAiND.mjs";import{u as h}from"./internal-context-Z-fyxadS.mjs";import{a as f}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{u as g}from"./index-BXKPenEy.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"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"tinycolor2";import"ofetch";import"./analytics-mkkvFRju.mjs";const y=({size:r=61,...o})=>/*#__PURE__*/t("svg",{width:r,height:r,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...o,children:/*#__PURE__*/e("g",{id:"moonpay_symbol_wht 2",children:[/*#__PURE__*/t("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),/*#__PURE__*/t("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})});const v={component:()=>{let{data:o,setModalData:i,navigateBack:n}=f(),a=p(),{closePrivyModal:c}=h(),{externalTransactionId:m}=o?.moonpayStatus,d=g(m||null,a.fundingMethodConfig.moonpay.useSandbox??!1);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/t(l,{title:"Fund account",backFn:()=>{let t={...o?.funding,showAlternateFundingMethod:!0};t.usingDefaultFundingMethod&&(t.usingDefaultFundingMethod=!1),i({funding:t,solanaFundingData:o?.solanaFundingData}),n()}}),/*#__PURE__*/t(C,{status:d,onClickCta:c}),/*#__PURE__*/t(s,{})]})}};let C=({status:o,onClickCta:i})=>{let{title:a,body:l,cta:s}=n((()=>(t=>{switch(t){case"completed":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"waitingAuthorization":return{title:"Processing payment",body:"This may take up to a few hours. You will receive an email when the purchase is complete.",cta:"Continue"};default:return{title:"In Progress",body:"Go back to MoonPay to finish funding your account.",cta:""}}})(o)),[o]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(x,{children:[/*#__PURE__*/t(w,{status:o}),/*#__PURE__*/e(m,{children:[/*#__PURE__*/t("h3",{children:a}),/*#__PURE__*/t(b,{children:l})]})]}),s&&/*#__PURE__*/t(c,{onClick:i,children:s})]})},w=({status:r})=>{if(!r||"pending"===r){let r="var(--privy-color-foreground-4)";/*#__PURE__*/return e("div",{style:{position:"relative"},children:[/*#__PURE__*/t(d,{color:r,style:{position:"absolute"}}),/*#__PURE__*/t(u,{color:r}),/*#__PURE__*/t(y,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let n=(e=>{switch(e){case"completed":return i;case"waitingAuthorization":return()=>/*#__PURE__*/t(o,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}});default:return}})(r),a=(l=r)?{completed:"var(--privy-color-success)",failed:"var(--privy-color-error)",serviceFailure:"var(--privy-color-error)",waitingAuthorization:"var(--privy-color-accent)",pending:"var(--privy-color-foreground-4)"}[l]:"var(--privy-color-foreground-4)";var l;/*#__PURE__*/return t("div",{style:{borderColor:a,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:n&&/*#__PURE__*/t(n,{width:"4rem",height:"4rem",color:a})})},b=a.p`
2
- font-size: 1rem;
3
- color: var(--privy-color-foreground-3);
4
- margin-bottom: 1rem;
5
- display: flex;
6
- flex-direction: column;
7
- gap: 1rem;
8
- `,x=a.div`
9
- display: flex;
10
- flex-direction: column;
11
- align-items: center;
12
- justify-content: center;
13
- margin-left: 1.75rem;
14
- margin-right: 1.75rem;
15
- padding: 2rem 0;
16
- `;export{v as MoonpayStatusScreen,v as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import t,{useState as r,useEffect as o}from"react";import{i,u as a,a as n}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{A as s,T as m,I as c,S as l,a as d,L as p,b as u,D as h,G as v}from"./twitter-BoAxhlj6.mjs";import y from"@heroicons/react/24/outline/GlobeAltIcon";import{T as g,L as f}from"./twitch-5IOe4sIQ.mjs";import{u as E,q as A}from"./context-bWeWAiND.mjs";import{b as T,u as S,k as w}from"./internal-context-Z-fyxadS.mjs";import{s as C}from"./shouldProceedtoEmbeddedWalletCreationFlow-BfZwb-3N.mjs";import{S as b}from"./ScreenLayout-C2Le_YIv.mjs";import{e as _}from"./capitalizeFirstLetter-DmLYqXsO.mjs";import{l as j}from"./index-DEtvMjrv.mjs";import"viem";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"./ModalHeader-CSfzkWxZ.mjs";import"styled-components";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.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-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";const O=({style:t})=>/*#__PURE__*/e(y,{style:{color:"var(--privy-color-error)",...t}});let R={google:{name:"Google",component:v},discord:{name:"Discord",component:h},github:{name:"Github",component:u},linkedin:{name:"LinkedIn",component:p},twitter:{name:"Twitter",component:d},spotify:{name:"Spotify",component:l},instagram:{name:"Instagram",component:c},tiktok:{name:"Tiktok",component:m},line:{name:"LINE",component:f},twitch:{name:"Twitch",component:g},apple:{name:"Apple",component:s}},N=({iconUrl:e,...r})=>t.createElement("svg",{width:"33",height:"32",viewBox:"0 0 33 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...r},t.createElement("foreignObject",{x:"2",y:"2",width:"29",height:"28"},t.createElement("img",{src:e,width:"29",height:"28",style:{display:"block",objectFit:"contain",borderRadius:"4px"},alt:"Provider icon"})));const U=(e,r)=>{if(e in R)return R[e];if(i(e)&&r){let o=r.find((t=>t.provider===e));if(o)return{name:o.provider_display_name,component:e=>t.createElement(N,{...e,iconUrl:o.provider_icon_url})}}return{name:"Unknown",component:O}};function I(e,t,r){let o={detail:"",retryable:!1},i=_(t);if(e?.privyErrorCode===T.LINKED_TO_ANOTHER_USER&&(o.detail="This account has already been linked to another user."),e?.privyErrorCode===T.INVALID_CREDENTIALS&&(o.retryable=!0,o.detail="Something went wrong. Try again."),e.privyErrorCode===T.OAUTH_USER_DENIED&&(o.detail=`Retry and check ${i} to finish connecting your account.`,o.retryable=!0),e?.privyErrorCode===T.TOO_MANY_REQUESTS&&(o.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode===T.TOO_MANY_REQUESTS&&e.message.includes("provider rate limit")){let e=U(t,r).name;o.detail=`Request limit reached for ${e}. Please wait a moment and try again.`}if(e?.privyErrorCode===T.OAUTH_ACCOUNT_SUSPENDED){let e=U(t,r).name;o.detail=`Your ${e} account is suspended. Please try another login method.`}return e?.privyErrorCode===T.CANNOT_LINK_MORE_OF_TYPE&&(o.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode===T.OAUTH_UNEXPECTED&&t.startsWith("privy:")&&(o.detail="Something went wrong. Please try again."),o}const L=({providerName:t,ProviderLogo:r,success:o,errorMessage:i,onRetry:a})=>{let n=o?`Successfully connected with ${t}`:i?i.message:`Verifying connection to ${t}`;/*#__PURE__*/return e(b,{title:n,subtitle:o?"You're good to go!":i?i.detail:"Just a few moments more",icon:r,iconVariant:"loading",iconLoadingStatus:{success:o,fail:!!i},secondaryCta:i?.retryable&&a?{label:"Retry",onClick:a}:void 0,watermark:!0})},k={component:()=>{let{authenticated:t,logout:i,ready:s,user:m}=a(),{setModalData:c,navigate:l,resetNavigation:d}=n(),p=E(),{getAuthMeta:u,initLoginWithOAuth:h,loginWithOAuth:v,updateWallets:y,setReadyToTrue:g,closePrivyModal:f,createAnalyticsEvent:b}=S(),[_,O]=r(!1),[R,N]=r(void 0),k=u()?.provider||"google",{name:P,component:D}=U(k,p.customOAuthProviders);return o((()=>{v(k).then((()=>{O(!0),g(!0)})).catch((e=>{if(g(!1),e?.privyErrorCode===T.ALLOWLIST_REJECTED)return N(void 0),d(),void l("AllowlistRejectionScreen");if(e?.privyErrorCode===T.USER_LIMIT_REACHED)return console.error(new w(e).toString()),N(void 0),d(),void l("UserLimitReachedScreen");if(e?.privyErrorCode===T.USER_DOES_NOT_EXIST)return N(void 0),d(),void l("AccountNotFoundScreen");if(e?.privyErrorCode===T.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return N(void 0),d(),c({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,displayName:e.data?.data?.account?.displayName,linkMethod:u()?.provider,embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress,oAuthUserInfo:e.data?.data?.otherUser?.oAuthUserInfo}}),void l("LinkConflictScreen");let{retryable:t,detail:r}=I(e,k,p.customOAuthProviders);N({retryable:t,detail:r,message:"Authentication failed"})})).finally((()=>{j()}))}),[P,k]),o((()=>{if(s&&t&&_&&m){if(p?.legal.requireUsersAcceptTerms&&!m.hasAcceptedTerms){let e=setTimeout((()=>{l("AffirmativeConsentScreen")}),A);return()=>clearTimeout(e)}if(C(m,p.embeddedWallets)){let e=setTimeout((()=>{c({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),b({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:k,screen:"OAuthStatusScreen"}}),i()},callAuthOnSuccessOnClose:!0}}),l("EmbeddedWalletOnAccountCreateScreen")}),A);return()=>clearTimeout(e)}{let e=setTimeout((()=>f({shouldCallAuthOnSuccess:!0,isSuccess:!0})),A);return y(),()=>clearTimeout(e)}}}),[s,t,_,m]),/*#__PURE__*/e(L,{providerName:P,ProviderLogo:D,success:_,errorMessage:R,onRetry:R?.retryable?()=>{j(),h(k),N(void 0)}:void 0})},isShownBeforeReady:!0};export{k as OAuthStatusScreen,L as OAuthStatusScreenView,k as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{FingerprintIcon as e}from"lucide-react";import{a as i}from"./index-DEtvMjrv.mjs";import{u as o}from"./internal-context-Z-fyxadS.mjs";import{a as r}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{S as a}from"./ScreenLayout-C2Le_YIv.mjs";import"react";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"./context-bWeWAiND.mjs";import"tinycolor2";import"styled-components";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-CSfzkWxZ.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-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const s=({title:i="Log in or create a new account?",subtitle:o="Create a new account with a passkey or use a passkey to log in to an existing account.",onSignup:r,onLogin:s})=>/*#__PURE__*/t(a,{title:i,subtitle:o,icon:e,primaryCta:{label:"Create new account",onClick:r},secondaryCta:{label:"Log in with a passkey",onClick:s},watermark:!0}),n={component:()=>{let{enabled:e,token:a}=i(),{navigate:n,setModalData:p}=r(),{initSignupWithPasskey:c,initLoginWithPasskey:m}=o();/*#__PURE__*/return t(s,{onSignup:async()=>{e&&!a?(p({passkeyAuthModalData:{passkeySignupFlow:!0},captchaModalData:{callback:t=>c({captchaToken:t,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"PasskeyStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),n("CaptchaScreen")):(await c({withPrivyUi:!0,captchaToken:a}),p({passkeyAuthModalData:{passkeySignupFlow:!0}}),n("PasskeyStatusScreen"))},onLogin:async()=>{e&&!a?(p({passkeyAuthModalData:{passkeySignupFlow:!1},captchaModalData:{callback:t=>m({captchaToken:t,withPrivyUi:!0}),userIntentRequired:!1,onSuccessNavigateTo:"PasskeyStatusScreen",onErrorNavigateTo:"ErrorScreen"}}),n("CaptchaScreen")):(await m({withPrivyUi:!0,captchaToken:a}),p({passkeyAuthModalData:{passkeySignupFlow:!1}}),n("PasskeyStatusScreen"))}})}};export{n as PasskeySelectSignupOrLogin,s as PasskeySelectSignupOrLoginView,n as default};
@@ -1,3 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{FingerprintIcon as r}from"lucide-react";import{useState as t,useRef as o,useEffect as s}from"react";import{styled as i}from"styled-components";import{u as a,q as n}from"./context-bWeWAiND.mjs";import{c,b as m,u}from"./internal-context-Z-fyxadS.mjs";import{a as l,u as p}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{s as d}from"./shouldProceedtoEmbeddedWalletCreationFlow-BfZwb-3N.mjs";import{S as y}from"./ScreenLayout-C2Le_YIv.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"viem";import"./index-DEtvMjrv.mjs";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./ModalHeader-CSfzkWxZ.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-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const h=({status:t,passkeySignupFlow:o=!1,error:s,onRetry:i})=>/*#__PURE__*/e(y,{title:(()=>{switch(t){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}})(),subtitle:/*#__PURE__*/e(g,{children:(()=>{switch(t){case"loading":return o?"Please follow prompts to register your passkey.":"Please follow prompts to verify your passkey.\nYou will have to sign up with another method first to register a passkey for your account.";case"success":return"You've successfully logged in with your passkey.";case"error":if(s instanceof c){if(s.privyErrorCode===m.CANNOT_LINK_MORE_OF_TYPE)return"Cannot link more passkeys to account.";if(s.privyErrorCode===m.PASSKEY_NOT_ALLOWED)return"Passkey request timed out or rejected by user.\nYou will have to sign up with another method first to register a passkey for your account."}return"An unknown error occurred.\nYou will have to sign up with another method first to register a passkey for your account."}})()}),icon:r,iconVariant:"loading",iconLoadingStatus:{success:"success"===t,fail:"error"===t},primaryCta:"error"===t&&i?{label:"Retry",onClick:i}:"success"===t?{label:"Continue",disabled:!0}:void 0,watermark:!0}),f={component:()=>{let{data:r,setModalData:i,navigate:c}=l(),m=a(),{loginWithPasskey:y,signupWithPasskey:f,closePrivyModal:g,createAnalyticsEvent:v}=u(),{user:w,logout:j}=p(),{passkeySignupFlow:k}=r?.passkeyAuthModalData??{},S=n-500,[C,b]=t("loading"),[A,P]=t(null),E=o([]),W=e=>{E.current=[e,...E.current]};s((()=>()=>{E.current.forEach((e=>clearTimeout(e))),E.current=[]}),[]);let x=async()=>{b("loading");try{k?await f():await y(),b("success")}catch(e){P(e),b("error")}};return s((()=>{if("success"===C&&w){if(m?.legal.requireUsersAcceptTerms&&!w.hasAcceptedTerms)return void W(setTimeout((()=>{c("AffirmativeConsentScreen")}),S));if(!d(w,m?.embeddedWallets))return void W(setTimeout((()=>{g({shouldCallAuthOnSuccess:!0,isSuccess:!0})}),n));W(setTimeout((()=>{i({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),v({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"PasskeyStatusScreen"}}),j()},callAuthOnSuccessOnClose:!0}}),c("EmbeddedWalletOnAccountCreateScreen")}),S))}}),[w,C]),s((()=>{x()}),[]),/*#__PURE__*/e(h,{status:C,passkeySignupFlow:k,error:A,onRetry:x})}};let g=i.span`
2
- white-space: pre-wrap;
3
- `;export{f as PasskeyStatusScreen,h as PasskeyStatusScreenView,f as default};
@@ -1,20 +0,0 @@
1
- import{jsxs as e,jsx as r}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/ShieldCheckIcon";import{useState as o,useEffect as i}from"react";import{styled as s,css as a}from"styled-components";import{u as n,a as l,h as c}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{P as m}from"./ModalHeader-CSfzkWxZ.mjs";import{S as d}from"./Layouts-BlFm53ED.mjs";import{P as p,a as u,I as h,H as y,S as v}from"./shared-CQ6jg1BO.mjs";import{n as f}from"./index-DEtvMjrv.mjs";import{u as w,m as g}from"./internal-context-Z-fyxadS.mjs";import{S as j}from"./Screen-5StC6JLQ.mjs";import"viem";import"./context-bWeWAiND.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.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"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"./index-Dq_xe9dz.mjs";const b={component:()=>{let[s,a]=o(!0),{authenticated:m,user:b}=n(),{walletProxy:A,closePrivyModal:I,createAnalyticsEvent:P,client:S}=w(),{navigate:T,data:W,onUserCloseViaDialogOrKeybindRef:_}=l(),[E,R]=o(void 0),[H,M]=o(""),[U,N]=o(!1),{entropyId:O,entropyIdVerifier:V,onCompleteNavigateTo:$,onSuccess:z,onFailure:D}=W.recoverWallet,F=(e="User exited before their wallet could be recovered")=>{I({shouldCallAuthOnSuccess:!1}),D("string"==typeof e?new g(e):e)};_.current=F,i((()=>{if(!m)return F("User must be authenticated and have a Privy wallet before it can be recovered")}),[m]);/*#__PURE__*/return e(j,{children:[/*#__PURE__*/r(j.Header,{icon:t,title:"Enter your password",subtitle:"Please provision your account on this new device. To continue, enter your recovery password.",showClose:!0,onClose:F}),/*#__PURE__*/r(j.Body,{children:/*#__PURE__*/r(x,{children:/*#__PURE__*/e("div",{children:[/*#__PURE__*/e(p,{children:[/*#__PURE__*/r(u,{type:s?"password":"text",onChange:e=>(e=>{e&&R(e)})(e.target.value),disabled:U,style:{paddingRight:"2.3rem"}}),/*#__PURE__*/r(h,{style:{right:"0.75rem"},children:s?/*#__PURE__*/r(y,{onClick:()=>a(!1)}):/*#__PURE__*/r(v,{onClick:()=>a(!0)})})]}),!!H&&/*#__PURE__*/r(C,{children:H})]})})}),/*#__PURE__*/e(j.Footer,{children:[/*#__PURE__*/r(j.HelpText,{children:/*#__PURE__*/e(d,{children:[/*#__PURE__*/r("h4",{children:"Why is this necessary?"}),/*#__PURE__*/r("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]})}),/*#__PURE__*/r(j.Actions,{children:/*#__PURE__*/r(k,{loading:U||!A,disabled:!E,onClick:async()=>{N(!0);let e=await S.getAccessToken(),r=c(b,O);if(!e||!r||null===E)return F("User must be authenticated and have a Privy wallet before it can be recovered");try{P({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:r.address}}),await(A?.recover({accessToken:e,entropyId:O,entropyIdVerifier:V,recoveryPassword:E})),M(""),$?T($):I({shouldCallAuthOnSuccess:!1}),z?.(r),P({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:r.address}})}catch(e){f(e)?M("Invalid recovery password, please try again."):M("An error has occurred, please try again.")}finally{N(!1)}},$hideAnimations:!O&&U,children:"Recover your account"})}),/*#__PURE__*/r(j.Watermark,{})]})]})}};let x=s.div`
2
- display: flex;
3
- flex-direction: column;
4
- gap: 1.5rem;
5
- `,C=s.div`
6
- line-height: 20px;
7
- height: 20px;
8
- font-size: 13px;
9
- color: var(--privy-color-error);
10
- text-align: left;
11
- margin-top: 0.5rem;
12
- `,k=s(m)`
13
- ${({$hideAnimations:e})=>e&&a`
14
- && {
15
- // Remove animations because the recoverWallet task on the iframe partially
16
- // blocks the renderer, so the animation stutters and doesn't look good
17
- transition: none;
18
- }
19
- `}
20
- `;export{b as PasswordRecoveryScreen,b as default};
@@ -1 +0,0 @@
1
- import{jsxs as e,Fragment as t,jsx as r}from"react/jsx-runtime";import{useState as o,useEffect as a,useCallback as i}from"react";import{M as c,P as s,B as l}from"./ModalHeader-CSfzkWxZ.mjs";import{C as n}from"./ScreenHeader-CHmc4-Lu.mjs";import{q as d}from"./context-bWeWAiND.mjs";import{o as p,q as u,r as m,v as h,R as v,l as w}from"./index-DEtvMjrv.mjs";import{a as y,f,b as _,u as A}from"./internal-context-Z-fyxadS.mjs";import{a as E,u as g,g as C}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{a8 as b,a9 as R,aa as k}from"./paths-3HW55qZg.mjs";import{g as T}from"./useWallets-izyyA2re.mjs";import{a as O}from"./events-context-CI0iqAXA.mjs";import{A as N,G as S,R as x}from"./styles-BsotlekN.mjs";import"styled-components";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"@privy-io/js-sdk-core";import"eventemitter3";import"viem/utils";import"viem";import"./getPublicClient-B4uPLKn-.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"tinycolor2";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";async function I({url:e,popup:t,provider:r}){return t.location=e,new Promise(((e,r)=>{function o(){t?.close(),window.removeEventListener("message",a)}function a(t){t.data&&("PRIVY_OAUTH_RESPONSE"===t.data.type&&t.data.stateCode&&t.data.authorizationCode&&(e(t.data),o()),"https://cdn.apple-cloudkit.com"===t.origin&&t.data.ckSession&&(e({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:t.data.ckSession}),o()),"PRIVY_OAUTH_ERROR"===t.data.type&&(r(t.data.error),o()))}window.addEventListener("message",a)}))}async function M({api:e,provider:t,stateCode:r,codeVerifier:o,authorizationCode:a}){if(!a||!r)throw new y("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if("undefined"===a)throw new y("User denied confirmation during OAuth flow");try{return(await e.post(b,{authorization_code:a,state_code:r,code_verifier:o,provider:t})).access_token}catch(e){let t=f(e);if(t.privyErrorCode)throw new y(t.message||"Invalid code during OAuth flow.",void 0,t.privyErrorCode);if("User denied confirmation during OAuth flow"===t.message)throw new y("Invalid code during oauth flow.",void 0,_.OAUTH_USER_DENIED);throw new y("Invalid code during OAuth flow.",void 0,_.UNKNOWN_AUTH_ERROR)}}async function U({api:e,provider:t}){let r=p(),o=u(),a=await m(r);try{return"icloud"===t?{url:(await e.post(R,{client_type:"web"})).url}:{url:(await e.post(k,{redirect_to:window.location.href,code_challenge:a,state_code:o})).url,codeVerifier:r,stateCode:o,provider:t}}catch(e){throw f(e)}}let j={"google-drive":{name:"Google Drive",component:S},icloud:{name:"iCloud",component:N}};const W={component:()=>{let{logout:p}=g(),{navigate:u,setModalData:m,data:f}=E(),{closePrivyModal:b,createAnalyticsEvent:R}=A(),{execute:k}=(()=>{let{client:e,walletProxy:t,refreshSessionAndUser:r}=A(),{data:o}=E(),{user:a}=g(),i=O(),{create:c}=h();return{execute:async({provider:s,action:l,popup:n,shouldCreateEth:d,shouldCreateSol:p})=>{let u,m;if(!e)throw new y("Missing client");function h(t){if(!t&&e)throw e.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:s}}),new y("Recovery OAuth failed")}switch(s){case"google-drive":{let t,r,{url:o,codeVerifier:a,stateCode:i}=await U({api:e.api,provider:s});h(o);try{let a=await I({url:o,popup:n,provider:s});if(t=a.stateCode,r=a.authorizationCode,t!==i)throw e.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:s,storedStateCode:i??"",returnedStateCode:t??""}}),new y("Unexpected auth flow. This may be a phishing attempt.",void 0,_.OAUTH_UNEXPECTED)}catch(t){throw e.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:t.toString(),provider:s}}),new y("Recovery OAuth failed")}[u,m]=await Promise.all([e.getAccessToken(),M({api:e.api,provider:s,codeVerifier:a,stateCode:t,authorizationCode:r})]);break}case"icloud":{let{url:t}=await U({api:e.api,provider:s});h(t);let{ckWebAuthToken:r}=await I({url:t,popup:n,provider:s});m=r,u=await e.getAccessToken()}}if(!t)throw new y("Cannot connect to wallet proxy");if(!u)throw new y("Unable to authorize user");switch(l){case"recover":{let r=o?.recoverWallet?.entropyId,a=o?.recoverWallet?.entropyIdVerifier;if(!r||!a)throw new y("Recovery OAuth failed");e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:r,recoveryMethod:s}}),await t.recover({accessToken:u,entropyId:r,entropyIdVerifier:a,recoveryAccessToken:m}),e.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:r,recoveryMethod:s}});break}case"create-wallet":{let t;if(e.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),d&&p)t=await c({recoveryMethod:s,recoveryAccessToken:m,chainType:"ethereum",walletIndex:0,latestUser:a}),t=await c({chainType:"solana",walletIndex:0,latestUser:t.user});else if(p)t=await c({recoveryMethod:s,recoveryAccessToken:m,chainType:"solana",walletIndex:0,latestUser:a});else{if(!d)throw Error("Invalid args to create wallet");t=await c({recoveryMethod:s,recoveryAccessToken:m,chainType:"ethereum",walletIndex:0,latestUser:a})}if(!t)throw i("createWallet","onError",_.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to create wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:t.account.address}}),i("createWallet","onSuccess",{wallet:t.account});break}case"set-recovery":{let o=C(a);if(!o)throw i("setWalletRecovery","onError",_.EMBEDDED_WALLET_NOT_FOUND),Error("Embedded wallet not found");e.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:o.address,existingRecoveryMethod:o.recoveryMethod,targetRecoveryMethod:s}});let{entropyId:c,entropyIdVerifier:l}=T(a);await t.setRecovery({accessToken:u,entropyId:c,entropyIdVerifier:l,recoveryMethod:s,recoveryAccessToken:m});let n=C(await r());if(!n)throw i("createWallet","onError",_.UNKNOWN_EMBEDDED_WALLET_ERROR),Error("Failed to set recovery on wallet");e.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:o.address,existingRecoveryMethod:o.recoveryMethod,targetRecoveryMethod:s}}),i("setWalletRecovery","onSuccess",{method:s,wallet:n});break}default:throw new y("Unsupported recovery action")}}}})(),[N,S]=o(!1),{provider:W,action:P,isInAccountCreateFlow:D,shouldCreateEth:V,shouldCreateSol:L}=f?.recoveryOAuthStatus,[z,H]=o(void 0),[$,B]=o("create-wallet"===P);if("user-passcode"===W)throw Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let F=j[W].name,G=j[W].component,K=f?.recoverWallet?.onCompleteNavigateTo,Y=new v((async(e="create-wallet")=>(B(!0),new Promise(((t,r)=>{setTimeout((async()=>{try{let r=window.open();await k({provider:W,action:e,popup:r,shouldCreateEth:V,shouldCreateSol:L}),S(!0),t()}catch(t){H({message:`${"recover"===e?"Recovery":"Back up"} with ${F} unsuccessful`,detail:"recover"===P?`Please verify that you are selecting the ${F} account associated with your backup.`:"",retryable:!0}),r()}}),0)})))));a((()=>{"recover"!==P&&Y.execute(D?"create-wallet":"set-recovery")}),[]),a((()=>{if(!N)return;let e=setTimeout((()=>{D?(m({createWallet:{onSuccess:()=>{},onFailure:e=>{R({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"RecoveryOAuthScreen"}}),p()},callAuthOnSuccessOnClose:!0,shouldCreateEth:!1,shouldCreateSol:!1}}),u("EmbeddedWalletCreatedScreen")):b({shouldCallAuthOnSuccess:!1})}),d);return()=>clearTimeout(e)}),[N]);let q=i((async()=>{await Y.execute("recover"),K?u(K):S(!0)}),[]),X="google-drive"===W?"Google Drive":"Apple iCloud",Q=N&&`Successfully ${"recover"===P?"recovered":"backed up"} with ${X}.`||z&&z.message||`${"recover"===P?"Recovering":"Backing up"} with ${X}...`,J=z?z.detail:"";/*#__PURE__*/return e(t,{children:[/*#__PURE__*/r(c,{}),$?/*#__PURE__*/r(t,{children:/*#__PURE__*/e(x,{children:[/*#__PURE__*/r(n,{title:Q,icon:/*#__PURE__*/r(G,{style:{width:"38px",height:"38px"}}),description:J}),z&&z?.retryable?/*#__PURE__*/r(s,{onClick:()=>{w(),H(void 0),"create-wallet"===P?Y.execute("create-wallet"):q()},disabled:!N&&!z?.retryable,children:"Try again"}):null]})}):/*#__PURE__*/e(x,{children:[/*#__PURE__*/r(n,{title:"Confirm it's really you",icon:/*#__PURE__*/r(G,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${X} where your account is backed up.`}),/*#__PURE__*/e(s,{onClick:q,children:["Confirm with ",X]})]}),/*#__PURE__*/r(l,{})]})}};export{W as RecoveryOAuthScreen,W as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as o}from"react";import{u as r}from"./context-bWeWAiND.mjs";import{v as i,R as s}from"./index-DEtvMjrv.mjs";import{u as a,m as n}from"./internal-context-Z-fyxadS.mjs";import{a as c,u as l}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{S as m,g as p}from"./SetWalletPasswordForm-lzuYpBex.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"./Layouts-BlFm53ED.mjs";import"./ModalHeader-CSfzkWxZ.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-CQ6jg1BO.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{navigate:u,data:d,onUserCloseViaDialogOrKeybindRef:h}=c(),w=r(),[y,v]=t(""),[j,f]=t(!1),[g,C]=t(),[I,b]=t(null),{create:x}=i(),{authenticated:P,user:S}=l(),{closePrivyModal:A,isNewUserThisSession:T,initializeWalletProxy:U}=a(),{onSuccess:k,onFailure:E,callAuthOnSuccessOnClose:M,shouldCreateEth:O,shouldCreateSol:W}=d.createWallet,[D,L]=t(null),R=new s((async()=>{try{let e;if(O&&W)e=await x({recoveryMethod:"user-passcode",recoveryPassword:g,chainType:"ethereum",walletIndex:0,latestUser:S}),e=await x({chainType:"solana",walletIndex:0,latestUser:e.user});else if(W)e=await x({recoveryMethod:"user-passcode",recoveryPassword:g,chainType:"solana",walletIndex:0,latestUser:S});else{if(!O)throw Error("Invalid args to create wallet");e=await x({recoveryMethod:"user-passcode",recoveryPassword:g,chainType:"ethereum",walletIndex:0,latestUser:S})}L(e),T?u("EmbeddedWalletCreatedScreen"):(k(e),A({shouldCallAuthOnSuccess:M}))}catch(e){v(e.message)}}));o((()=>{I||U(3e4).then((e=>b(e)))}),[I]),o((()=>{if(!P||!S)return u("LandingScreen"),void E(Error("User must be authenticated before creating a Privy wallet"))}),[P]),h.current=()=>null;/*#__PURE__*/return e(m,{config:{initiatedBy:"automatic"},appName:w?.name||"privy",loading:!I,buttonLoading:j,buttonHideAnimations:!D&&j,isResettingPassword:!1,error:y,password:g||"",onClose:()=>{D&&"user-passcode"!==D.account.recoveryMethod?(E(new n("User created a wallet but failed to set a password for it")),A({shouldCallAuthOnSuccess:!1})):D?(k(D),A({shouldCallAuthOnSuccess:M})):(E(new n("User wallet creation failed")),A({shouldCallAuthOnSuccess:!1}))},onPasswordChange:C,onPasswordGenerate:()=>C(p()),onSubmit:async()=>(f(!0),R.execute().then((()=>new Promise((e=>setTimeout(e,250))))).finally((()=>f(!1))))})}};export{u as EmbeddedWalletPasswordCreateScreen,u as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as r}from"react";import{a as o,m as i,C as a}from"./index-DEtvMjrv.mjs";import{u as s,q as n}from"./context-bWeWAiND.mjs";import{u as l,b as m,k as c}from"./internal-context-Z-fyxadS.mjs";import{u as d,a as u}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{s as p}from"./shouldProceedtoEmbeddedWalletCreationFlow-BfZwb-3N.mjs";import{S as g}from"./ScreenLayout-C2Le_YIv.mjs";import{T as v}from"./telegram-B-JqnkqZ.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.mjs";import"tinycolor2";import"./ModalHeader-CSfzkWxZ.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-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const y=({success:t,errorMessage:r,onRetry:o})=>{let i=t?"Successfully connected with Telegram":r?r.message:"Verifying connection to Telegram";/*#__PURE__*/return e(g,{title:i,subtitle:t?"You're good to go!":r?r.detail:"Just a few moments more",icon:v,iconVariant:"loading",iconLoadingStatus:{success:t,fail:!!r},secondaryCta:r?.retryable&&o?{label:"Retry",onClick:o}:void 0,watermark:!0})},f={component:()=>{let{authenticated:g,logout:v,ready:f,user:h}=d(),{setModalData:A,navigate:b,resetNavigation:j,data:T}=u(),C=s(),{initLoginWithTelegram:S,loginWithTelegram:w,updateWallets:E,setReadyToTrue:R,closePrivyModal:W,createAnalyticsEvent:_,getAuthMeta:k}=l(),[x,L]=t(!1),[M,I]=t(void 0),D=o();async function U(){try{let e=await async function(){let e;if(!g){if(D.enabled&&"error"===D.status)throw new a(D.error,null,m.CAPTCHA_FAILURE);return D.enabled&&"success"!==D.status&&(D.execute(),e=await D.waitForResult()),e}}();await w({captchaToken:e}),L(!0),R(!0)}catch(e){if(e?.privyErrorCode===m.ALLOWLIST_REJECTED)return I(void 0),j(),void b("AllowlistRejectionScreen");if(e?.privyErrorCode===m.USER_LIMIT_REACHED)return console.error(new c(e).toString()),I(void 0),j(),void b("UserLimitReachedScreen");if(e?.privyErrorCode===m.USER_DOES_NOT_EXIST)return I(void 0),j(),void b("AccountNotFoundScreen");if(e?.privyErrorCode===m.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return I(void 0),j(),A({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,telegramAuthResult:k()?.telegramAuthResult,telegramWebAppData:k()?.telegramWebAppData,displayName:e.data?.data?.account?.displayName,linkMethod:"telegram",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void b("LinkConflictScreen");let{retryable:t,detail:r}=i(e);I({retryable:t,detail:r,message:"Authentication failed"})}}r((()=>{U()}),[]),r((()=>{if(!(f&&g&&x&&h))return;if(C?.legal.requireUsersAcceptTerms&&!h.hasAcceptedTerms){let e=setTimeout((()=>{b("AffirmativeConsentScreen")}),n);return()=>clearTimeout(e)}if(p(h,C.embeddedWallets)){let e=setTimeout((()=>{A({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),_({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:"telegram",screen:"TelegramAuthScreen"}}),v()},callAuthOnSuccessOnClose:!0}}),b("EmbeddedWalletOnAccountCreateScreen")}),n);return()=>clearTimeout(e)}E();let e=setTimeout((()=>W({shouldCallAuthOnSuccess:!0,isSuccess:!0})),n);return()=>clearTimeout(e)}),[f,g,x,h]);/*#__PURE__*/return e(y,{success:x,errorMessage:M,onRetry:M?.retryable?async()=>{try{I(void 0),T?.telegramAuthModalData?.seamlessAuth||await S(void 0,T?.login?.disableSignup),await U()}catch(e){let{retryable:t,detail:r}=i(e);I({retryable:t,detail:r,message:"Authentication failed"})}}:void 0})},isCaptchaRequired:!0,isShownBeforeReady:!0};export{f as TelegramAuthScreen,y as TelegramAuthScreenView,f as default};
@@ -1 +0,0 @@
1
- import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import i from"@heroicons/react/24/outline/EnvelopeIcon";import{B as o}from"./Layouts-BlFm53ED.mjs";import{Mail as a}from"lucide-react";import{forwardRef as s,useState as m}from"react";import{u as n}from"./context-bWeWAiND.mjs";import{a as l}from"./index-DEtvMjrv.mjs";import{u as c}from"./internal-context-Z-fyxadS.mjs";import{u as d,a as p}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{a1 as u,V as h}from"./useActiveWallet-CSq3KvGj.mjs";import{E as j,P as v}from"./ModalHeader-CSfzkWxZ.mjs";import{I as f,E as g}from"./EmailInputForm-Dgoii4vf.mjs";import{E as y}from"./ErrorMessage-D8VaAP5m.mjs";import{S as w}from"./ScreenLayout-C2Le_YIv.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-izyyA2re.mjs";import"./use-export-wallet-DyNNbsJn.mjs";import"viem/utils";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-CvOp4eQ7.mjs";import"./events-context-CI0iqAXA.mjs";import"@scure/base";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"viem";import"./PrivyPluginContext-2QN2dVUw.mjs";import"./getEmbeddedConnectedWallet-JzK4iD-L.mjs";import"./getPublicClient-B4uPLKn-.mjs";import"ofetch";import"js-cookie";import"./frame-uzTmvtww.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-Do5Oi_rb.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-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const k=/*#__PURE__*/s(((i,o)=>{let[s,f]=m(""),[g,w]=m(""),[k,S]=m(!1),{authenticated:x,user:A}=d(),{initUpdateEmail:C}=c(),{navigate:P,setModalData:I,currentScreen:M}=p(),{enabled:T,token:U}=l(),D=n(),L=u(s)&&(D.disablePlusEmails&&s.includes("+")?(g||w("Please enter a valid email address without a '+'."),!1):(g&&w(""),!0)),W=k||!L,q=()=>{!T||U||x?(async e=>{if(!A?.email)throw Error("User is required to have an email address to update it.");S(!0);try{await C({oldAddress:A.email.address,newAddress:s,captchaToken:e}),P("AwaitingPasswordlessCodeScreen")}catch(e){I({errorModalData:{error:e,previousScreen:M||"LandingScreen"}}),P("ErrorScreen")}S(!1)})(U):(I({captchaModalData:{callback:e=>{if(!A?.email)throw Error("User is required to have an email address to update it.");return C({oldAddress:A.email.address,newAddress:s,captchaToken:e})},userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),P("CaptchaScreen"))};/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(b,{children:[g&&/*#__PURE__*/t(y,{style:{marginTop:"0.25rem",textAlign:"left"},children:g}),/*#__PURE__*/e(E,{$error:!!g,children:[/*#__PURE__*/t(h,{children:/*#__PURE__*/t(a,{})}),/*#__PURE__*/t("input",{ref:o,id:"email-input",type:"email",placeholder:"your@email.com",onChange:e=>f(e.target.value),onKeyUp:e=>{"Enter"===e.key&&q()},value:s,autoComplete:"email"}),i.stacked?null:/*#__PURE__*/t(j,{isSubmitting:k,onClick:q,disabled:W,children:"Submit"})]})]}),i.stacked?/*#__PURE__*/t(v,{loadingText:null,loading:k,disabled:W,onClick:q,style:{width:"100%"},children:"Submit"}):null]})}));let b=f,E=g;const S=({title:e="Update your email",subtitle:r="Add the email address you'd like to use going forward. We'll send you a confirmation code"})=>/*#__PURE__*/t(w,{title:e,subtitle:r,icon:i,watermark:!0,children:/*#__PURE__*/t(o,{children:/*#__PURE__*/t(k,{stacked:!0})})}),x={component:()=>/*#__PURE__*/t(S,{})};export{x as UpdateEmailScreen,S as UpdateEmailScreenView,x as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/PhoneIcon";import{useState as o}from"react";import{C as r}from"./ConnectPhoneForm-DMcfvHG9.mjs";import{u as i}from"./internal-context-Z-fyxadS.mjs";import{a as n,u as m}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{S as a}from"./ScreenLayout-C2Le_YIv.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"./context-bWeWAiND.mjs";import"tinycolor2";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"./getPublicClient-B4uPLKn-.mjs";import"./ModalHeader-CSfzkWxZ.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"ofetch";import"./Screen-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const s=({title:i="Update your phone number",subtitle:n="Add the phone number you'd like to use going forward. We'll send you a confirmation code",onSubmit:m,isSubmitting:s=!1})=>{let[c,u]=o(null);/*#__PURE__*/return e(a,{title:i,subtitle:n,icon:t,primaryCta:{label:s?"Submitting":"Update",onClick:async()=>{c?.qualifiedPhoneNumber&&await m(c)},disabled:!c?.isValid||s},watermark:!0,children:/*#__PURE__*/e(r,{onChange:e=>{u(e)},onSubmit:async()=>{},noIncludeSubmitButton:!0,hideRecent:!0})})},c={component:()=>{let{currentScreen:t,data:r,navigate:a,setModalData:c}=n(),{user:u}=m(),{initUpdatePhone:l}=i(),[p,d]=o(!1);/*#__PURE__*/return e(s,{onSubmit:async e=>{d(!0);try{if(!u?.phone?.number)throw Error("User is required to have an phone number to update it.");await l(u?.phone?.number,e.qualifiedPhoneNumber),a("AwaitingPasswordlessCodeScreen")}catch(e){c({errorModalData:{error:e,previousScreen:r?.errorModalData?.previousScreen||t||"LinkPhoneScreen"}}),a("ErrorScreen")}finally{d(!1)}},isSubmitting:p})}};export{c as UpdatePhoneScreen,s as UpdatePhoneScreenView,c as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{a as e}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{S as o}from"./ScreenLayout-C2Le_YIv.mjs";import"viem";import"react";import"./context-bWeWAiND.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./ModalHeader-CSfzkWxZ.mjs";import"styled-components";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.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-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const i=({style:e,...o})=>/*#__PURE__*/t("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...e},...o,children:/*#__PURE__*/t("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})}),r=({title:e="Unable to sign in",subtitle:r="This is a test application that has reached its user limit. To allow more users, this app needs to be upgraded to production.",onGoBack:n})=>/*#__PURE__*/t(o,{title:e,subtitle:r,icon:i,iconVariant:"subtle",primaryCta:{label:"Go back",onClick:n},showBack:!0,onBack:n,watermark:!0}),n={component:()=>{let{navigate:o}=e();/*#__PURE__*/return t(r,{onGoBack:()=>{o("LandingScreen")}})}};export{n as UserLimitReachedScreen,r as UserLimitReachedScreenView,n as default};
@@ -1 +0,0 @@
1
- import{jsx as t}from"react/jsx-runtime";import{useState as e}from"react";import{u as o,a as i}from"./get-is-unified-wallet-GcvxyU9r.mjs";import{S as n}from"./ScreenLayout-C2Le_YIv.mjs";import"viem";import"./context-bWeWAiND.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Z-fyxadS.mjs";import"ofetch";import"./ModalHeader-CSfzkWxZ.mjs";import"styled-components";import"./useActiveWallet-CSq3KvGj.mjs";import"zustand";import"react-device-detect";import"./use-export-wallet-DyNNbsJn.mjs";import"eventemitter3";import"viem/utils";import"./useWallets-izyyA2re.mjs";import"./events-context-CI0iqAXA.mjs";import"./getPublicClient-B4uPLKn-.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-5StC6JLQ.mjs";import"./index-Dq_xe9dz.mjs";const r=({title:e,subtitle:o,buttonText:i,buttonHref:r,isLoading:l=!1,helpText:a,onButtonClick:m})=>/*#__PURE__*/t(n,{title:e,subtitle:o,primaryCta:{label:i,onClick:()=>{r&&window.open(r,"_self"),m?.()},disabled:l},helpText:a,watermark:!0}),l={component:()=>{let{ready:n}=o(),{data:l}=i(),[a,m]=e(!1);if(!l?.installWalletModalData)throw Error("Wallet data is missing");let{walletConfig:s,connectOnly:c,chainType:p}=l.installWalletModalData,u=s.getMobileRedirect({useUniversalLink:!a,isSolana:"solana"===p,connectOnly:c}),d=s.name.replace(/ wallet/gi,""),h={title:`Redirecting to ${d} Mobile Wallet`,description:`We'll take you to the ${d} Mobile Wallet app to continue your login experience.`,footnote:""};return n&&(h.description=`For the best experience, we'll automatically log you into the ${d} Mobile Wallet in-app browser.`,h.footnote="You can always return here to login via other methods."),a&&(h.title="Still here?",h.description=`You may need to install the ${s.name} mobile app.`,h.footnote=`Once you're done, you can connect with ${s.name} wallet to complete the login.`),/*#__PURE__*/t(r,{title:h.title,subtitle:h.description,buttonText:a?"Go to App Store":"Continue",buttonHref:u,isLoading:n&&!u,helpText:h.footnote||void 0,onButtonClick:()=>{setTimeout((()=>m(!0)),1e3)}})}};export{l as WalletInterstitialScreen,r as WalletInterstitialScreenView,l as default};
@@ -1 +0,0 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as t,useMemo as a,useEffect as n,createContext as o,useContext as l}from"react";import{dedupeSupportedChains as r,DEFAULT_SUPPORTED_CHAINS as i,mainnet as s}from"@privy-io/js-sdk-core";import c from"tinycolor2";const d="https://auth.privy.io",u=2e4,g=1400,h=2500,f=4e3,p="3.13.0",_="privy:token",b="privy-token",m="privy:refresh_token",v="privy-refresh-token",w="privy:pat",k="privy:id_token",y="privy-id-token",F="privy-session",C="privy:caid",M=e=>`privy:guest:${e}`,A=e=>`privy:cross-app:${e}`,E="privy:state_code",x="privy:code_verifier",B="privy:headless_oauth",D="privy:oauth_disable_signup",W=e=>`privy:wallet:${e}`,S="privy:connections",L=12e4,H=1,I="0x1",O=3e4,U="https://api.moonpay.com/v1",P="https://api.moonpay.com/v1",q="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",j="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",R="deprecated",T={appearance:{landingHeader:"Log in or sign up",theme:"light",walletList:["detected_ethereum_wallets","detected_solana_wallets","metamask","coinbase_wallet","rainbow","base_account","wallet_connect","phantom"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let N=new Set(["coinbase_wallet","base_account","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","ronin_wallet","haha_wallet","wallet_connect","wallet_connect_qr","wallet_connect_qr_solana","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe","solflare","backpack","jupiter","binance","binanceus","bitget_wallet","kraken_wallet"]),$=e=>N.has(e),z=(e,t,a)=>a.indexOf(e)===t;const Y=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter($).filter(z):e?e.filter($).filter(z):T.appearance.walletList;let G=/paymaster\.biconomy\.io\/api/i,J={mode:"SPONSORED",calculateGasLimits:!0,expiryDuration:300,sponsorshipInfo:{webhookData:{},smartAccountInfo:{name:"BICONOMY",version:"2.0.0"}}};const V=(e,t)=>e&&G.test(e)?J:t&&t.policy_id?{policyId:t.policy_id}:void 0;function K(e,t){let a=Math.max(0,Math.min(1,e.toHsl().l+t));return c({...e.toHsl(),l:a})}function X(e,t){let a=e.getLuminance(),n=t.getLuminance();return(Math.max(a,n)+.05)/(Math.min(a,n)+.05)}function Z(e,t){if(!e){let e=t?ee:te;return{accent:c(e.background.interactive),accentLight:c(e.background.interactive),accentHover:c(e.background["interactive-hover"]),accentDark:c(e.background["interactive-clicked"]),accentDarkest:c(e.background["interactive-disabled"])}}let a=c(e);return{accent:a,accentLight:K(a,.15),accentHover:K(a,.3),accentDark:K(a,-.06),accentDarkest:K(a,-.6)}}function Q({backgroundTheme:e,accentHex:t}){let a,n;"light"===e?a=!1:"dark"===e?a=!0:(a=.5>=c(e).getLuminance(),n=c(e).toHslString());let o=a?"dark":"light",l=a?ee:te,{accent:r,accentLight:i,accentHover:s,accentDark:d,accentDarkest:u}=Z(t,a),g=function(e){let t=c(te.text.default),a=c(ee.text.default),n=X(e,t),o=X(e,a),l=e.toHsl();return l.h>=220&&l.h<=300&&o>=3?ee.text.default:n>o?te.text.default:ee.text.default}(r),h=c(g),f=X(r,c(l.background.default))>=3;return{colorScheme:o,background:n||l.background.default,background2:l.background.elevated,background3:l.background.interactive,foreground:l.text.default,foreground2:l.text.muted,foreground3:l.text.placeholder,foreground4:l.border.default,accent:r.toHslString(),accentLight:i.toHslString(),accentHover:s.toHslString(),accentDark:d.toHslString(),accentDarkest:u.toHslString(),foregroundAccent:h.toHslString(),success:l.background.success,successDark:l.text.success,successLight:l.background.success,error:l.text.error,errorLight:l.background.error,warn:l.background.warning,warnLight:l.background.warning,warningDark:l.text.warning,errorDark:l.text.error,successBg:l.background.success,errorBg:l.background.error,errorBgHover:l.background["error-hover"],warnBg:l.background.warning,infoBg:l.background.info,infoBgHover:l.background["info-hover"],borderDefault:l.border.default,borderHover:l.border["default-hover"],borderFocus:l.border.focused,borderError:l.border.error,borderSuccess:l.border.success,borderWarning:l.border.warning,borderInfo:l.border.info,borderInteractive:l.border.interactive,borderInteractiveHover:l.border["interactive-hover"],backgroundHover:l.background["default-hover"],backgroundClicked:l.background["default-clicked"],backgroundDisabled:l.background["default-disabled"],backgroundInteractive:l.background.interactive,backgroundInteractiveHover:l.background["interactive-hover"],backgroundInteractiveClicked:l.background["interactive-clicked"],backgroundInteractiveDisabled:l.background["interactive-disabled"],foregroundHover:l.text.default,foregroundClicked:l.text.default,foregroundDisabled:l.text["default-disabled"],foregroundInteractive:l.text.interactive,foregroundInteractiveHover:l.text["interactive-hover"],accentHasGoodContrast:f?"1":"0",linkNavigationColor:f?r.toHslString():l.text.default,linkNavigationDecoration:f?"none":"underline",iconDefault:l.icon.default,iconMuted:l.icon.muted,iconSubtle:l.icon.subtle,iconInverse:l.icon.inverse,iconSuccess:l.icon.success,iconWarning:l.icon.warning,iconError:l.icon.error,iconInteractive:l.icon.interactive,iconDefaultHover:l.icon["default-hover"],iconMutedHover:l.icon["muted-hover"],iconSubtleHover:l.icon["subtle-hover"],iconDefaultClicked:l.icon["default-clicked"],iconMutedClicked:l.icon["muted-clicked"],iconSubtleClicked:l.icon["subtle-clicked"],iconDefaultDisabled:l.icon["default-disabled"],iconMutedDisabled:l.icon["muted-disabled"],iconSubtleDisabled:l.icon["subtle-disabled"],iconErrorHover:l.icon["error-hover"],iconInteractiveHover:l.icon["interactive-hover"],iconErrorClicked:l.icon["error-clicked"],iconInteractiveClicked:l.icon["interactive-clicked"],iconMutedDisabledAlt:l.icon["muted-disabled"],iconSubtleDisabledAlt:l.icon["subtle-disabled"]}}const ee={background:{default:"#020713",elevated:"#1A2230","default-hover":"#101724","default-clicked":"#1A2230","default-disabled":"#020713",success:"#0E3E2D",warning:"#373827",error:"#2E0C18",interactive:"#8B86FF","error-hover":"#441821","interactive-hover":"#7B73E5","interactive-clicked":"#6560CC","interactive-disabled":"#141824",info:"#1F2937","info-hover":"#141824"},icon:{default:"#F8F8F8",muted:"#9BA2AE",subtle:"#7B8491",inverse:"#020713",success:"#88E3B5",warning:"#FDF27B",error:"#EF4444",interactive:"#88B6FF","default-hover":"#F8F8F8","muted-hover":"#AEB3BD","subtle-hover":"#8B939E","default-clicked":"#F8F8F8","muted-clicked":"#9097A5","subtle-clicked":"#78818E","default-disabled":"#404452","muted-disabled":"#404452","subtle-disabled":"#404452","error-hover":"#F05555","interactive-hover":"#7B73E5","error-clicked":"#EF4444","interactive-clicked":"#6560CC"},text:{default:"#F8F8F8",muted:"#9BA2AE",placeholder:"#7B8491",success:"#ACEECB",warning:"#FEF9A0",error:"#FCA5A5",interactive:"#A29EFF","default-disabled":"#404452","interactive-hover":"#8C88E5"},border:{default:"#1F2937",interactive:"#88B0FF",focused:"#F8F8FC",info:"#5B83D3",success:"#317056",warning:"#FBBF24",error:"#F87171","default-hover":"#34304A","interactive-hover":"#88B0FF"}},te={background:{default:"#FFFFFF",elevated:"#F1F2F9","default-hover":"#F8F9FC","default-clicked":"#F1F2F9","default-disabled":"#FFFFFF",success:"#DCFCE7",warning:"#FEF3C7",error:"#FEE2E2",interactive:"#5B4FFF","error-hover":"#FECACA","interactive-hover":"#4F46E5","interactive-clicked":"#4338CA","interactive-disabled":"#F1F2F9",info:"#E0E7FF","info-hover":"#EEF2FF"},icon:{default:"#110F2A",muted:"#64668B",subtle:"#9498B8",inverse:"#FFFFFF",success:"#33B287",warning:"#F59E0B",error:"#EF4444",interactive:"#564FFF","default-hover":"#1D1B35","muted-hover":"#64668B","subtle-hover":"#888AAE","default-clicked":"#060C23","muted-clicked":"#64668B","subtle-clicked":"#788804","default-disabled":"#CBCDE1","muted-disabled":"#CBCDE1","subtle-disabled":"#CBCDE1","error-hover":"#F06060","interactive-hover":"#4F46E5","error-clicked":"#DC3838","interactive-clicked":"#2BA482"},text:{default:"#040217",muted:"#64668B",placeholder:"#9498B8",success:"#135638",warning:"#906218",error:"#991B1B",interactive:"#5B4FFF","default-disabled":"#CBCDE1","interactive-hover":"#5B4FFF"},border:{default:"#E2E3F0",interactive:"#5B4FFF",focused:"#949DF9",info:"#F1F2F9",success:"#87D7B7",warning:"#FACD63",error:"#F69393","default-hover":"#E2E3F0","interactive-hover":"#5B4FFF"}};function ae(e,t,a,n,o){let l,c,d,u,g,h,f,p,_,b,m,v,w,k,y,F,C,M,A=a?console.warn:()=>{},E=[];if(t?.loginMethods)for(let e of(l=t.loginMethods.includes("email"),c=t.loginMethods.includes("sms"),u=t.loginMethods.includes("wallet"),g=t.loginMethods.includes("google"),h=t.loginMethods.includes("twitter"),f=t.loginMethods.includes("discord"),m=t.loginMethods.includes("spotify"),v=t.loginMethods.includes("instagram"),p=t.loginMethods.includes("tiktok"),_=t.loginMethods.includes("line"),b=t.loginMethods.includes("twitch"),k=t.loginMethods.includes("github"),w=t.loginMethods.includes("linkedin"),y=t.loginMethods.includes("apple"),F=t.loginMethods.includes("farcaster"),C=t.loginMethods.includes("telegram"),d=t.loginMethods.includes("passkey"),t.loginMethods))"string"==typeof e&&e.startsWith("privy:")&&E.push(e);else l=e.email_auth,c=e.sms_auth,u=e.wallet_auth||e.solana_wallet_auth,g=e.google_oauth,h=e.twitter_oauth,f=e.discord_oauth,k=e.github_oauth,m=e.spotify_oauth,v=e.instagram_oauth,p=e.tiktok_oauth,_=e.line_oauth,b=e.twitch_oauth,w=e.linkedin_oauth,y=e.apple_oauth,F=e.farcaster_auth,C=e.telegram_auth,d=e.passkey_auth,M=e.custom_jwt_auth;e.passkey_auth&&(d=!0),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential&&(d=!1);let x=[l,c].filter(Boolean),B=[g,h,f,k,m,v,p,_,b,w,y,F,C].filter(Boolean),D=[u].filter(Boolean),W=t?.loginMethods?.includes("passkey")??!1,S=e.passkeys_for_signup_enabled??!1,L=[d&&(S||W)].filter(Boolean),H=[M].filter(Boolean);if(x.length+B.length+D.length+L.length+H.length+E.length===0)throw Error("You must enable at least one login method");let I=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.show_wallet_login_first;I&&0===D.length?(A("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),I=!1):I||B.length+x.length!==0||(A("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),I=!0);let O=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&A("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let U=Y({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder});if((U.includes("wallet_connect_qr")||U.includes("wallet_connect"))&&U.includes("wallet_connect_qr_solana"))throw Error("wallet_connect_qr and wallet_connect_qr_solana cannot both be present in walletList due to WalletConnect session conflicts.");let P=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],a=[];for(let a of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(a)?console.warn(`Duplicated login method: ${a}`):t.push(a);for(let n of e.overflow??[])t.includes(n)||a.includes(n)?console.warn(`Duplicated login method: ${n}`):a.push(n);return{primary:t,overflow:a}})({input:t?.loginMethodsAndOrder}),q=t?.intl?.defaultCountry??"US",{chains:j,defaultChain:R}=function({supportedChains:e,defaultChainFromConfig:t}){let a;if(e){if(0===e.length)throw Error("`supportedChains` must contain at least one chain");a=r(e)}else a=[...i];let n=e?a[0]:s,o=t??n;if(!a.find((e=>e.id===o.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:a,defaultChain:o}}({supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain}),N=!!t?.defaultChain,$=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,z=$?"all-users":e.embedded_wallet_config.ethereum.create_on_login,G=e.embedded_wallet_config.solana.create_on_login;e.solana_wallet_auth&&!t?.externalWallets?.solana?.connectors&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`");let J=e.telegram_auth_config?{botId:e.telegram_auth_config.bot_id,botName:e.telegram_auth_config.bot_name,linkEnabled:e.telegram_auth_config.link_enabled,seamlessAuthEnabled:e.telegram_auth_config.seamless_auth_enabled}:void 0,K=e.funding_config?{methods:e.funding_config.methods,options:e.funding_config.options,defaultRecommendedAmount:e.funding_config.default_recommended_amount,defaultRecommendedCurrency:e.funding_config.default_recommended_currency,promptFundingOnWalletCreation:e.funding_config.prompt_funding_on_wallet_creation,crossChainBridgingEnabled:e.funding_config.cross_chain_bridging_enabled}:void 0,X=e.smart_wallet_config;return{id:e.id,appClientId:o,name:e.name,allowlistConfig:{errorTitle:e.allowlist_config.error_title,errorDetail:e.allowlist_config.error_detail,errorCtaText:e.allowlist_config.cta_text,errorCtaLink:e.allowlist_config.cta_link},legacyWalletUiConfig:e.legacy_wallet_ui_config,appearance:{logo:t?.appearance?.logo??e.logo_url??void 0,landingHeader:t?.appearance?.landingHeader??T.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,footerLogo:t?.appearance?.footerLogo,palette:Q({backgroundTheme:t?.appearance?.theme??T.appearance.theme,accentHex:t?.appearance?.accentColor??e.accent_color}),loginGroupPriority:I?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:U,walletChainType:t?.appearance?.walletChainType??(({evmWalletAuth:e,solanaWalletAuth:t})=>e&&t?"ethereum-and-solana":e?"ethereum-only":t?"solana-only":"ethereum-only")({evmWalletAuth:e.wallet_auth??!1,solanaWalletAuth:e.solana_wallet_auth??!1})},loginMethods:{wallet:u,email:l,sms:c,passkey:d,google:g,twitter:h,discord:f,github:k,spotify:m,instagram:v,tiktok:p,line:_,twitch:b,linkedin:w,apple:y,farcaster:F,telegram:C},globalDisablePasskeys:t?.globalDisablePasskeys??!1,customOAuthProviders:(e.custom_oauth_providers??[]).filter((e=>!1!==e.enabled)),crossAppProviders:E,disablePlusEmails:e.disable_plus_emails,loginMethodsAndOrder:P,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.terms_and_conditions_url,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacy_policy_url,requireUsersAcceptTerms:e.require_users_accept_terms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.wallet_connect_cloud_project_id??T.walletConnectCloudProjectId,rpcConfig:{rpcUrls:{},rpcTimeouts:t?.externalWallets?.signatureRequestTimeouts??{}},chains:j,defaultChain:R,intl:{defaultCountry:q,textLocalization:t?.intl?.textLocalization},shouldEnforceDefaultChainOnConnect:N,captcha:{enabledProvider:e.enabled_captcha_provider??null,siteKey:e.captcha_site_key},externalWallets:{coinbaseWallet:{config:{appName:e.name,appLogoUrl:e.logo_url,preference:{options:"all",...t?.externalWallets?.coinbaseWallet?.config?.preference},...t?.externalWallets?.coinbaseWallet?.config}},baseAccount:{config:{appName:e.name,appLogoUrl:e.logo_url,...t?.externalWallets?.baseAccount?.config,preference:{...t?.externalWallets?.baseAccount?.config?.preference,telemetry:!1}}},walletConnect:{enabled:O},solana:{connectors:t?.externalWallets?.solana?.connectors},disableAllExternalWallets:t?.externalWallets?.disableAllExternalWallets??!1},embeddedWallets:{requireUserOwnedRecoveryOnCreate:!$&&(e.embedded_wallet_config.require_user_owned_recovery_on_create??!1),userOwnedRecoveryOptions:$?["user-passcode"]:e.embedded_wallet_config.user_owned_recovery_options,priceDisplay:t?.embeddedWallets?.priceDisplay??{primary:"fiat-currency",secondary:"native-token"},ethereum:{createOnLogin:t?.embeddedWallets?.ethereum?.createOnLogin??z},solana:{createOnLogin:t?.embeddedWallets?.solana?.createOnLogin??G},disableAutomaticMigration:t?.embeddedWallets?.disableAutomaticMigration??!1,mode:e.embedded_wallet_config.mode,showWalletUIs:t?.embeddedWallets?.showWalletUIs??e.enforce_wallet_uis??!0,extendedCalldataDecoding:t?.embeddedWallets?.extendedCalldataDecoding??!1,transactionScanning:{enabled:t?.embeddedWallets?.transactionScanning?.enabled??!1,domain:t?.embeddedWallets?.transactionScanning?.domain??n??"https://auth.privy.io"}},mfa:{methods:e.mfa_methods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},passkeys:{shouldUnlinkOnUnenrollMfa:t?.passkeys?.shouldUnlinkOnUnenrollMfa,shouldUnenrollMfaOnUnlink:t?.passkeys?.shouldUnenrollMfaOnUnlink,registration:t?.passkeys?.registration},customAuth:$?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:J,passkeysForSignupEnabled:e.passkeys_for_signup_enabled},headless:!!t?.headless,render:{standalone:t?._render?.standalone??T._render.standalone},fundingConfig:K,fundingMethodConfig:{...t?.fundingMethodConfig??T.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??T.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??T.fundingMethodConfig.moonpay.useSandbox}},whatsAppEnabled:!!e.whatsapp_enabled,customOAuthRedirectUrl:t?.customOAuthRedirectUrl,allowOAuthInEmbeddedBrowsers:t?.allowOAuthInEmbeddedBrowsers??!1,solanaRpcs:{"solana:mainnet":t?.solana?.rpcs?.["solana:mainnet"]??null,"solana:devnet":t?.solana?.rpcs?.["solana:devnet"]??null,"solana:testnet":t?.solana?.rpcs?.["solana:testnet"]??null},smartWallets:X?.enabled?{enabled:X.enabled,smartWalletVersion:X.smart_wallet_version,smartWalletType:X.smart_wallet_type,configuredNetworks:X.configured_networks.map((e=>({chainId:e.chain_id,bundlerUrl:e.bundler_url,paymasterUrl:e.paymaster_url,paymasterContext:V(e.paymaster_url,e.paymaster_context)})))}:{enabled:X?.enabled??!1}}}const ne={show_wallet_login_first:!0,allowlist_config:{error_title:null,error_detail:null,cta_text:null,cta_link:null},wallet_auth:!0,email_auth:!0,sms_auth:!1,google_oauth:!1,twitter_oauth:!1,discord_oauth:!1,github_oauth:!1,linkedin_oauth:!1,apple_oauth:!1,disable_plus_emails:!1,terms_and_conditions_url:null,privacy_policy_url:null,embedded_wallet_config:{create_on_login:"off",ethereum:{create_on_login:"off"},solana:{create_on_login:"off"},require_user_owned_recovery_on_create:!1,user_owned_recovery_options:["user-passcode"],mode:"user-controlled-server-wallets-only"},captcha_site_key:"",enforce_wallet_uis:!1,legacy_wallet_ui_config:!1,id:"",name:"",passkeys_for_signup_enabled:!1,whatsapp_enabled:!1};let oe=/*#__PURE__*/o({appConfig:ae(ne,void 0,!1),isServerConfigLoaded:!1});const le=({children:o,client:l,legacyClient:r,clientConfig:i,appClientId:s})=>{let[c,d]=t(null),u=a((()=>ae(c??ne,i,!!c,"undefined"!=typeof window?window.location.origin:void 0,s)),[c,i,s]);return n((()=>{if(!c)return;let e=function(e){if(!e)return{};let{appearance:t,supportedChains:a,defaultChain:n,externalWallets:o,...l}=e;return{...l,...a?{supportedChains:a.map((e=>e.id))}:void 0,...n?{defaultChain:n.id}:void 0,...o?{walletConnect:o.walletConnect?{enabled:o.walletConnect.enabled}:void 0,coinbaseWallet:o.coinbaseWallet,solana:{connectors:o.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0}}(i),t=function(e,t=0){let a=3735928559^t,n=1103547991^t;for(let t,o=0;o<e.length;o++)a=Math.imul(a^(t=e.charCodeAt(o)),2654435761),n=Math.imul(n^t,1597334677);return a=Math.imul(a^a>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),4294967296*(2097151&(n=Math.imul(n^n>>>16,2246822507)^Math.imul(a^a>>>13,3266489909)))+(a>>>0)}(JSON.stringify(e)).toString(),a=`privy:sent:${c.id}:${t}`;localStorage.getItem(a)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(a,"t"))}),[i,c]),n((()=>{c||(async()=>{try{await l.initialize();let e=l.app.getConfig();e.custom_api_url&&r.updateApiUrl(e.custom_api_url),d(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),/*#__PURE__*/e(oe.Provider,{value:{appConfig:u,isServerConfigLoaded:!!c},children:o})},re=()=>{let{appConfig:e}=l(oe);return e},ie=()=>{let{isServerConfigLoaded:e}=l(oe);return e};export{_ as C,d as D,B as H,k as I,P as M,D as O,w as P,m as R,E as S,p as V,O as W,x as a,S as b,ie as c,C as d,A as e,F as f,M as g,R as h,b as i,v as j,y as k,u as l,le as m,L as n,W as o,I as p,g as q,h as r,H as s,f as t,re as u,U as v,j as w,q as x};