@privy-io/react-auth 3.8.1 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. package/dist/cjs/{AccountNotFoundScreen-Cu7enz9o.js → AccountNotFoundScreen-C0im9fAJ.js} +1 -1
  2. package/dist/cjs/{Address-DYZ3IQKV.js → Address-Doz93lgh.js} +1 -1
  3. package/dist/cjs/{AffirmativeConsentScreen-Cl_SWg16.js → AffirmativeConsentScreen-OgvUs4oT.js} +1 -1
  4. package/dist/cjs/{AllowlistRejectionScreen-D5b9mnX_.js → AllowlistRejectionScreen-CBfQZVO7.js} +1 -1
  5. package/dist/cjs/{AuthenticateWithWalletScreen-CfFbXvGY.js → AuthenticateWithWalletScreen-B4aHQC44.js} +1 -1
  6. package/dist/cjs/{AwaitingEvmToSolBridgingScreen-CCdsJbKx.js → AwaitingEvmToSolBridgingScreen-Cz2E1cWa.js} +1 -1
  7. package/dist/cjs/{AwaitingExternalEthereumTransferScreen-CTI3rpHf.js → AwaitingExternalEthereumTransferScreen-Ca1z7D4v.js} +1 -1
  8. package/dist/cjs/{AwaitingPasswordlessCodeScreen-ftedBDSO.js → AwaitingPasswordlessCodeScreen-DDws79F8.js} +1 -1
  9. package/dist/cjs/{AwaitingSolToEvmBridgingScreen-CaKyEgGQ.js → AwaitingSolToEvmBridgingScreen-DlTJafw4.js} +1 -1
  10. package/dist/cjs/{BridgeNetworkSelectionView-ekW1jVoZ.js → BridgeNetworkSelectionView-Cg3JjiFh.js} +1 -1
  11. package/dist/cjs/{Button-BpQ22RCK.js → Button-DpuRzAgk.js} +1 -1
  12. package/dist/cjs/{CaptchaScreen-aaD10pK6.js → CaptchaScreen-DrvkYUK-.js} +1 -1
  13. package/dist/cjs/{CoinbaseOnrampStatusScreen-DXk7YS8-.js → CoinbaseOnrampStatusScreen-Cfbivt0s.js} +1 -1
  14. package/dist/cjs/{ConnectEmailForm-uUuYB04I.js → ConnectEmailForm-DeN1Pg_E.js} +1 -1
  15. package/dist/cjs/{ConnectLedgerScreen-BsZYPosO.js → ConnectLedgerScreen-F3-JADjW.js} +1 -1
  16. package/dist/cjs/{ConnectOnlyLandingScreen-DDCcNqF9.js → ConnectOnlyLandingScreen-DQ9hxL8H.js} +1 -1
  17. package/dist/cjs/{ConnectOnlyStatusScreen-DyJB2X3z.js → ConnectOnlyStatusScreen-YPhacltK.js} +1 -1
  18. package/dist/cjs/ConnectOrCreateScreen-DmitWRwr.js +1 -0
  19. package/dist/cjs/{ConnectPhoneForm-tjeQd9v8.js → ConnectPhoneForm-CIaHyHT9.js} +1 -1
  20. package/dist/cjs/ConnectWalletView-B33uROyL.js +1 -0
  21. package/dist/cjs/{ConnectionStatusScreen-iMAYJhVc.js → ConnectionStatusScreen-Dg1LMsi6.js} +1 -1
  22. package/dist/cjs/{CrossAppAuthScreen-CsZ_rLLg.js → CrossAppAuthScreen-B6h5ejCd.js} +1 -1
  23. package/dist/cjs/{CustomLandingScreenView-B0bNrKZn.js → CustomLandingScreenView-ClPdt2GY.js} +2 -2
  24. package/dist/cjs/{DelegatedActionsConsentScreen-CyITZiB7.js → DelegatedActionsConsentScreen-CP9xV4-_.js} +1 -1
  25. package/dist/cjs/{DelegatedActionsRevokeScreen-vQnlP7qN.js → DelegatedActionsRevokeScreen-QrgQlVmp.js} +1 -1
  26. package/dist/cjs/{EmbeddedWalletConnectingScreen-D5yc0IhZ.js → EmbeddedWalletConnectingScreen-Ccb4geKv.js} +1 -1
  27. package/dist/cjs/{EmbeddedWalletCreatedScreen-BFJ6BKQ4.js → EmbeddedWalletCreatedScreen-DTRBR5WW.js} +1 -1
  28. package/dist/cjs/{EmbeddedWalletKeyExportScreen-Cz3cpL6Q.js → EmbeddedWalletKeyExportScreen-B1Ezr57N.js} +1 -1
  29. package/dist/cjs/{EmbeddedWalletOnAccountCreateScreen-L4tUdjxn.js → EmbeddedWalletOnAccountCreateScreen-0v1ZwZgX.js} +1 -1
  30. package/dist/cjs/{EmbeddedWalletPasswordUpdateScreen-n5Z982kO.js → EmbeddedWalletPasswordUpdateScreen-DJr1d2fN.js} +1 -1
  31. package/dist/cjs/{EmbeddedWalletPasswordUpdateSplashScreen-BJQXfJ5I.js → EmbeddedWalletPasswordUpdateSplashScreen-Slns6kTr.js} +1 -1
  32. package/dist/cjs/{EnrollTotp-Bo2kHSAy.js → EnrollTotp-zJR3l-q0.js} +1 -1
  33. package/dist/cjs/{ErrorScreen-BGI-4cUT.js → ErrorScreen-DAUNTckD.js} +1 -1
  34. package/dist/cjs/{FarcasterConnectStatusScreen-BKcQ6ZMu.js → FarcasterConnectStatusScreen-C3PPAnT1.js} +1 -1
  35. package/dist/cjs/{FarcasterSignerStatusScreen-BB63F9MZ.js → FarcasterSignerStatusScreen-BMd0iB8M.js} +1 -1
  36. package/dist/cjs/{FundSolWalletWithExternalSolanaWallet-DFQlLB8a.js → FundSolWalletWithExternalSolanaWallet-u8DS0vOP.js} +1 -1
  37. package/dist/cjs/{FundWalletMethodHeader-CZ9E9Pcd.js → FundWalletMethodHeader-DFV8N4os.js} +1 -1
  38. package/dist/cjs/{FundingEditAmountScreen-C8OzBV96.js → FundingEditAmountScreen-DXA8k8zQ.js} +1 -1
  39. package/dist/cjs/{FundingMethodSelectionScreen-GE2W8CGa.js → FundingMethodSelectionScreen-tlU_tfXm.js} +1 -1
  40. package/dist/cjs/{InAppBrowserLoginNotPossible-BDJuZ0-D.js → InAppBrowserLoginNotPossible-BB_zYdr4.js} +1 -1
  41. package/dist/cjs/{InstallWalletScreen-tcaVKdvZ.js → InstallWalletScreen-sNsX0qIj.js} +1 -1
  42. package/dist/cjs/{LandingScreen-BIRSSuAB.js → LandingScreen-BE8xOJTr.js} +1 -1
  43. package/dist/cjs/{LinkConflictScreen-D6812iEs.js → LinkConflictScreen-CwA2g0DP.js} +1 -1
  44. package/dist/cjs/{LinkEmailScreen-D-kZRiYu.js → LinkEmailScreen-DExuIdVG.js} +1 -1
  45. package/dist/cjs/{LinkPasskeyScreen-Dn0beRU9.js → LinkPasskeyScreen-DXLAama3.js} +1 -1
  46. package/dist/cjs/{LinkPhoneScreen-D2wD2X6_.js → LinkPhoneScreen-BGKi4PVT.js} +1 -1
  47. package/dist/cjs/{LoginFailedScreen-JL8lSBDT.js → LoginFailedScreen-BMAuqJva.js} +1 -1
  48. package/dist/cjs/{ManualTransferScreen-rVVbGuHO.js → ManualTransferScreen-Dg8uGXZw.js} +1 -1
  49. package/dist/cjs/{MfaAuthEnrollmentFlowScreen-7wF7sedZ.js → MfaAuthEnrollmentFlowScreen-BZ1svjjW.js} +1 -1
  50. package/dist/cjs/{MfaAuthVerifyFlowScreen-DXT_z8L7.js → MfaAuthVerifyFlowScreen-CJhMSZ1r.js} +1 -1
  51. package/dist/cjs/{MfaEnrollmentFlowScreen-DJWHdMZL.js → MfaEnrollmentFlowScreen-DvxX-vrH.js} +1 -1
  52. package/dist/cjs/{MfaVerifyFlowScreen-BC3Vuttf.js → MfaVerifyFlowScreen-BWPqGNNj.js} +1 -1
  53. package/dist/cjs/{ModalHeader-BmFtLkWJ.js → ModalHeader-4MV7Tgk7.js} +1 -1
  54. package/dist/cjs/{MoonpayStatusScreen-DyW9zeoT.js → MoonpayStatusScreen-Cd_71Pyq.js} +1 -1
  55. package/dist/cjs/{OAuthStatusScreen-FjNrpKlb.js → OAuthStatusScreen-ZTRfDJXT.js} +1 -1
  56. package/dist/cjs/{PasskeySelectSignupOrLogin-DyHtky_y.js → PasskeySelectSignupOrLogin-CQZM_RDH.js} +1 -1
  57. package/dist/cjs/{PasskeyStatusScreen-Q0ag_5Jx.js → PasskeyStatusScreen-BM1Mvl9i.js} +1 -1
  58. package/dist/cjs/{PasswordRecoveryScreen-D6vuUKqB.js → PasswordRecoveryScreen-CvVt6RGf.js} +1 -1
  59. package/dist/cjs/{QrCode-qgAdMqWi.js → QrCode-DvJPyneT.js} +1 -1
  60. package/dist/cjs/{RecoveryOAuthStatusScreen-D1xbanmh.js → RecoveryOAuthStatusScreen-Cg2ntkgK.js} +1 -1
  61. package/dist/cjs/{RecoveryPasswordCreateScreen-DW-I4Bjp.js → RecoveryPasswordCreateScreen-dGZOvD2x.js} +1 -1
  62. package/dist/cjs/{RecoverySelectionScreen-CSsw-SMB.js → RecoverySelectionScreen-DBAg2tyX.js} +1 -1
  63. package/dist/cjs/{Screen-BAXdSOJk.js → Screen-CJM19YNL.js} +1 -1
  64. package/dist/cjs/{ScreenLayout-95K6C4n8.js → ScreenLayout-Bbhw-EIr.js} +1 -1
  65. package/dist/cjs/{SetAutomaticRecoveryScreen-DdYvhBam.js → SetAutomaticRecoveryScreen-C65Py491.js} +1 -1
  66. package/dist/cjs/{SetWalletPasswordForm-D7TN70-K.js → SetWalletPasswordForm-Bx4bpcUs.js} +1 -1
  67. package/dist/cjs/{SignRequestScreen-B6DzD2bf.js → SignRequestScreen-Dy8xnXXp.js} +1 -1
  68. package/dist/cjs/{StandardSignAndSendTransactionScreen-Cl_1GhiF.js → StandardSignAndSendTransactionScreen-x1O5yfj4.js} +1 -1
  69. package/dist/cjs/{TelegramAuthScreen-D32WGqrh.js → TelegramAuthScreen-DaxoKw-V.js} +1 -1
  70. package/dist/cjs/{TransactionDetails-B4mP9iqk.js → TransactionDetails-DvBQbDgX.js} +1 -1
  71. package/dist/cjs/{TransactionErrorView-BPMOzuyp.js → TransactionErrorView-BdTYgWfc.js} +1 -1
  72. package/dist/cjs/{TransferFromWalletScreen-BbJ3ISYt.js → TransferFromWalletScreen-CGRGSTHN.js} +1 -1
  73. package/dist/cjs/{TransferOrBridgeLoadingScreen-DsBPxxqR.js → TransferOrBridgeLoadingScreen-C4UYLYIL.js} +1 -1
  74. package/dist/cjs/{UpdateEmailScreen-fqqg8VfP.js → UpdateEmailScreen-BtndcDiP.js} +1 -1
  75. package/dist/cjs/{UpdatePhoneScreen-BJDovBOR.js → UpdatePhoneScreen-BQb3cbdX.js} +1 -1
  76. package/dist/cjs/{UserLimitReachedScreen-CSkM5uLj.js → UserLimitReachedScreen-Ctgox4aT.js} +1 -1
  77. package/dist/cjs/{WalletButtonList-jzt0Egd8.js → WalletButtonList-C6cavPqd.js} +1 -1
  78. package/dist/cjs/{WalletInfoCard-bdaI4ebq.js → WalletInfoCard-DQtI0K25.js} +1 -1
  79. package/dist/cjs/{WalletInterstitialScreen-BzSNp3dA.js → WalletInterstitialScreen-HfTntL7I.js} +1 -1
  80. package/dist/cjs/{WalletLink-2kOfC5R5.js → WalletLink-CbnPrVEH.js} +1 -1
  81. package/dist/cjs/abstract-smart-wallets.js +1 -1
  82. package/dist/cjs/context-Dn8Hzo8O.js +1 -0
  83. package/dist/cjs/{ethers-Djy--MKt.js → ethers-BwK3McWK.js} +1 -1
  84. package/dist/cjs/extended-chains.js +1 -1
  85. package/dist/cjs/farcaster.js +1 -1
  86. package/dist/cjs/{frame-BSQIYvLs.js → frame-B14fp9oC.js} +1 -1
  87. package/dist/cjs/{get-is-unified-wallet-CAK7Zx3C.js → get-is-unified-wallet-CHHPpmxX.js} +1 -1
  88. package/dist/cjs/{getErc20Balance-BiXU_58s.js → getErc20Balance-DknCauCO.js} +1 -1
  89. package/dist/cjs/{getErc20TokenInfo-B78AxnZ3.js → getErc20TokenInfo-CBduyYx4.js} +1 -1
  90. package/dist/cjs/{getPublicClient-d-gCTRgH.js → getPublicClient-CGlodIp_.js} +1 -1
  91. package/dist/cjs/index-4-C2N_7K.js +5 -0
  92. package/dist/cjs/{index-BqAmClyL.js → index-D7QitaMz.js} +1 -1
  93. package/dist/cjs/{index-CBf8l7UH.js → index-DiPPDo6V.js} +1 -1
  94. package/dist/cjs/index.js +1 -1
  95. package/dist/cjs/internal-context-NWsAL807.js +1 -0
  96. package/dist/cjs/internal.js +1 -1
  97. package/dist/cjs/prepareFundingModalData-Bap-QRCV.js +1 -0
  98. package/dist/cjs/{reservoir-DLqCfAka.js → reservoir-CQGyEBb7.js} +1 -1
  99. package/dist/cjs/{shared-LnNw37YZ.js → shared-BjdszO5f.js} +1 -1
  100. package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-D8TmPfTs.js → shouldProceedtoEmbeddedWalletCreationFlow-CuHR6wvs.js} +1 -1
  101. package/dist/cjs/{smart-wallets-BxBo7Rwr.js → smart-wallets-Cb8qgePj.js} +1 -1
  102. package/dist/cjs/smart-wallets.js +1 -1
  103. package/dist/cjs/solana.js +1 -1
  104. package/dist/cjs/{to-ui-error-DQR0PH1r.js → to-ui-error-C_N9DMza.js} +1 -1
  105. package/dist/cjs/ui.js +1 -1
  106. package/dist/cjs/{use-create-wallet-without-fallback-DVsaEUAi.js → use-create-wallet-without-fallback-y9YpooGA.js} +1 -1
  107. package/dist/cjs/{use-export-wallet-Bp3Q263k.js → use-export-wallet-CmWKVG5J.js} +1 -1
  108. package/dist/cjs/{use-sign-with-user-signer-H6aAias8.js → use-sign-with-user-signer-BcAsQTGF.js} +1 -1
  109. package/dist/cjs/{useActiveWallet-rCbIz7HK.js → useActiveWallet-B5cSS56I.js} +1 -1
  110. package/dist/cjs/{useGetSolPrice-mb9rbK56.js → useGetSolPrice-C986iVoO.js} +1 -1
  111. package/dist/cjs/{useGetTokenPrice-BXSjabMV.js → useGetTokenPrice-CdW08dO7.js} +1 -1
  112. package/dist/cjs/{useI18n-DnOEBAdg.js → useI18n-D21RT6EH.js} +1 -1
  113. package/dist/cjs/usePrivy-DobNyfbl.js +1 -0
  114. package/dist/cjs/{useSolanaRpcClient-BSb_hq8i.js → useSolanaRpcClient-ZoxUaxNS.js} +1 -1
  115. package/dist/cjs/{useWalletBalance-9yRQYIAe.js → useWalletBalance-BVb8F3RO.js} +1 -1
  116. package/dist/cjs/{useWallets-D6t7Ii2K.js → useWallets-DPdw6ah8.js} +1 -1
  117. package/dist/cjs/{useWallets-dr024nCy.js → useWallets-Z7ZZY1fI.js} +1 -1
  118. package/dist/dts/{events-context-Bt8hY3AJ.d.ts → events-context-D8iPaW-H.d.mts} +1 -1
  119. package/dist/dts/{events-context-Bt8hY3AJ.d.mts → events-context-D8iPaW-H.d.ts} +1 -1
  120. package/dist/dts/extended-chains.d.mts +1 -1
  121. package/dist/dts/extended-chains.d.ts +1 -1
  122. package/dist/dts/farcaster.d.mts +1 -1
  123. package/dist/dts/farcaster.d.ts +1 -1
  124. package/dist/dts/index.d.mts +4 -4
  125. package/dist/dts/index.d.ts +4 -4
  126. package/dist/dts/internal.d.mts +1 -1
  127. package/dist/dts/internal.d.ts +1 -1
  128. package/dist/dts/smart-wallets.d.mts +1 -1
  129. package/dist/dts/smart-wallets.d.ts +1 -1
  130. package/dist/dts/solana.d.mts +3 -3
  131. package/dist/dts/solana.d.ts +3 -3
  132. package/dist/dts/{types-Dx2VbdX1.d.mts → types-diVZpIb-.d.mts} +10 -3
  133. package/dist/dts/{types-Dx2VbdX1.d.ts → types-diVZpIb-.d.ts} +10 -3
  134. package/dist/dts/ui.d.mts +1 -1
  135. package/dist/dts/ui.d.ts +1 -1
  136. package/dist/esm/{AccountNotFoundScreen-DQR0FatT.mjs → AccountNotFoundScreen-CvMiU7Tz.mjs} +1 -1
  137. package/dist/esm/{Address-C1iw9r70.mjs → Address-CDOE2oK9.mjs} +1 -1
  138. package/dist/esm/{AffirmativeConsentScreen-BU4I5ISJ.mjs → AffirmativeConsentScreen-Cia_UEaD.mjs} +1 -1
  139. package/dist/esm/{AllowlistRejectionScreen-WgcCN6CH.mjs → AllowlistRejectionScreen-DMqAO2Y-.mjs} +1 -1
  140. package/dist/esm/{AuthenticateWithWalletScreen-D6Zy69An.mjs → AuthenticateWithWalletScreen-DvzZViMZ.mjs} +1 -1
  141. package/dist/esm/{AwaitingEvmToSolBridgingScreen-ByIVuwRF.mjs → AwaitingEvmToSolBridgingScreen-BSG_hKyl.mjs} +1 -1
  142. package/dist/esm/{AwaitingExternalEthereumTransferScreen-Bq0rCErj.mjs → AwaitingExternalEthereumTransferScreen-BcZRmV50.mjs} +1 -1
  143. package/dist/esm/{AwaitingPasswordlessCodeScreen-itJ4854u.mjs → AwaitingPasswordlessCodeScreen-Dd7TblcM.mjs} +1 -1
  144. package/dist/esm/{AwaitingSolToEvmBridgingScreen-BSxfnQcf.mjs → AwaitingSolToEvmBridgingScreen-BD1wkQFf.mjs} +1 -1
  145. package/dist/esm/{BridgeNetworkSelectionView-DXjTVIcQ.mjs → BridgeNetworkSelectionView-DSCjcHJX.mjs} +1 -1
  146. package/dist/esm/{Button-OlK_6fKk.mjs → Button-DJY5dut3.mjs} +1 -1
  147. package/dist/esm/{CaptchaScreen-BBjPbV4B.mjs → CaptchaScreen-CapFNnoZ.mjs} +1 -1
  148. package/dist/esm/{CoinbaseOnrampStatusScreen-CZpfBNiz.mjs → CoinbaseOnrampStatusScreen-DbQEEYPn.mjs} +1 -1
  149. package/dist/esm/{ConnectEmailForm-C2TJPUYV.mjs → ConnectEmailForm-Cs3r5aBq.mjs} +1 -1
  150. package/dist/esm/{ConnectLedgerScreen-TCVn5s4x.mjs → ConnectLedgerScreen-EYZ2eRpE.mjs} +1 -1
  151. package/dist/esm/{ConnectOnlyLandingScreen-CjVJO9uh.mjs → ConnectOnlyLandingScreen-BM747X2V.mjs} +1 -1
  152. package/dist/esm/{ConnectOnlyStatusScreen-BGJ4l52n.mjs → ConnectOnlyStatusScreen-CW3W1N8z.mjs} +1 -1
  153. package/dist/esm/ConnectOrCreateScreen-BREVA7pu.mjs +1 -0
  154. package/dist/esm/{ConnectPhoneForm-kW8tUq0-.mjs → ConnectPhoneForm-Ft9zAuQd.mjs} +1 -1
  155. package/dist/esm/ConnectWalletView-DFfXN_9_.mjs +1 -0
  156. package/dist/esm/{ConnectionStatusScreen-B3NfUQx_.mjs → ConnectionStatusScreen-nzx3dVCV.mjs} +1 -1
  157. package/dist/esm/{CrossAppAuthScreen-CnvB1lhx.mjs → CrossAppAuthScreen-DAQweVCP.mjs} +1 -1
  158. package/dist/esm/CustomLandingScreenView-BkNtLof4.mjs +2 -0
  159. package/dist/esm/{DelegatedActionsConsentScreen-DeBkGN9b.mjs → DelegatedActionsConsentScreen-C35m_lng.mjs} +1 -1
  160. package/dist/esm/{DelegatedActionsRevokeScreen-CTgPXrqu.mjs → DelegatedActionsRevokeScreen-h4GhIT-2.mjs} +1 -1
  161. package/dist/esm/{EmbeddedWalletConnectingScreen-Qu9cmWzJ.mjs → EmbeddedWalletConnectingScreen-CrgNS1_v.mjs} +1 -1
  162. package/dist/esm/{EmbeddedWalletCreatedScreen-DFciR3k8.mjs → EmbeddedWalletCreatedScreen-BhSPSO8A.mjs} +1 -1
  163. package/dist/esm/{EmbeddedWalletKeyExportScreen-CEo3FI_N.mjs → EmbeddedWalletKeyExportScreen-BlAL_BUV.mjs} +1 -1
  164. package/dist/esm/{EmbeddedWalletOnAccountCreateScreen-C7cawTmQ.mjs → EmbeddedWalletOnAccountCreateScreen-Xz2dhW-I.mjs} +1 -1
  165. package/dist/esm/{EmbeddedWalletPasswordUpdateScreen-GdNNmtZR.mjs → EmbeddedWalletPasswordUpdateScreen-DQbd-pAr.mjs} +1 -1
  166. package/dist/esm/{EmbeddedWalletPasswordUpdateSplashScreen-BNOCuoES.mjs → EmbeddedWalletPasswordUpdateSplashScreen-9VnFkswr.mjs} +1 -1
  167. package/dist/esm/{EnrollTotp-CtNw20-I.mjs → EnrollTotp-twiE9SrW.mjs} +1 -1
  168. package/dist/esm/{ErrorScreen-NoHFWbKU.mjs → ErrorScreen-CTI5XNc0.mjs} +1 -1
  169. package/dist/esm/FarcasterConnectStatusScreen-26MCKeUz.mjs +1 -0
  170. package/dist/esm/{FarcasterSignerStatusScreen-MQ2QrijY.mjs → FarcasterSignerStatusScreen-YwCO1kz9.mjs} +1 -1
  171. package/dist/esm/{FundSolWalletWithExternalSolanaWallet-DVaHCgDh.mjs → FundSolWalletWithExternalSolanaWallet-B3w3-z6B.mjs} +1 -1
  172. package/dist/esm/{FundWalletMethodHeader-RY6-H-Ry.mjs → FundWalletMethodHeader-CN-93vVj.mjs} +1 -1
  173. package/dist/esm/FundingEditAmountScreen-Cz6ZAJlk.mjs +1 -0
  174. package/dist/esm/{FundingMethodSelectionScreen-yZenKs6o.mjs → FundingMethodSelectionScreen-B85fzSsC.mjs} +1 -1
  175. package/dist/esm/{InAppBrowserLoginNotPossible-CTnPeOBa.mjs → InAppBrowserLoginNotPossible-CPsaFweG.mjs} +1 -1
  176. package/dist/esm/{InstallWalletScreen-CBxWJiQf.mjs → InstallWalletScreen-D5mGXNHF.mjs} +1 -1
  177. package/dist/esm/LandingScreen-BqSnrgDb.mjs +1 -0
  178. package/dist/esm/{LinkConflictScreen-BnoDRUE0.mjs → LinkConflictScreen-D8y5of24.mjs} +1 -1
  179. package/dist/esm/{LinkEmailScreen-x_TPODcx.mjs → LinkEmailScreen-C9lKAk-L.mjs} +1 -1
  180. package/dist/esm/{LinkPasskeyScreen-D9IfHaec.mjs → LinkPasskeyScreen-C33kWVrX.mjs} +1 -1
  181. package/dist/esm/{LinkPhoneScreen-DaK-7otl.mjs → LinkPhoneScreen-Bi98Ngac.mjs} +1 -1
  182. package/dist/esm/{LoginFailedScreen-CoukYLVP.mjs → LoginFailedScreen-BX7s2pm7.mjs} +1 -1
  183. package/dist/esm/{ManualTransferScreen-DdumQnbt.mjs → ManualTransferScreen-BBMujAte.mjs} +1 -1
  184. package/dist/esm/{MfaAuthEnrollmentFlowScreen-BsRpCR72.mjs → MfaAuthEnrollmentFlowScreen-BBOfIRfA.mjs} +1 -1
  185. package/dist/esm/{MfaAuthVerifyFlowScreen-Cr92F0yT.mjs → MfaAuthVerifyFlowScreen-CwZbfXVc.mjs} +1 -1
  186. package/dist/esm/{MfaEnrollmentFlowScreen-CXyaDU1D.mjs → MfaEnrollmentFlowScreen-Dq5X_CVZ.mjs} +1 -1
  187. package/dist/esm/{MfaVerifyFlowScreen-ghKHn2BT.mjs → MfaVerifyFlowScreen-DGylIeVO.mjs} +1 -1
  188. package/dist/esm/{ModalHeader-CxHK1IKF.mjs → ModalHeader-DHXUvTf4.mjs} +1 -1
  189. package/dist/esm/{MoonpayStatusScreen-DhMZLroP.mjs → MoonpayStatusScreen-Boj9S0LW.mjs} +1 -1
  190. package/dist/esm/{OAuthStatusScreen-BFVDc4G4.mjs → OAuthStatusScreen-DLvm8CkQ.mjs} +1 -1
  191. package/dist/esm/{PasskeySelectSignupOrLogin-Dvxli58H.mjs → PasskeySelectSignupOrLogin-62N4Cj_4.mjs} +1 -1
  192. package/dist/esm/{PasskeyStatusScreen-c9nu4s_d.mjs → PasskeyStatusScreen-DE8Ez-Rl.mjs} +1 -1
  193. package/dist/esm/{PasswordRecoveryScreen-CsdO4G6h.mjs → PasswordRecoveryScreen-CxXsaYPM.mjs} +1 -1
  194. package/dist/esm/{QrCode-BI2LxLLg.mjs → QrCode-CbRLsYtm.mjs} +1 -1
  195. package/dist/esm/{RecoveryOAuthStatusScreen-Dp7fnj5t.mjs → RecoveryOAuthStatusScreen-9ETDOsJ0.mjs} +1 -1
  196. package/dist/esm/{RecoveryPasswordCreateScreen-DdzD09T3.mjs → RecoveryPasswordCreateScreen-CZizgkaK.mjs} +1 -1
  197. package/dist/esm/{RecoverySelectionScreen-D2nDGt4R.mjs → RecoverySelectionScreen-CDzuMgIx.mjs} +1 -1
  198. package/dist/esm/{Screen-Dzz_AFFs.mjs → Screen-CKaxnxac.mjs} +1 -1
  199. package/dist/esm/{ScreenLayout-pthdsODa.mjs → ScreenLayout-BQ6FV6yc.mjs} +1 -1
  200. package/dist/esm/{SetAutomaticRecoveryScreen-g1kDOe61.mjs → SetAutomaticRecoveryScreen-D5x6hDUL.mjs} +1 -1
  201. package/dist/esm/{SetWalletPasswordForm-DUTEhc4R.mjs → SetWalletPasswordForm-DelBzpVM.mjs} +1 -1
  202. package/dist/esm/{SignRequestScreen-DjLHkDxK.mjs → SignRequestScreen-BA5JF3Hr.mjs} +1 -1
  203. package/dist/esm/{StandardSignAndSendTransactionScreen-CFqthHKF.mjs → StandardSignAndSendTransactionScreen-CiJd6Wf9.mjs} +1 -1
  204. package/dist/esm/{TelegramAuthScreen-B5uYbdxP.mjs → TelegramAuthScreen-zZOkgtJy.mjs} +1 -1
  205. package/dist/esm/{TransactionDetails-DITlhQNk.mjs → TransactionDetails-B2vXU-k4.mjs} +1 -1
  206. package/dist/esm/{TransactionErrorView-DmFbjQHi.mjs → TransactionErrorView-DOcJFQEX.mjs} +1 -1
  207. package/dist/esm/{TransferFromWalletScreen-Dvp-YNqS.mjs → TransferFromWalletScreen-C5QQN9h6.mjs} +1 -1
  208. package/dist/esm/{TransferOrBridgeLoadingScreen-CFRKffkj.mjs → TransferOrBridgeLoadingScreen-B-uvt7Fj.mjs} +1 -1
  209. package/dist/esm/{UpdateEmailScreen-DoDVvVCw.mjs → UpdateEmailScreen-B1-pVdEN.mjs} +1 -1
  210. package/dist/esm/{UpdatePhoneScreen-BoEnTnCl.mjs → UpdatePhoneScreen-CwYS0KNr.mjs} +1 -1
  211. package/dist/esm/{UserLimitReachedScreen-68Vv3bFU.mjs → UserLimitReachedScreen-C9lTsh_J.mjs} +1 -1
  212. package/dist/esm/{WalletButtonList-C1OqZHCA.mjs → WalletButtonList-DZp-38Ac.mjs} +1 -1
  213. package/dist/esm/{WalletInfoCard-DmIqX_B8.mjs → WalletInfoCard-C8BrD5jy.mjs} +1 -1
  214. package/dist/esm/{WalletInterstitialScreen-Du_L0CK7.mjs → WalletInterstitialScreen-d520uEnZ.mjs} +1 -1
  215. package/dist/esm/{WalletLink-D2x4SkPO.mjs → WalletLink-WAY9-CI0.mjs} +1 -1
  216. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  217. package/dist/esm/context-Dee1TPOi.mjs +1 -0
  218. package/dist/esm/{ethers-oRuqwv5W.mjs → ethers-g3QzXj2h.mjs} +1 -1
  219. package/dist/esm/extended-chains.mjs +1 -1
  220. package/dist/esm/farcaster.mjs +1 -1
  221. package/dist/esm/{frame-BMn1PaPp.mjs → frame-CwE9r3cT.mjs} +1 -1
  222. package/dist/esm/{get-is-unified-wallet-DXko-EzF.mjs → get-is-unified-wallet-_KIJnP68.mjs} +1 -1
  223. package/dist/esm/{getErc20Balance-Cl5jZN3g.mjs → getErc20Balance-CaKjNAs9.mjs} +1 -1
  224. package/dist/esm/{getErc20TokenInfo-wBcf5dYY.mjs → getErc20TokenInfo-BFoeg5F6.mjs} +1 -1
  225. package/dist/esm/{getPublicClient-C_l_ocJu.mjs → getPublicClient-A9RSftUZ.mjs} +1 -1
  226. package/dist/esm/{index-Ce4cEnEO.mjs → index-BGEWwttv.mjs} +1 -1
  227. package/dist/esm/{index-BctMJtH0.mjs → index-CiEOopPN.mjs} +1 -1
  228. package/dist/esm/index-Dr4t3oWO.mjs +5 -0
  229. package/dist/esm/index.mjs +1 -1
  230. package/dist/esm/{internal-context-DLZicboG.mjs → internal-context-e-Eni5bG.mjs} +1 -1
  231. package/dist/esm/internal.mjs +1 -1
  232. package/dist/esm/prepareFundingModalData-BYy0MVol.mjs +1 -0
  233. package/dist/esm/{reservoir-DRNnyqld.mjs → reservoir-kvLjIrEo.mjs} +1 -1
  234. package/dist/esm/{shared-BMOp6N9y.mjs → shared-CRNjAkzC.mjs} +1 -1
  235. package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-DVwf2mAj.mjs → shouldProceedtoEmbeddedWalletCreationFlow-iMnL58wW.mjs} +1 -1
  236. package/dist/esm/{smart-wallets-B3-1-dnO.mjs → smart-wallets-BMn13jfV.mjs} +1 -1
  237. package/dist/esm/smart-wallets.mjs +1 -1
  238. package/dist/esm/solana.mjs +1 -1
  239. package/dist/esm/{to-ui-error-B8DSJO-0.mjs → to-ui-error-CnxcoZ1S.mjs} +1 -1
  240. package/dist/esm/ui.mjs +1 -1
  241. package/dist/esm/{use-create-wallet-without-fallback-COqi_EHH.mjs → use-create-wallet-without-fallback-5er4aqoE.mjs} +1 -1
  242. package/dist/esm/{use-export-wallet-CRKJ4-yx.mjs → use-export-wallet-WZT8QqOJ.mjs} +1 -1
  243. package/dist/esm/{use-sign-with-user-signer-J1po7l19.mjs → use-sign-with-user-signer-eEm9Olt_.mjs} +1 -1
  244. package/dist/esm/{useActiveWallet-Bj-s666H.mjs → useActiveWallet-SiVSXkvG.mjs} +1 -1
  245. package/dist/esm/{useGetSolPrice-fF6UX0Cj.mjs → useGetSolPrice-Cfm8o9C5.mjs} +1 -1
  246. package/dist/esm/{useGetTokenPrice-CnQZmfvQ.mjs → useGetTokenPrice-CfQvz_Mo.mjs} +1 -1
  247. package/dist/esm/{useI18n-DIAzggWr.mjs → useI18n-O3hskpuB.mjs} +1 -1
  248. package/dist/esm/usePrivy-Bh4N2Hpm.mjs +1 -0
  249. package/dist/esm/{useSolanaRpcClient-Be5Dd6m5.mjs → useSolanaRpcClient-DaxiCEwc.mjs} +1 -1
  250. package/dist/esm/{useWalletBalance-BuMx9pCk.mjs → useWalletBalance-CkNw6kj0.mjs} +1 -1
  251. package/dist/esm/{useWallets-Cc1ILfGS.mjs → useWallets-DCp1uab-.mjs} +1 -1
  252. package/dist/esm/{useWallets-DuxHKVvE.mjs → useWallets-gElyEQoU.mjs} +1 -1
  253. package/package.json +6 -6
  254. package/dist/cjs/ConnectOrCreateScreen-Dfoq-0pD.js +0 -1
  255. package/dist/cjs/ConnectWalletView-CxfQTEJ2.js +0 -1
  256. package/dist/cjs/context-CToLw7Dr.js +0 -1
  257. package/dist/cjs/index-DKxtLOTJ.js +0 -5
  258. package/dist/cjs/internal-context-D80qA_jS.js +0 -1
  259. package/dist/cjs/prepareFundingModalData-BhY38T4k.js +0 -1
  260. package/dist/cjs/usePrivy-fmKLKsT3.js +0 -1
  261. package/dist/esm/ConnectOrCreateScreen-CZDi1Oaj.mjs +0 -1
  262. package/dist/esm/ConnectWalletView-tpdAD3K7.mjs +0 -1
  263. package/dist/esm/CustomLandingScreenView-DZTOg8z4.mjs +0 -2
  264. package/dist/esm/FarcasterConnectStatusScreen-CiN00CmD.mjs +0 -1
  265. package/dist/esm/FundingEditAmountScreen-DiZ2-4XS.mjs +0 -1
  266. package/dist/esm/LandingScreen-CzhCoUSE.mjs +0 -1
  267. package/dist/esm/context-B4VZqX5H.mjs +0 -1
  268. package/dist/esm/index-CCrVHfyv.mjs +0 -5
  269. package/dist/esm/prepareFundingModalData-CndHQFiM.mjs +0 -1
  270. package/dist/esm/usePrivy-BSIhOAz8.mjs +0 -1
@@ -1,4 +1,4 @@
1
- import{jsx as e,jsxs as r}from"react/jsx-runtime";import i from"react";import{styled as o}from"styled-components";import{a4 as n}from"./useActiveWallet-Bj-s666H.mjs";import{M as a,B as t}from"./ModalHeader-CxHK1IKF.mjs";import{N as c}from"./index-CJMgUOnw.mjs";const l=/*#__PURE__*/o.div.withConfig({displayName:"ScreenRoot",componentId:"sc-2e815abe-0"})(["--screen-space:16px;--screen-space-lg:calc(var(--screen-space) * 1.5);position:relative;overflow:hidden;margin:0 calc(-1 * var(--screen-space));height:100%;border-radius:var(--privy-border-radius-lg);"]),d=/*#__PURE__*/o.div.withConfig({displayName:"ScreenRootInner",componentId:"sc-2e815abe-1"})(["display:flex;flex-direction:column;gap:calc(var(--screen-space) * 1.5);width:100%;background:var(--privy-color-background);padding:0 var(--screen-space-lg) var(--screen-space);height:100%;border-radius:var(--privy-border-radius-lg);"]),s=/*#__PURE__*/o.div.withConfig({displayName:"HeaderContainer",componentId:"sc-2e815abe-2"})(["position:relative;display:flex;flex-direction:column;"]),p=/*#__PURE__*/o(a).withConfig({displayName:"StyledModalHeader",componentId:"sc-2e815abe-3"})(["margin:0 -8px;"]),g=/*#__PURE__*/o.div.withConfig({displayName:"BodyContainer",componentId:"sc-2e815abe-4"})(["flex:1 1 auto;display:flex;flex-direction:column;overflow-y:auto;padding:3px;margin:-3px;&::-webkit-scrollbar{display:none;}scrollbar-gutter:stable both-edges;scrollbar-width:none;-ms-overflow-style:none;"," background-repeat:no-repeat;background-size:100% 32px,100% 16px;background-attachment:local,scroll;"],(({$colorScheme:e})=>"light"===e?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;":"dark"===e?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;":void 0)),h=/*#__PURE__*/o.div.withConfig({displayName:"FooterContainer",componentId:"sc-2e815abe-5"})(["display:flex;flex-direction:column;gap:var(--screen-space-lg);"]);let m=/*#__PURE__*/o.div.withConfig({displayName:"CenteredHeader",componentId:"sc-2e815abe-6"})(["text-align:center;display:flex;flex-direction:column;align-items:center;gap:var(--screen-space);"]),v=/*#__PURE__*/o.div.withConfig({displayName:"TitleContainer",componentId:"sc-2e815abe-7"})(["display:flex;flex-direction:column;gap:4px;"]),u=/*#__PURE__*/o.h3.withConfig({displayName:"HeaderTitle",componentId:"sc-2e815abe-8"})(["&&{font-size:20px;line-height:32px;font-weight:500;color:var(--privy-color-foreground);margin:0;}"]),f=/*#__PURE__*/o.p.withConfig({displayName:"HeaderSubtitle",componentId:"sc-2e815abe-9"})(["&&{margin:0;font-size:16px;font-weight:300;line-height:24px;color:var(--privy-color-foreground);}"]),y=/*#__PURE__*/o.div.withConfig({displayName:"IconContainer",componentId:"sc-2e815abe-10"})(["background:",";border-radius:50%;width:64px;height:64px;display:flex;align-items:center;justify-content:center;"],(({$variant:e})=>{switch(e){case"success":return"var(--privy-color-success-bg, #EAFCEF)";case"warning":return"var(--privy-color-warn, #FEF3C7)";case"error":return"var(--privy-color-error-bg, #FEE2E2)";case"loading":case"logo":return"transparent";default:return"var(--privy-color-background-2)"}})),b=/*#__PURE__*/o.div.withConfig({displayName:"LogoContainer",componentId:"sc-2e815abe-11"})(["display:flex;align-items:center;justify-content:center;margin-bottom:var(--screen-space);img,svg{max-height:90px;max-width:180px;}"]),x=/*#__PURE__*/o.div.withConfig({displayName:"LoadingWithIconContainer",componentId:"sc-2e815abe-12"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > :first-child{position:relative;}> div > :last-child{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);}"]);const w=({children:r,...i})=>/*#__PURE__*/e(l,{children:/*#__PURE__*/e(d,{...i,children:r})});let C=/*#__PURE__*/o.div.withConfig({displayName:"ProgressBarContainer",componentId:"sc-2e815abe-13"})(["position:absolute;top:0;left:calc(-1 * var(--screen-space-lg));width:calc(100% + calc(var(--screen-space-lg) * 2));height:4px;background:var(--privy-color-background-2);border-top-left-radius:inherit;border-top-right-radius:inherit;overflow:hidden;"]),k=/*#__PURE__*/o(t).withConfig({displayName:"StyledBlobbyFooter",componentId:"sc-2e815abe-14"})(["padding:0;&& a{padding:0;color:var(--privy-color-foreground-3);}"]),I=/*#__PURE__*/o.div.withConfig({displayName:"ProgressBarFill",componentId:"sc-2e815abe-15"})(["height:100%;width:","%;background:var(--privy-color-foreground-3);border-radius:2px;transition:width 300ms ease-in-out;"],(({pct:e})=>e)),N=({step:r})=>r?/*#__PURE__*/e(C,{children:/*#__PURE__*/e(I,{pct:Math.min(100,r.current/r.total*100)})}):null;w.Header=({title:i,subtitle:o,icon:n,iconVariant:a,iconLoadingStatus:t,showBack:c,onBack:l,showInfo:d,onInfo:g,showClose:h,onClose:y,step:b,...x})=>/*#__PURE__*/r(s,{...x,children:[/*#__PURE__*/e(p,{backFn:c?l:void 0,infoFn:d?g:void 0,onClose:h?y:void 0,closeable:h}),(n||a||i||o)&&/*#__PURE__*/r(m,{children:[n||a?/*#__PURE__*/e(w.Icon,{icon:n,variant:a,loadingStatus:t}):null,/*#__PURE__*/r(v,{children:[i&&/*#__PURE__*/e(u,{children:i}),o&&/*#__PURE__*/e(f,{children:o})]})]}),b&&/*#__PURE__*/e(N,{step:b})]}),(w.Body=/*#__PURE__*/i.forwardRef((({children:r,...i},o)=>/*#__PURE__*/e(g,{ref:o,...i,children:r})))).displayName="Screen.Body",w.Footer=({children:r,...i})=>/*#__PURE__*/e(h,{id:"privy-content-footer-container",...i,children:r}),w.Actions=({children:r,...i})=>/*#__PURE__*/e(E,{...i,children:r}),w.HelpText=({children:r,...i})=>/*#__PURE__*/e(S,{...i,children:r}),w.Watermark=()=>/*#__PURE__*/e(k,{}),w.Icon=({icon:o,variant:a="subtle",loadingStatus:t})=>"logo"===a&&o?/*#__PURE__*/e(b,"string"==typeof o?{children:/*#__PURE__*/e("img",{src:o,alt:""})}:/*#__PURE__*/i.isValidElement(o)?{children:o}:{children:/*#__PURE__*/i.createElement(o)}):"loading"===a?o?
1
+ import{jsx as e,jsxs as r}from"react/jsx-runtime";import i from"react";import{styled as o}from"styled-components";import{a4 as n}from"./useActiveWallet-SiVSXkvG.mjs";import{M as a,B as t}from"./ModalHeader-DHXUvTf4.mjs";import{N as c}from"./index-CJMgUOnw.mjs";const l=/*#__PURE__*/o.div.withConfig({displayName:"ScreenRoot",componentId:"sc-2e815abe-0"})(["--screen-space:16px;--screen-space-lg:calc(var(--screen-space) * 1.5);position:relative;overflow:hidden;margin:0 calc(-1 * var(--screen-space));height:100%;border-radius:var(--privy-border-radius-lg);"]),d=/*#__PURE__*/o.div.withConfig({displayName:"ScreenRootInner",componentId:"sc-2e815abe-1"})(["display:flex;flex-direction:column;gap:calc(var(--screen-space) * 1.5);width:100%;background:var(--privy-color-background);padding:0 var(--screen-space-lg) var(--screen-space);height:100%;border-radius:var(--privy-border-radius-lg);"]),s=/*#__PURE__*/o.div.withConfig({displayName:"HeaderContainer",componentId:"sc-2e815abe-2"})(["position:relative;display:flex;flex-direction:column;"]),p=/*#__PURE__*/o(a).withConfig({displayName:"StyledModalHeader",componentId:"sc-2e815abe-3"})(["margin:0 -8px;"]),g=/*#__PURE__*/o.div.withConfig({displayName:"BodyContainer",componentId:"sc-2e815abe-4"})(["flex:1 1 auto;display:flex;flex-direction:column;overflow-y:auto;padding:3px;margin:-3px;&::-webkit-scrollbar{display:none;}scrollbar-gutter:stable both-edges;scrollbar-width:none;-ms-overflow-style:none;"," background-repeat:no-repeat;background-size:100% 32px,100% 16px;background-attachment:local,scroll;"],(({$colorScheme:e})=>"light"===e?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;":"dark"===e?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;":void 0)),h=/*#__PURE__*/o.div.withConfig({displayName:"FooterContainer",componentId:"sc-2e815abe-5"})(["display:flex;flex-direction:column;gap:var(--screen-space-lg);"]);let m=/*#__PURE__*/o.div.withConfig({displayName:"CenteredHeader",componentId:"sc-2e815abe-6"})(["text-align:center;display:flex;flex-direction:column;align-items:center;gap:var(--screen-space);"]),v=/*#__PURE__*/o.div.withConfig({displayName:"TitleContainer",componentId:"sc-2e815abe-7"})(["display:flex;flex-direction:column;gap:4px;"]),u=/*#__PURE__*/o.h3.withConfig({displayName:"HeaderTitle",componentId:"sc-2e815abe-8"})(["&&{font-size:20px;line-height:32px;font-weight:500;color:var(--privy-color-foreground);margin:0;}"]),f=/*#__PURE__*/o.p.withConfig({displayName:"HeaderSubtitle",componentId:"sc-2e815abe-9"})(["&&{margin:0;font-size:16px;font-weight:300;line-height:24px;color:var(--privy-color-foreground);}"]),y=/*#__PURE__*/o.div.withConfig({displayName:"IconContainer",componentId:"sc-2e815abe-10"})(["background:",";border-radius:50%;width:64px;height:64px;display:flex;align-items:center;justify-content:center;"],(({$variant:e})=>{switch(e){case"success":return"var(--privy-color-success-bg, #EAFCEF)";case"warning":return"var(--privy-color-warn, #FEF3C7)";case"error":return"var(--privy-color-error-bg, #FEE2E2)";case"loading":case"logo":return"transparent";default:return"var(--privy-color-background-2)"}})),b=/*#__PURE__*/o.div.withConfig({displayName:"LogoContainer",componentId:"sc-2e815abe-11"})(["display:flex;align-items:center;justify-content:center;margin-bottom:var(--screen-space);img,svg{max-height:90px;max-width:180px;}"]),x=/*#__PURE__*/o.div.withConfig({displayName:"LoadingWithIconContainer",componentId:"sc-2e815abe-12"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > :first-child{position:relative;}> div > :last-child{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);}"]);const w=({children:r,...i})=>/*#__PURE__*/e(l,{children:/*#__PURE__*/e(d,{...i,children:r})});let C=/*#__PURE__*/o.div.withConfig({displayName:"ProgressBarContainer",componentId:"sc-2e815abe-13"})(["position:absolute;top:0;left:calc(-1 * var(--screen-space-lg));width:calc(100% + calc(var(--screen-space-lg) * 2));height:4px;background:var(--privy-color-background-2);border-top-left-radius:inherit;border-top-right-radius:inherit;overflow:hidden;"]),k=/*#__PURE__*/o(t).withConfig({displayName:"StyledBlobbyFooter",componentId:"sc-2e815abe-14"})(["padding:0;&& a{padding:0;color:var(--privy-color-foreground-3);}"]),I=/*#__PURE__*/o.div.withConfig({displayName:"ProgressBarFill",componentId:"sc-2e815abe-15"})(["height:100%;width:","%;background:var(--privy-color-foreground-3);border-radius:2px;transition:width 300ms ease-in-out;"],(({pct:e})=>e)),N=({step:r})=>r?/*#__PURE__*/e(C,{children:/*#__PURE__*/e(I,{pct:Math.min(100,r.current/r.total*100)})}):null;w.Header=({title:i,subtitle:o,icon:n,iconVariant:a,iconLoadingStatus:t,showBack:c,onBack:l,showInfo:d,onInfo:g,showClose:h,onClose:y,step:b,...x})=>/*#__PURE__*/r(s,{...x,children:[/*#__PURE__*/e(p,{backFn:c?l:void 0,infoFn:d?g:void 0,onClose:h?y:void 0,closeable:h}),(n||a||i||o)&&/*#__PURE__*/r(m,{children:[n||a?/*#__PURE__*/e(w.Icon,{icon:n,variant:a,loadingStatus:t}):null,/*#__PURE__*/r(v,{children:[i&&/*#__PURE__*/e(u,{children:i}),o&&/*#__PURE__*/e(f,{children:o})]})]}),b&&/*#__PURE__*/e(N,{step:b})]}),(w.Body=/*#__PURE__*/i.forwardRef((({children:r,...i},o)=>/*#__PURE__*/e(g,{ref:o,...i,children:r})))).displayName="Screen.Body",w.Footer=({children:r,...i})=>/*#__PURE__*/e(h,{id:"privy-content-footer-container",...i,children:r}),w.Actions=({children:r,...i})=>/*#__PURE__*/e(E,{...i,children:r}),w.HelpText=({children:r,...i})=>/*#__PURE__*/e(S,{...i,children:r}),w.Watermark=()=>/*#__PURE__*/e(k,{}),w.Icon=({icon:o,variant:a="subtle",loadingStatus:t})=>"logo"===a&&o?/*#__PURE__*/e(b,"string"==typeof o?{children:/*#__PURE__*/e("img",{src:o,alt:""})}:/*#__PURE__*/i.isValidElement(o)?{children:o}:{children:/*#__PURE__*/i.createElement(o)}):"loading"===a?o?
2
2
  /*#__PURE__*/e(x,{children:/*#__PURE__*/r("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[/*#__PURE__*/e(n,{success:t?.success,fail:t?.fail}),"string"==typeof o?
3
3
  /*#__PURE__*/e("span",{style:{background:`url('${o}') 0 0 / contain`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"contain"}}):/*#__PURE__*/i.isValidElement(o)?
4
4
  /*#__PURE__*/i.cloneElement(o,{style:{width:"38px",height:"38px"}}):
@@ -1 +1 @@
1
- import{jsxs as r,Fragment as e,jsx as l}from"react/jsx-runtime";import{B as t}from"./Button-OlK_6fKk.mjs";import{S as a}from"./Screen-Dzz_AFFs.mjs";const n=({primaryCta:n,secondaryCta:i,helpText:s,watermark:c=!0,children:d,...m})=>{let o=n||i?/*#__PURE__*/r(e,{children:[n&&(()=>{let{label:r,...e}=n,a=e.variant||"primary";/*#__PURE__*/return l(t,{...e,variant:a,style:{width:"100%",...e.style},children:r})})(),i&&(()=>{let{label:r,...e}=i,a=e.variant||"secondary";/*#__PURE__*/return l(t,{...e,variant:a,style:{width:"100%",...e.style},children:r})})()]}):null;/*#__PURE__*/return r(a,{id:m.id,className:m.className,children:[/*#__PURE__*/l(a.Header,{...m}),d?/*#__PURE__*/l(a.Body,{children:d}):null,s||o||c?/*#__PURE__*/r(a.Footer,{children:[s?/*#__PURE__*/l(a.HelpText,{children:s}):null,o?/*#__PURE__*/l(a.Actions,{children:o}):null,c?/*#__PURE__*/l(a.Watermark,{}):null]}):null]})};export{n as S};
1
+ import{jsxs as r,Fragment as e,jsx as l}from"react/jsx-runtime";import{B as t}from"./Button-DJY5dut3.mjs";import{S as a}from"./Screen-CKaxnxac.mjs";const n=({primaryCta:n,secondaryCta:i,helpText:s,watermark:c=!0,children:d,...m})=>{let o=n||i?/*#__PURE__*/r(e,{children:[n&&(()=>{let{label:r,...e}=n,a=e.variant||"primary";/*#__PURE__*/return l(t,{...e,variant:a,style:{width:"100%",...e.style},children:r})})(),i&&(()=>{let{label:r,...e}=i,a=e.variant||"secondary";/*#__PURE__*/return l(t,{...e,variant:a,style:{width:"100%",...e.style},children:r})})()]}):null;/*#__PURE__*/return r(a,{id:m.id,className:m.className,children:[/*#__PURE__*/l(a.Header,{...m}),d?/*#__PURE__*/l(a.Body,{children:d}):null,s||o||c?/*#__PURE__*/r(a.Footer,{children:[s?/*#__PURE__*/l(a.HelpText,{children:s}):null,o?/*#__PURE__*/l(a.Actions,{children:o}):null,c?/*#__PURE__*/l(a.Watermark,{}):null]}):null]})};export{n as S};
@@ -1 +1 @@
1
- import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/ExclamationTriangleIcon";import i from"@heroicons/react/24/outline/LockClosedIcon";import{useState as n}from"react";import{u as l,a,h as s}from"./get-is-unified-wallet-DXko-EzF.mjs";import{a as c}from"./Button-OlK_6fKk.mjs";import{M as m,B as d}from"./ModalHeader-CxHK1IKF.mjs";import{styled as p}from"styled-components";import{S as u}from"./Subtitle-DkvfP2Ev.mjs";import{T as y}from"./Title-D0pfZff-.mjs";import{q as h}from"./context-B4VZqX5H.mjs";import{u as f}from"./internal-context-DLZicboG.mjs";import{Y as v}from"./useActiveWallet-Bj-s666H.mjs";import"viem";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"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";const g=/*#__PURE__*/p.div.withConfig({displayName:"WithCircleBorder",componentId:"sc-e4fc5563-0"})(["&&{border-width:4px;}display:flex;justify-content:center;align-items:center;padding:1rem;aspect-ratio:1;border-style:solid;border-color:",";border-radius:50%;"],(e=>e.$color??"var(--privy-color-accent)")),w={component:()=>{let{user:p}=l(),{client:w,walletProxy:j,refreshSessionAndUser:I,closePrivyModal:b}=f(),x=a(),{entropyId:C,entropyIdVerifier:T}=x.data?.recoverWallet,[k,M]=n(!1),[S,W]=n(null),[A,P]=n(null);function U(){if(!k){if(A)return x.data?.setWalletPassword?.onFailure(A),void b();if(!S)return x.data?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),void b()}}x.onUserCloseViaDialogOrKeybindRef.current=U;let E=!(!k&&!S);/*#__PURE__*/return e(r,A?{children:[/*#__PURE__*/o(m,{onClose:U},"header"),/*#__PURE__*/o(g,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:/*#__PURE__*/o(t,{height:38,width:38,stroke:"var(--privy-color-error)"})}),/*#__PURE__*/o(y,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),/*#__PURE__*/o(v,{style:{minHeight:"2rem"}}),/*#__PURE__*/o(c,{onClick:()=>P(null),children:"Try again"}),/*#__PURE__*/o(d,{})]}:{children:[/*#__PURE__*/o(m,{onClose:U},"header"),/*#__PURE__*/o(i,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),/*#__PURE__*/o(y,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),/*#__PURE__*/o(u,{style:{marginTop:"1rem"},children:"When you log into a new device, you’ll only need to authenticate to access your account. Never get logged out if you forget your password."}),/*#__PURE__*/o(v,{style:{minHeight:"2rem"}}),/*#__PURE__*/o(c,{loading:k,disabled:E,onClick:()=>async function(){M(!0);try{let e=await w.getAccessToken(),r=s(p,C);if(!e||!j||!r)return;if(!(await j.setRecovery({accessToken:e,entropyId:C,entropyIdVerifier:T,existingRecoveryMethod:r.recoveryMethod,recoveryMethod:"privy"})).entropyId)throw Error("Unable to set recovery on wallet");let o=await I();if(!o)throw Error("Unable to set recovery on wallet");let t=s(o,r.address);if(!t)throw Error("Unabled to set recovery on wallet");W(!!o),setTimeout((()=>{x.data?.setWalletPassword?.onSuccess(t),b()}),h)}catch(e){P(e)}finally{M(!1)}}(),children:S?"Success":"Confirm"}),/*#__PURE__*/o(d,{})]})}};export{w as SetAutomaticRecoveryScreen,w as default};
1
+ import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/ExclamationTriangleIcon";import i from"@heroicons/react/24/outline/LockClosedIcon";import{useState as n}from"react";import{u as l,a,h as s}from"./get-is-unified-wallet-_KIJnP68.mjs";import{a as c}from"./Button-DJY5dut3.mjs";import{M as m,B as d}from"./ModalHeader-DHXUvTf4.mjs";import{styled as p}from"styled-components";import{S as u}from"./Subtitle-DkvfP2Ev.mjs";import{T as y}from"./Title-D0pfZff-.mjs";import{q as h}from"./context-Dee1TPOi.mjs";import{u as f}from"./internal-context-e-Eni5bG.mjs";import{Y as v}from"./useActiveWallet-SiVSXkvG.mjs";import"viem";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"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BYy0MVol.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-gElyEQoU.mjs";const g=/*#__PURE__*/p.div.withConfig({displayName:"WithCircleBorder",componentId:"sc-e4fc5563-0"})(["&&{border-width:4px;}display:flex;justify-content:center;align-items:center;padding:1rem;aspect-ratio:1;border-style:solid;border-color:",";border-radius:50%;"],(e=>e.$color??"var(--privy-color-accent)")),w={component:()=>{let{user:p}=l(),{client:w,walletProxy:j,refreshSessionAndUser:I,closePrivyModal:b}=f(),x=a(),{entropyId:C,entropyIdVerifier:T}=x.data?.recoverWallet,[k,M]=n(!1),[S,W]=n(null),[A,P]=n(null);function U(){if(!k){if(A)return x.data?.setWalletPassword?.onFailure(A),void b();if(!S)return x.data?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),void b()}}x.onUserCloseViaDialogOrKeybindRef.current=U;let E=!(!k&&!S);/*#__PURE__*/return e(r,A?{children:[/*#__PURE__*/o(m,{onClose:U},"header"),/*#__PURE__*/o(g,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:/*#__PURE__*/o(t,{height:38,width:38,stroke:"var(--privy-color-error)"})}),/*#__PURE__*/o(y,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),/*#__PURE__*/o(v,{style:{minHeight:"2rem"}}),/*#__PURE__*/o(c,{onClick:()=>P(null),children:"Try again"}),/*#__PURE__*/o(d,{})]}:{children:[/*#__PURE__*/o(m,{onClose:U},"header"),/*#__PURE__*/o(i,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),/*#__PURE__*/o(y,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),/*#__PURE__*/o(u,{style:{marginTop:"1rem"},children:"When you log into a new device, you’ll only need to authenticate to access your account. Never get logged out if you forget your password."}),/*#__PURE__*/o(v,{style:{minHeight:"2rem"}}),/*#__PURE__*/o(c,{loading:k,disabled:E,onClick:()=>async function(){M(!0);try{let e=await w.getAccessToken(),r=s(p,C);if(!e||!j||!r)return;if(!(await j.setRecovery({accessToken:e,entropyId:C,entropyIdVerifier:T,existingRecoveryMethod:r.recoveryMethod,recoveryMethod:"privy"})).entropyId)throw Error("Unable to set recovery on wallet");let o=await I();if(!o)throw Error("Unable to set recovery on wallet");let t=s(o,r.address);if(!t)throw Error("Unabled to set recovery on wallet");W(!!o),setTimeout((()=>{x.data?.setWalletPassword?.onSuccess(t),b()}),h)}catch(e){P(e)}finally{M(!1)}}(),children:S?"Success":"Confirm"}),/*#__PURE__*/o(d,{})]})}};export{w as SetAutomaticRecoveryScreen,w as default};
@@ -1,2 +1,2 @@
1
- import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import{useState as n,useEffect as i,useMemo as t,useCallback as a,useReducer as l}from"react";import{q as c}from"./context-B4VZqX5H.mjs";import{a as s}from"./get-is-unified-wallet-DXko-EzF.mjs";import d from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{b as h,R as p,c as u}from"./Layouts-Bmf8DxNP.mjs";import{M as m,B as g}from"./ModalHeader-CxHK1IKF.mjs";import{E as y,b as v,P as f,a as w,I as b,H as k,S as C,c as S,N as x,D as B,d as $,R as I,e as R,f as P,g as j}from"./shared-BMOp6N9y.mjs";import{styled as A}from"styled-components";import{S as L,P as E}from"./Button-OlK_6fKk.mjs";import{C as D}from"./Checkbox-NmGCZeKL.mjs";import z from"@heroicons/react/24/outline/KeyIcon";import H from"@heroicons/react/24/solid/CheckCircleIcon";import T from"fast-password-entropy";import*as U from"secure-password-utilities";import{DEFAULT_WORDLIST as F}from"secure-password-utilities/wordlists";import M from"@heroicons/react/24/outline/ArrowDownTrayIcon";import N from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import K from"@heroicons/react/24/outline/DocumentDuplicateIcon";import O from"@heroicons/react/24/solid/XCircleIcon";import{C as W}from"./ScreenHeader-Biz1wq02.mjs";const Y=({buttonHideAnimations:t,buttonLoading:a,password:l,onSubmit:c,onBack:s})=>{let[u,B]=n(!0),[$,I]=n(!1),[R,P]=n(""),j=l===R;return i((()=>{R&&!$&&I(!0)}),[R]),/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(m,{closeable:!1,backFn:s}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(y,{children:[/*#__PURE__*/e(v,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/o(w,{value:R,onChange:e=>P(e.target.value),onKeyUp:e=>{"Enter"===e.key&&c()},onBlur:()=>I(!0),placeholder:"confirm your password",type:u?"password":"text",style:{paddingRight:"2.3rem"}}),/*#__PURE__*/o(b,{style:{right:"0.75rem"},children:u?/*#__PURE__*/o(k,{onClick:()=>B(!1)}):/*#__PURE__*/o(C,{onClick:()=>B(!0)})})]}),
1
+ import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import{useState as n,useEffect as i,useMemo as t,useCallback as a,useReducer as l}from"react";import{q as c}from"./context-Dee1TPOi.mjs";import{a as s}from"./get-is-unified-wallet-_KIJnP68.mjs";import d from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{b as h,R as p,c as u}from"./Layouts-Bmf8DxNP.mjs";import{M as m,B as g}from"./ModalHeader-DHXUvTf4.mjs";import{E as y,b as v,P as f,a as w,I as b,H as k,S as C,c as S,N as x,D as B,d as $,R as I,e as R,f as P,g as j}from"./shared-CRNjAkzC.mjs";import{styled as A}from"styled-components";import{S as L,P as E}from"./Button-DJY5dut3.mjs";import{C as D}from"./Checkbox-NmGCZeKL.mjs";import z from"@heroicons/react/24/outline/KeyIcon";import H from"@heroicons/react/24/solid/CheckCircleIcon";import T from"fast-password-entropy";import*as U from"secure-password-utilities";import{DEFAULT_WORDLIST as F}from"secure-password-utilities/wordlists";import M from"@heroicons/react/24/outline/ArrowDownTrayIcon";import N from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import K from"@heroicons/react/24/outline/DocumentDuplicateIcon";import O from"@heroicons/react/24/solid/XCircleIcon";import{C as W}from"./ScreenHeader-Biz1wq02.mjs";const Y=({buttonHideAnimations:t,buttonLoading:a,password:l,onSubmit:c,onBack:s})=>{let[u,B]=n(!0),[$,I]=n(!1),[R,P]=n(""),j=l===R;return i((()=>{R&&!$&&I(!0)}),[R]),/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(m,{closeable:!1,backFn:s}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(y,{children:[/*#__PURE__*/e(v,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/o(w,{value:R,onChange:e=>P(e.target.value),onKeyUp:e=>{"Enter"===e.key&&c()},onBlur:()=>I(!0),placeholder:"confirm your password",type:u?"password":"text",style:{paddingRight:"2.3rem"}}),/*#__PURE__*/o(b,{style:{right:"0.75rem"},children:u?/*#__PURE__*/o(k,{onClick:()=>B(!1)}):/*#__PURE__*/o(C,{onClick:()=>B(!0)})})]}),
2
2
  /*#__PURE__*/o(S,{"aria-hidden":!$||j,error:!0,children:"Passwords do not match"})]}),/*#__PURE__*/o(x,{onClick:c,loading:a,disabled:!j,$hideAnimations:t,children:"Continue"}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})},Z=({buttonHideAnimations:i,buttonLoading:t,onSubmit:a,onBack:l,config:c})=>{let[s,u]=n(!1);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{closeable:!1,backFn:l}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(y,{children:[/*#__PURE__*/e(v,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),/*#__PURE__*/o(B,{children:/*#__PURE__*/e($,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:e=>{e.preventDefault(),u((e=>!e))},children:[/*#__PURE__*/o(D,{color:"var(--privy-color-error)",readOnly:!0,checked:s}),/*#__PURE__*/o(r,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),/*#__PURE__*/e(_,{children:["user"===c.initiatedBy&&/*#__PURE__*/o(L,{onClick:c.onCancel,disabled:t,children:"Cancel"}),/*#__PURE__*/o(x,{onClick:a,loading:t,$hideAnimations:i,disabled:!s,children:"Set Password"})]}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})};let _=/*#__PURE__*/A.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-d1659c5f-0"})(["display:flex;gap:10px;"]),q=/[a-z]/,G=/[A-Z]/,X=/[0-9]/,J="!@#$%^&*()\\-_+.",Q=`a-zA-Z0-9${J}`,V=RegExp(`[${J}]`),ee=RegExp(`[${Q}]`);const re=RegExp(`^[${Q}]{6,}$`),oe=()=>U.generatePassphrase(4,F);function ne(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function ie(e=""){return(.3*function(e){if(e.length<8)return 0;let r=0;return q.test(e)&&(r+=1),G.test(e)&&(r+=1),X.test(e)&&(r+=1),V.test(e)&&(r+=1),Math.max(0,Math.min(1,r/3))}(e)+T(e)/95)/2}const te=({buttonHideAnimations:a,buttonLoading:l,password:c="",config:s,isResettingPassword:d,onSubmit:u,onClose:P,onBack:j,onPasswordChange:A,onPasswordGenerate:L})=>{let[E,D]=n(!1),[T,U]=n(!1);i((()=>{c&&!T&&U(!0)}),[c]);let F=t((()=>T?6>(c?.length||0)?"Password must be at least 6 characters":re.test(c||"")?null:`Invalid characters used ( ${((e="")=>[...new Set(e.split("").filter((e=>!ee.test(e))).map((e=>e.replace(" ","SPACE"))))])(c).join(" ")} )`:null),[c,T]),M=t((()=>F?{value:0,label:"Weak"}:function(e=""){let r=ie(e);return{value:r,label:ne(r)}}(c)),[c,F]),N=t((()=>!c?.length||!!F),[F,c]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{onClose:P,closeable:"user"===s.initiatedBy,backFn:j}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(y,{children:[/*#__PURE__*/e(v,{children:[/*#__PURE__*/o(z,{height:48,width:48,stroke:"var(--privy-color-accent)"}),/*#__PURE__*/e("h3",{style:{color:"var(--privy-color-foreground)"},children:[d?"Reset":"Set"," your password"]}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/o(w,{value:c,onChange:e=>A(e.target.value),onKeyUp:e=>{"Enter"===e.key&&u()},placeholder:"enter or generate a strong password",type:E?"password":"text",style:{paddingRight:"3.8rem"}}),/*#__PURE__*/e(b,{style:{width:"3.5rem"},children:[E?/*#__PURE__*/o(k,{onClick:()=>D(!1)}):/*#__PURE__*/o(C,{onClick:()=>D(!0)}),/*#__PURE__*/o(I,{onClick:L})]})]}),/*#__PURE__*/o(R,{value:0===M.value?.01:M.value,label:M.label}),/*#__PURE__*/o(S,{error:!!F,children:F||`Password Strength: ${T?M.label:"--"}`}),/*#__PURE__*/e(le,{children:[/*#__PURE__*/o(ae,{children:/*#__PURE__*/e(B,{children:[/*#__PURE__*/e($,{children:[/*#__PURE__*/o(H,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),/*#__PURE__*/e($,{children:[/*#__PURE__*/o(H,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),/*#__PURE__*/o(x,{onClick:u,loading:l,disabled:N,$hideAnimations:a,children:"Continue"})]})]}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})};let ae=/*#__PURE__*/A(B).withConfig({displayName:"DetailsContainer",componentId:"sc-2da5fe90-0"})(["flex:1;padding-top:1rem;"]),le=/*#__PURE__*/A.div.withConfig({displayName:"LowerContainer",componentId:"sc-2da5fe90-1"})(["display:flex;flex-direction:column;height:100%;"]);const ce=({buttonHideAnimations:i,buttonLoading:t,appName:l,password:c,onSubmit:s,onBack:u})=>{let[w,S]=n(!1),[B,$]=n(!0),I=a((()=>{S(!0),c&&navigator.clipboard.writeText(c)}),[c]),R=a((()=>{let e=document.createElement("a"),r=l.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),o=new Blob([se(l,c)],{type:"text/plain"}),n=URL.createObjectURL(o);e.href=n,e.target="_blank",e.download=`${r}-privy-wallet-recovery.txt`,document.body.appendChild(e),e.click(),setTimeout((()=>{e.remove(),URL.revokeObjectURL(n)}),5e3)}),[c]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{backFn:u,closeable:!1}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(y,{children:[/*#__PURE__*/e(v,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),/*#__PURE__*/e(f,{centered:!0,children:[/*#__PURE__*/o(P,{children:B?"•".repeat(c.length):c}),/*#__PURE__*/o(b,{style:{right:"0.75rem"},children:B?/*#__PURE__*/o(k,{onClick:()=>$(!1)}):/*#__PURE__*/o(C,{onClick:()=>$(!0)})})]}),/*#__PURE__*/e("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[/*#__PURE__*/o(j,{onClick:I,children:/*#__PURE__*/e(r,w?{children:[/*#__PURE__*/o(N,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}:{children:[/*#__PURE__*/o(K,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),/*#__PURE__*/e(j,{onClick:R,children:[/*#__PURE__*/o(M,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),/*#__PURE__*/o(x,{onClick:s,loading:t,$hideAnimations:i,children:"Continue"}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})};let se=(e,r)=>`Your wallet recovery password for ${e} is\n\n${r}\n\nYou will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;const de=({error:n,onClose:i})=>/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(m,{closeable:!1}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(u,n?{children:[/*#__PURE__*/o(O,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),/*#__PURE__*/o(W,{title:"Something went wrong",description:n})]}:{children:[/*#__PURE__*/o(H,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/o(W,{title:"Success"})]}),/*#__PURE__*/o(E,{onClick:i,children:"Close"}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]});let he=(e,r)=>{switch(e){case"creating":return"back"===r?e:"saving";case"saving":return"back"===r?"creating":"confirming";case"confirming":return"back"===r?"saving":"finalizing";case"finalizing":return"back"===r?"confirming":"done";default:return e}};const pe=({onSubmit:e,...r})=>{let{lastScreen:n,navigate:t}=s(),{send:d,state:h}=(()=>{let[e,r]=l(he,"creating");return{send:r,state:e}})(),p=a((async()=>{"finalizing"===h&&await e(),d("next")}),[h,d,e]);i((()=>{let e;return"done"===h&&"automatic"===r.config.initiatedBy&&(e=setTimeout((()=>r.onClose?.()),c)),()=>{e&&clearTimeout(e)}}),[h,r.config.initiatedBy,r.onClose]);let u=a((()=>{d("back")}),[d]),m=a((()=>{t("RecoverySelectionScreen")}),[n,t]);return"creating"===h?/*#__PURE__*/o(te,{...r,onSubmit:p,onBack:"RecoverySelectionScreen"===n?m:void 0}):"saving"===h?/*#__PURE__*/o(ce,{...r,onSubmit:p,onBack:u}):"confirming"===h?/*#__PURE__*/o(Y,{...r,onSubmit:p,onBack:u}):"finalizing"===h?/*#__PURE__*/o(Z,{...r,onSubmit:p,onBack:u}):"done"===h?/*#__PURE__*/o(de,{...r,onSubmit:p}):null};export{pe as S,oe as g};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import{base64 as i}from"@scure/base";import{Edit as r}from"lucide-react";import{useState as n,useEffect as a}from"react";import{styled as s}from"styled-components";import{isHex as l,hexToString as c}from"viem";import{ProviderErrors as m}from"@privy-io/js-sdk-core";import{C as p}from"./CopyToClipboard-DatKc59_.mjs";import{a as d}from"./Layouts-Bmf8DxNP.mjs";import{M as u,D as g}from"./JsonTree-Bvd2C29R.mjs";import{P as y,j as h}from"./prepareFundingModalData-CndHQFiM.mjs";import{W as f,q as C}from"./context-B4VZqX5H.mjs";import{u as x}from"./internal-context-DLZicboG.mjs";import{u as w,a as j}from"./get-is-unified-wallet-DXko-EzF.mjs";import{S as b}from"./ScreenLayout-pthdsODa.mjs";import"./copy-Bx2Jwc5_.mjs";import"eventemitter3";import"tinycolor2";import"ofetch";import"./Button-OlK_6fKk.mjs";import"./useActiveWallet-Bj-s666H.mjs";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const S=/*#__PURE__*/s.img.withConfig({displayName:"StyledLogo",componentId:"sc-68c1b1ea-0"})(["&&{height:",";width:",";border-radius:16px;margin-bottom:12px;}"],(e=>"sm"===e.size?"65px":"140px"),(e=>"sm"===e.size?"65px":"140px"));let T=e=>{if(!l(e))return e;try{let t=c(e);return t.includes("�")?e:t}catch{return e}},v=e=>{try{let t=i.decode(e),o=(new TextDecoder).decode(t);return o.includes("�")?e:o}catch{return e}},E=i=>{let{types:r,primaryType:n,...a}=i.typedData;/*#__PURE__*/return t(o,{children:[/*#__PURE__*/e(_,{data:a}),/*#__PURE__*/e(p,{text:(s=i.typedData,JSON.stringify(s,null,2)),itemName:"full payload to clipboard"})," "]});var s};const D=({method:o,messageData:i,copy:n,iconUrl:a,isLoading:s,success:l,walletProxyIsLoading:c,errorMessage:m,isCancellable:p,onSign:u,onCancel:g,onClose:y})=>/*#__PURE__*/e(b,{title:n.title,subtitle:n.description,showClose:!0,onClose:y,icon:r,iconVariant:"subtle",helpText:m?/*#__PURE__*/e(R,{children:m}):void 0,primaryCta:{label:n.buttonText,onClick:u,disabled:s||l||c,loading:s},secondaryCta:p?{label:"Not now",onClick:g,disabled:s||l||c}:void 0,watermark:!0,children:/*#__PURE__*/t(d,{children:[a?/*#__PURE__*/e(S,{style:{alignSelf:"center"},size:"sm",src:a,alt:"app image"}):null,/*#__PURE__*/t(L,{children:["personal_sign"===o&&/*#__PURE__*/e(M,{children:T(i)}),"eth_signTypedData_v4"===o&&/*#__PURE__*/e(E,{typedData:i}),"solana_signMessage"===o&&/*#__PURE__*/e(M,{children:v(i)})]})]})}),I={component:()=>{let{authenticated:t}=w(),{initializeWalletProxy:o,closePrivyModal:i}=x(),{navigate:r,data:s,onUserCloseViaDialogOrKeybindRef:l}=j(),[c,p]=n(!0),[d,u]=n(""),[g,b]=n(),[S,T]=n(null),[v,E]=n(!1);a((()=>{t||r("LandingScreen")}),[t]),a((()=>{o(f).then((e=>{p(!1),e||(u("An error has occurred, please try again."),b(new y(new h(d,m.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))}))}),[]);let{method:I,data:L,confirmAndSign:R,onSuccess:_,onFailure:M,uiOptions:N}=s.signMessage,A={title:N?.title||"Sign message",description:N?.description||"Signing this message will not cost you any fees.",buttonText:N?.buttonText||"Sign and continue"},U=e=>{e?_(e):M(g||new y(new h("The user rejected the request.",m.E4001_USER_REJECTED_REQUEST.eipCode))),i({shouldCallAuthOnSuccess:!1}),setTimeout((()=>{T(null),u(""),b(void 0)}),200)};l.current=()=>{U(S)};/*#__PURE__*/return e(D,{method:I,messageData:L,copy:A,iconUrl:N?.iconUrl&&"string"==typeof N.iconUrl?N.iconUrl:void 0,isLoading:v,success:null!==S,walletProxyIsLoading:c,errorMessage:d,isCancellable:N?.isCancellable,onSign:async()=>{E(!0),u("");try{let e=await R();T(e),E(!1),setTimeout((()=>{U(e)}),C)}catch(e){console.error(e),u("An error has occurred, please try again."),b(new y(new h(d,m.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),E(!1)}},onCancel:()=>U(null),onClose:()=>U(S)})}};let L=/*#__PURE__*/s.div.withConfig({displayName:"MessageContainer",componentId:"sc-124260c0-0"})(["flex:1;display:flex;flex-direction:column;gap:16px;"]),R=/*#__PURE__*/s.p.withConfig({displayName:"ErrorText",componentId:"sc-124260c0-1"})(["&&{margin:0;width:100%;text-align:center;color:var(--privy-color-error-dark);font-size:14px;line-height:22px;}"]),_=/*#__PURE__*/s(g).withConfig({displayName:"StyledDisplayJsonTree",componentId:"sc-124260c0-2"})(["margin-top:0;"]),M=/*#__PURE__*/s(u).withConfig({displayName:"StyledMessage",componentId:"sc-124260c0-3"})(["margin-top:0;"]);export{I as SignRequestScreen,D as SignRequestView,I as default};
1
+ import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import{base64 as i}from"@scure/base";import{Edit as r}from"lucide-react";import{useState as n,useEffect as a}from"react";import{styled as s}from"styled-components";import{isHex as l,hexToString as c}from"viem";import{ProviderErrors as m}from"@privy-io/js-sdk-core";import{C as p}from"./CopyToClipboard-DatKc59_.mjs";import{a as d}from"./Layouts-Bmf8DxNP.mjs";import{M as u,D as g}from"./JsonTree-Bvd2C29R.mjs";import{P as y,j as h}from"./prepareFundingModalData-BYy0MVol.mjs";import{W as f,q as C}from"./context-Dee1TPOi.mjs";import{u as x}from"./internal-context-e-Eni5bG.mjs";import{u as w,a as j}from"./get-is-unified-wallet-_KIJnP68.mjs";import{S as b}from"./ScreenLayout-BQ6FV6yc.mjs";import"./copy-Bx2Jwc5_.mjs";import"eventemitter3";import"tinycolor2";import"ofetch";import"./Button-DJY5dut3.mjs";import"./useActiveWallet-SiVSXkvG.mjs";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-gElyEQoU.mjs";import"./Screen-CKaxnxac.mjs";import"./ModalHeader-DHXUvTf4.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const S=/*#__PURE__*/s.img.withConfig({displayName:"StyledLogo",componentId:"sc-68c1b1ea-0"})(["&&{height:",";width:",";border-radius:16px;margin-bottom:12px;}"],(e=>"sm"===e.size?"65px":"140px"),(e=>"sm"===e.size?"65px":"140px"));let T=e=>{if(!l(e))return e;try{let t=c(e);return t.includes("�")?e:t}catch{return e}},v=e=>{try{let t=i.decode(e),o=(new TextDecoder).decode(t);return o.includes("�")?e:o}catch{return e}},E=i=>{let{types:r,primaryType:n,...a}=i.typedData;/*#__PURE__*/return t(o,{children:[/*#__PURE__*/e(_,{data:a}),/*#__PURE__*/e(p,{text:(s=i.typedData,JSON.stringify(s,null,2)),itemName:"full payload to clipboard"})," "]});var s};const D=({method:o,messageData:i,copy:n,iconUrl:a,isLoading:s,success:l,walletProxyIsLoading:c,errorMessage:m,isCancellable:p,onSign:u,onCancel:g,onClose:y})=>/*#__PURE__*/e(b,{title:n.title,subtitle:n.description,showClose:!0,onClose:y,icon:r,iconVariant:"subtle",helpText:m?/*#__PURE__*/e(R,{children:m}):void 0,primaryCta:{label:n.buttonText,onClick:u,disabled:s||l||c,loading:s},secondaryCta:p?{label:"Not now",onClick:g,disabled:s||l||c}:void 0,watermark:!0,children:/*#__PURE__*/t(d,{children:[a?/*#__PURE__*/e(S,{style:{alignSelf:"center"},size:"sm",src:a,alt:"app image"}):null,/*#__PURE__*/t(L,{children:["personal_sign"===o&&/*#__PURE__*/e(M,{children:T(i)}),"eth_signTypedData_v4"===o&&/*#__PURE__*/e(E,{typedData:i}),"solana_signMessage"===o&&/*#__PURE__*/e(M,{children:v(i)})]})]})}),I={component:()=>{let{authenticated:t}=w(),{initializeWalletProxy:o,closePrivyModal:i}=x(),{navigate:r,data:s,onUserCloseViaDialogOrKeybindRef:l}=j(),[c,p]=n(!0),[d,u]=n(""),[g,b]=n(),[S,T]=n(null),[v,E]=n(!1);a((()=>{t||r("LandingScreen")}),[t]),a((()=>{o(f).then((e=>{p(!1),e||(u("An error has occurred, please try again."),b(new y(new h(d,m.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))}))}),[]);let{method:I,data:L,confirmAndSign:R,onSuccess:_,onFailure:M,uiOptions:N}=s.signMessage,A={title:N?.title||"Sign message",description:N?.description||"Signing this message will not cost you any fees.",buttonText:N?.buttonText||"Sign and continue"},U=e=>{e?_(e):M(g||new y(new h("The user rejected the request.",m.E4001_USER_REJECTED_REQUEST.eipCode))),i({shouldCallAuthOnSuccess:!1}),setTimeout((()=>{T(null),u(""),b(void 0)}),200)};l.current=()=>{U(S)};/*#__PURE__*/return e(D,{method:I,messageData:L,copy:A,iconUrl:N?.iconUrl&&"string"==typeof N.iconUrl?N.iconUrl:void 0,isLoading:v,success:null!==S,walletProxyIsLoading:c,errorMessage:d,isCancellable:N?.isCancellable,onSign:async()=>{E(!0),u("");try{let e=await R();T(e),E(!1),setTimeout((()=>{U(e)}),C)}catch(e){console.error(e),u("An error has occurred, please try again."),b(new y(new h(d,m.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),E(!1)}},onCancel:()=>U(null),onClose:()=>U(S)})}};let L=/*#__PURE__*/s.div.withConfig({displayName:"MessageContainer",componentId:"sc-124260c0-0"})(["flex:1;display:flex;flex-direction:column;gap:16px;"]),R=/*#__PURE__*/s.p.withConfig({displayName:"ErrorText",componentId:"sc-124260c0-1"})(["&&{margin:0;width:100%;text-align:center;color:var(--privy-color-error-dark);font-size:14px;line-height:22px;}"]),_=/*#__PURE__*/s(g).withConfig({displayName:"StyledDisplayJsonTree",componentId:"sc-124260c0-2"})(["margin-top:0;"]),M=/*#__PURE__*/s(u).withConfig({displayName:"StyledMessage",componentId:"sc-124260c0-3"})(["margin-top:0;"]);export{I as SignRequestScreen,D as SignRequestView,I as default};
@@ -1 +1 @@
1
- import{jsxs as t,jsx as n,Fragment as e}from"react/jsx-runtime";import{useState as a,useMemo as r,useEffect as o}from"react";import{formatTokenAmount as i}from"@privy-io/js-sdk-core";import{a as s,u as c,j as l,g as d}from"./get-is-unified-wallet-DXko-EzF.mjs";import{u}from"./context-B4VZqX5H.mjs";import{u as m}from"./internal-context-DLZicboG.mjs";import{u as p}from"./useGetSolPrice-fF6UX0Cj.mjs";import{ErrorScreenView as f}from"./ErrorScreen-NoHFWbKU.mjs";import g from"@heroicons/react/24/outline/CheckCircleIcon";import{styled as h}from"styled-components";import{P as y}from"./Button-OlK_6fKk.mjs";import{R as w}from"./Layouts-Bmf8DxNP.mjs";import{M as k,B as b}from"./ModalHeader-CxHK1IKF.mjs";import{C as v}from"./ScreenHeader-Biz1wq02.mjs";import{a as I,R as A}from"./Row-CG0lSY5Z.mjs";import{L as S,V as j}from"./Value-B4M62ove.mjs";import{S as C,W as T}from"./WalletLink-D2x4SkPO.mjs";import{e as O}from"./StackedContainer-BrIQsdas.mjs";import{Y as x}from"./useActiveWallet-Bj-s666H.mjs";import{T as $,a as L}from"./TransactionErrorView-DmFbjQHi.mjs";import{g as E}from"./transaction-CnfuREWo.mjs";import{pipe as F,getCompiledTransactionMessageDecoder as _,decompileTransactionMessage as P,setTransactionMessageLifetimeUsingBlockhash as B,compileTransaction as J,getTransactionEncoder as W,getBase58Decoder as D,fetchAddressesForLookupTables as M}from"@solana/kit";import{a as R,f as q,s as U,b as V,u as H}from"./useSolanaRpcClient-Be5Dd6m5.mjs";import{D as z,T as N,a as Q,S as X,A as Y,R as G,J as K,g as Z}from"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"viem";import"tinycolor2";import"ofetch";import"lucide-react";import"./index-CCrVHfyv.mjs";import"uuid";import"jose";import"eventemitter3";import"./useWallets-DuxHKVvE.mjs";import"./prepareFundingModalData-CndHQFiM.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-BSIhOAz8.mjs";import"./events-context-CI0iqAXA.mjs";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./getPublicClient-C_l_ocJu.mjs";import"js-cookie";import"./frame-BMn1PaPp.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-J1po7l19.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./reservoir-DRNnyqld.mjs";import"./ScreenLayout-pthdsODa.mjs";import"./Screen-Dzz_AFFs.mjs";import"./index-CJMgUOnw.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"./LoadingSkeleton-CHdaq3pb.mjs";import"./ethers-oRuqwv5W.mjs";import"@heroicons/react/24/outline";import"./ErrorMessage-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Subtitle-DkvfP2Ev.mjs";import"./Title-D0pfZff-.mjs";import"./Address-C1iw9r70.mjs";import"./WalletInfoCard-DmIqX_B8.mjs";import"./shared-CtYf3O54.mjs";import"./Checkbox-NmGCZeKL.mjs";import"./ErrorBanner-BdiArMwu.mjs";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"./WarningBanner-BDp-QC9i.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/ClipboardDocumentIcon";const tt=/*#__PURE__*/h.span.withConfig({displayName:"CircleBackground",componentId:"sc-c9f33cd-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";background-color:",";border-radius:50%;display:inline-block;box-sizing:border-box;}"],(t=>t.color??"var(--privy-color-accent)"),(t=>t.color??"var(--privy-color-accent)")),nt=({instruction:e,fees:a,transactionInfo:r,solPrice:o,chain:i})=>/*#__PURE__*/t(I,{children:[r?.action&&/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"Action"}),/*#__PURE__*/n(j,{children:r.action})]}),null!=e?.total&&/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"Total"}),/*#__PURE__*/n(j,{children:e.total})]}),!e?.total&&null!=e?.amount&&/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"Total"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(C,{quantities:[e.amount,a],tokenPrice:o})})]}),/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"Fees"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(C,{quantities:[a],tokenPrice:o})})]}),e?.to&&/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"To"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(T,{walletAddress:e.to,chainId:i,chainType:"solana"})})]})]}),et=({fees:a,onClose:r,receiptHeader:o,receiptDescription:i,transactionInfo:s,solPrice:c,signOnly:l,instruction:d,chain:u})=>/*#__PURE__*/t(e,{children:[/*#__PURE__*/n(k,{onClose:r}),/*#__PURE__*/n(O,{style:{marginBottom:"16px"},children:/*#__PURE__*/t("div",{children:[/*#__PURE__*/n(tt,{color:"var(--privy-color-success-light)"}),/*#__PURE__*/n(g,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),/*#__PURE__*/n(v,{title:o??`Transaction ${l?"signed":"complete"}!`,description:i??"You're all set."}),/*#__PURE__*/n(nt,{solPrice:c,instruction:d,fees:a,transactionInfo:s,chain:u}),/*#__PURE__*/n(x,{}),/*#__PURE__*/n(at,{loading:!1,onClick:r,children:"Close"}),/*#__PURE__*/n(w,{}),/*#__PURE__*/n(b,{})]});let at=/*#__PURE__*/h(y).withConfig({displayName:"SubmitButton",componentId:"sc-3cb7ee42-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);async function rt(t,n){try{return await t}catch{return n}}function ot(t){switch(t){case"solana:mainnet":return"mainnet-beta";case"solana:devnet":return"devnet";case"solana:testnet":return"testnet"}}async function it({privyClient:t,chain:n,mint:e}){let a=z[n];if(!a[e]){let r=await t.getSplTokenMetadata({mintAddress:e,cluster:ot(n)});r&&(a[e]={address:e,symbol:r.symbol,decimals:r.decimals})}return a[e]}async function st({tx:t,solanaClient:n,privyClient:e,checkFunds:a}){let r=_().decode(R(t)),o=r.staticAccounts[0]??"",i=await q({solanaClient:n,tx:t}),s=a?await rt(U({solanaClient:n,tx:t})):void 0,c=s?.hasFunds??!0,l={},d=[],u=await async function({solanaClient:t,message:n}){if(!("addressTableLookups"in n)||!n.addressTableLookups)return[...n.staticAccounts];let e=n.addressTableLookups.map((t=>t.lookupTableAddress)),a=await M(e,t.rpc),r=e.map(((t,e)=>[...n.addressTableLookups[e]?.writableIndexes.map((n=>{let r=a[t]?.[n];if(r)return{key:r,isWritable:!0,altIdx:e}}))??[],...n.addressTableLookups[e]?.readonlyIndexes.map((n=>{let r=a[t]?.[n];if(r)return{key:r,isWritable:!1,altIdx:e}}))??[]])).flat().filter((t=>!!t)).sort(((t,n)=>t.isWritable!==n.isWritable?t.isWritable?-1:1:t.altIdx-n.altIdx)).map((({key:t})=>t));return[...n.staticAccounts,...r]}({solanaClient:n,message:r});for(let t of r.instructions){let a=r.staticAccounts[t.programAddressIndex]||"";if(a!==N&&a!==Q)if(a!==X){if(a===Y){let n=await rt(function(t,n,e){let[a,r,o,i]=t.accountIndices?.map((t=>n[t]))??[];return{type:"ata-creation",program:e,payer:a,ata:r,owner:o,mint:i}}(t,u,a));if(!n){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}if(d.push(n),n.ata&&n.owner&&n.mint){l[n.ata]={owner:n.owner,mint:n.mint};continue}}if(G.includes(a)){let r=await rt(ut(t,u,n,e,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r)}else if(K.includes(a)){let r=await rt(mt(t,u,n,e,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r)}else d.push({type:"unknown",program:a,discriminator:t.data?.[0]})}else{let n=await rt(dt(t,u));if(!n){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(n)}else{let r=await rt(lt(t,u,n,e,l,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r),"spl-transfer"===r.type&&(r.fromAta&&r.fromAccount&&r.token.address&&(l[r.fromAta]??={owner:r.fromAccount,mint:r.token.address}),r.toAta&&r.toAccount&&r.token.address&&(l[r.toAta]??={owner:r.toAccount,mint:r.token.address}))}}return{spender:o,fee:i,instructions:d,hasFunds:!!c}}function ct(t,n=0){try{return function(t,n=0){let e=0n;for(let a=0;a<8;a++)e|=BigInt(t[n+a])<<BigInt(8*a);return e}(t,n)}catch{}try{return t.readBigInt64LE(n)}catch{}let e=V(t);try{return((t,n=0)=>{let e=t[n],a=t[n+7];if(!e||!a)throw Error(`Buffer offset out of range: first: ${e}, last: ${a}.`);return(BigInt(t[n+4]+256*t[n+5]+65536*t[n+6]+(a<<24))<<32n)+BigInt(e+256*t[++n]+65536*t[++n]+16777216*t[++n])})(e)}catch{}try{return e.subarray(n).readBigInt64LE()}catch{}try{return e.readBigInt64LE(n)}catch{}return 0n}async function lt(t,n,e,a,r,o){let i=t.data?.[0],s=t.accountIndices?.map((t=>n[t]))??[];if(1===i){let[t,n,e]=s;return{type:"spl-init-account",program:o,account:t,mint:n,owner:e}}if(3===i){let n,i,[c,l,d]=s,u="",m=l?r[l]:void 0;if(m)n=m.owner,u=m.mint;else if(l){let t=await e.rpc.getAccountInfo(l,{commitment:"confirmed",encoding:"jsonParsed"}).send(),a=t.value?.data;n=a?.parsed?.info?.owner,u=a?.parsed?.info?.mint??"",i=a?.parsed?.info?.tokenAmount?.decimals}if(!u&&c){let t=await e.rpc.getAccountInfo(c,{commitment:"confirmed",encoding:"jsonParsed"}).send(),n=t.value?.data;u=n?.parsed?.info?.mint??""}let p=await it({privyClient:a,chain:e.chain,mint:u}),f=p?.symbol??"";return i??=p?.decimals??9,{type:"spl-transfer",program:o,fromAta:c,fromAccount:d,toAta:l,toAccount:n,value:ct(t.data,1),token:{symbol:f,decimals:i,address:u}}}if(9===i){let[t,n,e]=s;return{type:"spl-close-account",program:o,source:t,destination:n,owner:e}}if(17===i)return{type:"spl-sync-native",program:o};throw Error(`Token program instruction type ${i} not supported`)}async function dt(t,n){let e=t.data?.[0],a=t.accountIndices?.map((t=>n[t]))??[];if(0===e){let[,n]=a;return{type:"create-account",program:X,account:n?.toString(),value:ct(t.data,4),withSeed:!1}}if(2===e){let[n,e]=a;return{type:"sol-transfer",program:X,fromAccount:n,toAccount:e,token:{symbol:"SOL",decimals:9},value:ct(t.data,4),withSeed:!1}}if(3===e){let[,n]=a;return{type:"create-account",program:X,account:n,withSeed:!0,value:ct(t.data.slice(t.data.length-32-8-8))}}if(11===e){let[n,e]=a;return{type:"sol-transfer",program:X,fromAccount:n,toAccount:e,value:ct(t.data,4),token:{symbol:"SOL",decimals:9},withSeed:!0}}throw Error(`System program instruction type ${e} not supported`)}async function ut(t,n,e,a,r){let o=t.accountIndices?.map((t=>n[t]))??[],i=t.data?.[0];if(143===i){let n=o[10],i=o[11];return{type:"raydium-swap-base-input",program:r,mintIn:n,mintOut:i,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:i?await it({privyClient:a,chain:e.chain,mint:i}):void 0,amountIn:ct(t.data,8),minimumAmountOut:ct(t.data,16)}}if(55===i){let n=o[10],i=o[11];return{type:"raydium-swap-base-output",program:r,mintIn:n,mintOut:i,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:i?await it({privyClient:a,chain:e.chain,mint:i}):void 0,maxAmountIn:ct(t.data,8),amountOut:ct(t.data,16)}}throw Error(`Raydium swap program instruction type ${i} not supported`)}async function mt(t,n,e,a,r){let o=t.data?.[0],i=t.accountIndices?.map((t=>n[t]))??[];if([208,51,239,151,123,43,237,92].includes(o)){let n=i[5],o=i[6];return{type:"jupiter-swap-exact-out-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,outAmount:ct(t.data,t.data.length-1-2-8-8),quotedInAmount:ct(t.data,t.data.length-1-2-8)}}if([176,209,105,168,154,125,69,62].includes(o)){let n=i[7],o=i[8];return{type:"jupiter-swap-exact-out-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,outAmount:ct(t.data,t.data.length-1-2-8-8),quotedInAmount:ct(t.data,t.data.length-1-2-8)}}if([193,32,155,51,65,214,156,129].includes(o)){let n=i[7],o=i[8];return{type:"jupiter-swap-shared-accounts-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,inAmount:ct(t.data,t.data.length-1-2-8-8),quotedOutAmount:ct(t.data,t.data.length-1-2-8)}}throw[62,198,214,193,213,159,108,210].includes(o)&&console.warn("Jupiter swap program instruction 'claim' not implemented"),[116,206,27,191,166,19,0,73].includes(o)&&console.warn("Jupiter swap program instruction 'claim_token' not implemented"),[26,74,236,151,104,64,183,249].includes(o)&&console.warn("Jupiter swap program instruction 'close_token' not implemented"),[229,194,212,172,8,10,134,147].includes(o)&&console.warn("Jupiter swap program instruction 'create_open_orders' not implemented"),[28,226,32,148,188,136,113,171].includes(o)&&console.warn("Jupiter swap program instruction 'create_program_open_orders' not implemented"),[232,242,197,253,240,143,129,52].includes(o)&&console.warn("Jupiter swap program instruction 'create_token_ledger' not implemented"),[147,241,123,100,244,132,174,118].includes(o)&&console.warn("Jupiter swap program instruction 'create_token_account' not implemented"),[229,23,203,151,122,227,173,42].includes(o)&&console.warn("Jupiter swap program instruction 'route' not implemented"),[150,86,71,116,167,93,14,104].includes(o)&&console.warn("Jupiter swap program instruction 'route_with_token_ledger' not implemented"),[228,85,185,112,78,79,77,2].includes(o)&&console.warn("Jupiter swap program instruction 'set_token_ledger' not implemented"),[230,121,143,80,119,159,106,170].includes(o)&&console.warn("Jupiter swap program instruction 'shared_accounts_route_with_token_ledger' not implemented"),Error(`Jupiter swap program instruction type ${o} not supported`)}const pt={component:()=>{let{data:t,onUserCloseViaDialogOrKeybindRef:e,setModalData:g,navigate:h}=s(),{client:y,closePrivyModal:w,walletProxy:k,showFiatPrices:b}=m(),v=u(),{user:I}=c(),A=H()(t?.standardSignAndSendTransaction?.chain??"solana:mainnet"),[S,j]=a(t?.standardSignAndSendTransaction?.transaction),[C,T]=a(),[O,x]=a(),[M,q]=a({value:0n,isLoading:!1}),[U,V]=a(!1),[z,N]=a({}),[Q,X]=a(),Y=t?.standardSignAndSendTransaction?.account,G=!!t?.standardSignAndSendTransaction?.signOnly,K=Y?.imported?l(I).find((t=>t.address===Y.address)):d(I),{solPrice:tt,isSolPriceLoading:nt}=p({enabled:b}),at=r((()=>{if(!C)return;let t=C.spender,n=E(C.fee),e=E(M.value,3,!0),a=C.instructions.filter((t=>["sol-transfer","spl-transfer","raydium-swap-base-input","raydium-swap-base-output","jupiter-swap-shared-accounts-route","jupiter-swap-exact-out-route"].includes(t.type))),r=a.at(0);if(!r||a.length>1)return{fee:n,spender:t,balance:e};if("sol-transfer"===r.type)return{fee:n,spender:t,balance:e,total:E(r.value)};if("spl-transfer"===r.type)return{fee:n,spender:t,balance:e,total:`${i({amount:r.value,decimals:r.token.decimals})} ${r.token.symbol}`};if("raydium-swap-base-input"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.amountIn,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.minimumAmountOut,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("raydium-swap-base-output"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.maxAmountIn,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.amountOut,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("jupiter-swap-shared-accounts-route"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.inAmount,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.quotedOutAmount,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("jupiter-swap-exact-out-route"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.quotedInAmount,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.outAmount,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}return{fee:n,spender:t,balance:e}}),[C,Y?.address,M]),rt=r((()=>{let t;if(!C||!b||!tt||nt)return;function n(...t){return Z(t.reduce(((t,n)=>t+n),0n),tt??0)}Y?.address===C.spender&&(t=n(C.fee));let e=n(M.value),a=C.instructions.filter((t=>"sol-transfer"===t.type||"spl-transfer"===t.type)).at(0);return!a||C.instructions.length>1?{fee:t,balance:e}:"sol-transfer"===a.type?{fee:t,balance:e,total:n(a.value,Y?.address===C.spender?C.fee:0n)}:"spl-transfer"===a.type?{fee:t,balance:e,total:`${i({amount:a.value,decimals:a.token.decimals})} ${a.token.symbol}`}:{fee:t,balance:e}}),[C,b,tt,nt,Y?.address,M]);if(o((()=>{!async function(){if(S&&y)try{x(void 0);let t=await st({tx:S,solanaClient:A,privyClient:y,checkFunds:!G});T(t)}catch(t){console.error("Failed to prepare transaction",t),x(t)}}()}),[S,A,y,G]),o((()=>{(async function(){if(!Y)return;q({value:M.value,isLoading:!0});let{value:t}=await A.rpc.getBalance(Y.address,{commitment:"confirmed"}).send();q({value:t??0n,isLoading:!1})})().catch(console.error)}),[C]),!S||!t?.standardSignAndSendTransaction||!Y){let e=Error("Invalid transaction request");/*#__PURE__*/return n(f,{error:e,allowlistConfig:v.allowlistConfig,onRetry:()=>{t?.standardSignAndSendTransaction?.onFailure(e),w({shouldCallAuthOnSuccess:!1})}})}let ot=()=>{if(!U)return z.signature||z.signedTransaction?t?.standardSignAndSendTransaction?.onSuccess({signature:z.signature,signedTransaction:z.signedTransaction}):t?.standardSignAndSendTransaction?.onFailure(Q??O??Error("User exited the modal before submitting the transaction")),w({shouldCallAuthOnSuccess:!1})};e.current=ot;let it=t.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?/*#__PURE__*/n("img",{src:t.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:t.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,ct=!!(t.funding&&t.funding.supportedOptions.length>0),lt=!C?.hasFunds&&ct;if(z.signature||z.signedTransaction){let e=C?.instructions.filter((t=>"sol-transfer"===t.type||"spl-transfer"===t.type)),a=1===e?.length?e?.at(0):void 0;/*#__PURE__*/return n(et,{fees:z.fees??0n,onClose:ot,transactionInfo:t.standardSignAndSendTransaction?.uiOptions.transactionInfo,solPrice:tt,receiptHeader:t.standardSignAndSendTransaction?.uiOptions.successHeader,receiptDescription:t.standardSignAndSendTransaction?.uiOptions.successDescription,chain:A.chain,signOnly:G,instruction:"sol-transfer"===a?.type?{to:a.toAccount,amount:a.value}:{to:a?.toAccount||a?.toAta,total:at?.total}})}return Q?/*#__PURE__*/n($,{transactionError:Q,chainId:A.chain,onClose:ot,chainType:"solana",onRetry:async()=>{X(void 0);let{value:t}=await A.rpc.getLatestBlockhash().send();var n,e;j((n=S,e=t,F(_().decode(R(n)),(t=>P(t)),(t=>B(e,t)),(t=>J(t)),(t=>new Uint8Array(W().encode(t))))))}}):/*#__PURE__*/n(L,{img:it,title:t.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.title||"Confirm transaction",subtitle:t.standardSignAndSendTransaction?.uiOptions?.description||`${v.name} wants your permission to approve the following transaction.`,cta:lt?"Add funds":t.standardSignAndSendTransaction?.uiOptions?.buttonText||"Approve",instructions:C?.instructions??[],network:"solana:mainnet"==A.chain?"Solana":A.chain.replace("solana:",""),blockExplorerUrl:A.blockExplorerUrl,total:b?rt?.total:at?.total,fee:b?rt?.fee:at?.fee,balance:b?rt?.balance:at?.balance,swap:at?.swap,transactingWalletAddress:Y.address,disabled:!C?.hasFunds&&!ct,isSubmitting:U,isPreparing:!C||M.isLoading,isTokenPriceLoading:b&&nt,isMissingFunds:!C?.hasFunds,submitError:Q??void 0,isSponsored:!!t.standardSignAndSendTransaction?.isSponsored,parseError:O,onClick:lt?async()=>{if(!Y)return;if(!ct)throw Error("Funding wallet is not enabled");let n="FundingMethodSelectionScreen";g({...t,funding:{...t.funding,methodScreen:n},solanaFundingData:t?.solanaFundingData}),h(n)}:async()=>{try{if(V(!0),U||!Y||!k||!I||!K)return;let n=await t.standardSignAndSendTransaction.onConfirm(S);if("signature"in n){let t=await async function({solanaClient:t,signature:n}){let e=D().decode(n),a=await t.rpc.getTransaction(e,{maxSupportedTransactionVersion:0,commitment:"confirmed",encoding:"base64"}).send().catch((()=>null));return a?{fee:a.meta?.fee??0n}:null}({solanaClient:A,signature:n.signature});return void N({...n,fees:t?.fee})}N(n)}catch(t){console.warn({transaction:S,error:t}),X(t)}finally{V(!1)}},onClose:ot})}};export{pt as StandardSignAndSendTransactionScreen,pt as default};
1
+ import{jsxs as t,jsx as n,Fragment as e}from"react/jsx-runtime";import{useState as a,useMemo as r,useEffect as o}from"react";import{formatTokenAmount as i}from"@privy-io/js-sdk-core";import{a as s,u as c,j as l,g as d}from"./get-is-unified-wallet-_KIJnP68.mjs";import{u}from"./context-Dee1TPOi.mjs";import{u as m}from"./internal-context-e-Eni5bG.mjs";import{u as p}from"./useGetSolPrice-Cfm8o9C5.mjs";import{ErrorScreenView as f}from"./ErrorScreen-CTI5XNc0.mjs";import g from"@heroicons/react/24/outline/CheckCircleIcon";import{styled as h}from"styled-components";import{P as y}from"./Button-DJY5dut3.mjs";import{R as w}from"./Layouts-Bmf8DxNP.mjs";import{M as k,B as b}from"./ModalHeader-DHXUvTf4.mjs";import{C as v}from"./ScreenHeader-Biz1wq02.mjs";import{a as I,R as A}from"./Row-CG0lSY5Z.mjs";import{L as S,V as j}from"./Value-B4M62ove.mjs";import{S as C,W as T}from"./WalletLink-WAY9-CI0.mjs";import{e as O}from"./StackedContainer-BrIQsdas.mjs";import{Y as x}from"./useActiveWallet-SiVSXkvG.mjs";import{T as $,a as L}from"./TransactionErrorView-DOcJFQEX.mjs";import{g as E}from"./transaction-CnfuREWo.mjs";import{pipe as F,getCompiledTransactionMessageDecoder as _,decompileTransactionMessage as P,setTransactionMessageLifetimeUsingBlockhash as B,compileTransaction as J,getTransactionEncoder as W,getBase58Decoder as D,fetchAddressesForLookupTables as M}from"@solana/kit";import{a as R,f as q,s as U,b as V,u as H}from"./useSolanaRpcClient-DaxiCEwc.mjs";import{D as z,T as N,a as Q,S as X,A as Y,R as G,J as K,g as Z}from"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"viem";import"tinycolor2";import"ofetch";import"lucide-react";import"./index-Dr4t3oWO.mjs";import"uuid";import"jose";import"eventemitter3";import"./useWallets-gElyEQoU.mjs";import"./prepareFundingModalData-BYy0MVol.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Bh4N2Hpm.mjs";import"./events-context-CI0iqAXA.mjs";import"@scure/base";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./getPublicClient-A9RSftUZ.mjs";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./reservoir-kvLjIrEo.mjs";import"./ScreenLayout-BQ6FV6yc.mjs";import"./Screen-CKaxnxac.mjs";import"./index-CJMgUOnw.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"./LoadingSkeleton-CHdaq3pb.mjs";import"./ethers-g3QzXj2h.mjs";import"@heroicons/react/24/outline";import"./ErrorMessage-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Subtitle-DkvfP2Ev.mjs";import"./Title-D0pfZff-.mjs";import"./Address-CDOE2oK9.mjs";import"./WalletInfoCard-C8BrD5jy.mjs";import"./shared-CtYf3O54.mjs";import"./Checkbox-NmGCZeKL.mjs";import"./ErrorBanner-BdiArMwu.mjs";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"./WarningBanner-BDp-QC9i.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/ClipboardDocumentIcon";const tt=/*#__PURE__*/h.span.withConfig({displayName:"CircleBackground",componentId:"sc-c9f33cd-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";background-color:",";border-radius:50%;display:inline-block;box-sizing:border-box;}"],(t=>t.color??"var(--privy-color-accent)"),(t=>t.color??"var(--privy-color-accent)")),nt=({instruction:e,fees:a,transactionInfo:r,solPrice:o,chain:i})=>/*#__PURE__*/t(I,{children:[r?.action&&/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"Action"}),/*#__PURE__*/n(j,{children:r.action})]}),null!=e?.total&&/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"Total"}),/*#__PURE__*/n(j,{children:e.total})]}),!e?.total&&null!=e?.amount&&/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"Total"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(C,{quantities:[e.amount,a],tokenPrice:o})})]}),/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"Fees"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(C,{quantities:[a],tokenPrice:o})})]}),e?.to&&/*#__PURE__*/t(A,{children:[/*#__PURE__*/n(S,{children:"To"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(T,{walletAddress:e.to,chainId:i,chainType:"solana"})})]})]}),et=({fees:a,onClose:r,receiptHeader:o,receiptDescription:i,transactionInfo:s,solPrice:c,signOnly:l,instruction:d,chain:u})=>/*#__PURE__*/t(e,{children:[/*#__PURE__*/n(k,{onClose:r}),/*#__PURE__*/n(O,{style:{marginBottom:"16px"},children:/*#__PURE__*/t("div",{children:[/*#__PURE__*/n(tt,{color:"var(--privy-color-success-light)"}),/*#__PURE__*/n(g,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),/*#__PURE__*/n(v,{title:o??`Transaction ${l?"signed":"complete"}!`,description:i??"You're all set."}),/*#__PURE__*/n(nt,{solPrice:c,instruction:d,fees:a,transactionInfo:s,chain:u}),/*#__PURE__*/n(x,{}),/*#__PURE__*/n(at,{loading:!1,onClick:r,children:"Close"}),/*#__PURE__*/n(w,{}),/*#__PURE__*/n(b,{})]});let at=/*#__PURE__*/h(y).withConfig({displayName:"SubmitButton",componentId:"sc-3cb7ee42-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);async function rt(t,n){try{return await t}catch{return n}}function ot(t){switch(t){case"solana:mainnet":return"mainnet-beta";case"solana:devnet":return"devnet";case"solana:testnet":return"testnet"}}async function it({privyClient:t,chain:n,mint:e}){let a=z[n];if(!a[e]){let r=await t.getSplTokenMetadata({mintAddress:e,cluster:ot(n)});r&&(a[e]={address:e,symbol:r.symbol,decimals:r.decimals})}return a[e]}async function st({tx:t,solanaClient:n,privyClient:e,checkFunds:a}){let r=_().decode(R(t)),o=r.staticAccounts[0]??"",i=await q({solanaClient:n,tx:t}),s=a?await rt(U({solanaClient:n,tx:t})):void 0,c=s?.hasFunds??!0,l={},d=[],u=await async function({solanaClient:t,message:n}){if(!("addressTableLookups"in n)||!n.addressTableLookups)return[...n.staticAccounts];let e=n.addressTableLookups.map((t=>t.lookupTableAddress)),a=await M(e,t.rpc),r=e.map(((t,e)=>[...n.addressTableLookups[e]?.writableIndexes.map((n=>{let r=a[t]?.[n];if(r)return{key:r,isWritable:!0,altIdx:e}}))??[],...n.addressTableLookups[e]?.readonlyIndexes.map((n=>{let r=a[t]?.[n];if(r)return{key:r,isWritable:!1,altIdx:e}}))??[]])).flat().filter((t=>!!t)).sort(((t,n)=>t.isWritable!==n.isWritable?t.isWritable?-1:1:t.altIdx-n.altIdx)).map((({key:t})=>t));return[...n.staticAccounts,...r]}({solanaClient:n,message:r});for(let t of r.instructions){let a=r.staticAccounts[t.programAddressIndex]||"";if(a!==N&&a!==Q)if(a!==X){if(a===Y){let n=await rt(function(t,n,e){let[a,r,o,i]=t.accountIndices?.map((t=>n[t]))??[];return{type:"ata-creation",program:e,payer:a,ata:r,owner:o,mint:i}}(t,u,a));if(!n){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}if(d.push(n),n.ata&&n.owner&&n.mint){l[n.ata]={owner:n.owner,mint:n.mint};continue}}if(G.includes(a)){let r=await rt(ut(t,u,n,e,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r)}else if(K.includes(a)){let r=await rt(mt(t,u,n,e,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r)}else d.push({type:"unknown",program:a,discriminator:t.data?.[0]})}else{let n=await rt(dt(t,u));if(!n){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(n)}else{let r=await rt(lt(t,u,n,e,l,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r),"spl-transfer"===r.type&&(r.fromAta&&r.fromAccount&&r.token.address&&(l[r.fromAta]??={owner:r.fromAccount,mint:r.token.address}),r.toAta&&r.toAccount&&r.token.address&&(l[r.toAta]??={owner:r.toAccount,mint:r.token.address}))}}return{spender:o,fee:i,instructions:d,hasFunds:!!c}}function ct(t,n=0){try{return function(t,n=0){let e=0n;for(let a=0;a<8;a++)e|=BigInt(t[n+a])<<BigInt(8*a);return e}(t,n)}catch{}try{return t.readBigInt64LE(n)}catch{}let e=V(t);try{return((t,n=0)=>{let e=t[n],a=t[n+7];if(!e||!a)throw Error(`Buffer offset out of range: first: ${e}, last: ${a}.`);return(BigInt(t[n+4]+256*t[n+5]+65536*t[n+6]+(a<<24))<<32n)+BigInt(e+256*t[++n]+65536*t[++n]+16777216*t[++n])})(e)}catch{}try{return e.subarray(n).readBigInt64LE()}catch{}try{return e.readBigInt64LE(n)}catch{}return 0n}async function lt(t,n,e,a,r,o){let i=t.data?.[0],s=t.accountIndices?.map((t=>n[t]))??[];if(1===i){let[t,n,e]=s;return{type:"spl-init-account",program:o,account:t,mint:n,owner:e}}if(3===i){let n,i,[c,l,d]=s,u="",m=l?r[l]:void 0;if(m)n=m.owner,u=m.mint;else if(l){let t=await e.rpc.getAccountInfo(l,{commitment:"confirmed",encoding:"jsonParsed"}).send(),a=t.value?.data;n=a?.parsed?.info?.owner,u=a?.parsed?.info?.mint??"",i=a?.parsed?.info?.tokenAmount?.decimals}if(!u&&c){let t=await e.rpc.getAccountInfo(c,{commitment:"confirmed",encoding:"jsonParsed"}).send(),n=t.value?.data;u=n?.parsed?.info?.mint??""}let p=await it({privyClient:a,chain:e.chain,mint:u}),f=p?.symbol??"";return i??=p?.decimals??9,{type:"spl-transfer",program:o,fromAta:c,fromAccount:d,toAta:l,toAccount:n,value:ct(t.data,1),token:{symbol:f,decimals:i,address:u}}}if(9===i){let[t,n,e]=s;return{type:"spl-close-account",program:o,source:t,destination:n,owner:e}}if(17===i)return{type:"spl-sync-native",program:o};throw Error(`Token program instruction type ${i} not supported`)}async function dt(t,n){let e=t.data?.[0],a=t.accountIndices?.map((t=>n[t]))??[];if(0===e){let[,n]=a;return{type:"create-account",program:X,account:n?.toString(),value:ct(t.data,4),withSeed:!1}}if(2===e){let[n,e]=a;return{type:"sol-transfer",program:X,fromAccount:n,toAccount:e,token:{symbol:"SOL",decimals:9},value:ct(t.data,4),withSeed:!1}}if(3===e){let[,n]=a;return{type:"create-account",program:X,account:n,withSeed:!0,value:ct(t.data.slice(t.data.length-32-8-8))}}if(11===e){let[n,e]=a;return{type:"sol-transfer",program:X,fromAccount:n,toAccount:e,value:ct(t.data,4),token:{symbol:"SOL",decimals:9},withSeed:!0}}throw Error(`System program instruction type ${e} not supported`)}async function ut(t,n,e,a,r){let o=t.accountIndices?.map((t=>n[t]))??[],i=t.data?.[0];if(143===i){let n=o[10],i=o[11];return{type:"raydium-swap-base-input",program:r,mintIn:n,mintOut:i,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:i?await it({privyClient:a,chain:e.chain,mint:i}):void 0,amountIn:ct(t.data,8),minimumAmountOut:ct(t.data,16)}}if(55===i){let n=o[10],i=o[11];return{type:"raydium-swap-base-output",program:r,mintIn:n,mintOut:i,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:i?await it({privyClient:a,chain:e.chain,mint:i}):void 0,maxAmountIn:ct(t.data,8),amountOut:ct(t.data,16)}}throw Error(`Raydium swap program instruction type ${i} not supported`)}async function mt(t,n,e,a,r){let o=t.data?.[0],i=t.accountIndices?.map((t=>n[t]))??[];if([208,51,239,151,123,43,237,92].includes(o)){let n=i[5],o=i[6];return{type:"jupiter-swap-exact-out-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,outAmount:ct(t.data,t.data.length-1-2-8-8),quotedInAmount:ct(t.data,t.data.length-1-2-8)}}if([176,209,105,168,154,125,69,62].includes(o)){let n=i[7],o=i[8];return{type:"jupiter-swap-exact-out-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,outAmount:ct(t.data,t.data.length-1-2-8-8),quotedInAmount:ct(t.data,t.data.length-1-2-8)}}if([193,32,155,51,65,214,156,129].includes(o)){let n=i[7],o=i[8];return{type:"jupiter-swap-shared-accounts-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,inAmount:ct(t.data,t.data.length-1-2-8-8),quotedOutAmount:ct(t.data,t.data.length-1-2-8)}}throw[62,198,214,193,213,159,108,210].includes(o)&&console.warn("Jupiter swap program instruction 'claim' not implemented"),[116,206,27,191,166,19,0,73].includes(o)&&console.warn("Jupiter swap program instruction 'claim_token' not implemented"),[26,74,236,151,104,64,183,249].includes(o)&&console.warn("Jupiter swap program instruction 'close_token' not implemented"),[229,194,212,172,8,10,134,147].includes(o)&&console.warn("Jupiter swap program instruction 'create_open_orders' not implemented"),[28,226,32,148,188,136,113,171].includes(o)&&console.warn("Jupiter swap program instruction 'create_program_open_orders' not implemented"),[232,242,197,253,240,143,129,52].includes(o)&&console.warn("Jupiter swap program instruction 'create_token_ledger' not implemented"),[147,241,123,100,244,132,174,118].includes(o)&&console.warn("Jupiter swap program instruction 'create_token_account' not implemented"),[229,23,203,151,122,227,173,42].includes(o)&&console.warn("Jupiter swap program instruction 'route' not implemented"),[150,86,71,116,167,93,14,104].includes(o)&&console.warn("Jupiter swap program instruction 'route_with_token_ledger' not implemented"),[228,85,185,112,78,79,77,2].includes(o)&&console.warn("Jupiter swap program instruction 'set_token_ledger' not implemented"),[230,121,143,80,119,159,106,170].includes(o)&&console.warn("Jupiter swap program instruction 'shared_accounts_route_with_token_ledger' not implemented"),Error(`Jupiter swap program instruction type ${o} not supported`)}const pt={component:()=>{let{data:t,onUserCloseViaDialogOrKeybindRef:e,setModalData:g,navigate:h}=s(),{client:y,closePrivyModal:w,walletProxy:k,showFiatPrices:b}=m(),v=u(),{user:I}=c(),A=H()(t?.standardSignAndSendTransaction?.chain??"solana:mainnet"),[S,j]=a(t?.standardSignAndSendTransaction?.transaction),[C,T]=a(),[O,x]=a(),[M,q]=a({value:0n,isLoading:!1}),[U,V]=a(!1),[z,N]=a({}),[Q,X]=a(),Y=t?.standardSignAndSendTransaction?.account,G=!!t?.standardSignAndSendTransaction?.signOnly,K=Y?.imported?l(I).find((t=>t.address===Y.address)):d(I),{solPrice:tt,isSolPriceLoading:nt}=p({enabled:b}),at=r((()=>{if(!C)return;let t=C.spender,n=E(C.fee),e=E(M.value,3,!0),a=C.instructions.filter((t=>["sol-transfer","spl-transfer","raydium-swap-base-input","raydium-swap-base-output","jupiter-swap-shared-accounts-route","jupiter-swap-exact-out-route"].includes(t.type))),r=a.at(0);if(!r||a.length>1)return{fee:n,spender:t,balance:e};if("sol-transfer"===r.type)return{fee:n,spender:t,balance:e,total:E(r.value)};if("spl-transfer"===r.type)return{fee:n,spender:t,balance:e,total:`${i({amount:r.value,decimals:r.token.decimals})} ${r.token.symbol}`};if("raydium-swap-base-input"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.amountIn,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.minimumAmountOut,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("raydium-swap-base-output"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.maxAmountIn,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.amountOut,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("jupiter-swap-shared-accounts-route"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.inAmount,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.quotedOutAmount,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("jupiter-swap-exact-out-route"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.quotedInAmount,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.outAmount,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}return{fee:n,spender:t,balance:e}}),[C,Y?.address,M]),rt=r((()=>{let t;if(!C||!b||!tt||nt)return;function n(...t){return Z(t.reduce(((t,n)=>t+n),0n),tt??0)}Y?.address===C.spender&&(t=n(C.fee));let e=n(M.value),a=C.instructions.filter((t=>"sol-transfer"===t.type||"spl-transfer"===t.type)).at(0);return!a||C.instructions.length>1?{fee:t,balance:e}:"sol-transfer"===a.type?{fee:t,balance:e,total:n(a.value,Y?.address===C.spender?C.fee:0n)}:"spl-transfer"===a.type?{fee:t,balance:e,total:`${i({amount:a.value,decimals:a.token.decimals})} ${a.token.symbol}`}:{fee:t,balance:e}}),[C,b,tt,nt,Y?.address,M]);if(o((()=>{!async function(){if(S&&y)try{x(void 0);let t=await st({tx:S,solanaClient:A,privyClient:y,checkFunds:!G});T(t)}catch(t){console.error("Failed to prepare transaction",t),x(t)}}()}),[S,A,y,G]),o((()=>{(async function(){if(!Y)return;q({value:M.value,isLoading:!0});let{value:t}=await A.rpc.getBalance(Y.address,{commitment:"confirmed"}).send();q({value:t??0n,isLoading:!1})})().catch(console.error)}),[C]),!S||!t?.standardSignAndSendTransaction||!Y){let e=Error("Invalid transaction request");/*#__PURE__*/return n(f,{error:e,allowlistConfig:v.allowlistConfig,onRetry:()=>{t?.standardSignAndSendTransaction?.onFailure(e),w({shouldCallAuthOnSuccess:!1})}})}let ot=()=>{if(!U)return z.signature||z.signedTransaction?t?.standardSignAndSendTransaction?.onSuccess({signature:z.signature,signedTransaction:z.signedTransaction}):t?.standardSignAndSendTransaction?.onFailure(Q??O??Error("User exited the modal before submitting the transaction")),w({shouldCallAuthOnSuccess:!1})};e.current=ot;let it=t.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?/*#__PURE__*/n("img",{src:t.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:t.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,ct=!!(t.funding&&t.funding.supportedOptions.length>0),lt=!C?.hasFunds&&ct;if(z.signature||z.signedTransaction){let e=C?.instructions.filter((t=>"sol-transfer"===t.type||"spl-transfer"===t.type)),a=1===e?.length?e?.at(0):void 0;/*#__PURE__*/return n(et,{fees:z.fees??0n,onClose:ot,transactionInfo:t.standardSignAndSendTransaction?.uiOptions.transactionInfo,solPrice:tt,receiptHeader:t.standardSignAndSendTransaction?.uiOptions.successHeader,receiptDescription:t.standardSignAndSendTransaction?.uiOptions.successDescription,chain:A.chain,signOnly:G,instruction:"sol-transfer"===a?.type?{to:a.toAccount,amount:a.value}:{to:a?.toAccount||a?.toAta,total:at?.total}})}return Q?/*#__PURE__*/n($,{transactionError:Q,chainId:A.chain,onClose:ot,chainType:"solana",onRetry:async()=>{X(void 0);let{value:t}=await A.rpc.getLatestBlockhash().send();var n,e;j((n=S,e=t,F(_().decode(R(n)),(t=>P(t)),(t=>B(e,t)),(t=>J(t)),(t=>new Uint8Array(W().encode(t))))))}}):/*#__PURE__*/n(L,{img:it,title:t.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.title||"Confirm transaction",subtitle:t.standardSignAndSendTransaction?.uiOptions?.description||`${v.name} wants your permission to approve the following transaction.`,cta:lt?"Add funds":t.standardSignAndSendTransaction?.uiOptions?.buttonText||"Approve",instructions:C?.instructions??[],network:"solana:mainnet"==A.chain?"Solana":A.chain.replace("solana:",""),blockExplorerUrl:A.blockExplorerUrl,total:b?rt?.total:at?.total,fee:b?rt?.fee:at?.fee,balance:b?rt?.balance:at?.balance,swap:at?.swap,transactingWalletAddress:Y.address,disabled:!C?.hasFunds&&!ct,isSubmitting:U,isPreparing:!C||M.isLoading,isTokenPriceLoading:b&&nt,isMissingFunds:!C?.hasFunds,submitError:Q??void 0,isSponsored:!!t.standardSignAndSendTransaction?.isSponsored,parseError:O,onClick:lt?async()=>{if(!Y)return;if(!ct)throw Error("Funding wallet is not enabled");let n="FundingMethodSelectionScreen";g({...t,funding:{...t.funding,methodScreen:n},solanaFundingData:t?.solanaFundingData}),h(n)}:async()=>{try{if(V(!0),U||!Y||!k||!I||!K)return;let n=await t.standardSignAndSendTransaction.onConfirm(S);if("signature"in n){let t=await async function({solanaClient:t,signature:n}){let e=D().decode(n),a=await t.rpc.getTransaction(e,{maxSupportedTransactionVersion:0,commitment:"confirmed",encoding:"base64"}).send().catch((()=>null));return a?{fee:a.meta?.fee??0n}:null}({solanaClient:A,signature:n.signature});return void N({...n,fees:t?.fee})}N(n)}catch(t){console.warn({transaction:S,error:t}),X(t)}finally{V(!1)}},onClose:ot})}};export{pt as StandardSignAndSendTransactionScreen,pt as default};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as r}from"react";import{a as o,q as i,C as a}from"./index-CCrVHfyv.mjs";import{u as s,q as n}from"./context-B4VZqX5H.mjs";import{u as m,b as l,j as c}from"./internal-context-DLZicboG.mjs";import{u as d,a as u}from"./get-is-unified-wallet-DXko-EzF.mjs";import{s as p}from"./shouldProceedtoEmbeddedWalletCreationFlow-DVwf2mAj.mjs";import{S as g}from"./ScreenLayout-pthdsODa.mjs";import{T as v}from"./telegram-B-JqnkqZ.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-Bj-s666H.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-BSIhOAz8.mjs";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-BMn1PaPp.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-J1po7l19.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"tinycolor2";import"./Button-OlK_6fKk.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const 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})},h={component:()=>{let{authenticated:g,logout:v,ready:h,user:f}=d(),{setModalData:A,navigate:j,resetNavigation:b,data:T}=u(),S=s(),{initLoginWithTelegram:C,loginWithTelegram:w,updateWallets:E,setReadyToTrue:R,closePrivyModal:W,createAnalyticsEvent:_,getAuthMeta:M}=m(),[L,k]=t(!1),[I,x]=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,l.CAPTCHA_FAILURE);return D.enabled&&"success"!==D.status&&(D.execute(),e=await D.waitForResult()),e}}();await w({captchaToken:e}),k(!0),R(!0)}catch(e){if(e?.privyErrorCode===l.ALLOWLIST_REJECTED)return x(void 0),b(),void j("AllowlistRejectionScreen");if(e?.privyErrorCode===l.USER_LIMIT_REACHED)return console.error(new c(e).toString()),x(void 0),b(),void j("UserLimitReachedScreen");if(e?.privyErrorCode===l.USER_DOES_NOT_EXIST)return x(void 0),b(),void j("AccountNotFoundScreen");if(e?.privyErrorCode===l.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return x(void 0),b(),A({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,telegramAuthResult:M()?.telegramAuthResult,telegramWebAppData:M()?.telegramWebAppData,displayName:e.data?.data?.account?.displayName,linkMethod:"telegram",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void j("LinkConflictScreen");let{retryable:t,detail:r}=i(e);x({retryable:t,detail:r,message:"Authentication failed"})}}r((()=>{U()}),[]),r((()=>{if(!(h&&g&&L&&f))return;if(S?.legal.requireUsersAcceptTerms&&!f.hasAcceptedTerms){let e=setTimeout((()=>{j("AffirmativeConsentScreen")}),n);return()=>clearTimeout(e)}if(p(f,S.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}}),j("EmbeddedWalletOnAccountCreateScreen")}),n);return()=>clearTimeout(e)}E();let e=setTimeout((()=>W({shouldCallAuthOnSuccess:!0,isSuccess:!0})),n);return()=>clearTimeout(e)}),[h,g,L,f]);/*#__PURE__*/return e(y,{success:L,errorMessage:I,onRetry:I?.retryable?async()=>{try{x(void 0),T?.telegramAuthModalData?.seamlessAuth||await C(void 0,T?.login?.disableSignup),await U()}catch(e){let{retryable:t,detail:r}=i(e);x({retryable:t,detail:r,message:"Authentication failed"})}}:void 0})},isCaptchaRequired:!0,isShownBeforeReady:!0};export{h as TelegramAuthScreen,y as TelegramAuthScreenView,h as default};
1
+ import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as r}from"react";import{a as o,q as i,C as a}from"./index-Dr4t3oWO.mjs";import{u as s,q as n}from"./context-Dee1TPOi.mjs";import{u as m,b as l,k as c}from"./internal-context-e-Eni5bG.mjs";import{u as d,a as u}from"./get-is-unified-wallet-_KIJnP68.mjs";import{s as p}from"./shouldProceedtoEmbeddedWalletCreationFlow-iMnL58wW.mjs";import{S as g}from"./ScreenLayout-BQ6FV6yc.mjs";import{T as v}from"./telegram-B-JqnkqZ.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-SiVSXkvG.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-BYy0MVol.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-gElyEQoU.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Bh4N2Hpm.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"tinycolor2";import"./Button-DJY5dut3.mjs";import"./Screen-CKaxnxac.mjs";import"./ModalHeader-DHXUvTf4.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const y=({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})},h={component:()=>{let{authenticated:g,logout:v,ready:h,user:f}=d(),{setModalData:A,navigate:b,resetNavigation:j,data:T}=u(),S=s(),{initLoginWithTelegram:C,loginWithTelegram:w,updateWallets:E,setReadyToTrue:R,closePrivyModal:W,createAnalyticsEvent:_,getAuthMeta:M}=m(),[k,L]=t(!1),[I,x]=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,l.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===l.ALLOWLIST_REJECTED)return x(void 0),j(),void b("AllowlistRejectionScreen");if(e?.privyErrorCode===l.USER_LIMIT_REACHED)return console.error(new c(e).toString()),x(void 0),j(),void b("UserLimitReachedScreen");if(e?.privyErrorCode===l.USER_DOES_NOT_EXIST)return x(void 0),j(),void b("AccountNotFoundScreen");if(e?.privyErrorCode===l.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return x(void 0),j(),A({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,telegramAuthResult:M()?.telegramAuthResult,telegramWebAppData:M()?.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);x({retryable:t,detail:r,message:"Authentication failed"})}}r((()=>{U()}),[]),r((()=>{if(!(h&&g&&k&&f))return;if(S?.legal.requireUsersAcceptTerms&&!f.hasAcceptedTerms){let e=setTimeout((()=>{b("AffirmativeConsentScreen")}),n);return()=>clearTimeout(e)}if(p(f,S.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)}),[h,g,k,f]);/*#__PURE__*/return e(y,{success:k,errorMessage:I,onRetry:I?.retryable?async()=>{try{x(void 0),T?.telegramAuthModalData?.seamlessAuth||await C(void 0,T?.login?.disableSignup),await U()}catch(e){let{retryable:t,detail:r}=i(e);x({retryable:t,detail:r,message:"Authentication failed"})}}:void 0})},isCaptchaRequired:!0,isShownBeforeReady:!0};export{h as TelegramAuthScreen,y as TelegramAuthScreenView,h as default};
@@ -1,3 +1,3 @@
1
- import{jsxs as e,jsx as i,Fragment as n}from"react/jsx-runtime";import{styled as t}from"styled-components";import{P as o,H as r,W as l}from"./WalletLink-D2x4SkPO.mjs";import{g as d}from"./ethers-oRuqwv5W.mjs";import{F as a}from"./Layouts-Bmf8DxNP.mjs";import c from"@heroicons/react/24/outline/ChevronDownIcon";import{createContext as s,useState as p,useContext as h}from"react";import{s as f,u as g}from"./context-B4VZqX5H.mjs";const m=({label:n,children:t,valueStyles:o})=>/*#__PURE__*/e(v,{children:[/*#__PURE__*/i("div",{children:n}),/*#__PURE__*/i(u,{style:{...o},children:t})]});let v=/*#__PURE__*/t.div.withConfig({displayName:"StyledDetailsRow",componentId:"sc-4ebfdd45-0"})(["display:flex;align-items:center;justify-content:space-between;width:100%;> :first-child{color:var(--privy-color-foreground-3);text-align:left;}> :last-child{color:var(--privy-color-foreground-2);text-align:right;}"]),u=/*#__PURE__*/t.div.withConfig({displayName:"ValueWrapper",componentId:"sc-4ebfdd45-1"})(["font-size:14px;line-height:100%;display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-full);background-color:var(--privy-color-background-2);padding:4px 8px;"]);const y=({gas:n,tokenPrice:t,tokenSymbol:r})=>/*#__PURE__*/e(a,{style:{paddingBottom:"12px"},children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/i(I,{children:"Est. Fees"}),/*#__PURE__*/i("div",{children:/*#__PURE__*/i(o,{weiQuantities:[BigInt(n)],tokenPrice:t,tokenSymbol:r})})]}),t&&/*#__PURE__*/i(b,{children:`${d(BigInt(n),r)}`})]}),x=({value:n,gas:t,tokenPrice:r,tokenSymbol:l})=>{let c=BigInt(n??0)+BigInt(t);/*#__PURE__*/return e(a,{children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/i(I,{children:"Total (including fees)"}),/*#__PURE__*/i("div",{children:/*#__PURE__*/i(o,{weiQuantities:[BigInt(n||0),BigInt(t)],tokenPrice:r,tokenSymbol:l})})]}),r&&/*#__PURE__*/i(b,{children:d(c,l)})]})};let w=/*#__PURE__*/t.div.withConfig({displayName:"TransactionTotalRow",componentId:"sc-f8ef9b74-0"})(["display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-top:4px;"]),b=/*#__PURE__*/t.div.withConfig({displayName:"ValueConversionRow",componentId:"sc-f8ef9b74-1"})(["display:flex;flex-direction:row;height:12px;font-size:12px;line-height:12px;color:var(--privy-color-foreground-3);font-weight:400;"]),I=/*#__PURE__*/t.div.withConfig({displayName:"TotalText",componentId:"sc-f8ef9b74-2"})(["font-size:14px;line-height:22.4px;font-weight:400;"]);const C=/*#__PURE__*/s(void 0),k=/*#__PURE__*/s(void 0),P=({defaultValue:e,children:n})=>{let[t,o]=p(e||null);/*#__PURE__*/return i(C.Provider,{value:{activePanel:t,togglePanel:e=>{o(t===e?null:e)}},children:/*#__PURE__*/i(j,{children:n})})},T=({value:e,children:n})=>{let{activePanel:t,togglePanel:o}=h(C),r=t===e;/*#__PURE__*/return i(k.Provider,{value:{onToggle:()=>o(e),value:e},children:/*#__PURE__*/i(D,{isActive:r?"true":"false","data-open":String(r),children:n})})},N=({children:t})=>{let{activePanel:o}=h(C),{onToggle:r,value:l}=h(k),d=o===l;/*#__PURE__*/
1
+ import{jsxs as e,jsx as i,Fragment as n}from"react/jsx-runtime";import{styled as t}from"styled-components";import{P as o,H as r,W as l}from"./WalletLink-WAY9-CI0.mjs";import{g as d}from"./ethers-g3QzXj2h.mjs";import{F as a}from"./Layouts-Bmf8DxNP.mjs";import c from"@heroicons/react/24/outline/ChevronDownIcon";import{createContext as s,useState as p,useContext as h}from"react";import{s as f,u as g}from"./context-Dee1TPOi.mjs";const m=({label:n,children:t,valueStyles:o})=>/*#__PURE__*/e(v,{children:[/*#__PURE__*/i("div",{children:n}),/*#__PURE__*/i(u,{style:{...o},children:t})]});let v=/*#__PURE__*/t.div.withConfig({displayName:"StyledDetailsRow",componentId:"sc-4ebfdd45-0"})(["display:flex;align-items:center;justify-content:space-between;width:100%;> :first-child{color:var(--privy-color-foreground-3);text-align:left;}> :last-child{color:var(--privy-color-foreground-2);text-align:right;}"]),u=/*#__PURE__*/t.div.withConfig({displayName:"ValueWrapper",componentId:"sc-4ebfdd45-1"})(["font-size:14px;line-height:100%;display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-full);background-color:var(--privy-color-background-2);padding:4px 8px;"]);const y=({gas:n,tokenPrice:t,tokenSymbol:r})=>/*#__PURE__*/e(a,{style:{paddingBottom:"12px"},children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/i(I,{children:"Est. Fees"}),/*#__PURE__*/i("div",{children:/*#__PURE__*/i(o,{weiQuantities:[BigInt(n)],tokenPrice:t,tokenSymbol:r})})]}),t&&/*#__PURE__*/i(b,{children:`${d(BigInt(n),r)}`})]}),x=({value:n,gas:t,tokenPrice:r,tokenSymbol:l})=>{let c=BigInt(n??0)+BigInt(t);/*#__PURE__*/return e(a,{children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/i(I,{children:"Total (including fees)"}),/*#__PURE__*/i("div",{children:/*#__PURE__*/i(o,{weiQuantities:[BigInt(n||0),BigInt(t)],tokenPrice:r,tokenSymbol:l})})]}),r&&/*#__PURE__*/i(b,{children:d(c,l)})]})};let w=/*#__PURE__*/t.div.withConfig({displayName:"TransactionTotalRow",componentId:"sc-f8ef9b74-0"})(["display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-top:4px;"]),b=/*#__PURE__*/t.div.withConfig({displayName:"ValueConversionRow",componentId:"sc-f8ef9b74-1"})(["display:flex;flex-direction:row;height:12px;font-size:12px;line-height:12px;color:var(--privy-color-foreground-3);font-weight:400;"]),I=/*#__PURE__*/t.div.withConfig({displayName:"TotalText",componentId:"sc-f8ef9b74-2"})(["font-size:14px;line-height:22.4px;font-weight:400;"]);const C=/*#__PURE__*/s(void 0),k=/*#__PURE__*/s(void 0),P=({defaultValue:e,children:n})=>{let[t,o]=p(e||null);/*#__PURE__*/return i(C.Provider,{value:{activePanel:t,togglePanel:e=>{o(t===e?null:e)}},children:/*#__PURE__*/i(j,{children:n})})},T=({value:e,children:n})=>{let{activePanel:t,togglePanel:o}=h(C),r=t===e;/*#__PURE__*/return i(k.Provider,{value:{onToggle:()=>o(e),value:e},children:/*#__PURE__*/i(D,{isActive:r?"true":"false","data-open":String(r),children:n})})},N=({children:t})=>{let{activePanel:o}=h(C),{onToggle:r,value:l}=h(k),d=o===l;/*#__PURE__*/
2
2
  return e(n,{children:[/*#__PURE__*/e(B,{onClick:r,"data-open":String(d),children:[/*#__PURE__*/i(z,{children:t}),/*#__PURE__*/i(V,{isactive:d?"true":"false",children:/*#__PURE__*/i(c,{height:"16px",width:"16px",strokeWidth:"2"})})]}),/*#__PURE__*/i(W,{})]})},S=({children:e})=>{let{activePanel:n}=h(C),{value:t}=h(k);/*#__PURE__*/return i(F,{"data-open":String(n===t),children:/*#__PURE__*/i(R,{children:e})})},A=({children:e})=>{let{activePanel:n}=h(C),{value:t}=h(k);/*#__PURE__*/return i(R,{children:"function"==typeof e?e({isActive:n===t}):e})};let j=/*#__PURE__*/t.div.withConfig({displayName:"AccordionRoot",componentId:"sc-d25f9267-0"})(["display:flex;flex-direction:column;width:100%;gap:8px;"]),B=/*#__PURE__*/t.div.withConfig({displayName:"AccordionTriggerContainer",componentId:"sc-d25f9267-1"})(["display:flex;justify-content:space-between;align-items:center;width:100%;cursor:pointer;padding-bottom:8px;"]),W=/*#__PURE__*/t.div.withConfig({displayName:"AccordionDivider",componentId:"sc-d25f9267-2"})(["width:100%;&&{border-top:1px solid;border-color:var(--privy-color-foreground-4);}padding-bottom:12px;"]),z=/*#__PURE__*/t.div.withConfig({displayName:"AccordionTriggerContent",componentId:"sc-d25f9267-3"})(["font-size:14px;font-weight:500;line-height:19.6px;width:100%;padding-right:8px;"]),D=/*#__PURE__*/t.div.withConfig({displayName:"AccordionPanelContainer",componentId:"sc-d25f9267-4"})(["display:flex;flex-direction:column;width:100%;overflow:hidden;padding:12px;&&{border:1px solid;border-color:var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);}"]),F=/*#__PURE__*/t.div.withConfig({displayName:"AccordionContentContainer",componentId:"sc-d25f9267-5"})(["position:relative;overflow:hidden;transition:max-height 25ms ease-out;&[data-open='true']{max-height:700px;}&[data-open='false']{max-height:0;}"]),R=/*#__PURE__*/t.div.withConfig({displayName:"ContentWrapper",componentId:"sc-d25f9267-6"})(["display:flex;flex-direction:column;gap:12px;flex:1 1 auto;min-height:1px;"]),V=/*#__PURE__*/t.div.withConfig({displayName:"IconWrapper",componentId:"sc-d25f9267-7"})(["transform:",";"],(e=>"true"===e.isactive?"rotate(180deg)":"rotate(0deg)"));const Q=({from:n,to:t,txn:o,transactionInfo:d,tokenPrice:a,gas:c,tokenSymbol:s})=>{let p=BigInt(o?.value||0);/*#__PURE__*/
3
3
  return i(P,{...g().render.standalone?{defaultValue:"details"}:{},children:/*#__PURE__*/e(T,{value:"details",children:[/*#__PURE__*/i(N,{children:/*#__PURE__*/e(L,{children:[/*#__PURE__*/i("div",{children:d?.title||"Details"}),/*#__PURE__*/i(E,{children:/*#__PURE__*/i(r,{weiQuantities:[p],tokenPrice:a,tokenSymbol:s})})]})}),/*#__PURE__*/e(S,{children:[/*#__PURE__*/i(m,{label:"From",children:/*#__PURE__*/i(l,{walletAddress:n,chainId:o.chainId||f,chainType:"ethereum"})}),/*#__PURE__*/i(m,{label:"To",children:/*#__PURE__*/i(l,{walletAddress:t,chainId:o.chainId||f,chainType:"ethereum"})}),d&&d.action&&/*#__PURE__*/i(m,{label:"Action",children:d.action}),c&&/*#__PURE__*/i(y,{value:o.value,gas:c,tokenPrice:a,tokenSymbol:s})]}),/*#__PURE__*/i(A,{children:({isActive:e})=>/*#__PURE__*/i(x,{value:o.value,displayFee:e,gas:c||"0x0",tokenPrice:a,tokenSymbol:s})})]})})};let L=/*#__PURE__*/t.div.withConfig({displayName:"AccordionTriggerContent",componentId:"sc-2eff9f5c-0"})(["display:flex;flex-direction:row;justify-content:space-between;"]),E=/*#__PURE__*/t.div.withConfig({displayName:"TotalText",componentId:"sc-2eff9f5c-1"})(["flex-shrink:0;padding-left:8px;"]);export{Q as T};
@@ -1,2 +1,2 @@
1
- import{jsx as e,jsxs as n,Fragment as r}from"react/jsx-runtime";import{BoltIcon as i,ArrowRightIcon as o,ChevronDownIcon as t}from"@heroicons/react/24/outline";import{useState as a}from"react";import{styled as l}from"styled-components";import{formatTokenAmount as c}from"@privy-io/js-sdk-core";import{P as d,E as s}from"./Button-OlK_6fKk.mjs";import{M as h,B as m,a as p}from"./ModalHeader-CxHK1IKF.mjs";import{L as u,V as f,a as g}from"./Value-B4M62ove.mjs";import{a as y,R as b}from"./Row-CG0lSY5Z.mjs";import{E as x}from"./ErrorMessage-Cx8GKGhL.mjs";import{L as k}from"./LabelXs-BOisBtqT.mjs";import{S as w}from"./Subtitle-DkvfP2Ev.mjs";import{T as v}from"./Title-D0pfZff-.mjs";import{A as I}from"./Address-C1iw9r70.mjs";import{W as C}from"./WalletInfoCard-DmIqX_B8.mjs";import{u as T}from"./context-B4VZqX5H.mjs";import{Y as S}from"./useActiveWallet-Bj-s666H.mjs";import{L as N}from"./LoadingSkeleton-CHdaq3pb.mjs";import{isAddress as A}from"viem";import{B as j}from"./shared-CtYf3O54.mjs";import{C as E}from"./Checkbox-NmGCZeKL.mjs";import{E as M}from"./ErrorBanner-BdiArMwu.mjs";import{W as $}from"./WarningBanner-BDp-QC9i.mjs";import O from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import D from"@heroicons/react/24/outline/ClipboardDocumentIcon";import F from"@heroicons/react/24/outline/ExclamationCircleIcon";import{u as L}from"./internal-context-DLZicboG.mjs";const B=/*#__PURE__*/l(u).withConfig({displayName:"InteractiveLabel",componentId:"sc-b57d0824-0"})(["cursor:pointer;display:inline-flex;gap:8px;align-items:center;color:var(--privy-color-accent);svg{fill:var(--privy-color-accent);}"]);var P=({iconUrl:r,value:i,symbol:o,usdValue:t,nftName:a,nftCount:l,decimals:c,$isLoading:d})=>{if(d)/*#__PURE__*/return e(R,{$isLoading:d});let s=i&&t&&c?function(e,n,r){let i=parseFloat(e),o=parseFloat(r);if(0===i||0===o||Number.isNaN(i)||Number.isNaN(o))return e;let t=Math.ceil(-Math.log10(.01/(o/i))),a=Math.pow(10,t=Math.max(t=Math.min(t,n),1)),l=+(Math.floor(i*a)/a).toFixed(t).replace(/\.?0+$/,"");return Intl.NumberFormat(void 0,{maximumFractionDigits:n}).format(l)}(i,c,t):i;/*#__PURE__*/return n("div",{children:[/*#__PURE__*/n(R,{$isLoading:d,children:[r&&/*#__PURE__*/e(z,{src:r,alt:"Token icon"}),l&&l>1?l+"x":void 0," ",a,s," ",o]}),t&&/*#__PURE__*/n(W,{$isLoading:d,children:["$",t]})]})};let R=/*#__PURE__*/l.span.withConfig({displayName:"Value",componentId:"sc-991db279-0"})(["color:var(--privy-color-foreground);font-size:0.875rem;font-weight:500;line-height:1.375rem;word-break:break-all;text-align:right;display:flex;justify-content:flex-end;",""],N);const W=/*#__PURE__*/l.span.withConfig({displayName:"Subvalue",componentId:"sc-991db279-1"})(["color:var(--privy-color-foreground-2);font-size:12px;font-weight:400;line-height:18px;word-break:break-all;text-align:right;display:flex;justify-content:flex-end;",""],N);let z=/*#__PURE__*/l.img.withConfig({displayName:"TokenIcon",componentId:"sc-991db279-2"})(["height:14px;width:14px;margin-right:4px;object-fit:contain;"]);const V=i=>{let{chain:o,transactionDetails:t,isTokenContractInfoLoading:a,symbol:l}=i,{action:c,functionName:d}=t;/*#__PURE__*/return e(j,{children:/*#__PURE__*/n(y,{children:["transaction"!==c&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Action"}),/*#__PURE__*/e(f,{children:d})]}),"mint"===d&&"args"in t&&t.args.filter((e=>e)).map(((r,i)=>/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:`Param ${i}`}),/*#__PURE__*/e(f,{children:"string"==typeof r&&A(r)?/*#__PURE__*/e(I,{address:r,url:o?.blockExplorers?.default?.url,showCopyIcon:!1}):r?.toString()})]},i))),"setApprovalForAll"===d&&t.operator&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Operator"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.operator,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),"setApprovalForAll"===d&&void 0!==t.approved&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Set approval to"}),/*#__PURE__*/e(f,{children:t.approved?"true":"false"})]}),"transfer"===d||"transferFrom"===d||"safeTransferFrom"===d||"approve"===d?/*#__PURE__*/n(r,{children:["formattedAmount"in t&&t.formattedAmount&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/n(f,{$isLoading:a,children:[t.formattedAmount," ",l]})]}),"tokenId"in t&&t.tokenId&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token ID"}),/*#__PURE__*/e(f,{children:t.tokenId.toString()})]})]}):null,"safeBatchTransferFrom"===d&&/*#__PURE__*/n(r,{children:["amounts"in t&&t.amounts&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amounts"}),/*#__PURE__*/e(f,{children:t.amounts.join(", ")})]}),"tokenIds"in t&&t.tokenIds&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token IDs"}),/*#__PURE__*/e(f,{children:t.tokenIds.join(", ")})]})]}),"approve"===d&&t.spender&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Spender"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.spender,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===d||"safeTransferFrom"===d||"safeBatchTransferFrom"===d)&&t.transferFrom&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Transferring from"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.transferFrom,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===d||"safeTransferFrom"===d||"safeBatchTransferFrom"===d)&&t.transferTo&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Transferring to"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.transferTo,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]})]})})},H=({variant:i,setPreventMaliciousTransaction:o,colorScheme:t="light",preventMaliciousTransaction:a})=>"warn"===i?/*#__PURE__*/e(U,{children:/*#__PURE__*/n($,{theme:t,children:[/*#__PURE__*/e("span",{style:{fontWeight:"500"},children:"Warning: Suspicious transaction"}),/*#__PURE__*/e("br",{}),"This has been flagged as a potentially deceptive request. Approving could put your assets or funds at risk."]})}):"error"===i?/*#__PURE__*/e(r,{children:/*#__PURE__*/n(U,{children:[/*#__PURE__*/e(M,{theme:t,children:/*#__PURE__*/n("div",{children:[/*#__PURE__*/e("strong",{children:"This is a malicious transaction"}),/*#__PURE__*/e("br",{}),"This transaction transfers tokens to a known malicious address. Proceeding may result in the loss of valuable assets."]})}),/*#__PURE__*/n(q,{children:[/*#__PURE__*/e(E,{color:"var(--privy-color-error)",checked:!a,readOnly:!0,onClick:()=>o(!a)}),/*#__PURE__*/e("span",{children:"I understand and want to proceed anyways."})]})]})}):null;let U=/*#__PURE__*/l.div.withConfig({displayName:"BannerContainer",componentId:"sc-ab8a5a0b-0"})(["margin-top:1.5rem;"]),q=/*#__PURE__*/l.div.withConfig({displayName:"CheckboxContainer",componentId:"sc-ab8a5a0b-1"})(["display:flex;align-items:center;gap:0.5rem;margin-top:0.75rem;"]);const J=({transactionIndex:e,maxIndex:n})=>"number"!=typeof e||0===n?"":` (${e+1} / ${n+1})`,Q=({img:l,submitError:c,prepareError:p,onClose:k,action:C,title:N,subtitle:A,to:j,tokenAddress:E,network:M,missingFunds:$,fee:O,from:D,cta:F,disabled:L,chain:R,isSubmitting:W,isPreparing:z,isTokenPriceLoading:U,isTokenContractInfoLoading:q,isSponsored:Q,symbol:Y,balance:G,onClick:ne,transactionDetails:re,transactionIndex:ie,maxIndex:oe,onBack:te,chainName:ae,validation:le,hasScanDetails:ce,setIsScanDetailsOpen:de,preventMaliciousTransaction:se,setPreventMaliciousTransaction:he,tokensSent:me,tokensReceived:pe,isScanning:ue,isCancellable:fe,functionName:ge})=>{let{showTransactionDetails:ye,setShowTransactionDetails:be,hasMoreDetails:xe,isErc20Ish:ke}=(e=>{let[n,r]=a(!1),i=!0,o=!1;return(!e||e.isErc20Ish||"transaction"===e.action)&&(i=!1),i&&(o=Object.entries(e||{}).some((([e,n])=>n&&!["action","isErc20Ish","isNFTIsh"].includes(e)))),{showTransactionDetails:n,setShowTransactionDetails:r,hasMoreDetails:i&&o,isErc20Ish:e?.isErc20Ish}})(re),we=T(),ve=ke&&q||z||U||ue;/*#__PURE__*/return n(r,{children:[/*#__PURE__*/e(h,{onClose:k,backFn:te}),l&&/*#__PURE__*/e(Z,{children:l}),/*#__PURE__*/n(v,{style:{marginTop:l?"1.5rem":0},children:[N,/*#__PURE__*/e(J,{maxIndex:oe,transactionIndex:ie})]}),/*#__PURE__*/e(w,{children:A}),/*#__PURE__*/n(y,{style:{marginTop:"2rem"},children:[(!!me[0]||ve)&&/*#__PURE__*/n(b,{children:[pe.length>0?/*#__PURE__*/e(u,{children:"Send"}):/*#__PURE__*/e(u,{children:"approve"===C?"Approval amount":"Amount"}),/*#__PURE__*/e("div",{className:"flex flex-col",children:me.map(((n,r)=>/*#__PURE__*/e(P,{iconUrl:n.iconUrl,value:"setApprovalForAll"===ge?"All":n.value,usdValue:n.usdValue,symbol:n.symbol,nftName:n.nftName,nftCount:n.nftCount,decimals:n.decimals},r)))})]}),pe.length>0&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Receive"}),/*#__PURE__*/e("div",{className:"flex flex-col",children:pe.map(((n,r)=>/*#__PURE__*/e(P,{iconUrl:n.iconUrl,value:n.value,usdValue:n.usdValue,symbol:n.symbol,nftName:n.nftName,nftCount:n.nftCount,decimals:n.decimals},r)))})]}),re&&"spender"in re&&re?.spender?/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Spender"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:re.spender,url:R?.blockExplorers?.default?.url})})]}):null,j&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"To"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:j,url:R?.blockExplorers?.default?.url,showCopyIcon:!0})})]}),E&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token address"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:E,url:R?.blockExplorers?.default?.url})})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Network"}),/*#__PURE__*/e(f,{children:M})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Estimated fee"}),/*#__PURE__*/e(f,{$isLoading:z||U||void 0===Q,children:Q?/*#__PURE__*/n(_,{children:[/*#__PURE__*/n(ee,{children:["Sponsored by ",we.name]}),/*#__PURE__*/e(i,{height:16,width:16})]}):O})]}),xe&&!ce&&/*#__PURE__*/n(r,{children:[/*#__PURE__*/e(b,{className:"cursor-pointer",onClick:()=>be(!ye),children:/*#__PURE__*/n(g,{className:"flex items-center gap-x-1",children:["Details"," ",/*#__PURE__*/e(t,{style:{width:"0.75rem",marginLeft:"0.25rem",transform:ye?"rotate(180deg)":void 0}})]})}),ye&&re&&/*#__PURE__*/e(V,{action:C,chain:R,transactionDetails:re,isTokenContractInfoLoading:q,symbol:Y})]}),ce&&/*#__PURE__*/e(b,{children:/*#__PURE__*/n(B,{onClick:()=>de(!0),children:[/*#__PURE__*/e("span",{className:"text-color-primary",children:"Details"}),/*#__PURE__*/e(o,{height:"14px",width:"14px",strokeWidth:"2"})]})})]}),/*#__PURE__*/e(S,{}),c?/*#__PURE__*/e(x,{style:{marginTop:"2rem"},children:c.message}):p&&0===ie?
1
+ import{jsx as e,jsxs as n,Fragment as r}from"react/jsx-runtime";import{BoltIcon as i,ArrowRightIcon as o,ChevronDownIcon as t}from"@heroicons/react/24/outline";import{useState as a}from"react";import{styled as l}from"styled-components";import{formatTokenAmount as c}from"@privy-io/js-sdk-core";import{P as d,E as s}from"./Button-DJY5dut3.mjs";import{M as h,B as m,a as p}from"./ModalHeader-DHXUvTf4.mjs";import{L as u,V as f,a as g}from"./Value-B4M62ove.mjs";import{a as y,R as b}from"./Row-CG0lSY5Z.mjs";import{E as x}from"./ErrorMessage-Cx8GKGhL.mjs";import{L as k}from"./LabelXs-BOisBtqT.mjs";import{S as w}from"./Subtitle-DkvfP2Ev.mjs";import{T as v}from"./Title-D0pfZff-.mjs";import{A as I}from"./Address-CDOE2oK9.mjs";import{W as C}from"./WalletInfoCard-C8BrD5jy.mjs";import{u as T}from"./context-Dee1TPOi.mjs";import{Y as S}from"./useActiveWallet-SiVSXkvG.mjs";import{L as N}from"./LoadingSkeleton-CHdaq3pb.mjs";import{isAddress as A}from"viem";import{B as j}from"./shared-CtYf3O54.mjs";import{C as E}from"./Checkbox-NmGCZeKL.mjs";import{E as M}from"./ErrorBanner-BdiArMwu.mjs";import{W as $}from"./WarningBanner-BDp-QC9i.mjs";import O from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import D from"@heroicons/react/24/outline/ClipboardDocumentIcon";import F from"@heroicons/react/24/outline/ExclamationCircleIcon";import{u as L}from"./internal-context-e-Eni5bG.mjs";const B=/*#__PURE__*/l(u).withConfig({displayName:"InteractiveLabel",componentId:"sc-b57d0824-0"})(["cursor:pointer;display:inline-flex;gap:8px;align-items:center;color:var(--privy-color-accent);svg{fill:var(--privy-color-accent);}"]);var P=({iconUrl:r,value:i,symbol:o,usdValue:t,nftName:a,nftCount:l,decimals:c,$isLoading:d})=>{if(d)/*#__PURE__*/return e(R,{$isLoading:d});let s=i&&t&&c?function(e,n,r){let i=parseFloat(e),o=parseFloat(r);if(0===i||0===o||Number.isNaN(i)||Number.isNaN(o))return e;let t=Math.ceil(-Math.log10(.01/(o/i))),a=Math.pow(10,t=Math.max(t=Math.min(t,n),1)),l=+(Math.floor(i*a)/a).toFixed(t).replace(/\.?0+$/,"");return Intl.NumberFormat(void 0,{maximumFractionDigits:n}).format(l)}(i,c,t):i;/*#__PURE__*/return n("div",{children:[/*#__PURE__*/n(R,{$isLoading:d,children:[r&&/*#__PURE__*/e(z,{src:r,alt:"Token icon"}),l&&l>1?l+"x":void 0," ",a,s," ",o]}),t&&/*#__PURE__*/n(W,{$isLoading:d,children:["$",t]})]})};let R=/*#__PURE__*/l.span.withConfig({displayName:"Value",componentId:"sc-991db279-0"})(["color:var(--privy-color-foreground);font-size:0.875rem;font-weight:500;line-height:1.375rem;word-break:break-all;text-align:right;display:flex;justify-content:flex-end;",""],N);const W=/*#__PURE__*/l.span.withConfig({displayName:"Subvalue",componentId:"sc-991db279-1"})(["color:var(--privy-color-foreground-2);font-size:12px;font-weight:400;line-height:18px;word-break:break-all;text-align:right;display:flex;justify-content:flex-end;",""],N);let z=/*#__PURE__*/l.img.withConfig({displayName:"TokenIcon",componentId:"sc-991db279-2"})(["height:14px;width:14px;margin-right:4px;object-fit:contain;"]);const V=i=>{let{chain:o,transactionDetails:t,isTokenContractInfoLoading:a,symbol:l}=i,{action:c,functionName:d}=t;/*#__PURE__*/return e(j,{children:/*#__PURE__*/n(y,{children:["transaction"!==c&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Action"}),/*#__PURE__*/e(f,{children:d})]}),"mint"===d&&"args"in t&&t.args.filter((e=>e)).map(((r,i)=>/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:`Param ${i}`}),/*#__PURE__*/e(f,{children:"string"==typeof r&&A(r)?/*#__PURE__*/e(I,{address:r,url:o?.blockExplorers?.default?.url,showCopyIcon:!1}):r?.toString()})]},i))),"setApprovalForAll"===d&&t.operator&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Operator"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.operator,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),"setApprovalForAll"===d&&void 0!==t.approved&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Set approval to"}),/*#__PURE__*/e(f,{children:t.approved?"true":"false"})]}),"transfer"===d||"transferFrom"===d||"safeTransferFrom"===d||"approve"===d?/*#__PURE__*/n(r,{children:["formattedAmount"in t&&t.formattedAmount&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/n(f,{$isLoading:a,children:[t.formattedAmount," ",l]})]}),"tokenId"in t&&t.tokenId&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token ID"}),/*#__PURE__*/e(f,{children:t.tokenId.toString()})]})]}):null,"safeBatchTransferFrom"===d&&/*#__PURE__*/n(r,{children:["amounts"in t&&t.amounts&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amounts"}),/*#__PURE__*/e(f,{children:t.amounts.join(", ")})]}),"tokenIds"in t&&t.tokenIds&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token IDs"}),/*#__PURE__*/e(f,{children:t.tokenIds.join(", ")})]})]}),"approve"===d&&t.spender&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Spender"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.spender,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===d||"safeTransferFrom"===d||"safeBatchTransferFrom"===d)&&t.transferFrom&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Transferring from"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.transferFrom,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===d||"safeTransferFrom"===d||"safeBatchTransferFrom"===d)&&t.transferTo&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Transferring to"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.transferTo,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]})]})})},H=({variant:i,setPreventMaliciousTransaction:o,colorScheme:t="light",preventMaliciousTransaction:a})=>"warn"===i?/*#__PURE__*/e(U,{children:/*#__PURE__*/n($,{theme:t,children:[/*#__PURE__*/e("span",{style:{fontWeight:"500"},children:"Warning: Suspicious transaction"}),/*#__PURE__*/e("br",{}),"This has been flagged as a potentially deceptive request. Approving could put your assets or funds at risk."]})}):"error"===i?/*#__PURE__*/e(r,{children:/*#__PURE__*/n(U,{children:[/*#__PURE__*/e(M,{theme:t,children:/*#__PURE__*/n("div",{children:[/*#__PURE__*/e("strong",{children:"This is a malicious transaction"}),/*#__PURE__*/e("br",{}),"This transaction transfers tokens to a known malicious address. Proceeding may result in the loss of valuable assets."]})}),/*#__PURE__*/n(q,{children:[/*#__PURE__*/e(E,{color:"var(--privy-color-error)",checked:!a,readOnly:!0,onClick:()=>o(!a)}),/*#__PURE__*/e("span",{children:"I understand and want to proceed anyways."})]})]})}):null;let U=/*#__PURE__*/l.div.withConfig({displayName:"BannerContainer",componentId:"sc-ab8a5a0b-0"})(["margin-top:1.5rem;"]),q=/*#__PURE__*/l.div.withConfig({displayName:"CheckboxContainer",componentId:"sc-ab8a5a0b-1"})(["display:flex;align-items:center;gap:0.5rem;margin-top:0.75rem;"]);const J=({transactionIndex:e,maxIndex:n})=>"number"!=typeof e||0===n?"":` (${e+1} / ${n+1})`,Q=({img:l,submitError:c,prepareError:p,onClose:k,action:C,title:N,subtitle:A,to:j,tokenAddress:E,network:M,missingFunds:$,fee:O,from:D,cta:F,disabled:L,chain:R,isSubmitting:W,isPreparing:z,isTokenPriceLoading:U,isTokenContractInfoLoading:q,isSponsored:Q,symbol:Y,balance:G,onClick:ne,transactionDetails:re,transactionIndex:ie,maxIndex:oe,onBack:te,chainName:ae,validation:le,hasScanDetails:ce,setIsScanDetailsOpen:de,preventMaliciousTransaction:se,setPreventMaliciousTransaction:he,tokensSent:me,tokensReceived:pe,isScanning:ue,isCancellable:fe,functionName:ge})=>{let{showTransactionDetails:ye,setShowTransactionDetails:be,hasMoreDetails:xe,isErc20Ish:ke}=(e=>{let[n,r]=a(!1),i=!0,o=!1;return(!e||e.isErc20Ish||"transaction"===e.action)&&(i=!1),i&&(o=Object.entries(e||{}).some((([e,n])=>n&&!["action","isErc20Ish","isNFTIsh"].includes(e)))),{showTransactionDetails:n,setShowTransactionDetails:r,hasMoreDetails:i&&o,isErc20Ish:e?.isErc20Ish}})(re),we=T(),ve=ke&&q||z||U||ue;/*#__PURE__*/return n(r,{children:[/*#__PURE__*/e(h,{onClose:k,backFn:te}),l&&/*#__PURE__*/e(Z,{children:l}),/*#__PURE__*/n(v,{style:{marginTop:l?"1.5rem":0},children:[N,/*#__PURE__*/e(J,{maxIndex:oe,transactionIndex:ie})]}),/*#__PURE__*/e(w,{children:A}),/*#__PURE__*/n(y,{style:{marginTop:"2rem"},children:[(!!me[0]||ve)&&/*#__PURE__*/n(b,{children:[pe.length>0?/*#__PURE__*/e(u,{children:"Send"}):/*#__PURE__*/e(u,{children:"approve"===C?"Approval amount":"Amount"}),/*#__PURE__*/e("div",{className:"flex flex-col",children:me.map(((n,r)=>/*#__PURE__*/e(P,{iconUrl:n.iconUrl,value:"setApprovalForAll"===ge?"All":n.value,usdValue:n.usdValue,symbol:n.symbol,nftName:n.nftName,nftCount:n.nftCount,decimals:n.decimals},r)))})]}),pe.length>0&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Receive"}),/*#__PURE__*/e("div",{className:"flex flex-col",children:pe.map(((n,r)=>/*#__PURE__*/e(P,{iconUrl:n.iconUrl,value:n.value,usdValue:n.usdValue,symbol:n.symbol,nftName:n.nftName,nftCount:n.nftCount,decimals:n.decimals},r)))})]}),re&&"spender"in re&&re?.spender?/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Spender"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:re.spender,url:R?.blockExplorers?.default?.url})})]}):null,j&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"To"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:j,url:R?.blockExplorers?.default?.url,showCopyIcon:!0})})]}),E&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token address"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:E,url:R?.blockExplorers?.default?.url})})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Network"}),/*#__PURE__*/e(f,{children:M})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Estimated fee"}),/*#__PURE__*/e(f,{$isLoading:z||U||void 0===Q,children:Q?/*#__PURE__*/n(_,{children:[/*#__PURE__*/n(ee,{children:["Sponsored by ",we.name]}),/*#__PURE__*/e(i,{height:16,width:16})]}):O})]}),xe&&!ce&&/*#__PURE__*/n(r,{children:[/*#__PURE__*/e(b,{className:"cursor-pointer",onClick:()=>be(!ye),children:/*#__PURE__*/n(g,{className:"flex items-center gap-x-1",children:["Details"," ",/*#__PURE__*/e(t,{style:{width:"0.75rem",marginLeft:"0.25rem",transform:ye?"rotate(180deg)":void 0}})]})}),ye&&re&&/*#__PURE__*/e(V,{action:C,chain:R,transactionDetails:re,isTokenContractInfoLoading:q,symbol:Y})]}),ce&&/*#__PURE__*/e(b,{children:/*#__PURE__*/n(B,{onClick:()=>de(!0),children:[/*#__PURE__*/e("span",{className:"text-color-primary",children:"Details"}),/*#__PURE__*/e(o,{height:"14px",width:"14px",strokeWidth:"2"})]})})]}),/*#__PURE__*/e(S,{}),c?/*#__PURE__*/e(x,{style:{marginTop:"2rem"},children:c.message}):p&&0===ie?
2
2
  /*#__PURE__*/e(x,{style:{marginTop:"2rem"},children:p.shortMessage??K}):null,/*#__PURE__*/e(H,{variant:le,preventMaliciousTransaction:se,setPreventMaliciousTransaction:he}),/*#__PURE__*/e(X,{$useSmallMargins:!(!p&&!c&&"warn"!==le&&"error"!==le),address:D,balance:G,errMsg:z||p||c||!$?void 0:`Add funds on ${R?.name??ae} to complete transaction.`}),/*#__PURE__*/e(d,{style:{marginTop:"1rem"},loading:W,disabled:L||z,onClick:ne,children:F}),fe&&/*#__PURE__*/e(s,{style:{marginTop:"1rem"},onClick:k,isSubmitting:!1,children:"Not now"}),/*#__PURE__*/e(m,{})]})},Y=({img:o,title:l,subtitle:s,cta:p,instructions:g,network:C,blockExplorerUrl:N,isMissingFunds:A,submitError:j,parseError:E,total:M,swap:$,transactingWalletAddress:O,fee:D,balance:F,disabled:L,isSubmitting:P,isPreparing:R,isTokenPriceLoading:W,onClick:z,onClose:V,onBack:H,isSponsored:U})=>{let q=R||W,[J,Q]=a(!1),Y=T();/*#__PURE__*/return n(r,{children:[/*#__PURE__*/e(h,{onClose:V,backFn:H}),o&&/*#__PURE__*/e(Z,{children:o}),/*#__PURE__*/e(v,{style:{marginTop:o?"1.5rem":0},children:l}),/*#__PURE__*/e(w,{children:s}),/*#__PURE__*/n(y,{style:{marginTop:"2rem",marginBottom:".5rem"},children:[(M||q)&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/e(f,{$isLoading:q,children:M})]}),$&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Swap"}),/*#__PURE__*/e(f,{children:$})]}),C&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Network"}),/*#__PURE__*/e(f,{children:C})]}),(D||q||void 0!==U)&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Estimated fee"}),/*#__PURE__*/e(f,{$isLoading:q,children:U&&!q?/*#__PURE__*/n(_,{children:[/*#__PURE__*/n(ee,{children:["Sponsored by ",Y.name]}),/*#__PURE__*/e(i,{height:16,width:16})]}):D})]})]}),/*#__PURE__*/e(b,{children:/*#__PURE__*/n(B,{onClick:()=>Q((e=>!e)),children:[/*#__PURE__*/e("span",{children:"Advanced"}),/*#__PURE__*/e(t,{height:"16px",width:"16px",strokeWidth:"2",style:{transition:"all 300ms",transform:J?"rotate(180deg)":void 0}})]})}),J&&/*#__PURE__*/e(r,{children:g.map(((r,i)=>"sol-transfer"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Transfer ",r.withSeed?"with seed":""]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/n(f,{children:[c({amount:r.value,decimals:r.token.decimals})," ",r.token.symbol]})]}),!!r.toAccount&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Destination"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.toAccount,url:N})})]})]},i):"spl-transfer"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Transfer ",r.token.symbol]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/e(f,{children:r.value.toString()})]}),!!r.fromAta&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Source"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.fromAta,url:N})})]}),!!r.toAta&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Destination"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.toAta,url:N})})]}),!!r.token.address&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.token.address,url:N})})]})]},i):"ata-creation"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/e(k,{children:"Create token account"})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Program ID"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.program,url:N})})]}),!!r.owner&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Owner"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.owner,url:N})})]})]},i):"create-account"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Create account ",r.withSeed?"with seed":""]})}),!!r.account&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Account"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.account,url:N})})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/n(f,{children:[c({amount:r.value,decimals:9})," SOL"]})]})]},i):"spl-init-account"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/e(k,{children:"Initialize token account"})}),!!r.account&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Account"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.account,url:N})})]}),!!r.mint&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Mint"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mint,url:N})})]}),!!r.owner&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Owner"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.owner,url:N})})]})]},i):"spl-close-account"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/e(k,{children:"Close token account"})}),!!r.source&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Source"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.source,url:N})})]}),!!r.destination&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Destination"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.destination,url:N})})]}),!!r.owner&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Owner"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.owner,url:N})})]})]},i):"spl-sync-native"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/e(k,{children:"Sync native"})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Program ID"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.program,url:N})})]})]},i):"raydium-swap-base-input"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Raydium swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount in"}),/*#__PURE__*/e(f,{children:r.amountIn.toString()})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Minimum amount out"}),/*#__PURE__*/e(f,{children:r.minimumAmountOut.toString()})]}),r.mintIn&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):"raydium-swap-base-output"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Raydium swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Max amount in"}),/*#__PURE__*/e(f,{children:r.maxAmountIn.toString()})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount out"}),/*#__PURE__*/e(f,{children:r.amountOut.toString()})]}),r.mintIn&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):"jupiter-swap-shared-accounts-route"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Jupiter swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"In amount"}),/*#__PURE__*/e(f,{children:r.inAmount.toString()})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Quoted out amount"}),/*#__PURE__*/e(f,{children:r.quotedOutAmount.toString()})]}),r.mintIn&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):"jupiter-swap-exact-out-route"===r.type?/*#__PURE__*/n(G,{children:[/*#__PURE__*/e(b,{children:/*#__PURE__*/n(k,{children:["Jupiter swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Quoted in amount"}),/*#__PURE__*/e(f,{children:r.quotedInAmount.toString()})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Amount out"}),/*#__PURE__*/e(f,{children:r.outAmount.toString()})]}),r.mintIn&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):/*#__PURE__*/n(G,{children:[/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Program ID"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.program,url:N})})]}),/*#__PURE__*/n(b,{children:[/*#__PURE__*/e(u,{children:"Data"}),/*#__PURE__*/e(f,{children:r.discriminator})]})]},i)))}),/*#__PURE__*/e(S,{}),j?/*#__PURE__*/e(x,{style:{marginTop:"2rem"},children:j.message}):E?/*#__PURE__*/e(x,{style:{marginTop:"2rem"},children:K}):null,/*#__PURE__*/e(X,{$useSmallMargins:!(!E&&!j),title:"",address:O,balance:F,errMsg:R||E||j||!A?void 0:"Add funds on Solana to complete transaction."}),/*#__PURE__*/e(d,{style:{marginTop:"1rem"},loading:P,disabled:L||R,onClick:z,children:p}),/*#__PURE__*/e(m,{})]})};let X=/*#__PURE__*/l(C).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-cbe5ab37-0"})(["",""],(e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;")),G=/*#__PURE__*/l(y).withConfig({displayName:"InstructionRows",componentId:"sc-cbe5ab37-1"})(["margin-top:0.5rem;border:1px solid var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-sm);padding:0.5rem;"]),K="There was an error preparing your transaction. Your transaction request will likely fail.",Z=/*#__PURE__*/l.div.withConfig({displayName:"ImageContainer",componentId:"sc-cbe5ab37-2"})(["display:flex;width:100%;justify-content:center;max-height:40px;> img{object-fit:contain;border-radius:var(--privy-border-radius-sm);}"]),_=/*#__PURE__*/l.span.withConfig({displayName:"SponsoredRow",componentId:"sc-cbe5ab37-3"})(["display:inline-flex;align-items:center;gap:0.3rem;"]),ee=/*#__PURE__*/l.span.withConfig({displayName:"SponsoredText",componentId:"sc-cbe5ab37-4"})(["font-size:14px;font-weight:500;color:var(--privy-color-foreground);"]);let ne=()=>/*#__PURE__*/n(ae,{children:[/*#__PURE__*/e(ce,{}),/*#__PURE__*/e(le,{})]});const re=({transactionError:i,chainId:o,onClose:t,onRetry:l,chainType:c,transactionHash:d})=>{let{chains:s}=L(),[m,u]=a(!1),{errorCode:f,errorMessage:g}=((e,n)=>{if("ethereum"===n)return{errorCode:e.details??e.message,errorMessage:e.shortMessage};let r=e.txSignature,i=e?.transactionMessage||"Something went wrong.";if(Array.isArray(e.logs)){let n=e.logs.find((e=>/insufficient (lamports|funds)/gi.test(e)));n&&(i=n)}return{transactionHash:r,errorMessage:i}})(i,c),y=(({chains:e,chainId:n,chainType:r,transactionHash:i})=>"ethereum"===r?e.find((e=>e.id===n))?.blockExplorers?.default.url??"https://etherscan.io":function(e,n){return`https://explorer.solana.com/tx/${e}?chain=${n}`}(i||"",n))({chains:s,chainId:o,chainType:c,transactionHash:d});/*#__PURE__*/return n(r,{children:[/*#__PURE__*/e(h,{onClose:t}),/*#__PURE__*/n(ie,{children:[/*#__PURE__*/e(ne,{}),/*#__PURE__*/e(oe,{children:f}),/*#__PURE__*/e(te,{children:"Please try again."}),/*#__PURE__*/n(he,{children:[/*#__PURE__*/e(se,{children:"Error message"}),/*#__PURE__*/e(pe,{$clickable:!1,children:g})]}),d&&/*#__PURE__*/n(he,{children:[/*#__PURE__*/e(se,{children:"Transaction hash"}),/*#__PURE__*/n(me,{children:["Copy this hash to view details about the transaction on a"," ",/*#__PURE__*/e("u",{children:/*#__PURE__*/e("a",{href:y,children:"block explorer"})}),"."]}),/*#__PURE__*/n(pe,{$clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(d),u(!0)},children:[d,/*#__PURE__*/e(ge,{clicked:m})]})]}),/*#__PURE__*/e(de,{onClick:()=>l({resetNonce:!!d}),children:"Retry transaction"})]}),/*#__PURE__*/e(p,{})]})};let ie=/*#__PURE__*/l.div.withConfig({displayName:"TransactionErrorScreenContainer",componentId:"sc-d58f10e6-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;"]),oe=/*#__PURE__*/l.span.withConfig({displayName:"ErrorCode",componentId:"sc-d58f10e6-1"})(["color:var(--privy-color-foreground);text-align:center;font-size:1.125rem;font-weight:500;line-height:1.25rem;text-align:center;margin:10px;"]),te=/*#__PURE__*/l.span.withConfig({displayName:"Subtitle",componentId:"sc-d58f10e6-2"})(["margin-top:4px;margin-bottom:10px;color:var(--privy-color-foreground-3);text-align:center;font-size:0.875rem;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.008px;"]),ae=/*#__PURE__*/l.div.withConfig({displayName:"CircleContainer",componentId:"sc-d58f10e6-3"})(["position:relative;width:60px;height:60px;margin:10px;display:flex;justify-content:center;align-items:center;"]),le=/*#__PURE__*/l(F).withConfig({displayName:"StyledExclamationCircleIcon",componentId:"sc-d58f10e6-4"})(["position:absolute;width:35px;height:35px;color:var(--privy-color-error);"]),ce=/*#__PURE__*/l.div.withConfig({displayName:"StyledRedCircle",componentId:"sc-d58f10e6-5"})(["position:absolute;width:60px;height:60px;border-radius:50%;background-color:var(--privy-color-error);opacity:0.1;"]),de=/*#__PURE__*/l(d).withConfig({displayName:"RetryButton",componentId:"sc-d58f10e6-6"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]),se=/*#__PURE__*/l.span.withConfig({displayName:"TextBoxTitle",componentId:"sc-d58f10e6-7"})(["width:100%;text-align:left;font-size:0.825rem;color:var(--privy-color-foreground);padding:4px;"]),he=/*#__PURE__*/l.div.withConfig({displayName:"TextBoxContainer",componentId:"sc-d58f10e6-8"})(["width:100%;margin:5px;display:flex;flex-direction:column;justify-content:center;align-items:center;"]),me=/*#__PURE__*/l.text.withConfig({displayName:"HelperText",componentId:"sc-d58f10e6-9"})(["position:relative;width:100%;padding:5px;font-size:0.8rem;color:var(--privy-color-foreground-3);text-align:left;word-wrap:break-word;"]),pe=/*#__PURE__*/l.span.withConfig({displayName:"TextBox",componentId:"sc-d58f10e6-10"})(["position:relative;width:100%;background-color:var(--privy-color-background-2);padding:8px 12px;border-radius:10px;margin-top:5px;font-size:14px;color:var(--privy-color-foreground-3);text-align:left;word-wrap:break-word;",""],(e=>e.$clickable&&"cursor: pointer;\n transition: background-color 0.3s;\n padding-right: 45px;\n\n &:hover {\n background-color: var(--privy-color-foreground-4);\n }")),ue=/*#__PURE__*/l(D).withConfig({displayName:"StyledClipboardIcon",componentId:"sc-d58f10e6-11"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),fe=/*#__PURE__*/l(O).withConfig({displayName:"StyledClipboardCheckIcon",componentId:"sc-d58f10e6-12"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),ge=({clicked:n})=>/*#__PURE__*/e(n?fe:ue,{});export{Q as S,re as T,Y as a};
@@ -1 +1 @@
1
- import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useState as a,useEffect as i}from"react";import{M as o,B as l}from"./ModalHeader-CxHK1IKF.mjs";import{C as r}from"./ScreenHeader-Biz1wq02.mjs";import{t as s}from"./FundWalletMethodHeader-RY6-H-Ry.mjs";import{C as m}from"./Chip-Bsgj4Yc-.mjs";import{S as p}from"./Subtitle-DkvfP2Ev.mjs";import{u as c}from"./context-B4VZqX5H.mjs";import{v as d,a8 as u,U as h}from"./useActiveWallet-Bj-s666H.mjs";import{u as y}from"./internal-context-DLZicboG.mjs";import{a as g}from"./get-is-unified-wallet-DXko-EzF.mjs";import{u as f}from"./useWallets-DuxHKVvE.mjs";import{t as C,W as w}from"./WalletButtonList-C1OqZHCA.mjs";import{I as T}from"./styles-DY17fuAX.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./LoadingSkeleton-CHdaq3pb.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"ofetch";import"lucide-react";import"./index-CCrVHfyv.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-BSIhOAz8.mjs";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMn1PaPp.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-J1po7l19.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"@heroicons/react/24/outline/WalletIcon";const j={component:()=>{let m,{connectors:h}=y(),{setModalData:T,data:j,navigate:W}=g(),S=c(),{wallets:x}=f(),D=h.filter(d).flatMap((e=>e.wallets)),[F,k]=a("default"),M="solana"===j?.funding?.chainType,b=!!j?.funding?.crossChainBridgingEnabled;m="ethereum"===j?.funding?.chainType?j.funding.erc20Address&&!j.funding.isUSDC?"ethereum-only":b&&!j.funding.chain.testnet?"ethereum-and-solana":"ethereum-only":b&&!j.funding?.isUSDC?"ethereum-and-solana":"solana-only";let E=x.filter((e=>"privy"!==e.walletClientType)),A=E.map((e=>e.walletClientType)),I=D.filter((e=>"privy"!==e.walletClientType)),L=I.map((e=>e.walletClientType)),B=[],H={...j.funding};H.usingDefaultFundingMethod&&(H.usingDefaultFundingMethod=!1);let U=({wallet:e,walletChainType:t})=>{T({...j,funding:{...H,connectedWallet:e,onContinueWithExternalWallet:()=>W(q({destChainType:M?"solana":"ethereum",sourceChainType:t}))},solanaFundingData:j?.solanaFundingData?{...j.solanaFundingData,sourceWalletData:{address:e.address,walletClientType:e.walletClientType}}:void 0}),W("FundingAmountEditScreen")};"solana-only"!==m&&B.push(...E.map(((t,n)=>/*#__PURE__*/e(v,{onClick:()=>U({wallet:t,walletChainType:"ethereum"}),icon:t.meta.icon,name:t.meta.name,chainType:t.type},n)))),"ethereum-only"!==m&&B.push(...I.map(((t,n)=>/*#__PURE__*/e(v,{onClick:()=>U({wallet:t,walletChainType:"solana"}),icon:t.meta.icon,name:t.meta.name,chainType:t.type},n)))),B.push(...C({walletList:S.appearance.walletList.filter((e=>!E.some((t=>t.walletClientType===e))&&!I.some((t=>t.walletClientType===e)))),walletChainType:m,connectors:h,connectOnly:!0,ignore:[...S.appearance.walletList,...A,...L],walletConnectEnabled:S.externalWallets.walletConnect.enabled}));let P=/*#__PURE__*/e(w,{text:"More wallets",onClick:()=>k("overflow")}),q=({sourceChainType:e,destChainType:t})=>"ethereum"===e&&"solana"===t?"AwaitingEvmToSolBridgingScreen":"ethereum"===e&&"ethereum"===t?"AwaitingExternalEthereumTransferScreen":"solana"===e&&"ethereum"===t?"AwaitingSolToEvmBridgingScreen":H.externalSolanaFundingScreen;return i((()=>{T({...j,externalConnectWallet:{onCompleteNavigateTo:({address:e,walletClientType:t,walletChainType:n})=>{let a=n??"ethereum",i="ethereum"===a?E.find((n=>n.address===e&&n.walletClientType===t)):I.find((n=>n.address===e&&n.walletClientType===t));return T({...j,funding:{...H,connectedWallet:i,onContinueWithExternalWallet:()=>{W(q({destChainType:M?"solana":"ethereum",sourceChainType:a}))}},solanaFundingData:j?.solanaFundingData?{...j.solanaFundingData,sourceWalletData:{address:e||"",walletClientType:t||""}}:void 0}),"FundingAmountEditScreen"}}})}),[]),/*#__PURE__*/t(n,"overflow"===F?{children:[/*#__PURE__*/e(o,{backFn:()=>k("default")},"header"),/*#__PURE__*/t(u,{children:[/*#__PURE__*/e(p,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),B]}),/*#__PURE__*/e(l,{})]}:{children:[/*#__PURE__*/e(s,{}),/*#__PURE__*/e(r,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),/*#__PURE__*/t(u,{children:[B.length>4?B.slice(0,3):B,B.length>4&&P]}),/*#__PURE__*/e(l,{})]})}};let v=({onClick:n,icon:a,name:i,chainType:o})=>/*#__PURE__*/t(h,{onClick:n,children:[/*#__PURE__*/e(T,{style:{width:20},children:/*#__PURE__*/e("img",{src:a})}),i,/*#__PURE__*/e(m,{color:"gray",style:{marginLeft:"auto"},children:"Connected"}),"solana"===o&&/*#__PURE__*/e(m,{color:"gray",children:"Solana"})]});export{j as TransferFromWalletScreen,j as default};
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useState as a,useEffect as i}from"react";import{M as o,B as l}from"./ModalHeader-DHXUvTf4.mjs";import{C as r}from"./ScreenHeader-Biz1wq02.mjs";import{t as s}from"./FundWalletMethodHeader-CN-93vVj.mjs";import{C as m}from"./Chip-Bsgj4Yc-.mjs";import{S as p}from"./Subtitle-DkvfP2Ev.mjs";import{u as c}from"./context-Dee1TPOi.mjs";import{v as d,a8 as u,U as h}from"./useActiveWallet-SiVSXkvG.mjs";import{u as y}from"./internal-context-e-Eni5bG.mjs";import{a as g}from"./get-is-unified-wallet-_KIJnP68.mjs";import{u as f}from"./useWallets-gElyEQoU.mjs";import{t as C,W as w}from"./WalletButtonList-DZp-38Ac.mjs";import{I as T}from"./styles-DY17fuAX.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./LoadingSkeleton-CHdaq3pb.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BYy0MVol.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"ofetch";import"lucide-react";import"./index-Dr4t3oWO.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-Bh4N2Hpm.mjs";import"@scure/base";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"@heroicons/react/24/outline/WalletIcon";const j={component:()=>{let m,{connectors:h}=y(),{setModalData:T,data:j,navigate:W}=g(),S=c(),{wallets:x}=f(),D=h.filter(d).flatMap((e=>e.wallets)),[F,k]=a("default"),M="solana"===j?.funding?.chainType,b=!!j?.funding?.crossChainBridgingEnabled;m="ethereum"===j?.funding?.chainType?j.funding.erc20Address&&!j.funding.isUSDC?"ethereum-only":b&&!j.funding.chain.testnet?"ethereum-and-solana":"ethereum-only":b&&!j.funding?.isUSDC?"ethereum-and-solana":"solana-only";let E=x.filter((e=>"privy"!==e.walletClientType)),A=E.map((e=>e.walletClientType)),I=D.filter((e=>"privy"!==e.walletClientType)),L=I.map((e=>e.walletClientType)),B=[],H={...j.funding};H.usingDefaultFundingMethod&&(H.usingDefaultFundingMethod=!1);let U=({wallet:e,walletChainType:t})=>{T({...j,funding:{...H,connectedWallet:e,onContinueWithExternalWallet:()=>W(q({destChainType:M?"solana":"ethereum",sourceChainType:t}))},solanaFundingData:j?.solanaFundingData?{...j.solanaFundingData,sourceWalletData:{address:e.address,walletClientType:e.walletClientType}}:void 0}),W("FundingAmountEditScreen")};"solana-only"!==m&&B.push(...E.map(((t,n)=>/*#__PURE__*/e(v,{onClick:()=>U({wallet:t,walletChainType:"ethereum"}),icon:t.meta.icon,name:t.meta.name,chainType:t.type},n)))),"ethereum-only"!==m&&B.push(...I.map(((t,n)=>/*#__PURE__*/e(v,{onClick:()=>U({wallet:t,walletChainType:"solana"}),icon:t.meta.icon,name:t.meta.name,chainType:t.type},n)))),B.push(...C({walletList:S.appearance.walletList.filter((e=>!E.some((t=>t.walletClientType===e))&&!I.some((t=>t.walletClientType===e)))),walletChainType:m,connectors:h,connectOnly:!0,ignore:[...S.appearance.walletList,...A,...L],walletConnectEnabled:S.externalWallets.walletConnect.enabled}));let P=/*#__PURE__*/e(w,{text:"More wallets",onClick:()=>k("overflow")}),q=({sourceChainType:e,destChainType:t})=>"ethereum"===e&&"solana"===t?"AwaitingEvmToSolBridgingScreen":"ethereum"===e&&"ethereum"===t?"AwaitingExternalEthereumTransferScreen":"solana"===e&&"ethereum"===t?"AwaitingSolToEvmBridgingScreen":H.externalSolanaFundingScreen;return i((()=>{T({...j,externalConnectWallet:{onCompleteNavigateTo:({address:e,walletClientType:t,walletChainType:n})=>{let a=n??"ethereum",i="ethereum"===a?E.find((n=>n.address===e&&n.walletClientType===t)):I.find((n=>n.address===e&&n.walletClientType===t));return T({...j,funding:{...H,connectedWallet:i,onContinueWithExternalWallet:()=>{W(q({destChainType:M?"solana":"ethereum",sourceChainType:a}))}},solanaFundingData:j?.solanaFundingData?{...j.solanaFundingData,sourceWalletData:{address:e||"",walletClientType:t||""}}:void 0}),"FundingAmountEditScreen"}}})}),[]),/*#__PURE__*/t(n,"overflow"===F?{children:[/*#__PURE__*/e(o,{backFn:()=>k("default")},"header"),/*#__PURE__*/t(u,{children:[/*#__PURE__*/e(p,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),B]}),/*#__PURE__*/e(l,{})]}:{children:[/*#__PURE__*/e(s,{}),/*#__PURE__*/e(r,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),/*#__PURE__*/t(u,{children:[B.length>4?B.slice(0,3):B,B.length>4&&P]}),/*#__PURE__*/e(l,{})]})}};let v=({onClick:n,icon:a,name:i,chainType:o})=>/*#__PURE__*/t(h,{onClick:n,children:[/*#__PURE__*/e(T,{style:{width:20},children:/*#__PURE__*/e("img",{src:a})}),i,/*#__PURE__*/e(m,{color:"gray",style:{marginLeft:"auto"},children:"Connected"}),"solana"===o&&/*#__PURE__*/e(m,{color:"gray",children:"Solana"})]});export{j as TransferFromWalletScreen,j as default};
@@ -1 +1 @@
1
- import{jsxs as e,Fragment as r,jsx as i}from"react/jsx-runtime";import{styled as o}from"styled-components";import{d as t}from"./Layouts-Bmf8DxNP.mjs";import{B as n}from"./ModalHeader-CxHK1IKF.mjs";import{C as m}from"./ScreenHeader-Biz1wq02.mjs";import{t as a}from"./FundWalletMethodHeader-RY6-H-Ry.mjs";import{I as s}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{N as d}from"./index-CJMgUOnw.mjs";import{a as l,R as c}from"./Row-CG0lSY5Z.mjs";import{L as h,V as p}from"./Value-B4M62ove.mjs";import{A as f}from"./Address-C1iw9r70.mjs";import{N as g}from"./NetworkIcon-B48ilzF8.mjs";import{Q as j}from"./useActiveWallet-Bj-s666H.mjs";const I=({walletClientType:o,displayName:I,addressToFund:w,chainId:y,chainName:N,isBridging:C,isErc20Flow:x,totalPriceInNativeCurrency:T,totalPriceInUsd:v,gasPriceInNativeCurrency:B,gasPriceInUsd:P})=>{let k=j(o);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/i(a,{}),/*#__PURE__*/i(d,{centerIcon:/*#__PURE__*/i(s,{icon:k?.image_url?.md,name:o})}),/*#__PURE__*/i(m,{style:{marginTop:"8px",marginBottom:"12px"},title:`${C?"Bridging":"Confirming"} with ${I}`}),!C&&!x&&/*#__PURE__*/e(l,{children:[/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Total"}),/*#__PURE__*/i(p,{children:v||T})]}),/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"To"}),/*#__PURE__*/i(p,{children:/*#__PURE__*/i(f,{address:w,showCopyIcon:!1})})]}),/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Network"}),/*#__PURE__*/i(p,{children:/*#__PURE__*/e(u,{children:[/*#__PURE__*/i(g,{chainId:y,height:16,width:16})," ",N]})})]}),B&&/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Estimated fee"}),/*#__PURE__*/i(p,{children:P||B})]})]}),/*#__PURE__*/i(t,{height:24}),/*#__PURE__*/i(n,{})]})};let u=/*#__PURE__*/o.div.withConfig({displayName:"NetworkColumn",componentId:"sc-5bdbf842-0"})(["display:flex;flex-direction:row;align-items:center;gap:4px;"]);export{I as T};
1
+ import{jsxs as e,Fragment as r,jsx as i}from"react/jsx-runtime";import{styled as o}from"styled-components";import{d as t}from"./Layouts-Bmf8DxNP.mjs";import{B as n}from"./ModalHeader-DHXUvTf4.mjs";import{C as m}from"./ScreenHeader-Biz1wq02.mjs";import{t as a}from"./FundWalletMethodHeader-CN-93vVj.mjs";import{I as s}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{N as d}from"./index-CJMgUOnw.mjs";import{a as l,R as c}from"./Row-CG0lSY5Z.mjs";import{L as h,V as p}from"./Value-B4M62ove.mjs";import{A as f}from"./Address-CDOE2oK9.mjs";import{N as g}from"./NetworkIcon-B48ilzF8.mjs";import{Q as j}from"./useActiveWallet-SiVSXkvG.mjs";const I=({walletClientType:o,displayName:I,addressToFund:w,chainId:y,chainName:N,isBridging:C,isErc20Flow:x,totalPriceInNativeCurrency:T,totalPriceInUsd:v,gasPriceInNativeCurrency:B,gasPriceInUsd:P})=>{let k=j(o);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/i(a,{}),/*#__PURE__*/i(d,{centerIcon:/*#__PURE__*/i(s,{icon:k?.image_url?.md,name:o})}),/*#__PURE__*/i(m,{style:{marginTop:"8px",marginBottom:"12px"},title:`${C?"Bridging":"Confirming"} with ${I}`}),!C&&!x&&/*#__PURE__*/e(l,{children:[/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Total"}),/*#__PURE__*/i(p,{children:v||T})]}),/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"To"}),/*#__PURE__*/i(p,{children:/*#__PURE__*/i(f,{address:w,showCopyIcon:!1})})]}),/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Network"}),/*#__PURE__*/i(p,{children:/*#__PURE__*/e(u,{children:[/*#__PURE__*/i(g,{chainId:y,height:16,width:16})," ",N]})})]}),B&&/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Estimated fee"}),/*#__PURE__*/i(p,{children:P||B})]})]}),/*#__PURE__*/i(t,{height:24}),/*#__PURE__*/i(n,{})]})};let u=/*#__PURE__*/o.div.withConfig({displayName:"NetworkColumn",componentId:"sc-5bdbf842-0"})(["display:flex;flex-direction:row;align-items:center;gap:4px;"]);export{I as T};
@@ -1 +1 @@
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-Bmf8DxNP.mjs";import{Mail as a}from"lucide-react";import{forwardRef as s,useState as m}from"react";import{u as n}from"./context-B4VZqX5H.mjs";import{a as l}from"./index-CCrVHfyv.mjs";import{u as d}from"./internal-context-DLZicboG.mjs";import{u as c,a as p}from"./get-is-unified-wallet-DXko-EzF.mjs";import{a1 as u,V as h}from"./useActiveWallet-Bj-s666H.mjs";import{E as j,P as v}from"./Button-OlK_6fKk.mjs";import{I as f,E as g}from"./EmailInputForm-B4hjCxRU.mjs";import{E as y}from"./ErrorMessage-Cx8GKGhL.mjs";import{S as w}from"./ScreenLayout-pthdsODa.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-DuxHKVvE.mjs";import"./prepareFundingModalData-CndHQFiM.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-BSIhOAz8.mjs";import"./events-context-CI0iqAXA.mjs";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"viem";import"./getPublicClient-C_l_ocJu.mjs";import"ofetch";import"js-cookie";import"./frame-BMn1PaPp.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-J1po7l19.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const k=/*#__PURE__*/s(((i,o)=>{let[s,f]=m(""),[g,w]=m(""),[k,E]=m(!1),{authenticated:A,user:C}=c(),{initUpdateEmail:x}=d(),{navigate:I,setModalData:M,currentScreen:P}=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||A?(async e=>{if(!C?.email)throw Error("User is required to have an email address to update it.");E(!0);try{await x({oldAddress:C.email.address,newAddress:s,captchaToken:e}),I("AwaitingPasswordlessCodeScreen")}catch(e){M({errorModalData:{error:e,previousScreen:P||"LandingScreen"}}),I("ErrorScreen")}E(!1)})(U):(M({captchaModalData:{callback:e=>{if(!C?.email)throw Error("User is required to have an email address to update it.");return x({oldAddress:C.email.address,newAddress:s,captchaToken:e})},userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),I("CaptchaScreen"))};/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(b,{children:[g&&/*#__PURE__*/t(y,{style:{marginTop:"0.25rem",textAlign:"left"},children:g}),/*#__PURE__*/e(S,{$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,S=g;const E=({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})})}),A={component:()=>/*#__PURE__*/t(E,{})};export{A as UpdateEmailScreen,E as UpdateEmailScreenView,A as default};
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-Bmf8DxNP.mjs";import{Mail as a}from"lucide-react";import{forwardRef as s,useState as m}from"react";import{u as n}from"./context-Dee1TPOi.mjs";import{a as l}from"./index-Dr4t3oWO.mjs";import{u as d}from"./internal-context-e-Eni5bG.mjs";import{u as c,a as p}from"./get-is-unified-wallet-_KIJnP68.mjs";import{a1 as u,V as h}from"./useActiveWallet-SiVSXkvG.mjs";import{E as j,P as v}from"./Button-DJY5dut3.mjs";import{I as f,E as g}from"./EmailInputForm-B4hjCxRU.mjs";import{E as y}from"./ErrorMessage-Cx8GKGhL.mjs";import{S as w}from"./ScreenLayout-BQ6FV6yc.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-gElyEQoU.mjs";import"./prepareFundingModalData-BYy0MVol.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"./usePrivy-Bh4N2Hpm.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"./getPublicClient-A9RSftUZ.mjs";import"ofetch";import"js-cookie";import"./frame-CwE9r3cT.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-eEm9Olt_.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Screen-CKaxnxac.mjs";import"./ModalHeader-DHXUvTf4.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const k=/*#__PURE__*/s(((i,o)=>{let[s,f]=m(""),[g,w]=m(""),[k,E]=m(!1),{authenticated:A,user:C}=c(),{initUpdateEmail:x}=d(),{navigate:I,setModalData:M,currentScreen:P}=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||A?(async e=>{if(!C?.email)throw Error("User is required to have an email address to update it.");E(!0);try{await x({oldAddress:C.email.address,newAddress:s,captchaToken:e}),I("AwaitingPasswordlessCodeScreen")}catch(e){M({errorModalData:{error:e,previousScreen:P||"LandingScreen"}}),I("ErrorScreen")}E(!1)})(U):(M({captchaModalData:{callback:e=>{if(!C?.email)throw Error("User is required to have an email address to update it.");return x({oldAddress:C.email.address,newAddress:s,captchaToken:e})},userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),I("CaptchaScreen"))};/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(b,{children:[g&&/*#__PURE__*/t(y,{style:{marginTop:"0.25rem",textAlign:"left"},children:g}),/*#__PURE__*/e(S,{$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,S=g;const E=({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})})}),A={component:()=>/*#__PURE__*/t(E,{})};export{A as UpdateEmailScreen,E as UpdateEmailScreenView,A as default};
@@ -1 +1 @@
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-kW8tUq0-.mjs";import{u as i}from"./internal-context-DLZicboG.mjs";import{a as n,u as m}from"./get-is-unified-wallet-DXko-EzF.mjs";import{S as a}from"./ScreenLayout-pthdsODa.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"./context-B4VZqX5H.mjs";import"tinycolor2";import"./useActiveWallet-Bj-s666H.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"./Button-OlK_6fKk.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"ofetch";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const 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:p}=i(),[l,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 p(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:l})}};export{c as UpdatePhoneScreen,s as UpdatePhoneScreenView,c as default};
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-Ft9zAuQd.mjs";import{u as i}from"./internal-context-e-Eni5bG.mjs";import{a as n,u as m}from"./get-is-unified-wallet-_KIJnP68.mjs";import{S as a}from"./ScreenLayout-BQ6FV6yc.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"./context-Dee1TPOi.mjs";import"tinycolor2";import"./useActiveWallet-SiVSXkvG.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BYy0MVol.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-gElyEQoU.mjs";import"./Button-DJY5dut3.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"ofetch";import"./Screen-CKaxnxac.mjs";import"./ModalHeader-DHXUvTf4.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const 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:p}=i(),[l,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 p(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:l})}};export{c as UpdatePhoneScreen,s as UpdatePhoneScreenView,c as default};
@@ -1 +1 @@
1
- import{jsx as t}from"react/jsx-runtime";import{a as o}from"./get-is-unified-wallet-DXko-EzF.mjs";import{S as e}from"./ScreenLayout-pthdsODa.mjs";import"viem";import"react";import"./context-B4VZqX5H.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-DLZicboG.mjs";import"ofetch";import"./Button-OlK_6fKk.mjs";import"styled-components";import"./useActiveWallet-Bj-s666H.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-CndHQFiM.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-C_l_ocJu.mjs";import"./useWallets-DuxHKVvE.mjs";import"./Screen-Dzz_AFFs.mjs";import"./ModalHeader-CxHK1IKF.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const i=({style:o,...e})=>/*#__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",...o},...e,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:o="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(e,{title:o,subtitle:r,icon:i,iconVariant:"subtle",primaryCta:{label:"Go back",onClick:n},showBack:!0,onBack:n,watermark:!0}),n={component:()=>{let{navigate:e}=o();/*#__PURE__*/return t(r,{onGoBack:()=>{e("LandingScreen")}})}};export{n as UserLimitReachedScreen,r as UserLimitReachedScreenView,n as default};
1
+ import{jsx as t}from"react/jsx-runtime";import{a as o}from"./get-is-unified-wallet-_KIJnP68.mjs";import{S as e}from"./ScreenLayout-BQ6FV6yc.mjs";import"viem";import"react";import"./context-Dee1TPOi.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-e-Eni5bG.mjs";import"ofetch";import"./Button-DJY5dut3.mjs";import"styled-components";import"./useActiveWallet-SiVSXkvG.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BYy0MVol.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-A9RSftUZ.mjs";import"./useWallets-gElyEQoU.mjs";import"./Screen-CKaxnxac.mjs";import"./ModalHeader-DHXUvTf4.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const i=({style:o,...e})=>/*#__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",...o},...e,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:o="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(e,{title:o,subtitle:r,icon:i,iconVariant:"subtle",primaryCta:{label:"Go back",onClick:n},showBack:!0,onBack:n,watermark:!0}),n={component:()=>{let{navigate:e}=o();/*#__PURE__*/return t(r,{onGoBack:()=>{e("LandingScreen")}})}};export{n as UserLimitReachedScreen,r as UserLimitReachedScreenView,n as default};