@privy-io/react-auth 3.9.0 → 3.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/dist/cjs/{AccountNotFoundScreen-C0im9fAJ.js → AccountNotFoundScreen-BjG_YLcK.js} +1 -1
  2. package/dist/cjs/{Address-Doz93lgh.js → Address-5znFAhQw.js} +1 -1
  3. package/dist/cjs/{AffirmativeConsentScreen-OgvUs4oT.js → AffirmativeConsentScreen-BiwTOLaX.js} +1 -1
  4. package/dist/cjs/{AllowlistRejectionScreen-CBfQZVO7.js → AllowlistRejectionScreen-DOZr-QmF.js} +1 -1
  5. package/dist/cjs/{AuthenticateWithWalletScreen-B4aHQC44.js → AuthenticateWithWalletScreen-BO4ml_zL.js} +1 -1
  6. package/dist/cjs/{AwaitingEvmToSolBridgingScreen-Cz2E1cWa.js → AwaitingEvmToSolBridgingScreen-DCvvtPfy.js} +1 -1
  7. package/dist/cjs/{AwaitingExternalEthereumTransferScreen-Ca1z7D4v.js → AwaitingExternalEthereumTransferScreen-DXSQjzHX.js} +1 -1
  8. package/dist/cjs/{AwaitingPasswordlessCodeScreen-DDws79F8.js → AwaitingPasswordlessCodeScreen-COP_Jshz.js} +1 -1
  9. package/dist/cjs/{AwaitingSolToEvmBridgingScreen-DlTJafw4.js → AwaitingSolToEvmBridgingScreen-tGqHxf1K.js} +1 -1
  10. package/dist/cjs/{BridgeNetworkSelectionView-Cg3JjiFh.js → BridgeNetworkSelectionView-DgFjMLY3.js} +1 -1
  11. package/dist/cjs/{Button-DpuRzAgk.js → Button-Bm_Ft0Dw.js} +1 -1
  12. package/dist/cjs/{CaptchaScreen-DrvkYUK-.js → CaptchaScreen-BvyOQUvH.js} +1 -1
  13. package/dist/cjs/{CoinbaseOnrampStatusScreen-Cfbivt0s.js → CoinbaseOnrampStatusScreen-9G_2yIQ-.js} +1 -1
  14. package/dist/cjs/{ConnectEmailForm-DeN1Pg_E.js → ConnectEmailForm-D0Xd9Tnw.js} +1 -1
  15. package/dist/cjs/{ConnectLedgerScreen-F3-JADjW.js → ConnectLedgerScreen-COTQ1lqK.js} +1 -1
  16. package/dist/cjs/{ConnectOnlyLandingScreen-DQ9hxL8H.js → ConnectOnlyLandingScreen-DErN9BXL.js} +1 -1
  17. package/dist/cjs/{ConnectOnlyStatusScreen-YPhacltK.js → ConnectOnlyStatusScreen-DKhKRV2M.js} +1 -1
  18. package/dist/cjs/ConnectOrCreateScreen-54nvcrr7.js +1 -0
  19. package/dist/cjs/{ConnectPhoneForm-CIaHyHT9.js → ConnectPhoneForm-WT8rso3i.js} +1 -1
  20. package/dist/cjs/ConnectWalletView-DsOX-lHz.js +1 -0
  21. package/dist/cjs/{ConnectionStatusScreen-Dg1LMsi6.js → ConnectionStatusScreen-C1nqbW_A.js} +1 -1
  22. package/dist/cjs/CrossAppAuthScreen-weeiAu3O.js +1 -0
  23. package/dist/cjs/CustomLandingScreenView-DQLDU2GD.js +2 -0
  24. package/dist/cjs/{DelegatedActionsConsentScreen-CP9xV4-_.js → DelegatedActionsConsentScreen-C_-0aHwH.js} +1 -1
  25. package/dist/cjs/{DelegatedActionsRevokeScreen-QrgQlVmp.js → DelegatedActionsRevokeScreen-SZkD3b1o.js} +1 -1
  26. package/dist/cjs/{EmbeddedWalletConnectingScreen-Ccb4geKv.js → EmbeddedWalletConnectingScreen-VdpmfKNX.js} +1 -1
  27. package/dist/cjs/{EmbeddedWalletCreatedScreen-DTRBR5WW.js → EmbeddedWalletCreatedScreen-CfEf4KkH.js} +1 -1
  28. package/dist/cjs/{EmbeddedWalletKeyExportScreen-B1Ezr57N.js → EmbeddedWalletKeyExportScreen-D0NE_HvJ.js} +1 -1
  29. package/dist/cjs/{EmbeddedWalletOnAccountCreateScreen-0v1ZwZgX.js → EmbeddedWalletOnAccountCreateScreen-CrJFTRI0.js} +1 -1
  30. package/dist/cjs/{EmbeddedWalletPasswordUpdateScreen-DJr1d2fN.js → EmbeddedWalletPasswordUpdateScreen-CjVK53bu.js} +1 -1
  31. package/dist/cjs/{EmbeddedWalletPasswordUpdateSplashScreen-Slns6kTr.js → EmbeddedWalletPasswordUpdateSplashScreen-CVldlThA.js} +1 -1
  32. package/dist/cjs/{EnrollTotp-zJR3l-q0.js → EnrollTotp-BVeDTQ5J.js} +1 -1
  33. package/dist/cjs/{ErrorScreen-DAUNTckD.js → ErrorScreen-BSjRGrRR.js} +1 -1
  34. package/dist/cjs/{FarcasterConnectStatusScreen-C3PPAnT1.js → FarcasterConnectStatusScreen-B7Ab3ddi.js} +1 -1
  35. package/dist/cjs/{FarcasterSignerStatusScreen-BMd0iB8M.js → FarcasterSignerStatusScreen-Bf--BYd8.js} +1 -1
  36. package/dist/cjs/{FundSolWalletWithExternalSolanaWallet-u8DS0vOP.js → FundSolWalletWithExternalSolanaWallet-DcRxhkRg.js} +2 -2
  37. package/dist/cjs/{FundWalletMethodHeader-DFV8N4os.js → FundWalletMethodHeader-BKgYjMau.js} +1 -1
  38. package/dist/cjs/{FundingEditAmountScreen-DXA8k8zQ.js → FundingEditAmountScreen-Bs3_avzr.js} +1 -1
  39. package/dist/cjs/{FundingMethodSelectionScreen-tlU_tfXm.js → FundingMethodSelectionScreen-C_cbW1TC.js} +1 -1
  40. package/dist/cjs/{InAppBrowserLoginNotPossible-BB_zYdr4.js → InAppBrowserLoginNotPossible-CySpQd3Y.js} +1 -1
  41. package/dist/cjs/{InstallWalletScreen-sNsX0qIj.js → InstallWalletScreen-rFpE2-7H.js} +1 -1
  42. package/dist/cjs/LandingScreen-BmZWpgb3.js +1 -0
  43. package/dist/cjs/{LinkConflictScreen-CwA2g0DP.js → LinkConflictScreen-DSIPReKB.js} +1 -1
  44. package/dist/cjs/{LinkEmailScreen-DExuIdVG.js → LinkEmailScreen-Dc8QC15P.js} +1 -1
  45. package/dist/cjs/{LinkPasskeyScreen-DXLAama3.js → LinkPasskeyScreen-CUMuhJ2Q.js} +1 -1
  46. package/dist/cjs/{LinkPhoneScreen-BGKi4PVT.js → LinkPhoneScreen-bozyY6A1.js} +1 -1
  47. package/dist/cjs/{LoginFailedScreen-BMAuqJva.js → LoginFailedScreen-C4gl1Ezs.js} +1 -1
  48. package/dist/cjs/{ManualTransferScreen-Dg8uGXZw.js → ManualTransferScreen-BTj8KQgY.js} +1 -1
  49. package/dist/cjs/{MfaAuthEnrollmentFlowScreen-BZ1svjjW.js → MfaAuthEnrollmentFlowScreen-cmFsgDp4.js} +1 -1
  50. package/dist/cjs/{MfaAuthVerifyFlowScreen-CJhMSZ1r.js → MfaAuthVerifyFlowScreen-DEC3hYOD.js} +1 -1
  51. package/dist/cjs/{MfaEnrollmentFlowScreen-DvxX-vrH.js → MfaEnrollmentFlowScreen-3lOG0uKv.js} +1 -1
  52. package/dist/cjs/{MfaVerifyFlowScreen-BWPqGNNj.js → MfaVerifyFlowScreen-aRH0rn8s.js} +1 -1
  53. package/dist/cjs/{ModalHeader-4MV7Tgk7.js → ModalHeader-DB7Tbjwz.js} +1 -1
  54. package/dist/cjs/{MoonpayStatusScreen-Cd_71Pyq.js → MoonpayStatusScreen-DANoQOd5.js} +1 -1
  55. package/dist/cjs/{OAuthStatusScreen-ZTRfDJXT.js → OAuthStatusScreen-DsGkPiMe.js} +1 -1
  56. package/dist/cjs/{PasskeySelectSignupOrLogin-CQZM_RDH.js → PasskeySelectSignupOrLogin-D9Wfb44J.js} +1 -1
  57. package/dist/cjs/{PasskeyStatusScreen-BM1Mvl9i.js → PasskeyStatusScreen-DAxg2zUJ.js} +1 -1
  58. package/dist/cjs/{PasswordRecoveryScreen-CvVt6RGf.js → PasswordRecoveryScreen-CJfW4kpk.js} +1 -1
  59. package/dist/cjs/{QrCode-DvJPyneT.js → QrCode-DsQD8cG6.js} +1 -1
  60. package/dist/cjs/{RecoveryOAuthStatusScreen-Cg2ntkgK.js → RecoveryOAuthStatusScreen-_R1gExdU.js} +1 -1
  61. package/dist/cjs/{RecoveryPasswordCreateScreen-dGZOvD2x.js → RecoveryPasswordCreateScreen-Cb-gcVc8.js} +1 -1
  62. package/dist/cjs/{RecoverySelectionScreen-DBAg2tyX.js → RecoverySelectionScreen-CZOXXRGl.js} +1 -1
  63. package/dist/cjs/{Screen-CJM19YNL.js → Screen-D9Tvi297.js} +1 -1
  64. package/dist/cjs/{ScreenLayout-Bbhw-EIr.js → ScreenLayout-BeH-Q6N2.js} +1 -1
  65. package/dist/cjs/{SetAutomaticRecoveryScreen-C65Py491.js → SetAutomaticRecoveryScreen-BSDQb_dJ.js} +1 -1
  66. package/dist/cjs/{SetWalletPasswordForm-Bx4bpcUs.js → SetWalletPasswordForm-C3YB2v_1.js} +1 -1
  67. package/dist/cjs/{SignRequestScreen-Dy8xnXXp.js → SignRequestScreen-DW3SnJi5.js} +1 -1
  68. package/dist/cjs/{StandardSignAndSendTransactionScreen-x1O5yfj4.js → StandardSignAndSendTransactionScreen-Cima1YEn.js} +1 -1
  69. package/dist/cjs/{TelegramAuthScreen-DaxoKw-V.js → TelegramAuthScreen-pfwAx0uQ.js} +1 -1
  70. package/dist/cjs/{TransactionDetails-DvBQbDgX.js → TransactionDetails-KB5Wyu1l.js} +1 -1
  71. package/dist/cjs/{TransactionErrorView-BdTYgWfc.js → TransactionErrorView-SaY08uTA.js} +1 -1
  72. package/dist/cjs/TransferFromWalletScreen-DVzjB3Gc.js +1 -0
  73. package/dist/cjs/TransferOrBridgeLoadingScreen-B3zo8l43.js +1 -0
  74. package/dist/cjs/{UpdateEmailScreen-BtndcDiP.js → UpdateEmailScreen-CwWKZeJR.js} +1 -1
  75. package/dist/cjs/{UpdatePhoneScreen-BQb3cbdX.js → UpdatePhoneScreen-B84E2DOe.js} +1 -1
  76. package/dist/cjs/{UserLimitReachedScreen-Ctgox4aT.js → UserLimitReachedScreen-CQMqK5QW.js} +1 -1
  77. package/dist/cjs/{WalletInfoCard-DQtI0K25.js → WalletInfoCard-DKVdH9iF.js} +1 -1
  78. package/dist/cjs/{WalletInterstitialScreen-HfTntL7I.js → WalletInterstitialScreen-0cBKaDQ1.js} +1 -1
  79. package/dist/cjs/{WalletLink-CbnPrVEH.js → WalletLink-GY0_Tmtg.js} +1 -1
  80. package/dist/cjs/WalletOverflowButton-iCeXR9aA.js +1 -0
  81. package/dist/cjs/abstract-smart-wallets.js +1 -1
  82. package/dist/cjs/context-DFq1obBO.js +1 -0
  83. package/dist/cjs/{ethers-BwK3McWK.js → ethers-DZGJ4Y5i.js} +1 -1
  84. package/dist/cjs/extended-chains.js +1 -1
  85. package/dist/cjs/{get-is-unified-wallet-CHHPpmxX.js → get-is-unified-wallet-D4ouXJpi.js} +1 -1
  86. package/dist/cjs/{index-D7QitaMz.js → index-BQai4Vqd.js} +1 -1
  87. package/dist/cjs/{index-DiPPDo6V.js → index-CKB4VKFb.js} +1 -1
  88. package/dist/cjs/{index-4-C2N_7K.js → index-NJrQkxJ7.js} +3 -3
  89. package/dist/cjs/index.js +1 -1
  90. package/dist/cjs/internal.js +1 -1
  91. package/dist/cjs/{prepareFundingModalData-Bap-QRCV.js → prepareFundingModalData-Cnd6rhhJ.js} +1 -1
  92. package/dist/cjs/{shared-BjdszO5f.js → shared-CCAyvw5i.js} +1 -1
  93. package/dist/cjs/{shouldProceedtoEmbeddedWalletCreationFlow-CuHR6wvs.js → shouldProceedtoEmbeddedWalletCreationFlow-DZvEYqlO.js} +1 -1
  94. package/dist/cjs/{smart-wallets-Cb8qgePj.js → smart-wallets-CV78p-ta.js} +1 -1
  95. package/dist/cjs/smart-wallets.js +1 -1
  96. package/dist/cjs/solana.js +1 -1
  97. package/dist/cjs/{to-ui-error-C_N9DMza.js → to-ui-error-ER-8XlJF.js} +1 -1
  98. package/dist/cjs/ui.js +1 -1
  99. package/dist/cjs/{use-create-wallet-without-fallback-y9YpooGA.js → use-create-wallet-without-fallback-q0_yd_V9.js} +1 -1
  100. package/dist/cjs/{use-export-wallet-CmWKVG5J.js → use-export-wallet-DKaavHqM.js} +1 -1
  101. package/dist/cjs/{useActiveWallet-B5cSS56I.js → useActiveWallet-BOX8xCn9.js} +1 -1
  102. package/dist/cjs/{useGetTokenPrice-CdW08dO7.js → useGetTokenPrice-BHq-guWz.js} +1 -1
  103. package/dist/cjs/{useI18n-D21RT6EH.js → useI18n-CY6Et_lH.js} +1 -1
  104. package/dist/cjs/{usePrivy-DobNyfbl.js → usePrivy-CcfSRv1R.js} +1 -1
  105. package/dist/cjs/{useSolanaRpcClient-ZoxUaxNS.js → useSolanaRpcClient-TQdbjNyx.js} +1 -1
  106. package/dist/cjs/{useWallets-DPdw6ah8.js → useWallets-BLFNjTwC.js} +1 -1
  107. package/dist/cjs/{useWallets-Z7ZZY1fI.js → useWallets-oPpMUdRR.js} +1 -1
  108. package/dist/dts/{events-context-D8iPaW-H.d.ts → events-context-BYT6PpDG.d.mts} +1 -1
  109. package/dist/dts/{events-context-D8iPaW-H.d.mts → events-context-BYT6PpDG.d.ts} +1 -1
  110. package/dist/dts/extended-chains.d.mts +1 -1
  111. package/dist/dts/extended-chains.d.ts +1 -1
  112. package/dist/dts/farcaster.d.mts +1 -1
  113. package/dist/dts/farcaster.d.ts +1 -1
  114. package/dist/dts/index.d.mts +26 -4
  115. package/dist/dts/index.d.ts +26 -4
  116. package/dist/dts/internal.d.mts +1 -1
  117. package/dist/dts/internal.d.ts +1 -1
  118. package/dist/dts/smart-wallets.d.mts +1 -1
  119. package/dist/dts/smart-wallets.d.ts +1 -1
  120. package/dist/dts/solana.d.mts +3 -3
  121. package/dist/dts/solana.d.ts +3 -3
  122. package/dist/dts/{types-diVZpIb-.d.mts → types-D7U23FgR.d.mts} +2 -0
  123. package/dist/dts/{types-diVZpIb-.d.ts → types-D7U23FgR.d.ts} +2 -0
  124. package/dist/dts/ui.d.mts +1 -1
  125. package/dist/dts/ui.d.ts +1 -1
  126. package/dist/esm/{AccountNotFoundScreen-CvMiU7Tz.mjs → AccountNotFoundScreen-Bk2ZDlxR.mjs} +1 -1
  127. package/dist/esm/{Address-CDOE2oK9.mjs → Address-BsvZLUXE.mjs} +1 -1
  128. package/dist/esm/{AffirmativeConsentScreen-Cia_UEaD.mjs → AffirmativeConsentScreen-CMcGT-7c.mjs} +1 -1
  129. package/dist/esm/{AllowlistRejectionScreen-DMqAO2Y-.mjs → AllowlistRejectionScreen-CgdkdFzy.mjs} +1 -1
  130. package/dist/esm/{AuthenticateWithWalletScreen-DvzZViMZ.mjs → AuthenticateWithWalletScreen-fhyjSxI8.mjs} +1 -1
  131. package/dist/esm/{AwaitingEvmToSolBridgingScreen-BSG_hKyl.mjs → AwaitingEvmToSolBridgingScreen-DbNP1yPY.mjs} +1 -1
  132. package/dist/esm/{AwaitingExternalEthereumTransferScreen-BcZRmV50.mjs → AwaitingExternalEthereumTransferScreen-COnzLcDW.mjs} +1 -1
  133. package/dist/esm/{AwaitingPasswordlessCodeScreen-Dd7TblcM.mjs → AwaitingPasswordlessCodeScreen-D9BoqETu.mjs} +1 -1
  134. package/dist/esm/{AwaitingSolToEvmBridgingScreen-BD1wkQFf.mjs → AwaitingSolToEvmBridgingScreen-JY-d6qlj.mjs} +1 -1
  135. package/dist/esm/{BridgeNetworkSelectionView-DSCjcHJX.mjs → BridgeNetworkSelectionView-Dn5uqa3q.mjs} +1 -1
  136. package/dist/esm/{Button-DJY5dut3.mjs → Button-B8mqatRx.mjs} +1 -1
  137. package/dist/esm/{CaptchaScreen-CapFNnoZ.mjs → CaptchaScreen-D3uGo3qJ.mjs} +1 -1
  138. package/dist/esm/{CoinbaseOnrampStatusScreen-DbQEEYPn.mjs → CoinbaseOnrampStatusScreen-Ce2Z_vJB.mjs} +1 -1
  139. package/dist/esm/{ConnectEmailForm-Cs3r5aBq.mjs → ConnectEmailForm--PZXgvw4.mjs} +1 -1
  140. package/dist/esm/{ConnectLedgerScreen-EYZ2eRpE.mjs → ConnectLedgerScreen-CRDZ_shP.mjs} +1 -1
  141. package/dist/esm/{ConnectOnlyLandingScreen-BM747X2V.mjs → ConnectOnlyLandingScreen-NSgaj_D4.mjs} +1 -1
  142. package/dist/esm/{ConnectOnlyStatusScreen-CW3W1N8z.mjs → ConnectOnlyStatusScreen-DAGVWgFv.mjs} +1 -1
  143. package/dist/esm/ConnectOrCreateScreen-CuVcGxrh.mjs +1 -0
  144. package/dist/esm/{ConnectPhoneForm-Ft9zAuQd.mjs → ConnectPhoneForm-DoYmHBv3.mjs} +1 -1
  145. package/dist/esm/ConnectWalletView-eQbJO3Pg.mjs +1 -0
  146. package/dist/esm/{ConnectionStatusScreen-nzx3dVCV.mjs → ConnectionStatusScreen-DVtobAVi.mjs} +1 -1
  147. package/dist/esm/CrossAppAuthScreen-B0633bnY.mjs +1 -0
  148. package/dist/esm/CustomLandingScreenView-DNbO8W7v.mjs +2 -0
  149. package/dist/esm/{DelegatedActionsConsentScreen-C35m_lng.mjs → DelegatedActionsConsentScreen-Cm3QtgBC.mjs} +1 -1
  150. package/dist/esm/{DelegatedActionsRevokeScreen-h4GhIT-2.mjs → DelegatedActionsRevokeScreen-C2WBGR2c.mjs} +1 -1
  151. package/dist/esm/{EmbeddedWalletConnectingScreen-CrgNS1_v.mjs → EmbeddedWalletConnectingScreen-CpKPkmKa.mjs} +1 -1
  152. package/dist/esm/{EmbeddedWalletCreatedScreen-BhSPSO8A.mjs → EmbeddedWalletCreatedScreen-CMyRcNaG.mjs} +1 -1
  153. package/dist/esm/{EmbeddedWalletKeyExportScreen-BlAL_BUV.mjs → EmbeddedWalletKeyExportScreen-nkSO3O1P.mjs} +1 -1
  154. package/dist/esm/{EmbeddedWalletOnAccountCreateScreen-Xz2dhW-I.mjs → EmbeddedWalletOnAccountCreateScreen-rwdmo9iN.mjs} +1 -1
  155. package/dist/esm/{EmbeddedWalletPasswordUpdateScreen-DQbd-pAr.mjs → EmbeddedWalletPasswordUpdateScreen-Tcp68U7U.mjs} +1 -1
  156. package/dist/esm/{EmbeddedWalletPasswordUpdateSplashScreen-9VnFkswr.mjs → EmbeddedWalletPasswordUpdateSplashScreen-5PH-3FQ3.mjs} +1 -1
  157. package/dist/esm/{EnrollTotp-twiE9SrW.mjs → EnrollTotp-ULLNt8tl.mjs} +1 -1
  158. package/dist/esm/{ErrorScreen-CTI5XNc0.mjs → ErrorScreen-BdxNEgU1.mjs} +1 -1
  159. package/dist/esm/{FarcasterConnectStatusScreen-26MCKeUz.mjs → FarcasterConnectStatusScreen-CruCPzPD.mjs} +1 -1
  160. package/dist/esm/{FarcasterSignerStatusScreen-YwCO1kz9.mjs → FarcasterSignerStatusScreen-DBAyc7bd.mjs} +1 -1
  161. package/dist/esm/{FundSolWalletWithExternalSolanaWallet-B3w3-z6B.mjs → FundSolWalletWithExternalSolanaWallet-Fxpj9pEN.mjs} +1 -1
  162. package/dist/esm/{FundWalletMethodHeader-CN-93vVj.mjs → FundWalletMethodHeader-I8a6Y30s.mjs} +1 -1
  163. package/dist/esm/{FundingEditAmountScreen-Cz6ZAJlk.mjs → FundingEditAmountScreen-yKYKiyG9.mjs} +1 -1
  164. package/dist/esm/{FundingMethodSelectionScreen-B85fzSsC.mjs → FundingMethodSelectionScreen-Dr-QG6BQ.mjs} +1 -1
  165. package/dist/esm/{InAppBrowserLoginNotPossible-CPsaFweG.mjs → InAppBrowserLoginNotPossible-BYO_nlWy.mjs} +1 -1
  166. package/dist/esm/{InstallWalletScreen-D5mGXNHF.mjs → InstallWalletScreen-Cma1GXX4.mjs} +1 -1
  167. package/dist/esm/LandingScreen-DCR5C-gA.mjs +1 -0
  168. package/dist/esm/{LinkConflictScreen-D8y5of24.mjs → LinkConflictScreen-C8kM_4ZL.mjs} +1 -1
  169. package/dist/esm/{LinkEmailScreen-C9lKAk-L.mjs → LinkEmailScreen-DsrprT7p.mjs} +1 -1
  170. package/dist/esm/{LinkPasskeyScreen-C33kWVrX.mjs → LinkPasskeyScreen-yKY5ebtx.mjs} +1 -1
  171. package/dist/esm/{LinkPhoneScreen-Bi98Ngac.mjs → LinkPhoneScreen-BklMbJs1.mjs} +1 -1
  172. package/dist/esm/{LoginFailedScreen-BX7s2pm7.mjs → LoginFailedScreen-CVGjcD9g.mjs} +1 -1
  173. package/dist/esm/ManualTransferScreen-C6MTkQcg.mjs +1 -0
  174. package/dist/esm/{MfaAuthEnrollmentFlowScreen-BBOfIRfA.mjs → MfaAuthEnrollmentFlowScreen-BrEYUoOi.mjs} +1 -1
  175. package/dist/esm/{MfaAuthVerifyFlowScreen-CwZbfXVc.mjs → MfaAuthVerifyFlowScreen-D_LbAt1N.mjs} +1 -1
  176. package/dist/esm/{MfaEnrollmentFlowScreen-Dq5X_CVZ.mjs → MfaEnrollmentFlowScreen-BseHvqlH.mjs} +1 -1
  177. package/dist/esm/{MfaVerifyFlowScreen-DGylIeVO.mjs → MfaVerifyFlowScreen-DB8BFfTJ.mjs} +1 -1
  178. package/dist/esm/{ModalHeader-DHXUvTf4.mjs → ModalHeader-BLGC-7ev.mjs} +1 -1
  179. package/dist/esm/{MoonpayStatusScreen-Boj9S0LW.mjs → MoonpayStatusScreen-D-Qnyxst.mjs} +1 -1
  180. package/dist/esm/{OAuthStatusScreen-DLvm8CkQ.mjs → OAuthStatusScreen-pEjYhAdx.mjs} +1 -1
  181. package/dist/esm/{PasskeySelectSignupOrLogin-62N4Cj_4.mjs → PasskeySelectSignupOrLogin-CmmjfwZM.mjs} +1 -1
  182. package/dist/esm/{PasskeyStatusScreen-DE8Ez-Rl.mjs → PasskeyStatusScreen-AiT-3Rq0.mjs} +1 -1
  183. package/dist/esm/{PasswordRecoveryScreen-CxXsaYPM.mjs → PasswordRecoveryScreen-BW7BBSLI.mjs} +1 -1
  184. package/dist/esm/{QrCode-CbRLsYtm.mjs → QrCode-DR5LogOp.mjs} +1 -1
  185. package/dist/esm/{RecoveryOAuthStatusScreen-9ETDOsJ0.mjs → RecoveryOAuthStatusScreen-BGxGq84t.mjs} +1 -1
  186. package/dist/esm/{RecoveryPasswordCreateScreen-CZizgkaK.mjs → RecoveryPasswordCreateScreen-Brv0MUPN.mjs} +1 -1
  187. package/dist/esm/{RecoverySelectionScreen-CDzuMgIx.mjs → RecoverySelectionScreen-CluXGpRG.mjs} +1 -1
  188. package/dist/esm/{Screen-CKaxnxac.mjs → Screen-BTyXgDrd.mjs} +1 -1
  189. package/dist/esm/{ScreenLayout-BQ6FV6yc.mjs → ScreenLayout-CddsD3Of.mjs} +1 -1
  190. package/dist/esm/{SetAutomaticRecoveryScreen-D5x6hDUL.mjs → SetAutomaticRecoveryScreen-nXcm7pIi.mjs} +1 -1
  191. package/dist/esm/{SetWalletPasswordForm-DelBzpVM.mjs → SetWalletPasswordForm-DvgKP4Ez.mjs} +1 -1
  192. package/dist/esm/{SignRequestScreen-BA5JF3Hr.mjs → SignRequestScreen-Cp5zIIZ3.mjs} +1 -1
  193. package/dist/esm/{StandardSignAndSendTransactionScreen-CiJd6Wf9.mjs → StandardSignAndSendTransactionScreen-bbPFP1pO.mjs} +1 -1
  194. package/dist/esm/{TelegramAuthScreen-zZOkgtJy.mjs → TelegramAuthScreen-DorSPB8G.mjs} +1 -1
  195. package/dist/esm/{TransactionDetails-B2vXU-k4.mjs → TransactionDetails-Bb1NEpUH.mjs} +1 -1
  196. package/dist/esm/{TransactionErrorView-DOcJFQEX.mjs → TransactionErrorView-CfyBAYzV.mjs} +2 -2
  197. package/dist/esm/TransferFromWalletScreen-BeSvua3b.mjs +1 -0
  198. package/dist/esm/{TransferOrBridgeLoadingScreen-B-uvt7Fj.mjs → TransferOrBridgeLoadingScreen-D5Y_FQAB.mjs} +1 -1
  199. package/dist/esm/{UpdateEmailScreen-B1-pVdEN.mjs → UpdateEmailScreen-BolXWblK.mjs} +1 -1
  200. package/dist/esm/{UpdatePhoneScreen-CwYS0KNr.mjs → UpdatePhoneScreen-G2aRPp1w.mjs} +1 -1
  201. package/dist/esm/{UserLimitReachedScreen-C9lTsh_J.mjs → UserLimitReachedScreen-BUXcfdpd.mjs} +1 -1
  202. package/dist/esm/{WalletInfoCard-C8BrD5jy.mjs → WalletInfoCard-YE5P6CSV.mjs} +1 -1
  203. package/dist/esm/{WalletInterstitialScreen-d520uEnZ.mjs → WalletInterstitialScreen-6lMKxpAk.mjs} +1 -1
  204. package/dist/esm/{WalletLink-WAY9-CI0.mjs → WalletLink-C9CSqqVy.mjs} +1 -1
  205. package/dist/esm/WalletOverflowButton-DV9Pe-aq.mjs +1 -0
  206. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  207. package/dist/esm/context-Bycd1SKV.mjs +1 -0
  208. package/dist/esm/{ethers-g3QzXj2h.mjs → ethers-C3Y94dat.mjs} +1 -1
  209. package/dist/esm/extended-chains.mjs +1 -1
  210. package/dist/esm/{get-is-unified-wallet-_KIJnP68.mjs → get-is-unified-wallet-DvKS5IUO.mjs} +1 -1
  211. package/dist/esm/{index-BGEWwttv.mjs → index-C9_VQk69.mjs} +1 -1
  212. package/dist/esm/{index-Dr4t3oWO.mjs → index-CCyaupaz.mjs} +3 -3
  213. package/dist/esm/{index-CiEOopPN.mjs → index-DeGXWdV3.mjs} +1 -1
  214. package/dist/esm/index.mjs +1 -1
  215. package/dist/esm/internal.mjs +1 -1
  216. package/dist/esm/{prepareFundingModalData-BYy0MVol.mjs → prepareFundingModalData-CIgFwA7s.mjs} +1 -1
  217. package/dist/esm/{shared-CRNjAkzC.mjs → shared-rucIJmk0.mjs} +1 -1
  218. package/dist/esm/{shouldProceedtoEmbeddedWalletCreationFlow-iMnL58wW.mjs → shouldProceedtoEmbeddedWalletCreationFlow-Djgu4xiS.mjs} +1 -1
  219. package/dist/esm/{smart-wallets-BMn13jfV.mjs → smart-wallets-B-nGTJog.mjs} +1 -1
  220. package/dist/esm/smart-wallets.mjs +1 -1
  221. package/dist/esm/solana.mjs +1 -1
  222. package/dist/esm/{to-ui-error-CnxcoZ1S.mjs → to-ui-error-3mK4-1VA.mjs} +1 -1
  223. package/dist/esm/ui.mjs +1 -1
  224. package/dist/esm/{use-create-wallet-without-fallback-5er4aqoE.mjs → use-create-wallet-without-fallback-cSYr4rn8.mjs} +1 -1
  225. package/dist/esm/{use-export-wallet-WZT8QqOJ.mjs → use-export-wallet-ntS-M0Jk.mjs} +1 -1
  226. package/dist/esm/{useActiveWallet-SiVSXkvG.mjs → useActiveWallet-Bsy5GTCV.mjs} +1 -1
  227. package/dist/esm/{useGetTokenPrice-CfQvz_Mo.mjs → useGetTokenPrice-0Bn0Y88A.mjs} +1 -1
  228. package/dist/esm/{useI18n-O3hskpuB.mjs → useI18n-BtdAZuQ8.mjs} +1 -1
  229. package/dist/esm/{usePrivy-Bh4N2Hpm.mjs → usePrivy-BaiIHGte.mjs} +1 -1
  230. package/dist/esm/{useSolanaRpcClient-DaxiCEwc.mjs → useSolanaRpcClient-DW9Xaoo_.mjs} +1 -1
  231. package/dist/esm/{useWallets-gElyEQoU.mjs → useWallets-D0lpBS44.mjs} +1 -1
  232. package/dist/esm/{useWallets-DCp1uab-.mjs → useWallets-NhjmJtNE.mjs} +1 -1
  233. package/package.json +4 -4
  234. package/dist/cjs/ConnectOrCreateScreen-DmitWRwr.js +0 -1
  235. package/dist/cjs/ConnectWalletView-B33uROyL.js +0 -1
  236. package/dist/cjs/CrossAppAuthScreen-B6h5ejCd.js +0 -1
  237. package/dist/cjs/CustomLandingScreenView-ClPdt2GY.js +0 -2
  238. package/dist/cjs/LandingScreen-BE8xOJTr.js +0 -1
  239. package/dist/cjs/TransferFromWalletScreen-CGRGSTHN.js +0 -1
  240. package/dist/cjs/TransferOrBridgeLoadingScreen-C4UYLYIL.js +0 -1
  241. package/dist/cjs/WalletButtonList-C6cavPqd.js +0 -1
  242. package/dist/cjs/context-Dn8Hzo8O.js +0 -1
  243. package/dist/esm/ConnectOrCreateScreen-BREVA7pu.mjs +0 -1
  244. package/dist/esm/ConnectWalletView-DFfXN_9_.mjs +0 -1
  245. package/dist/esm/CrossAppAuthScreen-DAQweVCP.mjs +0 -1
  246. package/dist/esm/CustomLandingScreenView-BkNtLof4.mjs +0 -2
  247. package/dist/esm/LandingScreen-BqSnrgDb.mjs +0 -1
  248. package/dist/esm/ManualTransferScreen-BBMujAte.mjs +0 -1
  249. package/dist/esm/TransferFromWalletScreen-C5QQN9h6.mjs +0 -1
  250. package/dist/esm/WalletButtonList-DZp-38Ac.mjs +0 -1
  251. package/dist/esm/context-Dee1TPOi.mjs +0 -1
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./context-Dn8Hzo8O.js"),i=require("./index-4-C2N_7K.js"),s=require("./internal-context-NWsAL807.js"),o=require("./use-create-wallet-without-fallback-y9YpooGA.js"),a=require("./get-is-unified-wallet-CHHPpmxX.js"),u=require("./SetWalletPasswordForm-Bx4bpcUs.js");require("@privy-io/js-sdk-core"),require("tinycolor2"),require("uuid"),require("jose"),require("eventemitter3"),require("./useActiveWallet-B5cSS56I.js"),require("zustand"),require("styled-components"),require("react-device-detect"),require("./prepareFundingModalData-Bap-QRCV.js"),require("./events-context-Di6--rDg.js"),require("viem"),require("viem/utils"),require("./getPublicClient-CGlodIp_.js"),require("./useWallets-DPdw6ah8.js"),require("@coinbase/wallet-sdk"),require("@privy-io/ethereum"),require("mipd"),require("@privy-io/popup"),require("./paths-DizMb-lU.js"),require("./usePrivy-DobNyfbl.js"),require("@scure/base"),require("@headlessui/react"),require("@walletconnect/ethereum-provider"),require("@privy-io/urls"),require("ofetch"),require("js-cookie"),require("./frame-B14fp9oC.js"),require("@privy-io/routes"),require("x402/client"),require("@privy-io/api-base"),require("viem/accounts"),require("./use-sign-with-user-signer-BcAsQTGF.js"),require("./getEmbeddedConnectedWallet-6TsVZJkD.js"),require("@heroicons/react/24/outline/ExclamationTriangleIcon"),require("./Layouts-dRL0OSpp.js"),require("./ModalHeader-4MV7Tgk7.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("./shared-BjdszO5f.js"),require("@heroicons/react/24/outline/ArrowPathIcon"),require("@heroicons/react/24/outline/EyeIcon"),require("@heroicons/react/24/outline/EyeSlashIcon"),require("./Button-DpuRzAgk.js"),require("./Checkbox-DXPQZFlQ.js"),require("@heroicons/react/24/outline/KeyIcon"),require("@heroicons/react/24/solid/CheckCircleIcon"),require("fast-password-entropy"),require("secure-password-utilities"),require("secure-password-utilities/wordlists"),require("@heroicons/react/24/outline/ArrowDownTrayIcon"),require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon"),require("@heroicons/react/24/outline/DocumentDuplicateIcon"),require("@heroicons/react/24/solid/XCircleIcon"),require("./ScreenHeader-CyURV6Ti.js");const n={component:()=>{let{navigate:n,data:c,onUserCloseViaDialogOrKeybindRef:l}=a.usePrivyModal(),d=t.useAppConfig(),[q,h]=r.useState(""),[w,p]=r.useState(!1),[y,v]=r.useState(),[m,j]=r.useState(null),{create:f}=o.useCreateWalletWithoutFallback(),{authenticated:C,user:P}=a.usePrivyContext(),{closePrivyModal:S,isNewUserThisSession:b,initializeWalletProxy:g}=s.usePrivyInternal(),{onSuccess:I,onFailure:x,callAuthOnSuccessOnClose:E,shouldCreateEth:W,shouldCreateSol:A}=c.createWallet,[k,M]=r.useState(null),U=new i.RunEffectOnce((async()=>{try{let e;if(W&&A)e=await f({recoveryMethod:"user-passcode",recoveryPassword:y,chainType:"ethereum",walletIndex:0,latestUser:P}),e=await f({chainType:"solana",walletIndex:0,latestUser:e.user});else if(A)e=await f({recoveryMethod:"user-passcode",recoveryPassword:y,chainType:"solana",walletIndex:0,latestUser:P});else{if(!W)throw Error("Invalid args to create wallet");e=await f({recoveryMethod:"user-passcode",recoveryPassword:y,chainType:"ethereum",walletIndex:0,latestUser:P})}M(e),b?n("EmbeddedWalletCreatedScreen"):(I(e),S({shouldCallAuthOnSuccess:E}))}catch(e){h(e.message)}}));r.useEffect((()=>{m||g(3e4).then((e=>j(e)))}),[m]),r.useEffect((()=>{if(!C||!P)return n("LandingScreen"),void x(Error("User must be authenticated before creating a Privy wallet"))}),[C]),l.current=()=>null;/*#__PURE__*/return e.jsx(u.SetWalletPasswordForm,{config:{initiatedBy:"automatic"},appName:d?.name||"privy",loading:!m,buttonLoading:w,buttonHideAnimations:!k&&w,isResettingPassword:!1,error:q,password:y||"",onClose:()=>{k&&"user-passcode"!==k.account.recoveryMethod?(x(new s.PrivyEmbeddedWalletError("User created a wallet but failed to set a password for it")),S({shouldCallAuthOnSuccess:!1})):k?(I(k),S({shouldCallAuthOnSuccess:E})):(x(new s.PrivyEmbeddedWalletError("User wallet creation failed")),S({shouldCallAuthOnSuccess:!1}))},onPasswordChange:v,onPasswordGenerate:()=>v(u.generatePassphrase()),onSubmit:async()=>(p(!0),U.execute().then((()=>new Promise((e=>setTimeout(e,250))))).finally((()=>p(!1))))})}};exports.EmbeddedWalletPasswordCreateScreen=n,exports.default=n;
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./context-DFq1obBO.js"),i=require("./index-NJrQkxJ7.js"),s=require("./internal-context-NWsAL807.js"),o=require("./use-create-wallet-without-fallback-q0_yd_V9.js"),a=require("./get-is-unified-wallet-D4ouXJpi.js"),u=require("./SetWalletPasswordForm-C3YB2v_1.js");require("@privy-io/js-sdk-core"),require("tinycolor2"),require("uuid"),require("jose"),require("eventemitter3"),require("./useActiveWallet-BOX8xCn9.js"),require("zustand"),require("styled-components"),require("react-device-detect"),require("./prepareFundingModalData-Cnd6rhhJ.js"),require("./events-context-Di6--rDg.js"),require("viem"),require("viem/utils"),require("./getPublicClient-CGlodIp_.js"),require("./useWallets-BLFNjTwC.js"),require("@coinbase/wallet-sdk"),require("@privy-io/ethereum"),require("mipd"),require("@privy-io/popup"),require("./paths-DizMb-lU.js"),require("./usePrivy-CcfSRv1R.js"),require("@scure/base"),require("@headlessui/react"),require("@walletconnect/ethereum-provider"),require("@privy-io/urls"),require("ofetch"),require("js-cookie"),require("./frame-B14fp9oC.js"),require("@privy-io/routes"),require("x402/client"),require("@privy-io/api-base"),require("viem/accounts"),require("./use-sign-with-user-signer-BcAsQTGF.js"),require("./getEmbeddedConnectedWallet-6TsVZJkD.js"),require("@heroicons/react/24/outline/ExclamationTriangleIcon"),require("./Layouts-dRL0OSpp.js"),require("./ModalHeader-DB7Tbjwz.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("./shared-CCAyvw5i.js"),require("@heroicons/react/24/outline/ArrowPathIcon"),require("@heroicons/react/24/outline/EyeIcon"),require("@heroicons/react/24/outline/EyeSlashIcon"),require("./Button-Bm_Ft0Dw.js"),require("./Checkbox-DXPQZFlQ.js"),require("@heroicons/react/24/outline/KeyIcon"),require("@heroicons/react/24/solid/CheckCircleIcon"),require("fast-password-entropy"),require("secure-password-utilities"),require("secure-password-utilities/wordlists"),require("@heroicons/react/24/outline/ArrowDownTrayIcon"),require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon"),require("@heroicons/react/24/outline/DocumentDuplicateIcon"),require("@heroicons/react/24/solid/XCircleIcon"),require("./ScreenHeader-CyURV6Ti.js");const n={component:()=>{let{navigate:n,data:c,onUserCloseViaDialogOrKeybindRef:l}=a.usePrivyModal(),d=t.useAppConfig(),[q,h]=r.useState(""),[w,p]=r.useState(!1),[y,v]=r.useState(),[m,j]=r.useState(null),{create:f}=o.useCreateWalletWithoutFallback(),{authenticated:C,user:b}=a.usePrivyContext(),{closePrivyModal:g,isNewUserThisSession:P,initializeWalletProxy:S}=s.usePrivyInternal(),{onSuccess:I,onFailure:x,callAuthOnSuccessOnClose:E,shouldCreateEth:W,shouldCreateSol:A}=c.createWallet,[k,M]=r.useState(null),U=new i.RunEffectOnce((async()=>{try{let e;if(W&&A)e=await f({recoveryMethod:"user-passcode",recoveryPassword:y,chainType:"ethereum",walletIndex:0,latestUser:b}),e=await f({chainType:"solana",walletIndex:0,latestUser:e.user});else if(A)e=await f({recoveryMethod:"user-passcode",recoveryPassword:y,chainType:"solana",walletIndex:0,latestUser:b});else{if(!W)throw Error("Invalid args to create wallet");e=await f({recoveryMethod:"user-passcode",recoveryPassword:y,chainType:"ethereum",walletIndex:0,latestUser:b})}M(e),P?n("EmbeddedWalletCreatedScreen"):(I(e),g({shouldCallAuthOnSuccess:E}))}catch(e){h(e.message)}}));r.useEffect((()=>{m||S(3e4).then((e=>j(e)))}),[m]),r.useEffect((()=>{if(!C||!b)return n("LandingScreen"),void x(Error("User must be authenticated before creating a Privy wallet"))}),[C]),l.current=()=>null;/*#__PURE__*/return e.jsx(u.SetWalletPasswordForm,{config:{initiatedBy:"automatic"},appName:d?.name||"privy",loading:!m,buttonLoading:w,buttonHideAnimations:!k&&w,isResettingPassword:!1,error:q,password:y||"",onClose:()=>{k&&"user-passcode"!==k.account.recoveryMethod?(x(new s.PrivyEmbeddedWalletError("User created a wallet but failed to set a password for it")),g({shouldCallAuthOnSuccess:!1})):k?(I(k),g({shouldCallAuthOnSuccess:E})):(x(new s.PrivyEmbeddedWalletError("User wallet creation failed")),g({shouldCallAuthOnSuccess:!1}))},onPasswordChange:v,onPasswordGenerate:()=>v(u.generatePassphrase()),onSubmit:async()=>(p(!0),U.execute().then((()=>new Promise((e=>setTimeout(e,250))))).finally((()=>p(!1))))})}};exports.EmbeddedWalletPasswordCreateScreen=n,exports.default=n;
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("@heroicons/react/24/outline/LockClosedIcon"),o=require("@heroicons/react/24/outline/PencilSquareIcon"),t=require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),i=require("react"),s=require("styled-components"),n=require("./get-is-unified-wallet-CHHPpmxX.js"),c=require("./Button-DpuRzAgk.js"),u=require("./ModalHeader-4MV7Tgk7.js"),l=require("./ScreenHeader-CyURV6Ti.js"),a=require("./context-Dn8Hzo8O.js"),d=require("./internal-context-NWsAL807.js"),h=require("./index-4-C2N_7K.js"),p=require("./styles-Ca_DS00a.js"),y=require("./useActiveWallet-B5cSS56I.js");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("viem"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("@privy-io/js-sdk-core"),require("tinycolor2"),require("ofetch"),require("uuid"),require("jose"),require("eventemitter3"),require("./useWallets-DPdw6ah8.js"),require("./prepareFundingModalData-Bap-QRCV.js"),require("@coinbase/wallet-sdk"),require("@privy-io/ethereum"),require("mipd"),require("react-device-detect"),require("viem/utils"),require("@privy-io/popup"),require("./paths-DizMb-lU.js"),require("./usePrivy-DobNyfbl.js"),require("./events-context-Di6--rDg.js"),require("@scure/base"),require("zustand"),require("@headlessui/react"),require("@walletconnect/ethereum-provider"),require("@privy-io/urls"),require("./getPublicClient-CGlodIp_.js"),require("js-cookie"),require("./frame-B14fp9oC.js"),require("@privy-io/routes"),require("x402/client"),require("@privy-io/api-base"),require("viem/accounts"),require("./use-sign-with-user-signer-BcAsQTGF.js"),require("./getEmbeddedConnectedWallet-6TsVZJkD.js");var j=/*#__PURE__*/v(r),q=/*#__PURE__*/v(o),g=/*#__PURE__*/v(t);let x=/*#__PURE__*/s.styled.div.withConfig({displayName:"IconContainer",componentId:"sc-1c4e63fb-0"})(["width:24px;height:24px;display:flex;justify-content:center;align-items:center;"]),C={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy","privy-v2":"Privy"},m=({onClose:r})=>/*#__PURE__*/e.jsxs(p.RecoveryExplainerContainer,{children:[/*#__PURE__*/e.jsx(l.CenteredScreenHeader,{title:"Why do I need to secure my account?",icon:/*#__PURE__*/e.jsx(g.default,{width:48}),description:/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),/*#__PURE__*/e.jsx("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. It’s important you don’t lose access to the method you choose."})]})}),/*#__PURE__*/e.jsx(c.PrimaryButton,{onClick:r,children:"Select backup method"})]});const w={component:()=>{let[r,o]=i.useState(!1),{navigate:t,lastScreen:s,navigateBack:c,setModalData:v,data:g,onUserCloseViaDialogOrKeybindRef:w}=n.usePrivyModal(),{user:f}=n.usePrivyContext(),{embeddedWallets:S}=a.useAppConfig(),{closePrivyModal:k}=d.usePrivyInternal(),b=n.getPrivyPrimaryWallet(f),P=null===b,{isInAccountCreateFlow:M,isResettingPassword:A,shouldCreateEth:I,shouldCreateSol:F}=g.recoverySelection,W=b&&"privy"!==b.recoveryMethod,B=W?/*#__PURE__*/e.jsxs("span",{children:["Your account is currently secured using"," ",/*#__PURE__*/e.jsx("strong",{children:C[b?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function R(e){v({recoveryOAuthStatus:{provider:e,action:P?"create-wallet":"set-recovery",isInAccountCreateFlow:M,shouldCreateEth:I,shouldCreateSol:F}}),t("RecoveryOAuthScreen")}function O(){g?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),k({shouldCallAuthOnSuccess:g?.setWalletPassword?.callAuthOnSuccessOnClose??!1})}return w.current=O,/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(u.ModalHeader,{onClose:O,backFn:r?()=>o(!1):s?c:void 0,infoFn:s||r?void 0:()=>o(!0)},"header"),r?/*#__PURE__*/e.jsx(m,{onClose:()=>o(!1)}):/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.CenteredScreenHeader,{title:W?"Update backup method":"Secure your account",icon:/*#__PURE__*/e.jsx(j.default,{width:48}),description:B}),/*#__PURE__*/e.jsx(p.RecoveryContainer,{children:S.userOwnedRecoveryOptions.filter((e=>!["icloud","google-drive"].includes(b?.recoveryMethod||"")||e!==b?.recoveryMethod)).sort().map((r=>{switch(r){case"google-drive":/*#__PURE__*/return e.jsxs(y.LoginMethodButton,{onClick:()=>R("google-drive"),children:[/*#__PURE__*/e.jsx(x,{children:/*#__PURE__*/e.jsx(p.GoogleDrive,{style:{width:18}})}),"Back up to Google Drive"]},r);case"icloud":/*#__PURE__*/return e.jsxs(y.LoginMethodButton,{onClick:()=>R("icloud"),children:[/*#__PURE__*/e.jsx(x,{children:/*#__PURE__*/e.jsx(p.AppleICloud,{style:{width:24}})}),"Back up to Apple iCloud"]},r);case"user-passcode":/*#__PURE__*/return e.jsxs(y.LoginMethodButton,{onClick:()=>{t(h.embeddedWalletSetPasswordScreen({isCreatingWallet:P,skipSplashScreen:!0}))},children:[/*#__PURE__*/e.jsx(x,{children:/*#__PURE__*/e.jsx(q.default,{style:{width:18}})}),A?"Reset your":"Set a"," password"]},r);default:return null}}))})]}),/*#__PURE__*/e.jsx(u.BlobbyFooter,{})]})}};exports.RecoverySelectionScreen=w,exports.default=w;
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("@heroicons/react/24/outline/LockClosedIcon"),o=require("@heroicons/react/24/outline/PencilSquareIcon"),t=require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),i=require("react"),s=require("styled-components"),n=require("./get-is-unified-wallet-D4ouXJpi.js"),c=require("./Button-Bm_Ft0Dw.js"),u=require("./ModalHeader-DB7Tbjwz.js"),l=require("./ScreenHeader-CyURV6Ti.js"),a=require("./context-DFq1obBO.js"),d=require("./internal-context-NWsAL807.js"),h=require("./index-NJrQkxJ7.js"),p=require("./styles-Ca_DS00a.js"),y=require("./useActiveWallet-BOX8xCn9.js");function v(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("viem"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("@privy-io/js-sdk-core"),require("tinycolor2"),require("ofetch"),require("uuid"),require("jose"),require("eventemitter3"),require("./useWallets-BLFNjTwC.js"),require("./prepareFundingModalData-Cnd6rhhJ.js"),require("@coinbase/wallet-sdk"),require("@privy-io/ethereum"),require("mipd"),require("react-device-detect"),require("viem/utils"),require("@privy-io/popup"),require("./paths-DizMb-lU.js"),require("./usePrivy-CcfSRv1R.js"),require("./events-context-Di6--rDg.js"),require("@scure/base"),require("zustand"),require("@headlessui/react"),require("@walletconnect/ethereum-provider"),require("@privy-io/urls"),require("./getPublicClient-CGlodIp_.js"),require("js-cookie"),require("./frame-B14fp9oC.js"),require("@privy-io/routes"),require("x402/client"),require("@privy-io/api-base"),require("viem/accounts"),require("./use-sign-with-user-signer-BcAsQTGF.js"),require("./getEmbeddedConnectedWallet-6TsVZJkD.js");var q=/*#__PURE__*/v(r),j=/*#__PURE__*/v(o),g=/*#__PURE__*/v(t);let x=/*#__PURE__*/s.styled.div.withConfig({displayName:"IconContainer",componentId:"sc-1c4e63fb-0"})(["width:24px;height:24px;display:flex;justify-content:center;align-items:center;"]),C={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy","privy-v2":"Privy"},m=({onClose:r})=>/*#__PURE__*/e.jsxs(p.RecoveryExplainerContainer,{children:[/*#__PURE__*/e.jsx(l.CenteredScreenHeader,{title:"Why do I need to secure my account?",icon:/*#__PURE__*/e.jsx(g.default,{width:48}),description:/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),/*#__PURE__*/e.jsx("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. It’s important you don’t lose access to the method you choose."})]})}),/*#__PURE__*/e.jsx(c.PrimaryButton,{onClick:r,children:"Select backup method"})]});const w={component:()=>{let[r,o]=i.useState(!1),{navigate:t,lastScreen:s,navigateBack:c,setModalData:v,data:g,onUserCloseViaDialogOrKeybindRef:w}=n.usePrivyModal(),{user:f}=n.usePrivyContext(),{embeddedWallets:S}=a.useAppConfig(),{closePrivyModal:b}=d.usePrivyInternal(),k=n.getPrivyPrimaryWallet(f),P=null===k,{isInAccountCreateFlow:M,isResettingPassword:A,shouldCreateEth:I,shouldCreateSol:F}=g.recoverySelection,W=k&&"privy"!==k.recoveryMethod,B=W?/*#__PURE__*/e.jsxs("span",{children:["Your account is currently secured using"," ",/*#__PURE__*/e.jsx("strong",{children:C[k?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function R(e){v({recoveryOAuthStatus:{provider:e,action:P?"create-wallet":"set-recovery",isInAccountCreateFlow:M,shouldCreateEth:I,shouldCreateSol:F}}),t("RecoveryOAuthScreen")}function O(){g?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),b({shouldCallAuthOnSuccess:g?.setWalletPassword?.callAuthOnSuccessOnClose??!1})}return w.current=O,/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(u.ModalHeader,{onClose:O,backFn:r?()=>o(!1):s?c:void 0,infoFn:s||r?void 0:()=>o(!0)},"header"),r?/*#__PURE__*/e.jsx(m,{onClose:()=>o(!1)}):/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.CenteredScreenHeader,{title:W?"Update backup method":"Secure your account",icon:/*#__PURE__*/e.jsx(q.default,{width:48}),description:B}),/*#__PURE__*/e.jsx(p.RecoveryContainer,{children:S.userOwnedRecoveryOptions.filter((e=>!["icloud","google-drive"].includes(k?.recoveryMethod||"")||e!==k?.recoveryMethod)).sort().map((r=>{switch(r){case"google-drive":/*#__PURE__*/return e.jsxs(y.LoginMethodButton,{onClick:()=>R("google-drive"),children:[/*#__PURE__*/e.jsx(x,{children:/*#__PURE__*/e.jsx(p.GoogleDrive,{style:{width:18}})}),"Back up to Google Drive"]},r);case"icloud":/*#__PURE__*/return e.jsxs(y.LoginMethodButton,{onClick:()=>R("icloud"),children:[/*#__PURE__*/e.jsx(x,{children:/*#__PURE__*/e.jsx(p.AppleICloud,{style:{width:24}})}),"Back up to Apple iCloud"]},r);case"user-passcode":/*#__PURE__*/return e.jsxs(y.LoginMethodButton,{onClick:()=>{t(h.embeddedWalletSetPasswordScreen({isCreatingWallet:P,skipSplashScreen:!0}))},children:[/*#__PURE__*/e.jsx(x,{children:/*#__PURE__*/e.jsx(j.default,{style:{width:18}})}),A?"Reset your":"Set a"," password"]},r);default:return null}}))})]}),/*#__PURE__*/e.jsx(u.BlobbyFooter,{})]})}};exports.RecoverySelectionScreen=w,exports.default=w;
@@ -1,4 +1,4 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("react"),i=require("styled-components"),n=require("./useActiveWallet-B5cSS56I.js"),o=require("./ModalHeader-4MV7Tgk7.js"),t=require("./index-CRFXS9pP.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=/*#__PURE__*/a(r);const c=/*#__PURE__*/i.styled.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);"]),s=/*#__PURE__*/i.styled.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);"]),d=/*#__PURE__*/i.styled.div.withConfig({displayName:"HeaderContainer",componentId:"sc-2e815abe-2"})(["position:relative;display:flex;flex-direction:column;"]),p=/*#__PURE__*/i.styled(o.ModalHeader).withConfig({displayName:"StyledModalHeader",componentId:"sc-2e815abe-3"})(["margin:0 -8px;"]),g=/*#__PURE__*/i.styled.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__*/i.styled.div.withConfig({displayName:"FooterContainer",componentId:"sc-2e815abe-5"})(["display:flex;flex-direction:column;gap:var(--screen-space-lg);"]);let u=/*#__PURE__*/i.styled.div.withConfig({displayName:"CenteredHeader",componentId:"sc-2e815abe-6"})(["text-align:center;display:flex;flex-direction:column;align-items:center;gap:var(--screen-space);"]),y=/*#__PURE__*/i.styled.div.withConfig({displayName:"TitleContainer",componentId:"sc-2e815abe-7"})(["display:flex;flex-direction:column;gap:4px;"]),v=/*#__PURE__*/i.styled.h3.withConfig({displayName:"HeaderTitle",componentId:"sc-2e815abe-8"})(["&&{font-size:20px;line-height:32px;font-weight:500;color:var(--privy-color-foreground);margin:0;}"]),x=/*#__PURE__*/i.styled.p.withConfig({displayName:"HeaderSubtitle",componentId:"sc-2e815abe-9"})(["&&{margin:0;font-size:16px;font-weight:300;line-height:24px;color:var(--privy-color-foreground);}"]),f=/*#__PURE__*/i.styled.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)"}})),m=/*#__PURE__*/i.styled.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;}"]),b=/*#__PURE__*/i.styled.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.jsx(c,{children:/*#__PURE__*/e.jsx(s,{...i,children:r})});let j=/*#__PURE__*/i.styled.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;"]),C=/*#__PURE__*/i.styled(o.BlobbyFooter).withConfig({displayName:"StyledBlobbyFooter",componentId:"sc-2e815abe-14"})(["padding:0;&& a{padding:0;color:var(--privy-color-foreground-3);}"]),k=/*#__PURE__*/i.styled.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)),I=({step:r})=>r?/*#__PURE__*/e.jsx(j,{children:/*#__PURE__*/e.jsx(k,{pct:Math.min(100,r.current/r.total*100)})}):null;w.Header=({title:r,subtitle:i,icon:n,iconVariant:o,iconLoadingStatus:t,showBack:a,onBack:l,showInfo:c,onInfo:s,showClose:g,onClose:h,step:f,...m})=>/*#__PURE__*/e.jsxs(d,{...m,children:[/*#__PURE__*/e.jsx(p,{backFn:a?l:void 0,infoFn:c?s:void 0,onClose:g?h:void 0,closeable:g}),(n||o||r||i)&&/*#__PURE__*/e.jsxs(u,{children:[n||o?/*#__PURE__*/e.jsx(w.Icon,{icon:n,variant:o,loadingStatus:t}):null,/*#__PURE__*/e.jsxs(y,{children:[r&&/*#__PURE__*/e.jsx(v,{children:r}),i&&/*#__PURE__*/e.jsx(x,{children:i})]})]}),f&&/*#__PURE__*/e.jsx(I,{step:f})]}),w.Body=/*#__PURE__*/l.default.forwardRef((({children:r,...i},n)=>/*#__PURE__*/e.jsx(g,{ref:n,...i,children:r}))),w.Body.displayName="Screen.Body",w.Footer=({children:r,...i})=>/*#__PURE__*/e.jsx(h,{id:"privy-content-footer-container",...i,children:r}),w.Actions=({children:r,...i})=>/*#__PURE__*/e.jsx(N,{...i,children:r}),w.HelpText=({children:r,...i})=>/*#__PURE__*/e.jsx(E,{...i,children:r}),w.Watermark=()=>/*#__PURE__*/e.jsx(C,{}),w.Icon=({icon:r,variant:i="subtle",loadingStatus:o})=>"logo"===i&&r?"string"==typeof r?/*#__PURE__*/e.jsx(m,{children:/*#__PURE__*/e.jsx("img",{src:r,alt:""})}):/*#__PURE__*/l.default.isValidElement(r)?/*#__PURE__*/e.jsx(m,{children:r}):
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("react"),i=require("styled-components"),n=require("./useActiveWallet-BOX8xCn9.js"),o=require("./ModalHeader-DB7Tbjwz.js"),t=require("./index-CRFXS9pP.js");function a(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var l=/*#__PURE__*/a(r);const c=/*#__PURE__*/i.styled.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);"]),s=/*#__PURE__*/i.styled.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);"]),d=/*#__PURE__*/i.styled.div.withConfig({displayName:"HeaderContainer",componentId:"sc-2e815abe-2"})(["position:relative;display:flex;flex-direction:column;"]),p=/*#__PURE__*/i.styled(o.ModalHeader).withConfig({displayName:"StyledModalHeader",componentId:"sc-2e815abe-3"})(["margin:0 -8px;"]),g=/*#__PURE__*/i.styled.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__*/i.styled.div.withConfig({displayName:"FooterContainer",componentId:"sc-2e815abe-5"})(["display:flex;flex-direction:column;gap:var(--screen-space-lg);"]);let u=/*#__PURE__*/i.styled.div.withConfig({displayName:"CenteredHeader",componentId:"sc-2e815abe-6"})(["text-align:center;display:flex;flex-direction:column;align-items:center;gap:var(--screen-space);"]),y=/*#__PURE__*/i.styled.div.withConfig({displayName:"TitleContainer",componentId:"sc-2e815abe-7"})(["display:flex;flex-direction:column;gap:4px;"]),v=/*#__PURE__*/i.styled.h3.withConfig({displayName:"HeaderTitle",componentId:"sc-2e815abe-8"})(["&&{font-size:20px;line-height:32px;font-weight:500;color:var(--privy-color-foreground);margin:0;}"]),x=/*#__PURE__*/i.styled.p.withConfig({displayName:"HeaderSubtitle",componentId:"sc-2e815abe-9"})(["&&{margin:0;font-size:16px;font-weight:300;line-height:24px;color:var(--privy-color-foreground);}"]),f=/*#__PURE__*/i.styled.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)"}})),m=/*#__PURE__*/i.styled.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;}"]),b=/*#__PURE__*/i.styled.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.jsx(c,{children:/*#__PURE__*/e.jsx(s,{...i,children:r})});let j=/*#__PURE__*/i.styled.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;"]),C=/*#__PURE__*/i.styled(o.BlobbyFooter).withConfig({displayName:"StyledBlobbyFooter",componentId:"sc-2e815abe-14"})(["padding:0;&& a{padding:0;color:var(--privy-color-foreground-3);}"]),k=/*#__PURE__*/i.styled.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)),I=({step:r})=>r?/*#__PURE__*/e.jsx(j,{children:/*#__PURE__*/e.jsx(k,{pct:Math.min(100,r.current/r.total*100)})}):null;w.Header=({title:r,subtitle:i,icon:n,iconVariant:o,iconLoadingStatus:t,showBack:a,onBack:l,showInfo:c,onInfo:s,showClose:g,onClose:h,step:f,...m})=>/*#__PURE__*/e.jsxs(d,{...m,children:[/*#__PURE__*/e.jsx(p,{backFn:a?l:void 0,infoFn:c?s:void 0,onClose:g?h:void 0,closeable:g}),(n||o||r||i)&&/*#__PURE__*/e.jsxs(u,{children:[n||o?/*#__PURE__*/e.jsx(w.Icon,{icon:n,variant:o,loadingStatus:t}):null,/*#__PURE__*/e.jsxs(y,{children:[r&&/*#__PURE__*/e.jsx(v,{children:r}),i&&/*#__PURE__*/e.jsx(x,{children:i})]})]}),f&&/*#__PURE__*/e.jsx(I,{step:f})]}),w.Body=/*#__PURE__*/l.default.forwardRef((({children:r,...i},n)=>/*#__PURE__*/e.jsx(g,{ref:n,...i,children:r}))),w.Body.displayName="Screen.Body",w.Footer=({children:r,...i})=>/*#__PURE__*/e.jsx(h,{id:"privy-content-footer-container",...i,children:r}),w.Actions=({children:r,...i})=>/*#__PURE__*/e.jsx(N,{...i,children:r}),w.HelpText=({children:r,...i})=>/*#__PURE__*/e.jsx(E,{...i,children:r}),w.Watermark=()=>/*#__PURE__*/e.jsx(C,{}),w.Icon=({icon:r,variant:i="subtle",loadingStatus:o})=>"logo"===i&&r?"string"==typeof r?/*#__PURE__*/e.jsx(m,{children:/*#__PURE__*/e.jsx("img",{src:r,alt:""})}):/*#__PURE__*/l.default.isValidElement(r)?/*#__PURE__*/e.jsx(m,{children:r}):
2
2
  /*#__PURE__*/e.jsx(m,{children:/*#__PURE__*/l.default.createElement(r)}):"loading"===i?r?
3
3
  /*#__PURE__*/e.jsx(b,{children:/*#__PURE__*/e.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:[/*#__PURE__*/e.jsx(n.ConnectionLoader,{success:o?.success,fail:o?.fail}),"string"==typeof r?
4
4
  /*#__PURE__*/e.jsx("span",{style:{background:`url('${r}') 0 0 / contain`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"contain"}}):/*#__PURE__*/l.default.isValidElement(r)?
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("./Button-DpuRzAgk.js"),n=require("./Screen-CJM19YNL.js");exports.ScreenLayout=({primaryCta:t,secondaryCta:l,helpText:s,watermark:a=!0,children:c,...i})=>{let u=t||l?/*#__PURE__*/e.jsxs(e.Fragment,{children:[t&&(()=>{let{label:n,...l}=t,s=l.variant||"primary";/*#__PURE__*/return e.jsx(r.Button,{...l,variant:s,style:{width:"100%",...l.style},children:n})})(),l&&(()=>{let{label:n,...t}=l,s=t.variant||"secondary";/*#__PURE__*/return e.jsx(r.Button,{...t,variant:s,style:{width:"100%",...t.style},children:n})})()]}):null;/*#__PURE__*/return e.jsxs(n.Screen,{id:i.id,className:i.className,children:[/*#__PURE__*/e.jsx(n.Screen.Header,{...i}),c?/*#__PURE__*/e.jsx(n.Screen.Body,{children:c}):null,s||u||a?/*#__PURE__*/e.jsxs(n.Screen.Footer,{children:[s?/*#__PURE__*/e.jsx(n.Screen.HelpText,{children:s}):null,u?/*#__PURE__*/e.jsx(n.Screen.Actions,{children:u}):null,a?/*#__PURE__*/e.jsx(n.Screen.Watermark,{}):null]}):null]})};
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("./Button-Bm_Ft0Dw.js"),n=require("./Screen-D9Tvi297.js");exports.ScreenLayout=({primaryCta:t,secondaryCta:l,helpText:s,watermark:a=!0,children:c,...i})=>{let u=t||l?/*#__PURE__*/e.jsxs(e.Fragment,{children:[t&&(()=>{let{label:n,...l}=t,s=l.variant||"primary";/*#__PURE__*/return e.jsx(r.Button,{...l,variant:s,style:{width:"100%",...l.style},children:n})})(),l&&(()=>{let{label:n,...t}=l,s=t.variant||"secondary";/*#__PURE__*/return e.jsx(r.Button,{...t,variant:s,style:{width:"100%",...t.style},children:n})})()]}):null;/*#__PURE__*/return e.jsxs(n.Screen,{id:i.id,className:i.className,children:[/*#__PURE__*/e.jsx(n.Screen.Header,{...i}),c?/*#__PURE__*/e.jsx(n.Screen.Body,{children:c}):null,s||u||a?/*#__PURE__*/e.jsxs(n.Screen.Footer,{children:[s?/*#__PURE__*/e.jsx(n.Screen.HelpText,{children:s}):null,u?/*#__PURE__*/e.jsx(n.Screen.Actions,{children:u}):null,a?/*#__PURE__*/e.jsx(n.Screen.Watermark,{}):null]}):null]})};
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("@heroicons/react/24/outline/ExclamationTriangleIcon"),t=require("@heroicons/react/24/outline/LockClosedIcon"),o=require("react"),i=require("./get-is-unified-wallet-CHHPpmxX.js"),n=require("./Button-DpuRzAgk.js"),l=require("./ModalHeader-4MV7Tgk7.js"),s=require("styled-components"),a=require("./Subtitle-Dtmrw8l5.js"),c=require("./Title-C-tHJvrb.js"),u=require("./context-Dn8Hzo8O.js"),d=require("./internal-context-NWsAL807.js"),y=require("./useActiveWallet-B5cSS56I.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("viem"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("@privy-io/js-sdk-core"),require("tinycolor2"),require("ofetch"),require("zustand"),require("react-device-detect"),require("./prepareFundingModalData-Bap-QRCV.js"),require("eventemitter3"),require("./events-context-Di6--rDg.js"),require("viem/utils"),require("./getPublicClient-CGlodIp_.js"),require("./useWallets-DPdw6ah8.js");var v=/*#__PURE__*/h(r),f=/*#__PURE__*/h(t);const g=/*#__PURE__*/s.styled.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)")),m={component:()=>{let{user:r}=i.usePrivyContext(),{client:t,walletProxy:s,refreshSessionAndUser:h,closePrivyModal:m}=d.usePrivyInternal(),j=i.usePrivyModal(),{entropyId:q,entropyIdVerifier:x}=j.data?.recoverWallet,[p,w]=o.useState(!1),[S,b]=o.useState(null),[C,I]=o.useState(null);function W(){if(!p){if(C)return j.data?.setWalletPassword?.onFailure(C),void m();if(!S)return j.data?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),void m()}}j.onUserCloseViaDialogOrKeybindRef.current=W;let P=!(!p&&!S);return C?/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:W},"header"),/*#__PURE__*/e.jsx(g,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:/*#__PURE__*/e.jsx(v.default,{height:38,width:38,stroke:"var(--privy-color-error)"})}),/*#__PURE__*/e.jsx(c.Title,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),/*#__PURE__*/e.jsx(y.Grow,{style:{minHeight:"2rem"}}),/*#__PURE__*/e.jsx(n.PrimaryButtonWithoutGray,{onClick:()=>I(null),children:"Try again"}),/*#__PURE__*/e.jsx(l.BlobbyFooter,{})]}):/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:W},"header"),/*#__PURE__*/e.jsx(f.default,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),/*#__PURE__*/e.jsx(c.Title,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),/*#__PURE__*/e.jsx(a.Subtitle,{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__*/e.jsx(y.Grow,{style:{minHeight:"2rem"}}),/*#__PURE__*/e.jsx(n.PrimaryButtonWithoutGray,{loading:p,disabled:P,onClick:()=>async function(){w(!0);try{let e=await t.getAccessToken(),o=i.getPrivyWalletWithAddress(r,q);if(!e||!s||!o)return;if(!(await s.setRecovery({accessToken:e,entropyId:q,entropyIdVerifier:x,existingRecoveryMethod:o.recoveryMethod,recoveryMethod:"privy"})).entropyId)throw Error("Unable to set recovery on wallet");let n=await h();if(!n)throw Error("Unable to set recovery on wallet");let l=i.getPrivyWalletWithAddress(n,o.address);if(!l)throw Error("Unabled to set recovery on wallet");b(!!n),setTimeout((()=>{j.data?.setWalletPassword?.onSuccess(l),m()}),u.DEFAULT_SUCCESS_SCREEN_DURATION_MS)}catch(e){I(e)}finally{w(!1)}}(),children:S?"Success":"Confirm"}),/*#__PURE__*/e.jsx(l.BlobbyFooter,{})]})}};exports.SetAutomaticRecoveryScreen=m,exports.default=m;
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("@heroicons/react/24/outline/ExclamationTriangleIcon"),t=require("@heroicons/react/24/outline/LockClosedIcon"),o=require("react"),i=require("./get-is-unified-wallet-D4ouXJpi.js"),n=require("./Button-Bm_Ft0Dw.js"),l=require("./ModalHeader-DB7Tbjwz.js"),s=require("styled-components"),a=require("./Subtitle-Dtmrw8l5.js"),c=require("./Title-C-tHJvrb.js"),u=require("./context-DFq1obBO.js"),d=require("./internal-context-NWsAL807.js"),y=require("./useActiveWallet-BOX8xCn9.js");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("viem"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("@privy-io/js-sdk-core"),require("tinycolor2"),require("ofetch"),require("zustand"),require("react-device-detect"),require("./prepareFundingModalData-Cnd6rhhJ.js"),require("eventemitter3"),require("./events-context-Di6--rDg.js"),require("viem/utils"),require("./getPublicClient-CGlodIp_.js"),require("./useWallets-BLFNjTwC.js");var v=/*#__PURE__*/h(r),f=/*#__PURE__*/h(t);const g=/*#__PURE__*/s.styled.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)")),m={component:()=>{let{user:r}=i.usePrivyContext(),{client:t,walletProxy:s,refreshSessionAndUser:h,closePrivyModal:m}=d.usePrivyInternal(),j=i.usePrivyModal(),{entropyId:q,entropyIdVerifier:x}=j.data?.recoverWallet,[p,w]=o.useState(!1),[S,b]=o.useState(null),[C,I]=o.useState(null);function W(){if(!p){if(C)return j.data?.setWalletPassword?.onFailure(C),void m();if(!S)return j.data?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),void m()}}j.onUserCloseViaDialogOrKeybindRef.current=W;let P=!(!p&&!S);return C?/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:W},"header"),/*#__PURE__*/e.jsx(g,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:/*#__PURE__*/e.jsx(v.default,{height:38,width:38,stroke:"var(--privy-color-error)"})}),/*#__PURE__*/e.jsx(c.Title,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),/*#__PURE__*/e.jsx(y.Grow,{style:{minHeight:"2rem"}}),/*#__PURE__*/e.jsx(n.PrimaryButtonWithoutGray,{onClick:()=>I(null),children:"Try again"}),/*#__PURE__*/e.jsx(l.BlobbyFooter,{})]}):/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:W},"header"),/*#__PURE__*/e.jsx(f.default,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),/*#__PURE__*/e.jsx(c.Title,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),/*#__PURE__*/e.jsx(a.Subtitle,{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__*/e.jsx(y.Grow,{style:{minHeight:"2rem"}}),/*#__PURE__*/e.jsx(n.PrimaryButtonWithoutGray,{loading:p,disabled:P,onClick:()=>async function(){w(!0);try{let e=await t.getAccessToken(),o=i.getPrivyWalletWithAddress(r,q);if(!e||!s||!o)return;if(!(await s.setRecovery({accessToken:e,entropyId:q,entropyIdVerifier:x,existingRecoveryMethod:o.recoveryMethod,recoveryMethod:"privy"})).entropyId)throw Error("Unable to set recovery on wallet");let n=await h();if(!n)throw Error("Unable to set recovery on wallet");let l=i.getPrivyWalletWithAddress(n,o.address);if(!l)throw Error("Unabled to set recovery on wallet");b(!!n),setTimeout((()=>{j.data?.setWalletPassword?.onSuccess(l),m()}),u.DEFAULT_SUCCESS_SCREEN_DURATION_MS)}catch(e){I(e)}finally{w(!1)}}(),children:S?"Success":"Confirm"}),/*#__PURE__*/e.jsx(l.BlobbyFooter,{})]})}};exports.SetAutomaticRecoveryScreen=m,exports.default=m;
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./context-Dn8Hzo8O.js"),o=require("./get-is-unified-wallet-CHHPpmxX.js"),n=require("@heroicons/react/24/outline/ExclamationTriangleIcon"),s=require("./Layouts-dRL0OSpp.js"),a=require("./ModalHeader-4MV7Tgk7.js"),i=require("./shared-BjdszO5f.js"),l=require("styled-components"),c=require("./Button-DpuRzAgk.js"),d=require("./Checkbox-DXPQZFlQ.js"),u=require("@heroicons/react/24/outline/KeyIcon"),h=require("@heroicons/react/24/solid/CheckCircleIcon"),p=require("fast-password-entropy"),x=require("secure-password-utilities"),j=require("secure-password-utilities/wordlists"),g=require("@heroicons/react/24/outline/ArrowDownTrayIcon"),y=require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon"),m=require("@heroicons/react/24/outline/DocumentDuplicateIcon"),f=require("@heroicons/react/24/solid/XCircleIcon"),v=require("./ScreenHeader-CyURV6Ti.js");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function w(e){if(e&&"object"==typeof e&&"default"in e)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}var C=/*#__PURE__*/b(n),S=/*#__PURE__*/b(u),k=/*#__PURE__*/b(h),I=/*#__PURE__*/b(p),B=/*#__PURE__*/w(x),R=/*#__PURE__*/b(g),P=/*#__PURE__*/b(y),E=/*#__PURE__*/b(m),q=/*#__PURE__*/b(f);const F=({buttonHideAnimations:t,buttonLoading:o,password:n,onSubmit:l,onBack:c})=>{let[d,u]=r.useState(!0),[h,p]=r.useState(!1),[x,j]=r.useState(""),g=n===x;return r.useEffect((()=>{x&&!h&&p(!0)}),[x]),/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(a.ModalHeader,{closeable:!1,backFn:c}),/*#__PURE__*/e.jsx(s.RefactorSpacerTop,{}),/*#__PURE__*/e.jsxs(i.EmbeddedWalletScreenContainer,{children:[/*#__PURE__*/e.jsxs(i.Header,{children:[/*#__PURE__*/e.jsx(C.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/e.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),/*#__PURE__*/e.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),/*#__PURE__*/e.jsxs(i.PasswordContainer,{children:[/*#__PURE__*/e.jsx(i.PasswordInput,{value:x,onChange:e=>j(e.target.value),onKeyUp:e=>{"Enter"===e.key&&l()},onBlur:()=>p(!0),placeholder:"confirm your password",type:d?"password":"text",style:{paddingRight:"2.3rem"}}),/*#__PURE__*/e.jsx(i.InputRightIcons,{style:{right:"0.75rem"},children:d?/*#__PURE__*/e.jsx(i.HiddenIcon,{onClick:()=>u(!1)}):/*#__PURE__*/e.jsx(i.ShownIcon,{onClick:()=>u(!0)})})]}),
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./context-DFq1obBO.js"),o=require("./get-is-unified-wallet-D4ouXJpi.js"),n=require("@heroicons/react/24/outline/ExclamationTriangleIcon"),s=require("./Layouts-dRL0OSpp.js"),a=require("./ModalHeader-DB7Tbjwz.js"),i=require("./shared-CCAyvw5i.js"),l=require("styled-components"),c=require("./Button-Bm_Ft0Dw.js"),d=require("./Checkbox-DXPQZFlQ.js"),u=require("@heroicons/react/24/outline/KeyIcon"),h=require("@heroicons/react/24/solid/CheckCircleIcon"),p=require("fast-password-entropy"),x=require("secure-password-utilities"),j=require("secure-password-utilities/wordlists"),g=require("@heroicons/react/24/outline/ArrowDownTrayIcon"),y=require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon"),m=require("@heroicons/react/24/outline/DocumentDuplicateIcon"),f=require("@heroicons/react/24/solid/XCircleIcon"),v=require("./ScreenHeader-CyURV6Ti.js");function b(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function w(e){if(e&&"object"==typeof e&&"default"in e)return e;var r=Object.create(null);return e&&Object.keys(e).forEach((function(t){if("default"!==t){var o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:function(){return e[t]}})}})),r.default=e,Object.freeze(r)}var C=/*#__PURE__*/b(n),S=/*#__PURE__*/b(u),k=/*#__PURE__*/b(h),I=/*#__PURE__*/b(p),B=/*#__PURE__*/w(x),R=/*#__PURE__*/b(g),P=/*#__PURE__*/b(y),E=/*#__PURE__*/b(m),q=/*#__PURE__*/b(f);const F=({buttonHideAnimations:t,buttonLoading:o,password:n,onSubmit:l,onBack:c})=>{let[d,u]=r.useState(!0),[h,p]=r.useState(!1),[x,j]=r.useState(""),g=n===x;return r.useEffect((()=>{x&&!h&&p(!0)}),[x]),/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(a.ModalHeader,{closeable:!1,backFn:c}),/*#__PURE__*/e.jsx(s.RefactorSpacerTop,{}),/*#__PURE__*/e.jsxs(i.EmbeddedWalletScreenContainer,{children:[/*#__PURE__*/e.jsxs(i.Header,{children:[/*#__PURE__*/e.jsx(C.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/e.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),/*#__PURE__*/e.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),/*#__PURE__*/e.jsxs(i.PasswordContainer,{children:[/*#__PURE__*/e.jsx(i.PasswordInput,{value:x,onChange:e=>j(e.target.value),onKeyUp:e=>{"Enter"===e.key&&l()},onBlur:()=>p(!0),placeholder:"confirm your password",type:d?"password":"text",style:{paddingRight:"2.3rem"}}),/*#__PURE__*/e.jsx(i.InputRightIcons,{style:{right:"0.75rem"},children:d?/*#__PURE__*/e.jsx(i.HiddenIcon,{onClick:()=>u(!1)}):/*#__PURE__*/e.jsx(i.ShownIcon,{onClick:()=>u(!0)})})]}),
2
2
  /*#__PURE__*/e.jsx(i.StatusText,{"aria-hidden":!h||g,error:!0,children:"Passwords do not match"})]}),/*#__PURE__*/e.jsx(i.NoAnimationPrimaryButton,{onClick:l,loading:o,disabled:!g,$hideAnimations:t,children:"Continue"}),/*#__PURE__*/e.jsx(s.RefactorSpacerBottom,{}),/*#__PURE__*/e.jsx(a.BlobbyFooter,{})]})},H=({buttonHideAnimations:t,buttonLoading:o,onSubmit:n,onBack:l,config:u})=>{let[h,p]=r.useState(!1);/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(a.ModalHeader,{closeable:!1,backFn:l}),/*#__PURE__*/e.jsx(s.RefactorSpacerTop,{}),/*#__PURE__*/e.jsxs(i.EmbeddedWalletScreenContainer,{children:[/*#__PURE__*/e.jsxs(i.Header,{children:[/*#__PURE__*/e.jsx(C.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),/*#__PURE__*/e.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),/*#__PURE__*/e.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),/*#__PURE__*/e.jsx(i.Details,{children:/*#__PURE__*/e.jsxs(i.DetailItem,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:e=>{e.preventDefault(),p((e=>!e))},children:[/*#__PURE__*/e.jsx(d.Checkbox,{color:"var(--privy-color-error)",readOnly:!0,checked:h}),/*#__PURE__*/e.jsx(e.Fragment,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),/*#__PURE__*/e.jsxs(A,{children:["user"===u.initiatedBy&&/*#__PURE__*/e.jsx(c.SecondaryButton,{onClick:u.onCancel,disabled:o,children:"Cancel"}),/*#__PURE__*/e.jsx(i.NoAnimationPrimaryButton,{onClick:n,loading:o,$hideAnimations:t,disabled:!h,children:"Set Password"})]}),/*#__PURE__*/e.jsx(s.RefactorSpacerBottom,{}),/*#__PURE__*/e.jsx(a.BlobbyFooter,{})]})};let A=/*#__PURE__*/l.styled.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-d1659c5f-0"})(["display:flex;gap:10px;"]),D=/[a-z]/,T=/[A-Z]/,$=/[0-9]/,L="!@#$%^&*()\\-_+.",M=`a-zA-Z0-9${L}`,O=RegExp(`[${L}]`),U=RegExp(`[${M}]`);const N=RegExp(`^[${M}]{6,}$`);function W(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function z(e=""){return(.3*function(e){if(e.length<8)return 0;let r=0;return D.test(e)&&(r+=1),T.test(e)&&(r+=1),$.test(e)&&(r+=1),O.test(e)&&(r+=1),Math.max(0,Math.min(1,r/3))}(e)+I.default(e)/95)/2}const _=({buttonHideAnimations:t,buttonLoading:o,password:n="",config:l,isResettingPassword:c,onSubmit:d,onClose:u,onBack:h,onPasswordChange:p,onPasswordGenerate:x})=>{let[j,g]=r.useState(!1),[y,m]=r.useState(!1);r.useEffect((()=>{n&&!y&&m(!0)}),[n]);let f=r.useMemo((()=>y?6>(n?.length||0)?"Password must be at least 6 characters":N.test(n||"")?null:`Invalid characters used ( ${((e="")=>[...new Set(e.split("").filter((e=>!U.test(e))).map((e=>e.replace(" ","SPACE"))))])(n).join(" ")} )`:null),[n,y]),v=r.useMemo((()=>f?{value:0,label:"Weak"}:function(e=""){let r=z(e);return{value:r,label:W(r)}}(n)),[n,f]),b=r.useMemo((()=>!n?.length||!!f),[f,n]);/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(a.ModalHeader,{onClose:u,closeable:"user"===l.initiatedBy,backFn:h}),/*#__PURE__*/e.jsx(s.RefactorSpacerTop,{}),/*#__PURE__*/e.jsxs(i.EmbeddedWalletScreenContainer,{children:[/*#__PURE__*/e.jsxs(i.Header,{children:[/*#__PURE__*/e.jsx(S.default,{height:48,width:48,stroke:"var(--privy-color-accent)"}),/*#__PURE__*/e.jsxs("h3",{style:{color:"var(--privy-color-foreground)"},children:[c?"Reset":"Set"," your password"]}),/*#__PURE__*/e.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),/*#__PURE__*/e.jsxs(i.PasswordContainer,{children:[/*#__PURE__*/e.jsx(i.PasswordInput,{value:n,onChange:e=>p(e.target.value),onKeyUp:e=>{"Enter"===e.key&&d()},placeholder:"enter or generate a strong password",type:j?"password":"text",style:{paddingRight:"3.8rem"}}),/*#__PURE__*/e.jsxs(i.InputRightIcons,{style:{width:"3.5rem"},children:[j?/*#__PURE__*/e.jsx(i.HiddenIcon,{onClick:()=>g(!1)}):/*#__PURE__*/e.jsx(i.ShownIcon,{onClick:()=>g(!0)}),/*#__PURE__*/e.jsx(i.RegenerateIcon,{onClick:x})]})]}),/*#__PURE__*/e.jsx(i.StrengthMeter,{value:0===v.value?.01:v.value,label:v.label}),/*#__PURE__*/e.jsx(i.StatusText,{error:!!f,children:f||`Password Strength: ${y?v.label:"--"}`}),/*#__PURE__*/e.jsxs(K,{children:[/*#__PURE__*/e.jsx(G,{children:/*#__PURE__*/e.jsxs(i.Details,{children:[/*#__PURE__*/e.jsxs(i.DetailItem,{children:[/*#__PURE__*/e.jsx(k.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),/*#__PURE__*/e.jsxs(i.DetailItem,{children:[/*#__PURE__*/e.jsx(k.default,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),/*#__PURE__*/e.jsx(i.NoAnimationPrimaryButton,{onClick:d,loading:o,disabled:b,$hideAnimations:t,children:"Continue"})]})]}),/*#__PURE__*/e.jsx(s.RefactorSpacerBottom,{}),/*#__PURE__*/e.jsx(a.BlobbyFooter,{})]})};let G=/*#__PURE__*/l.styled(i.Details).withConfig({displayName:"DetailsContainer",componentId:"sc-2da5fe90-0"})(["flex:1;padding-top:1rem;"]),K=/*#__PURE__*/l.styled.div.withConfig({displayName:"LowerContainer",componentId:"sc-2da5fe90-1"})(["display:flex;flex-direction:column;height:100%;"]);const Y=({buttonHideAnimations:t,buttonLoading:o,appName:n,password:l,onSubmit:c,onBack:d})=>{let[u,h]=r.useState(!1),[p,x]=r.useState(!0),j=r.useCallback((()=>{h(!0),l&&navigator.clipboard.writeText(l)}),[l]),g=r.useCallback((()=>{let e=document.createElement("a"),r=n.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),t=new Blob([Z(n,l)],{type:"text/plain"}),o=URL.createObjectURL(t);e.href=o,e.target="_blank",e.download=`${r}-privy-wallet-recovery.txt`,document.body.appendChild(e),e.click(),setTimeout((()=>{e.remove(),URL.revokeObjectURL(o)}),5e3)}),[l]);/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(a.ModalHeader,{backFn:d,closeable:!1}),/*#__PURE__*/e.jsx(s.RefactorSpacerTop,{}),/*#__PURE__*/e.jsxs(i.EmbeddedWalletScreenContainer,{children:[/*#__PURE__*/e.jsxs(i.Header,{children:[/*#__PURE__*/e.jsx(C.default,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/e.jsx("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),/*#__PURE__*/e.jsx("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),/*#__PURE__*/e.jsxs(i.PasswordContainer,{centered:!0,children:[/*#__PURE__*/e.jsx(i.PasswordDisplay,{children:p?"•".repeat(l.length):l}),/*#__PURE__*/e.jsx(i.InputRightIcons,{style:{right:"0.75rem"},children:p?/*#__PURE__*/e.jsx(i.HiddenIcon,{onClick:()=>x(!1)}):/*#__PURE__*/e.jsx(i.ShownIcon,{onClick:()=>x(!0)})})]}),/*#__PURE__*/e.jsxs("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[/*#__PURE__*/e.jsx(i.ExportButton,{onClick:j,children:u?/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(P.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(E.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),/*#__PURE__*/e.jsxs(i.ExportButton,{onClick:g,children:[/*#__PURE__*/e.jsx(R.default,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),/*#__PURE__*/e.jsx(i.NoAnimationPrimaryButton,{onClick:c,loading:o,$hideAnimations:t,children:"Continue"}),/*#__PURE__*/e.jsx(s.RefactorSpacerBottom,{}),/*#__PURE__*/e.jsx(a.BlobbyFooter,{})]})};let Z=(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 X=({error:r,onClose:t})=>/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(a.ModalHeader,{closeable:!1}),/*#__PURE__*/e.jsx(s.RefactorSpacerTop,{}),r?/*#__PURE__*/e.jsxs(s.CenteredItemWithGap,{children:[/*#__PURE__*/e.jsx(q.default,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),/*#__PURE__*/e.jsx(v.CenteredScreenHeader,{title:"Something went wrong",description:r})]}):/*#__PURE__*/e.jsxs(s.CenteredItemWithGap,{children:[/*#__PURE__*/e.jsx(k.default,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/e.jsx(v.CenteredScreenHeader,{title:"Success"})]}),/*#__PURE__*/e.jsx(c.PrimaryButton,{onClick:t,children:"Close"}),/*#__PURE__*/e.jsx(s.RefactorSpacerBottom,{}),/*#__PURE__*/e.jsx(a.BlobbyFooter,{})]});let J=(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}};exports.SetWalletPasswordForm=({onSubmit:n,...s})=>{let{lastScreen:a,navigate:i}=o.usePrivyModal(),{send:l,state:c}=(()=>{let[e,t]=r.useReducer(J,"creating");return{send:t,state:e}})(),d=r.useCallback((async()=>{"finalizing"===c&&await n(),l("next")}),[c,l,n]);r.useEffect((()=>{let e;return"done"===c&&"automatic"===s.config.initiatedBy&&(e=setTimeout((()=>s.onClose?.()),t.DEFAULT_SUCCESS_SCREEN_DURATION_MS)),()=>{e&&clearTimeout(e)}}),[c,s.config.initiatedBy,s.onClose]);let u=r.useCallback((()=>{l("back")}),[l]),h=r.useCallback((()=>{i("RecoverySelectionScreen")}),[a,i]);return"creating"===c?/*#__PURE__*/e.jsx(_,{...s,onSubmit:d,onBack:"RecoverySelectionScreen"===a?h:void 0}):"saving"===c?/*#__PURE__*/e.jsx(Y,{...s,onSubmit:d,onBack:u}):"confirming"===c?/*#__PURE__*/e.jsx(F,{...s,onSubmit:d,onBack:u}):"finalizing"===c?/*#__PURE__*/e.jsx(H,{...s,onSubmit:d,onBack:u}):"done"===c?/*#__PURE__*/e.jsx(X,{...s,onSubmit:d}):null},exports.generatePassphrase=()=>B.generatePassphrase(4,j.DEFAULT_WORDLIST);
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("@scure/base"),i=require("lucide-react"),t=require("react"),o=require("styled-components"),s=require("viem"),n=require("@privy-io/js-sdk-core"),a=require("./CopyToClipboard-fd8Z3kQX.js"),l=require("./Layouts-dRL0OSpp.js"),c=require("./JsonTree-xaeo0q6z.js"),d=require("./prepareFundingModalData-Bap-QRCV.js"),u=require("./context-Dn8Hzo8O.js"),p=require("./internal-context-NWsAL807.js"),y=require("./get-is-unified-wallet-CHHPpmxX.js"),g=require("./ScreenLayout-Bbhw-EIr.js");require("./copy-BiZ7dtqy.js"),require("eventemitter3"),require("tinycolor2"),require("ofetch"),require("./Button-DpuRzAgk.js"),require("./useActiveWallet-B5cSS56I.js"),require("zustand"),require("react-device-detect"),require("./events-context-Di6--rDg.js"),require("viem/utils"),require("./getPublicClient-CGlodIp_.js"),require("./useWallets-DPdw6ah8.js"),require("./Screen-CJM19YNL.js"),require("./ModalHeader-4MV7Tgk7.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("./index-CRFXS9pP.js");const x=/*#__PURE__*/o.styled.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 h=e=>{if(!s.isHex(e))return e;try{let r=s.hexToString(e);return r.includes("�")?e:r}catch{return e}},m=e=>{try{let i=r.base64.decode(e),t=(new TextDecoder).decode(i);return t.includes("�")?e:t}catch{return e}},q=r=>{let{types:i,primaryType:t,...o}=r.typedData;/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(j,{data:o}),/*#__PURE__*/e.jsx(a.CopytoClipboardButton,{text:(s=r.typedData,JSON.stringify(s,null,2)),itemName:"full payload to clipboard"})," "]});var s};const C=({method:r,messageData:t,copy:o,iconUrl:s,isLoading:n,success:a,walletProxyIsLoading:c,errorMessage:d,isCancellable:u,onSign:p,onCancel:y,onClose:C})=>/*#__PURE__*/e.jsx(g.ScreenLayout,{title:o.title,subtitle:o.description,showClose:!0,onClose:C,icon:i.Edit,iconVariant:"subtle",helpText:d?/*#__PURE__*/e.jsx(S,{children:d}):void 0,primaryCta:{label:o.buttonText,onClick:p,disabled:n||a||c,loading:n},secondaryCta:u?{label:"Not now",onClick:y,disabled:n||a||c}:void 0,watermark:!0,children:/*#__PURE__*/e.jsxs(l.FixedGappedContainer,{children:[s?/*#__PURE__*/e.jsx(x,{style:{alignSelf:"center"},size:"sm",src:s,alt:"app image"}):null,/*#__PURE__*/e.jsxs(E,{children:["personal_sign"===r&&/*#__PURE__*/e.jsx(T,{children:h(t)}),"eth_signTypedData_v4"===r&&/*#__PURE__*/e.jsx(q,{typedData:t}),"solana_signMessage"===r&&/*#__PURE__*/e.jsx(T,{children:m(t)})]})]})}),v={component:()=>{let{authenticated:r}=y.usePrivyContext(),{initializeWalletProxy:i,closePrivyModal:o}=p.usePrivyInternal(),{navigate:s,data:a,onUserCloseViaDialogOrKeybindRef:l}=y.usePrivyModal(),[c,g]=t.useState(!0),[x,h]=t.useState(""),[m,q]=t.useState(),[v,E]=t.useState(null),[S,j]=t.useState(!1);t.useEffect((()=>{r||s("LandingScreen")}),[r]),t.useEffect((()=>{i(u.WALLET_PROXY_TIMEOUT).then((e=>{g(!1),e||(h("An error has occurred, please try again."),q(new d.PrivyProviderRpcError(new d.ProviderRpcError(x,n.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))}))}),[]);let{method:T,data:w,confirmAndSign:f,onSuccess:R,onFailure:b,uiOptions:P}=a.signMessage,_={title:P?.title||"Sign message",description:P?.description||"Signing this message will not cost you any fees.",buttonText:P?.buttonText||"Sign and continue"},L=e=>{e?R(e):b(m||new d.PrivyProviderRpcError(new d.ProviderRpcError("The user rejected the request.",n.ProviderErrors.E4001_USER_REJECTED_REQUEST.eipCode))),o({shouldCallAuthOnSuccess:!1}),setTimeout((()=>{E(null),h(""),q(void 0)}),200)};l.current=()=>{L(v)};/*#__PURE__*/return e.jsx(C,{method:T,messageData:w,copy:_,iconUrl:P?.iconUrl&&"string"==typeof P.iconUrl?P.iconUrl:void 0,isLoading:S,success:null!==v,walletProxyIsLoading:c,errorMessage:x,isCancellable:P?.isCancellable,onSign:async()=>{j(!0),h("");try{let e=await f();E(e),j(!1),setTimeout((()=>{L(e)}),u.DEFAULT_SUCCESS_SCREEN_DURATION_MS)}catch(e){console.error(e),h("An error has occurred, please try again."),q(new d.PrivyProviderRpcError(new d.ProviderRpcError(x,n.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),j(!1)}},onCancel:()=>L(null),onClose:()=>L(v)})}};let E=/*#__PURE__*/o.styled.div.withConfig({displayName:"MessageContainer",componentId:"sc-124260c0-0"})(["flex:1;display:flex;flex-direction:column;gap:16px;"]),S=/*#__PURE__*/o.styled.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;}"]),j=/*#__PURE__*/o.styled(c.DisplayJsonTree).withConfig({displayName:"StyledDisplayJsonTree",componentId:"sc-124260c0-2"})(["margin-top:0;"]),T=/*#__PURE__*/o.styled(c.Message).withConfig({displayName:"StyledMessage",componentId:"sc-124260c0-3"})(["margin-top:0;"]);exports.SignRequestScreen=v,exports.SignRequestView=C,exports.default=v;
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("@scure/base"),i=require("lucide-react"),t=require("react"),o=require("styled-components"),s=require("viem"),n=require("@privy-io/js-sdk-core"),a=require("./CopyToClipboard-fd8Z3kQX.js"),l=require("./Layouts-dRL0OSpp.js"),c=require("./JsonTree-xaeo0q6z.js"),d=require("./prepareFundingModalData-Cnd6rhhJ.js"),u=require("./context-DFq1obBO.js"),p=require("./internal-context-NWsAL807.js"),y=require("./get-is-unified-wallet-D4ouXJpi.js"),g=require("./ScreenLayout-BeH-Q6N2.js");require("./copy-BiZ7dtqy.js"),require("eventemitter3"),require("tinycolor2"),require("ofetch"),require("./Button-Bm_Ft0Dw.js"),require("./useActiveWallet-BOX8xCn9.js"),require("zustand"),require("react-device-detect"),require("./events-context-Di6--rDg.js"),require("viem/utils"),require("./getPublicClient-CGlodIp_.js"),require("./useWallets-BLFNjTwC.js"),require("./Screen-D9Tvi297.js"),require("./ModalHeader-DB7Tbjwz.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("./index-CRFXS9pP.js");const x=/*#__PURE__*/o.styled.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 h=e=>{if(!s.isHex(e))return e;try{let r=s.hexToString(e);return r.includes("�")?e:r}catch{return e}},m=e=>{try{let i=r.base64.decode(e),t=(new TextDecoder).decode(i);return t.includes("�")?e:t}catch{return e}},q=r=>{let{types:i,primaryType:t,...o}=r.typedData;/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(j,{data:o}),/*#__PURE__*/e.jsx(a.CopytoClipboardButton,{text:(s=r.typedData,JSON.stringify(s,null,2)),itemName:"full payload to clipboard"})," "]});var s};const C=({method:r,messageData:t,copy:o,iconUrl:s,isLoading:n,success:a,walletProxyIsLoading:c,errorMessage:d,isCancellable:u,onSign:p,onCancel:y,onClose:C})=>/*#__PURE__*/e.jsx(g.ScreenLayout,{title:o.title,subtitle:o.description,showClose:!0,onClose:C,icon:i.Edit,iconVariant:"subtle",helpText:d?/*#__PURE__*/e.jsx(S,{children:d}):void 0,primaryCta:{label:o.buttonText,onClick:p,disabled:n||a||c,loading:n},secondaryCta:u?{label:"Not now",onClick:y,disabled:n||a||c}:void 0,watermark:!0,children:/*#__PURE__*/e.jsxs(l.FixedGappedContainer,{children:[s?/*#__PURE__*/e.jsx(x,{style:{alignSelf:"center"},size:"sm",src:s,alt:"app image"}):null,/*#__PURE__*/e.jsxs(E,{children:["personal_sign"===r&&/*#__PURE__*/e.jsx(T,{children:h(t)}),"eth_signTypedData_v4"===r&&/*#__PURE__*/e.jsx(q,{typedData:t}),"solana_signMessage"===r&&/*#__PURE__*/e.jsx(T,{children:m(t)})]})]})}),v={component:()=>{let{authenticated:r}=y.usePrivyContext(),{initializeWalletProxy:i,closePrivyModal:o}=p.usePrivyInternal(),{navigate:s,data:a,onUserCloseViaDialogOrKeybindRef:l}=y.usePrivyModal(),[c,g]=t.useState(!0),[x,h]=t.useState(""),[m,q]=t.useState(),[v,E]=t.useState(null),[S,j]=t.useState(!1);t.useEffect((()=>{r||s("LandingScreen")}),[r]),t.useEffect((()=>{i(u.WALLET_PROXY_TIMEOUT).then((e=>{g(!1),e||(h("An error has occurred, please try again."),q(new d.PrivyProviderRpcError(new d.ProviderRpcError(x,n.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))}))}),[]);let{method:T,data:w,confirmAndSign:f,onSuccess:R,onFailure:b,uiOptions:P}=a.signMessage,_={title:P?.title||"Sign message",description:P?.description||"Signing this message will not cost you any fees.",buttonText:P?.buttonText||"Sign and continue"},L=e=>{e?R(e):b(m||new d.PrivyProviderRpcError(new d.ProviderRpcError("The user rejected the request.",n.ProviderErrors.E4001_USER_REJECTED_REQUEST.eipCode))),o({shouldCallAuthOnSuccess:!1}),setTimeout((()=>{E(null),h(""),q(void 0)}),200)};l.current=()=>{L(v)};/*#__PURE__*/return e.jsx(C,{method:T,messageData:w,copy:_,iconUrl:P?.iconUrl&&"string"==typeof P.iconUrl?P.iconUrl:void 0,isLoading:S,success:null!==v,walletProxyIsLoading:c,errorMessage:x,isCancellable:P?.isCancellable,onSign:async()=>{j(!0),h("");try{let e=await f();E(e),j(!1),setTimeout((()=>{L(e)}),u.DEFAULT_SUCCESS_SCREEN_DURATION_MS)}catch(e){console.error(e),h("An error has occurred, please try again."),q(new d.PrivyProviderRpcError(new d.ProviderRpcError(x,n.ProviderErrors.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),j(!1)}},onCancel:()=>L(null),onClose:()=>L(v)})}};let E=/*#__PURE__*/o.styled.div.withConfig({displayName:"MessageContainer",componentId:"sc-124260c0-0"})(["flex:1;display:flex;flex-direction:column;gap:16px;"]),S=/*#__PURE__*/o.styled.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;}"]),j=/*#__PURE__*/o.styled(c.DisplayJsonTree).withConfig({displayName:"StyledDisplayJsonTree",componentId:"sc-124260c0-2"})(["margin-top:0;"]),T=/*#__PURE__*/o.styled(c.Message).withConfig({displayName:"StyledMessage",componentId:"sc-124260c0-3"})(["margin-top:0;"]);exports.SignRequestScreen=v,exports.SignRequestView=C,exports.default=v;
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("@privy-io/js-sdk-core"),r=require("./get-is-unified-wallet-CHHPpmxX.js"),a=require("./context-Dn8Hzo8O.js"),i=require("./internal-context-NWsAL807.js"),o=require("./useGetSolPrice-C986iVoO.js"),s=require("./ErrorScreen-DAUNTckD.js"),c=require("@heroicons/react/24/outline/CheckCircleIcon"),u=require("styled-components"),l=require("./Button-DpuRzAgk.js"),d=require("./Layouts-dRL0OSpp.js"),p=require("./ModalHeader-4MV7Tgk7.js"),m=require("./ScreenHeader-CyURV6Ti.js"),f=require("./Row-CxDF-VMy.js"),g=require("./Value-C-XtZyFa.js"),h=require("./WalletLink-CbnPrVEH.js"),y=require("./StackedContainer-ByB6Mdu0.js"),w=require("./useActiveWallet-B5cSS56I.js"),S=require("./TransactionErrorView-BdTYgWfc.js"),k=require("./transaction-DjF5X-by.js"),A=require("@solana/kit"),b=require("./useSolanaRpcClient-ZoxUaxNS.js"),v=require("./getFormattedUsdFromLamports-Mu2fqwL2.js");function j(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("viem"),require("tinycolor2"),require("ofetch"),require("lucide-react"),require("./index-4-C2N_7K.js"),require("uuid"),require("jose"),require("eventemitter3"),require("./useWallets-DPdw6ah8.js"),require("./prepareFundingModalData-Bap-QRCV.js"),require("@coinbase/wallet-sdk"),require("@privy-io/ethereum"),require("mipd"),require("react-device-detect"),require("viem/utils"),require("@privy-io/popup"),require("./paths-DizMb-lU.js"),require("./usePrivy-DobNyfbl.js"),require("./events-context-Di6--rDg.js"),require("@scure/base"),require("zustand"),require("@headlessui/react"),require("@walletconnect/ethereum-provider"),require("@privy-io/urls"),require("./getPublicClient-CGlodIp_.js"),require("js-cookie"),require("./frame-B14fp9oC.js"),require("@privy-io/routes"),require("x402/client"),require("@privy-io/api-base"),require("viem/accounts"),require("./use-sign-with-user-signer-BcAsQTGF.js"),require("./getEmbeddedConnectedWallet-6TsVZJkD.js"),require("./reservoir-CQGyEBb7.js"),require("./ScreenLayout-Bbhw-EIr.js"),require("./Screen-CJM19YNL.js"),require("./index-CRFXS9pP.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("./LoadingSkeleton-DoCrfGnl.js"),require("./ethers-BwK3McWK.js"),require("@heroicons/react/24/outline"),require("./ErrorMessage-f0cRWc29.js"),require("./LabelXs-CYMv6rOZ.js"),require("./Subtitle-Dtmrw8l5.js"),require("./Title-C-tHJvrb.js"),require("./Address-Doz93lgh.js"),require("./WalletInfoCard-DQtI0K25.js"),require("./shared-BPGwTh8c.js"),require("./Checkbox-DXPQZFlQ.js"),require("./ErrorBanner-CMjaobRI.js"),require("@heroicons/react/24/outline/ExclamationCircleIcon"),require("./WarningBanner-B_Gs_15p.js"),require("@heroicons/react/24/outline/ExclamationTriangleIcon"),require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon"),require("@heroicons/react/24/outline/ClipboardDocumentIcon");var I=/*#__PURE__*/j(c);const q=/*#__PURE__*/u.styled.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;}"],(e=>e.color??"var(--privy-color-accent)"),(e=>e.color??"var(--privy-color-accent)")),T=({instruction:t,fees:n,transactionInfo:r,solPrice:a,chain:i})=>/*#__PURE__*/e.jsxs(f.Rows,{children:[r?.action&&/*#__PURE__*/e.jsxs(f.Row,{children:[/*#__PURE__*/e.jsx(g.LabelSm,{children:"Action"}),/*#__PURE__*/e.jsx(g.Value,{children:r.action})]}),null!=t?.total&&/*#__PURE__*/e.jsxs(f.Row,{children:[/*#__PURE__*/e.jsx(g.LabelSm,{children:"Total"}),/*#__PURE__*/e.jsx(g.Value,{children:t.total})]}),!t?.total&&null!=t?.amount&&/*#__PURE__*/e.jsxs(f.Row,{children:[/*#__PURE__*/e.jsx(g.LabelSm,{children:"Total"}),/*#__PURE__*/e.jsx(g.Value,{children:/*#__PURE__*/e.jsx(h.SolanaPriceDisplay,{quantities:[t.amount,n],tokenPrice:a})})]}),/*#__PURE__*/e.jsxs(f.Row,{children:[/*#__PURE__*/e.jsx(g.LabelSm,{children:"Fees"}),/*#__PURE__*/e.jsx(g.Value,{children:/*#__PURE__*/e.jsx(h.SolanaPriceDisplay,{quantities:[n],tokenPrice:a})})]}),t?.to&&/*#__PURE__*/e.jsxs(f.Row,{children:[/*#__PURE__*/e.jsx(g.LabelSm,{children:"To"}),/*#__PURE__*/e.jsx(g.Value,{children:/*#__PURE__*/e.jsx(h.WalletLink,{walletAddress:t.to,chainId:i,chainType:"solana"})})]})]}),x=({fees:t,onClose:n,receiptHeader:r,receiptDescription:a,transactionInfo:i,solPrice:o,signOnly:s,instruction:c,chain:u})=>/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(p.ModalHeader,{onClose:n}),/*#__PURE__*/e.jsx(y.e,{style:{marginBottom:"16px"},children:/*#__PURE__*/e.jsxs("div",{children:[/*#__PURE__*/e.jsx(q,{color:"var(--privy-color-success-light)"}),/*#__PURE__*/e.jsx(I.default,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),/*#__PURE__*/e.jsx(m.CenteredScreenHeader,{title:r??`Transaction ${s?"signed":"complete"}!`,description:a??"You're all set."}),/*#__PURE__*/e.jsx(T,{solPrice:o,instruction:c,fees:t,transactionInfo:i,chain:u}),/*#__PURE__*/e.jsx(w.Grow,{}),/*#__PURE__*/e.jsx(C,{loading:!1,onClick:n,children:"Close"}),/*#__PURE__*/e.jsx(d.RefactorSpacerBottom,{}),/*#__PURE__*/e.jsx(p.BlobbyFooter,{})]});let C=/*#__PURE__*/u.styled(l.PrimaryButton).withConfig({displayName:"SubmitButton",componentId:"sc-3cb7ee42-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);async function O(e,t){try{return await e}catch{return t}}function _(e){switch(e){case"solana:mainnet":return"mainnet-beta";case"solana:devnet":return"devnet";case"solana:testnet":return"testnet"}}async function E({privyClient:e,chain:t,mint:n}){let r=v.DEFAULT_TOKENS_DATA[t];if(!r[n]){let a=await e.getSplTokenMetadata({mintAddress:n,cluster:_(t)});a&&(r[n]={address:n,symbol:a.symbol,decimals:a.decimals})}return r[n]}async function P({tx:e,solanaClient:t,privyClient:n,checkFunds:r}){let a=A.getCompiledTransactionMessageDecoder().decode(b.getTransactionMessageBytes(e)),i=a.staticAccounts[0]??"",o=await b.fetchTransactionEstimatedFees({solanaClient:t,tx:e}),s=r?await O(b.simulateTransaction({solanaClient:t,tx:e})):void 0,c=s?.hasFunds??!0,u={},l=[],d=await async function({solanaClient:e,message:t}){if(!("addressTableLookups"in t)||!t.addressTableLookups)return[...t.staticAccounts];let n=t.addressTableLookups.map((e=>e.lookupTableAddress)),r=await A.fetchAddressesForLookupTables(n,e.rpc),a=n.map(((e,n)=>[...t.addressTableLookups[n]?.writableIndexes.map((t=>{let a=r[e]?.[t];if(a)return{key:a,isWritable:!0,altIdx:n}}))??[],...t.addressTableLookups[n]?.readonlyIndexes.map((t=>{let a=r[e]?.[t];if(a)return{key:a,isWritable:!1,altIdx:n}}))??[]])).flat().filter((e=>!!e)).sort(((e,t)=>e.isWritable!==t.isWritable?e.isWritable?-1:1:e.altIdx-t.altIdx)).map((({key:e})=>e));return[...t.staticAccounts,...a]}({solanaClient:t,message:a});for(let e of a.instructions){let r=a.staticAccounts[e.programAddressIndex]||"";if(r!==v.TOKEN_PROGRAM_ID&&r!==v.TOKEN_2022_PROGRAM_ID)if(r!==v.SYSTEM_PROGRAM_ID){if(r===v.ASSOCIATED_TOKEN_PROGRAM_ID){let t=await O(function(e,t,n){let[r,a,i,o]=e.accountIndices?.map((e=>t[e]))??[];return{type:"ata-creation",program:n,payer:r,ata:a,owner:i,mint:o}}(e,d,r));if(!t){l.push({type:"unknown",program:r,discriminator:e.data?.[0]});continue}if(l.push(t),t.ata&&t.owner&&t.mint){u[t.ata]={owner:t.owner,mint:t.mint};continue}}if(v.RAYDIUM_SWAP_PROGRAM_IDS.includes(r)){let a=await O($(e,d,t,n,r));if(!a){l.push({type:"unknown",program:r,discriminator:e.data?.[0]});continue}l.push(a)}else if(v.JUPITER_SWAP_PROGRAM_IDS.includes(r)){let a=await O(F(e,d,t,n,r));if(!a){l.push({type:"unknown",program:r,discriminator:e.data?.[0]});continue}l.push(a)}else l.push({type:"unknown",program:r,discriminator:e.data?.[0]})}else{let t=await O(M(e,d));if(!t){l.push({type:"unknown",program:r,discriminator:e.data?.[0]});continue}l.push(t)}else{let a=await O(R(e,d,t,n,u,r));if(!a){l.push({type:"unknown",program:r,discriminator:e.data?.[0]});continue}l.push(a),"spl-transfer"===a.type&&(a.fromAta&&a.fromAccount&&a.token.address&&(u[a.fromAta]??={owner:a.fromAccount,mint:a.token.address}),a.toAta&&a.toAccount&&a.token.address&&(u[a.toAta]??={owner:a.toAccount,mint:a.token.address}))}}return{spender:i,fee:o,instructions:l,hasFunds:!!c}}function L(e,t=0){try{return function(e,t=0){let n=0n;for(let r=0;r<8;r++)n|=BigInt(e[t+r])<<BigInt(8*r);return n}(e,t)}catch{}try{return e.readBigInt64LE(t)}catch{}let n=b.bufferFrom(e);try{return((e,t=0)=>{let n=e[t],r=e[t+7];if(!n||!r)throw Error(`Buffer offset out of range: first: ${n}, last: ${r}.`);return(BigInt(e[t+4]+256*e[t+5]+65536*e[t+6]+(r<<24))<<32n)+BigInt(n+256*e[++t]+65536*e[++t]+16777216*e[++t])})(n)}catch{}try{return n.subarray(t).readBigInt64LE()}catch{}try{return n.readBigInt64LE(t)}catch{}return 0n}async function R(e,t,n,r,a,i){let o=e.data?.[0],s=e.accountIndices?.map((e=>t[e]))??[];if(1===o){let[e,t,n]=s;return{type:"spl-init-account",program:i,account:e,mint:t,owner:n}}if(3===o){let t,o,[c,u,l]=s,d="",p=u?a[u]:void 0;if(p)t=p.owner,d=p.mint;else if(u){let e=await n.rpc.getAccountInfo(u,{commitment:"confirmed",encoding:"jsonParsed"}).send(),r=e.value?.data;t=r?.parsed?.info?.owner,d=r?.parsed?.info?.mint??"",o=r?.parsed?.info?.tokenAmount?.decimals}if(!d&&c){let e=await n.rpc.getAccountInfo(c,{commitment:"confirmed",encoding:"jsonParsed"}).send(),t=e.value?.data;d=t?.parsed?.info?.mint??""}let m=await E({privyClient:r,chain:n.chain,mint:d}),f=m?.symbol??"";return o??=m?.decimals??9,{type:"spl-transfer",program:i,fromAta:c,fromAccount:l,toAta:u,toAccount:t,value:L(e.data,1),token:{symbol:f,decimals:o,address:d}}}if(9===o){let[e,t,n]=s;return{type:"spl-close-account",program:i,source:e,destination:t,owner:n}}if(17===o)return{type:"spl-sync-native",program:i};throw Error(`Token program instruction type ${o} not supported`)}async function M(e,t){let n=e.data?.[0],r=e.accountIndices?.map((e=>t[e]))??[];if(0===n){let[,t]=r;return{type:"create-account",program:v.SYSTEM_PROGRAM_ID,account:t?.toString(),value:L(e.data,4),withSeed:!1}}if(2===n){let[t,n]=r;return{type:"sol-transfer",program:v.SYSTEM_PROGRAM_ID,fromAccount:t,toAccount:n,token:{symbol:"SOL",decimals:9},value:L(e.data,4),withSeed:!1}}if(3===n){let[,t]=r;return{type:"create-account",program:v.SYSTEM_PROGRAM_ID,account:t,withSeed:!0,value:L(e.data.slice(e.data.length-32-8-8))}}if(11===n){let[t,n]=r;return{type:"sol-transfer",program:v.SYSTEM_PROGRAM_ID,fromAccount:t,toAccount:n,value:L(e.data,4),token:{symbol:"SOL",decimals:9},withSeed:!0}}throw Error(`System program instruction type ${n} not supported`)}async function $(e,t,n,r,a){let i=e.accountIndices?.map((e=>t[e]))??[],o=e.data?.[0];if(143===o){let t=i[10],o=i[11];return{type:"raydium-swap-base-input",program:a,mintIn:t,mintOut:o,tokenIn:t?await E({privyClient:r,chain:n.chain,mint:t}):void 0,tokenOut:o?await E({privyClient:r,chain:n.chain,mint:o}):void 0,amountIn:L(e.data,8),minimumAmountOut:L(e.data,16)}}if(55===o){let t=i[10],o=i[11];return{type:"raydium-swap-base-output",program:a,mintIn:t,mintOut:o,tokenIn:t?await E({privyClient:r,chain:n.chain,mint:t}):void 0,tokenOut:o?await E({privyClient:r,chain:n.chain,mint:o}):void 0,maxAmountIn:L(e.data,8),amountOut:L(e.data,16)}}throw Error(`Raydium swap program instruction type ${o} not supported`)}async function F(e,t,n,r,a){let i=e.data?.[0],o=e.accountIndices?.map((e=>t[e]))??[];if([208,51,239,151,123,43,237,92].includes(i)){let t=o[5],i=o[6];return{type:"jupiter-swap-exact-out-route",program:a,mintIn:t,mintOut:i,tokenIn:t?await E({privyClient:r,chain:n.chain,mint:t}):void 0,tokenOut:i?await E({privyClient:r,chain:n.chain,mint:i}):void 0,outAmount:L(e.data,e.data.length-1-2-8-8),quotedInAmount:L(e.data,e.data.length-1-2-8)}}if([176,209,105,168,154,125,69,62].includes(i)){let t=o[7],i=o[8];return{type:"jupiter-swap-exact-out-route",program:a,mintIn:t,mintOut:i,tokenIn:t?await E({privyClient:r,chain:n.chain,mint:t}):void 0,tokenOut:i?await E({privyClient:r,chain:n.chain,mint:i}):void 0,outAmount:L(e.data,e.data.length-1-2-8-8),quotedInAmount:L(e.data,e.data.length-1-2-8)}}if([193,32,155,51,65,214,156,129].includes(i)){let t=o[7],i=o[8];return{type:"jupiter-swap-shared-accounts-route",program:a,mintIn:t,mintOut:i,tokenIn:t?await E({privyClient:r,chain:n.chain,mint:t}):void 0,tokenOut:i?await E({privyClient:r,chain:n.chain,mint:i}):void 0,inAmount:L(e.data,e.data.length-1-2-8-8),quotedOutAmount:L(e.data,e.data.length-1-2-8)}}throw[62,198,214,193,213,159,108,210].includes(i)&&console.warn("Jupiter swap program instruction 'claim' not implemented"),[116,206,27,191,166,19,0,73].includes(i)&&console.warn("Jupiter swap program instruction 'claim_token' not implemented"),[26,74,236,151,104,64,183,249].includes(i)&&console.warn("Jupiter swap program instruction 'close_token' not implemented"),[229,194,212,172,8,10,134,147].includes(i)&&console.warn("Jupiter swap program instruction 'create_open_orders' not implemented"),[28,226,32,148,188,136,113,171].includes(i)&&console.warn("Jupiter swap program instruction 'create_program_open_orders' not implemented"),[232,242,197,253,240,143,129,52].includes(i)&&console.warn("Jupiter swap program instruction 'create_token_ledger' not implemented"),[147,241,123,100,244,132,174,118].includes(i)&&console.warn("Jupiter swap program instruction 'create_token_account' not implemented"),[229,23,203,151,122,227,173,42].includes(i)&&console.warn("Jupiter swap program instruction 'route' not implemented"),[150,86,71,116,167,93,14,104].includes(i)&&console.warn("Jupiter swap program instruction 'route_with_token_ledger' not implemented"),[228,85,185,112,78,79,77,2].includes(i)&&console.warn("Jupiter swap program instruction 'set_token_ledger' not implemented"),[230,121,143,80,119,159,106,170].includes(i)&&console.warn("Jupiter swap program instruction 'shared_accounts_route_with_token_ledger' not implemented"),Error(`Jupiter swap program instruction type ${i} not supported`)}const D={component:()=>{let{data:c,onUserCloseViaDialogOrKeybindRef:u,setModalData:l,navigate:d}=r.usePrivyModal(),{client:p,closePrivyModal:m,walletProxy:f,showFiatPrices:g}=i.usePrivyInternal(),h=a.useAppConfig(),{user:y}=r.usePrivyContext(),w=b.useSolanaRpcClient()(c?.standardSignAndSendTransaction?.chain??"solana:mainnet"),[j,I]=t.useState(c?.standardSignAndSendTransaction?.transaction),[q,T]=t.useState(),[C,O]=t.useState(),[_,E]=t.useState({value:0n,isLoading:!1}),[L,R]=t.useState(!1),[M,$]=t.useState({}),[F,D]=t.useState(),B=c?.standardSignAndSendTransaction?.account,W=!!c?.standardSignAndSendTransaction?.signOnly,J=B?.imported?r.getImportedPrivySolanaWallets(y).find((e=>e.address===B.address)):r.getPrivyPrimaryWallet(y),{solPrice:G,isSolPriceLoading:U}=o.useGetSolPrice({enabled:g}),V=t.useMemo((()=>{if(!q)return;let e=q.spender,t=k.getNativeCurrencyFromLamports(q.fee),r=k.getNativeCurrencyFromLamports(_.value,3,!0),a=q.instructions.filter((e=>["sol-transfer","spl-transfer","raydium-swap-base-input","raydium-swap-base-output","jupiter-swap-shared-accounts-route","jupiter-swap-exact-out-route"].includes(e.type))),i=a.at(0);if(!i||a.length>1)return{fee:t,spender:e,balance:r};if("sol-transfer"===i.type)return{fee:t,spender:e,balance:r,total:k.getNativeCurrencyFromLamports(i.value)};if("spl-transfer"===i.type)return{fee:t,spender:e,balance:r,total:`${n.formatTokenAmount({amount:i.value,decimals:i.token.decimals})} ${i.token.symbol}`};if("raydium-swap-base-input"===i.type&&i.tokenIn&&i.tokenOut){return{fee:t,spender:e,balance:r,swap:`${`${n.formatTokenAmount({amount:i.amountIn,decimals:i.tokenIn.decimals})} ${i.tokenIn.symbol}`} → ${`${n.formatTokenAmount({amount:i.minimumAmountOut,decimals:i.tokenOut.decimals})} ${i.tokenOut.symbol}`}`}}if("raydium-swap-base-output"===i.type&&i.tokenIn&&i.tokenOut){return{fee:t,spender:e,balance:r,swap:`${`${n.formatTokenAmount({amount:i.maxAmountIn,decimals:i.tokenIn.decimals})} ${i.tokenIn.symbol}`} → ${`${n.formatTokenAmount({amount:i.amountOut,decimals:i.tokenOut.decimals})} ${i.tokenOut.symbol}`}`}}if("jupiter-swap-shared-accounts-route"===i.type&&i.tokenIn&&i.tokenOut){return{fee:t,spender:e,balance:r,swap:`${`${n.formatTokenAmount({amount:i.inAmount,decimals:i.tokenIn.decimals})} ${i.tokenIn.symbol}`} → ${`${n.formatTokenAmount({amount:i.quotedOutAmount,decimals:i.tokenOut.decimals})} ${i.tokenOut.symbol}`}`}}if("jupiter-swap-exact-out-route"===i.type&&i.tokenIn&&i.tokenOut){return{fee:t,spender:e,balance:r,swap:`${`${n.formatTokenAmount({amount:i.quotedInAmount,decimals:i.tokenIn.decimals})} ${i.tokenIn.symbol}`} → ${`${n.formatTokenAmount({amount:i.outAmount,decimals:i.tokenOut.decimals})} ${i.tokenOut.symbol}`}`}}return{fee:t,spender:e,balance:r}}),[q,B?.address,_]),N=t.useMemo((()=>{let e;if(!q||!g||!G||U)return;function t(...e){return v.getFormattedUsdFromLamports(e.reduce(((e,t)=>e+t),0n),G??0)}B?.address===q.spender&&(e=t(q.fee));let r=t(_.value),a=q.instructions.filter((e=>"sol-transfer"===e.type||"spl-transfer"===e.type)).at(0);return!a||q.instructions.length>1?{fee:e,balance:r}:"sol-transfer"===a.type?{fee:e,balance:r,total:t(a.value,B?.address===q.spender?q.fee:0n)}:"spl-transfer"===a.type?{fee:e,balance:r,total:`${n.formatTokenAmount({amount:a.value,decimals:a.token.decimals})} ${a.token.symbol}`}:{fee:e,balance:r}}),[q,g,G,U,B?.address,_]);if(t.useEffect((()=>{!async function(){if(j&&p)try{O(void 0);let e=await P({tx:j,solanaClient:w,privyClient:p,checkFunds:!W});T(e)}catch(e){console.error("Failed to prepare transaction",e),O(e)}}()}),[j,w,p,W]),t.useEffect((()=>{(async function(){if(!B)return;E({value:_.value,isLoading:!0});let{value:e}=await w.rpc.getBalance(B.address,{commitment:"confirmed"}).send();E({value:e??0n,isLoading:!1})})().catch(console.error)}),[q]),!j||!c?.standardSignAndSendTransaction||!B){let t=Error("Invalid transaction request");/*#__PURE__*/return e.jsx(s.ErrorScreenView,{error:t,allowlistConfig:h.allowlistConfig,onRetry:()=>{c?.standardSignAndSendTransaction?.onFailure(t),m({shouldCallAuthOnSuccess:!1})}})}let H=()=>{if(!L)return M.signature||M.signedTransaction?c?.standardSignAndSendTransaction?.onSuccess({signature:M.signature,signedTransaction:M.signedTransaction}):c?.standardSignAndSendTransaction?.onFailure(F??C??Error("User exited the modal before submitting the transaction")),m({shouldCallAuthOnSuccess:!1})};u.current=H;let Y=c.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?/*#__PURE__*/e.jsx("img",{src:c.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:c.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,K=!!(c.funding&&c.funding.supportedOptions.length>0),z=!q?.hasFunds&&K;if(M.signature||M.signedTransaction){let t=q?.instructions.filter((e=>"sol-transfer"===e.type||"spl-transfer"===e.type)),n=1===t?.length?t?.at(0):void 0;/*#__PURE__*/return e.jsx(x,{fees:M.fees??0n,onClose:H,transactionInfo:c.standardSignAndSendTransaction?.uiOptions.transactionInfo,solPrice:G,receiptHeader:c.standardSignAndSendTransaction?.uiOptions.successHeader,receiptDescription:c.standardSignAndSendTransaction?.uiOptions.successDescription,chain:w.chain,signOnly:W,instruction:"sol-transfer"===n?.type?{to:n.toAccount,amount:n.value}:{to:n?.toAccount||n?.toAta,total:V?.total}})}return F?/*#__PURE__*/e.jsx(S.TransactionErrorView,{transactionError:F,chainId:w.chain,onClose:H,chainType:"solana",onRetry:async()=>{D(void 0);let{value:e}=await w.rpc.getLatestBlockhash().send();var t,n;I((t=j,n=e,A.pipe(A.getCompiledTransactionMessageDecoder().decode(b.getTransactionMessageBytes(t)),(e=>A.decompileTransactionMessage(e)),(e=>A.setTransactionMessageLifetimeUsingBlockhash(n,e)),(e=>A.compileTransaction(e)),(e=>new Uint8Array(A.getTransactionEncoder().encode(e))))))}}):/*#__PURE__*/e.jsx(S.SendSolanaTransactionScreenView,{img:Y,title:c.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.title||"Confirm transaction",subtitle:c.standardSignAndSendTransaction?.uiOptions?.description||`${h.name} wants your permission to approve the following transaction.`,cta:z?"Add funds":c.standardSignAndSendTransaction?.uiOptions?.buttonText||"Approve",instructions:q?.instructions??[],network:"solana:mainnet"==w.chain?"Solana":w.chain.replace("solana:",""),blockExplorerUrl:w.blockExplorerUrl,total:g?N?.total:V?.total,fee:g?N?.fee:V?.fee,balance:g?N?.balance:V?.balance,swap:V?.swap,transactingWalletAddress:B.address,disabled:!q?.hasFunds&&!K,isSubmitting:L,isPreparing:!q||_.isLoading,isTokenPriceLoading:g&&U,isMissingFunds:!q?.hasFunds,submitError:F??void 0,isSponsored:!!c.standardSignAndSendTransaction?.isSponsored,parseError:C,onClick:z?async()=>{if(!B)return;if(!K)throw Error("Funding wallet is not enabled");let e="FundingMethodSelectionScreen";l({...c,funding:{...c.funding,methodScreen:e},solanaFundingData:c?.solanaFundingData}),d(e)}:async()=>{try{if(R(!0),L||!B||!f||!y||!J)return;let e=await c.standardSignAndSendTransaction.onConfirm(j);if("signature"in e){let t=await async function({solanaClient:e,signature:t}){let n=A.getBase58Decoder().decode(t),r=await e.rpc.getTransaction(n,{maxSupportedTransactionVersion:0,commitment:"confirmed",encoding:"base64"}).send().catch((()=>null));return r?{fee:r.meta?.fee??0n}:null}({solanaClient:w,signature:e.signature});return void $({...e,fees:t?.fee})}$(e)}catch(e){console.warn({transaction:j,error:e}),D(e)}finally{R(!1)}},onClose:H})}};exports.StandardSignAndSendTransactionScreen=D,exports.default=D;
1
+ "use strict";var e=require("react/jsx-runtime"),t=require("react"),n=require("@privy-io/js-sdk-core"),r=require("./get-is-unified-wallet-D4ouXJpi.js"),a=require("./context-DFq1obBO.js"),i=require("./internal-context-NWsAL807.js"),o=require("./useGetSolPrice-C986iVoO.js"),s=require("./ErrorScreen-BSjRGrRR.js"),c=require("@heroicons/react/24/outline/CheckCircleIcon"),u=require("styled-components"),l=require("./Button-Bm_Ft0Dw.js"),d=require("./Layouts-dRL0OSpp.js"),p=require("./ModalHeader-DB7Tbjwz.js"),m=require("./ScreenHeader-CyURV6Ti.js"),f=require("./Row-CxDF-VMy.js"),g=require("./Value-C-XtZyFa.js"),h=require("./WalletLink-GY0_Tmtg.js"),y=require("./StackedContainer-ByB6Mdu0.js"),w=require("./useActiveWallet-BOX8xCn9.js"),S=require("./TransactionErrorView-SaY08uTA.js"),k=require("./transaction-DjF5X-by.js"),A=require("@solana/kit"),b=require("./useSolanaRpcClient-TQdbjNyx.js"),v=require("./getFormattedUsdFromLamports-Mu2fqwL2.js");function j(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}require("viem"),require("tinycolor2"),require("ofetch"),require("lucide-react"),require("./index-NJrQkxJ7.js"),require("uuid"),require("jose"),require("eventemitter3"),require("./useWallets-BLFNjTwC.js"),require("./prepareFundingModalData-Cnd6rhhJ.js"),require("@coinbase/wallet-sdk"),require("@privy-io/ethereum"),require("mipd"),require("react-device-detect"),require("viem/utils"),require("@privy-io/popup"),require("./paths-DizMb-lU.js"),require("./usePrivy-CcfSRv1R.js"),require("./events-context-Di6--rDg.js"),require("@scure/base"),require("zustand"),require("@headlessui/react"),require("@walletconnect/ethereum-provider"),require("@privy-io/urls"),require("./getPublicClient-CGlodIp_.js"),require("js-cookie"),require("./frame-B14fp9oC.js"),require("@privy-io/routes"),require("x402/client"),require("@privy-io/api-base"),require("viem/accounts"),require("./use-sign-with-user-signer-BcAsQTGF.js"),require("./getEmbeddedConnectedWallet-6TsVZJkD.js"),require("./reservoir-CQGyEBb7.js"),require("./ScreenLayout-BeH-Q6N2.js"),require("./Screen-D9Tvi297.js"),require("./index-CRFXS9pP.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("./LoadingSkeleton-DoCrfGnl.js"),require("./ethers-DZGJ4Y5i.js"),require("@heroicons/react/24/outline"),require("./ErrorMessage-f0cRWc29.js"),require("./LabelXs-CYMv6rOZ.js"),require("./Subtitle-Dtmrw8l5.js"),require("./Title-C-tHJvrb.js"),require("./Address-5znFAhQw.js"),require("./WalletInfoCard-DKVdH9iF.js"),require("./shared-BPGwTh8c.js"),require("./Checkbox-DXPQZFlQ.js"),require("./ErrorBanner-CMjaobRI.js"),require("@heroicons/react/24/outline/ExclamationCircleIcon"),require("./WarningBanner-B_Gs_15p.js"),require("@heroicons/react/24/outline/ExclamationTriangleIcon"),require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon"),require("@heroicons/react/24/outline/ClipboardDocumentIcon");var I=/*#__PURE__*/j(c);const q=/*#__PURE__*/u.styled.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;}"],(e=>e.color??"var(--privy-color-accent)"),(e=>e.color??"var(--privy-color-accent)")),T=({instruction:t,fees:n,transactionInfo:r,solPrice:a,chain:i})=>/*#__PURE__*/e.jsxs(f.Rows,{children:[r?.action&&/*#__PURE__*/e.jsxs(f.Row,{children:[/*#__PURE__*/e.jsx(g.LabelSm,{children:"Action"}),/*#__PURE__*/e.jsx(g.Value,{children:r.action})]}),null!=t?.total&&/*#__PURE__*/e.jsxs(f.Row,{children:[/*#__PURE__*/e.jsx(g.LabelSm,{children:"Total"}),/*#__PURE__*/e.jsx(g.Value,{children:t.total})]}),!t?.total&&null!=t?.amount&&/*#__PURE__*/e.jsxs(f.Row,{children:[/*#__PURE__*/e.jsx(g.LabelSm,{children:"Total"}),/*#__PURE__*/e.jsx(g.Value,{children:/*#__PURE__*/e.jsx(h.SolanaPriceDisplay,{quantities:[t.amount,n],tokenPrice:a})})]}),/*#__PURE__*/e.jsxs(f.Row,{children:[/*#__PURE__*/e.jsx(g.LabelSm,{children:"Fees"}),/*#__PURE__*/e.jsx(g.Value,{children:/*#__PURE__*/e.jsx(h.SolanaPriceDisplay,{quantities:[n],tokenPrice:a})})]}),t?.to&&/*#__PURE__*/e.jsxs(f.Row,{children:[/*#__PURE__*/e.jsx(g.LabelSm,{children:"To"}),/*#__PURE__*/e.jsx(g.Value,{children:/*#__PURE__*/e.jsx(h.WalletLink,{walletAddress:t.to,chainId:i,chainType:"solana"})})]})]}),x=({fees:t,onClose:n,receiptHeader:r,receiptDescription:a,transactionInfo:i,solPrice:o,signOnly:s,instruction:c,chain:u})=>/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(p.ModalHeader,{onClose:n}),/*#__PURE__*/e.jsx(y.e,{style:{marginBottom:"16px"},children:/*#__PURE__*/e.jsxs("div",{children:[/*#__PURE__*/e.jsx(q,{color:"var(--privy-color-success-light)"}),/*#__PURE__*/e.jsx(I.default,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),/*#__PURE__*/e.jsx(m.CenteredScreenHeader,{title:r??`Transaction ${s?"signed":"complete"}!`,description:a??"You're all set."}),/*#__PURE__*/e.jsx(T,{solPrice:o,instruction:c,fees:t,transactionInfo:i,chain:u}),/*#__PURE__*/e.jsx(w.Grow,{}),/*#__PURE__*/e.jsx(C,{loading:!1,onClick:n,children:"Close"}),/*#__PURE__*/e.jsx(d.RefactorSpacerBottom,{}),/*#__PURE__*/e.jsx(p.BlobbyFooter,{})]});let C=/*#__PURE__*/u.styled(l.PrimaryButton).withConfig({displayName:"SubmitButton",componentId:"sc-3cb7ee42-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);async function O(e,t){try{return await e}catch{return t}}function _(e){switch(e){case"solana:mainnet":return"mainnet-beta";case"solana:devnet":return"devnet";case"solana:testnet":return"testnet"}}async function E({privyClient:e,chain:t,mint:n}){let r=v.DEFAULT_TOKENS_DATA[t];if(!r[n]){let a=await e.getSplTokenMetadata({mintAddress:n,cluster:_(t)});a&&(r[n]={address:n,symbol:a.symbol,decimals:a.decimals})}return r[n]}async function P({tx:e,solanaClient:t,privyClient:n,checkFunds:r}){let a=A.getCompiledTransactionMessageDecoder().decode(b.getTransactionMessageBytes(e)),i=a.staticAccounts[0]??"",o=await b.fetchTransactionEstimatedFees({solanaClient:t,tx:e}),s=r?await O(b.simulateTransaction({solanaClient:t,tx:e})):void 0,c=s?.hasFunds??!0,u={},l=[],d=await async function({solanaClient:e,message:t}){if(!("addressTableLookups"in t)||!t.addressTableLookups)return[...t.staticAccounts];let n=t.addressTableLookups.map((e=>e.lookupTableAddress)),r=await A.fetchAddressesForLookupTables(n,e.rpc),a=n.map(((e,n)=>[...t.addressTableLookups[n]?.writableIndexes.map((t=>{let a=r[e]?.[t];if(a)return{key:a,isWritable:!0,altIdx:n}}))??[],...t.addressTableLookups[n]?.readonlyIndexes.map((t=>{let a=r[e]?.[t];if(a)return{key:a,isWritable:!1,altIdx:n}}))??[]])).flat().filter((e=>!!e)).sort(((e,t)=>e.isWritable!==t.isWritable?e.isWritable?-1:1:e.altIdx-t.altIdx)).map((({key:e})=>e));return[...t.staticAccounts,...a]}({solanaClient:t,message:a});for(let e of a.instructions){let r=a.staticAccounts[e.programAddressIndex]||"";if(r!==v.TOKEN_PROGRAM_ID&&r!==v.TOKEN_2022_PROGRAM_ID)if(r!==v.SYSTEM_PROGRAM_ID){if(r===v.ASSOCIATED_TOKEN_PROGRAM_ID){let t=await O(function(e,t,n){let[r,a,i,o]=e.accountIndices?.map((e=>t[e]))??[];return{type:"ata-creation",program:n,payer:r,ata:a,owner:i,mint:o}}(e,d,r));if(!t){l.push({type:"unknown",program:r,discriminator:e.data?.[0]});continue}if(l.push(t),t.ata&&t.owner&&t.mint){u[t.ata]={owner:t.owner,mint:t.mint};continue}}if(v.RAYDIUM_SWAP_PROGRAM_IDS.includes(r)){let a=await O($(e,d,t,n,r));if(!a){l.push({type:"unknown",program:r,discriminator:e.data?.[0]});continue}l.push(a)}else if(v.JUPITER_SWAP_PROGRAM_IDS.includes(r)){let a=await O(F(e,d,t,n,r));if(!a){l.push({type:"unknown",program:r,discriminator:e.data?.[0]});continue}l.push(a)}else l.push({type:"unknown",program:r,discriminator:e.data?.[0]})}else{let t=await O(M(e,d));if(!t){l.push({type:"unknown",program:r,discriminator:e.data?.[0]});continue}l.push(t)}else{let a=await O(R(e,d,t,n,u,r));if(!a){l.push({type:"unknown",program:r,discriminator:e.data?.[0]});continue}l.push(a),"spl-transfer"===a.type&&(a.fromAta&&a.fromAccount&&a.token.address&&(u[a.fromAta]??={owner:a.fromAccount,mint:a.token.address}),a.toAta&&a.toAccount&&a.token.address&&(u[a.toAta]??={owner:a.toAccount,mint:a.token.address}))}}return{spender:i,fee:o,instructions:l,hasFunds:!!c}}function L(e,t=0){try{return function(e,t=0){let n=0n;for(let r=0;r<8;r++)n|=BigInt(e[t+r])<<BigInt(8*r);return n}(e,t)}catch{}try{return e.readBigInt64LE(t)}catch{}let n=b.bufferFrom(e);try{return((e,t=0)=>{let n=e[t],r=e[t+7];if(!n||!r)throw Error(`Buffer offset out of range: first: ${n}, last: ${r}.`);return(BigInt(e[t+4]+256*e[t+5]+65536*e[t+6]+(r<<24))<<32n)+BigInt(n+256*e[++t]+65536*e[++t]+16777216*e[++t])})(n)}catch{}try{return n.subarray(t).readBigInt64LE()}catch{}try{return n.readBigInt64LE(t)}catch{}return 0n}async function R(e,t,n,r,a,i){let o=e.data?.[0],s=e.accountIndices?.map((e=>t[e]))??[];if(1===o){let[e,t,n]=s;return{type:"spl-init-account",program:i,account:e,mint:t,owner:n}}if(3===o){let t,o,[c,u,l]=s,d="",p=u?a[u]:void 0;if(p)t=p.owner,d=p.mint;else if(u){let e=await n.rpc.getAccountInfo(u,{commitment:"confirmed",encoding:"jsonParsed"}).send(),r=e.value?.data;t=r?.parsed?.info?.owner,d=r?.parsed?.info?.mint??"",o=r?.parsed?.info?.tokenAmount?.decimals}if(!d&&c){let e=await n.rpc.getAccountInfo(c,{commitment:"confirmed",encoding:"jsonParsed"}).send(),t=e.value?.data;d=t?.parsed?.info?.mint??""}let m=await E({privyClient:r,chain:n.chain,mint:d}),f=m?.symbol??"";return o??=m?.decimals??9,{type:"spl-transfer",program:i,fromAta:c,fromAccount:l,toAta:u,toAccount:t,value:L(e.data,1),token:{symbol:f,decimals:o,address:d}}}if(9===o){let[e,t,n]=s;return{type:"spl-close-account",program:i,source:e,destination:t,owner:n}}if(17===o)return{type:"spl-sync-native",program:i};throw Error(`Token program instruction type ${o} not supported`)}async function M(e,t){let n=e.data?.[0],r=e.accountIndices?.map((e=>t[e]))??[];if(0===n){let[,t]=r;return{type:"create-account",program:v.SYSTEM_PROGRAM_ID,account:t?.toString(),value:L(e.data,4),withSeed:!1}}if(2===n){let[t,n]=r;return{type:"sol-transfer",program:v.SYSTEM_PROGRAM_ID,fromAccount:t,toAccount:n,token:{symbol:"SOL",decimals:9},value:L(e.data,4),withSeed:!1}}if(3===n){let[,t]=r;return{type:"create-account",program:v.SYSTEM_PROGRAM_ID,account:t,withSeed:!0,value:L(e.data.slice(e.data.length-32-8-8))}}if(11===n){let[t,n]=r;return{type:"sol-transfer",program:v.SYSTEM_PROGRAM_ID,fromAccount:t,toAccount:n,value:L(e.data,4),token:{symbol:"SOL",decimals:9},withSeed:!0}}throw Error(`System program instruction type ${n} not supported`)}async function $(e,t,n,r,a){let i=e.accountIndices?.map((e=>t[e]))??[],o=e.data?.[0];if(143===o){let t=i[10],o=i[11];return{type:"raydium-swap-base-input",program:a,mintIn:t,mintOut:o,tokenIn:t?await E({privyClient:r,chain:n.chain,mint:t}):void 0,tokenOut:o?await E({privyClient:r,chain:n.chain,mint:o}):void 0,amountIn:L(e.data,8),minimumAmountOut:L(e.data,16)}}if(55===o){let t=i[10],o=i[11];return{type:"raydium-swap-base-output",program:a,mintIn:t,mintOut:o,tokenIn:t?await E({privyClient:r,chain:n.chain,mint:t}):void 0,tokenOut:o?await E({privyClient:r,chain:n.chain,mint:o}):void 0,maxAmountIn:L(e.data,8),amountOut:L(e.data,16)}}throw Error(`Raydium swap program instruction type ${o} not supported`)}async function F(e,t,n,r,a){let i=e.data?.[0],o=e.accountIndices?.map((e=>t[e]))??[];if([208,51,239,151,123,43,237,92].includes(i)){let t=o[5],i=o[6];return{type:"jupiter-swap-exact-out-route",program:a,mintIn:t,mintOut:i,tokenIn:t?await E({privyClient:r,chain:n.chain,mint:t}):void 0,tokenOut:i?await E({privyClient:r,chain:n.chain,mint:i}):void 0,outAmount:L(e.data,e.data.length-1-2-8-8),quotedInAmount:L(e.data,e.data.length-1-2-8)}}if([176,209,105,168,154,125,69,62].includes(i)){let t=o[7],i=o[8];return{type:"jupiter-swap-exact-out-route",program:a,mintIn:t,mintOut:i,tokenIn:t?await E({privyClient:r,chain:n.chain,mint:t}):void 0,tokenOut:i?await E({privyClient:r,chain:n.chain,mint:i}):void 0,outAmount:L(e.data,e.data.length-1-2-8-8),quotedInAmount:L(e.data,e.data.length-1-2-8)}}if([193,32,155,51,65,214,156,129].includes(i)){let t=o[7],i=o[8];return{type:"jupiter-swap-shared-accounts-route",program:a,mintIn:t,mintOut:i,tokenIn:t?await E({privyClient:r,chain:n.chain,mint:t}):void 0,tokenOut:i?await E({privyClient:r,chain:n.chain,mint:i}):void 0,inAmount:L(e.data,e.data.length-1-2-8-8),quotedOutAmount:L(e.data,e.data.length-1-2-8)}}throw[62,198,214,193,213,159,108,210].includes(i)&&console.warn("Jupiter swap program instruction 'claim' not implemented"),[116,206,27,191,166,19,0,73].includes(i)&&console.warn("Jupiter swap program instruction 'claim_token' not implemented"),[26,74,236,151,104,64,183,249].includes(i)&&console.warn("Jupiter swap program instruction 'close_token' not implemented"),[229,194,212,172,8,10,134,147].includes(i)&&console.warn("Jupiter swap program instruction 'create_open_orders' not implemented"),[28,226,32,148,188,136,113,171].includes(i)&&console.warn("Jupiter swap program instruction 'create_program_open_orders' not implemented"),[232,242,197,253,240,143,129,52].includes(i)&&console.warn("Jupiter swap program instruction 'create_token_ledger' not implemented"),[147,241,123,100,244,132,174,118].includes(i)&&console.warn("Jupiter swap program instruction 'create_token_account' not implemented"),[229,23,203,151,122,227,173,42].includes(i)&&console.warn("Jupiter swap program instruction 'route' not implemented"),[150,86,71,116,167,93,14,104].includes(i)&&console.warn("Jupiter swap program instruction 'route_with_token_ledger' not implemented"),[228,85,185,112,78,79,77,2].includes(i)&&console.warn("Jupiter swap program instruction 'set_token_ledger' not implemented"),[230,121,143,80,119,159,106,170].includes(i)&&console.warn("Jupiter swap program instruction 'shared_accounts_route_with_token_ledger' not implemented"),Error(`Jupiter swap program instruction type ${i} not supported`)}const D={component:()=>{let{data:c,onUserCloseViaDialogOrKeybindRef:u,setModalData:l,navigate:d}=r.usePrivyModal(),{client:p,closePrivyModal:m,walletProxy:f,showFiatPrices:g}=i.usePrivyInternal(),h=a.useAppConfig(),{user:y}=r.usePrivyContext(),w=b.useSolanaRpcClient()(c?.standardSignAndSendTransaction?.chain??"solana:mainnet"),[j,I]=t.useState(c?.standardSignAndSendTransaction?.transaction),[q,T]=t.useState(),[C,O]=t.useState(),[_,E]=t.useState({value:0n,isLoading:!1}),[L,R]=t.useState(!1),[M,$]=t.useState({}),[F,D]=t.useState(),B=c?.standardSignAndSendTransaction?.account,W=!!c?.standardSignAndSendTransaction?.signOnly,J=B?.imported?r.getImportedPrivySolanaWallets(y).find((e=>e.address===B.address)):r.getPrivyPrimaryWallet(y),{solPrice:G,isSolPriceLoading:U}=o.useGetSolPrice({enabled:g}),V=t.useMemo((()=>{if(!q)return;let e=q.spender,t=k.getNativeCurrencyFromLamports(q.fee),r=k.getNativeCurrencyFromLamports(_.value,3,!0),a=q.instructions.filter((e=>["sol-transfer","spl-transfer","raydium-swap-base-input","raydium-swap-base-output","jupiter-swap-shared-accounts-route","jupiter-swap-exact-out-route"].includes(e.type))),i=a.at(0);if(!i||a.length>1)return{fee:t,spender:e,balance:r};if("sol-transfer"===i.type)return{fee:t,spender:e,balance:r,total:k.getNativeCurrencyFromLamports(i.value)};if("spl-transfer"===i.type)return{fee:t,spender:e,balance:r,total:`${n.formatTokenAmount({amount:i.value,decimals:i.token.decimals})} ${i.token.symbol}`};if("raydium-swap-base-input"===i.type&&i.tokenIn&&i.tokenOut){return{fee:t,spender:e,balance:r,swap:`${`${n.formatTokenAmount({amount:i.amountIn,decimals:i.tokenIn.decimals})} ${i.tokenIn.symbol}`} → ${`${n.formatTokenAmount({amount:i.minimumAmountOut,decimals:i.tokenOut.decimals})} ${i.tokenOut.symbol}`}`}}if("raydium-swap-base-output"===i.type&&i.tokenIn&&i.tokenOut){return{fee:t,spender:e,balance:r,swap:`${`${n.formatTokenAmount({amount:i.maxAmountIn,decimals:i.tokenIn.decimals})} ${i.tokenIn.symbol}`} → ${`${n.formatTokenAmount({amount:i.amountOut,decimals:i.tokenOut.decimals})} ${i.tokenOut.symbol}`}`}}if("jupiter-swap-shared-accounts-route"===i.type&&i.tokenIn&&i.tokenOut){return{fee:t,spender:e,balance:r,swap:`${`${n.formatTokenAmount({amount:i.inAmount,decimals:i.tokenIn.decimals})} ${i.tokenIn.symbol}`} → ${`${n.formatTokenAmount({amount:i.quotedOutAmount,decimals:i.tokenOut.decimals})} ${i.tokenOut.symbol}`}`}}if("jupiter-swap-exact-out-route"===i.type&&i.tokenIn&&i.tokenOut){return{fee:t,spender:e,balance:r,swap:`${`${n.formatTokenAmount({amount:i.quotedInAmount,decimals:i.tokenIn.decimals})} ${i.tokenIn.symbol}`} → ${`${n.formatTokenAmount({amount:i.outAmount,decimals:i.tokenOut.decimals})} ${i.tokenOut.symbol}`}`}}return{fee:t,spender:e,balance:r}}),[q,B?.address,_]),N=t.useMemo((()=>{let e;if(!q||!g||!G||U)return;function t(...e){return v.getFormattedUsdFromLamports(e.reduce(((e,t)=>e+t),0n),G??0)}B?.address===q.spender&&(e=t(q.fee));let r=t(_.value),a=q.instructions.filter((e=>"sol-transfer"===e.type||"spl-transfer"===e.type)).at(0);return!a||q.instructions.length>1?{fee:e,balance:r}:"sol-transfer"===a.type?{fee:e,balance:r,total:t(a.value,B?.address===q.spender?q.fee:0n)}:"spl-transfer"===a.type?{fee:e,balance:r,total:`${n.formatTokenAmount({amount:a.value,decimals:a.token.decimals})} ${a.token.symbol}`}:{fee:e,balance:r}}),[q,g,G,U,B?.address,_]);if(t.useEffect((()=>{!async function(){if(j&&p)try{O(void 0);let e=await P({tx:j,solanaClient:w,privyClient:p,checkFunds:!W});T(e)}catch(e){console.error("Failed to prepare transaction",e),O(e)}}()}),[j,w,p,W]),t.useEffect((()=>{(async function(){if(!B)return;E({value:_.value,isLoading:!0});let{value:e}=await w.rpc.getBalance(B.address,{commitment:"confirmed"}).send();E({value:e??0n,isLoading:!1})})().catch(console.error)}),[q]),!j||!c?.standardSignAndSendTransaction||!B){let t=Error("Invalid transaction request");/*#__PURE__*/return e.jsx(s.ErrorScreenView,{error:t,allowlistConfig:h.allowlistConfig,onRetry:()=>{c?.standardSignAndSendTransaction?.onFailure(t),m({shouldCallAuthOnSuccess:!1})}})}let H=()=>{if(!L)return M.signature||M.signedTransaction?c?.standardSignAndSendTransaction?.onSuccess({signature:M.signature,signedTransaction:M.signedTransaction}):c?.standardSignAndSendTransaction?.onFailure(F??C??Error("User exited the modal before submitting the transaction")),m({shouldCallAuthOnSuccess:!1})};u.current=H;let Y=c.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?/*#__PURE__*/e.jsx("img",{src:c.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:c.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,K=!!(c.funding&&c.funding.supportedOptions.length>0),z=!q?.hasFunds&&K;if(M.signature||M.signedTransaction){let t=q?.instructions.filter((e=>"sol-transfer"===e.type||"spl-transfer"===e.type)),n=1===t?.length?t?.at(0):void 0;/*#__PURE__*/return e.jsx(x,{fees:M.fees??0n,onClose:H,transactionInfo:c.standardSignAndSendTransaction?.uiOptions.transactionInfo,solPrice:G,receiptHeader:c.standardSignAndSendTransaction?.uiOptions.successHeader,receiptDescription:c.standardSignAndSendTransaction?.uiOptions.successDescription,chain:w.chain,signOnly:W,instruction:"sol-transfer"===n?.type?{to:n.toAccount,amount:n.value}:{to:n?.toAccount||n?.toAta,total:V?.total}})}return F?/*#__PURE__*/e.jsx(S.TransactionErrorView,{transactionError:F,chainId:w.chain,onClose:H,chainType:"solana",onRetry:async()=>{D(void 0);let{value:e}=await w.rpc.getLatestBlockhash().send();var t,n;I((t=j,n=e,A.pipe(A.getCompiledTransactionMessageDecoder().decode(b.getTransactionMessageBytes(t)),(e=>A.decompileTransactionMessage(e)),(e=>A.setTransactionMessageLifetimeUsingBlockhash(n,e)),(e=>A.compileTransaction(e)),(e=>new Uint8Array(A.getTransactionEncoder().encode(e))))))}}):/*#__PURE__*/e.jsx(S.SendSolanaTransactionScreenView,{img:Y,title:c.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.title||"Confirm transaction",subtitle:c.standardSignAndSendTransaction?.uiOptions?.description||`${h.name} wants your permission to approve the following transaction.`,cta:z?"Add funds":c.standardSignAndSendTransaction?.uiOptions?.buttonText||"Approve",instructions:q?.instructions??[],network:"solana:mainnet"==w.chain?"Solana":w.chain.replace("solana:",""),blockExplorerUrl:w.blockExplorerUrl,total:g?N?.total:V?.total,fee:g?N?.fee:V?.fee,balance:g?N?.balance:V?.balance,swap:V?.swap,transactingWalletAddress:B.address,disabled:!q?.hasFunds&&!K,isSubmitting:L,isPreparing:!q||_.isLoading,isTokenPriceLoading:g&&U,isMissingFunds:!q?.hasFunds,submitError:F??void 0,isSponsored:!!c.standardSignAndSendTransaction?.isSponsored,parseError:C,onClick:z?async()=>{if(!B)return;if(!K)throw Error("Funding wallet is not enabled");let e="FundingMethodSelectionScreen";l({...c,funding:{...c.funding,methodScreen:e},solanaFundingData:c?.solanaFundingData}),d(e)}:async()=>{try{if(R(!0),L||!B||!f||!y||!J)return;let e=await c.standardSignAndSendTransaction.onConfirm(j);if("signature"in e){let t=await async function({solanaClient:e,signature:t}){let n=A.getBase58Decoder().decode(t),r=await e.rpc.getTransaction(n,{maxSupportedTransactionVersion:0,commitment:"confirmed",encoding:"base64"}).send().catch((()=>null));return r?{fee:r.meta?.fee??0n}:null}({solanaClient:w,signature:e.signature});return void $({...e,fees:t?.fee})}$(e)}catch(e){console.warn({transaction:j,error:e}),D(e)}finally{R(!1)}},onClose:H})}};exports.StandardSignAndSendTransactionScreen=D,exports.default=D;
@@ -1 +1 @@
1
- "use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./index-4-C2N_7K.js"),i=require("./context-Dn8Hzo8O.js"),a=require("./internal-context-NWsAL807.js"),o=require("./get-is-unified-wallet-CHHPpmxX.js"),s=require("./shouldProceedtoEmbeddedWalletCreationFlow-CuHR6wvs.js"),u=require("./ScreenLayout-Bbhw-EIr.js"),n=require("./telegram-D3O0_F1a.js");require("@privy-io/js-sdk-core"),require("uuid"),require("jose"),require("eventemitter3"),require("./useActiveWallet-B5cSS56I.js"),require("zustand"),require("styled-components"),require("react-device-detect"),require("./prepareFundingModalData-Bap-QRCV.js"),require("./events-context-Di6--rDg.js"),require("viem"),require("viem/utils"),require("./getPublicClient-CGlodIp_.js"),require("./useWallets-DPdw6ah8.js"),require("@coinbase/wallet-sdk"),require("@privy-io/ethereum"),require("mipd"),require("@privy-io/popup"),require("./paths-DizMb-lU.js"),require("./usePrivy-DobNyfbl.js"),require("@scure/base"),require("@headlessui/react"),require("@walletconnect/ethereum-provider"),require("@privy-io/urls"),require("ofetch"),require("js-cookie"),require("./frame-B14fp9oC.js"),require("@privy-io/routes"),require("x402/client"),require("@privy-io/api-base"),require("viem/accounts"),require("./use-sign-with-user-signer-BcAsQTGF.js"),require("./getEmbeddedConnectedWallet-6TsVZJkD.js"),require("tinycolor2"),require("./Button-DpuRzAgk.js"),require("./Screen-CJM19YNL.js"),require("./ModalHeader-4MV7Tgk7.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("./index-CRFXS9pP.js");const l=({success:r,errorMessage:t,onRetry:i})=>{let a=r?"Successfully connected with Telegram":t?t.message:"Verifying connection to Telegram";/*#__PURE__*/return e.jsx(u.ScreenLayout,{title:a,subtitle:r?"You're good to go!":t?t.detail:"Just a few moments more",icon:n.Telegram,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!t},secondaryCta:t?.retryable&&i?{label:"Retry",onClick:i}:void 0,watermark:!0})},c={component:()=>{let{authenticated:u,logout:n,ready:c,user:d}=o.usePrivyContext(),{setModalData:m,navigate:q,resetNavigation:g,data:v}=o.usePrivyModal(),y=i.useAppConfig(),{initLoginWithTelegram:h,loginWithTelegram:E,updateWallets:S,setReadyToTrue:p,closePrivyModal:A,createAnalyticsEvent:C,getAuthMeta:T}=a.usePrivyInternal(),[f,j]=r.useState(!1),[R,b]=r.useState(void 0),_=t.useCaptcha();async function w(){try{let e=await async function(){let e;if(!u){if(_.enabled&&"error"===_.status)throw new t.CaptchaError(_.error,null,a.PrivyErrorCode.CAPTCHA_FAILURE);return _.enabled&&"success"!==_.status&&(_.execute(),e=await _.waitForResult()),e}}();await E({captchaToken:e}),j(!0),p(!0)}catch(e){if(e?.privyErrorCode===a.PrivyErrorCode.ALLOWLIST_REJECTED)return b(void 0),g(),void q("AllowlistRejectionScreen");if(e?.privyErrorCode===a.PrivyErrorCode.USER_LIMIT_REACHED)return console.error(new a.PrivyUserLimitReachedError(e).toString()),b(void 0),g(),void q("UserLimitReachedScreen");if(e?.privyErrorCode===a.PrivyErrorCode.USER_DOES_NOT_EXIST)return b(void 0),g(),void q("AccountNotFoundScreen");if(e?.privyErrorCode===a.PrivyErrorCode.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return b(void 0),g(),m({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,telegramAuthResult:T()?.telegramAuthResult,telegramWebAppData:T()?.telegramWebAppData,displayName:e.data?.data?.account?.displayName,linkMethod:"telegram",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void q("LinkConflictScreen");let{retryable:r,detail:i}=t.getTelegramAuthErrorMessage(e);b({retryable:r,detail:i,message:"Authentication failed"})}}r.useEffect((()=>{w()}),[]),r.useEffect((()=>{if(!(c&&u&&f&&d))return;if(y?.legal.requireUsersAcceptTerms&&!d.hasAcceptedTerms){let e=setTimeout((()=>{q("AffirmativeConsentScreen")}),i.DEFAULT_SUCCESS_SCREEN_DURATION_MS);return()=>clearTimeout(e)}if(s.shouldProceedtoEmbeddedWalletCreationFlow(d,y.embeddedWallets)){let e=setTimeout((()=>{m({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),C({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:"telegram",screen:"TelegramAuthScreen"}}),n()},callAuthOnSuccessOnClose:!0}}),q("EmbeddedWalletOnAccountCreateScreen")}),i.DEFAULT_SUCCESS_SCREEN_DURATION_MS);return()=>clearTimeout(e)}S();let e=setTimeout((()=>A({shouldCallAuthOnSuccess:!0,isSuccess:!0})),i.DEFAULT_SUCCESS_SCREEN_DURATION_MS);return()=>clearTimeout(e)}),[c,u,f,d]);/*#__PURE__*/return e.jsx(l,{success:f,errorMessage:R,onRetry:R?.retryable?async()=>{try{b(void 0),v?.telegramAuthModalData?.seamlessAuth||await h(void 0,v?.login?.disableSignup),await w()}catch(e){let{retryable:r,detail:i}=t.getTelegramAuthErrorMessage(e);b({retryable:r,detail:i,message:"Authentication failed"})}}:void 0})},isCaptchaRequired:!0,isShownBeforeReady:!0};exports.TelegramAuthScreen=c,exports.TelegramAuthScreenView=l,exports.default=c;
1
+ "use strict";var e=require("react/jsx-runtime"),r=require("react"),t=require("./index-NJrQkxJ7.js"),i=require("./context-DFq1obBO.js"),a=require("./internal-context-NWsAL807.js"),o=require("./get-is-unified-wallet-D4ouXJpi.js"),s=require("./shouldProceedtoEmbeddedWalletCreationFlow-DZvEYqlO.js"),u=require("./ScreenLayout-BeH-Q6N2.js"),n=require("./telegram-D3O0_F1a.js");require("@privy-io/js-sdk-core"),require("uuid"),require("jose"),require("eventemitter3"),require("./useActiveWallet-BOX8xCn9.js"),require("zustand"),require("styled-components"),require("react-device-detect"),require("./prepareFundingModalData-Cnd6rhhJ.js"),require("./events-context-Di6--rDg.js"),require("viem"),require("viem/utils"),require("./getPublicClient-CGlodIp_.js"),require("./useWallets-BLFNjTwC.js"),require("@coinbase/wallet-sdk"),require("@privy-io/ethereum"),require("mipd"),require("@privy-io/popup"),require("./paths-DizMb-lU.js"),require("./usePrivy-CcfSRv1R.js"),require("@scure/base"),require("@headlessui/react"),require("@walletconnect/ethereum-provider"),require("@privy-io/urls"),require("ofetch"),require("js-cookie"),require("./frame-B14fp9oC.js"),require("@privy-io/routes"),require("x402/client"),require("@privy-io/api-base"),require("viem/accounts"),require("./use-sign-with-user-signer-BcAsQTGF.js"),require("./getEmbeddedConnectedWallet-6TsVZJkD.js"),require("tinycolor2"),require("./Button-Bm_Ft0Dw.js"),require("./Screen-D9Tvi297.js"),require("./ModalHeader-DB7Tbjwz.js"),require("@heroicons/react/24/outline/ArrowLeftIcon"),require("@heroicons/react/24/outline/ArrowRightIcon"),require("@heroicons/react/24/outline/QuestionMarkCircleIcon"),require("@heroicons/react/24/outline/XMarkIcon"),require("./index-CRFXS9pP.js");const l=({success:r,errorMessage:t,onRetry:i})=>{let a=r?"Successfully connected with Telegram":t?t.message:"Verifying connection to Telegram";/*#__PURE__*/return e.jsx(u.ScreenLayout,{title:a,subtitle:r?"You're good to go!":t?t.detail:"Just a few moments more",icon:n.Telegram,iconVariant:"loading",iconLoadingStatus:{success:r,fail:!!t},secondaryCta:t?.retryable&&i?{label:"Retry",onClick:i}:void 0,watermark:!0})},c={component:()=>{let{authenticated:u,logout:n,ready:c,user:d}=o.usePrivyContext(),{setModalData:m,navigate:q,resetNavigation:g,data:v}=o.usePrivyModal(),y=i.useAppConfig(),{initLoginWithTelegram:h,loginWithTelegram:E,updateWallets:S,setReadyToTrue:p,closePrivyModal:A,createAnalyticsEvent:C,getAuthMeta:T}=a.usePrivyInternal(),[f,j]=r.useState(!1),[R,b]=r.useState(void 0),_=t.useCaptcha();async function w(){try{let e=await async function(){let e;if(!u){if(_.enabled&&"error"===_.status)throw new t.CaptchaError(_.error,null,a.PrivyErrorCode.CAPTCHA_FAILURE);return _.enabled&&"success"!==_.status&&(_.execute(),e=await _.waitForResult()),e}}();await E({captchaToken:e}),j(!0),p(!0)}catch(e){if(e?.privyErrorCode===a.PrivyErrorCode.ALLOWLIST_REJECTED)return b(void 0),g(),void q("AllowlistRejectionScreen");if(e?.privyErrorCode===a.PrivyErrorCode.USER_LIMIT_REACHED)return console.error(new a.PrivyUserLimitReachedError(e).toString()),b(void 0),g(),void q("UserLimitReachedScreen");if(e?.privyErrorCode===a.PrivyErrorCode.USER_DOES_NOT_EXIST)return b(void 0),g(),void q("AccountNotFoundScreen");if(e?.privyErrorCode===a.PrivyErrorCode.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return b(void 0),g(),m({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,telegramAuthResult:T()?.telegramAuthResult,telegramWebAppData:T()?.telegramWebAppData,displayName:e.data?.data?.account?.displayName,linkMethod:"telegram",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void q("LinkConflictScreen");let{retryable:r,detail:i}=t.getTelegramAuthErrorMessage(e);b({retryable:r,detail:i,message:"Authentication failed"})}}r.useEffect((()=>{w()}),[]),r.useEffect((()=>{if(!(c&&u&&f&&d))return;if(y?.legal.requireUsersAcceptTerms&&!d.hasAcceptedTerms){let e=setTimeout((()=>{q("AffirmativeConsentScreen")}),i.DEFAULT_SUCCESS_SCREEN_DURATION_MS);return()=>clearTimeout(e)}if(s.shouldProceedtoEmbeddedWalletCreationFlow(d,y.embeddedWallets)){let e=setTimeout((()=>{m({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),C({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:"telegram",screen:"TelegramAuthScreen"}}),n()},callAuthOnSuccessOnClose:!0}}),q("EmbeddedWalletOnAccountCreateScreen")}),i.DEFAULT_SUCCESS_SCREEN_DURATION_MS);return()=>clearTimeout(e)}S();let e=setTimeout((()=>A({shouldCallAuthOnSuccess:!0,isSuccess:!0})),i.DEFAULT_SUCCESS_SCREEN_DURATION_MS);return()=>clearTimeout(e)}),[c,u,f,d]);/*#__PURE__*/return e.jsx(l,{success:f,errorMessage:R,onRetry:R?.retryable?async()=>{try{b(void 0),v?.telegramAuthModalData?.seamlessAuth||await h(void 0,v?.login?.disableSignup),await w()}catch(e){let{retryable:r,detail:i}=t.getTelegramAuthErrorMessage(e);b({retryable:r,detail:i,message:"Authentication failed"})}}:void 0})},isCaptchaRequired:!0,isShownBeforeReady:!0};exports.TelegramAuthScreen=c,exports.TelegramAuthScreenView=l,exports.default=c;
@@ -1,3 +1,3 @@
1
- "use strict";var e=require("react/jsx-runtime"),i=require("styled-components"),t=require("./WalletLink-CbnPrVEH.js"),n=require("./ethers-BwK3McWK.js"),o=require("./Layouts-dRL0OSpp.js"),r=require("@heroicons/react/24/outline/ChevronDownIcon"),l=require("react"),d=require("./context-Dn8Hzo8O.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=/*#__PURE__*/s(r);const c=({label:i,children:t,valueStyles:n})=>/*#__PURE__*/e.jsxs(p,{children:[/*#__PURE__*/e.jsx("div",{children:i}),/*#__PURE__*/e.jsx(x,{style:{...n},children:t})]});let p=/*#__PURE__*/i.styled.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;}"]),x=/*#__PURE__*/i.styled.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 h=({gas:i,tokenPrice:r,tokenSymbol:l})=>/*#__PURE__*/e.jsxs(o.FlexContainer,{style:{paddingBottom:"12px"},children:[/*#__PURE__*/e.jsxs(u,{children:[/*#__PURE__*/e.jsx(y,{children:"Est. Fees"}),/*#__PURE__*/e.jsx("div",{children:/*#__PURE__*/e.jsx(t.PriceDisplay,{weiQuantities:[BigInt(i)],tokenPrice:r,tokenSymbol:l})})]}),r&&/*#__PURE__*/e.jsx(g,{children:`${n.getNativeCurrencyFromWei(BigInt(i),l)}`})]}),f=({value:i,gas:r,tokenPrice:l,tokenSymbol:d})=>{let s=BigInt(i??0)+BigInt(r);/*#__PURE__*/return e.jsxs(o.FlexContainer,{children:[/*#__PURE__*/e.jsxs(u,{children:[/*#__PURE__*/e.jsx(y,{children:"Total (including fees)"}),/*#__PURE__*/e.jsx("div",{children:/*#__PURE__*/e.jsx(t.PriceDisplay,{weiQuantities:[BigInt(i||0),BigInt(r)],tokenPrice:l,tokenSymbol:d})})]}),l&&/*#__PURE__*/e.jsx(g,{children:n.getNativeCurrencyFromWei(s,d)})]})};let u=/*#__PURE__*/i.styled.div.withConfig({displayName:"TransactionTotalRow",componentId:"sc-f8ef9b74-0"})(["display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-top:4px;"]),g=/*#__PURE__*/i.styled.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;"]),y=/*#__PURE__*/i.styled.div.withConfig({displayName:"TotalText",componentId:"sc-f8ef9b74-2"})(["font-size:14px;line-height:22.4px;font-weight:400;"]);const v=/*#__PURE__*/l.createContext(void 0),m=/*#__PURE__*/l.createContext(void 0),j=({defaultValue:i,children:t})=>{let[n,o]=l.useState(i||null);/*#__PURE__*/return e.jsx(v.Provider,{value:{activePanel:n,togglePanel:e=>{o(n===e?null:e)}},children:/*#__PURE__*/e.jsx(k,{children:t})})},w=({value:i,children:t})=>{let{activePanel:n,togglePanel:o}=l.useContext(v),r=n===i;/*#__PURE__*/return e.jsx(m.Provider,{value:{onToggle:()=>o(i),value:i},children:/*#__PURE__*/e.jsx(T,{isActive:r?"true":"false","data-open":String(r),children:t})})},C=({children:i})=>{let{activePanel:t}=l.useContext(v),{onToggle:n,value:o}=l.useContext(m),r=t===o;/*#__PURE__*/
1
+ "use strict";var e=require("react/jsx-runtime"),i=require("styled-components"),t=require("./WalletLink-GY0_Tmtg.js"),n=require("./ethers-DZGJ4Y5i.js"),o=require("./Layouts-dRL0OSpp.js"),r=require("@heroicons/react/24/outline/ChevronDownIcon"),l=require("react"),d=require("./context-DFq1obBO.js");function s(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=/*#__PURE__*/s(r);const c=({label:i,children:t,valueStyles:n})=>/*#__PURE__*/e.jsxs(p,{children:[/*#__PURE__*/e.jsx("div",{children:i}),/*#__PURE__*/e.jsx(x,{style:{...n},children:t})]});let p=/*#__PURE__*/i.styled.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;}"]),x=/*#__PURE__*/i.styled.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 h=({gas:i,tokenPrice:r,tokenSymbol:l})=>/*#__PURE__*/e.jsxs(o.FlexContainer,{style:{paddingBottom:"12px"},children:[/*#__PURE__*/e.jsxs(u,{children:[/*#__PURE__*/e.jsx(y,{children:"Est. Fees"}),/*#__PURE__*/e.jsx("div",{children:/*#__PURE__*/e.jsx(t.PriceDisplay,{weiQuantities:[BigInt(i)],tokenPrice:r,tokenSymbol:l})})]}),r&&/*#__PURE__*/e.jsx(g,{children:`${n.getNativeCurrencyFromWei(BigInt(i),l)}`})]}),f=({value:i,gas:r,tokenPrice:l,tokenSymbol:d})=>{let s=BigInt(i??0)+BigInt(r);/*#__PURE__*/return e.jsxs(o.FlexContainer,{children:[/*#__PURE__*/e.jsxs(u,{children:[/*#__PURE__*/e.jsx(y,{children:"Total (including fees)"}),/*#__PURE__*/e.jsx("div",{children:/*#__PURE__*/e.jsx(t.PriceDisplay,{weiQuantities:[BigInt(i||0),BigInt(r)],tokenPrice:l,tokenSymbol:d})})]}),l&&/*#__PURE__*/e.jsx(g,{children:n.getNativeCurrencyFromWei(s,d)})]})};let u=/*#__PURE__*/i.styled.div.withConfig({displayName:"TransactionTotalRow",componentId:"sc-f8ef9b74-0"})(["display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-top:4px;"]),g=/*#__PURE__*/i.styled.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;"]),y=/*#__PURE__*/i.styled.div.withConfig({displayName:"TotalText",componentId:"sc-f8ef9b74-2"})(["font-size:14px;line-height:22.4px;font-weight:400;"]);const v=/*#__PURE__*/l.createContext(void 0),m=/*#__PURE__*/l.createContext(void 0),j=({defaultValue:i,children:t})=>{let[n,o]=l.useState(i||null);/*#__PURE__*/return e.jsx(v.Provider,{value:{activePanel:n,togglePanel:e=>{o(n===e?null:e)}},children:/*#__PURE__*/e.jsx(k,{children:t})})},w=({value:i,children:t})=>{let{activePanel:n,togglePanel:o}=l.useContext(v),r=n===i;/*#__PURE__*/return e.jsx(m.Provider,{value:{onToggle:()=>o(i),value:i},children:/*#__PURE__*/e.jsx(T,{isActive:r?"true":"false","data-open":String(r),children:t})})},C=({children:i})=>{let{activePanel:t}=l.useContext(v),{onToggle:n,value:o}=l.useContext(m),r=t===o;/*#__PURE__*/
2
2
  return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsxs(N,{onClick:n,"data-open":String(r),children:[/*#__PURE__*/e.jsx(A,{children:i}),/*#__PURE__*/e.jsx(W,{isactive:r?"true":"false",children:/*#__PURE__*/e.jsx(a.default,{height:"16px",width:"16px",strokeWidth:"2"})})]}),/*#__PURE__*/e.jsx(P,{})]})},I=({children:i})=>{let{activePanel:t}=l.useContext(v),{value:n}=l.useContext(m);/*#__PURE__*/return e.jsx(S,{"data-open":String(t===n),children:/*#__PURE__*/e.jsx(D,{children:i})})},b=({children:i})=>{let{activePanel:t}=l.useContext(v),{value:n}=l.useContext(m);/*#__PURE__*/return e.jsx(D,{children:"function"==typeof i?i({isActive:t===n}):i})};let k=/*#__PURE__*/i.styled.div.withConfig({displayName:"AccordionRoot",componentId:"sc-d25f9267-0"})(["display:flex;flex-direction:column;width:100%;gap:8px;"]),N=/*#__PURE__*/i.styled.div.withConfig({displayName:"AccordionTriggerContainer",componentId:"sc-d25f9267-1"})(["display:flex;justify-content:space-between;align-items:center;width:100%;cursor:pointer;padding-bottom:8px;"]),P=/*#__PURE__*/i.styled.div.withConfig({displayName:"AccordionDivider",componentId:"sc-d25f9267-2"})(["width:100%;&&{border-top:1px solid;border-color:var(--privy-color-foreground-4);}padding-bottom:12px;"]),A=/*#__PURE__*/i.styled.div.withConfig({displayName:"AccordionTriggerContent",componentId:"sc-d25f9267-3"})(["font-size:14px;font-weight:500;line-height:19.6px;width:100%;padding-right:8px;"]),T=/*#__PURE__*/i.styled.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);}"]),S=/*#__PURE__*/i.styled.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;}"]),D=/*#__PURE__*/i.styled.div.withConfig({displayName:"ContentWrapper",componentId:"sc-d25f9267-6"})(["display:flex;flex-direction:column;gap:12px;flex:1 1 auto;min-height:1px;"]),W=/*#__PURE__*/i.styled.div.withConfig({displayName:"IconWrapper",componentId:"sc-d25f9267-7"})(["transform:",";"],(e=>"true"===e.isactive?"rotate(180deg)":"rotate(0deg)"));let q=/*#__PURE__*/i.styled.div.withConfig({displayName:"AccordionTriggerContent",componentId:"sc-2eff9f5c-0"})(["display:flex;flex-direction:row;justify-content:space-between;"]),B=/*#__PURE__*/i.styled.div.withConfig({displayName:"TotalText",componentId:"sc-2eff9f5c-1"})(["flex-shrink:0;padding-left:8px;"]);exports.TransactionDetails=({from:i,to:n,txn:o,transactionInfo:r,tokenPrice:l,gas:s,tokenSymbol:a})=>{let p=BigInt(o?.value||0);/*#__PURE__*/
3
3
  return e.jsx(j,{...d.useAppConfig().render.standalone?{defaultValue:"details"}:{},children:/*#__PURE__*/e.jsxs(w,{value:"details",children:[/*#__PURE__*/e.jsx(C,{children:/*#__PURE__*/e.jsxs(q,{children:[/*#__PURE__*/e.jsx("div",{children:r?.title||"Details"}),/*#__PURE__*/e.jsx(B,{children:/*#__PURE__*/e.jsx(t.HeaderPriceDisplay,{weiQuantities:[p],tokenPrice:l,tokenSymbol:a})})]})}),/*#__PURE__*/e.jsxs(I,{children:[/*#__PURE__*/e.jsx(c,{label:"From",children:/*#__PURE__*/e.jsx(t.WalletLink,{walletAddress:i,chainId:o.chainId||d.CHAIN_ID_MAINNET,chainType:"ethereum"})}),/*#__PURE__*/e.jsx(c,{label:"To",children:/*#__PURE__*/e.jsx(t.WalletLink,{walletAddress:n,chainId:o.chainId||d.CHAIN_ID_MAINNET,chainType:"ethereum"})}),r&&r.action&&/*#__PURE__*/e.jsx(c,{label:"Action",children:r.action}),s&&/*#__PURE__*/e.jsx(h,{value:o.value,gas:s,tokenPrice:l,tokenSymbol:a})]}),/*#__PURE__*/e.jsx(b,{children:({isActive:i})=>/*#__PURE__*/e.jsx(f,{value:o.value,displayFee:i,gas:s||"0x0",tokenPrice:l,tokenSymbol:a})})]})})};
@@ -1,2 +1,2 @@
1
- "use strict";var e=require("react/jsx-runtime"),s=require("@heroicons/react/24/outline"),r=require("react"),n=require("styled-components"),i=require("@privy-io/js-sdk-core"),o=require("./Button-DpuRzAgk.js"),l=require("./ModalHeader-4MV7Tgk7.js"),t=require("./Value-C-XtZyFa.js"),a=require("./Row-CxDF-VMy.js"),d=require("./ErrorMessage-f0cRWc29.js"),c=require("./LabelXs-CYMv6rOZ.js"),x=require("./Subtitle-Dtmrw8l5.js"),h=require("./Title-C-tHJvrb.js"),u=require("./Address-Doz93lgh.js"),m=require("./WalletInfoCard-DQtI0K25.js"),j=require("./context-Dn8Hzo8O.js"),p=require("./useActiveWallet-B5cSS56I.js"),g=require("./LoadingSkeleton-DoCrfGnl.js"),b=require("viem"),f=require("./shared-BPGwTh8c.js"),w=require("./Checkbox-DXPQZFlQ.js"),y=require("./ErrorBanner-CMjaobRI.js"),S=require("./WarningBanner-B_Gs_15p.js"),k=require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon"),v=require("@heroicons/react/24/outline/ClipboardDocumentIcon"),I=require("@heroicons/react/24/outline/ExclamationCircleIcon"),L=require("./internal-context-NWsAL807.js");function C(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var R=/*#__PURE__*/C(k),A=/*#__PURE__*/C(v),T=/*#__PURE__*/C(I);const V=/*#__PURE__*/n.styled(t.LabelSm).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 N=({iconUrl:s,value:r,symbol:n,usdValue:i,nftName:o,nftCount:l,decimals:t,$isLoading:a})=>{if(a)/*#__PURE__*/return e.jsx(M,{$isLoading:a});let d=r&&i&&t?function(e,s,r){let n=parseFloat(e),i=parseFloat(r);if(0===n||0===i||Number.isNaN(n)||Number.isNaN(i))return e;let o=Math.ceil(-Math.log10(.01/(i/n))),l=Math.pow(10,o=Math.max(o=Math.min(o,s),1)),t=+(Math.floor(n*l)/l).toFixed(o).replace(/\.?0+$/,"");return Intl.NumberFormat(void 0,{maximumFractionDigits:s}).format(t)}(r,t,i):r;/*#__PURE__*/return e.jsxs("div",{children:[/*#__PURE__*/e.jsxs(M,{$isLoading:a,children:[s&&/*#__PURE__*/e.jsx(F,{src:s,alt:"Token icon"}),l&&l>1?l+"x":void 0," ",o,d," ",n]}),i&&/*#__PURE__*/e.jsxs(E,{$isLoading:a,children:["$",i]})]})};let M=/*#__PURE__*/n.styled.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;",""],g.LoadingSkeleton);const E=/*#__PURE__*/n.styled.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;",""],g.LoadingSkeleton);let F=/*#__PURE__*/n.styled.img.withConfig({displayName:"TokenIcon",componentId:"sc-991db279-2"})(["height:14px;width:14px;margin-right:4px;object-fit:contain;"]);const q=s=>{let{chain:r,transactionDetails:n,isTokenContractInfoLoading:i,symbol:o}=s,{action:l,functionName:d}=n;/*#__PURE__*/return e.jsx(f.Box,{children:/*#__PURE__*/e.jsxs(a.Rows,{children:["transaction"!==l&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Action"}),/*#__PURE__*/e.jsx(t.Value,{children:d})]}),"mint"===d&&"args"in n&&n.args.filter((e=>e)).map(((s,n)=>/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:`Param ${n}`}),/*#__PURE__*/e.jsx(t.Value,{children:"string"==typeof s&&b.isAddress(s)?/*#__PURE__*/e.jsx(u.Address,{address:s,url:r?.blockExplorers?.default?.url,showCopyIcon:!1}):s?.toString()})]},n))),"setApprovalForAll"===d&&n.operator&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Operator"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:n.operator,url:r?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),"setApprovalForAll"===d&&void 0!==n.approved&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Set approval to"}),/*#__PURE__*/e.jsx(t.Value,{children:n.approved?"true":"false"})]}),"transfer"===d||"transferFrom"===d||"safeTransferFrom"===d||"approve"===d?/*#__PURE__*/e.jsxs(e.Fragment,{children:["formattedAmount"in n&&n.formattedAmount&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsxs(t.Value,{$isLoading:i,children:[n.formattedAmount," ",o]})]}),"tokenId"in n&&n.tokenId&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token ID"}),/*#__PURE__*/e.jsx(t.Value,{children:n.tokenId.toString()})]})]}):null,"safeBatchTransferFrom"===d&&/*#__PURE__*/e.jsxs(e.Fragment,{children:["amounts"in n&&n.amounts&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amounts"}),/*#__PURE__*/e.jsx(t.Value,{children:n.amounts.join(", ")})]}),"tokenIds"in n&&n.tokenIds&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token IDs"}),/*#__PURE__*/e.jsx(t.Value,{children:n.tokenIds.join(", ")})]})]}),"approve"===d&&n.spender&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Spender"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:n.spender,url:r?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===d||"safeTransferFrom"===d||"safeBatchTransferFrom"===d)&&n.transferFrom&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Transferring from"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:n.transferFrom,url:r?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===d||"safeTransferFrom"===d||"safeBatchTransferFrom"===d)&&n.transferTo&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Transferring to"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:n.transferTo,url:r?.blockExplorers?.default?.url,showCopyIcon:!1})})]})]})})},$=({variant:s,setPreventMaliciousTransaction:r,colorScheme:n="light",preventMaliciousTransaction:i})=>"warn"===s?/*#__PURE__*/e.jsx(D,{children:/*#__PURE__*/e.jsxs(S.WarningBanner,{theme:n,children:[/*#__PURE__*/e.jsx("span",{style:{fontWeight:"500"},children:"Warning: Suspicious transaction"}),/*#__PURE__*/e.jsx("br",{}),"This has been flagged as a potentially deceptive request. Approving could put your assets or funds at risk."]})}):"error"===s?/*#__PURE__*/e.jsx(e.Fragment,{children:/*#__PURE__*/e.jsxs(D,{children:[/*#__PURE__*/e.jsx(y.ErrorBanner,{theme:n,children:/*#__PURE__*/e.jsxs("div",{children:[/*#__PURE__*/e.jsx("strong",{children:"This is a malicious transaction"}),/*#__PURE__*/e.jsx("br",{}),"This transaction transfers tokens to a known malicious address. Proceeding may result in the loss of valuable assets."]})}),/*#__PURE__*/e.jsxs(O,{children:[/*#__PURE__*/e.jsx(w.Checkbox,{color:"var(--privy-color-error)",checked:!i,readOnly:!0,onClick:()=>r(!i)}),/*#__PURE__*/e.jsx("span",{children:"I understand and want to proceed anyways."})]})]})}):null;let D=/*#__PURE__*/n.styled.div.withConfig({displayName:"BannerContainer",componentId:"sc-ab8a5a0b-0"})(["margin-top:1.5rem;"]),O=/*#__PURE__*/n.styled.div.withConfig({displayName:"CheckboxContainer",componentId:"sc-ab8a5a0b-1"})(["display:flex;align-items:center;gap:0.5rem;margin-top:0.75rem;"]);const B=({transactionIndex:e,maxIndex:s})=>"number"!=typeof e||0===s?"":` (${e+1} / ${s+1})`;let P=/*#__PURE__*/n.styled(m.WalletInfoCard).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-cbe5ab37-0"})(["",""],(e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;")),X=/*#__PURE__*/n.styled(a.Rows).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;"]),W="There was an error preparing your transaction. Your transaction request will likely fail.",z=/*#__PURE__*/n.styled.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);}"]),H=/*#__PURE__*/n.styled.span.withConfig({displayName:"SponsoredRow",componentId:"sc-cbe5ab37-3"})(["display:inline-flex;align-items:center;gap:0.3rem;"]),U=/*#__PURE__*/n.styled.span.withConfig({displayName:"SponsoredText",componentId:"sc-cbe5ab37-4"})(["font-size:14px;font-weight:500;color:var(--privy-color-foreground);"]);let G=()=>/*#__PURE__*/e.jsxs(K,{children:[/*#__PURE__*/e.jsx(_,{}),/*#__PURE__*/e.jsx(Z,{})]});let J=/*#__PURE__*/n.styled.div.withConfig({displayName:"TransactionErrorScreenContainer",componentId:"sc-d58f10e6-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;"]),Q=/*#__PURE__*/n.styled.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;"]),Y=/*#__PURE__*/n.styled.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;"]),K=/*#__PURE__*/n.styled.div.withConfig({displayName:"CircleContainer",componentId:"sc-d58f10e6-3"})(["position:relative;width:60px;height:60px;margin:10px;display:flex;justify-content:center;align-items:center;"]),Z=/*#__PURE__*/n.styled(T.default).withConfig({displayName:"StyledExclamationCircleIcon",componentId:"sc-d58f10e6-4"})(["position:absolute;width:35px;height:35px;color:var(--privy-color-error);"]),_=/*#__PURE__*/n.styled.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;"]),ee=/*#__PURE__*/n.styled(o.PrimaryButton).withConfig({displayName:"RetryButton",componentId:"sc-d58f10e6-6"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]),se=/*#__PURE__*/n.styled.span.withConfig({displayName:"TextBoxTitle",componentId:"sc-d58f10e6-7"})(["width:100%;text-align:left;font-size:0.825rem;color:var(--privy-color-foreground);padding:4px;"]),re=/*#__PURE__*/n.styled.div.withConfig({displayName:"TextBoxContainer",componentId:"sc-d58f10e6-8"})(["width:100%;margin:5px;display:flex;flex-direction:column;justify-content:center;align-items:center;"]),ne=/*#__PURE__*/n.styled.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;"]),ie=/*#__PURE__*/n.styled.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 }")),oe=/*#__PURE__*/n.styled(A.default).withConfig({displayName:"StyledClipboardIcon",componentId:"sc-d58f10e6-11"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),le=/*#__PURE__*/n.styled(R.default).withConfig({displayName:"StyledClipboardCheckIcon",componentId:"sc-d58f10e6-12"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),te=({clicked:s})=>s?/*#__PURE__*/e.jsx(le,{}):/*#__PURE__*/e.jsx(oe,{});exports.SendSolanaTransactionScreenView=({img:n,title:m,subtitle:g,cta:b,instructions:f,network:w,blockExplorerUrl:y,isMissingFunds:S,submitError:k,parseError:v,total:I,swap:L,transactingWalletAddress:C,fee:R,balance:A,disabled:T,isSubmitting:N,isPreparing:M,isTokenPriceLoading:E,onClick:F,onClose:q,onBack:$,isSponsored:D})=>{let O=M||E,[B,G]=r.useState(!1),J=j.useAppConfig();/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:q,backFn:$}),n&&/*#__PURE__*/e.jsx(z,{children:n}),/*#__PURE__*/e.jsx(h.Title,{style:{marginTop:n?"1.5rem":0},children:m}),/*#__PURE__*/e.jsx(x.Subtitle,{children:g}),/*#__PURE__*/e.jsxs(a.Rows,{style:{marginTop:"2rem",marginBottom:".5rem"},children:[(I||O)&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsx(t.Value,{$isLoading:O,children:I})]}),L&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Swap"}),/*#__PURE__*/e.jsx(t.Value,{children:L})]}),w&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Network"}),/*#__PURE__*/e.jsx(t.Value,{children:w})]}),(R||O||void 0!==D)&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Estimated fee"}),/*#__PURE__*/e.jsx(t.Value,{$isLoading:O,children:D&&!O?/*#__PURE__*/e.jsxs(H,{children:[/*#__PURE__*/e.jsxs(U,{children:["Sponsored by ",J.name]}),/*#__PURE__*/e.jsx(s.BoltIcon,{height:16,width:16})]}):R})]})]}),/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(V,{onClick:()=>G((e=>!e)),children:[/*#__PURE__*/e.jsx("span",{children:"Advanced"}),/*#__PURE__*/e.jsx(s.ChevronDownIcon,{height:"16px",width:"16px",strokeWidth:"2",style:{transition:"all 300ms",transform:B?"rotate(180deg)":void 0}})]})}),B&&/*#__PURE__*/e.jsx(e.Fragment,{children:f.map(((s,r)=>"sol-transfer"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Transfer ",s.withSeed?"with seed":""]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsxs(t.Value,{children:[i.formatTokenAmount({amount:s.value,decimals:s.token.decimals})," ",s.token.symbol]})]}),!!s.toAccount&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Destination"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.toAccount,url:y})})]})]},r):"spl-transfer"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Transfer ",s.token.symbol]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsx(t.Value,{children:s.value.toString()})]}),!!s.fromAta&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Source"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.fromAta,url:y})})]}),!!s.toAta&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Destination"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.toAta,url:y})})]}),!!s.token.address&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.token.address,url:y})})]})]},r):"ata-creation"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsx(c.LabelXs,{children:"Create token account"})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Program ID"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.program,url:y})})]}),!!s.owner&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Owner"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.owner,url:y})})]})]},r):"create-account"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Create account ",s.withSeed?"with seed":""]})}),!!s.account&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Account"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.account,url:y})})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsxs(t.Value,{children:[i.formatTokenAmount({amount:s.value,decimals:9})," SOL"]})]})]},r):"spl-init-account"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsx(c.LabelXs,{children:"Initialize token account"})}),!!s.account&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Account"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.account,url:y})})]}),!!s.mint&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Mint"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mint,url:y})})]}),!!s.owner&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Owner"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.owner,url:y})})]})]},r):"spl-close-account"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsx(c.LabelXs,{children:"Close token account"})}),!!s.source&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Source"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.source,url:y})})]}),!!s.destination&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Destination"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.destination,url:y})})]}),!!s.owner&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Owner"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.owner,url:y})})]})]},r):"spl-sync-native"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsx(c.LabelXs,{children:"Sync native"})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Program ID"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.program,url:y})})]})]},r):"raydium-swap-base-input"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Raydium swap"," ",s.tokenIn&&s.tokenOut?`${s.tokenIn.symbol} → ${s.tokenOut.symbol}`:""]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount in"}),/*#__PURE__*/e.jsx(t.Value,{children:s.amountIn.toString()})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Minimum amount out"}),/*#__PURE__*/e.jsx(t.Value,{children:s.minimumAmountOut.toString()})]}),s.mintIn&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token in"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintIn,url:y})})]}),s.mintOut&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token out"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintOut,url:y})})]})]},r):"raydium-swap-base-output"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Raydium swap"," ",s.tokenIn&&s.tokenOut?`${s.tokenIn.symbol} → ${s.tokenOut.symbol}`:""]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Max amount in"}),/*#__PURE__*/e.jsx(t.Value,{children:s.maxAmountIn.toString()})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount out"}),/*#__PURE__*/e.jsx(t.Value,{children:s.amountOut.toString()})]}),s.mintIn&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token in"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintIn,url:y})})]}),s.mintOut&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token out"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintOut,url:y})})]})]},r):"jupiter-swap-shared-accounts-route"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Jupiter swap"," ",s.tokenIn&&s.tokenOut?`${s.tokenIn.symbol} → ${s.tokenOut.symbol}`:""]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"In amount"}),/*#__PURE__*/e.jsx(t.Value,{children:s.inAmount.toString()})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Quoted out amount"}),/*#__PURE__*/e.jsx(t.Value,{children:s.quotedOutAmount.toString()})]}),s.mintIn&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token in"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintIn,url:y})})]}),s.mintOut&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token out"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintOut,url:y})})]})]},r):"jupiter-swap-exact-out-route"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Jupiter swap"," ",s.tokenIn&&s.tokenOut?`${s.tokenIn.symbol} → ${s.tokenOut.symbol}`:""]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Quoted in amount"}),/*#__PURE__*/e.jsx(t.Value,{children:s.quotedInAmount.toString()})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount out"}),/*#__PURE__*/e.jsx(t.Value,{children:s.outAmount.toString()})]}),s.mintIn&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token in"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintIn,url:y})})]}),s.mintOut&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token out"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintOut,url:y})})]})]},r):/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Program ID"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.program,url:y})})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Data"}),/*#__PURE__*/e.jsx(t.Value,{children:s.discriminator})]})]},r)))}),/*#__PURE__*/e.jsx(p.Grow,{}),k?/*#__PURE__*/e.jsx(d.ErrorMessage,{style:{marginTop:"2rem"},children:k.message}):v?/*#__PURE__*/e.jsx(d.ErrorMessage,{style:{marginTop:"2rem"},children:W}):null,/*#__PURE__*/e.jsx(P,{$useSmallMargins:!(!v&&!k),title:"",address:C,balance:A,errMsg:M||v||k||!S?void 0:"Add funds on Solana to complete transaction."}),/*#__PURE__*/e.jsx(o.PrimaryButton,{style:{marginTop:"1rem"},loading:N,disabled:T||M,onClick:F,children:b}),/*#__PURE__*/e.jsx(l.BlobbyFooter,{})]})},exports.SendTransactionScreenView=({img:n,submitError:i,prepareError:c,onClose:m,action:g,title:b,subtitle:f,to:w,tokenAddress:y,network:S,missingFunds:k,fee:v,from:I,cta:L,disabled:C,chain:R,isSubmitting:A,isPreparing:T,isTokenPriceLoading:M,isTokenContractInfoLoading:E,isSponsored:F,symbol:D,balance:O,onClick:X,transactionDetails:G,transactionIndex:J,maxIndex:Q,onBack:Y,chainName:K,validation:Z,hasScanDetails:_,setIsScanDetailsOpen:ee,preventMaliciousTransaction:se,setPreventMaliciousTransaction:re,tokensSent:ne,tokensReceived:ie,isScanning:oe,isCancellable:le,functionName:te})=>{let{showTransactionDetails:ae,setShowTransactionDetails:de,hasMoreDetails:ce,isErc20Ish:xe}=(e=>{let[s,n]=r.useState(!1),i=!0,o=!1;return(!e||e.isErc20Ish||"transaction"===e.action)&&(i=!1),i&&(o=Object.entries(e||{}).some((([e,s])=>s&&!["action","isErc20Ish","isNFTIsh"].includes(e)))),{showTransactionDetails:s,setShowTransactionDetails:n,hasMoreDetails:i&&o,isErc20Ish:e?.isErc20Ish}})(G),he=j.useAppConfig(),ue=xe&&E||T||M||oe;/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:m,backFn:Y}),n&&/*#__PURE__*/e.jsx(z,{children:n}),/*#__PURE__*/e.jsxs(h.Title,{style:{marginTop:n?"1.5rem":0},children:[b,/*#__PURE__*/e.jsx(B,{maxIndex:Q,transactionIndex:J})]}),/*#__PURE__*/e.jsx(x.Subtitle,{children:f}),/*#__PURE__*/e.jsxs(a.Rows,{style:{marginTop:"2rem"},children:[(!!ne[0]||ue)&&/*#__PURE__*/e.jsxs(a.Row,{children:[ie.length>0?/*#__PURE__*/e.jsx(t.LabelSm,{children:"Send"}):/*#__PURE__*/e.jsx(t.LabelSm,{children:"approve"===g?"Approval amount":"Amount"}),/*#__PURE__*/e.jsx("div",{className:"flex flex-col",children:ne.map(((s,r)=>/*#__PURE__*/e.jsx(N,{iconUrl:s.iconUrl,value:"setApprovalForAll"===te?"All":s.value,usdValue:s.usdValue,symbol:s.symbol,nftName:s.nftName,nftCount:s.nftCount,decimals:s.decimals},r)))})]}),ie.length>0&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Receive"}),/*#__PURE__*/e.jsx("div",{className:"flex flex-col",children:ie.map(((s,r)=>/*#__PURE__*/e.jsx(N,{iconUrl:s.iconUrl,value:s.value,usdValue:s.usdValue,symbol:s.symbol,nftName:s.nftName,nftCount:s.nftCount,decimals:s.decimals},r)))})]}),G&&"spender"in G&&G?.spender?/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Spender"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:G.spender,url:R?.blockExplorers?.default?.url})})]}):null,w&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"To"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:w,url:R?.blockExplorers?.default?.url,showCopyIcon:!0})})]}),y&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token address"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:y,url:R?.blockExplorers?.default?.url})})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Network"}),/*#__PURE__*/e.jsx(t.Value,{children:S})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Estimated fee"}),/*#__PURE__*/e.jsx(t.Value,{$isLoading:T||M||void 0===F,children:F?/*#__PURE__*/e.jsxs(H,{children:[/*#__PURE__*/e.jsxs(U,{children:["Sponsored by ",he.name]}),/*#__PURE__*/e.jsx(s.BoltIcon,{height:16,width:16})]}):v})]}),ce&&!_&&/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(a.Row,{className:"cursor-pointer",onClick:()=>de(!ae),children:/*#__PURE__*/e.jsxs(t.LabelSmPrimary,{className:"flex items-center gap-x-1",children:["Details"," ",/*#__PURE__*/e.jsx(s.ChevronDownIcon,{style:{width:"0.75rem",marginLeft:"0.25rem",transform:ae?"rotate(180deg)":void 0}})]})}),ae&&G&&/*#__PURE__*/e.jsx(q,{action:g,chain:R,transactionDetails:G,isTokenContractInfoLoading:E,symbol:D})]}),_&&/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(V,{onClick:()=>ee(!0),children:[/*#__PURE__*/e.jsx("span",{className:"text-color-primary",children:"Details"}),/*#__PURE__*/e.jsx(s.ArrowRightIcon,{height:"14px",width:"14px",strokeWidth:"2"})]})})]}),/*#__PURE__*/e.jsx(p.Grow,{}),i?/*#__PURE__*/e.jsx(d.ErrorMessage,{style:{marginTop:"2rem"},children:i.message}):c&&0===J?
1
+ "use strict";var e=require("react/jsx-runtime"),s=require("@heroicons/react/24/outline"),r=require("react"),n=require("styled-components"),i=require("@privy-io/js-sdk-core"),o=require("./Button-Bm_Ft0Dw.js"),l=require("./ModalHeader-DB7Tbjwz.js"),t=require("./Value-C-XtZyFa.js"),a=require("./Row-CxDF-VMy.js"),d=require("./ErrorMessage-f0cRWc29.js"),c=require("./LabelXs-CYMv6rOZ.js"),x=require("./Subtitle-Dtmrw8l5.js"),h=require("./Title-C-tHJvrb.js"),u=require("./Address-5znFAhQw.js"),m=require("./WalletInfoCard-DKVdH9iF.js"),j=require("./context-DFq1obBO.js"),p=require("./useActiveWallet-BOX8xCn9.js"),g=require("./LoadingSkeleton-DoCrfGnl.js"),b=require("viem"),f=require("./shared-BPGwTh8c.js"),w=require("./Checkbox-DXPQZFlQ.js"),y=require("./ErrorBanner-CMjaobRI.js"),S=require("./WarningBanner-B_Gs_15p.js"),k=require("@heroicons/react/24/outline/ClipboardDocumentCheckIcon"),v=require("@heroicons/react/24/outline/ClipboardDocumentIcon"),I=require("@heroicons/react/24/outline/ExclamationCircleIcon"),L=require("./internal-context-NWsAL807.js");function C(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var R=/*#__PURE__*/C(k),A=/*#__PURE__*/C(v),T=/*#__PURE__*/C(I);const V=/*#__PURE__*/n.styled(t.LabelSm).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 N=({iconUrl:s,value:r,symbol:n,usdValue:i,nftName:o,nftCount:l,decimals:t,$isLoading:a})=>{if(a)/*#__PURE__*/return e.jsx(M,{$isLoading:a});let d=r&&i&&t?function(e,s,r){let n=parseFloat(e),i=parseFloat(r);if(0===n||0===i||Number.isNaN(n)||Number.isNaN(i))return e;let o=Math.ceil(-Math.log10(.01/(i/n))),l=Math.pow(10,o=Math.max(o=Math.min(o,s),1)),t=+(Math.floor(n*l)/l).toFixed(o).replace(/\.?0+$/,"");return Intl.NumberFormat(void 0,{maximumFractionDigits:s}).format(t)}(r,t,i):r;/*#__PURE__*/return e.jsxs("div",{children:[/*#__PURE__*/e.jsxs(M,{$isLoading:a,children:[s&&/*#__PURE__*/e.jsx(F,{src:s,alt:"Token icon"}),l&&l>1?l+"x":void 0," ",o,d," ",n]}),i&&/*#__PURE__*/e.jsxs(E,{$isLoading:a,children:["$",i]})]})};let M=/*#__PURE__*/n.styled.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;",""],g.LoadingSkeleton);const E=/*#__PURE__*/n.styled.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;",""],g.LoadingSkeleton);let F=/*#__PURE__*/n.styled.img.withConfig({displayName:"TokenIcon",componentId:"sc-991db279-2"})(["height:14px;width:14px;margin-right:4px;object-fit:contain;"]);const q=s=>{let{chain:r,transactionDetails:n,isTokenContractInfoLoading:i,symbol:o}=s,{action:l,functionName:d}=n;/*#__PURE__*/return e.jsx(f.Box,{children:/*#__PURE__*/e.jsxs(a.Rows,{children:["transaction"!==l&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Action"}),/*#__PURE__*/e.jsx(t.Value,{children:d})]}),"mint"===d&&"args"in n&&n.args.filter((e=>e)).map(((s,n)=>/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:`Param ${n}`}),/*#__PURE__*/e.jsx(t.Value,{children:"string"==typeof s&&b.isAddress(s)?/*#__PURE__*/e.jsx(u.Address,{address:s,url:r?.blockExplorers?.default?.url,showCopyIcon:!1}):s?.toString()})]},n))),"setApprovalForAll"===d&&n.operator&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Operator"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:n.operator,url:r?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),"setApprovalForAll"===d&&void 0!==n.approved&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Set approval to"}),/*#__PURE__*/e.jsx(t.Value,{children:n.approved?"true":"false"})]}),"transfer"===d||"transferFrom"===d||"safeTransferFrom"===d||"approve"===d?/*#__PURE__*/e.jsxs(e.Fragment,{children:["formattedAmount"in n&&n.formattedAmount&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsxs(t.Value,{$isLoading:i,children:[n.formattedAmount," ",o]})]}),"tokenId"in n&&n.tokenId&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token ID"}),/*#__PURE__*/e.jsx(t.Value,{children:n.tokenId.toString()})]})]}):null,"safeBatchTransferFrom"===d&&/*#__PURE__*/e.jsxs(e.Fragment,{children:["amounts"in n&&n.amounts&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amounts"}),/*#__PURE__*/e.jsx(t.Value,{children:n.amounts.join(", ")})]}),"tokenIds"in n&&n.tokenIds&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token IDs"}),/*#__PURE__*/e.jsx(t.Value,{children:n.tokenIds.join(", ")})]})]}),"approve"===d&&n.spender&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Spender"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:n.spender,url:r?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===d||"safeTransferFrom"===d||"safeBatchTransferFrom"===d)&&n.transferFrom&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Transferring from"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:n.transferFrom,url:r?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===d||"safeTransferFrom"===d||"safeBatchTransferFrom"===d)&&n.transferTo&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Transferring to"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:n.transferTo,url:r?.blockExplorers?.default?.url,showCopyIcon:!1})})]})]})})},$=({variant:s,setPreventMaliciousTransaction:r,colorScheme:n="light",preventMaliciousTransaction:i})=>"warn"===s?/*#__PURE__*/e.jsx(D,{children:/*#__PURE__*/e.jsxs(S.WarningBanner,{theme:n,children:[/*#__PURE__*/e.jsx("span",{style:{fontWeight:"500"},children:"Warning: Suspicious transaction"}),/*#__PURE__*/e.jsx("br",{}),"This has been flagged as a potentially deceptive request. Approving could put your assets or funds at risk."]})}):"error"===s?/*#__PURE__*/e.jsx(e.Fragment,{children:/*#__PURE__*/e.jsxs(D,{children:[/*#__PURE__*/e.jsx(y.ErrorBanner,{theme:n,children:/*#__PURE__*/e.jsxs("div",{children:[/*#__PURE__*/e.jsx("strong",{children:"This is a malicious transaction"}),/*#__PURE__*/e.jsx("br",{}),"This transaction transfers tokens to a known malicious address. Proceeding may result in the loss of valuable assets."]})}),/*#__PURE__*/e.jsxs(O,{children:[/*#__PURE__*/e.jsx(w.Checkbox,{color:"var(--privy-color-error)",checked:!i,readOnly:!0,onClick:()=>r(!i)}),/*#__PURE__*/e.jsx("span",{children:"I understand and want to proceed anyways."})]})]})}):null;let D=/*#__PURE__*/n.styled.div.withConfig({displayName:"BannerContainer",componentId:"sc-ab8a5a0b-0"})(["margin-top:1.5rem;"]),O=/*#__PURE__*/n.styled.div.withConfig({displayName:"CheckboxContainer",componentId:"sc-ab8a5a0b-1"})(["display:flex;align-items:center;gap:0.5rem;margin-top:0.75rem;"]);const B=({transactionIndex:e,maxIndex:s})=>"number"!=typeof e||0===s?"":` (${e+1} / ${s+1})`;let P=/*#__PURE__*/n.styled(m.WalletInfoCard).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-cbe5ab37-0"})(["",""],(e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;")),X=/*#__PURE__*/n.styled(a.Rows).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;"]),W="There was an error preparing your transaction. Your transaction request will likely fail.",z=/*#__PURE__*/n.styled.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);}"]),H=/*#__PURE__*/n.styled.span.withConfig({displayName:"SponsoredRow",componentId:"sc-cbe5ab37-3"})(["display:inline-flex;align-items:center;gap:0.3rem;"]),U=/*#__PURE__*/n.styled.span.withConfig({displayName:"SponsoredText",componentId:"sc-cbe5ab37-4"})(["font-size:14px;font-weight:500;color:var(--privy-color-foreground);"]);let G=()=>/*#__PURE__*/e.jsxs(K,{children:[/*#__PURE__*/e.jsx(_,{}),/*#__PURE__*/e.jsx(Z,{})]});let J=/*#__PURE__*/n.styled.div.withConfig({displayName:"TransactionErrorScreenContainer",componentId:"sc-d58f10e6-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;"]),Q=/*#__PURE__*/n.styled.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;"]),Y=/*#__PURE__*/n.styled.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;"]),K=/*#__PURE__*/n.styled.div.withConfig({displayName:"CircleContainer",componentId:"sc-d58f10e6-3"})(["position:relative;width:60px;height:60px;margin:10px;display:flex;justify-content:center;align-items:center;"]),Z=/*#__PURE__*/n.styled(T.default).withConfig({displayName:"StyledExclamationCircleIcon",componentId:"sc-d58f10e6-4"})(["position:absolute;width:35px;height:35px;color:var(--privy-color-error);"]),_=/*#__PURE__*/n.styled.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;"]),ee=/*#__PURE__*/n.styled(o.PrimaryButton).withConfig({displayName:"RetryButton",componentId:"sc-d58f10e6-6"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]),se=/*#__PURE__*/n.styled.span.withConfig({displayName:"TextBoxTitle",componentId:"sc-d58f10e6-7"})(["width:100%;text-align:left;font-size:0.825rem;color:var(--privy-color-foreground);padding:4px;"]),re=/*#__PURE__*/n.styled.div.withConfig({displayName:"TextBoxContainer",componentId:"sc-d58f10e6-8"})(["width:100%;margin:5px;display:flex;flex-direction:column;justify-content:center;align-items:center;"]),ne=/*#__PURE__*/n.styled.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;"]),ie=/*#__PURE__*/n.styled.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 }")),oe=/*#__PURE__*/n.styled(A.default).withConfig({displayName:"StyledClipboardIcon",componentId:"sc-d58f10e6-11"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),le=/*#__PURE__*/n.styled(R.default).withConfig({displayName:"StyledClipboardCheckIcon",componentId:"sc-d58f10e6-12"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),te=({clicked:s})=>s?/*#__PURE__*/e.jsx(le,{}):/*#__PURE__*/e.jsx(oe,{});exports.SendSolanaTransactionScreenView=({img:n,title:m,subtitle:g,cta:b,instructions:f,network:w,blockExplorerUrl:y,isMissingFunds:S,submitError:k,parseError:v,total:I,swap:L,transactingWalletAddress:C,fee:R,balance:A,disabled:T,isSubmitting:N,isPreparing:M,isTokenPriceLoading:E,onClick:F,onClose:q,onBack:$,isSponsored:D})=>{let O=M||E,[B,G]=r.useState(!1),J=j.useAppConfig();/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:q,backFn:$}),n&&/*#__PURE__*/e.jsx(z,{children:n}),/*#__PURE__*/e.jsx(h.Title,{style:{marginTop:n?"1.5rem":0},children:m}),/*#__PURE__*/e.jsx(x.Subtitle,{children:g}),/*#__PURE__*/e.jsxs(a.Rows,{style:{marginTop:"2rem",marginBottom:".5rem"},children:[(I||O)&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsx(t.Value,{$isLoading:O,children:I})]}),L&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Swap"}),/*#__PURE__*/e.jsx(t.Value,{children:L})]}),w&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Network"}),/*#__PURE__*/e.jsx(t.Value,{children:w})]}),(R||O||void 0!==D)&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Estimated fee"}),/*#__PURE__*/e.jsx(t.Value,{$isLoading:O,children:D&&!O?/*#__PURE__*/e.jsxs(H,{children:[/*#__PURE__*/e.jsxs(U,{children:["Sponsored by ",J.name]}),/*#__PURE__*/e.jsx(s.BoltIcon,{height:16,width:16})]}):R})]})]}),/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(V,{onClick:()=>G((e=>!e)),children:[/*#__PURE__*/e.jsx("span",{children:"Advanced"}),/*#__PURE__*/e.jsx(s.ChevronDownIcon,{height:"16px",width:"16px",strokeWidth:"2",style:{transition:"all 300ms",transform:B?"rotate(180deg)":void 0}})]})}),B&&/*#__PURE__*/e.jsx(e.Fragment,{children:f.map(((s,r)=>"sol-transfer"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Transfer ",s.withSeed?"with seed":""]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsxs(t.Value,{children:[i.formatTokenAmount({amount:s.value,decimals:s.token.decimals})," ",s.token.symbol]})]}),!!s.toAccount&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Destination"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.toAccount,url:y})})]})]},r):"spl-transfer"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Transfer ",s.token.symbol]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsx(t.Value,{children:s.value.toString()})]}),!!s.fromAta&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Source"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.fromAta,url:y})})]}),!!s.toAta&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Destination"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.toAta,url:y})})]}),!!s.token.address&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.token.address,url:y})})]})]},r):"ata-creation"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsx(c.LabelXs,{children:"Create token account"})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Program ID"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.program,url:y})})]}),!!s.owner&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Owner"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.owner,url:y})})]})]},r):"create-account"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Create account ",s.withSeed?"with seed":""]})}),!!s.account&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Account"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.account,url:y})})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount"}),/*#__PURE__*/e.jsxs(t.Value,{children:[i.formatTokenAmount({amount:s.value,decimals:9})," SOL"]})]})]},r):"spl-init-account"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsx(c.LabelXs,{children:"Initialize token account"})}),!!s.account&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Account"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.account,url:y})})]}),!!s.mint&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Mint"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mint,url:y})})]}),!!s.owner&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Owner"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.owner,url:y})})]})]},r):"spl-close-account"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsx(c.LabelXs,{children:"Close token account"})}),!!s.source&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Source"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.source,url:y})})]}),!!s.destination&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Destination"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.destination,url:y})})]}),!!s.owner&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Owner"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.owner,url:y})})]})]},r):"spl-sync-native"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsx(c.LabelXs,{children:"Sync native"})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Program ID"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.program,url:y})})]})]},r):"raydium-swap-base-input"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Raydium swap"," ",s.tokenIn&&s.tokenOut?`${s.tokenIn.symbol} → ${s.tokenOut.symbol}`:""]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount in"}),/*#__PURE__*/e.jsx(t.Value,{children:s.amountIn.toString()})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Minimum amount out"}),/*#__PURE__*/e.jsx(t.Value,{children:s.minimumAmountOut.toString()})]}),s.mintIn&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token in"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintIn,url:y})})]}),s.mintOut&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token out"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintOut,url:y})})]})]},r):"raydium-swap-base-output"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Raydium swap"," ",s.tokenIn&&s.tokenOut?`${s.tokenIn.symbol} → ${s.tokenOut.symbol}`:""]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Max amount in"}),/*#__PURE__*/e.jsx(t.Value,{children:s.maxAmountIn.toString()})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount out"}),/*#__PURE__*/e.jsx(t.Value,{children:s.amountOut.toString()})]}),s.mintIn&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token in"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintIn,url:y})})]}),s.mintOut&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token out"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintOut,url:y})})]})]},r):"jupiter-swap-shared-accounts-route"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Jupiter swap"," ",s.tokenIn&&s.tokenOut?`${s.tokenIn.symbol} → ${s.tokenOut.symbol}`:""]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"In amount"}),/*#__PURE__*/e.jsx(t.Value,{children:s.inAmount.toString()})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Quoted out amount"}),/*#__PURE__*/e.jsx(t.Value,{children:s.quotedOutAmount.toString()})]}),s.mintIn&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token in"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintIn,url:y})})]}),s.mintOut&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token out"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintOut,url:y})})]})]},r):"jupiter-swap-exact-out-route"===s.type?/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(c.LabelXs,{children:["Jupiter swap"," ",s.tokenIn&&s.tokenOut?`${s.tokenIn.symbol} → ${s.tokenOut.symbol}`:""]})}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Quoted in amount"}),/*#__PURE__*/e.jsx(t.Value,{children:s.quotedInAmount.toString()})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Amount out"}),/*#__PURE__*/e.jsx(t.Value,{children:s.outAmount.toString()})]}),s.mintIn&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token in"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintIn,url:y})})]}),s.mintOut&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token out"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.mintOut,url:y})})]})]},r):/*#__PURE__*/e.jsxs(X,{children:[/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Program ID"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:s.program,url:y})})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Data"}),/*#__PURE__*/e.jsx(t.Value,{children:s.discriminator})]})]},r)))}),/*#__PURE__*/e.jsx(p.Grow,{}),k?/*#__PURE__*/e.jsx(d.ErrorMessage,{style:{marginTop:"2rem"},children:k.message}):v?/*#__PURE__*/e.jsx(d.ErrorMessage,{style:{marginTop:"2rem"},children:W}):null,/*#__PURE__*/e.jsx(P,{$useSmallMargins:!(!v&&!k),title:"",address:C,balance:A,errMsg:M||v||k||!S?void 0:"Add funds on Solana to complete transaction."}),/*#__PURE__*/e.jsx(o.PrimaryButton,{style:{marginTop:"1rem"},loading:N,disabled:T||M,onClick:F,children:b}),/*#__PURE__*/e.jsx(l.BlobbyFooter,{})]})},exports.SendTransactionScreenView=({img:n,submitError:i,prepareError:c,onClose:m,action:g,title:b,subtitle:f,to:w,tokenAddress:y,network:S,missingFunds:k,fee:v,from:I,cta:L,disabled:C,chain:R,isSubmitting:A,isPreparing:T,isTokenPriceLoading:M,isTokenContractInfoLoading:E,isSponsored:F,symbol:D,balance:O,onClick:X,transactionDetails:G,transactionIndex:J,maxIndex:Q,onBack:Y,chainName:K,validation:Z,hasScanDetails:_,setIsScanDetailsOpen:ee,preventMaliciousTransaction:se,setPreventMaliciousTransaction:re,tokensSent:ne,tokensReceived:ie,isScanning:oe,isCancellable:le,functionName:te})=>{let{showTransactionDetails:ae,setShowTransactionDetails:de,hasMoreDetails:ce,isErc20Ish:xe}=(e=>{let[s,n]=r.useState(!1),i=!0,o=!1;return(!e||e.isErc20Ish||"transaction"===e.action)&&(i=!1),i&&(o=Object.entries(e||{}).some((([e,s])=>s&&!["action","isErc20Ish","isNFTIsh"].includes(e)))),{showTransactionDetails:s,setShowTransactionDetails:n,hasMoreDetails:i&&o,isErc20Ish:e?.isErc20Ish}})(G),he=j.useAppConfig(),ue=xe&&E||T||M||oe;/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:m,backFn:Y}),n&&/*#__PURE__*/e.jsx(z,{children:n}),/*#__PURE__*/e.jsxs(h.Title,{style:{marginTop:n?"1.5rem":0},children:[b,/*#__PURE__*/e.jsx(B,{maxIndex:Q,transactionIndex:J})]}),/*#__PURE__*/e.jsx(x.Subtitle,{children:f}),/*#__PURE__*/e.jsxs(a.Rows,{style:{marginTop:"2rem"},children:[(!!ne[0]||ue)&&/*#__PURE__*/e.jsxs(a.Row,{children:[ie.length>0?/*#__PURE__*/e.jsx(t.LabelSm,{children:"Send"}):/*#__PURE__*/e.jsx(t.LabelSm,{children:"approve"===g?"Approval amount":"Amount"}),/*#__PURE__*/e.jsx("div",{className:"flex flex-col",children:ne.map(((s,r)=>/*#__PURE__*/e.jsx(N,{iconUrl:s.iconUrl,value:"setApprovalForAll"===te?"All":s.value,usdValue:s.usdValue,symbol:s.symbol,nftName:s.nftName,nftCount:s.nftCount,decimals:s.decimals},r)))})]}),ie.length>0&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Receive"}),/*#__PURE__*/e.jsx("div",{className:"flex flex-col",children:ie.map(((s,r)=>/*#__PURE__*/e.jsx(N,{iconUrl:s.iconUrl,value:s.value,usdValue:s.usdValue,symbol:s.symbol,nftName:s.nftName,nftCount:s.nftCount,decimals:s.decimals},r)))})]}),G&&"spender"in G&&G?.spender?/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Spender"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:G.spender,url:R?.blockExplorers?.default?.url})})]}):null,w&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"To"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:w,url:R?.blockExplorers?.default?.url,showCopyIcon:!0})})]}),y&&/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Token address"}),/*#__PURE__*/e.jsx(t.Value,{children:/*#__PURE__*/e.jsx(u.Address,{address:y,url:R?.blockExplorers?.default?.url})})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Network"}),/*#__PURE__*/e.jsx(t.Value,{children:S})]}),/*#__PURE__*/e.jsxs(a.Row,{children:[/*#__PURE__*/e.jsx(t.LabelSm,{children:"Estimated fee"}),/*#__PURE__*/e.jsx(t.Value,{$isLoading:T||M||void 0===F,children:F?/*#__PURE__*/e.jsxs(H,{children:[/*#__PURE__*/e.jsxs(U,{children:["Sponsored by ",he.name]}),/*#__PURE__*/e.jsx(s.BoltIcon,{height:16,width:16})]}):v})]}),ce&&!_&&/*#__PURE__*/e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(a.Row,{className:"cursor-pointer",onClick:()=>de(!ae),children:/*#__PURE__*/e.jsxs(t.LabelSmPrimary,{className:"flex items-center gap-x-1",children:["Details"," ",/*#__PURE__*/e.jsx(s.ChevronDownIcon,{style:{width:"0.75rem",marginLeft:"0.25rem",transform:ae?"rotate(180deg)":void 0}})]})}),ae&&G&&/*#__PURE__*/e.jsx(q,{action:g,chain:R,transactionDetails:G,isTokenContractInfoLoading:E,symbol:D})]}),_&&/*#__PURE__*/e.jsx(a.Row,{children:/*#__PURE__*/e.jsxs(V,{onClick:()=>ee(!0),children:[/*#__PURE__*/e.jsx("span",{className:"text-color-primary",children:"Details"}),/*#__PURE__*/e.jsx(s.ArrowRightIcon,{height:"14px",width:"14px",strokeWidth:"2"})]})})]}),/*#__PURE__*/e.jsx(p.Grow,{}),i?/*#__PURE__*/e.jsx(d.ErrorMessage,{style:{marginTop:"2rem"},children:i.message}):c&&0===J?
2
2
  /*#__PURE__*/e.jsx(d.ErrorMessage,{style:{marginTop:"2rem"},children:c.shortMessage??W}):null,/*#__PURE__*/e.jsx($,{variant:Z,preventMaliciousTransaction:se,setPreventMaliciousTransaction:re}),/*#__PURE__*/e.jsx(P,{$useSmallMargins:!(!c&&!i&&"warn"!==Z&&"error"!==Z),address:I,balance:O,errMsg:T||c||i||!k?void 0:`Add funds on ${R?.name??K} to complete transaction.`}),/*#__PURE__*/e.jsx(o.PrimaryButton,{style:{marginTop:"1rem"},loading:A,disabled:C||T,onClick:X,children:L}),le&&/*#__PURE__*/e.jsx(o.EmbeddedButton,{style:{marginTop:"1rem"},onClick:m,isSubmitting:!1,children:"Not now"}),/*#__PURE__*/e.jsx(l.BlobbyFooter,{})]})},exports.TransactionErrorView=({transactionError:s,chainId:n,onClose:i,onRetry:o,chainType:t,transactionHash:a})=>{let{chains:d}=L.usePrivyInternal(),[c,x]=r.useState(!1),{errorCode:h,errorMessage:u}=((e,s)=>{if("ethereum"===s)return{errorCode:e.details??e.message,errorMessage:e.shortMessage};let r=e.txSignature,n=e?.transactionMessage||"Something went wrong.";if(Array.isArray(e.logs)){let s=e.logs.find((e=>/insufficient (lamports|funds)/gi.test(e)));s&&(n=s)}return{transactionHash:r,errorMessage:n}})(s,t),m=(({chains:e,chainId:s,chainType:r,transactionHash:n})=>"ethereum"===r?e.find((e=>e.id===s))?.blockExplorers?.default.url??"https://etherscan.io":function(e,s){return`https://explorer.solana.com/tx/${e}?chain=${s}`}(n||"",s))({chains:d,chainId:n,chainType:t,transactionHash:a});/*#__PURE__*/return e.jsxs(e.Fragment,{children:[/*#__PURE__*/e.jsx(l.ModalHeader,{onClose:i}),/*#__PURE__*/e.jsxs(J,{children:[/*#__PURE__*/e.jsx(G,{}),/*#__PURE__*/e.jsx(Q,{children:h}),/*#__PURE__*/e.jsx(Y,{children:"Please try again."}),/*#__PURE__*/e.jsxs(re,{children:[/*#__PURE__*/e.jsx(se,{children:"Error message"}),/*#__PURE__*/e.jsx(ie,{$clickable:!1,children:u})]}),a&&/*#__PURE__*/e.jsxs(re,{children:[/*#__PURE__*/e.jsx(se,{children:"Transaction hash"}),/*#__PURE__*/e.jsxs(ne,{children:["Copy this hash to view details about the transaction on a"," ",/*#__PURE__*/e.jsx("u",{children:/*#__PURE__*/e.jsx("a",{href:m,children:"block explorer"})}),"."]}),/*#__PURE__*/e.jsxs(ie,{$clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(a),x(!0)},children:[a,/*#__PURE__*/e.jsx(te,{clicked:c})]})]}),/*#__PURE__*/e.jsx(ee,{onClick:()=>o({resetNonce:!!a}),children:"Retry transaction"})]}),/*#__PURE__*/e.jsx(l.ModalFooter,{})]})};