@privy-io/react-auth 3.7.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (361) hide show
  1. package/dist/cjs/AccountNotFoundScreen-jSbfPu_e.js +1 -0
  2. package/dist/cjs/Address-CZQd_MIA.js +1 -0
  3. package/dist/cjs/AffirmativeConsentScreen-7a4hl59A.js +1 -0
  4. package/dist/cjs/AllowlistRejectionScreen-B6roj0JU.js +1 -0
  5. package/dist/cjs/AuthenticateWithWalletScreen-BcBapHrq.js +1 -0
  6. package/dist/cjs/AwaitingEvmToSolBridgingScreen-D1Xd83Hp.js +2 -0
  7. package/dist/cjs/AwaitingExternalEthereumTransferScreen-COL0WYkT.js +2 -0
  8. package/dist/cjs/AwaitingPasswordlessCodeScreen-Cx5fqGf6.js +1 -0
  9. package/dist/cjs/AwaitingSolToEvmBridgingScreen-DYS3lDs0.js +2 -0
  10. package/dist/cjs/BridgeNetworkSelectionView-uivzU_Y9.js +1 -0
  11. package/dist/cjs/Button-nXApC2Jy.js +2 -0
  12. package/dist/cjs/CaptchaScreen-025syTLo.js +1 -0
  13. package/dist/cjs/Checkbox-DXPQZFlQ.js +1 -0
  14. package/dist/cjs/Chip-ChrHHazc.js +1 -0
  15. package/dist/cjs/CoinbaseOnrampStatusScreen-ORl8wt4H.js +1 -0
  16. package/dist/cjs/Column-C2bAbJE0.js +1 -0
  17. package/dist/cjs/ConnectEmailForm-BEv-7qU9.js +1 -0
  18. package/dist/cjs/ConnectLedgerScreen-DBYExlWR.js +1 -0
  19. package/dist/cjs/ConnectOnlyLandingScreen-bOhkl0xJ.js +1 -0
  20. package/dist/cjs/ConnectOnlyStatusScreen-DvTrLHyY.js +1 -0
  21. package/dist/cjs/ConnectOrCreateScreen-Dh4EFU5N.js +1 -0
  22. package/dist/cjs/ConnectPhoneForm-DK-bg2D5.js +1 -0
  23. package/dist/cjs/ConnectWalletView-4vj7Sq7-.js +1 -0
  24. package/dist/cjs/ConnectionStatusScreen-Ct-KTCXS.js +1 -0
  25. package/dist/cjs/CopyToClipboard-fd8Z3kQX.js +1 -0
  26. package/dist/cjs/CrossAppAuthScreen-B-DtA7IH.js +1 -0
  27. package/dist/cjs/CustomLandingScreenView-tt_NEfU6.js +2 -0
  28. package/dist/cjs/DelegatedActionsConsentScreen-B5WlYn7z.js +1 -0
  29. package/dist/cjs/DelegatedActionsRevokeScreen-2g_ydX-Y.js +1 -0
  30. package/dist/cjs/EmailInputForm-tjrhBacA.js +1 -0
  31. package/dist/cjs/EmbeddedWalletConnectingScreen-9seYvsTF.js +1 -0
  32. package/dist/cjs/EmbeddedWalletCreatedScreen-PycFyIz6.js +1 -0
  33. package/dist/cjs/EmbeddedWalletKeyExportScreen-BDTDQY1f.js +2 -0
  34. package/dist/cjs/EmbeddedWalletOnAccountCreateScreen-B0tXEtG9.js +1 -0
  35. package/dist/cjs/EmbeddedWalletPasswordUpdateScreen-ZfgU86hx.js +1 -0
  36. package/dist/cjs/EmbeddedWalletPasswordUpdateSplashScreen-tP8rSVUL.js +1 -0
  37. package/dist/cjs/EnrollTotp-DZ5fIrXr.js +1 -0
  38. package/dist/cjs/ErrorBanner-CMjaobRI.js +1 -0
  39. package/dist/cjs/ErrorMessage-f0cRWc29.js +1 -0
  40. package/dist/cjs/ErrorScreen-Cob9AO30.js +1 -0
  41. package/dist/cjs/FarcasterConnectStatusScreen-C5FoWA6N.js +2 -0
  42. package/dist/cjs/FarcasterSignerStatusScreen-CDYkqsxz.js +2 -0
  43. package/dist/cjs/FundSolWalletWithExternalSolanaWallet-DC_xoE6W.js +2 -0
  44. package/dist/cjs/FundWalletMethodHeader-zYWhBIiS.js +1 -0
  45. package/dist/cjs/FundingEditAmountScreen-BB7-k00c.js +1 -0
  46. package/dist/cjs/FundingMethodSelectionScreen-BrV94GD2.js +1 -0
  47. package/dist/cjs/InAppBrowserLoginNotPossible-y8g07-kU.js +1 -0
  48. package/dist/cjs/InfoBanner-CTx1eRnV.js +1 -0
  49. package/dist/cjs/InjectedWalletIcon-UY3nMvZo.js +1 -0
  50. package/dist/cjs/InstallWalletScreen-CmGi6mS1.js +1 -0
  51. package/dist/cjs/JsonTree-xaeo0q6z.js +1 -0
  52. package/dist/cjs/LabelXs-CYMv6rOZ.js +1 -0
  53. package/dist/cjs/LandingScreen-B9jb8n_d.js +1 -0
  54. package/dist/cjs/Layouts-dRL0OSpp.js +1 -0
  55. package/dist/cjs/Link-DmzPZ_M7.js +1 -0
  56. package/dist/cjs/LinkConflictScreen-BJXyOu2J.js +1 -0
  57. package/dist/cjs/LinkEmailScreen-zyJFrvy-.js +1 -0
  58. package/dist/cjs/LinkPasskeyScreen-Bw7Xs741.js +1 -0
  59. package/dist/cjs/LinkPhoneScreen-C4JQblY3.js +1 -0
  60. package/dist/cjs/LoadingSkeleton-DoCrfGnl.js +1 -0
  61. package/dist/cjs/LoginFailedScreen-CGT-2B2h.js +1 -0
  62. package/dist/cjs/ManualTransferScreen-DPz98CSt.js +1 -0
  63. package/dist/cjs/MfaAuthEnrollmentFlowScreen-BBKMKDGR.js +1 -0
  64. package/dist/cjs/MfaAuthVerifyFlowScreen-3LKUo_xV.js +1 -0
  65. package/dist/cjs/MfaEnrollmentFlowScreen-B2YgNRCC.js +1 -0
  66. package/dist/cjs/MfaVerifyFlowScreen-BhVqkM2f.js +1 -0
  67. package/dist/cjs/ModalHeader-DbV81e3m.js +3 -0
  68. package/dist/cjs/MoonpayStatusScreen-yghPhz7v.js +1 -0
  69. package/dist/cjs/NetworkIcon-BZ9Mj6vV.js +1 -0
  70. package/dist/cjs/OAuthStatusScreen-q9MFItPT.js +1 -0
  71. package/dist/cjs/OpenLink-BpCUf9iR.js +1 -0
  72. package/dist/cjs/PasskeySelectSignupOrLogin-BKBH0QxK.js +1 -0
  73. package/dist/cjs/PasskeyStatusScreen-DVx4lzwq.js +1 -0
  74. package/dist/cjs/PasswordRecoveryScreen-BmGdXVfh.js +1 -0
  75. package/dist/cjs/PinInput-DSI6rjOn.js +1 -0
  76. package/dist/cjs/QrCode-Ua_0cVUP.js +2 -0
  77. package/dist/cjs/RecoveryOAuthStatusScreen-DUobwBXF.js +1 -0
  78. package/dist/cjs/RecoveryPasswordCreateScreen-vQG4ErlF.js +1 -0
  79. package/dist/cjs/RecoverySelectionScreen-E2l_NO8y.js +1 -0
  80. package/dist/cjs/Row-CxDF-VMy.js +1 -0
  81. package/dist/cjs/Screen-65eQbiHD.js +9 -0
  82. package/dist/cjs/ScreenHeader-CyURV6Ti.js +2 -0
  83. package/dist/cjs/ScreenLayout-B_60rKhZ.js +1 -0
  84. package/dist/cjs/SetAutomaticRecoveryScreen-DQolobOz.js +1 -0
  85. package/dist/cjs/SetWalletPasswordForm-8g-lawop.js +2 -0
  86. package/dist/cjs/SignRequestScreen-BAgmmVVW.js +1 -0
  87. package/dist/cjs/StackedContainer-ByB6Mdu0.js +1 -0
  88. package/dist/cjs/StandardSignAndSendTransactionScreen-BUB57iWU.js +1 -0
  89. package/dist/cjs/Subtitle-Dtmrw8l5.js +1 -0
  90. package/dist/cjs/TelegramAuthScreen-D5uhx6WN.js +1 -0
  91. package/dist/cjs/Title-C-tHJvrb.js +1 -0
  92. package/dist/cjs/TodoList-Cm_a93ef.js +2 -0
  93. package/dist/cjs/TransactionDetails-BefABtVQ.js +3 -0
  94. package/dist/cjs/TransactionErrorView-QKWh4urc.js +2 -0
  95. package/dist/cjs/TransferFromWalletScreen-C_0IpL-A.js +1 -0
  96. package/dist/cjs/TransferOrBridgeLoadingScreen-C6t1_cTP.js +1 -0
  97. package/dist/cjs/UpdateEmailScreen-BUAgWudx.js +1 -0
  98. package/dist/cjs/UpdatePhoneScreen-DefnuTEZ.js +1 -0
  99. package/dist/cjs/UserLimitReachedScreen-B76r_-LC.js +1 -0
  100. package/dist/cjs/Value-C-XtZyFa.js +1 -0
  101. package/dist/cjs/WalletButtonList-bICzXZXM.js +1 -0
  102. package/dist/cjs/WalletCards-BfpeHH5n.js +1 -0
  103. package/dist/cjs/WalletInfoCard-CscdnrUV.js +1 -0
  104. package/dist/cjs/WalletInterstitialScreen-CG1k3EvV.js +1 -0
  105. package/dist/cjs/WalletLink-DF6dDjkz.js +3 -0
  106. package/dist/cjs/WarningBanner-B_Gs_15p.js +1 -0
  107. package/dist/cjs/abstract-smart-wallets.js +1 -1
  108. package/dist/cjs/analytics-C6C_4JmG.js +1 -0
  109. package/dist/cjs/capitalizeFirstLetter-D-K8mqBm.js +1 -0
  110. package/dist/cjs/context-JUEgi5-6.js +1 -0
  111. package/dist/cjs/copy-BiZ7dtqy.js +1 -0
  112. package/dist/cjs/ethers-uj8IknV_.js +1 -0
  113. package/dist/cjs/events-context-Di6--rDg.js +1 -0
  114. package/dist/cjs/extended-chains.js +1 -1
  115. package/dist/cjs/farcaster-CWHXGAib.js +1 -0
  116. package/dist/cjs/farcaster.js +1 -1
  117. package/dist/cjs/formatErc20TokenAmount-DxwoWe7e.js +1 -0
  118. package/dist/cjs/frame-bPqBJ8fS.js +1 -0
  119. package/dist/cjs/get-is-unified-wallet-DmiciSes.js +1 -0
  120. package/dist/cjs/getChainName-C4rO8-3n.js +1 -0
  121. package/dist/cjs/getErc20Balance-BZ5-OGfD.js +1 -0
  122. package/dist/cjs/getErc20TokenInfo-HX7DgcWx.js +1 -0
  123. package/dist/cjs/getFormattedUsdFromLamports-Mu2fqwL2.js +1 -0
  124. package/dist/cjs/getPublicClient-EjAv8R2z.js +1 -0
  125. package/dist/cjs/getUsdcMintAddress-REYZSOb9.js +1 -0
  126. package/dist/cjs/index-BNNk54gK.js +1 -0
  127. package/dist/cjs/index-CRFXS9pP.js +1 -0
  128. package/dist/cjs/index-Cuv6j_Y0.js +1 -0
  129. package/dist/cjs/index-DvDeCr_m.js +5 -0
  130. package/dist/cjs/index.js +1 -6
  131. package/dist/cjs/internal-context-VDPFkIXN.js +1 -0
  132. package/dist/cjs/internal.js +1 -1
  133. package/dist/cjs/paths-DizMb-lU.js +1 -0
  134. package/dist/cjs/prepareFundingModalData-BVlyr8l5.js +1 -0
  135. package/dist/cjs/reservoir-3I-Vkf2B.js +1 -0
  136. package/dist/cjs/shared-BPGwTh8c.js +1 -0
  137. package/dist/cjs/shared-CT5ocsPG.js +1 -0
  138. package/dist/cjs/shouldProceedtoEmbeddedWalletCreationFlow-DcjqezwI.js +1 -0
  139. package/dist/cjs/smart-wallets-B7vHjGAW.js +1 -0
  140. package/dist/cjs/smart-wallets.js +1 -1
  141. package/dist/cjs/solana.js +1 -1
  142. package/dist/cjs/styles-Ca_DS00a.js +1 -0
  143. package/dist/cjs/styles-D4VeJNv1.js +1 -0
  144. package/dist/cjs/telegram-D3O0_F1a.js +1 -0
  145. package/dist/cjs/to-ui-error-a-xwbRKZ.js +1 -0
  146. package/dist/cjs/transaction-DjF5X-by.js +1 -0
  147. package/dist/cjs/transfer-Cit146vy.js +1 -0
  148. package/dist/cjs/twitch-BNvhZb2Y.js +1 -0
  149. package/dist/cjs/twitter-BVVRWkcG.js +1 -0
  150. package/dist/cjs/ui.js +2 -2
  151. package/dist/cjs/use-create-wallet-without-fallback-DSOJS4h0.js +1 -0
  152. package/dist/cjs/use-export-wallet-BRFTskbr.js +1 -0
  153. package/dist/cjs/{use-sign-with-user-signer-BtJVKMQr.js → use-sign-with-user-signer-On9f1Fag.js} +1 -1
  154. package/dist/cjs/useActiveWallet-DcxqWAsq.js +1 -0
  155. package/dist/cjs/useGetSolPrice-eOpcFeNE.js +1 -0
  156. package/dist/cjs/useGetTokenPrice-EcT0H5rf.js +1 -0
  157. package/dist/cjs/useI18n-hYSvbQCq.js +1 -0
  158. package/dist/cjs/usePrivy-CXPeoT5g.js +1 -0
  159. package/dist/cjs/useSolanaRpcClient-mfV88iJm.js +1 -0
  160. package/dist/cjs/useWalletBalance-CQAgfkRc.js +1 -0
  161. package/dist/cjs/useWallets-TxPVNWGS.js +1 -0
  162. package/dist/cjs/useWallets-h2xCj02C.js +1 -0
  163. package/dist/dts/{events-context-CCElA92Y.d.mts → events-context-CkFXl3uc.d.mts} +1 -1
  164. package/dist/dts/{events-context-CCElA92Y.d.ts → events-context-CkFXl3uc.d.ts} +1 -1
  165. package/dist/dts/extended-chains.d.mts +1 -1
  166. package/dist/dts/extended-chains.d.ts +1 -1
  167. package/dist/dts/farcaster.d.mts +1 -1
  168. package/dist/dts/farcaster.d.ts +1 -1
  169. package/dist/dts/index.d.mts +11 -9
  170. package/dist/dts/index.d.ts +11 -9
  171. package/dist/dts/internal.d.mts +1 -1
  172. package/dist/dts/internal.d.ts +1 -1
  173. package/dist/dts/smart-wallets.d.mts +1 -1
  174. package/dist/dts/smart-wallets.d.ts +1 -1
  175. package/dist/dts/solana.d.mts +3 -3
  176. package/dist/dts/solana.d.ts +3 -3
  177. package/dist/dts/ui.d.mts +1 -1
  178. package/dist/dts/ui.d.ts +1 -1
  179. package/dist/esm/AccountNotFoundScreen-CmhSsknC.mjs +1 -0
  180. package/dist/esm/Address-DtXA0OPS.mjs +1 -0
  181. package/dist/esm/AffirmativeConsentScreen-C6AcYU94.mjs +1 -0
  182. package/dist/esm/AllowlistRejectionScreen-BuH5iBJ3.mjs +1 -0
  183. package/dist/esm/AuthenticateWithWalletScreen-CKJqrLEm.mjs +1 -0
  184. package/dist/esm/AwaitingEvmToSolBridgingScreen-DuO5iRV2.mjs +2 -0
  185. package/dist/esm/AwaitingExternalEthereumTransferScreen-C50_Dj-N.mjs +2 -0
  186. package/dist/esm/AwaitingPasswordlessCodeScreen-Bb0UxW46.mjs +1 -0
  187. package/dist/esm/AwaitingSolToEvmBridgingScreen-YsM6M4T9.mjs +2 -0
  188. package/dist/esm/BridgeNetworkSelectionView-Bu0vi9_a.mjs +1 -0
  189. package/dist/esm/Button-DJ-mtuuD.mjs +2 -0
  190. package/dist/esm/CaptchaScreen-CWQAXaCK.mjs +1 -0
  191. package/dist/esm/Checkbox-NmGCZeKL.mjs +1 -0
  192. package/dist/esm/Chip-Bsgj4Yc-.mjs +1 -0
  193. package/dist/esm/CoinbaseOnrampStatusScreen-NdySyA5D.mjs +1 -0
  194. package/dist/esm/Column-DQ5Vw9t1.mjs +1 -0
  195. package/dist/esm/ConnectEmailForm-DUgOCS2V.mjs +1 -0
  196. package/dist/esm/ConnectLedgerScreen-3wp1wuP2.mjs +1 -0
  197. package/dist/esm/ConnectOnlyLandingScreen-BVkcUaO6.mjs +1 -0
  198. package/dist/esm/ConnectOnlyStatusScreen-CyT_IEgy.mjs +1 -0
  199. package/dist/esm/ConnectOrCreateScreen-BlIxCxVJ.mjs +1 -0
  200. package/dist/esm/ConnectPhoneForm-CbuSfwAI.mjs +1 -0
  201. package/dist/esm/ConnectWalletView-DVDOSzi0.mjs +1 -0
  202. package/dist/esm/ConnectionStatusScreen-DNdZyKcL.mjs +1 -0
  203. package/dist/esm/CopyToClipboard-DatKc59_.mjs +1 -0
  204. package/dist/esm/CrossAppAuthScreen-DEF_slEx.mjs +1 -0
  205. package/dist/esm/CustomLandingScreenView-DWt9lv8W.mjs +2 -0
  206. package/dist/esm/DelegatedActionsConsentScreen-DqeBCJkz.mjs +1 -0
  207. package/dist/esm/DelegatedActionsRevokeScreen-B-xLCB1j.mjs +1 -0
  208. package/dist/esm/EmailInputForm-B4hjCxRU.mjs +1 -0
  209. package/dist/esm/EmbeddedWalletConnectingScreen-BCg7qeI6.mjs +1 -0
  210. package/dist/esm/EmbeddedWalletCreatedScreen-jGepSDyo.mjs +1 -0
  211. package/dist/esm/EmbeddedWalletKeyExportScreen-DX22sVNh.mjs +2 -0
  212. package/dist/esm/EmbeddedWalletOnAccountCreateScreen-hkifQ988.mjs +1 -0
  213. package/dist/esm/EmbeddedWalletPasswordUpdateScreen-CezgHp88.mjs +1 -0
  214. package/dist/esm/EmbeddedWalletPasswordUpdateSplashScreen-BFamfPb_.mjs +1 -0
  215. package/dist/esm/EnrollTotp-BzAm1Ya4.mjs +1 -0
  216. package/dist/esm/ErrorBanner-BdiArMwu.mjs +1 -0
  217. package/dist/esm/ErrorMessage-Cx8GKGhL.mjs +1 -0
  218. package/dist/esm/ErrorScreen-DFAo4S7A.mjs +1 -0
  219. package/dist/esm/FarcasterConnectStatusScreen-Ys1uAk-s.mjs +1 -0
  220. package/dist/esm/FarcasterSignerStatusScreen-DIfmv7Ft.mjs +1 -0
  221. package/dist/esm/FundSolWalletWithExternalSolanaWallet-CkEgl8wO.mjs +1 -0
  222. package/dist/esm/FundWalletMethodHeader-CbTaIDLQ.mjs +1 -0
  223. package/dist/esm/FundingEditAmountScreen-Cz4tmsMX.mjs +1 -0
  224. package/dist/esm/FundingMethodSelectionScreen-fBauGI0K.mjs +1 -0
  225. package/dist/esm/InAppBrowserLoginNotPossible-DBhsoAkw.mjs +1 -0
  226. package/dist/esm/InfoBanner-D6C6Bt8L.mjs +1 -0
  227. package/dist/esm/InjectedWalletIcon-DLcYOGDj.mjs +1 -0
  228. package/dist/esm/InstallWalletScreen-CEcl2LHj.mjs +1 -0
  229. package/dist/esm/JsonTree-Bvd2C29R.mjs +1 -0
  230. package/dist/esm/LabelXs-BOisBtqT.mjs +1 -0
  231. package/dist/esm/LandingScreen-BvRIrtFN.mjs +1 -0
  232. package/dist/esm/Layouts-Bmf8DxNP.mjs +1 -0
  233. package/dist/esm/Link-DwjLfHwW.mjs +1 -0
  234. package/dist/esm/LinkConflictScreen-Bg9QTrJX.mjs +1 -0
  235. package/dist/esm/LinkEmailScreen-SlCMvM43.mjs +1 -0
  236. package/dist/esm/LinkPasskeyScreen-CNFL2N09.mjs +1 -0
  237. package/dist/esm/LinkPhoneScreen-DnPAvact.mjs +1 -0
  238. package/dist/esm/LoadingSkeleton-CHdaq3pb.mjs +1 -0
  239. package/dist/esm/LoginFailedScreen-CkxfR75o.mjs +1 -0
  240. package/dist/esm/ManualTransferScreen-px_MUbVh.mjs +1 -0
  241. package/dist/esm/MfaAuthEnrollmentFlowScreen-RbHifi_a.mjs +1 -0
  242. package/dist/esm/MfaAuthVerifyFlowScreen-B3SIiFnH.mjs +1 -0
  243. package/dist/esm/MfaEnrollmentFlowScreen-LgmZFVEZ.mjs +1 -0
  244. package/dist/esm/MfaVerifyFlowScreen-DZkVptvz.mjs +1 -0
  245. package/dist/esm/ModalHeader-D7WajfD8.mjs +3 -0
  246. package/dist/esm/MoonpayStatusScreen-CBc4DLDR.mjs +1 -0
  247. package/dist/esm/NetworkIcon-B48ilzF8.mjs +1 -0
  248. package/dist/esm/OAuthStatusScreen-DvD84FHd.mjs +1 -0
  249. package/dist/esm/OpenLink-BpeNYBKs.mjs +1 -0
  250. package/dist/esm/PasskeySelectSignupOrLogin-DZP4Hj5r.mjs +1 -0
  251. package/dist/esm/PasskeyStatusScreen-bP3yfXNt.mjs +1 -0
  252. package/dist/esm/PasswordRecoveryScreen-Bt_Cf8-l.mjs +1 -0
  253. package/dist/esm/PinInput-C3_MNxMt.mjs +1 -0
  254. package/dist/esm/QrCode-zzqjquVm.mjs +2 -0
  255. package/dist/esm/RecoveryOAuthStatusScreen-y6_gmb9s.mjs +1 -0
  256. package/dist/esm/RecoveryPasswordCreateScreen-CloUjFKm.mjs +1 -0
  257. package/dist/esm/RecoverySelectionScreen-FxCwz-PR.mjs +1 -0
  258. package/dist/esm/Row-CG0lSY5Z.mjs +1 -0
  259. package/dist/esm/Screen-dwi2CitY.mjs +8 -0
  260. package/dist/esm/ScreenHeader-Biz1wq02.mjs +2 -0
  261. package/dist/esm/ScreenLayout-Dmrhdwtt.mjs +1 -0
  262. package/dist/esm/SetAutomaticRecoveryScreen-Db5Xg_sQ.mjs +1 -0
  263. package/dist/esm/SetWalletPasswordForm-ZtRqoZYj.mjs +2 -0
  264. package/dist/esm/SignRequestScreen-DdAK4SlJ.mjs +1 -0
  265. package/dist/esm/StackedContainer-BrIQsdas.mjs +1 -0
  266. package/dist/esm/StandardSignAndSendTransactionScreen-C0IrbkCx.mjs +1 -0
  267. package/dist/esm/Subtitle-DkvfP2Ev.mjs +1 -0
  268. package/dist/esm/TelegramAuthScreen-vp2lrJFZ.mjs +1 -0
  269. package/dist/esm/Title-D0pfZff-.mjs +1 -0
  270. package/dist/esm/TodoList-Dn0Qu-vv.mjs +2 -0
  271. package/dist/esm/TransactionDetails-fgHkAnf9.mjs +3 -0
  272. package/dist/esm/TransactionErrorView-Dgp1KSy5.mjs +2 -0
  273. package/dist/esm/TransferFromWalletScreen-CTAGaF9C.mjs +1 -0
  274. package/dist/esm/TransferOrBridgeLoadingScreen-D3vBwM_o.mjs +1 -0
  275. package/dist/esm/UpdateEmailScreen-BBtChP9Q.mjs +1 -0
  276. package/dist/esm/UpdatePhoneScreen-Byn7UW7u.mjs +1 -0
  277. package/dist/esm/UserLimitReachedScreen-DXDqdBpt.mjs +1 -0
  278. package/dist/esm/Value-B4M62ove.mjs +1 -0
  279. package/dist/esm/WalletButtonList-CGloXTN0.mjs +1 -0
  280. package/dist/esm/WalletCards-DH1rqayz.mjs +1 -0
  281. package/dist/esm/WalletInfoCard-DAv0WFcc.mjs +1 -0
  282. package/dist/esm/WalletInterstitialScreen-CKiSWjpa.mjs +1 -0
  283. package/dist/esm/WalletLink-CjuEskpb.mjs +3 -0
  284. package/dist/esm/WarningBanner-BDp-QC9i.mjs +1 -0
  285. package/dist/esm/abstract-smart-wallets.mjs +1 -1
  286. package/dist/esm/analytics-mkkvFRju.mjs +1 -0
  287. package/dist/esm/capitalizeFirstLetter-DmLYqXsO.mjs +1 -0
  288. package/dist/esm/{events-context-ClaboIDc.mjs → context-Cb5MFcME.mjs} +1 -1
  289. package/dist/esm/copy-Bx2Jwc5_.mjs +1 -0
  290. package/dist/esm/ethers-CpMSCMOg.mjs +1 -0
  291. package/dist/esm/events-context-CI0iqAXA.mjs +1 -0
  292. package/dist/esm/extended-chains.mjs +1 -1
  293. package/dist/esm/farcaster-DPlSjvF5.mjs +1 -0
  294. package/dist/esm/farcaster.mjs +1 -1
  295. package/dist/esm/formatErc20TokenAmount-BuPk9xcy.mjs +1 -0
  296. package/dist/esm/frame-BMa3kyjk.mjs +1 -0
  297. package/dist/esm/get-is-unified-wallet-DymQMSJy.mjs +1 -0
  298. package/dist/esm/getChainName-DjpPdUSc.mjs +1 -0
  299. package/dist/esm/getErc20Balance-Dtau1386.mjs +1 -0
  300. package/dist/esm/getErc20TokenInfo-CKA_MDcy.mjs +1 -0
  301. package/dist/esm/getFormattedUsdFromLamports-B6EqSEho.mjs +1 -0
  302. package/dist/esm/getPublicClient-IxRndou_.mjs +1 -0
  303. package/dist/esm/getUsdcMintAddress-DFI1hv05.mjs +1 -0
  304. package/dist/esm/index-B_e8abKi.mjs +1 -0
  305. package/dist/esm/index-CI666IP9.mjs +5 -0
  306. package/dist/esm/index-CJMgUOnw.mjs +1 -0
  307. package/dist/esm/index-DdlRJsoj.mjs +1 -0
  308. package/dist/esm/index.mjs +1 -5
  309. package/dist/esm/internal-context-Cvo1WmWN.mjs +1 -0
  310. package/dist/esm/internal.mjs +1 -1
  311. package/dist/esm/paths-3HW55qZg.mjs +1 -0
  312. package/dist/esm/prepareFundingModalData-BUyu5Vhr.mjs +1 -0
  313. package/dist/esm/reservoir-B0V48m2I.mjs +1 -0
  314. package/dist/esm/shared-CtYf3O54.mjs +1 -0
  315. package/dist/esm/shared-DsP7M4P5.mjs +1 -0
  316. package/dist/esm/shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs +1 -0
  317. package/dist/esm/smart-wallets-Cbhn7qlU.mjs +1 -0
  318. package/dist/esm/smart-wallets.mjs +1 -1
  319. package/dist/esm/solana.mjs +1 -1
  320. package/dist/esm/styles-BxA7nKxI.mjs +1 -0
  321. package/dist/esm/styles-DY17fuAX.mjs +1 -0
  322. package/dist/esm/telegram-B-JqnkqZ.mjs +1 -0
  323. package/dist/esm/to-ui-error-B3m2hl6e.mjs +1 -0
  324. package/dist/esm/transaction-CnfuREWo.mjs +1 -0
  325. package/dist/esm/transfer-CMPmjPsM.mjs +1 -0
  326. package/dist/esm/twitch-5IOe4sIQ.mjs +1 -0
  327. package/dist/esm/twitter-6jomarO4.mjs +1 -0
  328. package/dist/esm/ui.mjs +2 -2
  329. package/dist/esm/use-create-wallet-without-fallback-DodUf3VP.mjs +1 -0
  330. package/dist/esm/use-export-wallet-CWslDKqf.mjs +1 -0
  331. package/dist/esm/use-sign-with-user-signer-LJ6ROduD.mjs +1 -0
  332. package/dist/esm/useActiveWallet-hrZcON-K.mjs +1 -0
  333. package/dist/esm/useGetSolPrice-Bi0pPiUW.mjs +1 -0
  334. package/dist/esm/useGetTokenPrice-B4XVfxeD.mjs +1 -0
  335. package/dist/esm/useI18n-ByKvnaXP.mjs +1 -0
  336. package/dist/esm/usePrivy-D3OPY7tm.mjs +1 -0
  337. package/dist/esm/useSolanaRpcClient-DjD2ma5c.mjs +1 -0
  338. package/dist/esm/useWalletBalance-Xca4-c_r.mjs +1 -0
  339. package/dist/esm/useWallets-BplPx0Pz.mjs +1 -0
  340. package/dist/esm/useWallets-CQMJYOF9.mjs +1 -0
  341. package/package.json +15 -9
  342. package/dist/cjs/EmbeddedWalletConnectingScreen-JRafXI8d.js +0 -27
  343. package/dist/cjs/SignRequestScreen-Dy02euV9.js +0 -1
  344. package/dist/cjs/events-context-7-Gs8c_9.js +0 -1
  345. package/dist/cjs/frame-B2orQ_lK.js +0 -1
  346. package/dist/cjs/internal-context-CeWKmK5u.js +0 -1
  347. package/dist/cjs/smart-wallets-DaqaXBrW.js +0 -1
  348. package/dist/cjs/use-export-wallet-Cz8MVlvJ.js +0 -2
  349. package/dist/cjs/useActiveWallet-C5D3a-je.js +0 -1
  350. package/dist/cjs/usePrivy-BdYU4BZI.js +0 -1
  351. package/dist/esm/EmbeddedWalletConnectingScreen-D50stmJi.mjs +0 -25
  352. package/dist/esm/SignRequestScreen-D9o7VhNz.mjs +0 -1
  353. package/dist/esm/frame-Dj70FEYB.mjs +0 -1
  354. package/dist/esm/internal-context-eGSwROSk.mjs +0 -1
  355. package/dist/esm/smart-wallets-BXT3GZwg.mjs +0 -1
  356. package/dist/esm/use-export-wallet-DTiEdSYz.mjs +0 -1
  357. package/dist/esm/use-sign-with-user-signer-DaTvrd5T.mjs +0 -1
  358. package/dist/esm/useActiveWallet-B8DSbnuu.mjs +0 -1
  359. package/dist/esm/usePrivy-BCcRF869.mjs +0 -1
  360. package/dist/dts/{types-B6UNnZ2P.d.mts → types-BkkvIRg5.d.mts} +134 -134
  361. package/dist/dts/{types-B6UNnZ2P.d.ts → types-BkkvIRg5.d.ts} +134 -134
@@ -0,0 +1 @@
1
+ import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/ExclamationTriangleIcon";import i from"@heroicons/react/24/outline/LockClosedIcon";import{useState as n}from"react";import{u as l,a,h as s}from"./get-is-unified-wallet-DymQMSJy.mjs";import{a as c}from"./Button-DJ-mtuuD.mjs";import{M as m,B as d}from"./ModalHeader-D7WajfD8.mjs";import{styled as p}from"styled-components";import{S as u}from"./Subtitle-DkvfP2Ev.mjs";import{T as y}from"./Title-D0pfZff-.mjs";import{q as f}from"./context-Cb5MFcME.mjs";import{u as h}from"./internal-context-Cvo1WmWN.mjs";import{Y as g}from"./useActiveWallet-hrZcON-K.mjs";import"viem";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";const v=/*#__PURE__*/p.div.withConfig({displayName:"WithCircleBorder",componentId:"sc-e4fc5563-0"})(["&&{border-width:4px;}display:flex;justify-content:center;align-items:center;padding:1rem;aspect-ratio:1;border-style:solid;border-color:",";border-radius:50%;"],(e=>e.$color??"var(--privy-color-accent)")),w={component:()=>{let{user:p}=l(),{client:w,walletProxy:j,refreshSessionAndUser:I,closePrivyModal:b}=h(),x=a(),{entropyId:C,entropyIdVerifier:k}=x.data?.recoverWallet,[T,M]=n(!1),[S,W]=n(null),[A,P]=n(null);function U(){if(!T){if(A)return x.data?.setWalletPassword?.onFailure(A),void b();if(!S)return x.data?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),void b()}}x.onUserCloseViaDialogOrKeybindRef.current=U;let E=!(!T&&!S);/*#__PURE__*/return e(r,A?{children:[/*#__PURE__*/o(m,{onClose:U},"header"),/*#__PURE__*/o(v,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:/*#__PURE__*/o(t,{height:38,width:38,stroke:"var(--privy-color-error)"})}),/*#__PURE__*/o(y,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),/*#__PURE__*/o(g,{style:{minHeight:"2rem"}}),/*#__PURE__*/o(c,{onClick:()=>P(null),children:"Try again"}),/*#__PURE__*/o(d,{})]}:{children:[/*#__PURE__*/o(m,{onClose:U},"header"),/*#__PURE__*/o(i,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),/*#__PURE__*/o(y,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),/*#__PURE__*/o(u,{style:{marginTop:"1rem"},children:"When you log into a new device, you’ll only need to authenticate to access your account. Never get logged out if you forget your password."}),/*#__PURE__*/o(g,{style:{minHeight:"2rem"}}),/*#__PURE__*/o(c,{loading:T,disabled:E,onClick:()=>async function(){M(!0);try{let e=await w.getAccessToken(),r=s(p,C);if(!e||!j||!r)return;if(!(await j.setRecovery({accessToken:e,entropyId:C,entropyIdVerifier:k,existingRecoveryMethod:r.recoveryMethod,recoveryMethod:"privy"})).entropyId)throw Error("Unable to set recovery on wallet");let o=await I();if(!o)throw Error("Unable to set recovery on wallet");let t=s(o,r.address);if(!t)throw Error("Unabled to set recovery on wallet");W(!!o),setTimeout((()=>{x.data?.setWalletPassword?.onSuccess(t),b()}),f)}catch(e){P(e)}finally{M(!1)}}(),children:S?"Success":"Confirm"}),/*#__PURE__*/o(d,{})]})}};export{w as SetAutomaticRecoveryScreen,w as default};
@@ -0,0 +1,2 @@
1
+ import{jsxs as e,Fragment as r,jsx as o}from"react/jsx-runtime";import{useState as n,useEffect as i,useMemo as t,useCallback as a,useReducer as l}from"react";import{q as c}from"./context-Cb5MFcME.mjs";import{a as s}from"./get-is-unified-wallet-DymQMSJy.mjs";import d from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{b as h,R as p,c as u}from"./Layouts-Bmf8DxNP.mjs";import{M as m,B as g}from"./ModalHeader-D7WajfD8.mjs";import{E as y,b as v,P as f,a as w,I as b,H as k,S as C,c as S,N as x,D as B,d as $,R as I,e as R,f as P,g as j}from"./shared-DsP7M4P5.mjs";import{styled as A}from"styled-components";import{S as L,P as E}from"./Button-DJ-mtuuD.mjs";import{C as D}from"./Checkbox-NmGCZeKL.mjs";import z from"@heroicons/react/24/outline/KeyIcon";import H from"@heroicons/react/24/solid/CheckCircleIcon";import T from"fast-password-entropy";import*as U from"secure-password-utilities";import{DEFAULT_WORDLIST as F}from"secure-password-utilities/wordlists";import M from"@heroicons/react/24/outline/ArrowDownTrayIcon";import N from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import K from"@heroicons/react/24/outline/DocumentDuplicateIcon";import O from"@heroicons/react/24/solid/XCircleIcon";import{C as W}from"./ScreenHeader-Biz1wq02.mjs";const Y=({buttonHideAnimations:t,buttonLoading:a,password:l,onSubmit:c,onBack:s})=>{let[u,B]=n(!0),[$,I]=n(!1),[R,P]=n(""),j=l===R;return i((()=>{R&&!$&&I(!0)}),[R]),/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(m,{closeable:!1,backFn:s}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(y,{children:[/*#__PURE__*/e(v,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/o(w,{value:R,onChange:e=>P(e.target.value),onKeyUp:e=>{"Enter"===e.key&&c()},onBlur:()=>I(!0),placeholder:"confirm your password",type:u?"password":"text",style:{paddingRight:"2.3rem"}}),/*#__PURE__*/o(b,{style:{right:"0.75rem"},children:u?/*#__PURE__*/o(k,{onClick:()=>B(!1)}):/*#__PURE__*/o(C,{onClick:()=>B(!0)})})]}),
2
+ /*#__PURE__*/o(S,{"aria-hidden":!$||j,error:!0,children:"Passwords do not match"})]}),/*#__PURE__*/o(x,{onClick:c,loading:a,disabled:!j,$hideAnimations:t,children:"Continue"}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})},Z=({buttonHideAnimations:i,buttonLoading:t,onSubmit:a,onBack:l,config:c})=>{let[s,u]=n(!1);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{closeable:!1,backFn:l}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(y,{children:[/*#__PURE__*/e(v,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),/*#__PURE__*/o(B,{children:/*#__PURE__*/e($,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:e=>{e.preventDefault(),u((e=>!e))},children:[/*#__PURE__*/o(D,{color:"var(--privy-color-error)",readOnly:!0,checked:s}),/*#__PURE__*/o(r,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),/*#__PURE__*/e(_,{children:["user"===c.initiatedBy&&/*#__PURE__*/o(L,{onClick:c.onCancel,disabled:t,children:"Cancel"}),/*#__PURE__*/o(x,{onClick:a,loading:t,$hideAnimations:i,disabled:!s,children:"Set Password"})]}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})};let _=/*#__PURE__*/A.div.withConfig({displayName:"ButtonsContainer",componentId:"sc-d1659c5f-0"})(["display:flex;gap:10px;"]),q=/[a-z]/,G=/[A-Z]/,Q=/[0-9]/,X="!@#$%^&*()\\-_+.",J=`a-zA-Z0-9${X}`,V=RegExp(`[${X}]`),ee=RegExp(`[${J}]`);const re=RegExp(`^[${J}]{6,}$`),oe=()=>U.generatePassphrase(4,F);function ne(e){return e>.9?"Strong":e>.5?"Medium":"Weak"}function ie(e=""){return(.3*function(e){if(e.length<8)return 0;let r=0;return q.test(e)&&(r+=1),G.test(e)&&(r+=1),Q.test(e)&&(r+=1),V.test(e)&&(r+=1),Math.max(0,Math.min(1,r/3))}(e)+T(e)/95)/2}const te=({buttonHideAnimations:a,buttonLoading:l,password:c="",config:s,isResettingPassword:d,onSubmit:u,onClose:P,onBack:j,onPasswordChange:A,onPasswordGenerate:L})=>{let[E,D]=n(!1),[T,U]=n(!1);i((()=>{c&&!T&&U(!0)}),[c]);let F=t((()=>T?6>(c?.length||0)?"Password must be at least 6 characters":re.test(c||"")?null:`Invalid characters used ( ${((e="")=>[...new Set(e.split("").filter((e=>!ee.test(e))).map((e=>e.replace(" ","SPACE"))))])(c).join(" ")} )`:null),[c,T]),M=t((()=>F?{value:0,label:"Weak"}:function(e=""){let r=ie(e);return{value:r,label:ne(r)}}(c)),[c,F]),N=t((()=>!c?.length||!!F),[F,c]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{onClose:P,closeable:"user"===s.initiatedBy,backFn:j}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(y,{children:[/*#__PURE__*/e(v,{children:[/*#__PURE__*/o(z,{height:48,width:48,stroke:"var(--privy-color-accent)"}),/*#__PURE__*/e("h3",{style:{color:"var(--privy-color-foreground)"},children:[d?"Reset":"Set"," your password"]}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),/*#__PURE__*/e(f,{children:[/*#__PURE__*/o(w,{value:c,onChange:e=>A(e.target.value),onKeyUp:e=>{"Enter"===e.key&&u()},placeholder:"enter or generate a strong password",type:E?"password":"text",style:{paddingRight:"3.8rem"}}),/*#__PURE__*/e(b,{style:{width:"3.5rem"},children:[E?/*#__PURE__*/o(k,{onClick:()=>D(!1)}):/*#__PURE__*/o(C,{onClick:()=>D(!0)}),/*#__PURE__*/o(I,{onClick:L})]})]}),/*#__PURE__*/o(R,{value:0===M.value?.01:M.value,label:M.label}),/*#__PURE__*/o(S,{error:!!F,children:F||`Password Strength: ${T?M.label:"--"}`}),/*#__PURE__*/e(le,{children:[/*#__PURE__*/o(ae,{children:/*#__PURE__*/e(B,{children:[/*#__PURE__*/e($,{children:[/*#__PURE__*/o(H,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),/*#__PURE__*/e($,{children:[/*#__PURE__*/o(H,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),/*#__PURE__*/o(x,{onClick:u,loading:l,disabled:N,$hideAnimations:a,children:"Continue"})]})]}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})};let ae=/*#__PURE__*/A(B).withConfig({displayName:"DetailsContainer",componentId:"sc-2da5fe90-0"})(["flex:1;padding-top:1rem;"]),le=/*#__PURE__*/A.div.withConfig({displayName:"LowerContainer",componentId:"sc-2da5fe90-1"})(["display:flex;flex-direction:column;height:100%;"]);const ce=({buttonHideAnimations:i,buttonLoading:t,appName:l,password:c,onSubmit:s,onBack:u})=>{let[w,S]=n(!1),[B,$]=n(!0),I=a((()=>{S(!0),c&&navigator.clipboard.writeText(c)}),[c]),R=a((()=>{let e=document.createElement("a"),r=l.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),o=new Blob([se(l,c)],{type:"text/plain"}),n=URL.createObjectURL(o);e.href=n,e.target="_blank",e.download=`${r}-privy-wallet-recovery.txt`,document.body.appendChild(e),e.click(),setTimeout((()=>{e.remove(),URL.revokeObjectURL(n)}),5e3)}),[c]);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/o(m,{backFn:u,closeable:!1}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(y,{children:[/*#__PURE__*/e(v,{children:[/*#__PURE__*/o(d,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),/*#__PURE__*/o("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),/*#__PURE__*/o("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),/*#__PURE__*/e(f,{centered:!0,children:[/*#__PURE__*/o(P,{children:B?"•".repeat(c.length):c}),/*#__PURE__*/o(b,{style:{right:"0.75rem"},children:B?/*#__PURE__*/o(k,{onClick:()=>$(!1)}):/*#__PURE__*/o(C,{onClick:()=>$(!0)})})]}),/*#__PURE__*/e("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[/*#__PURE__*/o(j,{onClick:I,children:/*#__PURE__*/e(r,w?{children:[/*#__PURE__*/o(N,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}:{children:[/*#__PURE__*/o(K,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),/*#__PURE__*/e(j,{onClick:R,children:[/*#__PURE__*/o(M,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),/*#__PURE__*/o(x,{onClick:s,loading:t,$hideAnimations:i,children:"Continue"}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]})};let se=(e,r)=>`Your wallet recovery password for ${e} is\n\n${r}\n\nYou will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`;const de=({error:n,onClose:i})=>/*#__PURE__*/e(r,{children:[/*#__PURE__*/o(m,{closeable:!1}),/*#__PURE__*/o(h,{}),/*#__PURE__*/e(u,n?{children:[/*#__PURE__*/o(O,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),/*#__PURE__*/o(W,{title:"Something went wrong",description:n})]}:{children:[/*#__PURE__*/o(H,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),/*#__PURE__*/o(W,{title:"Success"})]}),/*#__PURE__*/o(E,{onClick:i,children:"Close"}),/*#__PURE__*/o(p,{}),/*#__PURE__*/o(g,{})]});let he=(e,r)=>{switch(e){case"creating":return"back"===r?e:"saving";case"saving":return"back"===r?"creating":"confirming";case"confirming":return"back"===r?"saving":"finalizing";case"finalizing":return"back"===r?"confirming":"done";default:return e}};const pe=({onSubmit:e,...r})=>{let{lastScreen:n,navigate:t}=s(),{send:d,state:h}=(()=>{let[e,r]=l(he,"creating");return{send:r,state:e}})(),p=a((async()=>{"finalizing"===h&&await e(),d("next")}),[h,d,e]);i((()=>{let e;return"done"===h&&"automatic"===r.config.initiatedBy&&(e=setTimeout((()=>r.onClose?.()),c)),()=>{e&&clearTimeout(e)}}),[h,r.config.initiatedBy,r.onClose]);let u=a((()=>{d("back")}),[d]),m=a((()=>{t("RecoverySelectionScreen")}),[n,t]);return"creating"===h?/*#__PURE__*/o(te,{...r,onSubmit:p,onBack:"RecoverySelectionScreen"===n?m:void 0}):"saving"===h?/*#__PURE__*/o(ce,{...r,onSubmit:p,onBack:u}):"confirming"===h?/*#__PURE__*/o(Y,{...r,onSubmit:p,onBack:u}):"finalizing"===h?/*#__PURE__*/o(Z,{...r,onSubmit:p,onBack:u}):"done"===h?/*#__PURE__*/o(de,{...r,onSubmit:p}):null};export{pe as S,oe as g};
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as t,Fragment as o}from"react/jsx-runtime";import{base64 as i}from"@scure/base";import{Edit as r}from"lucide-react";import{useState as n,useEffect as a}from"react";import{styled as s}from"styled-components";import{isHex as l,hexToString as c}from"viem";import{ProviderErrors as m}from"@privy-io/js-sdk-core";import{C as p}from"./CopyToClipboard-DatKc59_.mjs";import{a as d}from"./Layouts-Bmf8DxNP.mjs";import{M as u,D as g}from"./JsonTree-Bvd2C29R.mjs";import{P as y,j as h}from"./prepareFundingModalData-BUyu5Vhr.mjs";import{W as f,q as C}from"./context-Cb5MFcME.mjs";import{u as x}from"./internal-context-Cvo1WmWN.mjs";import{u as w,a as j}from"./get-is-unified-wallet-DymQMSJy.mjs";import{S as b}from"./ScreenLayout-Dmrhdwtt.mjs";import"./copy-Bx2Jwc5_.mjs";import"eventemitter3";import"tinycolor2";import"ofetch";import"./Button-DJ-mtuuD.mjs";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const T=/*#__PURE__*/s.img.withConfig({displayName:"StyledLogo",componentId:"sc-68c1b1ea-0"})(["&&{height:",";width:",";border-radius:16px;margin-bottom:12px;}"],(e=>"sm"===e.size?"65px":"140px"),(e=>"sm"===e.size?"65px":"140px"));let S=e=>{if(!l(e))return e;try{let t=c(e);return t.includes("�")?e:t}catch{return e}},v=e=>{try{let t=i.decode(e),o=(new TextDecoder).decode(t);return o.includes("�")?e:o}catch{return e}},E=i=>{let{types:r,primaryType:n,...a}=i.typedData;/*#__PURE__*/return t(o,{children:[/*#__PURE__*/e(_,{data:a}),/*#__PURE__*/e(p,{text:(s=i.typedData,JSON.stringify(s,null,2)),itemName:"full payload to clipboard"})," "]});var s};const D=({method:o,messageData:i,copy:n,iconUrl:a,isLoading:s,success:l,walletProxyIsLoading:c,errorMessage:m,isCancellable:p,onSign:u,onCancel:g,onClose:y})=>/*#__PURE__*/e(b,{title:n.title,subtitle:n.description,showClose:!0,onClose:y,icon:r,iconVariant:"subtle",helpText:m?/*#__PURE__*/e(R,{children:m}):void 0,primaryCta:{label:n.buttonText,onClick:u,disabled:s||l||c,loading:s},secondaryCta:p?{label:"Not now",onClick:g,disabled:s||l||c}:void 0,watermark:!0,children:/*#__PURE__*/t(d,{children:[a?/*#__PURE__*/e(T,{style:{alignSelf:"center"},size:"sm",src:a,alt:"app image"}):null,/*#__PURE__*/t(L,{children:["personal_sign"===o&&/*#__PURE__*/e(A,{children:S(i)}),"eth_signTypedData_v4"===o&&/*#__PURE__*/e(E,{typedData:i}),"solana_signMessage"===o&&/*#__PURE__*/e(A,{children:v(i)})]})]})}),I={component:()=>{let{authenticated:t}=w(),{initializeWalletProxy:o,closePrivyModal:i}=x(),{navigate:r,data:s,onUserCloseViaDialogOrKeybindRef:l}=j(),[c,p]=n(!0),[d,u]=n(""),[g,b]=n(),[T,S]=n(null),[v,E]=n(!1);a((()=>{t||r("LandingScreen")}),[t]),a((()=>{o(f).then((e=>{p(!1),e||(u("An error has occurred, please try again."),b(new y(new h(d,m.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))}))}),[]);let{method:I,data:L,confirmAndSign:R,onSuccess:_,onFailure:A,uiOptions:M}=s.signMessage,N={title:M?.title||"Sign message",description:M?.description||"Signing this message will not cost you any fees.",buttonText:M?.buttonText||"Sign and continue"},U=e=>{e?_(e):A(g||new y(new h("The user rejected the request.",m.E4001_USER_REJECTED_REQUEST.eipCode))),i({shouldCallAuthOnSuccess:!1}),setTimeout((()=>{S(null),u(""),b(void 0)}),200)};l.current=()=>{U(T)};/*#__PURE__*/return e(D,{method:I,messageData:L,copy:N,iconUrl:M?.iconUrl&&"string"==typeof M.iconUrl?M.iconUrl:void 0,isLoading:v,success:null!==T,walletProxyIsLoading:c,errorMessage:d,isCancellable:M?.isCancellable,onSign:async()=>{E(!0),u("");try{let e=await R();S(e),E(!1),setTimeout((()=>{U(e)}),C)}catch(e){console.error(e),u("An error has occurred, please try again."),b(new y(new h(d,m.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),E(!1)}},onCancel:()=>U(null),onClose:()=>U(T)})}};let L=/*#__PURE__*/s.div.withConfig({displayName:"MessageContainer",componentId:"sc-124260c0-0"})(["flex:1;display:flex;flex-direction:column;gap:16px;"]),R=/*#__PURE__*/s.p.withConfig({displayName:"ErrorText",componentId:"sc-124260c0-1"})(["&&{margin:0;width:100%;text-align:center;color:var(--privy-color-error-dark);font-size:14px;line-height:22px;}"]),_=/*#__PURE__*/s(g).withConfig({displayName:"StyledDisplayJsonTree",componentId:"sc-124260c0-2"})(["margin-top:0;"]),A=/*#__PURE__*/s(u).withConfig({displayName:"StyledMessage",componentId:"sc-124260c0-3"})(["margin-top:0;"]);export{I as SignRequestScreen,D as SignRequestView,I as default};
@@ -0,0 +1 @@
1
+ import{styled as t}from"styled-components";let e=/*#__PURE__*/t.div.withConfig({displayName:"StackedContainer",componentId:"sc-f7e7d474-0"})(["display:flex;flex-direction:column;justify-content:center;align-items:center;width:100%;height:82px;> div{position:relative;}> div > span{position:absolute;left:-41px;top:-41px;}> div > :last-child{position:absolute;left:-19px;top:-19px;}"]);export{e};
@@ -0,0 +1 @@
1
+ import{jsxs as t,jsx as n,Fragment as e}from"react/jsx-runtime";import{useState as a,useMemo as r,useEffect as o}from"react";import{formatTokenAmount as i}from"@privy-io/js-sdk-core";import{a as s,u as c,j as l,g as d}from"./get-is-unified-wallet-DymQMSJy.mjs";import{u}from"./context-Cb5MFcME.mjs";import{u as m}from"./internal-context-Cvo1WmWN.mjs";import{u as p}from"./useGetSolPrice-Bi0pPiUW.mjs";import{ErrorScreenView as f}from"./ErrorScreen-DFAo4S7A.mjs";import g from"@heroicons/react/24/outline/CheckCircleIcon";import{styled as h}from"styled-components";import{P as y}from"./Button-DJ-mtuuD.mjs";import{R as w}from"./Layouts-Bmf8DxNP.mjs";import{M as k,B as b}from"./ModalHeader-D7WajfD8.mjs";import{C as v}from"./ScreenHeader-Biz1wq02.mjs";import{a as A,R as I}from"./Row-CG0lSY5Z.mjs";import{L as S,V as j}from"./Value-B4M62ove.mjs";import{S as C,W as T}from"./WalletLink-CjuEskpb.mjs";import{e as O}from"./StackedContainer-BrIQsdas.mjs";import{Y as x}from"./useActiveWallet-hrZcON-K.mjs";import{T as $,a as L}from"./TransactionErrorView-Dgp1KSy5.mjs";import{g as E}from"./transaction-CnfuREWo.mjs";import{pipe as _,getCompiledTransactionMessageDecoder as F,decompileTransactionMessage as P,setTransactionMessageLifetimeUsingBlockhash as B,compileTransaction as J,getTransactionEncoder as W,getBase58Decoder as D,fetchAddressesForLookupTables as M}from"@solana/kit";import{a as R,f as q,s as U,b as H,u as V}from"./useSolanaRpcClient-DjD2ma5c.mjs";import{D as z,T as N,a as Q,S as X,A as Y,R as G,J as K,g as Z}from"./getFormattedUsdFromLamports-B6EqSEho.mjs";import"viem";import"tinycolor2";import"ofetch";import"lucide-react";import"./index-CI666IP9.mjs";import"uuid";import"jose";import"eventemitter3";import"./useWallets-BplPx0Pz.mjs";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"./events-context-CI0iqAXA.mjs";import"@marsidev/react-turnstile";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"./getPublicClient-IxRndou_.mjs";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./reservoir-B0V48m2I.mjs";import"./ScreenLayout-Dmrhdwtt.mjs";import"./Screen-dwi2CitY.mjs";import"./index-CJMgUOnw.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./LoadingSkeleton-CHdaq3pb.mjs";import"./ethers-CpMSCMOg.mjs";import"@heroicons/react/24/outline";import"./ErrorMessage-Cx8GKGhL.mjs";import"./LabelXs-BOisBtqT.mjs";import"./Subtitle-DkvfP2Ev.mjs";import"./Title-D0pfZff-.mjs";import"./Address-DtXA0OPS.mjs";import"./WalletInfoCard-DAv0WFcc.mjs";import"./shared-CtYf3O54.mjs";import"./Checkbox-NmGCZeKL.mjs";import"./ErrorBanner-BdiArMwu.mjs";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"./WarningBanner-BDp-QC9i.mjs";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/ClipboardDocumentIcon";const tt=/*#__PURE__*/h.span.withConfig({displayName:"CircleBackground",componentId:"sc-c9f33cd-0"})(["&&{width:82px;height:82px;border-width:4px;border-style:solid;border-color:",";background-color:",";border-radius:50%;display:inline-block;box-sizing:border-box;}"],(t=>t.color??"var(--privy-color-accent)"),(t=>t.color??"var(--privy-color-accent)")),nt=({instruction:e,fees:a,transactionInfo:r,solPrice:o,chain:i})=>/*#__PURE__*/t(A,{children:[r?.action&&/*#__PURE__*/t(I,{children:[/*#__PURE__*/n(S,{children:"Action"}),/*#__PURE__*/n(j,{children:r.action})]}),null!=e?.total&&/*#__PURE__*/t(I,{children:[/*#__PURE__*/n(S,{children:"Total"}),/*#__PURE__*/n(j,{children:e.total})]}),!e?.total&&null!=e?.amount&&/*#__PURE__*/t(I,{children:[/*#__PURE__*/n(S,{children:"Total"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(C,{quantities:[e.amount,a],tokenPrice:o})})]}),/*#__PURE__*/t(I,{children:[/*#__PURE__*/n(S,{children:"Fees"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(C,{quantities:[a],tokenPrice:o})})]}),e?.to&&/*#__PURE__*/t(I,{children:[/*#__PURE__*/n(S,{children:"To"}),/*#__PURE__*/n(j,{children:/*#__PURE__*/n(T,{walletAddress:e.to,chainId:i,chainType:"solana"})})]})]}),et=({fees:a,onClose:r,receiptHeader:o,receiptDescription:i,transactionInfo:s,solPrice:c,signOnly:l,instruction:d,chain:u})=>/*#__PURE__*/t(e,{children:[/*#__PURE__*/n(k,{onClose:r}),/*#__PURE__*/n(O,{style:{marginBottom:"16px"},children:/*#__PURE__*/t("div",{children:[/*#__PURE__*/n(tt,{color:"var(--privy-color-success-light)"}),/*#__PURE__*/n(g,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-success)"})]})}),/*#__PURE__*/n(v,{title:o??`Transaction ${l?"signed":"complete"}!`,description:i??"You're all set."}),/*#__PURE__*/n(nt,{solPrice:c,instruction:d,fees:a,transactionInfo:s,chain:u}),/*#__PURE__*/n(x,{}),/*#__PURE__*/n(at,{loading:!1,onClick:r,children:"Close"}),/*#__PURE__*/n(w,{}),/*#__PURE__*/n(b,{})]});let at=/*#__PURE__*/h(y).withConfig({displayName:"SubmitButton",componentId:"sc-3cb7ee42-0"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]);async function rt(t,n){try{return await t}catch{return n}}function ot(t){switch(t){case"solana:mainnet":return"mainnet-beta";case"solana:devnet":return"devnet";case"solana:testnet":return"testnet"}}async function it({privyClient:t,chain:n,mint:e}){let a=z[n];if(!a[e]){let r=await t.getSplTokenMetadata({mintAddress:e,cluster:ot(n)});r&&(a[e]={address:e,symbol:r.symbol,decimals:r.decimals})}return a[e]}async function st({tx:t,solanaClient:n,privyClient:e,checkFunds:a}){let r=F().decode(R(t)),o=r.staticAccounts[0]??"",i=await q({solanaClient:n,tx:t}),s=a?await rt(U({solanaClient:n,tx:t})):void 0,c=s?.hasFunds??!0,l={},d=[],u=await async function({solanaClient:t,message:n}){if(!("addressTableLookups"in n)||!n.addressTableLookups)return[...n.staticAccounts];let e=n.addressTableLookups.map((t=>t.lookupTableAddress)),a=await M(e,t.rpc),r=e.map(((t,e)=>[...n.addressTableLookups[e]?.writableIndexes.map((n=>{let r=a[t]?.[n];if(r)return{key:r,isWritable:!0,altIdx:e}}))??[],...n.addressTableLookups[e]?.readonlyIndexes.map((n=>{let r=a[t]?.[n];if(r)return{key:r,isWritable:!1,altIdx:e}}))??[]])).flat().filter((t=>!!t)).sort(((t,n)=>t.isWritable!==n.isWritable?t.isWritable?-1:1:t.altIdx-n.altIdx)).map((({key:t})=>t));return[...n.staticAccounts,...r]}({solanaClient:n,message:r});for(let t of r.instructions){let a=r.staticAccounts[t.programAddressIndex]||"";if(a!==N&&a!==Q)if(a!==X){if(a===Y){let n=await rt(function(t,n,e){let[a,r,o,i]=t.accountIndices?.map((t=>n[t]))??[];return{type:"ata-creation",program:e,payer:a,ata:r,owner:o,mint:i}}(t,u,a));if(!n){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}if(d.push(n),n.ata&&n.owner&&n.mint){l[n.ata]={owner:n.owner,mint:n.mint};continue}}if(G.includes(a)){let r=await rt(ut(t,u,n,e,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r)}else if(K.includes(a)){let r=await rt(mt(t,u,n,e,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r)}else d.push({type:"unknown",program:a,discriminator:t.data?.[0]})}else{let n=await rt(dt(t,u));if(!n){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(n)}else{let r=await rt(lt(t,u,n,e,l,a));if(!r){d.push({type:"unknown",program:a,discriminator:t.data?.[0]});continue}d.push(r),"spl-transfer"===r.type&&(r.fromAta&&r.fromAccount&&r.token.address&&(l[r.fromAta]??={owner:r.fromAccount,mint:r.token.address}),r.toAta&&r.toAccount&&r.token.address&&(l[r.toAta]??={owner:r.toAccount,mint:r.token.address}))}}return{spender:o,fee:i,instructions:d,hasFunds:!!c}}function ct(t,n=0){try{return function(t,n=0){let e=0n;for(let a=0;a<8;a++)e|=BigInt(t[n+a])<<BigInt(8*a);return e}(t,n)}catch{}try{return t.readBigInt64LE(n)}catch{}let e=H(t);try{return((t,n=0)=>{let e=t[n],a=t[n+7];if(!e||!a)throw Error(`Buffer offset out of range: first: ${e}, last: ${a}.`);return(BigInt(t[n+4]+256*t[n+5]+65536*t[n+6]+(a<<24))<<32n)+BigInt(e+256*t[++n]+65536*t[++n]+16777216*t[++n])})(e)}catch{}try{return e.subarray(n).readBigInt64LE()}catch{}try{return e.readBigInt64LE(n)}catch{}return 0n}async function lt(t,n,e,a,r,o){let i=t.data?.[0],s=t.accountIndices?.map((t=>n[t]))??[];if(1===i){let[t,n,e]=s;return{type:"spl-init-account",program:o,account:t,mint:n,owner:e}}if(3===i){let n,i,[c,l,d]=s,u="",m=l?r[l]:void 0;if(m)n=m.owner,u=m.mint;else if(l){let t=await e.rpc.getAccountInfo(l,{commitment:"confirmed",encoding:"jsonParsed"}).send(),a=t.value?.data;n=a?.parsed?.info?.owner,u=a?.parsed?.info?.mint??"",i=a?.parsed?.info?.tokenAmount?.decimals}if(!u&&c){let t=await e.rpc.getAccountInfo(c,{commitment:"confirmed",encoding:"jsonParsed"}).send(),n=t.value?.data;u=n?.parsed?.info?.mint??""}let p=await it({privyClient:a,chain:e.chain,mint:u}),f=p?.symbol??"";return i??=p?.decimals??9,{type:"spl-transfer",program:o,fromAta:c,fromAccount:d,toAta:l,toAccount:n,value:ct(t.data,1),token:{symbol:f,decimals:i,address:u}}}if(9===i){let[t,n,e]=s;return{type:"spl-close-account",program:o,source:t,destination:n,owner:e}}if(17===i)return{type:"spl-sync-native",program:o};throw Error(`Token program instruction type ${i} not supported`)}async function dt(t,n){let e=t.data?.[0],a=t.accountIndices?.map((t=>n[t]))??[];if(0===e){let[,n]=a;return{type:"create-account",program:X,account:n?.toString(),value:ct(t.data,4),withSeed:!1}}if(2===e){let[n,e]=a;return{type:"sol-transfer",program:X,fromAccount:n,toAccount:e,token:{symbol:"SOL",decimals:9},value:ct(t.data,4),withSeed:!1}}if(3===e){let[,n]=a;return{type:"create-account",program:X,account:n,withSeed:!0,value:ct(t.data.slice(t.data.length-32-8-8))}}if(11===e){let[n,e]=a;return{type:"sol-transfer",program:X,fromAccount:n,toAccount:e,value:ct(t.data,4),token:{symbol:"SOL",decimals:9},withSeed:!0}}throw Error(`System program instruction type ${e} not supported`)}async function ut(t,n,e,a,r){let o=t.accountIndices?.map((t=>n[t]))??[],i=t.data?.[0];if(143===i){let n=o[10],i=o[11];return{type:"raydium-swap-base-input",program:r,mintIn:n,mintOut:i,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:i?await it({privyClient:a,chain:e.chain,mint:i}):void 0,amountIn:ct(t.data,8),minimumAmountOut:ct(t.data,16)}}if(55===i){let n=o[10],i=o[11];return{type:"raydium-swap-base-output",program:r,mintIn:n,mintOut:i,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:i?await it({privyClient:a,chain:e.chain,mint:i}):void 0,maxAmountIn:ct(t.data,8),amountOut:ct(t.data,16)}}throw Error(`Raydium swap program instruction type ${i} not supported`)}async function mt(t,n,e,a,r){let o=t.data?.[0],i=t.accountIndices?.map((t=>n[t]))??[];if([208,51,239,151,123,43,237,92].includes(o)){let n=i[5],o=i[6];return{type:"jupiter-swap-exact-out-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,outAmount:ct(t.data,t.data.length-1-2-8-8),quotedInAmount:ct(t.data,t.data.length-1-2-8)}}if([176,209,105,168,154,125,69,62].includes(o)){let n=i[7],o=i[8];return{type:"jupiter-swap-exact-out-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,outAmount:ct(t.data,t.data.length-1-2-8-8),quotedInAmount:ct(t.data,t.data.length-1-2-8)}}if([193,32,155,51,65,214,156,129].includes(o)){let n=i[7],o=i[8];return{type:"jupiter-swap-shared-accounts-route",program:r,mintIn:n,mintOut:o,tokenIn:n?await it({privyClient:a,chain:e.chain,mint:n}):void 0,tokenOut:o?await it({privyClient:a,chain:e.chain,mint:o}):void 0,inAmount:ct(t.data,t.data.length-1-2-8-8),quotedOutAmount:ct(t.data,t.data.length-1-2-8)}}throw[62,198,214,193,213,159,108,210].includes(o)&&console.warn("Jupiter swap program instruction 'claim' not implemented"),[116,206,27,191,166,19,0,73].includes(o)&&console.warn("Jupiter swap program instruction 'claim_token' not implemented"),[26,74,236,151,104,64,183,249].includes(o)&&console.warn("Jupiter swap program instruction 'close_token' not implemented"),[229,194,212,172,8,10,134,147].includes(o)&&console.warn("Jupiter swap program instruction 'create_open_orders' not implemented"),[28,226,32,148,188,136,113,171].includes(o)&&console.warn("Jupiter swap program instruction 'create_program_open_orders' not implemented"),[232,242,197,253,240,143,129,52].includes(o)&&console.warn("Jupiter swap program instruction 'create_token_ledger' not implemented"),[147,241,123,100,244,132,174,118].includes(o)&&console.warn("Jupiter swap program instruction 'create_token_account' not implemented"),[229,23,203,151,122,227,173,42].includes(o)&&console.warn("Jupiter swap program instruction 'route' not implemented"),[150,86,71,116,167,93,14,104].includes(o)&&console.warn("Jupiter swap program instruction 'route_with_token_ledger' not implemented"),[228,85,185,112,78,79,77,2].includes(o)&&console.warn("Jupiter swap program instruction 'set_token_ledger' not implemented"),[230,121,143,80,119,159,106,170].includes(o)&&console.warn("Jupiter swap program instruction 'shared_accounts_route_with_token_ledger' not implemented"),Error(`Jupiter swap program instruction type ${o} not supported`)}const pt={component:()=>{let{data:t,onUserCloseViaDialogOrKeybindRef:e,setModalData:g,navigate:h}=s(),{client:y,closePrivyModal:w,walletProxy:k,showFiatPrices:b}=m(),v=u(),{user:A}=c(),I=V()(t?.standardSignAndSendTransaction?.chain??"solana:mainnet"),[S,j]=a(t?.standardSignAndSendTransaction?.transaction),[C,T]=a(),[O,x]=a(),[M,q]=a({value:0n,isLoading:!1}),[U,H]=a(!1),[z,N]=a({}),[Q,X]=a(),Y=t?.standardSignAndSendTransaction?.account,G=!!t?.standardSignAndSendTransaction?.signOnly,K=Y?.imported?l(A).find((t=>t.address===Y.address)):d(A),{solPrice:tt,isSolPriceLoading:nt}=p({enabled:b}),at=r((()=>{if(!C)return;let t=C.spender,n=E(C.fee),e=E(M.value,3,!0),a=C.instructions.filter((t=>["sol-transfer","spl-transfer","raydium-swap-base-input","raydium-swap-base-output","jupiter-swap-shared-accounts-route","jupiter-swap-exact-out-route"].includes(t.type))),r=a.at(0);if(!r||a.length>1)return{fee:n,spender:t,balance:e};if("sol-transfer"===r.type)return{fee:n,spender:t,balance:e,total:E(r.value)};if("spl-transfer"===r.type)return{fee:n,spender:t,balance:e,total:`${i({amount:r.value,decimals:r.token.decimals})} ${r.token.symbol}`};if("raydium-swap-base-input"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.amountIn,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.minimumAmountOut,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("raydium-swap-base-output"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.maxAmountIn,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.amountOut,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("jupiter-swap-shared-accounts-route"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.inAmount,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.quotedOutAmount,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}if("jupiter-swap-exact-out-route"===r.type&&r.tokenIn&&r.tokenOut){return{fee:n,spender:t,balance:e,swap:`${`${i({amount:r.quotedInAmount,decimals:r.tokenIn.decimals})} ${r.tokenIn.symbol}`} → ${`${i({amount:r.outAmount,decimals:r.tokenOut.decimals})} ${r.tokenOut.symbol}`}`}}return{fee:n,spender:t,balance:e}}),[C,Y?.address,M]),rt=r((()=>{let t;if(!C||!b||!tt||nt)return;function n(...t){return Z(t.reduce(((t,n)=>t+n),0n),tt??0)}Y?.address===C.spender&&(t=n(C.fee));let e=n(M.value),a=C.instructions.filter((t=>"sol-transfer"===t.type||"spl-transfer"===t.type)).at(0);return!a||C.instructions.length>1?{fee:t,balance:e}:"sol-transfer"===a.type?{fee:t,balance:e,total:n(a.value,Y?.address===C.spender?C.fee:0n)}:"spl-transfer"===a.type?{fee:t,balance:e,total:`${i({amount:a.value,decimals:a.token.decimals})} ${a.token.symbol}`}:{fee:t,balance:e}}),[C,b,tt,nt,Y?.address,M]);if(o((()=>{!async function(){if(S&&y)try{x(void 0);let t=await st({tx:S,solanaClient:I,privyClient:y,checkFunds:!G});T(t)}catch(t){console.error("Failed to prepare transaction",t),x(t)}}()}),[S,I,y,G]),o((()=>{(async function(){if(!Y)return;q({value:M.value,isLoading:!0});let{value:t}=await I.rpc.getBalance(Y.address,{commitment:"confirmed"}).send();q({value:t??0n,isLoading:!1})})().catch(console.error)}),[C]),!S||!t?.standardSignAndSendTransaction||!Y){let e=Error("Invalid transaction request");/*#__PURE__*/return n(f,{error:e,allowlistConfig:v.allowlistConfig,onRetry:()=>{t?.standardSignAndSendTransaction?.onFailure(e),w({shouldCallAuthOnSuccess:!1})}})}let ot=()=>{if(!U)return z.signature||z.signedTransaction?t?.standardSignAndSendTransaction?.onSuccess({signature:z.signature,signedTransaction:z.signedTransaction}):t?.standardSignAndSendTransaction?.onFailure(Q??O??Error("User exited the modal before submitting the transaction")),w({shouldCallAuthOnSuccess:!1})};e.current=ot;let it=t.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?/*#__PURE__*/n("img",{src:t.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:t.standardSignAndSendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,ct=!!(t.funding&&t.funding.supportedOptions.length>0),lt=!C?.hasFunds&&ct;if(z.signature||z.signedTransaction){let e=C?.instructions.filter((t=>"sol-transfer"===t.type||"spl-transfer"===t.type)),a=1===e?.length?e?.at(0):void 0;/*#__PURE__*/return n(et,{fees:z.fees??0n,onClose:ot,transactionInfo:t.standardSignAndSendTransaction?.uiOptions.transactionInfo,solPrice:tt,receiptHeader:t.standardSignAndSendTransaction?.uiOptions.successHeader,receiptDescription:t.standardSignAndSendTransaction?.uiOptions.successDescription,chain:I.chain,signOnly:G,instruction:"sol-transfer"===a?.type?{to:a.toAccount,amount:a.value}:{to:a?.toAccount||a?.toAta,total:at?.total}})}return Q?/*#__PURE__*/n($,{transactionError:Q,chainId:I.chain,onClose:ot,chainType:"solana",onRetry:async()=>{X(void 0);let{value:t}=await I.rpc.getLatestBlockhash().send();var n,e;j((n=S,e=t,_(F().decode(R(n)),(t=>P(t)),(t=>B(e,t)),(t=>J(t)),(t=>new Uint8Array(W().encode(t))))))}}):/*#__PURE__*/n(L,{img:it,title:t.standardSignAndSendTransaction?.uiOptions?.transactionInfo?.title||"Confirm transaction",subtitle:t.standardSignAndSendTransaction?.uiOptions?.description||`${v.name} wants your permission to approve the following transaction.`,cta:lt?"Add funds":t.standardSignAndSendTransaction?.uiOptions?.buttonText||"Approve",instructions:C?.instructions??[],network:"solana:mainnet"==I.chain?"Solana":I.chain.replace("solana:",""),blockExplorerUrl:I.blockExplorerUrl,total:b?rt?.total:at?.total,fee:b?rt?.fee:at?.fee,balance:b?rt?.balance:at?.balance,swap:at?.swap,transactingWalletAddress:Y.address,disabled:!C?.hasFunds&&!ct,isSubmitting:U,isPreparing:!C||M.isLoading,isTokenPriceLoading:b&&nt,isMissingFunds:!C?.hasFunds,submitError:Q??void 0,isSponsored:!!t.standardSignAndSendTransaction?.isSponsored,parseError:O,onClick:lt?async()=>{if(!Y)return;if(!ct)throw Error("Funding wallet is not enabled");let n="FundingMethodSelectionScreen";g({...t,funding:{...t.funding,methodScreen:n},solanaFundingData:t?.solanaFundingData}),h(n)}:async()=>{try{if(H(!0),U||!Y||!k||!A||!K)return;let n=await t.standardSignAndSendTransaction.onConfirm(S);if("signature"in n){let t=await async function({solanaClient:t,signature:n}){let e=D().decode(n),a=await t.rpc.getTransaction(e,{maxSupportedTransactionVersion:0,commitment:"confirmed",encoding:"base64"}).send().catch((()=>null));return a?{fee:a.meta?.fee??0n}:null}({solanaClient:I,signature:n.signature});return void N({...n,fees:t?.fee})}N(n)}catch(t){console.warn({transaction:S,error:t}),X(t)}finally{H(!1)}},onClose:ot})}};export{pt as StandardSignAndSendTransactionScreen,pt as default};
@@ -0,0 +1 @@
1
+ import{styled as o}from"styled-components";const t=/*#__PURE__*/o.span.withConfig({displayName:"Subtitle",componentId:"sc-7a11f796-0"})(["margin-top:4px;color:var(--privy-color-foreground);text-align:center;font-size:0.875rem;font-weight:400;line-height:1.375rem;&& a{color:var(--privy-color-accent);}"]);export{t as S};
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import{useState as t,useEffect as r}from"react";import{a as o,q as i,C as a}from"./index-CI666IP9.mjs";import{u as s,q as n}from"./context-Cb5MFcME.mjs";import{u as m,b as l,i as c}from"./internal-context-Cvo1WmWN.mjs";import{u as d,a as u}from"./get-is-unified-wallet-DymQMSJy.mjs";import{s as p}from"./shouldProceedtoEmbeddedWalletCreationFlow-CxerhsH3.mjs";import{S as g}from"./ScreenLayout-Dmrhdwtt.mjs";import{T as v}from"./telegram-B-JqnkqZ.mjs";import"@privy-io/js-sdk-core";import"uuid";import"jose";import"eventemitter3";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"styled-components";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"ofetch";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"tinycolor2";import"./Button-DJ-mtuuD.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const y=({success:t,errorMessage:r,onRetry:o})=>{let i=t?"Successfully connected with Telegram":r?r.message:"Verifying connection to Telegram";/*#__PURE__*/return e(g,{title:i,subtitle:t?"You're good to go!":r?r.detail:"Just a few moments more",icon:v,iconVariant:"loading",iconLoadingStatus:{success:t,fail:!!r},secondaryCta:r?.retryable&&o?{label:"Retry",onClick:o}:void 0,watermark:!0})},f={component:()=>{let{authenticated:g,logout:v,ready:f,user:h}=d(),{setModalData:A,navigate:b,resetNavigation:j,data:S}=u(),T=s(),{initLoginWithTelegram:C,loginWithTelegram:w,updateWallets:E,setReadyToTrue:R,closePrivyModal:W,createAnalyticsEvent:_,getAuthMeta:M}=m(),[L,k]=t(!1),[I,x]=t(void 0),D=o();async function N(){try{let e=await async function(){let e;if(!g){if(D.enabled&&"error"===D.status)throw new a(D.error,null,l.CAPTCHA_FAILURE);return D.enabled&&"success"!==D.status&&(D.execute(),e=await D.waitForResult()),e}}();await w({captchaToken:e}),k(!0),R(!0)}catch(e){if(e?.privyErrorCode===l.ALLOWLIST_REJECTED)return x(void 0),j(),void b("AllowlistRejectionScreen");if(e?.privyErrorCode===l.USER_LIMIT_REACHED)return console.error(new c(e).toString()),x(void 0),j(),void b("UserLimitReachedScreen");if(e?.privyErrorCode===l.USER_DOES_NOT_EXIST)return x(void 0),j(),void b("AccountNotFoundScreen");if(e?.privyErrorCode===l.ACCOUNT_TRANSFER_REQUIRED&&e.data?.data?.nonce)return x(void 0),j(),A({accountTransfer:{nonce:e.data?.data?.nonce,account:e.data?.data?.subject,telegramAuthResult:M()?.telegramAuthResult,telegramWebAppData:M()?.telegramWebAppData,displayName:e.data?.data?.account?.displayName,linkMethod:"telegram",embeddedWalletAddress:e.data?.data?.otherUser?.embeddedWalletAddress}}),void b("LinkConflictScreen");let{retryable:t,detail:r}=i(e);x({retryable:t,detail:r,message:"Authentication failed"})}}r((()=>{N()}),[]),r((()=>{if(!(f&&g&&L&&h))return;if(T?.legal.requireUsersAcceptTerms&&!h.hasAcceptedTerms){let e=setTimeout((()=>{b("AffirmativeConsentScreen")}),n);return()=>clearTimeout(e)}if(p(h,T.embeddedWallets)){let e=setTimeout((()=>{A({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),_({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:"telegram",screen:"TelegramAuthScreen"}}),v()},callAuthOnSuccessOnClose:!0}}),b("EmbeddedWalletOnAccountCreateScreen")}),n);return()=>clearTimeout(e)}E();let e=setTimeout((()=>W({shouldCallAuthOnSuccess:!0,isSuccess:!0})),n);return()=>clearTimeout(e)}),[f,g,L,h]);/*#__PURE__*/return e(y,{success:L,errorMessage:I,onRetry:I?.retryable?async()=>{try{x(void 0),S?.telegramAuthModalData?.seamlessAuth||await C(void 0,S?.login?.disableSignup),await N()}catch(e){let{retryable:t,detail:r}=i(e);x({retryable:t,detail:r,message:"Authentication failed"})}}:void 0})},isCaptchaRequired:!0,isShownBeforeReady:!0};export{f as TelegramAuthScreen,y as TelegramAuthScreenView,f as default};
@@ -0,0 +1 @@
1
+ import{styled as e}from"styled-components";const o=/*#__PURE__*/e.span.withConfig({displayName:"Title",componentId:"sc-66de63c-0"})(["color:var(--privy-color-foreground);font-size:1.125rem;font-weight:600;line-height:1.875rem;text-align:center;"]);export{o as T};
@@ -0,0 +1,2 @@
1
+ import{jsxs as r,jsx as e}from"react/jsx-runtime";import{X as t,Check as o}from"lucide-react";import c from"react";import{styled as i}from"styled-components";const a=/*#__PURE__*/i.div.withConfig({displayName:"TodoList",componentId:"sc-bcc78743-0"})(["display:flex;flex-direction:column;justify-content:flex-start;gap:10px;padding-left:8px;"]),s=({children:i,variant:a="default",icon:s})=>{let d=()=>{switch(a){case"success":return"var(--privy-color-icon-success)";case"error":return"var(--privy-color-icon-error)";default:return"var(--privy-color-icon-muted)"}};/*#__PURE__*/return r(l,{children:[/*#__PURE__*/e(n,{$variant:a,"data-variant":a,children:(()=>{if(s)
2
+ /*#__PURE__*/return c.isValidElement(s)?/*#__PURE__*/c.cloneElement(s,{stroke:d(),strokeWidth:2}):s;switch(a){case"success":default:/*#__PURE__*/return e(o,{size:12,stroke:d(),strokeWidth:3});case"error":/*#__PURE__*/return e(t,{size:12,stroke:d(),strokeWidth:3})}})()}),i]})};let n=/*#__PURE__*/i.div.withConfig({displayName:"IconBackground",componentId:"sc-bcc78743-2"})(["display:flex;align-items:center;justify-content:center;width:20px;height:20px;border-radius:50%;background-color:",";flex-shrink:0;"],(({$variant:r})=>{switch(r){case"success":return"var(--privy-color-success-bg, #EAFCEF)";case"error":return"var(--privy-color-error-bg, #FEE2E2)";default:return"var(--privy-color-background-2)"}})),l=/*#__PURE__*/i.div.withConfig({displayName:"TodoItemWrapper",componentId:"sc-bcc78743-3"})(["display:flex;justify-content:flex-start;align-items:flex-start;text-align:left;gap:8px;&&{a{color:var(--privy-color-accent);}}"]);export{a as T,s as a};
@@ -0,0 +1,3 @@
1
+ import{jsxs as e,jsx as i,Fragment as n}from"react/jsx-runtime";import{styled as t}from"styled-components";import{P as o,H as r,W as l}from"./WalletLink-CjuEskpb.mjs";import{g as d}from"./ethers-CpMSCMOg.mjs";import{F as a}from"./Layouts-Bmf8DxNP.mjs";import c from"@heroicons/react/24/outline/ChevronDownIcon";import{createContext as s,useState as p,useContext as h}from"react";import{s as f,u as g}from"./context-Cb5MFcME.mjs";const m=({label:n,children:t,valueStyles:o})=>/*#__PURE__*/e(v,{children:[/*#__PURE__*/i("div",{children:n}),/*#__PURE__*/i(u,{style:{...o},children:t})]});let v=/*#__PURE__*/t.div.withConfig({displayName:"StyledDetailsRow",componentId:"sc-4ebfdd45-0"})(["display:flex;align-items:center;justify-content:space-between;width:100%;> :first-child{color:var(--privy-color-foreground-3);text-align:left;}> :last-child{color:var(--privy-color-foreground-2);text-align:right;}"]),u=/*#__PURE__*/t.div.withConfig({displayName:"ValueWrapper",componentId:"sc-4ebfdd45-1"})(["font-size:14px;line-height:100%;display:flex;align-items:center;justify-content:center;border-radius:var(--privy-border-radius-full);background-color:var(--privy-color-background-2);padding:4px 8px;"]);const y=({gas:n,tokenPrice:t,tokenSymbol:r})=>/*#__PURE__*/e(a,{style:{paddingBottom:"12px"},children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/i(I,{children:"Est. Fees"}),/*#__PURE__*/i("div",{children:/*#__PURE__*/i(o,{weiQuantities:[BigInt(n)],tokenPrice:t,tokenSymbol:r})})]}),t&&/*#__PURE__*/i(b,{children:`${d(BigInt(n),r)}`})]}),x=({value:n,gas:t,tokenPrice:r,tokenSymbol:l})=>{let c=BigInt(n??0)+BigInt(t);/*#__PURE__*/return e(a,{children:[/*#__PURE__*/e(w,{children:[/*#__PURE__*/i(I,{children:"Total (including fees)"}),/*#__PURE__*/i("div",{children:/*#__PURE__*/i(o,{weiQuantities:[BigInt(n||0),BigInt(t)],tokenPrice:r,tokenSymbol:l})})]}),r&&/*#__PURE__*/i(b,{children:d(c,l)})]})};let w=/*#__PURE__*/t.div.withConfig({displayName:"TransactionTotalRow",componentId:"sc-f8ef9b74-0"})(["display:flex;flex-direction:row;justify-content:space-between;align-items:center;padding-top:4px;"]),b=/*#__PURE__*/t.div.withConfig({displayName:"ValueConversionRow",componentId:"sc-f8ef9b74-1"})(["display:flex;flex-direction:row;height:12px;font-size:12px;line-height:12px;color:var(--privy-color-foreground-3);font-weight:400;"]),I=/*#__PURE__*/t.div.withConfig({displayName:"TotalText",componentId:"sc-f8ef9b74-2"})(["font-size:14px;line-height:22.4px;font-weight:400;"]);const C=/*#__PURE__*/s(void 0),k=/*#__PURE__*/s(void 0),P=({defaultValue:e,children:n})=>{let[t,o]=p(e||null);/*#__PURE__*/return i(C.Provider,{value:{activePanel:t,togglePanel:e=>{o(t===e?null:e)}},children:/*#__PURE__*/i(j,{children:n})})},N=({value:e,children:n})=>{let{activePanel:t,togglePanel:o}=h(C),r=t===e;/*#__PURE__*/return i(k.Provider,{value:{onToggle:()=>o(e),value:e},children:/*#__PURE__*/i(D,{isActive:r?"true":"false","data-open":String(r),children:n})})},T=({children:t})=>{let{activePanel:o}=h(C),{onToggle:r,value:l}=h(k),d=o===l;/*#__PURE__*/
2
+ return e(n,{children:[/*#__PURE__*/e(B,{onClick:r,"data-open":String(d),children:[/*#__PURE__*/i(z,{children:t}),/*#__PURE__*/i(R,{isactive:d?"true":"false",children:/*#__PURE__*/i(c,{height:"16px",width:"16px",strokeWidth:"2"})})]}),/*#__PURE__*/i(W,{})]})},A=({children:e})=>{let{activePanel:n}=h(C),{value:t}=h(k);/*#__PURE__*/return i(F,{"data-open":String(n===t),children:/*#__PURE__*/i(Q,{children:e})})},S=({children:e})=>{let{activePanel:n}=h(C),{value:t}=h(k);/*#__PURE__*/return i(Q,{children:"function"==typeof e?e({isActive:n===t}):e})};let j=/*#__PURE__*/t.div.withConfig({displayName:"AccordionRoot",componentId:"sc-d25f9267-0"})(["display:flex;flex-direction:column;width:100%;gap:8px;"]),B=/*#__PURE__*/t.div.withConfig({displayName:"AccordionTriggerContainer",componentId:"sc-d25f9267-1"})(["display:flex;justify-content:space-between;align-items:center;width:100%;cursor:pointer;padding-bottom:8px;"]),W=/*#__PURE__*/t.div.withConfig({displayName:"AccordionDivider",componentId:"sc-d25f9267-2"})(["width:100%;&&{border-top:1px solid;border-color:var(--privy-color-foreground-4);}padding-bottom:12px;"]),z=/*#__PURE__*/t.div.withConfig({displayName:"AccordionTriggerContent",componentId:"sc-d25f9267-3"})(["font-size:14px;font-weight:500;line-height:19.6px;width:100%;padding-right:8px;"]),D=/*#__PURE__*/t.div.withConfig({displayName:"AccordionPanelContainer",componentId:"sc-d25f9267-4"})(["display:flex;flex-direction:column;width:100%;overflow:hidden;padding:12px;&&{border:1px solid;border-color:var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-md);}"]),F=/*#__PURE__*/t.div.withConfig({displayName:"AccordionContentContainer",componentId:"sc-d25f9267-5"})(["position:relative;overflow:hidden;transition:max-height 25ms ease-out;&[data-open='true']{max-height:700px;}&[data-open='false']{max-height:0;}"]),Q=/*#__PURE__*/t.div.withConfig({displayName:"ContentWrapper",componentId:"sc-d25f9267-6"})(["display:flex;flex-direction:column;gap:12px;flex:1 1 auto;min-height:1px;"]),R=/*#__PURE__*/t.div.withConfig({displayName:"IconWrapper",componentId:"sc-d25f9267-7"})(["transform:",";"],(e=>"true"===e.isactive?"rotate(180deg)":"rotate(0deg)"));const V=({from:n,to:t,txn:o,transactionInfo:d,tokenPrice:a,gas:c,tokenSymbol:s})=>{let p=BigInt(o?.value||0);/*#__PURE__*/
3
+ return i(P,{...g().render.standalone?{defaultValue:"details"}:{},children:/*#__PURE__*/e(N,{value:"details",children:[/*#__PURE__*/i(T,{children:/*#__PURE__*/e(L,{children:[/*#__PURE__*/i("div",{children:d?.title||"Details"}),/*#__PURE__*/i(E,{children:/*#__PURE__*/i(r,{weiQuantities:[p],tokenPrice:a,tokenSymbol:s})})]})}),/*#__PURE__*/e(A,{children:[/*#__PURE__*/i(m,{label:"From",children:/*#__PURE__*/i(l,{walletAddress:n,chainId:o.chainId||f,chainType:"ethereum"})}),/*#__PURE__*/i(m,{label:"To",children:/*#__PURE__*/i(l,{walletAddress:t,chainId:o.chainId||f,chainType:"ethereum"})}),d&&d.action&&/*#__PURE__*/i(m,{label:"Action",children:d.action}),c&&/*#__PURE__*/i(y,{value:o.value,gas:c,tokenPrice:a,tokenSymbol:s})]}),/*#__PURE__*/i(S,{children:({isActive:e})=>/*#__PURE__*/i(x,{value:o.value,displayFee:e,gas:c||"0x0",tokenPrice:a,tokenSymbol:s})})]})})};let L=/*#__PURE__*/t.div.withConfig({displayName:"AccordionTriggerContent",componentId:"sc-2eff9f5c-0"})(["display:flex;flex-direction:row;justify-content:space-between;"]),E=/*#__PURE__*/t.div.withConfig({displayName:"TotalText",componentId:"sc-2eff9f5c-1"})(["flex-shrink:0;padding-left:8px;"]);export{V as T};
@@ -0,0 +1,2 @@
1
+ import{jsx as e,jsxs as n,Fragment as r}from"react/jsx-runtime";import{BoltIcon as i,ArrowRightIcon as o,ChevronDownIcon as t}from"@heroicons/react/24/outline";import{useState as a}from"react";import{styled as l}from"styled-components";import{formatTokenAmount as c}from"@privy-io/js-sdk-core";import{P as d,E as s}from"./Button-DJ-mtuuD.mjs";import{M as h,B as m,a as p}from"./ModalHeader-D7WajfD8.mjs";import{L as u,V as f,a as g}from"./Value-B4M62ove.mjs";import{a as y,R as x}from"./Row-CG0lSY5Z.mjs";import{E as b}from"./ErrorMessage-Cx8GKGhL.mjs";import{L as k}from"./LabelXs-BOisBtqT.mjs";import{S as w}from"./Subtitle-DkvfP2Ev.mjs";import{T as v}from"./Title-D0pfZff-.mjs";import{A as I}from"./Address-DtXA0OPS.mjs";import{W as C}from"./WalletInfoCard-DAv0WFcc.mjs";import{u as T}from"./context-Cb5MFcME.mjs";import{Y as S}from"./useActiveWallet-hrZcON-K.mjs";import{L as N}from"./LoadingSkeleton-CHdaq3pb.mjs";import{isAddress as A}from"viem";import{B as j}from"./shared-CtYf3O54.mjs";import{C as E}from"./Checkbox-NmGCZeKL.mjs";import{E as M}from"./ErrorBanner-BdiArMwu.mjs";import{W as $}from"./WarningBanner-BDp-QC9i.mjs";import O from"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import D from"@heroicons/react/24/outline/ClipboardDocumentIcon";import F from"@heroicons/react/24/outline/ExclamationCircleIcon";import{u as L}from"./internal-context-Cvo1WmWN.mjs";const B=/*#__PURE__*/l(u).withConfig({displayName:"InteractiveLabel",componentId:"sc-b57d0824-0"})(["cursor:pointer;display:inline-flex;gap:8px;align-items:center;color:var(--privy-color-accent);svg{fill:var(--privy-color-accent);}"]);var P=({iconUrl:r,value:i,symbol:o,usdValue:t,nftName:a,nftCount:l,decimals:c,$isLoading:d})=>{if(d)/*#__PURE__*/return e(R,{$isLoading:d});let s=i&&t&&c?function(e,n,r){let i=parseFloat(e),o=parseFloat(r);if(0===i||0===o||Number.isNaN(i)||Number.isNaN(o))return e;let t=Math.ceil(-Math.log10(.01/(o/i))),a=Math.pow(10,t=Math.max(t=Math.min(t,n),1)),l=+(Math.floor(i*a)/a).toFixed(t).replace(/\.?0+$/,"");return Intl.NumberFormat(void 0,{maximumFractionDigits:n}).format(l)}(i,c,t):i;/*#__PURE__*/return n("div",{children:[/*#__PURE__*/n(R,{$isLoading:d,children:[r&&/*#__PURE__*/e(z,{src:r,alt:"Token icon"}),l&&l>1?l+"x":void 0," ",a,s," ",o]}),t&&/*#__PURE__*/n(W,{$isLoading:d,children:["$",t]})]})};let R=/*#__PURE__*/l.span.withConfig({displayName:"Value",componentId:"sc-991db279-0"})(["color:var(--privy-color-foreground);font-size:0.875rem;font-weight:500;line-height:1.375rem;word-break:break-all;text-align:right;display:flex;justify-content:flex-end;",""],N);const W=/*#__PURE__*/l.span.withConfig({displayName:"Subvalue",componentId:"sc-991db279-1"})(["color:var(--privy-color-foreground-2);font-size:12px;font-weight:400;line-height:18px;word-break:break-all;text-align:right;display:flex;justify-content:flex-end;",""],N);let z=/*#__PURE__*/l.img.withConfig({displayName:"TokenIcon",componentId:"sc-991db279-2"})(["height:14px;width:14px;margin-right:4px;object-fit:contain;"]);const V=i=>{let{chain:o,transactionDetails:t,isTokenContractInfoLoading:a,symbol:l}=i,{action:c,functionName:d}=t;/*#__PURE__*/return e(j,{children:/*#__PURE__*/n(y,{children:["transaction"!==c&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Action"}),/*#__PURE__*/e(f,{children:d})]}),"mint"===d&&"args"in t&&t.args.filter((e=>e)).map(((r,i)=>/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:`Param ${i}`}),/*#__PURE__*/e(f,{children:"string"==typeof r&&A(r)?/*#__PURE__*/e(I,{address:r,url:o?.blockExplorers?.default?.url,showCopyIcon:!1}):r?.toString()})]},i))),"setApprovalForAll"===d&&t.operator&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Operator"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.operator,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),"setApprovalForAll"===d&&void 0!==t.approved&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Set approval to"}),/*#__PURE__*/e(f,{children:t.approved?"true":"false"})]}),"transfer"===d||"transferFrom"===d||"safeTransferFrom"===d||"approve"===d?/*#__PURE__*/n(r,{children:["formattedAmount"in t&&t.formattedAmount&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/n(f,{$isLoading:a,children:[t.formattedAmount," ",l]})]}),"tokenId"in t&&t.tokenId&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token ID"}),/*#__PURE__*/e(f,{children:t.tokenId.toString()})]})]}):null,"safeBatchTransferFrom"===d&&/*#__PURE__*/n(r,{children:["amounts"in t&&t.amounts&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Amounts"}),/*#__PURE__*/e(f,{children:t.amounts.join(", ")})]}),"tokenIds"in t&&t.tokenIds&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token IDs"}),/*#__PURE__*/e(f,{children:t.tokenIds.join(", ")})]})]}),"approve"===d&&t.spender&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Spender"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.spender,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===d||"safeTransferFrom"===d||"safeBatchTransferFrom"===d)&&t.transferFrom&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Transferring from"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.transferFrom,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),("transferFrom"===d||"safeTransferFrom"===d||"safeBatchTransferFrom"===d)&&t.transferTo&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Transferring to"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:t.transferTo,url:o?.blockExplorers?.default?.url,showCopyIcon:!1})})]})]})})},H=({variant:i,setPreventMaliciousTransaction:o,colorScheme:t="light",preventMaliciousTransaction:a})=>"warn"===i?/*#__PURE__*/e(U,{children:/*#__PURE__*/n($,{theme:t,children:[/*#__PURE__*/e("span",{style:{fontWeight:"500"},children:"Warning: Suspicious transaction"}),/*#__PURE__*/e("br",{}),"This has been flagged as a potentially deceptive request. Approving could put your assets or funds at risk."]})}):"error"===i?/*#__PURE__*/e(r,{children:/*#__PURE__*/n(U,{children:[/*#__PURE__*/e(M,{theme:t,children:/*#__PURE__*/n("div",{children:[/*#__PURE__*/e("strong",{children:"This is a malicious transaction"}),/*#__PURE__*/e("br",{}),"This transaction transfers tokens to a known malicious address. Proceeding may result in the loss of valuable assets."]})}),/*#__PURE__*/n(q,{children:[/*#__PURE__*/e(E,{color:"var(--privy-color-error)",checked:!a,readOnly:!0,onClick:()=>o(!a)}),/*#__PURE__*/e("span",{children:"I understand and want to proceed anyways."})]})]})}):null;let U=/*#__PURE__*/l.div.withConfig({displayName:"BannerContainer",componentId:"sc-ab8a5a0b-0"})(["margin-top:1.5rem;"]),q=/*#__PURE__*/l.div.withConfig({displayName:"CheckboxContainer",componentId:"sc-ab8a5a0b-1"})(["display:flex;align-items:center;gap:0.5rem;margin-top:0.75rem;"]);const J=({transactionIndex:e,maxIndex:n})=>"number"!=typeof e||0===n?"":` (${e+1} / ${n+1})`,Q=({img:l,submitError:c,prepareError:p,onClose:k,action:C,title:N,subtitle:A,to:j,tokenAddress:E,network:M,missingFunds:$,fee:O,from:D,cta:F,disabled:L,chain:R,isSubmitting:W,isPreparing:z,isTokenPriceLoading:U,isTokenContractInfoLoading:q,isSponsored:Q,symbol:Y,balance:_,onClick:ne,transactionDetails:re,transactionIndex:ie,maxIndex:oe,onBack:te,chainName:ae,validation:le,hasScanDetails:ce,setIsScanDetailsOpen:de,preventMaliciousTransaction:se,setPreventMaliciousTransaction:he,tokensSent:me,tokensReceived:pe,isScanning:ue,isCancellable:fe,functionName:ge})=>{let{showTransactionDetails:ye,setShowTransactionDetails:xe,hasMoreDetails:be,isErc20Ish:ke}=(e=>{let[n,r]=a(!1),i=!0,o=!1;return(!e||e.isErc20Ish||"transaction"===e.action)&&(i=!1),i&&(o=Object.entries(e||{}).some((([e,n])=>n&&!["action","isErc20Ish","isNFTIsh"].includes(e)))),{showTransactionDetails:n,setShowTransactionDetails:r,hasMoreDetails:i&&o,isErc20Ish:e?.isErc20Ish}})(re),we=T(),ve=ke&&q||z||U||ue;/*#__PURE__*/return n(r,{children:[/*#__PURE__*/e(h,{onClose:k,backFn:te}),l&&/*#__PURE__*/e(K,{children:l}),/*#__PURE__*/n(v,{style:{marginTop:l?"1.5rem":0},children:[N,/*#__PURE__*/e(J,{maxIndex:oe,transactionIndex:ie})]}),/*#__PURE__*/e(w,{children:A}),/*#__PURE__*/n(y,{style:{marginTop:"2rem"},children:[(!!me[0]||ve)&&/*#__PURE__*/n(x,{children:[pe.length>0?/*#__PURE__*/e(u,{children:"Send"}):/*#__PURE__*/e(u,{children:"approve"===C?"Approval amount":"Amount"}),/*#__PURE__*/e("div",{className:"flex flex-col",children:me.map(((n,r)=>/*#__PURE__*/e(P,{iconUrl:n.iconUrl,value:"setApprovalForAll"===ge?"All":n.value,usdValue:n.usdValue,symbol:n.symbol,nftName:n.nftName,nftCount:n.nftCount,decimals:n.decimals},r)))})]}),pe.length>0&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Receive"}),/*#__PURE__*/e("div",{className:"flex flex-col",children:pe.map(((n,r)=>/*#__PURE__*/e(P,{iconUrl:n.iconUrl,value:n.value,usdValue:n.usdValue,symbol:n.symbol,nftName:n.nftName,nftCount:n.nftCount,decimals:n.decimals},r)))})]}),re&&"spender"in re&&re?.spender?/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Spender"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:re.spender,url:R?.blockExplorers?.default?.url})})]}):null,j&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"To"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:j,url:R?.blockExplorers?.default?.url,showCopyIcon:!0})})]}),E&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token address"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:E,url:R?.blockExplorers?.default?.url})})]}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Network"}),/*#__PURE__*/e(f,{children:M})]}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Estimated fee"}),/*#__PURE__*/e(f,{$isLoading:z||U||void 0===Q,children:Q?/*#__PURE__*/n(Z,{children:[/*#__PURE__*/n(ee,{children:["Sponsored by ",we.name]}),/*#__PURE__*/e(i,{height:16,width:16})]}):O})]}),be&&!ce&&/*#__PURE__*/n(r,{children:[/*#__PURE__*/e(x,{className:"cursor-pointer",onClick:()=>xe(!ye),children:/*#__PURE__*/n(g,{className:"flex items-center gap-x-1",children:["Details"," ",/*#__PURE__*/e(t,{style:{width:"0.75rem",marginLeft:"0.25rem",transform:ye?"rotate(180deg)":void 0}})]})}),ye&&re&&/*#__PURE__*/e(V,{action:C,chain:R,transactionDetails:re,isTokenContractInfoLoading:q,symbol:Y})]}),ce&&/*#__PURE__*/e(x,{children:/*#__PURE__*/n(B,{onClick:()=>de(!0),children:[/*#__PURE__*/e("span",{className:"text-color-primary",children:"Details"}),/*#__PURE__*/e(o,{height:"14px",width:"14px",strokeWidth:"2"})]})})]}),/*#__PURE__*/e(S,{}),c?/*#__PURE__*/e(b,{style:{marginTop:"2rem"},children:c.message}):p&&0===ie?
2
+ /*#__PURE__*/e(b,{style:{marginTop:"2rem"},children:p.shortMessage??G}):null,/*#__PURE__*/e(H,{variant:le,preventMaliciousTransaction:se,setPreventMaliciousTransaction:he}),/*#__PURE__*/e(X,{$useSmallMargins:!(!p&&!c&&"warn"!==le&&"error"!==le),address:D,balance:_,errMsg:z||p||c||!$?void 0:`Add funds on ${R?.name??ae} to complete transaction.`}),/*#__PURE__*/e(d,{style:{marginTop:"1rem"},loading:W,disabled:L||z,onClick:ne,children:F}),fe&&/*#__PURE__*/e(s,{style:{marginTop:"1rem"},onClick:k,isSubmitting:!1,children:"Not now"}),/*#__PURE__*/e(m,{})]})},Y=({img:o,title:l,subtitle:s,cta:p,instructions:g,network:C,blockExplorerUrl:N,isMissingFunds:A,submitError:j,parseError:E,total:M,swap:$,transactingWalletAddress:O,fee:D,balance:F,disabled:L,isSubmitting:P,isPreparing:R,isTokenPriceLoading:W,onClick:z,onClose:V,onBack:H,isSponsored:U})=>{let q=R||W,[J,Q]=a(!1),Y=T();/*#__PURE__*/return n(r,{children:[/*#__PURE__*/e(h,{onClose:V,backFn:H}),o&&/*#__PURE__*/e(K,{children:o}),/*#__PURE__*/e(v,{style:{marginTop:o?"1.5rem":0},children:l}),/*#__PURE__*/e(w,{children:s}),/*#__PURE__*/n(y,{style:{marginTop:"2rem",marginBottom:".5rem"},children:[(M||q)&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/e(f,{$isLoading:q,children:M})]}),$&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Swap"}),/*#__PURE__*/e(f,{children:$})]}),C&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Network"}),/*#__PURE__*/e(f,{children:C})]}),(D||q||void 0!==U)&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Estimated fee"}),/*#__PURE__*/e(f,{$isLoading:q,children:U&&!q?/*#__PURE__*/n(Z,{children:[/*#__PURE__*/n(ee,{children:["Sponsored by ",Y.name]}),/*#__PURE__*/e(i,{height:16,width:16})]}):D})]})]}),/*#__PURE__*/e(x,{children:/*#__PURE__*/n(B,{onClick:()=>Q((e=>!e)),children:[/*#__PURE__*/e("span",{children:"Advanced"}),/*#__PURE__*/e(t,{height:"16px",width:"16px",strokeWidth:"2",style:{transition:"all 300ms",transform:J?"rotate(180deg)":void 0}})]})}),J&&/*#__PURE__*/e(r,{children:g.map(((r,i)=>"sol-transfer"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/n(k,{children:["Transfer ",r.withSeed?"with seed":""]})}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/n(f,{children:[c({amount:r.value,decimals:r.token.decimals})," ",r.token.symbol]})]}),!!r.toAccount&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Destination"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.toAccount,url:N})})]})]},i):"spl-transfer"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/n(k,{children:["Transfer ",r.token.symbol]})}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/e(f,{children:r.value.toString()})]}),!!r.fromAta&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Source"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.fromAta,url:N})})]}),!!r.toAta&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Destination"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.toAta,url:N})})]}),!!r.token.address&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.token.address,url:N})})]})]},i):"ata-creation"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/e(k,{children:"Create token account"})}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Program ID"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.program,url:N})})]}),!!r.owner&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Owner"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.owner,url:N})})]})]},i):"create-account"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/n(k,{children:["Create account ",r.withSeed?"with seed":""]})}),!!r.account&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Account"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.account,url:N})})]}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Amount"}),/*#__PURE__*/n(f,{children:[c({amount:r.value,decimals:9})," SOL"]})]})]},i):"spl-init-account"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/e(k,{children:"Initialize token account"})}),!!r.account&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Account"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.account,url:N})})]}),!!r.mint&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Mint"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mint,url:N})})]}),!!r.owner&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Owner"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.owner,url:N})})]})]},i):"spl-close-account"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/e(k,{children:"Close token account"})}),!!r.source&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Source"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.source,url:N})})]}),!!r.destination&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Destination"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.destination,url:N})})]}),!!r.owner&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Owner"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.owner,url:N})})]})]},i):"spl-sync-native"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/e(k,{children:"Sync native"})}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Program ID"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.program,url:N})})]})]},i):"raydium-swap-base-input"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/n(k,{children:["Raydium swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Amount in"}),/*#__PURE__*/e(f,{children:r.amountIn.toString()})]}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Minimum amount out"}),/*#__PURE__*/e(f,{children:r.minimumAmountOut.toString()})]}),r.mintIn&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):"raydium-swap-base-output"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/n(k,{children:["Raydium swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Max amount in"}),/*#__PURE__*/e(f,{children:r.maxAmountIn.toString()})]}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Amount out"}),/*#__PURE__*/e(f,{children:r.amountOut.toString()})]}),r.mintIn&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):"jupiter-swap-shared-accounts-route"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/n(k,{children:["Jupiter swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"In amount"}),/*#__PURE__*/e(f,{children:r.inAmount.toString()})]}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Quoted out amount"}),/*#__PURE__*/e(f,{children:r.quotedOutAmount.toString()})]}),r.mintIn&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):"jupiter-swap-exact-out-route"===r.type?/*#__PURE__*/n(_,{children:[/*#__PURE__*/e(x,{children:/*#__PURE__*/n(k,{children:["Jupiter swap"," ",r.tokenIn&&r.tokenOut?`${r.tokenIn.symbol} → ${r.tokenOut.symbol}`:""]})}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Quoted in amount"}),/*#__PURE__*/e(f,{children:r.quotedInAmount.toString()})]}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Amount out"}),/*#__PURE__*/e(f,{children:r.outAmount.toString()})]}),r.mintIn&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token in"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintIn,url:N})})]}),r.mintOut&&/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Token out"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.mintOut,url:N})})]})]},i):/*#__PURE__*/n(_,{children:[/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Program ID"}),/*#__PURE__*/e(f,{children:/*#__PURE__*/e(I,{address:r.program,url:N})})]}),/*#__PURE__*/n(x,{children:[/*#__PURE__*/e(u,{children:"Data"}),/*#__PURE__*/e(f,{children:r.discriminator})]})]},i)))}),/*#__PURE__*/e(S,{}),j?/*#__PURE__*/e(b,{style:{marginTop:"2rem"},children:j.message}):E?/*#__PURE__*/e(b,{style:{marginTop:"2rem"},children:G}):null,/*#__PURE__*/e(X,{$useSmallMargins:!(!E&&!j),title:"",address:O,balance:F,errMsg:R||E||j||!A?void 0:"Add funds on Solana to complete transaction."}),/*#__PURE__*/e(d,{style:{marginTop:"1rem"},loading:P,disabled:L||R,onClick:z,children:p}),/*#__PURE__*/e(m,{})]})};let X=/*#__PURE__*/l(C).withConfig({displayName:"StyledWalletInfoCard",componentId:"sc-cbe5ab37-0"})(["",""],(e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;")),_=/*#__PURE__*/l(y).withConfig({displayName:"InstructionRows",componentId:"sc-cbe5ab37-1"})(["margin-top:0.5rem;border:1px solid var(--privy-color-foreground-4);border-radius:var(--privy-border-radius-sm);padding:0.5rem;"]),G="There was an error preparing your transaction. Your transaction request will likely fail.",K=/*#__PURE__*/l.div.withConfig({displayName:"ImageContainer",componentId:"sc-cbe5ab37-2"})(["display:flex;width:100%;justify-content:center;max-height:40px;> img{object-fit:contain;border-radius:var(--privy-border-radius-sm);}"]),Z=/*#__PURE__*/l.span.withConfig({displayName:"SponsoredRow",componentId:"sc-cbe5ab37-3"})(["display:inline-flex;align-items:center;gap:0.3rem;"]),ee=/*#__PURE__*/l.span.withConfig({displayName:"SponsoredText",componentId:"sc-cbe5ab37-4"})(["font-size:14px;font-weight:500;color:var(--privy-color-foreground);"]);let ne=()=>/*#__PURE__*/n(ae,{children:[/*#__PURE__*/e(ce,{}),/*#__PURE__*/e(le,{})]});const re=({transactionError:i,chainId:o,onClose:t,onRetry:l,chainType:c,transactionHash:d})=>{let{chains:s}=L(),[m,u]=a(!1),{errorCode:f,errorMessage:g}=((e,n)=>{if("ethereum"===n)return{errorCode:e.details??e.message,errorMessage:e.shortMessage};let r=e.txSignature,i=e?.transactionMessage||"Something went wrong.";if(Array.isArray(e.logs)){let n=e.logs.find((e=>/insufficient (lamports|funds)/gi.test(e)));n&&(i=n)}return{transactionHash:r,errorMessage:i}})(i,c),y=(({chains:e,chainId:n,chainType:r,transactionHash:i})=>"ethereum"===r?e.find((e=>e.id===n))?.blockExplorers?.default.url??"https://etherscan.io":function(e,n){return`https://explorer.solana.com/tx/${e}?chain=${n}`}(i||"",n))({chains:s,chainId:o,chainType:c,transactionHash:d});/*#__PURE__*/return n(r,{children:[/*#__PURE__*/e(h,{onClose:t}),/*#__PURE__*/n(ie,{children:[/*#__PURE__*/e(ne,{}),/*#__PURE__*/e(oe,{children:f}),/*#__PURE__*/e(te,{children:"Please try again."}),/*#__PURE__*/n(he,{children:[/*#__PURE__*/e(se,{children:"Error message"}),/*#__PURE__*/e(pe,{$clickable:!1,children:g})]}),d&&/*#__PURE__*/n(he,{children:[/*#__PURE__*/e(se,{children:"Transaction hash"}),/*#__PURE__*/n(me,{children:["Copy this hash to view details about the transaction on a"," ",/*#__PURE__*/e("u",{children:/*#__PURE__*/e("a",{href:y,children:"block explorer"})}),"."]}),/*#__PURE__*/n(pe,{$clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(d),u(!0)},children:[d,/*#__PURE__*/e(ge,{clicked:m})]})]}),/*#__PURE__*/e(de,{onClick:()=>l({resetNonce:!!d}),children:"Retry transaction"})]}),/*#__PURE__*/e(p,{})]})};let ie=/*#__PURE__*/l.div.withConfig({displayName:"TransactionErrorScreenContainer",componentId:"sc-d58f10e6-0"})(["display:flex;flex-direction:column;align-items:center;justify-content:center;"]),oe=/*#__PURE__*/l.span.withConfig({displayName:"ErrorCode",componentId:"sc-d58f10e6-1"})(["color:var(--privy-color-foreground);text-align:center;font-size:1.125rem;font-weight:500;line-height:1.25rem;text-align:center;margin:10px;"]),te=/*#__PURE__*/l.span.withConfig({displayName:"Subtitle",componentId:"sc-d58f10e6-2"})(["margin-top:4px;margin-bottom:10px;color:var(--privy-color-foreground-3);text-align:center;font-size:0.875rem;font-style:normal;font-weight:400;line-height:20px;letter-spacing:-0.008px;"]),ae=/*#__PURE__*/l.div.withConfig({displayName:"CircleContainer",componentId:"sc-d58f10e6-3"})(["position:relative;width:60px;height:60px;margin:10px;display:flex;justify-content:center;align-items:center;"]),le=/*#__PURE__*/l(F).withConfig({displayName:"StyledExclamationCircleIcon",componentId:"sc-d58f10e6-4"})(["position:absolute;width:35px;height:35px;color:var(--privy-color-error);"]),ce=/*#__PURE__*/l.div.withConfig({displayName:"StyledRedCircle",componentId:"sc-d58f10e6-5"})(["position:absolute;width:60px;height:60px;border-radius:50%;background-color:var(--privy-color-error);opacity:0.1;"]),de=/*#__PURE__*/l(d).withConfig({displayName:"RetryButton",componentId:"sc-d58f10e6-6"})(["&&{margin-top:24px;}transition:color 350ms ease,background-color 350ms ease;"]),se=/*#__PURE__*/l.span.withConfig({displayName:"TextBoxTitle",componentId:"sc-d58f10e6-7"})(["width:100%;text-align:left;font-size:0.825rem;color:var(--privy-color-foreground);padding:4px;"]),he=/*#__PURE__*/l.div.withConfig({displayName:"TextBoxContainer",componentId:"sc-d58f10e6-8"})(["width:100%;margin:5px;display:flex;flex-direction:column;justify-content:center;align-items:center;"]),me=/*#__PURE__*/l.text.withConfig({displayName:"HelperText",componentId:"sc-d58f10e6-9"})(["position:relative;width:100%;padding:5px;font-size:0.8rem;color:var(--privy-color-foreground-3);text-align:left;word-wrap:break-word;"]),pe=/*#__PURE__*/l.span.withConfig({displayName:"TextBox",componentId:"sc-d58f10e6-10"})(["position:relative;width:100%;background-color:var(--privy-color-background-2);padding:8px 12px;border-radius:10px;margin-top:5px;font-size:14px;color:var(--privy-color-foreground-3);text-align:left;word-wrap:break-word;",""],(e=>e.$clickable&&"cursor: pointer;\n transition: background-color 0.3s;\n padding-right: 45px;\n\n &:hover {\n background-color: var(--privy-color-foreground-4);\n }")),ue=/*#__PURE__*/l(D).withConfig({displayName:"StyledClipboardIcon",componentId:"sc-d58f10e6-11"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),fe=/*#__PURE__*/l(O).withConfig({displayName:"StyledClipboardCheckIcon",componentId:"sc-d58f10e6-12"})(["position:absolute;top:13px;right:13px;width:24px;height:24px;"]),ge=({clicked:n})=>/*#__PURE__*/e(n?fe:ue,{});export{Q as S,re as T,Y as a};
@@ -0,0 +1 @@
1
+ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import{useState as a,useEffect as i}from"react";import{M as o,B as l}from"./ModalHeader-D7WajfD8.mjs";import{C as r}from"./ScreenHeader-Biz1wq02.mjs";import{t as s}from"./FundWalletMethodHeader-CbTaIDLQ.mjs";import{C as m}from"./Chip-Bsgj4Yc-.mjs";import{S as p}from"./Subtitle-DkvfP2Ev.mjs";import{u as c}from"./context-Cb5MFcME.mjs";import{v as d,a8 as u,U as h}from"./useActiveWallet-hrZcON-K.mjs";import{u as y}from"./internal-context-Cvo1WmWN.mjs";import{a as f}from"./get-is-unified-wallet-DymQMSJy.mjs";import{u as g}from"./useWallets-BplPx0Pz.mjs";import{t as C,W as w}from"./WalletButtonList-CGloXTN0.mjs";import{I as T}from"./styles-DY17fuAX.mjs";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./LoadingSkeleton-CHdaq3pb.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"ofetch";import"lucide-react";import"./index-CI666IP9.mjs";import"uuid";import"jose";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"@marsidev/react-turnstile";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./InjectedWalletIcon-DLcYOGDj.mjs";import"@heroicons/react/24/outline/WalletIcon";const j={component:()=>{let m,{connectors:h}=y(),{setModalData:T,data:j,navigate:W}=f(),S=c(),{wallets:x}=g(),D=h.filter(d).flatMap((e=>e.wallets)),[F,k]=a("default"),M="solana"===j?.funding?.chainType,b=!!j?.funding?.crossChainBridgingEnabled;m="ethereum"===j?.funding?.chainType?j.funding.erc20Address&&!j.funding.isUSDC?"ethereum-only":b&&!j.funding.chain.testnet?"ethereum-and-solana":"ethereum-only":b&&!j.funding?.isUSDC?"ethereum-and-solana":"solana-only";let E=x.filter((e=>"privy"!==e.walletClientType)),A=E.map((e=>e.walletClientType)),I=D.filter((e=>"privy"!==e.walletClientType)),L=I.map((e=>e.walletClientType)),B=[],H={...j.funding};H.usingDefaultFundingMethod&&(H.usingDefaultFundingMethod=!1);let U=({wallet:e,walletChainType:t})=>{T({...j,funding:{...H,connectedWallet:e,onContinueWithExternalWallet:()=>W(z({destChainType:M?"solana":"ethereum",sourceChainType:t}))},solanaFundingData:j?.solanaFundingData?{...j.solanaFundingData,sourceWalletData:{address:e.address,walletClientType:e.walletClientType}}:void 0}),W("FundingAmountEditScreen")};"solana-only"!==m&&B.push(...E.map(((t,n)=>/*#__PURE__*/e(v,{onClick:()=>U({wallet:t,walletChainType:"ethereum"}),icon:t.meta.icon,name:t.meta.name,chainType:t.type},n)))),"ethereum-only"!==m&&B.push(...I.map(((t,n)=>/*#__PURE__*/e(v,{onClick:()=>U({wallet:t,walletChainType:"solana"}),icon:t.meta.icon,name:t.meta.name,chainType:t.type},n)))),B.push(...C({walletList:S.appearance.walletList.filter((e=>!E.some((t=>t.walletClientType===e))&&!I.some((t=>t.walletClientType===e)))),walletChainType:m,connectors:h,connectOnly:!0,ignore:[...S.appearance.walletList,...A,...L],walletConnectEnabled:S.externalWallets.walletConnect.enabled}));let P=/*#__PURE__*/e(w,{text:"More wallets",onClick:()=>k("overflow")}),z=({sourceChainType:e,destChainType:t})=>"ethereum"===e&&"solana"===t?"AwaitingEvmToSolBridgingScreen":"ethereum"===e&&"ethereum"===t?"AwaitingExternalEthereumTransferScreen":"solana"===e&&"ethereum"===t?"AwaitingSolToEvmBridgingScreen":H.externalSolanaFundingScreen;return i((()=>{T({...j,externalConnectWallet:{onCompleteNavigateTo:({address:e,walletClientType:t,walletChainType:n})=>{let a=n??"ethereum",i="ethereum"===a?E.find((n=>n.address===e&&n.walletClientType===t)):I.find((n=>n.address===e&&n.walletClientType===t));return T({...j,funding:{...H,connectedWallet:i,onContinueWithExternalWallet:()=>{W(z({destChainType:M?"solana":"ethereum",sourceChainType:a}))}},solanaFundingData:j?.solanaFundingData?{...j.solanaFundingData,sourceWalletData:{address:e||"",walletClientType:t||""}}:void 0}),"FundingAmountEditScreen"}}})}),[]),/*#__PURE__*/t(n,"overflow"===F?{children:[/*#__PURE__*/e(o,{backFn:()=>k("default")},"header"),/*#__PURE__*/t(u,{children:[/*#__PURE__*/e(p,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),B]}),/*#__PURE__*/e(l,{})]}:{children:[/*#__PURE__*/e(s,{}),/*#__PURE__*/e(r,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),/*#__PURE__*/t(u,{children:[B.length>4?B.slice(0,3):B,B.length>4&&P]}),/*#__PURE__*/e(l,{})]})}};let v=({onClick:n,icon:a,name:i,chainType:o})=>/*#__PURE__*/t(h,{onClick:n,children:[/*#__PURE__*/e(T,{style:{width:20},children:/*#__PURE__*/e("img",{src:a})}),i,/*#__PURE__*/e(m,{color:"gray",style:{marginLeft:"auto"},children:"Connected"}),"solana"===o&&/*#__PURE__*/e(m,{color:"gray",children:"Solana"})]});export{j as TransferFromWalletScreen,j as default};
@@ -0,0 +1 @@
1
+ import{jsxs as e,Fragment as r,jsx as i}from"react/jsx-runtime";import{styled as o}from"styled-components";import{d as t}from"./Layouts-Bmf8DxNP.mjs";import{B as n}from"./ModalHeader-D7WajfD8.mjs";import{C as m}from"./ScreenHeader-Biz1wq02.mjs";import{t as a}from"./FundWalletMethodHeader-CbTaIDLQ.mjs";import{I as s}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{N as d}from"./index-CJMgUOnw.mjs";import{a as l,R as c}from"./Row-CG0lSY5Z.mjs";import{L as h,V as p}from"./Value-B4M62ove.mjs";import{A as f}from"./Address-DtXA0OPS.mjs";import{N as g}from"./NetworkIcon-B48ilzF8.mjs";import{Q as j}from"./useActiveWallet-hrZcON-K.mjs";const I=({walletClientType:o,displayName:I,addressToFund:w,chainId:y,chainName:N,isBridging:x,isErc20Flow:C,totalPriceInNativeCurrency:T,totalPriceInUsd:v,gasPriceInNativeCurrency:A,gasPriceInUsd:B})=>{let P=j(o);/*#__PURE__*/return e(r,{children:[/*#__PURE__*/i(a,{}),/*#__PURE__*/i(d,{centerIcon:/*#__PURE__*/i(s,{icon:P?.image_url?.md,name:o})}),/*#__PURE__*/i(m,{style:{marginTop:"8px",marginBottom:"12px"},title:`${x?"Bridging":"Confirming"} with ${I}`}),!x&&!C&&/*#__PURE__*/e(l,{children:[/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Total"}),/*#__PURE__*/i(p,{children:v||T})]}),/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"To"}),/*#__PURE__*/i(p,{children:/*#__PURE__*/i(f,{address:w,showCopyIcon:!1})})]}),/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Network"}),/*#__PURE__*/i(p,{children:/*#__PURE__*/e(u,{children:[/*#__PURE__*/i(g,{chainId:y,height:16,width:16})," ",N]})})]}),A&&/*#__PURE__*/e(c,{children:[/*#__PURE__*/i(h,{children:"Estimated fee"}),/*#__PURE__*/i(p,{children:B||A})]})]}),/*#__PURE__*/i(t,{height:24}),/*#__PURE__*/i(n,{})]})};let u=/*#__PURE__*/o.div.withConfig({displayName:"NetworkColumn",componentId:"sc-5bdbf842-0"})(["display:flex;flex-direction:row;align-items:center;gap:4px;"]);export{I as T};
@@ -0,0 +1 @@
1
+ import{jsxs as e,Fragment as r,jsx as t}from"react/jsx-runtime";import i from"@heroicons/react/24/outline/EnvelopeIcon";import{B as o}from"./Layouts-Bmf8DxNP.mjs";import{Mail as a}from"lucide-react";import{forwardRef as s,useState as m}from"react";import{u as n}from"./context-Cb5MFcME.mjs";import{a as l}from"./index-CI666IP9.mjs";import{u as d}from"./internal-context-Cvo1WmWN.mjs";import{u as c,a as p}from"./get-is-unified-wallet-DymQMSJy.mjs";import{a1 as u,V as h}from"./useActiveWallet-hrZcON-K.mjs";import{E as f,P as j}from"./Button-DJ-mtuuD.mjs";import{I as v,E as g}from"./EmailInputForm-B4hjCxRU.mjs";import{E as y}from"./ErrorMessage-Cx8GKGhL.mjs";import{S as w}from"./ScreenLayout-Dmrhdwtt.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"tinycolor2";import"uuid";import"jose";import"eventemitter3";import"./useWallets-BplPx0Pz.mjs";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"@coinbase/wallet-sdk";import"@privy-io/ethereum";import"mipd";import"react-device-detect";import"viem/utils";import"@privy-io/popup";import"./paths-3HW55qZg.mjs";import"@scure/base";import"./usePrivy-D3OPY7tm.mjs";import"./events-context-CI0iqAXA.mjs";import"@marsidev/react-turnstile";import"zustand";import"@headlessui/react";import"@walletconnect/ethereum-provider";import"@privy-io/urls";import"viem";import"./getPublicClient-IxRndou_.mjs";import"ofetch";import"js-cookie";import"./frame-BMa3kyjk.mjs";import"@privy-io/routes";import"x402/client";import"@privy-io/api-base";import"viem/accounts";import"./use-sign-with-user-signer-LJ6ROduD.mjs";import"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const k=/*#__PURE__*/s(((i,o)=>{let[s,v]=m(""),[g,w]=m(""),[k,S]=m(!1),{authenticated:A,user:x}=c(),{initUpdateEmail:C}=d(),{navigate:I,setModalData:M,currentScreen:P}=p(),{enabled:T,token:U}=l(),D=n(),L=u(s)&&(D.disablePlusEmails&&s.includes("+")?(g||w("Please enter a valid email address without a '+'."),!1):(g&&w(""),!0)),W=k||!L,q=()=>{!T||U||A?(async e=>{if(!x?.email)throw Error("User is required to have an email address to update it.");S(!0);try{await C({oldAddress:x.email.address,newAddress:s,captchaToken:e}),I("AwaitingPasswordlessCodeScreen")}catch(e){M({errorModalData:{error:e,previousScreen:P||"LandingScreen"}}),I("ErrorScreen")}S(!1)})(U):(M({captchaModalData:{callback:e=>{if(!x?.email)throw Error("User is required to have an email address to update it.");return C({oldAddress:x.email.address,newAddress:s,captchaToken:e})},userIntentRequired:!1,onSuccessNavigateTo:"AwaitingPasswordlessCodeScreen",onErrorNavigateTo:"ErrorScreen"}}),I("CaptchaScreen"))};/*#__PURE__*/return e(r,{children:[/*#__PURE__*/e(b,{children:[g&&/*#__PURE__*/t(y,{style:{marginTop:"0.25rem",textAlign:"left"},children:g}),/*#__PURE__*/e(E,{$error:!!g,children:[/*#__PURE__*/t(h,{children:/*#__PURE__*/t(a,{})}),/*#__PURE__*/t("input",{ref:o,id:"email-input",type:"email",placeholder:"your@email.com",onChange:e=>v(e.target.value),onKeyUp:e=>{"Enter"===e.key&&q()},value:s,autoComplete:"email"}),i.stacked?null:/*#__PURE__*/t(f,{isSubmitting:k,onClick:q,disabled:W,children:"Submit"})]})]}),i.stacked?/*#__PURE__*/t(j,{loadingText:null,loading:k,disabled:W,onClick:q,style:{width:"100%"},children:"Submit"}):null]})}));let b=v,E=g;const S=({title:e="Update your email",subtitle:r="Add the email address you'd like to use going forward. We'll send you a confirmation code"})=>/*#__PURE__*/t(w,{title:e,subtitle:r,icon:i,watermark:!0,children:/*#__PURE__*/t(o,{children:/*#__PURE__*/t(k,{stacked:!0})})}),A={component:()=>/*#__PURE__*/t(S,{})};export{A as UpdateEmailScreen,S as UpdateEmailScreenView,A as default};
@@ -0,0 +1 @@
1
+ import{jsx as e}from"react/jsx-runtime";import t from"@heroicons/react/24/outline/PhoneIcon";import{useState as o}from"react";import{C as r}from"./ConnectPhoneForm-CbuSfwAI.mjs";import{u as i}from"./internal-context-Cvo1WmWN.mjs";import{a as n,u as m}from"./get-is-unified-wallet-DymQMSJy.mjs";import{S as a}from"./ScreenLayout-Dmrhdwtt.mjs";import"styled-components";import"@privy-io/js-sdk-core";import"./context-Cb5MFcME.mjs";import"tinycolor2";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"./Button-DJ-mtuuD.mjs";import"./Chip-Bsgj4Yc-.mjs";import"./LoadingSkeleton-CHdaq3pb.mjs";import"ofetch";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const s=({title:i="Update your phone number",subtitle:n="Add the phone number you'd like to use going forward. We'll send you a confirmation code",onSubmit:m,isSubmitting:s=!1})=>{let[c,u]=o(null);/*#__PURE__*/return e(a,{title:i,subtitle:n,icon:t,primaryCta:{label:s?"Submitting":"Update",onClick:async()=>{c?.qualifiedPhoneNumber&&await m(c)},disabled:!c?.isValid||s},watermark:!0,children:/*#__PURE__*/e(r,{onChange:e=>{u(e)},onSubmit:async()=>{},noIncludeSubmitButton:!0,hideRecent:!0})})},c={component:()=>{let{currentScreen:t,data:r,navigate:a,setModalData:c}=n(),{user:u}=m(),{initUpdatePhone:p}=i(),[l,d]=o(!1);/*#__PURE__*/return e(s,{onSubmit:async e=>{d(!0);try{if(!u?.phone?.number)throw Error("User is required to have an phone number to update it.");await p(u?.phone?.number,e.qualifiedPhoneNumber),a("AwaitingPasswordlessCodeScreen")}catch(e){c({errorModalData:{error:e,previousScreen:r?.errorModalData?.previousScreen||t||"LinkPhoneScreen"}}),a("ErrorScreen")}finally{d(!1)}},isSubmitting:l})}};export{c as UpdatePhoneScreen,s as UpdatePhoneScreenView,c as default};
@@ -0,0 +1 @@
1
+ import{jsx as t}from"react/jsx-runtime";import{a as o}from"./get-is-unified-wallet-DymQMSJy.mjs";import{S as e}from"./ScreenLayout-Dmrhdwtt.mjs";import"viem";import"react";import"./context-Cb5MFcME.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Cvo1WmWN.mjs";import"ofetch";import"./Button-DJ-mtuuD.mjs";import"styled-components";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const i=({style:o,...e})=>/*#__PURE__*/t("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...o},...e,children:/*#__PURE__*/t("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})}),r=({title:o="Unable to sign in",subtitle:r="This is a test application that has reached its user limit. To allow more users, this app needs to be upgraded to production.",onGoBack:n})=>/*#__PURE__*/t(e,{title:o,subtitle:r,icon:i,iconVariant:"subtle",primaryCta:{label:"Go back",onClick:n},showBack:!0,onBack:n,watermark:!0}),n={component:()=>{let{navigate:e}=o();/*#__PURE__*/return t(r,{onGoBack:()=>{e("LandingScreen")}})}};export{n as UserLimitReachedScreen,r as UserLimitReachedScreenView,n as default};
@@ -0,0 +1 @@
1
+ import{styled as o}from"styled-components";import{L as e}from"./LoadingSkeleton-CHdaq3pb.mjs";const r=/*#__PURE__*/o.span.withConfig({displayName:"LabelSm",componentId:"sc-6c002d6-0"})(["color:var(--privy-color-foreground-3);font-size:0.875rem;font-weight:400;line-height:1.375rem;"]),a=/*#__PURE__*/o(r).withConfig({displayName:"LabelSmPrimary",componentId:"sc-6c002d6-1"})(["color:var(--privy-color-accent);"]),i=/*#__PURE__*/o.span.withConfig({displayName:"Value",componentId:"sc-72aa026-0"})(["color:var(--privy-color-foreground);font-size:0.875rem;font-weight:500;line-height:1.375rem;word-break:break-all;text-align:right;",""],e);export{r as L,i as V,a};
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as n}from"react/jsx-runtime";import{Wallet as t}from"lucide-react";import{U as l,V as a,Y as o,F as c,Q as i,n as r,T as s}from"./useActiveWallet-hrZcON-K.mjs";import{m as p,n as d,o as y}from"./index-CI666IP9.mjs";import{isMobile as w}from"react-device-detect";import{styled as m}from"styled-components";import{I as h}from"./InjectedWalletIcon-DLcYOGDj.mjs";import{C as f}from"./Chip-Bsgj4Yc-.mjs";import{u}from"./internal-context-Cvo1WmWN.mjs";import{a as T}from"./get-is-unified-wallet-DymQMSJy.mjs";const C=({onClick:c,text:i})=>/*#__PURE__*/e(l,{onClick:c,children:[/*#__PURE__*/n(a,{children:/*#__PURE__*/n(t,{})}),/*#__PURE__*/n(o,{children:i})]}),_=({provider:t,displayName:l,logo:a,connectOnly:o,connector:d})=>{let y,{navigate:m,setModalData:f}=T(),{connectWallet:C}=u(),_=c(),x=i(t),b="wallet_connect_v2"===d.connectorType?t:d.walletClientType,O=window.matchMedia("(display-mode: standalone)").matches,W=r({connectorType:d.connectorType,walletClientType:b});y=W&&W.chainTypes.includes(d.chainType)?()=>{W.isInstalled||"solana"===d.chainType&&"isInstalled"in d&&d.isInstalled?(C(d,b),m(o?"ConnectOnlyStatusScreen":"ConnectionStatusScreen")):w?(f({installWalletModalData:{walletConfig:W,chainType:d.chainType,connectOnly:o}}),m("WalletInterstitialScreen")):(f({installWalletModalData:{walletConfig:W,chainType:d.chainType,connectOnly:o}}),m("InstallWalletScreen"))}:"coinbase_wallet"!==d.connectorType||"eoaOnly"!==d.coinbaseWalletConfig.preference?.options||!w||O||s()?()=>{(!p(window.navigator.userAgent)||event?.isTrusted)&&(C(d,b),o?"wallet_connect_v2"===d.connectorType?(f((e=>({...e,externalConnectWallet:{...e?.externalConnectWallet,preSelectedWalletId:"wallet_connect_qr"}}))),m("ConnectOnlyLandingScreen")):m("ConnectOnlyStatusScreen"):m("ConnectionStatusScreen"))}:()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`};let S=l||x?.metadata?.shortName||x?.name||d.walletClientType;/*#__PURE__*/return e(g,{onClick:y,children:[/*#__PURE__*/n(h,{icon:a||x?.image_url?.md,name:S}),/*#__PURE__*/n("span",{children:S}),/*#__PURE__*/e($,{id:"chip-container",children:[_?.walletClientType===b&&_?.chainType===d.chainType?/*#__PURE__*/n(v,{color:"gray",children:"Recent"}):/*#__PURE__*/n("span",{id:"connect-text",children:"Connect"}),"solana"===d.chainType&&/*#__PURE__*/n(v,{color:"gray",children:"Solana"})]})]})};let g=/*#__PURE__*/m(l).withConfig({displayName:"ConnectWalletButton",componentId:"sc-5fe2f19b-0"})(["> span{color:var(--privy-color-foreground);}> #chip-container > #connect-text{font-weight:500;color:var(--privy-color-accent);opacity:0;transition:opacity 0.1s ease-out;}:hover > #chip-container > #connect-text{opacity:1;}@media (max-width:440px){> #chip-container > #connect-text{display:none;}}"]),v=/*#__PURE__*/m(f).withConfig({displayName:"StyledChip",componentId:"sc-5fe2f19b-1"})(["margin-left:auto;"]),$=/*#__PURE__*/m.div.withConfig({displayName:"ChipContainer",componentId:"sc-5fe2f19b-2"})(["display:flex;flex-wrap:wrap;gap:8px;margin-left:auto;"]);const x=["coinbase_wallet","base_account"];let b=["metamask","okx_wallet","rainbow","uniswap","bybit_wallet","ronin_wallet","haha_wallet","uniswap_extension","zerion","rabby_wallet","cryptocom","binance"];const O=["safe"],W=["phantom","backpack","solflare","universal_profile"],S=({walletList:e,walletChainType:t,connectors:l,connectOnly:a,ignore:o,walletConnectEnabled:c,forceWallet:i})=>{let r=[],s=[],p=[],w=l.filter((e=>"ethereum-only"===t?"ethereum"===e.chainType:"solana-only"!==t||"solana"===e.chainType)),m=w.find((e=>"wallet_connect_v2"===e.connectorType));for(let[l,h]of(i?[i.wallet]:e).entries()){if("detected_ethereum_wallets"===h)for(let[e,t]of w.filter((({chainType:e,connectorType:n,walletClientType:t})=>"solana"!==e&&("uniswap_wallet_extension"===t||"uniswap_extension"===t?!o.includes("uniswap"):"crypto.com_wallet_extension"===t||"crypto.com_onchain"===t?!o.includes("cryptocom"):"injected"===n&&!o.includes(t)))).entries()){let{walletClientType:o,walletBranding:c,chainType:i}=t;("unknown"===o?s:r).push(/*#__PURE__*/n(_,{connectOnly:a,provider:o,logo:c.icon,displayName:c.name,connector:t},`${l}-${h}-${o}-${i}-${e}`))}if("detected_solana_wallets"===h)for(let[e,c]of w.filter((({chainType:e,walletClientType:n})=>{if("solana"===e)return"ethereum-only"!==t&&!o.includes(n)})).entries()){let{walletClientType:t,walletBranding:o,chainType:i}=c;("unknown"===t?s:r).push(/*#__PURE__*/n(_,{connectOnly:a,provider:t,logo:o.icon,displayName:o.name,connector:c},`${l}-${h}-${t}-${i}-${e}`))}if(W.includes(h)){let e=w.find((e=>"injected"===e.connectorType&&e.walletClientType===h||e.connectorType===h));if(e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:e},`${l}-${h}`)),"solana-only"===t||"ethereum-and-solana"===t){let e=w.find((({chainType:e,walletClientType:n})=>"solana"===e&&n===h));e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:e},`${h}-solana`))}}else if(b.includes(h)){let e=w.find((e=>"uniswap"===h?"uniswap_wallet_extension"===e.walletClientType||"uniswap_extension"===e.walletClientType:"cryptocom"===h?"crypto.com_wallet_extension"===e.walletClientType||"crypto.com_onchain"===e.walletClientType:"injected"===e.connectorType&&e.walletClientType===h));if(c&&!e&&(e=m),e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:e,logo:"injected"===e.connectorType?e.walletBranding.icon:void 0,displayName:"injected"===e.connectorType?e.walletBranding.name:void 0},`${l}-${h}`)),"solana-only"===t||"ethereum-and-solana"===t){let e=w.find((({chainType:e,walletClientType:n})=>"solana"===e&&n===h));e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:e},`${h}-solana`))}}else if(x.includes(h)){let e=w.find((({connectorType:e})=>e===h));e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:e,displayName:"coinbase_wallet"===e.walletClientType?"Coinbase":"Base",logo:"coinbase_wallet"===e.walletClientType?d:y},`${l}-${h}`))}else if(O.includes(h))m&&p.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:m},`${l}-${h}`));else if("wallet_connect"===h)m&&p.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,connector:m,logo:m.walletBranding.icon,displayName:"WalletConnect"},`${l}-${h}`));else if(h===i?.wallet){let t="ethereum"===i.chainType&&e.includes("detected_ethereum_wallets"),o="solana"===i.chainType&&e.includes("detected_solana_wallets");if(t||o){let e=w.find((({walletClientType:e})=>e===h));e&&r.push(/*#__PURE__*/n(_,{connectOnly:a,provider:h,displayName:e.walletBranding?.name,logo:e.walletBranding?.icon,connector:e},`${l}-${h}`))}}}return[...s,...r,...p]};export{C as W,S as t};
@@ -0,0 +1 @@
1
+ import{jsxs as t,jsx as r}from"react/jsx-runtime";const e=({...e})=>/*#__PURE__*/t("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",...e,children:[/*#__PURE__*/r("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}),/*#__PURE__*/r("path",{d:"M3 9a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2"}),/*#__PURE__*/r("path",{d:"M3 11h3c.8 0 1.6.3 2.1.9l1.1.9c1.6 1.6 4.1 1.6 5.7 0l1.1-.9c.5-.5 1.3-.9 2.1-.9H21"})]});export{e as W};
@@ -0,0 +1 @@
1
+ import{jsxs as e,jsx as o,Fragment as t}from"react/jsx-runtime";import{Check as i,Copy as r}from"lucide-react";import{useState as n,useEffect as s}from"react";import{styled as a}from"styled-components";import{S as d}from"./Button-DJ-mtuuD.mjs";import{E as m}from"./ErrorMessage-Cx8GKGhL.mjs";import{L as l}from"./LabelXs-BOisBtqT.mjs";import{A as c}from"./Address-DtXA0OPS.mjs";import{B as p}from"./shared-CtYf3O54.mjs";let f=/*#__PURE__*/a(p).withConfig({displayName:"StyledBox",componentId:"sc-4010d8f3-0"})(["&&{padding:0.75rem;height:56px;}"]),h=/*#__PURE__*/a.div.withConfig({displayName:"WalletContent",componentId:"sc-4010d8f3-1"})(["display:flex;align-items:center;justify-content:space-between;width:100%;"]),g=/*#__PURE__*/a.div.withConfig({displayName:"AddressContainer",componentId:"sc-4010d8f3-2"})(["display:flex;flex-direction:column;gap:0;"]),y=/*#__PURE__*/a.div.withConfig({displayName:"BalanceText",componentId:"sc-4010d8f3-3"})(["font-size:12px;line-height:1rem;color:var(--privy-color-foreground-3);"]),C=/*#__PURE__*/a(l).withConfig({displayName:"TitleLabel",componentId:"sc-4010d8f3-4"})(["text-align:left;margin-bottom:0.5rem;"]),u=/*#__PURE__*/a(m).withConfig({displayName:"StyledErrorMessage",componentId:"sc-4010d8f3-5"})(["margin-top:0.25rem;"]),x=/*#__PURE__*/a(d).withConfig({displayName:"CopyButton",componentId:"sc-4010d8f3-6"})(["&&{gap:0.375rem;font-size:14px;}"]);const w=({errMsg:a,balance:d,address:m,className:l,title:p,showCopyButton:w=!1})=>{let[v,N]=n(!1);return s((()=>{if(v){let e=setTimeout((()=>N(!1)),3e3);return()=>clearTimeout(e)}}),[v]),/*#__PURE__*/e("div",{children:[p&&/*#__PURE__*/o(C,{children:p}),/*#__PURE__*/o(f,{className:l,$state:a?"error":void 0,children:/*#__PURE__*/e(h,{children:[/*#__PURE__*/e(g,{children:[/*#__PURE__*/o(c,{address:m,showCopyIcon:!1}),void 0!==d&&/*#__PURE__*/o(y,{children:d})]}),w&&/*#__PURE__*/o(x,{onClick:function(e){e.stopPropagation(),navigator.clipboard.writeText(m).then((()=>N(!0))).catch(console.error)},size:"sm",children:/*#__PURE__*/e(t,v?{children:["Copied",/*#__PURE__*/o(i,{size:14})]}:{children:["Copy",/*#__PURE__*/o(r,{size:14})]})})]})}),a&&/*#__PURE__*/o(u,{children:a})]})};export{w as W};
@@ -0,0 +1 @@
1
+ import{jsx as t}from"react/jsx-runtime";import{useState as e}from"react";import{u as o,a as i}from"./get-is-unified-wallet-DymQMSJy.mjs";import{S as n}from"./ScreenLayout-Dmrhdwtt.mjs";import"viem";import"./context-Cb5MFcME.mjs";import"@privy-io/js-sdk-core";import"tinycolor2";import"./internal-context-Cvo1WmWN.mjs";import"ofetch";import"./Button-DJ-mtuuD.mjs";import"styled-components";import"./useActiveWallet-hrZcON-K.mjs";import"zustand";import"react-device-detect";import"./prepareFundingModalData-BUyu5Vhr.mjs";import"eventemitter3";import"./events-context-CI0iqAXA.mjs";import"viem/utils";import"./getPublicClient-IxRndou_.mjs";import"./useWallets-BplPx0Pz.mjs";import"./Screen-dwi2CitY.mjs";import"./ModalHeader-D7WajfD8.mjs";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"./index-CJMgUOnw.mjs";const r=({title:e,subtitle:o,buttonText:i,buttonHref:r,isLoading:l=!1,helpText:a,onButtonClick:m})=>/*#__PURE__*/t(n,{title:e,subtitle:o,primaryCta:{label:i,onClick:()=>{r&&window.open(r,"_self"),m?.()},disabled:l},helpText:a,watermark:!0}),l={component:()=>{let{ready:n}=o(),{data:l}=i(),[a,m]=e(!1);if(!l?.installWalletModalData)throw Error("Wallet data is missing");let{walletConfig:s,connectOnly:c,chainType:p}=l.installWalletModalData,u=s.getMobileRedirect({useUniversalLink:!a,isSolana:"solana"===p,connectOnly:c}),d=s.name.replace(/ wallet/gi,""),h={title:`Redirecting to ${d} Mobile Wallet`,description:`We'll take you to the ${d} Mobile Wallet app to continue your login experience.`,footnote:""};return n&&(h.description=`For the best experience, we'll automatically log you into the ${d} Mobile Wallet in-app browser.`,h.footnote="You can always return here to login via other methods."),a&&(h.title="Still here?",h.description=`You may need to install the ${s.name} mobile app.`,h.footnote=`Once you're done, you can connect with ${s.name} wallet to complete the login.`),/*#__PURE__*/t(r,{title:h.title,subtitle:h.description,buttonText:a?"Go to App Store":"Continue",buttonHref:u,isLoading:n&&!u,helpText:h.footnote||void 0,onButtonClick:()=>{setTimeout((()=>m(!0)),1e3)}})}};export{l as WalletInterstitialScreen,r as WalletInterstitialScreenView,l as default};
@@ -0,0 +1,3 @@
1
+ import{jsx as e,Fragment as t,jsxs as i}from"react/jsx-runtime";import{styled as n}from"styled-components";import{formatUnits as o}from"viem";import{s as r,a,g as s,b as c}from"./ethers-CpMSCMOg.mjs";import{g as l}from"./getFormattedUsdFromLamports-B6EqSEho.mjs";import{g as d}from"./transaction-CnfuREWo.mjs";import{D as m}from"./useActiveWallet-hrZcON-K.mjs";const p=({weiQuantities:t,tokenPrice:i,tokenSymbol:n})=>{let o=r(t),c=i?a(o,i):void 0,l=s(o,n);/*#__PURE__*/return e(y,{children:c||l})},h=({weiQuantities:n,tokenPrice:o,tokenSymbol:c})=>{let l=r(n),d=o?a(l,o):void 0,m=s(l,c);/*#__PURE__*/return e(y,{children:d?/*#__PURE__*/i(t,{children:[/*#__PURE__*/e(g,{children:"USD"}),"<$0.01"===d?
2
+ /*#__PURE__*/i(x,{children:[/*#__PURE__*/e(u,{children:"<"}),"$0.01"]}):d]}):m})},f=({quantities:n,tokenPrice:r,tokenSymbol:a="SOL",tokenDecimals:s=9})=>{let c=n.reduce(((e,t)=>e+t),0n),m=r&&"SOL"===a&&9===s?l(c,r):void 0,p="SOL"===a&&9===s?d(c):`${o(c,s)} ${a}`;/*#__PURE__*/return e(y,{children:m?/*#__PURE__*/e(t,{children:"<$0.01"===m?
3
+ /*#__PURE__*/i(x,{children:[/*#__PURE__*/e(u,{children:"<"}),"$0.01"]}):m}):p})};let y=/*#__PURE__*/n.span.withConfig({displayName:"StyledPriceDisplay",componentId:"sc-3cd56c8a-0"})(["font-size:14px;line-height:140%;display:flex;gap:4px;align-items:center;"]),g=/*#__PURE__*/n.span.withConfig({displayName:"StyledPriceUnit",componentId:"sc-3cd56c8a-1"})(["font-size:12px;line-height:12px;color:var(--privy-color-foreground-3);"]),u=/*#__PURE__*/n.span.withConfig({displayName:"TinyLessThan",componentId:"sc-3cd56c8a-2"})(["font-size:10px;"]),x=/*#__PURE__*/n.span.withConfig({displayName:"FlexCenter",componentId:"sc-3cd56c8a-3"})(["display:flex;align-items:center;"]);function S(e,t){return`https://explorer.solana.com/account/${e}?chain=${t}`}const w=t=>/*#__PURE__*/e(k,{href:"ethereum"===t.chainType?c(t.chainId,t.walletAddress):S(t.walletAddress,t.chainId),target:"_blank",children:m(t.walletAddress)});let k=/*#__PURE__*/n.a.withConfig({displayName:"StyledLink",componentId:"sc-dd6c0f9f-0"})(["&:hover{text-decoration:underline;}"]);export{p as H,h as P,f as S,w as W};
@@ -0,0 +1 @@
1
+ import{jsxs as r,jsx as e}from"react/jsx-runtime";import o from"@heroicons/react/24/outline/ExclamationTriangleIcon";import{styled as i}from"styled-components";const t=({children:i,theme:t})=>/*#__PURE__*/r(n,{$theme:t,children:[/*#__PURE__*/e(o,{width:"20px",height:"20px",color:"var(--privy-color-icon-warning)",strokeWidth:2,style:{flexShrink:0}}),/*#__PURE__*/e(a,{$theme:t,children:i})]});let n=/*#__PURE__*/i.div.withConfig({displayName:"Container",componentId:"sc-a77c2854-0"})(["display:flex;gap:0.75rem;background-color:var(--privy-color-warn-bg);align-items:flex-start;padding:1rem;border-radius:0.75rem;"]),a=/*#__PURE__*/i.div.withConfig({displayName:"Content",componentId:"sc-a77c2854-1"})(["color:",";font-size:1rem;font-weight:400;line-height:1.5;flex:1;text-align:left;"],(r=>"dark"===r.$theme?"var(--privy-color-foreground-2)":"var(--privy-color-foreground)"));export{t as W};
@@ -1 +1 @@
1
- import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{getBatchTransactionObject as t}from"@abstract-foundation/agw-client/actions";import{hexToNumber as r,createWalletClient as o,custom as n,http as a}from"viem";import{toAccount as i}from"viem/accounts";import{abstractTestnet as s,zksync as c}from"viem/chains";import{ab as l,$ as p,ac as d,b5 as m,q as u,H as h,bE as y,bw as g,bM as I}from"./EmbeddedWalletConnectingScreen-D50stmJi.mjs";import{k as f}from"./events-context-ClaboIDc.mjs";import{aa as v}from"./internal-context-eGSwROSk.mjs";import{S as w}from"./SignRequestScreen-D9o7VhNz.mjs";import{g as C}from"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import{c as T}from"./smart-wallets-BXT3GZwg.mjs";import"react/jsx-runtime";import"lucide-react";import"react";import"fast-password-entropy";import"secure-password-utilities";import"secure-password-utilities/wordlists";import"@heroicons/react/24/outline/UserCircleIcon";import"styled-components";import"@heroicons/react/24/outline/ArrowLeftIcon";import"@heroicons/react/24/outline/ArrowRightIcon";import"@heroicons/react/24/outline/QuestionMarkCircleIcon";import"@heroicons/react/24/outline/XMarkIcon";import"@heroicons/react/20/solid/CheckIcon";import"@heroicons/react/24/outline/EnvelopeIcon";import"@heroicons/react/24/outline/PhoneIcon";import"react-device-detect";import"@heroicons/react/24/outline/ExclamationTriangleIcon";import"@heroicons/react/24/outline/WalletIcon";import"@heroicons/react/24/outline/ExclamationCircleIcon";import"@heroicons/react/24/outline/Square2StackIcon";import"@privy-io/js-sdk-core";import"zustand";import"@heroicons/react/24/outline";import"@tanstack/react-virtual";import"@heroicons/react/24/outline/CheckIcon";import"qrcode";import"viem/utils";import"eventemitter3";import"@scure/base";import"@walletconnect/ethereum-provider";import"@heroicons/react/24/outline/CreditCardIcon";import"@heroicons/react/24/outline/QrCodeIcon";import"@heroicons/react/24/solid/ArrowsRightLeftIcon";import"@heroicons/react/24/outline/InformationCircleIcon";import"@heroicons/react/24/outline/ClipboardDocumentCheckIcon";import"@heroicons/react/24/outline/ClipboardDocumentIcon";import"@heroicons/react/24/outline/ChevronDownIcon";import"@privy-io/ethereum";import"@heroicons/react/24/outline/CheckCircleIcon";import"@heroicons/react/24/outline/GlobeAltIcon";import"@headlessui/react";import"@privy-io/popup";import"@heroicons/react/24/solid/CheckCircleIcon";import"ofetch";import"@heroicons/react/24/outline/FingerPrintIcon";import"@heroicons/react/24/outline/LockClosedIcon";import"@heroicons/react/24/outline/PencilSquareIcon";import"jose";import"@heroicons/react/24/outline/ArrowPathIcon";import"@heroicons/react/24/outline/EyeIcon";import"@heroicons/react/24/outline/EyeSlashIcon";import"@heroicons/react/24/outline/KeyIcon";import"@heroicons/react/24/outline/ArrowDownTrayIcon";import"@heroicons/react/24/outline/DocumentDuplicateIcon";import"@heroicons/react/24/solid/XCircleIcon";import"@heroicons/react/24/outline/ShieldCheckIcon";import"@privy-io/urls";import"tinycolor2";import"permissionless";import"permissionless/accounts";import"permissionless/clients/pimlico";import"viem/account-abstraction";function S(){let{user:S}=l(),{hideWalletUIs:b,openPrivyModal:P,chains:W,appId:A,rpcConfig:M,client:F}=v(),q=f(),{wallets:x}=p(),{setModalData:E}=d(),_=m(S),k=!!_&&u(_),D=async(t=s.id)=>{let l=C(x);if(!l)throw Error("No connected wallet found");let p="string"==typeof t?r(t):t;if(![s.id,2741,c.id].includes(p))throw Error("Error, only Abstract and ZKSync Era chains are supported");let d=W.find((e=>e.id===p));if(!d)throw Error("Chain not configured");await l.switchChain(d.id);let m=await l.getEthereumProvider(),u=o({account:l.address,transport:n(m)}),h=i({address:l.address,signMessage:u.signMessage,signTransaction:u.signTransaction,signTypedData:u.signTypedData});return await e({chain:d,transport:a(I(d,M,A)),publicTransport:a(I(d,M,A)),signer:h})};return{signMessage:async({message:e},t)=>{let r=await D(t);return new Promise((async(t,o)=>{let{entropyId:n,entropyIdVerifier:a}=h(S);b.current=!0,E({connectWallet:{recoveryMethod:_.recoveryMethod,connectingWalletAddress:_.address,isUnifiedWallet:k,entropyId:n,entropyIdVerifier:a,onCompleteNavigateTo:w,onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>r.signMessage({message:e}),onSuccess:e=>t(e),onFailure:o,uiOptions:{isCancellable:!0}}}),P(g)})).finally((()=>{b.current=!1}))},signTypedData:async(e,t)=>{let r=await D(t);return new Promise((async(t,o)=>{b.current=!0;let{entropyId:n,entropyIdVerifier:a}=h(S);E({connectWallet:{recoveryMethod:_.recoveryMethod,connectingWalletAddress:_.address,isUnifiedWallet:k,entropyId:n,entropyIdVerifier:a,onCompleteNavigateTo:w,onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>r.signTypedData(e),onSuccess:e=>t(e),onFailure:o,uiOptions:{isCancellable:!0}}}),P(g)})).finally((()=>{b.current=!1}))},sendTransaction:async e=>{let r=await D(e.chainId),o=[],n="calls"in e&&void 0!==e.calls;return o=n?[...e.calls]:[e],new Promise((async(a,i)=>{b.current=!0;let{entropyId:s,entropyIdVerifier:c}=h(S);E({connectWallet:{recoveryMethod:_.recoveryMethod,connectingWalletAddress:_.address,isUnifiedWallet:k,entropyId:s,entropyIdVerifier:c,onCompleteNavigateTo:y,onFailure:()=>{}},sendTransaction:{transactionRequests:T({calls:o,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:s,entropyIdVerifier:c,transactingWalletAddress:r.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let o=n?t(r.account.address,e):e;return await r.prepareAbstractTransactionRequest(o)},scanTransaction:async()=>{if(!F)throw Error("Privy client not found");let o=n?t(r.account.address,e):e,a=await r.prepareAbstractTransactionRequest(o);return await F.scanTransaction({metadata:{domain:q.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:a.from,to:a.to,value:a.value?.toString(),gas:a.gas?.toString(),gasPrice:a.gasPrice?.toString(),nonce:a.nonce?.toString(),data:a.data,eip_712_meta:{paymaster_params:{paymaster:a.paymaster,paymaster_input:a.paymasterInput}}}]}})},signOnly:!1,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:()=>n?r.sendTransactionBatch(e):r.sendTransaction(e),onSuccess:e=>a(e.hash),onFailure:i,uiOptions:{isCancellable:!0}}}),P(g)})).finally((()=>{b.current=!1}))},signTransaction:async e=>{let r=await D(e.chainId),o=[],n="calls"in e&&void 0!==e.calls;return o=n?[...e.calls]:[e],new Promise((async(a,i)=>{b.current=!0;let{entropyId:s,entropyIdVerifier:c}=h(S);E({connectWallet:{recoveryMethod:_.recoveryMethod,connectingWalletAddress:_.address,isUnifiedWallet:k,entropyId:s,entropyIdVerifier:c,onCompleteNavigateTo:y,onFailure:()=>{}},sendTransaction:{transactionRequests:T({calls:o,chain:r.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:s,entropyIdVerifier:c,transactingWalletAddress:r.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let o=n?t(r.account.address,e):e;return await r.prepareAbstractTransactionRequest(o)},scanTransaction:async()=>{if(!F)throw Error("Privy client not found");let o=n?t(r.account.address,e):e,a=await r.prepareAbstractTransactionRequest(o);return await F.scanTransaction({metadata:{domain:q.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:a.from,to:a.to,value:a.value?.toString(),gas:a.gas?.toString(),gasPrice:a.gasPrice?.toString(),nonce:a.nonce?.toString(),data:a.data,eip_712_meta:{paymaster_params:{paymaster:a.paymaster,paymaster_input:a.paymasterInput}}}]}})},signOnly:!0,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:async()=>{let o=n?t(r.account.address,e):e,a=await r.prepareAbstractTransactionRequest(o);return r.signTransaction(a)},onSuccess:e=>a(e.hash),onFailure:i,uiOptions:{isCancellable:!0}}}),P(g)})).finally((()=>{b.current=!1}))}}}export{S as useAbstractSmartWallets};
1
+ import{createAbstractClient as e}from"@abstract-foundation/agw-client";import{getBatchTransactionObject as a}from"@abstract-foundation/agw-client/actions";import{hexToNumber as n,createWalletClient as t,custom as r,http as s}from"viem";import{toAccount as i}from"viem/accounts";import{abstractTestnet as o,zksync as c}from"viem/chains";import{u as d,a as l,b as m,d as p}from"./get-is-unified-wallet-DymQMSJy.mjs";import{u}from"./context-Cb5MFcME.mjs";import{u as g}from"./internal-context-Cvo1WmWN.mjs";import{u as y,g as f}from"./useWallets-BplPx0Pz.mjs";import{a as h}from"./getPublicClient-IxRndou_.mjs";import{g as v}from"./getEmbeddedConnectedWallet-CM6cDQCS.mjs";import{c as I}from"./smart-wallets-Cbhn7qlU.mjs";import"react/jsx-runtime";import"react";import"@privy-io/js-sdk-core";import"tinycolor2";import"ofetch";import"permissionless";import"permissionless/accounts";import"permissionless/clients/pimlico";import"viem/account-abstraction";function T(){let{user:T}=d(),{hideWalletUIs:S,openPrivyModal:w,chains:P,appId:W,rpcConfig:b,client:C}=g(),F=u(),{wallets:M}=y(),{setModalData:_}=l(),x=m(T),A=!!x&&p(x),q=async(a=o.id)=>{let d=v(M);if(!d)throw Error("No connected wallet found");let l="string"==typeof a?n(a):a;if(![o.id,2741,c.id].includes(l))throw Error("Error, only Abstract and ZKSync Era chains are supported");let m=P.find((e=>e.id===l));if(!m)throw Error("Chain not configured");await d.switchChain(m.id);let p=await d.getEthereumProvider(),u=t({account:d.address,transport:r(p)}),g=i({address:d.address,signMessage:u.signMessage,signTransaction:u.signTransaction,signTypedData:u.signTypedData});return await e({chain:m,transport:s(h(m,b,W)),publicTransport:s(h(m,b,W)),signer:g})};return{signMessage:async({message:e},a)=>{let n=await q(a);return new Promise((async(a,t)=>{let{entropyId:r,entropyIdVerifier:s}=f(T);S.current=!0,_({connectWallet:{recoveryMethod:x.recoveryMethod,connectingWalletAddress:x.address,isUnifiedWallet:A,entropyId:r,entropyIdVerifier:s,onCompleteNavigateTo:"SignRequestScreen",onFailure:()=>{}},signMessage:{method:"personal_sign",data:e,confirmAndSign:()=>n.signMessage({message:e}),onSuccess:e=>a(e),onFailure:t,uiOptions:{isCancellable:!0}}}),w("EmbeddedWalletConnectingScreen")})).finally((()=>{S.current=!1}))},signTypedData:async(e,a)=>{let n=await q(a);return new Promise((async(a,t)=>{S.current=!0;let{entropyId:r,entropyIdVerifier:s}=f(T);_({connectWallet:{recoveryMethod:x.recoveryMethod,connectingWalletAddress:x.address,isUnifiedWallet:A,entropyId:r,entropyIdVerifier:s,onCompleteNavigateTo:"SignRequestScreen",onFailure:()=>{}},signMessage:{method:"eth_signTypedData_v4",data:e,confirmAndSign:()=>n.signTypedData(e),onSuccess:e=>a(e),onFailure:t,uiOptions:{isCancellable:!0}}}),w("EmbeddedWalletConnectingScreen")})).finally((()=>{S.current=!1}))},sendTransaction:async e=>{let n=await q(e.chainId),t=[],r="calls"in e&&void 0!==e.calls;return t=r?[...e.calls]:[e],new Promise((async(s,i)=>{S.current=!0;let{entropyId:o,entropyIdVerifier:c}=f(T);_({connectWallet:{recoveryMethod:x.recoveryMethod,connectingWalletAddress:x.address,isUnifiedWallet:A,entropyId:o,entropyIdVerifier:c,onCompleteNavigateTo:"SendTransactionScreen",onFailure:()=>{}},sendTransaction:{transactionRequests:I({calls:t,chain:n.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:o,entropyIdVerifier:c,transactingWalletAddress:n.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let t=r?a(n.account.address,e):e;return await n.prepareAbstractTransactionRequest(t)},scanTransaction:async()=>{if(!C)throw Error("Privy client not found");let t=r?a(n.account.address,e):e,s=await n.prepareAbstractTransactionRequest(t);return await C.scanTransaction({metadata:{domain:F.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:s.from,to:s.to,value:s.value?.toString(),gas:s.gas?.toString(),gasPrice:s.gasPrice?.toString(),nonce:s.nonce?.toString(),data:s.data,eip_712_meta:{paymaster_params:{paymaster:s.paymaster,paymaster_input:s.paymasterInput}}}]}})},signOnly:!1,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:()=>r?n.sendTransactionBatch(e):n.sendTransaction(e),onSuccess:e=>s(e.hash),onFailure:i,uiOptions:{isCancellable:!0}}}),w("EmbeddedWalletConnectingScreen")})).finally((()=>{S.current=!1}))},signTransaction:async e=>{let n=await q(e.chainId),t=[],r="calls"in e&&void 0!==e.calls;return t=r?[...e.calls]:[e],new Promise((async(s,i)=>{S.current=!0;let{entropyId:o,entropyIdVerifier:c}=f(T);_({connectWallet:{recoveryMethod:x.recoveryMethod,connectingWalletAddress:x.address,isUnifiedWallet:A,entropyId:o,entropyIdVerifier:c,onCompleteNavigateTo:"SendTransactionScreen",onFailure:()=>{}},sendTransaction:{transactionRequests:I({calls:t,chain:n.chain,maxPriorityFeePerGas:e.maxPriorityFeePerGas,maxFeePerGas:e.maxFeePerGas,nonce:e.nonce?BigInt(e.nonce):void 0}),entropyId:o,entropyIdVerifier:c,transactingWalletAddress:n.account.address,transactingWalletIndex:void 0,prepareTransactionRequest:async()=>{let t=r?a(n.account.address,e):e;return await n.prepareAbstractTransactionRequest(t)},scanTransaction:async()=>{if(!C)throw Error("Privy client not found");let t=r?a(n.account.address,e):e,s=await n.prepareAbstractTransactionRequest(t);return await C.scanTransaction({metadata:{domain:F.embeddedWallets.transactionScanning.domain},chain_id:e.chainId.toString(),request:{method:"eth_sendTransaction",params:[{from:s.from,to:s.to,value:s.value?.toString(),gas:s.gas?.toString(),gasPrice:s.gasPrice?.toString(),nonce:s.nonce?.toString(),data:s.data,eip_712_meta:{paymaster_params:{paymaster:s.paymaster,paymaster_input:s.paymasterInput}}}]}})},signOnly:!0,getIsSponsored:async()=>void 0!==e.paymaster&&void 0!==e.paymasterInput,onConfirm:async()=>{let t=r?a(n.account.address,e):e,s=await n.prepareAbstractTransactionRequest(t);return n.signTransaction(s)},onSuccess:e=>s(e.hash),onFailure:i,uiOptions:{isCancellable:!0}}}),w("EmbeddedWalletConnectingScreen")})).finally((()=>{S.current=!1}))}}}export{T as useAbstractSmartWallets};
@@ -0,0 +1 @@
1
+ const t="sdk_fiat_on_ramp_completed_with_status";export{t as O};
@@ -0,0 +1 @@
1
+ function e(e){return e.charAt(0).toUpperCase()+e.slice(1)}export{e};
@@ -1 +1 @@
1
- import{jsx as e}from"react/jsx-runtime";import{useState as t,useMemo as n,useEffect as a,createContext as o,useContext as r}from"react";import{dedupeSupportedChains as l,DEFAULT_SUPPORTED_CHAINS as i,mainnet as c}from"@privy-io/js-sdk-core";import s from"tinycolor2";const d="https://auth.privy.io",u=2e4,g=1400,h=2500,f=4e3,p="3.7.0",_="privy:token",b="privy-token",m="privy:refresh_token",v="privy-refresh-token",w="privy:pat",k="privy:id_token",F="privy-id-token",C="privy-session",y="privy:caid",E=e=>`privy:guest:${e}`,A=e=>`privy:cross-app:${e}`,M="privy:state_code",x="privy:code_verifier",W="privy:headless_oauth",B="privy:oauth_disable_signup",S=e=>`privy:wallet:${e}`,D="privy:connections",H=12e4,L=1,O="0x1",I=3e4,U="https://api.moonpay.com/v1",P="https://api.moonpay.com/v1",q="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",T="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",j="deprecated",R={appearance:{landingHeader:"Log in or sign up",theme:"light",walletList:["detected_ethereum_wallets","detected_solana_wallets","metamask","coinbase_wallet","rainbow","base_account","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let $=new Set(["coinbase_wallet","base_account","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","ronin_wallet","haha_wallet","wallet_connect","wallet_connect_qr","wallet_connect_qr_solana","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe","solflare","backpack","binance","binanceus","bitget_wallet"]),z=e=>$.has(e),N=(e,t,n)=>n.indexOf(e)===t;const Y=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(z).filter(N):e?e.filter(z).filter(N):R.appearance.walletList;function G(e,t){let n=Math.max(0,Math.min(1,e.toHsl().l+t));return s({...e.toHsl(),l:n})}function J(e,t){let n=e.getLuminance(),a=t.getLuminance();return(Math.max(n,a)+.05)/(Math.min(n,a)+.05)}function K(e,t){if(!e){let e=t?X:Z;return{accent:s(e.background.interactive),accentLight:s(e.background.interactive),accentHover:s(e.background["interactive-hover"]),accentDark:s(e.background["interactive-clicked"]),accentDarkest:s(e.background["interactive-disabled"])}}let n=s(e);return{accent:n,accentLight:G(n,.15),accentHover:G(n,.3),accentDark:G(n,-.06),accentDarkest:G(n,-.6)}}function V({backgroundTheme:e,accentHex:t}){let n,a;"light"===e?n=!1:"dark"===e?n=!0:(n=.5>=s(e).getLuminance(),a=s(e).toHslString());let o=n?"dark":"light",r=n?X:Z,{accent:l,accentLight:i,accentHover:c,accentDark:d,accentDarkest:u}=K(t,n),g=function(e){let t=s(Z.text.default),n=s(X.text.default),a=J(e,t),o=J(e,n),r=e.toHsl();return r.h>=220&&r.h<=300&&o>=3?X.text.default:a>o?Z.text.default:X.text.default}(l),h=s(g),f=J(l,s(r.background.default))>=3;return{colorScheme:o,background:a||r.background.default,background2:r.background.elevated,background3:r.background.interactive,foreground:r.text.default,foreground2:r.text.muted,foreground3:r.text.placeholder,foreground4:r.border.default,accent:l.toHslString(),accentLight:i.toHslString(),accentHover:c.toHslString(),accentDark:d.toHslString(),accentDarkest:u.toHslString(),foregroundAccent:h.toHslString(),success:r.background.success,successDark:r.text.success,successLight:r.background.success,error:r.text.error,errorLight:r.background.error,warn:r.background.warning,warnLight:r.background.warning,warningDark:r.text.warning,errorDark:r.text.error,successBg:r.background.success,errorBg:r.background.error,errorBgHover:r.background["error-hover"],warnBg:r.background.warning,infoBg:r.background.info,infoBgHover:r.background["info-hover"],borderDefault:r.border.default,borderHover:r.border["default-hover"],borderFocus:r.border.focused,borderError:r.border.error,borderSuccess:r.border.success,borderWarning:r.border.warning,borderInfo:r.border.info,borderInteractive:r.border.interactive,borderInteractiveHover:r.border["interactive-hover"],backgroundHover:r.background["default-hover"],backgroundClicked:r.background["default-clicked"],backgroundDisabled:r.background["default-disabled"],backgroundInteractive:r.background.interactive,backgroundInteractiveHover:r.background["interactive-hover"],backgroundInteractiveClicked:r.background["interactive-clicked"],backgroundInteractiveDisabled:r.background["interactive-disabled"],foregroundHover:r.text.default,foregroundClicked:r.text.default,foregroundDisabled:r.text["default-disabled"],foregroundInteractive:r.text.interactive,foregroundInteractiveHover:r.text["interactive-hover"],accentHasGoodContrast:f?"1":"0",linkNavigationColor:f?l.toHslString():r.text.default,linkNavigationDecoration:f?"none":"underline",iconDefault:r.icon.default,iconMuted:r.icon.muted,iconSubtle:r.icon.subtle,iconInverse:r.icon.inverse,iconSuccess:r.icon.success,iconWarning:r.icon.warning,iconError:r.icon.error,iconInteractive:r.icon.interactive,iconDefaultHover:r.icon["default-hover"],iconMutedHover:r.icon["muted-hover"],iconSubtleHover:r.icon["subtle-hover"],iconDefaultClicked:r.icon["default-clicked"],iconMutedClicked:r.icon["muted-clicked"],iconSubtleClicked:r.icon["subtle-clicked"],iconDefaultDisabled:r.icon["default-disabled"],iconMutedDisabled:r.icon["muted-disabled"],iconSubtleDisabled:r.icon["subtle-disabled"],iconErrorHover:r.icon["error-hover"],iconInteractiveHover:r.icon["interactive-hover"],iconErrorClicked:r.icon["error-clicked"],iconInteractiveClicked:r.icon["interactive-clicked"],iconMutedDisabledAlt:r.icon["muted-disabled"],iconSubtleDisabledAlt:r.icon["subtle-disabled"]}}const X={background:{default:"#020713",elevated:"#1A2230","default-hover":"#101724","default-clicked":"#1A2230","default-disabled":"#020713",success:"#0E3E2D",warning:"#373827",error:"#2E0C18",interactive:"#8B86FF","error-hover":"#441821","interactive-hover":"#7B73E5","interactive-clicked":"#6560CC","interactive-disabled":"#141824",info:"#1F2937","info-hover":"#141824"},icon:{default:"#F8F8F8",muted:"#9BA2AE",subtle:"#7B8491",inverse:"#020713",success:"#88E3B5",warning:"#FDF27B",error:"#EF4444",interactive:"#88B6FF","default-hover":"#F8F8F8","muted-hover":"#AEB3BD","subtle-hover":"#8B939E","default-clicked":"#F8F8F8","muted-clicked":"#9097A5","subtle-clicked":"#78818E","default-disabled":"#404452","muted-disabled":"#404452","subtle-disabled":"#404452","error-hover":"#F05555","interactive-hover":"#7B73E5","error-clicked":"#EF4444","interactive-clicked":"#6560CC"},text:{default:"#F8F8F8",muted:"#9BA2AE",placeholder:"#7B8491",success:"#ACEECB",warning:"#FEF9A0",error:"#FCA5A5",interactive:"#A29EFF","default-disabled":"#404452","interactive-hover":"#8C88E5"},border:{default:"#1F2937",interactive:"#88B0FF",focused:"#F8F8FC",info:"#5B83D3",success:"#317056",warning:"#FBBF24",error:"#F87171","default-hover":"#34304A","interactive-hover":"#88B0FF"}},Z={background:{default:"#FFFFFF",elevated:"#F1F2F9","default-hover":"#F8F9FC","default-clicked":"#F1F2F9","default-disabled":"#FFFFFF",success:"#DCFCE7",warning:"#FEF3C7",error:"#FEE2E2",interactive:"#5B4FFF","error-hover":"#FECACA","interactive-hover":"#4F46E5","interactive-clicked":"#4338CA","interactive-disabled":"#F1F2F9",info:"#E0E7FF","info-hover":"#EEF2FF"},icon:{default:"#110F2A",muted:"#64668B",subtle:"#9498B8",inverse:"#FFFFFF",success:"#33B287",warning:"#F59E0B",error:"#EF4444",interactive:"#564FFF","default-hover":"#1D1B35","muted-hover":"#64668B","subtle-hover":"#888AAE","default-clicked":"#060C23","muted-clicked":"#64668B","subtle-clicked":"#788804","default-disabled":"#CBCDE1","muted-disabled":"#CBCDE1","subtle-disabled":"#CBCDE1","error-hover":"#F06060","interactive-hover":"#4F46E5","error-clicked":"#DC3838","interactive-clicked":"#2BA482"},text:{default:"#040217",muted:"#64668B",placeholder:"#9498B8",success:"#135638",warning:"#906218",error:"#991B1B",interactive:"#5B4FFF","default-disabled":"#CBCDE1","interactive-hover":"#5B4FFF"},border:{default:"#E2E3F0",interactive:"#5B4FFF",focused:"#949DF9",info:"#F1F2F9",success:"#87D7B7",warning:"#FACD63",error:"#F69393","default-hover":"#E2E3F0","interactive-hover":"#5B4FFF"}};function Q(e,t,n,a,o){let r,s,d,u,g,h,f,p,_,b,m,v,w,k,F,C,y,E=n?console.warn:()=>{};t?.loginMethods?(r=t.loginMethods.includes("email"),s=t.loginMethods.includes("sms"),u=t.loginMethods.includes("wallet"),g=t.loginMethods.includes("google"),h=t.loginMethods.includes("twitter"),f=t.loginMethods.includes("discord"),m=t.loginMethods.includes("spotify"),v=t.loginMethods.includes("instagram"),p=t.loginMethods.includes("tiktok"),_=t.loginMethods.includes("line"),b=t.loginMethods.includes("twitch"),k=t.loginMethods.includes("github"),w=t.loginMethods.includes("linkedin"),F=t.loginMethods.includes("apple"),C=t.loginMethods.includes("farcaster"),y=t.loginMethods.includes("telegram"),d=t.loginMethods.includes("passkey")):(r=e.email_auth,s=e.sms_auth,u=e.wallet_auth||e.solana_wallet_auth,g=e.google_oauth,h=e.twitter_oauth,f=e.discord_oauth,k=e.github_oauth,m=e.spotify_oauth,v=e.instagram_oauth,p=e.tiktok_oauth,_=e.line_oauth,b=e.twitch_oauth,w=e.linkedin_oauth,F=e.apple_oauth,C=e.farcaster_auth,y=e.telegram_auth,d=e.passkey_auth),e.passkey_auth&&(d=!0),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential&&(d=!1);let A=[r,s].filter(Boolean),M=[g,h,f,k,m,v,p,_,w,F,C,y].filter(Boolean),x=[u].filter(Boolean),W=t?.loginMethods?.includes("passkey")??!1,B=e.passkeys_for_signup_enabled??!1,S=[d&&(B||W)].filter(Boolean);if(A.length+M.length+x.length+S.length===0)throw Error("You must enable at least one login method");let D=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.show_wallet_login_first;D&&0===x.length?(E("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),D=!1):D||M.length+A.length!==0||(E("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),D=!0);let H=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&E("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let L=Y({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder});if((L.includes("wallet_connect_qr")||L.includes("wallet_connect"))&&L.includes("wallet_connect_qr_solana"))throw Error("wallet_connect_qr and wallet_connect_qr_solana cannot both be present in walletList due to WalletConnect session conflicts.");let O=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],n=[];for(let n of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(n)?console.warn(`Duplicated login method: ${n}`):t.push(n);for(let a of e.overflow??[])t.includes(a)||n.includes(a)?console.warn(`Duplicated login method: ${a}`):n.push(a);return{primary:t,overflow:n}})({input:t?.loginMethodsAndOrder}),I=t?.intl?.defaultCountry??"US",{chains:U,defaultChain:P}=function({supportedChains:e,defaultChainFromConfig:t}){let n;if(e){if(0===e.length)throw Error("`supportedChains` must contain at least one chain");n=l(e)}else n=[...i];let a=e?n[0]:c,o=t??a;if(!n.find((e=>e.id===o.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:o}}({supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain}),q=!!t?.defaultChain,T=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,j=T?"all-users":e.embedded_wallet_config.ethereum.create_on_login,$=e.embedded_wallet_config.solana.create_on_login;e.solana_wallet_auth&&!t?.externalWallets?.solana?.connectors&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`");let z=e.telegram_auth_config?{botId:e.telegram_auth_config.bot_id,botName:e.telegram_auth_config.bot_name,linkEnabled:e.telegram_auth_config.link_enabled,seamlessAuthEnabled:e.telegram_auth_config.seamless_auth_enabled}:void 0,N=e.funding_config?{methods:e.funding_config.methods,options:e.funding_config.options,defaultRecommendedAmount:e.funding_config.default_recommended_amount,defaultRecommendedCurrency:e.funding_config.default_recommended_currency,promptFundingOnWalletCreation:e.funding_config.prompt_funding_on_wallet_creation,crossChainBridgingEnabled:e.funding_config.cross_chain_bridging_enabled}:void 0;return{id:e.id,appClientId:o,name:e.name,allowlistConfig:{errorTitle:e.allowlist_config.error_title,errorDetail:e.allowlist_config.error_detail,errorCtaText:e.allowlist_config.cta_text,errorCtaLink:e.allowlist_config.cta_link},legacyWalletUiConfig:e.legacy_wallet_ui_config,appearance:{logo:t?.appearance?.logo??e.logo_url??void 0,landingHeader:t?.appearance?.landingHeader??R.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,footerLogo:t?.appearance?.footerLogo,palette:V({backgroundTheme:t?.appearance?.theme??R.appearance.theme,accentHex:t?.appearance?.accentColor??e.accent_color}),loginGroupPriority:D?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:L,walletChainType:t?.appearance?.walletChainType??(({evmWalletAuth:e,solanaWalletAuth:t})=>e&&t?"ethereum-and-solana":e?"ethereum-only":t?"solana-only":"ethereum-only")({evmWalletAuth:e.wallet_auth??!1,solanaWalletAuth:e.solana_wallet_auth??!1})},loginMethods:{wallet:u,email:r,sms:s,passkey:d,google:g,twitter:h,discord:f,github:k,spotify:m,instagram:v,tiktok:p,line:_,twitch:b,linkedin:w,apple:F,farcaster:C,telegram:y},customOAuthProviders:(e.custom_oauth_providers??[]).filter((e=>!1!==e.enabled)),disablePlusEmails:e.disable_plus_emails,loginMethodsAndOrder:O,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.terms_and_conditions_url,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacy_policy_url,requireUsersAcceptTerms:e.require_users_accept_terms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.wallet_connect_cloud_project_id??R.walletConnectCloudProjectId,rpcConfig:{rpcUrls:{},rpcTimeouts:t?.externalWallets?.signatureRequestTimeouts??{}},chains:U,defaultChain:P,intl:{defaultCountry:I,textLocalization:t?.intl?.textLocalization},shouldEnforceDefaultChainOnConnect:q,captchaEnabled:e.captcha_enabled??R.captchaEnabled,captchaSiteKey:e.captcha_site_key,externalWallets:{coinbaseWallet:{config:{appName:e.name,appLogoUrl:e.logo_url,preference:{options:"all",...t?.externalWallets?.coinbaseWallet?.config?.preference},...t?.externalWallets?.coinbaseWallet?.config}},baseAccount:{config:{appName:e.name,appLogoUrl:e.logo_url,...t?.externalWallets?.baseAccount?.config,preference:{...t?.externalWallets?.baseAccount?.config?.preference,telemetry:!1}}},walletConnect:{enabled:H},solana:{connectors:t?.externalWallets?.solana?.connectors},disableAllExternalWallets:t?.externalWallets?.disableAllExternalWallets??!1},embeddedWallets:{requireUserOwnedRecoveryOnCreate:!T&&(e.embedded_wallet_config.require_user_owned_recovery_on_create??!1),userOwnedRecoveryOptions:T?["user-passcode"]:e.embedded_wallet_config.user_owned_recovery_options,priceDisplay:t?.embeddedWallets?.priceDisplay??{primary:"fiat-currency",secondary:"native-token"},ethereum:{createOnLogin:t?.embeddedWallets?.ethereum?.createOnLogin??j},solana:{createOnLogin:t?.embeddedWallets?.solana?.createOnLogin??$},disableAutomaticMigration:t?.embeddedWallets?.disableAutomaticMigration??!1,mode:e.embedded_wallet_config.mode,showWalletUIs:t?.embeddedWallets?.showWalletUIs??e.enforce_wallet_uis??!0,extendedCalldataDecoding:t?.embeddedWallets?.extendedCalldataDecoding??!1,transactionScanning:{enabled:t?.embeddedWallets?.transactionScanning?.enabled??!1,domain:t?.embeddedWallets?.transactionScanning?.domain??a??"https://auth.privy.io"}},mfa:{methods:e.mfa_methods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},passkeys:{shouldUnlinkOnUnenrollMfa:t?.passkeys?.shouldUnlinkOnUnenrollMfa,shouldUnenrollMfaOnUnlink:t?.passkeys?.shouldUnenrollMfaOnUnlink,registration:t?.passkeys?.registration},customAuth:T?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:z,passkeysForSignupEnabled:e.passkeys_for_signup_enabled},headless:!!t?.headless,render:{standalone:t?._render?.standalone??R._render.standalone},fundingConfig:N,fundingMethodConfig:{...t?.fundingMethodConfig??R.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??R.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??R.fundingMethodConfig.moonpay.useSandbox}},whatsAppEnabled:!!e.whatsapp_enabled,customOAuthRedirectUrl:t?.customOAuthRedirectUrl,allowOAuthInEmbeddedBrowsers:t?.allowOAuthInEmbeddedBrowsers??!1,solanaRpcs:{"solana:mainnet":t?.solana?.rpcs?.["solana:mainnet"]??null,"solana:devnet":t?.solana?.rpcs?.["solana:devnet"]??null,"solana:testnet":t?.solana?.rpcs?.["solana:testnet"]??null}}}const ee={show_wallet_login_first:!0,allowlist_config:{error_title:null,error_detail:null,cta_text:null,cta_link:null},wallet_auth:!0,email_auth:!0,sms_auth:!1,google_oauth:!1,twitter_oauth:!1,discord_oauth:!1,github_oauth:!1,linkedin_oauth:!1,apple_oauth:!1,disable_plus_emails:!1,terms_and_conditions_url:null,privacy_policy_url:null,embedded_wallet_config:{create_on_login:"off",ethereum:{create_on_login:"off"},solana:{create_on_login:"off"},require_user_owned_recovery_on_create:!1,user_owned_recovery_options:["user-passcode"],mode:"user-controlled-server-wallets-only"},captcha_enabled:!1,captcha_site_key:"",enforce_wallet_uis:!1,legacy_wallet_ui_config:!1,id:"",name:"",passkeys_for_signup_enabled:!1,whatsapp_enabled:!1};let te=/*#__PURE__*/o({appConfig:Q(ee,void 0,!1),isServerConfigLoaded:!1});const ne=({children:o,client:r,legacyClient:l,clientConfig:i,appClientId:c})=>{let[s,d]=t(null),u=n((()=>Q(s??ee,i,!!s,"undefined"!=typeof window?window.location.origin:void 0,c)),[s,i,c]);return a((()=>{if(!s)return;let e=function(e){if(!e)return{};let{appearance:t,supportedChains:n,defaultChain:a,externalWallets:o,...r}=e;return{...r,...n?{supportedChains:n.map((e=>e.id))}:void 0,...a?{defaultChain:a.id}:void 0,...o?{walletConnect:o.walletConnect?{enabled:o.walletConnect.enabled}:void 0,coinbaseWallet:o.coinbaseWallet,solana:{connectors:o.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0}}(i),t=function(e,t=0){let n=3735928559^t,a=1103547991^t;for(let t,o=0;o<e.length;o++)n=Math.imul(n^(t=e.charCodeAt(o)),2654435761),a=Math.imul(a^t,1597334677);return n=Math.imul(n^n>>>16,2246822507)^Math.imul(a^a>>>13,3266489909),4294967296*(2097151&(a=Math.imul(a^a>>>16,2246822507)^Math.imul(n^n>>>13,3266489909)))+(n>>>0)}(JSON.stringify(e)).toString(),n=`privy:sent:${s.id}:${t}`;localStorage.getItem(n)||(l.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(n,"t"))}),[i,s]),a((()=>{s||(async()=>{try{await r.initialize();let e=r.app.getConfig();e.custom_api_url&&l.updateApiUrl(e.custom_api_url),d(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),/*#__PURE__*/e(te.Provider,{value:{appConfig:u,isServerConfigLoaded:!!s},children:o})},ae=()=>{let{appConfig:e}=r(te);return e},oe=()=>{let{isServerConfigLoaded:e}=r(te);return e},re={login:{onComplete:[],onError:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},connectOrCreateWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},update:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},signTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},fundSolanaWallet:{onUserExited:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},le=/*#__PURE__*/o(void 0);let ie=()=>r(le);function ce(e,t){if(!t)return;let n=ie().current[e];return a((()=>{for(let[a,o]of Object.entries(t))Object.prototype.hasOwnProperty.call(n,a)||console.warn(`Invalid event type "${a}" for action "${e}"`),n[a]?.push(o);return()=>{for(let[a,o]of Object.entries(t))Object.prototype.hasOwnProperty.call(n,a)||console.warn(`Invalid event type "${a}" for action "${e}"`),n[a]=n[a]?.filter((e=>e!==o))}}),[t])}function se(e,t,n,...a){for(let o of e.current[t][n])o(...a)}function de(){let e=ie();return(t,n,...a)=>se(e,t,n,...a)}export{U as A,T as B,x as C,j as D,q as E,W as H,k as I,P as M,B as O,w as P,m as R,M as S,p as V,I as W,_ as a,A as b,C as c,b as d,v as e,F as f,E as g,d as h,u as i,y as j,ae as k,D as l,oe as m,de as n,g as o,h as p,ne as q,re as r,se as s,le as t,ce as u,f as v,H as w,S as x,O as y,L as z};
1
+ import{jsx as e}from"react/jsx-runtime";import{useState as t,useMemo as n,useEffect as a,createContext as o,useContext as l}from"react";import{dedupeSupportedChains as r,DEFAULT_SUPPORTED_CHAINS as i,mainnet as c}from"@privy-io/js-sdk-core";import s from"tinycolor2";const d="https://auth.privy.io",u=2e4,g=1400,h=2500,f=4e3,p="3.8.0",_="privy:token",b="privy-token",m="privy:refresh_token",v="privy-refresh-token",w="privy:pat",k="privy:id_token",F="privy-id-token",C="privy-session",y="privy:caid",M=e=>`privy:guest:${e}`,E=e=>`privy:cross-app:${e}`,A="privy:state_code",x="privy:code_verifier",B="privy:headless_oauth",D="privy:oauth_disable_signup",W=e=>`privy:wallet:${e}`,S="privy:connections",H=12e4,L=1,I="0x1",O=3e4,U="https://api.moonpay.com/v1",q="https://api.moonpay.com/v1",P="pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL",j="pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI",R="deprecated",T={appearance:{landingHeader:"Log in or sign up",theme:"light",walletList:["detected_ethereum_wallets","detected_solana_wallets","metamask","coinbase_wallet","rainbow","base_account","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}};let N=new Set(["coinbase_wallet","base_account","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","universal_profile","bybit_wallet","ronin_wallet","haha_wallet","wallet_connect","wallet_connect_qr","wallet_connect_qr_solana","detected_solana_wallets","detected_ethereum_wallets","rabby_wallet","safe","solflare","backpack","binance","binanceus","bitget_wallet"]),$=e=>N.has(e),z=(e,t,n)=>n.indexOf(e)===t;const Y=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter($).filter(z):e?e.filter($).filter(z):T.appearance.walletList;function J(e,t){let n=Math.max(0,Math.min(1,e.toHsl().l+t));return s({...e.toHsl(),l:n})}function G(e,t){let n=e.getLuminance(),a=t.getLuminance();return(Math.max(n,a)+.05)/(Math.min(n,a)+.05)}function K(e,t){if(!e){let e=t?X:Z;return{accent:s(e.background.interactive),accentLight:s(e.background.interactive),accentHover:s(e.background["interactive-hover"]),accentDark:s(e.background["interactive-clicked"]),accentDarkest:s(e.background["interactive-disabled"])}}let n=s(e);return{accent:n,accentLight:J(n,.15),accentHover:J(n,.3),accentDark:J(n,-.06),accentDarkest:J(n,-.6)}}function V({backgroundTheme:e,accentHex:t}){let n,a;"light"===e?n=!1:"dark"===e?n=!0:(n=.5>=s(e).getLuminance(),a=s(e).toHslString());let o=n?"dark":"light",l=n?X:Z,{accent:r,accentLight:i,accentHover:c,accentDark:d,accentDarkest:u}=K(t,n),g=function(e){let t=s(Z.text.default),n=s(X.text.default),a=G(e,t),o=G(e,n),l=e.toHsl();return l.h>=220&&l.h<=300&&o>=3?X.text.default:a>o?Z.text.default:X.text.default}(r),h=s(g),f=G(r,s(l.background.default))>=3;return{colorScheme:o,background:a||l.background.default,background2:l.background.elevated,background3:l.background.interactive,foreground:l.text.default,foreground2:l.text.muted,foreground3:l.text.placeholder,foreground4:l.border.default,accent:r.toHslString(),accentLight:i.toHslString(),accentHover:c.toHslString(),accentDark:d.toHslString(),accentDarkest:u.toHslString(),foregroundAccent:h.toHslString(),success:l.background.success,successDark:l.text.success,successLight:l.background.success,error:l.text.error,errorLight:l.background.error,warn:l.background.warning,warnLight:l.background.warning,warningDark:l.text.warning,errorDark:l.text.error,successBg:l.background.success,errorBg:l.background.error,errorBgHover:l.background["error-hover"],warnBg:l.background.warning,infoBg:l.background.info,infoBgHover:l.background["info-hover"],borderDefault:l.border.default,borderHover:l.border["default-hover"],borderFocus:l.border.focused,borderError:l.border.error,borderSuccess:l.border.success,borderWarning:l.border.warning,borderInfo:l.border.info,borderInteractive:l.border.interactive,borderInteractiveHover:l.border["interactive-hover"],backgroundHover:l.background["default-hover"],backgroundClicked:l.background["default-clicked"],backgroundDisabled:l.background["default-disabled"],backgroundInteractive:l.background.interactive,backgroundInteractiveHover:l.background["interactive-hover"],backgroundInteractiveClicked:l.background["interactive-clicked"],backgroundInteractiveDisabled:l.background["interactive-disabled"],foregroundHover:l.text.default,foregroundClicked:l.text.default,foregroundDisabled:l.text["default-disabled"],foregroundInteractive:l.text.interactive,foregroundInteractiveHover:l.text["interactive-hover"],accentHasGoodContrast:f?"1":"0",linkNavigationColor:f?r.toHslString():l.text.default,linkNavigationDecoration:f?"none":"underline",iconDefault:l.icon.default,iconMuted:l.icon.muted,iconSubtle:l.icon.subtle,iconInverse:l.icon.inverse,iconSuccess:l.icon.success,iconWarning:l.icon.warning,iconError:l.icon.error,iconInteractive:l.icon.interactive,iconDefaultHover:l.icon["default-hover"],iconMutedHover:l.icon["muted-hover"],iconSubtleHover:l.icon["subtle-hover"],iconDefaultClicked:l.icon["default-clicked"],iconMutedClicked:l.icon["muted-clicked"],iconSubtleClicked:l.icon["subtle-clicked"],iconDefaultDisabled:l.icon["default-disabled"],iconMutedDisabled:l.icon["muted-disabled"],iconSubtleDisabled:l.icon["subtle-disabled"],iconErrorHover:l.icon["error-hover"],iconInteractiveHover:l.icon["interactive-hover"],iconErrorClicked:l.icon["error-clicked"],iconInteractiveClicked:l.icon["interactive-clicked"],iconMutedDisabledAlt:l.icon["muted-disabled"],iconSubtleDisabledAlt:l.icon["subtle-disabled"]}}const X={background:{default:"#020713",elevated:"#1A2230","default-hover":"#101724","default-clicked":"#1A2230","default-disabled":"#020713",success:"#0E3E2D",warning:"#373827",error:"#2E0C18",interactive:"#8B86FF","error-hover":"#441821","interactive-hover":"#7B73E5","interactive-clicked":"#6560CC","interactive-disabled":"#141824",info:"#1F2937","info-hover":"#141824"},icon:{default:"#F8F8F8",muted:"#9BA2AE",subtle:"#7B8491",inverse:"#020713",success:"#88E3B5",warning:"#FDF27B",error:"#EF4444",interactive:"#88B6FF","default-hover":"#F8F8F8","muted-hover":"#AEB3BD","subtle-hover":"#8B939E","default-clicked":"#F8F8F8","muted-clicked":"#9097A5","subtle-clicked":"#78818E","default-disabled":"#404452","muted-disabled":"#404452","subtle-disabled":"#404452","error-hover":"#F05555","interactive-hover":"#7B73E5","error-clicked":"#EF4444","interactive-clicked":"#6560CC"},text:{default:"#F8F8F8",muted:"#9BA2AE",placeholder:"#7B8491",success:"#ACEECB",warning:"#FEF9A0",error:"#FCA5A5",interactive:"#A29EFF","default-disabled":"#404452","interactive-hover":"#8C88E5"},border:{default:"#1F2937",interactive:"#88B0FF",focused:"#F8F8FC",info:"#5B83D3",success:"#317056",warning:"#FBBF24",error:"#F87171","default-hover":"#34304A","interactive-hover":"#88B0FF"}},Z={background:{default:"#FFFFFF",elevated:"#F1F2F9","default-hover":"#F8F9FC","default-clicked":"#F1F2F9","default-disabled":"#FFFFFF",success:"#DCFCE7",warning:"#FEF3C7",error:"#FEE2E2",interactive:"#5B4FFF","error-hover":"#FECACA","interactive-hover":"#4F46E5","interactive-clicked":"#4338CA","interactive-disabled":"#F1F2F9",info:"#E0E7FF","info-hover":"#EEF2FF"},icon:{default:"#110F2A",muted:"#64668B",subtle:"#9498B8",inverse:"#FFFFFF",success:"#33B287",warning:"#F59E0B",error:"#EF4444",interactive:"#564FFF","default-hover":"#1D1B35","muted-hover":"#64668B","subtle-hover":"#888AAE","default-clicked":"#060C23","muted-clicked":"#64668B","subtle-clicked":"#788804","default-disabled":"#CBCDE1","muted-disabled":"#CBCDE1","subtle-disabled":"#CBCDE1","error-hover":"#F06060","interactive-hover":"#4F46E5","error-clicked":"#DC3838","interactive-clicked":"#2BA482"},text:{default:"#040217",muted:"#64668B",placeholder:"#9498B8",success:"#135638",warning:"#906218",error:"#991B1B",interactive:"#5B4FFF","default-disabled":"#CBCDE1","interactive-hover":"#5B4FFF"},border:{default:"#E2E3F0",interactive:"#5B4FFF",focused:"#949DF9",info:"#F1F2F9",success:"#87D7B7",warning:"#FACD63",error:"#F69393","default-hover":"#E2E3F0","interactive-hover":"#5B4FFF"}};function Q(e,t,n,a,o){let l,s,d,u,g,h,f,p,_,b,m,v,w,k,F,C,y,M=n?console.warn:()=>{};t?.loginMethods?(l=t.loginMethods.includes("email"),s=t.loginMethods.includes("sms"),u=t.loginMethods.includes("wallet"),g=t.loginMethods.includes("google"),h=t.loginMethods.includes("twitter"),f=t.loginMethods.includes("discord"),m=t.loginMethods.includes("spotify"),v=t.loginMethods.includes("instagram"),p=t.loginMethods.includes("tiktok"),_=t.loginMethods.includes("line"),b=t.loginMethods.includes("twitch"),k=t.loginMethods.includes("github"),w=t.loginMethods.includes("linkedin"),F=t.loginMethods.includes("apple"),C=t.loginMethods.includes("farcaster"),y=t.loginMethods.includes("telegram"),d=t.loginMethods.includes("passkey")):(l=e.email_auth,s=e.sms_auth,u=e.wallet_auth||e.solana_wallet_auth,g=e.google_oauth,h=e.twitter_oauth,f=e.discord_oauth,k=e.github_oauth,m=e.spotify_oauth,v=e.instagram_oauth,p=e.tiktok_oauth,_=e.line_oauth,b=e.twitch_oauth,w=e.linkedin_oauth,F=e.apple_oauth,C=e.farcaster_auth,y=e.telegram_auth,d=e.passkey_auth),e.passkey_auth&&(d=!0),"undefined"!=typeof window&&"function"!=typeof window.PublicKeyCredential&&(d=!1);let E=[l,s].filter(Boolean),A=[g,h,f,k,m,v,p,_,w,F,C,y].filter(Boolean),x=[u].filter(Boolean),B=t?.loginMethods?.includes("passkey")??!1,D=e.passkeys_for_signup_enabled??!1,W=[d&&(D||B)].filter(Boolean);if(E.length+A.length+x.length+W.length===0)throw Error("You must enable at least one login method");let S=void 0!==t?.appearance?.showWalletLoginFirst?t?.appearance?.showWalletLoginFirst:e.show_wallet_login_first;S&&0===x.length?(M("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),S=!1):S||A.length+E.length!==0||(M("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),S=!0);let H=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&M("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let L=Y({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder});if((L.includes("wallet_connect_qr")||L.includes("wallet_connect"))&&L.includes("wallet_connect_qr_solana"))throw Error("wallet_connect_qr and wallet_connect_qr_solana cannot both be present in walletList due to WalletConnect session conflicts.");let I=(({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],n=[];for(let n of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(n)?console.warn(`Duplicated login method: ${n}`):t.push(n);for(let a of e.overflow??[])t.includes(a)||n.includes(a)?console.warn(`Duplicated login method: ${a}`):n.push(a);return{primary:t,overflow:n}})({input:t?.loginMethodsAndOrder}),O=t?.intl?.defaultCountry??"US",{chains:U,defaultChain:q}=function({supportedChains:e,defaultChainFromConfig:t}){let n;if(e){if(0===e.length)throw Error("`supportedChains` must contain at least one chain");n=r(e)}else n=[...i];let a=e?n[0]:c,o=t??a;if(!n.find((e=>e.id===o.id)))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:n,defaultChain:o}}({supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain}),P=!!t?.defaultChain,j=t?.customAuth?.getCustomAccessToken&&!1!==t?.customAuth?.enabled,R=j?"all-users":e.embedded_wallet_config.ethereum.create_on_login,N=e.embedded_wallet_config.solana.create_on_login;e.solana_wallet_auth&&!t?.externalWallets?.solana?.connectors&&console.warn("App configuration has Solana wallet login enabled, but no Solana wallet connectors have been passed to Privy. Make sure to pass Solana connectors to the `config.externalWallets.solana.connectors` field of the `PrivyProvider`");let $=e.telegram_auth_config?{botId:e.telegram_auth_config.bot_id,botName:e.telegram_auth_config.bot_name,linkEnabled:e.telegram_auth_config.link_enabled,seamlessAuthEnabled:e.telegram_auth_config.seamless_auth_enabled}:void 0,z=e.funding_config?{methods:e.funding_config.methods,options:e.funding_config.options,defaultRecommendedAmount:e.funding_config.default_recommended_amount,defaultRecommendedCurrency:e.funding_config.default_recommended_currency,promptFundingOnWalletCreation:e.funding_config.prompt_funding_on_wallet_creation,crossChainBridgingEnabled:e.funding_config.cross_chain_bridging_enabled}:void 0;return{id:e.id,appClientId:o,name:e.name,allowlistConfig:{errorTitle:e.allowlist_config.error_title,errorDetail:e.allowlist_config.error_detail,errorCtaText:e.allowlist_config.cta_text,errorCtaLink:e.allowlist_config.cta_link},legacyWalletUiConfig:e.legacy_wallet_ui_config,appearance:{logo:t?.appearance?.logo??e.logo_url??void 0,landingHeader:t?.appearance?.landingHeader??T.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,footerLogo:t?.appearance?.footerLogo,palette:V({backgroundTheme:t?.appearance?.theme??T.appearance.theme,accentHex:t?.appearance?.accentColor??e.accent_color}),loginGroupPriority:S?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:L,walletChainType:t?.appearance?.walletChainType??(({evmWalletAuth:e,solanaWalletAuth:t})=>e&&t?"ethereum-and-solana":e?"ethereum-only":t?"solana-only":"ethereum-only")({evmWalletAuth:e.wallet_auth??!1,solanaWalletAuth:e.solana_wallet_auth??!1})},loginMethods:{wallet:u,email:l,sms:s,passkey:d,google:g,twitter:h,discord:f,github:k,spotify:m,instagram:v,tiktok:p,line:_,twitch:b,linkedin:w,apple:F,farcaster:C,telegram:y},customOAuthProviders:(e.custom_oauth_providers??[]).filter((e=>!1!==e.enabled)),disablePlusEmails:e.disable_plus_emails,loginMethodsAndOrder:I,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.terms_and_conditions_url,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacy_policy_url,requireUsersAcceptTerms:e.require_users_accept_terms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.wallet_connect_cloud_project_id??T.walletConnectCloudProjectId,rpcConfig:{rpcUrls:{},rpcTimeouts:t?.externalWallets?.signatureRequestTimeouts??{}},chains:U,defaultChain:q,intl:{defaultCountry:O,textLocalization:t?.intl?.textLocalization},shouldEnforceDefaultChainOnConnect:P,captchaEnabled:e.captcha_enabled??T.captchaEnabled,captchaSiteKey:e.captcha_site_key,externalWallets:{coinbaseWallet:{config:{appName:e.name,appLogoUrl:e.logo_url,preference:{options:"all",...t?.externalWallets?.coinbaseWallet?.config?.preference},...t?.externalWallets?.coinbaseWallet?.config}},baseAccount:{config:{appName:e.name,appLogoUrl:e.logo_url,...t?.externalWallets?.baseAccount?.config,preference:{...t?.externalWallets?.baseAccount?.config?.preference,telemetry:!1}}},walletConnect:{enabled:H},solana:{connectors:t?.externalWallets?.solana?.connectors},disableAllExternalWallets:t?.externalWallets?.disableAllExternalWallets??!1},embeddedWallets:{requireUserOwnedRecoveryOnCreate:!j&&(e.embedded_wallet_config.require_user_owned_recovery_on_create??!1),userOwnedRecoveryOptions:j?["user-passcode"]:e.embedded_wallet_config.user_owned_recovery_options,priceDisplay:t?.embeddedWallets?.priceDisplay??{primary:"fiat-currency",secondary:"native-token"},ethereum:{createOnLogin:t?.embeddedWallets?.ethereum?.createOnLogin??R},solana:{createOnLogin:t?.embeddedWallets?.solana?.createOnLogin??N},disableAutomaticMigration:t?.embeddedWallets?.disableAutomaticMigration??!1,mode:e.embedded_wallet_config.mode,showWalletUIs:t?.embeddedWallets?.showWalletUIs??e.enforce_wallet_uis??!0,extendedCalldataDecoding:t?.embeddedWallets?.extendedCalldataDecoding??!1,transactionScanning:{enabled:t?.embeddedWallets?.transactionScanning?.enabled??!1,domain:t?.embeddedWallets?.transactionScanning?.domain??a??"https://auth.privy.io"}},mfa:{methods:e.mfa_methods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},passkeys:{shouldUnlinkOnUnenrollMfa:t?.passkeys?.shouldUnlinkOnUnenrollMfa,shouldUnenrollMfaOnUnlink:t?.passkeys?.shouldUnenrollMfaOnUnlink,registration:t?.passkeys?.registration},customAuth:j?{enabled:!0,...t.customAuth}:void 0,loginConfig:{telegramAuthConfiguration:$,passkeysForSignupEnabled:e.passkeys_for_signup_enabled},headless:!!t?.headless,render:{standalone:t?._render?.standalone??T._render.standalone},fundingConfig:z,fundingMethodConfig:{...t?.fundingMethodConfig??T.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??T.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??T.fundingMethodConfig.moonpay.useSandbox}},whatsAppEnabled:!!e.whatsapp_enabled,customOAuthRedirectUrl:t?.customOAuthRedirectUrl,allowOAuthInEmbeddedBrowsers:t?.allowOAuthInEmbeddedBrowsers??!1,solanaRpcs:{"solana:mainnet":t?.solana?.rpcs?.["solana:mainnet"]??null,"solana:devnet":t?.solana?.rpcs?.["solana:devnet"]??null,"solana:testnet":t?.solana?.rpcs?.["solana:testnet"]??null}}}const ee={show_wallet_login_first:!0,allowlist_config:{error_title:null,error_detail:null,cta_text:null,cta_link:null},wallet_auth:!0,email_auth:!0,sms_auth:!1,google_oauth:!1,twitter_oauth:!1,discord_oauth:!1,github_oauth:!1,linkedin_oauth:!1,apple_oauth:!1,disable_plus_emails:!1,terms_and_conditions_url:null,privacy_policy_url:null,embedded_wallet_config:{create_on_login:"off",ethereum:{create_on_login:"off"},solana:{create_on_login:"off"},require_user_owned_recovery_on_create:!1,user_owned_recovery_options:["user-passcode"],mode:"user-controlled-server-wallets-only"},captcha_enabled:!1,captcha_site_key:"",enforce_wallet_uis:!1,legacy_wallet_ui_config:!1,id:"",name:"",passkeys_for_signup_enabled:!1,whatsapp_enabled:!1};let te=/*#__PURE__*/o({appConfig:Q(ee,void 0,!1),isServerConfigLoaded:!1});const ne=({children:o,client:l,legacyClient:r,clientConfig:i,appClientId:c})=>{let[s,d]=t(null),u=n((()=>Q(s??ee,i,!!s,"undefined"!=typeof window?window.location.origin:void 0,c)),[s,i,c]);return a((()=>{if(!s)return;let e=function(e){if(!e)return{};let{appearance:t,supportedChains:n,defaultChain:a,externalWallets:o,...l}=e;return{...l,...n?{supportedChains:n.map((e=>e.id))}:void 0,...a?{defaultChain:a.id}:void 0,...o?{walletConnect:o.walletConnect?{enabled:o.walletConnect.enabled}:void 0,coinbaseWallet:o.coinbaseWallet,solana:{connectors:o.solana?.connectors?.get().map((e=>e.walletClientType))}}:void 0}}(i),t=function(e,t=0){let n=3735928559^t,a=1103547991^t;for(let t,o=0;o<e.length;o++)n=Math.imul(n^(t=e.charCodeAt(o)),2654435761),a=Math.imul(a^t,1597334677);return n=Math.imul(n^n>>>16,2246822507)^Math.imul(a^a>>>13,3266489909),4294967296*(2097151&(a=Math.imul(a^a>>>16,2246822507)^Math.imul(n^n>>>13,3266489909)))+(n>>>0)}(JSON.stringify(e)).toString(),n=`privy:sent:${s.id}:${t}`;localStorage.getItem(n)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(n,"t"))}),[i,s]),a((()=>{s||(async()=>{try{await l.initialize();let e=l.app.getConfig();e.custom_api_url&&r.updateApiUrl(e.custom_api_url),d(e)}catch(e){console.warn("Error generating app config: ",e)}})()}),[]),/*#__PURE__*/e(te.Provider,{value:{appConfig:u,isServerConfigLoaded:!!s},children:o})},ae=()=>{let{appConfig:e}=l(te);return e},oe=()=>{let{isServerConfigLoaded:e}=l(te);return e};export{_ as C,d as D,B as H,k as I,q as M,D as O,w as P,m as R,A as S,p as V,O as W,x as a,S as b,oe as c,y as d,E as e,C as f,M as g,R as h,b as i,v as j,F as k,u as l,ne as m,H as n,W as o,I as p,g as q,h as r,L as s,f as t,ae as u,U as v,j as w,P as x};
@@ -0,0 +1 @@
1
+ import{jsx as h}from"react/jsx-runtime";const c=({color:c,...v})=>/*#__PURE__*/h("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...v,children:/*#__PURE__*/h("g",{children:/*#__PURE__*/h("path",{fill:c||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})});export{c as C};
@@ -0,0 +1 @@
1
+ import{formatEther as e}from"viem";import{u as r}from"./internal-context-Cvo1WmWN.mjs";import{a5 as t}from"./useActiveWallet-hrZcON-K.mjs";let a=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),s=e=>a.format(e);const n=(e,r)=>{let t=s(r*parseFloat(e));return"$0.00"!==t?t:"<$0.01"},o=(r,t)=>{let a=s(t*parseFloat(e(r)));return"$0.00"===a?"<$0.01":a},c=(e,r,t=6,a=!1)=>`${i(e,t,a)} ${r}`,i=(r,t=6,a=!1)=>{let s=parseFloat(e(r)).toFixed(t).replace(/0+$/,"").replace(/\.$/,"");return a?s:`${"0"===s?"<0.001":s}`},l=e=>e.reduce(((e,r)=>e+r),0n),m=(e,a)=>{let{chains:s}=r(),n=`https://etherscan.io/address/${a}`,o=`${t(e,s)}/address/${a}`;if(!o)return n;try{new URL(o)}catch{return n}return o};export{o as a,m as b,n as c,c as g,i as p,l as s};
@@ -0,0 +1 @@
1
+ import{createContext as o,useContext as e,useEffect as n}from"react";const r={login:{onComplete:[],onError:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},connectOrCreateWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},update:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},signTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]},fundSolanaWallet:{onUserExited:[]},customAuth:{onAuthenticated:[],onUnauthenticated:[]}},t=/*#__PURE__*/o(void 0);let c=()=>e(t);function s(o,e){if(!e)return;let r=c().current[o];return n((()=>{for(let[n,t]of Object.entries(e))Object.prototype.hasOwnProperty.call(r,n)||console.warn(`Invalid event type "${n}" for action "${o}"`),r[n]?.push(t);return()=>{for(let[n,t]of Object.entries(e))Object.prototype.hasOwnProperty.call(r,n)||console.warn(`Invalid event type "${n}" for action "${o}"`),r[n]=r[n]?.filter((o=>o!==t))}}),[e])}function a(o,e,n,...r){for(let t of o.current[e][n])t(...r)}function u(){let o=c();return(e,n,...r)=>a(o,e,n,...r)}export{t as P,u as a,a as e,r as p,s as u};